/* ==========================================================================
   HUALIEN COUNTY DISASTER LIAISON OFFICER WEB APP (MOBILE DESIGN SYSTEM)
   ========================================================================== */

:root {
    /* Color Palette */
    --bg-dark: #090d16;
    --bg-header: #0f172a;
    --panel-bg: rgba(15, 23, 42, 0.85);
    --card-bg: rgba(30, 41, 59, 0.65);
    --card-border: rgba(255, 255, 255, 0.1);
    
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: rgba(37, 99, 235, 0.15);
    --secondary: #06b6d4;
    
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.15);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.15);
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.15);
    --info: #3b82f6;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --border-radius-sm: 8px;
    --border-radius-md: 14px;
    --border-radius-lg: 20px;
    --border-radius-full: 9999px;
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.5);
    --glow-primary: 0 0 20px rgba(37, 99, 235, 0.4);
    --glow-danger: 0 0 20px rgba(239, 68, 68, 0.4);
}

/* Reset & Base Styles */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    touch-action: manipulation;
}

html {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

body {
    width: 100%;
    min-height: 100dvh;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overscroll-behavior: none;
    -webkit-user-select: none;
    user-select: none;
}

input, textarea, select {
    font-size: 16px !important;
    -webkit-user-select: text;
    user-select: text;
    touch-action: auto;
}

/* Container Frame — fills 100% on mobile, max 480px on desktop */
#app, .app-container {
    width: 100%;
    flex: 1;
    min-height: 100dvh;
    background: radial-gradient(circle at top, #1e293b 0%, #090d16 80%);
    position: relative;
    display: flex;
    flex-direction: column;
}

@media (min-width: 600px) {
    body {
        align-items: center;
    }
    #app, .app-container {
        max-width: 480px;
        box-shadow: 0 0 60px rgba(0,0,0,0.9);
    }
}

/* Glassmorphism Panel Utility */
.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
}

.screen {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.screen.hidden {
    display: none !important;
}

.screen.active {
    display: flex;
    animation: fadeIn 0.3s ease-out forwards;
}

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

/* ==========================================================================
   1. LOGIN SCREEN STYLES
   ========================================================================== */

#loginScreen {
    justify-content: center;
    /* Add safe area padding so login card doesn't hide behind notch/Dynamic Island */
    padding: calc(24px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom)) 20px;
    overflow-y: auto;
}

.login-bg-decor {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.login-bg-decor .circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.25;
}

.circle-1 {
    width: 250px;
    height: 250px;
    background: var(--primary);
    top: -50px;
    right: -50px;
}

.circle-2 {
    width: 200px;
    height: 200px;
    background: var(--danger);
    bottom: 50px;
    left: -50px;
}

.login-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.brand-header {
    text-align: center;
    margin-bottom: 8px;
}

.badge-emblem {
    width: 64px;
    height: 64px;
    margin: 0 auto 12px auto;
    background: linear-gradient(135deg, #ef4444, #f59e0b);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #fff;
    box-shadow: var(--glow-danger);
}

.eoc-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--secondary);
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.3);
    padding: 4px 12px;
    border-radius: var(--border-radius-full);
    margin-bottom: 8px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--danger);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--danger);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.3); }
    100% { opacity: 1; transform: scale(1); }
}

.brand-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: linear-gradient(to right, #ffffff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.login-card {
    padding: 24px 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.form-group label {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input, .form-control {
    width: 100%;
    height: 48px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--border-radius-md);
    padding: 0 16px 0 44px;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: all 0.2s ease;
}

.input-wrapper input:focus, .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
    background: rgba(15, 23, 42, 0.95);
}

.input-icon {
    position: absolute;
    left: 14px;
    font-size: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.btn-toggle-pw {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
}

.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text-secondary);
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

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

