/* SpeedVote admin console. Same design language as the MoMoGram console: system of cards,
   FH Oscar headings, Satoshi text, one brand colour, light and dark. Loaded after style.css
   on admin pages only (body.yv-admin / body.yv-auth), so it also neutralises style.css there. */

/* body. prefix: style.css sets --brand on "body:not(.admin-body)", which is more specific than a class alone. */
body.yv-admin, body.yv-auth {
  --bg: #f5f5f7;
  --card: #ffffff;
  --head: #f9f9fb;
  --text: #1d1d1f;
  --text-2: #3a3a3c;
  --muted: #6e6e73;
  --border: #e5e5ea;
  --border-2: #d2d2d7;
  --brand: #0b4d6e;
  --brand-hover: #0e6189;
  --on-brand: #ffffff;
  --link: #0b5f86;
  --brand-tint: #e4eff5;
  --brand-text: #0b4d6e;
  --gold: #f2c230;
  --focus: rgba(11, 77, 110, .22);
  --ok: #1e7a3a; --ok-bg: #e7f5ec; --ok-line: #c9ead4;
  --warn: #8a5a00; --warn-bg: #fff4d6; --warn-line: #f3dc9b;
  --err: #c3261c; --err-bg: #fdecea; --err-line: #f6c8c3;
  --neutral-bg: #eeeef1;
  --danger: #c3261c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .04);
  --radius: 16px;
  --radius-sm: 10px;
  --sidebar: 248px;
  --font: "Satoshi", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: "FH Oscar", "Satoshi", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  body.yv-admin, body.yv-auth {
    --bg: #0f1112;
    --card: #1b1d1f;
    --head: #222527;
    --text: #f2f2f4;
    --text-2: #d9d9de;
    --muted: #a1a1a8;
    --border: #2c2f31;
    --border-2: #3a3d40;
    --brand: #ffc61a;
    --brand-hover: #ffd451;
    --on-brand: #1d1600;
    --link: #ffc61a;
    --brand-tint: rgba(255, 198, 26, .14);
    --brand-text: #ffc61a;
    --focus: rgba(255, 198, 26, .3);
    --ok: #6fd08b; --ok-bg: rgba(111, 208, 139, .14); --ok-line: rgba(111, 208, 139, .3);
    --warn: #f0c35a; --warn-bg: rgba(240, 195, 90, .14); --warn-line: rgba(240, 195, 90, .3);
    --err: #ff7a70; --err-bg: rgba(255, 122, 112, .14); --err-line: rgba(255, 122, 112, .3);
    --neutral-bg: #2a2d30;
    --danger: #ff7a70;
    --shadow: none;
    color-scheme: dark;
  }
}

