:root {
    --app-bg: #f3f6fb;
    --panel-bg: #fff;
    --sidebar-bg: #fff;
    --text-color: #212529;
    --muted-color: #64779c;
    --border-color: #e8edf6;
}

.theme-dark {
    --app-bg: #0d1424;
    --panel-bg: #141d31;
    --sidebar-bg: #141d31;
    --text-color: #d4ddf4;
    --muted-color: #9fb0d5;
    --border-color: #25324d;
}

body {
    font-family: "Segoe UI", Tahoma, sans-serif;
    overflow-x: hidden;
    color: var(--text-color);
    background-color: var(--app-bg);
}

.theme-toggle {
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    border-radius: 10px;
    padding: 6px 10px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.theme-toggle-public {
    position: fixed;
    right: 12px;
    top: 12px;
    z-index: 1200;
    background: #1e5eff;
    border-color: #1e5eff;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bg-landing {
    background: #f3f5f9;
}

.bg-login {
    background: linear-gradient(140deg, #1f5eff 0%, #5aa3ff 100%);
    min-height: 100vh;
}

.bg-app {
    background: var(--app-bg);
}

.app-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.app-sidebar {
    width: 250px;
    min-width: 250px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 18px 14px;
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.city-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 10px;
    background: #f6f9ff;
    border: 1px solid #dce8ff;
    padding: 4px;
}

.brand-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: #1e5eff;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.brand-title {
    font-weight: 700;
    font-size: 14px;
    line-height: 1.3;
}

.thesis-box {
    background: #fff8e9;
    border: 1px solid #ffe1aa;
    color: #6f5523;
    border-radius: 10px;
    padding: 9px 10px;
    margin-bottom: 14px;
    font-size: 12px;
    line-height: 1.35;
}

.user-box {
    background: #f4f8ff;
    border: 1px solid #e0eafe;
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 16px;
}

.menu-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.menu-link {
    text-decoration: none;
    color: #506080;
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 14px;
}

.menu-link:hover {
    background: #f4f7ff;
    color: #1e5eff;
}

.menu-link.active {
    background: #1e5eff;
    color: #fff;
}

.app-main {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: linear-gradient(110deg, #1e5eff 0%, #2d82ff 100%);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.topbar small {
    color: #dce8ff !important;
}

.content-area {
    padding: 20px;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: hidden;
}

.table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.app-footer {
    margin-top: auto;
    border-top: 1px solid #e8edf6;
    padding: 10px 20px;
    color: #64779c;
    background: #f8faff;
}

.panel {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(23, 45, 90, 0.05);
}

.panel-header {
    padding: 14px 16px;
    border-bottom: 1px solid #edf1f8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.panel-body {
    padding: 16px;
}

.soft-table thead th {
    background: var(--app-bg);
    color: var(--text-color);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.soft-table tbody td {
    vertical-align: middle;
}

.soft-table .cell-nowrap {
    white-space: nowrap;
}

.soft-table .cell-wrap {
    white-space: normal;
    word-break: break-word;
    min-width: 140px;
    max-width: 420px;
}

.form-label {
    font-weight: 600;
    color: #4a5d82;
    font-size: 13px;
}

.stat-card {
    padding: 16px;
}

.stat-label {
    color: #697a9b;
    font-size: 13px;
}

.stat-value {
    font-size: 25px;
    font-weight: 700;
    color: #193067;
}

.login-shell {
    min-height: calc(100vh - 4rem);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-radius: 18px;
}

.login-bg-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.login-bg-layer {
    position: absolute;
    inset: 0;
    background: linear-gradient(140deg, rgba(5, 16, 38, 0.68), rgba(15, 44, 99, 0.6));
    z-index: 2;
}

.login-form-card {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid #dfe8fb;
    box-shadow: 0 20px 45px rgba(17, 54, 124, 0.35);
    position: relative;
    z-index: 3;
}

.login-media {
    position: relative;
    min-height: 500px;
    background: #0f203f;
}

.login-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.login-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 16px 18px;
    color: #fff;
    background: linear-gradient(180deg, rgba(13, 33, 66, 0) 0%, rgba(13, 33, 66, 0.88) 100%);
}

.login-form-panel {
    padding: 24px 22px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-logo-wrap {
    text-align: center;
    margin-bottom: 6px;
}

.login-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.account-hint {
    background: #f8fbff;
    border: 1px solid #dfe9fb;
    border-radius: 10px;
    padding: 10px 12px;
}

.login-penumpang-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e0e9fb;
    border-radius: 8px;
    background: #fff;
}

.login-penumpang-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid #edf2fb;
}

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

.login-penumpang-info strong {
    font-size: 13px;
    display: block;
}

.login-penumpang-info small {
    font-size: 11px;
}

.landing-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 20px 28px;
}

