/* Reset & Base Variables */
:root {
    --primary: #0f2b46;          /* Maas-Blauw */
    --accent: #ff7a00;           /* Veiligheid-Oranje */
    --accent-light: #fff0e0;     /* Licht oranje voor warnings */
    --bg-main: #f8fafc;          /* Lichtgrijze achtergrond */
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(15, 43, 70, 0.05), 0 2px 4px -2px rgba(15, 43, 70, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(15, 43, 70, 0.1), 0 4px 6px -4px rgba(15, 43, 70, 0.1);
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --success: #10b981;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    height: 100vh;
    overflow: hidden;
    overflow-x: hidden; /* Prevent any horizontal scroll globally */
    max-width: 100vw;
}

/* Screens Layout */
.screen {
    display: none;
    width: 100%;
    height: 100vh;
    position: relative;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

/* Login Screen & Approval Card */
#view-login, #view-approval {
    background: linear-gradient(135deg, #0b1a2c 0%, #1e3a5f 100%);
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    width: 100%;
    max-width: 400px;
    padding: 40px 30px;
    border-radius: 20px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.login-card .brand {
    margin-bottom: 35px;
}

.login-card .brand .brand-logo {
    max-height: 48px;
    width: auto;
    display: inline-block;
    margin-bottom: 8px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.login-card h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.login-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.login-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
}

/* Buttons */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 20px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-google,
.btn-facebook {
    background-color: #ffffff;
    color: #374151;
    border: 1px solid #e2e8f0;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 10px 16px;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.btn-google:hover,
.btn-facebook:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.icon-google,
.icon-facebook {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}
.btn-primary:hover {
    background-color: #1b4b70;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--border);
    color: var(--text-main);
}
.btn-secondary:hover {
    background-color: #cbd5e1;
}

.login-card.approval-card .lock-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
    display: inline-block;
}

.login-card.approval-card h2 {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 12px;
}

.login-card.approval-card .instruction {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 15px 0 25px 0;
    line-height: 1.6;
}

/* Main App Layout */
#view-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.app-header {
    background-color: var(--primary);
    color: white;
    padding: 0 24px;
    /* On mobile with viewport-fit=cover, extend the header into the status bar area */
    padding-top: env(safe-area-inset-top, 0px);
    height: calc(64px + env(safe-area-inset-top, 0px));
    display: flex;
    justify-content: space-between;
    align-items: center; /* Items stay centred within the lower 64px portion */
    box-shadow: var(--shadow);
    z-index: 10;
    position: sticky;
    top: 0;
}

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

.app-header .brand .header-logo {
    height: 36px;
    width: auto;
    object-fit: contain;
}

.app-header .brand h2 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-badge .badge {
    background-color: rgba(255, 255, 255, 0.15);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.user-badge .user-name {
    font-size: 0.9rem;
    font-weight: 500;
}

.logout-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.logout-btn:hover {
    opacity: 1;
}

/* App Body & Sidebar Navigation */
.app-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

.side-nav {
    width: 240px;
    background-color: #ffffff;
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background-color: var(--bg-main);
    color: var(--primary);
}

.nav-item.active {
    background-color: var(--bg-main);
    color: var(--primary);
    font-weight: 600;
    box-shadow: inset 4px 0 0 var(--accent);
}

/* Content Area */
.content-pane {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    overflow-x: hidden; /* Prevent horizontal scroll */
    background-color: var(--bg-main);
    padding-bottom: 80px; /* Space for mobile nav */
}

.tab-panel {
    display: none;
    max-width: 1000px;
    margin: 0 auto;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.25s ease-in-out;
}

.tab-panel.tab-refreshing {
    animation: tabRefreshPulse 0.3s ease-out;
}

@keyframes tabRefreshPulse {
    0% { opacity: 0.5; transform: translateY(4px); }
    100% { opacity: 1; transform: translateY(0); }
}

.spin-rotate {
    display: inline-block;
    animation: spinRotate 0.6s linear infinite;
}

@keyframes spinRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Panels Cards */
.panel-card {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.panel-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--primary);
}

/* Form Styles */
.form-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

input[type="text"], select, textarea {
    font-family: inherit;
    font-size: 0.95rem;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background-color: #ffffff;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s;
}

input[type="text"]:focus, select:focus, textarea:focus {
    border-color: var(--primary);
}

.form-actions {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
}

/* Urgent Alerts Area */
.urgent-alert {
    background-color: var(--danger-light);
    border: 1px solid var(--danger);
    color: var(--danger);
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    animation: pulseBorder 2s infinite alternate;
}

@keyframes pulseBorder {
    0% { box-shadow: 0 0 0 rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 10px rgba(239, 68, 68, 0.15); }
}

.urgent-alert .alert-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.urgent-alert .alert-body h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.urgent-alert .alert-body p {
    font-size: 0.9rem;
    color: #7f1d1d;
    line-height: 1.4;
}

/* Category Filter Bar */
.filter-section {
    margin-bottom: 24px;
}

.filter-section h4 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}

.filter-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    background-color: #ffffff;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 20px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn.active {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
    font-weight: 600;
}