body.yv-admin, body.yv-auth {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
.yv-admin *, .yv-auth * { letter-spacing: normal; }
.yv-admin a, .yv-auth a { color: var(--link); text-underline-offset: 2px; }
.yv-admin img { max-width: 100%; }

/* ---------- Shell: sidebar on large screens, top bar + drawer on phones ---------- */
.yv-shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.yv-sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--card); border-right: 1px solid var(--border);
  padding: 20px 14px; display: flex; flex-direction: column; gap: 4px;
}
.yv-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; text-decoration: none; color: var(--text) !important; }
.yv-brand img { width: 32px; height: 32px; object-fit: contain; }
.yv-brand span { font-family: var(--font-head); font-weight: 700; font-size: 16px; line-height: 1.2; }
.yv-brand small { display: block; font-family: var(--font); font-weight: 500; font-size: 12px; color: var(--muted); }
.yv-nav-group { margin: 10px 0 2px; padding: 0 10px; font-size: 11px; font-weight: 700; letter-spacing: .06em !important; text-transform: uppercase; color: var(--muted); }
.yv-nav-link {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px;
  color: var(--text) !important; text-decoration: none; font-size: 14px; font-weight: 500;
}
.yv-icon, .yv-nav-link svg { width: 18px; height: 18px; flex: 0 0 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.yv-nav-link svg { opacity: .75; }
.yv-nav-link:hover { background: var(--neutral-bg); }
.yv-nav-link.on { background: var(--brand); color: var(--on-brand) !important; }
.yv-nav-link.on svg { opacity: 1; }
.yv-sidebar-foot { margin-top: auto; padding: 16px 10px 4px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.yv-sidebar-foot b { color: var(--text); }
.yv-sidebar-foot a { display: inline-block; margin-top: 6px; font-weight: 700; }
.yv-sidebar-foot .sep { color: var(--border-2); margin: 0 6px; }

.yv-topbar, .yv-scrim { display: none; }
.yv-content { min-width: 0; }
.yv-main { max-width: 1120px; margin: 0 auto; padding: 36px 32px 64px; }
.yv-back { margin: 0 0 10px; font-size: 14px; }
.yv-back a { text-decoration: none; font-weight: 500; }
.yv-back a:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .yv-shell { display: block; }
  .yv-topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    position: sticky; top: 0; z-index: 20; height: auto;
    background: color-mix(in srgb, var(--card) 88%, transparent);
    -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid var(--border); padding: 10px 16px;
  }
  .yv-topbar .yv-brand { padding: 0; }
  .yv-menu-btn {
    margin: 0; padding: 8px 12px; border-radius: 10px; border: 0; cursor: pointer;
    background: var(--neutral-bg); color: var(--text); font: inherit; font-weight: 700; font-size: 14px;
  }
  .yv-sidebar {
    position: fixed; z-index: 40; left: 0; top: 0; width: min(300px, 86vw);
    transform: translateX(-102%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .18);
  }
  .yv-sidebar .yv-brand { display: none; }
  body.yv-nav-open .yv-sidebar { transform: none; }
  .yv-scrim { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .32); }
  body.yv-nav-open .yv-scrim { display: block; }
  body.yv-nav-open { overflow: hidden; }
  .yv-main { padding: 22px 16px 48px; }
}

/* ---------- Type ---------- */
.yv-admin h1, .yv-admin h2, .yv-admin h3, .yv-admin h4 { font-family: var(--font-head); color: var(--text); }
.yv-admin h1 { font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: -.015em !important; margin: 0 0 8px; }
.yv-admin h2 { font-size: 18px; line-height: 1.3; font-weight: 600; margin: 0 0 12px; }
.yv-admin h3 { font-size: 16px; font-weight: 600; margin: 0 0 8px; }
.yv-admin h4 { font-size: 15px; font-weight: 600; margin: 0 0 6px; }
.yv-admin p { margin: 0 0 12px; }
.ui-muted, .ui-hint, .ui-empty, .ui-sub { color: var(--muted) !important; }
.ui-small { font-size: 13px; }
.ui-empty { margin: 0; font-size: 14px; }
.ui-sub { display: block; font-size: 13px; font-weight: 400; }
@media (max-width: 600px) { .yv-admin h1 { font-size: 26px; } }

.ui-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.ui-head h1 { margin: 0; }
.ui-head p { margin: 6px 0 0; font-size: 17px; color: var(--muted); }
.ui-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ui-all-clear { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; margin: -8px 0 28px; }

/* ---------- Surfaces ---------- */
.ui-section, .yv-admin .card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; margin: 0 0 16px;
}
.yv-admin .card:hover { transform: none; box-shadow: var(--shadow); }
.ui-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.ui-section-head h2 { margin: 0; }
.ui-section-head .ui-actions { align-self: center; }
.ui-section-body > :last-child { margin-bottom: 0; }
.ui-section.warn { border-color: color-mix(in srgb, var(--warn) 35%, var(--border)); }
.ui-section.danger { border-color: color-mix(in srgb, var(--err) 30%, var(--border)); }
@media (max-width: 600px) { .ui-section, .yv-admin .card { padding: 18px 16px; border-radius: 14px; } }

.ui-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; align-items: start; }
.ui-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1080px) { .ui-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .ui-grid-2 { grid-template-columns: 1fr; } }

