/* DHS ShopFloor — Modern Industrial design system
   Ported from Claude Design handoff bundle. Filled badge style baked in. */

:root {
  --bg: #0E1116;
  --surface: #161B22;
  --surface-2: #1C232C;
  --surface-3: #232C37;
  --line: #2A3442;
  --line-strong: #3A4757;

  --ink: #E8EDF3;
  --ink-2: #B6C0CE;
  --ink-3: #7C8898;
  --ink-4: #5A6675;

  --accent: #FFD23F;
  --accent-ink: #1A1300;
  --link: #6FB8FF;

  --ok: #34D399;
  --ok-bg: rgba(52, 211, 153, 0.12);
  --ok-line: rgba(52, 211, 153, 0.35);
  --warn: #F59E0B;
  --warn-bg: rgba(245, 158, 11, 0.12);
  --warn-line: rgba(245, 158, 11, 0.35);
  --danger: #F87171;
  --danger-bg: rgba(248, 113, 113, 0.12);
  --danger-line: rgba(248, 113, 113, 0.35);
  --info: #60A5FA;
  --info-bg: rgba(96, 165, 250, 0.12);
  --info-line: rgba(96, 165, 250, 0.35);
  --muted: #6B7280;
  --muted-bg: rgba(107, 114, 128, 0.14);
  --muted-line: rgba(107, 114, 128, 0.35);

  --font-sans: "Inter Tight", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, monospace;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
}

a { color: inherit; }
button { font-family: inherit; }

/* App shell */
.app {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top bar */
.topbar {
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  height: 64px;
  flex-shrink: 0;
}
.topbar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
  border-right: 1px solid var(--line);
  cursor: pointer;
  min-width: 240px;
  text-decoration: none;
  color: inherit;
}
.topbar .brand .mark {
  width: 32px; height: 32px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 8px;
  display: grid; place-items: center;
  font-weight: 800;
  letter-spacing: -0.04em;
  font-size: 15px;
}
.topbar .brand .name {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.topbar .brand .name small {
  display: block;
  font-weight: 500;
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.topbar .nav {
  display: flex;
  align-items: stretch;
  flex: 1;
  padding: 0 8px;
}
.topbar .nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 500;
  font-size: 14.5px;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: color 0.12s;
}
.topbar .nav a:hover { color: var(--ink); }
.topbar .nav a.active { color: var(--ink); }
.topbar .nav a.active::after {
  content: "";
  position: absolute;
  left: 18px; right: 18px;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
}
.topbar .nav a svg { width: 18px; height: 18px; opacity: 0.85; }

.topbar .right {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-left: 1px solid var(--line);
}
.topbar .pulse {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  padding-right: 10px;
  margin-right: 6px;
  border-right: 1px solid var(--line);
  height: 22px;
}
.topbar .pulse .dot {
  width: 7px; height: 7px;
  background: var(--ok);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(52,211,153,0.18);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.avatar {
  width: 36px; height: 36px;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
}
.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-2);
  cursor: pointer;
  text-decoration: none;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

/* Page */
.page {
  flex: 1;
  padding: 28px 32px 60px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}
.page-head h1 {
  font-size: 30px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.025em;
}
.page-head .crumbs {
  font-size: 12px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
  font-weight: 600;
}
.page-head .actions { display: flex; gap: 10px; align-items: center; }

/* Toolbar (search + filters above tables) */
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
}
.search {
  flex: 1;
  position: relative;
}
.search svg {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  width: 16px; height: 16px;
  pointer-events: none;
}
.search input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  padding: 11px 14px 11px 38px;
  font-size: 14.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.12s;
}
.search input:focus { border-color: var(--accent); }
.search input::placeholder { color: var(--ink-4); }

.filter-pill {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  text-decoration: none;
}
.filter-pill:hover { border-color: var(--line-strong); color: var(--ink); }
.filter-pill.active {
  border-color: var(--accent);
  background: rgba(255,210,63,0.08);
  color: var(--ink);
}
.filter-pill .count {
  background: var(--surface-3);
  color: var(--ink-2);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  font-variant-numeric: tabular-nums;
}
.filter-pill svg { width: 14px; height: 14px; }

