/* ═══════════════════════════════════════════════════════════════
   Zaloo Web App – Gold Premium / Pure Black Theme
   Matching Android Jetpack Compose UI
   ═══════════════════════════════════════════════════════════════ */

:root {
    --bg-primary: #000000;
    --bg-card: #0D0D0D;
    --bg-card-hover: #151515;
    --nav-bg: #080808;
    --accent: #D4A84B;
    --accent-dark: #B8912F;
    --accent-glow: rgba(212, 168, 75, 0.2);
    --success: #00E676;
    --success-glow: rgba(0, 230, 118, 0.15);
    --warning: #FF9800;
    --warning-glow: rgba(255, 152, 0, 0.1);
    --danger: #FF5252;
    --danger-glow: rgba(255, 82, 82, 0.1);
    --text-primary: #FFFFFF;
    --text-secondary: #E8D5A8;
    --text-muted: #8B7A3C;
    --gold-light: #E8C872;
    --gold-border: rgba(212, 168, 75, 0.2);
    --dark-glass: #080808;
    --zalo-blue: #0068FF;
    --grad-purple: #7C4DFF;
    --grad-blue: #448AFF;
    --grad-green1: #00E676;
    --grad-green2: #00BFA5;
    --grad-orange1: #FFAB40;
    --grad-orange2: #FF9100;
    --grad-pink1: #F50057;
    --grad-pink2: #FF4081;
    --radius: 16px;
    --radius-sm: 10px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    /* Fix: alias used in JS renderSettingsPricing */
    --text-dim: #6B6B6B;
    /* Font system */
    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior: none;
    user-select: none;
    overflow: hidden;
    width: 100%;
}

button,
a,
input,
textarea,
select,
label {
    touch-action: manipulation;
}

/* iOS standalone full-height fix */
@supports (-webkit-touch-callout: none) {
    html, body {
        height: -webkit-fill-available;
        min-height: -webkit-fill-available;
    }

    .screen,
    #main-app {
        height: -webkit-fill-available;
        min-height: -webkit-fill-available;
    }
}

body::after {
    content: '';
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--safe-bottom);
    background: var(--nav-bg);
    pointer-events: none;
}

/* scrollbar */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
}

/* ═══════ SCREENS ═══════ */
.screen {
    height: var(--app-height, 100dvh);
    min-height: var(--app-height, 100vh);
    display: none;
    flex-direction: column;
    pointer-events: none;
    width: 100%;
    background: var(--bg-primary);
    position: fixed;
    inset: 0;
}

.screen.active {
    display: flex;
    pointer-events: auto;
}

/* ═══════ AUTH SCREEN ═══════ */
.auth-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    background: radial-gradient(circle at 50% 30%, rgba(212, 168, 75, 0.06) 0%, transparent 60%);
}

.auth-logo {
    text-align: center;
    margin-bottom: 40px;
}

.auth-logo-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, var(--accent), var(--gold-light));
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    font-weight: 800;
    color: #000;
    box-shadow: 0 8px 32px rgba(212, 168, 75, 0.3);
    animation: logo-glow 3s ease-in-out infinite alternate;
}

@keyframes logo-glow {
    from {
        box-shadow: 0 8px 32px rgba(212, 168, 75, 0.25);
    }

    to {
        box-shadow: 0 12px 48px rgba(212, 168, 75, 0.45);
    }
}

.auth-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--accent);
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

.auth-form {
    width: 100%;
    max-width: 380px;
}

.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    background: var(--bg-card);
    border-radius: 12px;
    padding: 4px;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-tab.active {
    background: var(--accent);
    color: #000;
}

.auth-error {
    background: var(--danger-glow);
    border: 1px solid rgba(255, 82, 82, 0.3);
    color: var(--danger);
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 12px;
    animation: shake 0.3s;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0)
    }

    25% {
        transform: translateX(-4px)
    }

    75% {
        transform: translateX(4px)
    }
}

.input-group {
    position: relative;
    margin-bottom: 12px;
}

.input-group input {
    width: 100%;
    padding: 14px 14px 14px 44px;
    background: var(--bg-card);
    border: 1px solid var(--gold-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.input-group input:focus {
    border-color: var(--accent);
}

.input-group input::placeholder {
    color: var(--text-muted);
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 20px;
}

/* ═══════ BUTTONS ═══════ */
.btn-primary {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--gold-light));
    color: #000;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
    position: relative;
    font-family: inherit;
}

.btn-primary:active {
    transform: scale(0.97);
    opacity: 0.9;
}

.btn-full {
    width: 100%;
}

.btn-accent {
    padding: 10px 20px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #000;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-accent:active {
    transform: scale(0.96);
}

.btn-danger {
    padding: 8px 16px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 82, 82, 0.15);
    color: var(--danger);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(255, 82, 82, 0.2);
    font-family: inherit;
    transition: all 0.2s;
}

.btn-danger:active {
    background: rgba(255, 82, 82, 0.25);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 10px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    color: var(--accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.btn-icon:active {
    background: var(--accent-glow);
}

.btn-loader {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-text {
    display: inline;
}

/* ═══════ MAIN APP LAYOUT ═══════ */
#main-app {
    display: none;
    flex-direction: column;
    height: var(--app-height, 100dvh);
    overflow: hidden;
    min-height: var(--app-height, 100vh);
    width: 100%;
    background: var(--bg-primary);
    position: fixed;
    inset: 0;
}

#main-app.active {
    display: flex;
}

/* Pages container fills remaining space, nav stays fixed at bottom */
#pages-container {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overscroll-behavior: none;
    padding-bottom: calc(var(--nav-h, 56px) + var(--safe-bottom));
}