.ui-list { list-style: none; margin: 0; padding: 0; }
.ui-list li { display: block; padding: 10px 0; border-top: 1px solid var(--border); border-bottom: 0 !important; }
.ui-list li:first-child { border-top: 0; padding-top: 2px; }
.ui-list li:last-child { padding-bottom: 0; }
.ui-dl { display: grid; grid-template-columns: 200px minmax(0, 1fr); margin: 0; font-size: 14px; }
.ui-dl dt, .ui-dl dd { padding: 11px 0; border-bottom: 1px solid var(--border); margin: 0; }
.ui-dl dt { color: var(--muted); font-weight: 500; }
.ui-dl dd { word-break: break-word; }
.ui-dl :nth-last-child(-n+2) { border-bottom: 0; }
@media (max-width: 600px) { .ui-dl { grid-template-columns: 1fr; } .ui-dl dt { border-bottom: 0; padding-bottom: 0; } }

/* ---------- Key numbers (MoMoGram "metrics") ---------- */
.ui-stats-title { font-family: var(--font-head); font-size: 18px; font-weight: 600; color: var(--text); margin: 0 0 10px !important; }
.ui-stats {
  display: flex; flex-wrap: wrap; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin: 0 0 28px;
}
.ui-stat {
  flex: 1 1 170px; display: flex; flex-direction: column; gap: 4px; padding: 18px 20px;
  color: var(--text) !important; text-decoration: none !important;
  border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: 0 -1px -1px 0;
  transition: background .15s;
}
a.ui-stat:hover { background: var(--head); }
/* Satoshi for figures: FH Oscar draws a slashed zero, which reads badly in ₵0.00. */
.ui-stat-value { font-family: var(--font); font-size: 28px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em !important; font-variant-numeric: tabular-nums; }
.ui-stat-label { font-size: 13px; color: var(--muted); }
.ui-stat.alert .ui-stat-value { color: var(--err); }
.ui-stat.good .ui-stat-value { color: var(--ok); }
@media (max-width: 600px) { .ui-stat { flex-basis: 50%; padding: 14px 16px; } .ui-stat-value { font-size: 22px; } }

/* ---------- Status pills ---------- */
.ui-badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 20px; white-space: nowrap; vertical-align: middle; border: 0; }
.ui-badge.ok { background: var(--ok-bg); color: var(--ok); }
.ui-badge.warn { background: var(--warn-bg); color: var(--warn); }
.ui-badge.err { background: var(--err-bg); color: var(--err); }
.ui-badge.muted { background: var(--neutral-bg); color: var(--muted); }
.ui-badge.info { background: var(--brand-tint); color: var(--brand-text); }

