:root {
  --brand: #0f766e;
  --brand2: #14b8a6;
  --brand-soft: rgba(45, 212, 191, 0.14);
  --bg: #070b14;
  --bg-elev: #0d1424;
  --card: #111827;
  --card-2: #151c2e;
  --text: #f8fafc;
  --muted: #94a3b8;
  --border: #1e293b;
  --border-strong: #334155;
  --ok: #34d399;
  --bad: #f87171;
  --warn: #fbbf24;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --font: Inter, system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(1000px 560px at 8% -8%, rgba(45, 212, 191, 0.16), transparent 55%),
    radial-gradient(800px 480px at 100% 0%, rgba(56, 189, 248, 0.1), transparent 48%),
    radial-gradient(700px 400px at 50% 100%, rgba(15, 118, 110, 0.08), transparent 50%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
a { color: var(--brand2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Brand / logo ─────────────────────────────────────────── */
.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.brand-lg { margin-bottom: 1.75rem; }
.brand-sm { margin-bottom: 1rem; }
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.logo-word { font-size: 1.05rem; font-weight: 800; }
.brand-sub {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.logo-mark {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 12px;
  overflow: hidden;
  background: #F5FF00;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 8px 20px rgba(245, 255, 0, 0.18);
  flex-shrink: 0;
}
.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.brand-lg .logo-mark { width: 2.75rem; height: 2.75rem; border-radius: 14px; }
.top .logo-mark { width: 2rem; height: 2rem; border-radius: 10px; }
.platform-admin-pill {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  vertical-align: middle;
  color: #042f2e;
  background: linear-gradient(135deg, #5eead4, #2dd4bf);
}

/* ── Login shell ──────────────────────────────────────────── */
.shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.platform-back-workspace {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 2;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(17, 24, 39, 0.75);
  backdrop-filter: blur(8px);
  text-decoration: none;
}
.platform-back-workspace:hover {
  color: var(--text);
  border-color: var(--border-strong);
  text-decoration: none;
}
.login-stage {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1.25rem;
  align-items: stretch;
}
.login-aside {
  padding: 2rem 1.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background:
    linear-gradient(160deg, rgba(20, 184, 166, 0.12), transparent 42%),
    var(--card);
  box-shadow: var(--shadow);
}
.login-aside-title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.login-aside-lead {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.65;
}
.login-aside-points {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.65rem;
}
.login-aside-points li {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  color: #cbd5e1;
  font-size: 0.9rem;
  font-weight: 500;
}
.login-aside-points li::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-top: 0.4rem;
  border-radius: 50%;
  background: #2dd4bf;
  box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.15);
  flex-shrink: 0;
}
.login-card { width: 100%; align-self: center; }
.login-foot { margin-top: 0.85rem; line-height: 1.5; }

/* ── Cards / typography ───────────────────────────────────── */
.card {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
  box-shadow: var(--shadow);
}
.panel-elevated {
  border-color: rgba(45, 212, 191, 0.22);
  box-shadow:
    0 0 0 1px rgba(45, 212, 191, 0.06),
    var(--shadow);
}
.card-head { margin-bottom: 0.85rem; }
.eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand2);
}
h1 {
  font-size: clamp(1.35rem, 2vw, 1.7rem);
  margin: 0 0 0.35rem;
  letter-spacing: -0.03em;
  font-weight: 800;
}
h2 {
  font-size: 1.02rem;
  margin: 0 0 0.3rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}
h3.subhead {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 1.15rem 0 0.35rem;
}
.section-gap { margin-top: 1.75rem; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ── Forms ────────────────────────────────────────────────── */
label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin-top: 0.75rem;
}
input, select {
  width: 100%;
  margin-top: 0.35rem;
  border: 1px solid var(--border);
  background: #0b1220;
  color: var(--text);
  border-radius: 12px;
  padding: 0.65rem 0.8rem;
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus {
  outline: none;
  border-color: rgba(45, 212, 191, 0.55);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.15);
}
.form { display: grid; gap: 0.1rem; }
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}
.slug-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.35rem;
}
.slug-row span {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}
.slug-row input { margin-top: 0; }