/* Bulletins Grid & Cards */
.bulletins-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--primary);
}

.bulletins-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.bulletin-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

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

/* Highlight priority */
.bulletin-card.priority-high {
    border-left: 5px solid var(--accent);
    background-color: var(--accent-light);
}

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

.bulletin-header h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
}

.bulletin-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tag {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    background-color: #cbd5e1;
    color: #475569;
}

.tag.category-waarschuwing { background-color: #fee2e2; color: #ef4444; }
.tag.category-onderhoud { background-color: #dbeafe; color: #3b82f6; }
.tag.category-agenda { background-color: #d1fae5; color: #10b981; }
.tag.category-algemeen { background-color: #f1f5f9; color: #475569; }

.bulletin-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.bulletin-content {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-main);
    white-space: pre-line;
}

.bulletin-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.bulletin-card.priority-high .bulletin-footer {
    border-top-color: rgba(255, 122, 0, 0.15);
}

.bulletin-author {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.delete-bulletin-btn {
    background: none;
    border: none;
    color: var(--danger);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}
.delete-bulletin-btn:hover {
    text-decoration: underline;
}

.no-bulletins-msg {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 0.95rem;
    background: #ffffff;
    border-radius: 16px;
    border: 1px dashed var(--border);
}

/* Admin Panel Tables */
.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}

.admin-table th, .admin-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.admin-table th {
    background-color: var(--bg-main);
    font-weight: 600;
    color: var(--text-muted);
}

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

.admin-table select {
    padding: 6px 10px;
    font-size: 0.85rem;
}

.action-btn-group {
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
}

.btn-approve { background-color: var(--success); color: white; }
.btn-reject { background-color: var(--danger); color: white; }
.btn-delete-cat { background-color: var(--danger); color: white; padding: 4px 8px; border-radius: 4px; }

/* ─── Mobile: transform admin tables into stacked cards ─── */
@media (max-width: 768px) {
    .table-container {
        border: none;
        border-radius: 0;
        overflow-x: visible;
    }

    /* Hide desktop table header */
    .admin-table thead {
        display: none;
    }

    /* Each row becomes a card */
    .admin-table,
    .admin-table tbody,
    .admin-table tr,
    .admin-table td {
        display: block;
        width: 100%;
    }

    .admin-table tr {
        border: 1px solid var(--border);
        border-radius: 12px;
        margin-bottom: 12px;
        padding: 12px 14px;
        background-color: var(--card-bg);
        box-shadow: var(--shadow);
    }

    .admin-table td {
        padding: 5px 0;
        border-bottom: none;
        font-size: 0.9rem;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    /* Prepend label using data-label attribute */
    .admin-table td[data-label]::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-muted);
        font-size: 0.75rem;
        min-width: 72px;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        flex-shrink: 0;
    }

    /* Action buttons full-width on mobile */
    .admin-table td .action-btn-group {
        flex-wrap: wrap;
        gap: 6px;
        width: 100%;
    }

    .admin-table td .action-btn-group .btn {
        flex: 1 1 auto;
        text-align: center;
        justify-content: center;
    }

    /* Selects full-width on mobile */
    .admin-table td select {
        width: 100%;
        flex: 1;
    }
}

/* Mobile Navigation Footer (Default Hidden) */
.mobile-nav {
    display: none;
}

/* Responsive CSS */
@media (max-width: 768px) {
    /* Hide desktop sidebar */
    .side-nav {
        display: none;
    }
    
    /* Header layout for mobile — also respect safe-area for mobile insets */
    .app-header {
        padding: 0 16px;
        padding-top: env(safe-area-inset-top, 0px);
    }
    
    .app-header .brand h2 {
        font-size: 1.1rem;
    }
    
    .user-badge .user-name {
        display: none; /* Hide user name on small screens */
    }

    /* Content Area full-width and scrollable */
    .content-pane {
        padding: 16px;
        padding-bottom: 90px; /* Space for mobile nav */
    }
    
    /* Show mobile navigation bar ONLY when view-app is active */
    #view-app.active .mobile-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
        background-color: #ffffff;
        border-top: 1px solid var(--border);
        height: auto;
        min-height: 64px;
        /* Add padding for iPhone home indicator */
        padding-bottom: env(safe-area-inset-bottom, 0px);
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 100;
        box-shadow: 0 -4px 6px -1px rgba(15, 43, 70, 0.05);
    }

    #view-app:not(.active) .mobile-nav,
    .screen:not(.active) .mobile-nav {
        display: none !important;
    }
    
    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        color: var(--text-muted);
        flex: 1;
        height: 100%;
        cursor: pointer;
    }
    
    .mobile-nav-item .mobile-icon {
        font-size: 1.25rem;
        margin-bottom: 2px;
    }
    
    .mobile-nav-item .mobile-label {
        font-size: 0.75rem;
        font-weight: 500;
    }
    
    .mobile-nav-item.active {
        color: var(--primary);
    }
    
    .mobile-nav-item.active .mobile-label {
        font-weight: 700;
    }
}

