/* FULLMATİK team dashboard. Mobile first; black + magenta like the course site, colour only for status. */

:root {
  --bg: #08060a;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.18);
  --text: #f6f4f8;
  --muted: #a8a0ae;
  --faint: #8a8391;
  --brand: #ff00ff;
  --brand-soft: #ff7bff;
  --brand-wash: rgba(255, 0, 255, 0.12);
  --ok: #3ddc97;
  --warn: #ffbf47;
  --bad: #ff6b81;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'DM Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --display: 'Unbounded', 'Inter', system-ui, sans-serif;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(70% 38% at 50% -8%, rgba(255, 0, 255, 0.13), transparent 70%),
    radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1.3px);
  background-size: auto, 22px 22px;
  background-attachment: fixed;
  color: var(--text);
  font: 400 15px/1.5 var(--font);
  margin: 0;
  min-height: 100vh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
[hidden] { display: none !important; }

.mono { font-family: var(--mono); font-size: 0.8125rem; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }

/* ---------- sign-in ---------- */

.gate { align-items: center; display: grid; min-height: 100vh; padding: 24px 20px; }
.gate-card { margin: 0 auto; max-width: 380px; width: 100%; }
.wordmark { font: 600 0.8125rem/1 var(--display); letter-spacing: 0.14em; white-space: nowrap; }
.wm-sub { color: var(--faint); display: none; }
.wordmark span { color: var(--brand-soft); }
.gate h1 { font: 600 1.75rem/1.15 var(--font); letter-spacing: -0.03em; margin: 18px 0 8px; }
.gate p { color: var(--muted); margin: 0 0 22px; }

.field { display: grid; gap: 8px; }
.field span { color: var(--muted); font-size: 0.8125rem; font-weight: 500; }
.field input {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  font-size: 1rem;
  height: 52px;
  padding: 0 16px;
  width: 100%;
}
.field input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 4px var(--brand-wash); }

