/* ==========================================================================
   SKP Dispatcher UI - Design System
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Variables (Design Tokens)
   -------------------------------------------------------------------------- */
:root {
    /* Colors — Soft Depth palette */
    --color-primary: #4f46e5;
    --color-primary-hover: #4338ca;
    --color-primary-light: #eef2ff;

    --color-success: #16a34a;
    --color-success-hover: #15803d;

    --color-danger: #dc2626;
    --color-danger-hover: #b91c1c;
    --color-danger-light: #fef2f2;

    --color-warning: #f59e0b;

    --color-text: #1e293b;
    --color-text-secondary: #64748b;
    --color-text-muted: #94a3b8;

    --color-bg: #f8fafc;
    --color-bg-white: #ffffff;
    --color-border: #e2e8f0;
    --color-border-light: #f1f5f9;

    /* Header */
    --color-header-bg: #1e293b;
    --color-header-text: #ffffff;
    --color-header-text-muted: #94a3b8;

    /* Focus ring */
    --color-focus-ring: rgba(79, 70, 229, 0.1);

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;

    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.625;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;

    /* Shadows — softer, larger spread */
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.04), 0 1px 2px -1px rgb(0 0 0 / 0.04);
    --shadow-md: 0 4px 8px -2px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.04);
    --shadow-lg: 0 12px 24px -4px rgb(0 0 0 / 0.1), 0 4px 8px -4px rgb(0 0 0 / 0.06);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 200ms ease;
    --transition-slow: 300ms ease;

    /* Layout */
    --header-height: 120px;
    --sidebar-width: 350px;
    --container-max-width: 900px;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--color-text);
    background-color: var(--color-bg);
    min-height: 100vh;
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    color: var(--color-text);
    letter-spacing: -0.025em;
}

h1 { font-size: var(--font-size-2xl); }
h2 { font-size: var(--font-size-xl); }
h3 { font-size: var(--font-size-lg); }
h4 { font-size: var(--font-size-base); }

p {
    color: var(--color-text-secondary);
    line-height: var(--line-height-relaxed);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-hover);
}

/* --------------------------------------------------------------------------
   Layout Components
   -------------------------------------------------------------------------- */

/* Header — Dark Soft Depth */
.header {
    background: var(--color-header-bg);
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.2), 0 2px 8px 0 rgb(0 0 0 / 0.12);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-top {
    padding: var(--space-3) var(--space-8);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-top h1 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--color-header-text);
}

.header-top .btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-header-text-muted);
    border-color: rgba(255, 255, 255, 0.15);
}

.header-top .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--color-header-text);
    border-color: rgba(255, 255, 255, 0.25);
}

/* Header Info (date/time, exchange rate) */
.header-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.header-info-chip {
    font-size: var(--font-size-sm);
    color: var(--color-header-text);
    padding: var(--space-2) var(--space-4);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-full);
}

/* Navigation Tabs — Pill-shaped on dark header */
.tabs {
    display: flex;
    padding: var(--space-2) var(--space-8);
    gap: var(--space-1);
    border-bottom: none;
}

.tab {
    padding: var(--space-2) var(--space-4);
    color: var(--color-header-text-muted);
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-sm);
    border-bottom: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.tab:hover {
    color: var(--color-header-text);
    background: rgba(255, 255, 255, 0.08);
}

.tab.active {
    color: var(--color-header-text);
    background: rgba(255, 255, 255, 0.12);
}

/* Container */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: var(--space-6);
}

/* Card — Layered depth */
.card {
    background: var(--color-bg-white);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
}

.card-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-4);
    color: var(--color-text);
}

/* --------------------------------------------------------------------------
   Form Elements
   -------------------------------------------------------------------------- */

/* Form Group */
.form-group {
    margin-bottom: var(--space-4);
}

/* Labels */
label {
    display: block;
    margin-bottom: var(--space-2);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
}

