/* Sponsley app UI — same design language as the landing page. */
:root {
  --bg: #F8FAFC; --ink: #0F172A; --muted: #64748B;
  --accent: #2563EB; --accent-hover: #1D4ED8; --accent-soft: #EFF6FF;
  --ok: #16A34A; --ok-soft: #F0FDF4; --warn: #D97706; --warn-soft: #FFFBEB;
  --danger: #DC2626; --danger-soft: #FEF2F2;
  --card: #FFFFFF; --line: #E2E8F0;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
  --shadow-md: 0 4px 6px -1px rgba(15,23,42,.07), 0 2px 4px -2px rgba(15,23,42,.06);
}
* { box-sizing: border-box; margin: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.55; font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---- shell ---- */
.shell { display: flex; min-height: 100vh; }
.side {
  width: 210px; flex-shrink: 0; background: var(--ink); color: #CBD5E1;
  padding: 20px 12px; display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh;
}
.side .brand { font-weight: 800; font-size: 19px; color: #fff; padding: 0 10px 18px; letter-spacing: -0.02em; }
.side .brand span { color: #60A5FA; }
.side a.nav {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: #CBD5E1;
}
.side a.nav svg { width: 17px; height: 17px; stroke: currentColor; flex-shrink: 0; }
.side a.nav:hover { background: rgba(255,255,255,.06); color: #fff; }
.side a.nav.on { background: rgba(37,99,235,.35); color: #fff; }
.side .spacer { flex: 1; }
.side form button {
  width: 100%; background: none; border: 1px solid #334155; color: #94A3B8;
  padding: 8px; border-radius: 8px; font-size: 13px;
}
.side form button:hover { color: #fff; border-color: #64748B; }
.main { flex: 1; min-width: 0; padding: 28px 32px 60px; }
.main > header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 22px; flex-wrap: wrap; gap: 10px; }
.main > header h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.main > header .sub { color: var(--muted); font-size: 13.5px; }
@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .side { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; flex-wrap: wrap; padding: 10px 12px; }
  .side .brand { padding: 0 10px 0 4px; font-size: 16px; }
  .side a.nav { padding: 7px 9px; font-size: 13px; }
  .side a.nav svg { display: none; }
  .side .spacer { display: none; }
  .side form { margin-left: auto; }
  .side form button { padding: 6px 10px; }
  .main { padding: 18px 14px 60px; }
}

/* ---- cards, grids ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); }
.card .card-head { padding: 13px 18px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card .card-body { padding: 16px 18px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow-sm); }
.kpi .k-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.kpi .k-value { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .k-note { font-size: 12.5px; color: var(--muted); }
.kpi.warn .k-value { color: var(--warn); }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 1000px) { .grid2 { grid-template-columns: 3fr 2fr; } }
.stack > * + * { margin-top: 18px; }

/* ---- chips & pipeline ---- */
.chip { font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.chip-ok { background: var(--ok-soft); color: var(--ok); border: 1px solid #BBF7D0; }
.chip-warn { background: var(--warn-soft); color: var(--warn); border: 1px solid #FDE68A; }
.chip-blue { background: var(--accent-soft); color: var(--accent); border: 1px solid #BFDBFE; }
.chip-open { background: #fff; color: var(--accent); border: 1px dashed #93C5FD; }
.chip-muted { background: #F1F5F9; color: var(--muted); border: 1px solid var(--line); }
.chip-danger { background: var(--danger-soft); color: var(--danger); border: 1px solid #FECACA; }
.pipe { display: inline-flex; align-items: center; vertical-align: middle; }
.pipe i { width: 8px; height: 8px; border-radius: 50%; background: #E2E8F0; }
.pipe u { width: 13px; height: 2px; background: #E2E8F0; }
.pipe i.done, .pipe u.done { background: var(--accent); }

/* ---- rows / tables ---- */
.rowlist .row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); font-size: 14px; }
.rowlist .row:last-child { border-bottom: 0; }
.rowlist .row:hover { background: #FBFCFE; }
.slot-date { width: 42px; flex-shrink: 0; text-align: center; line-height: 1.1; }
.slot-date b { display: block; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.slot-date span { font-size: 10px; color: var(--muted); text-transform: uppercase; font-weight: 600; }
.avatar { width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 800; color: #fff; }
.avatar.empty { background: none; border: 1.5px dashed #CBD5E1; color: var(--muted); }
.grow { flex: 1; min-width: 0; }
.grow b { display: block; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grow small { display: block; color: var(--muted); font-size: 12px; }
.amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.month-h { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 26px 0 10px; }
table.plain { width: 100%; border-collapse: collapse; font-size: 14px; }
table.plain th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 18px; border-bottom: 1px solid var(--line); }
table.plain td { padding: 11px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.plain tr:last-child td { border-bottom: 0; }
table.plain tr:hover td { background: #FBFCFE; }

/* ---- buttons & forms ---- */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: 8px; font-size: 13.5px; font-weight: 600; border: 0; transition: background .15s ease; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: #94A3B8; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
input[type=text], input[type=email], input[type=date], input[type=number], input[type=url], input[type=password], select, textarea {
  width: 100%; padding: 9px 11px; font-size: 14px; font-family: inherit;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.13); }
label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.field { margin-bottom: 12px; }
.frow { display: flex; gap: 10px; flex-wrap: wrap; }
.frow > * { flex: 1; min-width: 140px; }
form.inline { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
form.inline .field { margin-bottom: 0; }

/* ---- timeline ---- */
.timeline { list-style: none; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; font-size: 13.5px; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.timeline li::after { content: ""; position: absolute; left: 8px; top: 16px; bottom: -2px; width: 1.5px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline .t-when { color: var(--muted); font-size: 11.5px; display: block; }

/* ---- misc ---- */
.flash { position: fixed; top: 16px; right: 16px; z-index: 50; padding: 11px 18px; border-radius: 10px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-md); animation: fadeout 5s forwards; }
.flash.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid #BBF7D0; }
.flash.err { background: var(--danger-soft); color: var(--danger); border: 1px solid #FECACA; }
@keyframes fadeout { 0%,80% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
.alert-banner { background: var(--warn-soft); border: 1px solid #FDE68A; border-radius: 12px; padding: 14px 18px; margin-bottom: 18px; }
.alert-banner b { color: var(--warn); }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.copy-input { display: flex; gap: 8px; }
.copy-input input { font-size: 12.5px; font-family: ui-monospace, Menlo, monospace; color: var(--muted); }
details.email-body summary { cursor: pointer; font-weight: 600; font-size: 13px; }
details.email-body pre { white-space: pre-wrap; font-family: inherit; font-size: 13px; background: #FBFCFE; border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-top: 8px; }

/* ---- login & public pages ---- */
.center-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.center-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-md); padding: 30px; width: 100%; max-width: 420px; }
.center-card h1 { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.center-card .sub { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.public-brand { font-weight: 800; font-size: 17px; margin-bottom: 20px; }
.public-brand span { color: var(--accent); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0; }
.stat { background: var(--accent-soft); border: 1px solid #BFDBFE; border-radius: 10px; padding: 14px; text-align: center; }
.stat .s-v { font-size: 22px; font-weight: 800; color: var(--accent-hover); font-variant-numeric: tabular-nums; }
.stat .s-l { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.up-zone { border: 1.5px dashed #CBD5E1; border-radius: 10px; padding: 18px; text-align: center; color: var(--muted); font-size: 13.5px; }