/* Trial picker */
.trial-box {
  margin-top: 1rem;
  padding: 0.95rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(45, 212, 191, 0.28);
  background:
    linear-gradient(135deg, rgba(45, 212, 191, 0.1), transparent 55%),
    #0b1220;
}
.trial-box-head {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 0.75rem;
}
.trial-box-head strong {
  font-size: 0.88rem;
  color: #ecfdf5;
}
.trial-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.trial-chip {
  border: 1px solid var(--border);
  background: #111827;
  color: var(--text);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.trial-chip:hover {
  border-color: var(--brand2);
}
.trial-chip.active {
  background: linear-gradient(135deg, var(--brand2), var(--brand));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.35);
}
.trial-custom { margin-top: 0.75rem; }
.trial-custom input { max-width: 8rem; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  border: 0;
  border-radius: 12px;
  padding: 0.7rem 1.05rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  margin-top: 1rem;
  width: 100%;
  background: linear-gradient(135deg, var(--brand2), var(--brand));
  color: #fff;
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.35);
}
.btn-inline { width: auto; margin-top: 0.85rem; }
.btn-secondary {
  background: #1e293b;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-sm { padding: 0.4rem 0.7rem; font-size: 0.78rem; border-radius: 10px; }
.btn-danger {
  background: rgba(248, 113, 113, 0.12);
  color: var(--bad);
  border: 1px solid rgba(248, 113, 113, 0.35);
}
.btn-ok {
  background: rgba(52, 211, 153, 0.12);
  color: var(--ok);
  border: 1px solid rgba(52, 211, 153, 0.35);
}
.linkish {
  border: 0;
  background: none;
  color: var(--brand2);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.alert {
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  font-size: 0.85rem;
  margin: 0.75rem 0;
}
.alert.error { background: rgba(248, 113, 113, 0.12); color: #fecaca; border: 1px solid rgba(248, 113, 113, 0.25); }
.alert.success { background: rgba(52, 211, 153, 0.12); color: #a7f3d0; border: 1px solid rgba(52, 211, 153, 0.25); }

/* ── App chrome ───────────────────────────────────────────── */
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.35rem;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 15, 28, 0.82);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.top-right { display: flex; align-items: center; gap: 0.55rem; }
.who-chip {
  font-size: 0.78rem;
  font-weight: 600;
  color: #ccfbf1;
  background: var(--brand-soft);
  border: 1px solid rgba(45, 212, 191, 0.25);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.35rem 1.25rem 2.5rem;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.15rem;
}
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.row-actions input,
.row-actions select {
  width: auto;
  min-width: 9rem;
  margin: 0;
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.15rem;
}
.stat-card {
  padding: 1rem 1.1rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(45, 212, 191, 0.08), transparent 55%), var(--card);
}
.stat-card.warn {
  background: linear-gradient(160deg, rgba(251, 191, 36, 0.1), transparent 55%), var(--card);
  border-color: rgba(251, 191, 36, 0.28);
}
.stat-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.stat-card strong {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.grid-2 {
  display: grid;
  grid-template-columns: 0.95fr 1.2fr;
  gap: 1rem;
  margin-top: 1rem;
}

/* Tables */
.table-wrap { overflow-x: auto; margin-top: 0.35rem; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
th {
  text-align: left;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 0.7rem 0.4rem;
  border-bottom: 1px solid #1a2332;
  vertical-align: top;
}
.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: #1e293b;
  text-transform: lowercase;
}
.badge.trial { color: var(--warn); background: rgba(251, 191, 36, 0.12); }
.badge.active { color: var(--ok); background: rgba(52, 211, 153, 0.12); }
.badge.suspended { color: var(--bad); background: rgba(248, 113, 113, 0.12); }
.trial-meta {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.45;
}
.trial-meta.ending { color: var(--warn); font-weight: 600; }
.trial-meta.expired { color: var(--bad); font-weight: 700; }
.trial-edit {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
  margin-top: 0.35rem;
}
.trial-edit input,
.trial-edit select {
  width: auto;
  min-width: 4.5rem;
  margin: 0;
  padding: 0.28rem 0.4rem;
  font-size: 0.75rem;
}
.actions { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.plan-select {
  max-width: 6.5rem;
  font-size: 0.75rem;
  padding: 0.28rem 0.4rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0b1220;
  color: var(--text);
  margin: 0;
}
.empty {
  text-align: center;
  padding: 1.75rem 1rem;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 14px;
  margin-top: 0.75rem;
}

.go-live-list {
  list-style: none;
  padding: 0;
  margin: 0.55rem 0 0;
  display: grid;
  gap: 0.45rem;
}
.go-live-list label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
  margin: 0;
}
.go-live-list input { width: auto; margin: 0.2rem 0 0; }

.audit-list {
  max-height: 240px;
  overflow: auto;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
  padding-top: 0.5rem;
}
.audit-list div {
  padding: 0.4rem 0;
  border-bottom: 1px solid #1a2332;
}

/* Desk */
.desk-card {
  border-color: #334155;
  margin-bottom: 0.25rem;
}
.desk-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.desk-period {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-end;
}
.desk-period input { width: 5rem; min-width: 0; }
.inline-label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
  margin: 0;
}
.desk-summary { margin-bottom: 0.75rem; line-height: 1.6; }
.desk-pill {
  display: inline-block;
  font-weight: 700;
  margin-right: 0.35rem;
}
.desk-pill.ok { color: var(--ok); }
.desk-pill.warn { color: var(--warn); }
.desk-pill.bad { color: var(--bad); }
.desk-pill.muted { color: var(--muted); }
.desk-grade {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}
.desk-grade-closed { background: #064e3b; color: #6ee7b7; }
.desk-grade-in_progress { background: #78350f; color: #fcd34d; }
.desk-grade-not_started { background: #1e293b; color: #94a3b8; }
.desk-grade-blocked { background: #7f1d1d; color: #fca5a5; }
.desk-grade-suspended { background: #334155; color: #cbd5e1; }
tr.desk-attention td:first-child {
  border-left: 3px solid var(--warn);
  padding-left: 0.45rem;
}
.desk-details { margin-top: 0.35rem; }
.desk-details summary { cursor: pointer; }
.desk-check {
  font-size: 0.75rem;
  margin: 0.2rem 0;
  padding: 0.2rem 0;
  color: var(--muted);
}
.desk-check-ok strong { color: var(--ok); }
.desk-check-warn strong { color: var(--warn); }
.desk-check-block strong { color: var(--bad); }

@media (max-width: 980px) {
  .login-stage { grid-template-columns: 1fr; }
  .login-aside { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .field-row { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr; }
  .who-chip { display: none; }
  .main { padding: 1rem 0.85rem 2rem; }
}
