/*
 * Kas WiFi Kos — CSS Design System v4
 * Mobile-First, Premium, Responsive (Mobile → Tablet → Desktop → Wide)
 */

/* ==========================================
 * 1. Design Tokens (CSS Variables)
 * ========================================== */
:root {
    /* Colors */
    --bg-app: hsl(220, 15%, 95%);
    --bg-surface: hsl(0, 0%, 100%);
    --color-primary: hsl(231, 70%, 25%);
    --color-primary-light: hsl(231, 70%, 45%);
    --color-accent: hsl(142, 69%, 29%);
    --color-accent-light: hsl(142, 69%, 45%);
    --color-danger: hsl(354, 70%, 45%);
    --color-danger-light: hsl(354, 70%, 55%);
    --color-warning: hsl(35, 90%, 45%);
    --color-text: hsl(220, 15%, 15%);
    --color-text-muted: hsl(220, 10%, 50%);
    --color-border: hsl(220, 15%, 88%);
    --color-glass: rgba(255, 255, 255, 0.7);

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;

    /* Radii */
    --radius-lg: 1rem;
    --radius-md: 0.75rem;
    --radius-sm: 0.5rem;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.02);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);

    /* Typography */
    --font-sans: 'Outfit', sans-serif;

    /* Layout */
    --content-max-width: 480px;
}

/* ==========================================
 * 2. Reset & Base
 * ========================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-app);
    color: var(--color-text);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    margin: 0;
    padding: 0;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

/* ==========================================
 * 3. Layout Shells
 * ========================================== */
.app-layout {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

body.auth-layout {
    background: linear-gradient(135deg, hsl(231, 70%, 15%) 0%, hsl(231, 70%, 35%) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--space-5);
    min-height: 100vh;
}

body.auth-layout .auth-container {
    width: 100%;
    max-width: 420px;
}

/* ==========================================
 * 4. Auth / Login Page
 * ========================================== */
.auth-container { width: 100%; }

.login-card {
    background: var(--color-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: var(--radius-lg);
    padding: 2rem 1.75rem;
    box-shadow: var(--shadow-lg);
    width: 100%;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-circle {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-accent));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 1rem;
    box-shadow: var(--shadow-md);
}

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: hsl(231, 70%, 15%);
    margin-bottom: 0.25rem;
}

.login-header p {
    color: var(--color-text-muted);
    font-size: 14px;
}

/* ==========================================
 * 5. App Header / Top Bar
 * ========================================== */
.app-header {
    background: var(--color-primary);
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
    padding: 0.875rem 1.25rem;
}

.app-header--member {
    background: var(--color-accent);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
    min-width: 0;
}

.app-title {
    font-size: 17px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-btn {
    background: transparent;
    border: none;
    color: white;
    opacity: 0.8;
    cursor: pointer;
    padding: 0.35rem;
    display: flex;
    align-items: center;
    border-radius: var(--radius-sm);
    transition: opacity 0.2s, transform 0.15s, background-color 0.2s;
    flex-shrink: 0;
}

.logout-btn:hover {
    opacity: 1;
    transform: scale(1.08);
    background-color: rgba(255,255,255,0.12);
}

/* Desktop Nav (hidden by default on mobile) */
.desktop-nav {
    display: none;
}

.desktop-nav__item {
    color: rgba(255,255,255,0.72);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-sm);
    transition: color 0.2s, background-color 0.2s;
    white-space: nowrap;
}

.desktop-nav__item:hover {
    color: white;
    background-color: rgba(255,255,255,0.12);
}

.desktop-nav__item.active {
    color: white;
    background-color: rgba(255,255,255,0.18);
}

.member-layout .desktop-nav__item.active {
    background-color: rgba(255,255,255,0.22);
}

/* ==========================================
 * 6. Bottom Navigation (Mobile Only)
 * ========================================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--content-max-width);
    background: var(--bg-surface);
    border-top: 1px solid var(--color-border);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    height: 60px;
    z-index: 100;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.04);
}

/* Member nav has 2 items */
.member-layout .bottom-nav {
    grid-template-columns: repeat(2, 1fr);
}

.bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 10.5px;
    font-weight: 500;
    gap: 3px;
    transition: color 0.2s;
    white-space: nowrap;
}

.bottom-nav__item svg {
    width: 20px;
    height: 20px;
}

.bottom-nav__item.active {
    color: var(--color-primary-light);
}

.bottom-nav__item.active svg {
    stroke: var(--color-primary-light);
}

.member-layout .bottom-nav__item.active {
    color: var(--color-accent-light);
}
.member-layout .bottom-nav__item.active svg {
    stroke: var(--color-accent-light);
}

