/* M&R CLOUD Admin dashboard (1.36.0 "Cloud Control"). Dark and Light base themes + one accent colour.
   Colours are tokens on :root and set again by admin.js from the admin's saved choice. No inline styles (the page's CSP forbids them). */
:root {
  --accent: #ff4057; --accent-ink: #ffffff; --accent-text: #ff7a8a;
  --bg: #09090d; --panel: #171219; --surface: #25202d; --input: #100e15; --line: #34303d;
  --text: #f7f2f6; --muted: #b3adbe; --danger: #ff8da0; --good: #5fe0a0; --warn: #ffcf70;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 15px; color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f1f4; --panel: #ffffff; --surface: #ece8f0; --input: #ffffff; --line: #d6d1dc;
  --text: #211e2b; --muted: #5b5868; --danger: #b3203f; --good: #11704a; --warn: #8a5a00; color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); min-height: 100dvh; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px; min-height: 40px; font-weight: 600; touch-action: manipulation; }
button:hover { filter: brightness(1.08); }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
button.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); background: transparent; }
button.quiet { background: transparent; }
button.small { min-height: 32px; padding: 4px 10px; font-size: 13px; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
input, select { width: 100%; background: var(--input); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 42px; }
input[type="color"] { padding: 3px; width: 56px; height: 42px; }
input[type="checkbox"] { width: auto; min-height: 0; }
.password-field { position: relative; width: 100%; }
.password-field input { padding-right: 54px; }
.password-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); min-height: 34px; min-width: 40px; padding: 4px 8px; border: 0; background: transparent; }
label { display: block; font-size: 12px; font-weight: 650; letter-spacing: .5px; color: var(--muted); margin: 14px 0 6px; }
h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: -.4px; }
h2 { font-size: 17px; margin: 0 0 10px; }
h3 { font-size: 15px; margin: 0; }
p { color: var(--muted); line-height: 1.6; margin: 6px 0 12px; }
small, .muted { color: var(--muted); }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 1.6px; color: var(--accent-text); }
code { background: var(--surface); padding: 2px 6px; border-radius: 6px; word-break: break-all; }

.shell { max-width: 1100px; margin: 0 auto; padding: 0 16px 90px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 42px; height: 42px; object-fit: contain; }
.brand strong { font-size: 19px; letter-spacing: .8px; display: block; }
.brand small { font-size: 10px; letter-spacing: 1.6px; font-weight: 650; }
.who { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.badge { font-size: 11px; font-weight: 700; letter-spacing: 1px; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--accent); color: var(--accent-text); }
.badge.good { border-color: var(--good); color: var(--good); }
.badge.warn { border-color: var(--warn); color: var(--warn); }
.badge.off { border-color: var(--line); color: var(--muted); }
nav { display: flex; gap: 6px; padding: 12px 0; overflow-x: auto; }
nav button { background: transparent; border-color: transparent; white-space: nowrap; }
nav button[aria-current="page"] { background: var(--surface); border-color: var(--line); color: var(--accent-text); }
.bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin: 12px 0; }
.bar > * { flex: 1 1 160px; }
.bar > button { flex: 0 0 auto; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; min-width: 0; }
.card header { display: flex; justify-content: space-between; align-items: start; gap: 10px; margin-bottom: 8px; }
.card .name { font-weight: 700; overflow-wrap: anywhere; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border-radius: 99px; padding: 3px 4px 3px 10px; font-size: 13px; }
.chip button { min-height: 24px; padding: 0 8px; border-radius: 99px; border: 0; background: transparent; color: var(--danger); }
.login { max-width: 420px; margin: 8vh auto 0; }
.login .top { border-bottom: 0; }
.login .card { padding: 24px; }
.center { text-align: center; }
.segment { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.segment button { border: 0; border-radius: 0; background: transparent; }
.segment button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0; }
.swatch { width: 38px; height: 38px; min-height: 38px; padding: 0; border-radius: 50%; border: 3px solid var(--line); }
.swatch[aria-pressed="true"] { border-color: var(--text); }
.swatch.c0 { background: #ff4057; } .swatch.c1 { background: #ff8a3d; } .swatch.c2 { background: #f6c945; } .swatch.c3 { background: #3fcf8e; }
.swatch.c4 { background: #35c4d9; } .swatch.c5 { background: #4f8bff; } .swatch.c6 { background: #9b6bff; } .swatch.c7 { background: #ff5fb0; }
.empty { text-align: center; padding: 40px 12px; }
.secret { font-size: 18px; letter-spacing: 2px; word-break: break-all; }
.codes { columns: 2; font-family: ui-monospace, Menlo, monospace; line-height: 1.9; }
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 18px; padding: 22px; width: min(480px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(0, 0, 0, .6); }
#notice { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 11px 16px; max-width: min(520px, calc(100vw - 24px)); display: none; z-index: 20; }
#notice.error { border-color: var(--danger); color: var(--danger); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: 11px; letter-spacing: 1px; color: var(--muted); }
@media (max-width: 640px) {
  .table, .table tbody, .table tr, .table td { display: block; }
  .table thead { display: none; }
  .table tr { border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; margin-bottom: 10px; background: var(--panel); }
  .table td { border: 0; padding: 4px 0; }
  .table td[data-label]::before { content: attr(data-label) " "; font-size: 11px; letter-spacing: 1px; color: var(--muted); display: block; }
}
@media (prefers-reduced-motion: no-preference) { button { transition: filter .15s; } }