/* Inputs */
input[type="text"],
input[type="tel"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: var(--font-size-sm);
    font-family: var(--font-family);
    color: var(--color-text);
    background: var(--color-bg-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-focus-ring);
}

input::placeholder {
    color: var(--color-text-muted);
}

input:disabled,
select:disabled {
    background: var(--color-bg);
    cursor: not-allowed;
    opacity: 0.7;
}

/* Buttons — Soft Depth with hover lift */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3) var(--space-6);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    font-family: var(--font-family);
    line-height: var(--line-height-normal);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    gap: var(--space-2);
}

.btn-primary {
    background: var(--color-primary);
    color: white;
    box-shadow: 0 1px 3px 0 rgb(79 70 229 / 0.3), 0 1px 2px -1px rgb(79 70 229 / 0.2);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px 0 rgb(79 70 229 / 0.35), 0 2px 4px -1px rgb(79 70 229 / 0.2);
}

.btn-success {
    background: var(--color-success);
    color: white;
    box-shadow: 0 1px 3px 0 rgb(22 163 74 / 0.3), 0 1px 2px -1px rgb(22 163 74 / 0.2);
}

.btn-success:hover {
    background: var(--color-success-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px 0 rgb(22 163 74 / 0.35), 0 2px 4px -1px rgb(22 163 74 / 0.2);
}

.btn-danger {
    background: var(--color-danger);
    color: white;
    box-shadow: 0 1px 3px 0 rgb(220 38 38 / 0.3), 0 1px 2px -1px rgb(220 38 38 / 0.2);
}

.btn-danger:hover {
    background: var(--color-danger-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px 0 rgb(220 38 38 / 0.35), 0 2px 4px -1px rgb(220 38 38 / 0.2);
}

.btn-secondary {
    background: var(--color-bg-white);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-xs);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--font-size-base);
}

/* --------------------------------------------------------------------------
   Utility Classes
   -------------------------------------------------------------------------- */

/* Grid */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
}

/* Flexbox */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

/* Spacing */
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

/* Text */
.text-center { text-align: center; }
.text-sm { font-size: var(--font-size-sm); }
.text-xs { font-size: var(--font-size-xs); }
.text-muted { color: var(--color-text-muted); }
.text-secondary { color: var(--color-text-secondary); }

/* Display */
.hidden { display: none; }

/* --------------------------------------------------------------------------
   Alerts & Messages
   -------------------------------------------------------------------------- */
.alert {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.alert-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-left: 3px solid var(--color-danger);
}

.alert-success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
    border-left: 3px solid var(--color-success);
}

/* --------------------------------------------------------------------------
   Empty State
   -------------------------------------------------------------------------- */
.empty-state {
    text-align: center;
    padding: var(--space-12) var(--space-6);
    color: var(--color-text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: var(--space-4);
    opacity: 0.35;
    filter: grayscale(0.3);
}

/* --------------------------------------------------------------------------
   Loading
   -------------------------------------------------------------------------- */
.loading {
    text-align: center;
    padding: var(--space-10);
    color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Badge
   -------------------------------------------------------------------------- */
.badge {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    border-radius: var(--radius-full);
    letter-spacing: 0.025em;
}

.badge-primary {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.badge-success {
    background: #f0fdf4;
    color: var(--color-success);
}

/* --------------------------------------------------------------------------
   Autocomplete Dropdown
   -------------------------------------------------------------------------- */
.autocomplete-container {
    position: relative;
}

.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--color-bg-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.03);
}

.autocomplete-item {
    padding: var(--space-3) var(--space-4);
    cursor: pointer;
    font-size: var(--font-size-sm);
    border-bottom: 1px solid var(--color-border-light);
    transition: background var(--transition-fast);
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: var(--color-primary-light);
}

/* --------------------------------------------------------------------------
   Passenger Card
   -------------------------------------------------------------------------- */
.passenger-card {
    background: #f8fafc;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    margin-bottom: var(--space-3);
    position: relative;
    transition: border-color var(--transition-fast);
}

.passenger-card:hover {
    border-color: #cbd5e1;
}

.passenger-card h4 {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-3);
}

