/* SavoraSave — Design System */
:root {
    --primary: #1a6b47;
    --primary-dark: #0d3d28;
    --primary-light: #2d8a5e;
    --primary-muted: #e8f4ee;
    --primary-glow: rgba(26, 107, 71, 0.25);

    --secondary: #e8940a;
    --secondary-light: #f5b84a;
    --accent: #c92a2a;

    --success: #2d6a4f;
    --warning: #e67e22;
    --mtn: #ffcc00;
    --airtel: #ed1c24;

    --bg-base: #f0f4f2;
    --bg-elevated: #ffffff;
    --bg-sidebar: #0c2e1f;
    --bg-sidebar-hover: rgba(255, 255, 255, 0.06);
    --bg-sidebar-active: rgba(232, 148, 10, 0.15);

    --text-primary: #14281e;
    --text-secondary: #5c6f66;
    --text-muted: #8a9d94;
    --text-on-dark: #f0f7f3;
    --text-on-dark-muted: #9bb8a8;

    --border: #dce8e2;
    --border-strong: #b8d4c4;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --shadow-xs: 0 1px 2px rgba(20, 40, 30, 0.04);
    --shadow-sm: 0 2px 8px rgba(20, 40, 30, 0.06);
    --shadow-md: 0 8px 24px rgba(20, 40, 30, 0.08);
    --shadow-lg: 0 16px 48px rgba(20, 40, 30, 0.12);
    --shadow-glow: 0 4px 20px var(--primary-glow);

    --nav-height: 64px;
    --sidebar-width: 268px;

    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --font-ui: 'IBM Plex Sans', system-ui, sans-serif;
    --font-display: 'DM Serif Display', Georgia, serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.savorasave-app {
    font-family: var(--font-ui);
    background: var(--bg-base);
    color: var(--text-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Ambient background */
body.savorasave-app::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 100% 0%, rgba(26, 107, 71, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 0% 100%, rgba(232, 148, 10, 0.06) 0%, transparent 45%),
        linear-gradient(180deg, var(--bg-base) 0%, #e8efe9 100%);
    pointer-events: none;
    z-index: -1;
}

/* ——— Navbar ——— */
.navbar.nav-glass {
    height: var(--nav-height);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0 1.25rem;
}

.navbar-brand {
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 400;
    color: var(--primary-dark) !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.02em;
}

.navbar-brand i {
    font-size: 1.35rem;
    color: var(--secondary);
}

.nav-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--primary-muted);
    color: var(--primary-dark);
    border: 1px solid var(--border-strong);
}

.nav-status-pill.offline {
    background: #fff4e6;
    color: #b45309;
    border-color: #fcd9a8;
}

.nav-user-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-muted);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border);
    transition: var(--transition);
}

.nav-user-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.dropdown-menu {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.85rem;
    font-weight: 500;
}

.dropdown-item:hover {
    background: var(--primary-muted);
    color: var(--primary-dark);
}

.mobile-menu-btn {
    display: none;
    color: var(--primary) !important;
    border-radius: var(--radius-sm);
}

.mobile-menu-btn:hover {
    background: var(--primary-muted);
}

/* ——— Sidebar ——— */
.sidebar.sidebar-dark {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--nav-height));
    background: linear-gradient(175deg, #0a2619 0%, var(--bg-sidebar) 40%, #0f3524 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    padding: 1.25rem 0;
    overflow-y: auto;
    z-index: 999;
    transition: transform 0.3s ease;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
}

.sidebar.sidebar-dark::-webkit-scrollbar { width: 5px; }
.sidebar.sidebar-dark::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.sidebar-brand-strip {
    padding: 0 1.25rem 1rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand-strip small {
    display: block;
    color: var(--text-on-dark-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.25rem;
}

.sidebar-brand-strip span {
    color: var(--text-on-dark);
    font-weight: 600;
    font-size: 0.9rem;
}

.sidebar-section {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-on-dark-muted);
    padding: 1rem 1.35rem 0.35rem;
    font-weight: 700;
}

.sidebar-item {
    margin: 0.15rem 0.75rem;
    padding: 0.65rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-on-dark-muted);
    text-decoration: none;
    border-radius: var(--radius-sm);
    border-left: none;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    font-weight: 500;
}

.sidebar-item i {
    font-size: 1.1rem;
    width: 1.35rem;
    opacity: 0.85;
}

.sidebar-item:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-on-dark);
}

.sidebar-item.active {
    background: var(--bg-sidebar-active);
    color: var(--text-on-dark);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--secondary);
}

.sidebar-item.active i {
    color: var(--secondary-light);
    opacity: 1;
}

/* ——— Main content ——— */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 1.75rem 2rem 2.5rem;
    min-height: calc(100vh - var(--nav-height));
    position: relative;
}

