﻿:root {
    --vf-red: #da0f24;
    --vf-red-dark: #970817;
    --vf-blue: #0c5bff;
    --vf-blue-dark: #08349f;
    --vf-cyan: #23d2ff;
    --vf-bg: #eef3fb;
    --vf-panel: #ffffff;
    --vf-text: #172235;
    --vf-muted: #5d6f8c;
    --vf-line: #d4deee;
    --vf-dark: #0a1836;
    --vf-motion: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--vf-text);
    background: var(--vf-bg);
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 14px;
}
a { text-decoration: none; }
.content a:not(.btn) {
    color: var(--vf-blue-dark);
    font-weight: 600;
    text-decoration-color: rgba(12, 91, 255, 0.45);
    text-underline-offset: 3px;
    transition: color .18s ease, text-decoration-color .18s ease;
}
.content a:not(.btn):hover {
    color: var(--vf-red);
    text-decoration: underline;
    text-decoration-color: rgba(218, 15, 36, 0.55);
}
.app-shell { min-height: 100vh; display: flex; }
.sidebar {
    width: 264px;
    background:
        radial-gradient(circle at 100% 10%, rgba(35, 210, 255, .30), transparent 32%),
        linear-gradient(180deg, #081632 0%, #0a2c73 46%, #8d0e1f 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    will-change: transform;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 66px;
    padding: 12px 14px;
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    box-shadow: none;
}
.brand-mark {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: #ffffff;
    border: 1px solid #bed7ff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
    overflow: hidden;
    flex: 0 0 auto;
}
.brand-logo {
    width: 38px;
    height: 31px;
    object-fit: contain;
    display: block;
}
.brand-wordmark,
.login-brand-wordmark {
    display: inline-flex;
    align-items: baseline;
    font-family: "Arial Black", "Segoe UI Black", Impact, sans-serif;
    font-weight: 900;
    line-height: .9;
    letter-spacing: 0;
    text-transform: uppercase;
    white-space: nowrap;
    filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .18));
}
.brand-wordmark {
    font-size: 21px;
    max-width: calc(100% - 56px);
}
.brand-wordmark-red,
.brand-wordmark-blue {
    display: inline-block;
    -webkit-text-stroke: .28px rgba(255, 255, 255, .9);
    text-shadow:
        0 0 1px rgba(255, 255, 255, .65),
        0 1px 0 rgba(255, 255, 255, .22);
}
.brand-wordmark-red {
    color: #ed1025;
    -webkit-text-fill-color: #ed1025;
}
.brand-wordmark-blue {
    color: #0c63df;
    -webkit-text-fill-color: #0c63df;
}
.sidebar-nav {
    display: grid;
    gap: 6px;
    padding: 10px 9px;
    overflow-y: auto;
}
.sidebar-nav a,
.nav-section-toggle,
.logout {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    padding: 9px 12px;
    color: rgba(255,255,255,.82);
    border-radius: 7px;
    border: 1px solid transparent;
    position: relative;
    z-index: 1;
    transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.nav-section {
    position: relative;
    border: 1px solid transparent;
    border-radius: 10px;
    overflow: hidden;
    transition: background .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.nav-section[open],
.nav-section.active {
    background: rgba(255,255,255,.07);
    border-color: rgba(255,255,255,.13);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.nav-section[open]::before {
    content: "";
    position: absolute;
    top: 48px;
    bottom: 12px;
    left: 25px;
    width: 1px;
    border-radius: 999px;
    background: rgba(255,255,255,.24);
}
.nav-section-toggle {
    justify-content: space-between;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.nav-section-toggle::-webkit-details-marker {
    display: none;
}
.nav-section-toggle > span {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.nav-section-toggle > span > i,
.sidebar-nav a > i {
    width: 18px;
    flex: 0 0 18px;
    text-align: center;
}
.nav-folder-icon-open {
    display: none;
}
.nav-section[open] .nav-folder-icon-closed {
    display: none;
}
.nav-section[open] .nav-folder-icon-open {
    display: inline-block;
    color: var(--vf-cyan);
}
.nav-section-toggle span span,
.sidebar-nav a span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nav-section-chevron {
    margin-left: auto;
    font-size: 12px;
    opacity: .78;
    transition: transform .22s var(--vf-motion), opacity .18s ease;
}
.nav-section[open] .nav-section-chevron {
    transform: rotate(180deg);
    opacity: 1;
}
.nav-section-items {
    display: grid;
    gap: 2px;
    margin: 2px 7px 8px 30px;
    padding: 2px 0 2px 7px;
    transform-origin: top;
    animation: navSectionIn .24s var(--vf-motion) both;
}
.nav-section-items .nav-child {
    min-height: 34px;
    padding: 8px 11px;
    font-size: 13px;
    border-radius: 7px;
    border-left: 2px solid transparent;
    background: transparent;
}
.sidebar-nav a:hover,
.sidebar-nav a.active,
.nav-section-toggle:hover,
.nav-section.active > .nav-section-toggle {
    background: rgba(255,255,255,.12);
    color: #fff;
    border-color: rgba(255,255,255,.16);
}
.sidebar-nav a:hover,
.nav-section-toggle:hover {
    transform: translateX(1px);
}
.sidebar-nav a.active,
.nav-section-items .nav-child.active {
    background: rgba(255,255,255,.14);
    border-color: rgba(255,255,255,.18);
    box-shadow: inset 3px 0 0 rgba(255,255,255,.36);
}
.nav-section-items .nav-child:hover {
    background: rgba(255,255,255,.09);
}
.nav-section-items .nav-child.active {
    border-left-color: var(--vf-cyan);
    box-shadow: inset 2px 0 0 var(--vf-cyan);
}
.nav-section.active > .nav-section-toggle {
    background: rgba(255,255,255,.10);
    box-shadow: inset 3px 0 0 rgba(35,210,255,.46);
}
.logout {
    margin: auto 10px 12px;
    color: #fff;
    border: 1px solid rgba(255,255,255,.14);
}
.main { margin-left: 264px; flex: 1; min-width: 0; }
.topbar {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 20px;
    background: #fff;
    border-bottom: 1px solid var(--vf-line);
    position: sticky;
    top: 0;
    z-index: 10;
}
.topbar h1 { margin: 0; font-size: 20px; color: var(--vf-blue-dark); font-weight: 750; }
.topbar span { color: var(--vf-muted); font-size: 12px; }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.topbar-user i { font-size: 26px; color: var(--vf-blue); }
.topbar-user small { display: block; color: var(--vf-muted); }
.sidebar-toggle,
.sidebar-close {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--vf-line);
    border-radius: 12px;
    background: #fff;
    color: var(--vf-blue-dark);
    box-shadow: 0 8px 20px rgba(8, 52, 159, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.85);
    transition: transform .2s var(--vf-motion), border-color .2s ease, background .2s ease, color .2s ease, box-shadow .2s ease;
}
.sidebar-toggle:hover,
.sidebar-toggle:focus-visible {
    border-color: rgba(12, 91, 255, .34);
    color: var(--vf-blue);
    box-shadow: 0 10px 24px rgba(8, 52, 159, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.92);
}
.sidebar-toggle:active,
.sidebar-close:active {
    transform: scale(.94);
}
.sidebar-close {
    position: absolute;
    top: 14px;
    right: 12px;
    z-index: 2;
    border-color: rgba(255, 255, 255, .2);
    background: rgba(255, 255, 255, .12);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
}
.sidebar-close:hover,
.sidebar-close:focus-visible {
    border-color: rgba(255, 255, 255, .42);
    background: rgba(255, 255, 255, .2);
    color: #fff;
}
.menu-glyph {
    position: relative;
    width: 18px;
    height: 14px;
    display: inline-block;
}
.menu-glyph span {
    position: absolute;
    left: 0;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transform-origin: 50% 50%;
    transition: transform .28s var(--vf-motion), top .28s var(--vf-motion), opacity .18s ease, width .22s ease;
}
.menu-glyph span:nth-child(1) { top: 0; }
.menu-glyph span:nth-child(2) { top: 6px; width: 13px; }
.menu-glyph span:nth-child(3) { top: 12px; width: 16px; }
.sidebar-toggle[aria-expanded="true"] .menu-glyph span:nth-child(1),
.menu-glyph-close span:nth-child(1) {
    top: 6px;
    width: 18px;
    transform: rotate(45deg);
}
.sidebar-toggle[aria-expanded="true"] .menu-glyph span:nth-child(2),
.menu-glyph-close span:nth-child(2) {
    opacity: 0;
    transform: translateX(-5px) scaleX(.4);
}
.sidebar-toggle[aria-expanded="true"] .menu-glyph span:nth-child(3),
.menu-glyph-close span:nth-child(3) {
    top: 6px;
    width: 18px;
    transform: rotate(-45deg);
}
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 18;
    border: 0;
    padding: 0;
    background: rgba(5, 14, 33, .52);
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(3px);
    transition: opacity .28s ease;
}
.sidebar-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}
body.sidebar-mobile-open {
    overflow: hidden;
}
.content { padding: 18px 20px 28px; }
.vf-card {
    background: var(--vf-panel);
    border: 1px solid var(--vf-line);
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.vf-card + .vf-card { margin-top: 14px; }
.vf-card-title { margin: 0 0 12px; color: var(--vf-blue-dark); font-weight: 750; font-size: 16px; }
.dashboard-pro {
    display: grid;
    gap: 16px;
}
.dashboard-pro .vf-card + .vf-card {
    margin-top: 0;
}
.dash-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 18px;
    min-height: 220px;
    padding: 22px;
    border-radius: 18px;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 84% 16%, rgba(35, 210, 255, .32), transparent 28%),
        radial-gradient(circle at 12% 12%, rgba(218, 15, 36, .26), transparent 30%),
        linear-gradient(135deg, #071634 0%, #0a2c73 54%, #8d0e1f 100%);
    box-shadow: 0 22px 60px rgba(8, 52, 159, .20);
}
.dash-hero::after {
    content: "";
    position: absolute;
    inset: auto -90px -120px auto;
    width: 300px;
    height: 300px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .06);
    pointer-events: none;
}
.dash-hero-copy,
.dash-command-card {
    position: relative;
    z-index: 1;
}
.dash-hero-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-bottom: 12px;
    padding: 6px 10px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 999px;
    background: rgba(255,255,255,.10);
    color: rgba(255,255,255,.86);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.dash-hero h2 {
    max-width: 680px;
    margin: 0;
    font-size: clamp(25px, 3vw, 38px);
    line-height: 1.04;
    font-weight: 850;
    letter-spacing: -.035em;
}
.dash-hero p {
    max-width: 620px;
    margin: 12px 0 0;
    color: rgba(255,255,255,.76);
    font-size: 14px;
    line-height: 1.6;
}
.dash-hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}
.dash-hero-actions .btn-vf-outline {
    color: #fff;
    border-color: rgba(255,255,255,.25);
    background: rgba(255,255,255,.10);
}
.dash-hero-actions .btn-vf-outline:hover {
    color: #fff;
    border-color: rgba(255,255,255,.46);
    background: rgba(255,255,255,.16);
}
.dash-command-card {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 8px;
    min-height: 176px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 18px;
    background: rgba(255,255,255,.10);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
    backdrop-filter: blur(8px);
}
.dash-command-card > span,
.dash-command-card small {
    color: rgba(255,255,255,.74);
    font-size: 12px;
    font-weight: 700;
}
.dash-command-card > strong {
    font-size: 34px;
    line-height: 1;
    letter-spacing: -.03em;
}
.dash-ring {
    width: 92px;
    height: 92px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background:
        radial-gradient(circle closest-side, rgba(7, 22, 52, .88) 72%, transparent 74%),
        conic-gradient(#23d2ff calc(var(--value) * 1%), rgba(255,255,255,.16) 0);
}
.dash-ring span {
    color: rgba(255,255,255,.84);
    font-size: 12px;
    font-weight: 800;
}
.dash-kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: stretch;
    gap: 16px;
}
.dash-kpi-card {
    position: relative;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
    min-height: 122px;
    height: 100%;
    padding: 14px;
    border: 1px solid var(--vf-line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(16,24,40,.06);
    overflow: hidden;
}
.dash-kpi-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: var(--kpi-color, var(--vf-blue));
}
.dash-kpi-card.primary { --kpi-color: var(--vf-blue); }
.dash-kpi-card.info { --kpi-color: var(--vf-cyan); }
.dash-kpi-card.success { --kpi-color: #198754; }
.dash-kpi-card.warning { --kpi-color: #f36f21; }
.dash-kpi-card.danger { --kpi-color: var(--vf-red); }
.dash-kpi-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: var(--kpi-color, var(--vf-blue));
    background: color-mix(in srgb, var(--kpi-color, var(--vf-blue)) 11%, #fff);
}
.dash-kpi-card span,
.dash-kpi-card small {
    display: block;
    color: var(--vf-muted);
    font-size: 12px;
}
.dash-kpi-card span {
    font-weight: 800;
}
.dash-kpi-card strong {
    display: block;
    margin: 4px 0 3px;
    color: var(--vf-dark);
    font-size: 25px;
    line-height: 1.05;
    letter-spacing: -.03em;
}
.dash-main-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 16px;
}
.dash-span-2 {
    grid-column: span 2;
}
.dash-chart-card {
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(16,24,40,.05);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}
.dash-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    min-height: 42px;
    margin-bottom: 12px;
}
.dash-card-head.compact {
    align-items: center;
}
.dash-card-head .vf-card-title {
    margin-bottom: 0;
}
.dash-card-head p {
    margin: 5px 0 0;
    color: var(--vf-muted);
    font-size: 12px;
}
.dash-chip {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 4px 9px;
    border: 1px solid #c4d7ff;
    border-radius: 999px;
    background: #edf4ff;
    color: var(--vf-blue-dark);
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}
.dash-chip.success {
    border-color: #c8e6d3;
    background: #eef8f1;
    color: #146c43;
}
.dash-chip.warning {
    border-color: #ffd8a8;
    background: #fff7ec;
    color: #9a4b00;
}
.dash-chip.danger {
    border-color: #f3bbc3;
    background: #fff1f3;
    color: #970817;
}
.dash-chart-box {
    flex: 0 0 auto;
    height: 232px;
    min-height: 0;
}
.dash-chart-box.tall {
    height: 232px;
    min-height: 0;
}
.dash-ops-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, .75fr);
    align-items: start;
    gap: 16px;
}
.dash-work-card,
.dash-alert-card {
    border-radius: 14px;
}
.dash-work-card {
    height: auto;
    min-height: 170px;
}
.dash-alert-stack {
    display: grid;
    gap: 16px;
    height: auto;
}
.dash-alert-card {
    display: flex;
    flex-direction: column;
    min-height: 132px;
}
.dash-order-list,
.dash-alert-list {
    display: grid;
    gap: 9px;
}
.dash-order-row {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(160px, .7fr) minmax(130px, .5fr);
    align-items: center;
    gap: 14px;
    padding: 12px;
    border: 1px solid #e0e8f4;
    border-radius: 12px;
    background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.dash-order-row:hover {
    transform: translateY(-1px);
    border-color: #bcd0ef;
    box-shadow: 0 12px 26px rgba(8,52,159,.08);
    text-decoration: none !important;
}
.dash-order-main {
    min-width: 0;
}
.dash-order-main strong,
.dash-alert-item strong {
    display: block;
    color: var(--vf-blue-dark);
    font-weight: 850;
}
.dash-order-main span,
.dash-alert-item span {
    display: block;
    margin-top: 3px;
    color: var(--vf-muted);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dash-order-progress {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38px;
    align-items: center;
    gap: 9px;
}
.dash-order-progress div {
    height: 9px;
    border-radius: 999px;
    background: #e8eef7;
    overflow: hidden;
}
.dash-order-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #23d2ff 0%, var(--vf-blue) 100%);
}
.dash-order-progress small,
.dash-order-meta small,
.dash-alert-item small {
    color: var(--vf-muted);
    font-size: 11px;
    font-weight: 700;
}
.dash-order-meta {
    display: grid;
    justify-items: end;
    gap: 5px;
}
.dash-alert-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid #e3eaf4;
    border-radius: 12px;
    background: #fff;
}
.dash-alert-item i {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: #9a4b00;
    background: #fff7ec;
}
.dash-alert-item.danger i {
    color: #970817;
    background: #fff1f3;
}
.dash-empty {
    padding: 14px;
    border: 1px dashed #cbd8ea;
    border-radius: 12px;
    color: var(--vf-muted);
    background: #f8fbff;
    font-weight: 700;
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 7px 14px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.15;
}
.btn i {
    font-size: 15px;
    line-height: 1;
}
.btn-sm {
    gap: 5px;
    min-height: 30px;
    padding: 5px 9px;
    border-radius: 6px;
    font-size: 12px;
}
.btn-sm i {
    font-size: 13px;
}
.btn-lg {
    min-height: 42px;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 14px;
}
.btn-vf {
    color: #fff;
    border: 1px solid #970817;
    background: linear-gradient(135deg, #e21b32 0%, #b4081a 100%);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 8px 18px rgba(151, 8, 23, .14);
}
.btn-vf:hover,
.btn-vf:focus,
.btn-vf:active {
    color: #fff;
    border-color: #7c0714;
    background: linear-gradient(135deg, #d4142a 0%, #970817 100%);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .16) inset, 0 6px 14px rgba(151, 8, 23, .12);
}
.btn-vf:active {
    background: #870716;
}
.btn-vf-outline {
    --bs-btn-bg: #fff;
    --bs-btn-border-color: #a9bdea;
    --bs-btn-color: var(--vf-blue-dark);
    --bs-btn-hover-bg: #eef4ff;
    --bs-btn-hover-border-color: var(--vf-blue);
    --bs-btn-hover-color: #0a3ea8;
    --bs-btn-active-bg: #dce8ff;
    --bs-btn-active-border-color: var(--vf-blue-dark);
    --bs-btn-active-color: var(--vf-blue-dark);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset;
}
.btn-outline-danger {
    --bs-btn-bg: #fff;
    --bs-btn-border-color: #f0b7c0;
    --bs-btn-color: #a60b1b;
    --bs-btn-hover-bg: #fff1f3;
    --bs-btn-hover-border-color: #dc3545;
    --bs-btn-hover-color: #8f0715;
    --bs-btn-active-bg: #ffe3e8;
    --bs-btn-active-border-color: #a60b1b;
    --bs-btn-active-color: #8f0715;
}
.form-control,
.form-select {
    min-height: 38px;
    padding: 7px 11px;
    border-radius: 7px;
    border-color: #cfd9e8;
    color: var(--vf-text);
    font-size: 13px;
    line-height: 1.2;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .75) inset;
}
.form-control:focus,
.form-select:focus {
    border-color: #7ea6ff;
    box-shadow: 0 0 0 3px rgba(12, 91, 255, .12);
}
.form-control-lg,
.form-select-lg {
    min-height: 40px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
}
textarea.form-control {
    min-height: 86px;
    line-height: 1.45;
}
.stat-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; }
.stat-card { background: #fff; border: 1px solid var(--vf-line); border-top: 4px solid var(--vf-blue); padding: 14px; border-radius: 8px; }
.stat-card.warning { border-top-color: var(--vf-red); }
.stat-card span { color: var(--vf-muted); display: block; min-height: 34px; }
.stat-card strong { display: block; margin-top: 8px; font-size: 28px; color: var(--vf-blue-dark); }
.table thead th { background: #f8fafc; color: #596273; white-space: nowrap; font-weight: 650; }
.dataTables_wrapper {
    color: var(--vf-text);
}
.dataTables_wrapper .row:first-child {
    align-items: center;
    gap: 8px 0;
    margin-bottom: 10px;
}
.dataTables_wrapper .row:last-child {
    align-items: center;
    gap: 8px 0;
    margin-top: 10px;
}
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--vf-muted);
    font-size: 12px;
    font-weight: 650;
}
.dataTables_wrapper .dataTables_length .form-select,
.dataTables_wrapper .dataTables_filter .form-control {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 12px;
}
.dataTables_wrapper .dataTables_length .form-select {
    width: 82px;
}
.dataTables_wrapper .dataTables_filter .form-control {
    width: min(240px, 45vw);
}
.dataTables_wrapper .datatable-filter-col {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}
.dataTables_wrapper .datatable-toolbar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.dataTables_wrapper .dataTables_info {
    color: var(--vf-muted);
    font-size: 12px;
    padding-top: 0;
}
.dataTables_wrapper .pagination {
    gap: 4px;
    margin: 0;
}
.dataTables_wrapper .page-link {
    min-width: 30px;
    min-height: 30px;
    padding: 5px 9px;
    border-radius: 6px;
    border-color: #d7e1ef;
    color: var(--vf-blue-dark);
    font-size: 12px;
    font-weight: 700;
}
.dataTables_wrapper .page-item.active .page-link {
    border-color: #970817;
    background: linear-gradient(135deg, #e21b32 0%, #b4081a 100%);
    color: #fff;
}
.dataTables_wrapper .page-item.disabled .page-link {
    color: #9aa8ba;
    background: #f7f9fc;
}
table.dataTable {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}
table.dataTable > thead > tr > th,
table.dataTable > thead > tr > td {
    border-bottom-color: var(--vf-line);
}
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control {
    position: relative;
    padding-left: 46px;
    cursor: pointer;
}
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control::before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control::before {
    position: absolute !important;
    top: 50% !important;
    left: 12px !important;
    width: 22px !important;
    height: 22px !important;
    margin-top: 0 !important;
    border: 1px solid #a9bdea !important;
    border-radius: 7px !important;
    background: #f8fbff !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .08) !important;
    color: transparent !important;
    content: "" !important;
    display: block !important;
    font-size: 0 !important;
    line-height: 0 !important;
    text-indent: -9999px !important;
    transform: translateY(-50%) !important;
    transition: background .16s ease, border-color .16s ease, box-shadow .16s ease !important;
}
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control::after,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control::after {
    position: absolute;
    top: 50%;
    left: 23px;
    width: 10px;
    height: 10px;
    background:
        linear-gradient(currentColor, currentColor) center / 10px 2px no-repeat,
        linear-gradient(currentColor, currentColor) center / 2px 10px no-repeat;
    color: var(--vf-blue-dark);
    content: "" !important;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: color .16s ease, transform .16s ease;
    z-index: 1;
}
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:hover::before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control:hover::before {
    border-color: var(--vf-blue) !important;
    background: #edf4ff !important;
    box-shadow: 0 4px 10px rgba(12, 91, 255, .14) !important;
}
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:hover::after,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control:hover::after {
    color: #0a3ea8;
}
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > td.dtr-control::before,
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > th.dtr-control::before {
    border-color: #970817 !important;
    background: linear-gradient(135deg, #e21b32 0%, #b4081a 100%) !important;
    box-shadow: 0 4px 10px rgba(151, 8, 23, .16) !important;
}
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > td.dtr-control::after,
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > th.dtr-control::after {
    height: 2px;
    background: currentColor;
    color: #fff;
}
table.dataTable > tbody > tr.child td.child {
    padding: 10px 14px;
    background: #f8fafc;
}
table.dataTable > tbody > tr.child ul.dtr-details {
    width: 100%;
    margin: 0;
}
table.dataTable > tbody > tr.child ul.dtr-details > li {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 7px 0;
    border-bottom-color: #e2e8f0;
}
table.dataTable > tbody > tr.child span.dtr-title {
    color: var(--vf-muted);
    font-weight: 750;
}
table.dataTable > tbody > tr.child span.dtr-data {
    text-align: right;
}
.badge-soft { background: #edf4ff; color: var(--vf-blue-dark); border: 1px solid #c4d7ff; }
.form-label { color: #485366; font-weight: 650; }
.action-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters .form-control,
.filters .form-select {
    width: clamp(210px, 26vw, 320px);
    min-width: 210px;
    max-width: 100%;
}
.filters .btn {
    height: 40px;
    min-width: 92px;
}
.action-bar > .btn,
.action-bar > .d-flex > .btn {
    height: 40px;
}
.status-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 7px 10px;
    border: 1px solid #ffd8a8;
    border-radius: 8px;
    background: #fff7ec;
    color: #9a4b00;
    font-size: 12px;
    font-weight: 750;
}
.admin-status-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-left: 4px solid var(--vf-blue);
}
.admin-status-copy {
    min-width: 0;
}
.admin-status-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}
.admin-status-form .form-select {
    min-width: 170px;
}
.qc-final-card form {
    padding-top: 4px;
    border-top: 1px solid #edf2f8;
}
.sop-flow-card {
    border-left: 4px solid var(--vf-blue);
}
.sop-flow-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}
.sop-flow-step {
    min-height: 132px;
    display: grid;
    gap: 5px;
    align-content: start;
    padding: 11px;
    border: 1px solid #d9e4f3;
    border-radius: 8px;
    background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
}
.sop-flow-step.qc {
    border-color: #f3bbc3;
    background: linear-gradient(180deg, #fff 0%, #fff6f7 100%);
}
.sop-flow-no {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #edf4ff;
    color: var(--vf-blue-dark);
    font-size: 12px;
    font-weight: 850;
}
.sop-flow-step.qc .sop-flow-no {
    background: #fff1f3;
    color: var(--vf-red-dark);
}
.sop-flow-step strong {
    color: var(--vf-blue-dark);
    font-size: 13px;
    line-height: 1.25;
}
.sop-flow-step small,
.sop-flow-step p {
    margin: 0;
    color: var(--vf-muted);
    font-size: 12px;
    line-height: 1.35;
}
.qc-checklist-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.qc-check-item {
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 8px 10px;
    border: 1px solid #d9e4f3;
    border-radius: 8px;
    background: #f8fbff;
    color: var(--vf-blue-dark);
    font-size: 13px;
    font-weight: 700;
}
.process-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.process-step { border: 1px solid var(--vf-line); padding: 10px; border-radius: 7px; background: #fff; }
.process-step.pass { border-left: 4px solid #198754; }
.process-step.fail { border-left: 4px solid #dc3545; }
.process-step-list {
    border: 1px solid var(--vf-line);
    border-radius: 8px;
    overflow: hidden;
}
.process-step-list .list-group-item {
    border-width: 0 0 1px;
    border-color: var(--vf-line);
    padding: 9px 14px;
    color: var(--vf-blue-dark);
    font-size: 13px;
    font-weight: 650;
    transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}
.process-step-list .list-group-item:last-child {
    border-bottom-width: 0;
}
.process-step-list .list-group-item:hover {
    color: #062d86;
    background: #f4f8ff;
}
.process-step-list .list-group-item.active {
    color: #fff;
    border-color: var(--vf-line);
    background: linear-gradient(90deg, #b80c20 0%, #175be8 100%);
    box-shadow: inset 4px 0 0 rgba(255, 255, 255, .74);
}
.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 12% 16%, rgba(218,15,36,.38), transparent 36%),
        radial-gradient(circle at 88% 12%, rgba(35,210,255,.26), transparent 34%),
        linear-gradient(135deg, #091a3b 0%, #0f2f73 46%, #7f0d1c 100%);
}
.login-card { width: min(420px, calc(100vw - 28px)); background: #fff; padding: 28px; border-radius: 12px; box-shadow: 0 24px 70px rgba(0,0,0,.32); }
.login-brand { display: flex; gap: 14px; align-items: center; margin-bottom: 20px; }
.login-brand-mark {
    width: 66px;
    height: 66px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid #bed7ff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
    overflow: hidden;
    flex: 0 0 auto;
}
.login-brand-logo { width: 56px; height: 45px; object-fit: contain; display: block; }
.login-brand-wordmark { font-size: 31px; margin-bottom: 4px; }
.login-brand small, .login-hint { color: var(--vf-muted); }
.chart-box { height: 280px; }
.qr-img { width: 150px; height: 150px; border: 1px solid var(--vf-line); padding: 6px; background: #fff; }
@media print {
    .sidebar, .topbar, .no-print, .action-bar { display: none !important; }
    .main { margin-left: 0; }
    .content { padding: 0; }
    .vf-card { border: 0; box-shadow: none; }
}
@media (max-width: 1199px) {
    .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .process-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sop-flow-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .dash-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .dash-main-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dash-span-2 { grid-column: span 2; }
    .dash-ops-grid { grid-template-columns: 1fr; }
}
@media (max-width: 991px) {
    .sidebar {
        width: min(286px, calc(100vw - 26px));
        z-index: 30;
        border-radius: 0 22px 22px 0;
        overflow: hidden;
        box-shadow: 24px 0 70px rgba(5, 14, 33, .34);
        transform: translateX(calc(-100% - 22px));
        transition: transform .42s var(--vf-motion);
    }
    .sidebar .brand {
        padding-right: 58px;
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar.open .brand,
    .sidebar.open .nav-section-toggle,
    .sidebar.open .sidebar-nav a,
    .sidebar.open .logout {
        animation: sidebarItemIn .46s var(--vf-motion) both;
    }
    .sidebar.open .sidebar-nav a:nth-child(1) { animation-delay: .04s; }
    .sidebar.open .sidebar-nav a:nth-child(2) { animation-delay: .07s; }
    .sidebar.open .sidebar-nav a:nth-child(3) { animation-delay: .10s; }
    .sidebar.open .sidebar-nav a:nth-child(4) { animation-delay: .13s; }
    .sidebar.open .sidebar-nav a:nth-child(5) { animation-delay: .16s; }
    .sidebar.open .sidebar-nav a:nth-child(6) { animation-delay: .19s; }
    .sidebar.open .sidebar-nav a:nth-child(7) { animation-delay: .22s; }
    .sidebar.open .sidebar-nav a:nth-child(8) { animation-delay: .25s; }
    .sidebar.open .logout { animation-delay: .28s; }
    .main { margin-left: 0; }
    .dash-hero {
        grid-template-columns: 1fr;
    }
    .dash-command-card {
        min-height: 150px;
    }
    .dash-order-row {
        grid-template-columns: 1fr;
    }
    .dash-order-meta {
        justify-items: start;
    }
    .admin-status-card,
    .admin-status-form {
        align-items: stretch;
        flex-direction: column;
    }
    .admin-status-form .form-select {
        min-width: 0;
        width: 100%;
    }
}
@media (max-width: 640px) {
    .content { padding: 12px; }
    .stat-grid, .process-grid { grid-template-columns: 1fr; }
    .sop-flow-grid,
    .qc-checklist-grid { grid-template-columns: 1fr; }
    .dashboard-pro { gap: 12px; }
    .dash-hero { padding: 16px; border-radius: 14px; }
    .dash-hero h2 { font-size: 25px; }
    .dash-hero-actions,
    .dash-hero-actions .btn {
        width: 100%;
    }
    .dash-kpi-grid,
    .dash-main-grid {
        grid-template-columns: 1fr;
    }
    .dash-span-2 {
        grid-column: auto;
    }
    .dash-chart-box,
    .dash-chart-box.tall {
        height: 220px;
        min-height: 0;
    }
    .dash-card-head {
        align-items: flex-start;
        flex-direction: column;
    }
    .dash-alert-item {
        grid-template-columns: 34px minmax(0, 1fr);
    }
    .dash-alert-item small {
        grid-column: 2;
    }
    .topbar-user { display: none; }
    .filters .form-control, .filters .form-select { min-width: 100%; width: 100%; }
    .filters .btn { width: 100%; }
    .dataTables_wrapper .datatable-filter-col {
        justify-content: stretch;
    }
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .datatable-toolbar,
    .dataTables_wrapper .datatable-toolbar .btn,
    .dataTables_wrapper .dataTables_filter .form-control {
        width: 100%;
    }
}
@keyframes sidebarItemIn {
    from {
        opacity: 0;
        transform: translateX(-12px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
@keyframes navSectionIn {
    from {
        opacity: 0;
        transform: translateY(-6px) scaleY(.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scaleY(1);
    }
}
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
@media (hover: none) and (pointer: coarse) {
    input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]),
    select,
    textarea,
    .form-control,
    .form-select,
    .dataTables_wrapper .dataTables_length .form-select,
    .dataTables_wrapper .dataTables_filter .form-control,
    .filters .form-control,
    .filters .form-select {
        font-size: 16px !important;
    }
}
@supports (-webkit-touch-callout: none) {
    input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]),
    select,
    textarea,
    .form-control,
    .form-select,
    .dataTables_wrapper .dataTables_length .form-select,
    .dataTables_wrapper .dataTables_filter .form-control,
    .filters .form-control,
    .filters .form-select {
        font-size: 16px !important;
    }
}
