/* --- 1. VARIABLES & RESET --- */
:root {
    --bg-dark: #1a1a1a;
    --sidebar-bg: #121212;
    --card-bg: #242424;
    --primary-yellow: #FFD700;
    --y4: #FFD700;
    --y4-glow: rgba(255, 215, 0, 0.3);
    --text-main: #ffffff;
    --text-muted: #999999;
    --border: #333333;
    --sidebar-width: 240px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    display: flex;
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
}

/* --- ANIMATED SIDEBAR --- */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #121212 0%, #0a0a0a 100%);
    border-right: 1px solid var(--border);
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo-area { 
    padding: 40px 20px; 
    text-align: center;
    position: relative;
}

/* GYM LOGO */
.gym-logo {
    height: 50px;
    max-height: 60px;
    width: auto;
    object-fit: contain;
    padding: 5px;
    display: block;
    margin: 0 auto;
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 5px rgba(241, 196, 15, 0.2));
}

.logo-link {
    text-decoration: none;
    border: none !important;
    display: inline-block;
}

.logo-link:hover .gym-logo {
    transform: scale(1.05);
    filter: drop-shadow(0 0 10px rgba(241, 196, 15, 0.4));
}

.side-nav {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* This allows you to scroll the sidebar if it's too long */
    padding-bottom: 20px;
}

/* Hide scrollbar for a cleaner look but keep functionality */
.side-nav::-webkit-scrollbar {
    width: 0px;
}

/* Sublte pulse animation for the logo */
.logo-text { 
    color: var(--primary-yellow); 
    font-size: 1.2rem; 
    font-weight: 900; 
    letter-spacing: 3px;
    animation: logo-glow 3s infinite alternate;
}

@keyframes logo-glow {
    from { text-shadow: 0 0 5px rgba(241, 196, 15, 0); }
    to { text-shadow: 0 0 15px rgba(241, 196, 15, 0.4); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.nav-item {
    color: var(--text-muted);
    text-decoration: none;
    padding: 14px 20px;
    margin: 8px 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden; /* For the "shimmer" effect */
    transition: all 0.3s ease;
}

/* The Hover Animation */
.nav-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--primary-yellow);
    transform: translateX(8px); /* Slides right on hover */
    box-shadow: -5px 0 0 var(--primary-yellow); /* Yellow indicator strip */
}

/* The Active State (Current Page) */
.nav-item.active {
    background: var(--primary-yellow);
    color: #000;
    font-weight: 700;
    transform: scale(1.02);
    box-shadow: 0 10px 20px rgba(241, 196, 15, 0.2);
}

/* "Shimmer" light effect that runs across buttons on hover */
.nav-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    transition: 0.5s;
}

.nav-item:hover::after {
    left: 100%;
}

/* --- COLLAPSIBLE SIDEBAR LOGIC --- */
:root {
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 80px;
}

/* Sidebar transition */
.sidebar {
    width: var(--sidebar-width);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    white-space: nowrap;
}

/* Main content must also transition its margin */
.main-content {
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* THE COLLAPSED STATE */
body.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* Hide text when collapsed, keep icons */
body.sidebar-collapsed .logo-text,
body.sidebar-collapsed .nav-text {
    opacity: 0;
    visibility: hidden;
}

/* Center icons when collapsed */
body.sidebar-collapsed .nav-item {
    justify-content: center;
    padding: 14px 0;
    margin: 8px 10px;
}

/* Nav icon spacing */
.nav-icon {
    font-size: 1.1rem;
    min-width: 24px;
    text-align: center;
    flex-shrink: 0;
    margin-right: 12px;
}

body.sidebar-collapsed .nav-icon {
    margin-right: 0;
}

/* Toggle Button Styling */
.btn-toggle {
    display: block;
    margin: 10px auto 0;
    width: 36px;
    height: 36px;
    background: var(--primary-yellow);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 1001;
}

/* --- SIDEBAR REVENUE FOOTER --- */
.sidebar-footer {
    margin-top: auto; /* Pushes to the very bottom */
    padding: 20px;
    border-top: 1px solid var(--border);
    background: rgba(0,0,0,0.2);
}

.revenue-mini-card {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.rev-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.rev-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: #2ecc71; /* Success Green */
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Hide numbers when collapsed to keep it clean */
body.sidebar-collapsed .sidebar-footer {
    padding: 20px 0;
    text-align: center;
}

body.sidebar-collapsed .rev-label,
body.sidebar-collapsed .rev-value span {
    display: none;
}

body.sidebar-collapsed .rev-value {
    justify-content: center;
    font-size: 1.2rem;
}

/* --- 3. MAIN CONTENT (THE FLUID AREA) --- */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 30px;
    width: calc(100% - var(--sidebar-width));
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.main-title { border-left: 4px solid var(--primary-yellow); padding-left: 15px; font-size: 1.6rem; margin: 0; }

/* --- 4. DASHBOARD & STATS --- */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-yellow);
}

.stat-card.highlight { border: 1px solid var(--primary-yellow); }
.label { color: var(--text-muted); text-transform: uppercase; font-size: 0.7rem; letter-spacing: 1px; }
.value { font-size: 2rem; font-weight: 700; margin-top: 5px; display: block; }

/* --- 5. FORMS (ADD MEMBER & EXPENSE) --- */
.table-card {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border);
    width: 100%;
    overflow: hidden;
    margin-top: 10px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.registration-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.analytics-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 22px;
}
.analytics-panel {
    padding: 20px;
    min-height: 300px;
}
.analytics-panel canvas {
    width: 100% !important;
    height: 240px !important;
}
.mini-stats-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 24px;
}
.mini-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 14px;
    text-align: center;
    transition: all 0.25s ease;
}
.mini-card:hover {
    background: rgba(241, 196, 15, 0.06);
    border-color: rgba(241, 196, 15, 0.5);
}
.mini-card .label {
    display: block;
    font-size: 0.64rem;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #8f8f8f;
    margin-bottom: 6px;
}
.mini-card .value {
    font-size: 1.2rem;
    font-weight: 800;
    font-family: 'Courier New', monospace;
}
.text-red { color: #e74c3c; }
.text-green { color: #2ecc71; }

.form-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 15px; }
.full-width { grid-column: span 2; }

.gym-input, .reports-search-input {
    width: 100%;
    background: #111;
    border: 1px solid var(--border);
    color: white;
    padding: 12px;
    border-radius: 8px;
    outline: none;
}

/* --- 6. HORIZONTAL EXPENSE ROW --- */
.expense-dashboard-row {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.flex-form-section { flex: 2; }
.flex-category-section { flex: 1; }

.category-manager-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid var(--primary-yellow);
}

/* --- 10. UTILITIES (SEARCH CARD) --- */
.reports-search-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 35px;
    border: 1px solid var(--border);
}

/* --- 7. BUTTONS & UTILITIES --- */
.category-flex { display: flex; gap: 10px; margin-bottom: 15px; }

.search-flex {
    display: flex;
    gap: 15px;
    align-items: stretch;
}

.btn-primary, .btn-search {
    background: var(--primary-yellow);
    color: #000;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
}