/* ---------- Buttons ---------- */
.ui-btn, .yv-admin .btn, .yv-admin button.btn, .yv-auth .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; height: auto; padding: 10px 18px; margin: 0; width: auto;
  font-family: var(--font); font-size: 14px; font-weight: 700; line-height: 1.2; white-space: nowrap;
  border: 0; border-radius: 999px; cursor: pointer; text-decoration: none !important;
  background: var(--brand); color: var(--on-brand) !important;
  box-shadow: none; filter: none; transform: none; transition: background .15s, transform .05s;
}
.ui-btn:hover, .yv-admin .btn:hover, .yv-auth .btn:hover { background: var(--brand-hover); box-shadow: none; filter: none; transform: none; }
.ui-btn:active, .yv-admin .btn:active { transform: scale(.98); }
.ui-btn:focus-visible, .yv-admin .btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--focus); }
.ui-btn.secondary, .yv-admin .btn.secondary, .yv-admin .btn.tertiary { background: var(--neutral-bg); color: var(--text) !important; }
.ui-btn.secondary:hover, .yv-admin .btn.secondary:hover, .yv-admin .btn.tertiary:hover { background: var(--border-2); }
.ui-btn.danger, .yv-admin .btn.danger { background: var(--err-bg); color: var(--err) !important; }
.ui-btn.danger:hover, .yv-admin .btn.danger:hover { background: var(--danger); color: #fff !important; }
.ui-btn.small, .yv-admin .btn.small { min-height: 32px; padding: 6px 13px; font-size: 13px; }
.ui-btn.link { background: none; color: var(--link) !important; padding: 0 4px; min-height: 0; }
.ui-btn.link:hover { background: none; text-decoration: underline !important; }
.ui-btn[disabled], .yv-admin .btn[disabled] { opacity: .45; cursor: default; transform: none; }

/* ---------- Forms ---------- */
.yv-admin form { gap: 14px; max-width: none; }
.yv-admin form button { width: auto; }
.yv-admin form > button[type=submit], .yv-admin form > .btn { align-self: flex-start; }
.yv-admin form label, .yv-admin .ui-label { display: block; font-size: 14px; font-weight: 700; color: var(--text); margin: 0 0 6px; }
.yv-admin form label:has(> input[type=checkbox]) { display: flex; align-items: center; gap: 10px; font-weight: 500; margin: 0; }
.yv-admin form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]),
.yv-admin form select, .yv-admin form textarea, .yv-admin .ui-input {
  width: 100%; height: auto; padding: 11px 13px; margin: 0;
  font-family: var(--font); font-size: 15px; color: var(--text);
  background: var(--card); border: 1px solid var(--border-2); border-radius: var(--radius-sm); box-shadow: none;
  transition: border-color .15s, box-shadow .15s;
}
.yv-admin form textarea { line-height: 1.5; resize: vertical; }
.yv-admin form select {
  -webkit-appearance: none; appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236e6e73' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
}
.yv-admin form input:not([type="checkbox"]):not([type="radio"]):hover, .yv-admin form select:hover, .yv-admin form textarea:hover { box-shadow: none !important; border-color: var(--border-2) !important; }
.yv-admin form input:not([type="checkbox"]):not([type="radio"]):focus, .yv-admin form select:focus, .yv-admin form textarea:focus, .yv-admin .ui-input:focus {
  outline: none; border-color: var(--brand) !important; box-shadow: 0 0 0 4px var(--focus) !important; background: var(--card) !important;
}
.yv-admin input::placeholder, .yv-admin textarea::placeholder { color: var(--muted); opacity: .8; }
.yv-admin input[type=checkbox], .yv-admin input[type=radio] { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); -webkit-appearance: auto; appearance: auto; }
.yv-admin form input[type=file] {
  width: 100%; height: auto !important; padding: 10px !important; font-family: var(--font); font-size: 14px !important; color: var(--muted);
  border: 1px dashed var(--border-2) !important; border-radius: var(--radius-sm) !important; background: var(--head) !important; box-shadow: none !important;
}
.yv-admin form input[type=file]::file-selector-button {
  margin-right: 12px; padding: 7px 14px; border: 0; border-radius: 999px; background: var(--neutral-bg); color: var(--text); font: inherit; font-weight: 700; cursor: pointer;
}
.ui-form { display: flex; flex-direction: column; gap: 16px; max-width: 640px; }
.ui-form.wide { max-width: none; }
.ui-field { display: flex; flex-direction: column; min-width: 0; }
.ui-hint { font-size: 13px; margin: 6px 0 0 !important; }
.ui-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 700px) { .ui-fields { grid-template-columns: 1fr; } }
.ui-form-foot { display: flex; gap: 8px; align-items: center; padding-top: 2px; }
.ui-inline, .yv-admin form.ui-inline { display: flex; flex-direction: row; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.ui-inline > input, .ui-inline > select { width: auto !important; flex: 1 1 160px; }
.ui-inline .ui-field { flex: 1 1 160px; }
.ui-checks { display: flex; flex-direction: column; gap: 12px; }
.ui-checks .ui-hint { margin: -6px 0 0 28px !important; }
.ui-filters { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 22px; margin: 0 0 16px; }
.ui-pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 0 0 16px; }
@media (max-width: 600px) { .ui-inline > * { flex-basis: 100% !important; } }

