/* DPMS design system — industrial / enterprise. Tokens first; components below. No external resources (CSP). */
:root {
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --r: 6px; --r-lg: 10px;
  --bg: #f3f5f8; --surface: #ffffff; --surface-2: #f8fafc; --surface-3: #eef2f6;
  --border: #d9e0e8; --border-strong: #b9c4d0;
  --text: #17212e; --text-2: #4a5a6c; --text-3: #738296;
  --primary: #12355b; --primary-2: #1d4f86; --primary-text: #ffffff; --primary-soft: #e4edf7;
  --accent: #d98e00; --accent-soft: #fdf1d8;
  --ok: #17794a; --ok-soft: #e0f3e8; --warn: #a65f00; --warn-soft: #fdeccf; --bad: #b3261e; --bad-soft: #fbe3e1; --info: #1d6fb8; --info-soft: #e1eefa;
  --focus: #1d6fb8; --shadow: 0 1px 2px rgba(16,32,52,.06), 0 2px 8px rgba(16,32,52,.06);
  --side-w: 244px; --top-h: 56px;
}
[data-theme="dark"] {
  --bg: #0e141b; --surface: #151d27; --surface-2: #1a2430; --surface-3: #202c3a;
  --border: #293647; --border-strong: #3a4b60;
  --text: #e6edf5; --text-2: #aab8c8; --text-3: #7f90a4;
  --primary: #5aa0e6; --primary-2: #7db6f0; --primary-text: #07121f; --primary-soft: #19324d;
  --accent: #f0b429; --accent-soft: #3a2d0c;
  --ok: #4cc38a; --ok-soft: #12301f; --warn: #f0b429; --warn-soft: #3a2d0c; --bad: #ff7b72; --bad-soft: #3c1816; --info: #6cb4f5; --info-soft: #13293f;
  --focus: #7db6f0; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 2px 10px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; line-height: 1.45; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 20px; } h2 { font-size: 16px; } h3 { font-size: 14px; }
a { color: var(--primary-2); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-3); } .mono { font-family: var(--mono); font-size: 12.5px; } .nowrap { white-space: nowrap; }
.right { text-align: right; } .center { text-align: center; }
.boot { height: 100vh; display: grid; place-items: center; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.noscript { padding: 24px; text-align: center; }

/* ---- shell ---- */
.shell { display: grid; grid-template-columns: var(--side-w) 1fr; grid-template-rows: var(--top-h) 1fr; height: 100vh; }
.shell > * { min-width: 0; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--primary); color: var(--primary-text); box-shadow: var(--shadow); z-index: 5; }
[data-theme="dark"] .topbar { background: var(--surface); color: var(--text); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .01em; min-width: calc(var(--side-w) - 16px); }
.brand img { width: 28px; height: 28px; border-radius: 6px; }
.brand small { display: block; font-weight: 400; opacity: .75; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.top-spacer { flex: 1; }
.top-meta { font-size: 12.5px; opacity: .9; text-align: right; line-height: 1.25; }
.icon-btn { background: transparent; border: 1px solid transparent; color: inherit; padding: 6px 10px; border-radius: var(--r); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.icon-btn:hover { background: rgba(255,255,255,.14); }
[data-theme="dark"] .icon-btn:hover { background: var(--surface-3); }
.icon-btn svg { width: 19px; height: 19px; flex: none; }
.menu-toggle { display: none; }
.side { background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto; padding: 12px 8px 24px; }
.nav-group { margin-top: 14px; }
.nav-group > .nav-title { padding: 4px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 600; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--r); color: var(--text-2); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--surface-3); color: var(--text); }
.nav a[aria-current="page"] { background: var(--primary-soft); color: var(--primary-2); font-weight: 650; }
.nav svg { width: 17px; height: 17px; flex: none; }
.main { overflow-y: auto; padding: 22px 26px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head p { margin: 2px 0 0; color: var(--text-3); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }

/* ---- cards / grid ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.card-h { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-b { padding: 16px; }
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-form { grid-template-columns: minmax(320px, 440px) minmax(0, 1fr); align-items: start; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--primary-2); border-radius: var(--r); padding: 12px 14px; box-shadow: var(--shadow); }
.kpi .v { font-size: 26px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }
.kpi.ok { border-left-color: var(--ok); } .kpi.bad { border-left-color: var(--bad); } .kpi.warn { border-left-color: var(--accent); }
.dept-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.dept { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--ok); border-radius: var(--r); padding: 12px 14px; }
.dept.hurdle { border-left-color: var(--bad); } .dept.idle { border-left-color: var(--border-strong); } .dept.below { border-left-color: var(--accent); }
.dept h3 { display: flex; justify-content: space-between; gap: 8px; }
.dept .big { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bar { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--ok); border-radius: 99px; transition: width .4s; }
.bar.warn > i { background: var(--accent); } .bar.bad > i { background: var(--bad); }

/* ---- forms ---- */
label { display: block; font-weight: 600; font-size: 12.5px; color: var(--text-2); margin-bottom: 4px; }
.field { margin-bottom: 12px; min-width: 0; }
.field .hint { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.field .err { font-size: 12px; color: var(--bad); margin-top: 3px; font-weight: 600; }
input:not([type]), input[type=text], input[type=password], input[type=number], input[type=date], input[type=time], input[type=email], input[type=search], input[type=tel], input[type=url], select, textarea {
  width: 100%; padding: 8px 10px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r); min-height: 36px;
}
textarea { min-height: 72px; resize: vertical; }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-3); color: var(--text-3); }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--bad); }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); }
.check input { width: 16px; height: 16px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: var(--r); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-weight: 600; cursor: pointer; min-height: 36px; text-decoration: none; }
.btn:hover { background: var(--surface-3); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.btn.primary:hover { filter: brightness(1.12); background: var(--primary); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; } .btn.danger:hover { filter: brightness(1.1); background: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; } .btn.sm { padding: 4px 9px; min-height: 28px; font-size: 12.5px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.lg { min-height: 46px; font-size: 15px; width: 100%; }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
.t th { position: sticky; top: 0; background: var(--surface-2); text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); padding: 9px 12px; border-bottom: 1px solid var(--border-strong); white-space: nowrap; }
.t td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.t tbody tr:hover { background: var(--surface-2); }
.t td.num, .t th.num { text-align: right; font-variant-numeric: tabular-nums; }
.t tfoot td { font-weight: 700; background: var(--surface-2); }
.empty { padding: 36px 16px; text-align: center; color: var(--text-3); }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-top: 1px solid var(--border); color: var(--text-3); gap: 10px; flex-wrap: wrap; }

