/* The app's only stylesheet. No inline styles, so step 3 can set a strict Content-Security-Policy. */

:root {
  --text: #1f2933; --muted: #616e7c; --line: #d9dee3; --accent: #1f5f99; --bad: #b42318; --bg: #f7f8fa;
  --surface: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
header { display: flex; flex-wrap: wrap; gap: 4px 20px; align-items: center; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
header .app { font-weight: 600; color: var(--text); text-decoration: none; }
header a { color: var(--accent); }
header form { margin: 0; }
header nav { display: flex; flex-wrap: wrap; gap: 4px 20px; align-items: center; }
/* The account area sits on the right, apart from the pages. */
header .account { margin-left: auto; gap: 4px 14px; padding-left: 14px; border-left: 1px solid var(--line); font-size: 0.9rem; }
header .account .name { color: var(--muted); }
/* Which data this is (kpi/datamode.py): quiet for sample data, impossible to miss for real data. */
.data-mode { margin: 0; padding: 4px 16px; font-size: 0.85rem; }
.data-mode.sample { background: #eef2f6; color: var(--muted); }
.data-mode.real { background: #fdecea; color: var(--bad); font-weight: 600; border-bottom: 1px solid #f3b8b2; }
/* For Super Admins, when the server's backups need looking at (kpi/datachecks.py, backup_warning). */
.backup-warning { margin: 0; padding: 6px 16px; background: #fdecea; color: var(--bad); font-weight: 600; border-bottom: 1px solid #f3b8b2; }
main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 40px; }
h1 { font-size: 1.4rem; margin: 0 0 12px; }
h2 { font-size: 1.1rem; margin: 28px 0 8px; }
a { color: var(--accent); }
table { border-collapse: collapse; width: 100%; background: var(--surface); }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.num, td.date { white-space: nowrap; }  /* "25h 36m" and "Mon 2 Nov" stay on one line in a crowded table */
.table-wrap { overflow-x: auto; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=time], textarea, select {
  font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 4px; width: 100%; max-width: 360px; }
button, .btn { font: inherit; padding: 6px 14px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface);
  color: var(--text); cursor: pointer; text-decoration: none; display: inline-block; }
.btn-primary, button[type=submit]:not(.btn-link):not(.btn-secondary) { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-link, .link-button { border: none; background: none; color: var(--accent); padding: 0; text-decoration: underline; }
.float-right { float: right; }
.errorlist, .error { color: var(--bad); }
.messages { list-style: none; padding: 8px 12px; background: #e8f3ea; border-radius: 4px; }
.messages li.error { color: var(--bad); font-weight: 600; }
.messages li.warning { color: #8a5a00; font-weight: 600; }
.muted { color: var(--muted); }
.notice { padding: 10px 12px; background: #fff7e6; border: 1px solid #f5d99a; border-radius: 4px; }

/* Dashboard pages */
.filters { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; margin: 0 0 8px; }
.filters label { display: flex; flex-direction: column; font-size: 0.85rem; color: var(--muted); }
.filters select, .filters input { width: auto; color: var(--text); }
.period-nav { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; margin: 0 0 16px; }
.period-nav strong { font-size: 1.05rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 16px 0; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; }
.tile .label { display: block; font-size: 0.85rem; color: var(--muted); }
.tile .value { display: block; font-size: 1.4rem; font-weight: 600; }
.tile .sub { display: block; font-size: 0.85rem; color: var(--muted); }
p.compared { margin: -8px 0 16px; }
.chart-box { position: relative; height: 300px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 8px; }
details { margin: 12px 0; }
details > summary { cursor: pointer; color: var(--accent); }
details.how { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; }
details.how ul { margin: 8px 0; padding-left: 20px; }
table.sortable th button.sort { border: none; background: none; padding: 0; font-weight: 600; color: var(--accent); text-align: inherit; }
table.sortable th[aria-sort=ascending] button.sort::after { content: " \25B2"; }
table.sortable th[aria-sort=descending] button.sort::after { content: " \25BC"; }
td.not-used { color: var(--muted); font-style: italic; }
td.flags { color: var(--bad); }
.tile.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
details.how ol { margin: 4px 0; padding-left: 20px; }

/* Timesheet in Jibble (phase 2, step 4) */
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
ul.entries { list-style: none; margin: 0; padding: 0; }

/* Manager notes */
p.note { margin: 0 0 4px; }
p.note.automatic { font-style: italic; }
td.notes { min-width: 12em; }
td.notes .add-note { font-size: 0.85rem; }
blockquote.note { margin: 8px 0; padding: 8px 12px; background: var(--surface); border-left: 3px solid var(--line); }
fieldset.choice { border: none; padding: 0; margin: 0 0 12px; }
fieldset.choice legend { padding: 0; margin-bottom: 4px; }
fieldset.choice label { display: block; }
dl.week-notes dt { font-weight: 600; margin-top: 8px; }
dl.week-notes dd { margin: 0 0 0 16px; }
