/* CP Auto-Booking - Warm professional interface */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@500;600&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --canvas: #f5f3ee;
    --canvas-alt: #eef3ef;
    --surface: #fffdf9;
    --surface-strong: #ffffff;
    --surface-muted: #f8f6f1;
    --ink: #28231f;
    --ink-soft: #564d45;
    --muted: #786f65;
    --muted-light: #a1988f;
    --line: #e1d9cf;
    --line-strong: #cfc4b7;

    --brand: #b85b34;
    --brand-dark: #8f3f24;
    --brand-soft: #f7e8df;
    --brand-softer: #fbf1eb;
    --accent: #0f766e;
    --accent-dark: #0b5d57;
    --accent-soft: #e3f2ee;
    --sage: #5f714f;
    --sage-soft: #edf3e7;
    --gold: #c88a22;
    --gold-soft: #fff4dd;
    --berry: #a7445f;
    --berry-soft: #fae8ee;

    --success: #198754;
    --success-bg: #e7f4ea;
    --warning: #bd7a16;
    --warning-bg: #fff3d9;
    --danger: #c43d32;
    --danger-bg: #fae8e5;
    --info: #277a9f;
    --info-bg: #e7f3f7;

    /* Compatibility aliases for existing template inline styles */
    --brand-50: var(--brand-softer);
    --brand-100: var(--brand-soft);
    --brand-400: #d2835f;
    --brand-500: var(--brand);
    --brand-600: var(--brand);
    --brand-700: var(--brand-dark);
    --accent-50: var(--accent-soft);
    --accent-100: #cce5df;
    --accent-400: #3b9d94;
    --accent-500: var(--accent);
    --accent-600: var(--accent-dark);
    --slate-50: var(--surface-muted);
    --slate-100: #eee9e2;
    --slate-200: var(--line);
    --slate-300: var(--line-strong);
    --slate-400: var(--muted-light);
    --slate-500: var(--muted);
    --slate-600: var(--ink-soft);
    --slate-700: #423a33;
    --slate-800: #332b25;
    --slate-900: var(--ink);
    --gradient-brand: linear-gradient(135deg, var(--brand), var(--accent));
    --gradient-dark: linear-gradient(135deg, var(--ink), var(--brand-dark));

    --bg-primary: var(--canvas);
    --bg-secondary: var(--surface);
    --text-primary: var(--ink);
    --text-secondary: var(--muted);
    --text-tertiary: var(--muted-light);
    --border-color: var(--line);
    --border-light: #eee7df;

    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;

    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 8px;
    --radius-xl: 8px;
    --radius-full: 999px;

    --shadow-xs: 0 1px 1px rgba(62, 49, 39, 0.04);
    --shadow-sm: 0 1px 2px rgba(62, 49, 39, 0.06), 0 8px 24px rgba(62, 49, 39, 0.04);
    --shadow-md: 0 10px 30px rgba(62, 49, 39, 0.08);
    --shadow-lg: 0 18px 48px rgba(62, 49, 39, 0.12);
    --focus-ring: 0 0 0 4px rgba(184, 91, 52, 0.14);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    color: var(--text-primary);
    background:
        linear-gradient(180deg, rgba(245, 243, 238, 0.96), rgba(238, 243, 239, 0.92) 46%, rgba(248, 246, 241, 0.98)),
        var(--canvas);
    font-family: var(--font-sans);
    font-size: 14.5px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

main {
    flex: 1;
}

a {
    color: var(--brand-dark);
    text-decoration: none;
}

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

::selection {
    background: rgba(184, 91, 52, 0.18);
    color: var(--brand-dark);
}

/* Navigation */
.app-navbar,
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0;
    background: rgba(255, 253, 249, 0.94) !important;
    border-bottom: 1px solid rgba(207, 196, 183, 0.75);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(18px);
}

.navbar > .container,
.navbar > .container-xl {
    min-height: 68px;
    display: flex;
    align-items: center;
}

.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--ink) !important;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0;
}

.navbar-brand:hover {
    color: var(--brand-dark) !important;
}

.brand-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--brand);
    border-radius: var(--radius-md);
    box-shadow: inset 0 -10px 20px rgba(88, 41, 25, 0.16), 0 10px 24px rgba(184, 91, 52, 0.22);
}

.brand-icon i {
    font-size: 1.05rem;
}

