:root {
  --blue: #8eaadb; --blue-d: #3f63a6; --ink: #1d232b; --muted: #6b7380;
  --line: #dfe4ec; --bg: #f5f7fb; --card: #fff; --ok: #e7f4ea; --bad: #fbe9e7;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 "Segoe UI", system-ui, -apple-system, Arial, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--blue-d); text-decoration: none; }
h1 { font-size: 22px; margin: 0 0 14px; }
h2 { font-size: 17px; margin: 22px 0 8px; }
.muted { color: var(--muted); }
.bad-text { color: #b3261e; }

/* logo */
.logo { display: inline-flex; flex-direction: column; align-items: center; }
.logo .cells { display: flex; border: 1px solid #666; }
.logo .cells b { width: 21px; height: 25px; display: flex; align-items: center; justify-content: center;
  font-weight: 400; font-size: 18px; background: #d9d9d9; border-left: 1px solid #666; }
.logo .cells b.g { background: var(--blue); border-left: 0; }
.logo .tag { font-size: 8.5px; letter-spacing: 2.9px; margin-top: 2px; }

/* frame */
.topbar { display: flex; justify-content: space-between; align-items: center; background: #fff;
  border-bottom: 1px solid var(--line); padding: 8px 20px; position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 14px; color: var(--ink); }
.brand > span:last-child { font-size: 20px; font-weight: 600; }
.who { color: var(--muted); font-size: 13px; }
.layout { display: flex; min-height: calc(100vh - 56px); }
.side { width: 190px; flex: none; background: #fff; border-right: 1px solid var(--line); padding: 12px 0; }
.side .group { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); padding: 14px 18px 4px; }
.side a { display: block; padding: 7px 18px; color: var(--ink); border-left: 3px solid transparent; }
.side a:hover { background: var(--bg); }
.side a.on { border-left-color: var(--blue-d); background: #eef2fa; font-weight: 600; }
main { flex: 1; padding: 22px 26px; min-width: 0; }

/* pieces */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.card.tight { padding: 0; overflow-x: auto; }
.card.narrow { max-width: 520px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 16px; }
.cards .card { margin: 0; }
.stat .label, .card > .label { color: var(--muted); font-size: 13px; }
.stat .big { font-size: 32px; font-weight: 600; margin: 4px 0; }
.stat .link { font-size: 13px; }
a.card { color: inherit; } a.card:hover { border-color: var(--blue); }
.flash { padding: 9px 13px; border-radius: 6px; margin-bottom: 14px; }
.flash.ok { background: var(--ok); } .flash.bad { background: var(--bad); } .flash.info { background: #eef2fa; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 11px; }
label input, label select { display: block; width: 100%; margin-top: 3px; }
label.chk { display: flex; align-items: center; gap: 7px; color: var(--ink); }
label.chk input { width: auto; margin: 0; }
input, select { font: inherit; padding: 6px 8px; border: 1px solid #c9d0db; border-radius: 5px; background: #fff; color: var(--ink); }
input:focus, select:focus { outline: 2px solid var(--blue); outline-offset: -1px; border-color: var(--blue); }
.btn { display: inline-block; font: inherit; padding: 6px 13px; border: 1px solid #c9d0db; border-radius: 5px;
  background: #fff; color: var(--ink); cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--blue-d); }
.btn.primary { background: var(--blue-d); border-color: var(--blue-d); color: #fff; }
.btn.wide { width: 100%; padding: 9px; }
.icon { border: 0; background: none; cursor: pointer; font-size: 15px; color: var(--muted); padding: 2px 5px; }
.icon:hover { color: var(--blue-d); }

/* tables */
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 9px 11px; border-bottom: 1px solid var(--line); background: #fafbfd; }
table.list td { padding: 8px 11px; border-bottom: 1px solid #eef1f5; }
table.list tr.click { cursor: pointer; } table.list tr.click:hover td { background: #f3f6fc; }
table.list tr.dim td { color: var(--muted); }
table.list input { padding: 4px 6px; }
.num { text-align: right; }
.pager { display: flex; gap: 12px; align-items: center; }

/* timesheet */
.tsbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.tsbar h1 { margin: 0; }
.weeknav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.weeknav label { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--ink); }
.weeknav input { width: auto; margin: 0; }
form.inline { display: flex; gap: 10px; align-items: center; margin-left: auto; }
form.inline label.chk { margin: 0; }
table.grid { width: 100%; border-collapse: collapse; min-width: 1100px; }
table.grid th { font-size: 12px; color: var(--muted); text-align: left; padding: 8px 5px; border-bottom: 1px solid var(--line); background: #fafbfd; }
table.grid th.day { text-align: center; width: 52px; }
table.grid th small { display: block; font-weight: 400; }
table.grid td { padding: 5px; border-bottom: 1px solid #eef1f5; }
table.grid select, table.grid input { width: 100%; padding: 5px 6px; }
table.grid input.hrs { text-align: center; padding: 5px 2px; }
table.grid .tot { text-align: center; font-weight: 600; }
table.grid .grand { font-size: 16px; color: var(--blue-d); }
table.grid tfoot td { background: #fafbfd; border-bottom: 0; }
table.grid .acts { white-space: nowrap; width: 54px; }
tbody.rec.deleted tr:first-child td { opacity: .4; text-decoration: line-through; }
tbody.rec.deleted .del-btn { color: #b3261e; opacity: 1; }
tr.notes td { background: #fbfcfe; }
.notegrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 6px 14px; padding: 4px 2px; }
.notegrid label { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--ink); }
.notegrid label span { width: 30px; font-size: 12px; color: var(--muted); }
.notegrid input { margin: 0; }
.savebar { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 35%); padding: 14px 0 4px; text-align: right; }
.savebar .btn { padding: 9px 26px; font-size: 15px; }
.filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.filters label { margin: 0; min-width: 160px; }
.filters .btn { margin-bottom: 1px; }

/* home chart */
.bars { display: flex; gap: 10px; align-items: flex-end; height: 190px; padding-top: 18px; }
.bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; color: var(--ink); }
.bar .fill { width: 70%; max-width: 46px; background: var(--blue); border-radius: 4px 4px 0 0; min-height: 2px; }
.bar:last-child .fill { background: var(--blue-d); }
.bar .v { font-size: 12px; margin-bottom: 3px; } .bar .x { font-size: 11px; color: var(--muted); margin-top: 5px; }

/* reports */
.report-form h2 { margin-top: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.preview { width: 100%; height: 75vh; border: 1px solid var(--line); border-radius: 8px; background: #fff; }

/* login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login { width: 340px; }
.login h1 { text-align: center; margin: 12px 0 18px; }
.center { text-align: center; }
