:root {
  --bg: #f4f5fa; --panel: #ffffff; --ink: #1c1b2e; --muted: #6a6a82; --line: #e2e3ee; --line2: #eef0f7;
  --navy: #251b6b; --navy-2: #3a2f8f; --orange: #e8411b; --purple: #8a5ca0; --blue: #3f7fb5; --green: #4f8a5b;
  --ok: #2f8f4e; --warn: #c98a00; --bad: #d23b2a; --sel: #ece9fb; --hover: #f6f5fd;
  --bar: #6c5fc7; --shadow: 0 1px 2px rgba(28,27,46,.06), 0 6px 20px rgba(28,27,46,.07);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12111c; --panel: #1b1a2a; --ink: #ecebf6; --muted: #9e9db6; --line: #2e2d42; --line2: #25243a;
    --navy: #8f84f0; --navy-2: #a79df5; --sel: #2a2750; --hover: #232240; --bar: #8f84f0;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.3);
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
/* faint blueprint grid behind the working screens */
.view { background-image: linear-gradient(var(--line2) 1px, transparent 1px), linear-gradient(90deg, var(--line2) 1px, transparent 1px); background-size: 40px 40px; background-position: -1px -1px; }
.view.flush { background-image: none; }
.side { background: linear-gradient(180deg, #1d1555 0%, #251b6b 70%, #3a2a7c 100%); }
.hidden { display: none !important; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--navy); }
.num { font-variant-numeric: tabular-nums; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: #1b1466 url(/bg.svg) center bottom / cover no-repeat; }
.login-card { backdrop-filter: blur(2px); box-shadow: 0 20px 60px rgba(8, 5, 40, .45); }
.login-card { width: min(380px, 100%); background: var(--panel); border-radius: 16px; padding: 30px 28px; box-shadow: var(--shadow); display: grid; gap: 12px; }
.login-card h1 { font-size: 24px; margin-top: 6px; }
.login-card .sub { margin: -6px 0 6px; color: var(--muted); }
.login-card label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.login-card input { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); font-size: 15px; }
.logo-login { width: 150px; height: auto; display: block; margin: 0 0 4px; }
.side-head { flex-direction: column; align-items: flex-start !important; gap: 8px !important; }
.logo-badge { background: #fff; border-radius: 10px; padding: 7px 10px; width: 100%; }
.logo-badge img { display: block; width: 100%; max-width: 150px; height: auto; }
.proj-pick { display: grid; gap: 4px; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; opacity: .9; padding: 0 4px 12px; font-weight: 700; color: #b8b3ee; }
.proj-pick select { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 8px; padding: 8px 9px; font-size: 13px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.proj-pick select option { color: #1c1b2e; }
.side-title b { font-size: 14px; line-height: 1.25; display: block; }
.co-name { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-top: 4px; }
.fine { font-size: 11px; color: var(--muted); text-align: center; margin: 4px 0 0; }
.err { color: var(--bad); min-height: 18px; font-size: 13px; }
.brand-mark { width: 44px; height: 44px; border-radius: 11px; background: var(--navy); display: grid; align-content: center; gap: 5px; padding: 0 10px; }
.brand-mark span { height: 5px; border-radius: 2px; background: var(--orange); display: block; }
.brand-mark span:nth-child(2) { background: #fff; width: 75%; }
.brand-mark.sm { width: 34px; height: 34px; gap: 4px; padding: 0 8px; flex: none; }
.brand-mark.sm span { height: 4px; }

/* shell */
.app { display: grid; grid-template-columns: 220px 1fr; height: 100vh; }
.side { background: #1d1555; color: #d8d5f4; display: flex; flex-direction: column; padding: 14px 10px; overflow-y: auto; }
.side-head { display: flex; gap: 10px; align-items: center; padding: 4px 8px 16px; color: #fff; }
.side-head small { display: block; opacity: .65; font-size: 11px; }
#nav { display: grid; gap: 2px; }
#nav button { text-align: left; background: none; border: 0; color: inherit; padding: 9px 12px; border-radius: 8px; cursor: pointer; display: flex; gap: 10px; align-items: center; }
#nav button:hover { background: rgba(255,255,255,.08); }
#nav button.on { background: rgba(255,255,255,.16); color: #fff; font-weight: 600; }
#nav .ico { width: 18px; text-align: center; opacity: .85; }
#nav .sep { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; opacity: .5; padding: 14px 12px 4px; }
.side-foot { margin-top: auto; padding: 14px 8px 4px; font-size: 12px; display: grid; gap: 4px; }
.side-foot .link { background: none; border: 0; color: #b8b3ee; text-align: left; padding: 2px 0; cursor: pointer; text-decoration: underline; }
.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.top { display: flex; align-items: center; gap: 12px; padding: 10px 20px; background: var(--panel); border-bottom: 1px solid var(--line); flex: none; }
.top h2 { font-size: 18px; flex: 1; }
.top-r { display: flex; gap: 10px; align-items: center; }
.asof { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.asof input { padding: 5px 7px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); }
.menu-btn { display: none; }
.view { flex: 1; overflow: auto; padding: 18px 20px 40px; min-height: 0; }
.view.flush { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.banner { background: #fff3cd; color: #5c4400; padding: 8px 20px; font-size: 13px; border-bottom: 1px solid #ecd58a; }
.banner.bad { background: #fde3df; color: #7a1d12; border-color: #f0b3aa; }

/* controls */
.btn { padding: 7px 13px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-weight: 550; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { filter: brightness(1.1); background: var(--navy); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #12111c; } }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.sm { padding: 3px 9px; font-size: 12px; }
.btn.wide { width: 100%; padding: 11px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; width: 34px; height: 34px; cursor: pointer; }
input, select, textarea { padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); min-width: 0; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--navy-2); outline-offset: 1px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 16px 18px; }
.card h3 { font-size: 14px; margin-bottom: 10px; }
.grid { display: grid; gap: 14px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; border-top: 3px solid var(--navy); }
.kpi small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 650; }
.kpi b { display: block; font-size: 22px; margin: 3px 0 1px; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 12px; color: var(--muted); }
.kpi.ok { border-top-color: var(--ok); } .kpi.warn { border-top-color: var(--warn); } .kpi.bad { border-top-color: var(--bad); }
.kpi.ok b { color: var(--ok); } .kpi.bad b { color: var(--bad); }
.cols2 { display: grid; grid-template-columns: 3fr 2fr; gap: 14px; }
.cols2e { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* tables */
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 7px 9px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
table.t td { padding: 6px 9px; border-bottom: 1px solid var(--line2); vertical-align: top; }
table.t tr:hover td { background: var(--hover); }
table.t td.r, table.t th.r { text-align: right; }
.tablewrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.chip { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; background: var(--sel); color: var(--navy); }
.chip.ok { background: #dff3e6; color: #1d6b38; } .chip.bad { background: #fde3df; color: #9a2a1b; } .chip.warn { background: #fff0c8; color: #7a5800; }
.muted { color: var(--muted); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar .grow { flex: 1; }
.bar { height: 8px; border-radius: 4px; background: var(--line2); overflow: hidden; position: relative; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ok); border-radius: 4px; }
.bar i.plan { background: rgba(108,95,199,.35); }
.tabs { display: flex; gap: 4px; margin-bottom: 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs button { background: none; border: 0; padding: 8px 14px; cursor: pointer; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; }
.tabs button.on { color: var(--navy); border-bottom-color: var(--navy); }

/* schedule / gantt */
.sched-bar { padding: 10px 20px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-bottom: 1px solid var(--line); background: var(--panel); flex: none; }
.sched-bar input[type=search] { width: 200px; }
.gwrap { flex: 1; overflow: auto; position: relative; background: var(--panel); min-height: 0; }
.ghead { position: sticky; top: 0; z-index: 5; display: flex; height: 44px; background: var(--panel); border-bottom: 1px solid var(--line); }
.gleft { position: sticky; left: 0; z-index: 4; background: var(--panel); flex: none; display: flex; border-right: 1px solid var(--line); }
.ghead .gleft { z-index: 6; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; align-items: end; }
.gc { padding: 0 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: flex; align-items: center; flex: none; }
.ghead .gc { padding-bottom: 5px; }
.gtime { position: relative; flex: none; }
.gm { position: absolute; top: 0; height: 44px; border-left: 1px solid var(--line); font-size: 10px; color: var(--muted); padding: 3px 4px; white-space: nowrap; }
.gm b { display: block; font-size: 11px; color: var(--ink); }
.grows { position: relative; }
.grow { position: absolute; left: 0; display: flex; height: 26px; border-bottom: 1px solid var(--line2); cursor: default; }
.grow:hover .gleft, .grow:hover { background: var(--hover); }
.grow.sel .gleft, .grow.sel { background: var(--sel); }
.grow .gleft { height: 26px; }
.grow.l0 { font-weight: 700; background: #f0eef9; } .grow.l0 .gleft { background: #f0eef9; }
.grow.l1 { font-weight: 600; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .grow.l0, :root:not([data-theme="light"]) .grow.l0 .gleft { background: #24224a; } }
.grow .tg { cursor: pointer; width: 16px; text-align: center; flex: none; color: var(--muted); user-select: none; }
.gt { position: relative; height: 26px; flex: none; }
.gt .grid-v { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line2); }
.gb { position: absolute; top: 7px; height: 12px; border-radius: 3px; background: var(--bar); min-width: 2px; }
.gb .pf { position: absolute; inset: 0 auto 0 0; background: rgba(0,0,0,.28); border-radius: 3px 0 0 3px; }
.gb.sum { height: 8px; top: 9px; border-radius: 0; clip-path: polygon(0 0, 100% 0, 100% 100%, calc(100% - 4px) 60%, 4px 60%, 0 100%); }
.gb.ms { width: 12px; height: 12px; min-width: 12px; transform: rotate(45deg); border-radius: 2px; margin-left: -6px; background: var(--orange); top: 7px; }
.gbl { position: absolute; top: 20px; height: 3px; background: #9a98b0; border-radius: 2px; opacity: .8; }
.gtoday { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--orange); opacity: .7; z-index: 2; pointer-events: none; }
.late { color: var(--bad); font-weight: 600; }
.pk0 { --bar: #251b6b; } .pk1 { --bar: #251b6b; }
.pk-groundwork { --bar: #3a2f8f; } .pk-env { --bar: #e8411b; } .pk-mep { --bar: #3f7fb5; } .pk-life { --bar: #8a5ca0; } .pk-ext { --bar: #4f8a5b; } .pk-pre { --bar: #7b7a93; }

/* drawer */
.drawer { position: fixed; right: 0; top: 0; bottom: 0; width: min(460px, 100vw); background: var(--panel); border-left: 1px solid var(--line); box-shadow: -8px 0 30px rgba(0,0,0,.12); z-index: 40; overflow-y: auto; padding: 18px 20px 40px; }
.drawer h3 { font-size: 16px; line-height: 1.3; }
.drawer .x { position: absolute; right: 12px; top: 10px; }
.drawer section { margin-top: 18px; }
.drawer h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; }
.field { display: grid; gap: 3px; margin-bottom: 9px; font-size: 12px; color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea { font-weight: 400; color: var(--ink); font-size: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.term { border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; margin-bottom: 7px; display: grid; gap: 6px; font-size: 13px; }
.term .tr { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.term select, .term input { padding: 3px 6px; font-size: 13px; }
.term input[type=number] { width: 64px; }
.pickres { border: 1px solid var(--line); border-radius: 8px; max-height: 190px; overflow: auto; margin-top: 4px; }
.pickres button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 6px 9px; cursor: pointer; font-size: 12px; border-bottom: 1px solid var(--line2); }
.pickres button:hover { background: var(--hover); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-variant-numeric: tabular-nums; }
.modal-wrap { position: fixed; inset: 0; background: rgba(15,12,40,.55); z-index: 60; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--panel); border-radius: 14px; width: min(520px, 100%); max-height: 90vh; overflow: auto; padding: 22px; box-shadow: var(--shadow); }
.modal h3 { margin-bottom: 12px; font-size: 17px; }
.modal .acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(30px); background: #1d1555; color: #fff; padding: 10px 16px; border-radius: 9px; opacity: 0; transition: .25s; z-index: 80; pointer-events: none; max-width: 90vw; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.bad { background: var(--bad); }
.matrix td, .matrix th { white-space: nowrap; font-size: 12px; }
.matrix td.cell { cursor: pointer; line-height: 1.25; }
.matrix td.cell:hover { background: var(--sel); }
.sticky1 { position: sticky; left: 0; background: var(--panel); z-index: 2; font-weight: 600; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
svg text { font-family: inherit; }
pre.notes { white-space: pre-wrap; font: inherit; margin: 0; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: -240px; top: 0; bottom: 0; width: 230px; z-index: 50; transition: left .2s; }
  .side.open { left: 0; }
  .menu-btn { display: inline-block; }
  .cols2, .cols2e { grid-template-columns: 1fr; }
  .top { padding: 8px 12px; } .view { padding: 12px 12px 40px; }
  .asof { display: none; }
  .sched-bar { padding: 8px 12px; }
}

/* light sidebar: logo sits on white, brand colours for the active item */
.side { background: var(--panel); color: var(--ink); border-right: 1px solid var(--line); }
.side-head { color: var(--ink); }
.logo-badge { background: transparent; padding: 4px 2px 0; border-radius: 0; }
.side-title small { color: var(--muted); opacity: 1; }
.proj-pick { color: var(--muted); }
.proj-pick select { background: var(--bg); color: var(--ink); border: 1px solid var(--line); }
.proj-pick select option { background: var(--panel); color: var(--ink); }   /* dropdown list follows the theme (dark text on a dark list hid the other projects) */
#nav button { color: var(--muted); }
#nav button:hover { background: var(--hover); color: var(--ink); }
#nav button.on { background: var(--sel); color: var(--navy); box-shadow: inset 3px 0 0 var(--orange); }
.side-foot { border-top: 1px solid var(--line); margin-top: auto; color: var(--muted); }
.side-foot .link { color: var(--navy); }

/* updates (daily / weekly / month-end) */
.upd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 4px 16px; }
.upd-grid .field.wide { grid-column: 1 / -1; }
.upd-grid .field textarea { resize: vertical; min-height: 64px; }
.upd-sec { grid-column: 1 / -1; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 10px 0 2px; }
.nb { margin-left: auto; background: var(--bad); color: #fff; border-radius: 99px; font-size: 11px; font-weight: 700; padding: 1px 7px; }

/* quick update cards */
.qsave { position: sticky; top: 0; z-index: 5; display: flex; gap: 8px; align-items: center; padding: 8px 12px; margin: 0 0 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.qsave .grow { flex: 1; }
.qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; align-items: start; }
.qcard { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.qcard.changed { border-color: var(--navy-2); box-shadow: 0 0 0 2px var(--sel); }
.qcard.bad { border-color: var(--bad); box-shadow: 0 0 0 2px #fde3df; }
.qhead { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; line-height: 1.3; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg button { padding: 9px 4px; border: 1px solid var(--line); background: var(--bg); border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 13px; }
.seg button.on { color: #fff; border-color: transparent; }
.seg button.on.notstarted { background: var(--bad); } .seg button.on.active { background: var(--blue); } .seg button.on.done { background: var(--ok); }
.qrow { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; margin-top: 10px; }
.qnote { width: 100%; margin-top: 10px; }

/* dashboard "needs attention" rows are clickable update entries */
.attn-row { display: flex; gap: 8px; padding: 7px 6px; border-bottom: 1px solid var(--line2); cursor: pointer; font-size: 13px; border-radius: 6px; align-items: flex-start; }
.attn-row:hover { background: var(--hover); }
.late-box { margin-top: 8px; padding: 9px 11px; border-radius: 8px; background: #fdeceb; color: #7a1d12; font-size: 13px; }

/* right-click menu */
.ctx { position: fixed; z-index: 90; min-width: 230px; max-width: 320px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 34px rgba(15, 12, 40, .28); padding: 5px; font-size: 13px; }
.ctx-item { display: flex; gap: 8px; align-items: center; width: 100%; text-align: left; background: none; border: 0; padding: 7px 9px; border-radius: 7px; cursor: pointer; color: var(--ink); }
.ctx-item:hover:not(:disabled) { background: var(--sel); }
.ctx-item:disabled { opacity: .45; cursor: default; }
.ctx-ico { width: 16px; text-align: center; color: var(--navy); }
.ctx-sep { height: 1px; background: var(--line); margin: 4px 2px; }
.ctx-head { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 5px 9px 3px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* global notices */
.notices { display: grid; gap: 0; }
.notices:empty { display: none; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 10px 20px; border-bottom: 1px solid var(--line); font-size: 13px; }
.notice-tag { flex: none; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 2px 9px; border-radius: 99px; margin-top: 1px; }
.notice-body { flex: 1; min-width: 0; white-space: pre-wrap; }
.notice-meta { color: var(--muted); font-size: 11px; margin-top: 2px; }
.notice-x { flex: none; background: none; border: 0; font-size: 20px; line-height: 1; cursor: pointer; color: var(--muted); padding: 0 4px; }
.notice.info { background: #eaf2fb; } .notice.info .notice-tag { background: #3f7fb5; color: #fff; }
.notice.important { background: #fff3cd; } .notice.important .notice-tag { background: #c98a00; color: #fff; }
.notice.urgent { background: #fde3df; } .notice.urgent .notice-tag { background: #d23b2a; color: #fff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .notice.info { background: #1b2b3f; } :root:not([data-theme="light"]) .notice.important { background: #3a3014; } :root:not([data-theme="light"]) .notice.urgent { background: #3f1d19; }
}

/* quick update: table view */
.viewsw { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.viewsw button { border: 0; background: var(--panel); padding: 6px 13px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); }
.viewsw button.on { background: var(--navy); color: #fff; }
.ut-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
table.ut { border-collapse: separate; border-spacing: 0; }
table.ut th { top: 52px; z-index: 3; box-shadow: 0 1px 0 var(--line); padding: 10px 9px; }
table.ut td { vertical-align: middle; padding: 9px; }
.ut-row { transition: background .15s; }
.ut-row.changed td:first-child { box-shadow: inset 4px 0 0 var(--navy-2); }
.ut-row.changed { background: var(--sel); }
.ut-row.isdone { background: #eef8f1; }
.ut-row.bad td:first-child { box-shadow: inset 4px 0 0 var(--bad); }
.ut-row.bad { background: #fdf0ee; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ut-row.isdone { background: #1b2e22; } :root:not([data-theme="light"]) .ut-row.bad { background: #3a1d1a; } }
.ut-act { min-width: 260px; max-width: 460px; }
.ut-name { font-weight: 600; line-height: 1.3; }
.ut-sub { font-size: 12px; }
.ut-err { font-size: 12px; margin-top: 2px; }
.ut-nowrap { white-space: nowrap; }
.sg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg); }
.sg button { border: 0; background: none; padding: 6px 9px; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--muted); white-space: nowrap; }
.sg button + button { border-left: 1px solid var(--line); }
.sg button.on { color: #fff; }
.sg button.on.notstarted { background: var(--bad); } .sg button.on.active { background: var(--blue); } .sg button.on.done { background: var(--ok); }
table.ut select, table.ut input { font-size: 13px; padding: 5px 7px; max-width: 100%; }
table.ut select.needs { border-color: var(--bad); background: #fff7f6; }
table.ut td input[type=text], table.ut td input:not([type]) { width: 100%; min-width: 150px; }
/* quick update table: fit the screen without sideways scrolling */
.ut-act { min-width: 200px; max-width: 320px; }
table.ut select { max-width: 172px; }
table.ut td input[type=text], table.ut td input:not([type]) { min-width: 110px; width: 130px; }
table.ut td { padding: 8px 7px; }
.sg button { padding: 6px 7px; }
.kpi.click { cursor: pointer; } .kpi.click:hover { box-shadow: 0 2px 10px rgba(30,30,80,.12); }
.wx-corner { float: right; width: 310px; margin: 0 0 14px 16px; }
.wx { background: linear-gradient(160deg, #f3f7ff 0%, #fbfcff 55%, #fff7ec 100%); border: 1px solid #e3e8f5; border-radius: 16px; padding: 14px 16px 10px; box-shadow: 0 4px 16px rgba(40, 60, 120, .08); font-size: 12px; color: #2a2f45; }
.wx-place { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #6b7390; font-weight: 600; }
.wx-main { display: flex; align-items: center; gap: 8px; margin: 6px 0 4px; }
.wx-main .wx-i { font-size: 30px; }
.wx-temp { font-size: 34px; font-weight: 700; line-height: 1; }
.wx-cond { font-size: 14px; color: #4a5170; margin-left: 2px; }
.wx-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.wx-pills span { background: #eaeefa; color: #4a5170; border-radius: 999px; padding: 2px 9px; font-size: 11px; }
.wx-days { display: grid; gap: 4px; }
.wx-row { display: grid; grid-template-columns: 62px 22px 62px 1fr 34px; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 10px; }
.wx-row.wet { background: rgba(66, 133, 244, .10); }
.wx-d { font-weight: 600; } .wx-t2 { text-align: right; font-variant-numeric: tabular-nums; } .wx-p { text-align: right; color: #4a5170; font-variant-numeric: tabular-nums; }
.wx-bar { height: 6px; border-radius: 999px; background: #e3e8f5; overflow: hidden; }
.wx-bar i { display: block; height: 100%; border-radius: 999px; background: #5b9cf6; }
.wx-i { font-size: 17px; text-align: center; }
.wx-i.sun { color: #f0a020; } .wx-i.cloud { color: #8a93ad; } .wx-i.rain { color: #3f82e8; } .wx-i.storm { color: #7a5cd6; } .wx-i.fog { color: #9aa3b8; }
.wx-tip { margin-top: 8px; padding: 6px 10px; border-radius: 10px; font-size: 11.5px; font-weight: 600; }
.wx-tip.wet { background: #fff1d6; color: #8a5a00; } .wx-tip.dry { background: #e3f5ea; color: #1f6b3b; }
.wx-src { margin-top: 6px; font-size: 10.5px; color: #8a93ad; text-align: right; }
@media (max-width: 800px) { .wx-corner { float: none; width: auto; margin: 0 0 14px; } }
.qrain-ask { box-shadow: 0 0 0 2px rgba(210, 59, 42, .35); }

/* theme choice (Settings in the sidebar): Auto follows the device; Light and Dark force it. forced dark = the dark rules above, applied by attribute */
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
    --bg: #12111c; --panel: #1b1a2a; --ink: #ecebf6; --muted: #9e9db6; --line: #2e2d42; --line2: #25243a;
    --navy: #8f84f0; --navy-2: #a79df5; --sel: #2a2750; --hover: #232240; --bar: #8f84f0;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.3);
  }
:root[data-theme="dark"] .btn.primary { color: #12111c; }
:root[data-theme="dark"] .grow.l0, :root[data-theme="dark"] .grow.l0 .gleft { background: #24224a; }
:root[data-theme="dark"] .notice.info { background: #1b2b3f; } :root[data-theme="dark"] .notice.important { background: #3a3014; } :root[data-theme="dark"] .notice.urgent { background: #3f1d19; }
:root[data-theme="dark"] .ut-row.isdone { background: #1b2e22; } :root[data-theme="dark"] .ut-row.bad { background: #3a1d1a; }
.rep-item { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line2); }
.card > h3 + .rep-item { border-top: 0; }
.rep-row { cursor: pointer; } .rep-row:hover { background: var(--hover); }
.rep-detail { display: grid; gap: 4px; padding: 6px 4px; white-space: pre-wrap; font-size: 13px; }
.card + .card { margin-top: 14px; }
.theme-pick { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); padding: 2px 0 6px; }
.theme-pick select { background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; font-size: 12px; }
.theme-pick select option { background: var(--panel); color: var(--ink); }
