/* assets/css/style.css
   MAP Connect — Brand Redesign (Electric Green + Vibrant Blue)
*/

:root {
    /* Logo Palette */
    --brand-green: #00E600;
    --brand-green-dark: #009900;
    --brand-blue: #0088FF;
    --brand-blue-dark: #0055FF;
    /* App Theme (Light, clean, modern) */
    --bg-app: #F4F7F6;
    --bg-surface: #FFFFFF;
    --text-main: #0F172A;
    --text-muted: #64748B;
    --border-light: #E2E8F0;
    /* Accents for badges/status */
    --status-pending: #64748B;
    --status-ready: #0088FF;
    --status-collected: #F59E0B;
    --status-delivered: #00E600;
    --status-missed: #EF4444;
    /* Shadows & Radius */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.08);
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-pill: 100px;
    --font-display: 'Manrope', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-app);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.disp {
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.hidden {
    display: none !important;
}


/* =========================================
   AUTH SCREEN (Dark immersive brand experience)
   ========================================= */

#authScreen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(circle at top left, #0a2e14 0%, #051008 100%);
    position: relative;
    overflow: hidden;
}


/* Glowing background orbs */

#authScreen::before,
#authScreen::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    z-index: 0;
}

#authScreen::before {
    width: 400px;
    height: 400px;
    background: rgba(0, 230, 0, 0.15);
    top: -100px;
    left: -100px;
}

#authScreen::after {
    width: 400px;
    height: 400px;
    background: rgba(0, 136, 255, 0.15);
    bottom: -100px;
    right: -100px;
}

.auth-wrap {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    text-align: center;
}

.auth-brand img {
    width: 200px;
    height: auto;
    filter: drop-shadow(0 10px 20px rgba(0, 230, 0, 0.2));
}

.auth-brand .sub {
    font-size: 12px;
    color: #A7F3D0;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 700;
}

.auth-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.5);
}

.role-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    background: rgba(0, 0, 0, 0.4);
    padding: 6px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.role-tab {
    appearance: none;
    border: none;
    background: transparent;
    padding: 10px 4px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    color: #94A3B8;
    cursor: pointer;
    transition: all 0.2s;
}

.role-tab.on {
    background: var(--brand-green);
    color: #000;
    box-shadow: 0 4px 15px rgba(0, 230, 0, 0.3);
}

.mode-toggle {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mode-btn {
    appearance: none;
    background: transparent;
    border: 0;
    padding: 0 0 12px;
    font-size: 14px;
    font-weight: 700;
    color: #94A3B8;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s;
}

.mode-btn.on {
    color: #FFF;
    border-color: var(--brand-green);
}

.auth-form .form-row {
    margin-bottom: 16px;
}

.auth-form label {
    color: #CBD5E1;
}

.auth-form input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #FFF;
}

.auth-form input:focus {
    border-color: var(--brand-green);
    background: rgba(0, 0, 0, 0.5);
}

.auth-err {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #FCA5A5;
    font-size: 12px;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 16px;
    display: none;
}

.auth-err.show {
    display: block;
}

.demo-hint {
    margin-top: 24px;
    font-size: 12px;
    color: #94A3B8;
    text-align: center;
    line-height: 1.6;
}

.demo-hint b {
    color: #FFF;
}

.demo-hint code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 6px;
    color: var(--brand-green);
    font-family: monospace;
}


/* =========================================
   MAIN APP (Light, bright, clean SaaS)
   ========================================= */

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px clamp(20px, 4vw, 40px);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-light);
    gap: 20px;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand img {
    height: 44px;
    width: auto;
}

.brand-text .disp {
    font-size: 18px;
    color: var(--text-main);
}

.brand-text .sub {
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 700;
}

.tabs {
    display: flex;
    gap: 6px;
    background: var(--bg-app);
    padding: 6px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-light);
}

.tab-btn {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 13px;
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    background: var(--text-main);
    color: #FFF;
    box-shadow: var(--shadow-md);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-app);
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    font-size: 16px;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: #E2E8F0;
}

.notif-dot {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 18px;
    height: 18px;
    border-radius: 100px;
    background: var(--brand-blue);
    color: #FFF;
    font-size: 10px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #FFF;
}

.notif-panel {
    position: absolute;
    top: 50px;
    right: 0;
    width: 320px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 12px;
    z-index: 100;
    max-height: 400px;
    overflow-y: auto;
}

.notif-item {
    padding: 12px;
    border-bottom: 1px solid var(--border-light);
    font-size: 12px;
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item .t {
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-main);
}

.notif-item .s {
    color: var(--text-muted);
}

.rel {
    position: relative;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-app);
    border: 1px solid var(--border-light);
    padding: 6px 16px 6px 6px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 600;
}

.user-chip .av {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--brand-blue);
    color: #FFF;
    font-weight: 800;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-btn {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-app);
    border: 1px solid var(--border-light);
    padding: 10px 16px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn:hover {
    color: var(--status-missed);
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.05);
}

.stage {
    padding: 40px clamp(20px, 4vw, 40px) 100px;
    max-width: 1200px;
    margin: 0 auto;
}

.view {
    display: none;
    animation: fadeIn 0.4s ease;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-line {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.eyebrow {
    font-size: 12px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--brand-blue);
    margin-bottom: 8px;
}

.hero-title {
    font-size: clamp(24px, 3vw, 36px);
    font-weight: 800;
    color: var(--text-main);
}

.hero-sub {
    color: var(--text-muted);
    font-size: 15px;
    margin-top: 8px;
    max-width: 560px;
    line-height: 1.5;
}


/* Modern Cards & Panels */

.card,
.panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 24px;
}

.panel-title {
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--text-main);
}

.panel-title .tag {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    background: var(--bg-app);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
}