/* ---------- Tables: scroll sideways on small screens ---------- */
.ui-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -22px; padding: 0 22px; }
@media (max-width: 600px) { .ui-table-wrap { margin: 0 -16px; padding: 0 16px; } }
.yv-admin table, .ui-table { display: table; width: 100%; border-collapse: collapse; border: 0; border-radius: 0; margin: 0; overflow: visible; font-size: 14px; background: transparent; }
.ui-table-wrap .ui-table { min-width: 620px; }
.yv-admin table th, .yv-admin .analytics-table th {
  background: transparent; color: var(--muted); font-family: var(--font); font-weight: 700; font-size: 12px;
  text-transform: uppercase; letter-spacing: .04em !important; white-space: nowrap; text-align: left;
  padding: 12px 10px; border-bottom: 1px solid var(--border);
}
.yv-admin table td { padding: 12px 10px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; background: transparent; }
.yv-admin table tr:last-child td { border-bottom: 0; }
.yv-admin table tbody tr:hover td { background: var(--head); }
.yv-admin table .r, .yv-admin table th.r { text-align: right; }
.yv-admin table td a { font-weight: 500; text-decoration: none; }
.yv-admin table td a:hover { text-decoration: underline; }
.ui-num { font-variant-numeric: tabular-nums; }
.ui-code { font-family: var(--mono); font-weight: 700; font-size: 13px; color: var(--text); background: var(--neutral-bg); border-radius: 6px; padding: 1px 7px; }
.ui-thumb { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; background: var(--neutral-bg); display: block; margin: 0; flex: 0 0 40px; }
.ui-name-cell { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.ui-name-cell a b { font-weight: 700; }
.ui-row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }
.yv-admin code, .yv-auth code { font-family: var(--mono); font-size: .88em; background: var(--neutral-bg); padding: 1px 6px; border-radius: 6px; word-break: break-all; border: 0; }
.yv-admin pre { font-family: var(--mono); background: var(--head); border: 1px solid var(--border); color: var(--text); border-radius: var(--radius-sm); padding: 12px; overflow: auto; }

/* ---------- Results, chart, slides, update steps ---------- */
.ui-result-group + .ui-result-group { margin-top: 26px; }
.ui-result-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.ui-result-head h3 { margin: 0; }
.ui-bars { display: flex; align-items: flex-end; gap: 8px; height: 210px; padding-top: 18px; }
.ui-bar { flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.ui-bar-fill { width: 100%; max-width: 38px; background: var(--brand); border-radius: 8px 8px 3px 3px; min-height: 3px; }
.ui-bar:hover .ui-bar-fill { background: var(--brand-hover); }
.ui-bar-n { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; min-height: 16px; }
.ui-bar-d { font-size: 11px; color: var(--muted); white-space: nowrap; }
@media (max-width: 700px) { .ui-bar-d { writing-mode: vertical-rl; transform: rotate(180deg); } .ui-bars { height: 230px; gap: 4px; } }
.ui-slide { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; padding: 18px 0; border-top: 1px solid var(--border); }
#slide-editor-container > .ui-slide:first-child { border-top: 0; padding-top: 0; }
.ui-slide-media img, .ui-slide-media video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-sm); display: block; margin: 0; }
.ui-slide-empty { aspect-ratio: 16 / 9; border: 1px dashed var(--border-2); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; background: var(--head); }
.ui-slide-fields { display: flex; flex-direction: column; gap: 12px; }
.ui-slide-title { display: flex; justify-content: space-between; align-items: center; }
@media (max-width: 700px) { .ui-slide { grid-template-columns: 1fr; } }
.ui-steps { margin: 0; padding-left: 20px; }
.ui-steps li { margin-bottom: 10px; line-height: 1.6; border: 0 !important; padding: 0; }

