/* ============================
   Спорт Команды - Styles
   ============================ */

:root {
    --primary: #c3eff8;
    --primary-light: #d9f6ff;
    --primary-dark: #7fbecd;
    --primary-rgb: 195, 239, 248;
    --primary-gradient: linear-gradient(135deg, #7fbecd, #c3eff8);
    --primary-gradient-2: linear-gradient(135deg, #0b1220, #101b2a, #162235);
    --bg: #0b0f1a;
    --bg-rgb: 11, 15, 26;
    --card-bg: #111827;
    --card-bg-rgb: 17, 24, 39;
    --text: #e5e7eb;
    --text-muted: #9ca3af;
    --border: rgba(195, 239, 248, 0.12);
    --shadow: 0 2px 12px rgba(0,0,0,0.45);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.6);
    --on-primary: #0b0f1a;
    --radius: 16px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --nav-height: 70px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

:root[data-theme="light"] {
    --primary: #a3d8e7;
    --primary-light: #c1e6f0;
    --primary-dark: #76b9c9;
    --primary-rgb: 163, 216, 231;
    --bg: #f5f7fb;
    --bg-rgb: 245, 247, 251;
    --card-bg: #ffffff;
    --card-bg-rgb: 255, 255, 255;
    --text: #111827;
    --text-muted: #4b5563;
    --border: rgba(17, 24, 39, 0.12);
    --shadow: 0 2px 12px rgba(17, 24, 39, 0.08);
    --shadow-lg: 0 10px 30px rgba(17, 24, 39, 0.14);
    --on-primary: #0b0f1a;
    --primary-gradient: linear-gradient(135deg, #76b9c9, #a3d8e7);
    --primary-gradient-2: linear-gradient(135deg, #76b9c9, #a3d8e7);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    min-height: 100vh;
}

a { text-decoration: none; color: var(--primary); }

/* ---- Animations ---- */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.95); }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.animate__fadeInDown { animation: fadeInDown 0.4s ease; }
.animate__fadeInUp { animation: fadeInUp 0.4s ease both; }
.animate__zoomIn { animation: zoomIn 0.5s ease; }
.animate__bounceIn { animation: bounceIn 0.6s ease; }
.animate__fadeIn { animation: fadeInDown 0.5s ease; }

/* ---- Flash Messages ---- */
.flash-container {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: 90%;
    max-width: 400px;
}

.flash-message {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(20px);
    animation: fadeInDown 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.flash-success { background: rgba(195, 239, 248, 0.2); color: var(--text); }
.flash-danger { background: rgba(220, 53, 69, 0.95); color: #fff; }
.flash-warning { background: rgba(255, 193, 7, 0.95); color: #333; }
.flash-info { background: rgba(13, 110, 253, 0.95); color: #fff; }

.flash-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 20px;
    cursor: pointer;
    margin-left: auto;
    opacity: 0.7;
}

/* ---- Error Page ---- */
.error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    padding: 20px;
}

.error-code {
    font-size: 80px;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.error-text { font-size: 18px; color: var(--text-muted); }

/* ---- Auth Pages ---- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--primary-gradient-2);
    position: relative;
    overflow: hidden;
}

.auth-container {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 40px 28px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    position: relative;
    z-index: 2;
}

.auth-logo { text-align: center; margin-bottom: 32px; }

.logo-icon {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 32px;
    color: var(--on-primary);
    box-shadow: 0 8px 24px rgba(195, 239, 248, 0.35);
    animation: float 3s ease-in-out infinite;
}

.auth-title {
    font-size: 24px;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-subtitle { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

.auth-form { display: flex; flex-direction: column; gap: 14px; }

.input-group-custom {
    display: flex;
    align-items: center;
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 0 16px;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.input-group-custom:focus-within {
    border-color: var(--primary);
    background: var(--card-bg);
    box-shadow: 0 0 0 4px rgba(195, 239, 248, 0.2);
}

.input-group-custom i { color: var(--text-muted); font-size: 18px; margin-right: 10px; }
.input-group-custom:focus-within i { color: var(--primary); }

.input-group-custom .form-control {
    border: none;
    background: transparent;
    color: var(--text);
    padding: 14px 0;
    font-family: 'Inter';
    font-size: 15px;
    box-shadow: none !important;
}

.form-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
    padding-left: 4px;
}

.btn-gradient {
    background: var(--primary-gradient);
    border: none;
    color: var(--on-primary);
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
    box-shadow: 0 4px 16px rgba(195, 239, 248, 0.35);
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(195, 239, 248, 0.45);
    color: var(--on-primary);
}

.btn-gradient:active { transform: translateY(0); }

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-muted);
}

.auth-footer a { color: var(--primary); font-weight: 600; }

.auth-decoration {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
}

.circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    background: rgba(195, 239, 248, 0.2);
}

.c1 { width: 300px; height: 300px; top: -100px; right: -80px; }
.c2 { width: 200px; height: 200px; bottom: -50px; left: -60px; }
.c3 { width: 150px; height: 150px; top: 40%; left: 60%; }

/* ---- Club Select ---- */
.club-select-page {
    min-height: 100vh;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.club-select-header { text-align: center; margin-bottom: 32px; }

.logo-icon-sm {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 24px;
    color: var(--on-primary);
}

.clubs-list { width: 100%; max-width: 400px; }

.club-card { margin-bottom: 12px; }

.club-card-btn {
    width: 100%;
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
}

.club-card-btn:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.club-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--on-primary);
    font-size: 22px;
    flex-shrink: 0;
}

.club-info h4 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }

.club-card-btn > i { margin-left: auto; color: var(--text-muted); }

/* ---- Bottom Navigation ---- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(11, 15, 26, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    padding-bottom: calc(8px + var(--safe-bottom));
    border-top: 1px solid var(--border);
    z-index: 1000;
    height: var(--nav-height);
}

.bottom-nav.admin-nav { background: rgba(17, 24, 39, 0.95); }

:root[data-theme="light"] .bottom-nav,
:root[data-theme="light"] .bottom-nav.admin-nav {
    background: rgba(255, 255, 255, 0.95);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    transition: all 0.3s;
    text-decoration: none;
    position: relative;
}

.nav-item i { font-size: 22px; }

.nav-item.active {
    color: var(--primary);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: 0 0 3px 3px;
}

/* ---- App Container ---- */
.app-container {
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
}

.page-content {
    padding: 0 16px;
    padding-bottom: calc(var(--nav-height) + 20px);
}

.bottom-spacer { height: 20px; }

/* ---- Page Header Bar ---- */
.page-header-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 100;
}

.page-header-bar h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.back-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    color: var(--text);
    font-size: 18px;
    transition: all 0.2s;
}

.back-btn:hover { transform: scale(1.05); color: var(--primary); }

/* ---- Home Header ---- */
.home-header {
    position: relative;
    margin: 0 -16px;
    padding: 28px 24px 24px;
    overflow: hidden;
}

.header-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--primary-gradient);
    border-radius: 0 0 28px 28px;
}

