/* WebAdmin — glass shell + clay workspace.
   Palette: ink navy (shell), porcelain (workspace), amber (primary), lime (live/success),
   coral (danger), ocean blue (info/links), orange (pending/warning), sky (accents on dark). */
:root {
  --ink-950: #050918; --ink-900: #0a1233; --ink-800: #111c4a; --ink-700: #1b2a66;
  --d-text: #eef2ff; --d-muted: #aab5d8; --d-line: rgb(255 255 255 / 12%);
  --canvas: #eef1f8; --canvas-2: #f7f8fc; --surface: #fff; --text: #0f1733; --muted: #4f5a7c; --line: #d9dfed;
  --amber: #f5a623; --amber-deep: #8a5200; --lime: #5f9a2a; --coral: #d93a2e; --blue: #1f5fd6; --orange: #d9700f; --sky: #6cc7ff;
  --clay-amber: #ffe8bf; --clay-lime: #def2cb; --clay-coral: #ffdcd6; --clay-blue: #d8e6ff; --clay-orange: #ffe2c8;
  --focus: #ffb938;
  --font-display: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Manrope', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1); --spring: cubic-bezier(.34, 1.4, .64, 1);
  --clay: 0 18px 36px -20px rgb(20 34 90 / 35%), 0 2px 5px -2px rgb(20 34 90 / 10%), inset 0 2px 1px rgb(255 255 255 / 95%), inset 6px 8px 16px rgb(255 255 255 / 70%), inset -8px -10px 18px rgb(28 46 120 / 10%);
  --clay-hover: 0 26px 46px -22px rgb(20 34 90 / 42%), 0 2px 5px -2px rgb(20 34 90 / 10%), inset 0 2px 1px rgb(255 255 255 / 95%), inset 6px 8px 16px rgb(255 255 255 / 70%), inset -8px -10px 18px rgb(28 46 120 / 12%);
  --side-w: 264px;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--font-body); font-size: 15.5px; line-height: 1.55; color: var(--text); background: var(--canvas); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.02em; margin: 0; line-height: 1.15; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