.content-section.section-visible {
    animation: sectionIn 0.35s ease forwards;
}

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

/* ——— Page header ——— */
.page-header {
    margin-bottom: 1.75rem;
}

.page-header-hero {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 55%, var(--primary-light) 100%);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.75rem;
    color: white;
    box-shadow: var(--shadow-glow);
    position: relative;
    overflow: hidden;
}

.page-header-hero::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(232, 148, 10, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

.page-header-hero .page-title {
    color: white;
    font-size: 1.75rem;
    margin-bottom: 0.35rem;
    position: relative;
}

.page-header-hero .page-subtitle {
    color: rgba(255, 255, 255, 0.82);
    margin: 0;
    position: relative;
}

.page-header:not(.page-header-hero) {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.page-title {
    font-family: var(--font-display);
    font-size: 1.9rem;
    color: var(--primary-dark);
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

/* ——— Stat cards ——— */
.stat-card {
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    padding: 1.35rem;
    height: 100%;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

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

.stat-card.success::before { background: linear-gradient(90deg, var(--success), #3d9b6e); }
.stat-card.warning::before { background: linear-gradient(90deg, var(--warning), var(--secondary-light)); }
.stat-card.danger::before { background: linear-gradient(90deg, var(--accent), #e85d5d); }

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: white;
    box-shadow: var(--shadow-xs);
}

.stat-icon.primary { background: linear-gradient(145deg, var(--primary-light), var(--primary-dark)); }
.stat-icon.success { background: linear-gradient(145deg, #3d9b6e, var(--success)); }
.stat-icon.warning { background: linear-gradient(145deg, var(--secondary-light), var(--warning)); }
.stat-icon.danger { background: linear-gradient(145deg, #e85d5d, var(--accent)); }

.stat-value {
    font-size: clamp(1.1rem, 2.5vw, 1.65rem);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    margin-top: 0.35rem;
}

/* ——— Cards ——— */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.35rem;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
}

.card-header i {
    color: var(--primary);
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

.card-header-accent {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: white;
    border-bottom: none;
}

.card-header-accent i { color: var(--secondary-light); }

.card-body { padding: 1.25rem; }

/* ——— Tables ——— */
.table {
    --bs-table-hover-bg: var(--primary-muted);
    margin-bottom: 0;
}

.table thead {
    background: var(--primary-muted);
    color: var(--primary-dark);
}

.table thead th {
    border: none;
    padding: 0.9rem 1rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.table tbody td {
    padding: 0.95rem 1rem;
    vertical-align: middle;
    border-color: var(--border);
    font-size: 0.9rem;
}

.table tbody tr {
    transition: background var(--transition);
}

.table tbody tr:hover {
    background: rgba(232, 244, 238, 0.5);
}

/* ——— Buttons ——— */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    padding: 0.55rem 1.15rem;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    color: white;
    box-shadow: 0 2px 8px var(--primary-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--primary-glow);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary) 0%, #c97d08 100%);
    border: none;
    color: white;
}

.btn-secondary:hover {
    filter: brightness(1.05);
    color: white;
}

.btn-outline-primary {
    border: 2px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-sm { padding: 0.35rem 0.65rem; font-size: 0.8rem; }

/* ——— Forms ——— */
.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.form-control,
.form-select {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.85rem;
    font-size: 0.9rem;
    transition: var(--transition);
    background: var(--bg-elevated);
}

.form-control:hover,
.form-select:hover {
    border-color: var(--border-strong);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-bar {
    position: relative;
}

.search-bar i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    z-index: 2;
    pointer-events: none;
}

.search-bar input {
    padding-left: 2.6rem;
    background: var(--bg-elevated);
}

/* ——— Quick actions ——— */
.quick-action {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.35rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    box-shadow: var(--shadow-xs);
}

.quick-action:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    color: inherit;
}

.quick-action-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: var(--primary-muted);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 0.85rem;
    transition: var(--transition);
}

.quick-action:hover .quick-action-icon {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    transform: scale(1.05);
}

.quick-action .fw-bold {
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* ——— Badges ——— */
.badge {
    padding: 0.38rem 0.7rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.7rem;
    letter-spacing: 0.02em;
}

.badge-approved, .badge-success {
    background: #d4edda;
    color: #1a5f3f;
}

.badge-pending, .badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-active {
    background: var(--primary-muted);
    color: var(--primary-dark);
}

.badge-defaulted, .badge-danger {
    background: #fde8e8;
    color: var(--accent);
}

.badge-completed {
    background: #e9ecef;
    color: #495057;
}

.badge-mtn { background: var(--mtn); color: #1a1a1a; }
.badge-airtel { background: var(--airtel); color: white; }

/* ——— Progress ——— */
.progress {
    height: 8px;
    border-radius: 999px;
    background: var(--border);
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 999px;
}

.progress-bar.bg-warning {
    background: linear-gradient(90deg, var(--warning), var(--secondary-light)) !important;
}

/* ——— Modals ——— */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: white;
    padding: 1.15rem 1.35rem;
    border: none;
}

.modal-header .modal-title {
    font-weight: 600;
    font-size: 1.05rem;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.85;
}

.modal-body { padding: 1.35rem; }

.modal-footer {
    border-top: 1px solid var(--border);
    padding: 1rem 1.35rem;
    background: #fafcfb;
}

/* ——— MoMo providers ——— */
.momo-provider {
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.15rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    background: var(--bg-elevated);
}

.momo-provider:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
}

.momo-provider.selected {
    border-color: var(--primary);
    background: var(--primary-muted);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.momo-provider.mtn.selected {
    border-color: #d4a800;
    background: rgba(255, 204, 0, 0.12);
    box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.25);
}

.momo-provider.airtel.selected {
    border-color: var(--airtel);
    background: rgba(237, 28, 36, 0.06);
    box-shadow: 0 0 0 3px rgba(237, 28, 36, 0.15);
}

/* ——— Member avatar ——— */
.member-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--primary-light), var(--primary-dark));
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    box-shadow: 0 2px 6px var(--primary-glow);
}

/* ——— Offline banner ——— */
.offline-banner {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: linear-gradient(90deg, var(--warning), var(--secondary));
    color: white;
    padding: 0.55rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    display: none;
    z-index: 998;
    box-shadow: var(--shadow-md);
}

.offline-banner.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

/* ——— Toast ——— */
.toast {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: none;
}

/* ——— Utility ——— */
.health-metric {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border);
}

.health-metric:last-child { border-bottom: none; }

.health-metric-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.health-metric-value {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-dark);
}

.account-type-savings { color: var(--success); font-weight: 600; }
.account-type-shares { color: var(--primary); font-weight: 600; }
.account-type-loan { color: var(--warning); font-weight: 600; }

.schedule-table { font-size: 0.85rem; }

.text-accent { color: var(--secondary) !important; }

/* WhatsApp */
.btn-whatsapp {
    background: #25d366;
    border: none;
    color: #fff;
    font-weight: 600;
}

.btn-whatsapp:hover,
.btn-whatsapp:focus {
    background: #1da851;
    color: #fff;
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.4);
}

.btn-outline-success.btn-whatsapp-outline:hover {
    background: rgba(37, 211, 102, 0.1);
    border-color: #25d366;
    color: #128c7e;
}

.bg-success-subtle {
    background: rgba(37, 211, 102, 0.12) !important;
}

.sms-recipient-table tr.sms-row-unselected {
    opacity: 0.55;
}

.sms-recipient-table .sms-col-check {
    vertical-align: middle;
}

@media (max-width: 991.98px) {
    .sms-recipient-table tbody td.sms-col-check::before {
        display: none;
    }
}

/* Settings calculator highlight */
.calc-result-box {
    background: linear-gradient(135deg, var(--primary-muted) 0%, #f5faf7 100%);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    padding: 1.15rem;
}

.calc-result-box strong { color: var(--primary-dark); }

/* ——— Responsive ——— */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: var(--nav-height) 0 0 0;
    background: rgba(12, 46, 31, 0.5);
    z-index: 998;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.show { display: block; }

@media (max-width: 991.98px) {
    .sidebar.sidebar-dark {
        transform: translateX(-100%);
        z-index: 1001;
    }

    .sidebar.sidebar-dark.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 1.25rem 1rem;
    }

    .mobile-menu-btn { display: flex !important; }

    body.savorasave-app {
        padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    }

    body.savorasave-app.has-bottom-nav .main-content {
        padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
    }
}

@media (max-width: 768px) {
    .page-header-hero {
        padding: 1.25rem;
    }

    .page-title { font-size: 1.5rem; }
}

.collection-sheet-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    background: rgba(26, 95, 63, 0.06);
    border-radius: 8px;
    border-left: 3px solid var(--secondary);
}

/* ——— Nav page context ——— */
.nav-page-context {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: 0 0.25rem;
}

.nav-page-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--primary-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-page-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-status-dot {
    width: 10px;
    height: 10px;
    padding: 0 !important;
    border-radius: 50%;
    background: var(--success);
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px var(--border-strong);
}

.nav-status-dot.offline {
    background: var(--warning);
}

.nav-status-pill.api-connected,
.nav-status-dot.api-connected {
    background: var(--primary-muted);
    color: var(--primary-dark);
    border-color: var(--border-strong);
}

.nav-status-dot.api-connected {
    background: var(--primary);
}

/* ——— Filter card ——— */
.filter-card {
    border-style: dashed;
    background: rgba(255, 255, 255, 0.7);
}

/* ——— Mobile card list (members, activity) ——— */
.mobile-card-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mobile-data-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.mobile-data-card:active {
    transform: scale(0.99);
}

.mobile-data-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.mobile-data-card-header .member-avatar {
    flex-shrink: 0;
}

.mobile-data-card-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.2;
}

.mobile-data-card-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.mobile-data-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
}

