/* SRL web panel: one design system for every page.
   Pages link this first and only add their own layout on top. */
:root {
  /* surfaces */
  --bg:#0c0f13; --panel:#131820; --panel2:#1a212b; --panel3:#222b37;
  --line:#2a3440; --line2:#384453;
  /* text */
  --fg:#e8ecf1; --muted:#93a0af; --dim:#5f6b79;
  /* accents and states */
  --acc:#e10600; --acc-soft:rgba(225,6,0,.14);
  /* brand (SRL logo: white S, red R, green L), softened for the dark panel */
  --brand-red:#e10600; --brand-green:#2fd27a;
  --ok:#2fd27a; --warn:#f5a623; --bad:#ff8a80; --blue:#3fa7ff; --yellow:#ffd23f;
  --gold:#ffd23f; --silver:#c9d1db; --bronze:#d9925b;
  /* type */
  --font:'Bahnschrift','Segoe UI Variable','Segoe UI',system-ui,sans-serif;
  --mono:ui-monospace,'Cascadia Mono',Consolas,monospace;
  --fs-xs:11px; --fs-sm:12px; --fs:13px; --fs-md:14px; --fs-lg:16px; --fs-xl:20px;
  /* shape */
  --r-sm:6px; --r:10px; --r-pill:20px;
  --header-h:56px; --subbar-h:48px;
  color-scheme:dark;
}
* { box-sizing:border-box; }
html, body { height:100%; }
/* same usable width with or without a page scrollbar: the header never shifts between tabs */
html { scrollbar-gutter:stable; }
body { margin:0; background:var(--bg); color:var(--fg); font:var(--fs)/1.45 var(--font); }
a { color:var(--blue); text-decoration:none; }
a:hover { text-decoration:underline; }
code { font:var(--fs-sm) var(--mono); background:var(--panel2); border:1px solid var(--line); border-radius:4px; padding:0 5px; }
::-webkit-scrollbar { width:10px; height:10px; }
::-webkit-scrollbar-thumb { background:var(--line2); border-radius:5px; border:2px solid var(--bg); }
::-webkit-scrollbar-track { background:transparent; }

