/* ==========================================================================
   LogiAI DPC Manager — desktop operations console
   Design tokens carry over from the DPC tablet app (1920x1200 artboard).
   ========================================================================== */

:root {
  --bg: #121416;
  --bar: #16181B;
  --panel: #1A1C1E;
  --row: #1F2226;
  --row-hover: #23272C;
  --input-bg: #141619;
  --line: #2A2E33;
  --line-strong: #3A4046;
  --track: #262A2F;
  --text: #F2F4F7;
  --muted: #8A9199;
  --muted-2: #7E878F;
  --green: #A4FF00;
  --green-text: #A4FF00;
  --green-ink: #0A0D00;
  --green-hover: #B6FF32;
  --amber: #FF9F00;
  --amber-text: #FFB33D;
  --red: #FF4D4D;
  --red-text: #FF6B6B;
  --blue: #3498DB;
  --blue-text: #5DB4E8;
  --sidebar-w: 248px;
  --topbar-h: 68px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 18px 48px rgba(0, 0, 0, .45);
  --green-tint: rgba(164, 255, 0, .09);
  --green-line: rgba(164, 255, 0, .34);
  --amber-tint: rgba(255, 159, 0, .09);
  --amber-line: rgba(255, 159, 0, .34);
  --red-tint: rgba(255, 77, 77, .10);
  --red-line: rgba(255, 77, 77, .34);
  --blue-tint: rgba(52, 152, 219, .11);
  --blue-line: rgba(52, 152, 219, .32);
  --gray-tint: rgba(138, 145, 153, .10);
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #F4F6F8;
  --bar: #FFFFFF;
  --panel: #FFFFFF;
  --row: #F7F9FB;
  --row-hover: #EDF2F7;
  --input-bg: #FFFFFF;
  --line: #D8DEE6;
  --line-strong: #B9C3D1;
  --track: #EEF2F6;
  --text: #0E2044;
  --muted: #5B6B82;
  --muted-2: #64748B;
  --green: #3F8F00;
  --green-text: #2E6B00;
  --green-ink: #0A0D00;
  --green-hover: #357A00;
  --amber: #C77700;
  --amber-text: #8A5200;
  --red: #D93636;
  --red-text: #B32626;
  --blue: #2563EB;
  --blue-text: #1D4ED8;
  --green-tint: rgba(63, 143, 0, .10);
  --green-line: rgba(63, 143, 0, .34);
  --amber-tint: rgba(199, 119, 0, .10);
  --amber-line: rgba(199, 119, 0, .32);
  --red-tint: rgba(217, 54, 54, .09);
  --red-line: rgba(217, 54, 54, .32);
  --blue-tint: rgba(37, 99, 235, .10);
  --blue-line: rgba(37, 99, 235, .32);
  --gray-tint: rgba(91, 107, 130, .10);
  --shadow: 0 18px 44px rgba(21, 24, 27, .16);
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans CJK KR", "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
  font-size: 13px;
  line-height: 1.45;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 420px at 78% -12%, rgba(164, 255, 0, .045), transparent 68%),
    radial-gradient(700px 380px at 12% 108%, rgba(52, 152, 219, .035), transparent 70%);
  z-index: 0;
}

html[data-theme="light"] body::before {
  background:
    radial-gradient(900px 420px at 78% -12%, rgba(63, 143, 0, .06), transparent 68%),
    radial-gradient(700px 380px at 12% 108%, rgba(37, 99, 235, .04), transparent 70%);
}

::selection { background: var(--green); color: var(--green-ink); }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

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

[hidden] { display: none !important; }

/* ---------------------------------------------------------------- layout */

.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0 14px 16px;
  background: color-mix(in srgb, var(--bar) 86%, var(--panel));
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 74px;
  padding: 0 8px;
  flex: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  color: var(--text);
  flex: none;
}

.brand-mark svg { width: 100%; height: 100%; display: block; }

.brand-text { display: flex; flex-direction: column; line-height: 1.12; }
.brand-text strong { font-size: 15px; font-weight: 750; letter-spacing: -.01em; }
.brand-text span {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--green-text);
  margin-top: 4px;
}

.nav-label {
  padding: 18px 10px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  color: var(--muted-2);
}
.nav-label-second { padding-top: 22px; }

.nav { display: flex; flex-direction: column; gap: 3px; }

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  height: 40px;
  padding: 0 11px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  border: 1px solid transparent;
  transition: background .14s ease, color .14s ease, border-color .14s ease;
}
.nav-item:hover { background: var(--row); color: var(--text); }
.nav-item.active {
  color: var(--text);
  background: var(--green-tint);
  border-color: var(--green-line);
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--green);
  box-shadow: 0 0 12px color-mix(in srgb, var(--green) 38%, transparent);
}
.nav-item.active .ico { color: var(--green-text); }

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 19px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--green-tint);
  color: var(--green-text);
  border: 1px solid var(--green-line);
  font-size: 10px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.nav-badge-alert { background: var(--red-tint); color: var(--red-text); border-color: var(--red-line); }
.nav-badge:empty { display: none; }

.sidebar-foot { margin-top: auto; padding-top: 18px; }

.server-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
}
.server-line { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.server-line strong { font-weight: 700; }
.server-state { margin-left: auto; font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--green-text); text-transform: uppercase; }
.server-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 7px;
  color: var(--muted-2);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}
.build-tag {
  display: flex;
  justify-content: space-between;
  padding: 10px 2px 0;
  color: var(--muted-2);
  font-size: 9.5px;
  letter-spacing: .12em;
  font-weight: 600;
}

.pulse-dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  flex: none;
}
.pulse-dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid var(--green);
  opacity: .5;
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { transform: scale(.6); opacity: .65; }
  70%, 100% { transform: scale(1.7); opacity: 0; }
}

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

/* ---------------------------------------------------------------- topbar */