.mobile-data-card-row:first-of-type {
    border-top: none;
    padding-top: 0;
}

.mobile-data-card-row span:first-child {
    color: var(--text-secondary);
    font-weight: 500;
}

.mobile-data-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border);
}

.mobile-data-card-actions .btn {
    flex: 1;
    min-height: 44px;
}

/* ——— Responsive tables (card layout) ——— */
@media (max-width: 991.98px) {
    .table-mobile-cards thead {
        display: none;
    }

    .table-mobile-cards tbody tr {
        display: block;
        margin-bottom: 0.75rem;
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        background: var(--bg-elevated);
        box-shadow: var(--shadow-xs);
        overflow: hidden;
    }

    .table-mobile-cards tbody tr:hover {
        background: var(--bg-elevated);
    }

    .table-mobile-cards tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
        padding: 0.65rem 1rem;
        border: none;
        border-bottom: 1px solid var(--border);
        text-align: right;
    }

    .table-mobile-cards tbody td:last-child {
        border-bottom: none;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .table-mobile-cards tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--text-muted);
        text-align: left;
        flex-shrink: 0;
    }

    .table-mobile-cards tbody td[data-label=""]::before,
    .table-mobile-cards tbody td:not([data-label])::before {
        display: none;
    }

    #dashboardSection .table-responsive:has(#recentActivityTable) {
        display: none;
    }
}