/* ---------- Messages ---------- */
.yv-flash {
  display: block; position: relative; padding: 12px 16px 12px 34px; border-radius: 12px; margin: 0 0 20px;
  font-weight: 500; font-size: 14px; border: 0; background: var(--brand-tint); color: var(--brand-text);
}
.yv-flash::before { content: ""; position: absolute; left: 16px; top: 19px; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.yv-flash.ok { background: var(--ok-bg); color: var(--ok); }
.yv-flash.error { background: var(--err-bg); color: var(--err); }
.yv-flash a { color: inherit; font-weight: 700; }

/* ---------- Leftovers from style.css inside the console ---------- */
.yv-admin ul { list-style: none; padding: 0; }
.yv-admin ul li { border-bottom-color: var(--border); }
.yv-admin .badge { border-radius: 999px; padding: 2px 10px; font-size: 12px; margin: 0; }
.yv-admin .grid { gap: 16px; }

/* ---------- Sign-in page ---------- */
.yv-auth { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 40px; }
.yv-auth-box { width: 100%; max-width: 440px; }
.yv-auth-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 22px; text-align: center; }
.yv-auth-brand img { width: 56px; height: 56px; object-fit: contain; }
.yv-auth-brand b { font-family: var(--font-head); font-size: 20px; font-weight: 700; color: var(--text); }
.yv-auth-brand span { color: var(--muted); font-size: 14px; }
.yv-auth .card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.yv-auth .card:hover { transform: none; box-shadow: var(--shadow); }
.yv-auth h1 { font-family: var(--font-head); font-size: 24px; font-weight: 700; margin: 0 0 16px; color: var(--text); }
.yv-auth form { max-width: none; gap: 14px; }
.yv-auth form label { display: block; font-size: 14px; font-weight: 700; color: var(--text); margin: 0 0 6px; }
/* !important: style.css forces a white field with large padding on every form input. */
.yv-auth form input[type=password] {
  width: 100%; padding: 12px 14px !important; font-family: var(--font); font-size: 16px !important; letter-spacing: .12em !important;
  color: var(--text) !important; -webkit-text-fill-color: var(--text); caret-color: var(--text);
  background: var(--head) !important; border: 1px solid var(--border-2) !important; border-radius: var(--radius-sm) !important; box-shadow: none !important;
}
.yv-auth form input[type=password]::placeholder { color: var(--muted); -webkit-text-fill-color: var(--muted); letter-spacing: normal; }
.yv-auth form input[type=password]:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px var(--head) inset !important; -webkit-text-fill-color: var(--text); }
.yv-auth form input[type=password]:hover { border-color: var(--border-2) !important; box-shadow: none !important; }
.yv-auth form input[type=password]:focus { outline: none; border-color: var(--brand) !important; box-shadow: 0 0 0 4px var(--focus) !important; }
.yv-auth .btn { width: 100%; }
.yv-auth .yv-back { display: block; text-align: center; margin-top: 18px; font-size: 14px; color: var(--muted); text-decoration: none; }
.yv-auth .yv-flash { margin-bottom: 16px; }

@media (prefers-reduced-motion: reduce) { .yv-sidebar { transition: none; } * { transition: none !important; } }