/* ---- badges / alerts ---- */
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 650; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: var(--warn); } .badge.info { background: var(--info-soft); color: var(--info); }
.alert { padding: 10px 14px; border-radius: var(--r); border: 1px solid; margin-bottom: 14px; display: block; line-height: 1.45; }
.alert.err { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.alert.ok { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.alert.warn { background: var(--warn-soft); border-color: var(--accent); color: var(--warn); }
.alert.info { background: var(--info-soft); border-color: var(--info); color: var(--info); }
.target-box { background: var(--primary-soft); border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px; margin-bottom: 12px; }
.target-box .big { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; padding: 9px 14px; cursor: pointer; font-weight: 600; color: var(--text-3); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--primary-2); border-bottom-color: var(--primary-2); }

/* ---- modal / toast ---- */
.overlay { position: fixed; inset: 0; background: rgba(8,16,26,.55); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--surface); border-radius: var(--r-lg); width: min(680px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.modal.wide { width: min(980px, 100%); }
.modal-h { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-b { padding: 18px; overflow-y: auto; }
.modal-f { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 90; }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: var(--r); box-shadow: var(--shadow); max-width: 380px; font-weight: 500; }
.toast.ok { background: var(--ok); color: #fff; } .toast.err { background: var(--bad); color: #fff; }

/* ---- login ---- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: linear-gradient(160deg, #0d2a49, #1d4f86 60%, #25619f); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.login-art h1 { font-size: 30px; line-height: 1.15; margin: 0 0 12px; } .login-art p { max-width: 460px; opacity: .85; }
.login-art .tag { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; opacity: .7; }
.login-panel { display: grid; place-items: center; padding: 32px; background: var(--bg); }
.login-card { width: min(400px, 100%); }
.login-theme { position: absolute; top: 14px; right: 16px; }

/* ---- wall display ---- */
.wall { background: #070c12; color: #e8eef6; height: 100vh; display: grid; grid-template-rows: auto auto 1fr auto; overflow: hidden; font-size: 17px; --surface: #0f1722; --surface-2: #131d2a; --surface-3: #1a2636; --border: #223044; --text: #e8eef6; --text-3: #8a9bb0; --ok: #3ddc97; --bad: #ff6b6b; --accent: #f5b83d; }
.wall-top { display: flex; align-items: center; gap: 24px; padding: 14px 28px; background: #0c1520; border-bottom: 1px solid #1c2a3c; }
.wall-top .co { font-size: 24px; font-weight: 700; } .wall-top .loc { color: var(--accent); font-weight: 650; }
.wall-clock { margin-left: auto; text-align: right; font-variant-numeric: tabular-nums; } .wall-clock b { font-size: 34px; display: block; line-height: 1; }
.live { color: var(--ok); font-weight: 650; } .live::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); margin-right: 6px; animation: pulse 1.6s infinite; } .live.stale { color: var(--bad); } .live.stale::before { background: var(--bad); animation: none; }
@keyframes pulse { 50% { opacity: .25; } }
.wall-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; padding: 14px 28px; }
.wall-kpis .kpi { background: var(--surface); border-color: var(--border); } .wall-kpis .kpi .v { font-size: 34px; }
.wall-body { padding: 0 28px 10px; overflow: hidden; position: relative; }
.slide { position: absolute; inset: 0 28px 10px; opacity: 0; pointer-events: none; transition: opacity .6s; overflow: hidden; }
.slide.on { opacity: 1; pointer-events: auto; }
.wall .dept { background: var(--surface); } .wall .t th { background: var(--surface-2); } .wall .t td { border-color: var(--border); font-size: 16px; }
.wall-cols { display: grid; gap: 16px; height: 100%; align-content: start; } .wall-col h2, .slide > h2 { margin: 0 0 8px; color: var(--accent); font-size: 20px; }
.wall-overview { grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); } .wall-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wall .dept-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } .wall-kpis { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
@media (max-width: 1100px) { .wall-overview, .wall-two { grid-template-columns: 1fr; } .wall { font-size: 15px; } }
.wall-bottom { display: flex; align-items: center; gap: 14px; padding: 10px 28px; background: #0c1520; border-top: 1px solid #1c2a3c; overflow: hidden; }
.ticker { overflow: hidden; white-space: nowrap; flex: 1; } .ticker-in { display: inline-block; padding-left: 100%; animation: tick var(--tick-dur, 60s) linear infinite; } @keyframes tick { to { transform: translateX(-100%); } }
.ticker .it { margin-right: 44px; } .it.hurdle { color: var(--bad); } .it.mat { color: var(--accent); } .it.prod { color: var(--ok); } .it.disp { color: #6cb4f5; }
.dots { display: flex; gap: 6px; } .dots i { width: 9px; height: 9px; border-radius: 50%; background: #2a3a50; } .dots i.on { background: var(--accent); }
.wall-ctl { position: fixed; top: 0; left: 0; right: 0; background: rgba(8,14,22,.96); padding: 10px 20px; display: flex; gap: 14px; align-items: center; transform: translateY(-100%); transition: transform .2s; z-index: 20; flex-wrap: wrap; font-size: 14px; }
.wall-hot { position: fixed; top: 0; left: 0; right: 0; height: 14px; z-index: 19; } .wall-hot:hover + .wall-ctl, .wall-ctl:hover, .wall-ctl:focus-within { transform: none; }
.wall .btn { background: #1a2636; border-color: #2c3d54; color: #e8eef6; } .wall select, .wall input { background: #0f1722; color: #e8eef6; border-color: #2c3d54; width: auto; }

.grid > *, .row > * { min-width: 0; } select, input, textarea { min-width: 0; max-width: 100%; }
@media (max-width: 1320px) { .lg-stack { grid-template-columns: minmax(0, 1fr); } .g-form { grid-template-columns: minmax(0, 1fr); } .g-form > .card:first-child { max-width: 720px; } }
@media (max-width: 1000px) { .g-2, .g-3 { grid-template-columns: minmax(0, 1fr); } .login { grid-template-columns: 1fr; } .login-art { display: none; } }
.mono { white-space: nowrap; }
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .menu-toggle { display: inline-flex; }
  .side { position: fixed; top: var(--top-h); bottom: 0; left: 0; width: 270px; transform: translateX(-100%); transition: transform .2s; z-index: 30; box-shadow: var(--shadow); }
  .shell.nav-open .side { transform: none; }
  .brand { min-width: 0; } .brand small, .top-meta { display: none; } .main { padding: 14px 12px 60px; }
}
@media print {
  .topbar, .side, .toolbar, .no-print, .pager, .toasts { display: none !important; }
  .shell { display: block; height: auto; } .main { overflow: visible; padding: 0; } body { background: #fff; color: #000; }
  .card { box-shadow: none; border-color: #999; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* utilities (the CSP forbids inline style attributes) */
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 16px; } .mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 16px; } .m0 { margin: 0; }
.span-all { grid-column: 1 / -1; } .boot-sm { height: 200px; display: grid; place-items: center; } .flex { display: flex; gap: 10px; align-items: center; } .flex-wrap { flex-wrap: wrap; } .grow { flex: 1; } .gap-2 { gap: 8px; }
.w-sm { width: 140px; } .w-md { width: 200px; } .w-lg { width: 280px; } .fs-lg { font-size: 15px; } .pre { white-space: pre-wrap; word-break: break-word; } .scroll-y { max-height: 360px; overflow-y: auto; }

/* ---- Urdu / RTL ---- */
@font-face { font-family: "Noto Naskh Arabic"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/assets/fonts/NotoNaskhArabic-arabic.woff2) format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
:root[lang="ur"] body { font-family: "Noto Naskh Arabic", "Segoe UI", system-ui, sans-serif; line-height: 1.7; }
[dir="rtl"] .side { border-right: 0; border-left: 1px solid var(--border); }
[dir="rtl"] .t th { text-align: right; } [dir="rtl"] .t td.num, [dir="rtl"] .t th.num { text-align: left; }
[dir="rtl"] .toasts { right: auto; left: 16px; } [dir="rtl"] .top-meta { text-align: left; }
[dir="rtl"] .wall, [dir="rtl"] .wall * { direction: ltr; }
.lang-btn { font-weight: 700; }

/* ---- simple (picture) entry wizard: big touch targets ---- */
.wiz { max-width: 1180px; margin: 0 auto; }
.wiz-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.wiz-top .btn { min-height: 56px; font-size: 18px; padding: 10px 22px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 18px; font-weight: 600; flex: 1; min-width: 0; }
.crumbs button { background: var(--primary-soft); color: var(--primary-2); border: 0; border-radius: 99px; padding: 10px 18px; font-size: 17px; font-weight: 700; cursor: pointer; min-height: 44px; }
.crumbs span.sep { color: var(--text-3); }
.wiz h1 { font-size: 28px; margin-bottom: 14px; }
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.pcard { display: flex; flex-direction: column; background: var(--surface); border: 3px solid var(--border); border-radius: 18px; overflow: hidden; cursor: pointer; padding: 0; text-align: center; color: var(--text); box-shadow: var(--shadow); transition: transform .08s, border-color .08s; min-height: 250px; }
.pcard:hover, .pcard:focus-visible { border-color: var(--primary-2); transform: translateY(-2px); }
.pcard:active { transform: scale(.98); }
.pimg { aspect-ratio: 4 / 3; background: var(--surface-3); display: grid; place-items: center; overflow: hidden; }
.pimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pimg.ph { background: var(--surface-3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' fill='none' stroke='%239aa9bb' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 20l24-12 24 12v24L32 56 8 44z'/%3E%3Cpath d='M8 20l24 12 24-12M32 32v24'/%3E%3C/svg%3E") center / 34% no-repeat; }
.plabel { font-size: 22px; font-weight: 700; padding: 12px 12px 2px; line-height: 1.25; }
.psub { color: var(--text-3); font-size: 16px; padding: 0 12px 14px; }
.wiz-entry { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 24px; align-items: start; }
.wiz-photo .pimg { border-radius: 18px; border: 3px solid var(--border); aspect-ratio: 4 / 3; }
.wiz-photo h2 { font-size: 26px; margin: 12px 0 2px; } .wiz-photo .partno { font-size: 20px; color: var(--text-3); font-family: var(--mono); }
.wbox { background: var(--surface); border: 2px solid var(--border); border-radius: 18px; padding: 18px; margin-bottom: 16px; }
.wbox h3 { font-size: 18px; margin-bottom: 10px; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { border: 3px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: 14px; padding: 12px 20px; font-size: 20px; font-weight: 700; cursor: pointer; min-height: 60px; }
.chip small { display: block; font-size: 14px; font-weight: 500; color: var(--text-3); }
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--primary-text); } .chip[aria-pressed="true"] small { color: inherit; opacity: .85; }
.target-big { background: var(--primary-soft); border: 3px solid var(--primary-2); border-radius: 18px; padding: 16px 20px; margin-bottom: 16px; }
.target-big .tv { font-size: 46px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stepper { display: grid; grid-template-columns: 60px minmax(0, 1fr) 60px; gap: 8px; align-items: stretch; }
.stepper button { font-size: 38px; font-weight: 800; border: 3px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: 18px; cursor: pointer; min-height: 80px; line-height: 1; padding: 0; }
.stepper button:active { background: var(--surface-3); }
.stepper input { font-size: 40px; font-weight: 800; text-align: center; border: 3px solid var(--border-strong); border-radius: 18px; min-height: 80px; width: 100%; min-width: 0; padding: 0 2px; -moz-appearance: textfield; appearance: textfield; font-variant-numeric: tabular-nums; }
.stepper.rej input, .stepper.rej button { border-color: var(--bad); }
.quick { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; } .quick button { flex: 1; min-width: 70px; min-height: 54px; font-size: 20px; font-weight: 700; border: 2px solid var(--border-strong); background: var(--surface-2); color: var(--text); border-radius: 14px; cursor: pointer; }
.btn-save { width: 100%; min-height: 84px; font-size: 30px; font-weight: 800; letter-spacing: .04em; background: #138a4d; border: 0; color: #fff; border-radius: 18px; cursor: pointer; box-shadow: var(--shadow); }
.btn-save:disabled { opacity: .6; } .btn-save:active { filter: brightness(.9); }
.btn-stop { width: 100%; min-height: 72px; font-size: 26px; font-weight: 800; background: #c62828; border: 0; color: #fff; border-radius: 18px; cursor: pointer; letter-spacing: .03em; }
.btn-resume { min-height: 64px; font-size: 24px; font-weight: 800; background: #138a4d; border: 0; color: #fff; border-radius: 16px; cursor: pointer; padding: 0 28px; }
.stopbanner { background: #c62828; color: #fff; border-radius: 18px; padding: 16px 20px; margin-bottom: 16px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; animation: stopflash 1.6s infinite; }
.stopbanner .big { font-size: 26px; font-weight: 800; flex: 1; min-width: 220px; }
@keyframes stopflash { 50% { background: #a31515; } }
.wremarks.need textarea { border-color: var(--bad); border-width: 3px; } .wremarks textarea { font-size: 20px; min-height: 110px; }
.rcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.rcard { border: 3px solid var(--border-strong); background: var(--surface); border-radius: 18px; padding: 16px 10px; cursor: pointer; font-size: 20px; font-weight: 700; color: var(--text); min-height: 130px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; }
.rcard svg { width: 54px; height: 54px; } .rcard[aria-pressed="true"] { background: #c62828; border-color: #c62828; color: #fff; }
.donecard { text-align: center; max-width: 560px; margin: 24px auto; } .donecard .tick { font-size: 90px; color: #138a4d; line-height: 1; } .donecard .pimg { max-width: 340px; margin: 0 auto 14px; border-radius: 18px; }
.donecard .row-btns { display: grid; gap: 14px; margin-top: 20px; } .donecard .btn { min-height: 64px; font-size: 20px; }
.alertcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-bottom: 18px; }
.alertcard { background: #c62828; color: #fff; border-radius: 14px; padding: 14px 16px; animation: stopflash 1.6s infinite; } .alertcard b { font-size: 20px; } .alertcard .dur { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .wiz-entry { grid-template-columns: minmax(0, 1fr); } .wiz-photo .pimg { max-width: 360px; } .stepper { grid-template-columns: 64px minmax(0, 1fr) 64px; } .stepper input { font-size: 46px; } }.thumb { width: 48px; height: 36px; object-fit: cover; border-radius: 6px; display: inline-block; vertical-align: middle; background: var(--surface-3); } .thumb.ph { border: 1px dashed var(--border-strong); }
.icon-s { display: inline-block; width: 28px; height: 28px; color: var(--bad); } .icon-s svg { width: 28px; height: 28px; }
.alertcard .muted-inv { opacity: .85; font-size: 14px; } .pimg.w-md { width: 160px; }

/* modal: the form must be the scrolling flex column so long dialogs keep header/footer visible and the body scrolls */
.modal > form { display: flex; flex-direction: column; min-height: 0; max-height: calc(100vh - 32px); }
.modal-b { min-height: 0; overflow-y: auto; }
.modal-h, .modal-f { flex: none; }

/* show the whole picture, never crop the part */
.pimg img { object-fit: contain; background: #fff; }
.thumb { object-fit: contain; background: #fff; }

/* ---- wall display v2: plain words, big type, traffic-light colours ---- */
.wall { font-size: clamp(11px, min(1.15vw, 2vh), 30px); --ok: #34d399; --warn: #fbbf24; --bad: #ff5d5d; --idle: #8a9bb0; }
.wall .co { font-size: 1.7em; } .wall-clock b { font-size: 2.3em; }
.wall-banner { margin: 0 28px 12px; padding: .55em 1em; border-radius: 14px; font-size: 1.45em; font-weight: 600; border: 3px solid; }
.wall-banner.ok { background: #062e22; border-color: var(--ok); color: #b6f5dc; } .wall-banner.warn { background: #3a2a05; border-color: var(--warn); color: #ffe7a3; }
.wall-banner.bad { background: #5a0f0f; border-color: var(--bad); color: #fff; animation: stopflash 1.6s infinite; } .wall-banner b { font-weight: 800; }
.wall-kpis { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding-top: 0; } .wall-kpis .kpi .v { font-size: 2.3em; } .wall-kpis .kpi .l { font-size: 1em; text-transform: none; letter-spacing: 0; }
.wall .wall-body h2 { font-size: 1.5em; margin: 0 0 .5em; color: #fff; } .wall .bad-t, .bad-t { color: var(--bad); } .ok-t { color: var(--ok); } .warn-t { color: var(--warn); }
.wcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22em), 1fr)); gap: 16px; }
.wcard { background: var(--surface); border: 3px solid var(--border); border-left-width: 14px; border-radius: 16px; padding: 14px 18px; }
.wcard.ok { border-color: var(--ok); } .wcard.warn { border-color: var(--warn); } .wcard.bad { border-color: var(--bad); } .wcard.idle { border-color: #3a4a60; }
.wcard.solid { background: #b71c1c; border-color: #ff8a80; color: #fff; animation: stopflash 1.6s infinite; }
.wc-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.wc-name { font-size: 1.35em; font-weight: 800; line-height: 1.15; }
.wc-pill { font-size: .85em; font-weight: 800; padding: .2em .7em; border-radius: 99px; white-space: nowrap; }
.wc-pill.ok { background: var(--ok); color: #04261c; } .wc-pill.warn { background: var(--warn); color: #2b1d00; } .wc-pill.bad { background: var(--bad); color: #fff; } .wc-pill.idle { background: #3a4a60; color: #dbe5f1; } .wc-pill.solid { background: #fff; color: #b71c1c; }
.wc-num { font-size: 3em; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; } .wc-num small { font-size: .38em; font-weight: 500; color: var(--text-3); }
.wc-line { margin-top: .35em; color: #cfd9e6; } .wc-reason { font-size: 1.8em; font-weight: 800; margin: .2em 0; } .wc-dur { font-size: 3em; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.bar.big { height: 16px; } .bar.bad > i { background: var(--bad); } .bar.idle > i { background: #3a4a60; }
.wparts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 26em), 1fr)); gap: 16px; }
.wpart { display: flex; gap: 14px; background: var(--surface); border: 2px solid var(--border); border-radius: 16px; padding: 12px; align-items: flex-start; }
.wpart .pimg { width: 9em; flex: none; border-radius: 12px; border: 0; } .wp-body { flex: 1; min-width: 0; } .wp-row { display: flex; justify-content: space-between; gap: 8px; margin-top: .5em; font-size: .9em; }
.wfeed { display: grid; gap: 10px; } .wf { display: flex; gap: 16px; background: var(--surface); border: 2px solid var(--border); border-radius: 14px; padding: 12px 16px; font-size: 1.1em; align-items: flex-start; }
.wf.bad { border-color: var(--bad); } .wf .ft { flex: none; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--accent); min-width: 3.4em; } .wf .fb { flex: 1; }
.legend { display: flex; gap: 18px; font-size: .8em; white-space: nowrap; } .legend .lg.ok { color: var(--ok); } .legend .lg.warn { color: var(--warn); } .legend .lg.bad { color: var(--bad); } .legend .lg.idle { color: var(--idle); }
.wall .wall-overview { grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); }
@media (max-width: 1100px) { .wall-kpis { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); } .legend { display: none; } }
.wall { grid-template-rows: auto auto auto 1fr auto; }
.wall-body { min-height: 0; }
/* light theme for the wall display (control bar -> "Light theme"); stoppage cards stay solid red so they are still seen from afar */
.wall.light { background: #f1f5f9; color: #0f172a; --surface: #ffffff; --surface-2: #eef2f7; --surface-3: #dbe3ee; --border: #c3cfdd; --text: #0f172a; --text-3: #475569; --ok: #059669; --warn: #d97706; --bad: #dc2626; --accent: #b45309; --idle: #64748b; }
.wall.light .wall-top, .wall.light .wall-bottom { background: #ffffff; border-color: #c3cfdd; }
.wall.light .wall-banner.ok { background: #dcfce7; color: #14532d; } .wall.light .wall-banner.warn { background: #fef3c7; color: #78350f; } .wall.light .wall-banner.bad { background: #dc2626; color: #fff; }
.wall.light .wall-body h2, .wall.light .slide > h2 { color: #0f172a; } .wall.light .wall-col h2 { color: #b45309; }
.wall.light .wc-line { color: #334155; } .wall.light .wc-pill.ok, .wall.light .wc-pill.warn, .wall.light .wc-pill.bad { color: #fff; } .wall.light .wc-pill.idle { background: #cbd5e1; color: #334155; }
.wall.light .wcard.idle { border-color: #b6c2d1; } .wall.light .bar.idle > i { background: #94a3b8; } .wall.light .dots i { background: #c3cfdd; } .wall.light .dots i.on { background: #b45309; }
.wall.light .it.disp { color: #1d4ed8; } .wall.light .wall-kpis .kpi { box-shadow: none; }
.wall.light .wall-ctl { background: rgba(255, 255, 255, .97); border-bottom: 1px solid #c3cfdd; }
.wall.light .btn { background: #e2e8f0; border-color: #c3cfdd; color: #0f172a; } .wall.light select, .wall.light input { background: #fff; color: #0f172a; border-color: #c3cfdd; }
/* short screens (laptop, browser window with tabs): tighter spacing so nothing is cut off at the bottom */
@media (max-height: 800px) {
  .wall-top { padding: 8px 28px; } .wall-banner { margin-bottom: 8px; padding: .3em .9em; font-size: 1.25em; } .wall-kpis { padding-bottom: 8px; gap: 8px; } .wall-kpis .kpi { padding: 6px 10px; }
  .wcard { padding: 8px 14px; } .wc-num { font-size: 2.2em; } .wcards { gap: 10px; } .wall-bottom { padding: 6px 28px; }
}

/* balance pill on the picture cards: how many can be entered now */
.avpill { margin-top: 8px; border-radius: 10px; padding: 6px 4px; text-align: center; }
.avpill strong { display: block; font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.avpill span { font-size: .8rem; }
.avpill.go { background: var(--ok-soft); color: var(--ok); } .avpill.stop { background: var(--surface-2, #f1f3f5); color: var(--text-2, #5b6674); } .avpill.low { background: var(--warn-soft); color: var(--warn); }


/* rows of assemblies that are shipped to customers */
tr.row-dispatch td { background: var(--ok-soft); } tr.row-dispatch td:first-child { box-shadow: inset 4px 0 0 var(--ok); }

/* pieces waiting at the next operation */
.pcard.hot { outline: 3px solid var(--ok); background: var(--ok-soft); }
.avnext { margin-top: 6px; padding: 5px 6px; border-radius: 8px; background: var(--ok-soft); color: var(--ok); font-size: .85rem; text-align: center; }
.nextbox { background: var(--ok-soft); border-radius: 12px; padding: 12px; text-align: center; }

.nav-version { padding: 14px 16px 18px; font-size: 12px; color: var(--muted, #6b7785); opacity: .85; }
.qr { display: flex; justify-content: center; margin: 8px 0; } .qr svg { max-width: 220px; height: auto; background: #fff; padding: 4px; border-radius: 8px; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
/* native controls follow the app theme, not the operating-system theme (dark-mode PCs showed black boxes and an invisible calendar icon on the light theme) */
:root { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }

/* ---- GRN sheet (laser parts received back): full-page form, printable / "Save as PDF" */
.sheet-overlay { position: fixed; inset: 0; z-index: 900; background: #e5e9f0; overflow: auto; padding: 12px; color: #111; color-scheme: light; }
.sheet-bar { max-width: 1000px; margin: 0 auto 10px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sheet { max-width: 1000px; margin: 0 auto; background: #fff; padding: 18px 22px; border: 1px solid #aaa; font-size: 14px; }
.sheet-head { display: flex; justify-content: space-between; gap: 16px; border-bottom: 3px solid #0f3057; padding-bottom: 8px; margin-bottom: 10px; }
.sheet-co { font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: #0f3057; } .sheet h1 { font-size: 24px; margin: 2px 0; }
.sheet-no { min-width: 210px; font-size: 12px; } .sheet-box { border: 1.5px solid #333; height: 30px; margin: 2px 0 6px; }
.sheet input.sheet-in, .sheet-no input { width: 100%; min-height: 36px; border: 1.5px solid #555; border-radius: 3px; padding: 2px 6px; background: #fff; color: #000; font: inherit; }
.sheet-meta, .sheet-t { width: 100%; border-collapse: collapse; margin-bottom: 10px; } .sheet-meta td { border: 1px solid #999; padding: 5px 8px; }
.sheet-t th, .sheet-t td { border: 1.5px solid #333; padding: 4px 6px; vertical-align: middle; } .sheet-t th { background: #e8edf5; font-size: 12px; text-align: center; }
.sheet-t td.n, .sheet-t input.n { text-align: center; } .sheet-pic { width: 92px; text-align: center; } .sheet-pic img { width: 84px; height: 64px; object-fit: contain; }
.sheet-t tbody tr { height: 74px; } .sheet-note { font-size: 12px; color: #333; } .sheet-sign { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 34px; text-align: center; font-size: 12px; }
.sheet-line { border-bottom: 1.5px solid #111; height: 34px; margin-bottom: 4px; }
@media print {
  body.sheet-open > *:not(.sheet-overlay) { display: none !important; }
  body.sheet-open .sheet-overlay { position: static; inset: auto; padding: 0; background: #fff; overflow: visible; }
  .sheet { border: 0; padding: 0; max-width: none; }
  .sheet-t tr { page-break-inside: avoid; }
}
.sheet { page: grnsheet; }
@page grnsheet { size: A4 landscape; margin: 10mm; }
.sheet-office { margin-top: 18px; border: 1.5px dashed #555; padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 8px 26px; font-size: 12px; }
@media print { .sheet { font-size: 12px; } .sheet-t tbody tr { height: 54px; } .sheet-pic { width: 76px; } .sheet-pic img { width: 68px; height: 48px; } .sheet h1 { font-size: 20px; } .sheet-sign { margin-top: 18px; } .sheet-sign .sheet-line { height: 22px; } .sheet-office { margin-top: 10px; } .sheet input.sheet-in { min-height: 30px; } .sheet-box { height: 24px; } .sheet-meta td { padding: 3px 6px; } }
.keybox { border: 2px dashed var(--border-strong); border-radius: 12px; padding: 14px 18px; font-size: 22px; font-weight: 700; letter-spacing: 1px; line-height: 1.7; margin: 10px 0; background: var(--surface-3); user-select: all; }
.step-row { padding: 4px 0; }
