/* =========================================================
   Chesterweb • app.css (Glass / Minimal Monitoring • CLEAN)
   Scope: GLOBAL (all pages)
   Notes:
   - Dashboard-only styling lives in dashboard.css (scoped to body.page-dashboard)
   - Compact mode tokens can remain global if other pages also use it
========================================================= */

/* -------------------------
   0) TOKENS (GLOBAL)
-------------------------- */
:root{
  --bg0:#070A12;
  --bg1:#0B1020;

  --text:#EAF0FF;
  --muted: rgba(234,240,255,.72);
  --muted2: rgba(234,240,255,.55);

  --card: rgba(255,255,255,.05);
  --border: rgba(255,255,255,.12);
  --border2: rgba(255,255,255,.10);

  --shadow: 0 18px 60px rgba(0,0,0,.55);
  --shadow2: 0 14px 40px rgba(0,0,0,.35);

  --radius: 18px;

  --focus: rgba(35,213,255,.55);

  /* layout */
  --container-pad-x: 22px;
  --container-pad-y: 28px;
  --container-pad-bottom: 70px;
}

/* LIGHT THEME (GLOBAL) */
:root[data-theme="light"]{
  --bg0:#F5F7FB;
  --bg1:#E9EDF6;

  --text:#1B2430;
  --muted: rgba(27,36,48,.65);
  --muted2: rgba(27,36,48,.45);

  --card: rgba(255,255,255,.85);

  --border: rgba(0,0,0,.08);
  --border2: rgba(0,0,0,.06);

  --shadow: 0 18px 40px rgba(0,0,0,.08);
  --shadow2: 0 10px 24px rgba(0,0,0,.06);

  --focus: rgba(35,213,255,.35);
}

/* -------------------------
   0b) COMPACT TOKENS (GLOBAL)
   Keep here only if compact mode is used across multiple pages.
-------------------------- */
body.is-compact{
  /* keep only truly global compact tweaks here */
  --container-pad-x: 18px;
}

/* -------------------------
   1) BASE
-------------------------- */
*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color:var(--text);
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(124,92,255,.25), transparent 60%),
    radial-gradient(800px 520px at 85% 15%, rgba(35,213,255,.18), transparent 62%),
    radial-gradient(900px 700px at 40% 90%, rgba(53,255,178,.10), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  overflow-x:hidden;
}

a{ color:inherit; }
img{ max-width:100%; display:block; }
hr{ border:0; border-top:1px solid var(--border2); }

:focus-visible{
  outline:2px solid var(--focus);
  outline-offset:3px;
  border-radius:10px;
}

/* FX layers (optional) */
.grid-overlay{
  position:fixed; inset:0;
  pointer-events:none;
  background:
    linear-gradient(to right, rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,.8), transparent 70%);
  opacity:.28;
}
.noise{
  position:fixed; inset:0;
  pointer-events:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
  mix-blend-mode:overlay;
  opacity:.20;
}

/* -------------------------
   2) LAYOUT (GLOBAL)
-------------------------- */
.wrap{
  width:100%;
  max-width:none;
  margin:0;
  padding: var(--container-pad-y) var(--container-pad-x) var(--container-pad-bottom);
}

h1{ margin:0 0 10px; font-size:34px; letter-spacing:.2px; }
h2{ margin:0 0 12px; font-size:18px; font-weight:800; }
p{ margin:0; color:var(--muted); line-height:1.65; }

.hero{
  margin-top:5px;
  padding:20px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04));
  border:1px solid var(--border);
  box-shadow: var(--shadow);
  position:relative;
  overflow:hidden;
}
.hero::before{
  content:"";
  position:absolute; inset:-2px;
  background:
    radial-gradient(600px 240px at 10% 15%, rgba(35,213,255,.22), transparent 60%),
    radial-gradient(520px 260px at 90% 10%, rgba(124,92,255,.26), transparent 60%);
  filter: blur(2px);
  opacity:.9;
  pointer-events:none;
}
.hero > *{ position:relative; }

.card{
  margin-top:4px;
  padding:18px;
  border-radius: var(--radius);
  background: var(--card);
  border:1px solid var(--border);
  box-shadow: var(--shadow2);
  position:relative;
  overflow:hidden;
}
.card::before{
  content:"";
  position:absolute; inset:-2px;
  background:
    radial-gradient(520px 240px at 15% 20%, rgba(35,213,255,.10), transparent 58%),
    radial-gradient(520px 260px at 85% 10%, rgba(124,92,255,.12), transparent 55%);
  opacity:.65;
  pointer-events:none;
}
.card > *{ position:relative; }

/* -------------------------
   4) FORMS (GLOBAL)
-------------------------- */
.label{ display:block; font-size:13px; color:var(--muted); margin:0 0 8px; }

.input, .textarea, select.input{
  width:100%;
  padding:12px 12px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(7,10,18,.55);
  color: var(--text);
  outline:none;
}
:root[data-theme="light"] .input,
:root[data-theme="light"] .textarea,
:root[data-theme="light"] select.input{
  border-color: rgba(0,0,0,.10);
  background: rgba(255,255,255,.85);
}
.textarea{ min-height:180px; resize:vertical; }
.row{ display:flex; gap:12px; flex-wrap:wrap; margin-top:12px; }

/* -------------------------
   5) MODALS (GLOBAL SHELL)
-------------------------- */
.modal{ position:fixed; inset:0; display:none; z-index:9999; }
.modal.is-open{ display:block; }

.modal__backdrop{
  position:absolute; inset:0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(8px);
}

.modal__panel{
  position:relative;
  width:min(520px, calc(100% - 24px));
  margin:10vh auto 0;
  border-radius:18px;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.14);
  box-shadow: 0 18px 60px rgba(0,0,0,.55);
  overflow:hidden;
}

.modal__header{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 16px;
  border-bottom:1px solid rgba(255,255,255,.10);
}
.modal__close{
  background:transparent; border:0;
  color: rgba(234,240,255,.85);
  cursor:pointer;
  padding:6px 10px;
  border-radius:10px;
}
.modal__close:hover{ background: rgba(255,255,255,.06); }

.modal__body{ padding:14px 16px 16px; }

/* -------------------------
   6) RESPONSIVE (GLOBAL)
-------------------------- */
@media (max-width: 820px){
  :root{
    --container-pad-x: 16px;
    --container-pad-y: 22px;
    --container-pad-bottom: 60px;
  }
  h1{ font-size:28px; }
}

/* -------------------------
   7) REDUCE MOTION (GLOBAL)
-------------------------- */
@media (prefers-reduced-motion: reduce){
  *{
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior:auto !important;
  }
}

/* SLA: alles naast elkaar */
body.page-site .sla-inline{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;
}

body.page-site .sla-pill.is-head{
  font-weight: 950;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .95;
}

body.page-site .sla-sep{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  opacity: .35;
  border: 1px solid rgba(255,255,255,.14);
}
:root[data-theme="light"] body.page-site .sla-sep{
  border-color: rgba(0,0,0,.12);
}

/* Chart toolbar: range links, meta rechts (compact) */
body.page-site .chart-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom: 8px;
}

body.page-site .chart-toolbar-left{
  display:flex;
  align-items:center;
  gap:10px;
}

body.page-site .chart-label{ opacity:.8; }