/* ---------- SpeedVote's own panels (organizers, nominations, email, newsletter…) ---------- */
/* Satoshi for small headings: their number cards use h3, and FH Oscar draws a slashed zero. */
.yv-admin h3, .yv-admin h4 { font-family: var(--font); font-weight: 700; letter-spacing: -.01em !important; }
.yv-admin .card h3 { font-size: 17px; }
.yv-admin .grid-4 > .card > h3:first-child, .yv-admin .grid-3 > .card > h3:first-child { font-size: 26px; line-height: 1.15; margin-bottom: 4px; }
/* style.css stacks every .actions row; keep button rows side by side here. */
.yv-admin .actions { flex-direction: row !important; align-items: center !important; flex-wrap: wrap; gap: 8px; }
.yv-admin .actions .btn, .yv-admin .actions .btn.secondary { width: auto !important; }
/* One page width for every panel (older panels set 800–1100px each). */
.yv-main > div[style*="max-width"], .yv-main > form > div[style*="max-width"] { max-width: none !important; margin: 0 !important; }
.yv-admin .grid { display: grid; gap: 16px; }
.yv-admin .grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.yv-admin .grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.yv-admin .grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.yv-admin .grid > .card { margin: 0; }
.yv-admin .card small { color: var(--muted); }
.yv-admin .analytics-bar-fill { background: var(--brand); border-radius: 8px 8px 3px 3px; }
.yv-admin .message-feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
/* Vote feed cards follow the admin theme (style.css paints them white, which hid the text in dark mode). */
.yv-admin .message-feed li.message-item { background: var(--head); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: none; padding: 12px 16px; color: var(--text); }
.yv-admin .message-item .message-title { color: var(--text); font-weight: 600; line-height: 1.4; }
.yv-admin .message-item .message-meta { color: var(--muted); }
.yv-admin .message-item .message-link { background: var(--brand-tint); color: var(--brand-text); }
.yv-admin .message-item .message-link:hover { background: var(--brand); color: var(--on-brand); }
.yv-admin .message-empty { color: var(--muted); border-color: var(--border); background: transparent; }
@media (max-width: 600px) { .yv-admin .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }/* style.css lays .payment-settings-form out as a grid of cells; only Payment settings (cards) wants that.
   Plain forms (Create organizer, Email broadcast…) read top to bottom. */
.yv-admin form.payment-settings-form:not(:has(> .card)) { display: flex !important; flex-direction: column; gap: 6px; max-width: 760px; }
.yv-admin form.payment-settings-form:not(:has(> .card)) > label { margin-top: 10px; }
.yv-admin form.payment-settings-form:not(:has(> .card)) > button, .yv-admin form.payment-settings-form:not(:has(> .card)) > .btn { align-self: flex-start; margin-top: 12px; }
.ui-name-cell { min-width: 260px; }
/* ---------- Organizer sign-in / registration ---------- */
.yv-auth-box.wide { max-width: 640px; }
.yv-auth .yv-auth-foot { margin: 16px 0 0; font-size: 14px; color: var(--muted); text-align: center; }
.yv-auth .yv-auth-alt { margin: 18px 0 0; text-align: center; font-size: 15px; color: var(--text); }
.yv-auth form label:has(> input[type=checkbox]) { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.yv-auth form input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--brand); }
.yv-auth form input:not([type=checkbox]):not([type=password]) {
  width: 100%; padding: 12px 14px !important; font-family: var(--font); font-size: 15px !important; color: var(--text) !important; -webkit-text-fill-color: var(--text);
  background: var(--head) !important; border: 1px solid var(--border-2) !important; border-radius: var(--radius-sm) !important; box-shadow: none !important;
}
.yv-auth form input:not([type=checkbox]):focus { outline: none; border-color: var(--brand) !important; box-shadow: 0 0 0 4px var(--focus) !important; }
.yv-auth .ui-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.yv-auth .ui-field { display: flex; flex-direction: column; }
.yv-auth .ui-hint { font-size: 13px; color: var(--muted); margin: -4px 0 0; }
@media (max-width: 600px) { .yv-auth .ui-fields { grid-template-columns: 1fr; } }
/* On/off switch rows (Organizer settings → What organizers can do) */
.yv-admin .ui-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 0; margin: 0; border-top: 1px solid var(--border); cursor: pointer; font-weight: 400; }
.yv-admin .ui-switch-row:first-child { border-top: 0; padding-top: 2px; }
.ui-switch-text b { display: block; font-weight: 600; color: var(--text); }
.ui-switch { position: relative; flex: none; width: 46px; height: 26px; }
.yv-admin .ui-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.ui-switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--neutral-bg); border: 1px solid var(--border); transition: background .15s, border-color .15s; }
.ui-switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .15s; }
.ui-switch input:checked + span { background: var(--brand); border-color: var(--brand); }
.ui-switch input:checked + span::after { transform: translateX(20px); background: var(--on-brand); }
.ui-switch input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