/* ==========================================
 * Side Drawer (Mobile Only)
 * ========================================== */
.drawer-toggle-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s, opacity 0.2s;
    flex-shrink: 0;
}
.drawer-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.12);
}

.side-drawer {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: var(--bg-surface);
    z-index: 200;
    box-shadow: var(--shadow-lg);
    transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.side-drawer.open {
    left: 0;
}

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
    z-index: 199;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.drawer-overlay.open {
    opacity: 1;
    visibility: visible;
}

.drawer-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--color-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}
.member-layout .drawer-header {
    background-color: var(--color-accent);
}

.drawer-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.drawer-close-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s;
}
.drawer-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.12);
}

.drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.drawer-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.drawer-nav__item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1.5rem;
    color: var(--color-text);
    text-decoration: none;
    font-size: 14.5px;
    font-weight: 600;
    transition: background-color 0.2s, color 0.2s;
}

.drawer-nav__item svg {
    width: 20px;
    height: 20px;
    stroke: var(--color-text-muted);
}

.drawer-nav__item:hover {
    background-color: hsl(220, 15%, 93%);
    color: var(--color-primary-light);
}
.drawer-nav__item:hover svg {
    stroke: var(--color-primary-light);
}

.member-layout .drawer-nav__item:hover {
    color: var(--color-accent-light);
}
.member-layout .drawer-nav__item:hover svg {
    stroke: var(--color-accent-light);
}

.drawer-nav__item.active {
    background-color: rgba(26, 35, 126, 0.06);
    color: var(--color-primary);
}
.drawer-nav__item.active svg {
    stroke: var(--color-primary);
}

.member-layout .drawer-nav__item.active {
    background-color: rgba(46, 125, 50, 0.06);
    color: var(--color-accent);
}
.member-layout .drawer-nav__item.active svg {
    stroke: var(--color-accent);
}

/* Hide toggle and drawer on desktop >= 1024px */
@media (min-width: 1024px) {
    .drawer-toggle-btn {
        display: none !important;
    }
    .side-drawer {
        display: none !important;
    }
    .drawer-overlay {
        display: none !important;
    }
}

/* ==========================================
 * 7. Main Content Area
 * ========================================== */
.app-content {
    flex: 1;
    padding: var(--space-5) var(--space-5) 80px; /* bottom buffer for nav */
    overflow-y: auto;
}

/* ==========================================
 * 8. Cards
 * ========================================== */
.card {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    margin-bottom: var(--space-5);
    transition: box-shadow 0.2s, transform 0.2s;
}

.card.glass {
    background: rgba(255,255,255,0.82);
    backdrop-filter: blur(10px);
}

.card h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--color-primary);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.5rem;
}

.member-layout .card h3 {
    color: var(--color-accent);
}

.card--success-border {
    border-top: 4px solid var(--color-accent) !important;
}

.card--danger-border {
    border-top: 4px solid var(--color-danger) !important;
}

.card--warning-border {
    border-top: 4px solid var(--color-warning) !important;
}

.card--status-panel {
    background-color: hsl(220, 15%, 93%) !important;
}

.card--status-panel-warning {
    border-left: 5px solid var(--color-warning) !important;
}

.card--status-panel-primary {
    border-left: 5px solid var(--color-primary-light) !important;
}

.card--status-panel-danger {
    border-left: 5px solid var(--color-danger) !important;
}

.card h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

/* ==========================================
 * 9. Alerts
 * ========================================== */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: var(--space-5);
    border: 1px solid transparent;
    animation: fadeSlideIn 0.3s ease;
}

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

.alert--danger {
    background-color: hsl(354, 70%, 96%);
    color: var(--color-danger);
    border-color: hsl(354, 70%, 90%);
}

.alert--success {
    background-color: hsl(142, 69%, 96%);
    color: var(--color-accent);
    border-color: hsl(142, 69%, 90%);
}

.alert--warning {
    background-color: hsl(35, 90%, 96%);
    color: hsl(35, 90%, 32%);
    border-color: hsl(35, 90%, 88%);
}

.alert-list {
    padding-left: 1.25rem;
}

