/* Debriage panel - same visual language as www.debriage.com */
:root {
  --bg: #07101c;
  --bg-soft: #0b1626;
  --panel: rgba(15, 29, 48, 0.82);
  --panel-strong: #101d30;
  --text: #f5f8fc;
  --muted: #9fb0c4;
  --line: rgba(255, 255, 255, 0.09);
  --brand: #6ee7b7;
  --brand-2: #60a5fa;
  --warning: #fbbf24;
  --danger: #fb7185;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 10%, rgba(96, 165, 250, 0.16), transparent 28%),
    radial-gradient(circle at 85% 15%, rgba(110, 231, 183, 0.14), transparent 25%),
    linear-gradient(180deg, #08111f 0%, #07101c 50%, #050b13 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }

/* ---- shell -------------------------------------------------------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  flex-shrink: 0;
  padding: 22px 16px;
  border-right: 1px solid var(--line);
  background: rgba(7, 16, 28, 0.7);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 1.08rem;
  color: var(--text);
  margin-bottom: 18px;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  color: #04110d;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  font-weight: 900;
}
.brand small { display: block; font-size: 0.68rem; font-weight: 600; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.93rem;
  font-weight: 600;
}
.nav-link:hover { color: var(--text); background: rgba(255,255,255,0.05); text-decoration: none; }
.nav-link.active {
  color: var(--text);
  background: rgba(110, 231, 183, 0.1);
  box-shadow: inset 0 0 0 1px rgba(110, 231, 183, 0.25);
}

.sidebar .spacer { flex: 1; }
.sidebar .whoami { padding: 10px 12px; color: var(--muted); font-size: 0.8rem; border-top: 1px solid var(--line); }
.sidebar .whoami strong { color: var(--text); display: block; }

.main { flex: 1; padding: 30px 34px 60px; max-width: 1200px; }

h1.page-title { margin: 0 0 6px; font-size: 1.9rem; letter-spacing: -0.04em; }
.page-sub { color: var(--muted); margin: 0 0 26px; font-size: 0.95rem; }

/* ---- cards / tables ------------------------------------------------ */
.card {
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.16);
  margin-bottom: 20px;
}
.card h2 { margin: 0 0 14px; font-size: 1.12rem; letter-spacing: -0.02em; }
.card .hint { color: var(--muted); font-size: 0.86rem; }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } .sidebar { display:none; } .main { padding: 20px; } }

.stat { padding: 18px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: rgba(255,255,255,0.025); }
.stat strong { display: block; font-size: 1.55rem; letter-spacing: -0.03em; }
.stat span { color: var(--muted); font-size: 0.8rem; }

table { width: 100%; border-collapse: collapse; font-size: 0.91rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.07em; font-weight: 700; }
tr:last-child td { border-bottom: none; }
td.actions { text-align: right; white-space: nowrap; }

/* ---- badges -------------------------------------------------------- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  border: 1px solid transparent;
}
.badge.ok { color: #86efac; background: rgba(74, 222, 128, 0.1); border-color: rgba(74, 222, 128, 0.3); }
.badge.warn { color: #fde68a; background: rgba(251, 191, 36, 0.1); border-color: rgba(251, 191, 36, 0.3); }
.badge.err { color: #fda4af; background: rgba(251, 113, 133, 0.1); border-color: rgba(251, 113, 133, 0.3); }
.badge.muted { color: var(--muted); background: rgba(255,255,255,0.04); border-color: var(--line); }

/* ---- forms ---------------------------------------------------------- */
label { display: block; margin: 12px 0 6px; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], select, textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: rgba(110, 231, 183, 0.5); }
select option { background: var(--panel-strong); }
.checkbox { display: flex; align-items: center; gap: 9px; margin: 12px 0; font-size: 0.9rem; color: var(--text); }
.checkbox input { width: auto; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: #04130f; background: linear-gradient(135deg, var(--brand), #91f3cf); }
.btn-secondary { background: rgba(255, 255, 255, 0.05); border-color: var(--line); color: var(--text); }
.btn-danger { background: rgba(251, 113, 133, 0.12); border-color: rgba(251, 113, 133, 0.35); color: #fda4af; }
.btn-sm { min-height: 32px; padding: 0 11px; font-size: 0.8rem; border-radius: 9px; }

form.inline { display: inline; }
.form-row { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.form-row > div { flex: 1; min-width: 160px; }

/* ---- flash ---------------------------------------------------------- */
.flash { padding: 13px 16px; border-radius: 12px; margin-bottom: 14px; font-size: 0.92rem; border: 1px solid; }
.flash.ok { color: #86efac; background: rgba(74, 222, 128, 0.08); border-color: rgba(74, 222, 128, 0.3); }
.flash.error { color: #fda4af; background: rgba(251, 113, 133, 0.08); border-color: rgba(251, 113, 133, 0.3); }

.secret-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: rgba(110, 231, 183, 0.07);
  border: 1px dashed rgba(110, 231, 183, 0.4);
  padding: 14px 16px;
  border-radius: 12px;
  margin: 10px 0;
  word-break: break-all;
}

/* ---- progress / quota ----------------------------------------------- */
.meter { height: 9px; border-radius: 999px; background: rgba(255,255,255,0.07); overflow: hidden; margin-top: 8px; }
.meter > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.meter.hot > i { background: linear-gradient(90deg, var(--warning), var(--danger)); }

/* ---- login ----------------------------------------------------------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(420px, 100%);
  padding: 34px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(16, 29, 48, 0.92), rgba(10, 20, 35, 0.92));
  box-shadow: var(--shadow);
}
.login-card .brand { justify-content: center; margin-bottom: 8px; }
.login-card p.sub { text-align: center; color: var(--muted); margin: 0 0 20px; font-size: 0.9rem; }
.login-card .btn { width: 100%; margin-top: 20px; }

.msg-thread .msg { padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,0.03); margin-bottom: 12px; }
.msg-thread .msg.staff { border-color: rgba(110, 231, 183, 0.3); background: rgba(110, 231, 183, 0.05); }
.msg-thread .msg .meta { font-size: 0.76rem; color: var(--muted); margin-bottom: 6px; }
.msg-thread .msg p { margin: 0; white-space: pre-wrap; font-size: 0.92rem; }

code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.86em; }
details.joblog pre { white-space: pre-wrap; font-size: 0.78rem; color: var(--muted); max-height: 240px; overflow: auto; }
