:root {
  --brand: #0a7ea4; --brand-dark: #08617f; --bg: #f6f8fa; --card: #fff; --line: #d9dee3;
  --text: #1c2630; --muted: #6b7782; --danger: #b3261e; --ok: #1b7f4b;
  --font: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.4 var(--font); color: var(--text); background: var(--bg); }
.topbar { display: flex; align-items: center; gap: 14px; padding: 6px 16px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; }
.brand img { height: 30px; }
nav { display: flex; gap: 2px; }
nav a { padding: 6px 12px; border-radius: 6px; color: var(--text); text-decoration: none; }
nav a:hover { background: #eef2f5; }
nav a.on { background: var(--brand); color: #fff; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
main { padding: 12px 16px 24px; max-width: 1700px; margin: 0 auto; }
h1 { font-size: 20px; margin: 0; }
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.tools, .actions, .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.actions { margin: 8px 0; }
input, select, textarea, button { font: inherit; }
input, select, textarea { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
textarea { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
button, .btn { padding: 5px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; color: var(--text); text-decoration: none; }
button:hover, .btn:hover { background: #eef2f5; }
button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
button.primary:hover { background: var(--brand-dark); }
button.danger { color: var(--danger); border-color: var(--danger); }
button:disabled { opacity: .45; cursor: default; }
button.link { border: 0; background: none; color: var(--brand); padding: 0 4px; }
form.inline { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 12px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px 12px; }
.grid-form label, .stack label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); }
.grid-form .wide { grid-column: span 2; }
.grid-form .full { grid-column: 1 / -1; }
.msg { padding: 8px 12px; border-radius: 6px; margin-bottom: 10px; }
.msg.err { background: #fdecea; color: var(--danger); }
.msg.ok { background: #e6f4ea; color: var(--ok); }
table.plain { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
table.plain th, table.plain td { padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--line); }
table.plain th { background: #eef2f5; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
table.plain tr.active td { background: #e8f4f9; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.tab { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: 7px 14px; }
.tab.on { border-bottom-color: var(--brand); font-weight: 600; }
.badge { background: #e3e8ec; border-radius: 10px; padding: 0 7px; font-size: 12px; }
.check { display: inline-flex; align-items: center; gap: 4px; }
.grid { height: calc(100vh - 250px); min-height: 320px; width: 100%; }
.quick { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; }
.quick summary { cursor: pointer; font-weight: 600; }
.quickbody { display: grid; gap: 8px; padding: 8px 0; }
.login { max-width: 340px; margin: 10vh auto; text-align: center; }
.login img { max-width: 220px; }
.login form { text-align: left; margin-top: 12px; gap: 10px; display: grid; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: #1c2630; color: #fff; padding: 8px 16px; border-radius: 6px; z-index: 50; }
.toast.err { background: var(--danger); }
[hidden] { display: none !important; }

h2 { font-size: 16px; margin: 0; } h3 { font-size: 14px; margin: 12px 0 4px; }
.pagehead.small { margin-bottom: 6px; }
.code { font-family: ui-monospace, Consolas, monospace; background: #eef2f5; border-radius: 4px; padding: 1px 6px; font-size: 12px; font-weight: 400; }
.late { color: var(--danger); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg a { padding: 3px 10px; text-decoration: none; color: var(--text); border-right: 1px solid var(--line); }
.seg a:last-child { border-right: 0; } .seg a.on { background: var(--brand); color: #fff; }
.plainlist { list-style: none; margin: 0; padding: 0; } .plainlist li { padding: 3px 0; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #aab4bd; margin-right: 6px; }
.dot.in-progress { background: #2f7fd1; } .dot.at-risk { background: #e8892b; } .dot.completed { background: #2e9d62; } .dot.on-hold { background: #8d6fd1; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 8px 0 4px; }
.tile { display: flex; flex-direction: column; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; text-decoration: none; color: var(--text); }
a.tile:hover { border-color: var(--brand); background: #f1f9fc; }
.tile .num { font-size: 26px; font-weight: 700; line-height: 1.1; }
.tile.warn .num { color: var(--danger); } .tile.static { cursor: default; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 24px; }
.cols p, section.card > p { margin: 3px 0; }
.grid.short { height: calc(100vh - 320px); }
.grid-form.compact { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; margin-bottom: 8px; }
.alignend { display: flex; align-items: end; }
.monthnav { display: flex; align-items: center; gap: 6px; }
.legend { display: flex; gap: 14px; font-size: 12px; } .legend span { display: inline-flex; align-items: center; gap: 4px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.vac { background: #5aa9e6; } .sick { background: #e86f6f; } .trip { background: #f0b34a; } .other { background: #9aa5b1; }
.tl-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
table.tl { border-collapse: collapse; width: 100%; font-size: 12px; }
table.tl th, table.tl td { border: 1px solid #edf0f3; padding: 0; text-align: center; min-width: 22px; height: 26px; }
table.tl th { background: #f6f8fa; font-weight: 600; } table.tl th.today { background: var(--brand); color: #fff; }
table.tl .name { text-align: left; padding: 0 10px; min-width: 190px; white-space: nowrap; position: sticky; left: 0; background: #fff; }
table.tl th.name { background: #f6f8fa; }
table.tl .we { background: #f3f4f6; }
table.tl td.vac { background: #5aa9e6; } table.tl td.sick { background: #e86f6f; }
table.tl td.trip { background: #f0b34a; } table.tl td.other { background: #9aa5b1; }

.partpick { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 4px 0; color: var(--text); font-size: 13px; }
textarea.prose { font-family: var(--font); font-size: 14px; }
.small { font-size: 13px; font-weight: 400; }

details.more, details.navgroup { position: relative; }
details.more > summary, details.navgroup > summary { list-style: none; cursor: pointer; padding: 6px 12px; border-radius: 6px; }
details.more > summary::-webkit-details-marker, details.navgroup > summary::-webkit-details-marker { display: none; }
details.more > summary:hover, details.navgroup > summary:hover { background: #eef2f5; }
details.more > summary.on, details.navgroup > summary.on { background: var(--brand); color: #fff; }
details.more .menu, details.navgroup .menu { position: absolute; top: 100%; left: 0; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 4px; min-width: 170px; display: grid; z-index: 20; box-shadow: 0 6px 18px rgba(0,0,0,.12); }
nav a, details.more > summary, details.navgroup > summary { white-space: nowrap; }
label.stackl { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); margin-bottom: 6px; }

.tpl3 { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 14px; }
@media (max-width: 1000px) { .tpl3 { grid-template-columns: 1fr; } }
.grid.mini { height: calc(100vh - 220px); min-height: 280px; }

.comment { border-bottom: 1px solid var(--line); padding: 6px 0; }
.card .row { align-items: flex-start; } .card .row textarea { flex: 1; font-family: var(--font); }

details.export > summary.btn { display: inline-block; }
details.export .menu { right: 0; left: auto; }

details.navgroup .menu a { padding: 6px 12px; border-radius: 6px; }
details.navgroup .menu a.on { background: var(--brand); color: #fff; }

/* pick-from cells: visible marker + native editors */
.ag-cell.pick-select::after, .ag-cell.pick-date::after { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); color: #8a97a3; pointer-events: none; font-size: 11px; }
.ag-cell.pick-select::after { content: "▾"; font-size: 13px; }
.ag-cell.pick-date::after { content: "📅"; opacity: .45; }
.ag-cell.pick-select:hover, .ag-cell.pick-date:hover { background: #eef6fa; cursor: pointer; }
.pick-editor { width: 100%; height: 100%; box-sizing: border-box; border: 2px solid var(--brand); border-radius: 4px; padding: 0 6px; font: inherit; background: #fff; }
/* entry bars above the grids */
form.entrybar { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 8px 0; }
form.entrybar label { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--muted); }
form.entrybar input[name=title] { min-width: 260px; }
form.entrybar .grow { flex: 1; min-width: 240px; }
/* project plan */
.ag-row.plan-wp .ag-cell { font-weight: 700; }
.ag-row.plan-wp { background: #eef3f7; }
.ag-row.plan-ms { background: #fffaf0; }
.ag-row.plan-ms .ag-cell { font-weight: 600; }
.plan-add { cursor: pointer; color: var(--brand); text-align: center; font-weight: 700; }
.planbar { display: flex; gap: 8px; margin: 8px 0; align-items: center; flex-wrap: wrap; }
.pbar { position: relative; height: 18px; margin-top: 7px; background: #e5eaee; border-radius: 9px; overflow: hidden; }
.pbar i { position: absolute; inset: 0 auto 0 0; background: #7dd3fc; }
.pbar span { position: relative; display: block; text-align: center; font-size: 11px; font-weight: 600; line-height: 18px; color: #0f172a; }

details.archive > summary { cursor: pointer; font-weight: 600; margin-bottom: 6px; }
button.danger-link { color: var(--danger); margin-left: 8px; }
td button.link { margin-left: 8px; }

.banner { background: #fff4d6; border-bottom: 1px solid #f0d58a; color: #6b4e00; padding: 6px 16px; font-size: 13px; text-align: center; }
.banner a { color: #6b4e00; font-weight: 600; margin-left: 8px; }
