/* InPhase RTC - Reactor Test Report System
   Brand: dark green #153335, gradient #39A7F6 -> #00E09D -> #009672, Inter */
:root {
  --brand: #153335;
  --brand-2: #1f4a4d;
  --blue: #1971B1;
  --grad: linear-gradient(90deg, #39A7F6 0%, #00E09D 60%, #009672 100%);
  --bg: #f3f5f7;
  --card: #ffffff;
  --ink: #17212b;
  --muted: #5d6b78;
  --line: #dde3e9;
  --line-2: #eef1f4;
  --pass-bg: #dcfce7; --pass: #11743b;
  --fail-bg: #fee2e2; --fail: #b3261e;
  --warn-bg: #fff4d6; --warn: #8a5a00;
  --info-bg: #e3f1fc;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --font: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", Consolas, "Courier New", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); font-size: 14px; color: var(--ink); background: var(--bg); line-height: 1.45; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 20px; } h2 { font-size: 16px; } h3 { font-size: 14px; }
small, .muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }

/* ---------- top bar ---------- */
.topbar { background: var(--brand); color: #fff; position: sticky; top: 0; z-index: 50; }
.topbar::after { content: ""; display: block; height: 3px; background: var(--grad); }
.topbar .inner { display: flex; align-items: center; gap: 18px; max-width: 1360px; margin: 0 auto; padding: 0 20px; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 13px; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 30px; height: 30px; border-radius: 7px; background: var(--grad); display: grid; place-items: center; color: var(--brand); font-weight: 800; letter-spacing: 0; font-size: 13px; }
.brand small { color: #9fc3c0; font-weight: 500; letter-spacing: .02em; text-transform: none; display: block; font-size: 11px; }
.nav { display: flex; gap: 4px; margin-left: 12px; }
.nav a { color: #cfe3e1; padding: 7px 12px; border-radius: 6px; font-weight: 500; }
.nav a:hover, .nav a.active { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.userchip { display: flex; align-items: center; gap: 8px; color: #e6f1f0; font-size: 13px; }
.userchip .role { font-size: 11px; padding: 2px 7px; border-radius: 10px; background: rgba(255,255,255,.12); }

/* ---------- notification bell ---------- */
.bell { position: relative; }
.bell > button { background: transparent; border: 0; color: #fff; cursor: pointer; padding: 8px; border-radius: 6px; display: grid; place-items: center; }
.bell > button:hover { background: rgba(255,255,255,.1); }
.bell .badge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #ef4444; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.notif-panel { position: absolute; right: 0; top: 44px; width: 380px; max-height: 460px; overflow: auto; background: #fff; color: var(--ink); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.18); border: 1px solid var(--line); }
.notif-panel header { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; }
.notif-panel .grp { padding: 6px 14px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; background: var(--line-2); }
.notif-item { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line-2); color: var(--ink); cursor: pointer; }
.notif-item:hover { background: var(--info-bg); text-decoration: none; }
.notif-item.unread { border-left: 3px solid var(--blue); }
.notif-item .t { font-size: 11px; color: var(--muted); margin-top: 2px; }
.notif-empty { padding: 18px 14px; color: var(--muted); text-align: center; }

/* ---------- layout ---------- */
.page { max-width: 1360px; margin: 0 auto; padding: 20px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; }
.card .hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card .hd h2 { display: flex; align-items: center; gap: 10px; }
.card .hd h2 .num { width: 24px; height: 24px; border-radius: 6px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 12px; }
.card .bd { padding: 16px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1000px) { .g4, .g6 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .g2, .g3, .g4, .g6 { grid-template-columns: 1fr; } .nav { display: none; } .page { padding: 12px; } }

/* ---------- forms ---------- */
label.f { display: block; }
label.f > span { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=email], input[type=month], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid #c9d2db; border-radius: 6px; padding: 8px 10px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(25,113,177,.15); }
input[readonly], input:disabled, select:disabled, textarea:disabled { background: #f5f7f9; color: #4a5560; }
input.invalid { border-color: var(--fail); box-shadow: 0 0 0 3px rgba(179,38,30,.12); }
textarea { resize: vertical; min-height: 70px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.counter { font-family: var(--mono); font-size: 11px; color: var(--muted); float: right; }
.counter.ok { color: var(--pass); } .counter.bad { color: var(--fail); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; font-size: 13px; padding: 8px 14px; border-radius: 6px; border: 1px solid #c9d2db; background: #fff; color: var(--ink); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: #f2f5f8; text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.green { background: #0d8a4a; border-color: #0d8a4a; color: #fff; }
.btn.danger { background: #fff; border-color: #e9b7b3; color: var(--fail); }
.btn.danger:hover { background: var(--fail-bg); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th { text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #f8fafb; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.tbl tr:hover td { background: #fafcfd; }
table.tbl td.c, table.tbl th.c { text-align: center; }
table.tbl td.r, table.tbl th.r { text-align: right; }
table.tbl input, table.tbl select { padding: 6px 8px; }
table.tbl tr.row-pass td { background: var(--pass-bg) !important; }
table.tbl tr.row-fail td { background: var(--fail-bg) !important; }
.empty-row td { text-align: center; color: var(--muted); padding: 28px !important; }

/* ---------- pills / status ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 650; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-Draft { background: #eef1f4; color: #4a5560; }
.st-Pending { background: var(--warn-bg); color: var(--warn); }
.st-Approved { background: var(--pass-bg); color: var(--pass); }
.st-Returned { background: var(--fail-bg); color: var(--fail); }
.res { font-weight: 700; font-size: 12px; letter-spacing: .03em; }
.res.PASS { color: var(--pass); } .res.FAIL { color: var(--fail); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 8px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 11px 14px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button.active { color: var(--brand); border-bottom-color: #00b885; }
.tabs .cnt { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 10px; background: var(--line-2); font-size: 11px; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.stat .k { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.stat .v { font-size: 24px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }

/* ---------- meter panel ---------- */
.meter { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 16px; background: #0f2627; color: #d9ecea; border-radius: var(--radius); margin-bottom: 14px; }
.meter .dot { width: 10px; height: 10px; border-radius: 50%; background: #6b7c7b; }
.meter.on .dot { background: #00E09D; box-shadow: 0 0 0 4px rgba(0,224,157,.2); }
.meter .live { display: flex; gap: 18px; margin-left: auto; font-family: var(--mono); }
.meter .live b { color: #fff; font-size: 16px; }
.meter .live span { font-size: 11px; color: #8fb3b0; display: block; }
.meter select { width: auto; background: #173638; color: #fff; border-color: #2d5355; }
.meter .btn { border-color: #2d5355; background: #173638; color: #fff; }
.meter .btn:hover { background: #21474a; }
.meter .btn.go { background: #00b885; border-color: #00b885; color: #062b22; }

/* ---------- limits banner ---------- */
.limits { display: flex; gap: 22px; flex-wrap: wrap; background: var(--info-bg); border: 1px solid #c7e1f6; color: #0d4a75; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; font-size: 13px; }
.limits b { font-family: var(--mono); }

/* ---------- alerts / toast / modal ---------- */
.alert { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; font-size: 13px; }
.alert.warn { background: var(--warn-bg); color: var(--warn); border: 1px solid #f1dc9e; }
.alert.err { background: var(--fail-bg); color: var(--fail); border: 1px solid #f3c1bd; }
.alert.ok { background: var(--pass-bg); color: var(--pass); border: 1px solid #b7e7c7; }
.alert.info { background: var(--info-bg); color: #0d4a75; border: 1px solid #c7e1f6; }
#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { min-width: 260px; max-width: 420px; padding: 11px 14px; border-radius: 8px; background: #17212b; color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.2); font-size: 13px; animation: tin .2s ease-out; }
.toast.err { background: #8f1d17; } .toast.ok { background: #0d6b3a; } .toast.warn { background: #7a5200; }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-bg { position: fixed; inset: 0; background: rgba(10,20,25,.45); z-index: 150; display: grid; place-items: center; padding: 16px; }
.modal { background: #fff; border-radius: 10px; width: 100%; max-width: 520px; box-shadow: 0 20px 50px rgba(0,0,0,.25); max-height: 90vh; overflow: auto; }
.modal .hd { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal .bd { padding: 18px; }
.modal .ft { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- @mention dropdown ---------- */
.mention-box { position: absolute; z-index: 300; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 20px rgba(0,0,0,.15); min-width: 220px; max-height: 220px; overflow: auto; }
.mention-box div { padding: 7px 10px; cursor: pointer; font-size: 13px; }
.mention-box div b { font-family: var(--mono); }
.mention-box div.sel, .mention-box div:hover { background: var(--info-bg); }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-side { background: var(--brand); color: #e6f1f0; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-side::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: var(--grad); }
.login-side h1 { font-size: 34px; line-height: 1.15; color: #fff; margin-top: 18px; letter-spacing: -.02em; }
.login-side .tag { letter-spacing: .2em; text-transform: uppercase; font-size: 12px; color: #00E09D; font-weight: 700; }
.login-side ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 10px; color: #b9d4d1; }
.login-side li::before { content: "—"; color: #00E09D; margin-right: 10px; }
.login-form { display: grid; place-items: center; padding: 32px; }
.login-form form { width: 100%; max-width: 360px; }
.login-form h2 { font-size: 22px; margin-bottom: 4px; }
@media (max-width: 860px) { .login-wrap { grid-template-columns: 1fr; } .login-side { padding: 28px; } .login-side ul { display: none; } }

/* ---------- report sheet ---------- */
.sheet-status { display: flex; align-items: center; gap: 10px; }
.cp-desc { font-weight: 500; }
.cp-spec { font-size: 11.5px; color: var(--muted); }
.sig-prev { height: 34px; max-width: 120px; object-fit: contain; vertical-align: middle; }
.sticky-actions { position: sticky; bottom: 0; background: rgba(243,245,247,.94); backdrop-filter: blur(6px); border-top: 1px solid var(--line); padding: 12px 20px; margin: 0 -20px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; z-index: 20; }
.locked-note { display: flex; align-items: center; gap: 8px; }
.offline-flag { background: #7a5200; color: #fff; text-align: center; font-size: 12px; padding: 4px; }

@media print {
  .topbar, .sticky-actions, .meter, .btn, #toasts, .no-print { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #999; break-inside: avoid; }
}
.u { text-transform: none; }
@media (max-width: 640px) {
  .topbar .inner { padding: 0 12px; gap: 10px; }
  .brand small, .userchip > span:first-child, #pwBtn { display: none; }
  .notif-panel { position: fixed; left: 8px; right: 8px; top: 60px; width: auto; }
}

/* =====================================================================
   v2 APP SHELL  (sidebar + app bar) — matches the original lobby look
   ===================================================================== */
:root { --side-w: 236px; --side-mini: 68px; --navy: #0f172a; --navy-2: #1e293b; --act: #2563eb; --pri: #0b4aa8; --page: #f8fafc; }
body.app { background: var(--page); }
.side { position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: var(--navy); color: #cbd5e1; display: flex; flex-direction: column; z-index: 70; transition: width .2s ease, transform .2s ease; }
.side-logo { height: 64px; flex: 0 0 64px; background: #fff; display: flex; align-items: center; padding: 0 20px; border-bottom: 1px solid #e5e7eb; overflow: hidden; }
.side-logo:hover { text-decoration: none; }
.logo-img { height: 26px; width: auto; display: block; }
.side-logo .mark-only { display: none; width: 34px; height: 34px; border-radius: 8px; background: linear-gradient(135deg,#1971B1,#00b894); color: #fff; font-weight: 800; font-size: 13px; place-items: center; }
.side-nav { flex: 1; overflow-y: auto; padding: 14px 0; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 20px; margin: 1px 0; color: #cbd5e1; font-size: 13px; font-weight: 500; white-space: nowrap; border-left: 3px solid transparent; }
.side-nav a:hover { background: rgba(255,255,255,.05); color: #fff; text-decoration: none; }
.side-nav a.active { background: var(--act); color: #fff; border-left-color: #93c5fd; }
.side-nav .mi { width: 17px; height: 17px; flex: 0 0 17px; }
.side-nav a.active .mi { color: #fff !important; }
.side-nav .cnt { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--navy-2); color: #cbd5e1; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.side-nav a.active .cnt { background: #fff; color: var(--act); }
.side-group { padding: 18px 20px 6px; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: #64748b; font-weight: 700; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: #0b1222; border-top: 1px solid #1e293b; white-space: nowrap; overflow: hidden; }
.side-user .avatar { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; background: #2563eb; color: #fff; font-weight: 700; font-size: 12px; display: grid; place-items: center; }
.side-user b { display: block; color: #fff; font-size: 12.5px; }
.side-user small { display: block; color: #64748b; font-size: 11px; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.side-scrim { display: none; }

.main { margin-left: var(--side-w); min-height: 100vh; transition: margin-left .2s ease; }
.appbar { height: 64px; background: #fff; border-bottom: 1px solid #e5e7eb; display: flex; align-items: center; gap: 14px; padding: 0 22px; position: sticky; top: 0; z-index: 50; }
.appbar-title { font-size: 16px; font-weight: 700; color: #0f172a; }
.appbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: #475569; }
.appbar-right .who b { color: #0f172a; }
.appbar-right .sep { color: #cbd5e1; }
.appbar-right .today { color: #0f172a; font-variant-numeric: tabular-nums; }
.menu-toggle { width: 38px; height: 38px; border-radius: 8px; border: 1px solid #e2e8f0; background: #fff; color: #334155; display: grid; place-items: center; cursor: pointer; }
.menu-toggle:hover { background: #f1f5f9; }
.round-btn { width: 34px; height: 34px; border-radius: 50%; border: 0; background: #f1f5f9; color: #475569; display: grid; place-items: center; cursor: pointer; }
.round-btn:hover { background: #e2e8f0; }
.appbar .bell .badge { top: -3px; right: -4px; }
.appbar .notif-panel { top: 46px; }
.btn.outline { background: #fff; border-color: #e2e8f0; color: #334155; }

/* collapsed (desktop) */
.side-collapsed .side { width: var(--side-mini); }
.side-collapsed .main { margin-left: var(--side-mini); }
.side-collapsed .side .lbl, .side-collapsed .side .cnt, .side-collapsed .side-logo .logo-img { display: none; }
.side-collapsed .side-logo { justify-content: center; padding: 0; }
.side-collapsed .side-logo .mark-only { display: grid; }
.side-collapsed .side-nav a { justify-content: center; padding: 12px 0; position: relative; }
.side-collapsed .side-nav a .cnt { display: grid; position: absolute; top: 4px; right: 8px; min-width: 16px; height: 16px; font-size: 9.5px; padding: 0 4px; background: #2563eb; color: #fff; }
.side-collapsed .side-nav a .cnt[data-zero] { display: none; }
.side-collapsed .side-group { padding: 10px 0; border-top: 1px solid #1e293b; margin: 8px 12px 0; }
.side-collapsed .side-user { justify-content: center; padding: 14px 0; }

@media (max-width: 900px) {
  .side { transform: translateX(-100%); width: var(--side-w) !important; }
  .side-open .side { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  .side-open .side-scrim { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 65; }
  .main, .side-collapsed .main { margin-left: 0; }
  .side-collapsed .side .lbl, .side-collapsed .side .cnt, .side-collapsed .side-logo .logo-img { display: revert; }
  .side-collapsed .side-logo .mark-only { display: none; }
  .appbar { padding: 0 12px; gap: 10px; }
  .appbar-right .who, .appbar-right .sep, #pwBtn { display: none; }
  .appbar-title { font-size: 14px; }
}
@media (max-width: 520px) { .appbar-right .today { display: none; } }

/* ---------- lobby sections ---------- */
.content { padding: 20px 22px 40px; }
.sec { display: none; }
.sec.show { display: block; animation: secin .18s ease-out; }
@keyframes secin { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.panel { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; box-shadow: 0 1px 2px rgba(15,23,42,.04); margin-bottom: 18px; }
.panel-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid #eef2f6; flex-wrap: wrap; }
.panel-hd h2 { font-size: 14px; font-weight: 700; color: #0f172a; display: flex; align-items: center; gap: 10px; }
.panel-bd { padding: 16px 18px; }
.dot-count { min-width: 22px; height: 22px; border-radius: 11px; padding: 0 7px; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.dc-red { background: #ef4444; } .dc-amber { background: #92400e; } .dc-teal { background: #0891b2; } .dc-green { background: #047857; } .dc-blue { background: #2563eb; } .dc-gray { background: #64748b; }
.panel .tbl th { background: #f8fafc; text-transform: none; letter-spacing: 0; font-size: 12px; color: #334155; padding: 10px 12px; }
.panel .tbl td { padding: 11px 12px; font-size: 13px; }
.panel .tbl .rem-in { border-color: #d6dde5; padding: 6px 9px; font-size: 12.5px; }
.empty-msg td { text-align: center; color: #94a3b8; font-style: italic; padding: 26px !important; font-size: 12.5px; }
.serial { font-weight: 700; color: #0f172a; font-family: var(--mono); font-size: 12.5px; }
.act-col { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.act-row { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.tag-btn { font: 700 10.5px/1 var(--font); letter-spacing: .04em; text-transform: uppercase; padding: 5px 9px; border-radius: 4px; border: 1.5px solid; background: #fff; cursor: pointer; white-space: nowrap; text-decoration: none !important; display: inline-block; }
.tb-blue { color: #1d4ed8; border-color: #1d4ed8; background: #eff6ff; }
.tb-amber { color: #92400e; border-color: #f59e0b; background: #fffbeb; }
.tb-red { color: #b91c1c; border-color: #f87171; background: #fef2f2; }
.tb-green { color: #047857; border-color: #10b981; background: #ecfdf5; }
.tb-gray { color: #334155; border-color: #94a3b8; background: #f8fafc; }
.tb-orange { color: #fff; border-color: #f59e0b; background: #f59e0b; }
.tb-danger { color: #fff; border-color: #ef4444; background: #ef4444; }
.tag-btn:hover { filter: brightness(.96); }
.sbadge { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 4px; color: #fff; white-space: nowrap; }
.sb-Draft { background: #f59e0b; } .sb-Pending { background: #06b6d4; } .sb-Approved { background: #10b981; } .sb-Returned { background: #ef4444; }

/* dashboard */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi { border-radius: 10px; padding: 16px 18px; color: #fff; position: relative; min-height: 86px; box-shadow: 0 6px 16px -8px rgba(15,23,42,.35); cursor: pointer; transition: transform .15s; }
.kpi:hover { transform: translateY(-2px); }
.kpi .k { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .92; }
.kpi .v { font-size: 26px; font-weight: 800; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi svg { position: absolute; right: 16px; top: 18px; width: 26px; height: 26px; opacity: .9; }
.kpi-blue { background: linear-gradient(135deg, #1d4ed8, #3b82f6); }
.kpi-amber { background: linear-gradient(135deg, #f59e0b, #d97706); }
.kpi-teal { background: linear-gradient(135deg, #06b6d4, #0d9488); }
.kpi-green { background: linear-gradient(135deg, #10b981, #059669); }
.kpi-red { background: linear-gradient(135deg, #f43f5e, #dc2626); }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.new-card { border: 1.5px dashed #60a5fa; background: #eff6ff; border-radius: 10px; padding: 22px; text-align: center; }
.new-card h3 { font-size: 14px; color: #0f172a; } .new-card p { margin: 4px 0 14px; color: #475569; font-size: 12px; }
.btn.pri { background: var(--pri); border-color: var(--pri); color: #fff; width: 100%; padding: 10px; }
.btn.pri:hover { background: #093d8c; }
.btn.sky { background: #0ea5e9; border-color: #0ea5e9; color: #fff; width: 100%; padding: 10px; }
.btn.sky:hover { background: #0284c7; }
.btn.wide-blue { background: #2563eb; border-color: #2563eb; color: #fff; flex: 1; }
.extract-form { display: grid; grid-template-columns: 110px 1fr; gap: 10px 12px; align-items: center; font-size: 12.5px; font-weight: 600; color: #334155; }
.extract-form .full { grid-column: 1 / -1; }
.note-box { margin: 14px 18px 18px; padding: 10px 14px; background: #eff6ff; border: 1px solid #bfdbfe; border-left: 4px solid #2563eb; border-radius: 6px; font-size: 12px; color: #1e3a8a; }
.role-badge { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 4px; color: #fff; }
.rb-Admin { background: #2563eb; } .rb-Approver { background: #0ea5e9; } .rb-Inspector { background: #10b981; } .rb-Viewer { background: #64748b; }
.priv-on { color: #047857; font-weight: 600; } .priv-off { color: #64748b; }
.priv-on::before { content: "☑ "; color: #7c3aed; } .priv-off::before { content: "✕ "; color: #ef4444; font-weight: 700; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar input[type=text] { max-width: 260px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 760px) { .kpis { grid-template-columns: repeat(2, minmax(0,1fr)); } .dash-grid { grid-template-columns: 1fr; } .content { padding: 14px 12px 30px; } }

/* =====================================================================
   v2 LOGIN
   ===================================================================== */
.lg { min-height: 100vh; position: relative; overflow: hidden; background: linear-gradient(125deg, #0b7d8c 0%, #059a77 38%, #07c48a 70%, #10f0a8 100%); color: #08332d; display: grid; grid-template-columns: 1.15fr .85fr; }
.lg::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px); background-size: 34px 34px; pointer-events: none; }
.lg-left { position: relative; padding: 36px 6vw 28px; display: flex; flex-direction: column; }
.lg-logo { background: #fff; border-radius: 6px; padding: 14px 30px; display: inline-flex; align-self: flex-start; margin-left: 8vw; box-shadow: 0 10px 30px -12px rgba(0,0,0,.3); }
.lg-logo .logo-img { height: 40px; }
.lg-hero { margin: auto 0; text-align: center; padding: 40px 0; }
.lg-hero .shield { width: 34px; height: 34px; border-radius: 8px; background: rgba(255,255,255,.18); display: inline-grid; place-items: center; margin-bottom: 16px; }
.lg-hero h1 { font-size: 34px; font-weight: 800; color: #0b3a35; letter-spacing: -.02em; }
.lg-hero h2 { font-size: 18px; font-weight: 700; color: #0b3a35; margin-top: 6px; }
.lg-hero p { max-width: 420px; margin: 12px auto 22px; color: #11463f; font-size: 13px; }
.lg-art { width: 200px; height: 144px; margin: 0 auto; border-radius: 10px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); display: grid; place-items: center; }
.lg-feats { display: flex; justify-content: space-around; border-top: 1px solid rgba(255,255,255,.28); padding-top: 16px; font-size: 12px; font-weight: 600; color: #0b3a35; }
.lg-feats div { text-align: center; }
.lg-feats span { display: block; width: 28px; height: 28px; margin: 0 auto 6px; border-radius: 50%; background: rgba(255,255,255,.18); display: grid; place-items: center; }
.lg-copy { text-align: center; font-size: 10.5px; margin-top: 10px; color: #0b3a35; font-weight: 600; }
.lg-right { position: relative; display: grid; place-items: center; padding: 24px; }
.lg-card { width: 100%; max-width: 340px; background: #fff; border-radius: 10px; padding: 28px 26px 26px; box-shadow: 0 24px 50px -20px rgba(0,0,0,.35); text-align: center; }
.lg-card .lock { width: 44px; height: 44px; border-radius: 50%; background: #e0ecff; color: #2563eb; display: inline-grid; place-items: center; margin-bottom: 10px; }
.lg-card h2 { font-size: 18px; color: #0f172a; line-height: 1.3; }
.lg-card .sub { font-size: 11.5px; color: #64748b; margin: 6px 0 20px; }
.lg-card label { display: block; text-align: left; font-size: 11.5px; font-weight: 700; color: #0f172a; margin-bottom: 5px; }
.lg-in { position: relative; margin-bottom: 14px; }
.lg-in svg.ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #94a3b8; }
.lg-in input { padding-left: 32px !important; padding-right: 34px !important; background: #f8fafc !important; font-size: 13px; }
.lg-in .eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: #94a3b8; cursor: pointer; padding: 4px; }
.lg-btn { width: 100%; border: 0; border-radius: 5px; background: var(--pri); color: #fff; font: 700 13px var(--font); padding: 11px; cursor: pointer; display: flex; justify-content: center; gap: 6px; align-items: center; margin-top: 4px; }
.lg-btn:hover { background: #093d8c; } .lg-btn:disabled { opacity: .6; }
@media (max-width: 900px) { .lg { grid-template-columns: 1fr; } .lg-left { padding: 20px; } .lg-logo { margin: 0 auto; } .lg-hero { padding: 20px 0; } .lg-feats { display: none; } }

/* =====================================================================
   v2 REACTOR SHEET (paper form)
   ===================================================================== */
body.sheet-page { background: #eef2f7; }
.sbar { height: 62px; background: #fff; border-bottom: 1px solid #e5e7eb; display: flex; align-items: center; gap: 14px; padding: 0 22px; position: sticky; top: 0; z-index: 50; }
.sbar h1 { font-size: 17px; font-weight: 800; color: #0f2a5c; }
.sbar .back { background: #e2e8f0; border: 0; border-radius: 4px; padding: 6px 12px; font: 600 12px var(--font); color: #0f172a; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.sbar .back:hover { background: #cbd5e1; text-decoration: none; }
.sbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.mode-badge { font-size: 10.5px; font-weight: 800; letter-spacing: .04em; padding: 5px 10px; border-radius: 4px; border: 1px solid; text-transform: uppercase; }
.mb-admin { color: #92400e; background: #fef3c7; border-color: #f59e0b; }
.mb-qe { color: #075985; background: #e0f2fe; border-color: #38bdf8; }
.mb-insp { color: #065f46; background: #d1fae5; border-color: #34d399; }
.mb-view { color: #334155; background: #f1f5f9; border-color: #94a3b8; }
.mb-lock { color: #991b1b; background: #fee2e2; border-color: #f87171; }
.uchip { display: flex; align-items: center; gap: 8px; border: 1px solid #e2e8f0; border-radius: 24px; padding: 4px 12px 4px 4px; }
.uchip .avatar { width: 28px; height: 28px; border-radius: 50%; background: #1d4ed8; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.uchip b { display: block; font-size: 11.5px; color: #0f172a; } .uchip small { display: block; font-size: 10px; color: #64748b; }

.paper-wrap { padding: 26px 16px 120px; }
.paper { width: 100%; max-width: 820px; margin: 0 auto; background: #fff; border: 1px solid #cbd5e1; box-shadow: 0 4px 24px -8px rgba(15,23,42,.25); padding: 36px 40px 28px; color: #111; }
.p-head { display: grid; grid-template-columns: 170px 1fr; align-items: center; margin-bottom: 26px; }
.p-head .logo-img { height: 26px; }
.p-head .ttl { text-align: center; padding-right: 170px; }
.p-head .ttl h2 { font-size: 21px; font-weight: 800; letter-spacing: .08em; }
.p-head .ttl div { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; margin-top: 4px; }
.p-fields { display: grid; grid-template-columns: 1.15fr 1.15fr 1fr; gap: 14px 22px; margin-bottom: 18px; }
.pf { display: flex; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 700; }
.pf > span:first-child { flex: 0 0 auto; line-height: 1.2; max-width: 78px; }
.pf input, .pf select { border: 0 !important; border-bottom: 1.5px dotted #475569 !important; border-radius: 0 !important; background: transparent !important; padding: 4px 2px !important; font-weight: 700; font-size: 12.5px; box-shadow: none !important; }
.pf input:focus, .pf select:focus { border-bottom: 1.5px solid #2563eb !important; }
.pf input.invalid { border-bottom-color: #dc2626 !important; background: #fef2f2 !important; }
.pf input[type=date] { background: #eef2f7 !important; border-bottom: 0 !important; padding: 4px 8px !important; }
.pf .counter { position: absolute; right: 0; top: -12px; }
.pf .rel { position: relative; flex: 1; }
.p-sec { font-size: 12.5px; font-weight: 800; text-decoration: underline; text-underline-offset: 2px; margin: 18px 0 7px; }
.ptbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.ptbl th, .ptbl td { border: 1px solid #1f2937; padding: 6px 8px; vertical-align: middle; }
.ptbl th { font-weight: 700; background: #f3f4f6; text-align: center; font-size: 11.5px; }
.ptbl td.c { text-align: center; }
.ptbl .cp-cell { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ptbl .cp-spec { font-size: 10.5px; color: #64748b; font-weight: 500; }
.ptbl input[type=text], .ptbl input[type=number] { border: 0; border-bottom: 1px dotted #94a3b8; border-radius: 0; padding: 3px 2px; font-size: 12px; background: transparent; box-shadow: none; }
.ptbl input:focus { border-bottom: 1px solid #2563eb; box-shadow: none; }
.ptbl input:disabled, .ptbl select:disabled, .pf input:disabled, .pf select:disabled { color: #111; opacity: 1; -webkit-text-fill-color: #111; }
.ptbl input[readonly] { background: transparent; color: #111; }
.ptbl tr.row-pass td { background: #ecfdf5; } .ptbl tr.row-fail td { background: #fef2f2; }
.stb { font-size: 9.5px; font-weight: 800; letter-spacing: .04em; padding: 2px 7px; border-radius: 3px; white-space: nowrap; }
.stb-PENDING { background: #fef3c7; color: #92400e; } .stb-FAIL { background: #fee2e2; color: #b91c1c; } .stb-PASS { background: #d1fae5; color: #047857; }
.meter-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 11.5px; margin-bottom: 7px; }
.meter-row .lbl { font-weight: 700; text-decoration: underline; color: #1e3a8a; }
.mbtn { font: 700 11px var(--font); border: 1.5px solid #0f172a; background: #fff; padding: 4px 9px; border-radius: 3px; cursor: pointer; text-decoration: underline; }
.mbtn:hover { background: #f1f5f9; }
.mbtn:disabled { color: #94a3b8; border-color: #cbd5e1; cursor: not-allowed; text-decoration: none; }
.mbtn.go { background: #0f172a; color: #fff; text-decoration: none; }
.mstate { font-weight: 700; color: #dc2626; text-decoration: underline; display: inline-flex; align-items: center; gap: 5px; }
.mstate::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.mstate.on { color: #047857; }
.mlive { margin-left: auto; font-family: var(--mono); font-size: 11px; color: #334155; display: flex; gap: 12px; }
.mlive b { color: #0f172a; }
.ind-val { font-family: var(--mono); font-weight: 700; }
.ind-sub { display: block; font-size: 9.5px; color: #64748b; font-weight: 500; }
.ptbl .clr { border: 0; background: none; color: #94a3b8; cursor: pointer; font-size: 12px; padding: 0 2px; }
.act-grid td.nm select { border: 0; border-bottom: 1px dotted #94a3b8; border-radius: 0; background: transparent; font-size: 11.5px; padding: 3px 2px; text-align: center; box-shadow: none; }
.act-grid td.sg { height: 54px; text-align: center; }
.act-grid td.sg img { max-height: 34px; max-width: 120px; display: block; margin: 0 auto 2px; }
.act-grid td.sg small { font-size: 10px; color: #334155; }
.rem-box { border: 1px solid #1f2937; padding: 7px 9px; margin-top: 16px; }
.rem-box b { font-size: 11.5px; display: block; margin-bottom: 4px; }
.rem-box textarea { border: 0; padding: 0; min-height: 56px; font-size: 12px; box-shadow: none !important; background: transparent; }
.disp { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #1f2937; margin-top: 14px; }
.disp-l { padding: 10px 14px; border-right: 1px solid #1f2937; }
.disp-l h4 { font-size: 11.5px; font-weight: 800; display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.lockb { font-size: 9px; font-weight: 800; padding: 2px 7px; border: 1px solid; border-radius: 3px; letter-spacing: .03em; }
.lockb.un { color: #047857; border-color: #10b981; background: #ecfdf5; } .lockb.lk { color: #b91c1c; border-color: #f87171; background: #fef2f2; }
.disp-l label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; margin: 7px 0; cursor: pointer; }
.disp-l input[type=radio] { appearance: none; -webkit-appearance: none; width: 13px; height: 13px; border: 1.5px solid #111; border-radius: 2px; margin: 0; display: grid; place-items: center; cursor: pointer; }
.disp-l input[type=radio]:checked::after { content: "✓"; font-size: 11px; font-weight: 900; line-height: 1; }
.disp-l input:disabled { cursor: not-allowed; opacity: .6; }
.disp-r { padding: 12px 18px; text-align: center; font-size: 11.5px; }
.disp-r .qe-sig { height: 42px; display: grid; place-items: center; border-bottom: 1.5px solid #111; margin: 6px 0 8px; }
.disp-r .qe-sig img { max-height: 40px; max-width: 160px; }
.disp-r .qe-sig .ph { font-size: 10.5px; color: #475569; letter-spacing: .04em; }
.disp-r dl { display: grid; grid-template-columns: 50px 1fr; gap: 4px; margin: 0 0 8px; text-align: left; }
.disp-r dt { font-weight: 700; } .disp-r dd { margin: 0; border-bottom: 1px dotted #94a3b8; text-align: center; font-weight: 700; }
.disp-r .ql b { display: block; } .disp-r .ql small { color: #64748b; font-size: 10px; }
.p-foot { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1.5px solid #111; margin-top: 24px; padding-top: 6px; font-size: 9.5px; font-weight: 700; text-transform: uppercase; }
.p-foot div:nth-child(2) { text-align: center; } .p-foot div:nth-child(3) { text-align: right; }
.p-alerts { max-width: 820px; margin: 0 auto 12px; }
.fab { position: fixed; right: 26px; bottom: 22px; z-index: 60; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; background: #fff; border: 1px solid #e2e8f0; border-radius: 30px; padding: 8px; box-shadow: 0 14px 34px -12px rgba(15,23,42,.35); max-width: calc(100vw - 30px); }
.fab .fb { font: 700 12px var(--font); border-radius: 20px; padding: 8px 14px; border: 1.5px solid #e2e8f0; background: #fff; color: #0f172a; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; text-decoration: none; }
.fab .fb:hover { background: #f8fafc; text-decoration: none; }
.fab .fb.blue { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.fab .fb.navy { background: #0b4aa8; border-color: #0b4aa8; color: #fff; }
.fab .fb.blue:hover, .fab .fb.navy:hover { filter: brightness(1.08); }
.fab .fb.red { background: #fff1f2; border-color: #fda4af; color: #be123c; }
.fab .fb:disabled { opacity: .5; cursor: not-allowed; }
.fab .save-state { align-self: center; font-size: 11px; color: #64748b; padding: 0 6px; }
@media (max-width: 760px) {
  .paper { padding: 20px 14px; } .p-head { grid-template-columns: 1fr; gap: 10px; text-align: center; } .p-head .ttl { padding: 0; } .p-head .logo-img { margin: 0 auto; }
  .p-fields { grid-template-columns: 1fr; } .disp { grid-template-columns: 1fr; } .disp-l { border-right: 0; border-bottom: 1px solid #1f2937; }
  .sbar .uchip, .sbar .mode-badge { display: none; } .fab { left: 10px; right: 10px; bottom: 10px; border-radius: 14px; justify-content: center; }
  .ptbl { font-size: 11px; } .mlive { margin-left: 0; }
}
@media print {
  @page { size: A4; margin: 8mm; }
  body.sheet-page { background: #fff; }
  .sbar, .fab, .p-alerts, .meter-row .mbtn, .mlive, .ptbl .clr, #toasts, .no-print { display: none !important; }
  .paper-wrap { padding: 0; } .paper { border: 0; box-shadow: none; max-width: none; padding: 0; }
  .ptbl tr.row-pass td, .ptbl tr.row-fail td { background: none !important; }
  .pf input, .pf select, .ptbl input, .act-grid select { -webkit-appearance: none; appearance: none; }
  select { background-image: none !important; }
}
/* v2 fixes */
.appbar .bell > button, .sbar .bell > button { color: #475569; }
.appbar .bell > button:hover, .sbar .bell > button:hover { background: #e2e8f0; }
.toolbar input[type=text] { width: 260px; }
.act-col { flex-direction: row; flex-wrap: wrap; justify-content: flex-end; max-width: 190px; margin-left: auto; }
.p-fields { grid-template-columns: 1.35fr 1.1fr .95fr; }
#serial { font-family: var(--mono); font-size: 12px !important; letter-spacing: .02em; }
@media print { .pf .counter, #limits { display: none !important; } .sbadge { border: 1px solid #999; } }
.pf .rel { flex: 1; min-width: 0; } .pf .rel input { width: 100%; }