select.input, input.input {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

/* Card / data table */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.data thead th {
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  white-space: nowrap;
}
table.data tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  vertical-align: middle;
}
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr.clickable {
  cursor: pointer;
  transition: background 0.1s;
}
table.data tbody tr.clickable:hover { background: var(--surface-2); }
table.data .num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
table.data .mono { font-family: var(--font-mono); font-size: 13px; }
table.data td.muted { color: var(--ink-3); }
table.data .order-id { font-weight: 600; color: var(--ink); }
table.data .link { color: var(--link); text-decoration: none; }
table.data .link:hover { text-decoration: underline; }
table.data td.right { text-align: right; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: inherit;
  letter-spacing: -0.005em;
  transition: transform 0.06s, background 0.12s;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn.primary:hover { background: #FFDC60; }
.btn.secondary {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--line);
}
.btn.secondary:hover { background: var(--surface-3); border-color: var(--line-strong); }
.btn.ghost {
  background: transparent;
  color: var(--ink-2);
  border-color: var(--line);
}
.btn.ghost:hover { color: var(--ink); border-color: var(--line-strong); }
.btn.danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger-line);
}
.btn.lg { padding: 16px 24px; font-size: 16px; }
.btn.full { width: 100%; justify-content: center; }

/* Badges — filled style baked in */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: -0.005em;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge.ok    { background: var(--ok-bg);    color: var(--ok);    border-color: var(--ok-line); }
.badge.warn  { background: var(--warn-bg);  color: var(--warn);  border-color: var(--warn-line); }
.badge.danger{ background: var(--danger-bg);color: var(--danger);border-color: var(--danger-line); }
.badge.info  { background: var(--info-bg);  color: var(--info);  border-color: var(--info-line); }
.badge.muted { background: var(--muted-bg); color: var(--ink-2); border-color: var(--muted-line); }

/* KPI tiles */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.kpi .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  font-weight: 600;
}
.kpi .value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.kpi .value.danger { color: var(--danger); }
.kpi .delta {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 4px;
}
.kpi .delta.up { color: var(--ok); }
.kpi .delta.down { color: var(--danger); }

/* Section */
.section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.section > header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.section > header h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.section > header .meta {
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.section > .body { padding: 16px 18px; }
.section > .body.no-pad { padding: 0; }

/* Detail layout */
.detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}
.detail-grid.single { grid-template-columns: 1fr; }