.icon { width: 18px; height: 18px; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .88em; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 18px 14px;
  color: var(--d-text); overflow: hidden; isolation: isolate;
  background: radial-gradient(60% 40% at 0% 0%, rgb(245 166 35 / 20%), transparent 70%), radial-gradient(70% 50% at 100% 100%, rgb(31 95 214 / 40%), transparent 70%), linear-gradient(180deg, var(--ink-900), var(--ink-950));
}
.side::after { content: ""; position: absolute; inset: 0; z-index: -1; background-image: radial-gradient(rgb(255 255 255 / 7%) 1px, transparent 1px); background-size: 18px 18px; mask-image: linear-gradient(180deg, #000, transparent 70%); }
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 18px; }
.brand__mark { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; color: #231500; background: linear-gradient(180deg, #ffc85e, var(--amber) 55%, #ef8322); box-shadow: inset 0 2px 0 rgb(255 255 255 / 55%), inset 0 -4px 8px rgb(170 80 0 / 35%), 0 10px 20px -8px rgb(245 140 20 / 70%); }
.brand strong { display: block; font-family: var(--font-display); font-size: 1.2rem; }
.brand span { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--d-muted); font-weight: 700; }
.nav { display: grid; gap: 3px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 14px; color: #d4dcfb; font-weight: 700; text-decoration: none; transition: background-color .2s, color .2s; }
.nav a:hover { background: rgb(255 255 255 / 8%); color: #fff; }
.nav a[aria-current="page"] { color: #fff; background: linear-gradient(160deg, rgb(255 255 255 / 16%), rgb(255 255 255 / 6%)); box-shadow: inset 0 1px 0 rgb(255 255 255 / 20%), inset 3px 0 0 var(--amber); }
.nav .badge { margin-left: auto; }
.side__foot { margin-top: auto; display: grid; gap: 10px; }
.me { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 16px; background: rgb(255 255 255 / 6%); border: 1px solid var(--d-line); }
.me__avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--clay-blue); color: #163f93; font-weight: 800; box-shadow: inset 0 1px 1px #fff, inset -3px -3px 6px rgb(0 0 0 / 12%); }
.me div { min-width: 0; flex: 1; }
.me strong { display: block; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; }
.me small { color: var(--d-muted); font-size: .75rem; }
.me button { background: none; border: 0; color: var(--d-muted); padding: 6px; border-radius: 10px; }
.me button:hover { color: #fff; background: rgb(255 255 255 / 10%); }

.main { min-width: 0; padding: 26px clamp(16px, 3vw, 38px) 60px; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 26px; }
.topbar h1 { font-size: clamp(1.6rem, 2.4vw, 2.1rem); }
.topbar p { color: var(--muted); margin-top: 4px; }
.topbar__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
.btn.menu-btn { display: none; }


@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: min(290px, 86vw); z-index: 60; transform: translateX(-105%); transition: transform .3s var(--ease); }
  .shell.nav-open .side { transform: none; }
  .shell.nav-open::after { content: ""; position: fixed; inset: 0; z-index: 50; background: rgb(3 6 20 / 50%); }
  .btn.menu-btn { display: inline-flex; }
}

/* ---------- Surfaces ---------- */
.card { position: relative; background: var(--surface); border-radius: 26px; padding: 22px; box-shadow: var(--clay); }
.card + .card { margin-top: 20px; }
.card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card__head h2 { font-size: 1.2rem; display: flex; align-items: center; gap: 10px; }
.grid { display: grid; gap: 18px; }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--sites { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
@media (max-width: 1100px) { .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid--2 { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .grid--4 { grid-template-columns: 1fr; } .grid--sites { grid-template-columns: 1fr; } }

.bubble { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 16px; background: var(--acc-soft, var(--clay-blue)); color: var(--acc-ink, #163f93); box-shadow: inset 0 2px 1px rgb(255 255 255 / 90%), inset 4px 5px 10px rgb(255 255 255 / 70%), inset -5px -6px 12px rgb(0 0 0 / 9%), 0 10px 18px -10px var(--acc-glow, rgb(31 95 214 / 55%)); }
.bubble .icon { width: 22px; height: 22px; }
.acc-amber { --acc-soft: var(--clay-amber); --acc-ink: #8a5200; --acc-glow: rgb(245 166 35 / 60%); }
.acc-lime { --acc-soft: var(--clay-lime); --acc-ink: #3c6d12; --acc-glow: rgb(125 184 67 / 60%); }
.acc-coral { --acc-soft: var(--clay-coral); --acc-ink: #a4241a; --acc-glow: rgb(229 72 59 / 55%); }
.acc-blue { --acc-soft: var(--clay-blue); --acc-ink: #163f93; --acc-glow: rgb(31 95 214 / 55%); }
.acc-orange { --acc-soft: var(--clay-orange); --acc-ink: #93430a; --acc-glow: rgb(239 131 34 / 60%); }

.stat { display: flex; align-items: center; gap: 16px; padding: 20px; border-radius: 24px; background: linear-gradient(160deg, #fff 30%, var(--acc-soft) 160%); box-shadow: var(--clay); transition: transform .3s var(--spring), box-shadow .3s; }
a.stat { color: inherit; text-decoration: none; }
a.stat:hover { transform: translateY(-3px); box-shadow: var(--clay-hover); }
.stat strong { display: block; font-family: var(--font-display); font-size: 2rem; line-height: 1; letter-spacing: -0.03em; }
.stat span { color: var(--muted); font-weight: 700; font-size: .88rem; }

/* health meters */
.meter { display: grid; gap: 6px; }
.meter__row { display: flex; justify-content: space-between; font-weight: 700; font-size: .88rem; }
.meter__bar { height: 12px; border-radius: 999px; background: var(--canvas); box-shadow: inset 0 2px 4px rgb(20 34 90 / 12%); overflow: hidden; }
.meter__bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8cd65a, var(--lime)); box-shadow: inset 0 2px 0 rgb(255 255 255 / 45%); }
.meter__bar i.warn { background: linear-gradient(90deg, #ffc85e, var(--orange)); }
.meter__bar i.bad { background: linear-gradient(90deg, #ff8a7d, var(--coral)); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 999px; border: 0; font-weight: 800; font-size: .9rem; white-space: nowrap; text-decoration: none !important; transition: transform .2s var(--spring), box-shadow .2s, background-color .2s; }
.btn:active { transform: translateY(1px) scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--primary { color: #231500; background: linear-gradient(180deg, #ffc85e, var(--amber) 55%, #ef8a12); box-shadow: inset 0 2px 0 rgb(255 255 255 / 60%), inset 0 -4px 8px rgb(170 80 0 / 30%), 0 12px 22px -10px rgb(245 140 20 / 70%); }
.btn--primary:hover:not(:disabled) { transform: translateY(-2px); }
.btn--ink { color: #fff; background: linear-gradient(180deg, #2a3c8f, var(--ink-800)); box-shadow: inset 0 2px 0 rgb(255 255 255 / 18%), inset 0 -4px 8px rgb(0 0 0 / 30%), 0 12px 22px -12px rgb(17 28 74 / 70%); }
.btn--ink:hover:not(:disabled) { transform: translateY(-2px); }
.btn--ghost { color: var(--text); background: var(--surface); border: 1.5px solid var(--line); }
.btn--ghost:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.btn--danger { color: #fff; background: linear-gradient(180deg, #f0665a, var(--coral)); box-shadow: inset 0 2px 0 rgb(255 255 255 / 30%), inset 0 -4px 8px rgb(120 20 10 / 30%), 0 12px 22px -12px rgb(217 58 46 / 70%); }
.btn--sm { min-height: 34px; padding: 0 12px; font-size: .82rem; }
.btn--icon { width: 36px; min-height: 36px; padding: 0; border-radius: 12px; background: var(--canvas-2); border: 1px solid var(--line); color: var(--muted); }
.btn--icon:hover { color: var(--blue); border-color: #b9c8ec; background: #fff; }
.btn--icon.danger:hover { color: var(--coral); border-color: #f1b8b1; }
.btn[aria-busy="true"] .icon { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Badges & chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 800; background: var(--acc-soft, var(--clay-blue)); color: var(--acc-ink, #163f93); white-space: nowrap; }
.badge .icon { width: 13px; height: 13px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--canvas-2); border: 1px solid var(--line); font-size: .82rem; font-weight: 700; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -6px; padding: 0 6px; }
table { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
th { text-align: left; font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 0 14px 2px; white-space: nowrap; }
td { background: var(--canvas-2); padding: 12px 14px; border-block: 1px solid var(--line); vertical-align: middle; }
td:first-child { border-left: 1px solid var(--line); border-radius: 16px 0 0 16px; }
td:last-child { border-right: 1px solid var(--line); border-radius: 0 16px 16px 0; }
tr:hover td { background: #fff; }
.domain-cell { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.domain-cell a { color: var(--text); }
.actions { display: flex; gap: 6px; justify-content: flex-end; }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.empty { padding: 30px; text-align: center; color: var(--muted); border: 1.5px dashed var(--line); border-radius: 20px; font-weight: 650; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; }
.field label, .field .label { font-size: .84rem; font-weight: 800; color: #26314f; }
.field small { color: var(--muted); font-size: .8rem; }
.input, select.input, textarea.input { width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--canvas-2); box-shadow: inset 0 2px 5px rgb(20 34 90 / 7%); transition: border-color .2s, box-shadow .2s, background-color .2s; }
.input:focus { outline: none; border-color: var(--blue); background: #fff; box-shadow: 0 0 0 4px rgb(31 95 214 / 15%); }
select.input { appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234f5a7c' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
select.input--inline { width: auto; min-height: 36px; padding: 4px 34px 4px 12px; font-weight: 700; font-size: .88rem; border-radius: 12px; }
.form { display: grid; gap: 14px; }
.form__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 560px) { .form__row { grid-template-columns: 1fr; } }
.toggle { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--canvas-2); border: 1px solid var(--line); cursor: pointer; }
.toggle input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--amber); }
.toggle strong { display: block; font-size: .9rem; }
.toggle span { color: var(--muted); font-size: .82rem; }
.search-box { position: relative; width: 260px; max-width: 100%; }
.search-box .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box .input { padding-left: 40px; border-radius: 999px; }
.error-text { color: #b3261e; font-weight: 700; font-size: .88rem; }

/* ---------- Site cards ---------- */
.site { display: flex; flex-direction: column; gap: 14px; }
.site__head { display: flex; gap: 14px; align-items: flex-start; }
.site__head h3 { font-size: 1.2rem; }
.site__meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.site__row { display: grid; gap: 6px; padding: 12px 14px; border-radius: 16px; background: var(--canvas-2); border: 1px solid var(--line); }
.site__row .label { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.site__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.dropzone { display: grid; place-items: center; gap: 6px; padding: 18px; border-radius: 18px; border: 2px dashed #c3cfe9; background: var(--canvas-2); text-align: center; color: var(--muted); font-weight: 700; font-size: .88rem; cursor: pointer; transition: border-color .2s, background-color .2s; }
.dropzone:hover, .dropzone.drag { border-color: var(--amber); background: #fffaf0; color: var(--amber-deep); }

/* ---------- Activity ---------- */
.feed { display: grid; gap: 8px; }
.feed li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--canvas-2); border: 1px solid var(--line); }
.feed .bubble { width: 34px; height: 34px; border-radius: 11px; }
.feed .bubble .icon { width: 16px; height: 16px; }
.feed strong { font-size: .9rem; }
.feed p { color: var(--muted); font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed time { color: var(--muted); font-size: .78rem; font-weight: 700; white-space: nowrap; }

/* ---------- Auth screens ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; color: var(--d-text); isolation: isolate; position: relative; overflow: hidden;
  background: radial-gradient(50% 50% at 80% 20%, rgb(31 95 214 / 45%), transparent 70%), radial-gradient(40% 40% at 10% 90%, rgb(245 166 35 / 25%), transparent 70%), radial-gradient(30% 30% at 20% 20%, rgb(229 72 59 / 18%), transparent 70%), linear-gradient(180deg, var(--ink-950), var(--ink-900)); }
.auth::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: radial-gradient(rgb(255 255 255 / 7%) 1px, transparent 1px); background-size: 22px 22px; }
.auth__card { width: min(440px, 100%); padding: 30px; border-radius: 30px; background: rgb(14 24 66 / 92%); border: 1px solid rgb(255 255 255 / 16%); box-shadow: inset 0 1px 0 rgb(255 255 255 / 18%), 0 30px 70px -30px rgb(0 0 0 / 70%); }
@supports (backdrop-filter: blur(1px)) { .auth__card { background: linear-gradient(160deg, rgb(40 58 140 / 45%), rgb(12 20 58 / 60%)); backdrop-filter: blur(22px) saturate(150%); } }
.auth__card h1 { font-size: 1.7rem; margin: 18px 0 6px; }
.auth__card p { color: var(--d-muted); margin-bottom: 20px; }
.auth .field label { color: #dfe6ff; }
.auth .input { background: rgb(255 255 255 / 8%); border-color: rgb(255 255 255 / 18%); color: #fff; box-shadow: inset 0 2px 6px rgb(0 0 0 / 25%); }
.auth .input:focus { border-color: var(--sky); background: rgb(255 255 255 / 12%); box-shadow: 0 0 0 4px rgb(108 199 255 / 20%); }
.auth .error-text { color: #ffb4a9; }
.auth .btn--primary { width: 100%; min-height: 48px; }
.auth__foot { margin-top: 18px; font-size: .8rem; color: var(--d-muted); display: flex; align-items: center; gap: 8px; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgb(3 6 20 / 55%); animation: fade .2s var(--ease); }
@supports (backdrop-filter: blur(1px)) { .modal { backdrop-filter: blur(4px); } }
.modal__panel { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 24px; border-radius: 28px; background: #fff; box-shadow: 0 40px 80px -30px rgb(0 0 0 / 50%), inset 0 2px 1px #fff; animation: pop .25s var(--spring); }
.modal__panel h2 { font-size: 1.35rem; margin-bottom: 6px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: grid; gap: 10px; width: min(380px, calc(100vw - 36px)); }
.toast { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 18px; color: var(--d-text); background: linear-gradient(160deg, #22348a, var(--ink-900)); box-shadow: 0 20px 40px -20px rgb(0 0 0 / 60%), inset 0 1px 0 rgb(255 255 255 / 15%); animation: pop .25s var(--spring); font-weight: 650; font-size: .9rem; }
.toast .icon { margin-top: 1px; }
.toast.ok .icon { color: #9be36c; }
.toast.err .icon { color: #ff9b8f; }

.secret { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--canvas-2); border: 1px dashed var(--line); font-family: ui-monospace, Consolas, monospace; font-weight: 700; letter-spacing: .06em; word-break: break-all; }
.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--clay-amber); color: #5a3600; font-weight: 650; font-size: .88rem; box-shadow: inset 0 2px 1px #fff; }
.note.info { background: var(--clay-blue); color: #163f93; }
.note.bad { background: var(--clay-coral); color: #8f1f16; }
.loading { padding: 60px; text-align: center; color: var(--muted); font-weight: 700; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