.brand-text {
    white-space: nowrap;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.78rem !important;
    color: var(--muted) !important;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 700;
    transition: color 150ms ease, background 150ms ease;
}

.nav-link i {
    font-size: 1rem;
}

.nav-link:hover {
    color: var(--ink) !important;
    background: var(--surface-muted);
}

.nav-link.active {
    color: var(--brand-dark) !important;
    background: var(--brand-soft);
}

.navbar-toggler {
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-md);
    padding: 0.35rem 0.55rem;
}

.navbar-toggler:focus {
    box-shadow: var(--focus-ring);
}

.navbar-toggler-icon {
    width: 1.15rem;
    height: 1.15rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23564d45' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.3' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.dropdown-menu {
    min-width: 190px;
    padding: 0.45rem;
    color: var(--ink);
    background: var(--surface-strong);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.dropdown-item,
.dropdown-item-text {
    border-radius: var(--radius-sm);
    color: var(--ink);
    font-size: 0.875rem;
}

.dropdown-item {
    padding: 0.55rem 0.65rem;
}

.dropdown-item:hover,
.dropdown-item:focus {
    color: var(--ink);
    background: var(--surface-muted);
}

.dropdown-divider {
    border-color: var(--border-light);
}

/* Layout */
.app-main {
    width: 100%;
    padding-top: 2rem;
    padding-bottom: 3rem;
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 1.35rem;
}

.page-title {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0 0 0.3rem;
    color: var(--ink);
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: 0;
}

.page-title i {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-dark);
    background: var(--brand-soft);
    border-radius: var(--radius-md);
    font-size: 1rem;
}

.page-subtitle {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.96rem;
}

.page-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.45rem;
    color: var(--accent-dark);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1.25rem;
    align-items: start;
}

/* Cards and panels */
.card,
.glass-card,
.info-panel {
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.card {
    overflow: hidden;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.card:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.05rem 1.2rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(248, 246, 241, 0.75));
    border-bottom: 1px solid var(--border-light);
}

.card-header h5 {
    margin: 0;
    color: var(--ink);
    font-size: 0.98rem;
    font-weight: 800;
    letter-spacing: 0;
}

.card-header h5 i {
    color: var(--brand);
}

.card-body {
    padding: 1.2rem;
}

.info-panel {
    padding: 1.1rem;
}

.info-panel + .info-panel {
    margin-top: 1rem;
}

.info-panel-title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0 0.7rem;
    color: var(--ink);
    font-size: 0.88rem;
    font-weight: 800;
}

.info-panel-title i {
    color: var(--accent);
}

.soft-panel {
    padding: 1rem;
    background: var(--surface-muted);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
}

/* Dashboard */
.dashboard-hero {
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(40, 35, 31, 0.96), rgba(95, 113, 79, 0.92) 56%, rgba(184, 91, 52, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.dashboard-hero .page-title,
.dashboard-hero .page-subtitle,
.dashboard-hero .eyebrow {
    color: #fff;
}

.dashboard-hero .page-title i {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
}

.dashboard-hero .page-subtitle {
    opacity: 0.78;
}

.dashboard-hero .btn-outline-secondary {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.dashboard-hero .btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.35);
}

.stats-card {
    position: relative;
    min-height: 132px;
    padding: 1.1rem;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.stats-card::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: var(--brand);
}

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

.stats-card.pending::before { background: var(--info); }
.stats-card.completed::before { background: var(--success); }
.stats-card.failed::before { background: var(--danger); }
.stats-card.recurring::before { background: var(--gold); }

.stats-card .stats-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
}

.stats-card.pending .stats-icon { color: var(--info); background: var(--info-bg); }
.stats-card.completed .stats-icon { color: var(--success); background: var(--success-bg); }
.stats-card.failed .stats-icon { color: var(--danger); background: var(--danger-bg); }
.stats-card.recurring .stats-icon { color: var(--gold); background: var(--gold-soft); }

.stats-label {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
}

.stats-value {
    margin: 0;
    color: var(--ink);
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.05;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 38px;
    padding: 0.54rem 0.95rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 800;
    letter-spacing: 0;
    transition: background 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:focus-visible,
.btn-check:focus-visible + .btn,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    box-shadow: var(--focus-ring);
}

