:root {
  --cream: oklch(97.5% 0.012 85);
  --surface: oklch(99.4% 0.006 85);
  --ink-1: oklch(28% 0.024 62);
  --ink-2: oklch(42% 0.02 62);
  --ink-3: oklch(52% 0.018 62);
  --line: oklch(88% 0.014 75);
  --accent: oklch(52% 0.128 32);
  --accent-soft: oklch(93% 0.035 40);
  --danger: oklch(50% 0.19 27);
  --danger-soft: oklch(95% 0.03 27);
  --ok: oklch(48% 0.1 150);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100dvh; background: var(--cream); color: var(--ink-1);
  font: 16px/1.5 'Satoshi', ui-sans-serif, system-ui, sans-serif; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
h1, h2 { font-family: 'Gambetta', ui-serif, Georgia, serif; font-weight: 500; letter-spacing: -0.01em; }
.muted { color: var(--ink-3); }
.mark { color: var(--accent); display: inline-flex; }

/* ---- centered card pages (login, denied) ---- */
.gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.card {
  width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 32px 28px 26px; text-align: center;
  box-shadow: 0 1px 2px oklch(28% 0.024 62 / 0.05), 0 12px 32px oklch(28% 0.024 62 / 0.06);
}
.card h1 { font-size: 30px; margin: 10px 0 6px; }
.card p { margin: 0 0 18px; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 600 15px 'Satoshi', system-ui, sans-serif; border-radius: 10px; padding: 11px 16px; cursor: pointer;
  border: 1px solid var(--accent); background: var(--accent); color: #fff; text-decoration: none;
}
.btn:hover { filter: brightness(1.05); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: var(--surface); color: var(--ink-1); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink-3); }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.google { background: #fff; color: #1f1f1f; border-color: #dadce0; }
.google:hover { background: #f8f9fa; filter: none; }

/* ---- alerts: errors are red and prominent ---- */
.alert { border-radius: 10px; padding: 10px 12px; font-size: 14px; text-align: left; margin: 0 0 16px; }
.alert.error { background: var(--danger-soft); color: var(--danger); border: 1px solid oklch(80% 0.08 27); font-weight: 600; }
.alert.info { background: var(--accent-soft); color: var(--ink-1); }
[hidden] { display: none !important; }

/* ---- app shell ---- */
.top { border-bottom: 1px solid var(--line); background: var(--surface); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.bar { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink-1);
  font: 500 21px 'Gambetta', Georgia, serif; }
.brand .mark svg { width: 28px; height: 28px; }
.spacer { flex: 1; }
.who { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-weight: 700; font-size: 13px; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.who .name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main.wrap { padding-top: 32px; padding-bottom: 64px; }
.head h1 { font-size: 34px; margin: 0 0 4px; }
.head p { margin: 0 0 24px; }

/* ---- tiles ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.tile {
  display: flex; flex-direction: column; gap: 10px; padding: 22px; min-height: 150px; text-decoration: none; color: var(--ink-1);
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.tile:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 10px 24px oklch(28% 0.024 62 / 0.07); }
.tile .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.tile .ic svg { width: 26px; height: 26px; }
.tile h2 { font-size: 22px; margin: 0; }
.tile p { margin: 0; font-size: 14px; color: var(--ink-3); }
.empty { padding: 28px; border: 1.5px dashed var(--line); border-radius: 16px; color: var(--ink-3); text-align: center; }

/* ---- access page ---- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; margin-bottom: 24px; }
.panel h2 { font-size: 22px; margin: 0 0 4px; }
.panel > p { margin: 0 0 16px; font-size: 14px; }
.form { display: grid; grid-template-columns: 2fr 1.4fr 1fr auto; gap: 10px; align-items: end; }
.form.apps { grid-template-columns: 1fr 1.2fr 2fr 1.6fr auto; }
label.f { display: block; font-size: 12px; color: var(--ink-3); letter-spacing: .04em; text-transform: uppercase; }
input[type=text], input[type=email], input[type=url], select {
  width: 100%; margin-top: 4px; font: inherit; font-size: 15px; color: var(--ink-1); background: #fff;
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; }
.form .checks { grid-column: 1 / -1; margin-top: 2px; }
.brand, .btn { white-space: nowrap; }
.checks label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr.off td { color: var(--ink-3); }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person .em { font-size: 13px; color: var(--ink-3); overflow-wrap: anywhere; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.pill.member { background: oklch(94% 0.01 75); color: var(--ink-2); }
.pill.off { background: oklch(94% 0.01 75); color: var(--ink-3); }
.rowacts { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.tablewrap { overflow-x: auto; }

/* ---- in-app confirmation ---- */
.modal { position: fixed; inset: 0; background: oklch(28% 0.024 62 / 0.35); display: grid; place-items: center; padding: 20px; z-index: 10; }
.modal .box { background: var(--surface); border-radius: 16px; padding: 24px; max-width: 420px; width: 100%; box-shadow: 0 20px 50px oklch(28% 0.024 62 / 0.25); }
.modal h2 { font-size: 22px; margin: 0 0 8px; }
.modal p { margin: 0 0 18px; color: var(--ink-2); }
.modal .acts { display: flex; gap: 8px; justify-content: flex-end; }

@media (max-width: 760px) {
  .form, .form.apps { grid-template-columns: 1fr; }
  .form .btn[type=submit] { order: 10; }
  .wide { display: none; }
  .bar { gap: 10px; }
  .brand { font-size: 19px; }
  td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); margin-bottom: 2px; }
  .who .name { display: none; }
  thead { display: none; }
  table, tbody, tr, td { display: block; width: 100%; }
  tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  td { border: 0; padding: 6px 4px; }
  .rowacts { justify-content: flex-start; }
}