.header-content { position: relative; z-index: 1; color: var(--on-primary); }

.header-greeting { font-size: 14px; opacity: 0.85; margin-bottom: 4px; }
.header-name { font-size: 24px; font-weight: 700; }

.avatar-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(195, 239, 248, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: var(--on-primary);
    text-decoration: none;
    border: 2px solid rgba(195, 239, 248, 0.4);
}

.balance-card {
    background: rgba(195, 239, 248, 0.15);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    backdrop-filter: blur(10px);
}

.balance-label { font-size: 12px; opacity: 0.8; }
.balance-amount { font-size: 28px; font-weight: 800; }

/* ---- Club Badge ---- */
.club-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 20px;
    background: var(--card-bg);
    box-shadow: var(--shadow);
    font-size: 13px;
    font-weight: 500;
    color: var(--primary);
    margin-top: 16px;
}

/* ---- Promo Banner ---- */
.promo-banner {
    background: var(--primary-gradient);
    border-radius: var(--radius);
    padding: 24px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--on-primary);
    overflow: hidden;
    position: relative;
}

.promo-content { flex: 1; }
.promo-content h4 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.promo-content p { font-size: 13px; opacity: 0.9; margin-bottom: 12px; }

.promo-decoration {
    font-size: 60px;
    opacity: 0.2;
    animation: float 3s ease-in-out infinite;
}