.topbar {
  height: var(--topbar-h);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 26px;
  background: color-mix(in srgb, var(--bar) 92%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.page-ident { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.eyebrow {
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: .2em;
  color: var(--muted-2);
  text-transform: uppercase;
}
.page-ident h1 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }

.top-actions { display: flex; align-items: center; gap: 9px; }

.conn-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--green-line);
  background: var(--green-tint);
  color: var(--green-text);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.conn-chip.is-offline {
  color: var(--red-text);
  border-color: var(--red-line);
  background: var(--red-tint);
}
.conn-chip.is-offline .pulse-dot { background: var(--red); }
.conn-chip.is-offline .pulse-dot::after { border-color: var(--red); }

.sync-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  padding: 0 4px 0 8px;
  border-left: 1px solid var(--line);
  margin-left: 2px;
}
.sync-block span { font-size: 9px; letter-spacing: .14em; color: var(--muted-2); text-transform: uppercase; font-weight: 650; }
.sync-block strong { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 650; letter-spacing: .04em; }

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  transition: color .14s, background .14s, border-color .14s;
}
.icon-btn:hover { color: var(--text); background: var(--row); border-color: var(--line-strong); }
.icon-btn .ico { width: 16px; height: 16px; }

.theme-switch {
  position: relative;
  width: 62px;
  height: 32px;
  padding: 0;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--row);
  color: var(--muted-2);
  transition: border-color .14s, color .14s, background .14s;
}
.theme-switch:hover { border-color: var(--line-strong); color: var(--text); }
.theme-switch .ts-track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 7px;
  border-radius: inherit;
}
.theme-switch .ts-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .22);
  transition: transform .18s ease;
  z-index: 0;
}
html[data-theme="dark"] .theme-switch .ts-thumb { transform: translateX(30px); }
html[data-theme="light"] .theme-switch .ts-thumb { transform: translateX(0); }
.theme-switch .ico { position: relative; z-index: 1; width: 13px; height: 13px; }
html[data-theme="dark"] .theme-switch .ts-moon { color: var(--green-text); }
html[data-theme="light"] .theme-switch .ts-sun { color: var(--green-text); }

.admin { position: relative; }
.admin-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  padding: 0 8px 0 6px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
}
.admin-btn:hover { border-color: var(--line); background: var(--row); }
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--green-tint);
  border: 1px solid var(--green-line);
  color: var(--green-text);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .03em;
  flex: none;
}
.avatar-sm { width: 30px; height: 30px; font-size: 10px; }
.admin-meta { display: flex; flex-direction: column; line-height: 1.2; }
.admin-meta strong { font-size: 12px; font-weight: 650; }
.admin-meta small { font-size: 9.5px; color: var(--muted-2); letter-spacing: .06em; }
.admin-btn .chev { width: 13px; height: 13px; color: var(--muted); margin-left: 2px; }

.menu-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 7px);
  width: 210px;
  padding: 5px;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 80;
}
.menu-pop button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  height: 34px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  text-align: left;
}
.menu-pop button:hover { background: var(--row); }
.menu-pop .ico { width: 15px; height: 15px; color: var(--muted); }
.menu-sep { height: 1px; background: var(--line); margin: 5px 4px; }

/* ---------------------------------------------------------------- content */

.content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 22px 26px 26px;
  scroll-behavior: smooth;
}

.view { animation: view-in .22s ease both; }
@keyframes view-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.view-head .eyebrow { margin-bottom: 5px; }
.view-head h2 { font-size: 23px; font-weight: 700; letter-spacing: -.025em; line-height: 1.15; }
.view-head .sub { margin-top: 5px; color: var(--muted); font-size: 12.5px; }
.view-actions { display: flex; align-items: center; gap: 8px; flex: none; }

/* buttons */
.btn {
  height: 36px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
  transition: background .14s, border-color .14s, color .14s, transform .06s;
}
.btn:hover { background: var(--row); border-color: var(--line-strong); }
.btn:active { transform: translateY(1px); }
.btn .ico { width: 15px; height: 15px; }
.btn-primary {
  background: var(--green);
  border-color: var(--green);
  color: var(--green-ink);
}
.btn-primary:hover { background: var(--green-hover); border-color: var(--green-hover); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--row); }
.btn-danger { color: var(--red-text); border-color: var(--red-line); background: var(--red-tint); }
.btn-danger:hover { background: color-mix(in srgb, var(--red) 17%, transparent); border-color: var(--red); }
.btn-sm { height: 29px; padding: 0 10px; font-size: 11.5px; border-radius: 7px; }
.btn-sm .ico { width: 13px; height: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--green-text);
  font-size: 11.5px;
  font-weight: 650;
}
.link .ico { width: 13px; height: 13px; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* panels */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 17px 11px;
}
.panel-head h3 { font-size: 13.5px; font-weight: 700; letter-spacing: -.005em; }
.panel-head p { margin-top: 3px; font-size: 11px; color: var(--muted-2); }
.panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 17px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 11px;
}

/* ---------------------------------------------------------------- KPI */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.kpi {
  position: relative;
  padding: 15px 16px 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 92%, var(--row)), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.kpi.tone-green { --tone: var(--green-text); --tone-bg: var(--green-tint); --tone-line: var(--green-line); }
.kpi.tone-blue { --tone: var(--blue-text); --tone-bg: var(--blue-tint); --tone-line: var(--blue-line); }
.kpi.tone-amber { --tone: var(--amber-text); --tone-bg: var(--amber-tint); --tone-line: var(--amber-line); }
.kpi.tone-red { --tone: var(--red-text); --tone-bg: var(--red-tint); --tone-line: var(--red-line); }
.kpi::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -60px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--tint, transparent), transparent 68%);
  pointer-events: none;
}
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.kpi-ico {
  width: 29px;
  height: 29px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--tone, var(--green-text));
  background: var(--tone-bg, var(--green-tint));
  border: 1px solid var(--tone-line, var(--green-line));
}
.kpi-ico .ico { width: 15px; height: 15px; }
.kpi-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 8px;
  font-size: 31px;
  font-weight: 750;
  letter-spacing: -.035em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.kpi-value small { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.kpi-sub { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 11px; color: var(--muted); }
.kpi-sub .up { color: var(--green-text); font-weight: 650; }
.kpi-sub .warn { color: var(--amber-text); font-weight: 650; }
.kpi-sub .bad { color: var(--red-text); font-weight: 650; }
.kpi-mini-bar { height: 3px; border-radius: 999px; background: var(--track); margin-top: 10px; overflow: hidden; }
.kpi-mini-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--tone, var(--green)); }