/* ==========================================
 * 10. Badges
 * ========================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    font-size: 10.5px;
    font-weight: 700;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.badge--success {
    background-color: hsl(142, 69%, 92%);
    color: hsl(142, 69%, 28%);
}

.badge--danger {
    background-color: hsl(354, 70%, 93%);
    color: var(--color-danger);
}

.badge--warning {
    background-color: hsl(35, 90%, 92%);
    color: hsl(35, 90%, 35%);
}

.badge--info {
    background-color: hsl(200, 80%, 92%);
    color: hsl(200, 80%, 30%);
}

.badge--neutral {
    background-color: hsl(220, 15%, 88%);
    color: var(--color-text-muted);
}

/* ==========================================
 * 11. Buttons
 * ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: var(--font-sans);
    font-size: 14.5px;
    font-weight: 600;
    padding: 0.7rem 1.2rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.18s, transform 0.1s, box-shadow 0.18s;
    outline: none;
    line-height: 1;
}

.btn:active { transform: scale(0.97); }

.btn--primary { background-color: var(--color-primary); color: white; }
.btn--primary:hover { background-color: var(--color-primary-light); box-shadow: 0 4px 12px rgba(26,35,126,0.2); }

.btn--secondary { background-color: hsl(220, 15%, 86%); color: var(--color-text); }
.btn--secondary:hover { background-color: hsl(220, 15%, 78%); }

.btn--danger { background-color: var(--color-danger); color: white; }
.btn--danger:hover { background-color: var(--color-danger-light); box-shadow: 0 4px 12px rgba(195,40,50,0.2); }

.btn--success { background-color: var(--color-accent); color: white; }
.btn--success:hover { background-color: var(--color-accent-light); box-shadow: 0 4px 12px rgba(27,94,32,0.2); }

.btn--ghost {
    background-color: transparent;
    color: var(--color-primary-light);
    border: 1.5px solid var(--color-border);
}
.btn--ghost:hover { background-color: rgba(26,35,126,0.05); border-color: var(--color-primary-light); }

.btn--block { display: flex; width: 100%; }

.btn--sm { padding: 0.45rem 0.8rem; font-size: 12.5px; }

.btn--circle {
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* ==========================================
 * 12. Forms
 * ========================================== */
.form-group { margin-bottom: var(--space-5); }

.form-label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--color-text);
}

.form-input {
    width: 100%;
    font-family: var(--font-sans);
    font-size: 15px;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--color-border);
    background-color: var(--bg-surface);
    color: var(--color-text);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    border-color: var(--color-primary-light);
    box-shadow: 0 0 0 3px rgba(26,35,126,0.12);
}

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    padding-right: 2.5rem;
}

.form-row-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-hint {
    display: block;
    font-size: 11.5px;
    color: var(--color-text-muted);
    margin-top: 4px;
    line-height: 1.4;
}

.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.form-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--color-text);
    cursor: pointer;
}

.form-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--color-primary-light);
}

.form-narrow-container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

/* ==========================================
 * 12b. Tables
 * ========================================== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: var(--space-5);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    text-align: left;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.table th,
.table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--color-border);
}

.table th {
    background-color: hsl(220, 15%, 93%);
    color: var(--color-text);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.table tr:last-child td {
    border-bottom: none;
}

.table-hover tr:hover {
    background-color: hsl(220, 15%, 97%);
}

.table--sm {
    font-size: 13px !important;
}

.table-cell-meta {
    font-size: 12.5px !important;
    white-space: nowrap !important;
}

.table-cell-phone {
    font-family: monospace !important;
    font-size: 12.5px !important;
}

.table-cell-message {
    font-size: 12.5px !important;
    max-width: 250px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.table-cell-empty,
.table-empty {
    padding: 2rem !important;
}

/* ==========================================
 * 12c. Modals
 * ========================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
    transition: opacity 0.2s ease;
}

.modal__box {
    position: relative;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    padding: var(--space-6);
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    border: 1px solid var(--color-border);
    animation: modalFadeIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.modal__title {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--space-3);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.modal__body {
    font-size: 14px;
    color: var(--color-text-muted);
    margin-bottom: var(--space-5);
    line-height: 1.5;
}

.modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    border-top: 1px solid var(--color-border);
    padding-top: var(--space-4);
}

.modal__title--danger {
    color: var(--color-danger) !important;
}

.modal__entity-name {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: var(--color-text) !important;
}

.modal__warning-alert,
.modal__warning-text {
    font-size: 13px !important;
    line-height: 1.4 !important;
}

.code-inline {
    background-color: hsl(220, 15%, 90%) !important;
    padding: 2px 6px !important;
    border-radius: 3px !important;
    font-size: 12px !important;
}

/* Button Global States */
.btn:disabled,
.btn.is-disabled {
    cursor: not-allowed !important;
    opacity: 0.5 !important;
}

/* ==========================================
 * 12d. AI Chat Window
 * ========================================== */
.ai-chat-container {
    display: flex;
    flex-direction: column;
    height: 65vh;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    background: hsl(220, 15%, 98%);
}

.ai-chat-bubble {
    max-width: 80%;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-size: 14px;
    line-height: 1.45;
    word-break: break-word;
}