/* ---- Section Title ---- */
.section-title {
    font-size: 16px;
    font-weight: 700;
    margin: 20px 0 12px;
    color: var(--text);
}

/* ---- Quick Actions ---- */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.quick-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 8px;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text);
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s;
}

.quick-action-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    color: var(--text);
}

.qa-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.qa-green { background: rgba(195, 239, 248, 0.12); color: var(--primary); }
.qa-blue { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.qa-purple { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.qa-orange { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }

/* ---- Cards Scroll ---- */
.cards-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.cards-scroll::-webkit-scrollbar { display: none; }

/* ---- Abonement Card ---- */
.abon-card {
    min-width: 200px;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    padding: 16px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
    flex-shrink: 0;
}

.abon-card.expired { border-left-color: #dc3545; opacity: 0.7; }
.abon-name { font-weight: 600; font-size: 14px; margin-bottom: 8px; }

.abon-detail {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

.abon-detail i { color: var(--primary); }

/* ---- Training Cards ---- */
.trainings-list { display: flex; flex-direction: column; gap: 10px; }

.training-card {
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    position: relative;
}

.training-card:hover { box-shadow: var(--shadow-lg); }

.training-card.mini { padding: 12px; }

.time-badge {
    background: var(--primary-gradient);
    color: var(--on-primary);
    padding: 6px 12px;
    border-radius: var(--radius-xs);
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
}

.time-badge-sm {
    background: var(--primary-gradient);
    color: var(--on-primary);
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
}

.training-info h5, .training-info h6 { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.training-info p, .training-info small { font-size: 12px; color: var(--text-muted); margin: 0; }
.training-info .trainer { color: var(--primary); }

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state i { font-size: 48px; display: block; margin-bottom: 12px; opacity: 0.3; }

.empty-state-sm {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 14px;
}

.empty-state-sm i { font-size: 20px; }

/* ---- Calendar ---- */
.month-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
}

.month-name {
    font-size: 18px;
    font-weight: 700;
}

.month-nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    color: var(--text);
    transition: all 0.2s;
}

.month-nav-btn:hover { color: var(--primary); transform: scale(1.05); }

.calendar-container {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    margin-top: 8px;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.cal-header-cell {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 8px 0;
}

.calendar-body { display: flex; flex-direction: column; gap: 4px; }

.calendar-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    min-height: 44px;
}

.cal-day.empty { cursor: default; }
.cal-day:not(.empty):hover { background: rgba(195, 239, 248, 0.08); }

.cal-day.today {
    background: var(--primary-gradient);
    color: var(--on-primary);
}

.cal-day.today .day-number { color: var(--on-primary); font-weight: 700; }

.cal-day.has-training { font-weight: 600; }

.day-number { font-size: 14px; font-weight: 500; }

.day-dots {
    display: flex;
    gap: 3px;
    margin-top: 2px;
}

.day-dots .dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--primary);
}

.day-dots .dot.enrolled { background: #f59e0b; }
.day-dots .dot.trainer { background: #8b5cf6; }
.day-dots .dot.cancelled { background: #ef4444; }

.day-count {
    position: absolute;
    bottom: 2px;
    font-size: 9px;
    font-weight: 700;
    color: var(--primary);
}

.cal-day.admin.has-training {
    background: rgba(195, 239, 248, 0.1);
    border: 1px solid rgba(195, 239, 248, 0.2);
}

.calendar-legend {
    display: flex;
    gap: 16px;
    padding: 12px 0;
    font-size: 12px;
    color: var(--text-muted);
}

.legend-item { display: flex; align-items: center; gap: 6px; }

.legend-item .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.legend-item .dot.has { background: var(--primary); }
.legend-item .dot.enrolled { background: #f59e0b; }
.legend-item .dot.trainer { background: #8b5cf6; }
.legend-item .dot.cancelled { background: #ef4444; }
.legend-item .dot.today-l { background: var(--primary-gradient); }

/* ---- Schedule Day ---- */
.training-detail-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
}

.tdc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.tdc-time {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
}

.tdc-enrolled {
    font-size: 13px;
    color: var(--text-muted);
}

.tdc-name { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.tdc-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.tdc-trainer { font-size: 13px; color: var(--primary); margin-bottom: 12px; }
.tdc-actions { margin-top: 8px; }

/* ---- Profile ---- */
.profile-header {
    position: relative;
    margin: 0 -16px;
    padding: 40px 24px 30px;
    text-align: center;
}

.profile-bg {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 120px;
    background: var(--primary-gradient);
    border-radius: 0 0 28px 28px;
}

.profile-content { position: relative; z-index: 1; }

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: var(--on-primary);
    margin: 0 auto 12px;
    border: 4px solid var(--card-bg);
    box-shadow: var(--shadow-lg);
}

.profile-name { font-size: 22px; font-weight: 700; }
.profile-username { color: var(--text-muted); font-size: 14px; }

.stats-row {
    display: flex;
    justify-content: space-around;
    padding: 16px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin: 16px 0;
}

.stat-item { text-align: center; }
.stat-value { font-size: 20px; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ---- Transactions ---- */
.transactions-list { display: flex; flex-direction: column; gap: 2px; }

.transaction-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--card-bg);
    border-radius: var(--radius-xs);
}

.transaction-item.compact { padding: 8px 12px; }

.tr-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.tr-icon.credit { background: rgba(195, 239, 248, 0.12); color: var(--primary); }
.tr-icon.debit { background: rgba(220, 53, 69, 0.1); color: #dc3545; }

.tr-info { flex: 1; min-width: 0; }
.tr-desc { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-date { font-size: 11px; color: var(--text-muted); }

.tr-amount { font-weight: 700; font-size: 14px; white-space: nowrap; }
.tr-amount.credit { color: var(--primary); }
.tr-amount.debit { color: #dc3545; }

/* ---- Settings ---- */
.settings-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.settings-form { display: flex; flex-direction: column; gap: 4px; }

.form-control-custom {
    border: 2px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 12px 14px;
    font-family: 'Inter';
    font-size: 14px;
    transition: all 0.3s;
    background: var(--card-bg);
    color: var(--text);
}

.form-control-custom:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(195, 239, 248, 0.2);
}

.form-control,
.form-select {
    background-color: var(--card-bg);
    border-color: var(--border);
    color: var(--text);
}

.form-control:focus,
.form-select:focus {
    background-color: var(--card-bg);
    border-color: var(--primary);
    color: var(--text);
    box-shadow: 0 0 0 4px rgba(195, 239, 248, 0.2);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-select option {
    background: var(--card-bg);
    color: var(--text);
}

:root:not([data-theme="light"]) .form-control[type="file"] {
    background-color: var(--card-bg);
    color: var(--text);
}

:root:not([data-theme="light"]) .form-control[type="file"]::file-selector-button {
    background: rgba(195, 239, 248, 0.12);
    color: var(--text);
    border-color: var(--border);
}

:root:not([data-theme="light"]) .list-group-item {
    background: var(--card-bg);
    color: var(--text);
    border-color: var(--border);
}

:root:not([data-theme="light"]) .table-responsive {
    background: var(--card-bg);
    border-radius: var(--radius-xs);
}

:root:not([data-theme="light"]) .table {
    --bs-table-bg: var(--card-bg);
    --bs-table-color: var(--text);
    --bs-table-border-color: var(--border);
    --bs-table-striped-color: var(--text);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
    --bs-table-hover-color: var(--text);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.05);
}

:root:not([data-theme="light"]) .text-muted,
:root:not([data-theme="light"]) .text-muted.small,
:root:not([data-theme="light"]) .text-muted.small.mb-2 {
    color: #cbd5e1 !important;
}

.btn-outline-success {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-success:hover,
.btn-outline-success:focus {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--on-primary);
}

.btn-success {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--on-primary);
}

.btn-success:hover,
.btn-success:focus {
    background: var(--primary-light);
    border-color: var(--primary-light);
    color: var(--on-primary);
}

.bg-success {
    background-color: var(--primary) !important;
    color: var(--on-primary) !important;
}

.text-success {
    color: var(--primary) !important;
}

.settings-links {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 8px;
}

.settings-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--card-bg);
    border-radius: var(--radius-xs);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font: inherit;
    appearance: none;
}

.settings-link.install-app-btn {
    border: none;
    width: 100%;
    text-align: left;
}

.settings-link:hover { background: rgba(195, 239, 248, 0.08); color: var(--text); }
.settings-link.text-danger { color: #dc3545 !important; }
.settings-link i:first-child { font-size: 20px; width: 24px; text-align: center; }

/* ---- Support ---- */
.support-content { text-align: center; padding: 20px 0; }

.support-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 36px;
    color: var(--on-primary);
}

.support-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }

.support-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    color: var(--text);
    font-weight: 500;
    transition: all 0.2s;
}

.support-btn:hover { transform: translateX(4px); color: var(--primary); }
.support-btn i { font-size: 22px; color: var(--primary); }

.acc-custom { border: none; margin-bottom: 4px; }
.acc-custom .accordion-header { border-radius: var(--radius-xs); overflow: hidden; }

.acc-btn-custom {
    background: var(--card-bg) !important;
    font-family: 'Inter';
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow);
    border-radius: var(--radius-xs) !important;
}

.acc-btn-custom:not(.collapsed) { color: var(--primary); }
.acc-btn-custom.collapsed { color: var(--text); }

.acc-btn-custom:focus { box-shadow: none; }
.acc-custom .accordion-body { background: var(--card-bg); color: var(--text); }

/* ---- News ---- */
.news-list { display: flex; flex-direction: column; gap: 14px; }

.news-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.news-date { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.news-card h5 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.news-card p { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }

/* ---- Admin ---- */
.admin-header {
    position: relative;
    margin: 0 -16px;
    padding: 28px 24px;
    overflow: hidden;
}

.admin-header-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--primary-gradient-2);
    border-radius: 0 0 28px 28px;
}