.landing-nav {
    height: 64px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid #e4e9f3;
    border-radius: 12px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.landing-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1f2f4c;
    font-weight: 600;
}

.brand-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #2f67f6;
    display: inline-block;
}

.landing-menu {
    display: flex;
    align-items: center;
    gap: 24px;
}

.landing-menu a {
    color: #4f5f7e;
    text-decoration: none;
    font-size: 14px;
}

.landing-menu a:hover {
    color: #1e5eff;
}

.landing-auth {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.landing-hero {
    margin-top: 22px;
    background: #eceff4;
    border: 1px solid #e4e9f3;
    border-radius: 18px;
    padding: 40px;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 28px;
    align-items: center;
}

.landing-title {
    font-size: 56px;
    line-height: 1.08;
    font-weight: 800;
    color: #0f1b36;
    max-width: 620px;
    margin-bottom: 14px;
}

.landing-subtitle {
    max-width: 600px;
    color: #526482;
    font-size: 18px;
    margin-bottom: 20px;
}

.landing-points {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    color: #4d5f7f;
    font-size: 15px;
}

.landing-image-box {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 28px rgba(20, 40, 80, 0.12);
    border: 1px solid #d8e0ef;
    background: #fff;
}

.landing-image-box img {
    width: 100%;
    height: 100%;
    max-height: 420px;
    object-fit: cover;
    display: block;
}

.landing-v2 {
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 18px 28px;
}

.landing-v2-nav {
    background: #0f2a66;
    color: #fff;
    border-radius: 16px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.landing-v2-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.landing-v2-brand img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
    padding: 3px;
}

.landing-v2-brand strong {
    display: block;
    font-size: 15px;
    line-height: 1.2;
}

.landing-v2-brand small {
    color: #c6d7ff;
    font-size: 12px;
}

.landing-v2-actions {
    display: flex;
    gap: 8px;
}

.landing-v2-hero {
    margin-top: 16px;
    background: #ffffff;
    border: 1px solid #dde6f8;
    border-radius: 20px;
    padding: 24px;
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 20px;
    align-items: center;
}

.landing-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #cddcff;
    color: #234ea8;
    font-size: 12px;
    margin-bottom: 12px;
}

.landing-v2-left h1 {
    font-size: 40px;
    line-height: 1.12;
    font-weight: 800;
    color: #13264f;
    margin-bottom: 10px;
}

.landing-lead {
    color: #536589;
    font-size: 16px;
    line-height: 1.5;
    max-width: 34rem;
    margin-bottom: 18px;
}

.landing-v2-cta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.landing-v2-right {
    position: relative;
}

.landing-v2-right img {
    width: 100%;
    border-radius: 16px;
    border: 1px solid #dae4f9;
    max-height: 420px;
    object-fit: cover;
    box-shadow: 0 12px 30px rgba(25, 50, 99, 0.16);
}

