:root {
  color: #1d2730;
  background: #f4f7f7;
  font-family: "IBM Plex Sans", "Noto Sans SC", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: #f4f7f7; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 208px minmax(0, 1fr); }
.sidebar { background: #173535; color: #edf5f2; padding: 22px 14px; display: flex; flex-direction: column; gap: 32px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; font-size: 16px; font-weight: 600; }
.brand-mark { width: 28px; height: 28px; display: grid; place-items: center; color: #173535; background: #d0dd75; font-size: 11px; }
nav { display: grid; gap: 5px; }
.nav-item { display: flex; gap: 11px; align-items: center; min-height: 40px; padding: 0 10px; color: #aebfbd; text-decoration: none; border-left: 2px solid transparent; }
.nav-item svg { width: 17px; }
.nav-item.active, .nav-item:hover { color: #ffffff; background: #24504e; border-left-color: #d0dd75; }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 8px; color: #aebfbd; font-size: 12px; }
.pulse { width: 7px; height: 7px; background: #d0dd75; border-radius: 50%; }

main { min-width: 0; padding: 28px 32px 44px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-bottom: 24px; }
.eyebrow { margin: 0 0 4px; color: #6d7b81; font-size: 12px; }
h1, h2 { margin: 0; font-weight: 500; }
h1 { font-size: 25px; }
h2 { font-size: 16px; }
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.icon-command, .primary-command { min-height: 36px; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid #cad5d4; background: #ffffff; color: #34464b; }
.primary-command { background: #173535; color: #ffffff; border-color: #173535; }
.icon-command svg, .primary-command svg { width: 16px; }
.icon-command input { display: none; }

.filter-bar { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px; margin-bottom: 20px; background: #ffffff; border: 1px solid #dce4e2; }
.filter-label { display: inline-flex; align-items: center; gap: 7px; color: #53666a; margin-right: 4px; }
.filter-label svg { width: 15px; }
.filter-bar label { display: inline-flex; align-items: center; gap: 7px; color: #66767b; }
select, input { min-height: 32px; border: 1px solid #cbd6d4; border-radius: 3px; padding: 0 8px; background: #ffffff; color: #25373b; }
.route-search { margin-left: auto; min-width: min(300px, 100%); }
.route-search svg { width: 15px; }
.route-search input { width: 100%; border: 0; padding-left: 0; }
.route-search:focus-within { outline: 2px solid #a9c5ba; outline-offset: 2px; }
.icon-button { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid #cbd6d4; background: #ffffff; color: #465b5f; }
.icon-button svg { width: 15px; }

.overview-grid { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); border: 1px solid #dce4e2; background: #ffffff; }
.metric { min-height: 120px; padding: 18px; border-right: 1px solid #dce4e2; }
.metric:last-child { border-right: 0; }
.metric p { margin: 0 0 10px; color: #607075; }
.metric strong { display: block; margin-bottom: 8px; font-size: 27px; font-weight: 500; font-variant-numeric: tabular-nums; }
.metric span { color: #79888c; font-size: 12px; }
.metric.emphasis { background: #f3f7e2; }
.metric.emphasis strong { color: #506600; }
.metric.warning { background: #fff6ec; }
.metric.warning strong { color: #b65c16; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); gap: 18px; margin-top: 18px; }
.panel { min-width: 0; padding: 18px; background: #ffffff; border: 1px solid #dce4e2; }
.panel-heading { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 18px; }
.data-state, .table-count { color: #586b70; font-size: 12px; padding: 4px 7px; background: #edf2f1; }
.funnel { display: grid; grid-template-columns: repeat(5, minmax(85px, 1fr)); gap: 9px; align-items: end; min-height: 168px; }
.funnel-step { display: grid; gap: 8px; }
.funnel-bar-space { height: 98px; display: flex; align-items: end; border-bottom: 1px solid #cad6d3; }
.funnel-bar { width: 100%; min-height: 4px; background: #285e58; transition: height .2s ease; }
.funnel-step:nth-child(2) .funnel-bar { background: #4e8479; }
.funnel-step:nth-child(3) .funnel-bar { background: #83a991; }
.funnel-step:nth-child(4) .funnel-bar { background: #aec36f; }
.funnel-step:nth-child(5) .funnel-bar { background: #d0dd75; }
.funnel-value { font-size: 21px; font-weight: 500; font-variant-numeric: tabular-nums; }
.funnel-label { color: #65757a; font-size: 12px; line-height: 1.35; }
.panel-note { margin: 16px 0 0; color: #718086; font-size: 12px; }

.efficiency-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.time-metric { min-height: 86px; padding: 12px; background: #f6f8f8; border-left: 3px solid #72a39a; }
.time-metric:nth-child(2) { border-left-color: #d0b15e; }
.time-metric:nth-child(3) { border-left-color: #af8762; }
.time-metric span, .time-metric small { display: block; color: #65767b; }
.time-metric strong { display: block; margin: 8px 0 5px; font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; }
.distribution-chart { display: grid; gap: 8px; margin-top: 18px; }
.distribution-row { display: grid; grid-template-columns: 95px 1fr 46px; gap: 9px; align-items: center; color: #5c6b70; font-size: 12px; }
.distribution-track { height: 8px; overflow: hidden; background: #ebf0ef; }
.distribution-fill { height: 100%; background: #245c56; }

.backlog-panel { margin-top: 18px; }
.table-heading { align-items: center; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 940px; }
th { color: #728087; font-size: 12px; font-weight: 500; text-align: left; padding: 10px 8px; border-bottom: 1px solid #dce4e2; white-space: nowrap; }
td { padding: 12px 8px; color: #33474b; border-bottom: 1px solid #edf1f0; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
.order-id { color: #243f42; font-weight: 500; }
.subtext { display: block; margin-top: 3px; color: #7a888d; font-size: 12px; }
.stage { display: inline-block; padding: 3px 6px; color: #42615d; background: #eaf2ef; font-size: 12px; white-space: nowrap; }
.stage.wait { color: #8f4c11; background: #fff0df; }
.stage.risk { color: #9d4216; background: #fde7df; }
.priority { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 12px; }
.priority-dot { width: 7px; height: 7px; border-radius: 50%; background: #74a49a; }
.priority-dot.high { background: #c45b24; }.priority-dot.medium { background: #d0a03e; }.priority-dot.low { background: #74a49a; }

.route-grid { grid-template-columns: 1fr 1fr; }
.rank-list { display: grid; }
.rank-row { display: grid; grid-template-columns: 1fr 36px 58px; gap: 12px; align-items: center; min-height: 47px; border-bottom: 1px solid #edf1f0; }
.rank-row:last-child { border-bottom: 0; }
.rank-name { min-width: 0; color: #33474b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-count { color: #273c40; font-variant-numeric: tabular-nums; text-align: right; }
.rank-risk { color: #a15420; text-align: right; font-size: 12px; }
.empty { color: #76868b; padding: 28px 0; text-align: center; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 5; max-width: 360px; padding: 11px 13px; color: #ffffff; background: #173535; opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.spinning { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 980px) { .overview-grid { grid-template-columns: repeat(3, 1fr); }.metric:nth-child(3) { border-right: 0; }.metric:nth-child(-n+3) { border-bottom: 1px solid #dce4e2; }.content-grid { grid-template-columns: 1fr; }.route-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .app-shell { grid-template-columns: 1fr; }.sidebar { display: none; } main { padding: 18px 14px 30px; }.topbar { align-items: flex-start; flex-direction: column; }.top-actions { justify-content: flex-start; }.filter-bar { align-items: stretch; flex-wrap: wrap; }.route-search { margin-left: 0; flex: 1 1 100%; }.overview-grid { grid-template-columns: repeat(2, 1fr); }.metric { border-bottom: 1px solid #dce4e2; }.metric:nth-child(2n) { border-right: 0; }.metric:last-child { grid-column: span 2; }.funnel { grid-template-columns: repeat(5, minmax(65px, 1fr)); overflow-x: auto; }.efficiency-metrics { grid-template-columns: 1fr; }.route-grid { grid-template-columns: 1fr; } }