.admin-header.global .admin-header-bg {
    background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
}

.admin-header-content { position: relative; z-index: 1; color: var(--text); }
.admin-header-content h3 { font-size: 20px; font-weight: 700; }
.admin-header-content p { font-size: 13px; opacity: 0.85; }

.admin-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 16px 0;
}

.admin-stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow);
}

.asc-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(195, 239, 248, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--primary);
    flex-shrink: 0;
}

.asc-icon.blue { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.asc-icon.purple { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.asc-icon.orange { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }

.asc-value { font-size: 20px; font-weight: 800; }
.asc-label { font-size: 11px; color: var(--text-muted); }

.admin-actions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.admin-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 12px;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    color: var(--text);
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s;
    text-align: center;
}

.admin-action-card i { font-size: 28px; color: var(--primary); }
.admin-action-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); color: var(--text); }

.clubs-admin-list { display: flex; flex-direction: column; gap: 10px; }

.club-admin-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    color: var(--text);
    transition: all 0.2s;
}

.club-admin-card:hover { box-shadow: var(--shadow-lg); color: var(--text); }

.cac-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--on-primary);
    font-size: 20px;
    flex-shrink: 0;
}

.cac-info { flex: 1; }
.cac-info h5 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }

.club-admin-card > i { color: var(--primary); font-size: 20px; }

