:root {
    --ink: #0d2346;
    --muted: #60738a;
    --line: #dfe6ee;
    --canvas: #f5f8fc;
    --card: #fff;
    --navy: #112b47;
    --navy-2: #0e3455;
    --accent: #0876e8;
    --focus: #0876e8;
    --ok: #098a4b;
    --danger: #e62e35;
    color-scheme: light;
}

html, body {
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    font-family: "Segoe UI", system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.45;
}

a {
    color: var(--navy);
}

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

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

h1 {
    font-size: 1.45rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    margin: 0 0 0.2rem;
}

h1 + p,
.lede {
    color: var(--muted);
    max-width: 42rem;
    margin-top: 0;
}

h2 {
    font-size: 1.05rem;
    font-weight: 650;
    margin: 0 0 0.75rem;
}

h3 {
    font-size: 0.95rem;
    font-weight: 650;
}

.content {
    padding: 12px 18px 28px;
    background: radial-gradient(circle at 12% 0, #eef7ff 0, transparent 28%), var(--canvas);
}

.border.rounded {
    background: var(--card);
    border-color: var(--line) !important;
    border-radius: 10px !important;
    box-shadow: 0 1px 1px rgba(15, 61, 76, 0.04);
}

.col-md-2 > label,
.col-md-3 > label,
.col-md-4 > label,
.col-md-5 > label,
.col-md-6 > label,
.col-md-8 > label,
.col-12 > label,
.mb-2 > label,
.mb-3 > label,
.col > label {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 650;
}

.form-control,
.form-select,
select {
    border-color: #d7e0ea;
    border-radius: 6px;
}

select,
.form-select {
    appearance: none;
    -webkit-appearance: none;
    height: 34px;
    padding: 0 32px 0 10px;
    border: 1px solid #d7e0ea;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23102b47' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    color: #102344;
    font-size: 13px;
    line-height: 32px;
}

.form-control:focus,
.form-select:focus,
select:focus,
.form-check-input:focus {
    border-color: #0876e8;
    box-shadow: 0 0 0 3px rgba(8, 118, 232, 0.16);
    outline: none;
}

select:disabled,
.form-select:disabled {
    background-color: #f4f7fa;
    color: #7b8b9e;
}

.ov-filters select,
.ord-filters select {
    min-width: 180px;
    width: 100%;
}

.btn {
    border-radius: 6px;
    font-weight: 650;
}

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

.btn-primary:hover,
.btn-primary:focus {
    background-color: #0664c4;
    border-color: #0664c4;
    color: #fff;
}

.btn-outline-primary {
    color: var(--navy);
    border-color: #9db4c0;
}

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

.btn-group {
    flex-wrap: wrap;
    gap: 0.35rem;
}

.btn-group > .btn {
    border-radius: 6px !important;
}

.alert {
    border-radius: 8px;
    border: 0;
}

.alert-danger {
    background: #fff1f2;
    color: var(--danger);
}

.alert-success {
    background: #ecfdf3;
    color: var(--ok);
}

.table {
    --bs-table-bg: #fff;
    margin-bottom: 0;
    font-variant-numeric: tabular-nums;
}

.table > :not(caption) > * > * {
    padding: 0.55rem 0.7rem;
    vertical-align: middle;
}

.table thead th {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--muted);
    background: #f4f7f8;
    border-bottom-color: var(--line);
    white-space: nowrap;
}

.table tbody tr:hover {
    background: #f7fbfc;
}

.table-scroll {
    max-height: min(70vh, 40rem);
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}

.table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}

.badge {
    font-weight: 650;
}