/* ——— Mobile bottom nav ——— */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(64px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(20, 40, 30, 0.08);
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 600;
    border: none;
    background: none;
    padding: 0.35rem 0.25rem;
    transition: var(--transition);
    min-height: 44px;
}

.bottom-nav-item i {
    font-size: 1.25rem;
}

.bottom-nav-item.active,
.bottom-nav-item:hover {
    color: var(--primary);
}

.bottom-nav-item.active i {
    color: var(--secondary);
}

/* ——— FAB ——— */
.fab-wrapper {
    position: fixed;
    right: 1rem;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    z-index: 999;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 0.65rem;
}

.fab-trigger {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--secondary), #c97d08);
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 4px 20px rgba(232, 148, 10, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.fab-trigger .fab-icon-close {
    display: none;
}

.fab-wrapper.open .fab-trigger {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    box-shadow: var(--shadow-glow);
    transform: rotate(90deg);
}

.fab-wrapper.open .fab-trigger .fab-icon-open {
    display: none;
}

.fab-wrapper.open .fab-trigger .fab-icon-close {
    display: block;
}

.fab-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: var(--transition);
    pointer-events: none;
}

.fab-wrapper.open .fab-actions {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.fab-action {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--bg-elevated);
    color: var(--primary);
    font-size: 1.15rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.fab-action:hover {
    background: var(--primary);
    color: white;
}

/* ——— Stat animation ——— */
.stat-value.stat-pulse {
    animation: statPulse 0.4s ease;
}

@keyframes statPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); color: var(--primary); }
    100% { transform: scale(1); }
}

/* ——— Touch targets & layout ——— */
.btn-action {
    min-height: 44px;
}

body.savorasave-app.has-bottom-nav {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
}

body.savorasave-app.has-bottom-nav .main-content {
    padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
}

.toast-container-app {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
}

.empty-state {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 2.5rem;
    color: var(--border-strong);
    margin-bottom: 0.75rem;
    display: block;
}

/* ——— Responsive ——— */
@media (max-width: 768px) {
    .navbar.nav-glass {
        padding: 0 0.75rem;
    }

    .navbar-brand {
        font-size: 1.2rem;
    }

    .page-header.d-flex {
        flex-direction: column;
        align-items: stretch !important;
    }

    .page-header.d-flex .btn {
        width: 100%;
    }

    .stat-card .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
        margin-bottom: 0.65rem;
    }

    .quick-action {
        padding: 1rem 0.5rem;
    }

    .quick-action-icon {
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }

    .quick-action .fw-bold {
        font-size: 0.78rem;
    }
}

@media (min-width: 992px) {
    .nav-page-context {
        display: none;
    }
}

@media print {
    .sidebar, .navbar, .btn, .quick-action, .mobile-bottom-nav, .fab-wrapper { display: none !important; }
    .main-content { margin-left: 0; }
    body.savorasave-app::before { display: none; }
}