/* ---- Users List ---- */
.users-list { display: flex; flex-direction: column; gap: 4px; }

.user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--card-bg);
    border-radius: var(--radius-xs);
    color: var(--text);
    transition: all 0.2s;
}

.user-card:hover { background: rgba(195, 239, 248, 0.06); color: var(--text); }

.uc-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--on-primary);
    flex-shrink: 0;
}

.uc-avatar.blocked { background: linear-gradient(135deg, #dc3545, #e74c5a); }

.uc-info { flex: 1; min-width: 0; }
.uc-name { font-size: 14px; font-weight: 600; }
.uc-meta { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.uc-badges { display: flex; gap: 4px; flex-shrink: 0; }
.uc-badges .badge { font-size: 10px; }

/* ---- User Detail ---- */
.user-detail-header {
    text-align: center;
    padding: 20px 0;
}

.ud-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--on-primary);
    margin: 0 auto 12px;
}

.ud-avatar.blocked { background: linear-gradient(135deg, #dc3545, #e74c5a); }

.ud-badges { display: flex; gap: 8px; justify-content: center; margin-top: 8px; }

.ud-stats { display: flex; justify-content: center; gap: 40px; }
.ud-stat { text-align: center; }
.ud-stat-val { font-size: 22px; font-weight: 800; color: var(--primary); }
.ud-stat-lbl { font-size: 11px; color: var(--text-muted); }

/* ---- Cards ---- */
.card-custom {
    border: none;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    background: var(--card-bg);
    color: var(--text);
}

.card {
    background: var(--card-bg);
    color: var(--text);
    border-color: var(--border);
}

.card-text.text-muted.small.mb-2 {
    color: #cbd5e1 !important;
}

p.mt-3.mb-2.fw-bold.text-muted.small {
    color: #cbd5e1 !important;
}

div.mt-3.text-muted.small {
    color: #b9c6d6 !important;
}

:root[data-theme="light"] div.mt-3.text-muted.small {
    color: var(--text-muted) !important;
}

.modal-content {
    background: var(--card-bg);
    color: var(--text);
}

.dropdown-menu {
    background: var(--card-bg);
    color: var(--text);
    border-color: var(--border);
}

.dropdown-item {
    color: var(--text);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: rgba(195, 239, 248, 0.12);
    color: var(--text);
}

/* ---- Default Schedule ---- */
.default-schedule-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--card-bg);
    border-radius: var(--radius-xs);
    margin-bottom: 6px;
    box-shadow: var(--shadow);
    font-size: 13px;
}

/* ---- Training Detail Admin ---- */
.training-detail-header {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.td-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.td-meta i { color: var(--primary); }

.enrollments-list { display: flex; flex-direction: column; gap: 4px; }

.enrollment-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--card-bg);
    border-radius: var(--radius-xs);
}