/* ---------- header (same on every page) ---------- */
header { position:relative; height:var(--header-h); display:flex; align-items:center; gap:14px; padding:0 16px;
         background:linear-gradient(180deg,#151b23,#11161c); border-bottom:1px solid var(--line); }
/* brand line: red -> green from the logo, fading out to the right */
header::after { content:""; position:absolute; left:0; right:0; bottom:-1px; height:2px; pointer-events:none;
                background:linear-gradient(90deg, var(--brand-red) 0, var(--brand-red) 90px, var(--brand-green) 210px, transparent 46%); }
/* the "SRL" text stays in the HTML (accessible name); the logo image is drawn instead */
.logo { display:inline-block; flex:none; width:96px; height:42px; background:url(/brand/logo-mark.png) left center/contain no-repeat;
        font-size:0; color:transparent; overflow:hidden; }
header .title { flex:none; font-size:var(--fs-lg); font-weight:700; letter-spacing:.01em; white-space:nowrap;
                padding-left:14px; border-left:1px solid var(--line2); line-height:22px; }
/* the header is global (logo, section, navigation, user): identical on every tab.
   Whatever belongs to one page goes in the bar below it. */
.subbar { height:var(--subbar-h); display:flex; align-items:center; gap:8px; padding:0 16px; min-width:0;
          background:var(--panel); border-bottom:1px solid var(--line); }
.subbar .spacer { flex:1; }

/* ---------- controls ---------- */
button, input, select, textarea { font:inherit; color:inherit; }
button { cursor:pointer; border:1px solid var(--line2); background:var(--panel2); border-radius:var(--r-sm);
         padding:6px 12px; line-height:1.35; white-space:nowrap; }
button:hover:not(:disabled) { border-color:var(--muted); }
button:disabled { opacity:.4; cursor:default; }
button.primary { background:var(--acc); border-color:var(--acc); color:#fff; font-weight:600; }
button.primary:hover:not(:disabled) { filter:brightness(1.1); border-color:var(--acc); }
button.go { background:#15361f; border-color:#2a7a46; color:#9ff0bf; font-weight:600; }
button.ghost { background:transparent; border-color:transparent; color:var(--muted); }
button.ghost:hover:not(:disabled) { color:var(--fg); border-color:var(--line2); }
button.danger { color:var(--bad); }
button.sm { padding:3px 8px; font-size:var(--fs-sm); }
a > button { color:var(--fg); }
input[type=text], input[type=number], input[type=email], input[type=date], input[type=datetime-local],
input:not([type]), select, textarea {
  background:var(--bg); border:1px solid var(--line2); border-radius:var(--r-sm); padding:6px 8px; min-width:0; }
input:focus, select:focus, textarea:focus { outline:none; border-color:var(--blue); }
input:disabled, select:disabled { opacity:.6; }
input[type=checkbox] { accent-color:var(--blue); width:15px; height:15px; }
textarea { font:var(--fs-sm)/1.45 var(--mono); width:100%; }

/* ---------- text ---------- */
h1 { font-size:var(--fs-xl); margin:0 0 6px; }
h2 { font-size:var(--fs-xl); margin:0 0 6px; }
h3, .section { font-size:var(--fs-xs); font-weight:700; text-transform:uppercase; letter-spacing:.09em; color:var(--muted); margin:18px 0 8px; }
.hint { color:var(--dim); font-size:var(--fs-sm); margin:6px 0; }
.muted { color:var(--muted); }
.sub { color:var(--dim); font-size:var(--fs-xs); display:block; }
.empty { padding:32px 16px; text-align:center; color:var(--muted); }

/* ---------- surfaces ---------- */
.card { background:var(--panel); border:1px solid var(--line); border-radius:var(--r); }
.card.pad { padding:14px 16px; }

/* ---------- tables ---------- */
table { width:100%; border-collapse:collapse; font-variant-numeric:tabular-nums; }
th, td { text-align:left; padding:8px 10px; border-bottom:1px solid var(--line); }
th { color:var(--muted); font-size:var(--fs-sm); font-weight:600; }
tr:last-child td { border-bottom:0; }
td.n, th.n { text-align:right; }

/* ---------- pills / status ---------- */
.pill { display:inline-block; font-size:var(--fs-xs); font-weight:600; padding:2px 9px; border-radius:var(--r-pill);
        border:1px solid var(--line2); color:var(--muted); white-space:nowrap; line-height:1.4; }
.pill.ok, .pill.open, .pill.current { color:var(--ok); border-color:rgba(47,210,122,.55); background:rgba(47,210,122,.08); }
.pill.warn, .pill.closed, .pill.missing { color:var(--warn); border-color:rgba(245,166,35,.5); background:rgba(245,166,35,.08); }
.pill.bad { color:var(--bad); border-color:rgba(255,138,128,.5); background:rgba(255,80,70,.1); }
.pill.info, .pill.next { color:var(--blue); border-color:rgba(63,167,255,.55); background:rgba(63,167,255,.08); }
.pill.finished { color:var(--fg); }
.pill.planned { border-style:dashed; }

/* ---------- tabs ---------- */
.tabs { display:flex; gap:4px; border-bottom:1px solid var(--line); }
.tabs button { border:0; border-radius:0; background:none; color:var(--muted); padding:10px 14px; font-weight:600;
               border-bottom:2px solid transparent; }
.tabs button:hover:not(:disabled) { color:var(--fg); }
.tabs button.on { color:var(--fg); border-bottom-color:var(--acc); }

/* ---------- toast ---------- */
#toast { position:fixed; bottom:18px; left:50%; transform:translateX(-50%) translateY(20px); opacity:0; pointer-events:none;
         background:#1e2732; border:1px solid var(--line2); padding:10px 16px; border-radius:8px; z-index:80;
         box-shadow:0 10px 30px rgba(0,0,0,.5); transition:.2s; max-width:70vw; }
#toast.show { opacity:1; transform:translateX(-50%); }
#toast.good { border-color:#2a7a46; color:#9ff0bf; }
#toast.bad { border-color:#7a2a2a; color:#ffb3ad; }
