/* Thadwell sign-in, account and console screens (slice 1). Built on the
   dashboard's Frutiger Aero tokens in style.css (load that first), so every
   screen shares one look and both themes (dark default). Class names follow
   Peeltag's ui.js, whose markup the console reuses. */

.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
a { color: var(--accent); }
code { font: 12px var(--mono); }

/* ================= buttons: aqua gel, glass, amber ================= */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 999px;
  padding: 9px 18px; font-weight: 600; color: #fff; border: 1px solid var(--aqua-deep);
  text-shadow: 0 -1px 0 rgba(0, 60, 110, .45);
  background: linear-gradient(180deg, #8fe3ff 0%, #3dbdf2 48%, #1497d9 52%, #36b4ee 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85), inset 0 -2px 6px rgba(255,255,255,.35), 0 3px 8px rgba(10, 110, 180, .35); }
.btn:hover:not(:disabled) { filter: brightness(1.08) saturate(1.1); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:focus-visible, .link:focus-visible, .nav-item:focus-visible, .user-chip:focus-visible, .menu button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.secondary { color: var(--ink); text-shadow: none; border-color: var(--line); background: var(--tile);
  box-shadow: var(--inset-hi), var(--small-shadow); }
.btn.amber { color: #5a3a00; text-shadow: 0 1px 0 rgba(255,255,255,.5); border-color: #d99b1c;
  background: linear-gradient(180deg, #fff1c2 0%, #ffd66b 48%, #f5b827 52%, #ffd25e 100%); }
.btn.small { padding: 5px 12px; font-size: 12.5px; }
.btn.full { width: 100%; }
.link { background: none; border: none; padding: 0; color: var(--accent); font: inherit; text-align: left; cursor: pointer; }
.link:hover { text-decoration: underline; }
.link.back { margin-bottom: 8px; font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }

/* ================= fields ================= */
label { display: block; font-size: 13px; color: var(--ink-2); margin: 12px 0 4px; }
.field, .console-filters input { width: 100%; border-radius: 12px; padding: 9px 12px; font: inherit; color: var(--ink);
  border: 1px solid var(--line); background: var(--input-bg); box-shadow: inset 0 2px 4px rgba(0, 40, 80, .18); outline: none; }
.field:focus, .console-filters input:focus { border-color: var(--aqua);
  box-shadow: inset 0 2px 4px rgba(0, 40, 80, .18), 0 0 0 3px rgba(30,167,228,.3); }
.field.code { font: 600 22px var(--mono); letter-spacing: .3em; text-align: center; }
select.field { appearance: auto; }
.toggle { display: flex; align-items: center; gap: 8px; margin: 12px 0; color: var(--ink); }
.toggle input { width: 18px; height: 18px; accent-color: var(--aqua); }
.hint { color: var(--ink-3); font-size: 12.5px; margin: 6px 0; }
.error-text { color: var(--act); margin: 10px 0 0; }
.ok-text { color: var(--good); margin: 10px 0 0; }
.notice { border-radius: 12px; padding: 10px 12px; margin: 8px 0; color: var(--ink); background: var(--tile-2);
  border: 1px solid var(--tile-edge); border-left: 4px solid var(--aqua); }
.notice.warn { border-left-color: #f5b827; }

/* ================= the person in the top bar ================= */
.who { position: relative; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 4px 12px 4px 4px;
  color: var(--ink); border: 1px solid var(--tile-edge); background: var(--tile); box-shadow: var(--small-shadow); }
.user-chip .avatar { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px;
  font-weight: 700; color: #fff; text-shadow: 0 -1px 0 rgba(0,60,110,.45);
  background: radial-gradient(circle at 38% 30%, #c8f4ff 0%, #25aee8 50%, #0a5a98 100%); }
.user-chip .role { color: var(--ink-3); font-size: 12px; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; z-index: 20; padding: 6px; border-radius: 14px;
  background: var(--glass-strong); border: 1px solid var(--glass-edge); box-shadow: var(--shadow);
  backdrop-filter: blur(16px) saturate(1.5); -webkit-backdrop-filter: blur(16px) saturate(1.5); }
.menu .menu-head { padding: 6px 10px 8px; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; }
.menu .menu-head b { display: block; }
.menu .menu-head span { color: var(--ink-3); font-size: 12px; }
.menu button, .menu a { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 10px; border: none;
  background: none; color: var(--ink); text-decoration: none; }
.menu button:hover, .menu a:hover { background: var(--sel); }

/* A staff member looking at the Demo, or an account with no data yet */
.workbar { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; padding: 6px 16px;
  font-size: 13px; color: var(--ink); background: var(--tile-2); border-bottom: 1px solid var(--bar-edge); }
.empty-state { max-width: 560px; margin: 40px auto; padding: 26px 28px; border-radius: var(--r); text-align: center; }
.empty-state h2 { margin: 0 0 8px; font-weight: 400; color: var(--accent); }

/* ================= sign-in, invite, reset, two-step ================= */
.auth-page { display: flex; flex-direction: column; min-height: 100%; }
.auth-top { display: flex; align-items: center; justify-content: space-between; padding: 10px 22px; background: var(--bar-top);
  border-bottom: 1px solid var(--bar-edge); box-shadow: 0 4px 18px rgba(0, 40, 80, .22); }
.auth-wrap { flex: 1; display: grid; place-items: center; padding: 28px 16px 60px; }
.auth-card { width: 100%; max-width: 430px; border-radius: 22px; padding: 26px 28px 24px; position: relative; overflow: hidden; }
.auth-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 46%; background: var(--sheen); pointer-events: none; }
.auth-card > * { position: relative; }
.auth-card h1 { margin: 0 0 4px; font-size: 22px; font-weight: 300; color: var(--accent); }
.auth-card .sub { color: var(--ink-2); margin: 0 0 6px; }
.auth-card form .btn.full { margin-top: 18px; }
.auth-card .foot { margin-top: 16px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.steps-list { padding-left: 20px; color: var(--ink-2); margin: 8px 0; }
.steps-list li { margin: 4px 0; }
.qr { display: block; width: 190px; height: 190px; margin: 12px auto; padding: 10px; border-radius: 14px; background: #fff;
  box-shadow: var(--small-shadow); }
.secret { font: 600 14px var(--mono); letter-spacing: .06em; word-break: break-all; }
.codes { columns: 2; list-style: none; padding: 12px 16px; margin: 10px 0; border-radius: 12px; font: 600 14px var(--mono);
  background: var(--input-bg); border: 1px solid var(--line); }
.codes li { padding: 3px 0; }

/* ================= console ================= */
.console-page { display: flex; flex-direction: column; height: 100%; }
.console-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 20px; padding: 20px 22px; }
.console-body.single { grid-template-columns: minmax(0, 1100px); justify-content: center; }
.console-nav { display: flex; flex-direction: column; gap: 6px; overflow: auto; }
.nav-item { display: flex; align-items: center; gap: 10px; border-radius: 12px; padding: 9px 12px; color: var(--ink-2);
  text-align: left; border: 1px solid var(--tile-edge); background: var(--glass); box-shadow: var(--small-shadow);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.nav-item:hover { color: var(--ink); border-color: var(--aqua); }
.nav-item.active { color: var(--ink); background: var(--sel); border-color: var(--aqua);
  box-shadow: 0 0 0 3px rgba(30,167,228,.22), var(--small-shadow); }
.nav-item.demo { margin-top: 10px; }
.ti { width: 18px; height: 18px; flex: none; }
.console-main { min-height: 0; overflow: auto; padding: 0 6px 24px 2px; outline: none; }
.console-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.console-head h2 { margin: 0; font-size: 22px; font-weight: 300; color: var(--accent); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 12px; }
.panel { border-radius: var(--r); background: var(--glass); border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow), var(--inset-hi); backdrop-filter: blur(16px) saturate(1.5); -webkit-backdrop-filter: blur(16px) saturate(1.5); }
.tile { padding: 14px 16px; }
.tile .num { font-size: 26px; font-weight: 300; color: var(--accent); }
.tile .lbl { color: var(--ink-2); font-size: 12.5px; }
.console-section { padding: 14px 16px; margin-bottom: 14px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.section-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 14px; }
.console-filters { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; max-width: 560px; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { padding: 4px 0; border-bottom: 1px solid var(--line-soft); }
.plain li:last-child { border-bottom: none; }
.pre { white-space: pre-wrap; margin: 0; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th { text-align: left; color: var(--ink-2); font-weight: 600; padding: 7px 8px; border-bottom: 1px solid var(--line); }
table.data td { padding: 7px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.data tbody tr:nth-child(odd) { background: var(--stripe); }
table.data tr.child td:first-child { padding-left: 22px; }
.indent { color: var(--ink-3); }
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap;
  border: 1px solid transparent; box-shadow: var(--inset-hi); }
.tag.ok { background: var(--h-healthy); color: var(--t-healthy); border-color: var(--b-healthy); }
.tag.warn { background: var(--h-watch); color: var(--t-watch); border-color: var(--b-watch); }
.tag.off { background: var(--h-act); color: var(--t-act); border-color: var(--b-act); }
.tag.info { background: var(--chip-bg); color: var(--ink-2); border-color: var(--line); }
.tag.demo { color: #7a5200; border-color: #e9b84a; background: linear-gradient(180deg, #fff6d6 0%, #ffe39a 50%, #ffd36a 51%, #ffe08e 100%); }
.link-text { font: 13px var(--mono); }

/* ================= dialogs ================= */
dialog.app-dialog { width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border-radius: 20px; color: var(--ink);
  background: var(--glass-strong); border: 1px solid var(--glass-edge); box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5); }
dialog.app-dialog::backdrop { background: rgba(2, 16, 30, .45); backdrop-filter: blur(2px); }
dialog.app-dialog form { display: flex; flex-direction: column; max-height: calc(100vh - 48px); }
dialog.app-dialog .dlg-title { padding: 14px 20px; font-size: 16px; color: var(--accent); background: var(--bar-top);
  border-bottom: 1px solid var(--bar-edge); }
dialog.app-dialog .dlg-body { padding: 6px 20px 8px; overflow: auto; }
dialog.app-dialog .dlg-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; }

/* ================= small screens ================= */
@media (max-width: 760px) {
  .console-body { grid-template-columns: 1fr; padding: 12px 16px; gap: 12px; }
  .console-nav { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .nav-item { flex: none; }
  .nav-item span { white-space: nowrap; }
  .auth-top, .console-page .topbar { padding: 8px 16px; }
  .auth-card { padding: 22px 18px; }
  table.data thead { display: none; }
  table.data tr { display: block; padding: 6px 0; border-bottom: 1px solid var(--line); }
  table.data td { display: flex; justify-content: space-between; gap: 12px; border: none; padding: 3px 8px; }
  table.data td::before { content: attr(data-label); color: var(--ink-3); flex: none; }
  table.data td[data-label=""]::before { content: none; }
  .facts { grid-template-columns: 1fr; }
  .facts dt { margin-top: 6px; }
  .codes { columns: 1; }
  .menu { right: -8px; }
}