.passenger-card .btn-remove {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    width: 24px;
    height: 24px;
    padding: 0;
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
}

.passenger-card input,
.passenger-card select {
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-xs);
}

.passenger-card label {
    font-size: var(--font-size-xs);
    margin-bottom: var(--space-1);
}

/* --------------------------------------------------------------------------
   Route Cards (for routes viewer)
   -------------------------------------------------------------------------- */
.route-card {
    background: var(--color-bg);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-3);
    border-left: 4px solid var(--color-primary);
}

.route-card-title {
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-sm);
    color: var(--color-text);
    margin-bottom: var(--space-3);
}

.route-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.stat-value {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

/* --------------------------------------------------------------------------
   Stops List
   -------------------------------------------------------------------------- */
.stops-list {
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-border);
}

.stop-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) 0;
    font-size: var(--font-size-xs);
}

.stop-icon {
    width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: var(--font-weight-bold);
    color: white;
    flex-shrink: 0;
}

.stop-icon.start { background: #9ca3af; }
.stop-icon.pickup { background: var(--color-success); }
.stop-icon.delivery { background: var(--color-primary); }
.stop-icon.end { background: #9ca3af; }

.stop-name {
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.stop-time {
    font-size: var(--font-size-xs);
    color: var(--color-success);
    font-weight: var(--font-weight-medium);
}

/* --------------------------------------------------------------------------
   Info Section (sidebar)
   -------------------------------------------------------------------------- */
.info-section {
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-5);
    border-bottom: 1px solid var(--color-border-light);
}

.info-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.info-title {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-2);
}

.info-value {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
}

/* --------------------------------------------------------------------------
   JSON Output
   -------------------------------------------------------------------------- */
.json-output {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: var(--space-4);
    border-radius: var(--radius-md);
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: var(--font-size-xs);
    line-height: var(--line-height-relaxed);
}

.json-key { color: #9cdcfe; }
.json-string { color: #ce9178; }
.json-number { color: #b5cea8; }
.json-boolean { color: #569cd6; }
.json-null { color: #569cd6; }

/* --------------------------------------------------------------------------
   Map Layout (for routes viewer)
   -------------------------------------------------------------------------- */
.map-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.map-container {
    flex: 1;
    min-width: 0;
}

.map-sidebar {
    width: var(--sidebar-width);
    background: var(--color-bg-white);
    overflow-y: auto;
    box-shadow: -2px 0 4px rgb(0 0 0 / 0.05);
}

.sidebar-content {
    padding: var(--space-5);
}

/* --------------------------------------------------------------------------
   Controls Bar
   -------------------------------------------------------------------------- */
.controls-bar {
    background: var(--color-bg-white);
    padding: var(--space-3) var(--space-5);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.controls-bar .form-group {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: 0;
}

.controls-bar label {
    margin-bottom: 0;
    white-space: nowrap;
}

.controls-bar select,
.controls-bar input {
    width: auto;
    min-width: 180px;
}

/* --------------------------------------------------------------------------
   Login/Auth Pages
   -------------------------------------------------------------------------- */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}

.auth-card {
    background: var(--color-bg-white);
    padding: 40px 36px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    box-shadow: 0 20px 40px -4px rgb(0 0 0 / 0.1), 0 8px 16px -4px rgb(0 0 0 / 0.06);
    width: 100%;
    max-width: 420px;
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
}

.auth-card h1 {
    text-align: center;
    margin-bottom: var(--space-6);
}

.auth-subtitle {
    text-align: center;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-6);
}

.auth-link {
    text-align: center;
    margin-top: var(--space-4);
}

/* --------------------------------------------------------------------------
   Location Group (country + place input)
   -------------------------------------------------------------------------- */
.location-group {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: var(--space-3);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

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

.modal {
    background: var(--color-bg-white);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    box-shadow: 0 24px 48px -12px rgb(0 0 0 / 0.25), 0 8px 16px -4px rgb(0 0 0 / 0.1);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--color-danger-light);
    border-bottom-color: #fecaca;
}

.modal-header.warning {
    background: #fefce8;
    border-bottom-color: #fef08a;
}

.modal-header.warning .modal-title {
    color: #a16207;
}

.modal-header-neutral {
    background: #f8fafc;
    border-bottom-color: #e2e8f0;
}

.modal-header-neutral .modal-title {
    color: #1e293b;
}

.modal-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--color-danger);
}

.modal-close {
    background: none;
    border: none;
    font-size: var(--font-size-xl);
    cursor: pointer;
    color: var(--color-text-secondary);
    padding: 0;
    line-height: 1;
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--color-text);
}

.modal-body {
    padding: var(--space-5);
    overflow-y: auto;
}

.modal-body p {
    color: var(--color-text);
    line-height: var(--line-height-relaxed);
}

.modal-footer {
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    background: #f8fafc;
}

/* --------------------------------------------------------------------------
   Button Group
   -------------------------------------------------------------------------- */
.button-group {
    display: flex;
    gap: var(--space-3);
}

/* --------------------------------------------------------------------------
   Price Table
   -------------------------------------------------------------------------- */
.price-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-4);
}