.bottom-nav {
    order: 1;
}

.page {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.page.active {
    display: flex;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    flex-shrink: 0;
    gap: 8px;
    flex-wrap: nowrap;
}

.page-header h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--accent);
    min-width: 0;
    flex: 1 1 auto;
}

.header-badges {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: nowrap;
    max-width: none;
    margin-left: auto;
    justify-content: flex-end;
}

.page-header > .btn-icon {
    margin-left: auto;
    flex: 0 0 auto;
}

.page-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(8px + var(--safe-bottom));
    overscroll-behavior: none;
    touch-action: pan-y;
}

/* ═══════ BADGES ═══════ */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.badge-accent {
    background: var(--accent-glow);
    color: var(--accent);
}

.badge-success {
    background: var(--success-glow);
    color: var(--success);
}

.badge-danger {
    background: var(--danger-glow);
    color: var(--danger);
}

.badge-warning {
    background: var(--warning-glow);
    color: var(--warning);
}

.badge-muted {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
}

.badge-zalo {
    background: rgba(0, 104, 255, 0.15);
    color: var(--zalo-blue);
}

/* ═══════ STATUS BADGE (APK-style) ═══════ */
.status-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.pulsing {
    animation: statusPulse 0.8s ease-in-out infinite alternate;
}

@keyframes statusPulse {
    from { opacity: 1; }
    to { opacity: 0.3; }
}

/* ═══════ TAB BAR ═══════ */
.tab-bar {
    display: flex;
    gap: 8px;
    padding: 0 16px 8px;
    flex-shrink: 0;
}

.tab-chip {
    padding: 8px 20px;
    border-radius: 20px;
    border: 1px solid var(--gold-border);
    background: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.tab-chip.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

/* ═══════ CARDS ═══════ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--gold-border);
    margin-bottom: 12px;
    transition: background 0.2s;
}

.card-body {
    padding: 16px;
}

.card-desc {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 12px;
    line-height: 1.5;
}

/* ═══════ NOTIFICATION CARDS ═══════ */
.notifications-list {
    padding: 8px 16px 0;
}

.notif-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1.5px solid rgba(212, 168, 75, 0.25);
    margin-bottom: 12px;
    margin-left: 6px;
    margin-top: 6px;
    overflow: visible;
    animation: slideIn 0.3s ease-out;
    position: relative;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.notif-bell {
    position: absolute;
    top: -6px;
    left: -6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    border: 2px solid var(--bg-primary);
}

.notif-card.accepted-card .notif-bell {
    background: var(--success);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notif-card.accepted {
    border-color: rgba(0, 230, 118, 0.3);
}

.notif-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px 0;
}

.notif-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    border: 2px solid var(--accent);
    background-size: cover;
    background-position: center;
}

.notif-meta {
    flex: 1;
    min-width: 0;
}

.notif-sender {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-group {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-time {
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
    font-weight: 500;
}

.notif-delay {
    font-size: 10px;
    font-weight: 600;
    color: var(--warning);
    background: var(--warning-glow);
    padding: 2px 6px;
    border-radius: 8px;
    white-space: nowrap;
}

.notif-content {
    margin: 8px 14px 12px;
    font-size: 15.5px;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 1.65;
    word-break: break-word;
    background: transparent;
    border-radius: 10px;
    border: none;
    display: flex;
    overflow: hidden;
}

.notif-content-bar {
    width: 3px;
    min-height: 30px;
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--accent), rgba(212, 168, 75, 0.5));
    transition: background 0.3s;
}

.notif-card.accepted-card .notif-content-bar {
    background: linear-gradient(180deg, var(--success), rgba(0, 230, 118, 0.5));
}

.notif-content-text {
    padding: 8px;
    font-family: var(--font-ui);
    color: #ffffff;
    background: transparent !important;
    border: none !important;
}

.notif-actions {
    display: flex;
    gap: 8px;
    padding: 0 14px 12px;
}

.btn-accept {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), var(--gold-light));
    color: #000;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-accept:active {
    transform: scale(0.97);
}

.btn-accept:disabled {
    opacity: 0.5;
    cursor: default;
}

.btn-accept.accepted {
    background: var(--success);
}

.btn-undo {
    padding: 10px 16px;
    border: 1px solid rgba(255, 82, 82, 0.3);
    border-radius: 10px;
    background: var(--danger-glow);
    color: var(--danger);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    position: relative;
    overflow: hidden;
}

.btn-undo:active {
    transform: scale(0.97);
}

.notif-progress {
    height: 3px;
    background: var(--gold-border);
}

.notif-progress-bar {
    height: 100%;
    background: var(--accent);
    transition: width 1s linear;
}

/* ═══════ EMPTY STATE ═══════ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    flex: 1;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.empty-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* ═══════ GROUPS ═══════ */
.group-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--gold-border);
    margin: 0 16px 10px;
}

.group-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
}

.group-info {
    flex: 1;
    min-width: 0;
}

.group-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.group-members {
    font-size: 11px;
    color: var(--text-muted);
}