.btn-search {
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-pill {
    background: #111;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--border);
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 4px;
}

    .revenue-goal-card {
        margin-bottom: 24px;
        padding: 18px 20px;
    }
    .goal-percent {
        font-size: 0.82rem;
        font-weight: 800;
        color: var(--primary-yellow);
        letter-spacing: 0.7px;
    }
    .progress-container {
        background: rgba(255, 255, 255, 0.05);
        height: 12px;
        border-radius: 10px;
        margin: 15px 0;
        overflow: hidden;
        border: 1px solid #333;
    }
    .progress-bar {
        height: 100%;
        background: linear-gradient(90deg, var(--primary-yellow), #f39c12);
        box-shadow: 0 0 15px rgba(241, 196, 15, 0.45);
        transition: width 1.5s cubic-bezier(0.1, 0.42, 0.41, 1);
        position: relative;
    }
    .progress-bar::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        animation: goalShine 2s infinite;
    }
    .goal-meta {
        display: flex;
        justify-content: space-between;
        font-size: 0.75rem;
        color: #888;
    }
    @keyframes goalShine {
        0% { transform: translateX(-100%); }
        100% { transform: translateX(100%); }
    }
/* --- 8. TABLES --- */
.data-table, .mini-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.data-table th, .mini-table th {
    background: #1a1a1a;
    color: var(--text-muted);
    padding: 18px 20px;
    text-align: left;
    text-transform: uppercase;
    font-size: 0.75rem;
    border-bottom: 2px solid var(--border);
}

.data-table td, .mini-table td { padding: 12px; border-bottom: 1px solid var(--border); }

.address-cell {
    display: inline-block;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: help;
    color: #a1a1aa;
    font-size: 0.85rem;
    vertical-align: bottom;
}

.address-cell:hover {
    white-space: normal;
    overflow: visible;
}

.amount-negative { color: #ff4d4d; font-weight: bold; }

.stats-grid {
    display: grid;
    /* This will automatically wrap the cards to a new line on smaller screens */
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 35px;
}

.stat-label {
    font-size: 0.7rem;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    font-weight: 700;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 900;
    margin: 10px 0;
}

.stat-sub {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 0.78rem;
}

/* --- STATUS GLOW EFFECTS --- */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.status-walkin {
    background: rgba(52, 152, 219, 0.1); /* Light Blue */
    color: #3498db;
    border: 1px solid #3498db;
}

.status-active {
    background: rgba(46, 204, 113, 0.1); /* Light Green */
    color: #2ecc71;
    border: 1px solid #2ecc71;
}

.status-expired {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.2);
}

.status-hold {
    background: rgba(52, 152, 219, 0.12);
    color: #3498db;
    border: 1px solid rgba(52, 152, 219, 0.4);
    box-shadow: 0 0 12px rgba(52, 152, 219, 0.25);
}

.status-none {
    background: rgba(255, 255, 255, 0.05);
    color: #888;
    border: 1px solid #444;
}

.pulse-dot {
    height: 8px;
    width: 8px;
    background-color: #2ecc71;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
    box-shadow: 0 0 8px #2ecc71;
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(46, 204, 113, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

/* --- DANGER ZONE (DELETE BUTTON) --- */
.btn-delete {
    background: transparent;
    border: 1px solid rgba(255, 77, 77, 0.3);
    color: #ff4d4d;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-delete:hover {
    background: #ff4d4d;
    color: white;
    box-shadow: 0 0 10px rgba(255, 77, 77, 0.5);
}

/* Alert Box for Deletion Success */
.alert-deleted {
    background: #1a1a1a;
    border-left: 5px solid #ff4d4d;
    padding: 15px;
    margin-bottom: 20px;
    color: #ff4d4d;
}

.dashboard-action-bar {
    margin-bottom: 25px;
    display: flex;
    gap: 15px;
}

.walkin-register-btn {
    background: #2ecc71;
    flex: 1;
    padding: 15px;
}

.btn-hold {
    color: #3498db;
    border-color: rgba(52, 152, 219, 0.45);
    background: rgba(52, 152, 219, 0.08);
    padding: 5px 10px;
    border-radius: 6px;
}

.btn-hold:hover {
    background: #3498db;
    color: #fff;
}

.gym-input-date {
    background: #1a1a1a;
    border: 1px solid #333;
    color: var(--primary-yellow);
    padding: 10px;
    border-radius: 8px;
    width: 100%;
    margin-bottom: 10px;
}

.table-card-head {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
}

.dashboard-reg-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.02);
}

.dashboard-view-all {
    color: var(--primary-yellow);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 700;
}

/* --- SCAN PAGE --- */
.scan-page-container {
    max-width: 600px;
    margin: 0 auto;
}

.scan-page-header {
    text-align: center;
    display: block;
}

.scan-page-title {
    border: none;
    padding: 0;
}

.scan-page-subtitle {
    color: var(--text-muted);
    margin-top: 10px;
}

@keyframes slideDown {
    from { transform: translateY(-20px); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

.scan-flash-card {
    margin-bottom: 20px;
    padding: 20px;
    border-left: 10px solid;
    animation: slideDown 0.4s ease;
}

.scan-flash-title {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: 1px;
}

.scan-flash-help {
    margin-top: 10px;
    color: #fff;
}

.scan-flash-danger {
    border-left-color: #ff4d4d;
    box-shadow: 0 0 30px rgba(255, 77, 77, 0.4);
    background: rgba(255, 77, 77, 0.15);
    border-left-width: 12px;
    animation: shake 0.4s ease-in-out;
}

.scan-flash-danger .scan-flash-title {
    color: #ff4d4d;
}

.scan-flash-success {
    border-left-color: #2ecc71;
    box-shadow: 0 0 25px rgba(46, 204, 113, 0.2);
    background: rgba(46, 204, 113, 0.07);
}

.scan-flash-success .scan-flash-title {
    color: #2ecc71;
}

.scan-action-bar {
    margin-bottom: 20px;
    display: grid;
    gap: 12px;
}

.scan-walkin-btn {
    background: #2ecc71;
    border: none;
    width: 100%;
    padding: 20px;
    font-size: 1.2rem;
    border-radius: 12px;
}

.scan-verify-card {
    padding: 40px;
    text-align: center;
}

.scan-terminal-card {
    border-top: 4px solid var(--primary-yellow);
}

.scan-barcode-input {
    width: 100%;
    background: #1a1a1a;
    border: 2px solid #333;
    font-size: 2.5rem;
    text-align: center;
    padding: 20px;
    color: var(--primary-yellow);
    border-radius: 12px;
    letter-spacing: 5px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.scan-barcode-input:focus {
    border-color: var(--primary-yellow);
    outline: none;
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.2);
}

.scan-verify-action {
    margin-top: 30px;
}

.scan-verify-btn {
    width: 100%;
    border: none;
    cursor: pointer;
    padding: 20px;
}

.scan-log-card {
    margin-top: 30px;
}

.scan-log-head {
    padding: 15px;
    border-bottom: 1px solid var(--border);
}

.scan-log-title {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.scan-log-status-cell {
    text-align: right;
}

.failed-log-container {
    margin-top: 20px;
    border: 1px solid rgba(255, 77, 77, 0.2);
    border-radius: 12px;
    background: rgba(255, 77, 77, 0.05);
    overflow: hidden;
}

.failed-log-head {
    padding: 10px 15px;
    background: rgba(255, 77, 77, 0.1);
    border-bottom: 1px solid rgba(255, 77, 77, 0.2);
}

.failed-log-title {
    margin: 0;
    font-size: 0.75rem;
    color: #ff4d4d;
    letter-spacing: 1px;
}

.failed-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 77, 77, 0.1);
    align-items: center;
}

.failed-row:last-child {
    border-bottom: none;
}

.failed-name {
    color: #ff4d4d;
    font-weight: 800;
    font-size: 0.9rem;
}

.failed-reason {
    font-size: 0.7rem;
    background: #ff4d4d;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.failed-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.failed-time {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.failed-empty {
    padding: 15px;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center;
    margin: 0;
}

/* INVENTORY POS */
.inventory-title-highlight {
    color: var(--primary-yellow);
}

.inventory-new-item-btn {
    text-decoration: none;
}

.pos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 22px;
}

.pos-header-left {
    display: flex;
    align-items: baseline;
    gap: 20px;
    flex-wrap: wrap;
}

/* ── POS Layout ── */
.pos-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 22px;
    margin-top: 20px;
}

/* ── Catalog ── */
.catalog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.catalog-title {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.item-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 14px;
}

.product-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    user-select: none;
}

.product-card:hover {
    background: rgba(255, 184, 0, 0.08);
    border-color: var(--primary-yellow);
    transform: translateY(-5px);
    box-shadow: 0 10px 28px rgba(255, 184, 0, 0.12);
}

.product-card:active {
    transform: scale(0.96);
}

/* Edit / Delete card actions (hidden until hover) */
.card-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 2;
}

.product-card:hover .card-actions {
    opacity: 1;
}

.icon-btn {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 4px 6px;
    cursor: pointer;
    font-size: 0.78rem;
    line-height: 1;
    color: #ccc;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.icon-btn:hover {
    background: var(--primary-yellow);
    color: #000;
    border-color: var(--primary-yellow);
}

.icon-btn-danger:hover {
    background: #e74c3c;
    color: #fff;
    border-color: #e74c3c;
}

.product-icon {
    font-size: 2.4rem;
    line-height: 1;
    margin-bottom: 4px;
}

.product-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
}

.pcard-name {
    font-weight: 700;
    font-size: 0.88rem;
    color: #fff;
    text-align: center;
}

.pcard-price {
    color: var(--primary-yellow);
    font-weight: 900;
    font-size: 0.95rem;
}

.pcard-category {
    color: var(--text-muted);
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.7px;
}

.pcard-stock {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 10px;
    margin-top: 4px;
}

