/* ========================================
   QR SYSTEM - UNIFIED RESPONSIVE CSS
   ======================================== */

/* === CSS DESIGN TOKENS === */
:root {
    /* Brand */
    --color-primary:        #667eea;
    --color-primary-dark:   #5568d3;
    /* Status */
    --color-success:        #48bb78;
    --color-success-dark:   #38a169;
    --color-danger:         #e53e3e;
    --color-danger-dark:    #c53030;
    --color-warning:        #ecc94b;
    --color-warning-dark:   #d69e2e;
    --color-warning-text:   #744210;
    /* Neutral */
    --color-secondary:      #e2e8f0;
    --color-secondary-dark: #cbd5e0;
    --color-text:           #2c3e50;
    --color-text-muted:     #718096;
    --color-border:         #e2e8f0;
    --color-bg:             #f5f5f5;
    --color-bg-card:        #ffffff;
    /* Radius */
    --radius-sm:            6px;
    --radius-md:            12px;
    --radius-lg:            16px;
    /* Shadows */
    --shadow-sm:            0 2px 8px rgba(0,0,0,0.1);
    --shadow-md:            0 4px 20px rgba(0,0,0,0.15);
    /* Transitions */
    --transition:           0.2s ease;
}

/* Screen-reader-only utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
}

/* === NAVIGATION === */
.nav { 
    background: #667eea;
    color: white;
    padding: 0 24px;
    height: 44px;
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 0;
    flex-wrap: nowrap;
}

/* Mobile menu — hidden everywhere by default */
.nav-mobile-menu { display: none !important; }
.nav-mobile-menu.open { display: flex !important; flex-direction: column; width: 100%; }
.nav-burger { display: none; }

/* Admin variant - dark gray nav */
.nav-admin {
    background: #2d3748;
}

/* Alternative: Add class to body */
body.admin-page .nav {
    background: #2d3748;
}

body.client-page .nav {
    background: #667eea;
}

.nav-left { 
    display: flex;
    gap: 0;
    align-items: stretch;
    flex-wrap: nowrap;
    flex: 1;
}

.nav-brand { 
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
    height: 44px;               /* never push nav taller */
    display: flex;
    align-items: center;
    padding: 0 16px 0 0;
    margin-right: 8px;
    border-right: 1px solid rgba(255,255,255,0.15);
    color: white;
    text-decoration: none;
    flex-shrink: 0;
}
.nav-brand:hover { opacity: 0.85; color: white; background: none !important; }

.nav-links { 
    display: flex;
    align-items: stretch;
    gap: 0;
    flex-wrap: nowrap;
}

.nav a, .nav-links a, .nav-links span { 
    color: rgba(255,255,255,0.78);
    text-decoration: none;
    padding: 0 14px;
    border-radius: 0;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
    font-size: 13px;
    display: flex;
    align-items: center;
    border-bottom: 2px solid transparent;
}

.nav-links a:hover { 
    background: rgba(255,255,255,0.1);
    color: white;
}

.nav-links a.active { 
    background: transparent;
    color: white;
    font-weight: 600;
    border-bottom: 2px solid #f6ad55;
}