/* ---------------------------------------------------------------- dashboard */

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
}
.activity-panel { grid-column: 1 / -1; }

.batch-list { display: flex; flex-direction: column; }
.batch-row {
  display: block;
  width: 100%;
  padding: 11px 17px 12px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
  transition: background .12s ease;
}
.batch-row:hover { background: var(--row); }
.batch-row.is-idle { opacity: .82; }
.batch-row-top { display: flex; align-items: center; gap: 9px; }
.batch-id {
  font-size: 13.5px;
  font-weight: 750;
  letter-spacing: .01em;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 8px;
}
.batch-meta { margin-left: auto; color: var(--muted-2); font-size: 11px; white-space: nowrap; }
.bar-row { display: flex; align-items: center; gap: 10px; margin-top: 9px; }
.bar {
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background: var(--track);
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  box-shadow: 0 0 10px color-mix(in srgb, var(--green) 28%, transparent);
  transition: width .4s ease;
}
.bar.is-idle > span { background: var(--muted-2); box-shadow: none; }
.bar.is-amber > span { background: var(--amber); box-shadow: none; }
.bar-row strong { font-size: 11px; font-weight: 700; min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.batch-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; font-size: 10.5px; color: var(--muted-2); font-variant-numeric: tabular-nums; }

.op-list { display: flex; flex-direction: column; }
.op-row { display: flex; align-items: center; gap: 10px; padding: 8px 17px; border-top: 1px solid var(--line); min-height: 46px; }
.op-row:first-child { border-top: 0; }
.op-main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.op-main strong { font-size: 12px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.op-main span { font-size: 10px; color: var(--muted-2); }
.op-batch {
  margin-left: auto;
  font-size: 10px;
  color: var(--muted);
  background: var(--row);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 6px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.op-status { display: flex; align-items: center; gap: 5px; font-size: 10px; color: var(--muted); min-width: 56px; justify-content: flex-end; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted-2); flex: none; }
.dot.green { background: var(--green); box-shadow: 0 0 8px color-mix(in srgb, var(--green) 45%, transparent); }
.dot.amber { background: var(--amber); }
.dot.red { background: var(--red); }
.dot.blue { background: var(--blue); }

.activity-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; padding: 2px 17px 12px; }
.activity-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); min-width: 0; }
.activity-item:nth-child(-n+2) { border-top: 0; }
.activity-ico {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  background: var(--gray-tint);
  color: var(--muted);
}
.activity-ico .ico { width: 13px; height: 13px; }
.activity-ico.green { background: var(--green-tint); color: var(--green-text); }
.activity-ico.amber { background: var(--amber-tint); color: var(--amber-text); }
.activity-ico.red { background: var(--red-tint); color: var(--red-text); }
.activity-ico.blue { background: var(--blue-tint); color: var(--blue-text); }
.activity-text { min-width: 0; }
.activity-text p { font-size: 11.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-text span { font-size: 9.5px; color: var(--muted-2); letter-spacing: .03em; }
.live-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 9px; letter-spacing: .14em; color: var(--green-text); font-weight: 700; }

/* ---------------------------------------------------------------- pills */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 21px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill-waiting { color: var(--muted); background: var(--gray-tint); border-color: var(--line); }
.pill-picking { color: var(--green-text); background: var(--green-tint); border-color: var(--green-line); }
.pill-done { color: var(--blue-text); background: var(--blue-tint); border-color: var(--blue-line); }
.pill-hold { color: var(--amber-text); background: var(--amber-tint); border-color: var(--amber-line); }
.pill-skipped { color: var(--red-text); background: var(--red-tint); border-color: var(--red-line); }
.pill-active { color: var(--green-text); background: var(--green-tint); border-color: var(--green-line); }
.pill-pending { color: var(--muted); background: var(--gray-tint); border-color: var(--line); }
.pill-inactive { color: var(--muted-2); background: transparent; border-color: var(--line); }
.pill-break { color: var(--amber-text); background: var(--amber-tint); border-color: var(--amber-line); }

/* ---------------------------------------------------------------- toolbar / forms */

.toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 13px;
  flex-wrap: wrap;
}
.toolbar .spacer { flex: 1; }
.toolbar-note { color: var(--muted-2); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.search-box { position: relative; flex: 0 1 280px; min-width: 190px; }
.search-box .ico {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--muted-2);
  pointer-events: none;
}
.input, .select {
  height: 36px;
  width: 100%;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--text);
  font-size: 12px;
  transition: border-color .14s, box-shadow .14s;
}
.input::placeholder { color: var(--muted-2); }
.input:hover, .select:hover { border-color: var(--line-strong); }
.input:focus, .select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-tint);
}
.search-box .input { padding-left: 33px; }
.select {
  appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238A9199' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
  max-width: 220px;
}
.select-sm { height: 32px; font-size: 11.5px; max-width: 190px; }
.input-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.inline-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; letter-spacing: .01em; }
.op-ref { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.avatar-xs { width: 22px; height: 22px; font-size: 8px; }

.chip-row { display: flex; gap: 5px; flex-wrap: wrap; }
.chip {
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chip:hover { color: var(--text); border-color: var(--line-strong); background: var(--row); }
.chip.active { color: var(--green-ink); background: var(--green); border-color: var(--green); }
.chip .count { font-size: 9.5px; opacity: .72; font-variant-numeric: tabular-nums; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field-label {
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
}
.field .hint { font-size: 10.5px; color: var(--muted-2); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-stack { display: flex; flex-direction: column; gap: 13px; }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track {
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: var(--track);
  border: 1px solid var(--line-strong);
  position: relative;
  transition: background .16s, border-color .16s;
  flex: none;
}
.switch .track::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--muted);
  transform: translateY(-50%);
  transition: transform .16s, background .16s;
}
.switch input:checked + .track { background: var(--green-tint); border-color: var(--green-line); }
.switch input:checked + .track::after { transform: translate(16px, -50%); background: var(--green); }
.switch input:focus-visible + .track { outline: 2px solid var(--green); outline-offset: 2px; }
.switch span:last-child { font-size: 11.5px; color: var(--muted); }

/* ---------------------------------------------------------------- table */

.table-panel { overflow: hidden; }
.table-scroll { overflow: auto; max-height: calc(100vh - 330px); }
table.data { width: 100%; border-collapse: collapse; min-width: 920px; }
table.data thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 9px 14px;
  background: color-mix(in srgb, var(--panel) 96%, var(--row));
  border-bottom: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: .13em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
}
table.data tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  vertical-align: middle;
  white-space: nowrap;
}
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover td { background: var(--row-hover); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr.is-exception td { background: color-mix(in srgb, var(--red-tint) 55%, transparent); }
table.data tbody tr.is-exception:hover td { background: color-mix(in srgb, var(--red-tint) 85%, transparent); }
table.data tbody tr.is-active td { background: color-mix(in srgb, var(--green-tint) 42%, transparent); }
table.data .num { font-variant-numeric: tabular-nums; }
table.data .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; letter-spacing: .01em; }
table.data .id-cell { font-weight: 700; font-variant-numeric: tabular-nums; }
table.data .sub { display: block; font-size: 9.5px; color: var(--muted-2); margin-top: 1px; }
table.data .actions { display: flex; gap: 5px; justify-content: flex-end; }
.table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 10.5px;
  background: var(--panel);
}
.table-foot strong { color: var(--muted); font-weight: 650; }

