@font-face { font-family: 'Source Sans 3'; font-weight: 400; font-display: swap; src: url(/fonts/ss3-400.woff2) format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-weight: 600; font-display: swap; src: url(/fonts/ss3-600.woff2) format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-weight: 700; font-display: swap; src: url(/fonts/ss3-700.woff2) format('woff2'); }

:root {
  --navy: #08376b; --navy-2: #0b4a8f; --cyan: #35c0ed; --cyan-soft: #e3f5fc;
  --ink: #071c2d; --muted: #5a6d7c; --faint: #8a9aa6; --line: #e1e8ee; --line-2: #eef2f5;
  --paper: #f4f7fa; --card: #fff; --hover: #f1f6fa;
  --red: #c2341b; --red-soft: #fdecea; --amber: #a35c00; --amber-soft: #fff4e0; --green: #18794e; --green-soft: #e6f4ec;
  --violet: #5b3fb5; --violet-soft: #efeafd;
  --r: 10px; --r-sm: 7px;
  --shadow: 0 1px 2px rgba(7, 28, 45, .06), 0 2px 8px rgba(7, 28, 45, .04);
  --shadow-lg: 0 12px 40px rgba(7, 28, 45, .18);
  --font: 'Source Sans 3', 'Segoe UI', Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.45 var(--font); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
a { color: var(--navy-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
h1 { font-size: 26px; line-height: 1.2; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--cyan-soft); }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 18px 12px 12px; }
.side .logo { display: block; padding: 2px 8px 18px; }
.side .logo img { width: 168px; display: block; }
.side .logo small { display: block; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin-top: 6px; padding-left: 2px; }
.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r-sm); color: var(--ink); font-weight: 500; }
.nav a:hover { background: var(--hover); text-decoration: none; }
.nav a.on { background: var(--cyan-soft); color: var(--navy); font-weight: 600; }
.nav a .n { margin-left: auto; font-size: 12px; background: var(--navy); color: #fff; border-radius: 10px; padding: 0 7px; line-height: 18px; }
.nav svg { width: 17px; height: 17px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.nav-h { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); padding: 14px 10px 4px; }
.side .me { margin-top: auto; display: flex; align-items: center; gap: 9px; padding: 10px 8px 2px; border-top: 1px solid var(--line-2); }
.side .me div { min-width: 0; flex: 1; }
.side .me b { display: block; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side .me small { color: var(--muted); font-size: 12px; }
.main { min-width: 0; padding: 26px 34px 60px; }
.topbar { display: none; }
.page-h { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-h .sub { color: var(--muted); margin-top: 3px; }
.page-h .grow { flex: 1; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.crumb a { color: var(--muted); }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; left: 0; top: 0; width: 250px; transform: translateX(-105%); transition: transform .18s ease; box-shadow: var(--shadow-lg); }
  body.nav-open .side { transform: none; }
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30; background: #fff; border-bottom: 1px solid var(--line); padding: 8px 12px; }
  .topbar img { height: 26px; }
  .main { padding: 18px 14px 60px; }
}

/* ---------- buttons and fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); background: #fff; border-radius: var(--r-sm); padding: 7px 13px; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; color: var(--ink); line-height: 1.25; }
.btn:hover { background: var(--hover); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.pri { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.pri:hover { background: var(--navy-2); }
.btn.good { background: var(--green); border-color: var(--green); color: #fff; }
.btn.warn { color: var(--red); border-color: #f1c7bf; }
.btn.warn:hover { background: var(--red-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.sm { padding: 4px 9px; font-size: 13px; }
.btn.block { width: 100%; }
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.iconbtn { border: 0; background: transparent; padding: 4px 6px; border-radius: 6px; cursor: pointer; color: var(--muted); line-height: 1; }
.iconbtn:hover { background: var(--hover); color: var(--ink); }
.iconbtn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; }

.in, select.in, textarea.in { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: var(--r-sm); padding: 7px 10px; outline: none; min-height: 36px; }
textarea.in { min-height: 70px; resize: vertical; }
.in:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(53, 192, 237, .18); }
.in.bare { border-color: transparent; background: transparent; padding: 4px 6px; min-height: 30px; }
.in.bare:hover { background: var(--hover); }
.in.bare:focus { background: #fff; border-color: var(--cyan); }
.in.err { border-color: var(--red); }
label.f { display: block; }
label.f > span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
label.f > span i { font-style: normal; font-weight: 400; color: var(--faint); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 16px; }
.span2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }
@media (max-width: 760px) { .grid2, .grid3, .grid4 { grid-template-columns: 1fr; } .span2 { grid-column: auto; } }
.chk { display: inline-flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.chk input { margin: 3px 0 0; accent-color: var(--navy); width: 15px; height: 15px; flex: none; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: #fff; }
.seg button { border: 0; background: transparent; padding: 6px 12px; cursor: pointer; font-size: 14px; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--navy); color: #fff; }
.hint { font-size: 13px; color: var(--muted); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.tight { gap: 6px; }
.grow { flex: 1; }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; } .mt-l { margin-top: 26px; }

/* ---------- cards, tables ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card > .hd { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; }
.card > .hd h2, .card > .hd h3 { flex: 1; }
.card > .bd { padding: 4px 16px 16px; }
.card.pad { padding: 18px 20px; }
.section { margin-bottom: 18px; }
.section > h3 { margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.section > h3 .num { width: 22px; height: 22px; border-radius: 50%; background: var(--cyan-soft); color: var(--navy); font-size: 12.5px; display: inline-grid; place-items: center; }

.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.link { cursor: pointer; }
.tbl tr.link:hover td { background: var(--hover); }
.tbl td.ref { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); white-space: nowrap; }
.tbl .t1 { font-weight: 600; }
.tbl .t2 { font-size: 13px; color: var(--muted); }
.tbl.compact td { padding: 6px 8px; }
.tbl-wrap { overflow-x: auto; }
.empty { padding: 26px 16px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 3px; }

/* ---------- pills, avatars, bars ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; padding: 2px 9px; border-radius: 20px; background: var(--line-2); color: var(--muted); white-space: nowrap; line-height: 1.5; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.pill.plain::before { display: none; }
.st-enquiry { background: #eef1f4; color: #50606d; }
.st-engaged { background: #e7eefa; color: #2d5aa8; }
.st-awaiting_docs { background: var(--amber-soft); color: var(--amber); }
.st-in_progress { background: var(--cyan-soft); color: #0b6f93; }
.st-under_review { background: var(--violet-soft); color: var(--violet); }
.st-draft_shared { background: #e6f2f6; color: #1d6e86; }
.st-final_issued { background: var(--green-soft); color: var(--green); }
.st-closed { background: #e8ecef; color: #4b5a66; }
.st-on_hold { background: #fff1d6; color: #8a5a00; }
.st-cancelled { background: var(--red-soft); color: var(--red); }
.t-todo { background: #eef1f4; color: #50606d; }
.t-doing { background: var(--cyan-soft); color: #0b6f93; }
.t-review { background: var(--violet-soft); color: var(--violet); }
.t-returned { background: var(--red-soft); color: var(--red); }
.t-done { background: var(--green-soft); color: var(--green); }
.d-pending { background: #eef1f4; color: #50606d; }
.d-requested { background: var(--amber-soft); color: var(--amber); }
.d-partial { background: #fff1d6; color: #8a5a00; }
.d-received { background: var(--green-soft); color: var(--green); }
.d-na { background: #f3f4f6; color: #8a96a0; }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 5px; background: #eef3f7; color: #3e5566; margin: 1px 3px 1px 0; }
.tag.cyan { background: var(--cyan-soft); color: var(--navy); }
.due-over { color: var(--red); font-weight: 600; }
.due-soon { color: var(--amber); font-weight: 600; }
.av { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: 11.5px; font-weight: 700; flex: none; letter-spacing: .02em; }
.av.lg { width: 34px; height: 34px; font-size: 13px; }
.av.sm { width: 22px; height: 22px; font-size: 10px; }
.avs { display: inline-flex; }
.avs .av { border: 2px solid #fff; margin-left: -6px; }
.avs .av:first-child { margin-left: 0; }
.bar { height: 6px; background: var(--line-2); border-radius: 4px; overflow: hidden; min-width: 60px; }
.bar i { display: block; height: 100%; background: var(--cyan); border-radius: 4px; }
.bar.done i { background: var(--green); }

/* ---------- dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); cursor: pointer; text-align: left; }
.kpi:hover { border-color: #c6d6e2; }
.kpi .v { font-size: 30px; font-weight: 700; line-height: 1.1; color: var(--navy); font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi.alert .v { color: var(--red); }
.dash { display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; align-items: start; }
.dash .col { display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(3, 1fr); } .dash { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.li:last-child { border-bottom: 0; }
.li .body { flex: 1; min-width: 0; }
.li .t1 { font-weight: 600; }
.li .t2 { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li.link { cursor: pointer; border-radius: 6px; }
.li.link:hover { background: var(--hover); }
.pipe { display: flex; flex-direction: column; gap: 6px; }
.pipe .p { display: grid; grid-template-columns: 130px 1fr 28px; align-items: center; gap: 10px; font-size: 13.5px; cursor: pointer; }
.pipe .p .track { height: 10px; background: var(--line-2); border-radius: 5px; overflow: hidden; }
.pipe .p .track i { display: block; height: 100%; background: var(--navy); border-radius: 5px; opacity: .85; }
.pipe .p b { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- board ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.col-b { background: #eaf0f5; border-radius: var(--r); padding: 10px; min-height: 160px; }
.col-b.drop { outline: 2px dashed var(--cyan); background: var(--cyan-soft); }
.col-b h4 { font-size: 13px; display: flex; align-items: center; gap: 6px; margin: 2px 4px 10px; }
.col-b h4 .c { color: var(--muted); font-weight: 400; }
.bcard { background: #fff; border-radius: 8px; padding: 10px 11px; box-shadow: var(--shadow); margin-bottom: 8px; cursor: pointer; border: 1px solid transparent; }
.bcard:hover { border-color: #c6d6e2; }
.bcard .ref { font-size: 12px; color: var(--faint); }
.bcard .t { font-weight: 600; line-height: 1.3; margin: 2px 0; }
.bcard .c { font-size: 13px; color: var(--muted); }
.bcard .m { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12.5px; color: var(--muted); }

/* ---------- toolbar ---------- */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .in { width: auto; min-width: 150px; }
.search { position: relative; }
.search .in { padding-left: 32px; min-width: 260px; }
.search svg { position: absolute; left: 10px; top: 10px; width: 16px; height: 16px; stroke: var(--faint); fill: none; stroke-width: 2; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 4px 11px; font-size: 13px; cursor: pointer; font-weight: 600; color: var(--muted); }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip .x { margin-left: 4px; opacity: .7; }

/* ---------- assignment page ---------- */
.ahead { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px 0; box-shadow: var(--shadow); margin-bottom: 16px; }
.ahead .t { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.ahead .t h1 { flex: 1; min-width: 260px; }
.ahead .client { font-size: 15px; color: var(--muted); margin-top: 3px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 26px; margin: 14px 0 4px; }
.fact { min-width: 0; }
.fact small { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); font-weight: 600; }
.fact span { font-weight: 600; font-size: 14.5px; }
.tabs { display: flex; gap: 2px; margin-top: 12px; overflow-x: auto; }
.tabs a { padding: 9px 13px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--navy); border-bottom-color: var(--cyan); }
.tabs a .c { font-weight: 400; color: var(--faint); margin-left: 3px; }
.banner { border-radius: var(--r-sm); padding: 10px 14px; display: flex; align-items: center; gap: 12px; margin-bottom: 14px; font-size: 14px; flex-wrap: wrap; }
.banner.violet { background: var(--violet-soft); color: #3c2a7d; }
.banner.amber { background: var(--amber-soft); color: #6b3d00; }
.banner.red { background: var(--red-soft); color: #7a1f0f; }
.banner.green { background: var(--green-soft); color: #0f5234; }
.banner .grow { flex: 1; min-width: 200px; }
.props { display: grid; grid-template-columns: 190px 1fr; gap: 2px 14px; align-items: center; }
.props > .k { color: var(--muted); font-size: 14px; padding: 7px 0; align-self: start; }
.props > .v { min-width: 0; padding: 2px 0; }
@media (max-width: 700px) { .props { grid-template-columns: 1fr; } .props > .k { padding-bottom: 0; } }
.savebar { position: sticky; bottom: 14px; z-index: 20; display: flex; gap: 10px; align-items: center; background: var(--ink); color: #fff; border-radius: var(--r); padding: 10px 14px; box-shadow: var(--shadow-lg); margin-top: 16px; }
.savebar .grow { font-weight: 600; }
.savebar .btn { border-color: rgba(255, 255, 255, .25); background: transparent; color: #fff; }
.savebar .btn.pri { background: var(--cyan); border-color: var(--cyan); color: var(--ink); }

.task-row td { vertical-align: top; }
.task-row .ttl { font-weight: 600; }
.task-row.done .ttl { color: var(--muted); text-decoration: line-through; text-decoration-color: #b6c2cb; }
.task-row select.in, .task-row input.in { min-height: 30px; padding: 3px 6px; font-size: 13.5px; }
.tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #b8c6d1; background: #fff; cursor: pointer; display: grid; place-items: center; padding: 0; margin-top: 4px; }
.tick:hover { border-color: var(--green); }
.tick.on { background: var(--green); border-color: var(--green); }
.tick.on::after { content: ''; width: 6px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.tick.rev { border-color: var(--violet); border-style: dashed; cursor: default; }
.rounds { font-size: 13px; color: var(--muted); margin-top: 4px; }
.rounds div { margin-top: 2px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.timeline li:last-child { border-bottom: 0; }
.timeline .when { font-size: 12.5px; color: var(--faint); }
.timeline .what { font-size: 14px; }
.timeline .what b { font-weight: 600; }
.comment { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.comment .meta { font-size: 13px; color: var(--muted); }
.comment .meta b { color: var(--ink); }
.comment .txt { white-space: pre-wrap; margin-top: 2px; word-wrap: break-word; }

/* ---------- new assignment ---------- */
.form-wrap { display: grid; grid-template-columns: 1fr 300px; gap: 18px; align-items: start; }
.summary { position: sticky; top: 20px; }
@media (max-width: 1100px) { .form-wrap { grid-template-columns: 1fr; } .summary { position: static; } }
.suggest { position: relative; }
.suggest .menu { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow-lg); z-index: 25; max-height: 280px; overflow: auto; }
.suggest .menu button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 12px; cursor: pointer; }
.suggest .menu button:hover, .suggest .menu button.hl { background: var(--hover); }
.suggest .menu button small { display: block; color: var(--muted); font-size: 12.5px; }
.suggest .menu .new { border-top: 1px solid var(--line-2); color: var(--navy-2); font-weight: 600; }
.plist { border: 1px solid var(--line); border-radius: var(--r-sm); max-height: 300px; overflow: auto; background: #fff; }
.plist .cat { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 600; padding: 9px 12px 3px; position: sticky; top: 0; background: #fff; }
.plist label { display: flex; gap: 8px; padding: 5px 12px; cursor: pointer; font-size: 14px; }
.plist label:hover { background: var(--hover); }
.plist input { accent-color: var(--navy); }
.qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px 18px; }
.q { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; }
.q .seg button { padding: 4px 10px; font-size: 13px; }
.regs { display: flex; flex-direction: column; }
.reg { display: flex; gap: 9px; align-items: flex-start; padding: 7px 4px; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.reg:last-child { border-bottom: 0; }
.reg input { margin-top: 3px; accent-color: var(--navy); }
.reg .why { font-size: 12.5px; color: var(--muted); }
.reg .lvl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 1px 6px; border-radius: 4px; }
.lvl.Default { background: var(--cyan-soft); color: var(--navy); }
.lvl.Conditional { background: var(--amber-soft); color: var(--amber); }
.reggrp { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 600; margin: 14px 0 4px; }
details.more summary { cursor: pointer; color: var(--navy-2); font-weight: 600; font-size: 14px; margin-top: 10px; }
.checklist label { display: flex; gap: 8px; padding: 4px 0; font-size: 14px; align-items: flex-start; }
.checklist label input { margin-top: 3px; accent-color: var(--navy); }
.checklist .rv { font-size: 11px; color: var(--violet); background: var(--violet-soft); border-radius: 4px; padding: 0 5px; margin-left: 4px; font-weight: 700; }

/* ---------- modal and toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(7, 28, 45, .42); z-index: 60; display: grid; place-items: center; padding: 18px; animation: fade .12s ease; }
.modal { background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.modal.wide { width: min(820px, 100%); }
.modal .mh { padding: 18px 22px 6px; display: flex; align-items: center; gap: 10px; }
.modal .mh h2 { flex: 1; }
.modal .mb { padding: 8px 22px 6px; overflow: auto; }
.modal .mf { padding: 14px 22px 18px; display: flex; gap: 10px; justify-content: flex-end; }
@keyframes fade { from { opacity: 0; } }
.toasts { position: fixed; right: 18px; top: 16px; z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { background: var(--ink); color: #fff; border-radius: 9px; padding: 10px 14px; box-shadow: var(--shadow-lg); max-width: 420px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; animation: up .16s ease; }
.toast.ok::before { content: '✓'; color: #7be0a7; font-weight: 700; }
.toast.err { background: #8d1f0c; }
.toast.err::before { content: '!'; font-weight: 700; width: 18px; height: 18px; border-radius: 50%; background: rgba(255, 255, 255, .2); display: grid; place-items: center; flex: none; font-size: 12px; }
.toast button { background: transparent; border: 1px solid rgba(255, 255, 255, .4); color: #fff; border-radius: 6px; padding: 1px 8px; cursor: pointer; margin-left: 6px; }
@keyframes up { from { transform: translateY(8px); opacity: 0; } }
.saving { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 90; background: linear-gradient(90deg, transparent, var(--cyan), transparent); background-size: 50% 100%; background-repeat: no-repeat; animation: slide 1s linear infinite; }
@keyframes slide { from { background-position: -50% 0; } to { background-position: 150% 0; } }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background:
  radial-gradient(1200px 500px at 85% -10%, rgba(53, 192, 237, .18), transparent 60%),
  radial-gradient(900px 500px at -10% 110%, rgba(8, 55, 107, .12), transparent 60%), var(--paper); }
.login .box { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 38px 38px 30px; width: min(420px, 100%); text-align: center; }
.login img { width: 230px; }
.login .sub { font-size: 11.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--faint); margin: 10px 0 26px; }
.login h1 { font-size: 22px; margin-bottom: 6px; }
.login p { color: var(--muted); margin: 0 0 22px; }
.gbtn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; border: 1px solid #c9d3db; background: #fff; border-radius: 9px; padding: 11px 14px; font-weight: 600; font-size: 15.5px; cursor: pointer; color: var(--ink); }
.gbtn:hover { background: var(--hover); text-decoration: none; }
.gbtn svg { width: 20px; height: 20px; }
.login .note { margin-top: 20px; font-size: 13px; color: var(--faint); }
.login .msg { background: var(--red-soft); color: #7a1f0f; border-radius: 8px; padding: 9px 12px; font-size: 14px; margin-bottom: 16px; text-align: left; }

/* ---------- admin ---------- */
.subnav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.subnav a { padding: 6px 12px; border-radius: 20px; color: var(--muted); font-weight: 600; font-size: 14px; border: 1px solid transparent; }
.subnav a:hover { background: #fff; border-color: var(--line); text-decoration: none; }
.subnav a.on { background: var(--navy); color: #fff; }
.split { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
@media (max-width: 960px) { .split { grid-template-columns: 1fr; } }
.perm-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; }
@media (max-width: 600px) { .perm-list { grid-template-columns: 1fr; } }
.code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; background: var(--line-2); padding: 1px 6px; border-radius: 4px; }
.inactive td { opacity: .5; }
@media print { .side, .topbar, .tabs, .btn, .savebar { display: none !important; } .shell { display: block; } }

.row > .in.grow, .row > input.in:not([type=date]):not([type=number]) { width: auto; flex: 1; min-width: 160px; }
.task-row .tick { margin-top: 2px; }