/* Bulletin Image Styling */
.bulletin-card .bulletin-image {
    width: 100%;
    max-height: 200px; /* Kept compact on the card */
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 14px;
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    display: flex;
    justify-content: center;
    align-items: center;
}

.bulletin-card .bulletin-image img {
    max-width: 100%;
    max-height: 200px;
    width: auto;
    height: auto;
    object-fit: contain; /* Full image visible, maintains aspect ratio */
    display: block;
}

/* Modal View Image Styling */
.modal-card .bulletin-image {
    width: 100%;
    max-height: 350px;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 20px;
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-card .bulletin-image img {
    max-width: 100%;
    max-height: 350px;
    width: auto;
    height: auto;
    object-fit: contain; /* Full image visible in modal */
    display: block;
}

/* Modal Backdrop & Styles */
.modal-backdrop {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 43, 70, 0.6); /* Maas-Blauw with transparency */
    backdrop-filter: blur(4px);
    z-index: 20000;
    justify-content: center;
    align-items: center;
}

.modal-backdrop.active {
    display: flex;
}

.modal-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 28px;
    width: 90%;
    max-width: 650px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    position: relative;
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background-color: var(--bg-main);
    color: var(--text-dark);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s, color 0.2s;
}

.modal-close-btn:hover {
    background-color: var(--danger-light);
    color: var(--danger);
    border-color: var(--danger-light);
}

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

/* ─── Calendar Widget ─── */
.calendar-widget {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 12px;
    margin-bottom: 18px;
    box-shadow: var(--shadow);
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

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

.calendar-header h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.calendar-nav-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-weight: bold;
    color: var(--text-dark);
    transition: background-color 0.2s;
}

.calendar-nav-btn:hover {
    background-color: var(--bg-main);
}

.calendar-grid {
    display: grid !important;
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    gap: 4px !important;
    text-align: center;
    width: 100% !important;
    box-sizing: border-box;
}

.calendar-weekday {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    padding-bottom: 6px;
    text-align: center;
    box-sizing: border-box;
}

.calendar-day {
    aspect-ratio: 1;
    width: 100%;
    max-width: 36px;
    max-height: 36px;
    margin: 0 auto;
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    position: relative;
    box-sizing: border-box;
    transition: background-color 0.2s, color 0.2s;
}

