/* Easy Vote design system. Layered on Bootstrap 4; no build step required.
   Colours and the kente stripe are taken from the Miss Tourism Teso logo. */

:root {
    --ink: #17140f;
    --ink-2: #5a5348;
    --ink-3: #7d7568;
    --paper: #faf7f2;
    --surface: #ffffff;
    --line: #e9e3d9;
    --line-strong: #d6cec0;
    --brand: #c8161f;
    --brand-dark: #a10f17;
    --brand-soft: #fcebec;
    --sun: #f5a400;
    --sun-soft: #fff4dc;
    --sun-ink: #7a5200;
    --leaf: #17704b;
    --leaf-soft: #e4f4ec;
    --sky: #1f8fc4;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow-sm: 0 1px 2px rgba(23, 20, 15, .06);
    --shadow: 0 1px 2px rgba(23, 20, 15, .05), 0 10px 28px -14px rgba(23, 20, 15, .22);
    --shadow-lg: 0 24px 60px -24px rgba(23, 20, 15, .45);
    --font-body: "DM Sans", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --font-display: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
    --kente: repeating-linear-gradient(90deg,
        var(--brand) 0 30px, var(--ink) 30px 36px,
        var(--sun) 36px 66px, var(--ink) 66px 72px,
        var(--leaf) 72px 102px, var(--ink) 102px 108px,
        var(--sky) 108px 138px, var(--ink) 138px 144px);
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 15.5px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { color: var(--ink); font-family: var(--font-body); font-weight: 700; }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
img { max-width: 100%; }
label { font-weight: 600; font-size: .875rem; color: var(--ink); margin-bottom: .35rem; }
sup { color: var(--brand); }
:focus-visible { outline: 3px solid rgba(200, 22, 31, .4); outline-offset: 2px; }

.kente { height: 5px; background: var(--kente); }
.muted { color: var(--ink-2); }
.small-muted { color: var(--ink-3); font-size: .85rem; }

/* ---------- Buttons ---------- */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: .92rem;
    padding: .56rem 1.05rem;
    border: 1px solid transparent;
    transition: background-color .15s, border-color .15s, color .15s, transform .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn:disabled, .btn.disabled { opacity: .5; transform: none; cursor: not-allowed; }
.btn i { margin-right: .4rem; }
.btn-brand, .btn-primary, .btn-success { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-brand:hover, .btn-primary:hover, .btn-success:hover,
.btn-brand:focus, .btn-primary:focus, .btn-success:focus {
    background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; box-shadow: none;
}
.btn-ink { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-ink:hover, .btn-ink:focus { background: #000; color: #fff; }
.btn-sun { background: var(--sun); border-color: var(--sun); color: var(--ink); }
.btn-sun:hover, .btn-sun:focus { background: #e09600; border-color: #e09600; color: var(--ink); }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover, .btn-ghost:focus { border-color: var(--ink); color: var(--ink); }
.btn-link { color: var(--brand); }

/* Compact row actions used in admin tables */
.actions { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin: 0; }
.act {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .24rem .6rem;
    border-radius: 7px;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--ink);
    font-size: .8rem;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color .15s, color .15s, background-color .15s;
}
.act:hover { border-color: var(--ink); color: var(--ink); text-decoration: none; }
.act--danger { color: var(--brand); border-color: #efc4c6; }
.act--danger:hover { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- Pills ---------- */
.pill {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .16rem .62rem;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 700;
    white-space: nowrap;
    background: var(--line);
    color: var(--ink-2);
}
.pill--open, .pill--ok { background: var(--leaf-soft); color: var(--leaf); }
.pill--soon, .pill--wait { background: var(--sun-soft); color: var(--sun-ink); }
.pill--open::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 1.05rem; }
.form-control {
    height: auto;
    padding: .58rem .8rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background-color: var(--surface);
    color: var(--ink);
    font-size: .95rem;
    transition: border-color .15s, box-shadow .15s;
}
.form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(200, 22, 31, .13); }
.form-control::placeholder { color: #a39b8e; }
select.form-control { height: calc(1.5em + 1.3rem); }
textarea.form-control { min-height: 104px; }
.form-control-file {
    display: block; width: 100%;
    padding: .55rem;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--paper);
    font-size: .88rem;
}
.form-hint { display: block; margin-top: .35rem; color: var(--ink-3); font-size: .82rem; }
.invalid-feedback { font-size: .84rem; }
.form-actions {
    display: flex; flex-wrap: wrap; gap: .6rem; align-items: center;
    padding-top: 1.1rem; margin-top: .4rem;
    border-top: 1px solid var(--line);
}

/* Segmented radio group */
.choice { display: flex; flex-wrap: wrap; gap: .5rem; }
.choice label { position: relative; margin: 0; cursor: pointer; font-weight: 500; }
.choice input { position: absolute; opacity: 0; }
.choice span {
    display: inline-block;
    padding: .42rem .95rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: .9rem;
    transition: background-color .15s, border-color .15s, color .15s;
}
.choice input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.choice input:focus-visible + span { outline: 3px solid rgba(200, 22, 31, .4); outline-offset: 2px; }

/* ---------- Alerts ---------- */
.alert {
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: .75rem 1rem;
    font-size: .93rem;
}
.alert ul { margin: 0; padding-left: 1.1rem; }
.alert-success { background: var(--leaf-soft); border-color: #bfe3d0; color: #0f5238; }
.alert-danger { background: var(--brand-soft); border-color: #f3c9cb; color: #86101a; }

/* ---------- Panels and modals ---------- */
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.35rem;
    margin-bottom: 1.25rem;
}
.panel__title { font-size: 1.02rem; margin: 0 0 1rem; }
.modal-content { border: 0; border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-header { align-items: center; border-bottom: 1px solid var(--line); padding: 1rem 1.25rem; }
.modal-title { font-size: 1.05rem; margin: 0; }
.modal-body { padding: 1.25rem; }
.modal-backdrop.show { opacity: .6; }
.close { font-weight: 400; opacity: .6; text-shadow: none; }

/* ---------- Public site: header and footer ---------- */
.site-header {
    position: sticky; top: 0; z-index: 1020;
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--line);
}
.site-nav { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--ink); }
.brand:hover { color: var(--ink); text-decoration: none; }
.brand img { height: 50px; width: auto; display: block; }
.brand__name { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.site-links { display: flex; align-items: center; gap: .3rem; margin: 0; padding: 0; list-style: none; }
.site-links > li > a:not(.btn), .site-links .dropdown-toggle {
    display: inline-block; padding: .45rem .75rem;
    color: var(--ink); font-weight: 500; font-size: .95rem;
    border-radius: 8px; background: none; border: 0;
}
.site-links > li > a:not(.btn):hover, .site-links .dropdown-toggle:hover { background: var(--paper); text-decoration: none; }
.site-links > li > a.is-active { color: var(--brand); font-weight: 600; }
.site-toggle { display: none; background: none; border: 1px solid var(--line-strong); border-radius: 8px; width: 42px; height: 42px; color: var(--ink); }
.dropdown-menu { border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: .35rem; font-size: .92rem; }
.dropdown-item { border-radius: 6px; padding: .45rem .7rem; }
.dropdown-item i { width: 18px; color: var(--ink-3); }
.dropdown-item:active { background: var(--brand); }

.site-footer { background: var(--ink); color: #cfc8bb; margin-top: 3.5rem; font-size: .88rem; }
.site-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; padding: 1.4rem 15px; }

/* ---------- Public site: heroes ---------- */
.hero {
    position: relative;
    background-color: var(--ink);
    background-size: cover;
    background-position: center 35%;
    color: #fff;
}
.hero::before {
    content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0;
    background: linear-gradient(100deg, rgba(23, 20, 15, .95) 0%, rgba(23, 20, 15, .84) 55%, rgba(23, 20, 15, .5) 100%);
}
.hero__inner { position: relative; padding-top: 4.2rem; padding-bottom: 4.6rem; }
.hero--home .hero__inner { padding-top: 6rem; padding-bottom: 6.4rem; }
.hero__eyebrow {
    display: inline-block;
    color: var(--sun);
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    margin-bottom: .55rem;
}
.hero h1 {
    color: #fff;
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6.4vw, 4.6rem);
    line-height: 1;
    text-transform: uppercase;
    margin: 0 0 .7rem;
    max-width: 15em;
}
.hero p { font-size: 1.1rem; color: #ece7dd; max-width: 38rem; margin: 0 0 1.4rem; }
.hero p:last-child { margin-bottom: 0; }

/* ---------- Public site: sections ---------- */
.section { padding: 3.2rem 0 .5rem; }
.section-head { margin-bottom: 1.6rem; }
.section-head h2, .position-title {
    font-family: var(--font-display);
    font-size: 2.1rem;
    line-height: 1.1;
    text-transform: uppercase;
    margin: 0;
}
.section-head p { color: var(--ink-2); margin: .3rem 0 0; }
.position-block { margin-bottom: 2.75rem; }
.position-title { display: flex; align-items: center; gap: .8rem; font-size: 1.8rem; margin-bottom: 1.15rem; }
.position-title::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }

.grid { display: grid; gap: 1.35rem; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.grid--people { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* Project card */
.project-card {
    position: relative;
    display: flex; flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
}
.project-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.project-card__media { position: relative; aspect-ratio: 16 / 10; background: var(--line); overflow: hidden; }
.project-card__media img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; display: block; }
.project-card__body { display: flex; flex-direction: column; flex: 1; padding: 1.05rem 1.15rem 1.15rem; }
.project-card h3 { font-size: 1.1rem; line-height: 1.3; margin: .55rem 0 .3rem; }
.project-card h3 a { color: var(--ink); }
.project-card h3 a:hover { text-decoration: none; }
.project-card h3 a::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; }
.project-card__date { color: var(--ink-2); font-size: .88rem; margin-bottom: .9rem; }
.project-card__date i { color: var(--ink-3); margin-right: .3rem; }
.project-card__cta { margin-top: auto; font-weight: 700; font-size: .9rem; color: var(--brand); }
.project-card__cta i { margin-left: .3rem; transition: margin-left .15s; }
.project-card:hover .project-card__cta i { margin-left: .55rem; }

/* Candidate card */
.candidate-card {
    position: relative;
    display: flex; flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
}
.candidate-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.candidate-card__media { position: relative; aspect-ratio: 4 / 5; background: var(--line); }
.candidate-card__media img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 20%; display: block; }
.candidate-card__votes {
    position: absolute; left: .7rem; bottom: .7rem;
    padding: .18rem .65rem;
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    font-size: .8rem;
    font-weight: 700;
}
.candidate-card__body { display: flex; flex-direction: column; flex: 1; padding: .9rem 1rem 1rem; }
.candidate-card h3 { font-size: 1.04rem; line-height: 1.3; margin: 0; }
.candidate-card__meta { display: flex; flex-wrap: wrap; gap: .1rem .8rem; color: var(--ink-2); font-size: .84rem; margin: .25rem 0 .85rem; }
.candidate-card__meta i { color: var(--ink-3); margin-right: .25rem; }
.candidate-card .btn { margin-top: auto; }
/* The whole card opens the vote dialog; the button remains the keyboard target. */
.candidate-card .btn::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; }

/* Result cards on finished projects */
.candidate-card--leader { border-color: var(--sun); box-shadow: 0 0 0 2px var(--sun); }
.rank {
    position: absolute; top: .7rem; left: .7rem;
    min-width: 34px; height: 34px; padding: 0 .4rem;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}
.candidate-card--leader .rank { background: var(--sun); }
.bar { height: 7px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.result-line { display: flex; justify-content: space-between; align-items: baseline; font-size: .86rem; color: var(--ink-2); margin: .55rem 0 .35rem; }
.result-line strong { color: var(--ink); font-size: 1rem; }
.bar-cell { min-width: 150px; }
.bar-cell .bar { margin-top: .25rem; }

/* Countdown strip, overlapping the hero */
.vote-bar {
    position: relative;
    margin-top: -2.3rem;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem;
    padding: 1.1rem 1.4rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.vote-bar__label { font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: .3rem; }
.vote-bar__hint { color: var(--ink-2); font-size: .94rem; margin: 0; }
.vote-bar__hint i { color: var(--brand); margin-right: .35rem; }
.countdown { display: flex; gap: .5rem; }
.countdown__seg { min-width: 56px; padding: .3rem .3rem .35rem; border-radius: var(--radius-sm); background: var(--ink); color: #fff; text-align: center; }
.countdown__seg b { display: block; font-family: var(--font-display); font-size: 1.65rem; line-height: 1.05; font-variant-numeric: tabular-nums; }
.countdown__seg span { font-size: .63rem; letter-spacing: .08em; text-transform: uppercase; color: #cfc8bb; }

/* Vote dialog */
.vote-who { display: flex; align-items: center; gap: .85rem; margin-bottom: 1.05rem; }
.vote-who img { width: 62px; height: 62px; border-radius: 50%; object-fit: cover; object-position: center 20%; }
.vote-who strong { display: block; font-size: 1.05rem; line-height: 1.25; }
.vote-options { display: grid; gap: .5rem; }

/* Candidate profile */
.profile { display: grid; gap: 2rem; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; padding-top: 2.2rem; }
.profile__photo { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); display: block; }
.profile__name { font-family: var(--font-display); font-size: clamp(2.2rem, 5vw, 3.2rem); line-height: 1.04; text-transform: uppercase; margin: 0 0 .4rem; }
.profile__role { color: var(--brand); font-weight: 600; margin-bottom: 1.1rem; }
.stats { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.25rem; }
.stat-chip { padding: .45rem .85rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-size: .88rem; color: var(--ink-2); }
.stat-chip b { display: block; color: var(--ink); font-family: var(--font-display); font-size: 1.35rem; line-height: 1.1; }
.profile__story { color: var(--ink-2); margin-bottom: 1.4rem; }
.profile__cta { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.6rem; }
.share { padding-top: 1.1rem; border-top: 1px solid var(--line); }
.share__label { font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: .55rem; }
.share__links { display: flex; flex-wrap: wrap; gap: .45rem; }
.video-frame { position: relative; aspect-ratio: 16 / 9; margin-top: 2.2rem; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--ink); }
.video-frame iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

/* Empty state */
.empty { padding: 3rem 1.25rem; text-align: center; color: var(--ink-2); background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty i { display: block; font-size: 1.9rem; color: var(--line-strong); margin-bottom: .7rem; }
.empty strong { display: block; color: var(--ink); font-size: 1.05rem; }

/* ---------- Dashboard shell ---------- */
.shell { display: flex; min-height: 100vh; }
.side {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 1040;
    width: 244px;
    display: flex; flex-direction: column;
    background: var(--ink);
    color: #d9d2c5;
    overflow-y: auto;
    transition: transform .2s;
}
.side__brand { display: flex; align-items: center; gap: .65rem; padding: 1.05rem 1.15rem; color: #fff; }
.side__brand:hover { color: #fff; text-decoration: none; }
.side__brand img { height: 44px; width: 44px; object-fit: contain; border-radius: 9px; background: #fff; padding: 2px; }
.side__brand span { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.side__nav { list-style: none; margin: .4rem 0 1rem; padding: 0 .7rem; }
.side__nav a, .side__nav button {
    display: flex; align-items: center; gap: .7rem; width: 100%;
    padding: .55rem .7rem;
    margin-bottom: .15rem;
    border: 0; border-radius: 8px;
    background: none;
    color: #d9d2c5;
    font-size: .93rem;
    font-weight: 500;
    text-align: left;
    transition: background-color .15s, color .15s;
}
.side__nav a:hover, .side__nav button:hover { background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; }
.side__nav i.ico { width: 18px; text-align: center; color: #9f978a; }
.side__nav a.is-active { background: var(--brand); color: #fff; font-weight: 600; }
.side__nav a.is-active i.ico { color: #fff; }
.side__nav button .chev { margin-left: auto; font-size: .7rem; transition: transform .15s; }
.side__nav button[aria-expanded="true"] .chev { transform: rotate(180deg); }
.side__sub { list-style: none; margin: 0 0 .3rem; padding: 0 0 0 1.45rem; }
.side__sub a { font-size: .88rem; padding: .4rem .7rem; }
.shell__main { flex: 1; min-width: 0; margin-left: 244px; display: flex; flex-direction: column; }
.shell--guest .shell__main { margin-left: 0; }
.topbar {
    position: sticky; top: 0; z-index: 1020;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    min-height: 62px;
    padding: 0 1.6rem;
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--line);
}
.topbar .brand img { height: 44px; }
.topbar__menu { display: none; background: none; border: 1px solid var(--line-strong); border-radius: 8px; width: 40px; height: 40px; color: var(--ink); }
.topbar__spacer { flex: 1; }
.user-chip { display: inline-flex; align-items: center; gap: .55rem; background: none; border: 0; padding: .25rem; color: var(--ink); font-weight: 600; font-size: .92rem; }
.user-chip__avatar {
    width: 34px; height: 34px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 700;
}
.user-chip small { display: block; font-weight: 500; font-size: .74rem; color: var(--ink-3); text-transform: capitalize; line-height: 1.2; text-align: left; }
.user-chip__name { display: block; line-height: 1.25; text-align: left; }
.content { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 1.7rem 1.6rem 2.5rem; }
.side-scrim { display: none; position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1030; background: rgba(23, 20, 15, .5); border: 0; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .85rem; margin-bottom: 1.35rem; }
.page-head h1 { font-size: 1.6rem; line-height: 1.2; margin: 0; }
.page-head p { color: var(--ink-2); margin: .2rem 0 0; }
.back-link { display: inline-flex; align-items: center; gap: .4rem; color: var(--ink-2); font-size: .87rem; font-weight: 500; margin-bottom: .4rem; }
.back-link:hover { color: var(--ink); text-decoration: none; }
.form-narrow { max-width: 720px; }

.stat-grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 1.35rem; }
.stat-card { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.2rem 1.3rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.stat-card__label { color: var(--ink-2); font-size: .88rem; }
.stat-card__value { font-family: var(--font-display); font-size: 2.3rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-card__icon { width: 46px; height: 46px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; font-size: 1.1rem; background: var(--brand-soft); color: var(--brand); }
.stat-card__icon--sun { background: var(--sun-soft); color: var(--sun-ink); }
.stat-card__icon--leaf { background: var(--leaf-soft); color: var(--leaf); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { color: var(--ink); margin-bottom: 0; font-size: .92rem; }
table.table thead th {
    border-top: 0;
    border-bottom: 1px solid var(--line-strong) !important;
    background-color: transparent;
    color: var(--ink-3);
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
    padding: .6rem 1.4rem .6rem .75rem;
}
table.table td { border-top: 1px solid var(--line) !important; padding: .72rem .75rem; vertical-align: middle; }
table.table tbody tr:hover { background: #fdfbf7; }
table.dataTable.no-footer { border-bottom: 0; }
table.dataTable thead .sorting, table.dataTable thead .sorting_asc, table.dataTable thead .sorting_desc { background-image: none !important; }
table.dataTable thead .sorting::after, table.dataTable thead .sorting_asc::after, table.dataTable thead .sorting_desc::after {
    font-family: "Font Awesome 5 Free"; font-weight: 900; margin-left: .4rem; opacity: .35;
}
table.dataTable thead .sorting::after { content: "\f0dc"; }
table.dataTable thead .sorting_asc::after { content: "\f0de"; opacity: .9; }
table.dataTable thead .sorting_desc::after { content: "\f0dd"; opacity: .9; }
.cell-strong { font-weight: 600; }
.cell-clip { min-width: 220px; max-width: 320px; color: var(--ink-2); }
.thumb { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; object-position: center 20%; display: block; }
.thumb--wide { width: 72px; object-position: center; }
.nowrap { white-space: nowrap; }

/* DataTables controls */
.dataTables_wrapper .dt-buttons { margin-bottom: .85rem; }
.dataTables_wrapper .dt-button {
    margin: 0 .3rem 0 0 !important;
    padding: .28rem .7rem !important;
    border: 1px solid var(--line-strong) !important;
    border-radius: 7px !important;
    background: var(--surface) !important;
    color: var(--ink) !important;
    font-size: .8rem !important;
    font-weight: 600;
}
.dataTables_wrapper .dt-button:hover { border-color: var(--ink) !important; }
.dataTables_wrapper .dataTables_filter { margin-bottom: .85rem; color: var(--ink-2); font-size: .85rem; }
.dataTables_wrapper .dataTables_filter label { font-weight: 500; font-size: .85rem; color: var(--ink-2); }
.dataTables_wrapper .dataTables_filter input {
    margin-left: .45rem;
    padding: .32rem .65rem;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    background: var(--surface);
}
.dataTables_wrapper .dataTables_filter input:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(200, 22, 31, .13); }
.dataTables_wrapper .dataTables_info { color: var(--ink-3) !important; font-size: .83rem; padding-top: .95rem; }
.dataTables_wrapper .dataTables_paginate { padding-top: .75rem; font-size: .84rem; }
.dataTables_wrapper .dataTables_paginate .paginate_button { border-radius: 7px !important; border: 1px solid transparent !important; padding: .2rem .65rem !important; }
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover { background: var(--ink) !important; border-color: var(--ink) !important; color: #fff !important; }
.dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.disabled) { background: var(--paper) !important; border-color: var(--line-strong) !important; color: var(--ink) !important; }
table.dataTable td.dataTables_empty { padding: 2rem; color: var(--ink-3); }
.pagination { margin: 1rem 0 0; flex-wrap: wrap; }
.page-link { color: var(--ink); border-color: var(--line); }
.page-item.active .page-link { background: var(--ink); border-color: var(--ink); }

/* ---------- Checkout ---------- */
.checkout { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr) 310px; align-items: start; }
.field-label { display: block; font-weight: 700; font-size: .95rem; margin-bottom: .6rem; }
.plan { position: relative; display: block; margin: 0 0 .5rem; cursor: pointer; font-weight: 500; font-size: .95rem; }
.plan input { position: absolute; opacity: 0; }
.plan__box {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: .78rem 1rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.plan__box:hover { border-color: var(--ink); }
.plan__price { flex: none; font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; }
.plan input:checked + .plan__box { border-color: var(--brand); background: #fff9f9; box-shadow: 0 0 0 1px var(--brand); }
.plan input:focus-visible + .plan__box { outline: 3px solid rgba(200, 22, 31, .4); outline-offset: 2px; }
.summary { position: sticky; top: 80px; padding: 0; overflow: hidden; }
.summary__photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: center 20%; display: block; }
.summary__body { padding: 1.1rem 1.2rem 1.2rem; }
.summary__name { font-size: 1.12rem; margin: 0; }
.summary__total { margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.summary__amount { display: block; min-height: 2.2rem; font-family: var(--font-display); font-size: 1.85rem; font-weight: 700; line-height: 1.2; }
.message { margin: .75rem 0 0; font-size: .92rem; color: var(--leaf); }
.message.is-error { color: var(--brand); }
.notice-card { max-width: 560px; margin: 2rem auto; text-align: center; padding: 2.2rem 1.75rem; }
.notice-card__icon { width: 64px; height: 64px; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 1rem; border-radius: 50%; font-size: 1.6rem; background: var(--leaf-soft); color: var(--leaf); }
.notice-card__icon--wait { background: var(--sun-soft); color: var(--sun-ink); }
.detail-list { margin: 1.1rem 0; padding: 0; list-style: none; text-align: left; border-top: 1px solid var(--line); }
.detail-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.detail-list span { color: var(--ink-2); }
.detail-list b { text-align: right; }

/* ---------- Auth ---------- */
.auth { display: grid; min-height: 100vh; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.auth__art { position: relative; background: var(--ink) center 25% / cover no-repeat; }
.auth__art::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: linear-gradient(180deg, rgba(23, 20, 15, 0) 45%, rgba(23, 20, 15, .88) 100%); }
.auth__quote { position: absolute; z-index: 1; left: 2.5rem; right: 2.5rem; bottom: 2.4rem; color: #fff; }
.auth__quote h2 { color: #fff; font-family: var(--font-display); font-size: 3rem; line-height: 1; text-transform: uppercase; margin: 0 0 .4rem; }
.auth__quote p { color: #ece7dd; margin: 0; }
.auth__main { display: flex; flex-direction: column; background: var(--surface); }
.auth__form { flex: 1; display: flex; flex-direction: column; justify-content: center; width: 100%; max-width: 440px; margin: 0 auto; padding: 2.2rem 1.5rem; }
.auth__logo-link { align-self: flex-start; }
.auth__logo { height: 76px; width: auto; margin-bottom: 1.4rem; }
.auth__title { font-size: 1.65rem; margin: 0 0 .25rem; }
.auth__sub { color: var(--ink-2); margin-bottom: 1.5rem; }
.auth__row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: 1.15rem; font-size: .9rem; }
.auth__alt { margin: 1.3rem 0 0; text-align: center; color: var(--ink-2); font-size: .92rem; }
.auth__foot { margin: 0; padding: 0 1.5rem 1.2rem; text-align: center; color: var(--ink-3); font-size: .8rem; }
.form-grid { display: grid; gap: 0 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------- Error pages ---------- */
.error-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); }
.error-page__body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem 1.25rem; text-align: center; }
.error-page__code { font-family: var(--font-display); font-size: clamp(5rem, 16vw, 8.5rem); font-weight: 700; line-height: 1; color: var(--brand); }
.error-page h1 { font-size: 1.4rem; margin: .4rem 0 1.4rem; }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .side { transform: translateX(-100%); }
    body.nav-open .side { transform: none; }
    body.nav-open .side-scrim { display: block; }
    .shell__main { margin-left: 0; }
    .topbar__menu { display: inline-flex; align-items: center; justify-content: center; }
    .checkout, .profile { grid-template-columns: minmax(0, 1fr); }
    .summary { position: static; order: -1; }
    .summary__photo { display: none; }
    .auth { grid-template-columns: minmax(0, 1fr); }
    .auth__art { display: none; }
}
@media (max-width: 767.98px) {
    .site-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .site-links {
        display: none;
        position: absolute; left: 0; right: 0; top: 100%;
        flex-direction: column; align-items: stretch; gap: .1rem;
        padding: .6rem 1rem .9rem;
        background: var(--surface);
        border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow);
    }
    .site-links.is-open { display: flex; }
    .site-links .btn { display: block; }
    .hero__inner, .hero--home .hero__inner { padding-top: 3.2rem; padding-bottom: 4rem; }
    .vote-bar { flex-direction: column; align-items: flex-start; }
    .content { padding: 1.2rem 1rem 2rem; }
    .topbar { padding: 0 1rem; }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .section { padding-top: 2.4rem; }
    .grid--people { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
    .dataTables_wrapper .dataTables_filter { float: none; text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
