/* casttit.com/admin (founder, 10 Nov 2026: "the admin panel should have its own tabs, like a standard admin panel"):
   its own screen, no website menu or footer. A dark sidebar (sections, who's signed in, view site, sign out), a top
   bar (section, test or live, refresh) and the content. Phones: the sidebar slides in from a menu button. */
body.adm-page { background: #F3F2EE; }
.adm { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; font-size: 15px; line-height: 1.5; }
.adm [hidden] { display: none !important; }
.adm section { padding-block: 0; border-top: 0; }

/* the sidebar */
.adm-side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px; padding: 20px 14px 16px;
  overflow-y: auto; background: var(--ink); color: #D7D9DE; }
.adm-side-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 6px 0; }
.adm-brand { display: inline-flex; align-items: center; gap: 9px; color: #FFFFFF; text-decoration: none; }
.adm-brand span { font: 700 21px var(--display); letter-spacing: -.5px; }
.adm-brand b { color: var(--signal); font-weight: 700; }
.adm-brand em { font-style: normal; padding: 4px 7px; border-radius: 6px; background: var(--signal); color: #14080A;
  font: 800 10.5px/1 var(--body); letter-spacing: 1.4px; text-transform: uppercase; }
.adm-close, .adm-menu { display: none; width: 40px; height: 40px; place-items: center; border: 0; border-radius: 10px;
  cursor: pointer; background: none; }
.adm-close svg, .adm-menu svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.adm-close { color: #B9BCC4; }
.adm-nav { display: grid; gap: 3px; }
.adm-nav button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 11px;
  background: none; cursor: pointer; text-align: left; font: 700 14.5px var(--body); color: #B9BCC4; transition: background .15s, color .15s; }
.adm-nav button svg { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round; }
.adm-nav button:hover { background: rgba(255, 255, 255, .06); color: #FFFFFF; }
.adm-nav button[aria-selected="true"] { background: rgba(255, 91, 46, .16); color: #FFFFFF; box-shadow: inset 3px 0 0 var(--signal); }
.adm-nav button[aria-selected="true"] svg { stroke: var(--signal); }
.adm-nav button:focus-visible, .adm-side-link:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.adm-side-foot { margin-top: auto; display: grid; gap: 2px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .1); }
.adm-me { display: flex; align-items: center; gap: 10px; padding: 4px 8px 10px; }
.adm-avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--signal);
  color: #14080A; font: 800 15px/1 var(--display); }
.adm-me b { display: block; font-size: 13.5px; color: #FFFFFF; overflow-wrap: anywhere; }
.adm-me span span { display: block; font-size: 12.5px; color: #8E929B; }
.adm-side-link { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; border-radius: 10px;
  background: none; cursor: pointer; text-align: left; text-decoration: none; font: 700 13.5px var(--body); color: #B9BCC4; }
.adm-side-link svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round;
  stroke-linejoin: round; }
.adm-side-link:hover { background: rgba(255, 255, 255, .06); color: #FFFFFF; }
.adm-scrim { display: none; }

/* the top bar and the content */
.adm-main { min-width: 0; display: flex; flex-direction: column; }
.adm-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 16px clamp(16px, 3vw, 32px);
  background: rgba(243, 242, 238, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.adm-menu { color: var(--text); border: 1px solid var(--line-2); background: var(--white); }
.adm-title { flex: 1; min-width: 0; }
.adm-title h1 { margin: 0; font: 800 22px/1.2 var(--display); letter-spacing: -.02em; color: var(--text); }
.adm-title p { margin: 2px 0 0; font-size: 13.5px; color: var(--subtle); }
.adm-env { padding: 6px 11px; border-radius: 999px; font: 800 12px/1 var(--body); letter-spacing: .3px; white-space: nowrap; }
.adm-env.test { background: #FFF1EB; color: #8A2A0E; border: 1px solid #FFC9B5; }
.adm-env.live { background: rgba(59, 209, 138, .16); color: #14683D; border: 1px solid rgba(59, 209, 138, .35); }
.adm-refresh { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--white); cursor: pointer; font: 700 13.5px var(--body); color: var(--text); }
.adm-refresh:hover { border-color: var(--text); }
.adm-refresh svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.adm-content { padding: 22px clamp(16px, 3vw, 32px) 64px; }
.adm .adm-h2 { margin: 24px 0 12px; font: 800 17px/1.3 var(--display); letter-spacing: -.01em; color: var(--text); }
.adm section > .adm-h2:first-child { margin-top: 0; }
.adm .adm-note { margin: 0 0 14px; max-width: 82ch; font-size: 14px; line-height: 1.55; color: var(--subtle); }
.adm .muted { color: var(--subtle); font-weight: 500; }

/* signed out, or not on the team */
.adm-gate { min-height: 62vh; display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center; }
.adm-gate p { margin: 0; color: var(--muted); }
.adm-gate-card { max-width: 430px; padding: 34px 30px; border-radius: 22px; background: var(--white); border: 1px solid var(--line);
  box-shadow: 0 30px 60px -40px rgba(14, 16, 20, .5); }
.adm-gate-card h2 { margin: 0 0 8px; font: 800 24px/1.2 var(--display); color: var(--text); }
.adm-gate-card p { margin: 0 0 18px; line-height: 1.55; }
.adm-gate-card .btn { height: 46px; text-decoration: none; }
.adm-gate-card a.btn-primary { color: #14080A; }
.adm-spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--signal);
  animation: adm-spin .8s linear infinite; }
@keyframes adm-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .adm-spinner { animation: none; } }

/* tables */
.adm .table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
.adm table { width: 100%; border-collapse: collapse; font-size: 14px; }
.adm th, .adm td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
.adm td { color: var(--muted); }
.adm td:first-child { color: var(--text); }
.adm th { position: sticky; top: 0; background: #FAF9F6; color: var(--subtle); font: 800 11.5px var(--body); letter-spacing: 1px;
  text-transform: uppercase; }
.adm tbody tr:last-child td { border-bottom: 0; }
.adm tbody tr:hover td { background: #FBFAF8; }
.adm td.num { font-variant-numeric: tabular-nums; }
.adm td.empty { padding: 20px 14px; white-space: normal; color: var(--subtle); }
.adm [data-table="early"] td:nth-child(8), .adm [data-table="invites"] td:nth-child(9) { min-width: 220px; max-width: 360px;
  white-space: normal; }
.adm code { font: 700 13.5px ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .5px; color: var(--text); }
.adm .linkish { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-weight: 700; color: #C4321A;
  text-decoration: underline; text-underline-offset: 3px; }
.adm .linkish:disabled { opacity: .5; cursor: default; }
.adm .tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; color: #8A2A0E;
  background: var(--signal-soft); vertical-align: 1px; }
.adm .tag.ok { color: #14683D; background: rgba(20, 104, 61, .1); }
.adm .tag.warn { color: #8A5A00; background: rgba(214, 150, 0, .14); }

/* the overview */
.adm .checks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.adm .checks li { display: flex; align-items: baseline; gap: 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--white); color: var(--text); }
.adm .checks .mark { font-weight: 800; }
.adm .checks li.ok .mark { color: #14683D; }
.adm .checks li.bad { border-color: rgba(196, 50, 26, .35); background: #FFF6F3; }
.adm .checks li.bad .mark { color: #C4321A; }
.adm .stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.adm .stat { display: grid; gap: 2px; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--white); }
.adm .stat strong { font: 800 28px/1.15 var(--display); letter-spacing: -.5px; color: var(--text); }
.adm .stat span { font-weight: 700; color: var(--text); }
.adm .stat small { font-size: 13px; color: var(--subtle); }

/* forms */
.adm form.card { display: grid; gap: 12px; margin: 0 0 16px; padding: 18px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--white); box-shadow: none; }
.adm form.card .adm-h2 { margin: 0; }
.adm form.card.inline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.adm form.card .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.adm form.card .grid .wide { grid-column: 1 / -1; }
.adm form.card label { display: grid; gap: 6px; margin: 0; font: 700 14px var(--body); color: var(--text); }
.adm form.card label .muted { display: inline; font-size: 13px; }
.adm input, .adm select, .adm textarea { min-width: 0; height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--white); color: var(--text); font: 500 15px var(--body); }
.adm input:focus, .adm select:focus, .adm textarea:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px var(--signal-soft); }
.adm form.card.inline input { flex: 1 1 220px; }
.adm textarea { width: 100%; height: auto; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.adm .btn { height: 42px; margin: 0; padding: 0 18px; border-radius: 10px; font-size: 14.5px; justify-self: start; }
.adm .made { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.adm .made p { margin: 0; color: var(--text); }
.adm .find { display: flex; gap: 10px; margin: 0 0 14px; padding: 0; background: none; border: 0; }
.adm .find input { flex: 1 1 auto; max-width: 440px; }

/* messages: a small notice at the bottom of the screen */
.adm-toast { position: fixed; left: 50%; bottom: 22px; z-index: 60; transform: translateX(-50%); width: max-content;
  max-width: min(560px, calc(100vw - 32px)); margin: 0; padding: 12px 18px; border-radius: 14px; background: var(--ink); color: #FFFFFF;
  font-size: 14.5px; line-height: 1.45; box-shadow: 0 20px 40px -20px rgba(14, 16, 20, .6); }
.adm-toast:empty { display: none; }
.adm-toast.ok::before { content: "✓  "; color: #3BD18A; font-weight: 800; }
.adm-toast.err { background: #B42318; }

/* phones and small windows: the sidebar slides in */
@media (max-width: 900px) {
  .adm { grid-template-columns: minmax(0, 1fr); }
  .adm-side { position: fixed; top: 0; bottom: 0; left: 0; z-index: 50; width: 276px; height: auto; transform: translateX(-102%);
    transition: transform .22s ease; }
  .adm.adm-open .adm-side { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, .45); }
  .adm.adm-open .adm-scrim { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(14, 16, 20, .45); }
  .adm-close, .adm-menu { display: inline-grid; }
  .adm-title h1 { font-size: 19px; }
  .adm-refresh span { display: none; }
  .adm-refresh { padding: 0 11px; }
}
@media (prefers-reduced-motion: reduce) { .adm-side { transition: none; } }
.adm .adm-toast.ok, .adm .adm-toast.err, .adm .adm-toast { color: #FFFFFF; }