.ai-chat-bubble--user {
    align-self: flex-end;
    background-color: var(--color-primary);
    color: white;
    border-bottom-right-radius: var(--radius-sm);
}

.member-layout .ai-chat-bubble--user {
    background-color: var(--color-accent);
}

.ai-chat-bubble--bot {
    align-self: flex-start;
    background-color: var(--bg-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-bottom-left-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.ai-chat-input-bar {
    padding: var(--space-3) var(--space-4);
    background: var(--bg-surface);
    border-top: 1px solid var(--color-border);
    display: flex;
    gap: var(--space-3);
    align-items: center;
}

.ai-chat-input {
    flex: 1;
}

/* ==========================================
 * 13. Page Headers
 * ========================================== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-5);
    gap: 10px;
}

.page-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.2;
}

.member-layout .page-header h2 {
    color: var(--color-accent);
}

.page-header p,
.page-subtitle {
    font-size: 13.5px;
    color: var(--color-text-muted);
    margin-top: 4px;
}

/* ==========================================
 * 14. Detail Lists (show pages)
 * ========================================== */
.detail-list,
.integration-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.detail-row,
.integration-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.6rem;
    border-bottom: 1px dashed var(--color-border);
    gap: 1rem;
}

.detail-row:last-child,
.integration-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-row.flex-col {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.detail-label,
.integration-name {
    font-size: 13px;
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.detail-value {
    font-size: 14.5px;
    font-weight: 600;
    text-align: right;
}

.notes-box {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-app);
    border-radius: var(--radius-sm);
    font-weight: 400;
    font-size: 13.5px;
    color: var(--color-text);
    white-space: pre-line;
    line-height: 1.5;
}

.notes-box--surface {
    background: var(--bg-surface) !important;
    border: 1px solid var(--color-border) !important;
}

.attachment-preview {
    margin-top: 1rem;
    text-align: center;
    background-color: var(--bg-app);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.attachment-preview__img {
    max-width: 100%;
    max-height: 450px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
}

.attachment-preview__pdf {
    text-align: center;
    padding: 2rem;
}

.attachment-preview__icon {
    font-size: 60px;
    margin-bottom: 1rem;
}

.attachment-preview__hint {
    display: block;
    font-size: 11px;
    color: var(--color-text-muted);
    margin-top: 8px;
}

/* ==========================================
 * 15. Welcome Banner
 * ========================================== */
.welcome-banner {
    margin-bottom: var(--space-5);
}

.welcome-banner h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.2rem;
}

.welcome-banner--member h2 {
    color: var(--color-accent);
}

.welcome-banner p {
    font-size: 13.5px;
    color: var(--color-text-muted);
}

/* ==========================================
 * 16. Stats Grid (Dashboard)
 * ========================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: var(--space-5);
}

.stat-card {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: 0.85rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-title {
    font-size: 10px;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 2px;
    line-height: 1;
}

.stat-card--success .stat-value { color: var(--color-accent); }
.stat-card--danger .stat-value  { color: var(--color-danger); }

.stat-desc {
    font-size: 10px;
    color: var(--color-text-muted);
}

/* Quick Shortcuts */
.shortcut-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ==========================================
 * 17. Filter Tab Navigation
 * ========================================== */
.filter-tab {
    display: flex;
    background: var(--color-border);
    padding: 3px;
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-5);
}

.filter-tab__item {
    flex: 1;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    padding: 0.5rem;
    border-radius: calc(var(--radius-sm) - 1px);
    color: var(--color-text-muted);
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.filter-tab__item.active {
    background-color: var(--bg-surface);
    color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}

/* ==========================================
 * 18. Settings — Tabs
 * ========================================== */
.tab-nav {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--color-border);
    margin-bottom: var(--space-6);
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.tab-nav::-webkit-scrollbar { display: none; }

.tab-btn,
.tab-link {
    flex: none;
    font-family: var(--font-sans);
    font-size: 13.5px;
    font-weight: 600;
    padding: 0.65rem 1.1rem;
    border: none;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    margin-bottom: -2px;
    text-decoration: none;
    display: inline-block;
}

.tab-btn:hover,
.tab-link:hover { color: var(--color-primary-light); }

.tab-btn.active,
.tab-link.active {
    color: var(--color-primary-light);
    border-bottom-color: var(--color-primary-light);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ==========================================
 * 19. Member List Cards
 * ========================================== */
.member-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.member-card { margin-bottom: 0; }

.member-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.65rem;
    gap: 8px;
}

.member-name {
    font-size: 15.5px;
    font-weight: 700;
    color: var(--color-text);
}

.member-card__body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12.5px;
    margin-bottom: 0.65rem;
}

.member-info-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.info-label {
    color: var(--color-text-muted);
    width: 40px;
    flex-shrink: 0;
}

.info-val { font-weight: 600; }

.wa-link {
    color: var(--color-accent-light);
    text-decoration: none;
    font-weight: 600;
}
.wa-link:hover { text-decoration: underline; }

.member-card__footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    border-top: 1px solid var(--color-border);
    padding-top: 0.65rem;
}

