:root {
  --bg: #f5f6fa; --surface: #fff; --text: #1d2433; --muted: #6b7385; --border: #e3e6ee;
  --brand: #4338ca; --brand-ink: #fff; --brand-soft: #eef0ff;
  --ok: #15803d; --ok-soft: #e7f6ec; --warn: #b45309; --warn-soft: #fdf3e2; --danger: #b91c1c; --danger-soft: #fdecec;
  --radius: 12px; --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1218; --surface: #171b24; --text: #e6e8ee; --muted: #9aa2b4; --border: #2a3040;
    --brand: #818cf8; --brand-ink: #0f1218; --brand-soft: #23264a; --ok: #4ade80; --ok-soft: #13301f; --warn: #fbbf24; --warn-soft: #33270f; --danger: #f87171; --danger-soft: #3a1717; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 26px; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 16px; margin: 8px 0 2px; }
code { background: var(--brand-soft); padding: 1px 6px; border-radius: 4px; font-size: 13px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.main { padding-top: 24px; padding-bottom: 40px; min-height: calc(100vh - 140px); }
.footer { padding: 20px 16px 32px; text-align: center; }
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; } .right { text-align: right; }
.danger { color: var(--danger); } .nowrap { white-space: nowrap; } .pre { white-space: pre-wrap; } .m0 { margin: 0; } .mt { margin-top: 20px; }
.row { display: flex; align-items: center; } .gap { gap: 12px; } .wrap-row { flex-wrap: wrap; } .align-end { align-items: flex-end; } .grow { flex: 1; min-width: 0; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stack > * + * { margin-top: 10px; }

/* Top bar */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.logo { width: 34px; height: 34px; border-radius: 9px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-size: 13px; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav > a { color: var(--muted); padding: 8px 12px; border-radius: 8px; font-weight: 500; }
.nav > a:hover { background: var(--bg); text-decoration: none; color: var(--text); }
.nav > a.active { color: var(--brand); background: var(--brand-soft); }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 18px; color: var(--text); }
.bell { position: relative; }
.badge-dot { position: absolute; top: 2px; right: 2px; background: var(--danger); color: #fff; border-radius: 999px; font-size: 10px; padding: 0 5px; line-height: 16px; }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; padding: 8px 12px; border-radius: 8px; font-weight: 600; }
.menu summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: 42px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); min-width: 220px; padding: 12px; display: grid; gap: 8px; }
.linklike { background: none; border: 0; color: var(--brand); padding: 0; font: inherit; cursor: pointer; }
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 60px; background: var(--surface); flex-direction: column; align-items: stretch; padding: 8px 16px 16px; border-bottom: 1px solid var(--border); }
  .nav.open { display: flex; }
  .menu-pop { position: static; box-shadow: none; }
}