/* Toggle Switch */
.toggle {
    position: relative;
    width: 48px;
    height: 28px;
    flex-shrink: 0;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    cursor: pointer;
    transition: 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle input:checked+.toggle-slider {
    background: var(--accent);
}

.toggle input:checked+.toggle-slider::before {
    transform: translateX(20px);
}

/* ═══════ KEYWORDS ═══════ */
.keyword-input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.keyword-input-row .input-text {
    flex: 1;
}

.chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: var(--accent-glow);
    border: 1px solid var(--gold-border);
    border-radius: 20px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 500;
    animation: scaleIn 0.2s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.chip .material-icons {
    font-size: 16px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.chip .material-icons:hover {
    opacity: 1;
}

/* ═══════ HISTORY ═══════ */
.history-item {
    padding: 14px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--gold-border);
    margin: 0 16px 10px;
}

.history-item.accepted {
    border-left: 3px solid var(--success);
}

.history-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.history-content {
    font-size: 14px;
    color: #ffffff;
    line-height: 1.4;
    margin-bottom: 6px;
    word-break: break-word;
}

.history-footer {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.history-tag {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.history-tag.accepted {
    background: var(--success-glow);
    color: var(--success);
}

/* ═══════ SETTINGS ═══════ */
.section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin: 16px 0 8px;
    padding-left: 4px;
}

.setting-item {
    margin-bottom: 16px;
}

.setting-item:last-child {
    margin-bottom: 0;
}

.setting-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.setting-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.setting-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.input-text {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--gold-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}

.input-text:focus {
    border-color: var(--accent);
}

.input-text::placeholder {
    color: var(--text-muted);
}

.slider-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slider-row input[type="range"] {
    flex: 1;
    /* Reset */
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: var(--gold-border);
    border-radius: 4px;
    outline: none;
}

.slider-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
}

.slider-val {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    min-width: 40px;
    text-align: right;
}

/* ═══════ ADMIN ═══════ */
.admin-user-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--gold-border);
    margin-bottom: 12px;
    padding: 16px;
}

.admin-user-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.admin-user-phone {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.admin-user-role {
    font-size: 11px;
    color: var(--accent);
}

.admin-user-info {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.admin-user-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-outline {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    background: none;
    color: var(--accent);
    border: 1px solid var(--gold-border);
}

.btn-outline:active {
    background: var(--accent-glow);
}

.plan-config-card {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--gold-border);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.plan-name {
    font-weight: 600;
    color: var(--text-primary);
}

.plan-detail {
    font-size: 12px;
    color: var(--text-muted);
}

/* ═══════ BOTTOM NAV ═══════ */
.bottom-nav {
    display: flex;
    background: var(--nav-bg);
    border-top: 1px solid rgba(212, 168, 75, 0.08);
    padding: 4px 0 calc(4px + var(--safe-bottom));
    flex-shrink: 0;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 0;
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
    font-family: inherit;
    position: relative;
}

.nav-item .material-icons-outlined {
    font-size: 22px;
    transition: color 0.2s;
}

.nav-label {
    font-size: 10px;
    font-weight: 500;
}

.nav-item.active {
    color: var(--accent);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--accent);
    border-radius: 0 0 3px 3px;
}

.nav-admin.active {
    color: var(--grad-orange1);
}

.nav-admin.active::before {
    background: var(--grad-orange1);
}

/* ═══════ DIALOGS ═══════ */
.dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.dialog {
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--gold-border);
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    animation: dialogSlide 0.3s ease-out;
}

@keyframes dialogSlide {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
}

.dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gold-border);
}

.dialog-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
}

.dialog-body {
    padding: 20px;
}

/* QR Dialog */
.qr-loading {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
}

.qr-image {
    text-align: center;
}

.qr-image img {
    max-width: 260px;
    width: 100%;
    border-radius: 12px;
}

.qr-status {
    text-align: center;
    margin-top: 12px;
    font-size: 14px;
    color: var(--text-secondary);
}

.qr-success {
    text-align: center;
    padding: 32px;
    color: var(--success);
}

.qr-success .material-icons {
    font-size: 64px;
    margin-bottom: 12px;
}