/* === CONTAINERS === */
.container { 
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.container-small {
    padding: 30px;
    max-width: 600px;
    margin: 0 auto;  /* Container itself is centered */
}

/* Center all block elements within container-small */
.container-small > * {
    margin-left: auto;
    margin-right: auto;
}

/* Explicit centering for common block elements */
.container-small .card,
.container-small .section,
.container-small form,
.container-small .btn-block {
    margin-left: auto;
    margin-right: auto;
}

.container-medium {
    padding: 30px;
    max-width: 900px;
    margin: 0 auto;
}

/* === CARDS === */
.card { 
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.section { 
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.section h2 { 
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ecf0f1;
    font-size: 20px;
}

/* === STATS CARDS === */
.stats { 
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card { 
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 4px solid #667eea;
}

.stat-card h3 { 
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .value { 
    font-size: 36px;
    font-weight: bold;
    color: #2c3e50;
}

/* Progress bars */
.progress-bar { 
    background: #e0e0e0;
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-fill { 
    background: #667eea;
    height: 100%;
    transition: width 0.3s;
}

/* === FORMS === */
.form-group { 
    margin-bottom: 20px;
}

label { 
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #2c3e50;
}

input, select, textarea { 
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
}
input[type="checkbox"],
input[type="radio"]
{
    width: auto;
}

input:focus, select:focus, textarea:focus { 
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.checkbox-group { 
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-group input[type="checkbox"] { 
    width: auto;
}

.input-group { 
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.help, .help-text { 
    font-size: 13px;
    color: #7f8c8d;
    margin-top: 5px;
    line-height: 1.4;
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: var(--color-primary);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    text-align: center;
    white-space: nowrap;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    vertical-align: middle;
}

button.btn { padding: 10px 20px; }

.btn:hover {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled,
.btn[disabled],
button:disabled,
button[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
    pointer-events: none;
}

/* Button sizes */
.btn-sm,
button.btn-sm,
a.btn-sm { 
    padding: 6px 12px !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    height: auto !important;
    min-height: unset !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    box-sizing: border-box !important;
    vertical-align: middle !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

/* Inline forms used alongside buttons — reset browser defaults */
form.inline-form,
form[style*="display:inline"],
form[style*="display: inline"] {
    display: inline !important;
    margin: 0;
    padding: 0;
    vertical-align: middle;
}

/* Reset type=submit button to look identical to type=button */
button[type="submit"].btn {
    margin: 0;
    vertical-align: middle;
    line-height: normal;
    -webkit-appearance: none;
    appearance: none;
}

.btn-block { 
    width: 100%;
    display: block;
}

/* Button variants */
.btn-primary { background: var(--color-primary); }
.btn-primary:hover { background: var(--color-primary-dark); }

.btn-success { background: var(--color-success); }
.btn-success:hover { background: var(--color-success-dark); }

.btn-danger { background: var(--color-danger); }
.btn-danger:hover { background: var(--color-danger-dark); }

.btn-warning { background: var(--color-warning); color: var(--color-warning-text); }
.btn-warning:hover { background: var(--color-warning-dark); }

.btn-secondary { background: var(--color-secondary); color: #4a5568; }
.btn-secondary:hover { background: var(--color-secondary-dark); }

.btn-purple { 
    background: #805ad5;
}

.btn-purple:hover { 
    background: #6b46c1;
}

.btn-teal { 
    background: #38b2ac;
}

.btn-teal:hover { 
    background: #319795;
}

.btn-download {
    background: #48bb78;
}

.btn-download:hover {
    background: #38a169;
}

.btn-delete {
    background: #f56565;
}

.btn-delete:hover {
    background: #e53e3e;
}

/* === TABLES === */
table { 
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

th { 
    background: #f7fafc;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #4a5568;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
}

td { 
    padding: 15px;
    border-bottom: 1px solid #edf2f7;
    font-size: 14px;
    vertical-align: middle;
}

tr:hover { 
    background: #f8fafc;
}

/* Table responsive wrapper */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* === BADGES === */
.badge { 
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    display: inline-block;
}

.badge-admin { 
    background: #922;
    color: white;
}

.badge-client { 
    background: #286;
    color: white;
}

.b-green { 
    background: #c6f6d5;
    color: #22543d;
}

.b-red { 
    background: #fed7d7;
    color: #742a2a;
}

.b-yellow {
    background: #fef3c7;
    color: #92400e;
}

.b-blue {
    background: #dbeafe;
    color: #1e40af;
}

/* === TABS === */
.tabs { 
    display: flex;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 30px;
    gap: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-btn { 
    padding: 15px 25px;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 16px;
    color: #718096;
    font-weight: 600;
    white-space: nowrap;
    transition: color 0.3s;
}

.tab-btn.active { 
    color: #667eea;
    border-bottom: 2px solid #667eea;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: #667eea;
}

.tab-content { 
    display: none;
    animation: fadeIn 0.3s;
}

.tab-content.active { 
    display: block;
}

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

/* === ACTION BAR === */
.actions, .action-bar { 
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.action-bar {
    justify-content: flex-end;
}

.action-btn {
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    color: #fff;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
}

/* === ALERTS & MESSAGES === */
.error {
    background: #fee;
    border: 1px solid #fcc;
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    color: #c33;
}

.success {
    background: #d1fae5;
    border: 1px solid #6ee7b7;
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    color: #065f46;
}

.warning {
    background: #fef3c7;
    border: 1px solid #fde047;
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    color: #92400e;
}

.info {
    background: #e0f2fe;
    border: 1px solid #7dd3fc;
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    color: #075985;
}

/* Live-region status messages */
[role="status"], [aria-live] {
    min-height: 1.4em;
}

/* === USER INFO === */
.user-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.user-info strong { 
    color: #2c3e50;
}

/* === TYPOGRAPHY === */
h1 { 
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 28px;
}

h2 {
    color: #2c3e50;
    font-size: 20px;
    margin-bottom: 15px;
}

h3 {
    color: #4a5568;
    font-size: 16px;
    margin-bottom: 10px;
}

.subtitle { 
    color: #7f8c8d;
    margin-bottom: 30px;
    font-size: 16px;
}

small {
    display: block;
    margin-top: 6px;
    color: #718096;
    font-size: 13px;
    line-height: 1.4;
}

/* === PAGINATION === */
.pagination {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.pagination a, .pagination span {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    text-decoration: none;
    color: #4a5568;
}

.pagination a:hover {
    background: #f7fafc;
}

.pagination .active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* === UTILITY CLASSES === */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }

.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }

.p-10 { padding: 10px; }
.p-20 { padding: 20px; }
.p-30 { padding: 30px; }

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.flex-center { justify-content: center; align-items: center; }
.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }

.hidden { display: none; }

/* === Extra (ranjan) === */

.alert { padding: 12px; border-radius: 6px; margin-bottom: 15px; }
.alert-error { background: #fed7d7; color: #742a2a; }
.alert-success { background: #c6f6d5; color: #22543d; }

.batch-logo { width: 40px; height: 40px; object-fit: contain; border: 1px solid #e2e8f0; border-radius: 4px; padding: 2px; background: white; }
.batch-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-top: 15px; }
.batch-logo-placeholder { font-size: 24px; color: #cbd5e0; display: inline-block; width: 40px; text-align: center; }

/* Logo Grid */
.logo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 15px; }
.logo-option { border: 2px solid #ecf0f1; border-radius: 8px; padding: 10px; text-align: center; cursor: pointer; position: relative; transition: border 0.2s; }
.logo-option:hover { border-color: #bdc3c7; }
.logo-option.selected { border-color: #667eea; background: #f0f4ff; }
.logo-option img { width: 50px; height: 50px; object-fit: contain; }
.logo-option input { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; }


/* === RESPONSIVE DESIGN === */

/* Tablets and below (max-width: 1024px) */
@media (max-width: 1024px) {
    .container { padding: 20px; }
    .stats { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; }
    .stat-card .value { font-size: 28px; }
    .section { padding: 20px; }

    /* Tablet nav — burger menu */
    .nav {
        padding: 0 12px;
        flex-wrap: wrap;
        align-items: flex-start;  /* top-align: keeps brand row 44px, menu below */
        min-height: 44px;
        overflow: visible;
        height: auto;
    }
    /* Brand row height — nav-left and burger both 44px, flex-aligned */
    .nav-left { flex: 1; height: 44px; display: flex; align-items: center; }
    .nav-burger { height: 44px; align-items: center; justify-content: center; }
    .nav-left .nav-links,
    .nav-right,
    .nav-dropdown { display: none !important; }
    .nav-burger {
        display: flex !important;
        flex-direction: column;
        gap: 5px;
        cursor: pointer;
        padding: 8px;
        background: none;
        border: none;
    }
    .nav-burger span {
        display: block;
        width: 22px;
        height: 2px;
        background: white;
        border-radius: 2px;
    }
    .nav-mobile-menu {
        order: 99;
        flex-basis: 100%;
        flex-direction: column;
        background: rgba(20,20,60,0.97);
        border-top: 1px solid rgba(255,255,255,0.12);
        padding: 4px 0 12px;
        max-height: calc(100vh - 44px);
        overflow-y: auto;
    }
    .nav-mobile-menu.open { display: flex !important; }
    /* Section heading labels */
    .mob-section-label {
        font-size: 10px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 1.2px;
        color: rgba(255,255,255,0.45);
        padding: 12px 16px 4px;
        margin-top: 4px;
    }
    .mob-section-label:first-child { margin-top: 0; padding-top: 8px; }
    /* Menu items — consistent left indent under section label */
    .mob-item {
        color: white !important;
        text-decoration: none;
        padding: 9px 16px 9px 28px;
        font-size: 14px;
        display: block;
        border-radius: 6px;
        margin: 0 8px;
    }
    .mob-item:hover { background: rgba(255,255,255,0.1); }
    .mob-item-warning {
        color: #ffcc80 !important;
        border-left: 3px solid #ed8936;
        padding-left: 25px;
        margin-bottom: 4px;
    }
    .mob-item-help {
        margin-top: 8px;
        border-top: 1px solid rgba(255,255,255,0.12);
        padding-top: 13px;
    }
    /* Top-level links — same indent as section labels, visually prominent */
    .mob-top-link {
        display: block;
        color: rgba(255,255,255,0.75) !important;
        text-decoration: none;
        padding: 10px 16px;
        font-size: 13px;
        font-weight: 600;
        letter-spacing: 0.3px;
        border-top: 1px solid rgba(255,255,255,0.1);
        margin-top: 4px;
    }
    .mob-top-link:hover { color: white !important; background: rgba(255,255,255,0.08); }
    /* Fallback for any plain <a> not classed mob-item */
    .nav-mobile-menu > a {
        color: white;
        text-decoration: none;
        padding: 9px 16px;
        font-size: 14px;
        display: block;
    }
    .nav-mobile-menu > a:hover { background: rgba(255,255,255,0.1); }
}

/* Mobile devices (max-width: 768px) */
@media (max-width: 768px) {
    /* Nav at 768px — inherits from 1024px block; just override padding */
    .nav { padding: 0 12px; }
    .nav-left .nav-links,
    .nav-right,
    .nav-dropdown { display: none !important; }
    .nav-left { flex: 1; height: 44px; overflow: hidden; }

    .nav-links {
        width: 100%;
        justify-content: flex-start;
    }
    .nav-links a {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .container, .container-small, .container-medium {
        padding: 15px;
    }
    
    .stats {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-card .value {
        font-size: 32px;
    }
    
    .section {
        padding: 20px;
    }
    
    .card {
        padding: 20px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    h2 {
        font-size: 18px;
    }
    
    /* Make tables scrollable on mobile */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
    }
    
    th, td {
        padding: 10px;
        font-size: 13px;
    }
    
    /* Stack form inputs */
    .input-group {
        grid-template-columns: 1fr;
    }
    
    /* Stack buttons */
    .actions, .action-bar {
        /* flex-direction: column; ranjan */
    }
    
    .btn {
        width: fit-content; /* ranjan */
        text-align: center;
    }
    
    /* Tabs */
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
}

/* Small mobile devices (max-width: 480px) */
@media (max-width: 480px) {
    .container, .container-small {
        padding: 10px;
    }
    
    .nav {
        padding: 0 10px;  /* no vertical padding — keeps nav at 44px */
    }
    
    .nav-brand {
        font-size: 18px;
    }
    
    .nav-links a {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-card h3 {
        font-size: 12px;
    }
    
    .stat-card .value {
        font-size: 28px;
    }
    
    .section, .card {
        padding: 15px;
    }
    
    .btn:not(.btn-sm) {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    input, select, textarea {
        padding: 10px;
        font-size: 14px;
    }
}

/* Print styles */
@media print {
    .nav, .actions, .action-bar, .btn {
        display: none;
    }
    
    body {
        background: white;
    }
    
    .card, .section {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* nav-brand defined in base nav rules above */

/* ── Nav icon link ─────────────────────────────────────────────────────────── */
.nav-icon-link {
    color: white !important;
    padding: 0 14px !important;
    font-size: 13px !important;   /* match all other nav-links a items */
    opacity: 1;
    transition: opacity 0.2s;
}
.nav-icon-link:hover { opacity: 1; background: rgba(255,255,255,0.15) !important; }

/* ── Masquerade badge ──────────────────────────────────────────────────────── */
.masquerade-badge {
    background: rgba(237,137,54,0.18);
    color: #fbd38d;
    padding: 4px 6px 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(237,137,54,0.4);
}
/* ✕ Stop — stands out as a distinct button */
.masquerade-badge a {
    color: white !important;
    background: #ed8936 !important;
    padding: 3px 8px !important;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s;
}
.masquerade-badge a:hover { background: #c05621 !important; }

/* ── Dropdown nav ──────────────────────────────────────────────────────────── */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropdown-btn {
    color: rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.12);
    border: none;
    border-radius: 0px;
    margin: 0 4px;
    align-self: center;
    padding: 4px 0px 4px 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
    height: 44px;
}
.nav-dropdown-btn:hover,
.nav-dropdown-btn.active {
    background: rgba(255,255,255,0.25);
    color: white;
}
.nav-dropdown-btn.active { font-weight: 600; }
.nav-dropdown-arrow { font-size: 10px; opacity: 0.8; }

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    min-width: 180px;
    z-index: 1000;
    overflow: hidden;
    padding: 4px 0;
}
.nav-dropdown-menu.open { display: block; }

.nav-dropdown-menu a {
    display: block;
    padding: 9px 16px;
    color: #2d3748 !important;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.15s;
    white-space: nowrap;
    border-radius: 0;
}
.nav-dropdown-menu a:hover {
    background: #f7fafc !important;
    color: #667eea !important;
}
.nav-dropdown-menu a.active {
    background: #ebf4ff !important;
    color: #667eea !important;
    font-weight: 600;
}
.nav-dropdown-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 4px 0;
}

/* === AUTH / LOGIN PAGE === */
body.auth-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 400px;
    margin: 20px; /* Safe padding for mobile */
}

.auth-page h1 {
    color: #333;
    margin-bottom: 30px;
    text-align: center;
    font-size: 24px;
}

.link {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
}

.link a {
    color: #667eea;
    text-decoration: none;
}

.link a:hover {
    text-decoration: underline;
}

.divider {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 20px 0;
}

/* Base.html missing alert type */
.alert-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}