.detail-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}
.detail-header .top {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
}
.detail-header .left { display: flex; flex-direction: column; gap: 8px; }
.detail-header .id-line {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.detail-header h1 {
  font-size: 32px;
  letter-spacing: -0.025em;
  margin: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.detail-header .description {
  color: var(--ink-2);
  font-size: 16px;
  font-weight: 400;
}
.detail-header .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.kv {
  display: grid;
  grid-template-columns: minmax(120px, 0.4fr) 1fr;
  gap: 10px 16px;
  align-items: baseline;
  margin: 0;
}
.kv dt {
  color: var(--ink-3);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.kv dd {
  margin: 0;
  color: var(--ink);
  font-size: 14.5px;
  font-variant-numeric: tabular-nums;
}
.kv dd.big {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.kv dd .sub { color: var(--ink-3); font-size: 13px; font-weight: 400; }

/* Progress bar */
.progress {
  position: relative;
  height: 6px;
  background: var(--surface-3);
  border-radius: 999px;
  overflow: hidden;
  width: 100px;
}
.progress > span {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--accent);
  border-radius: 999px;
}
.progress.full { width: 100%; }
.progress-cell { display: flex; align-items: center; gap: 10px; }
.progress-cell .num { color: var(--ink-2); font-size: 13px; min-width: 70px; }

/* Routing op cards (operator detail) */
.ops-list { display: flex; flex-direction: column; gap: 8px; }
.op-card {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  align-items: center;
}
.op-card.current {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(255,210,63,0.06), rgba(255,210,63,0.02));
}
.op-card .op-num {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--surface-3);
  font-weight: 700;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}
.op-card.current .op-num {
  background: var(--accent);
  color: var(--accent-ink);
}
.op-card.done .op-num { color: var(--ok); }
.op-card .op-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.op-card .op-title {
  font-weight: 600;
  font-size: 15px;
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
}
.op-card .op-meta {
  display: flex; gap: 14px;
  color: var(--ink-3);
  font-size: 12.5px;
  flex-wrap: wrap;
}
.op-card .op-meta b { color: var(--ink-2); font-weight: 500; }
.op-card .op-times {
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  white-space: nowrap;
}
.op-card .op-times .big { font-size: 16px; font-weight: 600; }
.op-card .op-times .lbl {
  color: var(--ink-3);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Reservation rows */
.mat-list { display: flex; flex-direction: column; gap: 1px; background: var(--line); border-radius: 8px; overflow: hidden; }
.mat-row {
  display: grid;
  grid-template-columns: 80px 1fr 90px 1fr auto;
  background: var(--surface-2);
  padding: 12px 14px;
  gap: 14px;
  align-items: center;
  font-size: 13.5px;
}
.mat-row .item-no { font-family: var(--font-mono); color: var(--ink-2); font-size: 12.5px; }
.mat-row .desc { color: var(--ink); font-weight: 500; }
.mat-row .qty { font-variant-numeric: tabular-nums; font-weight: 600; }
.mat-row .qty .uom { color: var(--ink-3); font-weight: 400; font-size: 12px; margin-left: 3px; }
.mat-row .loc { color: var(--ink-2); font-family: var(--font-mono); font-size: 12.5px; }

/* Sales order context card */
.so-card {
  display: flex; gap: 14px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(96,165,250,0.06), transparent);
  border: 1px solid rgba(96,165,250,0.25);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.12s;
  text-decoration: none;
  color: inherit;
  margin-bottom: 16px;
}
.so-card:hover { border-color: rgba(96,165,250,0.5); }
.so-card .icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(96,165,250,0.18);
  color: var(--info);
  display: grid; place-items: center;
}
.so-card .body { flex: 1; min-width: 0; }
.so-card .label {
  font-size: 11px;
  color: var(--info);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.so-card .so-no { font-weight: 700; font-size: 15px; font-family: var(--font-mono); }
.so-card .customer { color: var(--ink-2); font-size: 13.5px; margin-top: 2px; }
.so-card .arrow { align-self: center; color: var(--info); }

/* Big action buttons (operator screen) */
.op-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.op-action {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 18px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  color: var(--ink);
  font-family: inherit;
  transition: transform 0.06s, border-color 0.12s, background 0.12s;
}
.op-action:hover { border-color: var(--accent); background: var(--surface-3); }
.op-action:active { transform: translateY(1px); }
.op-action .icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: var(--surface-3);
  display: grid; place-items: center;
  color: var(--accent);
}
.op-action.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.op-action.primary:hover { background: #FFDC60; }
.op-action.primary .icon { background: rgba(0,0,0,0.12); color: var(--accent-ink); }
.op-action .text { display: flex; flex-direction: column; gap: 2px; }
.op-action .title { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.op-action .sub { font-size: 12.5px; opacity: 0.75; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(8, 11, 16, 0.78);
  display: grid; place-items: center;
  z-index: 1000;
  padding: 24px;
  backdrop-filter: blur(4px);
}
.modal {
  width: 100%;
  max-width: 580px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}
.modal.wide { max-width: 760px; }
.modal > header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.modal > header h2 {
  margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.01em;
}
.modal > header .close {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: transparent; border: none; color: var(--ink-3); cursor: pointer;
  border-radius: 6px;
  font-size: 22px;
}
.modal > header .close:hover { background: var(--surface-2); color: var(--ink); }
.modal > .body { padding: 20px 22px; }
.modal > footer {
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: 10px;
  background: var(--surface-2);
}

.modal-summary {
  margin-bottom: 16px;
  padding: 12px;
  background: var(--surface-2);
  border-radius: 8px;
  border: 1px solid var(--line);
}
.modal-summary .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--ink-3);
}
.modal-summary .row {
  display: flex; gap: 12px; align-items: baseline; margin-top: 4px;
}
.modal-summary .id { font-family: var(--font-mono); font-weight: 700; font-size: 16px; }