/* ═══════ SPINNER ═══════ */
.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 12px;
    border: 3px solid var(--gold-border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ═══════ UTILITIES ═══════ */
.text-muted {
    color: var(--text-muted);
}

.text-center {
    text-align: center;
}

.text-accent {
    color: var(--accent);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

/* Admin dialog form */
.dialog-form-group {
    margin-bottom: 14px;
}

.dialog-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.dialog-form-group select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--gold-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    font-family: inherit;
}

.dialog-form-group select option {
    background: var(--bg-card);
}

.dialog-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.dialog-actions .btn-accent {
    flex: 1;
    justify-content: center;
}

.dialog-actions .btn-outline {
    flex: 1;
    text-align: center;
}

/* ═══════ RESPONSIVE ═══════ */
@media (max-width: 390px) {
    .page-header h2 {
        font-size: 20px;
    }

    .notif-content {
        font-size: 14px;
    }
}

@media (min-width: 768px) {
    .auth-container {
        padding: 60px 40px;
    }

    .page-body {
        max-width: 600px;
        margin: 0 auto;
        width: 100%;
    }

    .notifications-list {
        max-width: 600px;
        margin: 0 auto;
    }
}

/* ═══════ ACCEPT PROGRESS BUTTON ═══════ */
.btn-accept-progress {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-accept-progress:active {
    transform: scale(0.97);
}

.btn-accept-progress:disabled {
    cursor: default;
}

.btn-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: linear-gradient(135deg, #0A1B2A, #FFB84D);
    border-radius: 10px;
}

.btn-progress-text {
    position: relative;
    z-index: 1;
    font-size: 14px;
    font-weight: 700;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.btn-accept-progress.accepted {
    background: var(--success);
}

.btn-accept-progress.accepted .btn-progress-text {
    color: #000;
    font-weight: 700;
}

/* ═══════ UNDO BUTTON ═══════ */
.btn-undo {
    padding: 10px 16px;
    border: 1px solid rgba(255, 82, 82, 0.3);
    border-radius: 10px;
    background: var(--danger-glow);
    color: var(--danger);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    position: relative;
    overflow: hidden;
}

.btn-undo:active {
    transform: scale(0.97);
}

/* ═══════ UNDO PROGRESS BUTTON ═══════ */
.btn-undo-progress {
    flex: 1;
    padding: 12px;
    border: 1px solid rgba(255, 82, 82, 0.3);
    border-radius: 10px;
    background: rgba(255, 82, 82, 0.1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-undo-progress:active {
    transform: scale(0.97);
}

.btn-undo-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: linear-gradient(135deg, var(--danger), #FF6B6B);
    border-radius: 10px;
    opacity: 0.7;
}

/* ═══════════════════════════════════════════════════════════════
   iPhone Safe Area & Responsive Fixes
   Supports: SE (375pt), 12/13/14 (390pt), XS Max/11/14+ (414pt),
             15 Pro Max (430pt)
   ═══════════════════════════════════════════════════════════════ */

/* Safe area insets for notch iPhones */
@supports (padding-top: env(safe-area-inset-top)) {
    .page-header {
        padding-top: calc(var(--safe-top) + 8px) !important;
    }

    .auth-container {
        padding-top: calc(var(--safe-top) + 16px) !important;
        padding-bottom: calc(var(--safe-bottom) + 16px) !important;
    }

    .dialog-overlay {
        padding-top: var(--safe-top);
        padding-bottom: var(--safe-bottom);
    }
}

/* Mobile-first: all phones up to 430pt */
@media (max-width: 430px) {

    /* Page header */
    .page-header {
        padding: 12px 16px;
        flex-wrap: nowrap;
        align-items: center;
    }

    .page-header h2 {
        font-size: 20px;
    }

    .header-badges {
        gap: 4px;
        max-width: 65%;
        justify-content: flex-end;
    }

    .badge {
        padding: 3px 8px;
        font-size: 10px;
    }

    /* Notification cards */
    .notifications-list {
        padding: 0 12px;
    }

    .notif-card {
        margin-bottom: 10px;
    }

    .notif-header {
        padding: 10px 12px 0;
        gap: 8px;
    }

    .notif-avatar {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }

    .notif-sender,
    .notif-group {
        font-size: 12px;
        max-width: 140px;
    }

    .notif-content {
        padding: 6px 12px 10px;
        font-size: 14px;
    }

    .notif-actions {
        padding: 0 12px 10px;
    }

    /* Bottom nav for all iPhones */
    .bottom-nav {
        padding: 6px 0 calc(6px + var(--safe-bottom));
    }

    .nav-item {
        gap: 1px;
        padding: 5px 0;
    }

    .nav-item .material-icons-outlined {
        font-size: 20px;
    }


    /* Groups */
    .group-item {
        margin: 0 12px 8px;
        padding: 12px;
        gap: 10px;
    }

    .group-avatar {
        width: 40px;
        height: 40px;
    }

    /* History */
    .history-item {
        margin: 0 12px 8px;
        padding: 12px;
    }

    /* Cards */
    .card-body {
        padding: 14px;
    }

    /* Settings */
    .section-title {
        font-size: 12px;
    }

    .setting-label {
        font-size: 13px;
    }

    /* Tab bar */
    .tab-bar {
        padding: 0 12px 6px;
        gap: 6px;
    }

    .tab-chip {
        padding: 6px 16px;
        font-size: 12px;
    }

    /* Auth */
    .auth-container {
        padding: 24px 20px;
    }

    .auth-logo-icon {
        width: 64px;
        height: 64px;
        font-size: 32px;
        border-radius: 20px;
    }

    .auth-title {
        font-size: 28px;
    }

    .auth-form {
        max-width: 100%;
    }
}

/* Extra small phones (iPhone SE, 375pt) */
@media (max-width: 375px) {
    .page-header h2 {
        font-size: 18px;
    }

    .notif-sender,
    .notif-group {
        font-size: 11px;
        max-width: 110px;
    }

    .notif-content {
        font-size: 13px;
    }


    .btn-accept-progress,
    .btn-undo-progress {
        padding: 10px;
        min-height: 40px;
    }

    .btn-progress-text {
        font-size: 13px;
    }
}

/* ═══════ Toggle Switch ═══════ */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #333;
    border-radius: 26px;
    transition: 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked+.toggle-slider {
    background: var(--accent);
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(22px);
}

/* ═══════ PAYMENT ═══════ */
.payment-plan-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--gold-border);
    border-radius: 14px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.payment-plan-card:hover {
    border-color: var(--accent);
    background: var(--bg-card-hover);
    transform: translateX(4px);
}

.payment-plan-card:active {
    transform: scale(0.98);
}

.payment-qr-container {
    padding: 8px 0;
}

.payment-qr-img {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 0 auto 16px;
    border-radius: 12px;
    background: #fff;
}

.payment-bank-info {
    background: rgba(212, 168, 75, 0.06);
    border: 1px solid var(--gold-border);
    border-radius: 12px;
    padding: 14px;
    font-size: 13px;
    line-height: 1.8;
}

/* ═══════ TABLET (768px – 1023px) ═══════ */
@media (min-width: 768px) and (max-width: 1023px) {
    .auth-container {
        padding: 60px 0;
    }

    .auth-form {
        max-width: 420px;
    }

    /* Wider content area on tablet */
    .page-body {
        max-width: 680px;
        margin: 0 auto;
        width: 100%;
        padding-left: 12px;
        padding-right: 12px;
    }

    .notifications-list {
        max-width: 680px;
        margin: 0 auto;
        padding: 0 12px;
    }

    .group-item,
    .history-item {
        margin-left: auto;
        margin-right: auto;
        max-width: 680px;
    }

    /* Larger touch targets on tablet */
    .notif-avatar {
        width: 44px;
        height: 44px;
    }

    .btn-accept-progress,
    .btn-undo-progress {
        min-height: 48px;
        font-size: 15px;
    }

    /* Bigger cards */
    .notif-content {
        font-size: 16px;
    }

    .page-header h2 {
        font-size: 24px;
    }

    /* Tab-bar slightly larger */
    .tab-chip {
        padding: 10px 24px;
    }

    /* nav labels bigger */

    .nav-item .material-icons-outlined {
        font-size: 24px;
    }
}

/* ═══════ DESKTOP (1024px+) ═══════ */
@media (min-width: 1024px) {
    /* Convert bottom nav to side nav */
    #main-app {
        flex-direction: row;
    }

    .bottom-nav {
        flex-direction: column;
        width: 220px;
        height: 100vh;
        height: 100dvh;
        border-top: none;
        border-right: 1px solid rgba(212, 168, 75, 0.08);
        padding: 24px 12px;
        justify-content: flex-start;
        gap: 4px;
        flex-shrink: 0;
        overflow: hidden;
        position: relative;
        left: auto;
        right: auto;
        bottom: auto;
    }

    .nav-item {
        flex: 0;
        flex-direction: row;
        justify-content: flex-start;
        width: 100%;
        padding: 12px 16px;
        border-radius: 12px;
        gap: 12px;
    }

    .nav-item.active::before {
        top: 50%;
        left: 0;
        transform: translateY(-50%);
        width: 3px;
        height: 24px;
        border-radius: 0 3px 3px 0;
    }

    .nav-item:hover {
        background: var(--accent-glow);
    }


    .nav-item .material-icons-outlined {
        font-size: 22px;
    }

    /* Main content area fills space */
    #pages-container {
        flex: 1;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        padding-bottom: 0;
    }

    .page {
        max-width: 860px;
    }

    .page-header {
        padding: 20px 32px;
    }

    .page-header h2 {
        font-size: 26px;
    }

    .page-body {
        max-width: 860px;
        padding: 0 16px;
    }

    .notifications-list {
        max-width: 860px;
        margin: 0 auto;
        padding: 0 16px;
    }

    .group-item,
    .history-item {
        max-width: 860px;
        margin-left: auto;
        margin-right: auto;
    }

    /* Bigger notif cards on desktop */
    .notif-content {
        font-size: 16px;
    }

    .btn-accept-progress,
    .btn-undo-progress {
        min-height: 48px;
        font-size: 15px;
    }

    /* Auth form centered nicely on desktop */
    .auth-container {
        padding: 80px 0;
    }

    .auth-form {
        max-width: 440px;
    }

    /* Hover state for desktop */
    .notif-card:hover {
        border-color: rgba(212, 168, 75, 0.35);
        background: var(--bg-card-hover);
    }

    .group-item:hover {
        background: var(--bg-card-hover);
    }
}

/* ═══════ LARGE DESKTOP (1280px+) ═══════ */
@media (min-width: 1280px) {
    .bottom-nav {
        width: 240px;
    }

    .page,
    .page-body,
    .notifications-list {
        max-width: 960px;
    }

    .page-header {
        padding: 24px 40px;
    }
}

/* ═══════ KEYBOARD OPEN FIX (mobile) ═══════ */
/* When virtual keyboard is shown, use dvh instead of fixed 100vh */
@supports (height: 100dvh) {
    .screen,
    #main-app {
        height: var(--app-height, 100dvh);
        min-height: var(--app-height, 100dvh);
    }
}

/* Prevent body scroll when keyboard pops on mobile */
@media (max-width: 430px) {
    .auth-container {
        /* Allow scroll when keyboard opens */
        overflow-y: auto;
        height: auto;
        min-height: calc(100dvh - 32px);
        justify-content: flex-start;
        padding-top: max(32px, env(safe-area-inset-top, 32px));
    }
}

/* ============================================================
   2026 Modern UI Theme (Ocean Blue / Night Glass)
   Overrides without breaking existing structure.
   ============================================================ */
:root {
    --bg-primary: #0A111A;
    --bg-card: rgba(15, 23, 34, 0.9);
    --bg-card-hover: rgba(22, 32, 46, 0.96);
    --nav-bg: rgba(11, 17, 26, 0.92);
    --accent: #2AA9FF;
    --accent-dark: #1E7FE0;
    --accent-glow: rgba(42, 169, 255, 0.22);
    --success: #3EEA8E;
    --success-glow: rgba(62, 234, 142, 0.18);
    --warning: #FFC36A;
    --warning-glow: rgba(255, 195, 106, 0.18);
    --danger: #FF6B7A;
    --danger-glow: rgba(255, 107, 122, 0.18);
    --text-primary: #F4F8FF;
    --text-secondary: #B9C6DA;
    --text-muted: #7E8FA6;
    --gold-light: #A7D8FF;
    --gold-border: rgba(42, 169, 255, 0.18);
    --dark-glass: rgba(9, 13, 18, 0.76);
    --zalo-blue: #0A6CFF;
    --radius: 18px;
    --radius-sm: 12px;
    --shadow-1: 0 10px 26px rgba(0, 0, 0, 0.32);
    --shadow-2: 0 20px 44px rgba(0, 0, 0, 0.48);
    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
}

body {
    font-family: var(--font-ui);
    font-size: clamp(14px, 1.2vw, 16px);
    color-scheme: dark;
    background:
        radial-gradient(900px 420px at 12% -10%, rgba(42, 169, 255, 0.16), transparent 60%),
        radial-gradient(700px 380px at 90% 5%, rgba(92, 197, 255, 0.18), transparent 55%),
        linear-gradient(180deg, #0A111A 0%, #0A0F18 35%, #0A111A 100%);
}

body::before {
    content: '';
    position: fixed;
    inset: -25%;
    background:
        radial-gradient(300px 200px at 18% 78%, rgba(42, 169, 255, 0.1), transparent 60%),
        radial-gradient(260px 180px at 82% 72%, rgba(92, 197, 255, 0.08), transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.screen,
#main-app,
#pages-container {
    z-index: 1;
}

.auth-container {
    background:
        radial-gradient(600px 320px at 50% 10%, rgba(42, 169, 255, 0.16), transparent 60%),
        radial-gradient(520px 260px at 85% 90%, rgba(92, 197, 255, 0.12), transparent 60%);
}

.auth-form {
    padding: 20px;
    border-radius: 18px;
    backdrop-filter: blur(12px);
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: var(--shadow-2);
}

.auth-title {
    font-family: var(--font-display);
}

.input-group input,
.input-text,
.dialog-form-group input,
.dialog-form-group select {
    background: rgba(9, 12, 16, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 0 0 1px rgba(42, 169, 255, 0.12);
}

.input-group input:focus,
.input-text:focus,
.dialog-form-group input:focus,
.dialog-form-group select:focus {
    border-color: rgba(42, 169, 255, 0.6);
    box-shadow: 0 0 0 3px rgba(42, 169, 255, 0.18);
}

.page-header {
    background: linear-gradient(180deg, rgba(10, 14, 20, 0.9), rgba(10, 14, 20, 0.4));
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 5;
}

.page-header h2 {
    color: var(--text-primary);
    font-weight: 700;
    font-family: var(--font-display);
}

.dashboard-title {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.header-badges .badge,
.status-badge {
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
}

.dashboard-header .header-badges {
    flex: 1;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: nowrap;
}

.dashboard-header .status-badge,
.dashboard-header .badge {
    font-size: 12px;
    padding: 6px 12px;
}

.badge-accent {
    background: rgba(42, 169, 255, 0.16);
    color: #8BD4FF;
}

.badge-muted {
    color: var(--text-secondary);
}

.btn-primary,
.btn-accent,
.btn-accept,
.btn-accept-progress {
    background: linear-gradient(135deg, var(--accent), #86D7FF);
    color: #071014;
    border: none;
    box-shadow: 0 10px 24px rgba(42, 169, 255, 0.28);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn-outline {
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.btn-icon {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-danger {
    background: rgba(255, 107, 122, 0.14);
    border: 1px solid rgba(255, 107, 122, 0.25);
}

.card,
.notif-card,
.group-item,
.history-item,
.admin-user-card,
.plan-config-card,
.payment-plan-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-1);
}

.notif-card {
    animation: notifIn 0.35s ease both;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
    will-change: transform, opacity;
    contain: layout;
    overflow: visible;
    transform: translateZ(0);
    max-height: none;
}

.notif-exit {
    opacity: 0;
    transform: none;
    transition: opacity 0.26s ease;
}

.notif-card:hover {
    transform: translateY(-2px);
    border-color: rgba(42, 169, 255, 0.35);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
}


.notif-meta > div {
    flex-wrap: wrap;
    gap: 4px 8px;
}

.notif-group,
.notif-sender {
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
}

.notif-card .notif-group {
    color: var(--warning) !important;
}

.notif-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(62, 234, 142, 0.16);
    color: var(--success);
    font-size: 11px;
    font-weight: 600;
}

.status-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    margin-left: 6px;
    vertical-align: middle;
    animation: statusSpin 0.8s linear infinite;
}

@keyframes statusSpin {
    to { transform: rotate(360deg); }
}


.group-name,
.history-header > div > div:first-child {
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.bottom-nav {
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 18px 18px 0 0;
    padding: 8px 6px calc(8px + var(--safe-bottom));
}

.nav-item {
    min-height: 48px;
    border-radius: 14px;
    transition: background 0.18s ease, transform 0.18s ease, color 0.18s ease;
    gap: 1px;
}


.nav-item.active {
    color: #8BD4FF;
    background: rgba(42, 169, 255, 0.14);
}

.nav-item.active::before {
    background: #8BD4FF;
}

.dialog {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-2);
}

.dialog-header h3 {
    font-family: var(--font-display);
}

.empty-state {
    color: var(--text-secondary);
}

.page.active {
    animation: pageRise 0.25s ease-out;
}

@keyframes pageRise {
    from { opacity: 0.6; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes notifIn {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(42, 169, 255, 0.22); }
    50% { box-shadow: 0 0 0 6px rgba(42, 169, 255, 0); }
}

@keyframes progressGlow {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

@media (hover: hover) {
    .btn-primary:hover,
    .btn-accent:hover,
    .btn-accept:hover {
        filter: brightness(1.05);
        transform: translateY(-1px);
        box-shadow: 0 14px 28px rgba(42, 169, 255, 0.32);
    }

    .nav-item:hover {
        background: rgba(255, 255, 255, 0.06);
    }
}

@media (max-width: 430px) {
    .header-badges {
        max-width: 60%;
        gap: 4px;
    }

    .badge,
    .status-badge {
        font-size: 10px;
        padding: 4px 8px;
        line-height: 1.2;
    }

    .nav-item span {
        font-size: 18px !important;
    }


    .btn-icon {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 375px) {
    .badge,
    .status-badge {
        font-size: 9px;
        padding: 3px 7px;
    }

    .nav-item span {
        font-size: 17px !important;
    }
}

.notif-progress-bar {
    background-image: linear-gradient(90deg, rgba(42, 169, 255, 0.95), rgba(134, 215, 255, 0.95), rgba(42, 169, 255, 0.95));
    background-size: 200% 100%;
    animation: progressGlow 1.2s linear infinite;
}

.status-badge {
    animation: badgePulse 2.8s ease-in-out infinite;
}

@media (min-width: 1024px) {
    .bottom-nav {
        left: auto;
        right: auto;
        bottom: auto;
        border-radius: 0;
        box-shadow: none;
        border: none;
        border-right: 1px solid rgba(255, 255, 255, 0.08);
    }

}

/* ============================================================
   High-Contrast & Outdoor Readability
   ============================================================ */
@media (prefers-contrast: more) {
    :root {
        --bg-card: #0F1824;
        --bg-card-hover: #142033;
        --nav-bg: #0D1722;
        --text-primary: #FFFFFF;
        --text-secondary: #DCE6F5;
        --text-muted: #A7B7CC;
        --accent: #4DBBFF;
        --accent-dark: #2E97F2;
        --accent-glow: rgba(77, 187, 255, 0.3);
        --gold-border: rgba(77, 187, 255, 0.28);
    }

    .card,
    .notif-card,
    .group-item,
    .history-item,
    .admin-user-card,
    .plan-config-card,
    .payment-plan-card,
    .bottom-nav,
    .dialog {
        border-color: rgba(255, 255, 255, 0.16);
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
    }

    .input-group input,
    .input-text,
    .dialog-form-group input,
    .dialog-form-group select {
        background: #0B121B;
        border-color: rgba(255, 255, 255, 0.18);
    }
}

@media (prefers-reduced-transparency: reduce) {
    .auth-form,
    .page-header,
    .bottom-nav,
    .dialog {
        backdrop-filter: none;
    }

    .card,
    .notif-card,
    .group-item,
    .history-item,
    .admin-user-card,
    .plan-config-card,
    .payment-plan-card {
        background: #0F1824;
    }
}

@media (max-width: 430px) {
}

@media (max-width: 375px) {
}

/* ============================================================
   Small Screen Optimizations (iPhone SE / small Android)
   ============================================================ */
@media (max-width: 360px) {
    .page-header {
        padding: 10px 12px;
    }

    .page-header h2 {
        font-size: 18px;
    }

    .notifications-list {
        padding: 0 10px;
    }

    .notif-header {
        padding: 8px 10px 0;
    }

    .notif-content {
        margin: 6px 10px 10px;
        font-size: 13px;
    }

    .notif-actions {
        padding: 0 10px 10px;
    }

    .group-item,
    .history-item {
        margin: 0 10px 8px;
        padding: 10px;
    }

    .tab-chip {
        padding: 6px 12px;
        font-size: 11px;
    }

}

@media (max-width: 320px) {
    .nav-item {
        min-height: 44px;
    }


    .btn-accept-progress,
    .btn-undo-progress {
        min-height: 38px;
        padding: 9px;
    }
}

/* ============================================================
   Skeleton Loading
   ============================================================ */
.skeleton-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 16px;
}

.skeleton-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px;
}

.skeleton-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.skeleton-lines {
    flex: 1;
    min-width: 0;
}

.skeleton-line {
    height: 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    margin-top: 8px;
}

.skeleton-line:first-child {
    margin-top: 0;
}

.skeleton-badge {
    width: 48px;
    height: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.skeleton-pill {
    width: 44px;
    height: 22px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.skeleton-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.skeleton-btn {
    height: 28px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
}

.w-35 { width: 35%; }
.w-40 { width: 40%; }
.w-50 { width: 50%; }
.w-55 { width: 55%; }
.w-60 { width: 60%; }
.w-70 { width: 70%; }
.w-90 { width: 90%; }

.skeleton-shimmer::after {
    content: '';
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
    animation: skeletonShimmer 1.2s infinite;
}

@keyframes skeletonShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@media (max-width: 360px) {
    .skeleton-list {
        padding: 10px 12px;
    }

    .skeleton-card {
        padding: 10px;
    }

    .skeleton-avatar {
        width: 34px;
        height: 34px;
    }
}

/* ============================================================
   Rebuilt Bottom Menu (match reference)
   ============================================================ */
.menu-new {
    height: 64px;
    padding: 6px 8px;
    gap: 2px;
}

.menu-new .nav-item {
    min-height: 52px;
    padding: 6px 0 8px;
    border-radius: 14px;
    gap: 4px;
}

.menu-new .nav-icon {
    font-size: 19px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
}

.menu-new .nav-label {
    font-size: 9px !important;
    line-height: 1.05 !important;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    margin-top: 2px;
}

.menu-new .nav-item.active .nav-icon,
.menu-new .nav-item.active .nav-label {
    color: #7EBBFF;
}

@media (max-width: 430px) {
    .menu-new .nav-label {
        font-size: 8px !important;
    }
}

@media (max-width: 360px) {
    .menu-new .nav-label {
        font-size: 7.5px !important;
    }
}

/* ============================================================
   Notification Card Theme V2 (gold + emerald)
   ============================================================ */
#notifications-list .notif-card {
    background: linear-gradient(145deg, #191206 0%, #0e0b06 60%, #0b0a08 100%) !important;
    border: 1px solid rgba(232, 184, 72, 0.28) !important;
    border-radius: 18px !important;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.45) !important;
    padding: 10px 10px 9px !important;
    margin: 8px 0 !important;
}

#notifications-list .notif-card.accepted-card {
    background: linear-gradient(145deg, #032b1e 0%, #052316 65%, #031510 100%) !important;
    border-color: rgba(0, 255, 153, 0.35) !important;
}

#notifications-list .notif-header {
    align-items: center !important;
    padding: 0 !important;
    gap: 8px !important;
}

#notifications-list .notif-avatar {
    width: 42px !important;
    height: 42px !important;
    border: 2px solid rgba(232, 184, 72, 0.35);
    box-shadow: 0 0 0 4px rgba(232, 184, 72, 0.08);
}

#notifications-list .notif-card.accepted-card .notif-avatar {
    border-color: rgba(0, 255, 153, 0.42);
    box-shadow: 0 0 0 4px rgba(0, 255, 153, 0.10);
}

#notifications-list .notif-title-grid {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

#notifications-list .notif-left {
    min-width: 0;
    flex: 1;
}

#notifications-list .notif-sub-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 3px;
    flex-wrap: wrap;
}

#notifications-list .notif-sender {
    color: #f7f9ff !important;
    font-weight: 800 !important;
    font-size: 14px;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 48%;
}

#notifications-list .notif-group {
    color: #d7a847 !important;
    font-weight: 600 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#notifications-list .notif-card.accepted-card .notif-group {
    color: #7cf0be !important;
}