.empty {
  padding: 46px 20px;
  text-align: center;
  color: var(--muted-2);
}
.empty .ico { width: 26px; height: 26px; margin-bottom: 8px; color: var(--line-strong); }
.empty p { font-size: 12px; }
.empty span { font-size: 10.5px; }

.progress-cell { display: flex; align-items: center; gap: 8px; min-width: 108px; }
.progress-cell .bar { height: 4px; width: 68px; }
.progress-cell span { font-size: 10px; color: var(--muted); min-width: 28px; font-variant-numeric: tabular-nums; }

.location { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.location b { font-weight: 650; }
.item-name { max-width: 210px; overflow: hidden; text-overflow: ellipsis; display: block; }

/* ---------------------------------------------------------------- batches */

.batches-layout { display: flex; flex-direction: column; gap: 0; }
.batch-status-cell { min-width: 92px; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }

/* drawer */
.drawer-root { position: fixed; inset: 0; z-index: 70; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(4, 6, 8, .55); backdrop-filter: blur(2px); animation: fade-in .16s ease; }
.drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(440px, 92vw);
  background: var(--panel);
  border-left: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  animation: drawer-in .2s cubic-bezier(.22,.8,.3,1);
}
@keyframes drawer-in { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.drawer-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px 15px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h3 { font-size: 19px; font-weight: 750; letter-spacing: -.02em; }
.drawer-head p { margin-top: 4px; color: var(--muted); font-size: 11px; }
.drawer-head .icon-btn { margin-left: auto; }
.drawer-body { flex: 1; overflow-y: auto; padding: 17px 20px 24px; }
.drawer-foot { padding: 13px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; }

.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.meta { display: flex; flex-direction: column; gap: 3px; }
.meta span { font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); }
.meta strong { font-size: 12px; font-weight: 650; }
.meta strong.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; }

.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 0 9px;
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.status-toggle { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.status-toggle button {
  height: 33px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--row);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .03em;
}
.status-toggle button:hover { color: var(--text); border-color: var(--line-strong); }
.status-toggle button.active { color: var(--green-text); border-color: var(--green-line); background: var(--green-tint); }
.status-toggle button.active[data-status="WAITING"] { color: var(--text); border-color: var(--line-strong); background: var(--gray-tint); }
.status-toggle button.active[data-status="DONE"] { color: var(--blue-text); border-color: var(--blue-line); background: var(--blue-tint); }
.status-toggle button.active[data-status="HOLD"] { color: var(--amber-text); border-color: var(--amber-line); background: var(--amber-tint); }

.drawer-lines { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.drawer-line { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--line); font-size: 11px; }
.drawer-line:first-child { border-top: 0; }
.drawer-line .loc { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 78px; }
.drawer-line .sku { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 9.5px; color: var(--muted-2); }
.drawer-line .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-line .pill { height: 18px; font-size: 8.5px; padding: 0 6px; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.stat-box { background: var(--row); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; }
.stat-box span { display: block; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); font-weight: 650; }
.stat-box strong { display: block; margin-top: 4px; font-size: 16px; font-weight: 750; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- tote matrix */

.totes-layout { display: grid; grid-template-columns: minmax(0, 1fr) 296px; gap: 14px; align-items: start; }
.matrix-panel { padding: 16px; }
.matrix-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 13px; }
.matrix-head h3 { font-size: 13.5px; font-weight: 700; }
.matrix-head p { margin-top: 3px; font-size: 11px; color: var(--muted-2); }
.matrix-scale { display: flex; align-items: center; gap: 8px; font-size: 9.5px; color: var(--muted-2); letter-spacing: .12em; font-weight: 650; text-transform: uppercase; }
.matrix-scale span { display: inline-flex; align-items: center; gap: 4px; }
.matrix-scale i { width: 7px; height: 7px; border-radius: 2px; display: inline-block; }

.matrix-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 11px;
}
.tote-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 122px;
  padding: 10px 11px 9px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--row);
  transition: border-color .15s, background .15s, transform .1s;
}
.tote-cell::before {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 0;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: var(--muted-2);
  opacity: .5;
}
.tote-cell:hover { border-color: var(--line-strong); }
.tote-cell.is-dirty { border-color: var(--amber); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--amber) 22%, transparent); }
.tote-cell.state-GREEN { background: linear-gradient(180deg, var(--green-tint), transparent 62%), var(--row); border-color: var(--green-line); }
.tote-cell.state-GREEN::before { background: var(--green); opacity: 1; box-shadow: 0 0 8px color-mix(in srgb, var(--green) 35%, transparent); }
.tote-cell.state-AMBER { background: linear-gradient(180deg, var(--amber-tint), transparent 62%), var(--row); border-color: var(--amber-line); }
.tote-cell.state-AMBER::before { background: var(--amber); opacity: 1; }
.tote-cell.state-GRAY { background: var(--row); }
.tote-cell.state-GRAY::before { background: var(--line-strong); }

