/* G-Sessions Admin: the G family look (GAiA Desk tokens): a dark canvas,
   glass cards, green as light (rims, washes, glow) rather than as fill. */

@font-face { font-family: 'Inter'; font-weight: 300 800; font-display: swap; src: url(/fonts/inter-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2192; }
@font-face { font-family: 'Inter'; font-weight: 300 800; font-display: swap; src: url(/fonts/inter-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+1E00-1EFF; }

:root {
  --brand: #18b451;
  --brand-hi: #2bd06b;
  --glow: rgba(24, 180, 81, 0.45);
  --wash: rgba(24, 180, 81, 0.10);
  --line: rgba(24, 180, 81, 0.32);
  --bg: hsl(0 0% 6%);
  --card: rgba(255, 255, 255, 0.045);
  --card-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --text: hsl(0 0% 97%);
  --text-2: hsl(0 0% 80%);
  --muted: hsl(0 0% 58%);
  --input: hsl(0 0% 11%);
  --bad: #ff6b6b;
  --wait: #f2bf6c;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, 'SF Pro Text', Inter, system-ui, sans-serif;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  color: var(--text);
  background:
    radial-gradient(60% 40% at 50% 110%, rgba(24, 180, 81, 0.14), transparent 70%),
    radial-gradient(80% 60% at 50% -10%, #1d1f22, transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
a { color: var(--brand-hi); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; margin: 6px 0 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h2 { font-size: 15px; margin: 0 0 12px; color: var(--text-2); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.right { text-align: right; white-space: nowrap; }

/* ------------------------------------------------------------ header */
.top {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; gap: 22px;
  padding: 12px 24px;
  background: rgba(12, 12, 14, 0.75);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; }
.brand b { color: var(--brand-hi); font-weight: 600; }
.brand:hover { text-decoration: none; }
.mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--card) url(/gaia-mark-white.png) center / 66% no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.brand.big { font-size: 18px; margin-bottom: 8px; }
.brand.big .mark { width: 38px; height: 38px; border-radius: 10px; }
nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
nav a { color: var(--text-2); padding: 6px 12px; border-radius: 8px; }
nav a:hover { background: var(--card-hover); text-decoration: none; }
nav a.on { color: var(--text); background: var(--wash); box-shadow: inset 0 0 0 1px var(--line); }
.out { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }

main { max-width: 1180px; margin: 0 auto; padding: 22px 24px 60px; }
main.center { min-height: 100vh; display: grid; place-items: center; padding: 20px 16px; }

/* ------------------------------------------------------------ cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 16px;
  backdrop-filter: blur(24px);
}
.card.attention { border-color: var(--line); box-shadow: 0 0 0 1px var(--line) inset, 0 10px 30px -18px var(--glow); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; }
.cols .card { margin-bottom: 0; }
.cols + .cols, .cols + .card, .card + .cols { margin-top: 16px; }
.login { width: min(380px, 100%); display: grid; gap: 12px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.stat b { display: block; font-size: 24px; font-weight: 650; }
.stat span { color: var(--muted); font-size: 12.5px; }
.stats.small .stat b { font-size: 19px; }

/* ------------------------------------------------------------ tables */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--border); }
td { padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
table.compact td { padding: 6px 8px; }
td form { display: inline-block; margin-left: 4px; }

.row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.row:last-child { border-bottom: 0; }
.row > :nth-child(3) { flex: 1; }
.events { list-style: none; margin: 0; padding: 0; }
.events li { padding: 7px 0; border-bottom: 1px solid var(--border); }
.events li:last-child { border-bottom: 0; }
.more { display: inline-block; margin-top: 10px; }

.pill { display: inline-block; font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: 999px; background: var(--card-hover); color: var(--text-2); }
.pill.ok { color: #7ee2a0; background: rgba(24, 180, 81, 0.14); }
.pill.wait { color: var(--wait); background: rgba(242, 191, 108, 0.12); }
.pill.bad { color: var(--bad); background: rgba(255, 107, 107, 0.12); }

/* ------------------------------------------------------------ forms */
label { display: grid; gap: 5px; color: var(--text-2); font-size: 13px; margin-bottom: 10px; }
label.small { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
label.small input { width: 64px; }
input, select, textarea {
  font: inherit; color: var(--text);
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--line); box-shadow: 0 0 0 3px var(--wash); }
.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.inline input[type='email'], .inline input:not([type]) { flex: 1; min-width: 180px; }

button, .button {
  display: inline-block;
  font: 600 13px/1 -apple-system, BlinkMacSystemFont, Inter, sans-serif;
  color: #fff;
  background: linear-gradient(180deg, var(--brand-hi), var(--brand));
  border: 0; border-radius: 8px;
  padding: 9px 14px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 6px 16px -8px var(--glow);
}
button:hover, .button:hover { filter: brightness(1.06); text-decoration: none; }
button:disabled { opacity: 0.5; cursor: default; }
button.ghost, .button.ghost { color: var(--text-2); background: var(--card-hover); box-shadow: inset 0 0 0 1px var(--border); }
button.danger { background: linear-gradient(180deg, #ff7a7a, #e05555); box-shadow: none; }
button.ghost.danger { color: var(--bad); background: transparent; box-shadow: inset 0 0 0 1px rgba(255, 107, 107, 0.4); }
.actions { display: flex; gap: 8px; margin: 4px 0 16px; }
.actions form { margin: 0; }
.danger-zone { margin-top: 24px; }
.back { display: inline-block; margin-bottom: 6px; color: var(--muted); }
.site-back {
  position: fixed; top: 20px; left: 24px; z-index: 2;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 15px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--text-2);
  background: var(--card); box-shadow: inset 0 0 0 1px var(--border);
  transition: background-color 0.2s ease, color 0.2s ease;
}
.site-back:hover { color: var(--text); background: var(--card-hover); text-decoration: none; }

.switches { display: grid; gap: 4px; margin-bottom: 12px; }
.switch { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; margin: 0; padding: 6px 4px; cursor: pointer; border-radius: 8px; }
.switch:hover { background: var(--card-hover); }
.switch input { display: none; }
.switch span { grid-row: 1 / 3; width: 36px; height: 21px; border-radius: 999px; background: hsl(0 0% 22%); position: relative; transition: background 0.2s; }
.switch span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.switch input:checked + span { background: var(--brand); box-shadow: 0 0 10px -2px var(--glow); }
.switch input:checked + span::after { transform: translateX(15px); }
.switch b { color: var(--text); font-weight: 550; }
.switch em { font-style: normal; color: var(--muted); font-size: 12.5px; }

.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; background: var(--wash); box-shadow: inset 0 0 0 1px var(--line); }
.flash.bad { background: rgba(255, 107, 107, 0.1); box-shadow: inset 0 0 0 1px rgba(255, 107, 107, 0.35); }

@media (max-width: 720px) {
  .top { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .out span { display: none; }
  main { padding: 16px; }
  .cols { grid-template-columns: 1fr; }
}