/* ==========================================
 * 20. Billing — Cycle Cards
 * ========================================== */
.billing-summary-card {
    border-left: 5px solid var(--color-primary-light);
}

.card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.5rem;
}

.card-header-flex h3 {
    margin-bottom: 0 !important;
    border-bottom: none !important;
    padding-bottom: 0 !important;
}

.btn-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-primary-light);
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.2s;
}
.btn-link:hover { opacity: 0.8; }

.panel-action-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    width: 100%;
}

.panel-action-item {
    flex: 1 1 200px;
    margin: 0;
}

.panel-action-item-sm {
    flex: 1 1 140px;
    margin: 0;
}

.empty-billing-state {
    text-align: center;
    padding: 1.75rem 1rem;
}

.empty-billing-state p {
    font-size: 13.5px;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.empty-state {
    text-align: center;
    padding: 2.5rem 1.5rem;
}

.empty-state__icon {
    font-size: 48px;
    margin-bottom: 1rem;
    line-height: 1;
}

.empty-state__title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.empty-state__desc {
    font-size: 14px;
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}

/* Billing Widget content */
.billing-widget-content {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.billing-widget-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.billing-widget-name {
    font-size: 15.5px;
    font-weight: 700;
    color: var(--color-text);
}

.billing-widget-details {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    background: var(--bg-app);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
}

.detail-item-small {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12.5px;
    gap: 8px;
}

.detail-item-small .label {
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.detail-item-small .value { font-weight: 600; }

.card-divider {
    border: 0;
    border-top: 1px solid var(--color-border);
    margin: 0.2rem 0;
}

.billing-widget-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    gap: 8px;
}

.progress-label { color: var(--color-text-muted); font-weight: 500; }
.progress-val { font-weight: 700; color: var(--color-primary-light); }
.progress-val .light { font-weight: 400; color: var(--color-text-muted); }

.billing-widget-grid-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 0.4rem;
}

.grid-stat-box {
    background: var(--bg-app);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.grid-stat-box .num {
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
}

.grid-stat-box .lbl {
    font-size: 9px;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Stat number colors */
.num.green  { color: var(--color-accent); }
.num.orange { color: var(--color-warning); }
.num.red    { color: var(--color-danger); }

/* Text color utility */
.green { color: var(--color-accent); }
.red   { color: var(--color-danger); }
.orange { color: var(--color-warning); }

/* Container alias for member bill show page */
.member-charge-show-container {
    /* inherits from .member-bills-container rules at desktop bp */
}

/* Header actions group (multiple buttons in page-header) */
.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

/* Cycle list */
.cycle-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cycle-card {
    border-left: 4px solid var(--color-border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.cycle-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.cycle-card--active { border-left-color: var(--color-accent-light); }
.cycle-card--closed { border-left-color: var(--color-danger-light); }

.cycle-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.7rem;
    gap: 8px;
}

.cycle-title {
    font-size: 15.5px;
    font-weight: 700;
    color: var(--color-text);
}

.cycle-card__body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 14px;
    font-size: 12.5px;
    margin-bottom: 0.7rem;
    color: var(--color-text-muted);
}

.cycle-card__body strong { color: var(--color-text); }

.cycle-card__footer {
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid var(--color-border);
    padding-top: 0.65rem;
    margin-top: 0.4rem;
}

/* ==========================================
 * 21. Billing Show — Top Grid & Charge Cards
 * ========================================== */
.billing-grid-top {
    display: flex;
    flex-direction: column;
    gap: 0; /* cards have their own margin-bottom */
}

.charge-card-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 1rem;
}

.charge-member-card {
    background: var(--bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: box-shadow 0.2s, transform 0.2s;
}

.charge-member-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.charge-member-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.charge-member-name {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--color-text);
}

.charge-member-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    font-size: 12px;
    background: var(--bg-app);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
}

.charge-member-balance {
    grid-column: span 2;
    border-top: 1px dashed var(--color-border);
    padding-top: 4px;
    margin-top: 4px;
}

.charge-member-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    border-top: 1px solid var(--color-border);
    padding-top: 0.5rem;
    margin-top: 0.25rem;
}

