:root {
  --ink: #0b1720;
  --muted: #657482;
  --line: #dce5ea;
  --surface: #ffffff;
  --canvas: #eef3f5;
  --nav: #071521;
  --nav-2: #0c2230;
  --green: #00a875;
  --green-2: #0bc991;
  --green-soft: #dff8ef;
  --blue: #1479f8;
  --blue-soft: #e8f2ff;
  --amber: #f2a61b;
  --amber-soft: #fff3d5;
  --red: #e04444;
  --red-soft: #ffe8e8;
  --self-operated: #9f1239;
  --self-operated-soft: #fff1f2;
  --slate-soft: #edf2f5;
  --shadow: 0 16px 45px rgba(9, 27, 39, .08);
  --radius: 18px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { margin: 0; min-height: 100vh; background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(20,121,248,.32); outline-offset: 2px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .02em; }

.brand-mark {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px;
  background: rgba(255,255,255,.07);
}
.brand-mark i { width: 4px; border-radius: 4px; background: var(--green-2); }
.brand-mark i:nth-child(1) { height: 18px; }
.brand-mark i:nth-child(2) { height: 29px; }
.brand-mark i:nth-child(3) { height: 23px; }
.brand-mark i:nth-child(4) { height: 34px; }
.brand-mark.small { width: 38px; height: 38px; border-radius: 11px; gap: 3px; }
.brand-mark.small i { width: 3px; transform: scale(.72); }

.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(310px, 490px) minmax(410px, 620px);
  grid-template-rows: auto 1fr;
  align-items: center;
  justify-content: center;
  column-gap: clamp(50px, 9vw, 150px);
  padding: 48px;
  color: white;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at 78% 25%, rgba(0, 201, 145, .2), transparent 29%),
    linear-gradient(145deg, #06131f 0%, #0a2330 60%, #103540 100%);
}
.auth-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .28;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}
.auth-brand { grid-column: 1 / -1; align-self: start; display: flex; gap: 14px; align-items: center; position: relative; z-index: 1; }
.brand-name { font-size: 20px; font-weight: 800; letter-spacing: .02em; }
.brand-note { margin-top: 4px; color: #9fb2bd; font-size: 13px; }
.auth-card {
  background: white;
  color: var(--ink);
  padding: clamp(30px, 5vw, 52px);
  border-radius: 28px;
  box-shadow: 0 35px 90px rgba(0,0,0,.28);
  position: relative;
  z-index: 1;
}
.auth-kicker { color: var(--green); font-weight: 800; font-size: 14px; letter-spacing: .1em; }
.auth-card h1 { font-size: clamp(28px, 4vw, 42px); margin: 10px 0 8px; letter-spacing: -.04em; }
.auth-card > p { margin: 0 0 28px; color: var(--muted); line-height: 1.7; }
.auth-card form { display: grid; gap: 18px; }
label { color: #3b4a55; font-size: 14px; font-weight: 700; display: grid; gap: 8px; }
input, select {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid #cad6dc;
  border-radius: 11px;
  background: white;
  color: var(--ink);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(0,168,117,.14); }
.button {
  min-height: 42px;
  padding: 0 17px;
  border: 0;
  border-radius: 11px;
  font-weight: 800;
  white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .5; transform: none; cursor: not-allowed; }
.button-large { min-height: 52px; margin-top: 4px; }
.button-primary { background: var(--green); color: white; box-shadow: 0 10px 24px rgba(0,168,117,.22); }
.button-primary:hover { background: #008f65; }
.button-secondary { background: white; color: var(--ink); border: 1px solid var(--line); }
.button-dark { background: var(--nav); color: white; }
.button-danger { background: var(--red-soft); color: #b72c2c; }
.form-error { min-height: 24px; margin-top: 14px; color: var(--red); font-size: 14px; font-weight: 700; }
.auth-visual { align-self: center; position: relative; z-index: 1; }
.mini-stat { padding: 24px 26px; border-radius: 20px 20px 0 0; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(16px); display: flex; justify-content: space-between; gap: 30px; }
.mini-stat b { font-size: 20px; }
.mini-stat span { color: #9fb4bf; }
.flow-line { display: flex; align-items: center; padding: 45px 42px; background: rgba(255,255,255,.05); border-inline: 1px solid rgba(255,255,255,.12); }
.flow-line i { width: 38px; height: 38px; border: 7px solid #49606c; border-radius: 50%; background: #0d2733; box-shadow: 0 0 0 6px rgba(255,255,255,.04); }
.flow-line i.done { border-color: var(--green-2); }
.flow-line em { flex: 1; height: 5px; background: linear-gradient(90deg, var(--green-2) 62%, #49606c 62%); }
.mini-ready { padding: 24px 26px; border-radius: 0 0 20px 20px; background: var(--green-2); color: #041c16; display: flex; justify-content: space-between; align-items: end; }
.mini-ready span { font-weight: 800; }
.mini-ready strong { font-size: 24px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0, 1fr); }
.sidebar {
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  padding: 23px 16px 18px;
  color: white;
  background: var(--nav);
  z-index: 20;
}
.sidebar-brand { display: flex; gap: 11px; align-items: center; padding: 0 7px 27px; }
.sidebar-brand strong { display: block; font-size: 16px; }
.sidebar-brand span { display: block; margin-top: 4px; color: #78909d; font-size: 12px; }
.primary-nav { display: grid; gap: 7px; }
.nav-button {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  color: #a9bbc4;
  background: transparent;
  font-weight: 700;
  text-align: left;
}
.nav-button:hover { background: rgba(255,255,255,.05); color: white; }
.nav-button.active { color: white; background: var(--nav-2); box-shadow: inset 3px 0 0 var(--green-2); }
.nav-icon { width: 20px; height: 20px; display: grid; place-items: center; font-size: 17px; }
.sidebar-user { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid rgba(255,255,255,.09); display: grid; grid-template-columns: 38px 1fr 34px; gap: 10px; align-items: center; min-width: 0; }
.user-avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--green); font-weight: 900; }
.sidebar-user strong, .sidebar-user span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user strong { font-size: 14px; }
.sidebar-user span { margin-top: 3px; color: #78909d; font-size: 12px; }
.icon-button { width: 34px; height: 34px; border: 0; border-radius: 10px; background: rgba(255,255,255,.07); color: #a9bbc4; font-size: 18px; }

.workspace { min-width: 0; }
.topbar { min-height: 94px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 18px clamp(22px, 3vw, 46px); background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 15; backdrop-filter: blur(16px); }
.eyebrow { color: var(--green); font-size: 12px; font-weight: 900; letter-spacing: .12em; }
.topbar h1 { margin: 5px 0 0; font-size: 24px; letter-spacing: -.03em; }
.topbar-actions { display: flex; gap: 12px; align-items: center; }
.mobile-logout { display: none; }
.live-pill { height: 40px; padding: 0 14px; display: flex; align-items: center; gap: 9px; border-radius: 999px; background: var(--green-soft); color: #007854; font-size: 13px; font-weight: 800; }
.live-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(0,168,117,.13); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px rgba(0,168,117,0); } }
.view { padding: clamp(20px, 3vw, 42px); max-width: 1680px; margin: 0 auto; }

.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(140px, 1fr)); gap: 14px; }
.dashboard-kpi-group + .dashboard-kpi-group { margin-top: 18px; }
.dashboard-kpi-heading { display: flex; align-items: baseline; gap: 12px; margin: 0 0 10px 2px; }
.dashboard-kpi-heading h2 { margin: 0; font-size: 16px; }
.dashboard-kpi-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.overview-kpis, .attention-kpis { grid-template-columns: repeat(4, minmax(160px, 1fr)); }
.waiting-kpis { grid-template-columns: repeat(3, minmax(160px, 1fr)); }
.dashboard-kpi-group .kpi-grid { grid-auto-rows: 126px; }
.dashboard-kpi-group .metric-button, .dashboard-kpi-group .kpi-card { height: 100%; }
.package-kpis { grid-template-columns: repeat(3, minmax(160px, 1fr)); max-width: 900px; }
.kpi-card { min-height: 126px; padding: 20px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); border: 1px solid rgba(220,229,234,.75); position: relative; overflow: hidden; }
.kpi-card::after { content: ""; width: 72px; height: 72px; position: absolute; right: -18px; bottom: -27px; border-radius: 50%; background: var(--slate-soft); }
.kpi-card.green::after { background: var(--green-soft); }
.kpi-card.amber::after { background: var(--amber-soft); }
.kpi-card.red::after { background: var(--red-soft); }
.kpi-card.blue::after { background: var(--blue-soft); }
.kpi-card.self-operated { border: 2px solid rgba(159,18,57,.72); background: var(--self-operated-soft); }
.kpi-card.self-operated::after { background: #fecdd3; }
.kpi-label { color: var(--muted); font-size: 14px; font-weight: 700; }
.kpi-value { margin-top: 13px; font-size: 36px; font-weight: 900; line-height: 1; letter-spacing: -.04em; }
.kpi-foot { margin-top: 12px; color: var(--muted); font-size: 12px; }
.kpi-card.green .kpi-value { color: var(--green); }
.kpi-card.amber .kpi-value { color: #bf7900; }
.kpi-card.red .kpi-value { color: var(--red); }
.kpi-card.blue .kpi-value { color: var(--blue); }
.kpi-card.self-operated .kpi-label, .kpi-card.self-operated .kpi-value { color: var(--self-operated); }
.metric-button { min-width: 0; padding: 0; border: 0; border-radius: var(--radius); background: transparent; color: inherit; text-align: left; }
.metric-button .kpi-card { height: 100%; transition: transform .15s ease, box-shadow .15s ease; }
.metric-button:hover .kpi-card { transform: translateY(-2px); box-shadow: 0 19px 48px rgba(9,27,39,.13); }

.dashboard-grid { margin-top: 18px; display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(310px, .8fr); gap: 18px; align-items: start; }
.panel { background: var(--surface); border: 1px solid rgba(220,229,234,.85); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.panel-header { min-height: 68px; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.panel-header h2 { margin: 0; font-size: 18px; }
.panel-header p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.panel-body { padding: 20px; }
.craft-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.craft-card { border: 1px solid var(--line); border-radius: 15px; padding: 16px; background: #fbfcfd; }
.craft-button, .status-button { width: 100%; padding: 0; border: 0; border-radius: 15px; background: transparent; color: inherit; text-align: left; }
.craft-button .craft-card { transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.craft-button:hover .craft-card { transform: translateY(-2px); border-color: rgba(20,121,248,.35); box-shadow: 0 10px 25px rgba(20,121,248,.09); }
.craft-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.craft-name { display: flex; align-items: center; gap: 9px; font-weight: 900; }
.craft-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--blue); }
.craft-count { font-size: 13px; color: var(--muted); }
.progress-track { margin-top: 13px; height: 9px; background: #e7edf0; border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green), var(--green-2)); }
.craft-meta { display: flex; justify-content: space-between; margin-top: 9px; font-size: 12px; color: var(--muted); }

.status-stack { display: grid; gap: 12px; }
.status-row { display: grid; grid-template-columns: 12px 1fr auto; gap: 11px; align-items: center; padding: 14px 0; border-bottom: 1px solid #edf1f3; }
.status-row:last-child { border-bottom: 0; }
.status-swatch { width: 10px; height: 35px; border-radius: 5px; background: var(--green); }
.status-swatch.blue { background: var(--blue); }
.status-swatch.amber { background: var(--amber); }
.status-swatch.red { background: var(--red); }
.status-swatch.gray { background: #9aabb4; }
.status-row strong { display: block; font-size: 14px; }
.status-row span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.status-number { font-size: 25px; font-weight: 900; }
.status-button .status-row { padding-left: 8px; padding-right: 8px; border-radius: 11px; transition: background .15s ease; }
.status-button:hover .status-row { background: #f5f8f9; }

.section-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.section-title h2 { margin: 0; font-size: 22px; }
.section-title p { margin: 7px 0 0; color: var(--muted); }
.toolbar-actions { display: flex; gap: 10px; align-items: center; }
.worker-task-tools { flex-wrap: wrap; justify-content: flex-end; }
.search-box.worker-task-search { min-width: min(360px, 100%); }
.search-box { display: flex; gap: 8px; min-width: min(420px, 100%); }
.search-box input { min-height: 44px; }
.filter-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-pill { min-height: 38px; padding: 0 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: white; font-weight: 800; }
.filter-pill.active { color: #007854; border-color: rgba(0,168,117,.32); background: var(--green-soft); }

.order-grid { display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: 14px; }
.order-card { border: 1px solid var(--line); border-radius: 17px; background: white; box-shadow: 0 9px 28px rgba(12,37,49,.06); overflow: hidden; transition: transform .15s ease, box-shadow .15s ease; }
.order-card:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(12,37,49,.11); }
.order-card.ready { border-color: rgba(0,168,117,.35); box-shadow: 0 9px 30px rgba(0,168,117,.1); }
.order-card.overdue { border-color: rgba(242,166,27,.5); }
.order-card.severe { border-color: rgba(224,68,68,.58); box-shadow: 0 9px 30px rgba(224,68,68,.09); }
.order-card-head { padding: 17px 18px 14px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.order-no { font-size: 22px; font-weight: 950; letter-spacing: .01em; }
.order-shop { margin-top: 5px; color: var(--muted); font-size: 13px; }
.badge { display: inline-flex; min-height: 27px; align-items: center; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 900; white-space: nowrap; }
.badge.green { background: var(--green-soft); color: #007854; }
.badge.blue { background: var(--blue-soft); color: #0c65ca; }
.badge.amber { background: var(--amber-soft); color: #a86500; }
.badge.red { background: var(--red-soft); color: #b42c2c; }
.badge.gray { background: var(--slate-soft); color: #60717b; }
.badge.urgent { background: #ffdfdc; color: #be1f16; }
.badge.self-operated { background: var(--self-operated); color: white; }
.card-badges { display: grid; gap: 6px; justify-items: end; }
.order-progress { padding: 0 18px 15px; }
.order-progress-line { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 800; }
.order-card-foot { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 18px; border-top: 1px solid #edf1f3; background: #fbfcfd; color: var(--muted); font-size: 12px; }
.order-time-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 18px 14px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.package-order-card { min-height: 340px; display: flex; flex-direction: column; }
.package-order-card .order-card-head { padding: 20px 20px 14px; }
.package-order-identity { min-width: 0; }
.package-order-label { display: block; margin-bottom: 6px; color: #526976; font-size: 12px; font-weight: 800; }
.package-order-no { color: var(--nav); font-size: 30px; font-weight: 950; line-height: 1; letter-spacing: .015em; }
.package-order-card .order-shop { margin-top: 9px; color: #526976; font-weight: 700; }
.package-imprint { margin: 0 18px 16px; padding: 13px 14px 14px; border-radius: 12px; background: var(--blue-soft); box-shadow: inset 0 0 0 1px rgba(20,121,248,.12); }
.package-imprint span { display: block; color: #0c65ca; font-size: 12px; font-weight: 900; }
.package-imprint strong { display: block; margin-top: 5px; color: #102c42; font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
.package-order-card .order-card-foot { margin-top: auto; }
.card-click { border: 0; width: 100%; padding: 0; background: transparent; color: inherit; text-align: left; }

.scan-layout { display: grid; grid-template-columns: minmax(340px, .9fr) minmax(0, 1.6fr); gap: 18px; align-items: start; }
.scan-console { padding: clamp(22px, 4vw, 36px); color: white; background: linear-gradient(145deg, #071521, #103546); border-radius: 22px; box-shadow: 0 24px 55px rgba(7,21,33,.22); position: sticky; top: 116px; overflow: hidden; }
.scan-console::after { content: ""; position: absolute; width: 220px; height: 220px; right: -90px; bottom: -100px; border-radius: 50%; background: rgba(11,201,145,.13); }
.scan-console h2 { margin: 0; font-size: 26px; }
.scan-console p { color: #9eb3be; line-height: 1.7; }
.scan-craft { margin: 25px 0 13px; color: var(--green-2); font-size: 13px; font-weight: 900; letter-spacing: .12em; }
.scan-form { position: relative; z-index: 1; }
.scan-form input { min-height: 62px; padding: 0 18px; border: 2px solid transparent; font-size: 24px; font-weight: 900; }
.scan-form .button { width: 100%; min-height: 52px; margin-top: 12px; background: var(--green-2); color: #05231a; }
.scan-hint { margin-top: 15px; color: #8098a4; font-size: 12px; }
.scan-feedback { margin-top: 18px; padding: 17px; border-radius: 14px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); position: relative; z-index: 1; }
.scan-feedback.success { background: rgba(11,201,145,.16); border-color: rgba(11,201,145,.35); }
.scan-feedback.error { background: rgba(224,68,68,.18); border-color: rgba(224,68,68,.35); }
.scan-feedback strong { display: block; font-size: 17px; }
.scan-feedback span { display: block; margin-top: 6px; color: #afc1c9; font-size: 13px; }

.task-list { display: grid; gap: 11px; }
.task-card { display: grid; grid-template-columns: 9px minmax(140px,.7fr) minmax(210px,1.15fr) minmax(150px,.75fr) minmax(110px,.5fr) minmax(160px,.7fr); gap: 16px; align-items: center; padding: 17px 18px; background: white; border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 7px 22px rgba(9,27,39,.05); }
.task-card.urgent { border-color: rgba(224,68,68,.27); }
.task-card.self-operated { border-color: rgba(159,18,57,.62); background: #fffafb; }
.priority-bar { align-self: stretch; border-radius: 8px; background: var(--blue); }
.task-card.urgent .priority-bar { background: var(--red); }
.task-card.overdue .priority-bar { background: var(--amber); }
.task-card.severe .priority-bar { background: var(--red); }
.task-card.self-operated .priority-bar { background: var(--self-operated); }
.task-order strong { display: block; font-size: 17px; }
.task-order span, .task-product span, .task-qty span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.task-product strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-product .task-payment { margin-top: 7px; color: #435560; font-weight: 700; }
.task-qty strong { font-size: 21px; }
.task-imprint { min-width: 0; padding: 10px 12px; border-radius: 11px; background: var(--blue-soft); }
.task-imprint > span { display: block; color: #0c65ca; font-size: 11px; font-weight: 800; }
.task-imprint > strong { display: block; margin-top: 4px; overflow-wrap: anywhere; }
.task-imprint > small { display: block; margin-top: 7px; color: #50636f; line-height: 1.45; }
.task-current-reason { margin-top: 9px; padding: 9px 10px; border: 1px solid rgba(224,68,68,.28); border-radius: 9px; background: var(--red-soft); }
.task-current-reason span, .task-current-reason strong, .task-current-reason small { display: block; }
.task-current-reason span { color: #b42c2c; font-size: 11px; font-weight: 900; }
.task-current-reason strong { margin-top: 3px; color: #c32626; line-height: 1.45; overflow-wrap: anywhere; }
.task-current-reason small { margin-top: 4px; color: #925353; font-size: 11px; }
.task-actions { display: grid; gap: 8px; justify-items: start; }
.task-note-button, .edit-task, .delete-task { min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: white; color: #354854; font-weight: 800; }
.delete-task { border-color: #f2b8b8; color: #c73333; background: #fff7f7; }
.task-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.worker-board-grid { display: grid; grid-template-columns: repeat(5,minmax(120px,1fr)); gap: 10px; margin-bottom: 18px; }
.worker-board { min-height: 112px; padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: white; color: inherit; text-align: left; box-shadow: 0 7px 22px rgba(9,27,39,.05); }
.worker-board:hover, .worker-board.active { border-color: rgba(20,121,248,.45); background: var(--blue-soft); }
.worker-board.red.active { border-color: rgba(224,68,68,.42); background: var(--red-soft); }
.worker-board.amber.active { border-color: rgba(242,166,27,.48); background: var(--amber-soft); }
.worker-board.self-operated { border: 2px solid rgba(159,18,57,.72); background: var(--self-operated-soft); }
.worker-board.self-operated span, .worker-board.self-operated strong { color: var(--self-operated); }
.worker-board.self-operated:hover, .worker-board.self-operated.active { border-color: var(--self-operated); background: #ffe4e6; }
.worker-board span, .worker-board small { display: block; }
.worker-board span { color: var(--muted); font-weight: 800; }
.worker-board strong { display: block; margin: 7px 0; font-size: 28px; }
.worker-board small { color: var(--muted); }
.self-operated-summary { color: var(--self-operated); }
.order-id-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.copy-order { min-height: 28px; padding: 0 8px; border: 1px solid #bfd0d8; border-radius: 8px; background: white; color: #36515f; font-size: 11px; font-weight: 800; opacity: 0; transform: translateY(2px); transition: opacity .15s ease, transform .15s ease; }
.copy-order.always, .order-card:hover .copy-order, .order-card:focus-within .copy-order, .task-card:hover .copy-order, .task-card:focus-within .copy-order, .logistics-row:hover .copy-order, .logistics-row:focus-within .copy-order { opacity: 1; transform: none; }
.pack-tools { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.72); }
.pack-tools .filter-pills { margin: 0; }
.date-filter { min-height: 38px; display: inline-flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--muted); font-size: 12px; font-weight: 800; }
.date-filter input { min-width: 124px; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; }
.note-input { width: 100%; resize: vertical; padding: 12px; border: 1px solid #cad6dc; border-radius: 11px; color: var(--ink); }
.edit-form { display: grid; gap: 14px; }
.craft-detail-actions { display: grid; gap: 6px; justify-items: end; }
.drawer-search { width: 100%; margin: 14px 0 12px; }
.review-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 14px 0; padding: 18px; border: 1px solid #f0cf83; border-radius: 16px; background: #fff9e9; }
.review-toolbar > div:first-child { display: grid; gap: 4px; }
.review-toolbar span { color: #9a6800; font-size: 12px; font-weight: 900; letter-spacing: .08em; }
.review-toolbar strong { font-size: 17px; }
.review-toolbar small { color: var(--muted); line-height: 1.5; }
.review-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.timeline { display: grid; gap: 0; }
.timeline-row { display: grid; grid-template-columns: 125px 1fr; gap: 4px 10px; padding: 11px 0; border-top: 1px solid #edf1f3; }
.timeline-row:first-child { border-top: 0; }
.timeline-row > span { grid-row: 1 / 3; color: var(--muted); font-size: 12px; }
.timeline-row small { color: var(--muted); line-height: 1.45; }
.table-actions { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.logistics-scan { display: flex; justify-content: space-between; gap: 24px; align-items: end; padding: 22px; margin-bottom: 20px; border-radius: 18px; background: var(--nav); color: white; }
.logistics-scan span { color: var(--green-2); font-size: 12px; font-weight: 900; }
.logistics-scan h2 { margin: 6px 0; }
.logistics-scan p { margin: 0; color: #a9bbc4; }
.logistics-list { display: grid; gap: 9px; }
.logistics-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 16px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: white; cursor: pointer; }
.logistics-row > div:last-child { display: grid; justify-items: end; gap: 5px; }
.logistics-row span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.older-logistics { margin-top: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.58); }
.older-logistics summary { margin-bottom: 12px; font-weight: 900; cursor: pointer; }
.screen-summary { display: grid; grid-template-columns: repeat(auto-fit,minmax(170px,1fr)); gap: 12px; }
.screen-summary .kpi-card { min-height: 116px; box-shadow: none; }
.screen-summary .kpi-value { font-size: 32px; }
.screen-grid { display: grid; grid-template-columns: 1.6fr .8fr; gap: 18px; margin-top: 18px; }
.screen-ready-list { display: grid; gap: 10px; }
.screen-ready-list > button { width: 100%; padding: 12px; border: 1px solid transparent; border-radius: 11px; background: var(--green-soft); color: inherit; text-align: left; }
.screen-ready-list > button:hover { border-color: rgba(0,168,117,.38); background: #cff2e5; }
.screen-ready-list strong, .screen-ready-list span { display: block; }
.screen-ready-list span { margin-top: 4px; color: #356053; font-size: 12px; }

.import-drop { min-height: 220px; display: grid; place-items: center; text-align: center; padding: 34px; border: 2px dashed #bdccd3; border-radius: 20px; background: rgba(255,255,255,.65); }
.import-drop.dragging { border-color: var(--green); background: var(--green-soft); }
.import-drop-icon { width: 62px; height: 62px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 18px; background: var(--green-soft); color: var(--green); font-size: 27px; font-weight: 900; }
.import-drop h2 { margin: 0; font-size: 21px; }
.import-drop p { color: var(--muted); }
.file-name { margin-top: 13px; font-weight: 800; color: var(--green); }
.preview-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 18px; }
.summary-tile { padding: 17px; border-radius: 14px; border: 1px solid var(--line); background: white; }
.summary-tile span { display: block; color: var(--muted); font-size: 12px; }
.summary-tile strong { display: block; margin-top: 7px; font-size: 25px; }
.warning-list { display: grid; gap: 9px; max-height: 330px; overflow: auto; }
.warning-row { padding: 13px 14px; border-radius: 11px; background: var(--amber-soft); display: grid; grid-template-columns: 100px 1fr; gap: 12px; font-size: 13px; }
.warning-row strong { color: #945c00; }

.data-table-wrap { overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 780px; }
.data-table th { padding: 12px 13px; position: sticky; top: 0; background: #f2f6f7; color: #51626d; font-size: 12px; text-align: left; border-bottom: 1px solid var(--line); }
.data-table td { padding: 13px; font-size: 14px; border-bottom: 1px solid #edf1f3; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tr:hover td { background: #fbfcfd; }
.user-form-grid { display: grid; grid-template-columns: repeat(4, minmax(150px,1fr)); gap: 14px; align-items: end; }
.user-create-button { grid-column: 1 / -1; justify-self: start; min-width: 180px; }
.account-directory { margin-top: 18px; }
.account-counts { display: grid; grid-template-columns: repeat(5,minmax(110px,1fr)); gap: 10px; padding: 16px 18px 0; }
.account-count { min-height: 76px; display: grid; align-content: center; justify-items: start; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; background: #fff; color: var(--ink); text-align: left; }
.account-count strong { font-size: 23px; line-height: 1; }
.account-count span { color: var(--muted); font-size: 12px; font-weight: 800; }
.account-count:hover, .account-count.active { border-color: rgba(0,168,117,.45); background: var(--green-soft); }
.account-count.active strong, .account-count.active span { color: #007854; }
.account-filters { display: grid; grid-template-columns: minmax(210px,1.4fr) repeat(4,minmax(130px,1fr)); gap: 10px; padding: 14px 18px 18px; border-bottom: 1px solid var(--line); }
.account-filters label { display: grid; gap: 6px; min-width: 0; }
.account-filters label > span { color: var(--muted); font-size: 11px; font-weight: 900; }
.account-filters input, .account-filters select { width: 100%; min-width: 0; }
.empty-state.compact { min-height: 150px; gap: 5px; border: 0; border-radius: 0; }
.empty-state.compact strong, .empty-state.compact span { display: block; }
.empty-state.compact span { color: var(--muted); font-size: 13px; }
.assignment-field { grid-column: span 2; min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: #f8fafb; }
.assignment-field legend { padding: 0 6px; color: #3b4a55; font-size: 13px; font-weight: 800; }
.assignment-options { display: flex; flex-wrap: wrap; gap: 8px; }
.assignment-options label { display: block; position: relative; cursor: pointer; }
.assignment-options input { position: absolute; opacity: 0; pointer-events: none; }
.assignment-options span { min-height: 36px; display: inline-flex; align-items: center; padding: 0 12px; border: 1px solid #cad6dc; border-radius: 999px; background: white; color: #52636e; font-size: 13px; font-weight: 800; transition: .15s ease; }
.assignment-options input:checked + span { border-color: rgba(0,168,117,.45); background: var(--green-soft); color: #007854; box-shadow: inset 0 0 0 1px rgba(0,168,117,.08); }
.assignment-options input:focus-visible + span { outline: 3px solid rgba(20,121,248,.32); outline-offset: 2px; }
.assignment-tags { display: flex; flex-wrap: wrap; gap: 5px; min-width: 120px; }
.assignment-tags span { display: inline-flex; padding: 5px 8px; border-radius: 999px; background: var(--blue-soft); color: #0c65ca; font-size: 12px; font-weight: 800; }
.edit-worker-fields { display: grid; grid-template-columns: 1fr; gap: 12px; }
.edit-worker-fields .assignment-field { grid-column: auto; }

.empty-state { min-height: 260px; display: grid; place-items: center; text-align: center; padding: 36px; background: white; border: 1px solid var(--line); border-radius: var(--radius); }
.empty-symbol { width: 60px; height: 60px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 18px; background: var(--slate-soft); color: #758894; font-size: 24px; }
.empty-state h3 { margin: 0; }
.empty-state p { margin: 8px 0 0; color: var(--muted); }
.loading { min-height: 240px; display: grid; place-items: center; color: var(--muted); font-weight: 700; }
.loading::before { content: ""; width: 28px; height: 28px; margin-right: 10px; display: inline-block; border: 3px solid #d5e0e4; border-top-color: var(--green); border-radius: 50%; animation: spin .7s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

.drawer-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(5,16,24,.42); backdrop-filter: blur(2px); }
.detail-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 60; width: min(760px, 50vw); min-width: 560px; padding: 25px; overflow: auto; background: #f5f8f9; box-shadow: -25px 0 70px rgba(6,20,30,.22); animation: slideIn .2s ease; }
@keyframes slideIn { from { transform: translateX(35px); opacity: 0; } }
.drawer-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.drawer-top h2 { margin: 4px 0 0; font-size: 30px; letter-spacing: -.03em; }
.drawer-nav-actions { display: flex; align-items: center; gap: 8px; }
.drawer-back { min-height: 42px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--ink); font-weight: 800; }
.drawer-back:hover { border-color: rgba(20,121,248,.42); background: var(--blue-soft); color: #0c65ca; }
.drawer-close { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 12px; background: white; font-size: 22px; }
.order-status-hero { margin: 20px 0; padding: 21px; border-radius: 17px; background: var(--nav); color: white; display: grid; grid-template-columns: 76px 1fr; gap: 17px; align-items: center; }
.order-status-hero.ready { background: linear-gradient(135deg, #007d59, #00aa78); }
.sla-strip { display: grid; grid-template-columns: 1fr 1fr 1.15fr; gap: 10px; margin: -6px 0 20px; padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.sla-strip > div { min-width: 0; padding: 4px 8px; }
.sla-strip span:not(.badge), .sla-strip small { display: block; color: var(--muted); font-size: 11px; }
.sla-strip strong { display: block; margin-top: 5px; font-size: 13px; }
.sla-strip .badge { white-space: normal; line-height: 1.35; padding-top: 5px; padding-bottom: 5px; }
.sla-strip small { margin-top: 5px; }
.sla-strip.overdue { border-color: rgba(242,166,27,.5); background: #fffdf7; }
.sla-strip.severe { border-color: rgba(224,68,68,.45); background: #fff9f9; }
.progress-ring { width: 72px; height: 72px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--green-2) var(--progress), rgba(255,255,255,.17) 0); position: relative; }
.progress-ring::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: #0d2632; }
.order-status-hero.ready .progress-ring::after { background-color: #038561; }
.progress-ring strong { position: relative; z-index: 1; font-size: 15px; }
.status-hero-copy strong { display: block; font-size: 20px; }
.status-hero-copy span { display: block; margin-top: 6px; color: rgba(255,255,255,.72); font-size: 13px; }
.detail-section { margin-top: 14px; padding: 19px; border-radius: 15px; background: white; border: 1px solid var(--line); }
.detail-section h3 { margin: 0 0 13px; font-size: 16px; }
.detail-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.detail-section-head h3 { margin: 0; }
.craft-detail { display: grid; grid-template-columns: 32px 1fr auto; gap: 11px; align-items: center; padding: 12px 0; border-top: 1px solid #edf1f3; }
.craft-detail:first-of-type { border-top: 0; }
.craft-check { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--slate-soft); color: #788b96; font-weight: 900; }
.craft-detail.done .craft-check { background: var(--green-soft); color: var(--green); }
.craft-detail strong { display: block; }
.craft-detail small { display: block; margin-top: 4px; color: var(--muted); }
.note-box { padding: 13px; border-radius: 11px; background: #f3f6f7; line-height: 1.7; color: #42525c; font-size: 14px; }
.drawer-action { position: sticky; bottom: 0; padding-top: 16px; background: linear-gradient(to bottom, transparent, #f5f8f9 22%); }
.drawer-action .button { width: 100%; min-height: 54px; }
.admin-force-action > div { margin-bottom: 10px; padding: 12px; border: 1px solid #f0c8c8; border-radius: 11px; background: var(--red-soft); }
.admin-force-action strong, .admin-force-action span { display: block; }
.admin-force-action span { margin-top: 4px; color: #7c4545; font-size: 12px; line-height: 1.45; }
.import-history-panel { margin-top: 18px; }
.import-toolbar { margin-bottom: 16px; }
.recycle-button { display: inline-flex; align-items: center; gap: 7px; }
.recycle-button small { color: var(--muted); font-weight: 700; }
.recycle-list { display: grid; gap: 10px; margin-top: 20px; }
.recycle-item { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.recycle-item strong, .recycle-item span, .recycle-item small { display: block; }
.recycle-item strong { margin-bottom: 7px; }
.recycle-item span { margin-top: 4px; color: #52636e; font-size: 13px; }
.recycle-item small { margin-top: 8px; color: #a86500; }
.category-create { display: grid; grid-template-columns: 1fr auto; gap: 9px; margin-top: 20px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.category-manage-list { display: grid; gap: 9px; margin-top: 14px; }
.category-manage-list article { display: grid; grid-template-columns: 1fr auto auto; gap: 9px; align-items: end; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.category-manage-list article > div span { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.worker-assignment { display: grid; gap: 10px; margin: -8px -8px 24px; padding: 16px; border: 1px solid rgba(11,201,145,.32); border-radius: 16px; background: rgba(11,201,145,.1); }
.worker-assignment > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,.13); }
.worker-assignment span { color: #8fc9b8; font-size: 12px; font-weight: 800; }
.worker-assignment strong { color: white; font-size: 20px; }
.worker-assignment p { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; }
.worker-assignment b { padding: 5px 9px; border-radius: 999px; background: #0bc991; color: #06251b; font-size: 12px; }
.last-scan-action { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; margin-top: 12px; padding: 13px; border: 1px solid rgba(11,201,145,.32); border-radius: 13px; background: rgba(11,201,145,.1); }
.last-scan-action span, .last-scan-action strong, .last-scan-action small { display: block; }
.last-scan-action span, .last-scan-action small { color: #9cd4c4; font-size: 11px; }
.last-scan-action strong { margin: 4px 0; color: white; font-size: 18px; }
.drawer-filters { margin: 18px 0 12px; }
.drill-list { display: grid; gap: 9px; margin-top: 16px; }
.drill-row, .shipment-row { width: 100%; display: grid; grid-template-columns: minmax(125px,.8fr) minmax(155px,1fr) auto; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: white; color: inherit; text-align: left; }
.drill-row:hover, .shipment-row:hover { border-color: rgba(20,121,248,.35); background: #fbfdff; }
.drill-row strong, .shipment-row strong { display: block; }
.drill-row span, .drill-row small, .shipment-row span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.drawer-summary { display: grid; grid-template-columns: repeat(4, minmax(110px,1fr)); gap: 9px; margin: 18px 0 6px; }
.drawer-summary span { padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--muted); font-size: 12px; }
.drawer-summary b { display: block; margin-top: 5px; color: var(--ink); font-size: 24px; }
.drawer-summary .warning { background: var(--amber-soft); border-color: rgba(242,166,27,.28); }
.drawer-summary .warning b { color: #a86500; }
.drawer-summary .danger { background: var(--red-soft); border-color: rgba(224,68,68,.24); }
.drawer-summary .danger b { color: #b42c2c; }

.date-range-form { display: flex; align-items: end; gap: 8px; flex-wrap: wrap; }
.date-range-form label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 800; }
.date-range-form input { min-height: 40px; min-width: 138px; }
.date-range-form > span { padding-bottom: 11px; color: var(--muted); font-size: 12px; }
.range-shortcuts { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 20px 0; }
.my-production-panel { margin-top: 18px; }
.my-production-list { display: grid; gap: 9px; padding: 18px 20px 20px; }
.my-production-row { width: 100%; display: grid; grid-template-columns: minmax(220px,1.2fr) minmax(160px,.8fr) auto; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #fbfcfd; color: inherit; text-align: left; }
.my-production-row:hover { border-color: rgba(20,121,248,.36); background: var(--blue-soft); }
.my-production-row strong, .my-production-row span { display: block; }
.my-production-row span { margin-top: 4px; color: var(--muted); font-size: 12px; }

.bi-intro { margin-bottom: 18px; }
.bi-section { margin-top: 18px; }
.bi-section-header { align-items: flex-end; }
.bi-section-header > div:first-child { min-width: 220px; }
.craft-summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 10px; margin-top: 18px; }
.craft-summary-grid button { padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: #fbfcfd; color: inherit; text-align: left; }
.craft-summary-grid button:hover { border-color: rgba(20,121,248,.42); background: var(--blue-soft); }
.craft-summary-grid span, .craft-summary-grid strong, .craft-summary-grid small { display: block; }
.craft-summary-grid span { color: var(--muted); font-size: 12px; font-weight: 800; }
.craft-summary-grid strong { margin-top: 6px; color: var(--blue); font-size: 23px; }
.craft-summary-grid small { margin-top: 5px; color: var(--muted); }
.craft-output-list.horizontal { grid-template-columns: repeat(auto-fit,minmax(170px,1fr)); }
.rate-badge { display: inline-flex; min-width: 52px; justify-content: center; padding: 5px 8px; border-radius: 999px; font-size: 12px; font-weight: 900; }
.rate-badge.warning { background: var(--amber-soft); color: #a86500; }
.rate-badge.danger { background: var(--red-soft); color: #b42c2c; }
.bi-toolbar { align-items: end; }
.month-control { min-width: 160px; }
.month-control input { min-height: 38px; }
.bi-kpis { grid-template-columns: repeat(5,minmax(140px,1fr)); }
.bi-layout { display: grid; grid-template-columns: minmax(0,1.75fr) minmax(280px,.65fr); gap: 18px; margin-top: 18px; }
.bi-table-panel { margin-top: 18px; }
.trend-chart { height: 265px; display: flex; align-items: stretch; gap: clamp(3px,.7vw,9px); padding: 22px 4px 2px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.trend-bar { position: relative; flex: 1 0 13px; min-width: 13px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 7px; padding: 0; border: 0; background: transparent; color: var(--muted); }
.trend-bar i { width: min(24px,100%); min-height: 2px; border-radius: 7px 7px 2px 2px; background: linear-gradient(180deg,var(--blue),#6db2ff); transition: transform .15s ease, filter .15s ease; }
.trend-bar:hover i { transform: scaleX(1.15); filter: saturate(1.35); }
.trend-bar b { min-height: 14px; color: var(--ink); font-size: 11px; }
.trend-bar span { min-height: 28px; font-size: 9px; writing-mode: vertical-rl; }
.craft-output-list { display: grid; gap: 9px; }
.craft-output-list button { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfd; color: inherit; text-align: left; }
.craft-output-list button:hover, .craft-output-list button.active { border-color: rgba(20,121,248,.42); background: var(--blue-soft); }
.craft-output-list strong { color: var(--blue); }
.craft-output-list small { grid-column: 1 / -1; color: var(--muted); }
.bi-daily-table { min-width: 900px; }
.craft-calendar-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
.craft-calendar { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.craft-calendar th, .craft-calendar td { min-width: 56px; height: 48px; padding: 7px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; }
.craft-calendar thead th { position: sticky; top: 0; z-index: 2; background: #eef4f7; color: #36505f; font-weight: 900; }
.craft-calendar th:first-child { position: sticky; left: 0; z-index: 3; min-width: 100px; background: white; color: var(--ink); text-align: left; }
.craft-calendar thead th:first-child { z-index: 4; background: #e5eef2; }
.craft-calendar th:nth-child(2), .craft-calendar td:nth-child(2) { position: sticky; left: 100px; z-index: 2; min-width: 72px; background: #f4f8fa; }
.craft-calendar td button { width: 100%; min-height: 32px; padding: 4px; border: 0; border-radius: 8px; background: transparent; color: inherit; font-weight: 800; }
.craft-calendar td.has-output { background: #e6f8f1; }
.craft-calendar td.has-output button { color: #007854; }
.craft-calendar td.has-output button:hover { background: #c8f0e2; }
.craft-calendar .craft-total { color: #0c65ca; font-size: 15px; font-weight: 900; }
.table-link, .worker-table th button { padding: 4px 6px; border: 0; border-radius: 7px; background: var(--blue-soft); color: #0c65ca; font-weight: 800; }
.table-link:hover, .worker-table th button:hover { background: #d8eaff; }
.worker-table th button { padding: 0; background: transparent; color: inherit; text-align: left; }
.person-link { padding: 0; border: 0; background: transparent; color: inherit; text-align: left; }
.person-link strong, .person-link span { display: block; }
.person-link span { margin-top: 3px; color: var(--blue); font-size: 11px; font-weight: 800; }

.product-toolbar { align-items: end; }
.product-summary-bar { display: grid; grid-template-columns: repeat(5,minmax(150px,1fr)); margin: 18px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: white; }
.product-summary-bar > div { min-width: 0; padding: 18px 20px; border-right: 1px solid var(--line); }
.product-summary-bar > div:last-child { border-right: 0; }
.product-summary-bar span, .product-summary-bar small, .product-summary-bar strong { display: block; }
.product-summary-bar span { color: var(--muted); font-size: 12px; font-weight: 800; }
.product-summary-bar strong { margin-top: 8px; font-size: 24px; overflow-wrap: anywhere; }
.product-summary-bar small { margin-top: 5px; color: var(--muted); font-size: 11px; }
.product-insight-grid { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(300px,.65fr); gap: 18px; }
.product-category-list { display: grid; gap: 7px; }
.product-category-list button { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 10px 11px; border: 1px solid transparent; border-radius: 11px; background: #f5f8f9; color: inherit; text-align: left; }
.product-category-list button:hover, .product-category-list button.active { border-color: rgba(20,121,248,.35); background: var(--blue-soft); }
.product-category-list span strong, .product-category-list span small { display: block; }
.product-category-list span small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.product-category-list > button > b { color: var(--blue); }
.product-category-list i { grid-column: 1 / -1; height: 5px; overflow: hidden; border-radius: 5px; background: #e1e9ed; }
.product-category-list em { display: block; height: 100%; border-radius: inherit; background: var(--blue); }
.product-table-panel { margin-top: 18px; }
.product-table-header { align-items: end; }
.product-filters { display: flex; gap: 8px; min-width: min(520px,50%); }
.product-filters input { min-width: 260px; }
.product-filters select { min-width: 130px; }
.product-sort { padding: 12px 20px; border-bottom: 1px solid var(--line); }
.product-table { min-width: 1150px; }
.product-row { cursor: pointer; }
.product-row:focus-visible { outline: 3px solid rgba(20,121,248,.26); outline-offset: -3px; }
.product-row td:first-child { width: 58px; }
.rank-number { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--slate-soft); font-weight: 900; }
.product-row:nth-child(-n+3) .rank-number { background: var(--blue-soft); color: #0c65ca; }
.table-subline { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.text-success { color: #007854; font-weight: 800; }
.text-danger { color: #b42c2c; font-weight: 800; }
.variant-list { display: grid; gap: 8px; }
.variant-list > div { padding: 11px 12px; border-radius: 10px; background: #f3f6f7; }
.variant-list strong, .variant-list span { display: block; }
.variant-list span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.product-daily-panel { margin-top: 18px; overflow: hidden; }
.product-daily-header { align-items: end; }
.daily-section { padding: 20px; border-top: 1px solid var(--line); }
.daily-section + .daily-section { margin-top: 4px; }
.daily-section-title { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; align-items: center; margin-bottom: 12px; }
.daily-section-title > span { grid-row: 1 / 3; align-self: stretch; display: grid; place-items: center; min-width: 56px; padding: 7px 10px; border-radius: 10px; background: var(--green-soft); color: #007854; font-size: 12px; font-weight: 900; }
.daily-section-title h3 { margin: 0; font-size: 17px; }
.daily-section-title p { margin: 0; color: var(--muted); font-size: 12px; }
.daily-matrix-wrap { max-width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.daily-matrix { min-width: max(100%, 760px); border-collapse: separate; border-spacing: 0; font-size: 12px; font-variant-numeric: tabular-nums; }
.daily-matrix th, .daily-matrix td { min-width: 62px; padding: 10px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.daily-matrix tr:last-child > * { border-bottom: 0; }
.daily-matrix tr > *:last-child { border-right: 0; }
.daily-matrix thead th { position: sticky; top: 0; z-index: 2; background: #f3f7f8; color: var(--muted); font-weight: 900; }
.daily-matrix tr > :first-child { position: sticky; left: 0; z-index: 1; min-width: 112px; background: white; text-align: left; font-weight: 900; }
.daily-matrix thead tr > :first-child { z-index: 3; background: #f3f7f8; }
.daily-matrix .daily-value { color: #9aa8b1; }
.daily-matrix .daily-value.has-value { background: var(--blue-soft); color: #0c65ca; font-weight: 900; }
.daily-matrix.accessories .daily-value.has-value { background: var(--amber-soft); color: #8b5b00; }
.daily-matrix .row-total { background: #f7fafb; font-weight: 900; }
.daily-matrix .daily-total > * { background: var(--nav); color: white; font-weight: 900; }
.daily-matrix .daily-total > :first-child { z-index: 1; background: var(--nav); color: white; }
.daily-empty { height: 74px; color: var(--muted); }
.daily-classification-panel { padding: 20px; border-top: 1px solid var(--line); background: #f7fafb; }
.daily-classification-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.daily-classification-heading h3 { margin: 0; font-size: 17px; }
.daily-classification-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.daily-classification-heading > span { flex: 0 0 auto; padding: 6px 10px; border-radius: 999px; background: var(--amber-soft); color: #8b5b00; font-size: 12px; font-weight: 900; }
.daily-classification-list { display: grid; gap: 9px; }
.daily-classification-form { display: grid; grid-template-columns: minmax(220px,1.25fr) minmax(180px,.8fr) minmax(150px,.55fr) minmax(170px,.7fr) auto; gap: 10px; align-items: end; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.daily-classification-form label { min-width: 0; font-size: 11px; }
.daily-classification-form input, .daily-classification-form select { min-width: 0; min-height: 40px; }
.daily-classification-product { min-width: 0; align-self: center; }
.daily-classification-product strong, .daily-classification-product span { display: block; overflow-wrap: anywhere; }
.daily-classification-product span { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.daily-classification-readonly { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.daily-classification-readonly span { color: var(--muted); font-size: 11px; }
.daily-classification-readonly em { grid-column: 2; grid-row: 1 / 3; color: #8b5b00; font-size: 12px; font-style: normal; font-weight: 800; }
.daily-classification-empty { padding: 14px; border: 1px dashed #bfd0d8; border-radius: 12px; color: var(--muted); background: white; font-size: 13px; }
.daily-rule-manager { margin-top: 14px; }
.daily-rule-manager summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 11px; background: white; font-size: 13px; font-weight: 900; cursor: pointer; }
.daily-rule-manager[open] summary { margin-bottom: 9px; }
.daily-rule-manager summary span { color: var(--muted); font-size: 11px; }
.order-filter-bar, .drawer-list-tools { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.order-filter-bar label, .drawer-list-tools label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 800; white-space: nowrap; }
.order-filter-bar select, .drawer-list-tools select { min-height: 38px; padding: 0 34px 0 10px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--ink); }
.drawer-list-tools .drawer-summary { flex: 1; }
.filename-cell { cursor: help; }

.service-search-page { max-width: 980px; margin: min(13vh,120px) auto 0; }
.service-search-brand { text-align: center; }
.brand-mark.search { margin: 0 auto 16px; border-color: var(--line); background: var(--nav); }
.service-search-brand h2 { margin: 0; font-size: 32px; letter-spacing: -.03em; }
.service-search-brand p { max-width: 620px; margin: 10px auto 26px; color: var(--muted); line-height: 1.6; }
.service-search-box { display: grid; grid-template-columns: 1fr auto; gap: 9px; max-width: 760px; margin: 0 auto; padding: 8px; border: 1px solid #bccbd3; border-radius: 16px; background: white; box-shadow: 0 6px 8px rgba(9,27,39,.08); }
.service-search-box:focus-within { border-color: var(--green); box-shadow: 0 0 0 4px rgba(0,168,117,.12); }
.service-search-box input { min-height: 54px; border: 0; box-shadow: none; font-size: 18px; }
.service-search-box input:focus { box-shadow: none; }
.service-search-box .button { min-width: 108px; min-height: 54px; box-shadow: none; }
.service-search-result { margin-top: 28px; }
.service-result-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: var(--muted); font-size: 13px; }
.service-result-head strong { color: var(--ink); }
.service-result-list { display: grid; gap: 9px; }
.service-result-list > button { width: 100%; display: grid; grid-template-columns: minmax(130px,.7fr) minmax(190px,1.1fr) 1fr auto; gap: 16px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: white; color: inherit; text-align: left; }
.service-result-list > button:hover { border-color: rgba(20,121,248,.38); background: #fbfdff; }
.service-result-list strong, .service-result-list span { display: block; }
.service-result-list span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.service-logistics-controls { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 16px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.service-logistics-controls .filter-pills { margin: 0; }
.kpi-grid.service-logistics-kpis { max-width: 340px; grid-template-columns: 1fr; }
.service-logistics-results { margin-top: 20px; }
.service-logistics-results > .section-title { margin-bottom: 12px; }

.toast-region { position: fixed; right: 22px; top: 112px; z-index: 90; display: grid; gap: 10px; pointer-events: none; }
.toast { max-width: 390px; padding: 14px 17px; border-radius: 13px; background: var(--nav); color: white; box-shadow: 0 15px 35px rgba(5,17,25,.24); animation: toastIn .2s ease; font-weight: 700; }
.toast.success { background: #007e5a; }
.toast.error { background: #b93131; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }

@media (max-width: 1220px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .order-grid { grid-template-columns: repeat(2, minmax(260px,1fr)); }
  .task-card { grid-template-columns: 8px minmax(120px,.65fr) minmax(200px,1.2fr) minmax(140px,.8fr) auto; }
  .task-actions { grid-column: 2 / -1; display: flex; flex-wrap: wrap; align-items: center; }
  .bi-layout { grid-template-columns: 1fr; }
  .screen-grid { grid-template-columns: 1fr; }
  .product-insight-grid { grid-template-columns: 1fr; }
  .product-summary-bar { grid-template-columns: repeat(3,1fr); }
  .product-summary-bar > div:nth-child(3) { border-right: 0; }
  .product-summary-bar > div:nth-child(n+4) { border-top: 1px solid var(--line); }
  .service-logistics-toolbar, .service-logistics-controls { align-items: stretch; flex-direction: column; }
  .service-logistics-toolbar .search-box { width: 100%; }
}

@media (max-width: 1100px) {
  .scan-layout { grid-template-columns: 1fr; }
  .scan-console { position: static; }
}

@media (min-width: 821px) and (max-width: 1440px) {
  .task-card { grid-template-columns: 8px minmax(0,1fr) auto; }
  .task-card .task-product, .task-card .task-imprint, .task-card .task-actions { grid-column: 2 / -1; }
  .task-card .task-qty { grid-column: 3; grid-row: 1; }
  .task-actions { display: flex; flex-wrap: wrap; align-items: center; }
}

@media (max-width: 820px) {
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .auth-screen { display: flex; flex-direction: column; align-items: stretch; justify-content: center; padding: 24px; }
  .auth-brand { position: absolute; top: 22px; left: 24px; }
  .auth-visual { display: none; }
  .auth-card { margin-top: 70px; padding: 28px 22px; border-radius: 22px; }
  .app-shell { display: block; }
  .sidebar { position: fixed; top: auto; bottom: 0; left: 0; right: 0; width: 100%; height: calc(68px + env(safe-area-inset-bottom)); padding: 6px 8px env(safe-area-inset-bottom); display: block; background: rgba(7,21,33,.98); backdrop-filter: blur(18px); }
  .sidebar-brand, .sidebar-user { display: none; }
  .primary-nav { height: 100%; display: flex; justify-content: flex-start; gap: 2px; overflow-x: auto; }
  .nav-button { width: auto; min-width: 70px; flex: 0 0 auto; height: 58px; padding: 6px 8px; display: flex; flex-direction: column; justify-content: center; gap: 3px; border-radius: 10px; font-size: 11px; text-align: center; }
  .nav-button.active { box-shadow: inset 0 -3px 0 var(--green-2); }
  .nav-icon { height: 20px; }
  .topbar { min-height: 76px; padding: 13px 17px; }
  .eyebrow { display: none; }
  .topbar h1 { margin: 0; font-size: 21px; }
  .live-pill span { display: none; }
  .live-pill { width: 38px; padding: 0; justify-content: center; }
  #refresh-button { padding: 0 12px; }
  .mobile-logout { display: inline-flex; padding: 0 12px; }
  .view { padding: 16px 13px 22px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .dashboard-kpi-heading { display: block; }
  .dashboard-kpi-heading p { margin-top: 4px; }
  .overview-kpis, .attention-kpis, .waiting-kpis, .package-kpis { grid-template-columns: repeat(2, 1fr); max-width: none; }
  .kpi-card { min-height: 108px; padding: 16px; }
  .kpi-card:first-child { grid-column: 1 / -1; }
  .kpi-value { font-size: 31px; }
  .dashboard-grid { grid-template-columns: 1fr; gap: 13px; }
  .craft-grid { grid-template-columns: 1fr; }
  .order-grid { grid-template-columns: 1fr; }
  .package-order-card { min-height: 0; }
  .section-toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-actions, .search-box { width: 100%; min-width: 0; }
  .worker-task-tools { justify-content: flex-start; }
  .search-box input { min-width: 0; }
  .scan-layout { grid-template-columns: 1fr; }
  .scan-console { position: static; border-radius: 18px; padding: 21px; }
  .scan-console h2 { font-size: 23px; }
  .task-card { grid-template-columns: 7px 1fr auto; gap: 12px; }
  .task-card .task-product { grid-column: 2 / -1; }
  .task-card .task-imprint, .task-card .task-actions { grid-column: 2 / -1; }
  .task-card .task-qty { grid-column: 2 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .worker-board-grid { grid-template-columns: 1fr 1fr; }
  .last-scan-action { grid-template-columns: 1fr; }
  .last-scan-action .button { width: 100%; }
  .copy-order { opacity: 1; transform: none; }
  .pack-tools { align-items: stretch; flex-direction: column; }
  .pack-tools > .button { width: 100%; }
  .date-filter { width: 100%; justify-content: space-between; }
  .logistics-scan { align-items: stretch; flex-direction: column; }
  .logistics-row { grid-template-columns: 1fr; }
  .logistics-row > div:last-child { justify-items: start; }
  .screen-summary { grid-template-columns: 1fr 1fr; }
  .screen-summary > .metric-button:first-child { grid-column: 1 / -1; }
  .preview-summary { grid-template-columns: repeat(2, 1fr); }
  .user-form-grid { grid-template-columns: 1fr 1fr; }
  .user-form-grid .button { grid-column: 1 / -1; }
  .account-counts { grid-template-columns: repeat(2,1fr); }
  .account-count:first-child { grid-column: 1 / -1; }
  .account-filters { grid-template-columns: 1fr 1fr; }
  .account-filters label:first-child { grid-column: 1 / -1; }
  .assignment-field { grid-column: 1 / -1; }
  .recycle-item { grid-template-columns: 1fr; }
  .recycle-item .button { width: 100%; }
  .category-create { grid-template-columns: 1fr; }
  .category-manage-list article { grid-template-columns: 1fr 1fr; }
  .category-manage-list article > div { grid-column: 1 / -1; }
  .detail-drawer { width: 100vw; min-width: 0; padding: 19px 15px calc(84px + env(safe-area-inset-bottom)); }
  .date-range-form { width: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; }
  .date-range-form .button { grid-column: 1 / -1; }
  .date-range-form input { min-width: 0; width: 100%; }
  .date-range-form > span { padding-bottom: 12px; }
  .range-shortcuts { padding-left: 0; padding-right: 0; }
  .bi-section-header { align-items: stretch; flex-direction: column; }
  .drawer-summary { grid-template-columns: 1fr 1fr; }
  .my-production-row { grid-template-columns: 1fr; }
  .worker-kpis, .bi-kpis { grid-template-columns: repeat(2,1fr) !important; }
  .bi-toolbar .toolbar-actions { display: grid; }
  .product-toolbar, .product-table-header { align-items: stretch; flex-direction: column; }
  .product-daily-header { align-items: stretch; flex-direction: column; }
  .daily-section { padding: 16px 0; }
  .daily-section-title { padding: 0 15px; }
  .daily-matrix-wrap { border-radius: 0; border-left: 0; border-right: 0; }
  .daily-classification-panel { padding: 16px 15px; }
  .daily-classification-heading { align-items: flex-start; }
  .daily-classification-form { grid-template-columns: 1fr 1fr; }
  .daily-classification-product { grid-column: 1 / -1; }
  .daily-classification-form label:first-of-type, .daily-classification-form .button { grid-column: 1 / -1; }
  .daily-classification-readonly { grid-template-columns: 1fr; }
  .daily-classification-readonly em { grid-column: auto; grid-row: auto; }
  .order-filter-bar, .drawer-list-tools { align-items: stretch; flex-direction: column; }
  .order-filter-bar label, .drawer-list-tools label { justify-content: space-between; }
  .product-filters { width: 100%; min-width: 0; display: grid; grid-template-columns: 1fr 120px; }
  .product-filters input { min-width: 0; }
  .product-summary-bar { grid-template-columns: 1fr 1fr; }
  .product-summary-bar > div { border-top: 1px solid var(--line); }
  .product-summary-bar > div:nth-child(odd) { border-right: 1px solid var(--line); }
  .product-summary-bar > div:nth-child(even) { border-right: 0; }
  .product-summary-bar > div:first-child, .product-summary-bar > div:nth-child(2) { border-top: 0; }
  .service-search-page { margin-top: 8vh; }
  .service-search-brand h2 { font-size: 27px; }
  .service-search-box { grid-template-columns: 1fr; border-radius: 14px; }
  .service-search-box .button { width: 100%; }
  .service-result-list > button { grid-template-columns: 1fr; }
  .service-logistics-controls { align-items: stretch; flex-direction: column; }
  .service-logistics-controls .date-range-form { width: 100%; }
  .month-control { width: 100%; }
  .sla-strip { grid-template-columns: 1fr; }
  .drill-row, .shipment-row { grid-template-columns: 1fr; }
  .order-time-row { grid-template-columns: 1fr; }
  .toast-region { top: 85px; left: 13px; right: 13px; }
  .toast { max-width: none; }
  .timeline-row { grid-template-columns: 1fr; }
  .timeline-row > span { grid-row: auto; }
  .review-toolbar { align-items: stretch; flex-direction: column; }
  .review-actions { display: grid; grid-template-columns: 1fr; }
  .review-actions .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (max-width: 420px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-card { min-width: 0; }
  .kpi-label { font-size: 12px; }
  .kpi-value { font-size: 28px; }
  .panel-body { padding: 15px; }
  .order-status-hero { grid-template-columns: 66px 1fr; }
  .progress-ring { width: 64px; height: 64px; }
  .preview-summary { grid-template-columns: 1fr 1fr; }
  .warning-row { grid-template-columns: 1fr; }
  .package-order-no { font-size: 27px; }
}

@media print {
  .sidebar, .topbar-actions, .button { display: none !important; }
  .app-shell { display: block; }
  .topbar { position: static; }
  .view { padding: 12px; }
  .panel, .kpi-card, .order-card { box-shadow: none; break-inside: avoid; }
}