.pcard-stock-ok  { color: #2ecc71; background: rgba(46, 204, 113, 0.12); }
.pcard-stock-low { color: #f39c12; background: rgba(243, 156, 18, 0.15); }
.pcard-stock-out { color: #ff4d4d; background: rgba(255, 77, 77, 0.12); }

/* Low Stock pulse badge */
.product-card.low-stock { border-color: rgba(231, 76, 60, 0.35); }

.product-card.low-stock::after {
    content: 'LOW';
    position: absolute;
    top: 9px;
    right: 9px;
    font-size: 0.52rem;
    font-weight: 900;
    background: #e74c3c;
    padding: 2px 6px;
    border-radius: 4px;
    color: #fff;
    letter-spacing: 0.6px;
    animation: lowStockPulse 1.8s ease-in-out infinite;
}

.product-card.critical-stock { border-color: rgba(255, 77, 77, 0.65); }

.product-card.critical-stock::after {
    content: 'CRITICAL';
    position: absolute;
    top: 9px;
    right: 9px;
    font-size: 0.5rem;
    font-weight: 900;
    background: #ff4d4d;
    padding: 2px 6px;
    border-radius: 4px;
    color: #fff;
    letter-spacing: 0.6px;
    animation: lowStockPulse 1.2s ease-in-out infinite;
}

@keyframes lowStockPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

/* ── Cart Panel ── */
.cart-panel {
    display: flex;
    flex-direction: column;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.btn-clear-cart {
    background: transparent;
    border: 1px solid rgba(255, 77, 77, 0.4);
    color: #ff4d4d;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 8px;
    cursor: pointer;
    letter-spacing: 0.6px;
    transition: background 0.18s;
}

.btn-clear-cart:hover { background: rgba(255, 77, 77, 0.12); }

.cart-list {
    min-height: 120px;
    max-height: 380px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 0;
}

.cart-empty-msg {
    color: var(--text-muted);
    font-size: 0.82rem;
    text-align: center;
    padding: 24px 0;
    margin: 0;
}

.cart-item {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 8px 10px;
}

.cart-item-info   { display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.cart-item-name   { font-weight: 700; font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-unit   { font-size: 0.68rem; color: var(--text-muted); }
.cart-item-total  { font-weight: 900; color: var(--primary-yellow); font-size: 0.85rem; white-space: nowrap; }

.cart-item-controls { display: flex; align-items: center; gap: 4px; }

.qty-btn {
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.15s;
}

.qty-btn:hover { background: rgba(255, 184, 0, 0.15); border-color: var(--primary-yellow); }

.qty-val { min-width: 22px; text-align: center; font-weight: 800; font-size: 0.88rem; }

.cart-remove-btn {
    background: transparent;
    border: none;
    color: rgba(255, 77, 77, 0.6);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color 0.15s;
}

.cart-remove-btn:hover { color: #ff4d4d; }

.cart-summary {
    border-top: 1px solid var(--border);
    padding-top: 16px;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cart-total-line  { display: flex; justify-content: space-between; align-items: center; }
.cart-total-label { font-size: 0.72rem; font-weight: 800; letter-spacing: 1.5px; color: var(--text-muted); text-transform: uppercase; }
.cart-total-value { font-size: 1.8rem; font-weight: 900; color: #fff; transition: color 0.2s; }

.cart-subtotal-line  { display: flex; justify-content: space-between; align-items: center; }
.cart-subtotal-value { font-size: 1rem; font-weight: 700; color: var(--text-muted); }

/* Discount row */
.cart-discount-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    border-top: 1px dashed rgba(255, 77, 77, 0.3);
    border-bottom: 1px dashed rgba(255, 77, 77, 0.3);
    margin: -4px 0;
}

.cart-discount-label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 1.2px;
    color: #e74c3c;
    text-transform: uppercase;
}

.discount-input-field {
    width: 90px;
    background: rgba(255, 77, 77, 0.06);
    border: 1px solid rgba(255, 77, 77, 0.4);
    border-radius: 8px;
    color: #e74c3c;
    font-weight: 800;
    font-size: 0.9rem;
    text-align: right;
    padding: 5px 8px;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
}

.discount-input-field:focus {
    border-color: #e74c3c;
    background: rgba(255, 77, 77, 0.12);
}

/* Hide spinner arrows on discount input */
.discount-input-field::-webkit-inner-spin-button,
.discount-input-field::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.discount-input-field[type=number] { appearance: textfield; -moz-appearance: textfield; }


.cart-checkout-btn { width: 100%; }
.cart-checkout-btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: auto; }

/* ── Bottom Grid (Sales Log + Chart) ── */
.pos-bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    margin-top: 28px;
}

.pos-chart-panel { padding: 20px 24px; }
.pos-chart-wrap  { position: relative; height: 220px; margin-top: 12px; }

.pos-empty-state {
    color: var(--text-muted);
    font-size: 0.88rem;
    padding: 30px;
    text-align: center;
    grid-column: 1 / -1;
}

.inventory-sales-log { margin-top: 0; }
.inventory-modal-input { margin-top: 10px; font-size: 1rem; letter-spacing: normal; }

@media (max-width: 960px) {
    /* Members directory uses .data-table, not .directory-table */
    .table-card .data-table,
    .table-card .data-table tbody,
    .table-card .data-table tr {
        display: block !important;
        width: 100% !important;
    }

    .table-card .data-table thead {
        display: none !important;
    }

    .table-card .data-table tbody tr {
        padding: 15px !important;
        margin-bottom: 10px !important;
        background: #18181b !important;
        border-left: 4px solid var(--y4) !important;
        border-radius: 8px !important;
    }

    .table-card .data-table td {
        display: block !important;
        width: 100% !important;
        padding: 6px 0 !important;
        text-align: left !important;
        border-bottom: none !important;
    }

    .table-card .data-table td:nth-child(2)::before {
        content: 'CONTACT: ';
        color: #71717a;
        font-size: 0.7rem;
        font-weight: 700;
    }

    .table-card .data-table td:nth-child(3)::before {
        content: 'ADDRESS: ';
        color: #71717a;
        font-size: 0.7rem;
        font-weight: 700;
    }

    .table-card .data-table td:nth-child(4)::before {
        content: 'STATUS: ';
        color: #71717a;
        font-size: 0.7rem;
        font-weight: 700;
    }

    .table-card .data-table td:nth-child(5)::before {
        content: 'PLAN: ';
        color: #71717a;
        font-size: 0.7rem;
        font-weight: 700;
    }

    .table-card .data-table td:nth-child(6)::before {
        content: 'ACTIONS: ';
        color: #71717a;
        font-size: 0.7rem;
        font-weight: 700;
        display: block;
        margin-bottom: 6px;
    }

    .pos-layout          { grid-template-columns: 1fr; }
    .pos-bottom-grid     { grid-template-columns: 1fr; }
    .cart-panel          { position: static; }
}


.scan-back-link-wrap {
    margin-top: 30px;
    text-align: center;
}

.scan-back-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
}

/* MODAL STYLES */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #111;
    border: 1px solid #333;
    padding: 30px;
    border-radius: 20px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    animation: modalScale 0.2s ease-out;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.modal-header h3 {
    margin: 0;
}

.modal-body-text {
    margin-top: 15px;
    color: var(--text-muted);
}

.close-btn {
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-muted);
}

.close-btn:hover {
    color: var(--text-main);
}

.gym-input-large {
    width: 100%;
    background: #1a1a1a;
    border: 1px solid #333;
    padding: 15px;
    font-size: 1.5rem;
    color: var(--primary-yellow);
    text-align: center;
    border-radius: 10px;
    margin-top: 10px;
}

.modal-input-label {
    display: block;
    margin-top: 15px;
    font-size: 0.8rem;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-secondary {
    flex: 1;
    background: transparent;
    color: var(--text-main);
    border: 1px solid #555;
    padding: 15px;
    font-weight: 700;
    border-radius: 10px;
}

/* --- SUBSCRIPTION HISTORY STYLING --- */
.data-table tbody tr:first-child {
    background: rgba(241, 196, 15, 0.08);
    border-left: 3px solid var(--primary-yellow);
}

.data-table th {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 15px;
    border-bottom: 1px solid var(--border);
}

.empty-state {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-muted);
    font-style: italic;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
}

.stat-card .value {
    letter-spacing: -1px;
    color: var(--primary-yellow);
    font-variant-numeric: tabular-nums;
    animation: fadeInUp 0.5s ease-out forwards;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.value-positive {
    color: #2ecc71 !important;
    text-shadow: 0 0 10px rgba(46, 204, 113, 0.2);
}

.btn-view-profile {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 700;
    transition: all 0.2s ease;
}

.btn-view-profile:hover {
    background: var(--primary-yellow);
    color: #000;
    border-color: var(--primary-yellow);
}

.member-name-link {
    color: var(--text-main);
    text-decoration: none;
    border-bottom: 1px dashed rgba(241, 196, 15, 0.35);
}

.member-name-link:hover {
    color: var(--primary-yellow);
    border-bottom-color: var(--primary-yellow);
}

.edit-member-page {
    max-width: 720px;
    margin: 0 auto;
}

.edit-member-form-card {
    padding: 30px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 15px;
}

.form-margin-top {
    margin-top: 15px;
}

.form-group label {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.form-control {
    width: 100%;
    background: #1a1a1a;
    border: 1px solid var(--border);
    color: #fff;
    padding: 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary-yellow);
    box-shadow: 0 0 5px rgba(241, 196, 15, 0.2);
}

.edit-member-actions {
    margin-top: 30px;
    display: flex;
    gap: 10px;
}

.edit-member-save {
    flex: 2;
}

.edit-member-cancel {
    flex: 1;
    text-align: center;
    text-decoration: none;
    padding: 12px;
}

.reports-export-btn {
    background: #3498db;
    margin-bottom: 20px;
    display: inline-block;
    text-decoration: none;
}

.reports-filter-card {
    padding: 16px 20px;
    margin-bottom: 16px;
}

.reports-preset-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.reports-preset-btn {
    text-decoration: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    transition: all 0.2s ease;
}

.reports-preset-btn:hover,
.reports-preset-btn.active {
    border-color: var(--primary-yellow);
    color: #000;
    background: var(--primary-yellow);
}

.reports-filter-form {
    margin: 0;
}

.reports-filter-row {
    display: grid;
    grid-template-columns: auto 140px auto 1fr auto 1fr auto;
    gap: 10px;
    align-items: center;
}

.reports-filter-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.reports-filter-select,
.reports-filter-date {
    background: #1a1a1a;
    border: 1px solid var(--border);
    color: #fff;
    border-radius: 6px;
    padding: 10px;
    font-size: 0.85rem;
}

.reports-fin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card.highlight-green {
    border-left: 4px solid #2ecc71;
}

.reports-grid-layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
}

.reports-plan-card {
    padding: 20px;
}

.reports-plan-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.report-summary-item {
    padding: 12px 0;
    border-bottom: 1px solid #222;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.reports-trans-title {
    padding: 20px;
}

.reports-transactions-card {
    margin-top: 20px;
}

.reports-expense-grid {
    margin-top: 20px;
}

.trend-track {
    width: 100%;
    background: #222;
    height: 8px;
    border-radius: 10px;
}

.trend-bar {
    height: 8px;
    border-radius: 10px;
    background: #2ecc71;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.3);
}

.value-small {
    font-size: 1.2rem;
    font-weight: 700;
}

.btn-delete-small {
    background: none;
    color: #ff4d4d;
    border: none;
    padding: 5px;
    border-radius: 4px;
    font-size: 0.85rem;
    line-height: 1;
    opacity: 0.5;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-delete-small:hover {
    opacity: 1;
    transform: scale(1.2);
    text-shadow: 0 0 8px rgba(255, 77, 77, 0.4);
}

.btn-edit-small {
    background: none;
    color: #6ec1ff;
    border: none;
    padding: 5px;
    border-radius: 4px;
    font-size: 0.8rem;
    line-height: 1;
    opacity: 0.65;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-edit-small:hover {
    opacity: 1;
    transform: scale(1.15);
    text-shadow: 0 0 8px rgba(110, 193, 255, 0.35);
}

.settings-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

tr.deleting,
.failed-row.deleting {
    background-color: rgba(255, 77, 77, 0.1) !important;
    pointer-events: none;
    transition: all 0.35s ease;
}

.btn-confirm {
    flex: 1;
    background: var(--primary-yellow);
    color: black;
    border: none;
    padding: 12px;
    font-weight: 900;
    border-radius: 8px;
    cursor: pointer;
}

@keyframes modalScale {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.payment-toast, .toast-welcome {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 30px;
    border-radius: 50px;
    font-weight: 900;
    z-index: 10000;
    animation: slideIn 0.5s ease;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    color: #fff;
}

.payment-toast {
    background: #2ecc71; /* Green — money */
}

.toast-welcome {
    background: #3498db; /* Blue — check-in */
}

/* Settings page */
.settings-page {
    max-width: 900px;
    margin: 0 auto;
}

.settings-highlight {
    color: var(--primary-yellow);
}

.settings-card {
    padding: 30px;
}

.settings-grid-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.settings-card-master {
    border-left: 4px solid var(--primary-yellow);
}

.settings-inline-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin-bottom: 16px;
}

.settings-inline-form-3 {
    grid-template-columns: 1.2fr 0.8fr 0.6fr auto;
}

.settings-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.settings-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    margin-bottom: 8px;
}

.settings-list li:hover {
    border-color: rgba(241, 196, 15, 0.3);
    background: rgba(241, 196, 15, 0.06);
}

.settings-list-empty {
    color: var(--text-muted);
    justify-content: center !important;
    font-size: 0.9rem;
}

.plan-info {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
    background: rgba(255, 255, 255, 0.02);
    border-left: 3px solid var(--primary-yellow);
    border-radius: 8px;
    padding: 10px 12px;
}

.plan-name {
    font-weight: 800;
    color: var(--primary-yellow);
    text-transform: uppercase;
    letter-spacing: 0.7px;
}

.plan-days {
    color: #8f8f8f;
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.settings-card-import {
    border-left: 4px solid var(--primary-yellow);
}

.settings-card-status {
    margin-top: 20px;
    border-left: 4px solid #3498db;
}

.settings-card-title {
    margin-top: 0;
    color: var(--primary-yellow);
    letter-spacing: 1px;
    font-size: 1.1rem;
    text-transform: uppercase;
}

.settings-action-wrap {
    margin-top: 25px;
}

.settings-import-btn {
    padding: 15px 30px;
}

.settings-alert {
    margin-bottom: 16px;
    padding: 14px 16px;
    font-weight: 700;
    border-left: 5px solid;
}

.settings-alert-success {
    border-left-color: #2ecc71;
    color: #2ecc71;
}

.settings-alert-danger {
    border-left-color: #ff4d4d;
    color: #ff4d4d;
}

.btn-secondary:disabled {
    background: #222;
    color: #444;
    cursor: not-allowed;
    border: 1px solid #333;
}

@media (max-width: 1000px) {
    .settings-grid-two {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .settings-inline-form,
    .settings-inline-form-3 {
        grid-template-columns: 1fr;
    }
}

@keyframes slideIn {
    from {
        transform: translateX(30px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* PROGRESS BAR STYLES */
.progress-cell {
    min-width: 150px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    margin-bottom: 5px;
    font-weight: 700;
    color: var(--text-muted);
}

.progress-bg {
    width: 100%;
    height: 8px;
    background: #222;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #333;
}

.progress-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease-in-out;
}

.progress-fill.high {
    background: #2ecc71;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.3);
}

.progress-fill.mid {
    background: #f1c40f;
    box-shadow: 0 0 10px rgba(241, 196, 15, 0.3);
}

.progress-fill.low {
    background: #ff4d4d;
    box-shadow: 0 0 10px rgba(255, 77, 77, 0.3);
}

.progress-fill.frozen {
    background: repeating-linear-gradient(
        45deg,
        #3498db,
        #3498db 10px,
        #4aa3df 10px,
        #4aa3df 20px
    );
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
}

.progress-fill.dormant {
    background: #2a2a2a;
    box-shadow: none;
    border: 1px solid #333;
}

.profile-health-section {
    margin-top: 18px;
    text-align: left;
}

.profile-health-warning {
    margin-top: 10px;
    font-size: 0.68rem;
    color: #ff6b6b;
    letter-spacing: 0.4px;
    font-weight: 700;
    background: rgba(255, 77, 77, 0.08);
    border-left: 3px solid rgba(255, 77, 77, 0.5);
    padding: 6px 10px;
    border-radius: 0 4px 4px 0;
}

/* COMMAND CENTER DASHBOARD */
.dashboard-wrapper {
    padding: 6px;
    background:
        radial-gradient(circle at 20% 0%, rgba(241, 196, 15, 0.08), transparent 45%),
        radial-gradient(circle at 90% 100%, rgba(46, 204, 113, 0.08), transparent 40%);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}

.dashboard-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.glow-text {
    margin: 0;
    font-size: 2.1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 0 15px rgba(241, 196, 15, 0.35);
}

.text-yellow {
    color: var(--primary-yellow);
}

.text-muted {
    color: var(--text-muted);
    margin: 6px 0 0;
}

.live-indicator {
    border: 1px solid rgba(46, 204, 113, 0.35);
    background: rgba(46, 204, 113, 0.07);
    color: #9ef3be;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.dashboard-wrapper .pulse-dot {
    height: 10px;
    width: 10px;
    margin-right: 8px;
}

.ai-command-status {
    color: var(--primary-yellow);
    font-size: 0.72rem;
    letter-spacing: 1.2px;
    font-family: "Courier New", monospace;
}

.ai-command-launcher {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 18px 0 22px;
    padding: 18px 20px;
    border-radius: 18px;
    border: 1px solid rgba(241, 196, 15, 0.24);
    background:
        linear-gradient(160deg, rgba(10, 10, 12, 0.96), rgba(20, 20, 24, 0.9)),
        radial-gradient(circle at 0% 50%, rgba(241, 196, 15, 0.08), transparent 35%);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
}

.ai-launch-copy {
    margin: 8px 0 0;
    color: rgba(255, 255, 255, 0.72);
    max-width: 640px;
    line-height: 1.6;
}

.ai-launch-btn {
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #f1c40f, #ffd84d);
    color: #111;
    padding: 12px 20px;
    min-width: 132px;
    font-weight: 900;
    letter-spacing: 0.8px;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(241, 196, 15, 0.2);
}

.ai-insight-bar {
    background: rgba(250, 204, 21, 0.05);
    border: 1px solid rgba(250, 204, 21, 0.2);
    border-left: 4px solid var(--primary-yellow);
    padding: 12px 20px;
    margin-bottom: 26px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.insight-label {
    font-family: "Courier New", monospace;
    color: var(--primary-yellow);
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 1px;
    white-space: nowrap;
}

.insight-ticker {
    color: #e4e4e7;
    font-size: 13px;
    font-style: italic;
    animation: fade-slide-in 1s ease-out;
}

.insight-ticker.insight-ticker-urgent {
    color: #ff8d8d;
    text-shadow: 0 0 12px rgba(255, 77, 77, 0.2);
}

.retention-status {
    display: flex;
    gap: 12px;
    margin: 0 0 18px;
    flex-wrap: wrap;
}

.retention-chip {
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 15px;
    border-radius: 6px;
    font-family: "Courier New", monospace;
    font-size: 11px;
    border-left: 3px solid #71717a;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.retention-chip:hover {
    background: rgba(255, 255, 255, 0.09);
    transform: translateY(-1px);
}

.retention-chip.expired {
    border-left-color: #ef4444;
}

.retention-chip.soon {
    border-left-color: #f59e0b;
}

.retention-chip.warning {
    border-left-color: #3b82f6;
}

.chip-label {
    color: rgba(255, 255, 255, 0.72);
}

.chip-value {
    font-weight: 800;
    margin-left: 5px;
    color: #fff;
}

.chip-dl {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 12px;
    text-decoration: none;
    line-height: 1;
    transition: background 0.2s, color 0.2s;
    cursor: pointer;
}

.chip-dl:hover {
    background: var(--primary-yellow, #f5c518);
    color: #111;
}

.expiry-action-panel {
    margin-bottom: 24px;
    border: 1px solid rgba(255, 77, 77, 0.35);
    border-left: 4px solid #ff4d4d;
    border-radius: 12px;
    background: linear-gradient(160deg, rgba(32, 10, 10, 0.9), rgba(18, 12, 12, 0.9));
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.26);
}

.action-tray {
    margin-top: 28px;
}

.action-tray-header {
    padding: 12px 16px 10px;
    margin-bottom: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.action-tray-header h3 {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    letter-spacing: 2px;
    color: var(--primary-yellow, #f5c518);
    margin: 0;
}

.action-tray-header p {
    font-size: 11px;
    color: #71717a;
    margin: 4px 0 0;
}

.filter-controls {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.risk-filter-btn {
    border: 1px solid rgba(245, 197, 24, 0.45);
    background: rgba(255, 255, 255, 0.04);
    color: #d7d7d7;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.risk-filter-btn:hover {
    border-color: rgba(245, 197, 24, 0.8);
    color: #fff;
}

.risk-filter-btn.active {
    background: rgba(245, 197, 24, 0.92);
    color: #111;
    border-color: #f5c518;
}

.expiry-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 77, 77, 0.2);
}

.expiry-title {
    color: #ff8d8d;
    font-weight: 900;
    letter-spacing: 0.8px;
    font-size: 0.78rem;
}

.expiry-badge {
    min-width: 26px;
    text-align: center;
    color: #fff;
    background: #ff4d4d;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
}

.expiry-table-wrap {
    overflow-x: auto;
}

.expiry-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    font-size: 0.98rem;
}

.expiry-table thead th {
    color: #71717a;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    font-size: 0.79rem;
    font-weight: 800;
    text-align: left;
    padding: 12px 15px 15px;
    border-bottom: 2px solid rgba(241, 196, 15, 0.55);
}

.expiry-table tbody td {
    color: #f1f1f1;
    padding: 16px 15px;
    border: none;
    background: rgba(255, 255, 255, 0.02);
    font-size: 1.03rem;
    vertical-align: middle;
}

.expiry-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.05);
}

.expiry-table tbody tr td {
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.08);
}

.expiry-table tbody td:first-child {
    border-radius: 10px 0 0 10px;
    font-weight: 800;
    font-size: 1.12rem;
}

.expiry-table tbody td:last-child {
    border-radius: 0 10px 10px 0;
}

.expiry-status {
    display: inline-block;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.7px;
}

.expiry-status.expired {
    color: #ffd8d8;
    background: rgba(255, 77, 77, 0.25);
}

.expiry-status.today {
    color: #ffe7b3;
    background: rgba(243, 156, 18, 0.25);
}

.expiry-status.upcoming {
    color: #cfe6ff;
    background: rgba(59, 130, 246, 0.28);
}

.expiry-actions {
    white-space: nowrap;
}

.expiry-action-links {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.last-contacted {
    display: block;
    margin-top: 6px;
    font-size: 0.74rem;
    color: #a1a1aa;
    letter-spacing: 0.25px;
}

.expiry-mini-stack {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.expiry-plan-name {
    display: block;
    color: #e7e7e7;
    font-weight: 800;
    font-size: 0.94rem;
    letter-spacing: 0.4px;
}

.risk-progress {
    width: 100%;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.risk-progress-bar {
    height: 100%;
    border-radius: 999px;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
    transition: width 0.6s ease;
}

.risk-progress.overdue .risk-progress-bar {
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.65);
}

.risk-day-label {
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.6px;
}

.risk-expiry-date {
    color: var(--primary-yellow);
    font-weight: 900;
    letter-spacing: 0.5px;
}

.expiry-table tr.animate-in {
    animation: rowFadeIn 0.28s ease-out;
}

@keyframes rowFadeIn {
    from {
        opacity: 0;
        transform: translateY(3px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.expiry-btn {
    display: inline-block;
    text-decoration: none;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.82rem;
    font-weight: 700;
    margin-right: 6px;
}

@media (max-width: 1100px) {
    .expiry-table thead th:nth-child(4),
    .expiry-table tbody td:nth-child(4) {
        display: none;
    }
}

@media (max-width: 900px) {
    .expiry-table {
        min-width: 560px;
    }

    .expiry-table thead th:nth-child(2),
    .expiry-table tbody td:nth-child(2) {
        display: none;
    }

    .expiry-table tbody td {
        font-size: 0.95rem;
        padding: 13px 12px;
    }

    .expiry-table tbody td:first-child {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    html,
    body {
        display: block;
        overflow-x: hidden;
        width: 100%;
    }

    .dashboard-container,
    .main-content,
    .table-container,
    .table-card,
    .expiry-table-wrap,
    .action-tray {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box;
    }

    /* Action tray (full-width retention table) keeps zero side padding */
    .action-tray {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Page header — stack title and action buttons vertically */
    .page-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }

    .page-header > div {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .page-header .btn-primary,
    .page-header .btn-outline,
    .page-header .btn-secondary,
    .page-header .btn-view-profile {
        flex: 1 1 calc(50% - 8px) !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }

    /* Members page — search input + button full-width */
    .search-flex {
        flex-direction: column !important;
        gap: 8px !important;
    }

    .search-flex input,
    .search-flex .btn-search {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .sidebar {
        position: sticky !important;
        top: 0;
        width: 100% !important;
        height: auto !important;
        padding: 10px !important;
        margin-bottom: 12px;
        border-right: none;
        border-bottom: 1px solid var(--border);
        border-radius: 10px;
    }

    .logo-area {
        padding: 10px 12px;
    }

    .side-nav {
        flex-direction: row;
        overflow-x: auto;
        gap: 6px;
        padding: 6px 8px 10px;
    }

    .nav-item {
        margin: 0;
        padding: 10px 12px;
        min-width: max-content;
    }

    .nav-item .nav-text,
    .logo-text {
        display: none;
    }

    .btn-toggle {
        display: none;
    }

    .sidebar-footer {
        display: none;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
        padding: 0 12px !important;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    body.sidebar-collapsed .main-content {
        margin-left: 0;
        width: 100%;
    }

    body.sidebar-collapsed .sidebar {
        width: 100%;
    }

    .hero-stats,
    .stats-grid,
    .dashboard-grid,
    .analytics-grid {
        grid-template-columns: 1fr !important;
    }

    .stat-card,
    .hero-card,
    .mini-card,
    .glass-panel {
        width: 100% !important;
        box-sizing: border-box;
    }

    .expiry-table {
        display: block !important;
        width: 100% !important;
        min-width: 0;
        border-spacing: 0 10px;
        border: none !important;
    }

    .expiry-table tbody {
        display: block;
        width: 100%;
    }

    .expiry-table thead {
        display: none;
    }

    .expiry-table tbody tr {
        display: flex;
        flex-direction: column;
        width: 100% !important;
        box-sizing: border-box;
        margin: 0 0 12px 0 !important;
        gap: 2px;
        padding: 12px;
        background: #18181b;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 12px;
    }

    .expiry-table tbody td {
        display: block;
        width: 100%;
        text-align: left;
        position: static;
        padding: 2px 0 !important;
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
        font-size: 0.96rem;
    }

    .expiry-table tbody td:first-child {
        border-radius: 0;
    }
    .expiry-table tbody td:last-child {
        border-radius: 0;
    }

    .expiry-table tbody td:nth-child(1) {
        font-size: 1.15rem;
        font-weight: 700;
        color: #ffffff;
        line-height: 1.25;
        margin-bottom: 1px;
    }

    .expiry-table tbody td:nth-child(2) {
        font-size: 0.86rem;
        color: #a1a1aa;
        margin-bottom: 3px;
        display: block !important;
        width: 100% !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border-radius: 8px;
        padding: 10px !important;
        margin: 8px 0;
        text-align: left !important;
        border: 1px solid rgba(241, 196, 15, 0.2) !important;
    }

    .expiry-table tbody td:nth-child(3) {
        display: inline-block;
        width: auto !important;
        font-size: 0.85rem;
        color: #a1a1aa;
        margin-right: 10px;
        margin-bottom: 2px;
    }

    .expiry-table tbody td:nth-child(4) {
        width: 100% !important;
        box-sizing: border-box;
        margin: 10px 0;
        padding: 12px !important;
        background: rgba(241, 196, 15, 0.1) !important;
        border-radius: 8px;
        border: 1px solid rgba(241, 196, 15, 0.2) !important;
    }

    .expiry-table tbody td:last-child {
        margin-top: 8px;
    }

    .expiry-action-links {
        width: 100%;
        gap: 8px;
    }

    .expiry-action-links .expiry-btn {
        flex: 1;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 12px !important;
        margin-right: 0;
        font-size: 0.95rem;
        font-weight: 700;
    }

    .last-contacted {
        margin-top: 8px;
        font-size: 0.78rem;
    }

    .risk-expiry-date {
        display: block;
        margin-top: 3px;
        padding: 6px;
        background: rgba(241, 196, 15, 0.15);
        border: 1px solid rgba(241, 196, 15, 0.3);
        border-radius: 6px;
        font-size: 1.1rem;
        font-weight: 800;
        color: var(--primary-yellow);
        text-transform: uppercase;
        letter-spacing: 1px;
        text-align: center;
        width: 100%;
    }

    .expiry-plan-name {
        font-size: 0.85rem;
        color: #a1a1aa;
        font-weight: 600;
    }

    .risk-progress {
        height: 3px;
        margin-top: 2px;
    }

    .risk-day-label {
        font-size: 0.82rem;
    }

    .expiry-table tbody td:nth-child(2)::before {
        content: "STATUS / COUNTDOWN";
        display: block;
        font-size: 0.7rem;
        color: #71717a;
        margin-bottom: 5px;
        font-weight: 700;
        letter-spacing: 0.8px;
        text-transform: uppercase;
    }


    /* Profile page — stack cards vertically */
    .profile-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important;
        width: 100% !important;
    }

    .membership-card,
    .contact-card,
    .info-box {
        width: 100% !important;
        min-width: 100% !important;
        margin: 0 0 10px 0 !important;
        box-sizing: border-box !important;
    }

    .contact-card {
        padding: 15px !important;
    }

    .contact-number {
        font-size: 1.2rem !important;
        word-break: break-all;
    }
}

@media (max-width: 520px) {
    .expiry-table tbody td {
        font-size: 0.95rem;
    }

    .expiry-table tbody td:nth-child(1) {
        font-size: 1.08rem;
    }
}

.expiry-btn.wa {
    color: #8df7b8;
    border-color: rgba(46, 204, 113, 0.45);
    background: rgba(46, 204, 113, 0.08);
}

.expiry-btn.disabled {
    opacity: 0.45;
    pointer-events: none;
}

.insight-ticker.is-refresh {
    animation: fade-slide-in 0.6s ease-out;
}

@keyframes fade-slide-in {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.ai-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
    z-index: 9997;
}

.ai-sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.ai-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: min(420px, 100vw);
    height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    background:
        linear-gradient(180deg, rgba(11, 11, 14, 0.95), rgba(17, 17, 22, 0.92)),
        radial-gradient(circle at 0% 0%, rgba(241, 196, 15, 0.1), transparent 30%);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-left: 1px solid rgba(241, 196, 15, 0.3);
    box-shadow: -26px 0 50px rgba(0, 0, 0, 0.38);
    transform: translateX(100%);
    transition: transform 0.45s cubic-bezier(0.19, 1, 0.22, 1);
    z-index: 9998;
}

.ai-sidebar.active {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 22px 18px;
    border-bottom: 1px solid rgba(241, 196, 15, 0.12);
}

.sidebar-title {
    color: var(--primary-yellow);
    font-family: "Courier New", monospace;
    font-size: 0.82rem;
    letter-spacing: 2px;
    font-weight: 800;
    text-transform: uppercase;
}

.sidebar-meta {
    margin-top: 6px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.75rem;
    letter-spacing: 0.8px;
}

.close-btn {
    border: 1px solid rgba(241, 196, 15, 0.18);
    background: rgba(255, 255, 255, 0.03);
    color: var(--primary-yellow);
    width: 40px;
    height: 40px;
    border-radius: 999px;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.sidebar-body {
    padding: 20px 22px;
    overflow-y: auto;
}

.system-status {
    color: rgba(241, 196, 15, 0.84);
    font-family: "Courier New", monospace;
    font-size: 0.72rem;
    letter-spacing: 1.5px;
    margin-bottom: 16px;
}

.sidebar-response {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(241, 196, 15, 0.1);
    border-left: 4px solid var(--primary-yellow);
    border-radius: 12px;
    padding: 18px 16px;
    min-height: 220px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.sidebar-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 18px 22px 24px;
    border-top: 1px solid rgba(241, 196, 15, 0.12);
    background: rgba(9, 9, 11, 0.55);
}

.sidebar-footer input {
    min-width: 0;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: #fff;
    padding: 13px 14px;
    outline: none;
}

.sidebar-footer input:focus {
    border-color: rgba(241, 196, 15, 0.45);
    box-shadow: 0 0 0 3px rgba(241, 196, 15, 0.12);
}

.exec-btn {
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #f1c40f, #ffd84d);
    color: #111;
    min-width: 96px;
    padding: 12px 16px;
    font-weight: 900;
    letter-spacing: 1px;
    cursor: pointer;
}

.exec-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.ai-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    color: var(--primary-yellow);
    font-size: 0.75rem;
    letter-spacing: 2px;
    font-weight: 800;
    text-transform: uppercase;
}

.ai-header span {
    animation: pulse-icon 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    font-size: 1.1rem;
}

@keyframes pulse-icon {
    0%, 100% {
        opacity: 1;
        filter: drop-shadow(0 0 4px rgba(241, 196, 15, 0.4));
    }
    50% {
        opacity: 0.7;
        filter: drop-shadow(0 0 8px rgba(241, 196, 15, 0.2));
    }
}

.ai-stat {
    color: var(--primary-yellow);
    font-weight: 700;
    background: rgba(250, 204, 21, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.ai-keyword-highlight {
    color: var(--primary-yellow);
    background: rgba(250, 204, 21, 0.1);
    padding: 2px 4px;
    font-weight: 700;
    border-radius: 4px;
}

.ai-list-index {
    color: rgba(255, 255, 255, 0.62);
    font-weight: 700;
}

.ai-body {
    margin-top: 8px;
    color: #f4f4f5;
    line-height: 1.75;
}

.ai-body.is-error,
.ai-header.is-error {
    color: #ff7b7b;
}

.ai-stream-line {
    width: 100%;
    height: 1px;
    margin: 8px 0 14px;
    background: linear-gradient(90deg, rgba(241, 196, 15, 0), rgba(241, 196, 15, 0.85), rgba(241, 196, 15, 0));
    animation: command-scan 1.5s linear infinite;
}

@keyframes command-scan {
    0% {
        transform: scaleX(0.35);
        opacity: 0.35;
    }
    50% {
        transform: scaleX(1);
        opacity: 1;
    }
    100% {
        transform: scaleX(0.35);
        opacity: 0.35;
    }
}

#aiResponseText h3 {
    color: var(--primary-yellow);
    font-size: 1.05rem;
    border-bottom: 1px solid rgba(250, 204, 21, 0.3);
    padding-bottom: 5px;
    margin-top: 18px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

#aiResponseText p {
    margin: 0 0 10px;
    line-height: 1.65;
}

#aiResponseText ul {
    list-style: none;
    padding-left: 10px;
    margin: 0 0 12px;
}

#aiResponseText li {
    margin-bottom: 8px;
    position: relative;
    padding-left: 20px;
    line-height: 1.6;
}

#aiResponseText li::before {
    content: ">";
    position: absolute;
    left: 0;
    color: var(--primary-yellow);
    font-weight: 700;
}

@media (max-width: 900px) {
    .ai-command-launcher {
        align-items: stretch;
        flex-direction: column;
    }

    .ai-insight-bar {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .retention-status {
        gap: 8px;
    }

    .expiry-table {
        min-width: 640px;
    }

    .ai-launch-btn {
        width: 100%;
    }

    .ai-sidebar {
        width: 100vw;
    }
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin: 24px 0;
}

.hero-card {
    background: linear-gradient(155deg, rgba(22, 22, 22, 0.95), rgba(8, 8, 8, 0.97));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.34);
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.hero-card:hover {
    transform: translateY(-4px);
    border-color: rgba(241, 196, 15, 0.55);
}

.hero-card .icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    background: rgba(241, 196, 15, 0.12);
    color: var(--primary-yellow);
    border: 1px solid rgba(241, 196, 15, 0.28);
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 0.72rem;
    letter-spacing: 0.35px;
    text-align: center;
    line-height: 1.05;
    padding: 6px;
    overflow-wrap: anywhere;
}

.hero-info .label {
    color: var(--text-muted);
    letter-spacing: 1.2px;
    font-size: 0.72rem;
}

.value-large {
    font-size: 2.1rem;
    margin: 4px 0 0;
    line-height: 1.1;
    color: #fff;
}

.active-pill {
    margin: 8px 0 0;
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    border: 1px solid rgba(46, 204, 113, 0.3);
    display: inline-flex;
    align-items: center;
    width: fit-content;
}

.active-pill::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #2ecc71;
    border-radius: 50%;
    margin-right: 8px;
    box-shadow: 0 0 8px #2ecc71;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 18px;
}

.glass-panel {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 20px;
    backdrop-filter: blur(12px);
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.3);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.panel-header h3 {
    margin: 0;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.badge-yellow {
    color: #000;
    background: var(--primary-yellow);
    border-radius: 999px;
    font-size: 0.65rem;
    padding: 5px 10px;
    font-weight: 800;
}

.link-yellow {
    color: var(--primary-yellow);
    text-decoration: none;
    font-size: 0.74rem;
    font-weight: 700;
}

.activity-feed {
    max-height: 356px;
    overflow-y: auto;
    padding-right: 4px;
}

.feed-item {
    display: grid;
    grid-template-columns: 62px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.feed-item:last-child {
    border-bottom: 0;
}

.feed-time {
    color: var(--primary-yellow);
    font-size: 0.78rem;
    font-weight: 800;
}

.feed-content {
    min-width: 0;
}

.feed-content .name {
    display: block;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: help;
}

.feed-content .meta {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: help;
}

.feed-status {
    font-size: 0.66rem;
    font-weight: 800;
    border-radius: 999px;
    padding: 4px 10px;
    text-transform: uppercase;
}

.feed-status.active {
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.45);
    background: rgba(46, 204, 113, 0.08);
}

.feed-status.inactive {
    color: #ff8f8f;
    border: 1px solid rgba(231, 76, 60, 0.45);
    background: rgba(231, 76, 60, 0.12);
}

.feed-status.grace {
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.1);
}

.feed-status.guest {
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.45);
    background: rgba(56, 189, 248, 0.08);
}

.feed-status.pending {
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.45);
    background: rgba(251, 191, 36, 0.08);
}

.feed-status.blocked {
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.1);
}

.feed-status.expired {
    color: #fb923c;
    border: 1px solid rgba(251, 146, 60, 0.45);
    background: rgba(251, 146, 60, 0.08);
}

/* Feed progress bars */
.feed-item-bar .feed-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

.feed-progress-wrap {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.07);
    border-radius: 999px;
    overflow: hidden;
}

.feed-progress {
    height: 100%;
    border-radius: 999px;
    transition: width 0.6s ease;
}

.feed-day-label {
    font-size: 0.6rem;
    font-weight: 700;
    color: rgba(255,255,255,0.45);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.feed-day-label.grace-label  { color: #f59e0b; }
.feed-day-label.blocked-label { color: #ef4444; }
.feed-day-label.pending-label { color: #fbbf24; }

.chart-placeholder {
    min-height: 330px;
    display: flex;
    align-items: flex-end;
}

.bar-container {
    width: 100%;
    height: 260px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    align-items: flex-end;
    gap: 12px;
}

.bar-wrap {
    display: grid;
    align-items: flex-end;
    justify-items: center;
    gap: 8px;
    height: 100%;
}

.bar {
    width: 100%;
    max-width: 42px;
    min-height: 12%;
    border-radius: 10px 10px 4px 4px;
    background: linear-gradient(180deg, #f7d44e 0%, #f1c40f 52%, #b6920d 100%);
    box-shadow: 0 0 18px rgba(241, 196, 15, 0.25);
    transition: transform 0.2s ease;
}

.bar:hover {
    transform: scaleY(1.06);
}

.bar-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

@media (max-width: 1200px) {
    .hero-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .analytics-grid {
        grid-template-columns: 1fr;
    }
    .mini-stats-strip {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 640px) {
    .mini-stats-strip {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .main-content {
        padding: 20px;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-header-right {
        align-items: stretch;
    }

    .hero-stats {
        grid-template-columns: 1fr;
    }

    .value-large {
        font-size: 1.85rem;
    }

    .hero-card .icon {
        width: 58px;
        height: 58px;
        font-size: 0.64rem;
        letter-spacing: 0.2px;
    }
}

/* --- Report Actions Row --- */
/* --- Live Member Search --- */
.search-container {
    position: relative;
    max-width: 420px;
    margin-bottom: 16px;
}

.search-container::before {
    content: '\1F50D';
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--y4);
    font-size: 0.95rem;
    pointer-events: none;
    z-index: 2;
}

.search-container .form-control {
    width: 100%;
    padding-left: 42px;
    box-sizing: border-box;
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 8px;
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.search-item {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.2s;
}

.search-item:last-child {
    border-bottom: none;
}

.search-item a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.search-item:hover {
    background: rgba(241, 196, 15, 0.1);
}

.search-item.autocomplete-active {
    background: #facc15;
}

.search-item.autocomplete-active .search-name,
.search-item.autocomplete-active .search-meta {
    color: #09090b;
}

.search-name {
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--primary-yellow);
}

.search-meta {
    font-size: 0.7rem;
    color: #888;
}

/* --- Report Actions Row --- */
.report-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn-outline {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: background 0.2s, border-color 0.2s;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #fff;
    color: #fff;
}

/* --- Staff Command Chat --- */
.staff-chat-toggle {
    position: fixed;
    right: 24px;
    bottom: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    background: var(--primary-yellow);
    color: #101010;
    cursor: pointer;
    z-index: 1500;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    border-radius: 999px;
    border: 2px solid #18181b;
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.staff-chat-window {
    position: fixed;
    right: 24px;
    bottom: 92px;
    width: 340px;
    height: 460px;
    background: #171717;
    border: 1px solid rgba(241, 196, 15, 0.65);
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    display: none;
    z-index: 1499;
    overflow: hidden;
}

.staff-chat-window.open {
    display: flex;
    flex-direction: column;
}

.staff-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: linear-gradient(120deg, #f1c40f, #d9ab00);
    color: #131313;
    font-weight: 800;
    letter-spacing: 0.4px;
}

.staff-chat-close {
    border: none;
    background: transparent;
    color: inherit;
    font-size: 1.35rem;
    cursor: pointer;
    line-height: 1;
}

.staff-chat-identity {
    padding: 8px 12px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.staff-chat-identity label {
    color: #b4b4b4;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.staff-chat-identity input {
    background: #27272a;
    border: 1px solid #3f3f46;
    color: #fff;
    border-radius: 6px;
    padding: 7px 9px;
    font-size: 0.85rem;
}

.staff-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.staff-chat-msg {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 3px solid var(--primary-yellow);
    border-radius: 9px;
    padding: 8px 9px;
    background: rgba(255, 255, 255, 0.02);
}

.staff-chat-msg-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.staff-chat-sender {
    color: var(--primary-yellow);
    font-weight: 700;
    font-size: 0.78rem;
}

.staff-chat-time {
    color: #8a8a8a;
    font-size: 0.72rem;
}

.staff-chat-content {
    color: #e8e8e8;
    font-size: 0.83rem;
    line-height: 1.35;
    white-space: pre-wrap;
    word-break: break-word;
}

.staff-chat-compose {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.staff-chat-compose input {
    background: #27272a;
    border: 1px solid #3f3f46;
    color: #fff;
    border-radius: 7px;
    padding: 9px 10px;
    font-size: 0.85rem;
}

.staff-chat-compose button {
    border: none;
    border-radius: 7px;
    background: var(--primary-yellow);
    color: #121212;
    padding: 0 12px;
    cursor: pointer;
    font-weight: 800;
}

@media (max-width: 768px) {
    .staff-chat-window {
        right: 12px;
        left: 12px;
        width: auto;
        height: 62vh;
        bottom: 86px;
    }

    .staff-chat-toggle {
        right: 14px;
        bottom: 14px;
    }
}

.btn-danger-outline {
    color: #ff4d4d;
    border-color: #ff4d4d;
    cursor: pointer;
}

.btn-danger-outline:hover {
    background: rgba(255, 77, 77, 0.12);
    border-color: #ff4d4d;
    color: #ff4d4d;
}

/* Danger Zone section */
.danger-zone {
    margin-top: 50px;
    border-top: 1px solid #2a2a2a;
    padding-top: 20px;
}

.danger-zone-label {
    color: #555;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.report-pdf-btn {
    background: #c0392b !important;
    text-decoration: none;
    display: inline-block;
    font-size: 0.8rem;
}

.report-pdf-btn:hover {
    background: #e74c3c !important;
}

.btn-primary.report-pdf-btn:hover {
    background: #c0392b !important;
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.4);
    transform: translateY(-2px);
}

.report-header-bg {
    border-left: 5px solid var(--primary-yellow);
    padding-left: 20px;
    margin-bottom: 30px;
}

.expense-tracker-grid {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(0, 2fr);
    gap: 30px;
    margin-top: 20px;
}

.expense-export-form {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
    margin: 18px 0 22px;
}

.expense-export-filter {
    display: grid;
    gap: 8px;
    min-width: 260px;
}

.expense-export-filter label {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.expense-month-input {
    max-width: 260px;
}

.expense-export-note {
    color: var(--text-muted);
    font-size: 0.76rem;
}

.expense-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.expense-export-btn {
    cursor: pointer;
}

/* --- Expense Preset Period Buttons --- */
.preset-pills-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.preset-pill {
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 184, 0, 0.45);
    background: transparent;
    color: var(--primary-yellow);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, border-color 0.18s;
    text-transform: uppercase;
}

.preset-pill:hover {
    background: var(--primary-yellow);
    color: #000;
    border-color: var(--primary-yellow);
}

/* --- Category Spending Chart --- */
.expense-chart-panel {
    margin-bottom: 24px;
    padding: 20px 24px;
}

.expense-chart-wrap {
    position: relative;
    height: 220px;
    margin-top: 12px;
}

.chart-period-label {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 400;
    letter-spacing: 0;
}

.expense-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.expense-summary-card {
    display: grid;
    gap: 8px;
    padding: 18px 20px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(155deg, rgba(22, 22, 22, 0.95), rgba(8, 8, 8, 0.97));
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.28);
}

.report-center-filter-card {
    padding: 18px 20px;
}

.report-center-filter-head h3 {
    margin: 0 0 6px;
    letter-spacing: 1px;
}

.report-center-filter-head p {
    margin: 0 0 14px;
}

.report-home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.report-card {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    padding: 20px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.report-card:hover {
    transform: translateY(-3px);
    border-color: rgba(241, 196, 15, 0.55);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.28);
}

.report-card.muted {
    opacity: 0.9;
}

.report-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    border: 1px solid rgba(241, 196, 15, 0.35);
    color: var(--primary-yellow);
    background: rgba(241, 196, 15, 0.12);
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 1.25rem;
}

.report-info h3 {
    margin: 0;
    color: #ffffff;
    font-size: 1.05rem;
    letter-spacing: 0.6px;
}

.report-info p {
    margin: 4px 0 0;
    color: #a1a1aa;
    font-size: 0.86rem;
}

.report-badge {
    font-weight: 800;
    letter-spacing: 0.2px;
}

.report-badge-success {
    color: #10b981;
}

.report-badge-yellow {
    color: var(--primary-yellow);
}

.report-badge-blue {
    color: #3b82f6;
}

.mobile-header {
    display: none;
}

.menu-overlay {
    display: none;
}

body.mobile-menu-open {
    overflow: hidden;
}

.report-center-filter-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 14px;
    align-items: end;
}

.report-center-quick-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
}

.report-center-quick-stats span {
    background: rgba(241, 196, 15, 0.12);
    border: 1px solid rgba(241, 196, 15, 0.3);
    color: var(--primary-yellow);
    border-radius: 8px;
    padding: 9px 12px;
    font-weight: 700;
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .report-home-grid {
        grid-template-columns: 1fr;
    }

    .report-card {
        padding: 16px;
    }

    .report-center-filter-grid {
        grid-template-columns: 1fr;
    }

    .report-center-quick-stats {
        flex-direction: column;
        align-items: stretch;
    }

    .report-center-quick-stats span {
        text-align: center;
    }
}

/* ========================================================
   MOBILE PROFILE PAGE — stack membership + contact cards
   ======================================================== */
@media (max-width: 768px) {
    html,
    body {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .mobile-header {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
        padding: 12px 14px;
        box-sizing: border-box;
        background: #18181b;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        position: sticky;
        top: 0;
        z-index: 1002;
    }

    .mobile-brand {
        color: var(--primary-yellow);
        font-weight: 800;
        letter-spacing: 1px;
        font-size: 0.85rem;
    }

    .hamburger-btn {
        border: none;
        background: transparent;
        color: var(--primary-yellow);
        font-size: 1.5rem;
        line-height: 1;
        cursor: pointer;
        padding: 4px;
    }

    .menu-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.68);
        z-index: 1000;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
        display: block;
    }

    .menu-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar {
        position: fixed !important;
        left: -300px !important;
        top: 0;
        width: 280px !important;
        max-width: 84vw;
        height: 100vh !important;
        z-index: 1001 !important;
        transition: left 0.3s ease-in-out !important;
        background: #09090b !important;
        box-shadow: 10px 0 24px rgba(0, 0, 0, 0.55);
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        overflow-y: auto;
        overflow-x: hidden;
        white-space: normal !important;
        padding: 14px 0 !important;
        gap: 4px !important;
    }

    .sidebar.active {
        left: 0 !important;
    }

    .sidebar .side-nav {
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        width: 100% !important;
        overflow-y: auto !important;
        padding: 6px 0 18px !important;
        gap: 4px !important;
        flex: 1 1 auto;
    }

    .sidebar .nav-item {
        display: flex !important;
        align-items: center;
        justify-content: flex-start !important;
        width: 100%;
        padding: 14px 18px !important;
        margin: 0 !important;
        border-radius: 0;
    }

    .sidebar .nav-item .nav-text {
        display: inline-block !important;
        opacity: 1 !important;
        visibility: visible !important;
        margin-left: 10px;
        font-size: 1.02rem;
        font-weight: 500;
        color: #fff;
    }

    .sidebar .nav-item .nav-icon {
        font-size: 1.2rem;
        min-width: 25px;
        text-align: center;
        margin-right: 0;
    }

    body.sidebar-collapsed .sidebar .nav-text,
    body.sidebar-collapsed .sidebar .logo-text {
        opacity: 1 !important;
        visibility: visible !important;
    }

    body.sidebar-collapsed .sidebar {
        width: 280px !important;
    }

    .main-content,
    body.sidebar-collapsed .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    .table-card,
    .table-container,
    .action-tray,
    .expiry-table,
    .reports-grid-layout .table-card,
    .reports-transactions-card,
    .report-center-table-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    .expiry-table {
        min-width: 0 !important;
        max-width: 100vw !important;
    }

    .expiry-table tbody tr {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    .expiry-table tbody td,
    .expiry-table td:nth-child(4) {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    img,
    button,
    .btn {
        max-width: 100% !important;
    }

    .expense-dashboard-row {
        flex-direction: column !important;
        gap: 15px !important;
    }

    .flex-category-section,
    .flex-form-section {
        flex: none !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .registration-grid {
        grid-template-columns: 1fr !important;
    }

    /* Reports page — stack Plan Popularity + 6-Month Trend */
    .reports-grid-layout {
        grid-template-columns: 1fr !important;
    }

    .reports-grid-layout .table-card {
        width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .reports-grid-layout .data-table {
        font-size: 0.85rem !important;
    }

    /* Report action buttons — stack vertically on mobile */
    .report-actions {
        flex-direction: column !important;
        gap: 8px !important;
    }

    .report-actions a,
    .report-actions button {
        width: 100% !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }

    /* Reports filter row — collapse 7-col grid to single column */
    .reports-filter-row {
        grid-template-columns: 1fr !important;
    }

    .reports-filter-label {
        margin-top: 8px;
    }

    .reports-filter-select,
    .reports-filter-date {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Preset buttons — each takes ~half width so 2 per row */
    .reports-preset-btn {
        flex: 1 1 calc(50% - 10px) !important;
        text-align: center !important;
        padding: 10px 5px !important;
    }

    /* APPLY button full width */
    .btn-search {
        width: 100% !important;
        margin-top: 4px !important;
        box-sizing: border-box !important;
    }

    /* Reports filter — 48px touch targets for thumb-friendliness */
    .reports-filter-select,
    .reports-filter-date,
    .btn-search {
        min-height: 48px !important;
        font-size: 1rem !important;
        border-radius: 8px !important;
    }

    /* Space between action buttons and the stat cards below */
    .report-actions {
        margin-bottom: 24px !important;
    }

    /* Reports transactions table — card-per-row layout */
    .reports-transactions-card .data-table,
    .reports-transactions-card .data-table tbody,
    .reports-transactions-card .data-table tr {
        display: block !important;
        width: 100% !important;
    }

    .reports-transactions-card .data-table thead {
        display: none !important;
    }

    .reports-transactions-card .data-table tbody tr {
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.07);
        border-radius: 10px;
        padding: 12px !important;
        margin-bottom: 10px !important;
    }

    .reports-transactions-card .data-table td {
        display: block !important;
        width: 100% !important;
        padding: 2px 0 !important;
        border: none !important;
        text-align: left !important;
    }

    /* Date — small muted label */
    .reports-transactions-card .data-table td:nth-child(1) {
        font-size: 0.78rem !important;
        color: #71717a !important;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    /* Member name — large and bold */
    .reports-transactions-card .data-table td:nth-child(2) {
        font-size: 1.05rem !important;
        font-weight: 700 !important;
        color: #ffffff !important;
    }

    /* Plan type — subdued */
    .reports-transactions-card .data-table td:nth-child(3) {
        font-size: 0.85rem !important;
        color: #a1a1aa !important;
    }

    /* Amount — highlighted yellow, full width */
    .reports-transactions-card .data-table td:nth-child(4) {
        font-size: 1.15rem !important;
        font-weight: 800 !important;
        color: var(--primary-yellow) !important;
        border-top: 1px solid rgba(255, 255, 255, 0.07) !important;
        padding-top: 8px !important;
        margin-top: 6px;
    }

    /* Action button — full width */
    .reports-transactions-card .data-table td:nth-child(5) {
        padding-top: 6px !important;
    }

    /* Bottom breathing room for scrolling */
    body {
        padding-bottom: 30px !important;
    }
}

.expense-summary-card-weekly {
    border-left: 4px solid #f39c12;
}

.expense-summary-card-monthly {
    border-left: 4px solid #ff4d4d;
}

.expense-summary-label {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.expense-summary-value {
    font-size: 1.6rem;
    font-weight: 900;
    color: #fff;
    line-height: 1.1;
}

.expense-summary-note {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.expense-form-panel {
    height: fit-content;
}

.stats-mini {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
}

.stats-mini .label {
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.value-highlight {
    color: #ff6b6b;
    font-size: 1.2rem;
    font-weight: 800;
}

.modern-form {
    display: grid;
    gap: 18px;
}

.modern-form .form-group {
    display: grid;
    gap: 8px;
}

.modern-form label {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.form-control-lg {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    font-size: 0.96rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.form-control-lg:focus {
    border-color: rgba(241, 196, 15, 0.7);
    box-shadow: 0 0 0 3px rgba(241, 196, 15, 0.12);
    background: rgba(255, 255, 255, 0.06);
}

.form-control-lg option {
    color: #111;
}

.btn-primary-glow {
    width: 100%;
    border: 0;
    border-radius: 14px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #f1c40f, #ffdd57);
    color: #111;
    font-weight: 900;
    letter-spacing: 0.8px;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(241, 196, 15, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(241, 196, 15, 0.3);
}

.expense-log-header {
    gap: 16px;
}

.filter-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pill {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.8px;
}

.pill.active {
    color: #111;
    background: var(--primary-yellow);
    border-color: var(--primary-yellow);
}

.expense-feed {
    display: grid;
    gap: 12px;
}

.expense-card {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.expense-card-empty {
    grid-template-columns: 1fr;
}

.expense-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(255, 77, 77, 0.12);
    border: 1px solid rgba(255, 77, 77, 0.2);
    font-size: 1.2rem;
}

.expense-info {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.exp-desc {
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.exp-meta {
    color: var(--text-muted);
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.expense-amount {
    color: #ff6b6b;
    font-weight: 900;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .expense-export-form {
        align-items: stretch;
    }

    .expense-summary-grid {
        grid-template-columns: 1fr;
    }

    .expense-tracker-grid {
        grid-template-columns: 1fr;
    }

    .expense-card {
        grid-template-columns: 52px 1fr auto;
    }

    .stats-mini {
        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    .expense-card {
        grid-template-columns: 1fr;
        justify-items: start;
    }

    .expense-icon {
        display: none;
    }

    .dashboard-header {
        align-items: stretch;
    }
}

/* --- System Health Monitor --- */
.health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.health-item .label {
    display: block;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.health-item .value-small {
    font-family: 'Courier New', Courier, monospace;
    color: #2ecc71;
    font-size: 0.85rem;
    margin: 0;
    word-break: break-all;
}

/* ─────────────────────────────────────────────────────────
   LIVE CLASS CARD (dashboard)
───────────────────────────────────────────────────────── */
.live-class-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-left: 4px solid #f5c518;
    border-radius: 10px;
    padding: 12px 18px;
    margin-bottom: 18px;
}

.lc-label {
    font-size: 0.65rem;
    font-weight: 900;
    letter-spacing: 2px;
    background: #f5c518;
    color: #111;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.lc-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lc-name {
    font-size: 0.95rem;
    font-weight: 800;
    color: #f5c518;
    letter-spacing: 1px;
}

.lc-meta {
    font-size: 0.72rem;
    color: var(--text-muted, #888);
    letter-spacing: 0.5px;
}

.lc-link {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #f5c518;
    text-decoration: none;
    white-space: nowrap;
    opacity: 0.75;
    transition: opacity 0.2s;
}
.lc-link:hover { opacity: 1; }

/* ─────────────────────────────────────────────────────────
   TIMETABLE PAGE
───────────────────────────────────────────────────────── */
.page-header-bar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-subhead {
    color: var(--text-muted, #888);
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    margin: 4px 0 0 0;
}

/* Instructor load strip */
.instructor-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 22px;
}

.instructor-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 5px 14px;
}

.ic-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: #e0e0e0;
    letter-spacing: 0.5px;
}

.ic-count {
    font-size: 0.7rem;
    color: #f5c518;
    font-weight: 800;
}

/* Weekly grid */
.weekly-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
}

@media (max-width: 1100px) {
    .weekly-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 680px) {
    .weekly-grid { grid-template-columns: 1fr 1fr; }
}

.tt-day-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tt-day-header {
    font-size: 0.65rem;
    font-weight: 900;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.4);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding-bottom: 6px;
    margin-bottom: 2px;
}

.tt-empty-day {
    font-size: 0.65rem;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.2);
    text-align: center;
    padding: 20px 0;
}

.tt-card {
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    position: relative;
    transition: transform 0.15s;
}

.tt-card:hover { transform: translateY(-2px); }

.tt-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tt-time {
    font-size: 0.72rem;
    font-weight: 800;
    color: rgba(255,255,255,0.7);
    font-family: 'Courier New', monospace;
}

.tt-capacity {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.4);
    letter-spacing: 0.5px;
}

.tt-class-name {
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.tt-card-bottom {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 4px;
}

.tt-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tt-instructor {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.55);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tt-del-btn {
    background: none;
    border: none;
    color: rgba(255,80,80,0.4);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 2px 4px;
    border-radius: 3px;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
}
.tt-del-btn:hover { color: #ff5050; background: rgba(255,80,80,0.12); }

.tt-loading {
    color: rgba(255,255,255,0.3);
    font-size: 0.8rem;
    letter-spacing: 2px;
    padding: 30px 0;
}

/* Add class modal */
.tt-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tt-modal {
    background: #1a1a2e;
    border: 1px solid rgba(255,255,255,0.12);
    border-top: 3px solid #f5c518;
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.6);
}

.tt-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 2px;
    color: #f5c518;
}

.tt-modal-close {
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.3rem;
    cursor: pointer;
    line-height: 1;
}

.tt-modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tt-field-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.tt-field-row label {
    font-size: 0.65rem;
    letter-spacing: 1.5px;
    font-weight: 800;
    color: rgba(255,255,255,0.45);
}

.tt-input {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    color: #fff;
    padding: 9px 12px;
    font-size: 0.85rem;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.tt-input:focus { outline: none; border-color: #f5c518; }
.tt-input option { background: #1a1a2e; }

.tt-modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 14px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.tt-btn-cancel {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    color: #aaa;
    padding: 9px 18px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.2s;
}
.tt-btn-cancel:hover { background: rgba(255,255,255,0.1); }

.tt-btn-save {
    padding: 9px 22px;
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 1px;
    border: none;
    border-radius: 6px;
    background: #f5c518;
    color: #111;
    cursor: pointer;
    transition: opacity 0.2s;
}
.tt-btn-save:hover { opacity: 0.85; }
.tt-btn-save:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 768px) {
    /* Final overflow guard: lock wrappers to viewport width */
    .dashboard-wrapper,
    .main-content,
    body {
        margin: 0 !important;
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Retention status row from inspector: remove side-pushing margin */
    .retention-status {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 10px !important;
        gap: 15px !important;
        box-sizing: border-box !important;
        overflow: hidden;
    }

    /* Force status cards and expiry rows to stay inside viewport */
    .card,
    .expiry-table tr,
    [class*="status-card"] {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box !important;
    }

    /* Date/status bar must not enforce any min-width */
    .expiry-table td:nth-child(4),
    .status-bar {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        overflow: hidden;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 768px) {
    /* Unified page breathing room across all views */
    .main-content,
    .dashboard-container,
    .report-container,
    .profile-container {
        padding: 15px 12px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        display: block !important;
    }

    /* Keep cards/tables from stretching edge-to-edge */
    .card,
    .stat-card,
    .report-card,
    .info-box,
    .table-container,
    .table-card,
    .glass-panel {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-bottom: 15px !important;
        border-radius: 12px !important;
    }

    /* Drawer top breathing room under the hamburger bar */
    .sidebar {
        padding-top: 60px !important;
    }

    /* Force the Directory Table to stack */
    .directory-table, .directory-table tbody, .directory-table tr {
        display: block !important;
        width: 100% !important;
    }

    .directory-table thead {
        display: none !important;
    }

    .directory-table tr {
        padding: 15px !important;
        margin-bottom: 10px !important;
        background: #18181b !important;
        border-left: 4px solid var(--y4) !important;
        border-radius: 8px;
    }

    .directory-table td {
        display: block !important;
        width: 100% !important;
        padding: 5px 0 !important;
        text-align: left !important;
    }

    /* Add labels for data fields since headers are hidden */
    .directory-table td:nth-child(2)::before { content: "CONTACT: "; color: #71717a; font-size: 0.7rem; font-weight: 700; }
    .directory-table td:nth-child(3)::before { content: "ADDRESS: "; color: #71717a; font-size: 0.7rem; font-weight: 700; }

    /* Prevent horizontal scroll on all elements */
    * {
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }

    body {
        overflow-x: hidden !important;
        width: 100% !important;
    }
}

@media (max-width: 768px) {
    /* Final launch-day mobile guardrails */
    html,
    body {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
        position: relative;
    }

    .btn-primary,
    .page-header .btn-primary,
    .status-active,
    .report-badge-yellow,
    .reports-preset-btn.active,
    .reports-preset-btn:hover {
        background-color: var(--y4) !important;
        border-color: var(--y4) !important;
        color: #000 !important;
        font-weight: 800 !important;
        box-shadow: 0 4px 10px var(--y4-glow) !important;
        text-shadow: none !important;
    }

    .table-card .data-table td,
    .table-card .data-table .address-cell,
    .table-card .data-table .member-name-link,
    .table-card .data-table small {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .table-card .data-table td:last-child {
        text-align: left !important;
    }

    .table-card .data-table td:last-child > div {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .table-card .data-table td:last-child .btn-view-profile,
    .table-card .data-table td:last-child .btn-secondary,
    .table-card .data-table td:last-child .btn-hold {
        width: 100% !important;
        text-align: center !important;
    }
}

/* Premium splash loader */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #09090b;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.6s ease-out, visibility 0.6s ease-out;
}

.loader-content {
    text-align: center;
}

.loader-logo {
    width: 100px;
    margin-bottom: 20px;
    animation: loaderPulse 1.5s infinite ease-in-out;
}

.welcome-text {
    color: var(--y4);
    font-size: 1.5rem;
    letter-spacing: 4px;
    margin: 0 0 15px;
}

.progress-bar-container {
    width: 200px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 auto;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    width: 0;
    height: 100%;
    background: var(--y4);
    animation: loadProgress 2s forwards ease-in-out;
}

.brand-subtext {
    margin-top: 14px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    letter-spacing: 2px;
}

.loader-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

@keyframes loaderPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

@keyframes loadProgress {
    0% { width: 0; }
    100% { width: 100%; }
}