/* GeoGroup Drill-Rig system — plain CSS, no build step. Dark theme, phone first. */
:root {
  --bg: #060c18; --side: #0a1220; --card: #0b1424; --card-2: #0e192c; --field: #0a1322;
  --line: #17233a; --line-strong: #24344f;
  --ink: #e8eef8; --ink-2: #a3b2c8; --muted: #7385a1;
  --brand: #2f7bff; --brand-dark: #1f66e5; --brand-soft: rgba(47, 123, 255, .14);
  --ok: #22c55e; --warn: #f5a524; --bad: #ef4444; --info: #3b82f6; --teal: #14b8a6; --violet: #8b5cf6; --grey: #8696b0;
  --ok-bg: rgba(34, 197, 94, .13); --warn-bg: rgba(245, 165, 36, .14); --bad-bg: rgba(239, 68, 68, .14);
  --info-bg: rgba(59, 130, 246, .14); --teal-bg: rgba(20, 184, 166, .14); --violet-bg: rgba(139, 92, 246, .15); --grey-bg: #142035;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Segoe UI Variable Text", "Segoe UI", Inter, Roboto, system-ui, -apple-system, Arial, sans-serif; line-height: 1.45; -webkit-font-smoothing: antialiased; }
h1 { font-size: 1.75rem; margin: 0 0 .25rem; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 1.05rem; margin: 0 0 .85rem; font-weight: 650; letter-spacing: -.01em; }
h3 { font-size: .95rem; margin: 1.1rem 0 .5rem; color: var(--ink-2); }
p { margin: 0 0 .6rem; }
a { color: #6ea8ff; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.page-sub { color: var(--ink-2); margin: 0; font-size: 1.02rem; }
.page-head { margin-bottom: 1.3rem; display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; justify-content: space-between; }
.clock { border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: .7rem 1rem; display: flex; gap: .8rem; align-items: center; }
.clock svg { width: 22px; height: 22px; fill: none; stroke: var(--ink-2); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.clock b { display: block; font-weight: 650; }
.clock span { color: var(--ink-2); font-size: .9rem; }

/* ---------------------------------------------------------------- layout */
#side { background: var(--side); border-right: 1px solid var(--line); color: var(--ink-2); display: none; flex-direction: column; }
#side.open { display: flex; }
.brand { padding: 1.2rem 1.2rem 1rem; display: flex; gap: .8rem; align-items: center; }
.brand-mark { width: 46px; height: 46px; border-radius: 12px; background: linear-gradient(145deg, #2f7bff, #1746b8); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.35rem; flex: 0 0 auto; box-shadow: 0 6px 18px rgba(47, 123, 255, .35); }
.brand-text { display: grid; gap: .1rem; }
.brand-name { font-weight: 750; font-size: 1.18rem; color: #fff; letter-spacing: -.01em; }
.brand-sub { font-size: .68rem; letter-spacing: .09em; color: var(--muted); text-transform: uppercase; }
#nav { display: flex; flex-direction: column; gap: .12rem; padding: .2rem .8rem 1rem; }
#nav .group { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: #5d6f8c; padding: 1rem .7rem .45rem; font-weight: 600; }
#nav a { color: var(--ink-2); text-decoration: none; padding: .62rem .75rem; border-radius: 10px; display: flex; align-items: center; gap: .8rem; font-size: .98rem; border: 1px solid transparent; }
#nav a:hover { background: rgba(255, 255, 255, .04); color: #fff; }
#nav a.current { background: linear-gradient(180deg, rgba(47, 123, 255, .22), rgba(47, 123, 255, .10)); border-color: rgba(47, 123, 255, .35); color: #fff; font-weight: 600; box-shadow: 0 8px 22px -10px rgba(47, 123, 255, .8); }
#nav svg, .kpi-icon svg, .card-icon svg { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.side-foot { margin-top: auto; padding: 1.2rem; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: #4c5d79; line-height: 1.9; display: none; }

#bar { background: rgba(6, 12, 24, .92); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: .75rem; padding: .65rem 1rem; flex-wrap: wrap; }
#menu-button { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: .5rem .8rem; font-weight: 500; }
#search { flex: 1 1 220px; max-width: 640px; position: relative; display: flex; }
#search svg { position: absolute; left: .9rem; top: 50%; width: 18px; height: 18px; margin-top: -9px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
#search input { width: 100%; padding: .68rem .9rem .68rem 2.6rem; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); }
#search input::placeholder { color: var(--muted); }
#who { margin-left: auto; display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; justify-content: flex-end; font-size: .88rem; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: .3rem .5rem .3rem .35rem; }
#who .avatar { width: 34px; height: 34px; border-radius: 50%; background: #1b2942; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .82rem; }
#who .who-name { display: grid; line-height: 1.2; }
#who .who-name b { font-weight: 650; }
#who .who-name span { color: var(--muted); font-size: .78rem; }
#who a { font-size: .82rem; }
#who button { background: transparent; color: var(--ink-2); border: 1px solid var(--line-strong); border-radius: 999px; padding: .3rem .75rem; font-weight: 500; }
#who button:hover { background: var(--card-2); color: #fff; }
main { padding: 1.1rem 1rem 2rem; max-width: 1560px; }

body.signed-out #side, body.signed-out #bar { display: none; }
body.signed-out { background: radial-gradient(1200px 600px at 50% -10%, #12284f 0%, var(--bg) 60%); min-height: 100vh; }
body.signed-out main { max-width: none; }

@media (min-width: 960px) {
  body.signed-in { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
  body.signed-in #side { display: flex; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
  .side-foot { display: block; }
  #menu-button { display: none; }
  #bar { padding: .8rem 2rem; position: sticky; top: 0; z-index: 5; backdrop-filter: blur(8px); }
  main { padding: 1.8rem 2rem 3rem; }
}

/* ----------------------------------------------------------------- cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 1.2rem 1.3rem; margin: 0 0 1.1rem; box-shadow: var(--shadow); }
.row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.cols { display: grid; gap: 1.1rem; grid-template-columns: 1fr; align-items: start; margin-bottom: 1.1rem; }
.cols > .card { margin: 0; height: 100%; }
@media (min-width: 1100px) { .cols.two { grid-template-columns: 1.15fr 1fr; } }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.card-head h2 { margin: 0; display: flex; align-items: center; gap: .7rem; }
.card-head a { font-size: .88rem; text-decoration: none; white-space: nowrap; font-weight: 600; }
.card-icon { color: var(--brand); display: inline-grid; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
@media (min-width: 1100px) { .kpis.n6 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1500px) { .kpis.n6 { grid-template-columns: repeat(6, 1fr); } }
.kpi { --tone: var(--brand); --tone-bg: var(--brand-soft); background: linear-gradient(180deg, color-mix(in srgb, var(--tone) 9%, var(--card)) 0%, var(--card) 70%); border: 1px solid color-mix(in srgb, var(--tone) 38%, var(--line)); border-bottom: 3px solid var(--tone); border-radius: 16px; padding: 1.05rem 1.15rem 1rem; display: grid; gap: .55rem; text-decoration: none; color: inherit; align-content: start; }
a.kpi:hover { border-color: var(--tone); transform: translateY(-1px); }
.kpi-top { display: flex; gap: .7rem; align-items: center; }
.kpi-icon { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; background: var(--tone-bg); color: var(--tone); }
.kpi-icon svg { width: 21px; height: 21px; }
.kpi-label { font-size: .98rem; font-weight: 650; color: var(--ink); line-height: 1.2; }
.kpi-value { font-size: 2.5rem; font-weight: 750; line-height: 1; letter-spacing: -.03em; }
.kpi-sub { font-size: .88rem; color: var(--ink-2); }
.kpi.ok { --tone: var(--ok); --tone-bg: var(--ok-bg); }
.kpi.teal { --tone: var(--teal); --tone-bg: var(--teal-bg); }
.kpi.warn { --tone: var(--warn); --tone-bg: var(--warn-bg); }
.kpi.bad { --tone: var(--bad); --tone-bg: var(--bad-bg); }
.kpi.violet { --tone: var(--violet); --tone-bg: var(--violet-bg); }

.donut-wrap { display: flex; flex-wrap: wrap; gap: 1.6rem; align-items: center; }
.donut { width: 176px; height: 176px; flex: 0 0 auto; }
.donut text.big { font-size: 7.5px; font-weight: 750; fill: var(--ink); }
.donut text.sub { font-size: 2.6px; fill: var(--ink-2); }
.legend { display: grid; gap: .6rem; flex: 1 1 190px; margin: 0; padding: 0; list-style: none; font-size: .95rem; color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: .6rem; }
.legend .dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.legend .num { margin-left: auto; font-weight: 650; white-space: nowrap; color: var(--ink); }
.chart { width: 100%; height: auto; display: block; }
.chart text { font-size: 11px; fill: var(--ink-2); }
.chart .axis { stroke: var(--line-strong); stroke-width: 1; }
.c-ok { fill: #22c55e; stroke: #22c55e; background: #22c55e; }
.c-info { fill: #3b82f6; stroke: #3b82f6; background: #3b82f6; }
.c-warn { fill: #f5a524; stroke: #f5a524; background: #f5a524; }
.c-bad { fill: #ef4444; stroke: #ef4444; background: #ef4444; }
.c-grey { fill: #5b6b86; stroke: #5b6b86; background: #5b6b86; }
.c-teal { fill: #14b8a6; stroke: #14b8a6; background: #14b8a6; }
.c-navy { fill: #6366f1; stroke: #6366f1; background: #6366f1; }
.c-violet { fill: #a78bfa; stroke: #a78bfa; background: #a78bfa; }
.donut circle { fill: none; }
.donut circle.track { stroke: #16233a; }

dl.facts { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: .45rem 1.2rem; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
.empty { text-align: center; padding: 1.6rem 1rem; color: var(--ink-2); }
.empty .card-icon { width: 54px; height: 54px; border-radius: 14px; background: var(--card-2); color: var(--ink-2); place-items: center; margin-bottom: .7rem; }
.empty b { display: block; color: var(--ink); font-size: 1.05rem; margin-bottom: .2rem; }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; margin: 0 -.3rem; }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { text-align: left; padding: .7rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; white-space: nowrap; font-size: .74rem; letter-spacing: .07em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: rgba(255, 255, 255, .03); }

.badge { display: inline-block; padding: .14rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--grey-bg); color: var(--grey); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: #4ade80; }
.badge.warn { background: var(--warn-bg); color: #fbbf4d; }
.badge.bad { background: var(--bad-bg); color: #f87171; }
.badge.info { background: var(--info-bg); color: #7db0ff; }

.notice { border: 1px solid rgba(59, 130, 246, .35); border-left: 4px solid var(--info); background: var(--info-bg); padding: .75rem 1rem; border-radius: 12px; margin: 0 0 1.1rem; }
.notice.warn { border-color: rgba(245, 165, 36, .4); border-left-color: var(--warn); background: var(--warn-bg); }
.notice.bad { border-color: rgba(239, 68, 68, .4); border-left-color: var(--bad); background: var(--bad-bg); }
.notice.ok { border-color: rgba(34, 197, 94, .4); border-left-color: var(--ok); background: var(--ok-bg); }
.notice ul { margin: .3rem 0 0 1.1rem; padding: 0; }
.todo { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.todo a { display: flex; gap: .8rem; align-items: center; padding: .7rem .85rem; border: 1px solid var(--line); background: var(--card-2); border-radius: 12px; text-decoration: none; color: var(--ink); }
.todo a:hover { border-color: var(--line-strong); background: #111f36; }
.todo b { background: var(--warn-bg); color: #fbbf4d; border-radius: 8px; min-width: 2.1rem; text-align: center; padding: .15rem .45rem; }

/* ----------------------------------------------------------------- forms */
form.form { display: grid; gap: .8rem; max-width: 640px; }
label.field { display: grid; gap: .35rem; font-weight: 600; font-size: .9rem; color: var(--ink-2); }
label.field.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; color: var(--ink); }
label.field .hint { font-weight: 400; color: var(--muted); font-size: .82rem; }
label.field .error { font-weight: 400; color: #f87171; font-size: .85rem; }
input, select, textarea, button { font: inherit; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=email], input[type=search], select, textarea {
  width: 100%; padding: .66rem .75rem; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--field); color: var(--ink);
}
input[type=file] { color: var(--ink-2); max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 123, 255, .3); }
input[type=checkbox], input[type=radio] { width: 1.25rem; height: 1.25rem; flex: 0 0 auto; accent-color: var(--brand); }
textarea { min-height: 4.5rem; resize: vertical; }
button, .button { background: var(--brand); color: #fff; border: 0; border-radius: 10px; padding: .64rem 1.1rem; cursor: pointer; text-decoration: none; display: inline-block; font-weight: 600; }
button:hover, .button:hover { background: var(--brand-dark); }
button.secondary, .button.secondary { background: var(--card-2); color: var(--ink); border: 1px solid var(--line-strong); }
button.secondary:hover, .button.secondary:hover { background: #13223b; }
button.danger, .button.danger { background: #dc2f2f; }
button.danger:hover, .button.danger:hover { background: #b92323; }
button:disabled { opacity: .5; cursor: default; }
button.link { background: none; color: #6ea8ff; padding: 0; text-decoration: underline; font-weight: 400; }
button.link:hover { background: none; color: #9cc3ff; }
.grow { flex: 1 1 260px; }

.check-item { border-top: 1px solid var(--line); padding: .9rem 0; display: grid; gap: .55rem; }
.check-item .text { font-weight: 600; }
.check-item .options { display: flex; flex-wrap: wrap; gap: .5rem; }
.check-item .options label { border: 1px solid var(--line-strong); border-radius: 10px; padding: .55rem .85rem; display: flex; gap: .5rem; align-items: center; background: var(--field); cursor: pointer; }
.check-item .options label.picked-ok { background: var(--ok-bg); border-color: var(--ok); }
.check-item .options label.picked-fail { background: var(--bad-bg); border-color: var(--bad); }
.check-item .options label.picked-not_checked, .check-item .options label.picked-na { background: var(--warn-bg); border-color: var(--warn); }
.photos { display: flex; flex-wrap: wrap; gap: .5rem; }
.photos figure { margin: 0; font-size: .8rem; text-align: center; color: var(--ink-2); }
.photos img { width: 110px; height: 82px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line-strong); display: block; background: var(--grey-bg); }
.login { max-width: 430px; margin: 10vh auto 0; padding: 2rem; border-color: var(--line-strong); box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .7); }
.login .brand { padding: 0 0 1.2rem; }
.secret { font-family: ui-monospace, Consolas, monospace; font-size: 1.15rem; background: var(--bg); color: #fff; padding: .3rem .6rem; border-radius: 8px; user-select: all; }
.pager { display: flex; gap: .75rem; align-items: center; margin-top: .9rem; }

@media print {
  :root { --bg: #fff; --card: #fff; --card-2: #fff; --field: #fff; --line: #ccc; --line-strong: #bbb; --ink: #000; --ink-2: #222; --muted: #444; color-scheme: light; }
  #side, #bar, form, button, .no-print { display: none !important; }
  body, body.signed-in { background: #fff; display: block; }
  .card { border: 0; padding: 0; box-shadow: none; }
  .badge { background: none !important; color: #000 !important; border: 1px solid #999; }
}