.price-table th,
.price-table td {
    padding: var(--space-3);
    text-align: left;
    border-bottom: 1px solid var(--color-border-light);
}

.price-table th {
    background: #f8fafc;
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.price-table td {
    color: var(--color-text);
}

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

.price-summary {
    display: flex;
    gap: var(--space-6);
    padding: var(--space-4) var(--space-5);
    background: #f8fafc;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}

.price-total {
    font-size: var(--font-size-lg);
    color: var(--color-text);
}

.price-total strong {
    color: var(--color-success);
}

.price-prepayment {
    font-size: var(--font-size-lg);
    color: var(--color-text);
}

.price-prepayment strong {
    color: #0891b2;
}

/* --------------------------------------------------------------------------
   Trip Cards & Booking UI
   -------------------------------------------------------------------------- */
.trips-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.trip-card {
    background: var(--color-bg-white);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.trip-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.trip-card.selected {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
    box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.trip-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--color-border);
}

.trip-route {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.trip-point {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    flex: 1;
}

.trip-departure {
    text-align: left;
}

.trip-arrival {
    text-align: right;
}

.trip-point-time {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text);
}

.trip-point-date {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
}

.trip-point-location {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.trip-arrival .trip-point-location {
    margin-left: auto;
}

.trip-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
    padding: 0 var(--space-4);
    position: relative;
}

.trip-arrow::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -20px;
    right: -20px;
    height: 2px;
    background: linear-gradient(90deg, var(--color-border), var(--color-primary), var(--color-border));
    z-index: 0;
}

.trip-duration-badge {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-primary);
    background: var(--color-bg-white);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    border: 1px solid var(--color-primary);
    position: relative;
    z-index: 1;
}

.trip-details {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border);
}

.trip-seats {
    display: flex;
    gap: var(--space-6);
}

.seat-type {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.seat-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.seat-availability {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
}

.seat-availability.available {
    color: var(--color-success);
}

.seat-availability.unavailable {
    color: var(--color-danger);
}

.seat-price {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
}

.trip-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--space-1);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.trip-vehicle,
.trip-drivers {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

/* Booking Confirmation */
.booking-confirmation {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.confirmation-box {
    background: var(--color-bg-white);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
}

.confirmation-status {
    padding: var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    text-align: center;
    margin-bottom: var(--space-4);
}

.confirmation-status.success {
    background: #ecfdf5;
    color: var(--color-success);
}

.confirmation-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-6);
    border-bottom: 1px solid var(--color-border);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) 0;
}

