/* schools.tribalcrunch.com — glass-box school admin portal */
:root {
  --bg-0: #0a0c18;
  --bg-1: #11152a;
  --text: #e8ecf5;
  --muted: rgba(232, 236, 245, 0.55);
  --accent: #5865f2;
  --ok: #3ecf8e;
  --warn: #f5c542;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: radial-gradient(ellipse at top left, #1a1f40 0%, var(--bg-0) 55%) fixed; color: var(--text); font-family: Inter, -apple-system, Segoe UI, Roboto, sans-serif; min-height: 100vh; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.login-card { width: min(420px, 100%); padding: 2rem 1.75rem; }
.login-card h1 { margin: 0; font-size: 1.6rem; font-weight: 700; text-align: center; }
.subtitle { color: var(--muted); text-align: center; margin: 0.3rem 0 1.5rem; }
.login-error { color: #ff7878; font-size: 0.9rem; min-height: 1.1rem; margin-bottom: 0.5rem; text-align: center; }

.field { margin-bottom: 1rem; }
.field label { display: block; font-size: 0.78rem; color: var(--muted); margin-bottom: 0.35rem; letter-spacing: 0.05em; text-transform: uppercase; }
.field input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  font: inherit;
  outline: none;
}
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(88,101,242,0.25); }

.btn { padding: 0.7rem 1rem; border-radius: 12px; font: inherit; font-weight: 600; cursor: pointer; border: none; transition: transform 0.15s, box-shadow 0.2s; }
.btn-primary { background: var(--accent); color: #fff; width: 100%; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(88,101,242,0.35); }
.btn-ghost { background: rgba(255,255,255,0.06); color: var(--text); border: 1px solid rgba(255,255,255,0.1); padding: 0.5rem 0.9rem; }
.btn-ghost:hover { background: rgba(255,255,255,0.1); }

/* Glass box */
.glass-box {
  position: relative;
  border-radius: 22px;
  padding: 1.5rem;
  background: linear-gradient(160deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 24px 60px rgba(0,0,0,0.45), 0 1px 0 rgba(255,255,255,0.08) inset;
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  --status: #8892a5;
  overflow: hidden;
}
.glass-pulse {
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle, color-mix(in srgb, var(--status) 25%, transparent) 0%, transparent 65%);
  filter: blur(40px);
  pointer-events: none;
  animation: pulse 4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.05); }
}

/* App shell */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  position: sticky; top: 0; z-index: 10;
  background: rgba(10,12,24,0.6);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.app-header h1 { margin: 0; font-size: 1.2rem; font-weight: 600; }
.main { max-width: 1120px; margin: 0 auto; padding: 1.5rem; display: flex; flex-direction: column; gap: 1.5rem; }

.loading { color: var(--muted); text-align: center; padding: 2rem; }
.empty { text-align: center; }
.empty h2 { margin-top: 0; }
.muted { color: var(--muted); }

/* Campaign cards */
.campaigns-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.campaign-card { text-align: left; cursor: pointer; color: inherit; font: inherit; }
.campaign-card:hover { transform: translateY(-2px); box-shadow: 0 30px 70px rgba(0,0,0,0.5); }
.campaign-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.75rem; }
.campaign-name { font-weight: 600; font-size: 1.05rem; }
.campaign-status { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; }
.campaign-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.campaign-meta .label { display: block; font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.campaign-meta .value { font-size: 0.9rem; }

/* Detail */
.campaign-detail { --status: #8892a5; }
.detail-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1rem; position: relative; }
.detail-head h2 { margin: 0; font-size: 1.4rem; }
.detail-status { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.75rem; position: relative; }
.stat { background: rgba(255,255,255,0.04); border-radius: 14px; padding: 0.85rem; border: 1px solid rgba(255,255,255,0.07); }
.stat-label { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.stat-value { font-size: 1.2rem; font-weight: 600; margin-top: 0.25rem; }

.split-block { margin-top: 1.25rem; background: rgba(255,255,255,0.04); border-radius: 14px; padding: 0.9rem; border: 1px solid rgba(255,255,255,0.07); position: relative; }
.split-title { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.split-bar { height: 10px; border-radius: 999px; overflow: hidden; display: flex; margin: 0.75rem 0 0.5rem; background: rgba(255,255,255,0.05); }
.split-school { background: var(--ok); }
.split-vendor { background: var(--accent); }
.split-legend { display: flex; gap: 1rem; font-size: 0.85rem; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 0.4rem; vertical-align: middle; }
.dot-school { background: var(--ok); }
.dot-vendor { background: var(--accent); }

.by-status { margin-top: 1rem; position: relative; }
.chips { margin-top: 0.5rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); border-radius: 999px; padding: 0.3rem 0.7rem; font-size: 0.82rem; }

/* Toasts */
.toast-container { position: fixed; top: 1rem; right: 1rem; z-index: 20; display: flex; flex-direction: column; gap: 0.5rem; pointer-events: none; }
.toast { pointer-events: auto; background: rgba(20,24,40,0.9); color: var(--text); padding: 0.7rem 1rem; border-radius: 12px; border: 1px solid rgba(255,255,255,0.08); box-shadow: 0 10px 30px rgba(0,0,0,0.45); font-size: 0.9rem; transition: opacity 0.3s; }
.toast-error { border-color: rgba(255,90,90,0.4); }
.toast-success { border-color: rgba(62,207,142,0.4); }