.tote-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.tote-code {
  width: 56px;
  padding: 1px 2px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: .05em;
  color: var(--text);
}
.tote-code:hover { border-color: var(--line); }
.tote-code:focus { outline: none; border-color: var(--green); background: var(--input-bg); }
.state-label { font-size: 8px; font-weight: 750; letter-spacing: .11em; text-transform: uppercase; color: var(--muted-2); }
.state-GREEN .state-label { color: var(--green-text); }
.state-AMBER .state-label { color: var(--amber-text); }

.tote-qty-row { display: flex; align-items: baseline; gap: 4px; }
.tote-qty {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 23px;
  font-weight: 750;
  letter-spacing: -.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.tote-qty:focus { outline: none; color: var(--green-text); }
.tote-qty-row .unit { font-size: 9px; color: var(--muted-2); letter-spacing: .08em; text-transform: uppercase; }
.tote-sub { font-size: 9px; color: var(--muted-2); min-height: 12px; font-variant-numeric: tabular-nums; }
.tote-sub .amber-txt { color: var(--amber-text); }

.state-toggle { display: flex; gap: 4px; margin-top: auto; }
.state-btn {
  flex: 1;
  height: 17px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: transparent;
  padding: 0;
  position: relative;
}
.state-btn::after { content: ""; position: absolute; inset: 3px; border-radius: 2px; background: var(--muted-2); opacity: .35; }
.state-btn:hover { border-color: var(--line-strong); }
.state-btn[data-state="GREEN"].on { border-color: var(--green); }
.state-btn[data-state="GREEN"].on::after { background: var(--green); opacity: 1; }
.state-btn[data-state="AMBER"].on { border-color: var(--amber); }
.state-btn[data-state="AMBER"].on::after { background: var(--amber); opacity: 1; }
.state-btn[data-state="GRAY"].on { border-color: var(--muted); }
.state-btn[data-state="GRAY"].on::after { background: var(--muted); opacity: .7; }

.tote-side { display: flex; flex-direction: column; gap: 14px; }
.side-panel { padding: 15px 16px; }
.side-panel h3 { font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.legend { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.legend-row i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.legend-row strong { margin-left: auto; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.legend-row .lg-green { background: var(--green); }
.legend-row .lg-amber { background: var(--amber); }
.legend-row .lg-gray { background: var(--muted-2); }
.summary-total { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; align-items: baseline; justify-content: space-between; }
.summary-total span { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); font-weight: 650; }
.summary-total strong { font-size: 20px; font-weight: 750; font-variant-numeric: tabular-nums; }
.util { margin-top: 9px; }
.util .bar { height: 5px; }
.util-row { display: flex; justify-content: space-between; margin-top: 6px; font-size: 9.5px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.save-note { display: flex; align-items: center; gap: 7px; font-size: 10px; color: var(--muted-2); padding: 0 2px; }
.save-note.dirty { color: var(--amber-text); }

/* ---------------------------------------------------------------- operators */

.op-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.mini-stat { display: flex; align-items: center; gap: 11px; padding: 12px 14px; }
.mini-stat .kpi-ico { width: 32px; height: 32px; }
.mini-stat .ms-label { font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); font-weight: 650; }
.mini-stat .ms-value { font-size: 19px; font-weight: 750; line-height: 1.1; font-variant-numeric: tabular-nums; margin-top: 2px; }
.op-cell { display: flex; align-items: center; gap: 9px; }
.op-cell .op-name { display: flex; flex-direction: column; gap: 1px; }
.op-cell .op-name strong { font-size: 12.5px; font-weight: 650; }
.op-cell .op-name span { font-size: 9.5px; color: var(--muted-2); }
.shift { font-size: 10.5px; color: var(--muted); }
.batch-link { color: var(--blue-text); font-weight: 650; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted-2); }
.text-muted { color: var(--muted); }

/* ---------------------------------------------------------------- settings */

.settings-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .85fr); gap: 14px; align-items: start; }
.settings-panel { padding: 18px; }
.settings-panel h3 { font-size: 13px; font-weight: 700; }
.settings-panel .panel-sub { margin-top: 4px; font-size: 11px; color: var(--muted-2); }
.settings-panel .form-stack { margin-top: 16px; }
.settings-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
.settings-stack { display: flex; flex-direction: column; gap: 14px; }

.theme-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.theme-card {
  position: relative;
  padding: 9px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--row);
  cursor: pointer;
  text-align: left;
}
.theme-card:hover { border-color: var(--line-strong); }
.theme-card.active { border-color: var(--green-line); box-shadow: inset 0 0 0 1px var(--green-line); }
.theme-preview { height: 52px; border-radius: 6px; border: 1px solid rgba(0,0,0,.18); overflow: hidden; display: flex; }
.theme-preview .tp-side { width: 26%; background: #16181B; }
.theme-preview .tp-main { flex: 1; background: #1A1C1E; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.tp-line { height: 4px; border-radius: 2px; background: #2A2E33; }
.tp-line.accent { background: #A4FF00; width: 38%; }
.theme-card.light .theme-preview .tp-side { background: #FFFFFF; }
.theme-card.light .theme-preview .tp-main { background: #F4F6F8; }
.theme-card.light .tp-line { background: #D8DEE6; }
.theme-card.light .tp-line.accent { background: #3F8F00; }
.theme-card .tc-label { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 11px; font-weight: 650; }
.theme-card .tc-check { margin-left: auto; color: var(--green-text); opacity: 0; }
.theme-card.active .tc-check { opacity: 1; }

.storage-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.storage-row:last-of-type { border-bottom: 0; }
.storage-row span { color: var(--muted); }
.storage-row strong { font-weight: 650; font-variant-numeric: tabular-nums; }

.danger-box { border: 1px solid var(--red-line); background: var(--red-tint); border-radius: 9px; padding: 12px; margin-top: 12px; }
.danger-box p { font-size: 10.5px; color: var(--muted); line-height: 1.5; }
.danger-box .btn { margin-top: 9px; }

.kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10px; padding: 1px 5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; color: var(--muted); }

/* ---------------------------------------------------------------- modal */

.modal-root { position: fixed; inset: 0; z-index: 80; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 8, .62);
  backdrop-filter: blur(3px);
  animation: fade-in .15s ease;
}
.modal {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 40px));
  max-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: var(--shadow);
  animation: modal-in .18s cubic-bezier(.22,.8,.3,1);
}
@keyframes modal-in {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 8px)) scale(.99); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 17px 19px 13px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16px; font-weight: 700; letter-spacing: -.015em; }
.modal-head p { margin-top: 3px; font-size: 11px; color: var(--muted); }
.modal-head .icon-btn { margin-left: auto; width: 30px; height: 30px; }
.modal-body { padding: 17px 19px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 19px; border-top: 1px solid var(--line); }
.modal-note { margin-top: 13px; padding: 9px 11px; border-radius: 8px; background: var(--row); border: 1px solid var(--line); font-size: 10.5px; color: var(--muted); line-height: 1.55; }
.modal-note strong { color: var(--text); }

/* ---------------------------------------------------------------- toast */

.toast-stack {
  position: fixed;
  right: 22px;
  bottom: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 330px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--green);
  background: color-mix(in srgb, var(--panel) 96%, var(--green));
  box-shadow: var(--shadow);
  animation: toast-in .2s cubic-bezier(.22,.8,.3,1);
  pointer-events: auto;
}
.toast.out { animation: toast-out .18s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }
.toast .ico { width: 16px; height: 16px; color: var(--green-text); margin-top: 1px; }
.toast .toast-text { min-width: 0; }
.toast strong { display: block; font-size: 11.5px; font-weight: 650; }
.toast span { display: block; margin-top: 2px; font-size: 10.5px; color: var(--muted); }
.toast.error { border-left-color: var(--red); }
.toast.error .ico { color: var(--red-text); }
.toast.info { border-left-color: var(--blue); }
.toast.info .ico { color: var(--blue-text); }
.toast.warn { border-left-color: var(--amber); }
.toast.warn .ico { color: var(--amber-text); }