.btn-primary {
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
    box-shadow: 0 10px 20px rgba(184, 91, 52, 0.18);
}

.btn-primary:hover,
.btn-primary:focus {
    color: #fff;
    background: var(--brand-dark);
    border-color: var(--brand-dark);
}

.btn-success {
    color: #fff;
    background: var(--success);
    border-color: var(--success);
}

.btn-success:hover {
    color: #fff;
    background: #136c43;
    border-color: #136c43;
}

.btn-danger {
    color: #fff;
    background: var(--danger);
    border-color: var(--danger);
}

.btn-danger:hover {
    color: #fff;
    background: #a83128;
    border-color: #a83128;
}

.btn-warning {
    color: #fff;
    background: var(--warning);
    border-color: var(--warning);
}

.btn-warning:hover {
    color: #fff;
    background: #9c6412;
    border-color: #9c6412;
}

.btn-outline-primary {
    color: var(--brand-dark);
    background: transparent;
    border-color: rgba(184, 91, 52, 0.38);
}

.btn-outline-primary:hover,
.btn-check:checked + .btn-outline-primary {
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
}

.btn-check:checked + .btn-outline-primary .text-muted {
    color: rgba(255, 255, 255, 0.78) !important;
}

.btn-outline-secondary {
    color: var(--ink-soft);
    background: transparent;
    border-color: var(--line-strong);
}

.btn-outline-secondary:hover {
    color: var(--ink);
    background: var(--surface-muted);
    border-color: var(--line-strong);
}

.btn-outline-danger {
    color: var(--danger);
    background: transparent;
    border-color: rgba(196, 61, 50, 0.45);
}

.btn-outline-danger:hover {
    color: #fff;
    background: var(--danger);
    border-color: var(--danger);
}

.btn-ghost {
    color: var(--muted);
    background: transparent;
    border-color: transparent;
}

.btn-ghost:hover {
    color: var(--ink);
    background: var(--surface-muted);
}

.btn-icon {
    width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
}

.btn-lg {
    min-height: 46px;
    padding: 0.72rem 1.2rem;
    font-size: 0.94rem;
}

.btn-sm {
    min-height: 34px;
    padding: 0.4rem 0.72rem;
    font-size: 0.8rem;
}

.btn-link {
    color: var(--brand-dark);
    box-shadow: none;
}

.btn-link:hover {
    color: var(--brand);
    transform: none;
}

/* Tables */
.table {
    margin: 0;
    color: var(--ink);
}

.table thead {
    background: var(--surface-muted);
}

.table th {
    padding: 0.8rem 1rem;
    color: var(--muted);
    border: 0;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
    white-space: nowrap;
}

.table td {
    padding: 0.92rem 1rem;
    vertical-align: middle;
    border-color: var(--border-light);
    font-size: 0.875rem;
}

.table tbody tr {
    transition: background 120ms ease;
}

.table tbody tr:hover {
    background: rgba(248, 246, 241, 0.72);
}

.journey-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: max-content;
}

.journey-station {
    color: var(--ink);
    font-size: 0.875rem;
    font-weight: 800;
}

.journey-arrow {
    display: inline-flex;
    color: var(--brand);
}

.time-display {
    color: var(--ink);
    font-family: var(--font-mono);
    font-weight: 600;
}

.action-buttons {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Status and badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.28rem 0.62rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.2;
    white-space: nowrap;
}

.status-dot {
    width: 6px;
    height: 6px;
    flex: 0 0 6px;
    border-radius: 50%;
    background: currentColor;
}

.status-badge.pending { color: var(--muted); background: #eee9e2; }
.status-badge.scheduled { color: var(--accent-dark); background: var(--accent-soft); }
.status-badge.in_progress { color: var(--warning); background: var(--warning-bg); }
.status-badge.completed { color: var(--success); background: var(--success-bg); }
.status-badge.failed { color: var(--danger); background: var(--danger-bg); }

.status-badge.in_progress .status-dot {
    animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.55); opacity: 0.45; }
}

.badge {
    padding: 0.25rem 0.55rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0;
}

.bg-secondary { background: var(--muted) !important; }
.bg-info { background: var(--info) !important; }
.bg-warning { background: var(--warning) !important; }
.bg-success { background: var(--success) !important; }
.bg-danger { background: var(--danger) !important; }
.bg-primary { background: var(--brand) !important; }

