/* GymHost - Custom Styles */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #0ea5e9;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --dark: #1e293b;
    --sidebar-bg: #0f172a;
    --sidebar-width: 260px;
    --header-height: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
a { text-decoration: none !important; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f1f5f9;
    color: #334155;
    min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    overflow-y: auto; z-index: 1000;
    transition: transform 0.3s ease;
    display: flex; flex-direction: column;
}
.sidebar-logo {
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex; align-items: center; gap: 12px;
}
.sidebar-logo .logo-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; color: #fff;
}
.sidebar-logo .logo-text { color: #fff; }
.sidebar-logo .logo-text h2 { font-size: 16px; font-weight: 700; }
.sidebar-logo .logo-text span { font-size: 11px; color: #94a3b8; }

.sidebar-section { padding: 16px 12px 8px; }
.sidebar-section-title {
    font-size: 10px; font-weight: 600; letter-spacing: 1px;
    color: #475569; text-transform: uppercase; padding: 0 8px 8px;
}
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 8px; margin-bottom: 2px;
    color: #94a3b8; text-decoration: none; font-size: 14px;
    transition: all 0.2s;
}
.nav-item:hover { background: rgba(255,255,255,0.07); color: #e2e8f0; }
.nav-item.active { background: rgba(99,102,241,0.2); color: #a5b4fc; font-weight: 600; }
.nav-item.active .nav-icon { color: var(--primary); }
.nav-icon { width: 18px; text-align: center; flex-shrink: 0; }
.nav-badge {
    margin-left: auto; background: var(--primary);
    color: #fff; font-size: 10px; font-weight: 700;
    padding: 2px 7px; border-radius: 20px; line-height: 1.4;
}

.sidebar-footer {
    margin-top: auto; padding: 16px 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.user-info {
    display: flex; align-items: center; gap: 12px;
    padding: 10px; border-radius: 10px; color: #94a3b8;
    font-size: 13px;
}
.user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.user-info-text strong { display: block; color: #e2e8f0; font-size: 13px; }
.user-info-text small { color: #64748b; font-size: 11px; text-transform: capitalize; }

/* ── MAIN LAYOUT ── */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh; display: flex; flex-direction: column;
}
.topbar {
    height: var(--header-height); background: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px; position: sticky; top: 0; z-index: 900;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.page-title { font-size: 18px; font-weight: 700; color: #1e293b; }
.breadcrumb { font-size: 12px; color: #94a3b8; margin-top: 2px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.btn-icon {
    width: 36px; height: 36px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    background: #f8fafc; border: 1px solid #e2e8f0;
    color: #64748b; cursor: pointer; text-decoration: none;
    transition: all 0.2s;
}
.btn-icon:hover { background: #f1f5f9; color: #334155; }
.hamburger { display: none; background: none; border: none; cursor: pointer; color: #64748b; font-size: 20px; }

.content { flex: 1; padding: 24px; }

/* ── CARDS ── */
.card {
    background: #fff; border-radius: 12px;
    border: 1px solid #e2e8f0; overflow: hidden;
}
.card-header {
    padding: 16px 20px; border-bottom: 1px solid #e2e8f0;
    display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 15px; font-weight: 600; color: #1e293b; }
.card-body { padding: 20px; }

/* ── STAT CARDS ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: #fff; border-radius: 12px; padding: 14px 16px;
    border: 1px solid #e2e8f0; display: flex; align-items: flex-start; gap: 12px;
}
a.stat-card-link {
    text-decoration: none; color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
a.stat-card-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    border-color: var(--primary);
}
.stat-icon {
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 17px; flex-shrink: 0;
}
.stat-icon.blue   { background: #eff6ff; color: #3b82f6; }
.stat-icon.green  { background: #f0fdf4; color: #10b981; }
.stat-icon.orange { background: #fff7ed; color: #f59e0b; }
.stat-icon.red    { background: #fef2f2; color: #ef4444; }
.stat-icon.purple { background: #f5f3ff; color: #8b5cf6; }
.stat-icon.cyan   { background: #ecfeff; color: #06b6d4; }
.stat-value { font-size: 22px; font-weight: 800; color: #1e293b; line-height: 1; }
.stat-label { font-size: 11px; color: #94a3b8; margin-top: 4px; }
.stat-sub   { font-size: 11px; color: #10b981; margin-top: 4px; }

/* ── BUTTONS ── */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 16px; border-radius: 8px; font-size: 14px;
    font-weight: 500; text-decoration: none; cursor: pointer;
    border: none; transition: all 0.2s; white-space: nowrap;
}
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-xs { padding: 3px 8px; font-size: 12px; border-radius: 6px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover  { background: #dc2626; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #d97706; }
.btn-info    { background: var(--info); color: #fff; }
.btn-secondary { background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; }
.btn-secondary:hover { background: #e2e8f0; }
.btn-outline { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }

/* ── TABLE ── */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
    background: #f8fafc; padding: 9px 14px; text-align: left;
    font-size: 11px; font-weight: 600; color: #64748b;
    text-transform: uppercase; letter-spacing: 0.5px;
    border-bottom: 1px solid #e2e8f0; white-space: nowrap;
}
tbody td { padding: 9px 14px; border-bottom: 1px solid #f1f5f9; font-size: 13px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #f8fafc; }

/* Row highlight for pending-fee members (e.g. Attendance page) */
tbody tr.row-fee-expired td { background: #fef2f2; }
tbody tr.row-fee-expired:hover td { background: #fee2e2; }
tbody tr.row-fee-urgent td { background: #fffbeb; }
tbody tr.row-fee-urgent:hover td { background: #fef3c7; }

/* Row highlight for "which row was I just acting on" reference — set when a
   row's action button opens a modal, and/or after a redirect brings you back
   to the list following an edit/renew/etc. (see ?highlight= handling). */
tbody tr.row-highlight td { background: #ede9fe; transition: background 1.2s ease; }
tbody tr.row-highlight:hover td { background: #ddd6fe; }

/* ── BADGES ── */
.badge {
    display: inline-flex; align-items: center; padding: 3px 10px;
    border-radius: 20px; font-size: 11px; font-weight: 600;
}
.badge-success   { background: #dcfce7; color: #15803d; }
.badge-danger    { background: #fee2e2; color: #dc2626; }
.badge-warning   { background: #fef3c7; color: #d97706; }
.badge-info      { background: #dbeafe; color: #2563eb; }
.badge-primary   { background: #ede9fe; color: #7c3aed; }
.badge-secondary { background: #f1f5f9; color: #64748b; }

/* ── FORMS ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: #374151; margin-bottom: 6px; }
.form-label .required { color: var(--danger); }
.form-control {
    width: 100%; padding: 9px 12px; border: 1px solid #e2e8f0;
    border-radius: 8px; font-size: 14px; color: #1e293b;
    background: #fff; transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 36px; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.form-hint { font-size: 12px; color: #94a3b8; margin-top: 4px; }

/* ── MODAL ── */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    z-index: 2000; display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.modal-overlay.show { opacity: 1; pointer-events: all; }
.modal {
    background: #fff; border-radius: 16px; padding: 0;
    width: 90%; max-width: 560px; max-height: 90vh;
    overflow-y: auto; transform: scale(0.95); transition: transform 0.2s;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
.modal-overlay.show .modal { transform: scale(1); }
.modal-header {
    padding: 20px 24px; border-bottom: 1px solid #e2e8f0;
    display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 700; color: #1e293b; }
.modal-close { background: none; border: none; font-size: 20px; color: #94a3b8; cursor: pointer; line-height: 1; }
.modal-close:hover { color: #334155; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid #e2e8f0; display: flex; gap: 12px; justify-content: flex-end; }
.modal-lg { max-width: 760px; }

/* ── ALERT / FLASH ── */
.alert {
    padding: 12px 16px; border-radius: 8px; font-size: 14px;
    margin-bottom: 16px; display: flex; align-items: center; gap: 10px;
    animation: slideDown 0.3s ease;
}
.alert-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.alert-error   { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.alert-warning { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.alert-info    { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
@keyframes slideDown { from { transform: translateY(-10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── SEARCH/FILTER BAR ── */
.filter-bar {
    display: flex; gap: 12px; flex-wrap: wrap;
    margin-bottom: 20px; align-items: center;
}
/* Groups a couple of filter-bar controls so they stay side by side even when
   the bar itself stacks to one-per-row on mobile (see the 480px query below). */
.filter-row { display: flex; gap: 8px; align-items: center; }
.search-input {
    flex: 1; min-width: 200px; position: relative;
}
.search-input input { padding-left: 36px; }
.search-input i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 14px; }

/* ── GRID LAYOUT ── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ── PAGINATION ── */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 20px; }
.page-btn {
    width: 36px; height: 36px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none; font-size: 13px; color: #64748b;
    background: #fff; border: 1px solid #e2e8f0; transition: all 0.2s;
}
.page-btn:hover, .page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state i { font-size: 48px; color: #e2e8f0; margin-bottom: 16px; }
.empty-state h3 { font-size: 16px; color: #94a3b8; margin-bottom: 8px; }
.empty-state p { font-size: 13px; color: #cbd5e1; }

/* ── MISC ── */
.text-muted { color: #94a3b8; }
.text-sm { font-size: 12px; }
.fw-bold { font-weight: 700; }
.d-flex { display: flex; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-4 { margin-top: 16px; }
.actions-col { display: flex; gap: 6px; align-items: center; }
.btn-stack {
    flex-direction: column; gap: 2px !important;
    padding: 5px 8px; line-height: 1.1; min-width: 44px;
}
.btn-stack i { font-size: 13px; }
.btn-stack .lbl { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }
.divider { border: none; border-top: 1px solid #e2e8f0; margin: 16px 0; }

/* ── QUICK FILTERS (Pending Fee by due date) ── */
.quick-filters-wrap { margin-bottom: 20px; }
.quick-filters-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px;
}
.quick-filters-title {
    display: flex; align-items: center; gap: 7px;
    font-size: 12.5px; font-weight: 700; color: #64748b;
    text-transform: uppercase; letter-spacing: .5px;
}
.quick-filters-title i { color: #f59e0b; }
.quick-filter-clear {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12px; color: #94a3b8; text-decoration: none; font-weight: 600;
}
.quick-filter-clear:hover { color: #ef4444; }
.quick-filters {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}
.quick-filter-card {
    position: relative; display: flex; align-items: center; gap: 12px;
    background: #fff; border: 1.5px solid #e2e8f0; border-radius: 14px;
    padding: 14px 16px; text-decoration: none; overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.quick-filter-card:hover {
    transform: translateY(-3px); border-color: #cbd5e1;
    box-shadow: 0 8px 20px rgba(15,23,42,0.08);
}
.quick-filter-card::before {
    content: ''; position: absolute; inset: 0 auto 0 0; width: 4px;
    background: var(--qf-color, #cbd5e1);
}
.quick-filter-card .qf-icon {
    width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 15px;
    background: var(--qf-bg, #f1f5f9); color: var(--qf-color, #64748b);
}
.quick-filter-card .qf-count { font-size: 20px; font-weight: 800; color: #1e293b; line-height: 1; }
.quick-filter-card .qf-label { font-size: 11.5px; color: #94a3b8; margin-top: 3px; font-weight: 600; }
.quick-filter-card.active {
    border-color: var(--qf-color, var(--primary));
    background: var(--qf-bg, #f5f3ff);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--qf-color, var(--primary)) 15%, transparent);
}
.quick-filter-card.active .qf-icon { background: #fff; }
.quick-filter-card .qf-check {
    position: absolute; top: 10px; right: 10px; font-size: 13px;
    color: var(--qf-color, var(--primary)); display: none;
}
.quick-filter-card.active .qf-check { display: block; }

/* ── DROPDOWN MENU (kebab / "..." action buttons) ── */
.dropdown-wrap { position: relative; display: inline-flex; }
.dropdown-dots {
    width: 26px; height: 26px; padding: 0; border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #f1f5f9; color: #64748b; border: none; cursor: pointer; font-size: 13px;
}
.dropdown-dots:hover { background: #e2e8f0; color: #1e293b; }
.dropdown-menu {
    display: none; position: absolute; top: calc(100% + 4px); right: 0; z-index: 50;
    min-width: 170px; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
    box-shadow: 0 8px 24px rgba(15,23,42,0.12); padding: 6px; flex-direction: column; gap: 2px;
}
.dropdown-menu.show { display: flex; }
.dropdown-menu button, .dropdown-menu a {
    display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
    padding: 8px 10px; border-radius: 7px; border: none; background: none; cursor: pointer;
    font-size: 13px; font-weight: 500; color: #334155; text-decoration: none;
}
.dropdown-menu button:hover, .dropdown-menu a:hover { background: #f1f5f9; }
.dropdown-menu .text-danger { color: var(--danger); }
.dropdown-menu .text-danger:hover { background: #fef2f2; }
.dropdown-menu i { width: 14px; text-align: center; flex-shrink: 0; color: #94a3b8; }
.dropdown-menu .text-danger i { color: var(--danger); }

/* ── PROGRESS BAR ── */
.progress { height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--primary); border-radius: 3px; transition: width 0.6s; }

/* ── AVATAR STACK ── */
.avatar-sm {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff; font-size: 12px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}

/* ── NOTIFICATION DOT ── */
.notif-dot {
    width: 8px; height: 8px; border-radius: 50%;
    position: absolute; top: 6px; right: 6px;
}

/* ── BOTTOM NAV (mobile app feel, PWA) ── */
.bottom-nav {
    display: none; /* enabled on mobile widths below */
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 950;
    background: #fff; border-top: 1px solid #e2e8f0;
    box-shadow: 0 -2px 16px rgba(0,0,0,0.06);
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.bn-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 8px 4px 6px; color: #94a3b8; text-decoration: none;
    background: none; border: none; font-family: inherit; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.bn-item .bn-icon { font-size: 19px; line-height: 1; }
.bn-item .bn-label { font-size: 10px; font-weight: 600; letter-spacing: 0.2px; }
.bn-item.active { color: var(--primary); }
.bn-item:active { opacity: 0.6; }

/* ── MOBILE ── */
@media (min-width: 769px) and (max-width: 1100px) {
    :root { --sidebar-width: 220px; }
    .stat-card { padding: 12px 14px; gap: 10px; }
    .stat-icon { width: 36px; height: 36px; font-size: 15px; }
    .stat-value { font-size: 20px; }
    .content { padding: 16px; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-wrapper { margin-left: 0; }
    .hamburger { display: flex; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .content { padding: 12px; padding-bottom: calc(72px + env(safe-area-inset-bottom, 0)); }
    .topbar { padding: 0 12px; height: 56px; }
    .page-title { font-size: 16px; }
    .overlay {
        position: fixed; inset: 0; background: rgba(0,0,0,0.5);
        z-index: 999; display: none;
    }
    .overlay.show { display: block; }
    .modal { width: 96%; max-height: 96vh; }
    .modal-body { padding: 16px; }
    .modal-header, .modal-footer { padding: 14px 16px; }
    .card-header { padding: 12px 16px; }
    .stat-card { padding: 10px 12px; gap: 10px; }
    .stat-icon { width: 34px; height: 34px; font-size: 14px; }
    .stat-value { font-size: 18px; }
    .filter-bar { gap: 8px; }
    .bottom-nav { display: flex; }
    #pwaInstallBanner { bottom: calc(64px + env(safe-area-inset-bottom, 0)) !important; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-bar > * { width: 100%; }
    .btn { justify-content: center; }
    /* Each filter-row still stacks full-width as a group, but its own
       controls stay side by side within that row (e.g. Status + Filter,
       Import CSV + Import History) instead of each getting its own line. */
    .filter-row > * { flex: 1; width: auto !important; }
}

/* ── INSTALL / LOGIN PAGE ── */
.auth-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    position: relative; overflow: hidden;
}
.auth-page::before {
    content: ''; position: absolute; width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 70%);
    top: -200px; right: -200px;
}
.auth-box {
    background: #fff; border-radius: 20px; padding: 40px;
    width: 100%; max-width: 420px; box-shadow: 0 25px 80px rgba(0,0,0,0.3);
    position: relative;
}
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo .icon {
    width: 60px; height: 60px; border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; color: #fff; margin: 0 auto 12px;
}
.auth-logo h1 { font-size: 22px; font-weight: 800; color: #1e293b; }
.auth-logo p { font-size: 14px; color: #94a3b8; margin-top: 4px; }

/* ── AUTH SPLIT-SCREEN (desktop only — mobile/tablet keep the single centered card) ── */
.auth-split { width: 100%; max-width: 420px; }
.auth-brand-panel { display: none; }

@media (min-width: 1024px) {
    .auth-split {
        max-width: 960px; display: flex; align-items: stretch;
        border-radius: 22px; overflow: hidden; box-shadow: 0 25px 80px rgba(0,0,0,0.35);
    }
    .auth-brand-panel {
        display: flex; flex-direction: column; justify-content: center;
        flex: 0 0 44%; position: relative; overflow: hidden;
        background: linear-gradient(135deg, #4338ca 0%, #6366f1 55%, #8b5cf6 100%);
        color: #fff; padding: 56px 48px;
    }
    .auth-brand-panel::before {
        content: ''; position: absolute; width: 420px; height: 420px;
        background: radial-gradient(circle, rgba(255,255,255,0.14) 0%, transparent 70%);
        top: -140px; right: -140px;
    }
    .auth-brand-panel::after {
        content: ''; position: absolute; width: 300px; height: 300px;
        background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
        bottom: -120px; left: -100px;
    }
    .auth-brand-panel .icon {
        width: 56px; height: 56px; border-radius: 14px; background: rgba(255,255,255,0.16);
        display: flex; align-items: center; justify-content: center;
        font-size: 24px; color: #fff; margin-bottom: 20px; position: relative; z-index: 1;
    }
    .auth-brand-panel h2 { font-size: 26px; font-weight: 800; margin-bottom: 10px; position: relative; z-index: 1; }
    .auth-brand-panel p.tagline { font-size: 14px; color: rgba(255,255,255,0.82); line-height: 1.6; margin-bottom: 28px; position: relative; z-index: 1; }
    .auth-brand-panel ul { list-style: none; position: relative; z-index: 1; }
    .auth-brand-panel ul li {
        display: flex; align-items: center; gap: 10px;
        font-size: 13.5px; color: rgba(255,255,255,0.92); margin-bottom: 14px;
    }
    .auth-brand-panel ul li i {
        width: 26px; height: 26px; border-radius: 8px; background: rgba(255,255,255,0.14);
        display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0;
    }
    .auth-split .auth-box {
        flex: 1 1 56%; max-width: none; box-shadow: none; border-radius: 0;
        display: flex; flex-direction: column; justify-content: center;
    }
}

/* ── CHART CONTAINER ── */
.chart-container { position: relative; height: 250px; }

/* ── SIMPLE-DATATABLES THEME ── */
.datatable-wrapper { font-size: 13px; }
.datatable-top {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px 12px; flex-wrap: wrap; gap: 8px;
    border-bottom: 1px solid #e2e8f0; background: #fafbfc;
    border-radius: 0;
}
.datatable-search { flex: 1; min-width: 160px; max-width: 260px; position: relative; }
.datatable-search::before {
    content: '\f002'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    color: #94a3b8; font-size: 11px; pointer-events: none;
}
.datatable-input {
    width: 100%; padding: 7px 10px 7px 30px;
    border: 1px solid #e2e8f0; border-radius: 8px;
    font-size: 13px; color: #1e293b; outline: none; background: #fff;
}
.datatable-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
.datatable-length { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #64748b; }
.datatable-selector {
    padding: 6px 10px; border: 1px solid #e2e8f0; border-radius: 8px;
    font-size: 13px; color: #1e293b; cursor: pointer; background: #fff;
    outline: none; min-width: 60px;
}
.datatable-selector:focus { border-color: var(--primary); }
.datatable-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.datatable-bottom {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px; border-top: 1px solid #e2e8f0;
    flex-wrap: wrap; gap: 8px; background: #fafbfc;
}
.datatable-info { font-size: 12px; color: #94a3b8; }
.datatable-pagination { list-style: none; display: flex; gap: 3px; margin: 0; padding: 0; flex-wrap: wrap; }
.datatable-pagination li button {
    min-width: 30px; height: 30px; padding: 0 8px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px; font-size: 12px; color: #64748b;
    background: #fff; border: 1px solid #e2e8f0;
    cursor: pointer; transition: all 0.15s; line-height: 1;
}
.datatable-pagination li button:hover { background: #f1f5f9; color: #334155; }
.datatable-pagination li.datatable-active button {
    background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600;
}
.datatable-pagination li.datatable-active button:hover { background: var(--primary-dark); }
.datatable-pagination li.datatable-disabled button { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.datatable-pagination li.datatable-hidden { display: none; }
/* Sort icon in header — the library (.datatable-sorter) draws TWO stacked
   CSS-triangle carets (::before = up, ::after = down) at all times. Kill the
   "before" caret entirely and turn the "after" one into a single, darker
   text arrow that flips direction/color once a column is actually sorted. */
.datatable-table th { position: relative; }
.datatable-sorter, .datatable-filter { padding-right: 14px; }
.datatable-sorter::before { display: none !important; content: none !important; }
.datatable-sorter::after {
    content: '↓' !important;
    border: none !important;
    width: auto !important; height: auto !important;
    position: absolute; right: 2px; top: 50%; transform: translateY(-50%);
    font-size: 10px; font-family: inherit; line-height: 1;
    opacity: 0.6 !important; color: #475569;
}
.datatable-ascending .datatable-sorter::after,
th.datatable-ascending .datatable-sorter::after {
    content: '↑' !important; opacity: 1 !important; color: var(--primary);
}
.datatable-descending .datatable-sorter::after,
th.datatable-descending .datatable-sorter::after {
    content: '↓' !important; opacity: 1 !important; color: var(--primary);
}
.datatable-table th button:focus { outline: none; }
@media (max-width: 600px) {
    .datatable-top { flex-direction: column; align-items: stretch; }
    .datatable-search { max-width: 100%; }
    .datatable-bottom { flex-direction: column; align-items: flex-start; }
    .datatable-pagination li button { min-width: 28px; height: 28px; font-size: 11px; }
}