.alert-box {
    padding: 10px 14px;
    border-radius: var(--border-radius-md);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.alert-box.error {
    background: var(--danger-bg);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert-box.hidden {
    display: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #1d4ed8);
    color: #fff;
    border: none;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-block {
    width: 100%;
}

.btn-lg {
    height: 50px;
    font-size: 16px;
}

.btn-sm {
    height: 38px;
    font-size: 13.5px;
    padding: 0 16px;
}

.btn-xs {
    height: 30px;
    font-size: 12px;
    padding: 0 10px;
    border-radius: var(--border-radius-sm);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    border-radius: var(--border-radius-md);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-secondary:hover, .btn-secondary:active {
    background: rgba(255, 255, 255, 0.15);
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
    cursor: pointer;
}

.btn-outline:active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.quick-demo-box {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px dashed rgba(255, 255, 255, 0.12);
    text-align: center;
}

.quick-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--warning);
}

.quick-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin: 4px 0 12px 0;
}

.login-footer {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

.version-tag {
    font-size: 11px;
    margin-top: 2px;
    opacity: 0.7;
}


/* ==========================================================================
   2. MAIN DASHBOARD SCREEN & HEADER
   ========================================================================== */

#mainScreen {
    /* Bottom space for tab bar + iOS home indicator */
    padding-bottom: calc(74px + env(safe-area-inset-bottom));
}

.app-header {
    background: var(--bg-header);
    border-bottom: 1px solid var(--card-border);
    /* Safe area top — accounts for Dynamic Island / notch in PWA mode */
    padding: calc(16px + env(safe-area-inset-top)) 16px 12px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-md);
}

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

.officer-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-badge {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    box-shadow: var(--glow-primary);
}

.officer-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.officer-station {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.location-tag {
    color: var(--secondary);
    font-weight: 600;
}

.btn-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:active {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

/* Station status bar */
.station-status-bar {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.status-label {
    font-size: 12px;
    color: var(--text-muted);
}

.status-pills {
    display: flex;
    gap: 6px;
}

.pill-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: var(--border-radius-full);
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.pill-btn .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.dot.green { background-color: var(--success); }
.dot.yellow { background-color: var(--warning); }
.dot.gray { background-color: var(--text-muted); }

.pill-btn.active {
    background: rgba(37, 99, 235, 0.2);
    border-color: var(--primary);
    color: var(--text-primary);
}


/* ==========================================================================
   3. APP BODY & TAB PANELS
   ========================================================================== */

.app-body {
    padding: 16px;
    flex: 1;
}

.tab-content {
    display: none;
    flex-direction: column;
    gap: 16px;
}

.tab-content.active {
    display: flex;
    animation: fadeIn 0.25s ease-out forwards;
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-md);
    padding: 16px;
    backdrop-filter: blur(10px);
}

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

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-title i {
    color: var(--secondary);
}

.sub-text {
    font-size: 11.5px;
    color: var(--text-muted);
}

/* Event Banner Card */
.event-banner {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
    border-left: 4px solid var(--danger);
}

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

.badge {
    padding: 3px 8px;
    border-radius: var(--border-radius-sm);
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-danger {
    background: var(--danger-bg);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.update-time {
    font-size: 11px;
    color: var(--text-muted);
}

.event-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 14px;
    color: #fff;
}

/* Overview Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.stat-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--border-radius-sm);
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
}

.bg-blue { background: rgba(37, 99, 235, 0.2); color: #60a5fa; }
.bg-teal { background: rgba(6, 182, 212, 0.2); color: #22d3ee; }
.bg-amber { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.bg-purple { background: rgba(168, 85, 247, 0.2); color: #c084fc; }

.stat-value {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.1;
}

.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Quick Action Banner */
.quick-action-card {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(6, 182, 212, 0.2));
    border: 1px solid rgba(37, 99, 235, 0.4);
    border-radius: var(--border-radius-md);
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.action-text h3 {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.action-text p {
    font-size: 11.5px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Township List Snapshots */
.township-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.township-item {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-sm);
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.township-name {
    font-weight: 600;
    font-size: 13.5px;
}

.township-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
}

.township-badge.active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

/* ==========================================================================
   4. DATA REPORT FORM & STEPPERS
   ========================================================================== */

.form-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.form-header h2 {
    font-size: 17px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.form-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.form-control.select-lg {
    height: 48px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 18px;
    appearance: none;
    padding-right: 40px;
    padding-left: 16px;
}

.form-section {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--border-radius-md);
    padding: 14px;
    margin-bottom: 16px;
}

.section-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stepper-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}

.stepper-field:last-child {
    border-bottom: none;
}

.field-info {
    display: flex;
    flex-direction: column;
}

.field-name {
    font-size: 13.5px;
    font-weight: 500;
}

.field-unit {
    font-size: 11px;
    color: var(--text-muted);
}

/* Stepper Control (+/- Buttons for Mobile) */
.stepper-control {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.btn-stepper {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--text-primary);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.btn-stepper:active {
    background: var(--primary);
}

.stepper-input {
    width: 48px;
    height: 36px;
    background: transparent;
    border: none;
    text-align: center;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    padding: 0;
    outline: none;
    -moz-appearance: textfield;
}

.stepper-input::-webkit-outer-spin-button,
.stepper-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

textarea.form-control {
    height: auto;
    padding: 12px;
    font-size: 13.5px;
    resize: vertical;
}


/* ==========================================================================
   5. HISTORY TIMELINE & CONTACTS
   ========================================================================== */

.timeline-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    padding-left: 12px;
}

.timeline-wrapper::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: rgba(255, 255, 255, 0.1);
}

.timeline-item {
    position: relative;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius-sm);
    padding: 12px;
    margin-left: 8px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -17px;
    top: 14px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary);
}

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

