/* Teamable staff console.
   Same restrained system as the product: warm neutrals, one clay accent used
   only for primary actions, hairline borders, small radii, no gradients. */

:root {
  --ac: #b8543f;
  --ac-hover: #c8604a;
  --ac-quiet: rgba(184, 84, 63, .12);
  --ok: #4f8f62;
  --warn: #a3762c;
  --info: #4a7391;
  --bad: #a8443c;

  --bg: #101011;
  --bg-2: #16161a;
  --surface: #1a1a1e;
  --surface-2: #202024;
  --line: #32323a;
  --line-soft: #26262c;
  --text: #e8e8ea;
  --text-2: #a5a5ad;
  --text-3: #74747e;

  --r: 5px;
  --r-lg: 7px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 13.5px/1.5 var(--sans); -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--info); }

.mono { font-family: var(--mono); }
.muted { color: var(--text-3); }
.tiny { font-size: 11.5px; }

/* ── brand ─────────────────────────────────────────────────────────────── */
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.brand__mark {
  width: 22px; height: 22px; border-radius: var(--r); background: var(--ac);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 12px;
}
.brand__sub {
  font-weight: 500; font-size: 11px; color: var(--text-3);
  border: 1px solid var(--line); border-radius: 3px; padding: 1px 5px;
}

/* ── sign-in ───────────────────────────────────────────────────────────── */
.gate { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.gate__box {
  width: min(360px, 100%); background: var(--surface);
  border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 22px;
}
.gate__box .brand { margin-bottom: 10px; }
.gate__err {
  background: rgba(168, 68, 60, .1); border: 1px solid rgba(168, 68, 60, .35);
  color: #d08a83; border-radius: var(--r); padding: 8px 10px; font-size: 12px; margin-bottom: 12px;
}
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 11.5px; color: var(--text-2); margin-bottom: 4px; }
.field input, .field select {
  width: 100%; height: 30px; padding: 0 9px; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: var(--r); outline: none;
}
.field input:focus { border-color: var(--text-3); }

/* ── buttons ───────────────────────────────────────────────────────────── */
.btn {
  height: 27px; padding: 0 11px; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-size: 12.5px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--text-3); }
.btn--primary { background: var(--ac); border-color: var(--ac); color: #fff; width: 100%; height: 31px; justify-content: center; }
.btn--primary:hover { background: var(--ac-hover); border-color: var(--ac-hover); }
.btn--sm { height: 23px; padding: 0 8px; font-size: 11.5px; }
.btn--danger { color: var(--bad); }
.btn--danger:hover { border-color: var(--bad); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── shell ─────────────────────────────────────────────────────────────── */
.app { min-height: 100%; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 18px; padding: 0 14px; height: 46px;
  border-bottom: 1px solid var(--line-soft); background: var(--bg-2);
  position: sticky; top: 0; z-index: 10; flex-wrap: wrap;
}
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 7px; }
.tabs { display: flex; }
.tabs button {
  height: 45px; padding: 0 12px; background: none; border: 0;
  border-bottom: 1px solid transparent; color: var(--text-3); cursor: pointer; font-size: 12.5px;
}
.tabs button:hover { color: var(--text); }
.tabs button.is-active { color: var(--text); border-bottom-color: var(--ac); }

.view { padding: 18px 16px 60px; max-width: 1180px; width: 100%; margin: 0 auto; }

/* ── pieces ────────────────────────────────────────────────────────────── */
.grid { display: grid; gap: 10px; }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-lg); }
.card--pad { padding: 13px 15px; }
.stat b { display: block; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat span { font-size: 11.5px; color: var(--text-3); }

.sec { display: flex; align-items: baseline; gap: 10px; margin: 24px 0 10px; }
.sec h2 { margin: 0; font-size: 14px; font-weight: 600; }
.sec .spacer { flex: 1; }

table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-3); padding: 8px 10px; border-bottom: 1px solid var(--line); font-weight: 600;
}
td { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--bg-2); }

.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px;
  border-radius: 3px; background: var(--surface-2); border: 1px solid var(--line-soft);
  font-size: 11px; color: var(--text-2); white-space: nowrap;
}
.chip--public  { background: rgba(79,143,98,.1);  border-color: rgba(79,143,98,.3);  color: #6faa80; }
.chip--invite  { background: rgba(74,115,145,.1); border-color: rgba(74,115,145,.3); color: #6d96b4; }
.chip--apply   { background: rgba(163,118,44,.1); border-color: rgba(163,118,44,.3); color: #b98f43; }
.chip--private { background: var(--ac-quiet);     border-color: rgba(184,84,63,.38); color: #e29079; }
.chip--staff   { background: var(--ac-quiet);     border-color: rgba(184,84,63,.38); color: #e29079; }

.dot { width: 6px; height: 6px; border-radius: 99px; display: inline-block; }
.dot--ok { background: var(--ok); }
.dot--off { background: var(--text-3); opacity: .5; }

.toolbar { display: flex; gap: 7px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.toolbar input {
  height: 27px; padding: 0 9px; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--r); outline: none; min-width: 220px;
}

.empty { padding: 40px 16px; text-align: center; color: var(--text-3); }

.notice {
  display: flex; gap: 9px; padding: 10px 12px; border-radius: var(--r);
  background: var(--bg-2); border: 1px solid var(--line-soft); color: var(--text-2);
  font-size: 12px; margin-bottom: 14px;
}
.notice--warn { border-color: rgba(163,118,44,.35); color: #b98f43; }

.audit-row { display: flex; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--line-soft); font-size: 12.5px; align-items: baseline; }
.audit-row:last-child { border-bottom: 0; }
.audit-row .when { margin-left: auto; color: var(--text-3); font-size: 11px; white-space: nowrap; }
.audit-row .act { font-family: var(--mono); font-size: 11.5px; color: var(--text); }
.audit-row.is-staff { background: var(--ac-quiet); }

.msg-list { display: flex; flex-direction: column; }
.msg {
  display: grid; grid-template-columns: 180px 1fr auto; gap: 12px; align-items: baseline;
  padding: 9px 10px; border-bottom: 1px solid var(--line-soft); cursor: pointer;
}
.msg:last-child { border-bottom: 0; }
.msg:hover { background: var(--bg-2); }
.msg.is-unread .msg__from { font-weight: 650; color: var(--text); }
.msg__from { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg__subject { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg__subject span { color: var(--text-3); }

.toasts { position: fixed; right: 14px; bottom: 14px; display: flex; flex-direction: column; gap: 7px; z-index: 50; }
.toast {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r);
  padding: 9px 12px; font-size: 12px; min-width: 200px;
}
.toast--bad { border-color: rgba(168,68,60,.4); color: #d08a83; }

@media (max-width: 860px) {
  .grid--4, .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .msg { grid-template-columns: 1fr; gap: 3px; }
  .topbar { height: auto; padding: 8px 12px; }
  .tabs button { height: 32px; }
}