.noscript {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  z-index: 200;
}

/* ---------------------------------------------------------------- responsive */

@media (max-width: 1440px) {
  :root { --sidebar-w: 228px; }
  .content { padding: 19px 22px 22px; }
  .topbar { padding: 0 22px; }
  .kpi-value { font-size: 28px; }
  .view-head h2 { font-size: 21px; }
  .admin-meta small { display: none; }
  .totes-layout { grid-template-columns: minmax(0, 1fr) 270px; }
  .matrix-grid { gap: 9px; }
  .tote-cell { padding: 9px 9px 8px; }
}

@media (max-width: 1320px) {
  :root { --sidebar-w: 216px; }
  .content { padding: 16px 18px 20px; }
  .topbar { padding: 0 18px; }
  .conn-chip .conn-text { font-size: 10px; }
  .sync-block { display: none; }
  .admin-meta { display: none; }
  .admin-btn { padding: 0 5px; }
  .kpi-grid { gap: 10px; }
  .kpi { padding: 13px 13px 12px; }
  .kpi-value { font-size: 26px; }
  .dash-grid { gap: 10px; }
  .totes-layout { grid-template-columns: minmax(0, 1fr) 250px; gap: 10px; }
  .tote-cell { min-height: 114px; }
  .tote-qty { font-size: 21px; }
  .settings-grid { grid-template-columns: 1fr; }
  .op-grid { gap: 9px; }
  table.data { min-width: 880px; }
  table.data thead th, table.data tbody td { padding-left: 10px; padding-right: 10px; }
}

@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .totes-layout { grid-template-columns: 1fr; }
  .tote-side { flex-direction: row; }
  .tote-side > * { flex: 1; }
  .activity-list { grid-template-columns: 1fr; }
  .activity-item:nth-child(2) { border-top: 1px solid var(--line); }
}

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

/* scrollbars */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; border: 2px solid var(--panel); }
::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }
::-webkit-scrollbar-corner { background: transparent; }

/* ── auth gate (DB session login) ─────────────────────────── */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 520px at 20% 0%, var(--green-tint), transparent 62%),
    radial-gradient(760px 520px at 100% 100%, var(--blue-tint), transparent 60%),
    var(--bg);
}
.auth-gate[hidden] { display: none; }