.pending {
    position: relative;
    width: min(18rem, 100%);
    height: 2.4rem;
    margin: 0.5rem 0 1rem;
    border-radius: 8px;
    color: transparent;
    user-select: none;
    background: linear-gradient(90deg, #e4ebf0 25%, #f7fafb 37%, #e4ebf0 63%);
    background-size: 400% 100%;
    animation: shimmer 1.15s ease infinite;
}

.desk {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.desk a, .desk button {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-height: 6.6rem;
    padding: 0.9rem 1rem;
    text-decoration: none;
    text-align: left;
    font: inherit;
    color: inherit;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
    width: 100%;
}

.desk a span, .desk button span {
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 750;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.desk a strong, .desk button strong {
    font-size: 1.05rem;
}

.desk a em, .desk button em {
    color: var(--muted);
    font-style: normal;
    font-size: 0.88rem;
}

.desk a:hover, .desk button:hover, .desk button.on {
    border-color: var(--navy);
}

.overview-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: end;
    margin: 0.5rem 0 1rem;
}

.overview-filters label {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.overview-filters select, .overview-filters input {
    min-width: 12rem;
    color: var(--ink, #1c1917);
}

.trend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.75rem;
}

.trend span {
    display: flex;
    flex-direction: column;
    min-width: 2.6rem;
    padding: 0.25rem 0.35rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    text-align: center;
}

.trend small { color: var(--muted); }

.ops-map {
    position: relative;
    height: 22rem;
    background:
        linear-gradient(rgba(15, 61, 76, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 61, 76, 0.05) 1px, transparent 1px),
        #e7f1f4;
    background-size: 12.5% 12.5%, 12.5% 12.5%, auto;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
}

.ops-map.live {
    height: 32rem;
}

.map-city {
    position: absolute;
    transform: translate(-50%, -120%);
    font-size: 0.75rem;
    color: #0f3d4c;
    pointer-events: none;
}

.ops-map .pin {
    position: absolute;
    width: 0.95rem;
    height: 0.95rem;
    min-height: 0;
    padding: 0;
    border-radius: 50%;
    border: 2px solid #fff;
    transform: translate(-50%, -50%);
}

.ops-map .pin.gps, .ops-map .pin.fresh, .map-legend .fresh { background: #166534; }
.ops-map .pin.stale, .ops-map .pin.slow, .map-legend .slow { background: #92400e; }
.ops-map .pin.lost, .map-legend .lost { background: #991b1b; }
.ops-map .pin.estimated { background: #0f3d4c; }
.ops-map .pin.on { outline: 2px solid #0f3d4c; }
.ops-map .pin.pickup { background: #166534; }
.ops-map .pin.delivery { background: #92400e; }
.ops-map .pin.stop { background: #0f3d4c; }

.map-trail {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.map-trail polyline {
    fill: none;
    stroke: #0f3d4c;
    stroke-width: 0.7;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    margin: 0.6rem 0 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.map-legend i {
    display: inline-block;
    width: 0.7rem;
    height: 0.7rem;
    margin-right: 0.3rem;
    border-radius: 50%;
    vertical-align: middle;
}

tr.row-on { background: #e7f1f4; }

article.border {
    content-visibility: auto;
    contain-intrinsic-size: auto 7rem;
}

.auth-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1.35rem 1.25rem 1.2rem;
    box-shadow: 0 8px 24px rgba(15, 61, 76, 0.06);
}

.auth-brand {
    margin: 0 0 0.85rem;
    color: var(--navy);
    font-size: 0.75rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-card h1 {
    margin-bottom: 0.35rem;
}

.role-picks {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.85rem 0 1rem;
}

.auth-card form {
    display: grid;
    gap: 0.35rem;
}

.auth-card details {
    margin-top: 0.35rem;
    color: var(--muted);
    font-size: 0.85rem;
}

.auth-card details input {
    margin-top: 0.4rem;
}

.auth-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.85rem;
}

code {
    font-size: 0.85em;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: #9f1239;
    padding: 1rem 1.1rem;
    color: white;
    border-radius: 8px;
}

.blazor-error-boundary::after {
    content: "Màn này gặp lỗi. Tải lại trang.";
}

@media (prefers-reduced-motion: reduce) {
    .pending {
        animation: none;
    }
}

.session-wait {
    margin: 2rem 1.25rem;
    color: var(--muted);
}

@keyframes shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: 0 0; }
}

.pool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.pool-card {
    border: 1px solid #dfe6ee;
    border-radius: 6px;
    padding: 10px 12px;
    background: #fff;
    cursor: grab;
    box-shadow: 0 1px 3px #173b6210;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 12px;
    color: #24344a;
}

.pool-card:active { cursor: grabbing; }

.pool-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.pool-card .ord-code {
    color: #0876e8;
    font-weight: 700;
    font-size: 13px;
}

.pool-pick {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #60738a;
    margin: 0;
    white-space: nowrap;
}

.pool-route {
    padding: 7px 8px;
    background: #f7f9fc;
    border-radius: 5px;
    display: grid;
    gap: 5px;
    font-size: 11px;
    line-height: 1.35;
}

.pool-route span {
    display: inline-block;
    min-width: 2.2rem;
    color: #64768b;
    font-weight: 600;
}

.pool-card .ord-field { margin: 0; }

.pool-card.on, .drop-lane.on {
    outline: 2px solid #0876e8;
    border-color: #0876e8;
}

.pool-card.plan-tour {
    cursor: default;
}

.pool-card.plan-tour.drop-lane {
    border-style: dashed;
    background: #fafcfe;
}

.res-detail {
    margin-top: 4px;
    padding: 8px;
    background: #f7f9fc;
    border-radius: 5px;
    display: grid;
    gap: 8px;
}

.user-table td, .user-table th {
    padding: 0.45rem 0.55rem;
    font-size: 0.9rem;
    vertical-align: middle;
}

.user-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    white-space: nowrap;
}

.pill.ok { background: #ecfdf3; color: #166534; }
.pill.plan { background: #e5f2ff; color: #0876e8; }
.pill.draft { background: #f5f5f4; color: #44403c; }
.pill.high { background: #fff7ed; color: #92400e; }

.ov-map .ops-map.live {
    height: 380px;
}

.ov-map.full .ops-map.live { height: 70vh; }

.drop-lane {
    border: 1px dashed #9bb6d4;
    border-radius: 6px;
    padding: 14px 12px;
    background: #f3f8ff;
    color: #40536a;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    margin-top: 8px;
}

.drop-lane.on {
    background: #e5f2ff;
    border-style: solid;
}

.plan-lead, .plan-note {
    margin: 0 0 8px;
    color: #60738a;
    font-size: 12px;
}

.plan-note { margin: 0; font-size: 11px; }

.plan-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.plan-toolbar .form-control,
.plan-toolbar .form-select {
    flex: 1 1 9rem;
    min-width: 8rem;
}

.plan-candidate, .plan-tour {
    border: 1px solid #dfe6ee;
    border-radius: 6px;
    padding: 12px;
    margin: 10px 0 0;
    background: #fff;
    box-shadow: 0 1px 3px #173b6210;
}

.plan-tour.drop-lane {
    border-style: dashed;
    background: #fafcfe;
    text-align: left;
    font-weight: 400;
    color: inherit;
}

.plan-tour.on {
    background: #e5f2ff;
}

.plan-tour ol {
    margin: 8px 0;
    padding-left: 1.25rem;
    font-size: 12px;
}

.plan-tour ol li {
    padding: 6px 0;
    border-bottom: 1px solid #e7ecf2;
}

.plan-tour ol li:last-child { border-bottom: 0; }


.ico {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: none;
}

.nav-collapse {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.page:has(.nav-collapse:checked) .sidebar {
    width: 4.6rem;
}

.page:has(.nav-collapse:checked) .nav-text,
.page:has(.nav-collapse:checked) .brand-copy,
.page:has(.nav-collapse:checked) .subnav,
.page:has(.nav-collapse:checked) .nav-label {
    display: none;
}

.ov-head, .ord-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.ov-head h1, .ord-head h1 {
    margin: 0 0 4px;
    font-size: 23px;
    color: #0d2040;
}

.ov-head p, .ord-head p {
    margin: 0;
    color: #60738a;
    font-size: 13px;
}

.ov-date {
    font-size: 12px;
    color: #4d6077;
    margin-top: 8px;
    white-space: nowrap;
}

.ov-filters, .ord-filters {
    margin-top: 12px;
    padding: 10px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    background: #fff;
    border: 1px solid #dfe6ee;
    border-radius: 6px;
    box-shadow: 0 1px 5px #173b6210;
}

.ov-filters label, .ord-filters label, .ord-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
    color: #40536a;
}

.ov-kpis, .ord-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.ord-kpis.ord-kpis-6 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

@media (max-width: 1400px) {
    .ord-kpis.ord-kpis-6 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.ov-kpi, .ord-kpi {
    min-height: 96px;
    padding: 14px;
    display: flex;
    gap: 12px;
    background: #fff;
    border: 1px solid #e3e8ef;
    border-radius: 7px;
    box-shadow: 0 2px 7px rgba(21, 49, 79, .06);
    text-align: left;
    color: inherit;
    width: 100%;
    text-decoration: none;
}
a.ord-kpi:hover, a.ov-kpi:hover { border-color: #0876e8; }
a.ord-kpi.on, a.ov-kpi.on { border-color: #0876e8; box-shadow: 0 0 0 2px rgba(8, 118, 232, .2); }
a.ghost-btn { text-decoration: none; color: #102344; }
.ord-code a { color: #0876e8; font-weight: 700; text-decoration: none; }
.ord-code a:hover { text-decoration: underline; }

button.ov-kpi { cursor: pointer; }
button.ov-kpi.on { outline: 2px solid #0876e8; }

.ov-kicon, .ord-kicon {
    width: 48px;
    height: 48px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    color: #fff;
    flex: none;
}

.ov-kicon .ico, .ord-kicon .ico { width: 24px; height: 24px; }
.tone-blue { background: linear-gradient(135deg, #1477ee, #3e99ff); }
.tone-green { background: linear-gradient(135deg, #28a85e, #55ca82); }
.tone-orange { background: linear-gradient(135deg, #efa415, #ffc354); }
.tone-red { background: linear-gradient(135deg, #ef4040, #ff7474); }
.tone-purple { background: linear-gradient(135deg, #7041db, #9d6aff); }
.tone-soft-blue { background: #e4f0ff; color: #0876e8; }
.tone-soft-orange { background: #fff0df; color: #ed8500; }
.tone-soft-green { background: #def7eb; color: #00a15a; }
.tone-soft-red { background: #ffe6eb; color: #ee3348; }
.tone-soft-purple { background: #eee7ff; color: #754bd8; }

.ov-kpi .lbl, .ord-kpi .lbl { font-size: 12px; color: #63758a; }
.ov-kpi strong, .ord-kpi strong { display: block; font-size: 20px; margin: 4px 0 2px; color: #102344; }
.ov-kpi em, .ord-kpi em { font-style: normal; font-size: 11px; color: #5b6d83; }

.ov-grid2 {
    display: grid;
    grid-template-columns: 1.02fr 1.14fr;
    gap: 10px;
    margin-top: 10px;
}

.ov-grid3, .ov-bottom {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.ov-grid3 { grid-template-columns: 1.4fr .9fr .9fr; }
.ov-bottom { grid-template-columns: 1.15fr 1.15fr .9fr; }

.ov-grid2 > .ov-card { display: flex; flex-direction: column; }
.ov-side .list-pager { margin-top: auto; }

.ov-card, .ord-card {
    background: #fff;
    border: 1px solid #dfe6ee;
    border-radius: 6px;
    box-shadow: 0 1px 5px #173b6210;
}

.ov-card { padding: 10px 13px 12px; }

.ov-title, .ord-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 8px;
}

.ov-link { color: #0879e8; font-size: 12px; font-weight: 400; }

.ov-map .ops-map {
    height: 380px;
    border-radius: 5px;
    background:
        linear-gradient(24deg, transparent 48%, rgba(255,255,255,.75) 49%, rgba(255,255,255,.75) 50%, transparent 51%),
        linear-gradient(155deg, transparent 48%, rgba(245,201,92,.28) 49%, rgba(245,201,92,.28) 50%, transparent 51%),
        linear-gradient(145deg, #d7ecd3, #d6edf4 55%, #9fd9ee);
    background-size: 110px 75px, 160px 110px, auto;
}

.ov-map.full .ops-map { height: 70vh; }

.map-callout {
    position: absolute;
    transform: translate(10px, -50%);
    background: #fff;
    border-radius: 5px;
    padding: 6px 8px;
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 2px 7px #7f9aaa55;
    pointer-events: none;
    max-width: 14rem;
    z-index: 1;
}

.ov-series {
    display: flex;
    gap: 14px;
    font-size: 11px;
    color: #40536a;
    margin-bottom: 6px;
}

.ov-series span, .ov-legend-col span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sw {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex: 0 0 8px;
}

.sw.orders { background: #2e8bed; }
.sw.money { background: #37b76d; }

.ov-sub, .ov-note {
    font-size: 11px;
    font-weight: 500;
    color: #5b6d83;
}

.ov-note { margin: 8px 0 0; }

.ov-bars {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 168px;
    margin-top: 8px;
    border-bottom: 1px solid #dfe6ef;
    overflow-x: auto;
    padding: 0 4px 4px;
    scrollbar-width: thin;
    scrollbar-color: #c5d2e0 transparent;
}

.ov-bars > span {
    flex: 1 0 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    min-width: 0;
}

.ov-bars .pair {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    width: 100%;
    height: 132px;
}

.ov-bars i {
    display: block;
    width: 8px;
    border-radius: 3px 3px 0 0;
}

.ov-bars i.orders { background: #2e8bed; }
.ov-bars i.money { background: #37b76d; }

.ov-bars small { color: #5b6d83; font-size: 10px; margin-top: 4px; white-space: nowrap; }

.ov-chart-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ov-donut {
    position: relative;
    width: 148px;
    height: 148px;
    border-radius: 50%;
    flex: 0 0 148px;
}

.ov-donut::after {
    content: "";
    position: absolute;
    inset: 36px;
    background: #fff;
    border-radius: 50%;
}

.ov-hub {
    position: absolute;
    inset: 36px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.15;
    pointer-events: none;
}

.ov-hub b { font-size: 13px; color: #102344; }
.ov-hub small { font-size: 10px; color: #5b6d83; font-weight: 500; }

.ov-legend-col { flex: 1; min-width: 0; }
.ov-legend-col div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    line-height: 1.9;
    color: #24344a;
}

.ov-legend div { font-size: 12px; line-height: 1.7; display: flex; justify-content: space-between; gap: 8px; }
.ov-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 6px; }

.ov-task {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 4px;
    border: 0;
    border-top: 1px solid #e6ebf1;
    background: transparent;
    text-align: left;
    color: inherit;
    font-size: 12px;
}

a.ov-task { text-decoration: none; }
a.ov-task:hover { background: #f4f8fd; }

.ov-notice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 2px;
    border-top: 1px solid #e6ebf1;
    color: inherit;
    text-decoration: none;
    font-size: 12px;
}

.ov-notice:first-of-type { border-top: 0; }
.ov-notice:hover { background: #f4f8fd; }
.ov-notice .dot {
    width: 8px;
    height: 8px;
    margin-top: 4px;
    border-radius: 50%;
    background: #2e8bed;
    flex: 0 0 8px;
}
.ov-notice .dot.hot { background: #f6a30e; }
.ov-notice .grow { flex: 1; }
.ov-notice .when { color: #8796a8; white-space: nowrap; }
.ov-task:first-of-type { border-top: 0; }
.ov-quick {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
}

.ov-quick a {
    min-height: 70px;
    border: 1px solid #dfe6ef;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
    font-size: 11px;
    color: #173454;
    text-decoration: none;
    padding: 6px;
}

.ov-quick a:hover { background: #f4f8fc; }
.ov-quick .bubble {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    background: #187de8;
}
.ov-quick .bubble .ico { width: 14px; height: 14px; }
.ov-quick a:nth-child(2) .bubble { background: #2fb766; }
.ov-quick a:nth-child(3) .bubble { background: #2385ed; }
.ov-quick a:nth-child(4) .bubble { background: #ff8c12; }
.ov-quick a:nth-child(5) .bubble { background: #7044dc; }
.ov-quick a:nth-child(6) .bubble { background: #425d7b; }
.ov-quick a:nth-child(7) .bubble { background: #187de8; }
.ov-quick a:nth-child(8) .bubble { background: #425d7b; }

.ord-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ord-actions .btn, .ghost-btn {
    height: 34px;
    border: 1px solid #d6e0ea;
    background: #fff;
    border-radius: 5px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #173454;
    text-decoration: none;
    font-size: 13px;
}
.ord-actions .btn-primary { color: #fff; background: #0876e8; border-color: #0876e8; }

.ord-search {
    height: 34px;
    min-width: 220px;
    flex: 1;
    border: 1px solid #d7e0ea;
    border-radius: 5px;
    padding: 0 10px;
}

.ord-panel { margin-top: 10px; }
.ord-titlebar {
    height: 39px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    border-bottom: 1px solid #e3e9ef;
    font-size: 13px;
    font-weight: 700;
}

.ord-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ord-table th { text-align: left; background: #f6f8fb; padding: 8px 6px; color: #31445c; font-weight: 600; text-transform: none; letter-spacing: 0; font-size: 12px; }
.ord-table td { padding: 8px 6px; border-bottom: 1px solid #e7ecf2; vertical-align: middle; }
.ord-table tr.on { background: #f3f8ff; }
.ord-code { color: #0876e8; font-weight: 650; }

.pill {
    display: inline-block;
    padding: 3px 7px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
}
.pill.wait { background: #fff0d9; color: #dc7900; }
.pill.plan { background: #ddf5e9; color: #0b8c4e; }
.pill.draft { background: #e5f2ff; color: #0876e8; }
.pill.high { background: #ffe2e4; color: #e62e35; }

.ord-pager {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    font-size: 12px;
}
.ord-pager .pages { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.ord-pager button {
    min-width: 30px;
    height: 30px;
    border: 1px solid #d5e0ea;
    border-radius: 4px;
    background: #fff;
}
.ord-pager button.on { background: #0876e8; color: #fff; border-color: #0876e8; }

.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
    align-items: start;
    margin: 8px 0 4px;
}

.tile-grid .tile {
    margin: 0;
    height: 100%;
    background: #fff;
    border: 1px solid #dfe6ee;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(16, 35, 68, .04);
}

.tile-grid .tile h2 {
    margin: 0 0 8px;
    font-size: 15px;
}

.tile-grid .tile .form-control,
.tile-grid .tile .form-select { width: 100%; }

.list-pager {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 16px;
    font-size: 12px;
    color: #40536a;
}

.list-pager .pages { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.list-pager button {
    min-width: 30px;
    height: 30px;
    border: 1px solid #d5e0ea;
    border-radius: 4px;
    background: #fff;
}
.list-pager button.on { background: #0876e8; color: #fff; border-color: #0876e8; }
.list-pager .gap { padding: 0 4px; }

.ord-split { display: grid; grid-template-columns: 1.55fr .85fr; gap: 10px; margin-top: 10px; }
.ord-detail { padding: 12px; }
.ord-detail h2 { margin: 0 0 12px; font-size: 14px; }
.ord-kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px 10px; font-size: 12px; }
.ord-kv .k { color: #64768b; }

.ord-tabs { display: flex; border-bottom: 1px solid #dfe6ee; }
.ord-tabs button {
    padding: 10px 12px;
    border: 0;
    background: transparent;
    font-size: 12px;
    color: #40536a;
}
.ord-tabs button.on { color: #0876e8; border-bottom: 2px solid #0876e8; }

.ord-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 14px;
}
.ord-form label { display: block; font-size: 11px; margin-bottom: 4px; color: #40536a; }
.ord-form .full { grid-column: 1 / -1; }
.ord-form input, .ord-form textarea, .ord-detail input {
    width: 100%;
    min-height: 34px;
    border: 1px solid #d7e0ea;
    border-radius: 5px;
    padding: 6px 10px;
}

.ord-form select, .ord-detail select {
    width: 100%;
}

.ord-stop {
    display: grid;
    grid-template-columns: 32px 1fr 160px;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #e6ebf1;
    font-size: 12px;
}
.ord-num {
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: #e4f0ff;
    color: #0876e8;
    display: grid;
    place-items: center;
    font-weight: 700;
}

.ord-kanban {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
}

@media (max-width: 1200px) {
    .ord-kanban {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
.ord-col {
    background: #f2f5f9;
    border: 1px solid #dde5ed;
    border-radius: 7px;
    padding: 9px;
    min-height: 280px;
}
.ord-col h2 { font-size: 13px; display: flex; justify-content: space-between; }
.ord-task {
    background: #fff;
    border: 1px solid #dfe6ee;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
    font-size: 12px;
}
.ord-task b { display: block; color: #0876e8; margin-bottom: 4px; }
.ord-route { margin-top: 8px; padding: 7px; background: #f7f9fc; border-radius: 5px; }

.content > section:not(.ord-card):not(.ov-card):not(.ord-col),
.content > article.border {
    background: #fff;
    border: 1px solid #dfe6ee;
    border-radius: 12px;
    padding: 14px 16px;
    margin: 12px 0;
    box-shadow: 0 1px 2px rgba(16, 35, 68, .04);
}

.content > section:not(.ord-card):not(.ov-card) > h2,
.content > article.border > h2 {
    margin-top: 0;
}

.content > section table:not(.ord-table),
.content > article table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.content > section table:not(.ord-table) th,
.content > article table th {
    text-align: left;
    font-size: 12px;
    color: #63758a;
    font-weight: 650;
    padding: 8px 10px;
    border-bottom: 1px solid #e6ebf1;
}

.content > section table:not(.ord-table) td,
.content > article table td {
    padding: 8px 10px;
    border-bottom: 1px solid #eef2f6;
    font-size: 13px;
    vertical-align: top;
}

.content .alert {
    border: 0;
    border-radius: 10px;
}

.auth-shade {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(16, 35, 68, .45);
    display: grid;
    place-items: center;
    padding: 16px;
}

.auth-pop {
    width: min(420px, 100%);
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 12px 40px rgba(16, 35, 68, .2);
}

.auth-pop h2 { margin-top: 0; }
.auth-pop p { color: #60738a; }

/* nav-busy removed */

@media (max-width: 1100px) {
    .ov-kpis, .ord-kpis, .ov-grid2, .ov-grid3, .ov-bottom, .ord-split, .ord-kanban, .ord-form {
        grid-template-columns: 1fr;
    }
    .ov-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* —— Desk pages: same mockup skin as Overview / Orders —— */
.content > .ord-head {
    margin-bottom: 4px;
}

.content .border.rounded,
.content section.border,
.content article.border {
    background: #fff !important;
    border: 1px solid #dfe6ee !important;
    border-radius: 12px !important;
    box-shadow: 0 1px 2px rgba(16, 35, 68, .04);
}

.content .border.rounded.p-3,
.content .border.rounded.mb-3,
.content .border.rounded.mb-4 {
    padding: 14px 16px !important;
}

.content > section:not(.ord-card):not(.ov-card):not(.ord-col):not(.ov-filters):not(.ord-filters),
.content section.mb-4:not(.ord-card),
.content section.mb-3:not(.ord-card) {
    background: #fff;
    border: 1px solid #dfe6ee;
    border-radius: 12px;
    padding: 14px 16px;
    margin: 12px 0;
    box-shadow: 0 1px 2px rgba(16, 35, 68, .04);
}

.content .ord-card {
    background: #fff;
    border: 1px solid #dfe6ee;
    border-radius: 12px;
    padding: 14px 16px;
    margin: 12px 0;
    box-shadow: 0 1px 2px rgba(16, 35, 68, .04);
}

.content .ord-card > h2:first-child,
.content section > h2:first-child {
    margin-top: 0;
    font-size: 14px;
    font-weight: 700;
    color: #102344;
}

.content .table,
.content table.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    background: #fff;
    margin-bottom: 0;
    --bs-table-bg: #fff;
    --bs-table-striped-bg: #f8fafc;
}

.content .table thead th,
.content table.table thead th,
.content .ord-table thead th {
    text-align: left;
    background: #f6f8fb;
    padding: 8px 10px;
    color: #31445c;
    font-weight: 600;
    font-size: 12px;
    border-bottom: 1px solid #e3e9ef;
    white-space: nowrap;
}

.content .table td,
.content table.table td,
.content .ord-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e7ecf2;
    vertical-align: middle;
    font-size: 12px;
    color: #24344a;
}

.content .table tbody tr:hover,
.content .ord-table tbody tr:hover {
    background: #f3f8ff;
}

.content .btn,
.content .btn-sm {
    height: 34px;
    border-radius: 5px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
}

.content .btn-sm {
    height: 30px;
    padding: 0 10px;
    font-size: 12px;
}

.content .btn-outline-primary,
.content .btn-outline-secondary {
    color: #173454;
    background: #fff;
    border: 1px solid #d6e0ea;
}

.content .btn-outline-primary:hover,
.content .btn-outline-secondary:hover {
    background: #f4f8fc;
    border-color: #c5d2e0;
    color: #102344;
}

.content .btn-primary {
    color: #fff;
    background: #0876e8;
    border-color: #0876e8;
}

.content .btn-success {
    color: #fff;
    background: #098a4b;
    border-color: #098a4b;
}

.content .btn-danger,
.content .btn-outline-danger {
    border-radius: 5px;
}

.content .badge,
.content .badge.text-bg-secondary,
.content .badge.text-bg-success,
.content .badge.text-bg-warning,
.content .badge.text-bg-danger,
.content .badge.text-bg-primary {
    display: inline-block;
    padding: 3px 7px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 650;
    white-space: nowrap;
    border: 0;
}

.content .badge.text-bg-secondary { background: #e5f2ff !important; color: #0876e8 !important; }
.content .badge.text-bg-success { background: #ddf5e9 !important; color: #0b8c4e !important; }
.content .badge.text-bg-warning { background: #fff0d9 !important; color: #dc7900 !important; }
.content .badge.text-bg-danger { background: #ffe2e4 !important; color: #e62e35 !important; }
.content .badge.text-bg-primary { background: #e5f2ff !important; color: #0876e8 !important; }

.ord-filters .btn {
    align-self: flex-end;
}

.ord-card > .ord-filters,
.ord-card > .overview-filters,
.ord-card form.ord-filters {
    margin: 0 0 12px;
    box-shadow: none;
    background: #f7f9fc;
    border-color: #e3e9ef;
}

.overview-filters label,
.ord-filters label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
    font-weight: 650;
    color: #40536a;
    margin: 0;
}

.overview-filters select,
.overview-filters input,
.ord-filters select,
.ord-filters input {
    min-width: 140px;
    height: 34px;
    border: 1px solid #d7e0ea;
    border-radius: 5px;
    padding: 0 10px;
    background: #fff;
    color: #102344;
}

.desk {
    gap: 10px;
    margin: 10px 0 14px;
}

.desk a, .desk button {
    min-height: 92px;
    border-radius: 12px;
    border: 1px solid #dfe6ee;
    box-shadow: 0 1px 2px rgba(16, 35, 68, .04);
    padding: 12px 14px;
}

.desk a span, .desk button span {
    font-size: 12px;
    color: #63758a;
    font-weight: 650;
}

.desk a strong, .desk button strong {
    font-size: 22px;
    color: #102344;
    margin: 4px 0 2px;
}

.desk a em, .desk button em {
    font-style: normal;
    font-size: 11px;
    color: #5b6d83;
}

.desk a:hover, .desk button:hover, .desk button.on {
    border-color: #0876e8;
    background: #f3f8ff;
    outline: none;
}

.content .form-control,
.content .form-select {
    min-height: 34px;
    border-radius: 5px;
    border-color: #d7e0ea;
    font-size: 13px;
}

.content .form-check-label {
    font-size: 13px;
    color: #24344a;
}

.content .text-muted {
    color: #5b6d83 !important;
    font-size: 12px;
}

.content .alert-danger {
    background: #fff1f2;
    color: #9f1239;
}

.content .alert-success {
    background: #ecfdf3;
    color: #166534;
}

.tile-grid .tile {
    border-radius: 12px;
    padding: 12px 14px !important;
}

.tile-grid .tile .btn {
    margin-top: 6px;
}

.ops-map {
    border-radius: 8px;
    border: 1px solid #dfe6ee;
}

.content ol, .content ul {
    margin: 0 0 8px;
    padding-left: 1.2rem;
    font-size: 12px;
    color: #24344a;
}

.login-shell,
.driver-shell {
    max-width: 28rem;
    margin: 2rem auto;
    padding: 1.25rem 1.35rem;
    background: #fff;
    border: 1px solid #dfe6ee;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(16, 35, 68, .04);
}

.login-shell h1,
.driver-shell h1 {
    margin-bottom: 0.35rem;
}

/* ==========================================================================
   TMS M03: Điều phối & Lịch xe Skin (Mockup Fidelity)
   ========================================================================== */
.plan-skin {
    --navy: #122741;
    --blue: #1161e8;
    --ink: #0d2445;
    --muted: #627694;
    --line: #e3eaf3;
    --bg: #f5f8fc;
    font-family: Arial, "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--ink);
    font-size: 13px;
    line-height: 1.4;
    padding-bottom: 2rem;
}

.plan-skin .icon {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 1.9;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: none;
    display: inline-block;
    vertical-align: middle;
}

.plan-skin .ico-sm {
    width: 15px;
    height: 15px;
}

.plan-skin .plan-top {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.plan-skin .page-title {
    font-size: 21px;
    font-weight: 700;
    color: #101e35;
    margin: 0 0 4px;
}

.plan-skin .crumb {
    color: #53698a;
    font-size: 12px;
    display: flex;
    align-items: center;
}

.plan-skin .crumb span {
    margin: 0 8px;
    color: #8da2ba;
}

.plan-skin .panel {
    background: #fff;
    border: 1px solid #eaf0f7;
    border-radius: 7px;
    box-shadow: 0 1px 7px rgba(23, 45, 75, 0.05);
    margin-bottom: 12px;
}

.plan-skin .tabs {
    height: 44px;
    display: flex;
    gap: 22px;
    align-items: stretch;
    padding: 0 17px;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
}

.plan-skin .tab {
    border: 0;
    background: none;
    color: #344d70;
    padding: 0 2px;
    position: relative;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    font-size: 13px;
    transition: color 0.15s;
}

.plan-skin .tab:hover {
    color: #075ee9;
}

.plan-skin .tab.active {
    color: #075ee9;
    font-weight: 700;
}

.plan-skin .tab.active:after {
    content: "";
    height: 2px;
    background: #075ee9;
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
}

.plan-skin .toolbar {
    min-height: 60px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    flex-wrap: wrap;
    background: #fff;
}

.plan-skin .field {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 4px;
    white-space: nowrap;
}

.plan-skin .field label {
    font-size: 12px;
    color: #627694;
    margin: 0;
    font-weight: 500;
}

.plan-skin .select,
.plan-skin .datefield,
.plan-skin .squarebtn {
    height: 36px;
    border: 1px solid #dbe4f0;
    border-radius: 5px;
    background: #fff;
    color: #314867;
    font-size: 12px;
}

.plan-skin .select {
    min-width: 130px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.plan-skin select.select {
    cursor: pointer;
    outline: none;
}

.plan-skin .datefield {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    font-weight: 600;
}

.plan-skin .squarebtn {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    background: #fff;
    padding: 0;
}

.plan-skin .squarebtn:hover {
    background: #f1f5fa;
    border-color: #c7d5e6;
    color: #1161e8;
}

.plan-skin .push {
    margin-left: auto;
}

.plan-skin .btn-mock {
    height: 37px;
    padding: 0 15px;
    border: 1px solid #1261f2;
    background: white;
    border-radius: 5px;
    color: #075ce2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.plan-skin .btn-mock:hover {
    background: #f0f6ff;
    color: #054bb8;
}

.plan-skin .btn-mock:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background: #f8fafc;
    border-color: #d1dbe7;
    color: #7d90a6;
}

.plan-skin .btn-mock.primary {
    background: #1063e9;
    color: white;
    border-color: #1063e9;
}

.plan-skin .btn-mock.primary:hover {
    background: #0d53c7;
    border-color: #0d53c7;
}

.plan-skin .btn-mock.secondary {
    border-color: #dbe4f0;
    color: #1e3b64;
    font-weight: 500;
}

.plan-skin .btn-mock.secondary:hover {
    background: #f4f7fb;
}

.plan-skin .btn-mock.sm {
    height: 30px;
    padding: 0 10px;
    font-size: 11px;
}

/* KPIs */
.plan-skin .kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    padding: 12px 0 16px;
}

.plan-skin .kpi {
    min-height: 76px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    cursor: pointer;
    background: #fff;
    border: 1px solid #eaf0f7;
    border-radius: 7px;
    box-shadow: 0 1px 7px rgba(23, 45, 75, 0.04);
    transition: transform 0.12s, box-shadow 0.12s;
    text-decoration: none;
    color: inherit;
}

.plan-skin .kpi:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(23, 45, 75, 0.08);
}

.plan-skin .kpiicon {
    width: 41px;
    height: 41px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    flex: none;
}

.plan-skin .kpiicon .icon {
    width: 32px;
    height: 32px;
    stroke-width: 1.6;
}

.plan-skin .kpiicon.green { color: #0dbd83; }
.plan-skin .kpiicon.blue { color: #5b90ff; }
.plan-skin .kpiicon.cyan { color: #08b98d; }
.plan-skin .kpiicon.clock { color: #5b93ff; }
.plan-skin .kpiicon.red { color: #f84853; }

.plan-skin .kpi .meta {
    min-width: 0;
}

.plan-skin .kpi .meta .label {
    font-size: 12px;
    white-space: nowrap;
    color: #627694;
    font-weight: 500;
}

.plan-skin .kpi .meta .value {
    font-size: 21px;
    font-weight: 700;
    margin-top: 4px;
    color: #111c30;
}

.plan-skin .kpi .right {
    margin-left: auto;
    color: #d9e4f2;
}

/* Middle Section */
.plan-skin .middle {
    display: grid;
    grid-template-columns: 1.28fr 1fr;
    gap: 11px;
    margin-bottom: 12px;
}

.plan-skin .orders,
.plan-skin .map {
    height: 330px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.plan-skin .sectionhead {
    height: 46px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 15px;
    font-weight: 700;
    color: #092653;
    border-bottom: 1px solid #e8edf4;
    flex: none;
    background: #fff;
}

.plan-skin .sectionhead a {
    font-size: 12px;
    font-weight: 500;
    color: #005de8;
    cursor: pointer;
    text-decoration: none;
}

.plan-skin .sectionhead a:hover {
    text-decoration: underline;
}

.plan-skin .orders-table-wrap {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
}

.plan-skin .orders table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
    font-size: 12px;
}

.plan-skin .orders th {
    height: 38px;
    text-align: left;
    background: #f3f6fb;
    font-size: 11px;
    color: #13243d;
    font-weight: 600;
    padding: 0 10px;
    position: sticky;
    top: 0;
    z-index: 2;
    border-bottom: 1px solid #e8edf4;
}

.plan-skin .orders td {
    height: 42px;
    border-bottom: 1px solid #e8edf4;
    padding: 0 10px;
    color: #1e3555;
}

.plan-skin .orders tbody tr:hover {
    background: #f7fafe;
}

.plan-skin .orders th:first-child,
.plan-skin .orders td:first-child {
    padding-left: 14px;
    width: 40px;
    text-align: center;
}

.plan-skin .orders th:last-child,
.plan-skin .orders td:last-child {
    padding-right: 14px;
}

.plan-skin .orders a {
    color: #075de8;
    text-decoration: none;
    font-weight: 600;
}

.plan-skin .orders a:hover {
    text-decoration: underline;
}

.plan-skin .check {
    width: 16px;
    height: 16px;
    accent-color: #1161e8;
    cursor: pointer;
}

.plan-skin .priority {
    padding: 3px 9px;
    border-radius: 4px;
    font-size: 11px;
    display: inline-block;
    font-weight: 600;
}

.plan-skin .priority.high { background: #ffe0e0; color: #e51c2b; }
.plan-skin .priority.mid { background: #ffead0; color: #e16a00; }
.plan-skin .priority.low { background: #d7f3e4; color: #16824d; }

/* Map */
.plan-skin .map {
    position: relative;
    background-color: #eaf1f7;
    background-image: url('/assets/planning-map-mockup.png');
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    border: 1px solid #e8edf4;
    border-radius: 7px;
}

.plan-skin .map.fullscreen {
    position: fixed;
    inset: 20px;
    z-index: 1040;
    height: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

.plan-skin .maptool {
    position: absolute;
    right: 12px;
    top: 13px;
    display: grid;
    gap: 8px;
    z-index: 5;
}

.plan-skin .maptool button {
    width: 33px;
    height: 33px;
    border: 0;
    border-radius: 5px;
    background: white;
    box-shadow: 0 1px 5px rgba(52, 68, 90, 0.18);
    display: grid;
    place-items: center;
    color: #183657;
    cursor: pointer;
    transition: background 0.15s;
    padding: 0;
}

.plan-skin .maptool button:hover {
    background: #f0f4fa;
    color: #1161e8;
}

.plan-skin .maptool.bottom {
    top: auto;
    bottom: 14px;
    gap: 0;
}

.plan-skin .maptool.bottom button {
    border-radius: 0;
}

.plan-skin .maptool.bottom button:first-child {
    border-radius: 5px 5px 0 0;
}

.plan-skin .maptool.bottom button:last-child {
    border-radius: 0 0 5px 5px;
    border-top: 1px solid #e9edf4;
}

.plan-skin .map-overlay-city {
    position: absolute;
    transform: translate(-50%, -120%);
    font-size: 11px;
    font-weight: 700;
    color: #10243e;
    text-shadow: 0 1px 2px #fff, 0 0 4px #fff;
    pointer-events: none;
}

.plan-skin .map-pin-btn {
    position: absolute;
    width: 14px;
    height: 14px;
    padding: 0;
    border-radius: 50%;
    border: 2px solid #fff;
    transform: translate(-50%, -50%);
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: transform 0.15s;
}

.plan-skin .map-pin-btn:hover,
.plan-skin .map-pin-btn.on {
    transform: translate(-50%, -50%) scale(1.4);
    outline: 2px solid #005de8;
    z-index: 4;
}

.plan-skin .map-pin-btn.pickup { background: #16a34a; }
.plan-skin .map-pin-btn.delivery { background: #dc2626; }
.plan-skin .map-pin-btn.stop { background: #2563eb; }

/* Schedule / Timeline */
.plan-skin .schedule {
    overflow: hidden;
    margin-bottom: 12px;
}

.plan-skin .schedulehead {
    min-height: 56px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    flex-wrap: wrap;
    border-bottom: 1px solid #e8edf4;
    background: #fff;
}

.plan-skin .schedulehead h2 {
    font-size: 15px;
    margin: 0 18px 0 0;
    color: #092653;
    white-space: nowrap;
    font-weight: 700;
}

.plan-skin .seg {
    display: flex;
}

.plan-skin .seg button {
    height: 34px;
    border: 1px solid #dfe7f2;
    background: #fff;
    color: #23456c;
    padding: 0 16px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.15s;
}

.plan-skin .seg button:first-child {
    border-radius: 5px 0 0 5px;
}

.plan-skin .seg button:last-child {
    border-radius: 0 5px 5px 0;
    border-left: 0;
}

.plan-skin .seg button.on {
    background: #1161e8;
    color: #fff;
    border-color: #1161e8;
    font-weight: 600;
}

.plan-skin .schedtools {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.plan-skin .timelinewrap {
    overflow-x: auto;
    background: #fff;
}

.plan-skin .timeline {
    min-width: 1050px;
    display: grid;
    grid-template-columns: 348px 1fr;
}

.plan-skin .tlheadleft {
    height: 40px;
    display: grid;
    grid-template-columns: 142px 94px 1fr;
    align-items: center;
    background: #f3f6fb;
    border-top: 1px solid #e8edf4;
    border-bottom: 1px solid #e8edf4;
    padding-left: 15px;
    font-size: 12px;
    font-weight: 600;
    color: #13243d;
}

.plan-skin .hours {
    height: 40px;
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    align-items: center;
    background: #f3f6fb;
    border-top: 1px solid #e8edf4;
    border-bottom: 1px solid #e8edf4;
    color: #214064;
    font-size: 11px;
    font-weight: 600;
}

.plan-skin .hours span {
    text-align: center;
    white-space: nowrap;
}

.plan-skin .vehicle {
    height: 52px;
    border-bottom: 1px solid #e7ecf4;
    display: grid;
    grid-template-columns: 142px 94px 1fr;
    align-items: center;
    padding-left: 15px;
    background: #fff;
}

.plan-skin .truckcell {
    display: flex;
    gap: 8px;
    align-items: center;
}

.plan-skin .truckcell .icon {
    width: 24px;
    height: 24px;
    color: #153b70;
    flex: none;
}

.plan-skin .truckcell strong {
    font-size: 12px;
    color: #111c30;
    white-space: nowrap;
}

.plan-skin .truckcell small {
    display: block;
    color: #637b9d;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 105px;
}

.plan-skin .vehicle .type {
    font-size: 12px;
    color: #314867;
}

.plan-skin .vehicle .type small {
    display: block;
    color: #647b9d;
    margin-top: 2px;
}

.plan-skin .status {
    font-size: 11px;
    padding: 3px 7px;
    border-radius: 4px;
    display: inline-block;
    white-space: nowrap;
    font-weight: 500;
}

.plan-skin .status.running { background: #17b780; color: #fff; }
.plan-skin .status.planned { background: #cfe0ff; color: #0757ce; }
.plan-skin .status.wait { background: #ffe5c6; color: #eb6800; }
.plan-skin .status.maint { background: #e0e4e9; color: #31445b; }

.plan-skin .lane {
    height: 52px;
    position: relative;
    border-bottom: 1px solid #e7ecf4;
    background: repeating-linear-gradient(to right, transparent 0, transparent calc(100% / 15 - 1px), #eaf0f7 calc(100% / 15 - 1px), #eaf0f7 calc(100% / 15));
}

.plan-skin .bar {
    position: absolute;
    top: 6px;
    height: 40px;
    border-radius: 4px;
    color: white;
    padding: 4px 8px;
    font-size: 11px;
    line-height: 14px;
    box-shadow: 0 2px 5px rgba(23, 45, 75, 0.12);
    overflow: hidden;
    cursor: pointer;
    white-space: nowrap;
    text-overflow: ellipsis;
    transition: transform 0.12s, box-shadow 0.12s;
}

.plan-skin .bar:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(23, 45, 75, 0.2);
    z-index: 2;
}

.plan-skin .bar:before,
.plan-skin .bar:after {
    content: "";
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #214a87;
    top: 17px;
}

.plan-skin .bar:before { left: 0; }
.plan-skin .bar:after { right: 0; }

.plan-skin .bar.blue { background: linear-gradient(90deg, #3f79e8, #6ca3fa); }
.plan-skin .bar.green { background: linear-gradient(90deg, #82bf7c, #91ca88); color: #122a20; }
.plan-skin .bar.purple { background: linear-gradient(90deg, #9762d4, #aa83e4); }
.plan-skin .bar.orange { background: linear-gradient(90deg, #ff9221, #ffa234); }
.plan-skin .bar.red { background: linear-gradient(90deg, #fb4e50, #ff6d6c); }
.plan-skin .bar.gray { background: linear-gradient(90deg, #d9dce1, #e5e7ea); color: #25334b; }

.plan-skin .now {
    position: absolute;
    top: 0;
    bottom: 0;
    border-left: 1px dashed #ff5054;
    z-index: 3;
    pointer-events: none;
}

.plan-skin .now span {
    position: absolute;
    top: -38px;
    left: -14px;
    background: #f43d42;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

.plan-skin .lanearea {
    position: relative;
}

.plan-skin .schedulefoot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 16px;
    background: #fff;
    border-top: 1px solid #e8edf4;
    flex-wrap: wrap;
}

.plan-skin .schedulefoot-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #40536a;
}

.plan-skin .schedulefoot .list-pager {
    margin: 0;
    min-height: unset;
}


/* Tour Cards & Dropping */
.plan-skin .drop-lane {
    border: 2px dashed #b9cfe7;
    border-radius: 7px;
    padding: 12px 16px;
    text-align: center;
    color: #005de8;
    font-weight: 600;
    background: #f4f8fe;
    margin-bottom: 12px;
    transition: all 0.18s;
}

.plan-skin .drop-lane.on {
    border-color: #1161e8;
    background: #e7f1ff;
    transform: scale(1.005);
}

.plan-skin .pool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 12px;
    margin-top: 10px;
    align-items: start;
}

.plan-skin .tour-card {
    background: #fff;
    border: 1px solid #eaf0f7;
    border-radius: 7px;
    padding: 14px 16px;
    box-shadow: 0 1px 5px rgba(23, 45, 75, 0.04);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.plan-skin .tour-assign {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    width: 100%;
    min-width: 0;
}

.plan-skin .tour-assign .btn {
    width: 100%;
    min-width: 0;
    white-space: normal;
    word-break: break-word;
    font-size: 13px;
}

.plan-skin .tour-banner,
.plan-skin .tour-lock {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
    font-size: 13px;
}

.plan-skin .tour-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.plan-skin .tour-card:hover {
    box-shadow: 0 3px 10px rgba(23, 45, 75, 0.08);
}

.plan-skin .tour-card.drop-target {
    border-style: dashed;
    border-color: #005de8;
    background: #fafcfe;
}

.plan-skin .tour-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.plan-skin .tour-card-top .code {
    font-size: 15px;
    font-weight: 700;
    color: #075ee9;
}

.plan-skin .pill-tag {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
}

.plan-skin .pill-tag.draft { background: #e0e7ff; color: #3730a3; }
.plan-skin .pill-tag.submitted { background: #fef3c7; color: #92400e; }
.plan-skin .pill-tag.approved { background: #dcfce7; color: #166534; }
.plan-skin .pill-tag.returned { background: #fee2e2; color: #991b1b; }

.plan-skin .stops-container {
    padding: 8px 10px;
    background: #f7f9fc;
    border-radius: 6px;
    display: grid;
    gap: 6px;
    font-size: 12px;
}

.plan-skin .stop-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    border-radius: 4px;
    background: #fff;
    border: 1px solid #eef2f6;
    font-size: 11.5px;
}

.plan-skin .stop-badge {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.plan-skin .stop-badge.p { background: #dcfce7; color: #15803d; }
.plan-skin .stop-badge.d { background: #fee2e2; color: #b91c1c; }

/* Modal and Toast */
.plan-skin .toast-plan {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #102c50;
    color: white;
    padding: 12px 18px;
    border-radius: 7px;
    box-shadow: 0 8px 25px rgba(18, 38, 63, 0.28);
    z-index: 1070;
    font-size: 13px;
    animation: fadeIn 0.2s ease-out;
}

.plan-skin .modalshade {
    position: fixed;
    inset: 0;
    background: rgba(8, 24, 44, 0.65);
    display: grid;
    place-items: center;
    z-index: 2000;
    backdrop-filter: blur(2px);
}

.plan-skin .modal-box {
    width: min(530px, 92vw);
    background: white;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.plan-skin .modal-box h2 {
    margin: 0 0 16px;
    font-size: 18px;
    color: #102344;
    font-weight: 700;
}

.plan-skin .modal-box label {
    display: block;
    margin: 12px 0 6px;
    font-size: 12px;
    color: #53698a;
    font-weight: 600;
}

.plan-skin .modal-box .form-check label,
.plan-skin .modal-box label.form-check-label,
.plan-skin .modal-box .alloc-mode-card label {
    display: inline-block !important;
    margin: 0 !important;
}

.plan-skin .modal-box input:not([type="radio"]):not([type="checkbox"]),
.plan-skin .modal-box select {
    height: 37px;
    width: 100%;
    border: 1px solid #dbe4ef;
    border-radius: 5px;
    padding: 0 11px;
    font-size: 13px;
    color: #102344;
    outline: none;
    background: #fff;
}

.plan-skin .modal-box input[type="radio"],
.plan-skin .modal-box input[type="checkbox"] {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    margin: 0 !important;
    padding: 0 !important;
    cursor: pointer;
    vertical-align: middle;
}

.alloc-mode-card {
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    background-color: #fff;
    transition: all 0.2s ease-in-out;
}
.alloc-mode-card:hover {
    border-color: #9ec5fe;
    background-color: #f8fafd;
}
.alloc-mode-card.active {
    border-color: #0d6efd !important;
    background-color: #f0f7ff !important;
    box-shadow: 0 2px 6px rgba(13, 110, 253, 0.12);
}

.plan-skin .modal-box input:focus,
.plan-skin .modal-box select:focus {
    border-color: #1161e8;
}

.plan-skin .modalactions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}

.plan-skin .note {
    font-size: 12px;
    color: #617792;
    margin-top: 8px;
    line-height: 1.4;
}

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

@media (max-width: 1250px) {
    .plan-skin .kpis { gap: 8px; }
    .plan-skin .kpi { padding: 10px 12px; gap: 8px; }
    .plan-skin .kpi .meta .label { font-size: 11px; }
    .plan-skin .middle { grid-template-columns: 1fr; }
    .plan-skin .map { height: 310px; }
    .plan-skin .orders { height: 310px; }
}

@media (max-width: 850px) {
    .plan-skin .kpis { grid-template-columns: repeat(2, 1fr); }
    .plan-skin .toolbar { gap: 8px; }
    .plan-skin .schedulehead { flex-wrap: wrap; padding: 12px; }
    .plan-skin .schedtools { margin-left: 0; }
    .plan-skin .pool-grid { grid-template-columns: 1fr; }
}

/* Trip picker cards — global so button defaults never show black border if scope misses */
.smart-sel__row {
    appearance: none;
    -webkit-appearance: none;
    border: 0 !important;
    background: #fff;
    box-shadow: none;
    border-radius: 0;
    text-align: left;
    width: 100%;
    padding: 8px 10px;
    cursor: pointer;
}
.smart-sel__row:focus { outline: none; }
.smart-sel__row:focus-visible { box-shadow: inset 0 0 0 2px #93c5fd; }
.smart-sel__group-title { white-space: nowrap; }
.smart-sel__code { display: block; }
.smart-sel__resource { display: block; color: #334155; font-size: 12px; }
.smart-sel__status { display: block; font-size: 11px; color: #64748b; }