.ei-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    color: var(--on-primary);
    flex-shrink: 0;
}

.ei-info { flex: 1; }
.ei-name { font-size: 13px; font-weight: 600; }
.ei-username { font-size: 11px; color: var(--text-muted); }

/* ---- Services ---- */
.service-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px;
    background: var(--card-bg);
    border-radius: var(--radius-xs);
    margin-bottom: 6px;
    box-shadow: var(--shadow);
}

.service-card.inactive { opacity: 0.5; }
.sc-info h6 { font-size: 14px; margin-bottom: 4px; }
.sc-meta { display: flex; gap: 8px; font-size: 12px; color: var(--text-muted); align-items: center; }

/* ---- Clubs Manage ---- */
.club-manage-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    box-shadow: var(--shadow);
}

.cmc-info h5 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.cmc-meta { display: flex; gap: 10px; font-size: 12px; align-items: center; }
.cmc-actions { display: flex; gap: 6px; }

/* ---- Abonement Card Small ---- */
.abon-card-sm {
    padding: 10px 14px;
    background: var(--card-bg);
    border-radius: var(--radius-xs);
    margin-bottom: 4px;
    font-size: 13px;
    border-left: 3px solid var(--primary);
    position: relative;
}

.abon-card-sm div { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ---- Subscription Item ---- */
.sub-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--card-bg);
    border-radius: var(--radius-xs);
    margin-bottom: 4px;
    font-size: 12px;
}

