/* ========================================
   宏衫杰技术 · MES追溯系统 后台深色主题
   与扫码页面统一深色科技商务风
   完全兼容现有 HTML 结构 + JS 逻辑
   ======================================== */

:root {
  --bg: #0d1a13;
  --surface: #16231e;
  --surface-2: #1c2b24;
  --border: #26362e;
  --border-light: #2d3f36;
  --ink: #edf3ef;
  --ink-2: #b6cbc2;
  --ink-3: #739486;
  --brand: #27b588;
  --brand-dim: #1a7a5c;
  --brand-bg: rgba(39, 181, 136, 0.08);
  --ok: #27b588;
  --ok-bg: rgba(39, 181, 136, 0.12);
  --warn: #d4942b;
  --warn-bg: rgba(212, 148, 43, 0.12);
  --bad: #e0554a;
  --bad-bg: rgba(224, 85, 74, 0.12);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 1px 4px rgba(0, 0, 0, 0.2);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 260px;
  --sidebar-collapsed: 72px;
  --field-h: 40px;
  --content-max: 1680px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--bg);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}


body.locked { background: #070714; overflow: hidden; }
.login-screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 1000; }
.login-bg { position: fixed; inset: 0; overflow: hidden; background: radial-gradient(ellipse 80% 60% at 50% 35%, rgba(99,102,241,0.1), transparent), radial-gradient(ellipse 60% 50% at 70% 65%, rgba(168,85,247,0.07), transparent), radial-gradient(ellipse 50% 40% at 30% 70%, rgba(59,130,246,0.05), transparent); }
.login-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(99,102,241,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(99,102,241,0.04) 1px, transparent 1px); background-size: 50px 50px; -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, black 30%, transparent 70%); mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, black 30%, transparent 70%); }
.login-orb { position: absolute; width: 500px; height: 500px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, rgba(99,102,241,0.15), rgba(168,85,247,0.08), transparent 70%); top: 50%; left: 50%; transform: translate(-50%,-50%); animation: orbFloat 8s ease-in-out infinite; filter: blur(60px); }
@keyframes orbFloat { 0%,100% { transform: translate(-50%,-50%) scale(1); } 33% { transform: translate(-45%,-55%) scale(1.08); } 66% { transform: translate(-55%,-45%) scale(0.95); } }
.login-container { position: relative; z-index: 10; display: flex; flex-direction: column; align-items: center; gap: 28px; animation: fadeUp 0.6s ease-out; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.login-branding { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.login-logo { margin-bottom: 2px; }
.login-title { font-size: 26px; font-weight: 700; margin: 0; background: linear-gradient(135deg, #e2e8f0, #a5b4fc, #c084fc); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; letter-spacing: 1px; }
.login-subtitle { font-size: 12px; color: rgba(148,163,184,0.5); letter-spacing: 3px; text-transform: uppercase; margin: 0; }
.login-card { width: 360px; background: rgba(12,12,30,0.75); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(99,102,241,0.12); border-radius: 14px; padding: 28px; box-shadow: 0 0 40px rgba(99,102,241,0.06), inset 0 1px 0 rgba(255,255,255,0.04); transition: border-color 0.3s, box-shadow 0.3s; }
.login-card:focus-within { border-color: rgba(99,102,241,0.35); box-shadow: 0 0 50px rgba(99,102,241,0.1), inset 0 1px 0 rgba(255,255,255,0.04); }
.login-card-header { margin-bottom: 22px; }
.login-card-header h2 { font-size: 18px; font-weight: 600; color: #e2e8f0; margin: 0 0 3px; }
.login-card-header p { font-size: 13px; color: rgba(148,163,184,0.5); margin: 0; }
.login-field { margin-bottom: 18px; }
.login-field label { display: block; font-size: 13px; font-weight: 500; color: rgba(148,163,184,0.7); margin-bottom: 5px; }
.input-wrapper { position: relative; }
.input-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: rgba(148,163,184,0.35); z-index: 2; pointer-events: none; transition: color 0.3s; }
.login-field input { width: 100%; height: 42px; padding: 0 12px 0 40px; background: rgba(0,0,0,0.35); border: 1px solid rgba(99,102,241,0.1); border-radius: 9px; color: #e2e8f0; font-size: 14px; font-family: inherit; outline: none; box-sizing: border-box; transition: border-color 0.3s, box-shadow 0.3s; }
.login-field input::placeholder { color: rgba(148,163,184,0.25); }
.login-field input:focus { border-color: rgba(99,102,241,0.4); box-shadow: 0 0 0 1px rgba(99,102,241,0.12), 0 0 18px rgba(99,102,241,0.06); }
.input-wrapper:focus-within .input-icon { color: rgba(99,102,241,0.6); }
.login-btn { width: 100%; height: 42px; display: flex; align-items: center; justify-content: center; gap: 6px; background: linear-gradient(135deg, #6366f1, #8b5cf6); border: none; border-radius: 9px; color: #fff; font-size: 15px; font-weight: 600; font-family: inherit; cursor: pointer; letter-spacing: 2px; transition: all 0.25s; position: relative; overflow: hidden; }
.login-btn::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, #4f46e5, #7c3aed); opacity: 0; transition: opacity 0.25s; }
.login-btn:hover::before { opacity: 1; }
.login-btn:hover { box-shadow: 0 0 25px rgba(99,102,241,0.35); transform: translateY(-1px); }
.login-btn:active { transform: translateY(0); }
.login-btn span, .login-btn svg { position: relative; z-index: 1; }
.btn-arrow { transition: transform 0.25s; }
.login-btn:hover .btn-arrow { transform: translateX(4px); }
#loginMessage { margin: 12px 0 0; font-size: 13px; text-align: center; min-height: 20px; color: #f87171; }
@media (max-width: 480px) { .login-card { width: calc(100vw - 32px); padding: 22px; } .login-title { font-size: 22px; } }

body.locked .app-shell {
  display: none;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ======== Login Screen ======== */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 20px;
  background: radial-gradient(ellipse at 50% 0%, #132a21 0%, #0b1711 100%);
}

body.locked .login-screen {
  display: grid;
}

.login-card {
  width: min(100%, 390px);
  display: grid;
  gap: 16px;
  padding: 32px 28px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.login-brand {
  color: var(--ink);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.login-brand .brand-mark {
  width: 52px;
  height: 52px;
  font-size: 22px;
}

.login-brand strong {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}

.login-brand span {
  font-size: 13px;
  color: var(--ink-3);
}

.login-icp {
  position: absolute;
  bottom: 24px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 12px;
  color: rgba(148,163,184,0.45);
  letter-spacing: 0.5px;
}

.login-card label {
  display: grid;
  gap: 6px;
}

.login-card label span {
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 500;
}

.login-card input {
  width: 100%;
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--ink);
}

.login-card input:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 3px var(--brand-bg);
}

.login-card .primary-button {
  margin-top: 4px;
  min-height: 44px;
  font-size: 15px;
  font-weight: 600;
}

#loginMessage {
  min-height: 20px;
  color: var(--bad);
  font-size: 13px;
  text-align: center;
}

/* ======== Buttons & Inputs ======== */
button, input, select, textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

input, select, textarea {
  height: var(--field-h);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  background: var(--surface-2);
  color: var(--ink);
  transition: border-color 0.15s ease;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 3px var(--brand-bg);
}

textarea {
  min-height: 100px;
  padding: 10px 12px;
  resize: vertical;
}

select {
  cursor: pointer;
  appearance: auto;
}

option {
  background: var(--surface);
  color: var(--ink);
}

/* ======== App Shell ======== */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
}

/* ======== Sidebar ======== */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px 14px;
  background: linear-gradient(180deg, #0e1f17 0%, #0a1611 100%);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  color: var(--ink);
  text-decoration: none;
  padding: 4px 6px;
}

.brand:hover {
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #0d1a13;
  font-size: 18px;
  font-weight: 800;
  flex-shrink: 0;
}

.brand strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.brand span,
.shift-card span,
.shift-card small {
  color: var(--ink-3);
  font-size: 12px;
  display: block;
  margin-top: 2px;
}

.nav-list {
  display: grid;
  gap: 4px;
}

.nav-item {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0 12px;
  color: var(--ink-2);
  background: transparent;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.nav-item:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.active {
  color: var(--brand);
  background: var(--brand-bg);
  font-weight: 600;
}

.shift-card {
  margin-top: auto;
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
}

.shift-card strong {
  font-size: 14px;
  color: var(--ink-2);
}

.shift-card .copyright {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  line-height: 1.45;
  font-size: 11px;
  color: var(--ink-3);
}

/* ======== Workspace ======== */
.workspace {
  min-width: 0;
  padding: 24px 28px;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

h1, h2, p {
  margin: 0;
}

h1 {
  font-size: clamp(22px, 2.8vw, 32px);
  line-height: 1.2;
  font-weight: 700;
  color: var(--ink);
}

h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}

p, .muted {
  color: var(--ink-3);
  font-size: 14px;
}

.topbar p,
.section-title p,
.panel-header p,
.trace-search p {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.5;
}

.top-actions,
.panel-header,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.top-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar > div,
.panel-header > div,
.section-title > div {
  min-width: 0;
}

.user-chip {
  display: grid;
  gap: 2px;
  min-width: 96px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.user-chip strong {
  font-size: 13px;
  color: var(--ink);
}

.user-chip span {
  color: var(--ink-3);
  font-size: 12px;
}

.version-label {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: 13px;
  white-space: nowrap;
}

.primary-button,
.icon-button,
.compact-button,
.text-button,
.segmented button {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.primary-button {
  min-height: var(--field-h);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  color: #fff;
  background: var(--brand);
  font-weight: 600;
  font-size: 14px;
}

.primary-button:hover {
  background: var(--brand-dim);
  box-shadow: 0 0 20px rgba(39, 181, 136, 0.25);
}

.primary-button:active {
  transform: scale(0.98);
}

.icon-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--ink-2);
  background: var(--surface-2);
  border-color: var(--border);
}

.icon-button:hover {
  border-color: var(--border-light);
  color: var(--ink);
}

.compact-button {
  min-width: 54px;
  min-height: var(--field-h);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  color: var(--ink-2);
  background: var(--surface-2);
  border-color: var(--border);
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
}

.compact-button:hover {
  border-color: var(--border-light);
  color: var(--ink);
  background: var(--surface);
}

.compact-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.text-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  background: transparent;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 500;
}

.text-button:hover {
  background: var(--brand-bg);
}

.danger-action {
  color: var(--bad);
}

.danger-action:hover {
  background: var(--bad-bg);
}

/* ======== Views ======== */
.view {
  display: none;
}

.view.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

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

/* ======== Metric Grid ======== */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric, .panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}

.metric {
  display: grid;
  gap: 8px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.metric::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), transparent);
}

.metric span, .metric small, .record-list dt, .field-label {
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 500;
}

.metric strong {
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.5px;
}

/* ======== Layout Grids ======== */
.dashboard-grid,
.trace-layout,
.recall-grid,
.upload-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.8fr);
  gap: 16px;
  margin-top: 16px;
}

.trace-layout,
.recall-grid,
.upload-grid.lower {
  grid-template-columns: minmax(280px, 0.7fr) minmax(0, 1.5fr);
}

.panel {
  padding: 20px;
  min-width: 0;
}

.panel-header {
  margin-bottom: 14px;
  min-height: 32px;
}

.panel-header.compact {
  align-items: center;
}

/* ======== Line Map ======== */
.line-map {
  width: 100%;
  max-height: 230px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

/* ======== Station Strip ======== */
.station-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.station {
  min-height: 86px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.station strong {
  display: block;
  font-size: 14px;
  color: var(--ink);
}

.station span {
  display: block;
  margin-top: 6px;
  color: var(--ink-3);
  font-size: 12px;
}

.station .status {
  margin-top: 8px;
}

/* ======== Risk List ======== */
.risk-list,
.issue-board,
.impact-summary {
  display: grid;
  gap: 10px;
}

.risk-item, .issue-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.risk-item {
  display: grid;
  gap: 6px;
}

.risk-item strong, .issue-card strong {
  font-size: 14px;
  color: var(--ink);
}

.risk-item small, .issue-card small {
  color: var(--ink-3);
}

/* ======== Trace Search ======== */
.trace-search {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.search-box {
  display: grid;
  grid-template-columns: 22px minmax(190px, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: min(100%, 520px);
  padding: 8px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
}

.search-box.flush {
  margin: 8px 0 16px;
  border: 1px solid var(--border);
}

.search-box.table-search,
.search-box.flush {
  width: 100%;
  max-width: none;
}

.search-box .primary-button,
.search-box .compact-button {
  min-height: 34px;
}

.search-box input {
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  height: 32px;
}

.search-box input:focus {
  box-shadow: none;
}

.search-box span[data-icon] {
  color: var(--ink-3);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ======== Record List ======== */
.record-list {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px 14px;
  margin: 0;
}

.record-list dt {
  color: var(--ink-3);
  font-weight: 500;
}

.record-list dd {
  margin: 0;
  font-weight: 600;
  color: var(--ink);
  word-break: break-all;
}

/* ======== Status Badges ======== */
.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.status.ok {
  color: var(--ok);
  background: var(--ok-bg);
}

.status.warn {
  color: var(--warn);
  background: var(--warn-bg);
}

.status.bad {
  color: var(--bad);
  background: var(--bad-bg);
}

/* ======== Timeline / Steps ======== */
.timeline {
  display: grid;
  gap: 12px;
}

.step {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.step-index {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #0d1a13;
  background: var(--brand);
  font-weight: 800;
  font-size: 14px;
}

.step strong {
  color: var(--ink);
}

.step p {
  margin-top: 4px;
  font-size: 13px;
}

.step small {
  display: block;
  margin-top: 6px;
}

.section-title {
  margin-bottom: 14px;
}

/* ======== Segmented Tabs ======== */
.segmented {
  display: inline-grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.segmented button {
  min-width: 62px;
  height: 34px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
}

.segmented button.active {
  color: #fff;
  background: var(--brand);
}

.segmented button:hover:not(.active) {
  background: var(--surface-2);
}

/* ======== CCC Tabs ======== */
.ccc-tabs {
  display: flex;
  width: 100%;
  grid-template-columns: none;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  margin-bottom: 14px;
}

.ccc-tabs button {
  min-width: 108px;
  padding: 0 14px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.ccc-tabs button:first-child {
  min-width: 128px;
  margin-right: auto;
}

.ccc-tab-panel {
  display: none;
}

.ccc-tab-panel.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

/* ======== Tables ======== */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

th, td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--ink-2);
  vertical-align: middle;
}

th {
  color: var(--ink-3);
  font-weight: 600;
  background: var(--surface-2);
  font-size: 13px;
  letter-spacing: 0.3px;
}

td strong {
  color: var(--ink);
}

td a {
  font-size: 13px;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* ======== Issue Board ======== */
.issue-board {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.issue-card {
  display: grid;
  gap: 10px;
}

.issue-card header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.impact-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.order-summary {
  margin-top: 14px;
}

.impact-box {
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.impact-box span {
  color: var(--ink-3);
  font-size: 13px;
}

.impact-box strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
  color: var(--ink);
  font-weight: 700;
}

/* ======== Flow Steps ======== */
.flow-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.flow-steps article,
.tool-item,
.qr-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.flow-steps article {
  min-height: 142px;
  padding: 16px;
}

.flow-steps span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  border-radius: 50%;
  color: #0d1a13;
  background: var(--brand);
  font-weight: 800;
  font-size: 14px;
}

.flow-steps strong {
  display: block;
  color: var(--ink);
}

.flow-steps p {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.5;
}

/* ======== QR Card ======== */
.qr-card {
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 20px;
  text-align: center;
}

.qr-card img {
  width: 160px;
  height: 160px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.qr-card strong {
  font-size: 14px;
  color: var(--ink);
  word-break: break-all;
}

.qr-card a {
  color: var(--brand);
  font-size: 13px;
  word-break: break-all;
}

/* ======== Tool List ======== */
.tool-list {
  display: grid;
  gap: 10px;
}

.tool-item {
  display: grid;
  gap: 7px;
  padding: 14px;
}

.settings-tools .tool-item {
  align-content: start;
}

.inline-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.inline-actions select {
  min-width: 150px;
}

.settings-trace-panel {
  margin-top: 16px;
}

.tool-item span, .tool-item small {
  color: var(--ink-3);
  font-size: 13px;
}

.tool-item .primary-button span {
  color: inherit;
}

.tool-item strong {
  color: var(--ink);
  font-size: 14px;
}

/* ======== Manual Panel ======== */
.manual-panel {
  margin-top: 20px;
}

.manual-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px 16px;
  align-items: flex-end;
}

.manual-form label,
.user-form label {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.manual-form label span,
.user-form label span {
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.manual-form input,
.manual-form select,
.manual-form textarea,
.user-form input,
.user-form select {
  width: 100%;
  height: var(--field-h);
}

.manual-form .primary-button {
  min-width: 150px;
  height: var(--field-h);
  justify-content: center;
  white-space: nowrap;
  align-self: end;
}

.batch-upload {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.batch-upload > label {
  display: grid;
  gap: 8px;
  color: var(--ink-2);
  font-weight: 600;
  font-size: 13px;
}

.batch-upload > label textarea {
  width: 100%;
  margin-top: 4px;
}

.batch-upload > label + .compact-button {
  margin-top: 10px;
  min-width: 96px;
}

.batch-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.batch-header span:first-child {
  color: var(--ink-2);
  font-weight: 600;
  font-size: 13px;
}

.batch-header .muted {
  font-size: 12px;
}

.batch-row {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.batch-row textarea {
  min-height: 64px;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
}

.batch-row .compact-button {
  min-height: 40px;
  white-space: nowrap;
  min-width: 96px;
}

.excel-upload {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(260px, 420px) auto auto;
  gap: 10px;
  align-items: end;
}

.excel-upload input[type="file"] {
  width: 100%;
  min-width: 0;
  max-width: none;
  height: var(--field-h);
  padding: 8px 10px;
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink-2);
}

.excel-upload .compact-button,
.excel-upload .text-button {
  min-height: var(--field-h);
  white-space: nowrap;
}

.form-note {
  margin: 10px 0 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--warn-bg);
  font-size: 13px;
  line-height: 1.55;
  color: var(--warn);
}

/* ======== Pager ======== */
.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

/* ======== User Form ======== */
.user-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px 14px;
  align-items: end;
}

.user-form .primary-button {
  margin-top: 4px;
  min-height: var(--field-h);
}

.model-image-list {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
}

.model-image-title,
.model-image-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}

.model-image-title {
  align-items: center;
}

.model-image-title > span {
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
}

.model-image-rows {
  display: grid;
  gap: 10px;
}

.model-image-row {
  grid-template-columns: minmax(150px, 1fr) minmax(180px, 1.3fr) var(--field-h);
}

.certificate-models {
  display: grid;
  gap: 8px;
  min-width: 220px;
}

.certificate-model-card {
  display: grid;
  grid-template-columns: 48px minmax(90px, 1fr);
  gap: 8px;
  align-items: center;
}

.certificate-model-card img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.certificate-model-card strong {
  display: block;
  color: var(--ink-1);
  font-size: 13px;
}

.certificate-model-card a {
  font-size: 12px;
}

.certificate-model-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
}

.certificate-model-actions .text-button {
  padding: 0;
  font-size: 12px;
}

.department-select,
.role-select,
.state-select {
  min-width: 120px;
}

/* ======== Print Labels ======== */
.print-labels {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.qr-label {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  text-align: center;
  break-inside: avoid;
}

.qr-label img {
  width: 112px;
  height: 112px;
  border-radius: 4px;
}

.qr-label strong {
  font-size: 13px;
  word-break: break-all;
  color: var(--ink);
}

.qr-label span {
  color: var(--ink-3);
  font-size: 12px;
}

/* ======== Admin Only ======== */
.admin-only {
  display: none;
}

body.is-admin .admin-only {
  display: flex;
}

/* ======== Print ======== */
@media print {
  body {
    background: #fff !important;
  }
  body > *:not(#printRoot) {
    display: none !important;
  }
  #printRoot {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 8mm;
    padding: 8mm;
    margin: 0 !important;
  }
  #printRoot .qr-label {
    border: 1px solid #000;
    box-shadow: none;
    page-break-inside: avoid;
    break-inside: avoid;
    background: #fff !important;
  }
}

/* ======== Toast ======== */
.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  transform: translateY(20px);
  opacity: 0;
  max-width: 320px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  color: #fff;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: 0.2s ease;
  pointer-events: none;
  font-size: 14px;
  z-index: 100;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* ======== Table Search ======== */
.search-box.table-search {
  margin-bottom: 14px;
}

/* ======== Responsive ======== */
@media (max-width: 1050px) {
  .app-shell {
    grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr);
  }

  .brand div:last-child,
  .nav-item {
    font-size: 0;
  }

  .nav-item {
    justify-content: center;
    padding: 0 4px;
  }

  .brand {
    justify-content: center;
  }

  .brand .brand-mark {
    margin: 0 auto;
  }

  .shift-card {
    display: none;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .trace-layout,
  .recall-grid,
  .upload-grid,
  .upload-grid.lower {
    grid-template-columns: 1fr;
  }

  .flow-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .manual-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .batch-row,
  .excel-upload {
    grid-template-columns: 1fr;
  }

  .ccc-tabs {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .ccc-tabs button:first-child {
    margin-right: 0;
  }
}

@media (max-width: 720px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 10px;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .brand {
    display: none;
  }

  .nav-list {
    grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
    gap: 2px;
    flex: 1;
  }

  .nav-item {
    height: 38px;
  }

  .workspace {
    padding: 16px;
  }

  .topbar,
  .trace-search,
  .section-title {
    align-items: stretch;
    flex-direction: column;
  }

  .metric-grid,
  .station-strip,
  .issue-board,
  .impact-summary,
  .flow-steps {
    grid-template-columns: 1fr;
  }

  .search-box {
    grid-template-columns: 22px minmax(0, 1fr);
  }

  .search-box .primary-button {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .manual-form {
    grid-template-columns: 1fr;
  }

  .batch-row,
  .excel-upload,
  .user-form {
    grid-template-columns: 1fr;
  }

  .batch-row .compact-button,
  .excel-upload .compact-button,
  .excel-upload .text-button,
  .manual-form .primary-button {
    width: 100%;
  }

  .ccc-tabs button {
    flex: 1 1 140px;
  }

  .ccc-tabs button:first-child {
    flex-basis: 100%;
  }

  .panel {
    padding: 14px;
  }

  h1 {
    font-size: 20px;
  }
}

/* ── CCC Appointments Gallery ── */
.appointment-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  padding: 8px 0;
}

.appointment-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.appointment-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.appointment-card-image {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: var(--surface-2);
  display: block;
}

.appointment-card-body {
  padding: 10px 12px;
}

.appointment-card-desc {
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
  margin-bottom: 4px;
}

.appointment-card-meta {
  font-size: 11px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.appointment-card-delete {
  color: var(--bad);
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 107, 122, 0.1);
  border: 1px solid rgba(255, 107, 122, 0.22);
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.2s, border-color 0.2s;
}

.appointment-card-delete b {
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.appointment-card-delete:hover {
  background: var(--bad-bg);
  border-color: rgba(255, 107, 122, 0.42);
}

/* ── Appointment Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.2s;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-content.modal-image {
  max-width: 90vw;
  max-height: 90vh;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 15px;
  color: var(--ink);
  margin: 0;
}

.modal-close-button {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 12px;
}

.modal-close-button svg {
  display: none;
}

.modal-close-button b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
}

.modal-image-body {
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  max-height: 70vh;
}

.modal-image-body img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  display: block;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
}

/* ── TYPE-C Dynamic Slot ── */
.typec-slot {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  background: var(--surface);
}
.typec-slot .slot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.typec-slot .slot-label {
  font-weight: 600;
  font-size: 14px;
  color: var(--primary);
}
.typec-slot .slot-remove {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.typec-slot .slot-remove:hover {
  background: var(--danger-bg);
}
.typec-slot .batch-upload {
  padding: 12px 14px;
}
.slot-add-bar {
  display: flex;
  justify-content: center;
  padding: 4px 0;
}
.slot-add-bar .compact-button {
  min-width: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* ICP / copyright alignment */
.icp-footer {
  margin: 16px auto 0;
  padding: 12px 18px;
  width: min(520px, calc(100% - 32px));
  border: 1px solid var(--border, rgba(148, 163, 184, 0.24));
  border-radius: 10px;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--surface-2, rgba(15, 23, 42, 0.45));
}
.icp-footer p { margin: 0; text-align: center; }
.icp-footer a { color: var(--ink-3, #739486); text-decoration: none; }

/* Sidebar copyright ICP */
.shift-card .copyright {
  text-align: center;
  font-size: 11px;
}

.shift-card .sidebar-icp {
  display: block;
  text-align: center;
  font-size: 11px;
  line-height: 1.45;
  color: var(--ink-3);
}

.shift-card .sidebar-icp a {
  color: inherit;
  text-decoration: none;
}

/* Unified 3C trace design system */
:root {
  --bg: #07110f;
  --surface: #0f1d1d;
  --surface-2: #142626;
  --surface-3: #182e2d;
  --border: rgba(118, 169, 162, 0.22);
  --border-light: rgba(69, 216, 198, 0.36);
  --ink: #f2fbf8;
  --ink-2: #b8d1ca;
  --ink-3: #7ea096;
  --brand: #45d8c6;
  --brand-dim: #32c88f;
  --brand-bg: rgba(69, 216, 198, 0.12);
  --ok: #32c88f;
  --ok-bg: rgba(50, 200, 143, 0.13);
  --warn: #f0b45a;
  --warn-bg: rgba(240, 180, 90, 0.14);
  --bad: #ff6b6b;
  --bad-bg: rgba(255, 107, 107, 0.14);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.035);
  --radius: 14px;
  --radius-sm: 9px;
}

body {
  background:
    linear-gradient(180deg, rgba(69, 216, 198, 0.07), transparent 28%),
    linear-gradient(135deg, #07110f 0%, #0b1518 48%, #101811 100%);
}

body.locked {
  background: #07110f;
}

.login-screen {
  background:
    linear-gradient(180deg, rgba(69, 216, 198, 0.1), transparent 38%),
    linear-gradient(135deg, #07110f 0%, #0b1518 50%, #101811 100%);
}

.login-screen::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(118, 169, 162, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(118, 169, 162, 0.08) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

.login-bg,
.login-grid,
.login-orb {
  display: none;
}

.login-container {
  width: min(100%, 430px);
  gap: 22px;
}

.login-logo svg rect:first-child,
.login-logo svg rect:nth-child(2) {
  fill: url(#g);
}

.login-title {
  background: none;
  -webkit-text-fill-color: currentColor;
  color: var(--ink);
  font-size: 28px;
  letter-spacing: 0;
}

.login-subtitle {
  color: var(--ink-3);
  letter-spacing: 2px;
}

.login-card {
  width: min(100%, 400px);
  padding: 30px;
  border: 1px solid var(--border-light);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent),
    rgba(15, 29, 29, 0.9);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

.login-card:focus-within {
  border-color: rgba(69, 216, 198, 0.58);
  box-shadow: 0 28px 78px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(69, 216, 198, 0.12);
}

.login-card-header h2 {
  color: var(--ink);
  font-size: 20px;
}

.login-card-header p,
.login-field label {
  color: var(--ink-3);
}

.login-field input,
input,
select,
textarea {
  color: var(--ink);
  background: rgba(6, 18, 17, 0.74);
  border-color: var(--border);
}

.login-field input:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(69, 216, 198, 0.12);
}

.input-icon {
  color: rgba(126, 160, 150, 0.7);
}

.input-wrapper:focus-within .input-icon {
  color: var(--brand);
}

.login-btn,
.primary-button {
  color: #061210;
  background: linear-gradient(135deg, var(--brand), var(--brand-dim));
  font-weight: 750;
  box-shadow: 0 12px 28px rgba(69, 216, 198, 0.16);
}

.login-btn::before {
  background: linear-gradient(135deg, #6de6d7, #45d8c6);
}

.login-btn:hover,
.primary-button:hover {
  color: #061210;
  background: linear-gradient(135deg, #6de6d7, var(--brand));
  box-shadow: 0 16px 38px rgba(69, 216, 198, 0.24);
}

.login-icp {
  color: rgba(184, 209, 202, 0.62);
}

.app-shell {
  background:
    linear-gradient(180deg, rgba(69, 216, 198, 0.05), transparent 260px),
    linear-gradient(135deg, #07110f 0%, #0b1518 48%, #101811 100%);
}

.app-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(118, 169, 162, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(118, 169, 162, 0.055) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, black, transparent 70%);
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 28%),
    rgba(7, 17, 15, 0.92);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(16px);
}

.brand {
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 14px;
}

.brand:hover {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.035);
}

.brand-mark {
  color: #061210;
  background: linear-gradient(135deg, var(--brand), var(--brand-dim));
  box-shadow: 0 0 26px rgba(69, 216, 198, 0.22);
}

.nav-item {
  color: var(--ink-2);
  background: transparent;
}

.nav-item:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.055);
}

.nav-item.active {
  color: var(--brand);
  background: rgba(69, 216, 198, 0.12);
  box-shadow: inset 3px 0 0 var(--brand);
}

.shift-card {
  background:
    linear-gradient(180deg, rgba(69, 216, 198, 0.09), transparent),
    rgba(15, 29, 29, 0.84);
  border-color: var(--border);
}

.workspace {
  position: relative;
  z-index: 1;
}

.topbar,
.metric,
.panel,
.tool-item,
.step,
.trace-data-card,
.io-record {
  border-color: var(--border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent),
    rgba(15, 29, 29, 0.86);
  box-shadow: var(--shadow);
}

.topbar {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.topbar h1,
.panel h2,
.section-title h2 {
  color: var(--ink);
}

.version-label,
.user-chip,
.compact-button,
.text-button,
.segmented button {
  background: rgba(255, 255, 255, 0.045);
  border-color: var(--border);
  color: var(--ink-2);
}

.compact-button:hover,
.text-button:hover,
.segmented button:hover {
  border-color: var(--border-light);
  background: rgba(69, 216, 198, 0.08);
  color: var(--ink);
}

.segmented button.active,
.ccc-tabs button.active {
  color: #061210;
  background: linear-gradient(135deg, var(--brand), var(--brand-dim));
  border-color: transparent;
}

.metric::after {
  background: linear-gradient(90deg, var(--brand), transparent);
}

.metric strong {
  color: var(--ink);
}

.status.ok {
  color: var(--ok);
  background: var(--ok-bg);
}

.status.warn {
  color: var(--warn);
  background: var(--warn-bg);
}

.status.bad {
  color: var(--bad);
  background: var(--bad-bg);
}

table thead,
.io-table th {
  background: rgba(69, 216, 198, 0.07);
}

tr:hover td {
  background: rgba(69, 216, 198, 0.035);
}

.icp-footer {
  border-color: var(--border);
  background: rgba(15, 29, 29, 0.82);
}

/* Sidebar menu enclosure and copyright polish */
.sidebar {
  padding: 18px 12px 20px;
  gap: 14px;
}

.nav-list {
  display: grid;
  gap: 6px;
  padding: 12px;
  margin: 0;
  border: 1px solid rgba(118, 169, 162, 0.24);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    rgba(9, 27, 23, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 14px 34px rgba(0, 0, 0, 0.16);
}

.nav-item {
  width: 100%;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.025);
}

.nav-item:hover {
  border-color: rgba(69, 216, 198, 0.24);
  background: rgba(69, 216, 198, 0.075);
}

.nav-item.active {
  border-color: rgba(69, 216, 198, 0.28);
  background: rgba(69, 216, 198, 0.12);
  box-shadow: inset 3px 0 0 var(--brand), 0 8px 22px rgba(0, 0, 0, 0.12);
}

.nav-item span[data-icon] {
  width: 18px;
  min-width: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.shift-card {
  padding: 14px 12px;
  border-radius: 14px;
}

.shift-card .copyright {
  display: block;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(118, 169, 162, 0.22);
  text-align: center;
  font-size: 11px;
  line-height: 1.5;
}

.shift-card .sidebar-icp {
  display: block;
  margin-top: 2px;
  text-align: center;
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-3);
}

.shift-card .sidebar-icp a {
  color: inherit;
  text-decoration: none;
}

/* Sidebar full-width menu bars */
.sidebar {
  padding-left: 0;
  padding-right: 0;
}

.sidebar .brand,
.sidebar .shift-card {
  margin-left: 12px;
  margin-right: 12px;
}

.nav-list {
  width: 100%;
  margin: 0;
  padding: 10px 0;
  border-left: 0;
  border-right: 0;
  border-radius: 0;
}

.nav-item {
  width: 100%;
  border-radius: 0;
  padding-left: 22px;
  padding-right: 18px;
  justify-content: flex-start;
}

.nav-item.active {
  border-left: 0;
  border-right: 0;
  box-shadow: inset 4px 0 0 var(--brand);
}

/* WorkBuddy-inspired dark technology finish */
:root {
  --wb-bg: #050711;
  --wb-bg-soft: #090d1d;
  --wb-panel: rgba(12, 18, 34, 0.82);
  --wb-panel-strong: rgba(15, 24, 46, 0.92);
  --wb-line: rgba(119, 141, 255, 0.22);
  --wb-line-strong: rgba(45, 212, 191, 0.38);
  --wb-text: #f4f7ff;
  --wb-muted: #9eabc7;
  --wb-dim: #6d7897;
  --wb-cyan: #23f0d0;
  --wb-blue: #3b82f6;
  --wb-violet: #8b5cf6;
  --wb-indigo: #4f46e5;
  --wb-green: #31d69b;
  --wb-amber: #f6b44b;
  --wb-red: #ff6b7a;
  --radius: 16px;
  --brand: var(--wb-cyan);
  --brand-dim: #4f8cff;
  --border: var(--wb-line);
  --border-light: var(--wb-line-strong);
  --ink: var(--wb-text);
  --ink-2: var(--wb-muted);
  --ink-3: var(--wb-dim);
  --surface: var(--wb-panel);
  --surface-2: rgba(18, 27, 51, 0.78);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

html,
body {
  background: var(--wb-bg);
}

body {
  color: var(--wb-text);
  background:
    radial-gradient(circle at 12% 14%, rgba(59, 130, 246, 0.22), transparent 32%),
    radial-gradient(circle at 82% 8%, rgba(139, 92, 246, 0.22), transparent 28%),
    radial-gradient(circle at 78% 78%, rgba(35, 240, 208, 0.14), transparent 34%),
    linear-gradient(135deg, #050711 0%, #08101e 44%, #08111b 100%);
}

.login-screen,
.app-shell {
  background:
    radial-gradient(circle at 8% 12%, rgba(59, 130, 246, 0.26), transparent 28%),
    radial-gradient(circle at 72% 10%, rgba(139, 92, 246, 0.28), transparent 30%),
    radial-gradient(circle at 88% 70%, rgba(35, 240, 208, 0.16), transparent 28%),
    radial-gradient(circle at 32% 84%, rgba(79, 70, 229, 0.18), transparent 32%),
    linear-gradient(135deg, #050711 0%, #08101f 48%, #071512 100%);
}

.login-bg,
.app-shell::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.login-bg {
  z-index: 0;
}

.login-grid,
.app-shell::before {
  background-image:
    linear-gradient(rgba(119, 141, 255, 0.075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(119, 141, 255, 0.075) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.28) 72%, transparent);
}

.app-shell::before {
  content: "";
  z-index: 0;
}

.login-orb {
  position: absolute;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  filter: blur(24px);
  opacity: 0.42;
  animation: wb-drift 14s ease-in-out infinite alternate;
}

.login-orb:not(.orb-blue):not(.orb-cyan):not(.orb-indigo) {
  left: 8%;
  top: 12%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.42), transparent 66%);
}

.orb-blue {
  right: 9%;
  top: 8%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.44), transparent 66%);
  animation-delay: -3s;
}

.orb-cyan {
  right: 12%;
  bottom: 10%;
  background: radial-gradient(circle, rgba(35, 240, 208, 0.32), transparent 66%);
  animation-delay: -6s;
}

.orb-indigo {
  left: 26%;
  bottom: -8%;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.34), transparent 66%);
  animation-delay: -9s;
}

.login-ground-grid {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -10%;
  height: 38vh;
  transform: perspective(620px) rotateX(64deg);
  transform-origin: bottom;
  background-image:
    linear-gradient(rgba(35, 240, 208, 0.24) 1px, transparent 1px),
    linear-gradient(90deg, rgba(35, 240, 208, 0.20) 1px, transparent 1px);
  background-size: 54px 54px;
  opacity: 0.28;
  mask-image: linear-gradient(to top, black, transparent 82%);
}

.scan-lines span {
  position: absolute;
  left: -15%;
  width: 130%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(35, 240, 208, 0.8), transparent);
  box-shadow: 0 0 18px rgba(35, 240, 208, 0.42);
  animation: wb-scan 7s linear infinite;
}

.scan-lines span:nth-child(1) { top: 24%; }
.scan-lines span:nth-child(2) { top: 48%; animation-delay: -2.5s; }
.scan-lines span:nth-child(3) { top: 72%; animation-delay: -4.8s; }

.tech-rings span {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(35, 240, 208, 0.22);
  box-shadow: inset 0 0 34px rgba(79, 70, 229, 0.12), 0 0 26px rgba(35, 240, 208, 0.12);
  animation: wb-ring 18s linear infinite;
}

.tech-rings span:first-child {
  width: 220px;
  height: 220px;
  left: 12%;
  bottom: 18%;
}

.tech-rings span:last-child {
  width: 300px;
  height: 300px;
  right: 12%;
  top: 14%;
  animation-direction: reverse;
}

.circuit-nodes span,
.floating-particles span {
  position: absolute;
  border-radius: 50%;
  background: var(--wb-cyan);
  box-shadow: 0 0 18px rgba(35, 240, 208, 0.72);
}

.circuit-nodes span {
  width: 7px;
  height: 7px;
  animation: wb-pulse 2.8s ease-in-out infinite;
}

.circuit-nodes span:nth-child(1) { left: 12%; top: 18%; }
.circuit-nodes span:nth-child(2) { left: 24%; top: 32%; animation-delay: -0.3s; }
.circuit-nodes span:nth-child(3) { left: 38%; top: 18%; animation-delay: -0.6s; }
.circuit-nodes span:nth-child(4) { left: 62%; top: 28%; animation-delay: -0.9s; }
.circuit-nodes span:nth-child(5) { left: 78%; top: 18%; animation-delay: -1.2s; }
.circuit-nodes span:nth-child(6) { left: 88%; top: 42%; animation-delay: -1.5s; }
.circuit-nodes span:nth-child(7) { left: 16%; top: 66%; animation-delay: -1.8s; }
.circuit-nodes span:nth-child(8) { left: 30%; top: 78%; animation-delay: -2.1s; }
.circuit-nodes span:nth-child(9) { left: 48%; top: 70%; animation-delay: -2.4s; }
.circuit-nodes span:nth-child(10) { left: 66%; top: 82%; animation-delay: -2.7s; }
.circuit-nodes span:nth-child(11) { left: 82%; top: 68%; animation-delay: -3s; }
.circuit-nodes span:nth-child(12) { left: 54%; top: 44%; animation-delay: -3.3s; }

.floating-particles span {
  width: 3px;
  height: 3px;
  opacity: 0.58;
  animation: wb-float 12s linear infinite;
}

.floating-particles span:nth-child(1) { left: 6%; top: 74%; animation-delay: -1s; }
.floating-particles span:nth-child(2) { left: 12%; top: 28%; animation-delay: -6s; }
.floating-particles span:nth-child(3) { left: 18%; top: 56%; animation-delay: -3s; }
.floating-particles span:nth-child(4) { left: 24%; top: 12%; animation-delay: -8s; }
.floating-particles span:nth-child(5) { left: 31%; top: 84%; animation-delay: -5s; }
.floating-particles span:nth-child(6) { left: 36%; top: 42%; animation-delay: -9s; }
.floating-particles span:nth-child(7) { left: 43%; top: 20%; animation-delay: -2s; }
.floating-particles span:nth-child(8) { left: 48%; top: 68%; animation-delay: -7s; }
.floating-particles span:nth-child(9) { left: 53%; top: 34%; animation-delay: -4s; }
.floating-particles span:nth-child(10) { left: 58%; top: 78%; animation-delay: -10s; }
.floating-particles span:nth-child(11) { left: 63%; top: 16%; animation-delay: -1.8s; }
.floating-particles span:nth-child(12) { left: 68%; top: 54%; animation-delay: -6.8s; }
.floating-particles span:nth-child(13) { left: 73%; top: 30%; animation-delay: -3.8s; }
.floating-particles span:nth-child(14) { left: 78%; top: 86%; animation-delay: -8.8s; }
.floating-particles span:nth-child(15) { left: 83%; top: 48%; animation-delay: -5.8s; }
.floating-particles span:nth-child(16) { left: 88%; top: 18%; animation-delay: -10.8s; }
.floating-particles span:nth-child(17) { left: 92%; top: 62%; animation-delay: -2.8s; }
.floating-particles span:nth-child(18) { left: 33%; top: 60%; animation-delay: -7.6s; }
.floating-particles span:nth-child(19) { left: 70%; top: 72%; animation-delay: -4.6s; }
.floating-particles span:nth-child(20) { left: 96%; top: 36%; animation-delay: -9.6s; }

.login-container {
  position: relative;
  z-index: 2;
}

.login-branding {
  margin-bottom: 26px;
}

.login-logo {
  position: relative;
  display: grid;
  place-items: center;
  margin-inline: auto;
  width: 72px;
  height: 72px;
  border-radius: 24px;
  background: rgba(8, 12, 28, 0.72);
  border: 1px solid rgba(35, 240, 208, 0.26);
  box-shadow: 0 0 34px rgba(35, 240, 208, 0.18);
}

.login-logo::before {
  content: "";
  position: absolute;
  inset: -9px;
  border-radius: 30px;
  border: 1px solid rgba(35, 240, 208, 0.26);
  animation: wb-logo-pulse 2.8s ease-in-out infinite;
}

.login-title,
.brand strong {
  background: linear-gradient(100deg, #f7fbff 0%, var(--wb-cyan) 40%, #8da2ff 76%, #c084fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.login-title {
  font-size: 34px;
  letter-spacing: 0;
}

.login-subtitle {
  color: var(--wb-muted);
}

.login-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: min(420px, calc(100vw - 34px));
  border: 1px solid transparent;
  border-radius: 22px;
  background: transparent;
  backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.login-card::before {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: -2;
  border-radius: inherit;
  background: conic-gradient(from var(--wb-angle, 0deg), var(--wb-cyan), var(--wb-blue), var(--wb-violet), var(--wb-cyan));
  animation: wb-border-spin 7s linear infinite;
}

.login-card::after {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  border-radius: 21px;
  background: rgba(9, 13, 30, 0.92);
}

.login-card input,
.input-wrapper input,
input,
select,
textarea {
  border-color: rgba(119, 141, 255, 0.22);
  background: rgba(9, 14, 30, 0.72);
  color: var(--wb-text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.login-card input:focus,
.input-wrapper:focus-within,
input:focus,
select:focus,
textarea:focus {
  border-color: rgba(35, 240, 208, 0.58);
  box-shadow: 0 0 0 3px rgba(35, 240, 208, 0.12), 0 0 22px rgba(35, 240, 208, 0.12);
  outline: none;
}

.login-btn,
.primary-button,
button.primary-button {
  position: relative;
  overflow: hidden;
  color: #04100e;
  border: 0;
  background: linear-gradient(135deg, var(--wb-cyan), #4f8cff 54%, #9b5cf6);
  box-shadow: 0 14px 34px rgba(35, 240, 208, 0.18), 0 8px 24px rgba(79, 70, 229, 0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.login-btn::before,
.primary-button::before {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-115%) skewX(-18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.46), transparent);
  transition: transform 0.72s ease;
}

.login-btn:hover,
.primary-button:hover {
  transform: translateY(-2px);
  filter: saturate(1.08);
  box-shadow: 0 18px 44px rgba(35, 240, 208, 0.24), 0 12px 30px rgba(79, 70, 229, 0.24);
}

.login-btn:hover::before,
.primary-button:hover::before {
  transform: translateX(115%) skewX(-18deg);
}

.login-btn:active,
.primary-button:active,
.compact-button:active,
.text-button:active,
.nav-item:active {
  transform: translateY(1px);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 3;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015)),
    rgba(5, 10, 22, 0.92);
  border-right: 1px solid rgba(35, 240, 208, 0.20);
  box-shadow: 14px 0 40px rgba(0, 0, 0, 0.22);
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(119, 141, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(119, 141, 255, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, black, transparent 86%);
}

.brand,
.nav-list,
.shift-card {
  position: relative;
  z-index: 1;
}

.sidebar .brand {
  min-height: 58px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(119, 141, 255, 0.18);
}

.brand-mark {
  border-radius: 16px;
  color: #04100e;
  background: linear-gradient(135deg, var(--wb-cyan), var(--wb-blue) 58%, var(--wb-violet));
  box-shadow: 0 0 24px rgba(35, 240, 208, 0.26);
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 0;
  border-block: 1px solid rgba(119, 141, 255, 0.18);
  background: rgba(7, 13, 28, 0.42);
}

.nav-item {
  min-height: 46px;
  color: #cce5f2;
  background: transparent;
  border: 0;
  border-left: 4px solid transparent;
  border-radius: 0;
}

.nav-item:hover {
  color: #ffffff;
  background: linear-gradient(90deg, rgba(35, 240, 208, 0.12), rgba(79, 70, 229, 0.06), transparent);
  border-left-color: rgba(35, 240, 208, 0.42);
}

.nav-item.active {
  color: var(--wb-cyan);
  background: linear-gradient(90deg, rgba(35, 240, 208, 0.18), rgba(79, 70, 229, 0.10), transparent);
  border-left-color: var(--wb-cyan);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), inset 0 -1px 0 rgba(255, 255, 255, 0.025);
}

.shift-card {
  margin-top: auto;
  border-color: rgba(119, 141, 255, 0.20);
  background:
    linear-gradient(180deg, rgba(35, 240, 208, 0.08), rgba(79, 70, 229, 0.05)),
    rgba(9, 16, 32, 0.80);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.shift-card strong,
.shift-card .copyright,
.shift-card .sidebar-icp {
  text-align: center;
}

.shift-card .copyright,
.shift-card .sidebar-icp {
  font-size: 12px;
  line-height: 1.55;
  color: #9fb2cd;
}

.workspace {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 20px clamp(18px, 2.4vw, 34px) 34px;
}

.workspace::before {
  content: "";
  position: fixed;
  right: 5%;
  top: 8%;
  z-index: -1;
  width: 42vw;
  height: 42vw;
  max-width: 640px;
  max-height: 640px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(35, 240, 208, 0.09), transparent 68%);
  filter: blur(12px);
  pointer-events: none;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 20px;
  padding: 20px 22px;
  border-radius: 20px;
  border: 1px solid rgba(119, 141, 255, 0.20);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025)),
    rgba(8, 15, 30, 0.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.topbar h1 {
  margin-bottom: 6px;
  font-size: clamp(22px, 2.2vw, 32px);
  line-height: 1.2;
  letter-spacing: 0;
}

.topbar p,
.section-title p,
.panel-header p,
.muted {
  color: var(--wb-muted);
}

.top-actions {
  align-items: center;
  gap: 10px;
}

.user-chip,
.version-label {
  min-height: 44px;
  border: 1px solid rgba(119, 141, 255, 0.20);
  background: rgba(11, 18, 36, 0.74);
}

.metric-grid,
.dashboard-grid,
.upload-grid,
.quality-grid,
.order-layout,
.ccc-grid,
.settings-grid {
  gap: 16px;
}

.metric,
.panel,
.trace-search,
.trace-data-card,
.tool-item,
.io-record,
.step,
.appointment-card,
.certificate-model-card,
.settings-trace-panel {
  border: 1px solid rgba(119, 141, 255, 0.20);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02)),
    rgba(10, 18, 34, 0.76);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.20), inset 0 1px 0 rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.metric {
  min-height: 118px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric strong {
  font-size: clamp(26px, 2.4vw, 38px);
  color: #ffffff;
}

.metric::after {
  height: 3px;
  background: linear-gradient(90deg, var(--wb-cyan), var(--wb-blue), transparent);
}

.panel,
.manual-panel {
  padding: 20px;
}

.panel-header {
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(119, 141, 255, 0.16);
}

.panel-header h2,
.section-title h2,
.manual-panel h2 {
  letter-spacing: 0;
  color: #ffffff;
}

.manual-panel h2 {
  margin-bottom: 14px;
}

.manual-form,
.form-grid,
.query-row,
.search-box,
.table-search,
.aging-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  align-items: end;
}

.manual-form label,
.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.manual-form label span,
.form-grid label span,
label span {
  color: #9fb2cd;
}

.manual-form .primary-button,
.form-grid .primary-button,
.search-box .primary-button,
.query-row .primary-button {
  min-height: 40px;
  align-self: end;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.table-wrap {
  border: 1px solid rgba(119, 141, 255, 0.16);
  border-radius: 14px;
  background: rgba(5, 10, 22, 0.34);
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

table thead,
.io-table th {
  background: rgba(35, 240, 208, 0.08);
}

th,
td {
  border-color: rgba(119, 141, 255, 0.12);
}

tr:hover td {
  background: rgba(35, 240, 208, 0.045);
}

.compact-button,
.text-button,
.icon-button,
.segmented button,
.ccc-tabs button {
  border: 1px solid rgba(119, 141, 255, 0.22);
  background: rgba(9, 14, 30, 0.70);
  color: #d8e7f7;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.compact-button:hover,
.text-button:hover,
.icon-button:hover,
.segmented button:hover,
.ccc-tabs button:hover {
  border-color: rgba(35, 240, 208, 0.48);
  background: rgba(35, 240, 208, 0.10);
  color: #ffffff;
}

.segmented button.active,
.ccc-tabs button.active {
  color: #04100e;
  border-color: transparent;
  background: linear-gradient(135deg, var(--wb-cyan), var(--wb-blue));
}

.status.ok {
  color: #55f2b3;
  background: rgba(49, 214, 155, 0.13);
}

.status.warn {
  color: #ffd175;
  background: rgba(246, 180, 75, 0.13);
}

.status.bad {
  color: #ff9aa6;
  background: rgba(255, 107, 122, 0.14);
}

.icp-footer {
  display: none;
}

@keyframes wb-drift {
  from { transform: translate3d(-18px, -10px, 0) scale(0.96); }
  to { transform: translate3d(18px, 14px, 0) scale(1.04); }
}

@keyframes wb-scan {
  0% { transform: translateX(-15%); opacity: 0; }
  12% { opacity: 0.72; }
  88% { opacity: 0.72; }
  100% { transform: translateX(15%); opacity: 0; }
}

@keyframes wb-ring {
  to { transform: rotate(360deg); }
}

@keyframes wb-pulse {
  0%, 100% { transform: scale(0.72); opacity: 0.34; }
  50% { transform: scale(1.35); opacity: 1; }
}

@keyframes wb-float {
  from { transform: translateY(42px); opacity: 0; }
  18%, 82% { opacity: 0.62; }
  to { transform: translateY(-76px); opacity: 0; }
}

@keyframes wb-logo-pulse {
  0%, 100% { transform: scale(0.92); opacity: 0.42; }
  50% { transform: scale(1.06); opacity: 0.92; }
}

@keyframes wb-border-spin {
  to { --wb-angle: 360deg; }
}

@media (max-width: 1100px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .top-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: relative;
    height: auto;
  }

  .nav-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-inline: 0;
  }

  .nav-item {
    min-height: 42px;
    padding-inline: 14px;
  }

  .workspace {
    padding: 16px;
  }

  .panel,
  .manual-panel,
  .topbar {
    padding: 16px;
  }
}

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