/* Forms */
.form-label {
    display: flex;
    align-items: center;
    gap: 0.42rem;
    margin-bottom: 0.42rem;
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0;
}

.form-label i {
    color: var(--brand);
}

.form-control,
.form-select {
    min-height: 44px;
    padding: 0.64rem 0.82rem;
    color: var(--ink);
    background-color: var(--surface-strong);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.form-control:hover,
.form-select:hover {
    border-color: #bfb1a2;
}

.form-control:focus,
.form-select:focus {
    color: var(--ink);
    background-color: #fff;
    border-color: var(--brand);
    outline: 0;
}

.form-control::placeholder {
    color: var(--muted-light);
}

.form-text {
    margin-top: 0.35rem;
    color: var(--muted);
    font-size: 0.8rem;
}

.input-group-text {
    min-height: 44px;
    color: var(--muted);
    background: var(--surface-muted);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-md);
}

.input-group > .input-group-text + .form-control {
    border-left: 0;
}

.form-check {
    min-height: 1.6rem;
}

.form-check-input {
    border-color: var(--line-strong);
}

.form-check-input:checked {
    background-color: var(--brand);
    border-color: var(--brand);
}

.form-check-label {
    color: var(--ink-soft);
    font-weight: 600;
}

.form-section {
    padding: 1rem;
    background: var(--surface-muted);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
}

.form-section + .form-section {
    margin-top: 1rem;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.9rem;
    color: var(--ink);
    font-size: 0.94rem;
    font-weight: 800;
}

.section-title i {
    color: var(--brand);
}

/* Alerts */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.86rem 0.95rem;
    border: 1px solid transparent;
    border-left-width: 4px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
}

.alert i {
    margin-top: 0.12rem;
}

