:root {
    --app-bg: #f3f6fb;
    --panel-bg: #ffffff;
    --panel-border: #e7edf5;
    --text-main: #172033;
    --text-muted: #667085;
    --brand: #176bff;
    --brand-soft: #edf4ff;
    --warning-soft: #fff7df;
    --danger-soft: #fff0f0;
    --success-soft: #ecfdf3;
    --shadow-soft: 0 10px 28px rgba(15, 23, 42, .06);
    --shadow-card: 0 2px 10px rgba(15, 23, 42, .055);
    --radius-lg: 18px;
    --radius-md: 14px;
}

/* Unified workflow hubs */
.workspace-tabs {
    display: flex;
    gap: 6px;
    margin: 0 0 18px;
    padding: 5px;
    overflow-x: auto;
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-lg);
    background: #fff;
}
.workspace-tabs a,
.workspace-tabs button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    padding: 7px 13px;
    border-radius: var(--radius-md);
    color: #526276;
    font-size: var(--type-small, 12px);
    font-weight: 650;
    text-decoration: none;
    white-space: nowrap;
    appearance: none;
    border: 0;
    background: transparent;
}
.workspace-tabs a:hover,
.workspace-tabs button:hover { color: var(--brand); background: var(--brand-soft); }
.workspace-tabs a.active,
.workspace-tabs button.active { color: #fff; background: var(--brand); }
.workspace-tabs a span {
    min-width: 20px;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(13, 110, 253, .1);
    color: inherit;
    text-align: center;
}
.workspace-tabs a.active span,
.workspace-tabs button.active span { background: rgba(255, 255, 255, .22); }
.todo-hub-card { color: inherit; transition: border-color .16s ease, transform .16s ease; }
.todo-hub-card:hover { border-color: #afc8ef; transform: translateY(-1px); }
.todo-filter-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 18px;
}
.todo-filter-field {
    display: flex;
    min-width: 150px;
    flex-direction: column;
}
.todo-filter-field .form-label { display: block; }
.todo-filter-check {
    display: flex;
    min-height: 36px;
    align-items: center;
    margin: 0;
}
.todo-timing-filter { min-width: 180px; }
.todo-timing-filter .form-select {
    width: 100%;
    padding-right: 2.25rem;
}
.todo-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.process-steps {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-lg);
    background: #fff;
    list-style: none;
}
.process-steps li {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 52px;
    padding: 10px 13px;
    border-right: 1px solid var(--panel-border);
    color: var(--text-muted);
}
.process-steps li:last-child { border-right: 0; }
.process-steps li span {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 50%;
    background: #edf1f6;
    font-size: 11px;
}
.process-steps li strong { font-size: var(--type-small, 12px); }
.process-steps li.active { color: var(--brand); background: var(--brand-soft); }
.process-steps li.active span { color: #fff; background: var(--brand); }
.process-steps li.is-active,
.process-steps li.is-complete { color: var(--brand); background: var(--brand-soft); }
.process-steps li.is-active span,
.process-steps li.is-complete span { color: #fff; background: var(--brand); }
.process-steps li div { display: grid; gap: 2px; }
.process-steps li small { color: var(--muted); font-size: 11px; }

.workspace-tabs .workspace-tab { display: inline-flex; align-items: center; gap: 4px; }
.workspace-tabs-subtle { background: transparent; border: 0; padding: 0; box-shadow: none; }
.workspace-tabs-subtle .workspace-tab { background: var(--panel-bg); border: 1px solid var(--panel-border); color: var(--muted); }

.page-tab-count {
    min-width: 20px;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(13, 110, 253, .1);
    font-size: 11px;
    text-align: center;
}

.inventory-item-link {
    color: inherit;
    text-decoration: none;
}

.inventory-item-link:hover,
.inventory-item-link:focus-visible {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 0.18em;
}
.page-tab.active .page-tab-count { background: rgba(255, 255, 255, .22); }
.inventory-status-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
}
.inventory-status-label {
    margin-right: 2px;
    color: var(--text-muted);
    font-size: var(--type-small, 12px);
    font-weight: 650;
}
.inventory-status-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 6px 11px;
    border: 1px solid var(--panel-border);
    border-radius: 999px;
    background: var(--panel-bg);
    color: var(--text-muted);
    font-size: var(--type-small, 12px);
    font-weight: 650;
    text-decoration: none;
}
.inventory-status-tab:hover { border-color: #afc8ef; color: var(--brand); background: var(--brand-soft); }
.inventory-status-tab.active { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.inventory-status-tab span {
    min-width: 20px;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(13, 110, 253, .1);
    text-align: center;
}

.workflow-section { padding: 24px 0; border-bottom: 1px solid var(--panel-border); }
.workflow-section:first-of-type { padding-top: 0; }
.workflow-section:last-child { border-bottom: 0; padding-bottom: 0; }
.workflow-section-heading { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 18px; }
.workflow-section-heading > span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 800; }
.workflow-section-heading h2 { margin: 0; font-size: 17px; }
.workflow-section-heading p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.workflow-section-ready { margin: 20px -20px -20px; padding: 20px; background: color-mix(in srgb, var(--brand-soft) 55%, transparent); border-radius: 12px; }
.preview-slot-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.preview-slot-grid span { padding: 7px 10px; border: 1px solid var(--panel-border); border-radius: 8px; background: var(--panel-bg); font-size: 12px; }

.todo-list { display: grid; gap: 10px; }
.todo-open-button { appearance: none; border: 0; padding: 0; background: transparent; color: inherit; }
.todo-open-button:hover strong { color: var(--brand); }
.todo-drawer { width: min(480px, 100vw) !important; }
.todo-tabs { overflow-x: auto; flex-wrap: nowrap; }

.detail-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.summary-card { padding: 16px; border: 1px solid var(--panel-border); border-radius: 12px; background: var(--panel-bg); box-shadow: var(--panel-shadow); }
.summary-card span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.summary-card strong { font-size: 18px; }
.detail-list { display: grid; gap: 0; }
.detail-list > div { display: flex; justify-content: space-between; gap: 18px; padding: 10px 0; border-bottom: 1px solid var(--panel-border); }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list span { color: var(--muted); }

.schedule-day-cell.is-conflict { background: #fff0f0 !important; box-shadow: inset 0 0 0 2px #dc3545; }
.schedule-cell-button { min-width: 44px; height: 32px; padding: 0 .45rem; border: 0; border-radius: 8px; background: transparent; color: inherit; font-weight: 800; white-space: nowrap; }
.schedule-cell-button::after { display: none; }
.schedule-cell-menu { min-width: 280px; max-width: 360px; }

@media (max-width: 767.98px) {
    .detail-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .workflow-section-ready { margin-inline: -12px; }
}
@media (max-width: 767.98px) {
    .process-steps { grid-template-columns: 1fr; }
    .process-steps li { min-height: 42px; border-right: 0; border-bottom: 1px solid var(--panel-border); }
    .process-steps li:last-child { border-bottom: 0; }
}

/* P1 vehicle day calendar */
.schedule-calendar-table { width: 100%; min-width: 980px; table-layout: fixed; }
.schedule-calendar-table th,
.schedule-calendar-table td { border-color: var(--panel-border); padding: .45rem .25rem; text-align: center; }
.schedule-calendar-table .schedule-sticky-vehicle {
    position: sticky; left: 0; z-index: 3; width: 160px; min-width: 160px;
    text-align: left; background: var(--panel-bg); box-shadow: 1px 0 0 var(--panel-border);
}
.schedule-calendar-table thead .schedule-sticky-vehicle { z-index: 5; background: var(--app-bg); }
.schedule-day-heading { width: 38px; min-width: 38px; font-variant-numeric: tabular-nums; }
.schedule-day-heading span,
.schedule-day-heading small { display: block; }
.schedule-day-heading small { color: var(--text-muted); font-size: .65rem; }
.schedule-day-heading.is-weekend { background: color-mix(in srgb, var(--brand) 5%, var(--app-bg)); }
.schedule-day-cell { height: 50px; background: var(--panel-bg); }
.schedule-day-cell > span,
.schedule-day-cell > a {
    display: inline-grid; width: 28px; height: 28px; place-items: center; border-radius: 8px;
    color: #fff; font-size: .75rem; font-weight: 700; text-decoration: none;
}
.schedule-day-cell.is-trip > a { background: #1769e0; }
.schedule-day-cell.is-repair > span { background: #d97706; }
.schedule-day-cell.is-disabled > span { background: #c2414b; }
.schedule-day-cell .schedule-available-dot {
    width: 7px; height: 7px; border-radius: 999px; background: #2f9e62;
}

html { min-height: 100%; }
body {
    min-height: 100%;
    background: var(--app-bg);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}

.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 2000;
    transform: translateY(-160%);
    padding: 10px 14px;
    border-radius: 8px;
    background: #fff;
    color: #0b5be7;
    font-weight: 800;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .24);
}
.skip-link:focus { transform: translateY(0); }

.navbar.app-topbar {
    min-height: 58px;
    background: linear-gradient(90deg, #176bff 0%, #0f63f6 55%, #0b5be7 100%);
    box-shadow: 0 8px 24px rgba(23, 107, 255, .18);
}
@media (min-width: 768px) {
    .navbar.app-topbar {
        position: sticky;
        top: 0;
        z-index: 1030;
    }
}
.navbar-brand {
    min-width: 0;
    max-width: 100%;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.2;
    white-space: normal;
    overflow-wrap: anywhere;
}
.topbar-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .14);
    color: #fff;
}
.topbar-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 5px 11px;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 999px;
    background: rgba(255, 255, 255, .94);
    color: #b42318;
    font-size: 13px;
    font-weight: 820;
    line-height: 1;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .12);
}
.topbar-logout:hover {
    background: #fff1f0;
    color: #912018;
}
.app-version-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    color: rgba(255, 255, 255, .9);
    font-size: 12px;
    font-weight: 750;
}
.user-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #7cffb2;
    box-shadow: 0 0 0 4px rgba(124, 255, 178, .16);
}