.auth-card {
  width: min(420px, 100%);
  padding: 30px 30px 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  color: var(--text);
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.auth-mark { width: 40px; height: 40px; color: var(--text); flex: none; }
.auth-mark svg { width: 40px; height: 40px; display: block; }
.auth-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.auth-brand-text strong { font-size: 16px; letter-spacing: .01em; }
.auth-brand-text small { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.auth-eyebrow { margin: 0 0 4px; color: var(--green-text); font-size: 10px; font-weight: 800; letter-spacing: .2em; }
.auth-card h2 { margin: 0 0 8px; font-size: 26px; line-height: 1.1; }
.auth-sub { margin: 0 0 20px; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.auth-label { display: block; margin: 14px 0 6px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .05em; }
.auth-input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
}
.auth-input:focus { border-color: var(--green-line); box-shadow: 0 0 0 3px var(--green-tint); }
.auth-error {
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--red-tint);
  border: 1px solid var(--red-line);
  border-radius: 10px;
  color: var(--red-text);
  font-size: 12.5px;
  line-height: 1.45;
}
.auth-btn {
  width: 100%;
  height: 46px;
  margin-top: 18px;
  background: var(--green);
  border: 0;
  border-radius: 10px;
  color: var(--green-ink);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}
.auth-btn:hover { background: var(--green-hover); }
.auth-btn:disabled { opacity: .55; cursor: progress; }
.auth-foot { margin: 14px 0 0; color: var(--muted-2); font-size: 11px; text-align: center; }

/* LogiAI 브랜드 로고 */
.brand-logo{display:block;width:auto;height:26px;flex:0 0 auto}
.brand-logo.logo-light{display:none}
.auth-logo{height:34px}
.side-logo{height:26px}
html[data-theme="light"] .logo-dark{display:none}
html[data-theme="light"] .logo-light{display:block}

/* ── carts ─────────────────────────────────────────────── */
.cart-context{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:11px 14px;margin-bottom:12px}
.cart-context .cart-title{font-weight:750;font-size:13px}
.cart-context .muted{font-size:11px}
.cart-context .pill{height:22px}
.tote-side .panel-sub{font-size:11px}

/* ── top header brand ───────────────────────────────────── */
.top-brand{display:flex;align-items:center;gap:11px;flex:0 0 auto;padding-right:16px;margin-right:16px;border-right:1px solid var(--line)}
.top-brand .brand-logo{display:block;width:auto;height:28px;flex:0 0 auto}
.top-brand .brand-logo.logo-light{display:none}
html[data-theme="light"] .top-brand .logo-dark{display:none}
html[data-theme="light"] .top-brand .logo-light{display:block}
.top-brand-text{display:flex;flex-direction:column;line-height:1.05}
.top-brand-text strong{font-size:16px;font-weight:800;letter-spacing:-.01em;color:var(--text)}
.top-brand-text span{font-size:9.5px;color:var(--muted-2);letter-spacing:.08em;text-transform:uppercase}
@media (max-width:1280px){.top-brand .brand-logo{height:24px}.top-brand-text span{display:none}.top-brand{gap:8px;padding-right:12px;margin-right:12px}}

/* ── full-width topbar, no sidebar brand ──────────────── */
.topbar{position:fixed;top:0;left:0;right:0;width:100%;z-index:60}
.sidebar{padding-top:calc(var(--topbar-h) + 6px)}
.main{padding-top:var(--topbar-h)}

/* ── map management ────────────────────────────────────── */
.map-upload-panel{padding:16px;display:flex;flex-direction:column;gap:12px}
.map-upload-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.map-upload-head h3{font-size:14px;font-weight:700}
.map-upload-head p{font-size:11px;color:var(--muted);margin-top:3px}
.map-file-name{font-family:var(--mono);font-size:10.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:45%}
.map-drop{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:22px;border:1px dashed var(--line-strong);border-radius:12px;background:var(--panel-2);cursor:pointer;text-align:center;transition:.15s}
.map-drop:hover{border-color:var(--green);background:var(--hover)}
.map-drop svg{width:30px;height:30px;stroke:var(--green);fill:none;stroke-width:1.6}
.map-drop strong{font-size:13px;color:var(--text)}
.map-drop span{font-family:var(--mono);font-size:10px;color:var(--muted)}
.map-help{font-size:11px;color:var(--muted)}
.map-help b{color:var(--text-2);font-weight:650}

/* ── topbar divider aligned to sidebar boundary ────────── */
.topbar{padding-left:0}
.top-brand{width:var(--sidebar-w);flex:0 0 var(--sidebar-w);box-sizing:border-box;padding-left:26px}

/* ── align current menu title next to the left divider ── */
.topbar{justify-content:flex-start;gap:0}
.top-brand{margin-right:0}
.page-ident{padding-left:24px;margin-right:auto}
.top-actions{margin-left:auto}
@media (max-width:1280px){.page-ident{padding-left:18px}}


/* ── remove duplicate page headers, keep action buttons ── */
.view-head{justify-content:flex-end}
.view-head > div:not(.view-actions){display:none}
.view-head .view-actions{margin-left:auto}

/* settings left column */
.settings-left{display:flex;flex-direction:column;gap:14px;min-width:0}

/* ── login: header removed, copyright footer ───────────── */
.auth-brand{margin-bottom:18px}
.auth-card > .auth-label:first-of-type{margin-top:2px}
.auth-foot{font-size:10.5px;letter-spacing:.02em}

/* ── login fields on one line ──────────────────────────── */
.auth-field{display:grid;grid-template-columns:64px minmax(0,1fr);align-items:center;gap:10px;margin-top:10px}
.auth-field .auth-label{margin:0;white-space:nowrap}
.auth-field .auth-input{width:100%;min-width:0}

/* ── login: larger labels/inputs, centered larger logo ─── */
.auth-brand{justify-content:center;text-align:center;margin:22px 0 30px;padding:4px 0}
.auth-logo{height:34px}
.auth-field{grid-template-columns:72px minmax(0,1fr)}
.auth-field .auth-label{font-size:13px}
.auth-field .auth-input{font-size:13px}

/* ── login logo larger, DPC/Manager left edges aligned ── */
.auth-logo{height:44px}
.auth-brand{gap:16px;justify-content:center}
.auth-brand-text{text-align:left;align-items:flex-start}
.auth-brand-text strong,.auth-brand-text small{display:block;text-align:left}

/* ── login brand text +1 step ──────────────────────────── */
.auth-brand-text strong{font-size:17px}
.auth-brand-text small{font-size:12px}

/* ── login: all text +2 steps ──────────────────────────── */
.auth-brand-text strong{font-size:19px}
.auth-brand-text small{font-size:14px}
.auth-field{grid-template-columns:84px minmax(0,1fr)}
.auth-field .auth-label{font-size:15px}
.auth-field .auth-input{font-size:15px}
.auth-btn{font-size:16px}
.auth-foot{font-size:13px}
.auth-error{font-size:14.5px}

/* ── light mode: buttons use LogiAI "A" blue ───────────── */
html[data-theme="light"] .btn-primary,
html[data-theme="light"] .auth-btn {
  background: #0062B9;
  border-color: #0062B9;
  color: #FFFFFF;
}
html[data-theme="light"] .btn-primary:hover,
html[data-theme="light"] .auth-btn:hover {
  background: #00539F;
  border-color: #00539F;
  color: #FFFFFF;
}
html[data-theme="light"] .theme-card.active {
  border-color: rgba(0, 98, 185, .45);
  box-shadow: inset 0 0 0 1px rgba(0, 98, 185, .45);
}

/* ── settings: equal left/right column heights ─────────── */
.settings-grid{align-items:stretch}
.settings-left,.settings-stack{height:100%}
.settings-left .settings-panel:last-child{margin-top:auto}

/* keep both settings columns bottom-aligned */
.settings-stack .settings-panel:last-child{margin-top:auto}

/* ── settings left: fill height, minimize gap ──────────── */
.settings-left{gap:10px;height:100%;justify-content:stretch}
.settings-left .settings-panel{flex:1 1 0;margin-top:0;display:flex;flex-direction:column}
.settings-left .settings-panel:last-child{margin-top:0}

/* ── DPC App card: keep save button fully visible ──────── */
.settings-left .settings-panel:first-child{flex:0 0 auto;padding-bottom:24px}
.settings-left .settings-panel:first-child .settings-actions{margin-bottom:0;padding-bottom:2px}
.settings-left .settings-panel:last-child{flex:1 1 auto;min-height:0}

/* ── language card vertical spacing ────────────────────── */
.settings-panel.language-panel{padding-top:20px;padding-bottom:22px}
.settings-panel.language-panel .panel-sub{margin-bottom:12px}
.settings-panel.language-panel #settingsLang{margin-top:2px}

/* ── productivity analysis ─────────────────────────────── */
.prod-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.prod-kpi{padding:14px 16px;display:flex;flex-direction:column;gap:4px;min-height:88px;justify-content:center}
.prod-label{font-size:10px;font-weight:750;letter-spacing:.12em;text-transform:uppercase;color:var(--muted)}
.prod-kpi strong{font-size:24px;line-height:1.05;letter-spacing:-.02em;color:var(--text)}
.prod-sub{font-family:var(--mono);font-size:10px;color:var(--muted-2)}
.prod-panel{margin-top:14px;overflow:hidden}
.prod-panel .panel-head{padding:15px 18px 6px;align-items:center}
.prod-badge{font-family:var(--mono);font-size:9.5px;letter-spacing:.1em;color:var(--muted-2);border:1px solid var(--line);border-radius:5px;padding:4px 7px;white-space:nowrap}
.chart-wrap{width:100%;padding:4px 12px 6px;overflow-x:auto}
.chart-wrap svg{width:100%;height:auto;display:block;min-width:760px}
.chart-grid{stroke:var(--line);stroke-width:1;opacity:.7}
.chart-axis{fill:var(--muted);font-size:10px;font-family:var(--mono)}
.chart-line{fill:none;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.chart-pt{stroke:var(--panel);stroke-width:1.5}
.weekly-line{stroke-width:2.6}
.avg-line{stroke:var(--amber);stroke-width:1.7;stroke-dasharray:7 5;opacity:.95}
.avg-label{fill:var(--amber-text);font-size:10px;font-family:var(--mono);font-weight:700}
.chart-subhead{display:flex;justify-content:space-between;align-items:center;padding:4px 18px 0;font-size:11px;font-weight:600;color:var(--muted)}
.chart-subhead span{font-family:var(--mono);font-size:9.5px;color:var(--muted-2)}
.chart-legend{display:flex;flex-wrap:wrap;align-items:center;gap:12px;padding:0 18px 14px}
.legend-item{display:inline-flex;align-items:center;gap:6px;font-size:11px;color:var(--muted)}
.legend-dot{width:8px;height:8px;border-radius:50%}
.heat-scale{width:90px;height:8px;border-radius:999px;background:linear-gradient(90deg,rgba(0,98,185,.12),rgba(0,98,185,.9));display:inline-block}
@media (max-width:900px){.prod-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* ── Manager Route Map panel ───────────────────────────── */
.map-route-panel{margin-top:14px;overflow:hidden}
.map-route-panel .panel-head{padding:15px 18px 6px;align-items:center}
.map-route-canvas{padding:8px 16px 0;overflow-x:auto}
.manager-route-map{width:100%;height:auto;display:block;min-width:680px}
.map-route-empty{padding:32px 18px;text-align:center;color:var(--muted);font-size:12px}

/* ── map page: match vertical gaps, fit one screen ─────── */
.map-route-panel{margin-top:14px;margin-bottom:0}
.table-panel{margin-top:14px}
.map-route-canvas{height:clamp(260px,34vh,380px);display:flex;align-items:center;justify-content:center}
.manager-route-map{width:100%;height:100%;min-width:0}
.table-panel .table-scroll{max-height:max(160px,calc(100vh - 650px))}

.pager{display:inline-flex;gap:6px;margin-left:auto}

/* ── i18n grid: fill to bottom + pagination ────────────── */
.i18n-view{display:flex;flex-direction:column;height:calc(100vh - 112px);min-height:0}
.i18n-view .i18n-table-panel{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;margin-top:14px}
.i18n-table-panel .toolbar{flex:0 0 auto}
.i18n-table-panel .table-scroll{flex:1 1 auto;min-height:0;max-height:none;overflow:auto}
.i18n-table-panel .table-foot{flex:0 0 auto}
.i18n-table-panel thead th{position:sticky;top:0;background:var(--panel);z-index:2}

/* i18n grid: fill content area reliably */
.i18n-view{display:flex;flex-direction:column;height:100%;min-height:calc(100vh - 120px);min-width:0}
.i18n-view .view-head{flex:0 0 auto}
.i18n-view .i18n-table-panel{flex:1 1 0;min-height:0;display:flex;flex-direction:column}
.i18n-table-panel .toolbar{flex:0 0 auto}
.i18n-table-panel .table-scroll{flex:1 1 0;min-height:0;max-height:none!important;overflow:auto}
.i18n-table-panel .table-foot{flex:0 0 auto;margin-top:auto}

/* ── match DPC login card dimensions (2026-11-03) ─────── */
.auth-card {
  width: min(440px, 100%);
  padding: 26px 28px 22px;
  border-radius: 16px;
}
.auth-input {
  height: 48px;
  border-radius: 9px;
}
.auth-btn {
  height: 48px;
  border-radius: 9px;
}
@media (max-width: 520px) {
  .auth-card { width: min(440px, calc(100vw - 48px)); }
}

/* ── exact DPC login spacing parity (2026-11-03) ───────── */
.auth-gate { padding-left: 4vw; padding-right: 4vw; }
.auth-card { width: min(440px, 92vw); }
.auth-brand {
  gap: 14px;
  margin: 22px 0 30px;
  padding: 4px 0;
  justify-content: center;
  align-items: center;
}
.auth-logo { height: 44px; }
.auth-brand-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  line-height: 1.1;
}
.auth-brand-text strong { font-size: 19px; }
.auth-brand-text small {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.auth-field {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.auth-field .auth-label {
  margin: 0;
  font-size: 15px;
  white-space: nowrap;
}
.auth-field .auth-input { font-size: 15px; }
.auth-input { height: 48px; border-radius: 9px; }
.auth-btn {
  height: clamp(50px, 5.9vh, 72px);
  margin-top: 18px;
  border-radius: 10px;
  font-size: clamp(12px, .95vw, 16px);
}
.auth-foot {
  margin-top: 14px;
  font-size: 13px;
  text-align: center;
}