.alert-info { color: #17536d; background: var(--info-bg); border-color: rgba(39, 122, 159, 0.25); border-left-color: var(--info); }
.alert-warning { color: #7c520f; background: var(--warning-bg); border-color: rgba(189, 122, 22, 0.25); border-left-color: var(--warning); }
.alert-success { color: #125c38; background: var(--success-bg); border-color: rgba(25, 135, 84, 0.22); border-left-color: var(--success); }
.alert-danger { color: #8b2b23; background: var(--danger-bg); border-color: rgba(196, 61, 50, 0.22); border-left-color: var(--danger); }

.alert-link {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Journey detail */
.breadcrumb {
    margin-bottom: 1rem;
    padding: 0;
    background: transparent;
    font-size: 0.86rem;
}

.breadcrumb-item a {
    color: var(--brand-dark);
    font-weight: 800;
}

.breadcrumb-item.active {
    color: var(--muted);
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--muted-light);
}

.journey-card {
    position: relative;
    overflow: hidden;
    padding: 1.55rem;
    color: #fff;
    background: linear-gradient(135deg, var(--ink) 0%, #4f3b31 48%, var(--brand-dark) 100%);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.journey-card .journey-stations {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.4rem;
}

.journey-card .station {
    min-width: 0;
    text-align: center;
}

.journey-card .station-label {
    margin: 0 0 0.32rem;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.73rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.journey-card .station-name {
    margin: 0;
    color: #fff;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.journey-card .journey-line {
    position: relative;
    flex: 1;
    min-width: 110px;
    height: 2px;
    background: rgba(255, 255, 255, 0.28);
}

.journey-card .journey-line::before,
.journey-card .journey-line::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 10px;
    height: 10px;
    background: var(--gold);
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    transform: translateY(-50%);
}

.journey-card .journey-line::before { left: 0; }
.journey-card .journey-line::after { right: 0; }

.journey-card .train-icon-large {
    position: absolute;
    left: 50%;
    top: 50%;
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    color: var(--ink);
    background: #fff;
    border-radius: var(--radius-full);
    transform: translate(-50%, -50%);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.schedule-info {
    padding: 0.95rem 1rem;
    background: linear-gradient(180deg, var(--surface-strong), var(--surface-muted));
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
}

.schedule-info .schedule-label {
    margin: 0 0 0.2rem;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.schedule-info .schedule-value {
    margin: 0;
    color: var(--ink);
    font-size: 0.98rem;
    font-weight: 800;
}

.confirmation-code {
    display: inline-block;
    padding: 0.75rem 1rem;
    color: var(--success);
    background: #f3fbf5;
    border: 1px dashed rgba(25, 135, 84, 0.45);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 1.18rem;
    font-weight: 600;
    letter-spacing: 0;
}

/* Logs */
.log-entry {
    display: flex;
    align-items: flex-start;
    gap: 0.62rem;
    margin-bottom: 0.44rem;
    padding: 0.56rem 0.7rem;
    background: var(--surface-muted);
    border: 1px solid var(--border-light);
    border-left: 4px solid transparent;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
}

.log-entry.info { border-left-color: var(--info); }
.log-entry.warning { border-left-color: var(--warning); }
.log-entry.error { border-left-color: var(--danger); }

.log-time {
    flex: 0 0 auto;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.72rem;
}

.log-level {
    flex: 0 0 auto;
    font-size: 0.62rem;
}

.log-message {
    flex: 1;
    min-width: 0;
    color: var(--ink-soft);
    overflow-wrap: anywhere;
}

.log-screenshot-btn {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    min-height: 30px;
    color: var(--accent-dark);
    background: var(--accent-soft);
    border-color: rgba(15, 118, 110, 0.18);
}

.log-screenshot-btn:hover,
.log-screenshot-btn:focus {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
}

.screenshot-modal .modal-content {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.screenshot-modal .modal-header {
    border-bottom-color: var(--border-light);
}

.screenshot-modal .modal-title {
    color: var(--ink);
    font-size: 1rem;
    font-weight: 800;
}

.screenshot-modal .modal-body {
    padding: 0.75rem;
    background: #151515;
}

.screenshot-modal-image {
    display: block;
    width: 100%;
    max-height: 78vh;
    object-fit: contain;
    border-radius: var(--radius-md);
}

/* Empty states */
.empty-state {
    padding: 4rem 1.5rem;
    text-align: center;
}

.empty-state-icon {
    width: 74px;
    height: 74px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.1rem;
    color: var(--brand);
    background: var(--brand-soft);
    border-radius: var(--radius-lg);
    font-size: 1.8rem;
}

.empty-state-title {
    margin: 0 0 0.45rem;
    color: var(--ink);
    font-size: 1.12rem;
    font-weight: 800;
    letter-spacing: 0;
}

.empty-state-text {
    max-width: 390px;
    margin: 0 auto 1.35rem;
    color: var(--muted);
    font-size: 0.94rem;
}

/* Recurring */
.recurring-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    padding: 0.3rem 0.62rem;
    color: var(--warning);
    background: var(--warning-bg);
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 800;
}

.day-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.day-btn {
    width: 46px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-soft);
    background: var(--surface-strong);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 800;
    transition: color 150ms ease, background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.day-btn:hover {
    color: var(--brand-dark);
    background: var(--brand-softer);
    border-color: rgba(184, 91, 52, 0.45);
}

.day-btn.active {
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
    box-shadow: 0 10px 20px rgba(184, 91, 52, 0.16);
}

/* Train cards */
.train-card {
    min-height: 114px;
    padding: 0.9rem;
    color: var(--ink);
    background: var(--surface-strong);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.train-card:hover {
    transform: translateY(-2px);
    background: var(--brand-softer);
    border-color: rgba(184, 91, 52, 0.45);
    box-shadow: var(--shadow-sm);
}

.train-card.selected {
    background: var(--brand-soft);
    border-color: var(--brand);
    box-shadow: var(--focus-ring);
}

.train-card .train-time {
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0;
}

.train-card .train-type,
.train-type {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.16rem 0.42rem;
    border-radius: var(--radius-xs);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.2;
}

.train-type-ap { background: #8f2d22; color: white; }
.train-type-ic { background: #206a8a; color: white; }
.train-type-ir { background: #71509d; color: white; }
.train-type-r { background: #287052; color: white; }
.train-type-u { background: #ad711b; color: white; }
.train-type-re { background: #0f766e; color: white; }
.train-type-in { background: #9b3f5a; color: white; }

/* Loading */
.loading-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(184, 91, 52, 0.2);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 0.72s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Auth */
.auth-page {
    min-height: 100vh;
    display: block;
    background:
        linear-gradient(135deg, rgba(40, 35, 31, 0.96), rgba(95, 113, 79, 0.88) 52%, rgba(184, 91, 52, 0.82)),
        var(--ink);
}

.auth-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 440px;
    align-items: center;
    gap: 2rem;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.auth-visual {
    color: #fff;
}

.auth-visual .brand-icon {
    margin-bottom: 1.35rem;
    background: rgba(255, 255, 255, 0.14);
    box-shadow: none;
}

.auth-visual h1 {
    max-width: 540px;
    margin: 0 0 0.7rem;
    font-size: clamp(2rem, 4vw, 3.4rem);
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.05;
}

.auth-visual p {
    max-width: 520px;
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 1rem;
}

.auth-metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    max-width: 560px;
    margin-top: 2rem;
}

.auth-metric {
    padding: 0.9rem;
    background: rgba(255, 255, 255, 0.11);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-md);
}

.auth-metric strong {
    display: block;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 800;
}

.auth-metric span {
    display: block;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.78rem;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    margin-left: auto;
    position: relative;
    z-index: 1;
}

.auth-card .card {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 24px 70px rgba(20, 15, 12, 0.28);
}

.auth-card .card-body {
    padding: 1.4rem;
}

.auth-header {
    padding: 1.25rem 1.4rem;
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border-light);
}

.auth-header h1 {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 800;
}

.auth-header h1 i {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--brand);
    border-radius: var(--radius-md);
}

.auth-title {
    margin: 0 0 1rem;
    color: var(--ink);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0;
}

.auth-footer {
    margin-top: 1rem;
    color: rgba(255, 255, 255, 0.68);
    text-align: center;
    font-size: 0.82rem;
}

.auth-footer i {
    color: #fff;
}

/* Utilities */
.text-primary { color: var(--brand-dark) !important; }
.text-cyan { color: var(--accent) !important; }
.text-gold { color: var(--gold) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-muted { color: var(--text-secondary) !important; }

.border-soft {
    border-color: var(--border-light) !important;
}

.sticky-panel {
    position: sticky;
    top: 88px;
}

/* Animation */
.fade-in {
    animation: fadeIn 0.32s ease-out both;
}

.stagger-1 { animation-delay: 0ms; }
.stagger-2 { animation-delay: 45ms; }
.stagger-3 { animation-delay: 90ms; }
.stagger-4 { animation-delay: 135ms; }

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

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }

    .fade-in,
    .stagger-1,
    .stagger-2,
    .stagger-3,
    .stagger-4 {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Footer */
.footer {
    padding: 1rem 0;
    color: var(--muted);
    background: rgba(255, 253, 249, 0.74);
    border-top: 1px solid var(--line);
    font-size: 0.82rem;
}

.footer small {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* Responsive */
@media (max-width: 991.98px) {
    .navbar-collapse {
        padding: 0.8rem 0 1rem;
    }

    .nav-link {
        width: 100%;
    }

    .page-header,
    .dashboard-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .page-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .sticky-panel {
        position: static;
    }

    .auth-layout {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }

    .auth-visual {
        text-align: center;
    }

    .auth-visual h1,
    .auth-visual p,
    .auth-metric-grid {
        margin-left: auto;
        margin-right: auto;
    }

    .auth-card {
        margin-right: auto;
    }
}

@media (max-width: 767.98px) {
    .app-main {
        padding-top: 1.25rem;
        padding-bottom: 2rem;
    }

    .page-title {
        font-size: 1.42rem;
    }

    .dashboard-hero {
        padding: 1rem;
    }

    .stats-card {
        min-height: 118px;
    }

    .stats-value {
        font-size: 1.7rem;
    }

    .journey-card {
        padding: 1.15rem;
    }

    .journey-card .journey-stations {
        flex-direction: column;
        gap: 1rem;
    }

    .journey-card .journey-line {
        width: 2px;
        height: 58px;
        min-width: 2px;
        flex: none;
    }

    .auth-metric-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    .container,
    .container-xl {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .brand-text {
        display: none;
    }

    .card-header,
    .card-body {
        padding: 1rem;
    }

    .page-actions .btn {
        width: 100%;
    }

    .table td,
    .table th {
        padding-left: 0.8rem;
        padding-right: 0.8rem;
    }

    .auth-layout {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #c7bbb0;
    border-radius: 7px;
}

::-webkit-scrollbar-thumb:hover {
    background: #aa9d91;
}