/* ==========================================
 * 22. Ledger Timeline
 * ========================================== */
.ledger-timeline {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    padding-left: 22px;
    margin-top: 1rem;
}

.ledger-timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 5px;
    bottom: 5px;
    width: 2px;
    background: linear-gradient(to bottom, var(--color-border), transparent);
}

.ledger-item { position: relative; }

.ledger-dot {
    position: absolute;
    left: -21px;
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-text-muted);
    border: 2px solid var(--bg-surface);
    box-shadow: 0 0 0 2px var(--color-border);
}

.ledger-item--charge  .ledger-dot { background: var(--color-primary-light); }
.ledger-item--payment .ledger-dot { background: var(--color-accent); }
.ledger-item--debit   .ledger-dot { background: var(--color-warning); }
.ledger-item--credit  .ledger-dot { background: hsl(190, 80%, 40%); }
.ledger-item--danger  .ledger-dot { background: var(--color-danger); }
.ledger-item--warning .ledger-dot { background: var(--color-warning); }
.ledger-item--reversal .ledger-desc,
.ledger-item--reversal .ledger-amount {
    text-decoration: line-through !important;
    opacity: 0.6 !important;
}

.ledger-content {
    background: var(--bg-app);
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--color-border);
}

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

.ledger-desc { font-size: 13px; font-weight: 600; color: var(--color-text); }
.ledger-amount { font-size: 13px; font-weight: 700; white-space: nowrap; }
.ledger-date { font-size: 10.5px; color: var(--color-text-muted); }

.ledger-item--payment .ledger-amount { color: var(--color-accent); }
.ledger-item--charge .ledger-amount,
.ledger-item--debit  .ledger-amount  { color: var(--color-danger); }
.ledger-item--credit .ledger-amount  { color: hsl(190, 80%, 35%); }

/* ==========================================
 * 23. Due Alert Banner (Member)
 * ========================================== */
.due-alert-banner {
    background-color: hsl(35, 90%, 96%);
    border: 1px solid hsl(35, 90%, 88%);
    border-radius: var(--radius-md);
    padding: 0.7rem 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: hsl(35, 90%, 32%);
    font-weight: 600;
    line-height: 1.4;
}

.due-alert-banner.danger {
    background-color: hsl(354, 70%, 96%);
    border-color: hsl(354, 70%, 88%);
    color: var(--color-danger);
}

/* ==========================================
 * 24. Member Dashboard — Billing Placeholder
 * ========================================== */
.billing-placeholder {
    text-align: center;
    padding: 1rem 0.5rem;
}

.placeholder-icon { font-size: 44px; margin-bottom: 0.6rem; }

.billing-placeholder h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--color-text);
}

.billing-placeholder p {
    font-size: 13px;
    color: var(--color-text-muted);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.preview-box {
    background: var(--bg-app);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.preview-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.preview-title { color: var(--color-text-muted); }
.preview-val { font-weight: 700; color: var(--color-accent); }

/* ==========================================
 * 25. Misc Utilities
 * ========================================== */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-decoration: none;
    margin-bottom: 1rem;
    padding: 0.3rem 0;
    transition: color 0.2s;
}
.btn-back:hover { color: var(--color-primary-light); }

.integration-list { display: flex; flex-direction: column; gap: 0.6rem; }
.integration-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.6rem;
    border-bottom: 1px dashed var(--color-border);
}
.integration-item:last-child { border-bottom: none; padding-bottom: 0; }
.integration-name { font-size: 13px; color: var(--color-text-muted); }

.dashboard-actions-flex { display: flex; flex-direction: column; gap: 8px; margin-top: 1rem; }

/* ==========================================
 * 25b. Global Layout Grids & Spacing Utilities
 * ========================================== */
/* Global Grid System */
.list-grid-simple {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
}

.list-grid-complex {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
}

.billing-grid-top {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
}