.item-township {
    font-weight: 700;
    font-size: 13.5px;
    color: var(--secondary);
}

.item-time {
    font-size: 11px;
    color: var(--text-muted);
}

.item-stats {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.item-notes {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
    font-size: 11.5px;
    color: var(--warning);
}

/* Contacts List */
.contact-search-box {
    position: relative;
    margin-bottom: 12px;
}

.contact-search-box input {
    width: 100%;
    height: 40px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--border-radius-md);
    padding: 0 14px 0 38px;
    color: #fff;
    font-size: 13px;
    outline: none;
}

.contact-search-box i {
    position: absolute;
    left: 12px;
    top: 12px;
    color: var(--text-muted);
}

.contact-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 380px;
    overflow-y: auto;
}

.contact-card {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--border-radius-sm);
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contact-info {
    display: flex;
    flex-direction: column;
}

.contact-name {
    font-weight: 600;
    font-size: 13.5px;
}

.contact-role {
    font-size: 11.5px;
    color: var(--text-muted);
}

.btn-call {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 16px;
    transition: all 0.2s ease;
}

.btn-call:active {
    background: var(--success);
    color: #fff;
}


/* ==========================================================================
   6. BOTTOM TOUCH NAVIGATION BAR
   ========================================================================== */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    /* Expand height to include iOS home indicator safe area */
    height: calc(64px + env(safe-area-inset-bottom));
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding-top: 10px;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 200;
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
    width: 25%;
}

.nav-item i {
    font-size: 20px;
    transition: transform 0.2s ease;
}

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

.nav-item.active i {
    transform: translateY(-2px);
    color: var(--secondary);
}


/* ==========================================================================
   7. TOAST NOTIFICATIONS
   ========================================================================== */

.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--success);
    color: var(--text-primary);
    padding: 10px 18px;
    border-radius: var(--border-radius-full);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    z-index: 999;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.toast-icon {
    color: var(--success);
    font-size: 18px;
}

.toast.hidden {
    opacity: 0;
    transform: translate(-50%, -20px);
    pointer-events: none;
}