/* Grid Layouts */

.two-col {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
    align-items: start;
}

.three-col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 920px) {
    .two-col {
        grid-template-columns: 1fr;
    }
    .three-col {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .three-col {
        grid-template-columns: 1fr;
    }
}


/* Stats */

.stat-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.stat-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--brand-blue);
    opacity: 0.1;
}

.stat-box:nth-child(2)::before {
    background: var(--brand-green);
}

.stat-box .num {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-main);
    font-family: var(--font-display);
    line-height: 1.1;
}

.stat-box .lbl {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 8px;
    font-weight: 700;
}


/* List Items */

.d-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-light);
    align-items: center;
    flex-wrap: wrap;
}

.d-item:last-child {
    border-bottom: none;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
    color: #FFF;
}

.d-body {
    flex: 1;
    min-width: 140px;
}

.d-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
}

.d-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.d-right {
    text-align: right;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}


/* Badges */

.badge {
    font-size: 10px;
    font-weight: 800;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.pending {
    background: rgba(100, 116, 139, 0.1);
    color: var(--status-pending);
}

.badge.ready {
    background: rgba(0, 136, 255, 0.1);
    color: var(--status-ready);
}

.badge.collected {
    background: rgba(245, 158, 11, 0.1);
    color: var(--status-collected);
}

.badge.delivered {
    background: rgba(0, 230, 0, 0.1);
    color: var(--brand-green-dark);
}

.badge.missed {
    background: rgba(239, 68, 68, 0.1);
    color: var(--status-missed);
}

.badge.cancelled {
    background: rgba(100, 116, 139, 0.1);
    color: var(--text-muted);
}


/* Buttons */

.btn {
    appearance: none;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    transition: all 0.2s;
    font-family: var(--font-body);
}

.btn:active {
    transform: scale(0.97);
}

.btn.primary {
    background: var(--brand-green);
    color: #000;
    box-shadow: 0 4px 15px rgba(0, 230, 0, 0.2);
}

.btn.primary:hover {
    background: #00D600;
    box-shadow: 0 6px 20px rgba(0, 230, 0, 0.3);
}

.btn.blue {
    background: var(--brand-blue);
    color: #FFF;
    box-shadow: 0 4px 15px rgba(0, 136, 255, 0.2);
}

.btn.blue:hover {
    background: var(--brand-blue-dark);
    box-shadow: 0 6px 20px rgba(0, 136, 255, 0.3);
}

.btn.ghost {
    background: var(--bg-app);
    color: var(--text-main);
    border: 1px solid var(--border-light);
}

.btn.ghost:hover {
    background: #E2E8F0;
}

.btn.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--status-missed);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn.danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

.btn.full {
    width: 100%;
}


/* Progress */

.progress-track {
    height: 8px;
    border-radius: 4px;
    background: var(--bg-app);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--brand-blue), var(--brand-green));
    transition: width 0.5s ease;
}


/* Forms */

.form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.form-row label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 700;
}

.form-row input,
.form-row select {
    background: var(--bg-app);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    color: var(--text-main);
    font-size: 14px;
    outline: none;
    width: 100%;
    font-family: var(--font-body);
    transition: border 0.2s;
}

.form-row input:focus,
.form-row select:focus {
    border-color: var(--brand-green);
    background: #FFF;
    box-shadow: 0 0 0 3px rgba(0, 230, 0, 0.1);
}


/* Empty States */

.empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

.empty .big {
    font-size: 32px;
    margin-bottom: 12px;
}


/* Segmented Controls (Clinic tabs) */

.seg {
    display: flex;
    background: var(--bg-app);
    border-radius: var(--radius-pill);
    padding: 6px;
    margin-bottom: 24px;
    border: 1px solid var(--border-light);
    flex-wrap: wrap;
}

.seg-btn {
    appearance: none;
    border: 0;
    background: transparent;
    flex: 1;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    padding: 12px;
    border-radius: var(--radius-pill);
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    min-width: 120px;
    transition: all 0.2s;
}

.seg-btn.on {
    background: #FFF;
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
}


/* Inventory */

.inv-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-light);
}

.inv-row:last-child {
    border-bottom: none;
}

.inv-name {
    flex: 1;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
}

.stepper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stepper button {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--bg-app);
    border: 1px solid var(--border-light);
    color: var(--text-main);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.stepper button:hover {
    background: var(--border-light);
}

.inv-stock {
    font-size: 16px;
    font-weight: 800;
    width: 40px;
    text-align: center;
    color: var(--text-main);
}


/* Alerts */

.alert-row {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
    align-items: center;
}

.alert-row:last-child {
    border-bottom: none;
}

.alert-ic {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.alert-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
}

.alert-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}


/* Ratings */

.stars {
    display: flex;
    gap: 4px;
}

.star {
    cursor: pointer;
    font-size: 18px;
    color: var(--border-light);
    transition: color 0.1s;
}

.star.on {
    color: #F59E0B;
}


/* Toast */

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    opacity: 0;
    background: var(--text-main);
    color: #FFF;
    padding: 14px 24px;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 600;
    z-index: 200;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    box-shadow: var(--shadow-lg);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}


/* Footer */

footer {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-muted);
    font-size: 12px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-surface);
}

footer b {
    color: var(--text-main);
}


/* Utility */

.assign-rider-select {
    cursor: pointer;
    background: var(--bg-app);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 10px;
    color: var(--text-main);
    font-size: 13px;
    width: 100%;
    margin-bottom: 8px;
}

.assign-rider-select:focus {
    outline: none;
    border-color: var(--brand-green);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-app);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-pill);
    padding: 10px 16px;
    margin-bottom: 20px;
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-size: 14px;
    flex: 1;
}