/* Cards & layout */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 20px; }
.card.narrow { max-width: 440px; margin: 40px auto; }
.card.highlight { border-color: var(--warn); background: linear-gradient(0deg, var(--surface), var(--warn-soft)); }
.page-head { margin-bottom: 20px; }
.back { display: inline-block; margin-bottom: 12px; font-size: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.grid2 > .card { margin-bottom: 20px; }
.profile-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 20px; align-items: start; }
@media (max-width: 860px) { .grid2, .profile-layout { grid-template-columns: 1fr; } }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-bottom: 20px; }
.cards .card { margin: 0; }
.person { color: var(--text); display: block; transition: border-color .15s, transform .15s; }
.person:hover { text-decoration: none; border-color: var(--brand); transform: translateY(-1px); }
.avatar { width: 40px; height: 40px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.avatar.lg { width: 60px; height: 60px; font-size: 20px; border-radius: 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { font-size: 12px; background: var(--bg); border: 1px solid var(--border); padding: 2px 8px; border-radius: 999px; color: var(--text); }
.tag-sent { background: var(--ok-soft); border-color: transparent; } .tag-failed { background: var(--danger-soft); border-color: transparent; } .tag-queued { background: var(--warn-soft); border-color: transparent; }
.pill { display: inline-block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 999px; background: var(--bg); color: var(--muted); }
.pill-investor { background: #e0f2fe; color: #075985; } .pill-mentor { background: #fef3c7; color: #92400e; } .pill-startup { background: #ede9fe; color: #5b21b6; }
.pill-admin { background: #dcfce7; color: #166534; } .pill-master { background: #fee2e2; color: #991b1b; }
@media (prefers-color-scheme: dark) { .pill-investor, .pill-mentor, .pill-startup, .pill-admin, .pill-master { filter: brightness(.85) saturate(.9); } }
.facts { display: grid; grid-template-columns: 130px 1fr; gap: 10px 16px; margin: 20px 0; }
.facts dt { color: var(--muted); font-size: 13px; padding-top: 2px; } .facts dd { margin: 0; }
@media (max-width: 520px) { .facts { grid-template-columns: 1fr; gap: 2px; } .facts dd { margin-bottom: 10px; } }
.bio { white-space: pre-wrap; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; color: var(--text); box-shadow: var(--shadow); }
a.stat:hover { border-color: var(--brand); text-decoration: none; }
.num { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.lbl { color: var(--muted); font-size: 13px; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 12px; }
.num-sm { font-size: 20px; font-weight: 700; }
.metrics .lbl { font-size: 11px; text-transform: capitalize; }

/* Lists */
.list { display: grid; }
.list-item { display: flex; gap: 14px; align-items: center; padding: 12px 4px; border-top: 1px solid var(--border); color: var(--text); }
.list-item:first-child { border-top: 0; }
a.list-item:hover { background: var(--bg); text-decoration: none; }
.list-item.unread { font-weight: 600; }
.when { text-align: center; min-width: 64px; border-right: 1px solid var(--border); padding-right: 12px; }
.when .d { font-weight: 700; } .when .tm { font-size: 12px; color: var(--muted); }
.agenda { margin-top: 4px; font-style: italic; color: var(--muted); }
.empty { color: var(--muted); padding: 20px; text-align: center; }

/* Status */
.status, .health { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; text-transform: capitalize; }
.status-pending { background: var(--warn-soft); color: var(--warn); }
.status-approved { background: var(--ok-soft); color: var(--ok); }
.status-completed { background: var(--brand-soft); color: var(--brand); }
.status-declined, .status-cancelled { background: var(--danger-soft); color: var(--danger); }
.status-expired { background: var(--bg); color: var(--muted); }
.health-up { background: var(--ok-soft); color: var(--ok); } .health-down, .health-error { background: var(--danger-soft); color: var(--danger); } .health-unknown { background: var(--bg); color: var(--muted); }

/* Forms */
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 14px; color: var(--text); }
input, select, textarea { display: block; width: 100%; margin-top: 6px; font: inherit; font-weight: 400; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
input[type=checkbox], input[type=radio] { width: auto; display: inline; margin: 0 6px 0 0; }
label.check { display: flex; align-items: center; font-weight: 500; padding-top: 22px; }
.row label, .filters > * { margin-bottom: 0; }
fieldset { border: 0; padding: 0; margin: 0 0 14px; } legend { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { margin: 0; font-weight: 500; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; padding: 5px 12px; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; font-size: 13px; background: var(--surface); }
.chip input:checked + span { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.chip input:focus-visible + span { outline: 2px solid var(--brand); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px; }
.filters input, .filters select { margin: 0; width: auto; flex: 1 1 150px; }
.filters input[type=search] { flex: 2 1 220px; }
.actions { margin-top: 10px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--brand); color: var(--brand-ink); border: 1px solid var(--brand); border-radius: 8px; padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(1.07); text-decoration: none; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-danger-ghost { background: var(--surface); color: var(--danger); border-color: var(--border); }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; border: 1px solid transparent; word-break: break-word; }
.alert-success { background: var(--ok-soft); color: var(--ok); }
.alert-error { background: var(--danger-soft); color: var(--danger); }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 500; }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
.tabs a:hover { text-decoration: none; color: var(--text); }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; padding: 8px; border-bottom: 1px solid var(--border); }
.table td { padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
tr.inactive, .card.inactive { opacity: .55; }

/* Slot picker */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; margin: 10px 0 12px; }
.slot { margin: 0; }
.slot input { position: absolute; opacity: 0; pointer-events: none; }
.slot span { display: block; text-align: center; padding: 8px 4px; border: 1px solid var(--border); border-radius: 8px; font-weight: 600; font-size: 13px; cursor: pointer; }
.slot-free span:hover { border-color: var(--brand); }
.slot input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.slot input:focus-visible + span { outline: 2px solid var(--brand); }
.slot-host-busy span, .slot-past span { background: var(--bg); color: var(--muted); text-decoration: line-through; cursor: not-allowed; }
.slot-you-busy span { background: var(--danger-soft); color: var(--danger); cursor: not-allowed; }
.slot-requested span { background: var(--warn-soft); color: var(--warn); cursor: not-allowed; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin-bottom: 16px; }
.slot-key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--border); vertical-align: -1px; margin-right: 4px; }
.slot-key.host-busy { background: var(--bg); } .slot-key.you-busy { background: var(--danger-soft); } .slot-key.requested { background: var(--warn-soft); }

/* Feedback */
.feedback { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }

/* Bars (reports) */
.bar-row { display: grid; grid-template-columns: 130px 1fr 56px; gap: 10px; align-items: center; margin-bottom: 8px; font-size: 13px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { position: relative; height: 14px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.bar > span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--brand-soft); border-radius: 4px; }
.bar > .bar-ok { background: var(--brand); }
.bar-val { text-align: right; color: var(--muted); }

/* Master */
.app-cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); }
.app-card { display: flex; flex-direction: column; }
.app-card.add { align-items: center; justify-content: center; border-style: dashed; color: var(--muted); min-height: 160px; font-weight: 600; }
.app-card .metrics { grid-template-columns: repeat(4, 1fr); }

/* Auth */
.auth { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; max-width: 960px; margin: 40px auto; }
.auth-hero h1 { font-size: 38px; line-height: 1.15; }
.auth-hero p { color: var(--muted); font-size: 17px; }
.auth-card { margin: 0; }
@media (max-width: 760px) { .auth { grid-template-columns: 1fr; margin-top: 10px; gap: 10px; } .auth-hero h1 { font-size: 28px; } }
.pager { display: flex; gap: 12px; justify-content: center; align-items: center; margin: 10px 0 20px; }
