/* confsched — shared styles. Vanilla CSS, mobile-first, light + dark. */

:root {
  --brand: #5b5bf0;
  --brand-600: #4a45e0;
  --brand-050: #eeeefc;
  --ok: #16a34a;
  --ok-bg: #e7f6ec;
  --warn: #d97706;
  --warn-bg: #fdf1df;
  --danger: #dc2626;
  --danger-bg: #fdeaea;

  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f1f2f8;
  --border: #e4e6ef;
  --text: #1a1a2e;
  --muted: #6b6f80;
  --shadow: 0 1px 2px rgba(20, 20, 50, 0.06), 0 4px 16px rgba(20, 20, 50, 0.05);
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #8a8aff;
    --brand-600: #a0a0ff;
    --brand-050: #1c1c34;
    --ok: #4ade80;
    --ok-bg: #16281c;
    --warn: #fbbf24;
    --warn-bg: #2a2110;
    --danger: #f87171;
    --danger-bg: #2c1616;

    --bg: #0f0f1e;
    --surface: #181829;
    --surface-2: #20203a;
    --border: #2b2b45;
    --text: #e8e8f2;
    --muted: #9a9ab0;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.25);
  }
}
:root[data-theme='dark'] { color-scheme: dark; }
:root[data-theme='light'] { color-scheme: light; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; }

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.hidden { display: none !important; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack > * + * { margin-top: 10px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── Top bar ─────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar .wrap { display: flex; align-items: center; gap: 12px; min-height: 58px; }
.brandmark { font-weight: 800; letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px; }
.brandmark .dot { width: 12px; height: 12px; border-radius: 4px; background: var(--brand); display: inline-block; }
.grow { flex: 1; }

/* ── Buttons / inputs ────────────────────────────────────── */
button, .btn {
  font: inherit; cursor: pointer; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  padding: 9px 14px; border-radius: 10px; font-weight: 600;
  transition: transform 0.04s ease, background 0.15s ease, border-color 0.15s;
}
button:hover, .btn:hover { border-color: var(--brand); }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.5; cursor: default; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn-danger:hover { border-color: var(--danger); color: var(--danger); }

input[type=text], input[type=email], textarea, select {
  font: inherit; width: 100%; padding: 11px 13px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text);
}
input:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
label { font-weight: 600; font-size: 13px; }

/* ── Cards / panels ──────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px;
}
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }

/* ── Badges / chips ──────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
  padding: 3px 8px; border-radius: 999px;
  background: var(--brand-050); color: var(--brand-600);
  border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent);
  text-transform: uppercase;
}
.badge.partner { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border);
}
.pill-ok { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.pill-warn { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.pill-danger { background: var(--danger-bg); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }

/* member initials avatar */
.ava {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%; font-size: 11px; font-weight: 700;
  background: var(--brand-050); color: var(--brand-600); border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent);
}
.ava.me { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ── Timeline (member grid) ──────────────────────────────── */
.daybar {
  position: sticky; top: 58px; z-index: 10;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(6px);
  padding: 14px 0 8px; margin-top: 8px;
  font-size: 15px; font-weight: 800; letter-spacing: -0.01em;
  border-bottom: 1px solid var(--border);
}
.slot { display: grid; grid-template-columns: 76px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.slot .time { font-size: 12px; font-weight: 700; color: var(--muted); padding-top: 3px; }
.slot .time .end { display: block; font-weight: 500; opacity: 0.7; }
.slot.plenary .body { color: var(--muted); }
.slot .label { font-weight: 700; }
.slot .sublabel { font-size: 12px; color: var(--muted); }

.sessions {
  display: grid; gap: 10px; margin-top: 8px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.session {
  position: relative; text-align: left; align-items: stretch;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  padding: 11px 12px; display: flex; flex-direction: column; gap: 6px; min-height: 92px;
}
.session:hover { border-color: var(--brand); }
.session.mine { border-color: var(--brand); background: var(--brand-050); box-shadow: inset 0 0 0 1px var(--brand); }
.session .stitle { font-weight: 700; font-size: 14px; line-height: 1.25; }
.session .smeta { font-size: 12px; color: var(--muted); }
.session .sfoot { margin-top: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.session .check {
  position: absolute; top: 9px; right: 9px; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--border); display: grid; place-items: center; font-size: 12px; color: transparent;
}
.session.mine .check { background: var(--brand); border-color: var(--brand); color: #fff; }
.session .room { font-size: 11px; font-weight: 700; color: var(--muted); }
.session.conflict { border-color: var(--danger); }

/* ── Coverage panel ──────────────────────────────────────── */
.cov-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px; text-align: center; }
.stat .num { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.stat .lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.stat.good .num { color: var(--ok); }
.stat.warn .num { color: var(--warn); }
.stat.bad .num { color: var(--danger); }

.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px;
  font-size: 13px; font-weight: 600; box-shadow: var(--shadow); opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s; z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

/* ── Footer funnel ───────────────────────────────────────── */
.brandfoot { text-align: center; color: var(--muted); font-size: 13px; padding: 28px 16px 40px; }
.brandfoot a { font-weight: 700; text-decoration: none; }

/* ── Modal ───────────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; background: rgba(10, 10, 25, 0.55); display: grid; place-items: center;
  padding: 16px; z-index: 50;
}
.modal { width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; }

@media (max-width: 560px) {
  .slot { grid-template-columns: 60px 1fr; }
  .sessions { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 420px) {
  .sessions { grid-template-columns: 1fr; }
}
