/* SmartVote admin — logo colours: royal blue #1638B8 + red #E30613, white surfaces. */
:root {
  --navy: #0B14A6; --navy-2: #070E86; --navy-3: #1A26C8;
  --ink: #0F1A3D; --text: #2B3553; --muted: #66708C; --faint: #9AA2B8; --line: #E4E8F1; --line2: #EEF1F7;
  --bg: #F5F7FB; --card: #FFFFFF; --hover: #F3F6FC;
  --accent: #1638B8; --accent-2: #2350E6; --accent-soft: #EAF0FF; --accent-ink: #1638B8;
  --red: #E30613; --red-soft: #FDECEE;
  --blue: #1638B8; --blue-soft: #EAF0FF; --teal: #1638B8; --teal-soft: #EAF0FF; --violet: #1638B8; --violet-soft: #EAF0FF;
  --ok: #16A34A; --ok-soft: #EAF8EF; --warn: #D97706; --warn-soft: #FFF7E6; --bad: #E30613; --bad-soft: #FDECEE; --gold: #F59E0B;
  --r: 14px; --sh: 0 1px 2px rgba(11, 23, 54, .05), 0 6px 20px -12px rgba(11, 23, 54, .18); --sh-lg: 0 30px 70px -24px rgba(11, 23, 54, .45);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --ink: #EEF2FF; --text: #CBD3E6; --muted: #8B96B3; --faint: #5F6A87; --line: #1E2A4A; --line2: #172241; --bg: #070F24; --card: #0E1A38; --hover: #142247; --accent: #9FB0E8; --accent-soft: #16245A; --blue: #9FB0E8; --blue-soft: #16245A; --teal: #9FB0E8; --teal-soft: #16245A; --violet: #9FB0E8; --violet-soft: #16245A; --red-soft: #3A1418; --ok-soft: #0E2A1A; --warn-soft: #2E220C; --bad-soft: #2E1220; color-scheme: dark; } }
:root[data-theme="dark"] { --ink: #EEF2FF; --text: #CBD3E6; --muted: #8B96B3; --faint: #5F6A87; --line: #1E2A4A; --line2: #172241; --bg: #070F24; --card: #0E1A38; --hover: #142247; --accent: #9FB0E8; --accent-soft: #16245A; --blue: #9FB0E8; --blue-soft: #16245A; --teal: #9FB0E8; --teal-soft: #16245A; --violet: #9FB0E8; --violet-soft: #16245A; --red-soft: #3A1418; --ok-soft: #0E2A1A; --warn-soft: #2E220C; --bad-soft: #2E1220; color-scheme: dark; }

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 14px/1.5 "Plus Jakarta Sans", Inter, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { color: var(--ink); margin: 0; letter-spacing: -.02em; }
img { display: block; max-width: 100%; }
.mono { font-family: "JetBrains Mono", ui-monospace, Consolas, monospace; font-size: .9em; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* shell */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: linear-gradient(180deg, #070C5E 0%, #02041F 100%); color: #C9D6FF; display: flex; flex-direction: column; padding: 18px 14px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; }
.wordmark { font-weight: 900; font-size: 1.25rem; letter-spacing: -.03em; line-height: 1; color: var(--navy); }
.wordmark i { font-style: normal; color: var(--red); font-weight: 800; margin-left: 3px; }
.brand img.logo { height: 38px; width: auto; }
.mark { width: 32px; height: 32px; border-radius: 10px; background: var(--navy); display: grid; place-items: center; }
.mark svg { width: 18px; height: 18px; }
.mark path { stroke: #fff; }
.mark circle { fill: #fff; }
.side .grp { font-size: .66rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #8296E0; padding: 14px 12px 6px; }
.side nav { display: grid; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: #D6DEFF; font-weight: 500; position: relative; }
.side nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.side nav a.on { background: rgba(255, 255, 255, .14); color: #fff; font-weight: 700; }
.side nav a.on::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--red); }
.side nav a svg { color: #9FB0F0; }
.side nav a.on svg, .side nav a:hover svg { color: #fff; }
.side nav .pill { margin-left: auto; background: var(--red); color: #fff; font-size: .68rem; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.side-foot { margin-top: auto; display: flex; gap: 6px; align-items: center; border-top: 1px solid rgba(255, 255, 255, .14); padding-top: 14px; }
.side .icon-btn { background: transparent; border-color: rgba(255, 255, 255, .2); color: #D6DEFF; }
.side .icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.who { display: flex; gap: 10px; align-items: center; flex: 1; min-width: 0; padding: 6px; border-radius: 10px; }
.who:hover, .who.on { background: rgba(255, 255, 255, .1); }
.who .av { width: 34px; height: 34px; border-radius: 10px; background: #E30613; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex: none; }
.who b { display: block; font-size: .84rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.who small { color: #9FB0F0; font-size: .72rem; }

.main { min-width: 0; }
.top { position: sticky; top: 0; z-index: 20; height: 66px; display: flex; align-items: center; gap: 12px; padding: 0 30px; background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.top h1 { font-size: 1.2rem; font-weight: 700; }
.top-end { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.content { padding: 26px 30px 56px; max-width: 1360px; }
.only-sm { display: none !important; }
.scrim { display: none; }
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 50; left: 0; top: 0; width: 270px; transform: translateX(-100%); transition: transform .22s; }
  .side.open { transform: none; box-shadow: var(--sh-lg); }
  .scrim.open { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(7, 15, 36, .5); }
  .only-sm { display: grid !important; }
  .top, .content { padding-left: 16px; padding-right: 16px; }
}

/* controls */
.icon-btn { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--card); color: var(--muted); cursor: pointer; flex: none; transition: .15s; }
.icon-btn:hover { color: var(--ink); border-color: var(--faint); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: 600 .85rem/1 inherit; cursor: pointer; white-space: nowrap; transition: .15s; }
.btn:hover { border-color: var(--faint); }
.btn-primary { background: var(--navy); color: #fff; border-color: var(--navy); box-shadow: 0 8px 18px -12px var(--navy); }
.btn-primary:hover { background: var(--navy-2); border-color: var(--navy-2); }
.btn-navy { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-navy:hover { background: var(--navy-3); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-danger { color: var(--bad); }
.btn-danger:hover { background: var(--bad-soft); border-color: transparent; }
.btn-danger-solid { background: var(--red); color: #fff; border-color: var(--red); }
.btn-danger-solid:hover { background: #C10510; }
.btn-sm { height: 32px; padding: 0 11px; font-size: .8rem; border-radius: 9px; }
.btn[disabled] { opacity: .55; cursor: progress; }
.btn-block { width: 100%; }
input.in, select.in, textarea.in, .picker select { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text); font: inherit; transition: .15s; }
textarea.in { height: auto; padding: 10px 12px; resize: vertical; }
.in:focus, .picker select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.picker select { width: auto; min-width: 240px; max-width: 100%; font-weight: 600; color: var(--ink); }
label.l { display: block; font-size: .78rem; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.f { margin-bottom: 14px; }
.f small { display: block; color: var(--faint); font-size: .74rem; margin-top: 5px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 700px) { .row2, .row3 { grid-template-columns: 1fr; } }
.switch { display: inline-flex; gap: 9px; align-items: center; cursor: pointer; font-weight: 600; color: var(--ink); }
.switch input { width: 38px; height: 22px; appearance: none; border-radius: 22px; background: var(--line); position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(16px); }

/* toolbar */
.bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.bar .grow { flex: 1; }
.search { position: relative; min-width: 230px; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search .in { padding-left: 34px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); padding: 3px; gap: 2px; }
.seg a { padding: 0 13px; height: 32px; display: grid; place-items: center; font-size: .82rem; font-weight: 600; color: var(--muted); border-radius: 8px; }
.seg a.on { background: var(--navy); color: #fff; box-shadow: 0 4px 10px -6px var(--navy); }

/* cards + stats */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line2); }
.card-h h2 { font-size: .98rem; font-weight: 700; }
.card-h .sub { font-size: .78rem; color: var(--muted); font-weight: 500; }
.card-b { padding: 20px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat { padding: 18px 20px; display: flex; gap: 14px; align-items: flex-start; position: relative; overflow: hidden; }
.stat .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.stat small { color: var(--muted); font-size: .8rem; font-weight: 600; }
.stat b { display: block; white-space: nowrap; font-size: clamp(1.15rem, 1.9vw, 1.6rem); font-weight: 800; color: var(--ink); letter-spacing: -.03em; margin-top: 2px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat .d { font-size: .75rem; color: var(--faint); margin-top: 3px; }
.stat .d .up { color: var(--ok); font-weight: 700; }
.stat .d .down { color: var(--bad); font-weight: 700; }
.ic-o { background: var(--accent-soft); color: var(--accent); }
.ic-b { background: var(--blue-soft); color: var(--blue); }
.ic-t { background: var(--teal-soft); color: var(--teal); }
.ic-v { background: var(--violet-soft); color: var(--violet); }
.stat.hero { background: var(--navy); border-color: transparent; color: #C9D6FF; }
.stat.hero b { color: #fff; }
.stat.hero small { color: #C9D6FF; }
.stat.hero .d { color: #C9D6FF; }
.stat.hero .d .up { color: #8CF0B4; }
.stat.hero .d .down { color: #FFB3B8; }
.stat.hero .ic { background: rgba(255, 255, 255, .14); color: #fff; }
.stat.hero::after { content: ""; position: absolute; right: -70px; bottom: -90px; width: 170px; height: 170px; border-radius: 50%; border: 20px solid rgba(227, 6, 19, .5); pointer-events: none; }
.stat.hero > div { position: relative; z-index: 1; }
.cols { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 16px; }
.cols-even { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 1100px) { .cols, .cols-3 { grid-template-columns: 1fr; } }
@media (max-width: 800px) { .cols-even { grid-template-columns: 1fr; } }
.chart-box { position: relative; height: 280px; }
.chart-box.sm { height: 220px; }
.legend { display: grid; gap: 10px; margin-top: 14px; }
.legend div { display: flex; align-items: center; gap: 10px; font-size: .84rem; }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend b { margin-left: auto; color: var(--ink); font-variant-numeric: tabular-nums; }
.welcome { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.welcome h2 { font-size: 1.5rem; font-weight: 800; }
.welcome p { margin: 4px 0 0; color: var(--muted); }
.alerts { display: grid; gap: 10px; margin-bottom: 18px; }
.alert-row { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--card); color: var(--text); border: 1px solid var(--line); border-left: 4px solid var(--red); font-weight: 600; box-shadow: var(--sh); }
.alert-row svg { color: var(--red); flex: none; }
.alert-row a.btn { margin-left: auto; }
.qa { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.qa a { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 12px; border: 1px solid var(--line); font-weight: 600; color: var(--ink); font-size: .85rem; transition: .15s; }
.qa a:hover { border-color: var(--navy); background: var(--accent-soft); }
.qa a span { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }

/* meters */
.split { display: grid; gap: 12px; }
.split .lbl { display: flex; justify-content: space-between; font-size: .82rem; margin-bottom: 5px; }
.meter { height: 7px; border-radius: 7px; background: var(--line2); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--blue); border-radius: 7px; }
.meter.a i { background: var(--red); }

/* tables */
.tbl-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: .86rem; }
.t th { text-align: left; font-size: .7rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--hover); }
.t td { padding: 12px 16px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover td { background: var(--hover); }
.t .r { text-align: right; white-space: nowrap; }
.t .act { text-align: right; white-space: nowrap; }
.t .act .btn { margin-left: 4px; }
.cell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.cell b { color: var(--ink); font-weight: 700; }
.cell small { display: block; color: var(--faint); font-size: .75rem; }
.th { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, var(--blue-soft), var(--violet-soft)); color: var(--blue); display: grid; place-items: center; font-size: .72rem; font-weight: 800; overflow: hidden; flex: none; }
.th img { width: 100%; height: 100%; object-fit: cover; }
.th.round { border-radius: 50%; }
.th.lg { width: 76px; height: 76px; border-radius: 16px; font-size: 1.25rem; }
.b { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 99px; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.b::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-ok { background: var(--ok-soft); color: var(--ok); }
.b-off { background: var(--hover); color: var(--muted); }
.b-warn { background: var(--warn-soft); color: var(--warn); }
.b-bad { background: var(--bad-soft); color: var(--bad); }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); font-size: .82rem; color: var(--muted); }
.empty { padding: 52px 16px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 1rem; margin-bottom: 4px; }

/* lists */
.list > div, .list > a { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line2); }
.list > :last-child { border-bottom: 0; }
.list .v { margin-left: auto; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.rank-n { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font-size: .74rem; color: var(--muted); font-weight: 700; background: var(--hover); flex: none; }
.rank-n.top { color: #fff; background: var(--red); }

/* nominee grid */
.ngrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.ncard { padding: 14px; display: grid; gap: 10px; transition: transform .15s, box-shadow .15s; }
.ncard:hover { transform: translateY(-2px); box-shadow: var(--sh-lg); }
.ncard .ph { aspect-ratio: 1; border-radius: 12px; background: var(--hover); display: grid; place-items: center; font-size: 1.9rem; font-weight: 800; color: var(--blue); overflow: hidden; position: relative; }
.ncard .ph img { width: 100%; height: 100%; object-fit: cover; }
.ncard .ph .code { position: absolute; left: 8px; bottom: 8px; background: var(--navy); color: #fff; padding: 3px 8px; border-radius: 7px; font-size: .72rem; }
.ncard h3 { font-size: .92rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ncard .meta { display: flex; justify-content: space-between; align-items: center; font-size: .78rem; color: var(--muted); }
.ncard .acts { display: flex; gap: 6px; }
.ncard .acts .btn { flex: 1; }

/* form sections */
.sec { display: grid; grid-template-columns: 250px 1fr; gap: 26px; padding: 24px 0; border-bottom: 1px solid var(--line2); }
.sec:last-child { border-bottom: 0; }
.sec h2 { font-size: .98rem; font-weight: 700; }
.sec p { color: var(--muted); font-size: .82rem; margin: 4px 0 0; }
@media (max-width: 800px) { .sec { grid-template-columns: 1fr; gap: 12px; } }

/* integrations */
.ints { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 500px) { .ints { grid-template-columns: 1fr; } }
.int-h { display: flex; gap: 14px; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line2); }
.logo-sq { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: .9rem; color: #fff; flex: none; letter-spacing: -.02em; }
.int-h h2 { font-size: 1rem; font-weight: 700; }
.int-h p { margin: 2px 0 0; font-size: .78rem; color: var(--muted); }
.int-h .b { margin-left: auto; }
.int-b { padding: 18px 20px; }
.int-f { display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line2); background: var(--hover); border-radius: 0 0 var(--r) var(--r); flex-wrap: wrap; }
.urlrow { display: flex; gap: 8px; align-items: center; padding: 9px 12px; border: 1px dashed var(--line); border-radius: 10px; margin-bottom: 8px; font-size: .8rem; }
.urlrow span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* modal + confirm */
dialog.modal { border: 0; padding: 0; border-radius: 18px; width: min(500px, calc(100% - 24px)); background: var(--card); color: var(--text); box-shadow: var(--sh-lg); }
dialog.modal::backdrop { background: rgba(7, 15, 36, .55); backdrop-filter: blur(3px); }
dialog.modal[open] { animation: pop .2s cubic-bezier(.2, .8, .2, 1); }
@keyframes pop { from { transform: translateY(12px) scale(.98); opacity: 0; } }
.m-h { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line2); }
.m-h h3 { font-size: 1.02rem; font-weight: 700; }
.m-b { padding: 20px; max-height: 66vh; overflow: auto; }
.m-f { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line2); }
dialog.confirm { width: min(420px, calc(100% - 24px)); text-align: center; }
dialog.confirm .c-b { padding: 28px 26px 10px; }
dialog.confirm .c-ic { width: 60px; height: 60px; border-radius: 18px; margin: 0 auto 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
dialog.confirm.danger .c-ic { background: var(--bad-soft); color: var(--bad); }
dialog.confirm h3 { font-size: 1.15rem; font-weight: 800; margin-bottom: 8px; }
dialog.confirm p { margin: 0; color: var(--muted); font-size: .9rem; }
dialog.confirm .typed { margin-top: 16px; text-align: left; }
dialog.confirm .typed label { font-size: .78rem; color: var(--muted); }
dialog.confirm .typed b { color: var(--bad); font-family: "JetBrains Mono", monospace; }
dialog.confirm .c-f { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 20px 26px 24px; }
dialog.confirm .c-f .btn { height: 44px; }

/* toast */
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 99; display: flex; gap: 10px; align-items: center; background: var(--navy); color: #fff; padding: 13px 18px; border-radius: 12px; font-weight: 600; font-size: .86rem; opacity: 0; transform: translateY(12px); transition: .22s; pointer-events: none; max-width: calc(100% - 44px); box-shadow: var(--sh-lg); }
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #7A90DD; flex: none; }
.toast.show { opacity: 1; transform: none; }
.toast.err::before { background: #FF6B74; }

/* auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); }
.auth-art { background: radial-gradient(520px 360px at 100% 100%, rgba(227, 6, 19, .55), transparent 60%), linear-gradient(160deg, #1638B8 0%, #081F73 100%); color: #D3DCFF; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-art h2 { color: #fff; font-size: 2.4rem; font-weight: 800; line-height: 1.1; letter-spacing: -.03em; }
.auth-art h2 em { font-style: normal; color: #FFB3B8; }
.auth-art .brand { padding: 0; }
.auth-stats { display: flex; gap: 28px; }
.auth-stats b { display: block; color: #fff; font-size: 1.3rem; }
.auth-form { display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(380px, 100%); }
.auth-card h1 { font-size: 1.6rem; font-weight: 800; }
.auth-card p.sub { color: var(--muted); margin: 6px 0 24px; }
.auth-card .in { height: 46px; }
.auth-card .btn { height: 46px; font-size: .92rem; }
.auth-links { display: flex; justify-content: space-between; margin-top: 18px; font-size: .84rem; color: var(--muted); }
.auth-links a:hover { color: var(--accent); }
.alert { padding: 11px 13px; border-radius: 10px; font-size: .85rem; margin-bottom: 16px; background: var(--bad-soft); color: var(--bad); font-weight: 500; }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth-art { display: none; } }

/* image drop zone */
.dz { position: relative; display: flex; align-items: center; gap: 14px; padding: 12px; border: 2px dashed var(--line); border-radius: 14px; background: var(--hover); cursor: pointer; transition: border-color .15s, background .15s; min-height: 92px; }
.dz:hover, .dz.over { border-color: var(--navy); background: var(--accent-soft); }
.dz.over { transform: scale(1.01); }
.dz-prev { width: 68px; height: 68px; border-radius: 12px; flex: none; background: var(--card) center / cover no-repeat; border: 1px solid var(--line); display: grid; place-items: center; }
.dz:not(.has) .dz-prev::before { content: ""; width: 28px; height: 28px; background: var(--faint); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='3'/%3E%3Ccircle cx='9' cy='9' r='2'/%3E%3Cpath d='m21 15-5-5L5 21'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='3'/%3E%3Ccircle cx='9' cy='9' r='2'/%3E%3Cpath d='m21 15-5-5L5 21'/%3E%3C/svg%3E") center / contain no-repeat; }
.dz.over .dz-prev::before { background: var(--accent); }
.dz-txt { display: grid; gap: 2px; font-size: .82rem; color: var(--muted); }
.dz-txt b { color: var(--ink); font-size: .9rem; }
.dz-txt u { color: var(--accent); text-decoration: none; font-weight: 700; }
.dz-x { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 8px; border: 0; background: var(--card); color: var(--bad); font-size: 1.1rem; line-height: 1; cursor: pointer; box-shadow: var(--sh); }
.dz-in { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* instant drop targets */
.droppable { position: relative; }
.droppable.drop-over { outline: 3px dashed var(--accent); outline-offset: 3px; }
.droppable.drop-over::after, .droppable.drop-busy::after { content: "Drop to upload"; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(11, 44, 159, .85); color: #fff; font-weight: 800; font-size: .78rem; border-radius: inherit; z-index: 2; text-align: center; padding: 4px; }
.droppable.drop-busy::after { content: "Uploading…"; background: rgba(11, 23, 54, .78); }
.ncard .ph.droppable::before { content: "Drag a photo here"; position: absolute; left: 0; right: 0; top: 8px; text-align: center; font-size: .66rem; font-weight: 700; color: var(--faint); opacity: 0; transition: opacity .15s; }
.ncard:hover .ph.droppable::before { opacity: 1; }
.ncard .ph img + .code, .ncard .ph:has(img)::before { }

/* dashboard layout */
.dash-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.dash-top h2 { font-size: 1.45rem; font-weight: 800; }
.dash-top p { margin: 4px 0 0; color: var(--muted); font-size: .88rem; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--sh); }
.toolbar .seg { border: 0; padding: 0; background: transparent; }
.toolbar .picker select { border: 0; background: var(--hover); height: 34px; min-width: 210px; }
.toolbar .btn { height: 34px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.kpis .stat { min-height: 112px; }
@media (max-width: 1200px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .kpis { grid-template-columns: 1fr; } }
.row-a { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.row-b { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1100px) { .row-a, .row-b { grid-template-columns: 1fr; } }
.row-a > .card, .row-b > .card { display: flex; flex-direction: column; }
.row-a .card-b, .row-b .card-b { flex: 1; }
.row-b .list { max-height: 372px; overflow: auto; }
.row-a .chart-box { height: 300px; }

.side .wordmark { color: #fff; }
.side .wordmark i { color: #FF6B73; }
.side .brand img.logo { background: #fff; border-radius: 10px; padding: 4px 8px; height: 42px; }
/* event page header */
.ev-head { display: grid; grid-template-columns: 240px 1fr; }
.ev-cover { min-height: 200px; background: var(--hover); overflow: hidden; }
.ev-cover img { width: 100%; height: 100%; object-fit: cover; }
.ev-info { padding: 22px 24px; display: flex; flex-direction: column; gap: 12px; }
.ev-info .kv { grid-template-columns: auto 1fr auto 1fr; gap: 6px 18px; }
.qa a small { display: block; font-weight: 500; }
@media (max-width: 760px) { .ev-head { grid-template-columns: 1fr; } .ev-cover { height: 180px; } .ev-info .kv { grid-template-columns: auto 1fr; } }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: .86rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink); font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.side .brand img.logo { height: 52px; padding: 4px 10px; }
.auth-art .brand img.logo { background: #fff; border-radius: 12px; padding: 6px 12px; height: 60px; }


/* organiser event switcher + assign list */
.ev-switch { margin: 0 4px 10px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .1); }
.ev-switch label { display: block; font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: #9FB0F0; font-weight: 700; margin-bottom: 4px; }
.ev-switch select { width: 100%; background: transparent; border: 0; color: #fff; font: 700 .9rem inherit; cursor: pointer; }
.ev-switch select option { color: #0F1A3D; }
.evlist { display: grid; gap: 6px; max-height: 320px; overflow: auto; }
.evrow { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 600; color: var(--ink); }
.evrow:hover { background: var(--hover); }
.evrow input { width: 18px; height: 18px; accent-color: var(--navy); }

/* nominee card: keep long names inside the card */
.ngrid > .ncard { min-width: 0; }
.ncard { grid-template-columns: minmax(0, 1fr); overflow: hidden; }
.ncard > * { min-width: 0; }
.ncard .meta { gap: 8px; }
.ncard .meta > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ncard .meta > span.mono { flex-shrink: 1; font-size: .74rem; }
.ncard .acts .btn-danger { flex: 0 0 40px; padding: 0; justify-content: center; }

/* results: one category at a time */
.rk { max-width: 900px; }
.rk-list { display: grid; }
.rk-row { display: grid; grid-template-columns: 34px 40px minmax(0, 1fr) 80px; gap: 14px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line2); }
.rk-row:last-child { border-bottom: 0; }
.rk-row.lead { background: linear-gradient(90deg, rgba(227, 6, 19, .06), transparent 70%); }
.rk-n { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: .8rem; color: var(--muted); background: var(--hover); }
.rk-row.lead .rk-n { background: var(--red); color: #fff; }
.rk-row:nth-child(2) .rk-n, .rk-row:nth-child(3) .rk-n { background: var(--accent-soft); color: var(--navy); }
.rk-main { min-width: 0; display: grid; gap: 7px; }
.rk-top { display: flex; gap: 10px; align-items: baseline; min-width: 0; }
.rk-top b { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk-code { font-size: .74rem; flex: none; }
.rk-v { text-align: right; }
.rk-v b { display: block; color: var(--ink); font-size: 1rem; }
.rk-v small { color: var(--muted); font-size: .74rem; }
@media (max-width: 560px) { .rk-row { grid-template-columns: 28px 34px minmax(0, 1fr) 60px; gap: 10px; padding: 12px 14px; } }

/* super admin signed in as another user */
.imp-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 28px 4px; padding: 10px 14px; border-radius: 12px; background: #FFF4E5; color: #7A4B00; border: 1px solid #F8D9A8; font-size: .86rem; }
.imp-bar span { flex: 1; min-width: 200px; }
.imp-bar .btn { background: #7A4B00; color: #fff; border-color: #7A4B00; }
@media (max-width: 760px) { .imp-bar { margin: 0 14px 4px; } }

/* stat cards without an icon: label, amount and note stacked */
.stat:has(> small) { flex-direction: column; gap: 0; }
.stat:has(> small) .d { white-space: normal; }

/* pager */
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 20px; color: var(--muted); font-size: .82rem; }
.ngrid + .pager { padding: 18px 0 0; }
.pager .pg { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pager .btn.on { background: var(--navy); border-color: var(--navy); color: #fff; }
form.search { margin: 0; }

/* activity log */
.act-d { max-width: 520px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .8rem; color: var(--muted); }

/* sidebar event switcher */
.ev-switch { position: relative; margin: 0 2px 12px; padding: 0; background: none; border-radius: 14px; }
.ev-switch summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 14px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); cursor: pointer; transition: background .15s; }
.ev-switch summary::-webkit-details-marker { display: none; }
.ev-switch summary:hover, .ev-switch[open] summary { background: rgba(255, 255, 255, .14); }
.ev-switch .ev-th { width: 34px; height: 34px; border-radius: 10px; flex: none; overflow: hidden; display: grid; place-items: center; background: rgba(255, 255, 255, .15); color: #fff; font-size: .72rem; font-weight: 800; }
.ev-switch .ev-th img { width: 100%; height: 100%; object-fit: cover; }
.ev-cur { min-width: 0; flex: 1; display: grid; }
.ev-cur small { font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: #8F9BE0; font-weight: 700; }
.ev-cur b { color: #fff; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-chev { color: #AEB8F0; flex: none; transition: transform .15s; }
.ev-switch[open] .ev-chev { transform: rotate(180deg); }
.ev-menu { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; background: #fff; border-radius: 14px; padding: 6px; box-shadow: 0 18px 40px rgba(2, 4, 31, .35); max-height: 320px; overflow: auto; }
.ev-menu a { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; color: var(--ink); font-size: .86rem; font-weight: 600; }
.ev-menu a:hover { background: var(--hover); }
.ev-menu a.on { background: var(--accent-soft); color: var(--navy); }
.ev-menu a span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-menu .ev-th { background: var(--hover); color: var(--navy); }

/* event form: manual vs timer */
.vm:has(select[name=vote_mode] option[value=timer]:checked) .vm-manual { display: none; }
.vm:has(select[name=vote_mode] option[value=manual]:checked) .vm-timer { display: none; }

/* broadcast */
.bc-aud { flex-wrap: wrap; }
.bc-aud label { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: .85rem; }
.bc-aud label:has(input:checked) { background: var(--navy); color: #fff; }
.bc-aud input { display: none; }
.bc-show-event, .bc-show-category, .bc-show-numbers { display: none; }
#bc-form[data-aud=event] .bc-show-event, #bc-form[data-aud=category] .bc-show-category, #bc-form[data-aud=numbers] .bc-show-numbers { display: block; }
.bc-ch { display: grid; gap: 8px; }
.bc-prog { margin-top: 14px; display: grid; gap: 6px; font-size: .82rem; color: var(--muted); }

/* ---------- top voter (dashboard + event page) ---------- */
.topvoter-a { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 14px 18px; margin-bottom: 16px; }
.topvoter-a .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; background: #FFF4E0; color: #B26A00; }
.topvoter-a small { display: block; color: var(--muted); font-size: .75rem; }
.tva-main { min-width: 150px; flex: 1; }
.tva-main b { font-size: 1.15rem; letter-spacing: .02em; }
.tva-stat b { display: block; font-size: 1rem; }
.tva-fav { max-width: 220px; }
.tva-fav b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) { .topvoter-a { gap: 12px 16px; } .topvoter-a .btn { width: 100%; } }

/* ---------- dashboard: Latest votes / Top voters tabs ---------- */
.vt-head { gap: 10px; }
.vtabs { display: inline-flex; background: var(--line2, #F1F4FA); border-radius: 12px; padding: 3px; gap: 2px; }
.vtabs button { border: 0; background: transparent; padding: 7px 12px; border-radius: 9px; font: inherit; font-weight: 700; font-size: .88rem; color: var(--muted); cursor: pointer; white-space: nowrap; }
.vtabs button.on { background: var(--card, #fff); color: var(--ink, #0F1A3D); box-shadow: 0 1px 3px rgba(15, 26, 61, .12); }
.vt-all[hidden], [data-vt-pane][hidden] { display: none !important; }

/* Edit event: sections and organiser permission rows */
#m-ev-edit { width: min(700px, calc(100% - 24px)); }
#m-ev-edit .m-b { max-height: 74vh; background: var(--bg, #f6f7fb); }
.msec { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 6px; margin: 0 0 12px; }
.msec:last-child { margin-bottom: 0; }
.msec h4 { display: flex; align-items: center; gap: 7px; margin: 0 0 12px; font-size: .74rem; letter-spacing: .07em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.msec h4 svg { width: 14px; height: 14px; }
.msec-note { font-size: .78rem; color: var(--muted); margin: -4px 0 12px; line-height: 1.45; }
.msec-split { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: start; }
.msec-split .dz { min-height: 128px; }
fieldset.bare { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.bare[disabled] { opacity: .55; }
.perm-grp { border: 1px solid var(--line); border-radius: 12px; margin: 0 0 10px; overflow: hidden; background: var(--card); }
.perm-g { font-size: .72rem; font-weight: 700; color: var(--muted); letter-spacing: .04em; padding: 7px 12px; background: var(--bg, #f6f7fb); border-bottom: 1px solid var(--line); }
.perm-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 12px; cursor: pointer; transition: background .12s; }
.perm-row:hover { background: var(--bg, #f6f7fb); }
.perm-row + .perm-row { border-top: 1px solid var(--line); }
.perm-row b { display: block; font-size: .86rem; font-weight: 600; color: var(--ink); }
.perm-row small { display: block; font-size: .74rem; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.perm-row .switch { flex: none; }
@media (max-width: 600px) { .msec-split, .msec .row2 { grid-template-columns: 1fr; } }

/* users list */
.seg-n { font-size: .72rem; opacity: .7; }
.bar .seg a { grid-auto-flow: column; gap: 5px; }
.u-who { display: flex; flex-direction: column; min-width: 0; }
.u-who small { color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 340px; }
.rpill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: .74rem; font-weight: 700; white-space: nowrap; background: var(--line); color: var(--ink, inherit); }
.rp-superadmin, .rp-admin { background: rgba(22,56,184,.12); color: #1638B8; }
.rp-event_admin { background: rgba(227,6,19,.10); color: #C20511; }
.rp-user { background: rgba(16,150,90,.12); color: #0E7A4B; }
.u-ev { max-width: 240px; }
.u-ev1 { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .85rem; }
.u-act { white-space: nowrap; text-align: right; }
#m-uedit { width: min(640px, calc(100vw - 24px)); }
#m-uedit .evlist { max-height: 170px; overflow: auto; }

.t tr.u-grp td { background: var(--hover); padding: 9px 16px; font-size: .72rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.t tr.u-grp td span { margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--line); font-size: .7rem; }
.t tbody tr.u-grp:hover td { background: var(--hover); }
.u-who b { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.u-who .rpill { padding: 1px 8px; font-size: .68rem; }
#u-t td { padding-left: 12px; padding-right: 12px; }
#u-t .u-who small { max-width: 240px; }
#u-t .u-ev { max-width: 200px; }
.rp-off { background: rgba(227,6,19,.12); color: #C20511; }
tr:has(.rp-off) .u-who > b, tr:has(.rp-off) .th { opacity: .6; }
#u-t .u-act .btn { margin-left: 3px; padding: 0 9px; }
#u-t .u-act .btn:not(:first-child) { width: 32px; padding: 0; justify-content: center; }