.detail-row .label {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

.detail-row .value {
    color: var(--color-text);
    font-size: var(--font-size-sm);
}

.detail-row .value strong {
    font-weight: var(--font-weight-semibold);
}

.confirmation-passengers {
    margin-top: var(--space-4);
}

.confirmation-passengers h4 {
    color: var(--color-text);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--color-border);
}

.confirmation-passenger {
    padding: var(--space-4);
    background: var(--color-bg);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-3);
}

.confirmation-passenger strong {
    display: block;
    color: var(--color-text);
    font-size: var(--font-size-base);
    margin-bottom: var(--space-2);
}

.passenger-details {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .trip-route {
        flex-direction: column;
        gap: var(--space-3);
    }

    .trip-point {
        text-align: center !important;
    }

    .trip-point-location {
        max-width: none;
    }

    .trip-arrival .trip-point-location {
        margin-left: 0;
    }

    .trip-arrow {
        width: 100%;
        padding: var(--space-2) 0;
    }

    .trip-arrow::before {
        display: none;
    }

    .trip-details {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-4);
    }

    .trip-seats {
        justify-content: space-between;
    }

    .trip-meta {
        flex-direction: row;
        justify-content: center;
        align-items: center;
    }

    .confirmation-details {
        grid-template-columns: 1fr;
    }

    .location-group {
        grid-template-columns: 1fr;
    }

    .map-sidebar {
        width: 100%;
    }

    .controls-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .controls-bar .form-group {
        flex-direction: column;
        align-items: stretch;
    }

    .controls-bar select,
    .controls-bar input {
        width: 100%;
    }

    .modal {
        max-width: calc(100% - var(--space-4));
        margin: var(--space-2);
    }
}

/* --------------------------------------------------------------------------
   Common Page Layout Components
   -------------------------------------------------------------------------- */

/* Main Content Container */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: auto;
    margin: 0 auto;
    width: 100%;
    padding: var(--space-6);
    box-sizing: border-box;
}

.main-content-sm {
    max-width: 900px;
}

.main-content-md {
    max-width: 1000px;
}

.main-content-lg {
    max-width: 1400px;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
}

.page-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
}

/* Section Card — Layered depth */
.section-card {
    background: var(--color-bg-white);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: var(--space-6);
}

.section-card:last-child {
    margin-bottom: 0;
}

.section-header {
    padding: var(--space-4) var(--space-5);
    background: #f8fafc;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title {
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    font-size: 15px;
}

.section-body {
    padding: var(--space-5);
}

/* Filters Bar — Toolbar treatment */
.filters-bar {
    display: flex;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    background: var(--color-bg-white);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-5);
    align-items: flex-end;
}

.filters-bar .form-group {
    margin-bottom: 0;
}

.filters-bar label {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-1);
}

/* Data Table (stops, bookings, etc.) */
.data-table,
.stops-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td,
.stops-table th,
.stops-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--color-border-light);
}

.data-table th,
.stops-table th {
    background: #f8fafc;
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.data-table tr:last-child td,
.stops-table tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover,
.stops-table tbody tr:hover {
    background: #f8fafc;
}

/* Empty Message / Empty State */
.empty-message,
.empty-state {
    text-align: center;
    padding: var(--space-10) var(--space-5);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

/* List Items (cars, routes, etc.) */
.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid #f1f5f9;
    transition: background var(--transition-fast);
}

.list-item:hover {
    background: #f8fafc;
}

.list-item:last-child {
    border-bottom: none;
}

/* Form Row (2-column grid) */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
}

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

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Section Grid (2-panel layout) */
.section-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
}

@media (max-width: 1024px) {
    .section-grid {
        grid-template-columns: 1fr;
    }
}

/* Icon Buttons */
.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: #fee2e2;
    border-color: #fecaca;
    color: var(--color-danger);
}