.floating-metric {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 12px;
    background: rgba(10, 23, 51, 0.82);
    color: #fff;
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.floating-metric small {
    display: block;
    color: #b3cafc;
    font-size: 11px;
}

.floating-metric strong {
    font-size: 18px;
}

.landing-v2-grid {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.feature-card {
    background: #fff;
    border: 1px solid #dde6f8;
    border-radius: 14px;
    padding: 16px;
}

.feature-card i {
    font-size: 20px;
    color: #2a61de;
}

.feature-card h6 {
    margin-top: 8px;
    margin-bottom: 6px;
    color: #153169;
}

.feature-card p {
    margin: 0;
    color: #596c90;
    font-size: 13px;
    line-height: 1.4;
}

.landing-route {
    padding: 18px 20px;
}

.landing-route-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 16px;
}

.landing-route-meta {
    color: #6b7c9c;
    font-size: 14px;
}

.route-track {
    position: relative;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding: 20px 12px 8px;
    background: var(--app-bg, #f6f8fc);
    border: 1px solid var(--border-color, #dde6f8);
    border-radius: 12px;
}

.route-track-line {
    position: absolute;
    top: 34px;
    left: 12%;
    right: 12%;
    height: 4px;
    background: #c9d9fb;
    border-radius: 4px;
    z-index: 0;
}

.route-stop {
    position: relative;
    z-index: 1;
    flex: 1;
    text-align: center;
    min-width: 0;
}

.route-stop-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin: 0 auto 8px;
    border-radius: 50%;
    background: #2a61de;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(42, 97, 222, 0.35);
}

.route-stop-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1a335f;
    line-height: 1.3;
}

.theme-dark body {
    color: #d4ddf4;
}

.theme-dark .bg-app,
.theme-dark .bg-landing {
    background: #0d1424;
}

.theme-dark .bg-login {
    background: linear-gradient(140deg, #0f2046 0%, #1a2f64 100%);
}

.theme-dark .app-sidebar,
.theme-dark .panel,
.theme-dark .feature-card,
.theme-dark .landing-v2-hero,
.theme-dark .landing-v2-nav,
.theme-dark .app-footer,
.theme-dark .user-box,
.theme-dark .thesis-box,
.theme-dark .landing-nav,
.theme-dark .landing-hero {
    background: #141d31 !important;
    border-color: #25324d !important;
    color: #d4ddf4 !important;
}

.theme-dark .brand-title,
.theme-dark .stat-value,
.theme-dark .feature-card h6,
.theme-dark .landing-v2-left h1 {
    color: #edf2ff;
}

.theme-dark .text-muted,
.theme-dark .landing-lead,
.theme-dark .landing-subtitle,
.theme-dark .landing-route-meta,
.theme-dark .route-stop-name,
.theme-dark .feature-card p,
.theme-dark .stat-label,
.theme-dark .app-footer {
    color: #9fb0d5 !important;
}

.theme-dark .menu-link {
    color: #b9c7e8;
}

.theme-dark .menu-link:hover {
    background: #1e2b45;
    color: #fff;
}

.theme-dark .menu-link.active {
    background: #3b6dff;
}

.theme-dark .topbar {
    background: linear-gradient(110deg, #111c37 0%, #1b315f 100%);
}

.theme-dark .panel-header,
.theme-dark .app-footer,
.theme-dark .sidebar-brand {
    border-color: #25324d;
}

.theme-dark .text-bg-primary {
    background-color: #3b6dff !important;
}

.theme-dark .text-bg-secondary {
    background-color: #2e3b5e !important;
    color: #cbd8f5 !important;
}

.theme-dark .alert-success {
    background-color: #112d23;
    border-color: #1b523e;
    color: #7ef7cc;
}

.theme-dark .alert-danger {
    background-color: #341a1a;
    border-color: #5d2b2b;
    color: #fca5a5;
}

.theme-dark .soft-table thead th {
    background: #1a263e !important;
    color: #c9d6f1 !important;
    border-bottom-color: #2a3a5b !important;
}

.theme-dark .soft-table tbody td {
    color: #d7e1f9 !important;
    background-color: transparent !important;
}

.theme-dark .table,
.theme-dark .table > :not(caption) > * > * {
    background-color: transparent !important;
    color: #d4ddf4 !important;
    border-color: #25324d !important;
    --bs-table-bg: transparent !important;
    --bs-table-accent-bg: transparent !important;
    --bs-table-striped-bg: transparent !important;
    --bs-table-active-bg: transparent !important;
}

.theme-dark .table-hover > tbody > tr:hover > * {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: #fff !important;
}

.theme-dark tr, .theme-dark td, .theme-dark th {
    background-color: transparent;
}

.theme-dark .form-control,
.theme-dark .form-select {
    background: #111a2d;
    border-color: #2a3b5d;
    color: #d6e2ff;
}

.theme-dark .form-control:focus,
.theme-dark .form-select:focus {
    border-color: #4f7bff;
    box-shadow: 0 0 0 0.25rem rgba(79, 123, 255, 0.25);
    background: #111a2d;
    color: #e8efff;
}

.theme-dark .login-form-card {
    background: rgba(20, 30, 50, 0.9);
    border-color: #2c3b5b;
}

.theme-dark .login-form-panel h4,
.theme-dark .login-form-panel .text-muted {
    color: #e5ecff !important;
}

.theme-dark .account-hint {
    background: #0f1a2e;
    border-color: #2b3b5e;
    color: #d9e5ff;
}

.theme-dark .landing-chip {
    border-color: #39508a;
    color: #b2c6ff;
    background: #1a2742;
}

.theme-dark .route-track {
    background: #0f1729;
    border-color: #25324d;
}

.theme-dark .route-track-line {
    background: #2a4068;
}

.theme-dark .floating-metric {
    background: rgba(8, 14, 28, 0.9);
}

@media (max-width: 992px) {
    .landing-menu {
        display: none;
    }

    .landing-hero {
        grid-template-columns: 1fr;
        padding: 24px;
    }

    .landing-title {
        font-size: 34px;
    }

    .landing-subtitle {
        font-size: 16px;
    }

    .login-form-card {
        max-width: 100%;
    }

    .landing-v2-hero {
        grid-template-columns: 1fr;
    }

    .landing-v2-left h1 {
        font-size: 34px;
    }

    .landing-lead {
        font-size: 15px;
    }

    .landing-v2-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-sidebar {
        width: 72px;
        min-width: 72px;
        padding: 12px 8px;
    }

    .app-sidebar .brand-title,
    .app-sidebar .sidebar-brand small,
    .app-sidebar .user-box,
    .app-sidebar .menu-link span {
        display: none;
    }

    .sidebar-brand {
        justify-content: center;
    }

    .menu-list {
        gap: 6px;
    }

    .menu-link {
        justify-content: center;
        padding: 10px 8px;
        font-size: 18px;
    }

    .menu-link i {
        margin: 0 !important;
    }

    .topbar {
        padding: 12px;
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar-actions {
        width: 100%;
        justify-content: space-between;
    }

    .topbar h6 {
        font-size: 14px;
    }

    .content-area {
        padding: 12px;
    }

    .panel {
        border-radius: 12px;
    }

    .panel-body {
        padding: 12px;
    }

    .landing-wrapper {
        padding: 10px 12px 20px;
    }

    .landing-nav {
        height: auto;
        min-height: 58px;
        padding: 10px 12px;
        gap: 8px;
    }

    .landing-brand {
        font-size: 13px;
    }

    .landing-auth .btn {
        font-size: 12px;
        padding: 6px 10px;
    }

    .landing-hero {
        margin-top: 14px;
        padding: 16px;
        gap: 14px;
    }

    .landing-title {
        font-size: 28px;
        line-height: 1.15;
    }

    .landing-subtitle {
        font-size: 14px;
        margin-bottom: 14px;
    }

    .landing-points {
        font-size: 13px;
        gap: 10px;
    }

    .landing-image-box img {
        max-height: 250px;
    }

    .landing-v2 {
        padding: 10px 12px 20px;
    }

    .landing-v2-nav {
        padding: 10px;
    }

    .landing-v2-brand strong {
        font-size: 13px;
    }

    .landing-v2-brand small {
        font-size: 11px;
    }

    .landing-v2-actions .btn {
        font-size: 12px;
        padding: 5px 10px;
    }

    .landing-v2-hero {
        margin-top: 12px;
        padding: 14px;
    }

    .landing-v2-left h1 {
        font-size: 26px;
    }

    .floating-metric strong {
        font-size: 15px;
    }

    .login-shell {
        min-height: calc(100vh - 2rem);
        border-radius: 12px;
    }

    .login-form-card {
        margin: 12px;
        border-radius: 14px;
    }

    .login-form-panel {
        padding: 20px 16px;
    }

    .login-form-panel h4 {
        font-size: 20px;
    }

    .app-footer {
        padding: 10px 12px;
        font-size: 12px;
    }

    .theme-toggle {
        font-size: 12px;
        padding: 5px 8px;
    }
}