.calendar-day:hover {
    background-color: var(--bg-main);
}

.calendar-day.empty {
    cursor: default;
    background: none !important;
}

.calendar-day.today {
    border: 2px solid var(--primary);
    font-weight: 700;
}

.calendar-day.has-event {
    background-color: var(--accent-light);
    color: var(--accent);
    font-weight: 700;
}

.calendar-day.has-event::after {
    content: '';
    position: absolute;
    bottom: 3px;
    width: 4px;
    height: 4px;
    background-color: var(--accent);
    border-radius: 50%;
}

.calendar-day.selected {
    background-color: var(--primary) !important;
    color: white !important;
}

.calendar-day.selected::after {
    background-color: white !important;
}

.calendar-filter-info {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ─── Dashboard Hero Banner ─── */
.dashboard-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px 10px 10px;
    background: linear-gradient(135deg, var(--primary) 0%, #1a4a73 100%);
    border-radius: 12px;
    margin-bottom: 14px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(15, 43, 70, 0.12);
}

.hero-animated-logo {
    height: 32px !important;
    width: auto !important;
    max-width: 48px !important;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.95);
    padding: 3px 8px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    display: block;
    margin: 0 auto 6px auto;
    animation: float 3s ease-in-out infinite;
}

.hero-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.01em;
    margin: 0 0 2px 0;
    text-align: center;
}

.hero-subtitle {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    font-weight: 400;
    text-align: center;
}

/* ─── Splash Screen (Pure CSS Auto Fade-Out) ─── */
#splash-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(160deg, #0f2b46 0%, #1a4a73 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    pointer-events: none;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    animation: splashAutoFade 1.2s ease-in-out forwards;
}

@keyframes splashAutoFade {
    0% { opacity: 1; visibility: visible; }
    75% { opacity: 1; visibility: visible; }
    100% { opacity: 0; visibility: hidden; }
}

#splash-screen.hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.splash-content {
    text-align: center;
    animation: splashEntrance 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes splashEntrance {
    from { transform: scale(0.85); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

.splash-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 14px;
    padding: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    margin-bottom: 14px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    animation: float 3s ease-in-out infinite;
}

.splash-title {
    font-size: 2rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.03em;
    margin: 0 0 8px 0;
    text-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.splash-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.65);
    margin: 0;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ─── In-App Toast & High Priority Pop-up Banner ─── */
.toast-container {
    position: fixed;
    top: 65px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: calc(100vw - 32px);
    width: 360px;
    pointer-events: none;
}

.toast-banner {
    pointer-events: auto;
    background: #ffffff;
    border-left: 5px solid var(--primary);
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transition: opacity 0.3s, transform 0.3s;
}

.toast-banner.high-priority {
    border-left: 6px solid #ef4444;
    background: #fff5f5;
    box-shadow: 0 12px 30px rgba(239, 68, 68, 0.3);
    animation: toastPulse 1.5s ease-in-out infinite alternate, toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

@keyframes toastPulse {
    from { box-shadow: 0 6px 20px rgba(239, 68, 68, 0.25); }
    to   { box-shadow: 0 14px 35px rgba(239, 68, 68, 0.45); }
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 2px 0;
}

.toast-banner.high-priority .toast-title {
    color: #b91c1c;
}

.toast-body {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

.toast-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 6px;
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.1rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

@media (max-width: 768px) {
    .toast-container {
        top: calc(env(safe-area-inset-top, 0px) + 55px);
        left: 16px;
        right: 16px;
        width: auto;
    }
}

/* Auth Portal Tabs & Panels */
.auth-tabs {
    display: flex;
    background-color: #f1f5f9;
    padding: 4px;
    border-radius: 10px;
    margin-bottom: 18px;
    gap: 4px;
}
.auth-tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 4px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.auth-tab-btn.active {
    background-color: #ffffff;
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.auth-panel {
    display: block;
}
.quick-account-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}
.quick-account-btn:hover {
    background: #edf2f7;
    border-color: var(--primary);
    transform: translateY(-1px);
}



