/* Design Issues — proof UI. Issue-specific components built on the MKS design-system tokens.
   Everything here uses the vendored tokens (colors/effects/typography) — no new brand decisions. */

/* ---- New Issue modal ---- */
.modal-overlay { position: fixed; inset: 0; background: rgba(30,30,30,.42); display: flex; align-items: flex-start;
  justify-content: center; padding: 6vh 16px; z-index: 80; animation: fadeIn var(--dur-fast) var(--ease-out); }
.modal { background: var(--bg-surface); width: 100%; max-width: 560px; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl); overflow: hidden; max-height: 88vh; display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 20px;
  border-bottom: var(--border); }
.modal-head h2 { font-size: 1.02rem; font-family: var(--font-display); }
.modal-x { background: none; border: none; font-size: 1.1rem; color: var(--text-muted); cursor: pointer; line-height: 1; }
.modal-x:hover { color: var(--text-strong); }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: var(--border);
  background: var(--bg-subtle); }
.field { margin-bottom: 14px; position: relative; }
.field > label { display: block; font-size: var(--fs-micro); text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-muted); font-weight: 600; margin-bottom: 5px; }
.field > label .opt { text-transform: none; letter-spacing: 0; font-weight: 400; }
.field > label .req { color: var(--color-error, #d92d20); font-weight: 700; margin-left: 1px; }
.field input[type="text"], .field select, .field textarea { width: 100%; padding: 9px 11px; font-size: .86rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.muted-note { font-size: var(--fs-caption); color: var(--text-muted); font-style: italic; }
.ni-error { background: var(--color-error-bg); color: var(--color-error); border-radius: var(--radius-sm);
  padding: 9px 12px; font-size: .8rem; font-weight: 600; }
.ni-picked { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--brand);
  background: var(--brand-tint); border-radius: var(--radius-md); margin-bottom: 7px; }
.ni-picked img { width: 40px; height: 40px; border-radius: var(--radius-sm); object-fit: cover; background: var(--bg-subtle); }
.ni-picked .p-meta { flex: 1; min-width: 0; }
.ni-picked .p-code { font-family: var(--font-mono); font-size: .8rem; font-weight: 700; color: var(--text-strong); }
.ni-picked .p-desc { font-size: .74rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ni-picked .p-clear { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: .9rem; }
.ni-results { position: absolute; left: 0; right: 0; top: 100%; margin-top: 3px; background: #fff; border: var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg); max-height: 260px; overflow-y: auto; z-index: 5; }
.ni-res { display: flex; align-items: center; gap: 9px; padding: 8px 10px; cursor: pointer; border-bottom: var(--border); }
.ni-res:last-child { border-bottom: none; }
.ni-res:hover { background: var(--bg-hover); }
.ni-res img { width: 34px; height: 34px; border-radius: var(--radius-xs); object-fit: cover; background: var(--bg-subtle); }
.ni-res .r-code { font-family: var(--font-mono); font-size: .76rem; font-weight: 700; }
.ni-res .r-desc { font-size: .72rem; color: var(--text-muted); }

/* ---- filter bar (multi-select dropdowns + chips) ---- */
.filterbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.ms { position: relative; }
.ms-btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; font-size: .76rem; font-weight: 600;
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  color: var(--text-secondary); cursor: pointer; white-space: nowrap; }
.ms-btn:hover { border-color: var(--mks-blue-grey); }
.ms-btn.active { border-color: var(--brand); color: var(--mks-orange-press); background: var(--brand-tint); }
.ms-pop { position: absolute; top: 100%; left: 0; margin-top: 4px; min-width: 190px; max-height: 280px; overflow-y: auto;
  background: #fff; border: var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); z-index: 30; padding: 5px; }
.ms-opt { display: flex; align-items: center; gap: 8px; padding: 6px 8px; font-size: .78rem; color: var(--text-body);
  border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap; }
.ms-opt:hover { background: var(--bg-hover); }
.ms-opt input { width: auto; }
.ms-date { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; color: var(--text-muted); }
.ms-date input[type="date"] { padding: 5px 7px; font-size: .74rem; }
.fq { padding: 6px 11px; font-size: .76rem; font-weight: 600; border-radius: var(--radius-pill); cursor: pointer;
  background: var(--bg-surface); border: 1px solid var(--border); color: var(--text-secondary); }
.fq.active { background: var(--mks-ink-900); border-color: var(--mks-ink-900); color: #fff; }

.filter-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.filter-chips:empty { margin: 0; }
.fchip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; font-size: .72rem; font-weight: 600;
  background: var(--brand-tint); color: var(--mks-orange-press); border-radius: var(--radius-pill); cursor: pointer; }
.fchip b { font-weight: 700; opacity: .7; }
.fchip:hover b { opacity: 1; }
.fchip-clear { background: none; border: none; color: var(--text-muted); font-size: .72rem; font-weight: 600;
  cursor: pointer; text-decoration: underline; }

/* ---- portal: per-design issue log ---- */
.pd-issues { margin-top: 16px; padding-top: 14px; border-top: var(--border); }
.pd-issues-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.pd-issues-head span { font-size: .84rem; font-weight: 700; color: var(--text-strong); }
.pd-issue-list { display: flex; flex-direction: column; gap: 6px; }
.pd-issue { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 11px; border: var(--border); border-radius: var(--radius-md); cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast); }
.pd-issue:hover { background: var(--bg-hover); border-color: var(--mks-blue-grey); }
.pd-i-main { min-width: 0; display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.pd-i-type { font-size: .8rem; font-weight: 600; color: var(--text-strong); }
.pd-i-date { font-size: .68rem; color: var(--text-muted); }

/* ---- tabs ---- */
.tabs { display: flex; gap: 4px; margin-left: 18px; }
.tab {
  background: transparent; border: none; color: var(--text-on-dark-dim); cursor: pointer;
  font-family: var(--font-display); font-size: .82rem; font-weight: 600; padding: 8px 14px;
  border-radius: var(--radius-md); transition: all var(--t-fast); white-space: nowrap;
}
.tab:hover { color: #fff; background: rgba(255,255,255,.08); }
.tab.active { color: var(--mks-ink-900); background: var(--brand); }

/* ---- portal: component chips (in list rows) ---- */
.portal-comps { display: flex; gap: 6px; margin-top: 5px; flex-wrap: wrap; }
.comp { display: inline-flex; align-items: center; gap: 4px; font-size: .68rem; font-weight: 600;
  padding: 2px 8px; border-radius: var(--radius-pill); border: 1px solid var(--border); }
.comp .ic svg { width: 12px; height: 12px; }
.comp.ok { color: var(--color-success); background: var(--color-success-bg); border-color: transparent; }
.comp.miss { color: var(--color-error); background: var(--color-error-bg); border-color: transparent; }
.comp b { font-weight: 700; }

/* ---- portal: component cards (in detail) ---- */
/* compact per-design file rows (Master Portal detail) */
.pfile-list { border: var(--border); border-radius: var(--radius-md); overflow: hidden; margin: 2px 0 4px; }
.pfile { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--border); }
.pfile:last-child { border-bottom: none; }
.pfile .pf-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--color-error); }
.pfile.ok .pf-dot { background: var(--color-success); }
.pfile .pf-name { font-size: .82rem; font-weight: 600; color: var(--text-strong); }
.pfile .pf-lvl { flex: 1; min-width: 0; font-size: .72rem; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pfile .pf-btn { padding: 3px 12px; font-size: .74rem; }

/* ---- layout shell ---- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: var(--space-lg);
  padding: 10px 22px; background: var(--bg-header); color: var(--text-on-dark);
  box-shadow: var(--shadow-sm); position: sticky; top: 0; z-index: 20;
}
.topbar .logo { height: 26px; }
.topbar .title { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; letter-spacing: .01em; }
.topbar .title small { display:block; font-weight:400; font-size:.62rem; letter-spacing:.14em; text-transform:uppercase; color: var(--text-on-dark-dim); }
.topbar .spacer { flex: 1; }
.viewas { display: flex; align-items: center; gap: 8px; font-size: .74rem; color: var(--text-on-dark-dim); }
.viewas select {
  background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.18);
  padding: 6px 10px; border-radius: var(--radius-sm); font-size: .78rem;
}
.viewas select option { color: #222; }

.wrap { flex: 1; padding: 18px 22px 40px; max-width: 1500px; width: 100%; margin: 0 auto; }

/* ---- KPI row (My Work) ---- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi {
  background: var(--bg-surface); border: var(--border); border-radius: var(--radius-lg);
  padding: 13px 16px; box-shadow: var(--shadow-xs); position: relative; overflow: hidden;
  transition: box-shadow var(--t-fast), transform var(--t-fast);
}
.kpi:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kpi::before { content:""; position:absolute; left:0; top:0; bottom:0; width:3px; background: var(--accent, var(--brand)); }
.kpi .kpi-label { font-size: var(--fs-micro); text-transform: uppercase; letter-spacing: .09em; color: var(--text-muted); font-weight: 600; }
.kpi .kpi-value { font-family: var(--font-num); font-size: var(--fs-kpi); font-weight: 700; color: var(--text-strong); line-height: 1.1; margin-top: 3px; }
.kpi .kpi-sub { font-size: var(--fs-caption); color: var(--text-muted); }

/* ---- toolbar / filters ---- */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; cursor: pointer;
  border-radius: var(--radius-pill); font-size: .76rem; font-weight: 600;
  background: var(--bg-surface); border: 1px solid var(--border); color: var(--text-secondary);
  transition: all var(--t-fast); user-select: none;
}
.pill:hover { border-color: var(--mks-blue-grey); }
.pill.active { background: var(--mks-ink-900); border-color: var(--mks-ink-900); color: #fff; }
.pill .n { font-size: .68rem; opacity: .7; }
.search { flex: 1; min-width: 200px; }
.search input { width: 100%; padding: 8px 12px; font-size: .82rem; }
select.filter { padding: 7px 11px; font-size: .78rem; }

/* ---- main split ---- */
.split { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 1050px) { .split { grid-template-columns: 1fr; } }

/* ---- issue list ---- */
.list { background: var(--bg-surface); border: var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); overflow: hidden; }
.list-head { padding: 11px 16px; border-bottom: var(--border); display:flex; align-items:center; justify-content:space-between; }
.list-head h2 { font-size: var(--fs-h2); }
.list-head .count { font-size: var(--fs-caption); color: var(--text-muted); }
.row {
  display: grid; grid-template-columns: 46px 1fr auto; gap: 12px; align-items: center;
  padding: 11px 16px; border-bottom: var(--border); cursor: pointer;
  transition: background var(--t-fast);
}
.row:last-child { border-bottom: none; }
.row:hover { background: var(--bg-hover); }
.row.sel { background: var(--brand-tint); box-shadow: inset 3px 0 0 var(--brand); }
.row .thumb { width: 46px; height: 46px; border-radius: var(--radius-sm); object-fit: cover; background: var(--bg-subtle); border: 1px solid var(--border); }
.row .mid { min-width: 0; }
.row .r-top { display: flex; align-items: center; gap: 8px; }
.row .r-id { font-size: .7rem; color: var(--text-muted); }
.row .r-type { font-family: var(--font-mono); font-size: .8rem; font-weight: 700; color: var(--text-strong); }
.row .r-desc { font-size: .76rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.row .r-desc-inline { font-size: .74rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .r-sub { display: flex; align-items: center; gap: 8px; margin-top: 3px; font-size: .68rem; color: var(--text-muted); }
.row .r-ind { display: inline-flex; align-items: center; gap: 2px; }
.row .r-ind .ic svg { width: 12px; height: 12px; }
.row .r-age { font-size: .66rem; color: var(--text-muted); white-space: nowrap; }
.row .r-right { display: flex; align-items: center; gap: 10px; }

/* ---- status pill + severity dot ---- */
.status { display:inline-flex; align-items:center; gap:5px; padding: 3px 9px; border-radius: var(--radius-pill); font-size: .68rem; font-weight: 700; letter-spacing:.02em; white-space: nowrap; }
.status::before { content:""; width:6px; height:6px; border-radius:50%; background: currentColor; }
.st-review   { color: var(--color-warning); background: var(--color-warning-bg); }
.st-approved { color: var(--color-info);    background: var(--color-info-bg); }
.st-progress { color: var(--mks-orange-press); background: var(--brand-tint); }
.st-resolved { color: var(--color-success); background: var(--color-success-bg); }
.st-rejected { color: var(--color-error);   background: var(--color-error-bg); }
.st-closed   { color: var(--text-muted);    background: var(--bg-subtle); }

.sev { display:inline-flex; align-items:center; gap:5px; font-size:.7rem; font-weight:600; color: var(--text-secondary); }
.sev .dot { width:8px; height:8px; border-radius:50%; }
.sev-Low .dot { background: var(--mks-blue-grey); }
.sev-Medium .dot { background: var(--color-warning); }
.sev-High .dot { background: var(--color-error); }

/* ---- avatar ---- */
.ava { width:26px; height:26px; border-radius:50%; background: var(--brand-soft); color: var(--mks-ink-900); display:inline-flex; align-items:center; justify-content:center; font-size:.62rem; font-weight:700; border:1.5px solid #fff; box-shadow: var(--shadow-xs); }
.ava.sm { width:22px; height:22px; font-size:.58rem; }
/* owner team = overlapping avatar stack */
.ava-stack { display:inline-flex; align-items:center; }
.ava-stack .ava { margin-left:-7px; }
.ava-stack .ava:first-child { margin-left:0; }
.ava-more { background: var(--mks-ink-100, #e7e3dd); color: var(--mks-ink-700, #555); }

/* ===== Admin screens (#9) ===== */
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.admin-tabs { display:flex; gap:4px; margin-bottom:18px; border-bottom:1px solid var(--border, rgba(0,0,0,.1)); }
.admin-tabs button { background:none; border:none; padding:9px 15px; font-size:.86rem; font-weight:600; color:var(--text-muted); cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-1px; }
.admin-tabs button.active { color:var(--mks-orange, #df6f27); border-bottom-color:var(--mks-orange, #df6f27); }
.admin-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.admin-head h2 { font-size:1rem; margin:0; }
.admin-tablewrap { overflow-x:auto; background:var(--bg-card, #fff); border-radius:var(--radius-md, 10px); box-shadow:var(--shadow-xs); }
.admin-tbl { width:100%; border-collapse:collapse; font-size:.82rem; }
.admin-tbl th { text-align:left; padding:10px 12px; font-size:.68rem; text-transform:uppercase; letter-spacing:.05em; color:var(--text-muted); border-bottom:1px solid var(--border, rgba(0,0,0,.08)); background:var(--bg-subtle, #faf9f7); white-space:nowrap; }
.admin-tbl td { padding:9px 12px; border-bottom:1px solid var(--border, rgba(0,0,0,.05)); vertical-align:middle; }
.admin-tbl tbody tr { cursor:pointer; }
.admin-tbl tbody tr:hover { background:var(--bg-hover, rgba(0,0,0,.03)); }
.abadge { display:inline-block; padding:2px 9px; border-radius:20px; font-size:.7rem; font-weight:600; }
.abadge.on { background:rgba(0,176,80,.12); color:#00893f; }
.abadge.off { background:rgba(0,0,0,.07); color:var(--text-muted); }
.rolechip { display:inline-block; padding:2px 8px; border-radius:5px; background:var(--brand-soft, #f3ede7); font-size:.72rem; font-weight:600; }
.rolechip.vall { background:#e3f0ff; color:#1a5fb4; }
.chip-select { display:flex; flex-wrap:wrap; gap:6px; max-height:190px; overflow-y:auto; padding:2px; }
.uchip { display:inline-flex; align-items:center; gap:6px; padding:4px 11px 4px 5px; border-radius:20px; border:1.5px solid var(--border, rgba(0,0,0,.12)); background:none; font-size:.78rem; cursor:pointer; color:var(--text-body); }
.uchip.on { border-color:var(--mks-orange, #df6f27); background:rgba(223,111,39,.08); color:var(--mks-orange-press, #b8571e); font-weight:600; }
.chkline { display:flex; align-items:center; gap:8px; font-size:.82rem; cursor:pointer; }
.chkline input { accent-color:var(--mks-orange, #df6f27); }
.admin-actions { display:flex; align-items:center; gap:10px; }
.admin-actions .search.sm input { padding:6px 12px; border-radius:8px; border:1px solid var(--border, rgba(0,0,0,.15)); font-size:.82rem; min-width:200px; }
.admin-tbl .r-sub2 { font-size:.7rem; color:var(--text-muted); margin-top:2px; }
.uchip.chip-off { opacity:.5; }                 /* inactive issue type */
.admin-types { margin-top:22px; border-top:1px solid var(--border, rgba(0,0,0,.1)); padding-top:10px; }
.admin-types > summary { cursor:pointer; font-size:.82rem; font-weight:600; color:var(--text-muted); padding:6px 0; list-style:revert; }
.admin-types > summary:hover { color:var(--text-body); }
.admin-subhead { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:10px 0; }
.btn.sm { padding:5px 11px; font-size:.8rem; }

/* ===== Home / My Work (#14) ===== */
.home-hd { margin-bottom:16px; }
.home-hi { font-size:1.35rem; font-weight:700; color:var(--text-heading, #1a1a1a); }
.home-sub { margin-top:6px; display:flex; gap:6px; }
.home-grid { display:grid; grid-template-columns:1fr 1fr; gap:18px; margin-top:18px; }
@media (max-width:900px) { .home-grid { grid-template-columns:1fr; } }
.home-col { display:flex; flex-direction:column; gap:18px; }
.hsec { background:var(--bg-card, #fff); border-radius:var(--radius-md, 10px); box-shadow:var(--shadow-xs); padding:14px 16px; }
.hsec-h { display:flex; align-items:center; gap:8px; font-size:.9rem; font-weight:700; margin-bottom:10px; color:var(--text-heading, #1a1a1a); }
.hsec-n { background:var(--brand-soft, #f3ede7); color:var(--text-muted); font-size:.72rem; font-weight:700; border-radius:20px; padding:1px 9px; }
.hsec-body { max-height:330px; overflow-y:auto; overscroll-behavior:contain; }
.hsec-body::-webkit-scrollbar { width:7px; }
.hsec-body::-webkit-scrollbar-thumb { border:none; }
.hrow { display:flex; align-items:center; gap:12px; padding:9px 6px; border-radius:8px; cursor:pointer; border-bottom:1px solid var(--border, rgba(0,0,0,.05)); }
.hrow:last-child { border-bottom:none; }
.hrow:hover { background:var(--bg-hover, rgba(0,0,0,.03)); }
.hrow-thumb { width:38px; height:38px; border-radius:7px; object-fit:cover; background:var(--bg-subtle, #f2efeb); flex:none; }
.hrow-main { flex:1; min-width:0; }
.hrow-top { display:flex; gap:8px; align-items:baseline; }
.hrow-design { font-weight:700; font-size:.84rem; font-family:ui-monospace, monospace; }
.hrow-type { font-size:.72rem; color:var(--text-muted); }
.hrow-desc { font-size:.78rem; color:var(--text-body); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.hrow-right { display:flex; align-items:center; gap:8px; flex:none; }
.hrow-hint { font-size:.68rem; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--mks-orange-press, #b8571e); background:rgba(223,111,39,.1); padding:2px 8px; border-radius:5px; }
.hrow-age { font-size:.72rem; color:var(--text-muted); min-width:52px; text-align:right; }
.hempty { padding:14px 6px; font-size:.82rem; color:var(--text-muted); }
.hmore { padding:8px 6px 2px; font-size:.75rem; color:var(--text-muted); }
.hnotif { display:flex; gap:10px; align-items:flex-start; padding:8px 6px; border-radius:8px; cursor:pointer; }
.hnotif:hover { background:var(--bg-hover, rgba(0,0,0,.03)); }
.hn-dot { width:8px; height:8px; border-radius:50%; background:transparent; margin-top:6px; flex:none; }
.hnotif.unread .hn-dot { background:var(--mks-orange, #df6f27); }
.hn-title { font-size:.8rem; color:var(--text-body); }
.hn-time { font-size:.7rem; color:var(--text-muted); margin-top:1px; }

/* ---- detail panel ---- */
.detail { background: var(--bg-surface); border: var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; position: sticky; top: 78px; }
.detail .empty { padding: 60px 24px; text-align: center; color: var(--text-muted); }
.detail .hero { position: relative; }
.detail .hero img { width: 100%; height: 210px; object-fit: cover; background: var(--bg-subtle); display:block; }
.detail .hero .over { position:absolute; left:0; right:0; bottom:0; padding: 14px 18px; background: linear-gradient(transparent, rgba(20,20,20,.72)); color:#fff; }
.detail .hero .over .d-code { font-family: var(--font-mono); font-size:.74rem; opacity:.85; }
.detail .hero .over .d-desc { font-size:.9rem; font-weight:600; }
.detail .body { padding: 16px 18px; }
.detail .d-head { display:flex; align-items:center; justify-content: space-between; gap:10px; margin-bottom: 12px; }
.detail .d-head .id { font-family: var(--font-mono); font-size:.76rem; color: var(--text-muted); }
.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 12px 0 14px; }
.meta-grid .m .lbl { font-size: var(--fs-micro); text-transform: uppercase; letter-spacing:.08em; color: var(--text-muted); font-weight:600; }
.meta-grid .m .val { font-size:.82rem; color: var(--text-strong); display:flex; align-items:center; gap:6px; }
.descbox { background: var(--bg-subtle); border-radius: var(--radius-md); padding: 11px 13px; font-size:.84rem; color: var(--text-body); line-height:1.5; }

/* ---- timeline stepper ---- */
.steps { display:flex; align-items:center; margin: 16px 0 6px; }
.step { display:flex; flex-direction:column; align-items:center; flex:1; position:relative; }
.step:not(:last-child)::after { content:""; position:absolute; top:9px; left:50%; width:100%; height:2px; background: var(--border); z-index:0; }
.step.done:not(:last-child)::after { background: var(--brand); }
.step .node { width:18px; height:18px; border-radius:50%; background:#fff; border:2px solid var(--border); z-index:1; }
.step.done .node { background: var(--brand); border-color: var(--brand); }
.step.cur .node { background:#fff; border-color: var(--brand); box-shadow: var(--ring); }
.step.rej .node { background: var(--color-error); border-color: var(--color-error); }
.step .lbl { font-size:.6rem; margin-top:5px; color: var(--text-muted); text-align:center; font-weight:600; letter-spacing:.02em; }
.step.done .lbl, .step.cur .lbl { color: var(--text-strong); }

/* ---- actions ---- */
.actions { display:flex; gap:8px; margin-top: 16px; padding-top: 14px; border-top: var(--border); flex-wrap: wrap; }

/* ---- toast ---- */
.toast-wrap { position: fixed; right: 20px; bottom: 20px; display:flex; flex-direction:column; gap:8px; z-index: 60; }
.toast { background: var(--mks-ink-900); color:#fff; padding: 11px 15px; border-radius: var(--radius-md); box-shadow: var(--shadow-lg); font-size:.82rem; display:flex; align-items:center; gap:9px; animation: fadeIn var(--dur-normal) var(--ease-out); }
.toast .ic svg { width:16px; height:16px; stroke:#fff; }
.toast.ok { background: var(--color-success); }

.ic svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: -2px; }
.demo-tag { font-size:.58rem; text-transform:uppercase; letter-spacing:.08em; color: var(--mks-blue-grey); border:1px solid var(--border); border-radius: var(--radius-pill); padding: 1px 6px; }

/* ============================================================================
   App shell — QC-dashboard style: dark collapsible sidebar + slim top bar.
   Ported from mksqc_dashboard/frontend/css/app.css (solid graphite, self-contained).
   ============================================================================ */
.brand-strip { height: 3px; width: 100%; background: linear-gradient(90deg, var(--brand), var(--mks-light-orange)); }
.app-shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }

/* Sidebar */
.sidebar { color: #fff; position: sticky; top: 0; height: 100vh; z-index: 60;
  background-color: var(--bg-header);
  background-image: linear-gradient(180deg, rgba(28,26,24,0.74) 0%, rgba(28,26,24,0.60) 48%, rgba(28,26,24,0.34) 100%), url('assets/mks-249.jpg');
  background-repeat: no-repeat, no-repeat; background-attachment: scroll, fixed;
  background-position: center, center; background-size: auto, cover;
  display: flex; flex-direction: column; }
.side-brand { display: flex; align-items: center; gap: 12px; padding: 20px 16px 10px; flex: none; }
.side-logo { width: 40px; height: auto; flex: none; }
.side-title { font-family: var(--font-display); font-size: 1.02rem; font-weight: 700; line-height: 1.12; color: #fff; }
.side-sub { font-size: var(--fs-caption); color: rgba(255,255,255,0.55); margin-top: 2px; white-space: nowrap; }
.side-nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.nav-grp { font-family: var(--font-display); font-size: var(--fs-micro); font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: #e9a36b; padding: 14px 10px 6px; white-space: nowrap; }
.nav-grp:first-child { padding-top: 2px; }
.nav-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 11px; margin: 1px 0;
  border: none; border-left: 2px solid transparent; border-radius: var(--radius-sm); background: none;
  font-family: var(--font-display); font-size: var(--fs-sm); font-weight: 600; color: rgba(255,255,255,0.72);
  cursor: pointer; text-align: left; white-space: nowrap; transition: background var(--t-fast), color var(--t-fast); }
.nav-item .ic svg { width: 16px; height: 16px; }
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active { background: rgba(223,111,39,0.16); color: #fff; border-left-color: var(--brand); }
.nav-item.active .ic { color: var(--brand); }
.side-foot { display: flex; align-items: center; gap: 7px; padding: 11px 16px; border-top: 1px solid rgba(255,255,255,0.08);
  font-size: var(--fs-micro); color: rgba(255,255,255,0.42); white-space: nowrap; }

/* Main area + slim dark top bar (overrides the old .topbar) */
.main-area { min-width: 0; display: block; }
.topbar { position: sticky; top: 0; z-index: 50; flex-direction: row;
  background-color: var(--bg-header);
  background-image: linear-gradient(100deg, rgba(28,26,24,0.76) 0%, rgba(28,26,24,0.60) 58%, rgba(28,26,24,0.46) 100%), url('assets/mks-249.jpg');
  background-repeat: no-repeat, no-repeat; background-attachment: scroll, fixed;
  background-position: center, center; background-size: auto, cover;
  border-bottom: 1px solid rgba(0,0,0,0.25); box-shadow: none;
  display: flex; align-items: center; gap: 12px; padding: 0 22px; min-height: 58px; }
.side-toggle { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: none;
  border: 1px solid rgba(255,255,255,0.22); border-radius: var(--radius-sm); background: rgba(255,255,255,0.08);
  color: #fff; cursor: pointer; transition: all var(--t-fast); }
.side-toggle:hover { background: var(--brand); border-color: var(--brand); }
.side-toggle .ic svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.top-filters { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* Filter dropdowns restyled for the dark bar */
.topbar .ms-btn { padding: 5px 12px; font-size: var(--fs-caption); background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.22); color: #fff; border-radius: var(--radius-sm); }
.topbar .ms-btn:hover { background: rgba(255,255,255,0.16); border-color: var(--brand); }
.topbar .ms-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.topbar .fq { padding: 5px 12px; font-size: var(--fs-caption); background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.22); color: #fff; }
.topbar .fq.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.topbar .ms-date { color: rgba(255,255,255,0.7); }
.topbar .ms-date input[type="date"] { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.22); color: #fff; }

/* User chip (Viewing-as) */
.user-menu { position: relative; }
.user-chip { display: inline-flex; align-items: center; gap: 7px; padding: 3px 9px 3px 3px;
  border: 1px solid rgba(255,255,255,0.22); border-radius: var(--radius-pill); background: rgba(255,255,255,0.06);
  cursor: pointer; transition: all var(--t-fast); }
.user-chip:hover { background: rgba(255,255,255,0.14); border-color: var(--brand); }
.user-chip .avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: var(--fs-micro); display: inline-flex;
  align-items: center; justify-content: center; flex: none; }
.user-chip .u-name { font-family: var(--font-display); font-size: var(--fs-caption); font-weight: 600; color: #fff; }
.user-chip .u-label { font-size: .6rem; color: rgba(255,255,255,0.5); }
.user-drop { display: none; position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; max-height: 340px;
  overflow-y: auto; background: #fff; border: var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  padding: 5px; z-index: 9999; }
.user-drop.open { display: block; }
.user-drop .ud-head { font-size: var(--fs-micro); text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted);
  font-weight: 600; padding: 7px 9px 4px; }
.user-drop button { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 7px 9px;
  border: none; background: none; border-radius: var(--radius-sm); font-size: .8rem; color: var(--text-body); cursor: pointer; }
.user-drop button:hover { background: var(--bg-hover); }
.user-drop button.sel { color: var(--mks-orange-press); font-weight: 700; }
.user-drop .ud-pref { display: flex; align-items: center; gap: 8px; padding: 8px 9px; margin-top: 4px;
  border-top: 1px solid var(--border, rgba(0,0,0,.08)); font-size: .8rem; color: var(--text-body); cursor: pointer; }
.user-drop .ud-pref input { accent-color: var(--mks-orange, #df6f27); cursor: pointer; }

/* Notification bell + dropdown */
.notif-menu { position: relative; }
.notif-bell { position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; flex: none; cursor: pointer; color: #fff;
  border: 1px solid rgba(255,255,255,0.22); border-radius: var(--radius-sm); background: rgba(255,255,255,0.08);
  transition: all var(--t-fast); }
.notif-bell:hover { background: rgba(255,255,255,0.16); border-color: var(--brand); }
.notif-bell .ic svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.notif-badge { position: absolute; top: -6px; right: -6px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: var(--radius-pill); background: var(--brand); color: #fff; font-family: var(--font-display);
  font-size: .6rem; font-weight: 700; line-height: 16px; text-align: center; border: 1.5px solid var(--mks-ink-900); }
.notif-drop { display: none; position: absolute; right: 0; top: calc(100% + 8px); width: 340px; max-height: 440px;
  overflow-y: auto; background: #fff; border: var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  padding: 4px; z-index: 9999; }
.notif-drop.open { display: block; }
.nd-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 6px;
  font-size: var(--fs-micro); text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); font-weight: 600; }
.nd-allread { border: none; background: none; cursor: pointer; font-size: .68rem; text-transform: none; letter-spacing: 0;
  font-weight: 600; color: var(--mks-orange-press); padding: 2px 4px; border-radius: var(--radius-sm); }
.nd-allread:hover { background: var(--brand-tint); }
.nd-empty { padding: 22px 12px; text-align: center; color: var(--text-muted); font-size: .82rem; }
.notif-item { display: flex; align-items: flex-start; gap: 9px; width: 100%; text-align: left; padding: 9px 10px;
  border: none; background: none; border-radius: var(--radius-sm); cursor: pointer; }
.notif-item:hover { background: var(--bg-hover); }
.notif-item .ni-dot { width: 7px; height: 7px; border-radius: 50%; background: transparent; flex: none; margin-top: 6px; }
.notif-item.unread .ni-dot { background: var(--brand); }
.notif-item.unread .ni-title { font-weight: 700; }
.ni-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ni-title { font-size: .82rem; color: var(--text-body); line-height: 1.35; }
.ni-sub { font-size: .74rem; color: var(--text-muted); line-height: 1.3; overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ni-meta { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: .68rem; color: var(--text-muted); }

/* Content container (replaces .wrap) */
.container { max-width: 1520px; margin: 0 auto; padding: 20px 26px 44px; }

/* Collapsed icon rail */
.app-shell.nav-collapsed { grid-template-columns: 58px 1fr; }
.nav-collapsed .side-brand-txt, .nav-collapsed .nav-lbl, .nav-collapsed .nav-grp,
.nav-collapsed .side-foot span:not(.upd-dot) { display: none; }
.nav-collapsed .side-brand { justify-content: center; padding: 16px 0 14px; }
.nav-collapsed .side-logo { width: 30px; }
.nav-collapsed .nav-item { justify-content: center; padding: 10px 0; gap: 0; }

@media (max-width: 900px) { .app-shell { grid-template-columns: 58px 1fr; } .container { padding: 14px; } }

/* ---- view toggle (list / kanban / grid) ---- */
.viewtoggle { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; margin-left: auto; flex: none; }
.viewtoggle button { background: var(--bg-surface); border: none; padding: 6px 11px; cursor: pointer; color: var(--text-muted); display: inline-flex; align-items: center; }
.viewtoggle button + button { border-left: 1px solid var(--border); }
.viewtoggle button:hover { background: var(--bg-hover); color: var(--text-strong); }
.viewtoggle button.active { background: var(--brand); color: #fff; }
.viewtoggle .ic svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; }

/* ---- Kanban board ---- */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; }
.kcol { flex: 1 0 210px; min-width: 210px; background: var(--bg-subtle); border-radius: var(--radius-lg); padding: 8px; }
.kcol-head { display: flex; align-items: center; justify-content: space-between; padding: 5px 8px 10px; }
.kcol-head .kc-name { font-size: .76rem; font-weight: 700; color: var(--text-strong); }
.kcol-head .kc-n { font-size: .66rem; font-weight: 700; color: var(--text-muted); background: #fff; border-radius: var(--radius-pill); padding: 1px 8px; }
.kcard { background: #fff; border: var(--border); border-radius: var(--radius-md); padding: 9px 10px; margin-bottom: 7px; cursor: pointer; box-shadow: var(--shadow-xs); transition: box-shadow var(--t-fast), transform var(--t-fast); }
.kcard:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kcard .kc-top { display: flex; align-items: center; gap: 8px; }
.kcard .kc-thumb { width: 30px; height: 30px; border-radius: var(--radius-xs); object-fit: cover; background: var(--bg-subtle); flex: none; border: 1px solid var(--border); }
.kcard .kc-tt { min-width: 0; }
.kcard .kc-design { font-family: var(--font-mono); font-size: .8rem; font-weight: 700; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kcard .kc-type { font-size: .66rem; font-weight: 500; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kcard .kc-id { color: var(--text-muted); }
.kcard .kc-desc { font-size: .71rem; color: var(--text-secondary); margin: 6px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kcard .kc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
/* shared latest-note preview (issue cards + rows) */
.note-line { display: flex; align-items: center; gap: 5px; margin-top: 5px; font-size: .68rem; color: var(--text-secondary); min-width: 0; }
.note-line .ic { flex: none; color: var(--text-muted); display: inline-flex; }
.note-line .ic svg { width: 12px; height: 12px; }
.note-line .note-txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.note-line .note-txt b { color: var(--text-strong); font-weight: 600; }
.note-more { flex: none; font-size: .6rem; color: var(--text-muted); background: var(--bg-subtle); border-radius: var(--radius-pill); padding: 0 6px; }

/* ---- Grid gallery ---- */
.grid-view { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
.gcard { background: var(--bg-surface); border: var(--border); border-radius: var(--radius-lg); overflow: hidden; cursor: pointer; box-shadow: var(--shadow-xs); transition: box-shadow var(--t-fast), transform var(--t-fast); }
.gcard:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.gcard .g-imgwrap { position: relative; }
.gcard .g-img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--bg-subtle); display: block; }
.gcard .g-iss { position: absolute; top: 7px; right: 7px; display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 7px; border-radius: var(--radius-pill); background: var(--color-error); color: #fff; font-size: .64rem; font-weight: 700; box-shadow: var(--shadow-sm); }
.gcard .g-iss .ic svg { width: 11px; height: 11px; }
.gcard .g-body { padding: 9px 11px; display: flex; flex-direction: column; gap: 4px; }
.gcard .g-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.gcard .g-code { font-family: var(--font-mono); font-size: .74rem; font-weight: 700; color: var(--text-strong); }
.gcard .g-desc { font-size: .72rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcard .g-cust { color: var(--text-muted); }
.gcard .g-meta { display: flex; align-items: center; gap: 8px; }
.gcard .g-var { font-size: .68rem; color: var(--text-muted); }
.gcard .g-comps { display: flex; gap: 5px; margin-top: 3px; }
.gcard .g-dot { width: 9px; height: 9px; border-radius: 50%; }
/* shared decoded chips */
.metal { display: inline-flex; align-items: center; gap: 4px; font-size: .68rem; color: var(--text-secondary); }
.metal .mdot { width: 8px; height: 8px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); flex: none; }
/* enriched issue (kanban) card */
.kcard .kc-tt { min-width: 0; }
.kcard .kc-sub { font-size: .66rem; color: var(--text-muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kcard .kc-right { display: inline-flex; align-items: center; gap: 7px; }
.kcard .kc-ind { display: inline-flex; align-items: center; gap: 2px; font-size: .64rem; color: var(--text-muted); }
.kcard .kc-ind .ic svg { width: 12px; height: 12px; }
.kcard .kc-age { font-size: .63rem; color: var(--text-muted); }

/* ---- pagination ---- */
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 16px 0 4px; }
.pager:empty { display: none; }
.pg-btn { padding: 7px 14px; font-size: .78rem; font-weight: 600; border: 1px solid var(--border-strong);
  border-radius: var(--radius-md); background: var(--bg-surface); color: var(--text-body); cursor: pointer; transition: all var(--t-fast); }
.pg-btn:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-tint); color: var(--mks-orange-press); }
.pg-btn:disabled { opacity: .4; cursor: default; }
.pg-info { font-size: .78rem; color: var(--text-muted); font-weight: 600; }

/* ---- issue detail v2: sections · photos · outcome · activity · comments ---- */
.di-sec { margin-top: 16px; padding-top: 14px; border-top: var(--border); }
.di-sec-h { font-size: var(--fs-micro); text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted);
  font-weight: 700; margin-bottom: 9px; }

/* outcome notes */
.di-note { font-size: .82rem; color: var(--text-body); background: var(--bg-subtle); border-radius: var(--radius-md);
  padding: 9px 11px; margin-bottom: 7px; white-space: pre-wrap; }
.di-note-l { display: block; font-size: var(--fs-micro); text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); font-weight: 700; margin-bottom: 3px; }

/* defect photo gallery */
.di-photos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; align-items: center; }
.di-photo { width: 62px; height: 62px; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border);
  background: var(--bg-subtle); flex: none; }
.di-photo img { width: 100%; height: 100%; object-fit: cover; }
.di-addphoto { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 600;
  color: var(--text-secondary); background: var(--bg-surface); border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md); padding: 6px 11px; cursor: pointer; }
.di-addphoto:hover { border-color: var(--brand); color: var(--mks-orange-press); }
.di-addphoto .ic svg { width: 13px; height: 13px; }

/* activity timeline */
.di-activity { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.act-t { font-size: .68rem; color: var(--text-muted); font-weight: 500; }
.act-e { display: flex; gap: 9px; }
.act-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mks-blue-grey); margin-top: 5px; flex: none;
  box-shadow: 0 0 0 3px var(--bg-subtle); }
.act-e-body { font-size: .8rem; color: var(--text-body); line-height: 1.4; }
.act-e-body b { color: var(--text-strong); font-weight: 600; }
.act-note { margin-top: 4px; font-size: .78rem; color: var(--text-secondary); background: var(--bg-subtle);
  border-left: 2px solid var(--border-strong); border-radius: var(--radius-xs); padding: 6px 9px; white-space: pre-wrap; }
.act-c { background: var(--bg-subtle); border-radius: var(--radius-md); padding: 9px 11px; }
.act-h { display: flex; align-items: center; gap: 6px; font-size: .78rem; }
.act-h b { color: var(--text-strong); font-weight: 600; }
.act-body { font-size: .82rem; color: var(--text-body); margin-top: 5px; white-space: pre-wrap; line-height: 1.45; }

/* add-comment box */
.di-comment { display: flex; gap: 8px; align-items: flex-start; }
.di-comment textarea { flex: 1; padding: 8px 10px; font-size: .82rem; resize: vertical; min-height: 38px; }
.di-comment .btn { flex: none; }

/* ---- reconcile-before-close dialog + status lines ---- */
.rec-status { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.rec-opt { display: flex; align-items: center; gap: 8px; font-size: .84rem; font-weight: 600; color: var(--text-strong);
  padding: 8px 0; cursor: pointer; }
.rec-opt input { width: auto; }
.rec-pane { padding: 2px 0 10px 24px; }
.rec-portal-link { display: inline-block; margin-top: 6px; font-size: .78rem; font-weight: 600; color: var(--mks-orange-press);
  text-decoration: none; }
.rec-portal-link:hover { text-decoration: underline; }
.rec-warn { display: flex; align-items: center; gap: 7px; margin: 12px 0 4px; font-size: .78rem; font-weight: 600;
  color: var(--color-error); background: var(--color-error-bg); border-radius: var(--radius-md); padding: 8px 11px; }
.rec-warn .ic svg, .rec-ok .ic svg { width: 14px; height: 14px; }
.rec-ok { display: flex; align-items: center; gap: 7px; margin: 12px 0 4px; font-size: .78rem; font-weight: 600;
  color: var(--color-success); background: var(--color-success-bg); border-radius: var(--radius-md); padding: 8px 11px; }

/* reconcile files panel */
.rec-files { border: var(--border); border-radius: var(--radius-md); overflow: hidden; margin: 10px 0 4px; }
.rec-files.rec-dim { opacity: .45; pointer-events: none; }
.rf-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.rf-row:last-child { border-bottom: none; }
.rf-info { flex: 1; min-width: 0; }
.rf-name { font-size: .84rem; font-weight: 700; color: var(--text-strong); }
.rf-sub { font-weight: 500; font-size: .74rem; color: var(--text-muted); }
.rf-cur { display: inline-flex; align-items: center; gap: 5px; margin-top: 3px; font-size: .74rem; color: var(--color-success); }
.rf-miss { display: inline-flex; align-items: center; gap: 5px; margin-top: 3px; font-size: .74rem; color: var(--text-muted); }
.rf-cur .ic svg, .rf-miss .ic svg { width: 13px; height: 13px; }
.rf-group { padding: 8px 12px 2px; font-size: var(--fs-micro); text-transform: uppercase; letter-spacing: .07em;
  font-weight: 600; color: var(--text-muted); background: var(--bg-subtle); border-bottom: 1px solid var(--border); }
.rf-pres { max-height: 220px; overflow-y: auto; }
.rec-nochange { display: flex; align-items: center; gap: 8px; margin: 12px 0 2px; font-size: .82rem;
  font-weight: 600; color: var(--text-strong); cursor: pointer; }
.rec-nochange input { width: auto; }
.foot-spacer { flex: 1; }

/* shared card-detail modal (issue detail from List/Kanban · design detail from Portal List/Grid) */
.card-overlay { z-index: 70; }                       /* below the action modals (txn/rec/ni at 80) */
.card-modal { max-width: 640px; width: 100%; padding: 0; overflow: hidden; position: relative; }
.card-modal-body { max-height: 88vh; overflow-y: auto; }
.card-modal .detail { border: none; box-shadow: none; border-radius: 0; position: static; top: auto; }
.card-x { position: absolute; top: 12px; right: 12px; z-index: 3; width: 30px; height: 30px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; border: none; border-radius: 50%;
  background: rgba(20,20,20,.45); color: #fff; cursor: pointer; }
.card-x:hover { background: rgba(20,20,20,.72); }
/* show the whole design in the modal (contain, not a hard 210px crop) + caption below the image */
.card-modal .hero img { height: 270px; object-fit: contain; background: var(--bg-subtle); display: block; width: 100%; }
.card-modal .hero-ph { height: 180px; background: var(--bg-subtle); }
.card-modal .hero-cap { display: flex; align-items: baseline; gap: 10px; padding: 11px 18px;
  border-bottom: 1px solid var(--border); background: var(--bg-surface); }
.card-modal .hero-cap .d-code { font-family: var(--font-mono); font-size: .76rem; color: var(--text-muted); }
.card-modal .hero-cap .d-desc { font-size: .95rem; font-weight: 600; color: var(--text-strong); }

/* ── Login screen (Entra sign-in gate) — ported from the QC dashboard login.html, tweaked for Microsoft SSO ── */
#loginScreen { position: fixed; inset: 0; z-index: 9999; overflow: hidden; color: #fff; padding: 56px 60px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(100deg, rgba(20,18,16,.92) 0%, rgba(20,18,16,.72) 46%, rgba(20,18,16,.55) 100%),
    url('assets/mks-435.jpg') center/cover no-repeat; }
#loginScreen .accent { position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: linear-gradient(180deg, var(--mks-orange), var(--mks-light-orange)); z-index: 2; }
#loginScreen .lg-top { display: flex; align-items: center; gap: 16px; position: relative; z-index: 1; }
#loginScreen .lg-top img { width: 54px; }
#loginScreen .wm { font-family: var(--font-display); font-weight: 600; font-size: 15px; letter-spacing: .04em; }
#loginScreen .wm small { display: block; color: rgba(255,255,255,.55); font-weight: 400; font-size: 12px; margin-top: 2px; }
#loginScreen .lg-mid { position: relative; z-index: 1; max-width: 560px; }
#loginScreen .eyebrow-o { font-family: var(--font-display); font-weight: 600; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--mks-light-orange); }
#loginScreen .lg-mid h1 { font-family: var(--font-display); font-weight: 600; font-size: 44px; line-height: 1.06; letter-spacing: -.02em; color: #fff; margin: 14px 0 16px; }
#loginScreen .lg-mid p { font-size: 16px; line-height: 1.6; color: rgba(255,255,255,.66); max-width: 430px; }
#loginScreen .lg-foot { position: relative; z-index: 1; font-size: 12.5px; color: rgba(255,255,255,.42); font-style: italic; }
#loginScreen .lg-card { position: absolute; right: 64px; top: 55%; transform: translateY(-50%); z-index: 3;
  width: 388px; min-height: 468px; padding: 40px 34px; color: #fff;
  display: flex; flex-direction: column;
  background: rgba(26,24,22,.55); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,.18); border-radius: var(--radius-lg); box-shadow: var(--shadow-xl); }
#loginScreen .lg-card-logo { width: 46px; margin-bottom: 20px; }
#loginScreen .lg-card h2 { font-family: var(--font-display); font-weight: 600; font-size: 25px; color: #fff; letter-spacing: -.01em; margin: 0 0 6px; }
#loginScreen .lg-card .lede { font-size: 13.5px; line-height: 1.5; color: rgba(255,255,255,.65); margin: 0 0 24px; }
#loginScreen .ms { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 13px;
  border: 1px solid rgba(255,255,255,.28); border-radius: var(--radius-md); font-family: var(--font-display);
  font-weight: 600; font-size: 14px; color: #fff; background: rgba(255,255,255,.12); cursor: pointer; transition: background var(--t-fast); }
#loginScreen .ms:hover { background: rgba(255,255,255,.2); }
#loginScreen .lg-feat-label { font-family: var(--font-display); font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.42); margin: 28px 0 14px; }
#loginScreen .lg-features { display: flex; flex-direction: column; gap: 13px; }
#loginScreen .feat { display: flex; align-items: flex-start; gap: 11px; font-size: 13px; line-height: 1.4; color: rgba(255,255,255,.78); }
#loginScreen .feat svg { flex: none; margin-top: 1px; }
#loginScreen .lg-spacer { flex: 1 1 auto; min-height: 18px; }
#loginScreen .note { text-align: center; font-size: 11.5px; color: rgba(255,255,255,.45); padding-top: 22px; margin: 0;
  border-top: 1px solid rgba(255,255,255,.12); }
@media (max-width: 900px) {
  #loginScreen { padding: 40px 28px 60px; justify-content: center; gap: 28px; }
  #loginScreen .lg-mid p { display: none; }
  #loginScreen .lg-card { position: static; transform: none; width: 100%; max-width: 380px; margin: 0; } }

/* ===== Quick wins: My Profile (#14 Phase C) + Portal version history (#8) ===== */
.user-drop .ud-sep { height: 1px; background: var(--border, rgba(0,0,0,.08)); margin: 4px 0; }

/* My Profile modal */
.avatar.lg { width: 46px; height: 46px; border-radius: 50%; background: var(--brand); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-display);
  font-weight: 700; font-size: 1rem; flex: none; }
.prof-id { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.prof-name { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--text-heading, #1a1a1a); }
.prof-email { font-size: .82rem; color: var(--text-muted); }
.prof-roles { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 5px; }
.prof-chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* Portal version history */
.pfile-actions { margin: 10px 0 4px; }
.hv-grp { margin-bottom: 16px; }
.hv-grp-h { font-family: var(--font-display); font-weight: 700; font-size: .82rem; text-transform: uppercase;
  letter-spacing: .04em; color: var(--mks-orange-press, #b8571e); margin-bottom: 6px; }
.hv-row { display: flex; align-items: center; gap: 10px; padding: 7px 2px; border-bottom: 1px solid var(--border, rgba(0,0,0,.06)); font-size: .82rem; }
.hv-ver { font-family: var(--font-display); font-weight: 700; flex: none; min-width: 96px; }
.hv-meta { color: var(--text-body); flex: 1 1 auto; }
.hv-right { display: flex; align-items: center; gap: 8px; flex: none; }
.hv-cur { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: #00723b; background: rgba(0,176,80,.12); padding: 2px 7px; border-radius: 5px; }
.hv-src { font-size: .74rem; font-weight: 600; color: var(--mks-orange-press, #b8571e); cursor: pointer; }
.hv-src:hover { text-decoration: underline; }
.hv-dl { font-size: .78rem; font-weight: 600; color: var(--brand); }
