/* Magnum Opus Task Tracker – brandbook: Playfair Display (headings), Montserrat (body), Sandstone Gold, Oxford Blue. */
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('../fonts/montserrat-latin-wght-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('../fonts/montserrat-latin-ext-wght-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Playfair Display'; font-style: normal; font-weight: 400 900; font-display: swap; src: url('../fonts/playfair-display-latin-wght-normal.woff2') format('woff2'); }

:root, html[data-theme='light'] {
  color-scheme: light;
  --bg: #F3F2EE; --surface: #FFFFFF; --surface2: #F8F7F4; --border: #E1DED6; --text: #232323; --muted: #5A5A5A;
  --goldtxt: #8A6128; --gold: #9E733A; --primary: #012B56; --onprimary: #FFFFFF; --header: #FFFFFF; --inputbg: #FFFFFF;
  --danger: #A12A1B; --dangerbg: #FBE4E0; --scrim: rgba(10, 34, 63, .45); --focus: #1F5A99; --shadow: 0 8px 28px rgba(10, 34, 63, .16);
  --st-Open-bg: #E3ECF7; --st-Open-fg: #0B3A6E; --st-WIP-bg: #F8EBCB; --st-WIP-fg: #6B4A12; --st-Done-bg: #DDF0EA; --st-Done-fg: #0F5A47;
  --st-Closed-bg: #E8E8E8; --st-Closed-fg: #454545; --st-Reopened-bg: #F8E0DC; --st-Reopened-fg: #8A2417;
  --p0-bg: #8A2417; --p0-fg: #FFFFFF; --p1-bg: #B5530E; --p1-fg: #FFFFFF; --p2-bg: #8A6128; --p2-fg: #FFFFFF; --p3-bg: #1F5A99; --p3-fg: #FFFFFF; --p4-bg: #4A5A6A; --p4-fg: #FFFFFF; --p5-bg: #6B6B6B; --p5-fg: #FFFFFF;
  --a0-bg: #F1E4C8; --a0-fg: #5A3F10; --a1-bg: #D9E4F2; --a1-fg: #0B3A6E; --a2-bg: #E6E3DC; --a2-fg: #3C3C3C;
  --bar-Open: #5B8FCB; --bar-WIP: #D9A441; --bar-Done: #3C9E85; --bar-Closed: #A9A9A9; --bar-Reopened: #C2503F;
}
html[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0A223F; --surface: #0F2E52; --surface2: #0C2745; --border: #24476E; --text: #EDEDED; --muted: #A8B7C9;
  --goldtxt: #F4D98F; --gold: #C9A24F; --primary: #F4D98F; --onprimary: #0A223F; --header: #071B33; --inputbg: #0A223F;
  --danger: #FF9C8F; --dangerbg: #4A1F1C; --scrim: rgba(3, 12, 24, .65); --focus: #8EC1F7; --shadow: 0 8px 28px rgba(0, 0, 0, .5);
  --st-Open-bg: #1B3F6B; --st-Open-fg: #BFD7F5; --st-WIP-bg: #4A3A17; --st-WIP-fg: #F4D98F; --st-Done-bg: #12453A; --st-Done-fg: #A8E6D2;
  --st-Closed-bg: #2B3B4D; --st-Closed-fg: #C5CED8; --st-Reopened-bg: #5A2420; --st-Reopened-fg: #FFC9C2;
  --p0-bg: #FF9C8F; --p0-fg: #3A0D08; --p1-bg: #FFB36B; --p1-fg: #3A1D00; --p2-bg: #F4D98F; --p2-fg: #3A2A00; --p3-bg: #8EC1F7; --p3-fg: #06223F; --p4-bg: #B9C7D6; --p4-fg: #0A223F; --p5-bg: #D0D0D0; --p5-fg: #232323;
  --a0-bg: #4A3A17; --a0-fg: #F4D98F; --a1-bg: #1D4670; --a1-fg: #CFE2F8; --a2-bg: #2B3B4D; --a2-fg: #DCE3EA;
  --bar-Open: #6FA6E6; --bar-WIP: #E8B94F; --bar-Done: #4FBF9F; --bar-Closed: #8294A8; --bar-Reopened: #F0786A;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Montserrat', system-ui, sans-serif; font-size: 14px; line-height: 1.45; min-height: 100vh; }
h1, h2, h3 { font-family: 'Playfair Display', Georgia, serif; font-weight: 700; margin: 0; line-height: 1.18; }
h1 { font-size: 30px; } h2 { font-size: 20px; } h3 { font-size: 17px; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); } .gold { color: var(--goldtxt); } .danger { color: var(--danger); } .b { font-weight: 700; } .sb { font-weight: 600; }
.hide { display: none !important; }
.ic { flex: none; display: block; }

/* ---------- header ---------- */
.hdr { background: var(--header); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.hdr-in { max-width: 1440px; margin: 0 auto; padding: 0 32px; height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.hdr-l { display: flex; align-items: center; gap: 36px; height: 100%; min-width: 0; }
.brand { display: block; flex: none; }
.brand img { display: block; width: 150px; height: 67px; }
.brand .mark { display: none; width: 56px; height: 52px; }
.nav { display: flex; gap: 4px; height: 100%; }
.nav a { display: inline-flex; align-items: center; gap: 8px; padding: 2px 16px 0; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 600; }
.nav a.on { color: var(--primary); border-bottom-color: var(--gold); }
html[data-theme='dark'] .nav a.on { color: var(--goldtxt); }
.hdr-r { display: flex; align-items: center; gap: 12px; }
.vsep { width: 1px; height: 32px; background: var(--border); margin: 0 4px; }
.theme-toggle { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: var(--header); }
.theme-toggle button { height: 34px; min-width: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 12px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; }
.theme-toggle button[aria-pressed='true'] { background: var(--surface2); color: var(--text); border-color: var(--gold); }
.userchip { display: flex; align-items: center; gap: 10px; background: transparent; border: 0; padding: 0; text-align: left; }
.userchip .meta { display: flex; flex-direction: column; line-height: 1.25; }
.userchip .nm { font-size: 13px; font-weight: 600; } .userchip .rl { font-size: 11px; color: var(--muted); }

/* ---------- buttons and form controls ---------- */
.btn { height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; border: 1px solid var(--primary); border-radius: 8px; background: transparent; color: var(--primary); font-weight: 600; white-space: nowrap; }
html[data-theme='dark'] .btn { color: var(--goldtxt); }
.btn.primary { background: var(--primary); color: var(--onprimary); }
html[data-theme='dark'] .btn.primary { color: var(--onprimary); }
.btn.ghost { border-color: transparent; color: var(--muted); }
html[data-theme='dark'] .btn.ghost { color: var(--muted); }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.sm { height: 36px; padding: 0 14px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.icon-btn { width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); display: inline-flex; align-items: center; justify-content: center; position: relative; }
.icon-btn .dot { position: absolute; top: 6px; right: 6px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--primary); color: var(--onprimary); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > .lbl, legend.lbl { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; padding: 0; margin-bottom: 0; }
.field .req { color: var(--danger); }
.field .hint { font-size: 12px; color: var(--muted); }
fieldset.field { border: 0; margin: 0; padding: 0; }
.inp { width: 100%; height: 44px; border: 1px solid var(--border); border-radius: 8px; background: var(--inputbg); color: var(--text); padding: 0 12px; font-size: 14px; }
textarea.inp { height: auto; padding: 12px; line-height: 1.5; resize: vertical; }
.inp[readonly] { background: var(--surface2); }
.inw { position: relative; display: block; }
.inw > .ic { position: absolute; left: 12px; top: 13px; color: var(--muted); pointer-events: none; }
.inw > .inp.l { padding-left: 38px; }
.sel { position: relative; display: block; }
.sel select { appearance: none; -webkit-appearance: none; padding-right: 36px; }
.sel > .ic { position: absolute; right: 12px; top: 13px; color: var(--muted); pointer-events: none; }
.chk { display: flex; align-items: center; gap: 10px; height: 44px; font-size: 14px; }
.chk input { width: 18px; height: 18px; margin: 0; accent-color: var(--gold); }
.err { color: var(--danger); background: var(--dangerbg); border-radius: 8px; padding: 10px 12px; font-size: 13px; font-weight: 600; }
.ok { color: var(--st-Done-fg); background: var(--st-Done-bg); border-radius: 8px; padding: 10px 12px; font-size: 13px; font-weight: 600; }

/* ---------- layout ---------- */
.main { max-width: 1440px; margin: 0 auto; padding: 28px 32px 96px; display: flex; flex-direction: column; gap: 20px; }
.main.narrow { max-width: 1344px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.page-head .t { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.crumbs { display: flex; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 500; }
.crumbs a:hover { text-decoration: underline; } .crumbs .cur { color: var(--text); font-weight: 600; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px; }
.card.pad-s { padding: 20px; }
.card.pad-l { padding: 28px; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.stack-s { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.cols2 { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* ---------- chips, avatars ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-Open { background: var(--st-Open-bg); color: var(--st-Open-fg); } .st-WIP { background: var(--st-WIP-bg); color: var(--st-WIP-fg); }
.st-Done { background: var(--st-Done-bg); color: var(--st-Done-fg); } .st-Closed { background: var(--st-Closed-bg); color: var(--st-Closed-fg); }
.st-Reopened { background: var(--st-Reopened-bg); color: var(--st-Reopened-fg); }
.prio { display: inline-block; min-width: 22px; text-align: center; padding: 4px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.pP0 { background: var(--p0-bg); color: var(--p0-fg); } .pP1 { background: var(--p1-bg); color: var(--p1-fg); } .pP2 { background: var(--p2-bg); color: var(--p2-fg); }
.pP3 { background: var(--p3-bg); color: var(--p3-fg); } .pP4 { background: var(--p4-bg); color: var(--p4-fg); } .pP5 { background: var(--p5-bg); color: var(--p5-fg); }
.od { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--dangerbg); color: var(--danger); font-size: 11px; font-weight: 700; white-space: nowrap; }
.tag { display: inline-block; padding: 3px 9px; border-radius: 6px; border: 1px solid var(--border); color: var(--muted); font-size: 11px; font-weight: 600; white-space: nowrap; }
.tag.me { border-color: var(--gold); color: var(--goldtxt); font-weight: 700; }
.av { flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-weight: 700; width: 28px; height: 28px; font-size: 11px; }
.av.s24 { width: 24px; height: 24px; font-size: 10px; } .av.s30 { width: 30px; height: 30px; } .av.s36 { width: 36px; height: 36px; font-size: 13px; } .av.s38 { width: 38px; height: 38px; font-size: 13px; }
.a0 { background: var(--a0-bg); color: var(--a0-fg); } .a1 { background: var(--a1-bg); color: var(--a1-fg); } .a2 { background: var(--a2-bg); color: var(--a2-fg); }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who .t { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.who .n { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who .s { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- pills ---------- */
.pills { display: flex; gap: 10px; flex-wrap: wrap; }
.pill { height: 36px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 600; }
.pill b { font-weight: 700; opacity: .85; }
.pill.on { background: var(--primary); border-color: var(--primary); color: var(--onprimary); }
.pill.danger { border-color: var(--danger); background: var(--dangerbg); color: var(--danger); }
.pill.danger.on { background: var(--danger); color: var(--dangerbg); }

/* ---------- task table ---------- */
.filters { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; align-items: start; }
.filters .acts { display: flex; align-items: flex-end; gap: 10px; align-self: end; }
.filters .acts .btn:first-child { flex: 1; }
.tbl { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.trow { display: grid; grid-template-columns: 92px minmax(0, 2.6fr) 64px 118px minmax(0, 1.3fr) minmax(0, 1.1fr) 140px 84px; gap: 16px; align-items: center; min-height: 68px; padding: 10px 16px; border-top: 1px solid var(--border); border-left: 3px solid transparent; }
a.trow:hover { background: var(--surface2); }
.trow.late { border-left-color: var(--danger); }
.trow.th { background: var(--surface2); min-height: 0; padding: 14px 16px; border-top: 0; }
.trow.th span { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.c-id { font-size: 13px; font-weight: 700; color: var(--goldtxt); }
.c-title { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.c-title .tt { font-size: 14px; font-weight: 600; line-height: 1.3; }
.c-title .pj { font-size: 12px; color: var(--muted); }
.c-due { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; font-size: 13px; font-weight: 500; }
.c-due.late .d { color: var(--danger); font-weight: 600; } .c-due.done .d { color: var(--muted); }
.c-files { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; font-weight: 600; }
.c-files span { display: inline-flex; align-items: center; gap: 4px; }
.c-cr { display: flex; flex-direction: column; line-height: 1.3; } .c-cr .s { font-size: 11px; color: var(--muted); } .c-cr .n { font-size: 13px; font-weight: 500; }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.empty { padding: 48px 16px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--text); margin-bottom: 6px; }

/* ---------- task detail ---------- */
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper .s { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; color: var(--muted); }
.stepper .s .n { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--border); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.stepper .s.done, .stepper .s.cur { color: var(--text); }
.stepper .s.done .n, .stepper .s.cur .n { background: var(--gold); border-color: var(--gold); color: #fff; }
html[data-theme='dark'] .stepper .s.done .n, html[data-theme='dark'] .stepper .s.cur .n { color: var(--onprimary); }
.stepper .s.cur { font-weight: 700; }
.stepper .ln { flex: 1; height: 2px; background: var(--border); min-width: 20px; } .stepper .ln.done { background: var(--gold); }
.facts > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--border); font-size: 13px; }
.facts > div > span:first-child { color: var(--muted); } .facts > div > span:last-child { font-weight: 600; text-align: right; }
.next { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; background: var(--surface2); border: 1px solid var(--gold); margin-bottom: 6px; }
.next .k { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--goldtxt); }
.files { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ft { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface2); min-width: 0; text-align: left; width: 100%; }
.ft .ico { flex: none; width: 36px; height: 36px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; color: var(--goldtxt); }
.ft .t { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; flex: 1; }
.ft .n { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .ft .s { font-size: 11px; color: var(--muted); }
.ft .x { flex: none; width: 32px; height: 32px; border: 0; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
.ft .prog { height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; margin-top: 4px; } .ft .prog > i { display: block; height: 100%; background: var(--gold); }
.tl { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 16px; }
.tl-rail { display: flex; flex-direction: column; align-items: center; }
.tl-dot { flex: none; width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface2); color: var(--goldtxt); }
.tl-line { flex: 1; width: 2px; background: var(--border); margin-top: 6px; }
.tl-body { flex: 1; min-width: 0; padding-bottom: 26px; } .tl-item:last-child .tl-body { padding-bottom: 0; }
.tl-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.tl-head .w { font-weight: 600; font-size: 14px; } .tl-head .w span { font-weight: 400; color: var(--muted); } .tl-head .when { font-size: 12px; color: var(--muted); }
.note-box { margin-top: 8px; padding: 12px 14px; border-radius: 8px; background: var(--surface2); border: 1px solid var(--border); line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.tl-chips { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.dz { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 20px; border: 2px dashed var(--border); border-radius: 10px; background: var(--surface2); text-align: center; }
.dz.over { border-color: var(--gold); }
.dz .ic-big { color: var(--goldtxt); }
.rcards { display: grid; gap: 10px; }
.rc { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--inputbg); cursor: pointer; }
.rc.l { align-items: flex-start; padding: 14px 16px; gap: 4px; }
.rc input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rc:has(input:checked) { border: 2px solid var(--gold); background: var(--surface2); padding: 11px 5px; }
.rc.l:has(input:checked) { padding: 13px 15px; }
.rc:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.rc .sub { font-size: 12px; color: var(--muted); font-weight: 500; }
.chips { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.mchip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 6px 4px 4px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface2); font-size: 13px; font-weight: 500; }
.mchip button { border: 0; background: transparent; color: var(--muted); width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.mail-note { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 10px; background: var(--surface2); border: 1px solid var(--border); margin-top: 14px; }

/* ---------- summary ---------- */
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.tile { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px; border-radius: 12px; text-align: left; border: 0; }
.tile .k { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.tile .v { font-family: 'Playfair Display', Georgia, serif; font-size: 36px; line-height: 1; font-weight: 700; }
.tile.od { background: var(--dangerbg); color: var(--danger); }
.srow { display: grid; grid-template-columns: minmax(0, 2.2fr) 130px repeat(5, 72px) 60px 72px minmax(0, 1.5fr); gap: 12px; align-items: center; padding: 16px 20px; border-top: 1px solid var(--border); }
.srow.th { background: var(--surface2); border-top: 0; padding: 12px 20px; }
.srow.th span { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.srow.th span { text-align: center; } .srow.th span:first-child, .srow.th span:nth-child(2), .srow.th span:last-child { text-align: left; }
.srow .num { text-align: center; font-size: 14px; } .srow .num.z { color: var(--muted); } .srow .num.t { font-weight: 700; }
.srow .pn { font-size: 14px; font-weight: 600; } .srow .pm { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); flex-wrap: wrap; margin-top: 5px; }
.srow .pm b { color: var(--goldtxt); }
.bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; background: var(--border); }
.bar span { min-width: 4px; }
.seg-Open { background: var(--bar-Open); } .seg-WIP { background: var(--bar-WIP); } .seg-Done { background: var(--bar-Done); } .seg-Closed { background: var(--bar-Closed); } .seg-Reopened { background: var(--bar-Reopened); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.site { white-space: nowrap; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--border); font-size: 11px; font-weight: 700; color: var(--muted); }

/* ---------- users ---------- */
.urow { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(0, 1.2fr) 130px minmax(0, 1.2fr) 90px 90px; gap: 14px; align-items: center; min-height: 64px; padding: 8px 20px; border-top: 1px solid var(--border); text-align: left; width: 100%; background: transparent; border-left: 0; border-right: 0; border-bottom: 0; }
button.urow:hover { background: var(--surface2); }
.urow.th { background: var(--surface2); min-height: 0; padding: 12px 20px; border-top: 0; }
.urow.th span { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.urow.sel { background: var(--surface2); }

/* ---------- login ---------- */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login .box { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 20px; align-items: stretch; }
.login .logo { display: block; margin: 0 auto; width: 180px; height: 80px; }
.login h1 { text-align: center; font-size: 28px; }
.login .sub { text-align: center; color: var(--muted); }
.login .tr { display: flex; justify-content: flex-end; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.codeinp { text-align: center; font-size: 28px; letter-spacing: 10px; font-weight: 700; height: 56px; }

/* ---------- mobile nav, toast, dialog ---------- */
.bnav { display: none; position: fixed; left: 0; right: 0; bottom: 0; height: 72px; z-index: 30; background: var(--header); border-top: 1px solid var(--border); padding: 4px 6px 0; }
.bnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding-top: 6px; font-size: 11px; font-weight: 600; color: var(--muted); }
.bnav a.on { color: var(--primary); font-weight: 700; }
html[data-theme='dark'] .bnav a.on { color: var(--goldtxt); }
.bnav a.add .pl { width: 44px; height: 30px; border-radius: 15px; background: var(--primary); color: var(--onprimary); display: inline-flex; align-items: center; justify-content: center; }
.bnav a.add { color: var(--text); padding-top: 2px; }
.toasts { position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 460px); }
.toast { padding: 12px 16px; border-radius: 10px; background: var(--primary); color: var(--onprimary); font-weight: 600; box-shadow: var(--shadow); }
.toast.bad { background: var(--danger); color: var(--dangerbg); }
html[data-theme='dark'] .toast.bad { background: #FF9C8F; color: #3A0D08; }
dialog { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); padding: 0; width: min(94vw, 520px); box-shadow: var(--shadow); }
dialog::backdrop { background: var(--scrim); }
.dlg { display: flex; flex-direction: column; gap: 16px; padding: 24px; }
.dlg .acts { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.plist { max-height: 340px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.plist label { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-top: 1px solid var(--border); cursor: pointer; }
.plist label:first-child { border-top: 0; }
.plist input { width: 18px; height: 18px; accent-color: var(--gold); margin: 0; }
.ver { position: fixed; right: 10px; bottom: 6px; font-size: 11px; color: var(--muted); z-index: 5; pointer-events: none; }
.loading { padding: 80px 16px; text-align: center; color: var(--muted); }
.spin { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--gold); border-radius: 50%; animation: sp 0.8s linear infinite; margin: 0 auto 12px; }
@keyframes sp { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }

/* ---------- responsive ---------- */
.mfilter { display: none; }
@media (max-width: 1180px) {
  .cols2 { grid-template-columns: minmax(0, 1fr); }
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hdr-r .btn { display: none; }
}
@media (max-width: 900px) {
  h1 { font-size: 24px; }
  .hdr-in { height: 64px; padding: 0 16px; gap: 12px; }
  .brand img { display: none; } .brand .mark { display: block; }
  .nav, .vsep, .userchip .meta { display: none; }
  .theme-toggle button span { display: none; } .theme-toggle button { padding: 0 8px; }
  .bnav { display: flex; }
  .mfilter { display: inline-flex; }
  .main { padding: 16px 16px 112px; gap: 14px; }
  .card, .card.pad-l { padding: 18px; }
  .filters { display: none; grid-template-columns: 1fr 1fr; gap: 12px; }
  .filters.open { display: grid; }
  .filters .wide { grid-column: 1 / -1; }
  .filters .acts { grid-column: 1 / -1; }
  .pills { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
  .pill { flex: none; }
  .tbl { background: transparent; border: 0; border-radius: 0; overflow: visible; display: flex; flex-direction: column; gap: 10px; }
  .trow.th { display: none; }
  .trow { grid-template-columns: auto 1fr auto auto; grid-template-areas: 'id id pri st' 'title title title title' 'asg asg due due'; gap: 10px 8px; padding: 14px; border: 1px solid var(--border); border-left-width: 4px; border-radius: 12px; background: var(--surface); }
  .trow .c-id { grid-area: id; } .trow .c-pri { grid-area: pri; } .trow .c-stage { grid-area: st; }
  .trow .c-title { grid-area: title; } .trow .c-title .tt { font-size: 15px; }
  .trow .c-asg { grid-area: asg; } .trow .c-due { grid-area: due; flex-direction: row; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
  .trow .c-cr, .trow .c-files { display: none; }
  .pager { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
  .files { grid-template-columns: 1fr; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .grid4 { grid-template-columns: 1fr 1fr; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .tile { padding: 12px 14px; } .tile .v { font-size: 26px; } .tile .k { font-size: 11px; }
  .srow.th { display: none; }
  .srow { grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 14px; }
  .srow > .cn { grid-column: 1 / -1; } .srow > .sst, .srow > .num.t, .srow > .num.od, .srow > .endd { display: none; } .srow > .bar { grid-column: 1 / -1; order: 5; } .srow .num::before { content: attr(data-k); display: block; font-size: 10px; font-weight: 600; color: var(--muted); }
  .urow { grid-template-columns: minmax(0, 1fr) auto; } .urow.th, .urow .u-org, .urow .u-si, .urow .u-last { display: none; }
  .rc-6 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .ver { bottom: 76px; }
  .toasts { bottom: 90px; }
  .stepper .s > span:not(.n) { display: none; } .stepper .s.cur > span:not(.n) { display: inline; }
}
@media print { .hdr, .bnav, .ver, .toasts { display: none !important; } }
.c { text-align: center; }
