/* ClientoraHQ Team monitor: dark, calm, readable. */
:root {
  --bg: #02060C;
  --surface: #041220;
  --surface-2: #071B2E;
  --line: #12324A;
  --accent: #29E6FF;
  --accent-ink: #02111A;
  --text: #EEFBFF;
  --muted: #9FBFCF;
  --ok: #4ADE9B;
  --warn: #FFC861;
  --bad: #FF7A8A;
  --radius: 14px;
  --font: Bahnschrift, "Segoe UI", Inter, system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg);
  background-image: radial-gradient(1200px 600px at 85% -10%, #062a3d 0%, transparent 60%), radial-gradient(900px 500px at -10% 110%, #04202f 0%, transparent 55%);
  background-attachment: fixed;
  color: var(--text); font: 15px/1.55 var(--font);
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1 { font-size: 26px; font-weight: 600; letter-spacing: .2px; margin: 8px 0 18px; }
h2 { font-size: 18px; font-weight: 600; margin: 0 0 12px; }
h3 { font-size: 15px; font-weight: 600; margin: 16px 0 8px; color: var(--text); }
p { margin: 0 0 12px; }
code { font-family: Consolas, "Cascadia Mono", ui-monospace, monospace; font-size: .92em; background: var(--surface-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 12px; }

/* Top bar */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 18px; padding: 12px 24px; background: rgba(2, 6, 12, .85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-size: 17px; letter-spacing: .3px; white-space: nowrap; }
.brand b { color: var(--accent); font-weight: 600; }
.brand.big { font-size: 20px; margin-bottom: 18px; }
#nav { display: flex; align-items: center; gap: 4px; margin-left: auto; flex-wrap: wrap; }
#nav a, #nav .link { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 10px; font: inherit; }
#nav a:hover, #nav .link:hover { color: var(--text); background: var(--surface-2); }
#nav a[aria-current="page"] { color: var(--accent-ink); background: var(--accent); font-weight: 600; }
.navtoggle { display: none; margin-left: auto; }
main { max-width: 1200px; margin: 0 auto; padding: 18px 24px 40px; }
main:focus { outline: none; }
.foot { max-width: 1200px; margin: 0 auto; padding: 16px 24px 28px; display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }

/* Cards and layout */
.card { background: linear-gradient(180deg, var(--surface) 0%, #03101C 100%); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin: 0 0 18px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.narrow { width: min(480px, calc(100% - 32px)); }
.narrowish { max-width: 560px; }
.center { display: grid; place-items: center; padding: 32px 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid2 > .card { margin: 0 0 18px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.inline { display: inline; }
.right { display: flex; justify-content: flex-end; margin-top: 12px; }
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.tile .num { font-size: 30px; font-weight: 600; line-height: 1.1; }
.tile .lbl { color: var(--muted); font-size: 13px; }
.tile.accent { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(41, 230, 255, .25) inset; }
.tile.accent .num { color: var(--accent); }
.tile.warn .num { color: var(--warn); }

/* Tables */
.tablewrap { overflow-x: auto; margin: 0 -6px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { color: var(--muted); font-weight: 500; font-size: 12.5px; text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; }
tbody th { font-weight: 600; }
tbody tr:hover { background: rgba(41, 230, 255, .04); }
.r { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.wrap { word-break: break-word; max-width: 480px; }
td.warn { color: var(--warn); font-weight: 600; }
tr.dim { opacity: .55; }
tr.pool th { color: var(--muted); font-style: italic; }
.actions form { display: flex; gap: 6px; flex-wrap: wrap; }
meter { width: 120px; height: 10px; }

/* Badges */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.s-open { background: rgba(41, 230, 255, .1); color: var(--accent); border-color: rgba(41, 230, 255, .35); }
.s-submitted { background: rgba(255, 200, 97, .12); color: var(--warn); border-color: rgba(255, 200, 97, .4); }
.s-approved { background: rgba(74, 222, 155, .12); color: var(--ok); border-color: rgba(74, 222, 155, .4); }
.s-changes, .s-late { background: rgba(255, 122, 138, .12); color: var(--bad); border-color: rgba(255, 122, 138, .4); }
.s-closed { background: rgba(159, 191, 207, .1); color: var(--muted); border-color: rgba(159, 191, 207, .3); }
.dot { font-size: 11px; color: var(--ok); font-weight: 500; margin-left: 6px; }
.dot::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-right: 4px; vertical-align: 1px; }

/* Forms */
label { display: block; color: var(--muted); font-size: 13.5px; margin: 12px 0 5px; }
input, select, textarea { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid #1E4766; background: #020B14; color: var(--text); font: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
textarea { resize: vertical; min-height: 80px; }
.stack > button, .stack > .row { margin-top: 16px; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 6px 16px 16px; margin: 0 0 16px; }
legend { color: var(--accent); padding: 0 6px; font-weight: 600; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 16px; }
.filters label { margin: 0; }
.filters select { width: auto; min-width: 150px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 10px; border: 1px solid #1E4766; background: var(--surface-2); color: var(--text); font: 600 14px var(--font); text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); border-color: rgba(255, 122, 138, .5); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.link { background: none; border: 0; cursor: pointer; }
.stack .btn.primary { width: 100%; }
.stack .row .btn.primary { width: auto; }

/* Flash messages */
.flash { border-radius: 12px; padding: 12px 16px; margin: 0 0 16px; border: 1px solid var(--line); background: var(--surface-2); }
.flash p:last-child { margin-bottom: 0; }
.flash.success { border-color: rgba(74, 222, 155, .5); }
.flash.error { border-color: rgba(255, 122, 138, .6); background: #1A0A10; }
.flash.info { border-color: rgba(41, 230, 255, .4); }
.secret { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 10px 0 6px; }
.secret code { font-size: 16px; padding: 8px 12px; color: var(--accent); word-break: break-all; user-select: all; }

/* Brief page */
.meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 18px; margin: 4px 0 8px; }
.meta dt { color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; }
.meta dd { margin: 2px 0 0; word-break: break-word; }
.prose { background: #020B14; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; white-space: normal; word-break: break-word; }
.prose.quote { border-left: 3px solid var(--warn); }
pre.text, pre.consent { white-space: pre-wrap; word-break: break-word; background: #020B14; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font: 14px/1.55 var(--font); margin: 8px 0 12px; }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 10px 0; }
.files figure { margin: 0; background: #020B14; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.files img, .files video { display: block; width: 100%; max-height: 420px; object-fit: contain; background: #000; }
.files figcaption { padding: 8px 10px; font-size: 12.5px; color: var(--muted); word-break: break-all; }
.review { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 6px; }
details.card > summary { cursor: pointer; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before { content: "+ "; color: var(--accent); font-weight: 700; }
details[open].card > summary::before { content: "– "; }
.inline-h { display: inline; }
.list { list-style: none; padding: 0; margin: 0 0 8px; }
.list li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 14px; }
.qr { display: flex; justify-content: center; margin: 12px 0; }
.qr svg { border-radius: 10px; max-width: 100%; height: auto; }
.steps { padding-left: 20px; color: var(--muted); }

@media (max-width: 960px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid2 { grid-template-columns: 1fr; }
  .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .top { flex-wrap: wrap; padding: 10px 16px; }
  .navtoggle { display: inline-flex; }
  .navtoggle { padding: 7px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; }
  #nav { display: none; width: 100%; flex-direction: column; align-items: stretch; }
  #nav.open { display: flex; }
  main { padding: 14px 16px 32px; }
  h1 { font-size: 22px; }
  .card { padding: 16px; }
  .meta { grid-template-columns: 1fr; }
  .foot { flex-direction: column; padding: 14px 16px 24px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