/* ---- Statistics ---- */
.chart-container {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    height: 260px;
}
.chart-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.stats-filters select { font-size: 13px; }

/* ---- Modal ---- */
.modal-custom {
    border: none;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
}

.modal-custom .modal-header { padding: 20px 20px 8px; }
.modal-custom .modal-body { padding: 12px 20px 20px; }

/* ---- Buttons ---- */
.btn-outline-success {
    border-color: var(--primary);
    color: var(--primary);
}
.btn-outline-success:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--on-primary);
}

.chat-thread {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 6px 16px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.chat-message-row {
    display: flex;
    justify-content: flex-start;
}

.chat-message-row.me {
    justify-content: flex-end;
}

.chat-bubble {
    max-width: 85%;
    background: rgba(195, 239, 248, 0.12);
    border: 1px solid rgba(195, 239, 248, 0.18);
    border-radius: 18px;
    padding: 10px 12px;
    color: var(--text);
}

.chat-message-row.me .chat-bubble {
    background: rgba(195, 239, 248, 0.28);
    border-color: rgba(195, 239, 248, 0.4);
}

.chat-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.chat-name {
    font-weight: 600;
    color: var(--text);
}

.chat-role {
    padding: 2px 6px;
    border-radius: 10px;
    background: rgba(195, 239, 248, 0.18);
    color: var(--text);
    font-size: 10px;
}

.chat-time {
    margin-left: auto;
}

.chat-time-bottom {
    margin-top: 6px;
    text-align: right;
    font-size: 11px;
    color: var(--text-muted);
}

.chat-text {
    font-size: 14px;
    line-height: 1.45;
    white-space: pre-wrap;
}

.chat-empty {
    padding: 8px 6px;
}

.chat-input-bar {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 10px;
    box-shadow: var(--shadow);
}

.chat-input {
    flex: 1;
    min-height: 42px;
}

.chat-member-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chat-member-list {
    display: grid;
    gap: 8px;
    max-height: 260px;
    overflow-y: auto;
    padding: 6px;
    border-radius: var(--radius-sm);
    background: var(--bg);
    border: 1px solid var(--border);
}

.chat-member-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-xs);
    background: rgba(195, 239, 248, 0.08);
    cursor: pointer;
    font-size: 13px;
}

.chat-member-item input {
    accent-color: var(--primary);
}

.chat-member-name {
    color: var(--text);
    font-weight: 600;
}

.chat-member-role {
    color: var(--text-muted);
    font-size: 11px;
    margin-left: auto;
}

.chat-member-selected {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chat-member-chip {
    background: rgba(195, 239, 248, 0.2);
    color: var(--text);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
}

.chat-member-actions-inline {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.chat-page {
    height: calc(100vh - var(--nav-height));
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-page .chat-thread {
    flex: 1;
    overflow-y: auto;
}

.chat-page .chat-input-bar {
    margin-top: auto;
}

/* ---- Responsive ---- */
@media (min-width: 768px) {
    .app-container {
        max-width: 600px;
        margin: 0 auto;
    }

    .bottom-nav {
        max-width: 600px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 20px 20px 0 0;
        box-shadow: var(--shadow-lg);
    }

    .home-header, .profile-header, .admin-header {
        margin: 0 -16px;
        border-radius: 0 0 28px 28px;
    }
}

@media (max-width: 360px) {
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-stats {
        grid-template-columns: 1fr;
    }

    .admin-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ---- Selection ---- */
::selection {
    background: rgba(195, 239, 248, 0.2);
}

/* ---- Safe Areas ---- */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-nav {
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
    }
    .page-content {
        padding-bottom: calc(var(--nav-height) + 20px + env(safe-area-inset-bottom));
    }
}