/* Form */
.form-grid { display: grid; gap: 14px; }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-size: 12px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.form-row input, .form-row select {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
}
.form-row input:focus, .form-row select:focus { border-color: var(--accent); }
.form-row .hint { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.form-row .row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qty-stepper {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.qty-stepper button {
  background: var(--surface-2); border: none; color: var(--ink); cursor: pointer; font-size: 18px;
}
.qty-stepper button:hover { background: var(--surface-3); }
.qty-stepper input {
  background: var(--surface-2);
  border: none; border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  color: var(--ink); font-size: 16px; text-align: center; outline: none; padding: 12px;
  font-variant-numeric: tabular-nums; font-weight: 600;
  font-family: inherit;
}

/* Printer picker (Print modal) */
.printer-list { display: flex; flex-direction: column; gap: 8px; }
.printer-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 8px;
  cursor: pointer;
}
.printer-item.selected {
  border-color: var(--accent);
  background: rgba(255,210,63,0.06);
}
.printer-item.disabled { opacity: 0.5; cursor: not-allowed; }
.printer-item .meta { flex: 1; }
.printer-item .name { font-weight: 600; font-size: 14px; }
.printer-item .sub { color: var(--ink-3); font-size: 12px; margin-top: 2px; }

/* Login */
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.login-shell .left {
  background: linear-gradient(160deg, #161B22 0%, #0E1116 100%);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 48px;
  border-right: 1px solid var(--line);
}
.login-shell .right {
  background: var(--bg);
  display: grid; place-items: center;
  padding: 48px;
}
.login-card {
  width: 100%; max-width: 380px;
  display: flex; flex-direction: column; gap: 24px;
}
.login-card h1 { font-size: 30px; letter-spacing: -0.025em; margin: 0; font-weight: 700; }
.login-card p { color: var(--ink-3); margin: 0; }
.ms-btn {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}
.ms-btn:hover { background: var(--surface-2); }

.brand-mark-large {
  display: flex; align-items: center; gap: 16px;
}
.brand-mark-large .mark {
  width: 56px; height: 56px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 12px;
  display: grid; place-items: center;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.04em;
}
.brand-mark-large .name {
  font-size: 22px; font-weight: 700; letter-spacing: -0.02em;
}
.brand-mark-large small {
  display: block;
  font-size: 12px; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 500;
}
.tagline {
  font-size: 36px;
  letter-spacing: -0.03em;
  font-weight: 700;
  line-height: 1.1;
}
.tagline span { color: var(--accent); }
.login-meta { color: var(--ink-3); font-size: 13px; }
.login-mid { flex: 1; display: flex; align-items: center; }

/* Empty state */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-3);
}
.empty svg { width: 40px; height: 40px; opacity: 0.5; margin-bottom: 8px; }

/* Machine grid */
.machine-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.machine-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.12s, background 0.12s;
  text-decoration: none;
  color: inherit;
}
.machine-card:hover { border-color: var(--accent); background: var(--surface-2); }
.machine-card header { display: flex; justify-content: space-between; align-items: flex-start; }
.machine-card .id { font-family: var(--font-mono); font-size: 16px; font-weight: 700; color: var(--ink); }
.machine-card .type { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.machine-card .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.machine-card .stat .lbl { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.machine-card .stat .val { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.machine-card .util-bar { height: 4px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.machine-card .util-bar > span { display: block; height: 100%; background: var(--ok); }
.machine-card.busy .util-bar > span { background: var(--accent); }
.machine-card.idle .util-bar > span { background: var(--ink-4); }

/* Cost grid */
.cost-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0; border-top: 1px solid var(--line); }
.cost-grid > div { padding: 16px 18px; border-right: 1px solid var(--line); }
.cost-grid > div:last-child { border-right: none; }
.cost-grid .lbl { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.cost-grid .val { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 4px; letter-spacing: -0.02em; }
.cost-grid .val.ok { color: var(--ok); }
.cost-grid .val.danger { color: var(--danger); }
.cost-grid .sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--ok-line);
  color: var(--ink);
  padding: 14px 18px;
  border-radius: 10px;
  display: flex; align-items: center; gap: 12px;
  z-index: 2000;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  animation: toastIn 0.25s ease;
}
.toast.error { border-color: var(--danger-line); }
.toast .icon { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--ok-bg); color: var(--ok); }
.toast.error .icon { background: var(--danger-bg); color: var(--danger); }
@keyframes toastIn {
  from { transform: translate(-50%, 30px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

/* Footer */
.foot {
  padding: 16px 32px;
  font-size: 12px;
  color: var(--ink-4);
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between;
  background: var(--surface);
}
.foot .mono { font-family: var(--font-mono); }

/* PDF modal — keep iframe styling for legacy fullscreen viewer */
#pdfFullscreenContainer { background-color: #000; position: fixed; inset: 0; z-index: 1500; }
.fullscreen-close {
  position: fixed;
  top: 1rem; right: 1rem;
  z-index: 2000;
  width: 3rem; height: 3rem;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
  font-size: 2rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
  transition: all 0.2s ease;
}
.fullscreen-close:hover {
  background-color: rgba(220, 53, 69, 0.9);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.1);
}
.fullscreen-loader {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: white;
  font-size: 1.2rem;
}
.fullscreen-pdf { width: 100%; height: 100%; border: none; }

/* Helpers */
.row { display: flex; align-items: center; gap: 8px; }
.spacer { flex: 1; }
.hr { height: 1px; background: var(--line); margin: 14px 0; }
.muted { color: var(--ink-3); }
.mono { font-family: var(--font-mono); }
.tnum { font-variant-numeric: tabular-nums; }