.btn {
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  display: inline-flex;
  font-size: 0.875rem;
  font-weight: 600;
  gap: 8px;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
.btn:hover:enabled { background: rgba(255, 255, 255, 0.11); }
.btn:disabled { cursor: progress; opacity: 0.55; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover:enabled { background: #ff33ff; }
.btn-danger:hover:enabled { background: rgba(255, 107, 129, 0.14); border-color: var(--bad); color: var(--bad); }
.btn-danger { color: #ffb4c0; }
.btn-danger-solid { background: var(--bad); border-color: var(--bad); color: #20060b; }
.btn-danger-solid:hover:enabled { background: #ff8a9b; }
.btn-block { width: 100%; margin-top: 14px; min-height: 52px; font-size: 1rem; }

.form-error { color: var(--bad); font-size: 0.875rem; margin: 12px 0 0; min-height: 1.3em; }

.icon { flex: none; height: 1.1em; width: 1.1em; }
.iconbtn {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: inline-grid;
  height: 44px;
  place-items: center;
  width: 44px;
}
.iconbtn:hover { background: var(--surface-2); }
.iconbtn .icon { height: 18px; width: 18px; }
.iconbtn.is-spinning .icon { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- shell ---------- */

.shell { margin: 0 auto; max-width: 1180px; padding: 0 16px 56px; }

.topbar {
  align-items: center;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(8, 6, 10, 0.78);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin: 0 -16px;
  padding: 10px 16px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-right { align-items: center; display: flex; gap: 10px; }
.live { align-items: center; color: var(--muted); display: inline-flex; font-size: 0.75rem; gap: 7px; white-space: nowrap; }
.live-time { display: none; margin-left: -4px; }
.live i { background: var(--ok); border-radius: 50%; height: 7px; width: 7px; box-shadow: 0 0 0 3px rgba(61, 220, 151, 0.18); }
.live.is-stale i { background: var(--warn); box-shadow: 0 0 0 3px rgba(255, 191, 71, 0.18); }

.banner { background: rgba(255, 191, 71, 0.1); border: 1px solid rgba(255, 191, 71, 0.35); border-radius: 12px; color: #ffd98a; font-size: 0.875rem; margin-top: 14px; padding: 11px 14px; }

/* ---------- tiles ---------- */

.tiles { display: grid; gap: 8px; grid-template-columns: repeat(2, 1fr); margin: 14px 0 4px; }
.tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 2px;
  padding: 10px 13px 9px;
  text-align: left;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.tile:hover { background: var(--surface-2); border-color: var(--line-2); }
.tile[aria-pressed='true'] { border-color: var(--brand); background: var(--brand-wash); }
.tile-label { color: var(--muted); font-size: 0.6875rem; font-weight: 500; }
.tile-value { font: 600 1.25rem/1.15 var(--display); letter-spacing: -0.02em; }
.tile.is-alert { border-color: rgba(255, 191, 71, 0.5); }
.tile.is-alert .tile-value { color: var(--warn); }
.tile.is-bad .tile-value { color: var(--bad); }
.tile.is-live .tile-value { color: var(--ok); }

/* ---------- tabs, chips, search ---------- */

.tabs { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; display: flex; gap: 4px; margin: 18px 0 14px; padding: 4px; }
.tab { background: none; border: 0; border-radius: 10px; color: var(--muted); flex: 1; font-size: 0.875rem; font-weight: 600; min-height: 40px; padding: 0 10px; }
.tab[aria-selected='true'] { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text); }

.toolbar { display: grid; gap: 10px; margin-bottom: 14px; }
.search { position: relative; }
.search .icon { color: var(--faint); height: 17px; left: 14px; pointer-events: none; position: absolute; top: 14px; width: 17px; }
.search input { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; height: 46px; padding: 0 14px 0 40px; width: 100%; }
.search input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 4px var(--brand-wash); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: none; border: 1px solid var(--line-2); border-radius: 999px; color: var(--muted); font-size: 0.8125rem; font-weight: 500; min-height: 36px; padding: 0 13px; }
.chip b { color: var(--text); font-weight: 600; margin-left: 6px; }
.chip[aria-pressed='true'] { background: var(--text); border-color: var(--text); color: #0b0810; }
.chip[aria-pressed='true'] b { color: #0b0810; }

/* ---------- member cards ---------- */

.cards { display: grid; gap: 12px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: grid; gap: 14px; padding: 16px; }
.card.is-waiting { border-color: rgba(255, 191, 71, 0.4); }

.card-head { align-items: flex-start; display: flex; gap: 10px; justify-content: space-between; }
.name { font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; overflow-wrap: anywhere; }
.sub { color: var(--muted); font-size: 0.8125rem; margin-top: 2px; }

.badge { align-items: center; border: 1px solid var(--line-2); border-radius: 999px; display: inline-flex; flex: none; font-size: 0.75rem; font-weight: 600; gap: 6px; padding: 3px 10px; white-space: nowrap; }
.badge i { background: currentColor; border-radius: 50%; height: 6px; width: 6px; }
.badge-ok { background: rgba(61, 220, 151, 0.1); border-color: rgba(61, 220, 151, 0.4); color: var(--ok); }
.badge-wait { background: rgba(255, 191, 71, 0.1); border-color: rgba(255, 191, 71, 0.4); color: var(--warn); }
.badge-bad { background: rgba(255, 107, 129, 0.1); border-color: rgba(255, 107, 129, 0.4); color: var(--bad); }
.badge-mute { color: var(--muted); }

.contact { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  display: inline-flex;
  font-size: 0.8125rem;
  gap: 7px;
  min-height: 38px;
  padding: 0 11px;
  text-decoration: none;
}
.pill:hover { background: var(--surface-2); border-color: var(--line-2); }
.pill .icon { color: var(--muted); }

/* the journey rail: registered -> approved -> first sign-in */
.rail { display: grid; grid-template-columns: repeat(3, 1fr); position: relative; }
.rail::before { background: var(--line-2); content: ''; height: 1px; left: 16.6%; position: absolute; right: 16.6%; top: 6px; }
.step { display: grid; gap: 3px; justify-items: center; position: relative; text-align: center; }
.step i { background: var(--bg); border: 2px solid var(--line-2); border-radius: 50%; height: 13px; width: 13px; }
.step.is-done i { background: var(--brand); border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-wash); }
.step.is-good i { background: var(--ok); border-color: var(--ok); box-shadow: 0 0 0 4px rgba(61, 220, 151, 0.14); }
.step.is-late i { border-color: var(--warn); box-shadow: 0 0 0 4px rgba(255, 191, 71, 0.14); }
.step-label { color: var(--muted); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.06em; margin-top: 4px; text-transform: uppercase; }
.step-time { font-family: var(--mono); font-size: 0.75rem; }
.step.is-late .step-time { color: var(--warn); }
.step.is-good .step-time { color: var(--ok); }
.step:not(.is-done):not(.is-good):not(.is-late) .step-time { color: var(--faint); }

.verdict { font-size: 0.8125rem; margin: -4px 0 0; text-align: center; }
.sheet .verdict { margin-top: 12px; }
.verdict.is-late { color: var(--warn); }
.verdict.is-good { color: var(--ok); }
.verdict.is-wait { color: var(--muted); }

.where { align-items: center; display: flex; flex-wrap: wrap; font-size: 0.8125rem; gap: 4px 10px; }
.where .icon { color: var(--brand-soft); }
.where-place { align-items: center; display: inline-flex; font-weight: 500; gap: 6px; }
.link { color: var(--brand-soft); text-decoration: underline; text-decoration-color: rgba(255, 123, 255, 0.4); text-underline-offset: 3px; }
.link:hover { text-decoration-color: var(--brand-soft); }

.stats { color: var(--muted); display: flex; flex-wrap: wrap; font-size: 0.8125rem; gap: 4px 14px; }
.stats b { color: var(--text); font-weight: 600; }
.stats .is-bad { color: var(--bad); }
.dot { background: var(--ok); border-radius: 50%; display: inline-block; height: 7px; margin-right: 6px; width: 7px; }

.actions { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.actions .btn-wide, .actions > :only-child { grid-column: 1 / -1; }

/* ---------- sign-in attempts ---------- */

.list { display: grid; gap: 10px; }
.row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: grid; gap: 9px; padding: 13px 15px; }
.row-head { align-items: flex-start; display: flex; gap: 10px; justify-content: space-between; }
.row-who { font-weight: 600; overflow-wrap: anywhere; }
.row-time { color: var(--muted); flex: none; font-size: 0.75rem; text-align: right; }
.row-meta { color: var(--muted); display: flex; flex-wrap: wrap; font-size: 0.8125rem; gap: 4px 12px; }

.empty { border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--muted); padding: 26px 20px; text-align: center; }
.empty strong { color: var(--text); display: block; font-size: 1rem; margin-bottom: 6px; }
.more { margin: 14px auto 0; }

/* ---------- lessons ---------- */

.lesson-row { display: grid; gap: 10px; }
.bar { background: var(--surface-2); border-radius: 99px; height: 6px; overflow: hidden; }
.bar i { background: var(--brand); display: block; height: 100%; }
.nums { display: grid; gap: 8px; grid-template-columns: repeat(3, 1fr); }
.num { display: grid; gap: 2px; }
.num b { font: 600 1.125rem var(--display); }
.num span { color: var(--muted); font-size: 0.75rem; }

/* ---------- detail sheet ---------- */

.scrim { background: rgba(0, 0, 0, 0.6); inset: 0; position: fixed; z-index: 40; }
.sheet {
  background: #100c13;
  border: 1px solid var(--line-2);
  border-radius: 20px 20px 0 0;
  bottom: 0;
  display: grid;
  gap: 18px;
  left: 0;
  max-height: 92vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 18px calc(24px + env(safe-area-inset-bottom));
  position: fixed;
  right: 0;
  z-index: 50;
}
.sheet-head { align-items: flex-start; display: flex; gap: 12px; justify-content: space-between; }
.sheet h2 { font: 600 1.25rem/1.2 var(--font); letter-spacing: -0.02em; margin: 0; overflow-wrap: anywhere; }
.sheet h3 { color: var(--muted); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; margin: 0 0 10px; text-transform: uppercase; }
.edit-form { display: grid; gap: 12px; }
.edit-form .field input { height: 46px; font-size: 0.9375rem; }
.sheet section > .actions { margin-top: 12px; }
.codeline { align-items: center; display: flex; flex-wrap: wrap; gap: 10px; }
.code-inline { background: var(--bg); border: 1px solid var(--line-2); border-radius: 12px; font: 600 1.5rem/1 var(--mono); letter-spacing: 0.28em; padding: 12px 8px 12px 18px; }
.danger-zone { border-top: 1px solid var(--line); padding-top: 18px; }
.danger-zone h3 { color: var(--bad); }
.facts { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.fact { background: #100c13; display: grid; gap: 2px 12px; grid-template-columns: 7.5rem 1fr; padding: 10px 13px; }
.fact dt { color: var(--muted); font-size: 0.8125rem; }
.fact dd { margin: 0; overflow-wrap: anywhere; }
.fact dd .sub { margin-top: 3px; }

.timeline { display: grid; gap: 0; list-style: none; margin: 0; padding: 0; }
.event { border-left: 2px solid var(--line-2); display: grid; gap: 2px; margin-left: 5px; padding: 0 0 14px 16px; position: relative; }
.event::before { background: var(--bg); border: 2px solid var(--line-2); border-radius: 50%; content: ''; height: 10px; left: -6px; position: absolute; top: 4px; width: 10px; }
.event.is-ok::before { background: var(--ok); border-color: var(--ok); }
.event.is-bad::before { background: var(--bad); border-color: var(--bad); }
.event.is-brand::before { background: var(--brand); border-color: var(--brand); }
.event:last-child { padding-bottom: 0; }
.event-title { font-size: 0.875rem; font-weight: 500; }
.event-meta { color: var(--muted); font-size: 0.75rem; }

/* ---------- one-time code dialog, toast, footer ---------- */

.dialog { background: #14101a; border: 1px solid var(--line-2); border-radius: 18px; left: 50%; max-width: 360px; padding: 22px; position: fixed; top: 50%; transform: translate(-50%, -50%); width: calc(100% - 32px); z-index: 70; }
.dialog h2 { font-size: 1.0625rem; margin: 0 0 6px; }
.dialog p { color: var(--muted); font-size: 0.875rem; margin: 0 0 16px; }
.code { background: var(--bg); border: 1px solid var(--line-2); border-radius: 12px; font: 600 2rem/1 var(--mono); letter-spacing: 0.3em; margin-bottom: 16px; padding: 16px 0 16px 0.3em; text-align: center; }
.dialog-actions { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }

.toast { background: var(--text); border-radius: 12px; bottom: calc(20px + env(safe-area-inset-bottom)); color: #0b0810; font-size: 0.875rem; font-weight: 600; left: 50%; max-width: calc(100% - 32px); padding: 11px 16px; position: fixed; transform: translateX(-50%); z-index: 80; }

.foot { color: var(--faint); font-size: 0.75rem; line-height: 1.6; margin-top: 30px; }
.foot a { color: var(--muted); }

/* ---------- larger screens ---------- */

@media (min-width: 520px) {
  .wm-sub, .live-time { display: inline; }
}

@media (min-width: 700px) {
  .shell { padding: 0 28px 72px; }
  .topbar { margin: 0 -28px; padding: 12px 28px; }
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .toolbar { align-items: center; grid-template-columns: minmax(220px, 320px) 1fr; }
  .cards { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1000px) {
  .tiles { grid-template-columns: repeat(6, 1fr); }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .list { grid-template-columns: repeat(2, 1fr); }
  .sheet { border-radius: 20px 0 0 20px; bottom: 0; left: auto; max-height: none; top: 0; width: 480px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