#notifications-list .notif-time {
    color: rgba(195, 200, 210, 0.72) !important;
    font-size: 11px !important;
}

#notifications-list .notif-delay {
    background: rgba(232, 184, 72, 0.12) !important;
    color: #f1be58 !important;
    border: 1px solid rgba(232, 184, 72, 0.25);
}

#notifications-list .notif-content {
    margin: 8px 0 !important;
    border: 1px solid rgba(232, 184, 72, 0.18) !important;
    background: linear-gradient(180deg, #111111 0%, #090909 100%) !important;
    border-radius: 12px !important;
}

#notifications-list .notif-content-bar {
    background: linear-gradient(180deg, #f4c869, #9e6f10) !important;
}

#notifications-list .notif-card.accepted-card .notif-content {
    border-color: rgba(0, 255, 153, 0.22) !important;
    background: linear-gradient(180deg, #06261b 0%, #041811 100%) !important;
}

#notifications-list .notif-card.accepted-card .notif-content-bar {
    background: linear-gradient(180deg, #00fca0, #00985f) !important;
}

#notifications-list .notif-content-text {
    color: #ffffff !important;
    font-weight: 600 !important;
}

#notifications-list .btn-accept-progress {
    height: 40px !important;
    border-radius: 12px !important;
    border: 1px solid rgba(232, 184, 72, 0.45) !important;
    background: #2c210d !important;
}

#notifications-list .btn-progress-fill {
    background: linear-gradient(90deg, #f4cf78, #b98f3a) !important;
}

#notifications-list .btn-accept-progress.accepted,
#notifications-list .notif-card.accepted-card .btn-accept-progress {
    border-color: rgba(0, 255, 153, 0.45) !important;
}

#notifications-list .notif-actions {
    padding: 0 !important;
    margin-top: 6px;
}

#notifications-list .notif-bell {
    top: 6px !important;
    left: 6px !important;
    width: 20px !important;
    height: 20px !important;
    font-size: 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 6 !important;
    pointer-events: none;
    background: linear-gradient(180deg, #2a1f08, #130f07) !important;
    color: #f1be58 !important;
    border: 1px solid rgba(232, 184, 72, 0.38) !important;
}

#notifications-list .notif-card.accepted-card .notif-bell {
    background: linear-gradient(180deg, #063121, #041910) !important;
    color: #00f8a2 !important;
    border-color: rgba(0, 255, 153, 0.4) !important;
}
