/* =========================================================
   Prisdanna Express — Core Stylesheet
   Mobile-first. Respects --brand-primary / --brand-accent / --brand-dark
   CSS vars (injected by brand_style_vars() helper).
   ========================================================= */

/* --- Design Tokens ---------------------------------------- */
:root {
    /* Brand (overridden by brand_style_vars() inline) */
    --brand-primary: #7C3AED;
    --brand-accent:  #F59E0B;
    --brand-dark:    #1E1B4B;

    /* Legacy aliases — kept for existing dashboard pages */
    --primary: var(--brand-primary);
    --primary-light: #A78BFA;
    --primary-50: #F5F3FF;
    --primary-100: #EDE9FE;
    --primary-200: #DDD6FE;
    --accent: var(--brand-accent);
    --dark: var(--brand-dark);

    /* Neutrals */
    --gray-50:  #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;

    /* Semantic */
    --success: #059669;
    --success-bg: #D1FAE5;
    --warning: #D97706;
    --warning-bg: #FEF3C7;
    --danger: #DC2626;
    --danger-bg: #FEE2E2;
    --info: #2563EB;
    --info-bg: #DBEAFE;

    /* Elevation */
    --shadow-xs: 0 1px 2px rgba(15,23,42,0.04);
    --shadow-sm: 0 2px 4px rgba(15,23,42,0.06);
    --shadow-md: 0 8px 24px rgba(15,23,42,0.08);
    --shadow-lg: 0 20px 48px rgba(15,23,42,0.12);

    /* Radii */
    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 999px;

    /* Motion */
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* --- Reset ------------------------------------------------ */
* { box-sizing: border-box; }
*, *::before, *::after { margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    font-size: 15px;
    line-height: 1.55;
    color: var(--gray-800);
    background: var(--gray-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--brand-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }

h1, h2, h3, h4, h5 { letter-spacing: -0.02em; line-height: 1.2; color: var(--gray-900); font-weight: 700; }

code { font-family: 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace; font-size: 0.92em; background: var(--gray-100); padding: 2px 6px; border-radius: 4px; }

.muted { color: var(--gray-500); }
.muted-label { font-size: 11px; font-weight: 600; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.06em; }
.nowrap { white-space: nowrap; }

/* --- Forms ------------------------------------------------ */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: #fff;
    font-size: 15px;
    color: var(--gray-900);
    transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
    -webkit-appearance: none;
}
.form-control:hover { border-color: var(--gray-300); }
.form-control:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-primary) 15%, transparent);
}
.form-control::placeholder { color: var(--gray-400); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 540px) { .form-row { grid-template-columns: 1fr; } }

.pw-wrap { position: relative; }
.pw-wrap .form-control { padding-right: 44px; }
.pw-toggle {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    width: 34px; height: 34px; border-radius: 8px; color: var(--gray-500);
    display: inline-flex; align-items: center; justify-content: center;
    transition: background 0.15s var(--ease);
}
.pw-toggle:hover { background: var(--gray-100); color: var(--gray-800); }