/* Flex / Spacing Helper Utilities */
.flex { display: flex !important; }
.flex-col { flex-direction: column !important; }
.flex-row { flex-direction: row !important; }
.justify-between { justify-content: space-between !important; }
.justify-end { justify-content: flex-end !important; }
.items-center { align-items: center !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-1 { flex: 1 !important; }
.flex-shrink-0 { flex-shrink: 0 !important; }

/* Margin helpers */
.m-0 { margin: 0 !important; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.ml-0 { margin-left: 0 !important; }
.mr-0 { margin-right: 0 !important; }
.mt-1 { margin-top: var(--space-1) !important; }
.mb-1 { margin-bottom: var(--space-1) !important; }
.mt-2 { margin-top: var(--space-2) !important; }
.mb-2 { margin-bottom: var(--space-2) !important; }
.mt-3 { margin-top: var(--space-3) !important; }
.mb-3 { margin-bottom: var(--space-3) !important; }
.mt-4 { margin-top: var(--space-4) !important; }
.mb-4 { margin-bottom: var(--space-4) !important; }
.mt-5 { margin-top: var(--space-5) !important; }
.mb-5 { margin-bottom: var(--space-5) !important; }
.mt-6 { margin-top: var(--space-6) !important; }
.mb-6 { margin-bottom: var(--space-6) !important; }
.mt-8 { margin-top: var(--space-8) !important; }
.mb-8 { margin-bottom: var(--space-8) !important; }

/* Padding helpers */
.p-0 { padding: 0 !important; }
.pt-0 { padding-top: 0 !important; }
.pb-0 { padding-bottom: 0 !important; }
.pt-1 { padding-top: var(--space-1) !important; }
.pb-1 { padding-bottom: var(--space-1) !important; }
.pt-2 { padding-top: var(--space-2) !important; }
.pb-2 { padding-bottom: var(--space-2) !important; }
.pt-3 { padding-top: var(--space-3) !important; }
.pb-3 { padding-bottom: var(--space-3) !important; }
.pt-4 { padding-top: var(--space-4) !important; }
.pb-4 { padding-bottom: var(--space-4) !important; }
.pt-5 { padding-top: var(--space-5) !important; }
.pb-5 { padding-bottom: var(--space-5) !important; }

/* Layout / Alignment helpers */
.w-full { width: 100% !important; }
.h-full { height: 100% !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.font-semibold { font-weight: 600 !important; }
.font-bold { font-weight: 700 !important; }
.text-muted { color: var(--color-text-muted) !important; }
.italic { font-style: italic !important; }
.border-top { border-top: 1px solid var(--color-border) !important; }
.text-primary { color: var(--color-primary) !important; }
.gap-1 { gap: var(--space-1) !important; }
.gap-2 { gap: var(--space-2) !important; }
.gap-3 { gap: var(--space-3) !important; }
.gap-4 { gap: var(--space-4) !important; }
.gap-5 { gap: var(--space-5) !important; }

/* ==========================================
 * 26. RESPONSIVE — Desktop Nav is Hidden
 *     (shown only at 1024+)
 * ========================================== */
/* Already .desktop-nav { display: none } above */

/* ==========================================
 * 27. BREAKPOINT: Tablet >= 768px
 * ========================================== */
@media (min-width: 768px) {
    :root { 
        --content-max-width: 768px; 
    }

    /* Layout full width */
    .admin-layout,
    .member-layout {
        width: 100%;
    }

    .stats-grid { gap: 14px; }
    .form-row-grid { gap: 16px; }

    /* Simple Grid layout - 2 columns at tablet */
    .list-grid-simple,
    .member-list,
    .cycle-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    /* Complex Grid layout - stays 1 column at tablet to maintain readability */
    .list-grid-complex,
    .charge-card-list {
        display: grid;
        grid-template-columns: 1fr;
        gap: 14px;
    }

    /* Settings container limit starting at tablet */
    .settings-container {
        max-width: 860px;
        margin-inline: auto;
        width: 100%;
    }
}

/* ==========================================
 * 28. BREAKPOINT: Desktop >= 1024px
 * ========================================== */
@media (min-width: 1024px) {
    :root { 
        --container-max-width: 1020px; 
    }

    body {
        background-color: var(--bg-app);
    }

    .app-layout {
        width: 100%;
        min-height: 100vh;
    }

    /* Full-width header spanning 100% of screen */
    .app-header {
        width: 100%;
        padding: 1rem 2rem;
    }

    .header-content {
        max-width: var(--container-max-width);
        margin: 0 auto;
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    /* Hide mobile bottom nav, show desktop nav */
    .bottom-nav { display: none; }

    .desktop-nav {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex-wrap: nowrap;
        white-space: nowrap;
    }

    .desktop-nav__item {
        font-size: 14px;
        font-weight: 600;
        padding: 0.5rem 1rem;
    }

    /* Bigger title on desktop */
    .app-title { font-size: 20px; }

    /* App content padding without bottom nav buffer */
    .app-content {
        padding: 2.5rem 2rem;
        width: 100%;
        max-width: var(--container-max-width);
        margin: 0 auto;
    }

    /* Page header bigger & unified action bar layout */
    .page-header {
        border-bottom: 2px solid var(--color-border);
        padding-bottom: 0.875rem;
        margin-bottom: 1.75rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 1.5rem;
    }

    .page-header h2 {
        font-size: 24px;
        margin-bottom: 0;
    }

    .header-actions {
        display: flex;
        gap: 10px;
        align-items: center;
    }

    /* Simple Grid - 3 columns at desktop */
    .list-grid-simple,
    .member-list,
    .cycle-list {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    /* Complex Grid - 2 columns at desktop */
    .list-grid-complex,
    .charge-card-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    /* Full-width empty states inside grids */
    .empty-billing-state,
    .empty-member-state,
    .empty-state {
        grid-column: 1 / -1;
    }

    /* Billing grid top: 2 columns balanced at desktop */
    .billing-grid-top {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
        margin-bottom: 2rem;
        align-items: start;
    }

    .billing-grid-top .card {
        margin-bottom: 0;
        height: 100%;
    }

    /* Shortcut grid horizontal */
    .shortcut-grid {
        flex-direction: row;
        gap: 16px;
    }

    .shortcut-grid .btn {
        flex: 1;
    }

    /* Settings layout */
    .settings-container {
        max-width: 860px;
        margin-inline: auto;
        width: 100%;
    }

    .settings-container .tab-nav {
        justify-content: flex-start;
        margin-bottom: 1.5rem;
    }

    .settings-container .tab-btn {
        font-size: 15px;
        padding: 0.75rem 1.5rem;
    }

    /* Settings form — 2-col grid for fields */
    .form-grid-layout {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem 2rem;
        align-items: start;
    }

    .form-grid-layout .form-group {
        margin-bottom: 0;
    }

    .form-grid-layout .form-group--full-width {
        grid-column: 1 / -1;
    }

    /* Spacing and margins for main page containers */
    .members-container,
    .billing-container,
    .billing-show-container,
    .charge-show-container,
    .member-bills-container,
    .member-charge-show-container,
    .member-dashboard,
    .dashboard-container {
        max-width: var(--container-max-width);
        margin-inline: auto;
        width: 100%;
    }

    /* Form containers and cards get an ergonomic max-width limit */
    .billing-create-container,
    .form-container-card {
        max-width: 720px;
        margin-inline: auto;
        width: 100%;
    }

    /* Cards get a bit more padding */
    .card { padding: 1.75rem; }

    /* Billing create/form padding */
    .billing-create-container .card.glass,
    .form-container-card .card {
        padding: 2rem 2.5rem;
    }

    /* Card h3 bigger */
    .card h3 { font-size: 17px; }

    /* Bigger form labels */
    .form-label { font-size: 14.5px; }
    .form-input { font-size: 16px; }

    /* Ledger timeline wider */
    .ledger-timeline { padding-left: 28px; }

    /* Utility overrides */
    .stat-value { font-size: 32px; }
    .welcome-banner h2 { font-size: 26px; }

    /* Dashboard columns support at desktop */
    .dashboard-container {
        display: grid;
        grid-template-columns: 1.5fr 1fr;
        gap: 1.5rem;
        align-items: start;
    }

    .dashboard-left-col {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }

    .dashboard-right-col {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }
}

/* ==========================================
 * 29. BREAKPOINT: Wide Desktop >= 1280px
 * ========================================== */
@media (min-width: 1280px) {
    :root { 
        --container-max-width: 1200px; 
    }

    /* Dashboard: 2-col layout on very wide */
    .dashboard-container {
        grid-template-columns: 2fr 1fr;
        gap: 2rem;
    }

    /* Simple Grid - 4 columns on wide screens */
    .list-grid-simple {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Complex Grid - stays 3 columns on wide screens (never 4 columns) */
    .list-grid-complex,
    .member-list,
    .cycle-list,
    .charge-card-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    .billing-grid-top {
        gap: 2.5rem;
    }

    /* Settings wider */
    .settings-container { max-width: 960px; }
}

/* ==========================================
 * Impersonate Banner
 * ========================================== */
.impersonate-banner {
    background-color: var(--color-warning);
    color: white;
    padding: 0.5rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    z-index: 101;
    font-size: 13.5px;
    box-shadow: var(--shadow-sm);
    width: 100%;
}

@media (max-width: 576px) {
    .impersonate-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.75rem 1.25rem;
    }
    .impersonate-banner form {
        width: 100%;
    }
    .impersonate-banner button {
        width: 100%;
        text-align: center;
    }
}

/* ==========================================
 * 30. Drawer & Layout Shell Cleanups
 * ========================================== */
.drawer-divider {
    border: 0;
    border-top: 1px solid var(--color-border);
    margin: 0.5rem 0;
}

.drawer-nav__btn {
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}

.btn--impersonate {
    padding: 0.25rem 0.75rem;
    font-size: 12px;
    line-height: 1;
}