.app-shell { min-height: calc(100vh - 58px); }
.sidebar {
    background: rgba(255, 255, 255, .96);
    border-right: 1px solid var(--panel-border);
    box-shadow: 8px 0 24px rgba(15, 23, 42, .035);
}
.sidebar-shell {
    position: sticky;
    top: 74px;
    max-height: calc(100vh - 82px);
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.sidebar-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    padding: 0 4px 10px 0;
}
.sidebar-quick-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
    min-height: 42px;
    flex: 1 1 auto;
    padding: 9px 12px;
    border-radius: 12px;
    background: var(--brand);
    color: #fff;
    font-size: 14px;
    font-weight: 750;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(23, 107, 255, .2);
}
.sidebar-quick-action:hover,
.sidebar-quick-action.active {
    background: #0b5be7;
    color: #fff;
}
.sidebar-inner {
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    padding-right: 4px;
}
.sidebar-inner::-webkit-scrollbar { width: 5px; }
.sidebar-inner::-webkit-scrollbar-thumb {
    background: #d4dceb;
    border-radius: 999px;
}
.nav-section { margin-bottom: 5px; }
.nav-section-title {
    min-height: 34px;
    padding: 7px 10px;
    color: #98a2b3;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
details.nav-section .nav-section-title {
    cursor: pointer;
    list-style: none;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-section-title > span:first-child { margin-right: auto; }
.nav-section-count {
    min-width: 20px;
    height: 20px;
    margin-left: 8px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #fff0f0;
    color: #b42318;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
}
details.nav-section[open] .nav-section-count { display: none !important; }
details.nav-section .nav-section-title::-webkit-details-marker {
    display: none;
}
details.nav-section .nav-section-title::after {
    content: "▾";
    font-size: 12px;
    color: #98a2b3;
    transform: rotate(-90deg);
    transition: transform .16s ease;
    margin-left: 8px;
}
details.nav-section[open] .nav-section-title::after {
    transform: rotate(0deg);
}
.sidebar .nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 48px;
    color: #344054;
    border-radius: 12px;
    margin-bottom: 2px;
    padding: 9px 10px;
    font-size: 13px;
    font-weight: 650;
    transition: all .16s ease;
}
.sidebar .nav-link:hover {
    background: #f5f8ff;
    color: #145fff;
    transform: translateX(1px);
}
.sidebar .nav-link.active {
    background: linear-gradient(90deg, #eaf2ff 0%, #f6f9ff 100%);
    color: #145fff;
    box-shadow: inset 3px 0 0 var(--brand);
}
.nav-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
}
.nav-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nav-count {
    min-width: 22px;
    height: 22px;
    margin-left: auto;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #fff0f0;
    color: #b42318;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}
.nav-link.active .nav-count {
    background: #fff;
    color: #b42318;
}
.logout-link {
    color: #b42318 !important;
}
.mobile-nav {
    display: none;
}
.optional-attachment-panel {
    border-top: 1px solid #e4e7ec;
    padding-top: 14px;
}
.optional-attachment-panel > summary {
    display: flex;
    min-height: 46px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
    color: #344054;
    cursor: pointer;
    font-weight: 800;
    list-style: none;
}
.optional-attachment-panel > summary::-webkit-details-marker { display: none; }
.optional-attachment-panel > summary::after {
    content: "+";
    color: var(--brand);
    font-size: 22px;
    line-height: 1;
}
.optional-attachment-panel[open] > summary {
    margin-bottom: 8px;
}
.optional-attachment-panel[open] > summary::after { content: "−"; }
.optional-attachment-panel:not([open]) > :not(summary) { display: none !important; }
.optional-form-panel {
    border: 1px solid #e4e7ec;
    border-radius: 14px;
    background: #f8fafc;
    padding: 0 14px 14px;
}
.optional-form-panel > summary,
.responsive-disclosure > summary,
.responsive-filter-panel > summary {
    cursor: pointer;
    font-weight: 800;
    list-style: none;
}
.optional-form-panel > summary {
    display: flex;
    min-height: 50px;
    align-items: center;
    justify-content: space-between;
}
.optional-form-panel > summary::-webkit-details-marker,
.responsive-disclosure > summary::-webkit-details-marker,
.responsive-filter-panel > summary::-webkit-details-marker { display: none; }
.optional-form-panel > summary::after {
    content: "+";
    color: var(--brand);
    font-size: 22px;
}
.optional-form-panel[open] > summary::after { content: "−"; }
.optional-form-panel:not([open]) > :not(summary) { display: none !important; }
.responsive-filter-panel > summary { display: none; }
.responsive-disclosure > summary {
    display: flex;
    min-height: 58px;
    align-items: center;
    padding: 0 22px;
    border-bottom: 1px solid #eef2f7;
    color: #172033;
    cursor: default;
    font-size: 18px;
}
.responsive-filter-panel:not([open]) > .card-body,
.responsive-disclosure:not([open]) > .card-body { display: block; }
.driver-language-form {
    padding: 10px 12px;
    border-top: 1px solid #eef2f7;
}
.driver-language-form label {
    display: block;
    margin-bottom: 6px;
    color: #667085;
    font-size: 12px;
    font-weight: 800;
}
.driver-language-form .form-select {
    min-height: 40px;
    font-weight: 700;
}
.login-language-form {
    text-align: start;
}
[dir="rtl"] .sidebar {
    border-right: 0;
    border-left: 1px solid var(--panel-border);
    box-shadow: -8px 0 24px rgba(15, 23, 42, .035);
}
[dir="rtl"] .sidebar-inner { padding-right: 0; padding-left: 4px; }
[dir="rtl"] .sidebar .nav-link:hover { transform: translateX(-1px); }
[dir="rtl"] input[type="date"],
[dir="rtl"] input[type="datetime-local"],
[dir="rtl"] input[inputmode="decimal"],
[dir="rtl"] .numeric-ltr { direction: ltr; text-align: left; }
[dir="rtl"] .table { direction: rtl; text-align: right; }

.content-wrap {
    padding: 28px;
}
.content-wrap > *:last-child { margin-bottom: 0; }

.page-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}
.page-eyebrow {
    color: var(--brand);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    margin-bottom: 4px;
}
.page-title {
    margin: 0;
    font-size: 27px;
    line-height: 1.25;
    font-weight: 850;
    letter-spacing: -.03em;
}
.page-subtitle {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 14px;
}
.page-actions,
.header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.dashboard-page-header {
    display: grid;
    grid-template-columns: auto minmax(360px, 1fr) auto;
    align-items: center;
    padding: 18px 20px;
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, .82);
    box-shadow: var(--shadow-card);
}
.dashboard-title-block {
    min-width: 150px;
}
.dashboard-header-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    min-width: 0;
}
.dashboard-header-meta-item {
    min-width: 0;
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--brand-soft);
}
.dashboard-header-meta-item span,
.dashboard-header-meta-item strong {
    display: block;
}
.dashboard-header-meta-item span {
    margin-bottom: 2px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}
.dashboard-header-meta-item strong {
    overflow: hidden;
    color: var(--text-main);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.page-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: -6px 0 20px;
    padding: 6px;
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, .76);
    box-shadow: var(--shadow-card);
}
.page-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 10px;
    color: #475467;
    font-weight: 750;
    text-decoration: none;
}
.page-tab:hover {
    color: var(--brand);
    background: #f5f8ff;
}
.page-tab.active {
    color: #fff;
    background: var(--brand);
    box-shadow: 0 8px 16px rgba(23, 107, 255, .16);
}
.content-wrap > h1.h3,
.content-wrap > .d-flex:first-child h1.h3 {
    font-size: 27px;
    line-height: 1.25;
    font-weight: 850;
    letter-spacing: -.03em;
}
.content-wrap > .d-flex:first-child {
    margin-bottom: 20px !important;
}

.card,
.stat-card,
.table-card {
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    background: var(--panel-bg);
}
.card-body { padding: 22px; }
.table-card { overflow: hidden; }
.filter-card {
    background: rgba(255, 255, 255, .9);
    box-shadow: var(--shadow-soft);
}
.section-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin: 24px 0 12px;
}
.section-title {
    margin: 0;
    font-size: 22px;
    font-weight: 820;
    letter-spacing: -.02em;
}
.section-subtitle {
    color: var(--text-muted);
    font-size: 14px;
}

.metric-card {
    position: relative;
    height: 100%;
    overflow: hidden;
}
.metric-card::after {
    content: "";
    position: absolute;
    inset: auto -28px -36px auto;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: rgba(23, 107, 255, .08);
}
.metric-label {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 700;
}
.metric-value {
    margin-top: 8px;
    font-size: 34px;
    line-height: 1;
    font-weight: 850;
    letter-spacing: -.03em;
}
.metric-unit {
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 13px;
}
.metric-card.is-warning::after { background: rgba(245, 158, 11, .16); }
.metric-card.is-danger::after { background: rgba(220, 38, 38, .12); }
.metric-card.is-success::after { background: rgba(22, 163, 74, .12); }
.stat-card .fs-2,
.stat-card .fs-3,
.stat-card .fs-5 {
    letter-spacing: -.03em;
    color: #172033;
}
.stat-card .text-muted:first-child {
    font-weight: 700;
}

