:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #eef2f7;
  --navy-950: #07101f;
  --navy-900: #0d1728;
  --blue-600: #2563eb;
  --blue-50: #eff6ff;
  --line: #dfe5ee;
  --muted: #64748b;
  --brand-navy: #06264a;
  --brand-blue: #0867c7;
  --brand-blue-dark: #064f9b;
  --brand-gold: #f4b400;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #eef2f7;
  color: #172033;
  font-family: inherit;
}

a { color: #2563eb; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.topbar {
  background: var(--navy-950);
  color: #fff;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 72px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: clamp(1.25rem, 2.5vw, 2.75rem);
  padding: 0.65rem clamp(1rem, 2vw, 2rem);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 8px 24px rgba(7, 16, 31, 0.2);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-width: max-content;
  color: #fff;
}
.brand:hover { color: #fff; }
.brand-mark {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.75rem;
  display: grid;
  place-items: center;
  background: #2563eb;
  font-size: 1.05rem;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.16);
}
.brand-copy { display: flex; align-items: baseline; gap: 0.35rem; }
.brand-copy strong { font-size: 1rem; letter-spacing: 0.09em; text-transform: uppercase; }
.brand-copy small { color: #93c5fd; font-size: 0.67rem; letter-spacing: 0.12em; font-weight: 800; }

.main-nav { display: flex; align-items: center; gap: 0.3rem; min-width: 0; }
.main-nav a,
.nav-dropdown summary {
  color: #cbd5e1;
  font-weight: 650;
  font-size: 0.86rem;
}
.nav-link,
.nav-dropdown > summary {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 0 0.85rem;
  border-radius: 0.7rem;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}
.nav-link:hover,
.nav-dropdown > summary:hover { color: #fff; background: rgba(255,255,255,0.07); }
.nav-link.active,
.nav-dropdown.active > summary {
  color: #fff;
  background: rgba(37, 99, 235, 0.26);
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.2);
}
.nav-link.active::before,
.nav-dropdown.active > summary::before {
  content: '';
  width: 0.42rem;
  height: 0.42rem;
  margin-right: 0.5rem;
  border-radius: 50%;
  background: #60a5fa;
}

.nav-dropdown,
.account-menu { position: relative; }
.nav-dropdown > summary,
.account-trigger { cursor: pointer; list-style: none; }
.nav-dropdown > summary::-webkit-details-marker,
.account-trigger::-webkit-details-marker { display: none; }
.chevron {
  width: 0.45rem;
  height: 0.45rem;
  margin-left: 0.65rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.15s ease;
}
details[open] > summary .chevron { transform: rotate(225deg) translate(-1px, -1px); }

.nav-popover,
.account-popover {
  position: absolute;
  top: calc(100% + 0.65rem);
  z-index: 110;
  color: #172033;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: 0 24px 55px rgba(7, 16, 31, 0.24);
}
.nav-popover {
  left: 0;
  width: min(650px, calc(100vw - 2rem));
  padding: 0.9rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}
.nav-group { min-width: 0; padding: 0.35rem; }
.nav-group-title {
  display: block;
  padding: 0 0.55rem 0.45rem;
  color: #94a3b8;
  font-size: 0.68rem;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.main-nav .nav-sub-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.6rem;
  color: #334155;
  border-radius: 0.6rem;
  line-height: 1.25;
}
.main-nav .nav-sub-link:hover { color: #1d4ed8; background: var(--blue-50); }
.main-nav .nav-sub-link.active { color: #1d4ed8; background: #dbeafe; }
.nav-arrow { opacity: 0; transform: translateX(-4px); transition: opacity 0.15s ease, transform 0.15s ease; }
.nav-sub-link:hover .nav-arrow,
.nav-sub-link.active .nav-arrow { opacity: 1; transform: translateX(0); }

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 0.7rem;
  background: rgba(255,255,255,0.06);
  color: #fff;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}
.nav-toggle span { width: 18px; height: 2px; border-radius: 999px; background: currentColor; transition: transform 0.15s ease, opacity 0.15s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.userbox { display: flex; align-items: center; gap: 0.75rem; }
.account-trigger {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.45rem;
  border-radius: 0.8rem;
  color: #fff;
}
.account-trigger:hover { background: rgba(255,255,255,0.07); }
.account-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #e2e8f0;
  position: relative;
}
.account-avatar::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0.42rem;
  width: 0.52rem;
  height: 0.52rem;
  border-radius: 50%;
  background: #64748b;
  transform: translateX(-50%);
}
.account-avatar::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0.35rem;
  width: 1rem;
  height: 0.55rem;
  border-radius: 1rem 1rem 0.5rem 0.5rem;
  background: #64748b;
  transform: translateX(-50%);
}
.account-copy { display: flex; flex-direction: column; min-width: 0; }
.account-copy strong { max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.84rem; }
.account-copy small { color: #94a3b8; font-size: 0.68rem; text-transform: uppercase; }
.account-popover { right: 0; width: 250px; padding: 0.9rem; }
.account-heading { display: flex; flex-direction: column; gap: 0.4rem; padding: 0.25rem 0.25rem 0.85rem; border-bottom: 1px solid var(--line); }
.role-badge { align-self: flex-start; background: #eef2ff; color: #4338ca; padding: 0.18rem 0.55rem; border-radius: 999px; font-size: 0.65rem; text-transform: uppercase; }
.language-row { display: flex; align-items: center; justify-content: space-between; padding: 0.85rem 0.25rem; color: #64748b; font-size: 0.78rem; font-weight: 700; }
.lang-switch { display: inline-flex; align-items: center; gap: 0.2rem; padding: 0.18rem; border-radius: 0.55rem; background: #eef2f7; }
.lang-switch a { min-width: 2rem; padding: 0.32rem 0.4rem; border-radius: 0.4rem; color: #64748b; text-align: center; font-size: 0.72rem; font-weight: 800; }
.lang-switch a.active { color: #1d4ed8; background: #fff; box-shadow: 0 1px 3px rgba(15,23,42,0.12); }
.lang-switch.standalone { background: rgba(255,255,255,0.1); }
.lang-switch.standalone a { color: #cbd5e1; }
.lang-switch.standalone a.active { color: #fff; background: #2563eb; }
.account-action { width: 100%; padding: 0.65rem 0.75rem; border: 0; border-radius: 0.55rem; background: transparent; text-align: left; font-weight: 700; cursor: pointer; }
.account-action.danger { color: #b91c1c; }
.account-action.danger:hover { background: #fef2f2; }

.main-nav a:focus-visible,
.nav-dropdown summary:focus-visible,
.account-trigger:focus-visible,
.nav-toggle:focus-visible { outline: 3px solid #60a5fa; outline-offset: 2px; }

.page { padding: clamp(1rem, 2vw, 2rem); min-height: calc(100vh - 72px); background: linear-gradient(180deg, #eef2f8 0%, #f8fafc 100%); }
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; margin-bottom: 1.25rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 2px; font-size: 0.75rem; color: #94a3b8; margin: 0; }
.page-header h1 { margin: 0.15rem 0 0; font-size: clamp(1.8rem, 3vw, 2.3rem); line-height: 1.1; color: #0f172a; }
.page-header p:last-child { margin-bottom: 0; color: #475569; }

.status-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.85rem; margin-bottom: 1.25rem; }
.status-card {
  border-radius: 16px;
  padding: 1.1rem 1.25rem;
  min-height: 100px;
  color: #fff;
  background: linear-gradient(135deg, #111827, #1f2937);
  box-shadow: 0 10px 22px rgba(15,23,42,0.18);
}
.status-card span { text-transform: uppercase; font-size: 0.75rem; letter-spacing: 1px; opacity: 0.85; }
.status-card strong { font-size: clamp(1.8rem, 3vw, 2.2rem); display: block; margin-top: 0.35rem; line-height: 1.1; }
.status-card.urgent { background: linear-gradient(135deg, #7f1d1d, #ef4444); }
.status-card.running { background: linear-gradient(135deg, #064e3b, #22c55e); }
.status-card.issues { background: linear-gradient(135deg, #92400e, #f97316); }
.status-card.completed { background: linear-gradient(135deg, #0f172a, #3b82f6); }

.panel, .panel-card {
  background: #fff;
  border-radius: 24px;
  padding: 1.25rem;
  box-shadow: 0 18px 35px rgba(15,23,42,0.12);
}
.panel + .panel { margin-top: 1rem; }
.line-snapshot-strip { display: flex; gap: 1.25rem; overflow-x: auto; padding-bottom: 0.5rem; }
.line-snapshot-strip::-webkit-scrollbar { height: 6px; }
.line-snapshot-strip::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.35); border-radius: 999px; }
.line-snapshot-card { min-width: 260px; flex: 0 0 auto; }
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.5rem; }

.live-lines { display: flex; flex-direction: column; gap: 1rem; }
.line-status { display: flex; justify-content: space-between; align-items: center; background: #f3f5fb; border-radius: 16px; padding: 1rem 1.25rem; border: 1px solid #e2e8f0; }
.line-info { display: flex; flex-direction: column; }
.line-name { font-weight: 600; font-size: 1.1rem; }
.line-job { color: #475569; font-size: 0.9rem; }
.status-pill { padding: 0.35rem 0.8rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; }
.status-pill.running { background: rgba(34,197,94,0.15); color: #15803d; }
.status-pill.paused { background: rgba(248,113,113,0.2); color: #b91c1c; }
.status-pill.prepared, .status-pill.planned { background: rgba(59,130,246,0.2); color: #1d4ed8; }
.status-pill.idle { background: rgba(148,163,184,0.4); color: #475569; }

.foil-alerts { display: flex; flex-direction: column; gap: 1rem; }
.foil-card { background: #0f172a; color: #fff; border-radius: 16px; padding: 1rem 1.25rem; box-shadow: 0 12px 24px rgba(15,23,42,0.5); }
.foil-card.critical { background: #7f1d1d; }
.flex-line { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.progress-bar { background: rgba(255,255,255,0.2); height: 8px; border-radius: 999px; margin-top: 0.5rem; position: relative; overflow: hidden; }
.progress-bar span { position: absolute; left: 0; top: 0; bottom: 0; background: #34d399; border-radius: 999px; }

.alert-list, .due-list, .event-feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.alert-list li, .due-list li, .event-feed li { padding: 0.85rem; border-radius: 14px; background: #f8fafc; border: 1px solid #e2e8f0; }
.event-time { font-size: 0.8rem; color: #94a3b8; display: block; }

.status-badge { padding: 0.3rem 0.8rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; }
.status-badge.primary { background: rgba(59,130,246,0.15); color: #1d4ed8; }
.status-badge.info { background: rgba(14,165,233,0.18); color: #0369a1; }
.status-badge.success { background: rgba(34,197,94,0.15); color: #15803d; }
.status-badge.warning { background: rgba(249,115,22,0.15); color: #b45309; }
.status-badge.danger { background: rgba(248,113,113,0.2); color: #b91c1c; }
.link-button { background: none; border: none; color: #2563eb; cursor: pointer; padding: 0; font-size: 0.9rem; text-decoration: underline; }
.link-button:hover { color: #1d4ed8; }
.muted { color: #94a3b8; font-size: 0.8rem; }

.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 18px; overflow: hidden; box-shadow: 0 12px 24px rgba(15,23,42,0.08); }
.data-table th { text-align: left; padding: 0.9rem; background: #e2e8f0; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; }
.data-table td { padding: 0.9rem; border-bottom: 1px solid #f1f5f9; }

.stat-card { background: #fff; border-radius: 18px; padding: 1.25rem; box-shadow: 0 12px 25px rgba(15,23,42,0.12); }
.action-button { padding: 0.6rem 1rem; border-radius: 10px; border: none; color: #fff; font-weight: 600; cursor: pointer; }
.action-button.primary { background: #2563eb; }
.action-button.success { background: #16a34a; }
.action-button.warning { background: #f97316; }
.action-button.danger { background: #dc2626; }
.action-button.danger.outline { background: transparent; color: #dc2626; border: 1px solid #dc2626; }

.scheduler-layout { display: block; }
.timeline-surface { background: rgba(255,255,255,0.92); border-radius: 36px; padding: 2rem; box-shadow: 0 30px 55px rgba(15,23,42,0.15); margin-top: 1.5rem; }
.timeline-board { display: flex; flex-direction: column; gap: 1.5rem; position: relative; --segment-count: 6; }
.timeline-axis { margin-bottom: 1rem; display: grid; font-size: 0.75rem; color: #64748b; letter-spacing: 0.08em; text-transform: uppercase; }
.timeline-axis span { text-align: center; position: relative; padding-bottom: 0.25rem; }
.timeline-axis span::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 2px; height: 6px; background: #94a3b8; border-radius: 999px; }
.timeline-lane { background: rgba(248,250,255,0.95); padding: 1.5rem 1.25rem; border-radius: 28px; min-height: 220px; border: 1px solid rgba(99,102,241,0.12); position: relative; overflow: hidden; margin-bottom: 1.25rem; }
.timeline-lane.drop-target { border-color: #38bdf8; box-shadow: 0 0 0 2px rgba(56,189,248,0.3); }
.timeline-lane::before { content: ''; position: absolute; top: 48px; bottom: 16px; left: 0; right: 0; background-image: repeating-linear-gradient(to right, rgba(99,102,241,0.25) 0, rgba(99,102,241,0.25) 1px, transparent 1px, transparent calc(100% / var(--segment-count, 6))); pointer-events: none; }
.timeline-lane h3 { margin: 0 0 0.5rem 0; }
.timeline-block { position: absolute; top: 40px; background: #fff; border-left: 6px solid #3b82f6; padding: 1rem 0.9rem; border-radius: 18px; box-shadow: 0 12px 28px rgba(15,23,42,0.16); cursor: grab; user-select: none; }
.timeline-block.status-running { border-color: #22c55e; }
.timeline-block.status-paused { border-color: #f97316; }
.timeline-block.status-planned { border-color: #3b82f6; }
.timeline-block.status-prepared { border-color: #a855f7; }
.timeline-block.urgent { border-color: #ef4444; }
.timeline-block.dragging { opacity: 0.85; box-shadow: 0 18px 30px rgba(59,130,246,0.35); }
.timeline-block .block-content { pointer-events: none; }
.resize-handle { position: absolute; top: 10px; bottom: 10px; width: 10px; cursor: ew-resize; background: rgba(59,130,246,0.15); border-radius: 6px; opacity: 0; transition: opacity 0.15s; }
.timeline-block:hover .resize-handle { opacity: 1; }
.resize-handle.left { left: 2px; }
.resize-handle.right { right: 2px; }
.scheduler-indicator { position: fixed; background: #0f172a; color: #fff; padding: 0.4rem 0.75rem; border-radius: 10px; font-size: 0.85rem; pointer-events: none; box-shadow: 0 10px 25px rgba(15,23,42,0.25); z-index: 120; }
.scheduler-indicator[hidden] { display: none; }
.timeline-controls { display: flex; justify-content: flex-end; margin-bottom: 0.5rem; gap: 1rem; align-items: center; }
.timeline-controls label { font-size: 0.85rem; text-transform: uppercase; color: #475569; letter-spacing: 0.08em; display: flex; gap: 0.65rem; align-items: center; }
.timeline-controls input[type="range"] { width: 180px; }

.scheduler-panel { background: #fff; border-radius: 20px; padding: 1.25rem; box-shadow: 0 14px 30px rgba(15,23,42,0.15); position: sticky; top: 100px; }
.scheduler-panel h3 { margin-top: 0; }
.plan-form { background: transparent; padding: 0; border-radius: 0; margin-bottom: 0; box-shadow: none; }
.scheduler-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }

.line-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.5rem; }
.line-card { background: #0f172a; color: #fff; padding: 1.25rem; border-radius: 22px; box-shadow: 0 18px 30px rgba(15,23,42,0.45); }
.line-card .actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.line-card .actions .btn { flex: 1; font-size: 1.05rem; padding: 0.9rem; border-radius: 14px; border: none; color: #fff; }
.line-card .actions .btn[data-action="start"] { background: #16a34a; }
.line-card .actions .btn[data-action="prepare"] { background: #3b82f6; }
.line-card .actions .btn[data-action="pause"] { background: #f97316; }
.line-card .actions .btn[data-action="resume"] { background: #8b5cf6; }
.line-card .actions .btn[data-action="complete"] { background: #22c55e; }
.line-card .actions .btn[data-action="preempt"] { background: #ef4444; }
.qa-block { margin-top: 1rem; background: rgba(255,255,255,0.12); padding: 1rem; border-radius: 14px; }
.measurement-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.5rem; margin-top: 0.5rem; }
.quick-buttons { display: flex; gap: 0.5rem; }
.quick-buttons .btn { border-radius: 999px; }
.measurement-log { max-height: 140px; overflow-y: auto; font-size: 0.85rem; margin-top: 0.5rem; }

.filters { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filters input, .filters select { padding: 0.5rem 0.8rem; border-radius: 10px; border: 1px solid #cbd5f6; min-width: 180px; }

.alert-card { padding: 0.9rem 1rem; border-radius: 12px; margin-bottom: 1rem; background: #fee2e2; color: #991b1b; }

.drawer { position: fixed; top: 0; right: -420px; width: 380px; height: 100vh; background: #fff; box-shadow: -12px 0 30px rgba(15,23,42,0.2); padding: 1.5rem; transition: right 0.3s ease; z-index: 50; }
.drawer.open { right: 0; }
.drawer h3 { margin-top: 0; }
.drawer-info p { margin: 0.2rem 0; font-size: 0.9rem; }
.drawer-form { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1rem; }
.drawer-form label { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: #475569; display: flex; flex-direction: column; gap: 0.35rem; }
.drawer-form input, .drawer-form select { border: 1px solid #cbd5f5; border-radius: 10px; padding: 0.45rem 0.6rem; font-size: 1rem; }

.daily-page { display: flex; flex-direction: column; gap: 1.1rem; }
.daily-metrics { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.line-snapshot-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0.85rem; }
.line-snapshot-cards .panel-card { padding: 1rem 1.1rem; border-radius: 16px; border: 1px solid #e2e8f0; box-shadow: 0 7px 18px rgba(15,23,42,0.06); }
.line-snapshot-cards .panel-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; }
.line-snapshot-cards .panel-card h3 { margin: 0.2rem 0 0; font-size: 1.05rem; }
.line-snapshot-cards .line-snapshot-metrics strong { display: block; margin-top: 0.2rem; font-size: 0.9rem; }
.line-snapshot-cards.compact { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.workflow-section { background: #fff; border-radius: 18px; padding: 1.1rem 1.25rem; border: 1px solid rgba(226,232,240,0.9); box-shadow: 0 8px 20px rgba(15,23,42,0.07); }
.workflow-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.workflow-chart { display: flex; gap: 1rem; }
.workflow-chart div { background: #f1f5f9; padding: 0.75rem 1rem; border-radius: 14px; min-width: 140px; }
.workflow-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin-top: 1rem; }
.workflow-card { background: #f8fafc; border-radius: 14px; padding: 0.9rem; min-height: 160px; border: 1px solid #eef2f7; }
.job-card { background: #fff; border-radius: 18px; padding: 1rem; box-shadow: 0 10px 25px rgba(15,23,42,0.12); display: flex; flex-direction: column; gap: 1rem; }
.job-card header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.job-data { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.5rem 1rem; margin: 0; padding: 0; }
.job-data li { display: flex; flex-direction: column; background: #f8fafc; border-radius: 12px; padding: 0.5rem 0.75rem; font-size: 0.85rem; }
.job-data span { font-size: 0.7rem; text-transform: uppercase; color: #64748b; letter-spacing: 0.05em; }
.qa-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.75rem; }
.qa-grid div { background: #eef2ff; border-radius: 12px; padding: 0.5rem 0.75rem; }
.qa-grid small { font-size: 0.7rem; color: #6366f1; display: block; }
.job-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.measurement-actions { margin-top: 0.5rem; }
.measurement-actions small { display: block; color: #475569; margin-bottom: 0.25rem; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; }
.measurement-buttons { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.measurement-buttons button { border: none; border-radius: 999px; padding: 0.4rem 0.9rem; font-size: 0.8rem; background: #e2e8f0; cursor: pointer; }
.measurement-buttons button:hover { background: #cbd5f5; }
.queue-item, .completed-item { background: #fff; border-radius: 14px; padding: 0.75rem; margin-bottom: 0.75rem; display: flex; justify-content: space-between; gap: 0.5rem; box-shadow: 0 4px 10px rgba(15,23,42,0.08); }
.queue-meta { text-align: right; font-size: 0.8rem; color: #475569; }
.completed-item small { color: #94a3b8; display: block; }
.empty-copy { color: #94a3b8; margin: 0; padding: 0.5rem 0; }
.line-snapshot-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; margin-top: 0.75rem; }
.line-snapshot-metrics small { font-size: 0.65rem; color: #94a3b8; text-transform: uppercase; }
.filter-pill { align-self: flex-start; background: #e0e7ff; color: #312e81; padding: 0.35rem 0.9rem; border-radius: 999px; font-size: 0.8rem; letter-spacing: 0.05em; }
.order-lines-wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.25rem; margin-top: 1.5rem; }
.order-line-card { background: #fff; border-radius: 20px; padding: 1.25rem; box-shadow: 0 14px 30px rgba(15,23,42,0.1); display: flex; flex-direction: column; gap: 1rem; }
.order-line-section { border: 1px solid #e2e8f0; border-radius: 16px; padding: 1rem; }
.section-header { display: flex; justify-content: space-between; gap: 0.75rem; align-items: center; margin-bottom: 0.75rem; }
.section-header h3 { margin: 0; font-size: 1rem; }
.order-meta-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.75rem; }
.order-meta-grid li { background: #f8fafc; border-radius: 12px; padding: 0.55rem 0.75rem; display: flex; flex-direction: column; gap: 0.15rem; }
.order-meta-grid small { font-size: 0.7rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.08em; }
.allocation-list,
.job-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.65rem; }
.allocation-list li,
.job-list li { display: flex; justify-content: space-between; gap: 0.75rem; align-items: center; padding: 0.6rem 0.75rem; border-radius: 12px; background: #f8fafc; border: 1px solid #e2e8f0; }
.allocation-list strong { font-size: 0.95rem; }
.allocation-list small { display: block; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.08em; color: #94a3b8; }
.job-main { display: flex; flex-direction: column; }
.job-main small { color: #64748b; font-size: 0.85rem; }
.job-meta { text-align: right; display: flex; flex-direction: column; font-size: 0.85rem; color: #0f172a; }
.job-meta span:last-child { color: #94a3b8; font-size: 0.75rem; }
.job-measurements { list-style: none; margin: 0.5rem 0 0; padding: 0; font-size: 0.8rem; color: #475569; }
.job-measurements li + li { margin-top: 0.25rem; }
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.55); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 1rem; }
.modal-overlay[hidden] { display: none; }
.modal { background: #fff; border-radius: 20px; width: min(480px, 100%); box-shadow: 0 25px 45px rgba(15,23,42,0.3); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid #e2e8f0; }
.modal-header h3 { margin: 0; font-size: 1rem; }
.modal-close { border: none; background: transparent; font-size: 1.3rem; cursor: pointer; color: #475569; }
.modal-body { padding: 1rem 1.25rem; }
.data-table.compact th, .data-table.compact td { padding: 0.55rem 0.65rem; }

.terminal-screen { padding: 1.5rem; display: flex; flex-direction: column; gap: 1.5rem; }
.terminal-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; background: #0f172a; color: #fff; padding: 1.25rem 1.5rem; border-radius: 20px; }
.terminal-heading h1 { font-size: 2.8rem; margin: 0; }
.terminal-heading small { color: #cbd5f5; }
.terminal-meta { display: flex; gap: 1rem; font-weight: 600; }
.terminal-meta span { background: rgba(255,255,255,0.1); padding: 0.35rem 0.8rem; border-radius: 999px; }
.terminal-job { background: #fff; border-radius: 20px; padding: 1.5rem; box-shadow: 0 18px 40px rgba(15,23,42,0.15); }
.terminal-job-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.terminal-job-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.terminal-job-details small { text-transform: uppercase; font-size: 0.7rem; color: #94a3b8; }
.terminal-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.5rem; }
.measurement-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.measurement-widget { background: #f8fafc; border-radius: 16px; padding: 1rem; display: flex; flex-direction: column; gap: 0.6rem; box-shadow: inset 0 1px 0 rgba(255,255,255,0.7); }
.measurement-header small { text-transform: uppercase; font-size: 0.65rem; letter-spacing: 0.08em; color: #475569; }
.measurement-header strong { font-size: 1.4rem; }
.measurement-slider { width: 100%; }
.measurement-stepper { display: flex; gap: 0.5rem; }
.measurement-stepper button { flex: 1; border: none; border-radius: 12px; padding: 0.4rem; background: #e2e8f0; font-size: 1.2rem; cursor: pointer; }
.preset-buttons { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.preset-buttons button { border: none; background: #fff; border-radius: 999px; padding: 0.3rem 0.8rem; cursor: pointer; box-shadow: 0 2px 6px rgba(15,23,42,0.15); }
.measurement-result { display: flex; gap: 0.5rem; }
.measurement-result .result-btn { flex: 1; border: 1px solid #cbd5f5; border-radius: 12px; padding: 0.3rem 0.6rem; cursor: pointer; background: #fff; font-weight: 600; }
.measurement-result .result-btn.active { background: #2563eb; color: #fff; border-color: #2563eb; }
.save-measurement { border: none; border-radius: 12px; padding: 0.5rem; background: #2563eb; color: #fff; font-weight: 600; cursor: pointer; }
.issue-banner { margin-top: 1rem; background: #fee2e2; color: #991b1b; padding: 0.75rem 1rem; border-radius: 12px; }
.issue-banner p { margin: 0.25rem 0 0 0; }
.terminal-empty { background: #fff; border-radius: 20px; padding: 2rem; text-align: center; font-size: 1.2rem; color: #94a3b8; }
.terminal-secondary { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; }
.terminal-list { background: #fff; border-radius: 18px; padding: 1rem; box-shadow: 0 12px 25px rgba(15,23,42,0.08); }
.terminal-list-item { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 0; border-bottom: 1px solid #e2e8f0; }
.terminal-list-item:last-child { border-bottom: none; }
.terminal-list-item small { display: block; color: #94a3b8; }

.trace-card { background: #fff; padding: 1.25rem; border-radius: 16px; box-shadow: 0 12px 25px rgba(15,23,42,0.12); }
.trace-chain { display: flex; flex-direction: column; gap: 1rem; }
.trace-step { display: flex; align-items: center; gap: 0.5rem; }
.trace-step::before { content: ''; width: 14px; height: 14px; border-radius: 50%; background: #1d4ed8; }
.trace-step + .trace-step { border-top: 1px dashed #cbd5f5; padding-top: 1rem; }

.auth-card {
  max-width: 420px;
  margin: 4rem auto;
  background: #fff;
  padding: 2.5rem;
  border-radius: 16px;
  box-shadow: 0 20px 45px rgba(15,23,42,0.25);
}
.auth-card form { display: flex; flex-direction: column; gap: 1rem; }
label { font-weight: 600; display: flex; flex-direction: column; gap: 0.25rem; }
input, select { padding: 0.5rem; border-radius: 10px; border: 1px solid #cbd5f6; }
.alert { padding: 0.75rem; border-radius: 12px; margin-bottom: 1rem; }
.alert-error { background: #fee2e2; color: #991b1b; }
.audit-layout .audit-search { display: flex; gap: 0.75rem; align-items: center; }
.audit-layout .audit-search input[type="search"] { min-width: 240px; }
.audit-filters { margin-bottom: 1.5rem; }
.audit-filters .filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }
.audit-filters label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: #475569; }
.audit-filters select,
.audit-filters input { width: 100%; border-radius: 10px; border: 1px solid #cbd5f5; padding: 0.65rem 0.75rem; font-size: 0.95rem; }
.audit-filters .checkbox-inline { flex-direction: row; align-items: center; font-size: 0.85rem; text-transform: none; letter-spacing: normal; }
.audit-filters .checkbox-inline input { width: auto; }
.audit-filters .filter-actions { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 1rem; }

.audit-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr); gap: 1.5rem; align-items: start; }
.audit-feed { display: flex; flex-direction: column; gap: 1rem; }
.audit-event-card { background: #fff; border-radius: 18px; padding: 1rem 1.25rem; border: 1px solid rgba(148, 163, 184, 0.3); box-shadow: 0 15px 35px rgba(15, 23, 42, 0.08); cursor: pointer; transition: border-color 0.2s, transform 0.2s; }
.audit-event-card header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; font-size: 0.85rem; color: #475569; }
.audit-event-card .event-summary { margin: 0 0 0.5rem 0; font-size: 1rem; color: #0f172a; font-weight: 600; }
.audit-event-card .event-meta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; font-size: 0.85rem; color: #475569; }
.audit-event-card.active { border-color: #6366f1; transform: translateY(-2px); box-shadow: 0 18px 35px rgba(79, 70, 229, 0.15); }

.event-badge { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.2rem 0.75rem; border-radius: 999px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: #0f172a; }
.badge-state { background: rgba(59, 130, 246, 0.15); color: #1d4ed8; }
.badge-plan { background: rgba(139, 92, 246, 0.18); color: #6d28d9; }
.badge-warning { background: rgba(249, 115, 22, 0.18); color: #c2410c; }
.badge-quality { background: rgba(34, 197, 94, 0.15); color: #15803d; }
.badge-sap { background: rgba(14, 165, 233, 0.18); color: #0369a1; }
.badge-assignment { background: rgba(236, 72, 153, 0.15); color: #be185d; }
.badge-info { background: rgba(148, 163, 184, 0.28); color: #0f172a; }

.audit-detail { background: #fff; border-radius: 22px; border: 1px solid rgba(148, 163, 184, 0.35); padding: 1.5rem; box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08); position: sticky; top: 96px; }
.audit-detail .detail-empty { color: #94a3b8; text-align: center; padding: 3rem 1rem; }
.audit-detail.is-empty .detail-body { display: none; }
.audit-detail .detail-body { display: flex; flex-direction: column; gap: 1rem; }
.detail-header { display: flex; justify-content: space-between; gap: 1rem; align-items: center; font-size: 0.85rem; color: #475569; }
.detail-summary { margin: 0; font-size: 1.1rem; color: #0f172a; font-weight: 600; }
.detail-grid { display: grid; grid-template-columns: 120px 1fr; gap: 0.3rem 0.75rem; font-size: 0.9rem; color: #334155; }
.detail-grid dt { font-weight: 600; color: #475569; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.7rem; }
.detail-grid dd { margin: 0; }
.detail-section { border-top: 1px dashed rgba(148, 163, 184, 0.5); padding-top: 0.75rem; display: none; }
.detail-section.visible { display: block; }
.detail-section h3 { margin: 0 0 0.5rem 0; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: #475569; }
.detail-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.detail-list li { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.9rem; }
.detail-list-label { color: #475569; font-weight: 600; }
.detail-list-value { color: #0f172a; }
.measurement-card { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, auto)); gap: 0.5rem; align-items: center; background: rgba(20, 184, 166, 0.08); border-radius: 14px; padding: 0.75rem 1rem; }
.measurement-card strong { font-size: 0.9rem; color: #0f172a; }
.measurement-card .status-badge { justify-self: flex-start; }
.link-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.link-chips a { background: rgba(99, 102, 241, 0.12); color: #4338ca; padding: 0.3rem 0.75rem; border-radius: 999px; font-size: 0.8rem; text-decoration: none; }
.audit-detail pre { background: #0f172a; color: #e2e8f0; padding: 0.75rem; border-radius: 12px; max-height: 240px; overflow: auto; font-size: 0.75rem; }

.empty-card { padding: 2rem; text-align: center; background: rgba(148, 163, 184, 0.15); border-radius: 16px; color: #475569; font-weight: 600; }
.action-button.ghost { background: transparent; border: 1px dashed rgba(148, 163, 184, 0.7); color: #475569; }

@media (max-width: 1024px) {
    .audit-grid { grid-template-columns: 1fr; }
    .audit-detail { position: static; }
}

.sap-stock-panel { margin-bottom: 1.5rem; }
.sap-stock-card { border: 1px solid rgba(148,163,184,0.35); border-radius: 18px; padding: 1rem 1.25rem; margin-bottom: 1rem; background: #fff; box-shadow: 0 20px 35px rgba(15,23,42,0.05); }
.sap-stock-header { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 1rem; margin-bottom: 0.75rem; }
.sap-stock-header strong { font-size: 1.1rem; color: #0f172a; }
.sap-stock-metrics { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.85rem; color: #475569; text-transform: uppercase; letter-spacing: 0.08em; }
.lot-table { width: 100%; border-collapse: collapse; margin-bottom: 0.75rem; font-size: 0.9rem; }
.lot-table th { text-align: left; padding: 0.35rem; font-size: 0.75rem; letter-spacing: 0.08em; color: #64748b; text-transform: uppercase; }
.lot-table td { padding: 0.35rem; border-top: 1px solid rgba(148,163,184,0.3); }
.decision-form { border-top: 1px solid #e2e8f0; margin-top: 1rem; padding-top: 1.25rem; }
.decision-form h3 { margin: 0 0 0.5rem 0; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.08em; color: #475569; }
.decision-last { font-size: 0.85rem; color: #0f172a; margin-bottom: 0.5rem; }
.decision-section { margin-bottom: 1.25rem; }
.decision-section-header { display: flex; justify-content: space-between; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.decision-section-header h4 { margin: 0; font-size: 1rem; }
.decision-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.75rem; }
.decision-metrics div { background: #f8fafc; border-radius: 14px; padding: 0.65rem 0.75rem; }
.decision-metrics small { font-size: 0.7rem; text-transform: uppercase; color: #94a3b8; letter-spacing: 0.08em; display: block; }
.decision-metrics strong { display: block; font-size: 1.1rem; color: #0f172a; }
.decision-options { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.9rem; color: #0f172a; }
.decision-options label { display: flex; align-items: center; gap: 0.35rem; font-weight: 600; }
.decision-state { border-radius: 14px; padding: 0.85rem 1rem; font-weight: 600; }
.decision-state[data-state="success"] { background: #ecfdf5; color: #047857; }
.decision-state[data-state="warning"] { background: #fff7ed; color: #b45309; }
.decision-state[data-state="danger"] { background: #fef2f2; color: #b91c1c; }
.decision-lock { border-radius: 14px; padding: 0.85rem 1rem; background: #fee2e2; color: #b91c1c; font-weight: 600; margin-bottom: 0.75rem; }
.decision-error { margin-top: 0.5rem; border-radius: 12px; padding: 0.65rem 0.85rem; font-size: 0.9rem; font-weight: 600; background: #fef2f2; color: #b91c1c; }
[data-role="error"][hidden] { display: none; }
.decision-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.9rem; }
.decision-fields label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.85rem; color: #475569; }
.decision-fields label span { text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.08em; color: #94a3b8; }
.decision-fields input,
.decision-fields select,
.decision-fields textarea { border-radius: 12px; border: 1px solid #cbd5f5; padding: 0.55rem 0.75rem; font-size: 0.95rem; font-family: inherit; background: #fff; }
.decision-fields label.full { grid-column: 1 / -1; }
.decision-fields label.half { min-width: 180px; }
.decision-fields textarea { min-height: 70px; resize: vertical; }
.field-hidden { display: none !important; }
.field-disabled input,
.field-disabled select { background: #f1f5f9; color: #94a3b8; cursor: not-allowed; }
.operator-nfc-hint { display: block; margin-top: 0.3rem; color: #94a3b8; }
.decision-actions { display: flex; justify-content: flex-end; }
.sap-stock-panel .action-button.primary { margin-top: 0.5rem; }

@media (max-width: 1180px) {
  .app-header { gap: 0.8rem; }
  .account-copy { display: none; }
  .main-nav { gap: 0.15rem; }
  .nav-link,
  .nav-dropdown > summary { padding-inline: 0.65rem; }
}

@media (max-width: 920px) {
  .app-header {
    display: flex;
    min-height: 64px;
  }
  .app-header .brand { margin-right: auto; }
  .nav-toggle { display: flex; }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    padding: 0.75rem 1rem 1rem;
    background: var(--navy-950);
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 18px 30px rgba(7, 16, 31, 0.25);
    flex-direction: column;
    align-items: stretch;
  }
  .main-nav.is-open { display: flex; }
  .nav-link,
  .nav-dropdown > summary { width: 100%; min-height: 46px; justify-content: space-between; }
  .nav-dropdown.active > summary::before { margin-right: 0.5rem; }
  .nav-dropdown > summary .chevron { margin-left: auto; }
  .nav-popover {
    position: static;
    width: 100%;
    margin-top: 0.35rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    box-shadow: none;
    border-color: rgba(148, 163, 184, 0.22);
  }
  .page { min-height: calc(100vh - 64px); }
}

@media (max-width: 680px) {
  .app-header { padding-inline: 0.8rem; }
  .brand-mark { width: 2.1rem; height: 2.1rem; }
  .brand-copy strong { font-size: 0.86rem; }
  .account-trigger { padding: 0.25rem; }
  .account-trigger > .chevron { display: none; }
  .account-popover { right: -0.25rem; width: min(250px, calc(100vw - 1.6rem)); }
  .nav-popover { grid-template-columns: 1fr; }
  .page-header { align-items: stretch; flex-direction: column; gap: 1rem; }
  .page-header .action-button { width: 100%; text-align: center; }
  .status-cards,
  .daily-metrics { grid-template-columns: 1fr; }
  .line-snapshot-cards { grid-template-columns: minmax(0, 1fr); }
  .line-snapshot-cards .panel-card { min-width: 0; overflow: hidden; }
  .line-snapshot-cards .line-snapshot-metrics { gap: 0.25rem; }
  .line-snapshot-cards .line-snapshot-metrics small { font-size: 0.58rem; letter-spacing: -0.01em; }
  .status-card { min-height: 88px; }
  .workflow-header { align-items: flex-start; }
  .workflow-chart { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.45rem; }
  .workflow-chart div { min-width: 0; padding: 0.6rem; }
  .workflow-chart strong { display: block; font-size: 0.9rem; }
  .data-table { display: block; overflow-x: auto; white-space: nowrap; }
}

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

/* Help and onboarding */
html { scroll-behavior: smooth; }
.help-page { width: min(1380px, 100%); margin: 0 auto; }
.help-hero {
  min-height: 300px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  align-items: center;
  gap: 2rem;
  padding: clamp(1.6rem, 4vw, 3.5rem);
  border-radius: 24px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 85% 15%, rgba(59,130,246,0.42), transparent 32%),
    linear-gradient(135deg, #07101f 0%, #13233d 100%);
  box-shadow: 0 22px 45px rgba(15,23,42,0.18);
}
.help-hero .eyebrow { color: #93c5fd; }
.help-hero h1 { margin: 0.5rem 0 0.75rem; font-size: clamp(2.25rem, 5vw, 4.4rem); line-height: 0.98; letter-spacing: -0.045em; }
.help-hero-copy > p:not(.eyebrow) { max-width: 720px; margin: 0; color: #cbd5e1; font-size: clamp(1rem, 2vw, 1.18rem); line-height: 1.65; }
.help-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-top: 1.5rem; }
.help-reading-time { color: #94a3b8; font-size: 0.82rem; }
.help-flow-preview {
  min-height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding: 1.5rem;
  border: 1px solid rgba(147,197,253,0.22);
  border-radius: 20px;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(8px);
}
.help-flow-preview span { padding: 0.65rem 0.85rem; border-radius: 0.65rem; background: rgba(37,99,235,0.24); font-size: 0.8rem; font-weight: 800; letter-spacing: 0.06em; }
.help-flow-preview i { color: #60a5fa; font-style: normal; }

.help-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); align-items: start; gap: 1.4rem; margin-top: 1.4rem; }
.help-toc {
  position: sticky;
  top: 92px;
  padding: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: rgba(255,255,255,0.9);
  box-shadow: 0 8px 20px rgba(15,23,42,0.06);
}
.help-toc > strong { display: block; margin: 0.15rem 0.6rem 0.65rem; color: #0f172a; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; }
.help-toc nav { display: flex; flex-direction: column; gap: 0.15rem; }
.help-toc a { padding: 0.55rem 0.6rem; border-radius: 0.55rem; color: #475569; font-size: 0.82rem; font-weight: 650; }
.help-toc a:hover { color: #1d4ed8; background: #eff6ff; }
.help-content { min-width: 0; display: flex; flex-direction: column; gap: 1.4rem; }
.help-section {
  scroll-margin-top: 92px;
  padding: clamp(1.2rem, 3vw, 2.2rem);
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(15,23,42,0.055);
}
.help-section-heading { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.35rem; }
.help-section-number {
  flex: 0 0 auto;
  min-width: 2.5rem;
  padding-top: 0.25rem;
  color: #2563eb;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}
.help-section-heading h2 { margin: 0; color: #0f172a; font-size: clamp(1.45rem, 2.5vw, 2rem); line-height: 1.15; }
.help-section-heading p { max-width: 820px; margin: 0.45rem 0 0; color: #64748b; line-height: 1.6; }
.help-large-copy { color: #334155; font-size: 1.06rem; line-height: 1.75; }
.help-summary-callout { display: flex; align-items: flex-start; gap: 0.75rem; margin-top: 1.25rem; padding: 1rem 1.15rem; border-radius: 14px; background: #ecfdf5; color: #065f46; }
.help-summary-callout span { width: 1.5rem; height: 1.5rem; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #10b981; font-size: 0.75rem; }
.help-permission-note { margin: 1rem 0 0; padding-left: 1rem; border-left: 3px solid #f59e0b; color: #7c2d12; font-size: 0.88rem; line-height: 1.55; }

.help-process { display: flex; flex-direction: column; }
.help-process-step { display: grid; grid-template-columns: 3rem minmax(0, 1fr); gap: 1rem; position: relative; padding-bottom: 1.2rem; }
.help-process-step:not(:last-child)::before { content: ''; position: absolute; top: 2.65rem; bottom: 0.2rem; left: 1.45rem; width: 2px; background: #dbeafe; }
.help-step-number { width: 3rem; height: 3rem; z-index: 1; display: grid; place-items: center; border-radius: 14px; color: #1d4ed8; background: #dbeafe; font-size: 1rem; font-weight: 850; }
.help-step-copy { padding: 0.1rem 0 0.4rem; }
.help-step-title { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.help-step-title h3 { margin: 0; color: #0f172a; font-size: 1.1rem; }
.help-step-title small { color: #6366f1; font-weight: 750; text-align: right; }
.help-step-copy p { margin: 0.45rem 0; color: #475569; line-height: 1.6; }
.help-result { display: block; margin-bottom: 0.45rem; color: #166534; font-size: 0.85rem; }
.help-step-copy a { font-size: 0.85rem; font-weight: 750; }

.help-checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }
.help-checklist li { display: grid; grid-template-columns: 1.15rem minmax(0, 1fr); gap: 0.8rem; padding: 0.95rem 1rem; border-radius: 14px; background: #f8fafc; }
.help-checklist li > span { width: 1.05rem; height: 1.05rem; margin-top: 0.16rem; border: 2px solid #93c5fd; border-radius: 0.3rem; background: #fff; }
.help-checklist strong { color: #0f172a; }
.help-checklist p { margin: 0.25rem 0 0; color: #64748b; font-size: 0.9rem; line-height: 1.55; }

.help-screen-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.85rem; }
.help-screen-card { min-width: 0; display: flex; flex-direction: column; padding: 1.05rem; border: 1px solid #e2e8f0; border-radius: 15px; background: #f8fafc; }
.help-screen-card:hover { border-color: #bfdbfe; background: #f4f8ff; }
.help-question { color: #2563eb; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.help-screen-card h3 { margin: 0.35rem 0; color: #0f172a; font-size: 1.05rem; }
.help-screen-card p { margin: 0; color: #475569; font-size: 0.88rem; line-height: 1.55; }
.help-screen-card small { display: block; margin: 0.7rem 0; color: #64748b; font-style: italic; line-height: 1.45; }
.help-screen-card a { margin-top: auto; font-size: 0.82rem; font-weight: 750; }

.help-status-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; }
.help-status-item { display: grid; grid-template-columns: auto minmax(100px, 0.35fr) minmax(0, 1fr); align-items: center; gap: 0.75rem; padding: 0.85rem 0.95rem; border: 1px solid #e2e8f0; border-radius: 13px; }
.help-status-item p { margin: 0; color: #64748b; font-size: 0.84rem; line-height: 1.45; }
.help-status-dot { width: 0.7rem; height: 0.7rem; border-radius: 50%; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 15%, transparent); }
.help-status-dot.blue { color: #3b82f6; background: #3b82f6; }
.help-status-dot.violet { color: #8b5cf6; background: #8b5cf6; }
.help-status-dot.green { color: #22c55e; background: #22c55e; }
.help-status-dot.orange { color: #f97316; background: #f97316; }
.help-status-dot.slate { color: #64748b; background: #64748b; }
.help-status-dot.red { color: #ef4444; background: #ef4444; }

.help-accordion-list { display: flex; flex-direction: column; gap: 0.65rem; }
.help-accordion { border: 1px solid #e2e8f0; border-radius: 14px; background: #f8fafc; overflow: hidden; }
.help-accordion summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.1rem; cursor: pointer; color: #0f172a; font-weight: 750; list-style: none; }
.help-accordion summary::-webkit-details-marker { display: none; }
.help-accordion summary span { color: #2563eb; font-size: 1.25rem; line-height: 1; transition: transform 0.15s ease; }
.help-accordion[open] summary span { transform: rotate(45deg); }
.help-accordion ol { margin: 0; padding: 0 1.25rem 1rem 2.8rem; color: #475569; }
.help-accordion li { padding: 0.24rem 0; line-height: 1.55; }
.help-accordion > p { margin: 0; padding: 0 1.1rem 1rem; color: #475569; line-height: 1.6; }

.help-terms { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; }
.help-terms > div { padding: 0.9rem 1rem; border-radius: 13px; background: #f8fafc; }
.help-terms dt { margin-bottom: 0.3rem; color: #0f172a; font-weight: 800; }
.help-terms dd { margin: 0; color: #64748b; font-size: 0.88rem; line-height: 1.5; }
.help-rules { color: #fff; border-color: transparent; background: linear-gradient(135deg, #0f3b2e, #166534); }
.help-rules .help-section-number,
.help-rules .help-section-heading h2 { color: #fff; }
.help-rules ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem 1rem; }
.help-rules li { display: flex; align-items: flex-start; gap: 0.65rem; padding: 0.8rem; border-radius: 12px; background: rgba(255,255,255,0.08); line-height: 1.5; }
.help-rules li span { width: 1.3rem; height: 1.3rem; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: #065f46; background: #bbf7d0; font-size: 0.68rem; font-weight: 900; }
.help-footer-note { display: flex; gap: 0.85rem; align-items: flex-start; padding: 1rem 1.15rem; border: 1px solid #fed7aa; border-radius: 14px; color: #9a3412; background: #fff7ed; }
.help-footer-note > span { width: 1.55rem; height: 1.55rem; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #f97316; font-weight: 850; }
.help-footer-note p { margin: 0; line-height: 1.55; }

@media (max-width: 1080px) {
  .help-layout { grid-template-columns: 1fr; }
  .help-toc { position: static; }
  .help-toc nav { flex-direction: row; flex-wrap: wrap; }
  .help-toc a { background: #f8fafc; }
  .help-status-list { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .help-hero { min-height: 0; grid-template-columns: 1fr; border-radius: 18px; }
  .help-flow-preview { min-height: 110px; }
  .help-section { border-radius: 16px; }
  .help-section-heading { gap: 0.6rem; }
  .help-section-number { min-width: 1.8rem; }
  .help-screen-grid,
  .help-terms,
  .help-rules ul { grid-template-columns: 1fr; }
  .help-step-title { align-items: flex-start; flex-direction: column; gap: 0.25rem; }
  .help-step-title small { text-align: left; }
  .help-status-item { grid-template-columns: auto minmax(0, 1fr); }
  .help-status-item p { grid-column: 2; }
}

/* Refined CernCutting brand shell */
.app-header {
  color: #10233d;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid #dbe4ef;
  box-shadow: 0 8px 26px rgba(20, 45, 75, 0.1);
  backdrop-filter: blur(16px);
}
.brand { width: 194px; height: 48px; overflow: hidden; }
.brand-logo { display: block; width: 194px; height: auto; }
.main-nav a,
.nav-dropdown summary { color: #526174; }
.nav-link:hover,
.nav-dropdown > summary:hover { color: var(--brand-navy); background: #f1f6fb; }
.nav-link.active,
.nav-dropdown.active > summary {
  color: var(--brand-blue-dark);
  background: #eaf3fc;
  box-shadow: inset 0 0 0 1px #d4e7f8;
}
.nav-link.active::before,
.nav-dropdown.active > summary::before { background: var(--brand-gold); }
.account-trigger { color: #132b48; }
.account-trigger:hover { background: #f1f6fb; }
.account-avatar { background: #e8f1fa; }
.account-avatar::before,
.account-avatar::after { background: var(--brand-blue); }
.nav-toggle { color: var(--brand-navy); background: #f4f7fb; border-color: #d7e1ec; }
.action-button.primary {
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-dark));
  box-shadow: 0 8px 18px rgba(8, 103, 199, 0.22);
}
.action-button.primary:hover { filter: brightness(1.05); transform: translateY(-1px); }

/* Public sign-in experience: deliberately isolated from the authenticated navigation. */
body.auth-page {
  min-height: 100vh;
  overflow-x: hidden;
  color: #13233b;
  background:
    radial-gradient(circle at 9% 13%, rgba(8, 103, 199, 0.09), transparent 25rem),
    #f4f7fb;
}
.auth-topbar {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.25rem, 4vw, 4rem);
  border-bottom: 1px solid rgba(192, 207, 224, 0.72);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
}
.auth-logo { display: block; width: clamp(190px, 18vw, 245px); height: auto; }
.auth-language {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.25rem;
  border: 1px solid #dce5ef;
  border-radius: 0.8rem;
  background: #f5f8fc;
}
.auth-language a {
  min-width: 42px;
  padding: 0.48rem 0.65rem;
  border-radius: 0.6rem;
  color: #66758a;
  font-size: 0.76rem;
  font-weight: 800;
  text-align: center;
}
.auth-language a.active { color: #fff; background: var(--brand-blue); box-shadow: 0 5px 12px rgba(8, 103, 199, 0.24); }
.auth-shell {
  width: min(1440px, 100%);
  min-height: calc(100vh - 82px);
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 4.5rem);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(420px, 0.9fr);
  gap: clamp(2rem, 5vw, 6rem);
  align-items: center;
}
.auth-story {
  min-height: 590px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(2.2rem, 5vw, 4.8rem);
  border-radius: 34px;
  color: #fff;
  background:
    radial-gradient(circle at 82% 20%, rgba(26, 128, 226, 0.55), transparent 32%),
    radial-gradient(circle at 75% 88%, rgba(244, 180, 0, 0.24), transparent 22%),
    linear-gradient(145deg, #061b35 0%, #063a70 100%);
  box-shadow: 0 30px 70px rgba(6, 38, 74, 0.26);
}
.auth-story::before {
  content: '';
  position: absolute;
  z-index: -1;
  width: 350px;
  height: 350px;
  right: -135px;
  top: 42%;
  border: 52px solid rgba(255, 255, 255, 0.055);
  border-radius: 50%;
}
.auth-story::after {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: 0.12;
  background-image: linear-gradient(rgba(255,255,255,.22) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.22) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom right, black, transparent 68%);
}
.auth-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 1.3rem;
  color: #a9d6ff;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.auth-eyebrow::before { content: ''; width: 30px; height: 3px; border-radius: 3px; background: var(--brand-gold); }
.auth-story h2 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(2.5rem, 5vw, 5.1rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}
.auth-story-subtitle { max-width: 660px; margin: 1.6rem 0 0; color: #c8dcf1; font-size: clamp(1rem, 1.6vw, 1.18rem); line-height: 1.7; }
.auth-benefits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; margin-top: 3rem; }
.auth-benefits article {
  min-width: 0;
  padding: 1.1rem;
  display: flex;
  gap: 0.8rem;
  border: 1px solid rgba(189, 222, 255, 0.18);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(8px);
}
.auth-benefits article > span { color: #facb42; font-size: 0.68rem; font-weight: 850; }
.auth-benefits div { min-width: 0; }
.auth-benefits strong { display: block; margin-bottom: 0.35rem; font-size: 0.88rem; }
.auth-benefits small { display: block; color: #b8cee5; font-size: 0.74rem; line-height: 1.45; }
.auth-form-column { width: 100%; max-width: 530px; justify-self: center; }
.auth-card.auth-card-redesigned {
  max-width: none;
  margin: 0;
  padding: clamp(1.8rem, 4vw, 3.4rem);
  border: 1px solid rgba(194, 208, 225, 0.8);
  border-radius: 28px;
  box-shadow: 0 24px 65px rgba(37, 57, 80, 0.13);
}
.auth-card-heading { margin-bottom: 1.8rem; }
.auth-card-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.85rem;
  color: var(--brand-blue-dark);
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.auth-card-eyebrow > span { width: 8px; height: 8px; border-radius: 50%; background: #16a36a; box-shadow: 0 0 0 4px #dff7ed; }
.auth-card-heading h1 { margin: 0; color: #0d2038; font-size: clamp(2rem, 3.2vw, 2.75rem); line-height: 1.08; letter-spacing: -0.045em; }
.auth-card-heading > p:last-child { margin: 0.85rem 0 0; color: #66758a; line-height: 1.55; }
.auth-alert { display: flex; align-items: flex-start; gap: 0.7rem; margin-bottom: 1.25rem; border: 1px solid #fecaca; }
.auth-alert > span { width: 1.35rem; height: 1.35rem; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #dc2626; font-size: 0.74rem; font-weight: 900; }
.auth-alert p { margin: 0; line-height: 1.45; }
.auth-card .auth-form { gap: 0; }
.auth-form > label,
.auth-password-label label { display: block; margin: 0 0 0.48rem; color: #263a52; font-size: 0.84rem; font-weight: 750; }
.auth-form input {
  width: 100%;
  height: 54px;
  padding: 0 1rem;
  border: 1px solid #cbd7e5;
  border-radius: 12px;
  outline: none;
  color: #13233b;
  background: #fbfdff;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.auth-form input::placeholder { color: #9aa8b8; }
.auth-form input:hover { border-color: #9eb4ca; }
.auth-form input:focus { border-color: var(--brand-blue); background: #fff; box-shadow: 0 0 0 4px rgba(8, 103, 199, 0.12); }
.auth-password-label { margin-top: 1.15rem; }
.auth-password-field { position: relative; }
.auth-password-field input { padding-right: 3.4rem; }
.auth-password-toggle {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 9px;
  color: #66758a;
  background: transparent;
  cursor: pointer;
}
.auth-password-toggle:hover { color: var(--brand-blue-dark); background: #eaf3fc; }
.auth-password-toggle span { width: 20px; height: 13px; position: relative; border: 1.8px solid currentColor; border-radius: 50% / 60%; }
.auth-password-toggle span::after { content: ''; position: absolute; width: 5px; height: 5px; top: 2.2px; left: 5.7px; border-radius: 50%; background: currentColor; }
.auth-password-toggle[aria-pressed="true"] span::before { content: ''; position: absolute; z-index: 1; width: 24px; height: 2px; top: 5px; left: -3px; background: currentColor; transform: rotate(-42deg); }
.auth-submit {
  width: 100%;
  min-height: 56px;
  margin-top: 1.5rem;
  padding-inline: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 12px;
  font-weight: 800;
}
.auth-security-note { display: flex; align-items: center; gap: 0.8rem; margin-top: 1.45rem; padding-top: 1.25rem; border-top: 1px solid #e5ebf2; }
.auth-security-note div { min-width: 0; }
.auth-security-note strong { display: block; color: #40546d; font-size: 0.76rem; }
.auth-security-note small { display: block; margin-top: 0.18rem; color: #8a98a9; font-size: 0.7rem; line-height: 1.4; }
.auth-lock { width: 30px; height: 30px; flex: 0 0 auto; position: relative; border-radius: 9px; background: #e9f3fc; }
.auth-lock::before { content: ''; position: absolute; width: 9px; height: 7px; top: 6px; left: 9px; border: 2px solid var(--brand-blue); border-bottom: 0; border-radius: 6px 6px 0 0; }
.auth-lock::after { content: ''; position: absolute; width: 12px; height: 10px; top: 13px; left: 9px; border-radius: 3px; background: var(--brand-blue); }

@media (max-width: 1040px) {
  .auth-shell { grid-template-columns: minmax(0, 1fr) minmax(390px, 0.9fr); gap: 1.5rem; padding: 1.5rem; }
  .auth-story { min-height: 540px; }
  .auth-benefits { grid-template-columns: 1fr; }
  .auth-benefits article { padding: 0.8rem; }
}

@media (max-width: 800px) {
  .auth-topbar { height: 70px; padding-inline: 1rem; }
  .auth-logo { width: 182px; }
  .auth-shell { min-height: calc(100vh - 70px); grid-template-columns: 1fr; padding: 1.25rem; }
  .auth-story { display: none; }
  .auth-form-column { max-width: 540px; }
}

@media (max-width: 920px) {
  .main-nav { color: #10233d; background: #fff; border-top-color: #dbe4ef; box-shadow: 0 18px 30px rgba(20,45,75,.14); }
}

@media (max-width: 520px) {
  .auth-language a { min-width: 36px; padding-inline: 0.5rem; }
  .auth-shell { align-items: start; padding: 0.8rem; }
  .auth-card.auth-card-redesigned { padding: 1.5rem 1.25rem; border-radius: 20px; }
  .auth-card-heading h1 { font-size: 1.85rem; }
  .brand { width: 155px; height: 42px; }
  .brand-logo { width: 155px; }
}

/* Admin workspaces: users and manual order entry */
.action-button.secondary { color: var(--brand-blue-dark); background: #e8f2fc; box-shadow: inset 0 0 0 1px #cfe3f7; }
.action-button.secondary:hover { background: #dcecfb; }
.alert-success { color: #08744d; background: #e8f8f1; border: 1px solid #bdebd8; }
.admin-workspace { width: min(1420px, 100%); margin: 0 auto; }
.admin-page-header { align-items: center; margin-bottom: 1.5rem; }
.admin-summary-pill { min-width: 130px; padding: 0.8rem 1.1rem; display: flex; align-items: baseline; justify-content: center; gap: 0.45rem; border: 1px solid #d9e4f0; border-radius: 14px; background: #fff; box-shadow: 0 8px 20px rgba(20,45,75,.07); }
.admin-summary-pill strong { color: var(--brand-blue-dark); font-size: 1.5rem; }
.admin-summary-pill span { color: #728196; font-size: 0.75rem; }
.admin-alert { max-width: 900px; margin: 0 0 1rem; }
.admin-create-panel { margin-bottom: 2rem; overflow: hidden; border: 1px solid #d8e4ef; border-radius: 20px; background: #fff; box-shadow: 0 14px 32px rgba(28,55,85,.08); }
.admin-create-panel > summary { min-height: 82px; padding: 1rem 1.35rem; display: flex; align-items: center; gap: 0.9rem; cursor: pointer; list-style: none; }
.admin-create-panel > summary::-webkit-details-marker { display: none; }
.admin-create-panel > summary > span:nth-child(2) { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 0.2rem; }
.admin-create-panel > summary strong { color: #10233d; font-size: 1rem; }
.admin-create-panel > summary small { color: #78879a; font-size: 0.8rem; }
.admin-create-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: #fff; background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-dark)); font-size: 1.55rem; }
.admin-create-panel > summary .chevron { color: #6b7b8e; }
.admin-create-panel[open] > summary { border-bottom: 1px solid #e3eaf2; background: #f9fbfd; }
.admin-form { padding: 1.4rem; }
.admin-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.admin-form-grid.three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.admin-form-grid.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.admin-form-grid label { min-width: 0; color: #405269; font-size: 0.78rem; font-weight: 750; }
.admin-form-grid input,
.admin-form-grid select,
.admin-form-grid textarea,
.inline-security-form input { width: 100%; min-height: 46px; margin-top: 0.38rem; padding: 0.65rem 0.78rem; border: 1px solid #cbd8e5; border-radius: 11px; outline: none; color: #14263d; background: #fbfdff; }
.admin-form-grid textarea { resize: vertical; }
.admin-form-grid input:focus,
.admin-form-grid select:focus,
.admin-form-grid textarea:focus,
.inline-security-form input:focus { border-color: var(--brand-blue); background: #fff; box-shadow: 0 0 0 4px rgba(8,103,199,.1); }
.admin-form-grid label > small { display: block; margin-top: 0.3rem; color: #8b98a8; font-weight: 500; }
.admin-form-grid .span-two { grid-column: span 2; }
.operator-fields { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; padding: 1rem; border: 1px solid #d9e8f7; border-radius: 13px; background: #f3f8fd; }
.operator-fields[hidden], .urgent-reason-field[hidden] { display: none; }
.admin-form-actions { display: flex; justify-content: flex-end; margin-top: 1.15rem; }
.user-list-heading { margin: 0 0 0.9rem; display: flex; justify-content: space-between; align-items: end; }
.user-list-heading h2 { margin: 0; color: #12243b; font-size: 1.2rem; }
.user-list-heading p { margin: 0.3rem 0 0; color: #758397; font-size: 0.84rem; }
.user-admin-list { display: flex; flex-direction: column; gap: 0.7rem; }
.user-admin-card { overflow: hidden; border: 1px solid #dce5ee; border-radius: 17px; background: #fff; box-shadow: 0 7px 20px rgba(20,45,75,.055); }
.user-admin-card > summary { min-height: 74px; padding: 0.75rem 1rem; display: grid; grid-template-columns: auto minmax(190px, 1.4fr) minmax(130px, .65fr) minmax(110px, .55fr) 90px auto auto; align-items: center; gap: 0.85rem; cursor: pointer; list-style: none; }
.user-admin-card > summary::-webkit-details-marker { display: none; }
.user-admin-card[open] > summary { border-bottom: 1px solid #e3eaf2; background: #f8fbfe; }
.user-admin-avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: #fff; background: linear-gradient(145deg, var(--brand-blue), #073d75); font-weight: 850; }
.user-admin-identity { min-width: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.user-admin-identity strong { overflow: hidden; color: #14253b; text-overflow: ellipsis; white-space: nowrap; }
.user-admin-identity small { overflow: hidden; color: #7c8a9c; font-size: 0.76rem; text-overflow: ellipsis; white-space: nowrap; }
.user-admin-assignment, .user-admin-nfc { display: flex; flex-direction: column; color: #203852; font-size: 0.85rem; font-weight: 750; }
.user-admin-assignment small, .user-admin-nfc small { margin-top: 0.15rem; color: #8794a4; font-size: 0.68rem; font-weight: 550; }
.user-admin-nfc { align-items: center; }
.user-admin-nfc strong { color: var(--brand-blue-dark); font-size: 1.1rem; }
.role-badge { width: fit-content; padding: 0.3rem 0.62rem; border-radius: 999px; color: #265078; background: #e7f1fa; font-size: 0.68rem; font-weight: 750; }
.role-badge.role-admin { color: #6d4800; background: #fff2ca; }
.role-badge.role-operator { color: #08704d; background: #e5f7ef; }
.user-admin-body { padding: 0 1.1rem 1.1rem; }
.user-admin-body > .admin-form { padding-inline: 0; }
.user-security-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.user-security-panel { padding: 1rem; border: 1px solid #dfe7f0; border-radius: 14px; background: #f9fbfd; }
.user-security-panel h3 { margin: 0; color: #1d344e; font-size: 0.95rem; }
.user-security-panel > p { margin: 0.35rem 0 0.85rem; color: #7b899b; font-size: 0.76rem; line-height: 1.45; }
.inline-security-form { display: flex; gap: 0.6rem; align-items: center; }
.inline-security-form input { min-width: 0; margin: 0; }
.inline-security-form .action-button { flex: 0 0 auto; }
.nfc-empty { padding: 0.75rem; border-radius: 10px; color: #7e8b9b; background: #eef3f8; font-size: 0.8rem; }
.nfc-card-list { display: flex; flex-direction: column; gap: 0.5rem; }
.nfc-card-row { min-height: 52px; padding: 0.55rem 0.65rem; display: flex; align-items: center; gap: 0.65rem; border: 1px solid #d9e6f2; border-radius: 11px; background: #fff; }
.nfc-card-row.inactive { opacity: .62; }
.nfc-card-icon { width: 38px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: #fff; background: var(--brand-blue); font-size: 0.62rem; font-weight: 850; }
.nfc-card-row > span:nth-child(2) { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.nfc-card-row strong { color: #243a53; font-size: 0.82rem; }
.nfc-card-row small { color: #8794a4; font-size: 0.68rem; }
.text-danger-button { padding: 0.35rem 0.55rem; border: 0; border-radius: 8px; color: #b4232c; background: #fdebed; font-size: 0.72rem; font-weight: 750; cursor: pointer; }
.nfc-app-note { display: block; margin-top: 0.75rem; color: #7c8a9b; line-height: 1.45; }

.manual-order-form { display: flex; flex-direction: column; gap: 1rem; }
.form-section-card { padding: clamp(1.15rem, 2.5vw, 1.8rem); border: 1px solid #dbe5ef; border-radius: 20px; background: #fff; box-shadow: 0 11px 28px rgba(28,55,85,.065); }
.form-section-heading { margin-bottom: 1.3rem; display: flex; align-items: flex-start; gap: 0.9rem; }
.form-section-heading > span { width: 36px; height: 36px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 11px; color: var(--brand-blue-dark); background: #e5f1fc; font-size: 0.7rem; font-weight: 850; }
.form-section-heading > div { min-width: 0; flex: 1; }
.form-section-heading h2 { margin: 0; color: #11263e; font-size: 1.1rem; }
.form-section-heading p { margin: 0.28rem 0 0; color: #7a889a; font-size: 0.8rem; }
.items-heading { align-items: center; }
.manual-items { display: flex; flex-direction: column; gap: 0.8rem; }
.manual-item-card { overflow: hidden; display: grid; grid-template-columns: 74px minmax(0, 1fr); border: 1px solid #dce6f0; border-radius: 15px; background: #fbfdff; }
.manual-item-number { min-height: 100%; padding: 0.8rem; display: flex; align-items: center; flex-direction: column; justify-content: center; color: #fff; background: linear-gradient(160deg, #092e57, #0867c7); }
.manual-item-number span { font-size: 0.58rem; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }
.manual-item-number strong { font-size: 1.55rem; }
.manual-item-number button { width: 26px; height: 26px; margin-top: 0.65rem; border: 0; border-radius: 50%; color: #fff; background: rgba(255,255,255,.16); cursor: pointer; }
.manual-item-number button[hidden] { display: none; }
.item-grid { grid-template-columns: minmax(130px, .8fr) repeat(2, minmax(110px, .55fr)) minmax(150px, 1.3fr); padding: 1rem; }
.item-grid label:nth-child(1) { grid-column: span 1; }
.item-grid label:nth-child(2) { grid-column: span 3; }
.manual-order-submit { padding: 1.1rem 1.3rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-radius: 17px; color: #fff; background: linear-gradient(135deg, #06264a, #084c8f); box-shadow: 0 15px 32px rgba(6,38,74,.2); }
.manual-order-submit > div { display: flex; flex-direction: column; gap: .2rem; }
.manual-order-submit small { color: #bdd3e9; }
.table-empty-state { min-height: 150px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: .45rem; color: #718095; }
.table-empty-state strong { color: #2b425d; }

.operator-app-page { max-width: 1240px; margin: 0 auto; padding-bottom: 2rem; }
.operator-app-hero { min-height: 300px; overflow: hidden; position: relative; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr); align-items: center; gap: 2rem; padding: clamp(1.6rem, 4vw, 3.4rem); border-radius: 26px; color: #fff; background: radial-gradient(circle at 78% 20%, rgba(39,145,240,.5), transparent 29%), linear-gradient(135deg, #052343 0%, #074b8b 58%, #0875ce 100%); box-shadow: 0 24px 50px rgba(7,50,92,.22); }
.operator-app-hero::before { content: ''; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 36px 36px; mask-image: linear-gradient(90deg, #000, transparent); }
.operator-app-hero-copy { position: relative; z-index: 1; max-width: 690px; }
.operator-app-hero .eyebrow { color: #ffcb44; }
.operator-app-hero h1 { max-width: 660px; margin: .35rem 0 .8rem; color: #fff; font-size: clamp(2rem, 4vw, 3.45rem); line-height: 1.03; letter-spacing: -.045em; }
.operator-app-hero-copy > p:not(.eyebrow) { max-width: 620px; margin: 0; color: #d4e5f6; font-size: clamp(.95rem, 1.7vw, 1.1rem); line-height: 1.65; }
.operator-app-tags { margin-top: 1.35rem; display: flex; gap: .55rem; flex-wrap: wrap; }
.operator-app-tags span { padding: .42rem .72rem; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; color: #e8f3fd; background: rgba(255,255,255,.09); font-size: .72rem; font-weight: 750; backdrop-filter: blur(8px); }
.operator-app-device { width: 176px; height: 252px; margin: 24px auto -68px; position: relative; z-index: 1; padding: 9px; border: 2px solid rgba(255,255,255,.38); border-radius: 31px; background: #05182c; box-shadow: 0 28px 50px rgba(0,0,0,.35); transform: rotate(5deg); }
.operator-app-device::before { content: ''; width: 58px; height: 12px; position: absolute; z-index: 2; top: 7px; left: 50%; border-radius: 0 0 10px 10px; background: #05182c; transform: translateX(-50%); }
.operator-app-device-screen { height: 100%; display: flex; align-items: center; justify-content: center; flex-direction: column; border-radius: 23px; color: #fff; background: radial-gradient(circle at 50% 20%, #1684e9, #072f59 62%, #041d37); }
.operator-app-device-screen img { width: 72px; height: 72px; margin-bottom: 1rem; border-radius: 19px; box-shadow: 0 13px 26px rgba(0,0,0,.25); }
.operator-app-device-screen strong { font-size: 1.05rem; letter-spacing: .04em; }
.operator-app-device-screen small { margin-top: .2rem; color: #ffcb44; font-size: .58rem; font-weight: 850; letter-spacing: .18em; }
.operator-app-layout { margin-top: 1.25rem; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 1.25rem; }
.operator-app-download-card, .operator-app-install-card { padding: clamp(1.3rem, 3vw, 2rem); border: 1px solid #dce6f0; border-radius: 22px; background: #fff; box-shadow: 0 13px 30px rgba(25,55,88,.07); }
.operator-app-download-card { border-top: 4px solid var(--brand-blue); }
.operator-app-card-heading { display: flex; align-items: center; gap: .9rem; }
.operator-app-card-heading .eyebrow { margin: 0 0 .12rem; }
.operator-app-card-heading h2 { margin: 0; color: #102944; font-size: 1.22rem; }
.operator-app-card-icon { width: 46px; height: 46px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 14px; color: #fff; background: linear-gradient(145deg, #0878dd, #07519a); font-size: 1.4rem; font-weight: 850; }
.operator-app-card-icon.secondary { color: #087152; background: #dff5ec; }
.operator-app-download-card > p { margin: 1.1rem 0; color: #66768a; line-height: 1.55; }
.operator-app-meta { margin: 0 0 1.2rem; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid #e1e9f1; border-radius: 14px; background: #f8fafc; }
.operator-app-meta div { min-width: 0; padding: .8rem 1rem; display: flex; flex-direction: column; gap: .18rem; border-right: 1px solid #e1e9f1; }
.operator-app-meta div:last-child { border-right: 0; }
.operator-app-meta dt { color: #8290a1; font-size: .65rem; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.operator-app-meta dd { margin: 0; color: #243c56; font-size: .84rem; font-weight: 780; }
.operator-app-download-button { width: 100%; min-height: 52px; justify-content: center; gap: .55rem; font-size: .95rem; }
.operator-app-download-button span { font-size: 1.2rem; }
.operator-app-file-name { margin-top: .6rem; display: block; color: #8290a1; text-align: center; }
.operator-app-checksum { margin-top: .75rem; color: #78879a; font-size: .7rem; text-align: center; }
.operator-app-checksum summary { cursor: pointer; }
.operator-app-checksum code { margin-top: .45rem; padding: .45rem; overflow-wrap: anywhere; display: block; border-radius: 8px; color: #50647b; background: #f1f5f9; font-size: .62rem; }
.operator-app-steps { margin: 1.25rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .85rem; list-style: none; }
.operator-app-steps li { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: start; gap: .75rem; }
.operator-app-steps li > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: #0758a6; background: #e6f2fc; font-size: .72rem; font-weight: 850; }
.operator-app-steps p { margin: .28rem 0 0; color: #52657b; font-size: .83rem; line-height: 1.5; }
.operator-app-security-note { margin-top: 1.2rem; padding: .85rem; display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: start; gap: .65rem; border: 1px solid #f1dfaa; border-radius: 12px; color: #795d14; background: #fff9e8; }
.operator-app-security-note > span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; color: #785700; background: #ffe7a0; font-weight: 900; }
.operator-app-security-note p { margin: .1rem 0 0; font-size: .75rem; line-height: 1.5; }

@media (max-width: 1050px) {
  .user-admin-card > summary { grid-template-columns: auto minmax(170px, 1fr) minmax(120px, .6fr) 80px auto auto; }
  .user-admin-assignment { display: none; }
  .item-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .item-grid label:nth-child(2) { grid-column: span 1; }
}

@media (max-width: 760px) {
  .admin-form-grid,
  .admin-form-grid.three-columns,
  .admin-form-grid.two-columns,
  .operator-fields,
  .user-security-grid,
  .item-grid { grid-template-columns: 1fr; }
  .admin-form-grid .span-two,
  .item-grid label:nth-child(2) { grid-column: auto; }
  .user-admin-card > summary { grid-template-columns: auto minmax(0, 1fr) auto; gap: .65rem; }
  .user-admin-card > summary .role-badge,
  .user-admin-card > summary .user-admin-assignment,
  .user-admin-card > summary .user-admin-nfc,
  .user-admin-card > summary .status-badge { display: none; }
  .inline-security-form { align-items: stretch; flex-direction: column; }
  .manual-item-card { grid-template-columns: 1fr; }
  .manual-item-number { min-height: 48px; flex-direction: row; gap: .45rem; }
  .manual-item-number button { margin: 0 0 0 auto; }
  .items-heading { align-items: stretch; flex-wrap: wrap; }
  .items-heading .action-button { width: 100%; }
  .manual-order-submit { align-items: stretch; flex-direction: column; }
  .manual-order-submit .action-button { width: 100%; }
  .operator-app-hero { min-height: auto; grid-template-columns: 1fr; }
  .operator-app-device { display: none; }
  .operator-app-layout { grid-template-columns: 1fr; }
  .operator-app-meta { grid-template-columns: 1fr; }
  .operator-app-meta div { border-right: 0; border-bottom: 1px solid #e1e9f1; }
  .operator-app-meta div:last-child { border-bottom: 0; }
}
