/* ═══════════════════════════════════════════════════════════════
   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-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior: none;
    user-select: none;
}

/* scrollbar */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
}

/* ═══════ SCREENS ═══════ */
.screen {
    height: 100vh;
    height: 100dvh;
    display: none;
    flex-direction: column;
}

.screen.active {
    display: flex;
}

/* ═══════ 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: 100vh;
    height: 100dvh;
}

#main-app.active {
    display: flex;
}

.page {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.page.active {
    display: flex;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    flex-shrink: 0;
}

.page-header h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--accent);
}

.header-badges {
    display: flex;
    gap: 6px;
    align-items: center;
}

.page-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
}

/* ═══════ BADGES ═══════ */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.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);
}

/* ═══════ 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: 0 16px;
}

.notif-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--gold-border);
    margin-bottom: 12px;
    overflow: hidden;
    animation: slideIn 0.3s ease-out;
    position: relative;
}

@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 {
    padding: 8px 14px 12px;
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.5;
    word-break: break-word;
}

.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: var(--text-secondary);
    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;
    letter-spacing: 0.5px;
    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;
}

.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, var(--accent), var(--gold-light));
    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(env(safe-area-inset-top, 0px) + 8px) !important;
    }

    .auth-container {
        padding-top: calc(env(safe-area-inset-top, 0px) + 16px) !important;
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 16px) !important;
    }

    .bottom-nav {
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 4px) !important;
    }

    .dialog-overlay {
        padding-top: env(safe-area-inset-top, 0px);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
}

/* Mobile-first: all phones up to 430pt */
@media (max-width: 430px) {

    /* Page header */
    .page-header {
        padding: 12px 16px;
    }

    .page-header h2 {
        font-size: 20px;
    }

    .header-badges {
        gap: 4px;
    }

    .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;
    }

    .nav-label {
        font-size: 9px;
    }

    /* 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;
    }

    .nav-label {
        font-size: 8px;
    }

    .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;
}