/* Supervision Tracker: plain greyscale, no build step */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; font-size: 14px; line-height: 1.6; color: #444; background: #f4f4f4; }
a { color: #1a1a1a; }
h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; color: #1a1a1a; margin: 0 0 4px; }
h2 { font-size: 15px; font-weight: 700; color: #1a1a1a; margin: 0 0 10px; }
.sub { color: #888; margin: 0 0 24px; }
.label { font-size: 10px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: #999; }

/* Header bar: one line on desktop; wraps only on narrow screens */
.bar { background: #1a1a1a; color: #fff; }
.bar-in { max-width: 1280px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 18px; min-height: 52px; }
.brand { font-weight: 700; letter-spacing: 0.5px; white-space: nowrap; }
.bar nav { display: flex; gap: 0; flex: 1; white-space: nowrap; }
.bar nav a { color: #bbb; text-decoration: none; padding: 14px 10px; font-size: 13px; }
.bar nav a:hover { color: #fff; }
.bar nav a.on { color: #fff; box-shadow: inset 0 -3px 0 #fff; }
.who { font-size: 12px; color: #bbb; line-height: 1.35; text-align: right; white-space: nowrap; }
.who a { color: #bbb; margin-left: 12px; }
.who a:first-child { margin-left: 0; }
.who a:hover { color: #fff; }
@media (max-width: 1100px) { .bar-in { flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; } .bar nav { flex-wrap: wrap; flex-basis: 100%; order: 3; } }

/* Centre switcher in the header */
.centre-pick { display: flex; align-items: center; gap: 6px; }
.centre-pick label { margin: 0; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: #bbb; }
.centre-pick select { width: auto; padding: 3px 8px; font-size: 13px; background: #333; color: #fff; border: 1px solid #666; }

/* Layout */
main { max-width: 1100px; margin: 28px auto 60px; padding: 0 24px; }
.panel { background: #fff; border: 1px solid #e0e0e0; padding: 20px 22px; margin-bottom: 20px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 800px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }

/* Forms */
label { display: block; font-size: 12px; font-weight: 600; color: #666; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=search], input[type=number], select, textarea {
  width: 100%; padding: 8px 10px; font: inherit; color: #1a1a1a; background: #fff; border: 1px solid #ccc; border-radius: 0; }
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #1a1a1a; outline-offset: -1px; }
.row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.row > div { flex: 1; min-width: 140px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 400; color: #444; margin: 0; }
.check input { width: auto; }

button, .btn { font: inherit; font-size: 13px; font-weight: 600; padding: 8px 16px; border: 1px solid #1a1a1a; background: #1a1a1a; color: #fff; cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { background: #333; }
button.ghost, .btn.ghost { background: #fff; color: #1a1a1a; }
button.ghost:hover, .btn.ghost:hover { background: #f0f0f0; }
button.danger { background: #fff; color: #8a1f1f; border-color: #8a1f1f; }
button:disabled { opacity: 0.5; cursor: default; }
.sm { padding: 4px 10px; font-size: 12px; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #1a1a1a; padding: 8px 10px; border-bottom: 2px solid #1a1a1a; white-space: nowrap; }
td { padding: 8px 10px; border-bottom: 1px solid #ebebeb; vertical-align: top; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { background: #f0f0f0; }
th.sortable::after { content: '\2195'; margin-left: 6px; color: #ccc; font-size: 11px; }
th.sortable.asc::after { content: '\25B2'; color: #1a1a1a; }
th.sortable.desc::after { content: '\25BC'; color: #1a1a1a; }
select.lvl { width: 92px; padding: 3px 6px; font-size: 13px; border: 1px solid transparent; background: transparent; cursor: pointer; }
select.lvl:hover, select.lvl:focus { border-color: #ccc; background: #fff; }
select.lvl.saved { border-color: #1a1a1a; background: #f0f0f0; }
select.lvl.failed { border-color: #8a1f1f; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #fafafa; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: #888; }
.empty { padding: 24px; text-align: center; color: #888; }

/* Badges */
.badge { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; padding: 1px 6px; background: #e0e0e0; color: #444; margin-right: 4px; white-space: nowrap; }
.badge.dark { background: #1a1a1a; color: #fff; }
.reasons { margin: 0; padding-left: 16px; }
.reasons li { margin: 0; }

/* Bars (trends) */
.bar-cell { display: flex; align-items: center; gap: 8px; }
.bar-fill { height: 10px; background: #1a1a1a; min-width: 1px; }
.stat { border: 1px solid #e0e0e0; padding: 16px 18px; background: #fff; }
.stat .v { font-size: 28px; font-weight: 700; color: #1a1a1a; line-height: 1.2; }
.stat .l { font-size: 10px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: #999; }

/* Messages */
.msg { padding: 10px 14px; margin: 12px 0; border-left: 3px solid #555; background: #f7f7f7; }
.msg.err { border-left-color: #8a1f1f; color: #8a1f1f; }
.msg.ok { border-left-color: #1a1a1a; }
.hidden { display: none !important; }

/* Dialog */
dialog { border: 1px solid #1a1a1a; padding: 0; max-width: 820px; width: 92vw; max-height: 90vh; overflow: auto; font: inherit; color: #444; }
dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.dlg-head { background: #1a1a1a; color: #fff; padding: 14px 22px; display: flex; justify-content: space-between; align-items: center; }
.dlg-head h2 { color: #fff; margin: 0; }
.dlg-head button { background: transparent; border-color: #888; }
.dlg-body { padding: 20px 22px; }

/* Login */
.login { max-width: 380px; margin: 12vh auto; }

@media print { body { background: #fff; } .bar, button, .btn, .no-print { display: none !important; } .panel { border: none; } }