.pw-strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 8px; }
.pw-strength span { height: 4px; border-radius: 2px; background: var(--gray-200); transition: background 0.2s var(--ease); }
.pw-strength.weak span:nth-child(-n+1),
.pw-strength.medium span:nth-child(-n+2),
.pw-strength.strong span:nth-child(-n+3),
.pw-strength.excellent span:nth-child(-n+4) { background: currentColor; }
.pw-strength.weak      { color: #DC2626; }
.pw-strength.medium    { color: #F59E0B; }
.pw-strength.strong    { color: #10B981; }
.pw-strength.excellent { color: #059669; }

.checkbox-row {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 4px 0; margin: 14px 0 18px; cursor: pointer;
    font-size: 14px; color: var(--gray-700);
}
.checkbox-row input[type=checkbox] { margin-top: 2px; width: 17px; height: 17px; accent-color: var(--brand-primary); cursor: pointer; }
.checkbox-row a { color: var(--brand-primary); text-decoration: underline; }

.text-link { color: var(--brand-primary); font-size: 13px; font-weight: 500; }

/* --- Buttons ---------------------------------------------- */
.btn-primary-lg, .btn-primary, .btn-ghost-lg, .btn-ghost, .btn-ghost-sm, .btn-icon-action {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-weight: 600; border-radius: var(--radius-sm); transition: transform 0.12s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease);
    cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn-primary-lg {
    width: 100%; padding: 14px 20px; font-size: 15px;
    background: var(--brand-primary); color: #fff;
    box-shadow: 0 6px 16px color-mix(in srgb, var(--brand-primary) 35%, transparent);
}
.btn-primary-lg:hover { transform: translateY(-1px); box-shadow: 0 10px 24px color-mix(in srgb, var(--brand-primary) 45%, transparent); text-decoration: none; }
.btn-primary-lg:active { transform: translateY(0); }

.btn-primary { padding: 10px 18px; font-size: 14px; background: var(--brand-primary); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--brand-primary) 85%, black); text-decoration: none; }

.btn-ghost-lg { width: 100%; padding: 14px 20px; font-size: 15px; background: transparent; color: var(--gray-700); border: 1.5px solid var(--gray-200); }
.btn-ghost-lg:hover { background: var(--gray-100); text-decoration: none; }
.btn-ghost { padding: 10px 16px; font-size: 14px; background: var(--gray-100); color: var(--gray-700); }
.btn-ghost:hover { background: var(--gray-200); text-decoration: none; }
.btn-ghost-sm { padding: 8px 14px; font-size: 13px; background: rgba(255,255,255,0.08); color: #fff; border: 1px solid rgba(255,255,255,0.15); }
.btn-ghost-sm:hover { background: rgba(255,255,255,0.15); text-decoration: none; }

.btn-icon-action {
    padding: 10px 14px; font-size: 13px; background: var(--gray-100); color: var(--gray-700);
    flex: 1; min-width: 0;
}
.btn-icon-action:hover { background: var(--gray-200); text-decoration: none; }
.btn-icon-action.whatsapp { background: #D1FAE5; color: #065F46; }
.btn-icon-action.whatsapp:hover { background: #A7F3D0; }

.copy-btn {
    width: 32px; height: 32px; border-radius: 8px; background: var(--gray-100); color: var(--gray-600);
    display: inline-flex; align-items: center; justify-content: center; transition: all 0.15s var(--ease);
}
.copy-btn:hover { background: var(--brand-primary); color: #fff; }
.copy-btn.copied { background: var(--success); color: #fff; }

/* --- Alerts ----------------------------------------------- */
.alert {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 16px; border-radius: var(--radius-sm);
    font-size: 14px; margin-bottom: 16px; line-height: 1.5;
}
.alert i { margin-top: 2px; flex-shrink: 0; }
.alert-danger  { background: var(--danger-bg);  color: #991B1B; }
.alert-success { background: var(--success-bg); color: #065F46; }
.alert-warning { background: var(--warning-bg); color: #92400E; }
.alert-info    { background: var(--info-bg);    color: #1E40AF; }

/* ============================================================
   AUTH PAGES  (signup / login / reset)
   ============================================================ */
.auth-body { background: var(--gray-100); min-height: 100vh; }

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    min-height: 100vh;
}

/* Left side panel (branded) */
.auth-side {
    background: linear-gradient(160deg, var(--brand-dark) 0%, color-mix(in srgb, var(--brand-dark) 60%, var(--brand-primary)) 70%, var(--brand-primary) 100%);
    color: #fff;
    padding: 40px;
    display: flex; flex-direction: column;
    position: relative; overflow: hidden;
}
.auth-side::after {
    content: ''; position: absolute;
    bottom: -30%; right: -20%;
    width: 500px; height: 500px; border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--brand-accent) 30%, transparent), transparent 70%);
    pointer-events: none;
}
.auth-brand-home { text-decoration: none; position: relative; z-index: 1; display: inline-block; }
.auth-side-content { flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: 420px; position: relative; z-index: 1; }
.auth-side-content h1 { font-size: 40px; color: #fff; margin-bottom: 16px; line-height: 1.1; letter-spacing: -0.03em; }
.auth-side-content p { font-size: 17px; color: rgba(255,255,255,0.75); line-height: 1.65; margin-bottom: 32px; }

.auth-feature-list { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.auth-feature-list li { display: flex; align-items: center; gap: 12px; font-size: 14px; color: rgba(255,255,255,0.85); }
.auth-feature-list li i {
    width: 32px; height: 32px; border-radius: 10px;
    background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--brand-accent); font-size: 13px; flex-shrink: 0;
}
.auth-side-foot { font-size: 12px; color: rgba(255,255,255,0.5); position: relative; z-index: 1; }

/* Right form area */
.auth-main {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 40px 24px; background: var(--gray-50);
}
.auth-card {
    background: #fff; border-radius: var(--radius-lg); padding: 40px;
    width: 100%; max-width: 560px; box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
}
.auth-card-narrow { max-width: 440px; }
.auth-mobile-brand { display: none; margin-bottom: 20px; text-decoration: none; }
.auth-card-head { margin-bottom: 24px; }
.auth-card-head h2 { font-size: 26px; margin-bottom: 6px; }
.auth-card-head p { color: var(--gray-500); font-size: 14px; }

.auth-foot { text-align: center; font-size: 14px; color: var(--gray-600); margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--gray-100); }
.auth-foot a { color: var(--brand-primary); font-weight: 600; }

.auth-aside-links {
    margin-top: 20px; display: flex; gap: 10px; align-items: center;
    font-size: 13px; color: var(--gray-500);
}
.auth-aside-links a { color: var(--gray-600); font-weight: 500; text-decoration: none; }
.auth-aside-links a:hover { color: var(--brand-primary); }

/* Role selector */
.role-grid {
    display: grid; grid-template-columns: 1fr; gap: 10px;
    margin-bottom: 24px;
}
.role-card {
    position: relative;
    display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 14px;
    padding: 14px 16px; border: 2px solid var(--gray-200); border-radius: var(--radius-md);
    cursor: pointer; transition: all 0.18s var(--ease); background: #fff;
}
.role-card:hover { border-color: var(--gray-300); background: var(--gray-50); }
.role-card input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.role-card:has(input:checked) { border-color: var(--brand-primary); background: color-mix(in srgb, var(--brand-primary) 5%, #fff); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-primary) 10%, transparent); }
.role-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.role-info h3 { font-size: 15px; font-weight: 700; color: var(--gray-900); margin-bottom: 2px; }
.role-info p { font-size: 13px; color: var(--gray-500); line-height: 1.4; }
.role-badge { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 3px 8px; border-radius: 999px; margin-top: 6px; }
.role-badge.ok { background: var(--success-bg); color: var(--success); }
.role-badge.review { background: var(--warning-bg); color: var(--warning); }
.role-check { color: var(--brand-primary); font-size: 20px; opacity: 0; transition: opacity 0.15s var(--ease); }
.role-card:has(input:checked) .role-check { opacity: 1; }

.role-only { display: none; }
.role-only.active { display: block; }
.role-only.active.form-row { display: grid; }

/* Success screen */
.success-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.success-card { background: #fff; border-radius: var(--radius-lg); padding: 48px 40px; text-align: center; max-width: 480px; box-shadow: var(--shadow-md); }
.success-icon { width: 72px; height: 72px; border-radius: 50%; background: var(--success-bg); color: var(--success); font-size: 30px; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 24px; }
.success-card h1 { font-size: 26px; margin-bottom: 10px; }
.success-card p { color: var(--gray-600); margin-bottom: 28px; }
.success-actions { display: flex; gap: 12px; flex-direction: column; }

/* Mobile auth */
@media (max-width: 860px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-side { display: none; }
    .auth-mobile-brand { display: inline-flex; }
    .auth-card { padding: 28px 22px; box-shadow: var(--shadow-sm); }
    .auth-card-head h2 { font-size: 22px; }
}

/* ============================================================
   PUBLIC NAV + TRACK PAGE
   ============================================================ */
.public-nav {
    position: sticky; top: 0; z-index: 40;
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 24px;
    background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--gray-200);
}
.public-nav.on-dark { background: rgba(30,27,75,0.85); border-bottom-color: rgba(255,255,255,0.1); }
.public-nav.on-dark .btn-ghost-sm { color: #fff; }
.nav-brand { text-decoration: none; }
.nav-actions { display: flex; gap: 8px; }

.track-body { background: var(--gray-50); }

.track-hero {
    background: linear-gradient(160deg, var(--brand-dark) 0%, color-mix(in srgb, var(--brand-dark) 50%, var(--brand-primary)) 100%);
    color: #fff; padding: 60px 24px 80px; position: relative; overflow: hidden;
}
.track-hero::before {
    content: ''; position: absolute; top: -20%; left: -10%;
    width: 400px; height: 400px; border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--brand-accent) 20%, transparent), transparent 70%);
}
.track-hero-inner { max-width: 720px; margin: 0 auto; text-align: center; position: relative; z-index: 1; }
.eyebrow { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brand-accent); margin-bottom: 16px; padding: 6px 12px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12); border-radius: 999px; }
.track-hero h1 { font-size: 44px; color: #fff; margin-bottom: 14px; line-height: 1.1; letter-spacing: -0.03em; }
.track-hero p { color: rgba(255,255,255,0.75); font-size: 17px; margin-bottom: 32px; }

.track-search {
    display: flex; align-items: center; background: #fff; border-radius: var(--radius-md);
    padding: 6px; padding-left: 18px; box-shadow: var(--shadow-lg);
    max-width: 520px; margin: 0 auto;
}
.track-search .search-icon { color: var(--gray-400); font-size: 16px; margin-right: 10px; }
.track-search input {
    flex: 1; border: none; outline: none; background: transparent;
    padding: 12px 0; font-size: 15px; font-weight: 500; color: var(--gray-900); min-width: 0;
}
.track-search input::placeholder { color: var(--gray-400); font-weight: 400; }
.track-search button {
    padding: 12px 24px; background: var(--brand-primary); color: #fff;
    border-radius: var(--radius-sm); font-weight: 600; font-size: 14px;
    transition: background 0.15s var(--ease);
}
.track-search button:hover { background: color-mix(in srgb, var(--brand-primary) 85%, black); }

.track-empty {
    margin-top: 32px; padding: 32px 24px; background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius-md);
    text-align: center; color: rgba(255,255,255,0.8);
}
.track-empty i { font-size: 42px; color: rgba(255,255,255,0.4); margin-bottom: 12px; }
.track-empty h3 { color: #fff; font-size: 18px; margin-bottom: 6px; }
.track-empty p { font-size: 14px; color: rgba(255,255,255,0.6); }

.track-main { max-width: 1100px; margin: -40px auto 0; padding: 0 24px 60px; position: relative; }
.track-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; }
.track-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
@media (max-width: 860px) { .track-grid { grid-template-columns: 1fr; } .track-main { margin-top: -30px; } }

/* Status card + timeline */
.status-card, .info-card {
    background: #fff; border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200); box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.status-card-head { padding: 20px 24px; border-bottom: 1px solid var(--gray-100); display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.status-code { font-size: 20px; font-weight: 800; letter-spacing: 0.02em; display: flex; align-items: center; gap: 10px; color: var(--gray-900); }
.status-pill {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 12px; border-radius: 999px;
    font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(1.3); } }

.status-steps { padding: 24px; position: relative; }
.status-steps .step { display: grid; grid-template-columns: 36px 1fr; gap: 14px; padding: 8px 0; position: relative; }
.status-steps .step:not(:last-child)::before {
    content: ''; position: absolute; left: 17px; top: 44px; bottom: -8px;
    width: 2px; background: var(--gray-200);
}
.status-steps .step.done:not(:last-child)::before { background: var(--brand-primary); }
.step-dot {
    width: 36px; height: 36px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--gray-100); color: var(--gray-400); font-size: 13px;
    border: 2px solid var(--gray-200); flex-shrink: 0; transition: all 0.3s var(--ease);
}
.step.done .step-dot { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }
.step.current .step-dot {
    background: #fff; color: var(--brand-primary); border-color: var(--brand-primary);
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--brand-primary) 20%, transparent);
}
.step-body { padding-top: 6px; }
.step-label { font-size: 14px; font-weight: 600; color: var(--gray-500); }
.step.done .step-label, .step.current .step-label { color: var(--gray-900); }
.step-time { font-size: 12px; color: var(--gray-500); margin-top: 2px; }

.status-card-body { padding: 20px 24px; }
.status-alert { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; background: var(--info-bg); color: var(--info); border-radius: var(--radius-sm); font-size: 14px; }

/* Journey card */
.card-title { padding: 16px 20px; border-bottom: 1px solid var(--gray-100); font-size: 14px; font-weight: 700; color: var(--gray-700); display: flex; align-items: center; gap: 8px; }
.card-title i { color: var(--brand-primary); }

.journey-row { display: grid; grid-template-columns: 36px 1fr; gap: 12px; padding: 16px 20px; align-items: start; }
.journey-dot { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; flex-shrink: 0; }
.journey-dot.pickup { background: var(--brand-primary); }
.journey-dot.dropoff { background: var(--success); }
.journey-name { font-weight: 600; font-size: 15px; color: var(--gray-900); margin-top: 4px; }
.journey-addr { font-size: 13px; color: var(--gray-500); margin-top: 2px; line-height: 1.4; }
.journey-line { margin-left: 37px; width: 2px; height: 20px; background: var(--gray-200); border-left: 2px dashed var(--gray-300); background: transparent; }

.detail-row { padding: 12px 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--gray-100); font-size: 14px; }
.detail-row:last-child { border-bottom: none; }
.detail-row span { color: var(--gray-500); }
.detail-row strong { color: var(--gray-900); font-weight: 600; }

.otp-box { margin: 16px 20px 20px; padding: 16px; background: linear-gradient(135deg, color-mix(in srgb, var(--brand-primary) 10%, #fff), color-mix(in srgb, var(--brand-accent) 10%, #fff)); border-radius: var(--radius-md); text-align: center; border: 1px dashed var(--brand-primary); }
.otp-digits { font-size: 32px; font-weight: 800; letter-spacing: 0.3em; color: var(--brand-primary); font-feature-settings: 'tnum'; margin: 6px 0; }
.otp-box p { font-size: 12px; color: var(--gray-600); }

/* Rider card */
.rider-card .rider-row { display: flex; align-items: center; gap: 14px; padding: 16px 20px; }
.rider-avatar { width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(135deg, var(--brand-primary), var(--brand-dark)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; flex-shrink: 0; }
.rider-name { font-weight: 600; font-size: 15px; color: var(--gray-900); margin-bottom: 2px; }
.rider-actions { display: flex; gap: 8px; padding: 12px 20px 20px; }

/* Activity list */
.activity-list { padding: 8px 20px 16px; }
.activity-item { display: grid; grid-template-columns: 12px 1fr; gap: 14px; padding: 12px 0; position: relative; }
.activity-item:not(:last-child)::before { content: ''; position: absolute; left: 5px; top: 22px; bottom: -4px; width: 2px; background: var(--gray-200); }
.activity-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--brand-primary); margin-top: 6px; border: 2px solid #fff; box-shadow: 0 0 0 2px var(--brand-primary); }
.activity-action { font-weight: 600; font-size: 13px; color: var(--gray-900); text-transform: capitalize; }
.activity-detail { font-size: 13px; color: var(--gray-600); margin-top: 2px; }
.activity-time { font-size: 11px; color: var(--gray-400); margin-top: 2px; }

/* Share card */
.share-card .qr-block {
    display: grid; grid-template-columns: 140px 1fr; gap: 16px; align-items: center;
    padding: 20px; background: var(--gray-50); margin: 0 20px; border-radius: var(--radius-md);
    margin-top: 0;
}
.share-card .qr-block img { width: 140px; height: 140px; border-radius: 12px; background: #fff; padding: 6px; border: 1px solid var(--gray-200); }
.share-url-row { display: flex; gap: 6px; margin-top: 6px; }
.share-url-row input { flex: 1; font-size: 12px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--gray-200); background: #fff; color: var(--gray-700); min-width: 0; }

.share-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
    padding: 16px 20px 20px;
}
.share-btn {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 14px 8px; border-radius: var(--radius-sm);
    background: var(--gray-100); color: var(--gray-700);
    font-size: 12px; font-weight: 500; transition: all 0.15s var(--ease);
    text-decoration: none; text-align: center;
}
.share-btn i { font-size: 20px; }
.share-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); text-decoration: none; }
.share-btn.whatsapp i { color: #25D366; }
.share-btn.whatsapp:hover { background: #D1FAE5; color: #065F46; }
.share-btn.sms i { color: var(--brand-primary); }
.share-btn.sms:hover { background: var(--primary-100); color: var(--brand-primary); }
.share-btn.email i { color: #DC2626; }
.share-btn.email:hover { background: var(--danger-bg); color: #991B1B; }
.share-btn.telegram i { color: #0088cc; }
.share-btn.telegram:hover { background: #DBEAFE; color: #1E40AF; }
.share-btn.native i { color: var(--gray-700); }
.share-btn.native:hover { background: var(--gray-200); }
.share-btn.download i { color: var(--warning); }
.share-btn.download:hover { background: var(--warning-bg); color: var(--warning); }

.track-auto-refresh {
    position: fixed; bottom: 24px; right: 24px;
    background: var(--brand-primary); color: #fff;
    padding: 10px 16px; border-radius: var(--radius-full); font-size: 13px; font-weight: 500;
    box-shadow: var(--shadow-md); display: flex; align-items: center; gap: 8px;
    z-index: 20;
}

/* Public footer */
.public-footer {
    background: var(--gray-900); color: var(--gray-400); padding: 24px;
    text-align: center; font-size: 13px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.public-footer a { color: var(--gray-300); }

@media (max-width: 540px) {
    .track-hero { padding: 40px 18px 60px; }
    .track-hero h1 { font-size: 30px; }
    .track-hero p { font-size: 15px; }
    .track-main { padding: 0 16px 40px; }
    .share-card .qr-block { grid-template-columns: 1fr; text-align: center; }
    .share-card .qr-block img { margin: 0 auto; }
    .share-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
    .share-btn { padding: 12px 4px; font-size: 11px; }
    .rider-actions { flex-wrap: wrap; }
    .public-footer { flex-direction: column; }
}

/* ============================================================
   DASHBOARD (sidebar + topbar + content)
   ============================================================ */
.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 260px;
    background: var(--brand-dark); color: #fff; padding: 22px 16px;
    display: flex; flex-direction: column; z-index: 40;
    transition: transform 0.25s var(--ease);
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 20px; margin-bottom: 16px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar-brand h1 { color: #fff; font-size: 16px; line-height: 1.1; margin: 0; }
.sidebar-brand span { font-size: 11px; color: rgba(255,255,255,0.5); }
.sidebar-nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.7); text-decoration: none;
    font-size: 14px; font-weight: 500; transition: all 0.15s var(--ease);
}
.sidebar-nav a i { width: 18px; font-size: 14px; color: rgba(255,255,255,0.5); }
.sidebar-nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar-nav a:hover i { color: var(--brand-accent); }
.sidebar-nav a.active { background: color-mix(in srgb, var(--brand-primary) 25%, transparent); color: #fff; }
.sidebar-nav a.active i { color: var(--brand-accent); }
.sidebar-section { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(255,255,255,0.35); padding: 14px 12px 4px; }
.sidebar-footer { padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.08); }

.main-content { margin-left: 260px; min-height: 100vh; }

.topbar {
    position: sticky; top: 0; z-index: 30;
    background: rgba(255,255,255,0.85); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--gray-200);
    padding: 14px 28px;
    display: flex; align-items: center; justify-content: space-between;
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar-left h2 { font-size: 18px; font-weight: 700; }
.menu-toggle { display: none; width: 40px; height: 40px; border-radius: 10px; color: var(--gray-700); background: var(--gray-100); align-items: center; justify-content: center; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.notif-bell { position: relative; }
.notif-bell .dot { position: absolute; top: -2px; right: -2px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); border: 2px solid #fff; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--brand-primary), var(--brand-dark)); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 14px; }

.content { padding: 28px; max-width: 1400px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-title { font-size: 24px; margin-bottom: 4px; }
.page-subtitle { color: var(--gray-500); font-size: 14px; }

/* Cards on dashboard */
.card { background: #fff; border-radius: var(--radius-md); border: 1px solid var(--gray-200); box-shadow: var(--shadow-xs); padding: 24px; }
.form-card h3 { font-size: 17px; margin-bottom: 4px; }
.form-card h4 { font-size: 14px; font-weight: 700; color: var(--gray-700); margin-top: 10px; margin-bottom: 12px; }
.form-card > .muted { margin-bottom: 18px; font-size: 13px; }
.form-actions { display: flex; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--gray-100); flex-wrap: wrap; }

.upload-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 16px; }
.upload-cell label:first-child { display: block; font-size: 13px; font-weight: 600; margin-bottom: 10px; color: var(--gray-700); }
.upload-cell input[type=file] { display: block; margin-top: 10px; font-size: 13px; color: var(--gray-600); width: 100%; }
.upload-preview { display: inline-flex; align-items: center; justify-content: center; padding: 16px; background: var(--gray-50); border-radius: var(--radius-md); border: 1px dashed var(--gray-300); min-height: 110px; min-width: 110px; }
.upload-preview img { max-height: 80px; max-width: 200px; object-fit: contain; }
.upload-preview.small { min-height: 80px; min-width: 80px; padding: 12px; }
.upload-preview.small img { max-height: 48px; max-width: 48px; }

.color-field { display: flex; gap: 8px; align-items: center; }
.color-field input[type=color] { width: 48px; height: 44px; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); cursor: pointer; padding: 2px; background: #fff; }
.color-field input[type=text] { flex: 1; font-family: 'SF Mono', monospace; font-size: 13px; text-transform: uppercase; }

/* Tabs */
.tabs-wrap { margin-bottom: 20px; }
.tabs-nav { display: flex; gap: 4px; border-bottom: 1px solid var(--gray-200); margin-bottom: 20px; overflow-x: auto; }
.tabs-nav .tab { padding: 12px 18px; font-size: 14px; font-weight: 600; color: var(--gray-500); border-bottom: 2px solid transparent; background: none; white-space: nowrap; transition: all 0.15s var(--ease); }
.tabs-nav .tab:hover { color: var(--gray-800); }
.tabs-nav .tab.active { color: var(--brand-primary); border-bottom-color: var(--brand-primary); }
.tab-panel[hidden] { display: none; }

/* Toggles */
.toggle-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--gray-100); }
.toggle-row:last-child { border-bottom: none; }
.toggle-row > div:last-child { flex: 1; font-size: 14px; }
.toggle-row .muted { font-size: 12px; margin-top: 2px; }
.toggle { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle .slider { position: absolute; cursor: pointer; inset: 0; background: var(--gray-300); border-radius: 999px; transition: background 0.2s var(--ease); }
.toggle .slider::before { content: ''; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform 0.2s var(--ease); box-shadow: var(--shadow-sm); }
.toggle input:checked + .slider { background: var(--brand-primary); }
.toggle input:checked + .slider::before { transform: translateX(18px); }

/* Stats grid */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-md); padding: 16px 18px; }
.stat-label { font-size: 12px; color: var(--gray-500); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-value { font-size: 24px; font-weight: 800; color: var(--gray-900); margin-top: 4px; font-feature-settings: 'tnum'; }

/* Filter chips */
.filter-bar { display: flex; gap: 20px; margin-bottom: 16px; flex-wrap: wrap; }
.chip-group { display: flex; gap: 6px; }
.chip { display: inline-block; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--gray-600); background: var(--gray-100); text-decoration: none; transition: all 0.15s var(--ease); }
.chip:hover { background: var(--gray-200); text-decoration: none; }
.chip.active { background: var(--brand-primary); color: #fff; }
.chip.active:hover { background: color-mix(in srgb, var(--brand-primary) 85%, black); }

/* Data table */
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table thead { background: var(--gray-50); }
.data-table th { text-align: left; padding: 12px 16px; font-size: 12px; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--gray-200); }
.data-table td { padding: 14px 16px; border-bottom: 1px solid var(--gray-100); vertical-align: top; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--gray-50); }
.empty-cell { text-align: center; padding: 40px 20px; color: var(--gray-400); font-size: 14px; }

.chan { display: inline-block; padding: 3px 8px; border-radius: 6px; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; }
.chan-email { background: var(--danger-bg); color: #991B1B; }
.chan-sms { background: var(--info-bg); color: #1E40AF; }
.chan-in_app { background: var(--primary-100); color: var(--brand-primary); }

.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.pill-success { background: var(--success-bg); color: var(--success); }
.pill-danger { background: var(--danger-bg); color: #991B1B; }
.pill-warning { background: var(--warning-bg); color: var(--warning); }
.event-tag { font-size: 11px; color: var(--gray-500); }

/* Mobile dashboard */
@media (max-width: 960px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .menu-toggle { display: inline-flex; }
    .content { padding: 20px 16px; }
    .upload-grid { grid-template-columns: 1fr; }
    .page-head { flex-direction: column; align-items: flex-start; }
}

/* Sidebar mobile overlay */
#sidebarOverlay.active { display: block !important; }

/* Dropdown (header user menu) */
.dropdown-toggle .dropdown-menu.open { display: block !important; }
.dropdown-menu a:hover { background: var(--gray-50); }