.insight-banner {
    border: 1px solid #a8e7f0;
    border-radius: var(--radius-lg);
    background: linear-gradient(90deg, #dffbff 0%, #effdff 100%);
    color: #155e75;
    padding: 16px 18px;
    box-shadow: var(--shadow-card);
}
.finance-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 18px;
    align-items: center;
}
.finance-donut {
    position: relative;
    width: 132px;
    aspect-ratio: 1;
    border-radius: 50%;
    background:
        conic-gradient(#16a34a 0 var(--profit-rate), #38bdf8 var(--profit-rate) 100%);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .04);
}
.finance-donut::after {
    content: "";
    position: absolute;
    inset: 18px;
    border-radius: 50%;
    background: #fff;
}
.finance-donut-center {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: grid;
    place-items: center;
    text-align: center;
    font-weight: 850;
    color: #166534;
}
.finance-legend {
    display: grid;
    gap: 8px;
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 13px;
}
.finance-legend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.finance-legend-item::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--legend-color);
    flex: 0 0 auto;
}
.finance-legend-item span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
}
.report-methodology {
    margin-top: 24px;
    padding: 18px;
    border: 1px solid #d8e3f2;
    border-radius: var(--radius-md);
    background: #f8fafc;
    color: #344054;
}
.report-methodology-title {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 820;
}
details.report-methodology {
    padding: 0;
}
.report-methodology-summary {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    cursor: pointer;
    list-style: none;
}
.report-methodology-summary::-webkit-details-marker {
    display: none;
}
.report-methodology-summary::after {
    content: "展开";
    margin-left: auto;
    color: var(--brand);
    font-size: 13px;
    font-weight: 820;
    white-space: nowrap;
}
details.report-methodology[open] .report-methodology-summary::after {
    content: "收起";
}
.report-methodology-summary .report-methodology-title {
    margin: 0;
    flex: 0 0 auto;
}
.report-methodology-brief {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
}
details.report-methodology .report-methodology-grid {
    padding: 0 16px 16px;
}
.report-methodology-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
}
.report-methodology-item {
    line-height: 1.65;
    overflow-wrap: anywhere;
}
.report-methodology-item strong {
    color: #172033;
}
.action-card {
    height: 100%;
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-card);
    padding: 22px;
}
.action-card-title {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 820;
}
.task-list {
    display: grid;
    gap: 10px;
}
.task-list.task-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.task-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 13px;
    background: #f8fafc;
}
.task-item strong {
    font-size: 20px;
    line-height: 1;
}
.task-item.is-warning { background: var(--warning-soft); color: #8a4b00; }
.task-item.is-danger { background: var(--danger-soft); color: #9f1239; }
.task-item.is-success { background: var(--success-soft); color: #166534; }

.compact-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}
.compact-metric {
    padding: 14px;
    border-radius: 14px;
    background: #f8fafc;
}
.compact-metric .label {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
}
.compact-metric .value {
    margin-top: 6px;
    font-size: 22px;
    font-weight: 820;
}
.status-panel-list {
    display: grid;
    gap: 10px;
}
.status-panel-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #f8fafc;
}
.status-panel-item .label {
    color: var(--text-muted);
    font-weight: 750;
}
.status-panel-item .value {
    font-size: 22px;
    line-height: 1;
    font-weight: 850;
}
@media (max-width: 575.98px) {
    .finance-split {
        grid-template-columns: 1fr;
    }
    .finance-donut {
        margin: 0 auto;
    }
}
details.table-card summary {
    cursor: pointer;
    list-style: none;
}
details.table-card summary::-webkit-details-marker {
    display: none;
}
details.table-card summary::after {
    content: "展开";
    float: right;
    color: var(--brand);
    font-size: 13px;
    font-weight: 800;
}
details.table-card[open] summary::after {
    content: "收起";
}

.empty-state,
.table .text-muted.py-3 {
    color: #98a2b3 !important;
}
.table {
    --bs-table-bg: transparent;
    margin-bottom: 0;
}
.table > :not(caption) > * > * {
    padding: .68rem .65rem;
    border-bottom-color: #edf1f7;
}
.table thead th {
    color: #475467;
    font-size: 12px;
    background: #f8fafc;
    border-bottom: 1px solid #e7edf5;
    white-space: nowrap;
}
.table tbody {
    font-size: 14px;
    line-height: 1.45;
}
.table .btn {
    white-space: nowrap;
}
.table tbody tr:hover > * {
    background: #fbfdff;
}

.btn {
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
}
.btn-sm {
    font-size: 13px;
}
.btn-primary {
    background: var(--brand);
    border-color: var(--brand);
    box-shadow: 0 8px 16px rgba(23, 107, 255, .16);
}
.btn-outline-primary {
    border-color: #8eb8ff;
}
.form-control,
.form-select {
    border-radius: 11px;
    border-color: #d7dfeb;
    min-height: 42px;
}
.form-control:focus,
.form-select:focus {
    border-color: #8eb8ff;
    box-shadow: 0 0 0 .2rem rgba(23, 107, 255, .12);
}
.form-label {
    color: #344054;
    font-weight: 750;
}
.form-error-summary:focus {
    outline: 3px solid rgba(220, 53, 69, .25);
    outline-offset: 2px;
}
[aria-invalid="true"] {
    border-color: #dc3545;
}
input,
select,
textarea {
    scroll-margin-top: 24px;
}
.alert {
    border-radius: 14px;
    border-width: 1px;
}

.mobile-form .form-label { font-weight: 800; }
.mobile-form .btn { min-height: 52px; }
.required-mark { color: #dc3545; margin-left: 2px; }
.mobile-record-list { display: none; }
.mobile-record-card .record-title {
    color: #101828;
    font-size: 16px;
    font-weight: 850;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.mobile-record-card .record-subtitle {
    color: #667085;
    font-size: 13px;
    line-height: 1.45;
}
.mobile-record-card .record-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
    margin-top: 12px;
}
.mobile-record-card .record-label {
    color: #667085;
    font-size: 12px;
    font-weight: 750;
}
.mobile-record-card .record-value {
    color: #1d2939;
    font-size: 14px;
    font-weight: 760;
    line-height: 1.4;
    overflow-wrap: anywhere;
}
.mobile-record-card .record-actions {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}
.review-queue-people {
    margin-top: 10px;
    color: #667085;
    font-size: 14px;
    overflow-wrap: anywhere;
}
.review-key-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
}
.review-key-metrics > div {
    min-width: 0;
    padding: 10px;
    border-radius: 12px;
    background: #f8fafc;
}
.review-key-metrics .record-value {
    font-size: 14px;
    overflow-wrap: anywhere;
}
.mobile-record-card .grid-span-full {
    grid-column: 1 / -1;
}
.table > tbody > tr.reminder-overdue > * { background-color: #f8d7da; color: #842029; }
.table > tbody > tr.reminder-urgent > * { background-color: #ffe0b2; color: #7c3e00; }
.table > tbody > tr.reminder-upcoming > * { background-color: #fff3cd; color: #664d03; }
.exception-normal { color: #198754; }
.exception-single { color: #b45309; }
.exception-multiple { color: #dc3545; font-weight: 800; }
.table > tbody > tr.stock-low > * { background-color: #fff3cd; color: #664d03; }
.table > tbody > tr.stock-out > * { background-color: #f8d7da; color: #842029; }

@media (max-width: 991.98px) {
    .content-wrap { padding: 20px; }
    .page-title { font-size: 26px; }
    .metric-value { font-size: 30px; }
    .dashboard-page-header {
        grid-template-columns: 1fr auto;
    }
    .dashboard-header-meta {
        grid-column: 1 / -1;
        grid-row: 2;
    }
}
@media (max-width: 767.98px) {
    .container-fluid.app-shell > .row.app-shell { min-height: 0; }
    [dir="rtl"] .container-fluid.app-shell > .row.app-shell { direction: ltr; }
    [dir="rtl"] .container-fluid.app-shell > .row.app-shell > * { direction: rtl; }
    .app-topbar .container-fluid {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
        gap: 8px;
        padding-top: 10px;
        padding-bottom: 10px;
    }
    .app-topbar .navbar-brand {
        width: 100%;
        margin: 0;
        font-size: 16px;
    }
    .app-topbar .container-fluid > .d-flex {
        min-width: 0;
        width: 100%;
        justify-content: flex-end;
    }
    .content-wrap { padding: 14px; padding-bottom: 88px; }
    .dashboard-page-header {
        grid-template-columns: 1fr;
        padding: 16px;
    }
    .dashboard-header-meta,
    .dashboard-page-header .page-actions {
        grid-column: 1;
    }
    .dashboard-header-meta {
        grid-template-columns: 1fr;
    }
    .dashboard-page-header .page-actions {
        width: 100%;
    }
    .mobile-record-list { display: grid; gap: 12px; }
    .mobile-table-hidden { display: none !important; }
    .mobile-record-card .btn,
    .mobile-record-card button,
    .page-actions .btn { min-height: 44px; }
    .mobile-form { padding-bottom: 84px; }
    .sidebar {
        border-right: 0;
        border-bottom: 1px solid var(--panel-border);
        box-shadow: none;
    }
    .sidebar-shell {
        position: static;
        max-height: none;
        display: block;
    }
    .sidebar-toolbar { display: none; }
    .sidebar-inner {
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }
    .desktop-nav { display: none !important; }
    .mobile-nav {
        display: grid;
        gap: 12px;
    }
    .mobile-nav-primary,
    .mobile-nav-more-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }
    .mobile-driver-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .mobile-nav .nav-link {
        justify-content: center;
        min-height: 46px;
        margin-bottom: 0;
        padding: 9px 10px;
        border-radius: 13px;
        background: #f8fafc;
        text-align: center;
        line-height: 1.3;
        white-space: normal;
        overflow-wrap: anywhere;
        box-shadow: none;
    }
    .mobile-nav .nav-link:hover {
        transform: none;
    }
    .mobile-nav .nav-link.active {
        background: var(--brand);
        color: #fff;
        box-shadow: 0 8px 16px rgba(23, 107, 255, .16);
    }
    .mobile-nav-more {
        padding-top: 2px;
        border-top: 1px solid #eef2f7;
    }
    .mobile-nav-more-toggle {
        display: inline-flex;
        min-height: 38px;
        align-items: center;
        color: #667085;
        cursor: pointer;
        font-weight: 800;
        list-style: none;
        user-select: none;
    }
    .mobile-nav-more-toggle::-webkit-details-marker {
        display: none;
    }
    .mobile-nav-more-toggle::after {
        content: "+";
        margin-left: 6px;
        color: #98a2b3;
        font-weight: 900;
    }
    .mobile-nav-current {
        margin-left: 6px;
        color: #415269;
        font-weight: 700;
    }
    .mobile-nav-more[open] .mobile-nav-more-toggle::after {
        content: "-";
    }
    .mobile-nav-more-grid {
        margin-top: 8px;
    }
    .mobile-nav .logout-link {
        justify-content: center;
        width: 100% !important;
        min-height: 46px;
        padding: 10px 12px;
        border: 1px solid #fecdca !important;
        background: #fff1f0;
        color: #667085 !important;
        font-weight: 820;
    }
    .mobile-nav .logout-link,
    .mobile-nav .logout-link:hover {
        color: #b42318 !important;
    }
    .mobile-nav .logout-link:hover {
        background: #fee4e2;
    }
    .mobile-utility-panel {
        border-top: 1px solid #eef2f7;
        padding-top: 2px;
    }
    .mobile-utility-panel > summary {
        display: flex;
        min-height: 38px;
        align-items: center;
        justify-content: space-between;
        color: #667085;
        cursor: pointer;
        font-weight: 800;
        list-style: none;
    }
    .mobile-utility-panel > summary::-webkit-details-marker { display: none; }
    .mobile-utility-panel > summary::after {
        content: "+";
        color: #98a2b3;
        font-size: 20px;
    }
    .mobile-utility-panel[open] > summary::after { content: "−"; }
    .mobile-utility-panel:not([open]) > :not(summary) { display: none !important; }
    .mobile-utility-panel .driver-language-form { padding: 8px 0 12px; }
    .mobile-logout-form {
        margin: 0;
    }
    .nav-dot { display: none; }
    .mobile-sticky-submit {
        position: sticky;
        grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr);
        bottom: 0;
        z-index: 20;
        margin-top: 18px;
        margin-right: -12px;
        margin-left: -12px;
        padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
        box-sizing: border-box;
        border-top: 1px solid var(--panel-border);
        background: rgba(255, 255, 255, .97);
        box-shadow: 0 -8px 20px rgba(15, 23, 42, .08);
        backdrop-filter: blur(8px);
    }
    .mobile-form {
        padding-bottom: calc(96px + env(safe-area-inset-bottom));
    }
    .mobile-form:has(input:focus, textarea:focus, select:focus) .mobile-sticky-submit {
        position: static;
    }
    .filter-card .card-body > .d-flex {
        display: grid !important;
        grid-template-columns: 1fr;
        align-items: stretch !important;
        gap: 14px !important;
    }
    .filter-card .btn-group {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        width: 100%;
    }
    .filter-card .btn,
    .filter-card .form-control {
        min-height: 46px;
    }
    .filter-card .ms-md-auto {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
        gap: 8px !important;
    }
    .responsive-filter-panel > summary,
    .responsive-disclosure > summary {
        display: flex;
        min-height: 52px;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 0 18px;
        color: #344054;
        cursor: pointer;
    }
    .responsive-filter-panel > summary::after,
    .responsive-disclosure > summary::after {
        content: "+";
        flex: 0 0 auto;
        color: var(--brand);
        font-size: 22px;
        line-height: 1;
    }
    .responsive-filter-panel[open] > summary::after,
    .responsive-disclosure[open] > summary::after { content: "−"; }
    .responsive-filter-panel[open] > summary,
    .responsive-disclosure[open] > summary { border-bottom: 1px solid #eef2f7; }
    .responsive-filter-panel:not([open]) > .card-body,
    .responsive-disclosure:not([open]) > .card-body { display: none !important; }
    .responsive-filter-panel .filter-summary-hint {
        margin-left: auto;
        color: #98a2b3;
        font-size: 12px;
        font-weight: 650;
        text-align: right;
    }
    .card-body { padding: 18px; }
}
@media (max-width: 420px) {
    .mobile-nav-primary,
    .mobile-nav-more-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Full-system audit remediation: visible focus, compact role choices and
   mobile disclosures that stay inside the normal document flow. */
:where(
    a[href],
    button,
    input,
    select,
    textarea,
    summary,
    [tabindex]:not([tabindex="-1"])
):focus-visible {
    outline: 3px solid #0d6efd !important;
    outline-offset: 2px;
}

.role-checkbox-grid > div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
}

.role-checkbox-grid > div > div {
    min-width: 0;
}

.role-checkbox-grid label {
    display: flex;
    min-height: 44px;
    margin: 0;
    padding: 8px 10px;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    cursor: pointer;
}

.role-checkbox-grid input {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    margin: 0;
}

.schedule-mobile-disclosure > summary {
    list-style: none;
}

.schedule-mobile-disclosure > summary::-webkit-details-marker {
    display: none;
}

.schedule-mobile-disclosure > summary::after {
    margin-left: 4px;
    content: "＋";
}

.schedule-mobile-disclosure[open] > summary::after {
    content: "−";
}

.schedule-mobile-day:has(.schedule-mobile-disclosure[open]) {
    flex-basis: min(280px, calc(100vw - 72px));
    text-align: left;
}

.schedule-mobile-details {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--panel-border);
    overflow-wrap: anywhere;
    text-align: left;
}

.operation-log-details summary {
    color: var(--brand);
    cursor: pointer;
    font-weight: 700;
}

.operation-log-details td,
.operation-log-details th {
    min-width: 110px;
    white-space: normal;
    overflow-wrap: anywhere;
}

@media (max-width: 767.98px) {
    .role-checkbox-grid > div {
        grid-template-columns: 1fr;
    }

    .mobile-form.has-errors .mobile-sticky-submit {
        position: static;
    }

    .mobile-form .form-error-summary,
    .mobile-form .invalid-feedback,
    .mobile-form :invalid {
        scroll-margin-bottom: 132px;
    }
}

.operation-log-table {
    min-width: 980px;
}
.operation-log-table th:nth-child(1),
.operation-log-table td:nth-child(1) {
    width: 150px;
}
.operation-log-table th:nth-child(6),
.operation-log-table td:nth-child(6) {
    min-width: 300px;
}
.operation-log-description {
    overflow-wrap: anywhere;
    white-space: normal;
}
.operation-log-table details > summary {
    cursor: pointer;
    white-space: nowrap;
}

@media (pointer: coarse) {
    .btn,
    .page-link,
    .topbar-user,
    .topbar-logout,
    .mobile-nav-more-toggle,
    .driver-language-form .form-select,
    .login-language-form .form-select,
    input.form-control,
    select.form-select,
    textarea.form-control {
        min-height: 44px;
    }
    .btn-close {
        width: 44px;
        height: 44px;
        padding: 0;
        background-position: center;
    }
    .form-check-label {
        display: inline-flex;
        min-height: 44px;
        align-items: center;
    }

    .pagination-bar {
        align-items: stretch !important;
    }

    .pagination-bar > .d-flex,
    .pagination-bar nav,
    .pagination-bar .pagination {
        width: 100%;
    }

    .pagination-bar > .d-flex,
    .pagination-bar .pagination {
        justify-content: space-between;
    }

    .pagination-bar .page-item {
        display: flex;
        flex: 1 1 0;
    }

    .pagination-bar .page-link {
        align-items: center;
        display: flex;
        justify-content: center;
        width: 100%;
        white-space: nowrap;
    }

    .page-size-options {
        flex-wrap: wrap;
    }
}

/* 2026 professional operations shell */
.navbar.app-topbar {
    min-height: 60px;
    background: #06233f;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .08);
}
.app-topbar .container-fluid {
    min-height: 60px;
    justify-content: space-between;
}
.topbar-brand-group,
.topbar-actions,
.topbar-company,
.topbar-date,
.topbar-alert {
    display: inline-flex;
    align-items: center;
}
.topbar-brand-group {
    min-width: 0;
    gap: 24px;
}
.app-topbar .navbar-brand {
    margin: 0;
    color: #fff;
    font-size: 19px;
    font-weight: 800;
    letter-spacing: .01em;
}
.topbar-company {
    max-width: 320px;
    min-height: 36px;
    gap: 8px;
    padding: 7px 12px;
    border: 1px solid rgba(255, 255, 255, .32);
    border-radius: 6px;
    color: rgba(255, 255, 255, .92);
    font-size: 13px;
    font-weight: 700;
}
.topbar-company span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.topbar-actions { gap: 14px; }
.topbar-date {
    gap: 7px;
    color: rgba(255, 255, 255, .82);
    font-size: 13px;
    font-weight: 650;
}
.topbar-alert {
    position: relative;
    justify-content: center;
    width: 34px;
    height: 34px;
    color: rgba(255, 255, 255, .88);
    text-decoration: none;
}
.topbar-alert:hover { color: #fff; }
.topbar-alert-count {
    position: absolute;
    top: -2px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #06233f;
    border-radius: 999px;
    background: #c5221f;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
}
.app-version-badge {
    min-height: auto;
    padding: 0 14px;
    border: 0;
    border-right: 1px solid rgba(255, 255, 255, .18);
    border-left: 1px solid rgba(255, 255, 255, .18);
    border-radius: 0;
    background: transparent;
    color: rgba(255, 255, 255, .72);
}
.topbar-user {
    min-height: 34px;
    padding: 5px 0;
    background: transparent;
}
.topbar-logout {
    min-height: 34px;
    padding: 5px 0 5px 14px;
    border: 0;
    border-left: 1px solid rgba(255, 255, 255, .18);
    border-radius: 0;
    background: transparent;
    color: rgba(255, 255, 255, .78);
    box-shadow: none;
}
.topbar-logout:hover { background: transparent; color: #fff; }

.container-fluid.app-shell { padding: 0; }
.app-layout {
    display: flex;
    align-items: stretch;
    min-height: calc(100vh - 60px);
}
.sidebar {
    width: 232px;
    flex: 0 0 232px;
    min-width: 0;
    border-right: 1px solid rgba(255, 255, 255, .08);
    background: #072846;
    box-shadow: none;
    color: #d9e7f5;
}
.sidebar-shell {
    top: 72px;
    max-height: calc(100vh - 84px);
}
.sidebar-toolbar { padding: 0 0 12px; }
.sidebar-quick-action {
    width: 100%;
    min-height: 40px;
    border: 0;
    border-radius: 6px;
    background: #0d6efd;
    font-size: 13px;
    box-shadow: none;
}
.sidebar .dropdown-menu {
    padding: 6px;
    border: 1px solid #dce5ef;
    border-radius: 7px;
    box-shadow: 0 14px 36px rgba(6, 35, 63, .18);
}
.sidebar .dropdown-item {
    min-height: 38px;
    padding: 9px 10px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 650;
}
.nav-section { margin-bottom: 7px; }
.nav-section-title {
    min-height: 30px;
    padding: 6px 9px;
    color: #6f9ac1;
    font-size: 11px;
    letter-spacing: .06em;
}
details.nav-section .nav-section-title::after { color: #6f9ac1; }
.sidebar .nav-link {
    min-height: 40px;
    gap: 10px;
    margin-bottom: 2px;
    padding: 8px 10px;
    border-radius: 6px;
    color: #c4d5e6;
    font-size: 13px;
    font-weight: 650;
}
.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, .07);
    color: #fff;
    transform: none;
}
.sidebar .nav-link.active {
    background: #0d6efd;
    color: #fff;
    box-shadow: none;
}
.sidebar .nav-link.active .nav-count { background: #fff; }
.sidebar-inner::-webkit-scrollbar-thumb { background: rgba(165, 192, 217, .32); }
.sidebar-footer {
    flex: 0 0 auto;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, .1);
}
.sidebar-theme-toggle {
    width: 100%;
    min-height: 42px;
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 8px;
    padding: 8px 9px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #c4d5e6;
    text-align: left;
    font-size: 12px;
}
.sidebar-theme-toggle:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar-theme-toggle strong { font-size: 11px; font-weight: 650; }
.sidebar-theme-switch {
    width: 32px;
    height: 18px;
    padding: 2px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: #0d6efd;
    transition: background .18s ease;
}
.sidebar-theme-switch > span {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    transform: translateX(14px);
    transition: transform .18s ease;
}

html[data-sidebar-theme="light"] .sidebar {
    border-right-color: #dfe6ee;
    background: #fff;
    color: #25364a;
}
html[data-sidebar-theme="light"] .sidebar .nav-section-title,
html[data-sidebar-theme="light"] details.nav-section .nav-section-title::after { color: #596b82; }
html[data-sidebar-theme="light"] .sidebar .nav-link { color: #415269; }
html[data-sidebar-theme="light"] .sidebar .nav-link:hover { background: #f0f5fb; color: #0b5fc6; }
html[data-sidebar-theme="light"] .sidebar .nav-link.active { background: #eaf2ff; color: #0b5fc6; box-shadow: inset 3px 0 0 #0b5fc6; }
html[data-sidebar-theme="light"] .sidebar-footer { border-top-color: #e4eaf1; }
html[data-sidebar-theme="light"] .sidebar-theme-toggle { color: #526276; }
html[data-sidebar-theme="light"] .sidebar-theme-toggle:hover { background: #f0f5fb; color: #0d6efd; }
html[data-sidebar-theme="light"] .sidebar-theme-switch { background: #9aa9b9; }
html[data-sidebar-theme="light"] .sidebar-theme-switch > span { transform: translateX(0); }
html[data-sidebar-theme="light"] .sidebar-inner::-webkit-scrollbar-thumb { background: #c8d3df; }

.content-wrap {
    width: calc(100% - 232px);
    min-width: 0;
    flex: 1 1 auto;
    padding: 22px 24px 28px;
    background: #f6f8fb;
}
.content-wrap-full { width: 100%; }

@media (max-width: 991.98px) {
    .sidebar { width: 210px; flex-basis: 210px; }
    .content-wrap { width: calc(100% - 210px); padding: 20px; }
    .topbar-brand-group { gap: 12px; }
}
@media (max-width: 767.98px) {
    .app-layout { display: block; min-height: 0; }
    .app-topbar .container-fluid {
        min-height: 54px;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        padding-top: 8px;
        padding-bottom: 8px;
    }
    .topbar-brand-group { flex: 1 1 auto; min-width: 0; }
    .topbar-actions { flex: 0 0 auto; gap: 8px; }
    .app-topbar .navbar-brand {
        overflow: hidden;
        font-size: 16px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .topbar-user bdi { display: none; }
    .topbar-user {
        min-width: 44px;
        min-height: 44px;
        justify-content: center;
        padding: 0;
    }
    .sidebar {
        width: 100%;
        border-right: 0;
        border-bottom: 1px solid #dfe6ee;
        background: #fff !important;
        color: #25364a;
    }
    .content-wrap { width: 100%; padding: 14px 12px 88px; }
    .mobile-nav .nav-link { color: #415269; }
}

/* Management cockpit */
.dashboard-page-header {
    min-height: 92px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: -4px 0 0;
    padding: 8px 0 14px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.dashboard-title-block { min-width: 0; }
.dashboard-page-header .page-title {
    font-size: 23px;
    font-weight: 800;
    letter-spacing: 0;
}
.dashboard-header-meta {
    display: flex;
    grid-template-columns: none;
    gap: 8px;
    margin-top: 8px;
    color: #596b82;
    font-size: 13px;
}
.dashboard-header-meta strong { color: #596b82; font-weight: 600; }
.dashboard-primary-actions .btn {
    min-width: 132px;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-weight: 700;
}
.dashboard-primary-actions .btn-primary { background: #0d6efd; border-color: #0d6efd; }
.dashboard-empty-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
    padding: 11px 14px;
    border-color: #c9dcee;
    border-radius: 6px;
    background: #edf7ff;
    box-shadow: none;
    font-size: 13px;
}
.dashboard-empty-notice a { font-weight: 700; }
.dashboard-kpi-band {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-bottom: 14px;
    padding: 18px 10px;
    border: 1px solid #dfe6ee;
    border-radius: 7px;
    background: #fff;
}
.dashboard-kpi {
    min-width: 0;
    padding: 0 20px;
    border-right: 1px solid #e3e9f0;
}
.dashboard-kpi:last-child { border-right: 0; }
.dashboard-kpi > span {
    display: block;
    margin-bottom: 9px;
    color: #596b82;
    font-size: 13px;
    font-weight: 650;
}
.dashboard-kpi > strong {
    display: block;
    overflow: hidden;
    color: #11243d;
    font-size: clamp(21px, 1.75vw, 30px);
    font-weight: 780;
    letter-spacing: -.02em;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dashboard-kpi > strong small {
    margin-left: 5px;
    color: #596b82;
    font-size: 12px;
    font-weight: 650;
}
.dashboard-kpi p {
    margin: 9px 0 0;
    color: #596b82;
    font-size: 12px;
}
.dashboard-main-grid,
.dashboard-bottom-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(420px, 1fr);
    gap: 14px;
    margin-bottom: 14px;
}
.dashboard-bottom-grid { grid-template-columns: minmax(360px, .8fr) minmax(0, 1.2fr); }
.dashboard-utilization {
    display: flex;
    flex-direction: column;
}
.dashboard-panel {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #dfe6ee;
    border-radius: 7px;
    background: #fff;
}
.dashboard-panel-header {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 16px;
    border-bottom: 1px solid #e5ebf2;
}
.dashboard-panel-header h2 {
    margin: 0;
    color: #14263e;
    font-size: 17px;
    font-weight: 780;
}
.dashboard-panel-header h2 small {
    color: #596b82;
    font-size: 12px;
    font-weight: 600;
}
.dashboard-panel-header > a,
.dashboard-panel-footer a {
    color: #0d6efd;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}
.dashboard-trend-panel { min-height: 430px; }
.dashboard-trend-panel .dashboard-panel-header { align-items: flex-start; }
.dashboard-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 12px;
    color: #66788d;
    font-size: 11px;
}
.dashboard-legend span::before {
    content: "";
    width: 20px;
    height: 3px;
    display: inline-block;
    margin-right: 6px;
    border-radius: 2px;
    background: currentColor;
    vertical-align: middle;
}
.dashboard-legend .is-revenue { color: #0b5fc6; }
.dashboard-legend .is-cost { color: #0b7285; }
.dashboard-legend .is-profit { color: #356f18; }
.dashboard-period-form,
.dashboard-period-tabs { display: flex; align-items: center; }
.dashboard-period-form { gap: 8px; }
.dashboard-period-tabs {
    overflow: hidden;
    border: 1px solid #d7e0ea;
    border-radius: 5px;
}
.dashboard-period-tabs a {
    min-width: 38px;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #d7e0ea;
    color: #607086;
    font-size: 12px;
    text-decoration: none;
}
.dashboard-period-tabs a:last-child { border-right: 0; }
.dashboard-period-tabs a.active { background: #eaf2ff; color: #0b5fc6; font-weight: 750; }
.dashboard-period-form .form-control { width: 130px; min-height: 32px; padding: 4px 8px; border-radius: 5px; font-size: 12px; }
.dashboard-period-form .btn { min-height: 32px; padding: 4px 10px; border-radius: 5px; font-size: 12px; }
.dashboard-chart-wrap {
    position: relative;
    min-height: 270px;
    padding: 12px 14px 0;
}
.dashboard-chart-wrap canvas { display: block; }
.dashboard-chart-empty {
    position: absolute;
    inset: 45% 0 auto;
    color: #596b82;
    text-align: center;
    font-size: 12px;
}
.dashboard-trend-data {
    border-top: 1px solid #e5ebf2;
}
.dashboard-trend-data > summary {
    min-height: 42px;
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: var(--brand);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}
.dashboard-trend-data .table-responsive {
    max-height: 320px;
    border-top: 1px solid #e5ebf2;
}
.dashboard-trend-data caption {
    color: var(--text-muted);
    font-size: 12px;
}
.dashboard-trend-summary {
    min-height: 72px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: center;
    border-top: 1px solid #e5ebf2;
}
.dashboard-trend-summary > span {
    min-width: 0;
    padding: 8px 16px;
    border-right: 1px solid #e5ebf2;
}
.dashboard-trend-summary > span:last-child { border-right: 0; }
.dashboard-trend-summary small,
.dashboard-trend-summary strong,
.dashboard-trend-summary b { display: block; }
.dashboard-trend-summary small { color: #596b82; font-size: 11px; }
.dashboard-trend-summary strong { margin-top: 4px; color: #172a43; font-size: 17px; }
.dashboard-trend-summary b { color: #263b55; font-size: 13px; }
.dashboard-todo-header { display: block; padding-bottom: 0; }
.dashboard-todo-header nav {
    display: flex;
    gap: 24px;
    margin-top: 12px;
}
.dashboard-todo-header nav a {
    padding-bottom: 10px;
    border-bottom: 2px solid transparent;
    color: #68798f;
    font-size: 12px;
    font-weight: 650;
    text-decoration: none;
}
.dashboard-todo-header nav a.active { border-bottom-color: #0d6efd; color: #0d6efd; }
.dashboard-todo-row {
    min-height: 62px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto 46px;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid #e8edf3;
    color: #263a53;
    text-decoration: none;
}
.dashboard-todo-row:hover { background: #f8fbff; color: #0d6efd; }
.dashboard-todo-row > span:nth-child(2) { min-width: 0; }
.dashboard-todo-row > span:nth-child(2) strong,
.dashboard-todo-row > span:nth-child(2) small { display: block; }
.dashboard-todo-row > span:nth-child(2) strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-todo-row > span:nth-child(2) small { margin-top: 3px; overflow: hidden; color: #596b82; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-todo-row > b { color: #4a5d74; font-size: 11px; font-weight: 650; }
.dashboard-todo-row > em { color: #0d6efd; font-size: 11px; font-style: normal; text-align: right; }
.dashboard-priority {
    width: 26px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: #fff;
    font-size: 11px;
    font-weight: 750;
}
.dashboard-priority.high { background: #b42318; }
.dashboard-priority.medium { background: #a84606; }
.dashboard-priority.low { background: #5b6b7e; }
.dashboard-panel-footer {
    display: flex;
    gap: 18px;
    padding: 13px 16px;
}
.dashboard-list-empty { padding: 34px 16px; color: #596b82; text-align: center; font-size: 12px; }
.owner-system-dashboard {
    margin-bottom: 28px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--panel-border);
}
.owner-business-section-heading { margin-bottom: 4px; }
.dashboard-utilization-content {
    min-height: 215px;
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: 118px 124px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    padding: 18px 20px 20px;
}
.dashboard-utilization-ring {
    position: relative;
    width: 112px;
    height: 112px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: conic-gradient(#138ba4 0 var(--utilization-rate), #e7edf3 var(--utilization-rate) 100%);
}
.dashboard-utilization-ring::after { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: #fff; }
.dashboard-utilization-ring span { position: relative; z-index: 1; text-align: center; }
.dashboard-utilization-ring strong,
.dashboard-utilization-ring small { display: block; }
.dashboard-utilization-ring strong { color: #10243d; font-size: 21px; }
.dashboard-utilization-ring small { color: #596b82; font-size: 11px; }
.dashboard-utilization-facts { padding-left: 16px; border-left: 1px solid #e4eaf1; }
.dashboard-utilization-facts p,
.dashboard-utilization-bars p { margin: 0; }
.dashboard-utilization-facts p + p { margin-top: 12px; }
.dashboard-utilization-facts span,
.dashboard-utilization-facts strong { display: block; }
.dashboard-utilization-facts span { color: #596b82; font-size: 11px; }
.dashboard-utilization-facts strong { margin-top: 3px; color: #243950; font-size: 15px; }
.dashboard-utilization-bars { min-width: 0; display: grid; gap: 13px; }
.dashboard-utilization-bars p {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 5px 10px;
    color: #596b82;
    font-size: 11px;
}
.dashboard-utilization-bars p > span { grid-column: 1; grid-row: 1; }
.dashboard-utilization-bars p > strong { grid-column: 2; grid-row: 1; }
.dashboard-utilization-bars p > i { grid-column: 1 / -1; grid-row: 2; }
.dashboard-utilization-bars i { height: 6px; overflow: hidden; border-radius: 999px; background: #edf1f5; }
.dashboard-utilization-bars i b { height: 100%; display: block; border-radius: inherit; background: #168fa7; }
.dashboard-utilization-bars p:nth-child(2) i b { background: #f59e0b; }
.dashboard-utilization-bars p:nth-child(3) i b { background: #ef4444; }
.dashboard-utilization-bars strong { color: #43566d; text-align: right; }
.dashboard-table-scroll { overflow-x: auto; }
.dashboard-data-table { width: 100%; border-collapse: collapse; font-size: 11px; white-space: nowrap; }
.dashboard-data-table th { padding: 10px 12px; border-bottom: 1px solid #e5ebf2; color: #596b82; font-weight: 650; }
.dashboard-data-table td { padding: 11px 12px; border-bottom: 1px solid #edf1f5; color: #41546b; }
.dashboard-data-table tbody tr:last-child td { border-bottom: 0; }
.dashboard-data-table a { color: #0d6efd; font-weight: 650; text-decoration: none; }
.dashboard-status { display: inline-flex; padding: 3px 7px; border-radius: 4px; background: #fff4df; color: #b86a00; }
.dashboard-status.success { background: #e7f7ed; color: #168048; }
@media (max-width: 1399.98px) {
    .dashboard-main-grid { grid-template-columns: minmax(0, 1.15fr) minmax(390px, .85fr); }
    .dashboard-bottom-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1199.98px) {
    .dashboard-kpi-band { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0; }
    .dashboard-kpi { padding: 16px; border-bottom: 1px solid #e3e9f0; }
    .dashboard-kpi:nth-child(3) { border-right: 0; }
    .dashboard-kpi:nth-child(n+4) { border-bottom: 0; }
    .dashboard-main-grid { grid-template-columns: 1fr; }
}
@media (max-width: 767.98px) {
    .dashboard-page-header { min-height: auto; align-items: flex-start; margin: 0; padding: 4px 0 14px; }
    .dashboard-page-header .page-title { font-size: 21px; }
    .dashboard-primary-actions { width: auto !important; }
    .dashboard-primary-actions .btn { min-width: auto; min-height: 38px; padding: 7px 10px; font-size: 12px; }
    .dashboard-primary-actions .btn-outline-secondary { display: none; }
    .dashboard-kpi-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-kpi { min-height: 110px; border-right: 1px solid #e3e9f0; border-bottom: 1px solid #e3e9f0 !important; }
    .dashboard-kpi:nth-child(even) { border-right: 0; }
    .dashboard-kpi:last-child { grid-column: 1 / -1; min-height: 92px; border-bottom: 0 !important; }
    .dashboard-kpi > strong { font-size: 21px; }
    .dashboard-panel-header { align-items: flex-start; }
    .dashboard-trend-panel .dashboard-panel-header { display: block; }
    .dashboard-period-form { margin-top: 12px; flex-wrap: wrap; }
    .dashboard-period-form .form-control { flex: 1 1 130px; }
    .dashboard-chart-wrap { min-height: 240px; padding-inline: 6px; }
    .dashboard-trend-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-trend-summary > span:nth-child(2) { border-right: 0; }
    .dashboard-trend-summary > span:nth-child(-n+2) { border-bottom: 1px solid #e5ebf2; }
    .dashboard-todo-header nav { gap: 14px; overflow-x: auto; }
    .dashboard-todo-header nav a { flex: 0 0 auto; }
    .dashboard-todo-row { grid-template-columns: 30px minmax(0, 1fr) auto; padding-inline: 12px; }
    .dashboard-todo-row > em { display: none; }
    .dashboard-utilization-content { grid-template-columns: 112px 1fr; padding: 16px; }
    .dashboard-utilization-ring { width: 108px; height: 108px; }
    .dashboard-utilization-facts { padding-left: 14px; }
    .dashboard-utilization-bars { grid-column: 1 / -1; }
}
@media (max-width: 420px) {
    .dashboard-header-meta { display: block; }
    .dashboard-header-meta strong { display: block; margin-top: 2px; }
    .dashboard-kpi { padding: 14px 12px; }
    .dashboard-kpi > strong { font-size: 18px; }
    .dashboard-period-tabs { width: 100%; }
    .dashboard-period-tabs a { flex: 1 1 0; }
}

/* Typography scale: dense, consistent operations UI */
:root {
    --type-caption: 11px;
    --type-small: 12px;
    --type-body: 13px;
    --type-section: 15px;
    --type-title: 21px;
    --type-metric: 25px;
}
body {
    font-size: var(--type-body);
    line-height: 1.5;
}
.btn,
.form-control,
.form-select,
.dropdown-item {
    font-size: var(--type-body);
}
.btn,
.dropdown-item { font-weight: 600; }
.table { font-size: var(--type-small); }
.table th { font-size: var(--type-caption); font-weight: 600; }
.page-title,
.content-wrap > h1.h3,
.content-wrap > .d-flex:first-child h1.h3 {
    font-size: var(--type-title);
    font-weight: 700;
    letter-spacing: 0;
}
.section-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0;
}
.app-topbar .navbar-brand {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0;
}
.topbar-company,
.topbar-date,
.topbar-user,
.topbar-logout { font-size: var(--type-small); font-weight: 600; }
.topbar-company .nav-icon { width: 18px; height: 18px; }
.sidebar-quick-action {
    font-size: var(--type-small);
    font-weight: 600;
}
.nav-section-title {
    font-size: 11px;
    font-weight: 700;
}
.sidebar .nav-link {
    font-size: var(--type-small);
    font-weight: 600;
    line-height: 1.35;
}
.sidebar .nav-link .nav-icon { width: 18px; height: 18px; }
.nav-count,
.nav-section-count { font-size: 11px; font-weight: 700; }
.sidebar-theme-toggle { font-size: var(--type-caption); font-weight: 600; }
.dashboard-page-header .page-title {
    font-size: var(--type-title);
    font-weight: 700;
}
.dashboard-header-meta { font-size: var(--type-small); }
.dashboard-primary-actions .btn { font-size: var(--type-body); font-weight: 600; }
.dashboard-kpi > span {
    font-size: var(--type-small);
    font-weight: 600;
}
.dashboard-kpi > strong {
    font-size: var(--type-metric);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.dashboard-kpi > strong small,
.dashboard-kpi p { font-size: var(--type-small); font-weight: 500; }
.dashboard-panel-header h2 {
    font-size: var(--type-section);
    font-weight: 700;
    letter-spacing: 0;
}
.dashboard-panel-header h2 small { font-size: var(--type-caption); font-weight: 600; }
.dashboard-panel-header > a,
.dashboard-panel-footer a { font-size: var(--type-small); font-weight: 600; }
.dashboard-legend,
.dashboard-period-tabs a,
.dashboard-period-form .form-control,
.dashboard-period-form .btn { font-size: var(--type-small); }
.dashboard-trend-summary b { font-size: var(--type-small); font-weight: 600; }
.dashboard-trend-summary small { font-size: var(--type-caption); }
.dashboard-trend-summary strong {
    font-size: var(--type-section);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.dashboard-todo-header nav a { font-size: var(--type-small); font-weight: 600; }
.dashboard-todo-row > span:nth-child(2) strong {
    font-size: var(--type-small);
    font-weight: 600;
}
.dashboard-todo-row > span:nth-child(2) small,
.dashboard-todo-row > b,
.dashboard-todo-row > em { font-size: var(--type-caption); }
.dashboard-utilization-ring strong {
    font-size: 21px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.dashboard-utilization-facts span { font-size: var(--type-caption); }
.dashboard-utilization-bars p,
.dashboard-data-table { font-size: var(--type-small); }
.dashboard-utilization-facts strong { font-size: var(--type-body); font-weight: 700; }
.dashboard-utilization .dashboard-panel-header h2 {
    display: flex;
    align-items: baseline;
    gap: 9px;
}
.dashboard-data-table th { font-size: var(--type-caption); font-weight: 600; }
.dashboard-data-table td { font-size: var(--type-small); line-height: 1.45; }
.dashboard-status { font-size: var(--type-caption); }
.dashboard-data-table td,
.dashboard-kpi > strong,
.dashboard-trend-summary strong { font-variant-numeric: tabular-nums; }

@media (max-width: 767.98px) {
    .app-topbar .navbar-brand { font-size: var(--type-section); }
    .dashboard-page-header .page-title { font-size: 20px; }
    .dashboard-kpi > strong { font-size: 22px; }
    input.form-control,
    select.form-select { font-size: 16px; }
}

/* System-wide visual language aligned with the management cockpit */
:root {
    --app-bg: #f6f8fb;
    --panel-border: #dce4ed;
    --text-main: #10233f;
    --text-muted: #596b82;
    --brand: #0b5fc6;
    --brand-soft: #eaf2ff;
    --shadow-soft: 0 1px 2px rgba(6, 35, 63, .035);
    --shadow-card: none;
    --radius-lg: 7px;
    --radius-md: 6px;
}

.page-header {
    min-height: 72px;
    align-items: center;
    margin-bottom: 16px;
    padding: 6px 0 10px;
}
.page-eyebrow {
    margin-bottom: 3px;
    font-size: var(--type-small);
    font-weight: 600;
    letter-spacing: 0;
}
.page-title,
.content-wrap > h1.h3,
.content-wrap > .d-flex:first-child h1.h3 {
    color: var(--text-main);
    font-size: var(--type-title);
    font-weight: 700;
    line-height: 1.35;
}
.page-subtitle { margin-top: 4px; font-size: var(--type-small); }
.page-actions,
.header-actions { gap: 8px; }

.card,
.stat-card,
.table-card {
    border-color: var(--panel-border);
    border-radius: var(--radius-lg);
    box-shadow: none;
}
.card-body { padding: 18px; }
.filter-card {
    background: #fff;
    box-shadow: none;
}
.filter-card .card-body { padding: 14px 16px; }
.review-filter-grid {
    display: grid;
    grid-template-columns: repeat(14, minmax(0, 1fr));
    align-items: end;
    gap: 14px;
}
.review-filter-grid > div { grid-column: span 2; min-width: 0; }
.review-filter-grid .review-filter-search { grid-column: span 3; }
.review-filter-grid .review-filter-date { grid-column: span 2; min-width: 150px; }
.review-filter-grid .review-filter-submit { grid-column: span 1; }
.review-filter-grid .review-filter-clear { grid-column: 1 / -1; }
@media (max-width: 1199.98px) {
    .review-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .review-filter-grid > div,
    .review-filter-grid .review-filter-search,
    .review-filter-grid .review-filter-date,
    .review-filter-grid .review-filter-submit { grid-column: span 1; min-width: 0; }
}
@media (max-width: 767.98px) {
    .review-filter-grid { grid-template-columns: minmax(0, 1fr); }
}
.content-wrap .row.g-3.mb-4 { margin-bottom: 16px !important; }
.content-wrap .rounded-3 { border-radius: var(--radius-md) !important; }

.page-tabs {
    gap: 4px;
    margin: 0 0 16px;
    padding: 4px;
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: none;
}
.page-tab {
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 5px;
    font-size: var(--type-body);
    font-weight: 600;
}
.page-tab.active { box-shadow: none; }

.section-header { margin: 18px 0 10px; }
.section-title {
    color: var(--text-main);
    font-size: var(--type-section);
    font-weight: 700;
}
.section-subtitle { font-size: var(--type-small); }

.metric-card::after { display: none; }
.metric-card .card-body {
    min-height: 112px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.metric-label {
    color: #596b82;
    font-size: var(--type-small);
    font-weight: 600;
}
.metric-value {
    margin-top: 6px;
    color: #101820;
    font-size: var(--type-metric);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
}
.metric-unit,
.metric-subtitle {
    margin-top: 5px;
    color: var(--text-muted);
    font-size: var(--type-small);
    line-height: 1.45;
}
.compact-metric {
    border: 1px solid #e6ebf1;
    border-radius: var(--radius-md);
    background: #f8fafc;
}

.btn {
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 5px;
    box-shadow: none !important;
}
.btn-sm { min-height: 28px; padding: 4px 9px; border-radius: 4px; }
.btn-lg { min-height: 42px; padding: 9px 16px; border-radius: 6px; }
.btn-primary { background: var(--brand); border-color: var(--brand); }
.btn-primary:hover,
.btn-primary:focus { background: #0b5ed7; border-color: #0a58ca; }
.btn-outline-success {
    border-color: #198754;
    color: #146c43;
}

.form-label {
    margin-bottom: 5px;
    color: #34445b;
    font-size: var(--type-small);
    font-weight: 600;
}
.form-control,
.form-select {
    min-height: 36px;
    padding: 6px 10px;
    border-color: #cfd9e5;
    border-radius: 5px;
    background-color: #fff;
    box-shadow: none;
}
.form-control:focus,
.form-select:focus {
    border-color: #6ea8fe;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, .12);
}
.form-text { color: var(--text-muted); font-size: var(--type-caption); }

.table {
    --bs-table-bg: #fff;
    margin-bottom: 0;
    color: #31435a;
}
.table > :not(caption) > * > * {
    padding: 11px 14px;
    border-bottom-color: #e7ecf2;
}
.table thead th,
.table-light th {
    background: #fafbfd;
    color: #596b82;
    font-weight: 600;
    vertical-align: middle;
    white-space: nowrap;
}
.table tbody tr:last-child > * { border-bottom: 0; }
.table tbody tr:hover > * { background: #f7faff; }
.table .btn { white-space: nowrap; }

/* Archive and approval details share the dashboard's compact information rhythm. */
.detail-card .card-body { padding: 16px 18px; }
.detail-card h2.h5,
.table-card h2.h5 {
    color: var(--text-main);
    font-size: var(--type-section);
    font-weight: 700;
    line-height: 1.35;
}
.detail-card .row.g-3 { --bs-gutter-y: 14px; }
.detail-card .text-muted,
.detail-card dt {
    margin-bottom: 3px;
    color: #596b82 !important;
    font-size: var(--type-caption);
    font-weight: 600;
    line-height: 1.35;
}
.detail-card .text-muted + div,
.detail-card dd {
    margin-bottom: 8px;
    color: #263a52;
    font-size: var(--type-small);
    line-height: 1.5;
}
.detail-card hr {
    margin: 17px 0;
    border-color: #e5ebf2;
    opacity: 1;
}

/* Operational schedules stay compact enough for daily dispatch work. */
.schedule-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
.schedule-summary-card {
    min-height: 82px;
    padding: 14px 16px;
    border: 1px solid var(--panel-border);
    border-left: 3px solid #8292a8;
    border-radius: var(--radius-md);
    background: #fff;
}
.schedule-summary-card span {
    display: block;
    color: var(--text-muted);
    font-size: var(--type-caption);
    font-weight: 600;
}
.schedule-summary-card strong {
    display: block;
    margin-top: 5px;
    color: var(--text-main);
    font-size: 24px;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}
.schedule-summary-card.is-available { border-left-color: #198754; }
.schedule-summary-card.is-transit { border-left-color: var(--brand); }
.schedule-summary-card.is-disabled { border-left-color: #6c757d; }
.schedule-table-header { padding: 13px 15px; border-bottom: 1px solid var(--panel-border); background: #fbfcfe; }
.schedule-table th:nth-child(1) { width: 14%; }
.schedule-table th:nth-child(2) { width: 14%; }
.schedule-table th:nth-child(3) { width: 44%; }
.schedule-table th:nth-child(4) { width: 28%; }
.schedule-vehicle-cell { min-width: 130px; }
.schedule-item {
    max-width: 640px;
    margin-bottom: 8px;
    padding: 9px 11px;
    border: 1px solid #dfe7f0;
    border-left: 3px solid var(--brand);
    border-radius: 5px;
    background: #f8fbff;
}
.schedule-item:last-child { margin-bottom: 0; }
.schedule-repair {
    display: grid;
    gap: 3px;
    margin-bottom: 7px;
    padding: 8px 10px;
    border-radius: 5px;
    background: #fff7e8;
    color: #77551d;
    font-size: var(--type-caption);
}
.schedule-empty { color: #8b99aa; font-size: var(--type-small); }
.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 3px 9px;
    border: 1px solid #d9e1ea;
    border-radius: 999px;
    background: #f8fafc;
    color: #4c5d73;
    font-size: var(--type-caption);
    font-weight: 700;
}
.status-available { border-color: #b8dfc7; background: #f0faf4; color: #18723d; }
.status-in_transit { border-color: #b9d5fb; background: #eef6ff; color: #0b5fc2; }
.status-disabled { border-color: #d6dce3; background: #f3f5f7; color: #596777; }

/* Trip details use explicit workflow groups instead of one undifferentiated field wall. */
.trip-overview {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-md);
    background: #fff;
}
.trip-overview-item { min-height: 72px; padding: 13px 16px; border-right: 1px solid #e7ecf2; }
.trip-overview-item:last-child { border-right: 0; }
.trip-overview-item span { display: block; margin-bottom: 5px; color: var(--text-muted); font-size: var(--type-caption); font-weight: 600; }
.trip-overview-item strong { color: var(--text-main); font-size: var(--type-small); }
.detail-section-heading { margin-top: 3px; padding-top: 14px; border-top: 1px solid #e7ecf2; }
.detail-section-heading:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.detail-section-heading span { color: #344c68; font-size: var(--type-small); font-weight: 700; }

.badge {
    padding: 4px 7px;
    border-radius: 4px;
    font-size: var(--type-caption);
    font-weight: 600;
}
.alert {
    padding: 11px 13px;
    border-radius: var(--radius-md);
    font-size: var(--type-small);
}
.task-item { border-radius: var(--radius-md); }

.modal-content {
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    box-shadow: 0 18px 50px rgba(6, 35, 63, .16);
}
.modal-header { padding: 16px 18px 12px; border-bottom-color: #e6ebf1; }
.modal-body { padding: 16px 18px; }
.modal-footer { padding: 12px 18px 16px; border-top-color: #e6ebf1; }
.modal-title { color: var(--text-main); font-size: 17px; font-weight: 700; }
.modal-eyebrow { margin-bottom: 2px; color: var(--brand); font-size: var(--type-caption); font-weight: 600; }
.logout-modal .modal-body p { margin: 0 0 5px; color: #34445b; }
.logout-modal .modal-body small { color: var(--text-muted); }
.logout-modal .modal-footer { justify-content: flex-end; gap: 6px; }
.logout-modal .modal-footer form { margin: 0; }

/* Responsive login screen, isolated from authenticated application pages. */
body.app-guest {
    background: #f7fafe;
    font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}
.app-guest .navbar.app-topbar { display: none; }
.app-guest .container-fluid.app-shell,
.app-guest .app-layout { min-height: 100vh; }
.app-guest .content-wrap {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 100vh;
    padding: 0;
}
.app-guest .content-wrap > .alert { display: none; }

.login-page {
    --login-blue: #0868f2;
    --login-deep-blue: #082a5a;
    --login-muted: #546a88;
    --login-border: #d9e3ef;
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    min-height: 100svh;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    padding: clamp(26px, 3.6vh, 42px) clamp(34px, 3.5vw, 68px) 22px;
    background: #f7fafe;
    color: var(--login-deep-blue);
}
.login-company-header {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--login-deep-blue);
    font-size: clamp(20px, 1.45vw, 28px);
    font-weight: 700;
    line-height: 1.2;
}
.login-company-logo {
    width: clamp(48px, 3.4vw, 66px);
    height: clamp(48px, 3.4vw, 66px);
    flex: 0 0 auto;
    object-fit: contain;
}
.login-stage {
    width: min(1820px, 100%);
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 62fr) minmax(448px, 38fr);
    align-items: center;
    margin: 0 auto;
}
.login-hero-copy {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 0 42px 4vh clamp(58px, 7.8vw, 150px);
}
.login-hero-copy h1 {
    margin: 0;
    color: var(--login-deep-blue);
    font-size: clamp(48px, 3.1vw, 56px);
    font-weight: 700;
    letter-spacing: .01em;
    line-height: 1.2;
}
.login-hero-copy > p {
    margin: 20px 0 0;
    color: var(--login-muted);
    font-size: clamp(21px, 1.35vw, 24px);
    line-height: 1.55;
}
.login-feature-tags {
    display: flex;
    align-items: center;
    gap: clamp(34px, 4vw, 72px);
    margin-top: 44px;
}
.login-feature-tags > span {
    min-width: 112px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--login-deep-blue);
    font-size: 17px;
    font-weight: 700;
    white-space: nowrap;
}
.login-feature-icon {
    width: 38px;
    height: 38px;
    color: var(--login-blue);
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}
.login-scene {
    position: absolute;
    z-index: -1;
    inset: auto 0 0;
    height: 60%;
    background-image: url("../images/login-hero.13b115ce1eb2.webp");
    background-repeat: no-repeat;
    background-position: center bottom;
    background-size: cover;
    opacity: .76;
    -webkit-mask-image: linear-gradient(
        to bottom,
        transparent 0,
        rgba(0, 0, 0, .18) 9%,
        rgba(0, 0, 0, .72) 23%,
        #000 38%
    );
    mask-image: linear-gradient(
        to bottom,
        transparent 0,
        rgba(0, 0, 0, .18) 9%,
        rgba(0, 0, 0, .72) 23%,
        #000 38%
    );
    pointer-events: none;
}
.login-card {
    position: relative;
    z-index: 2;
    width: min(438px, calc(100% - 18px));
    min-height: 558px;
    justify-self: start;
    margin-left: clamp(8px, 1.1vw, 22px);
    padding: 46px 44px 38px;
    border: 1px solid rgba(217, 227, 239, .92);
    border-radius: 20px;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 12px 36px rgba(16, 50, 90, .08);
}
.login-card-header { margin-bottom: 30px; }
.login-card-header h2 {
    margin: 0;
    color: var(--login-deep-blue);
    font-size: 30px;
    font-weight: 700;
    line-height: 1.25;
}
.login-card-header p {
    margin: 10px 0 0;
    color: var(--login-muted);
    font-size: 14px;
    line-height: 1.55;
}
.login-form { display: grid; gap: 22px; }
.login-field { min-width: 0; }
.login-field label {
    display: block;
    margin-bottom: 9px;
    color: var(--login-deep-blue);
    font-size: 14px;
    font-weight: 700;
}
.login-input-wrap { position: relative; }
.login-input-wrap .form-control {
    width: 100%;
    min-height: 52px;
    padding: 11px 46px 11px 46px;
    border: 1px solid var(--login-border);
    border-radius: 8px;
    background: #fff;
    color: var(--login-deep-blue);
    font-size: 15px;
    line-height: 1.4;
    box-shadow: none;
}
.login-input-wrap .form-control::placeholder { color: #596b82; opacity: 1; }
.login-input-wrap .form-control:hover { border-color: #b9c9dd; }
.login-input-wrap .form-control:focus {
    border-color: var(--login-blue);
    box-shadow: 0 0 0 3px rgba(8, 104, 242, .14);
    outline: 0;
}
.login-input-icon {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 16px;
    width: 19px;
    height: 19px;
    transform: translateY(-50%);
    opacity: .58;
    pointer-events: none;
}
.login-password-toggle {
    position: absolute;
    z-index: 3;
    top: 50%;
    right: 8px;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-50%);
    border: 0;
    border-radius: 7px;
    background: transparent;
    cursor: pointer;
}
.login-password-toggle:hover { background: #f0f5fc; }
.login-password-toggle:focus-visible {
    outline: 3px solid rgba(8, 104, 242, .2);
    outline-offset: 1px;
}
.login-password-toggle img { width: 20px; height: 20px; opacity: .62; }
.login-remember {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: -2px;
    color: #4f6580;
    font-size: 14px;
    cursor: pointer;
}
.login-remember .form-check-input {
    width: 18px;
    height: 18px;
    margin: 0;
    border-color: #66788f;
    border-radius: 4px;
    cursor: pointer;
}
.login-remember .form-check-input:focus { box-shadow: 0 0 0 3px rgba(8, 104, 242, .14); }
.login-remember .form-check-input:checked { background-color: var(--login-blue); border-color: var(--login-blue); }
.login-submit {
    width: 100%;
    min-height: 52px;
    margin-top: 1px;
    border-color: var(--login-blue);
    border-radius: 8px;
    background: var(--login-blue);
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    box-shadow: none !important;
}
.login-submit:hover,
.login-submit:focus { border-color: #075bda; background: #075bda; }
.login-submit:focus-visible { outline: 3px solid rgba(8, 104, 242, .22); outline-offset: 2px; }
.login-submit:disabled { border-color: #4a90f4; background: #4a90f4; opacity: 1; cursor: wait; }
.login-help {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 26px;
    padding-top: 23px;
    border-top: 1px solid #e5ebf3;
    color: var(--login-muted);
    font-size: 14px;
}
.login-help strong { color: inherit; font-weight: 600; }
.login-alert {
    margin: -10px 0 22px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
}
.login-alert.alert-danger {
    border: 1px solid #f2b8be;
    background: #fff3f4;
    color: #92212b;
}
.login-alert.alert-warning {
    border: 1px solid #f0d28a;
    background: #fff9e9;
    color: #76530a;
}
.login-alert ul { margin: 4px 0 0; padding-left: 18px; }
.login-field .invalid-feedback { margin-top: 6px; font-size: 12px; }
.login-page-footer {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #546a88;
    font-size: 13px;
    line-height: 1.5;
}

@media (min-width: 992px) {
    body.app-guest { overflow: hidden; }
    .login-scene { background-position: center calc(100% + 56px); }
    .login-card {
        transform: translateY(clamp(-82px, calc(405px - 45vh), 0px));
    }
    .login-hero-copy {
        transform: translateY(clamp(-146px, calc(341px - 45vh), -64px));
    }
}

@media (max-width: 1199.98px) and (min-width: 992px) {
    .login-page { padding-right: 34px; padding-left: 34px; }
    .login-stage { grid-template-columns: minmax(0, 58fr) minmax(448px, 42fr); }
    .login-hero-copy { padding-left: 54px; }
    .login-feature-tags { gap: 32px; }
}

@media (max-width: 991.98px) {
    .app-guest .container-fluid.app-shell,
    .app-guest .app-layout,
    .app-guest .content-wrap { min-height: 100%; }
    .login-page {
        min-height: 100vh;
        overflow: visible;
        padding: 20px 0 28px;
    }
    .login-company-header {
        justify-content: center;
        gap: 12px;
        padding: 0 20px;
        font-size: clamp(19px, 3vw, 24px);
        text-align: center;
    }
    .login-company-logo { width: 52px; height: 52px; }
    .login-stage {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    .login-hero-copy {
        width: 100%;
        max-width: 720px;
        padding: 42px 20px 0;
        text-align: center;
    }
    .login-hero-copy h1 { font-size: clamp(38px, 7vw, 48px); }
    .login-hero-copy > p { margin-top: 14px; font-size: clamp(17px, 3.2vw, 21px); }
    .login-feature-tags { justify-content: center; margin-top: 28px; }
    .login-scene {
        position: relative;
        z-index: 0;
        inset: auto;
        width: 100%;
        height: 240px;
        flex: 0 0 auto;
        margin: 10px 0 -26px;
        background-position: 32% bottom;
        background-size: cover;
        opacity: .78;
    }
    .login-card {
        width: calc(100% - 32px);
        max-width: 520px;
        min-height: 0;
        align-self: center;
        margin: 0 16px;
        padding: 36px 34px 32px;
    }
    .login-page-footer { margin-top: 34px; padding: 0 16px; }
}

@media (max-width: 767.98px) {
    .page-header { min-height: 0; align-items: flex-start; padding: 2px 0 8px; }
    .card-body { padding: 15px; }
    .filter-card .card-body { padding: 13px; }
    .metric-card .card-body { min-height: 96px; }
    .table > :not(caption) > * > * { padding: 10px 12px; }
    .app-guest .content-wrap { min-height: 100%; padding: 0; }
    .login-company-header { font-size: 20px; }
    .login-company-logo { width: 48px; height: 48px; }
    .login-hero-copy { padding-top: 36px; }
    .login-hero-copy h1 { font-size: clamp(34px, 9vw, 42px); }
    .login-hero-copy > p { max-width: 350px; margin-right: auto; margin-left: auto; font-size: 17px; }
    .login-feature-tags { display: none; }
    .login-scene {
        height: 204px;
        margin-top: 10px;
        background-position: 24% bottom;
        background-size: 135% auto;
    }
    .login-card { padding: 31px 28px 28px; border-radius: 20px; }
    .login-card-header { margin-bottom: 27px; }
    .login-card-header h2 { font-size: 28px; }
    .login-input-wrap .form-control,
    .login-submit { min-height: 52px; }
    .login-form { gap: 21px; }
    .login-help { margin-top: 24px; padding-top: 21px; }
    .login-page-footer { font-size: 13px; }
    .detail-card .card-body { padding: 15px; }
    .mobile-form { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
    .schedule-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .schedule-summary-card { min-height: 72px; padding: 12px 13px; }
    .trip-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .trip-overview-item:nth-child(2) { border-right: 0; }
    .trip-overview-item:nth-child(-n+2) { border-bottom: 1px solid #e7ecf2; }
}

@media (max-width: 575.98px) {
    .login-page { padding-top: 12px; }
    .login-company-header { font-size: 18px; }
    .login-company-logo { width: 40px; height: 40px; }
    .login-hero-copy { padding-top: 18px; }
    .login-hero-copy h1 { font-size: clamp(29px, 8vw, 36px); }
    .login-hero-copy > p { margin-top: 8px; font-size: 15px; }
    .login-scene {
        height: 112px;
        margin: 2px 0 -12px;
        background-size: 118% auto;
    }
    .login-card {
        width: calc(100% - 24px);
        margin: 0 12px;
        padding: 24px 20px 22px;
    }
    .login-card-header { margin-bottom: 18px; }
    .login-card-header h2 { font-size: 25px; }
    .login-form { gap: 16px; }
    .login-help { margin-top: 18px; padding-top: 16px; text-align: center; }
}
.advanced-filter {
    border-top: 1px solid var(--bs-border-color);
    padding-top: .75rem;
}

.advanced-filter > summary {
    color: var(--bs-primary);
    cursor: pointer;
    font-weight: 600;
    list-style-position: inside;
}

.clickable-row {
    cursor: pointer;
}

.clickable-row:focus-visible {
    outline: 3px solid rgba(13, 110, 253, .25);
    outline-offset: -3px;
}
@media (pointer: coarse) {
    .btn,
    .nav-link,
    .page-tab,
    .workspace-tab,
    summary[role="button"],
    details > summary.btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .form-check-input {
        min-width: 24px;
        min-height: 24px;
    }
}

.spare-transaction-table {
    min-width: 1500px;
}

.spare-transaction-table th,
.spare-transaction-table td {
    white-space: nowrap;
}

/* Third-pass usability and responsive hardening. */
.btn-outline-primary {
    color: #0756b8;
    border-color: #0756b8;
}
.btn-outline-primary:hover,
.btn-outline-primary:focus-visible {
    color: #fff;
    background-color: #0756b8;
    border-color: #0756b8;
}

.schedule-calendar-table {
    min-width: 832px;
}
.schedule-calendar-table .schedule-vehicle-column {
    width: 160px;
}
.schedule-calendar-table .schedule-day-column {
    width: 96px;
}
.schedule-scroll-hint,
.report-ranking-tabs-hint {
    padding: 8px 12px;
    color: #52657c;
    font-size: 12px;
    font-weight: 700;
}
.schedule-mobile-list {
    padding: 12px;
}
.schedule-mobile-card {
    margin-bottom: 12px;
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    background: var(--panel-bg);
    overflow: visible;
}
.schedule-mobile-vehicle {
    display: flex;
    min-height: 52px;
    padding: 10px 12px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--panel-border);
}
.schedule-mobile-days {
    display: flex;
    gap: 8px;
    padding: 10px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
}
.schedule-mobile-day {
    flex: 0 0 88px;
    min-height: 96px;
    padding: 8px;
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    background: var(--app-bg);
    text-align: center;
}
.schedule-mobile-day.is-conflict { border-color: #dc3545; background: #fff0f0; }
.schedule-mobile-day.is-disabled { border-color: #9ca3af; background: #f1f3f5; }
.schedule-mobile-day.is-repair { border-color: #e6a700; background: #fff8db; }
.schedule-mobile-day.is-trip { border-color: #86aef8; background: #eef5ff; }
.schedule-mobile-date {
    display: flex;
    margin-bottom: 6px;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    font-weight: 800;
}
.schedule-mobile-date small,
.schedule-mobile-available {
    color: var(--muted);
    font-size: 12px;
}
.target-highlight,
.spare-transaction-table tr:target {
    outline: 3px solid rgba(13, 110, 253, .35);
    outline-offset: 2px;
    background: #eef5ff;
}
.report-ranking-tabs-shell {
    position: relative;
    min-width: 0;
}
.report-ranking-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    max-width: 100%;
    padding-bottom: 4px;
    scrollbar-width: thin;
}
.report-ranking-tabs .workspace-tab {
    flex: 0 0 auto;
}

@media (max-width: 767.98px) {
    .workspace-tabs .workspace-tab {
        min-height: 44px;
    }
    .sidebar {
        padding: 8px 12px !important;
    }
    .mobile-nav {
        gap: 6px;
    }
    .mobile-nav-more,
    .mobile-utility-panel {
        padding-top: 0;
    }
    .mobile-nav-more-toggle,
    .mobile-utility-panel > summary {
        min-height: 44px;
    }
    .content-wrap {
        padding-top: 10px;
    }
    .schedule-calendar-table {
        min-width: 788px;
    }
    .schedule-calendar-table .schedule-vehicle-column,
    .schedule-calendar-table .schedule-sticky-vehicle {
        width: 116px;
        min-width: 116px;
        max-width: 116px;
    }
    .schedule-calendar-table .schedule-sticky-vehicle {
        overflow: hidden;
        padding-inline: 8px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .schedule-calendar-table .schedule-day-column {
        width: 96px;
    }
    .schedule-day-cell {
        position: relative;
        z-index: 1;
    }
    .schedule-cell-button {
        min-width: 44px;
        min-height: 44px;
    }
    .report-ranking-tabs-shell::after {
        position: absolute;
        top: 0;
        right: 0;
        width: 32px;
        height: 46px;
        background: linear-gradient(90deg, rgba(246, 248, 251, 0), #f6f8fb);
        content: "";
        pointer-events: none;
    }
    .report-ranking-tabs-hint {
        padding-left: 2px;
    }
    .pagination .page-link,
    .dropdown-toggle,
    .table .btn-sm,
    .record-actions .btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .pagination .page-link,
    .page-size-options .btn {
        min-width: 44px;
    }
}

@media (max-width: 420px) {
    .mobile-nav-primary,
    .mobile-driver-tabs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* This must follow compact component sizing rules so coarse-pointer devices
   keep a full 44px activation target. */
@media (pointer: coarse) {
    .login-password-toggle,
    .topbar-alert,
    .dashboard-period-tabs a,
    .dashboard-period-form .btn,
    .dashboard-period-form .form-control,
    .mobile-nav .nav-link,
    .mobile-nav-more-toggle,
    .mobile-utility-panel > summary {
        min-width: 44px;
        min-height: 44px;
    }
}
