/* Rankwright theme: deep navy with a violet-to-blue gradient accent and pill buttons. */
@import url("https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500&display=swap");

:root {
  color-scheme: dark;
  --bg: #0f0f1a; --bg-2: #13131f; --panel: #1a1a2e; --panel-2: #252540;
  --ink: #ffffff; --muted: #94a3b8; --faint: #64748b;
  --line: rgba(255, 255, 255, .08); --line-2: rgba(255, 255, 255, .14);
  --violet: #7c3aed; --blue: #2563eb; --cyan: #22d3ee;
  --accent: #a78bfa;                 /* links, chart lines, active states */
  --accent-soft: rgba(124, 58, 237, .16);
  --grad: linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
  --grad-text: linear-gradient(135deg, #c4b5fd 0%, #93c5fd 100%);
  --good: #34d399; --bad: #f87171; --warn: #fbbf24;
  --radius: 16px; --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; font: 14.5px/1.55 Geist, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink);
       background:
         radial-gradient(900px 500px at 85% -10%, rgba(124, 58, 237, .18), transparent 60%),
         radial-gradient(700px 500px at -10% 110%, rgba(37, 99, 235, .12), transparent 60%),
         var(--bg);
       background-attachment: fixed; min-height: 100vh; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: #c4b5fd; }
h1 { font-size: 26px; font-weight: 700; margin: 0 0 4px; letter-spacing: -.025em; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 14px; letter-spacing: -.01em; }
.sub { color: var(--muted); margin: 0 0 20px; }
::selection { background: rgba(124, 58, 237, .45); }

/* layout */
.layout { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { border-right: 1px solid var(--line); padding: 22px 14px; background: rgba(19, 19, 31, .85);
        backdrop-filter: blur(8px); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 3px; }
.brand { font-weight: 700; font-size: 19px; margin: 0 8px 18px; letter-spacing: -.03em; }
.brand span { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.side a.nav { display: block; padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 500;
              transition: background .15s, color .15s; }
.side a.nav:hover { background: rgba(255, 255, 255, .04); color: var(--ink); }
.side a.nav.on { background: var(--accent-soft); color: #fff; box-shadow: inset 2px 0 0 var(--violet); }
.side select { width: 100%; margin-bottom: 14px; }
.side .foot { margin-top: auto; font-size: 12.5px; color: var(--muted); display: grid; gap: 7px; padding: 0 8px; }
.side .foot a, .side .foot button.link { color: var(--muted); } .side .foot a:hover, .side .foot button.link:hover { color: var(--ink); }
main { padding: 32px 36px 64px; max-width: 1300px; width: 100%; }
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.head .sub { margin: 0; }

/* surfaces */
.panel { background: linear-gradient(180deg, rgba(37, 37, 64, .55), rgba(26, 26, 46, .75)); border: 1px solid var(--line);
         border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: 1fr 1fr; } .g3 { grid-template-columns: repeat(3, 1fr); }
.g-main { grid-template-columns: 2fr 1fr; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: linear-gradient(180deg, rgba(37, 37, 64, .55), rgba(26, 26, 46, .75)); border: 1px solid var(--line);
        border-radius: var(--radius); padding: 16px 18px; position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--grad); opacity: .7; }
.stat b { display: block; font-size: 28px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums;
          background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { color: var(--muted); font-size: 12.5px; }

/* tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11.5px; color: var(--faint); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
th a { color: inherit; } th a:hover { color: var(--ink); }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
tr:hover td { background: rgba(255, 255, 255, .025); }

/* buttons: secondary = dark outlined pill, primary = violet->blue gradient pill */
.btn, button { font: inherit; font-weight: 600; font-size: 13.5px; border: 1px solid var(--line-2); background: var(--panel);
       color: var(--ink); padding: 8px 18px; border-radius: 999px; cursor: pointer; display: inline-block; line-height: 1.4;
       transition: border-color .15s, background .15s, transform .1s, box-shadow .15s; }
.btn:hover, button:hover { border-color: rgba(167, 139, 250, .5); background: var(--panel-2); color: var(--ink); }
.btn:active, button:active { transform: translateY(1px); }
.btn.primary, button.primary { background: var(--grad); border-color: transparent; color: #fff;
       box-shadow: 0 6px 24px -8px rgba(124, 58, 237, .7); }
.btn.primary:hover, button.primary:hover { background: var(--grad); filter: brightness(1.12);
       box-shadow: 0 8px 30px -8px rgba(124, 58, 237, .9); }
button.danger { color: var(--bad); } button.danger:hover { border-color: rgba(248, 113, 113, .5); }
button.link { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 500; box-shadow: none; }
button.link:hover { background: none; color: #c4b5fd; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* forms */
input, select, textarea { font: inherit; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 10px;
       background: rgba(15, 15, 26, .7); color: var(--ink); transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(124, 58, 237, .25); }
input[type=checkbox] { accent-color: var(--violet); width: 15px; height: 15px; vertical-align: -2px; padding: 0; }
input[type=date] { color-scheme: dark; }
select option { background: var(--panel); }
textarea { width: 100%; }
label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; font-weight: 500; }
.field { margin-bottom: 14px; }
.field input:not([type=checkbox]), .field select, .field textarea { width: 100%; }
.hint { font-size: 12.5px; color: var(--faint); margin-top: 5px; }
.hint b { color: var(--muted); }

/* messages + badges */
.flash { padding: 11px 16px; border-radius: 12px; margin-bottom: 16px; border: 1px solid var(--line-2); background: var(--panel); }
.flash.ok { border-color: rgba(52, 211, 153, .4); background: rgba(52, 211, 153, .08); }
.flash.error { border-color: rgba(248, 113, 113, .45); background: rgba(248, 113, 113, .08); color: #fca5a5; }
.flash.warn { border-color: rgba(251, 191, 36, .4); background: rgba(251, 191, 36, .07); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 500;
        background: rgba(255, 255, 255, .05); border: 1px solid var(--line-2); white-space: nowrap; color: var(--muted); }
.pill.published, .pill.yes { background: rgba(52, 211, 153, .12); border-color: rgba(52, 211, 153, .25); color: var(--good); }
.pill.draft, .pill.planned { background: rgba(251, 191, 36, .1); border-color: rgba(251, 191, 36, .25); color: var(--warn); }
.pill.failed, .pill.no { background: rgba(248, 113, 113, .1); border-color: rgba(248, 113, 113, .25); color: var(--bad); }
.pill.approved, .pill.written { background: var(--accent-soft); border-color: rgba(167, 139, 250, .3); color: #c4b5fd; }
.up { color: var(--good); } .down { color: var(--bad); } .muted { color: var(--muted); }

/* filter tabs */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.tabs a { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel);
          color: var(--muted); font-size: 13px; font-weight: 500; }
.tabs a:hover { color: var(--ink); border-color: rgba(167, 139, 250, .4); }
.tabs a.on { background: var(--grad); color: #fff; border-color: transparent; }

/* charts */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: rgba(255, 255, 255, .07); stroke-width: 1; }
.chart .axis { fill: var(--faint); font-size: 10.5px; font-family: Geist, system-ui, sans-serif; }
.empty-chart { padding: 40px; text-align: center; color: var(--faint); border: 1px dashed var(--line-2); border-radius: 12px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal .dow { font-size: 11.5px; color: var(--faint); font-weight: 600; padding: 0 4px; text-transform: uppercase; letter-spacing: .06em; }
.cal .day { background: rgba(26, 26, 46, .7); border: 1px solid var(--line); border-radius: 12px; min-height: 112px; padding: 7px; font-size: 12.5px; }
.cal .day.other { opacity: .35; }
.cal .day.today { border-color: rgba(167, 139, 250, .7); box-shadow: 0 0 0 1px rgba(124, 58, 237, .35), 0 0 24px -6px rgba(124, 58, 237, .6); }
.cal .num { color: var(--faint); font-size: 12px; margin-bottom: 5px; font-weight: 500; }
.cal .item { background: rgba(255, 255, 255, .04); border-radius: 8px; padding: 6px 7px; margin-bottom: 5px; border-left: 3px solid var(--line-2); }
.cal .item.published { border-left-color: var(--good); } .cal .item.draft { border-left-color: var(--warn); }
.cal .item.approved { border-left-color: var(--violet); } .cal .item.failed { border-left-color: var(--bad); }
.cal details summary { cursor: pointer; list-style: none; }
.cal details form { margin-top: 6px; display: grid; gap: 5px; }
.cal details button { padding: 5px 12px; font-size: 12px; }

/* misc */
.score { font-weight: 700; font-variant-numeric: tabular-nums; }
.score.hi { color: var(--good); } .score.mid { color: var(--warn); } .score.lo { color: var(--bad); }
.checks li { list-style: none; margin: 4px 0; } .checks { padding: 0; margin: 0; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.editor textarea.body { font-family: var(--mono); font-size: 13px; min-height: 560px; line-height: 1.6; }
.answer { white-space: pre-wrap; background: rgba(15, 15, 26, .7); border: 1px solid var(--line); padding: 16px; border-radius: 12px; max-height: 70vh; overflow: auto; }
pre { background: rgba(15, 15, 26, .7); border-radius: 10px; padding: 10px; }
details summary { cursor: pointer; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--line-2); }
.dot.on { background: var(--good); box-shadow: 0 0 8px rgba(52, 211, 153, .7); }
.running { font-size: 12.5px; color: #c4b5fd; }
.spin { display: inline-block; width: 10px; height: 10px; border: 2px solid var(--accent); border-right-color: transparent;
        border-radius: 50%; animation: s 1s linear infinite; vertical-align: -1px; margin-right: 5px; }
@keyframes s { to { transform: rotate(360deg); } }
.login { max-width: 360px; margin: 16vh auto; }
.login .brand { font-size: 24px; }
.demo-banner { background: rgba(251, 191, 36, .1); border: 1px solid rgba(251, 191, 36, .35); color: var(--warn); text-align: center;
               font-size: 12.5px; padding: 6px; border-radius: 999px; margin-bottom: 18px; }
.trunc { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--panel-2); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; } .side { position: static; height: auto; }
  .g2, .g3, .g-main { grid-template-columns: 1fr; } main { padding: 20px 16px; }
  .cal { grid-template-columns: 1fr; } .cal .dow, .cal .day.other { display: none; }
  table { display: block; overflow-x: auto; }
}
