:root {
    color-scheme: light;
    --bg: #ffffff;
    --surface: rgba(255, 255, 255, .94);
    --panel: #ffffff;
    --panel-strong: #f7fafc;
    --ink: #0e2438;
    --muted: #64748b;
    --line: #e5edf5;
    --brand: #ff8b00;
    --brand-dark: #e67d00;
    --blue: rgb(14, 60, 105);
    --topbar: rgb(14, 60, 105);
    --soft: #f1f5f9;
    --shadow: 0 18px 44px rgba(14, 60, 105, .12);
    --shadow-soft: 0 10px 28px rgba(14, 60, 105, .08);
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0d1117;
    --surface: rgba(22, 27, 34, .86);
    --panel: #161b22;
    --panel-strong: #1f2630;
    --ink: #f4f7fb;
    --muted: #a5b1c3;
    --line: #2b3442;
    --topbar: #090c11;
    --blue: #7fb4e8;
    --soft: #222b37;
    --shadow: 0 18px 44px rgba(0, 0, 0, .32);
    --shadow-soft: 0 10px 28px rgba(0, 0, 0, .22);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(255, 139, 0, .12), transparent 28rem),
        radial-gradient(circle at top right, rgba(14, 60, 105, .10), transparent 26rem),
        var(--bg);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
}

a {
    color: inherit;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px clamp(16px, 4vw, 44px);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    background: color-mix(in srgb, var(--topbar) 94%, transparent);
    color: #fff;
    backdrop-filter: blur(16px);
}

.internal-topbar {
    justify-content: flex-end;
}

.topbar-user {
    margin-right: auto;
    font-weight: 900;
}

.topbar-user span {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    border-radius: 999px;
    padding: 8px 13px;
    background: rgba(255, 255, 255, .10);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    margin-right: auto;
    font-weight: 900;
    text-decoration: none;
}

.brand span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-logo {
    width: 58px;
    height: 58px;
    flex: 0 0 auto;
    object-fit: contain;
    border-radius: 0;
    background: transparent;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    padding: 8px 13px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, .15);
}

.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    cursor: pointer;
}

.icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.topbar nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.topbar nav a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: 999px;
    padding: 9px 12px;
    color: #fff;
    font-size: 14px;
    text-decoration: none;
}

.topbar nav a:hover {
    background: rgba(255, 255, 255, .12);
}

.container {
    width: min(1380px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 48px;
}

.container:has(.app-shell) {
    width: 100%;
    padding: 0;
}

.public-form {
    max-width: 960px;
    margin: 42px auto;
    padding: clamp(22px, 4vw, 38px);
    border-color: rgba(14, 60, 105, .14);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(255, 255, 255, .92)),
        radial-gradient(circle at top right, rgba(255, 139, 0, .12), transparent 18rem);
    box-shadow: 0 26px 70px rgba(14, 60, 105, .12);
}

.public-form h1 {
    color: var(--blue);
}

.public-form form:not(.event-switch) {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.event-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 18px 0;
}

.event-meta span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 12px;
    background: var(--panel-strong);
    color: var(--blue);
    font-size: 13px;
    font-weight: 800;
}

.event-details {
    display: grid;
    gap: 12px;
    margin: 18px 0;
}

.event-details section {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px;
    background: var(--panel-strong);
}

.event-details h2 {
    margin-bottom: 6px;
    color: var(--blue);
    font-size: 16px;
}

.event-details p {
    margin: 0;
    color: var(--muted);
}

.success-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 12px;
    margin: 22px 0;
}

.success-summary div {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px;
    background: var(--panel-strong);
}

.success-summary span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.success-summary strong {
    display: block;
    margin-top: 6px;
    color: var(--blue);
}

.qr-ticket {
    display: grid;
    justify-items: start;
    gap: 12px;
    margin: 22px 0;
}

.qr-ticket img {
    width: min(360px, 100%);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px;
    background: #fff;
}

.qr-pass-preview {
    box-shadow: var(--shadow-soft);
}

.scanner-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr);
    gap: 16px;
    align-items: start;
}

.scanner-grid.single {
    grid-template-columns: minmax(0, 760px);
}

.scanner-box {
    display: grid;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px;
    background: var(--panel);
}

.scanner-box video {
    width: 100%;
    min-height: 280px;
    border-radius: 14px;
    background: #111827;
    object-fit: cover;
}

.attendance-reader {
    display: grid;
    gap: 14px;
    max-width: 760px;
    margin-top: 16px;
}

.attendance-reader input {
    min-height: 58px;
    border-width: 2px;
    font-size: 18px;
    font-weight: 800;
    text-transform: uppercase;
}

.detected-folio {
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    background: var(--panel-strong);
    color: var(--blue);
    font-weight: 900;
}

.attendance-results {
    display: grid;
    gap: 8px;
}

.attendance-result {
    display: grid;
    gap: 4px;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px;
    background: var(--panel-strong);
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.attendance-result:hover {
    border-color: var(--brand);
    box-shadow: var(--shadow-soft);
}

.attendance-result strong {
    color: var(--blue);
}

.attendance-result span,
.attendance-result small {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.hero,
.page-head,
.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
}

.hero {
    padding: 34px 0;
}

.hero.compact {
    padding-bottom: 16px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--brand);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .1em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 8px;
    font-size: clamp(32px, 4.8vw, 58px);
    line-height: 1.02;
}

h2 {
    margin-bottom: 16px;
    font-size: 23px;
}

h3 {
    margin: 22px 0 8px;
    font-size: 16px;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 13px;
}

.form-panel,
.panel {
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 22px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(16px);
}

.public-form {
    border-radius: 24px;
}

.app-shell {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 0;
    align-items: start;
    min-height: calc(100vh - 71px);
}

.sidebar {
    position: sticky;
    top: 71px;
    display: grid;
    align-content: start;
    gap: 8px;
    min-height: calc(100vh - 71px);
    border: 0;
    border-right: 1px solid rgba(14, 60, 105, .12);
    border-radius: 0;
    padding: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(247, 250, 252, .96)),
        radial-gradient(circle at top left, rgba(255, 139, 0, .10), transparent 16rem);
    color: var(--ink);
    box-shadow: var(--shadow);
}

:root[data-theme="dark"] .sidebar {
    background: linear-gradient(180deg, #161b22, #111821);
    border-color: var(--line);
}

.sidebar-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 22px;
}

.sidebar-brand {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.sidebar-brand strong {
    display: block;
    color: var(--ink);
    font-size: 15px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.sidebar-logo {
    width: 92px;
    height: 92px;
    object-fit: contain;
    background: transparent;
}

.sidebar-label {
    margin: 0;
    color: var(--blue);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.sidebar-close {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--soft);
    color: var(--ink);
    cursor: pointer;
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 14px;
    padding: 13px 14px;
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
}

.sidebar a.is-active {
    background: linear-gradient(135deg, var(--blue), color-mix(in srgb, var(--blue) 72%, var(--brand)));
    color: #fff;
    box-shadow: 0 12px 26px rgba(14, 60, 105, .18);
}

.sidebar a:hover {
    background: linear-gradient(135deg, rgba(255, 139, 0, .14), rgba(14, 60, 105, .08));
    color: var(--blue);
    transform: translateX(2px);
}

.app-content {
    display: grid;
    gap: 18px;
    min-width: 0;
    overflow: hidden;
    padding: 22px clamp(16px, 2.4vw, 32px) 42px;
}

[data-view].is-hidden {
    display: none !important;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.stat-card {
    position: relative;
    overflow: hidden;
    min-width: 0;
    min-height: 142px;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 18px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .98), var(--panel)),
        radial-gradient(circle at top right, rgba(255, 139, 0, .14), transparent 10rem);
    box-shadow: var(--shadow);
}

.stat-card > .icon {
    width: 24px;
    height: 24px;
    margin-bottom: 16px;
    color: var(--brand);
}

.stat-card::after {
    content: "";
    position: absolute;
    right: -34px;
    bottom: -34px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--brand) 18%, transparent);
}

.stat-card em {
    position: absolute;
    top: 16px;
    right: 16px;
    color: color-mix(in srgb, var(--muted) 60%, transparent);
    font-style: normal;
    font-weight: 900;
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
}

.stat-card strong {
    display: block;
    margin: 12px 0 6px;
    color: var(--blue);
    font-size: 40px;
    line-height: 1;
}

.stat-card small {
    color: var(--muted);
}

.performance-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.metric-panel {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
    background: var(--panel);
    box-shadow: var(--shadow-soft);
}

.metric-panel div:first-child {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.metric-panel span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
}

.metric-panel strong {
    color: var(--blue);
    font-size: 28px;
}

.metric-panel p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.progress {
    height: 10px;
    margin-top: 14px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--soft);
}

.progress i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--blue), var(--brand));
}

.bar-list {
    display: grid;
    gap: 14px;
}

.bar-row {
    display: grid;
    gap: 7px;
}

.bar-row div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 13px;
}

.bar-row i {
    display: block;
    height: 11px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--blue), var(--brand));
}

.grid {
    display: grid;
    gap: 16px;
}

.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr);
    align-items: start;
    margin-bottom: 22px;
}

label {
    display: grid;
    gap: 7px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    background: var(--panel);
    color: var(--ink);
    font: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: 4px solid rgba(255, 139, 0, .16);
    border-color: var(--brand);
}

textarea {
    resize: vertical;
    line-height: 1.45;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox input {
    width: 18px;
    min-height: 18px;
}

body.modal-open {
    overflow: hidden;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 0;
    border-radius: 14px;
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--brand), #ffad3d);
    color: #fff;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 12px 22px rgba(255, 139, 0, .24);
}

.button:hover {
    filter: brightness(.96);
}

.button.secondary {
    border: 1px solid var(--line);
    background: rgba(14, 60, 105, .08);
    color: var(--blue);
    box-shadow: none;
}

.button.secondary:hover {
    background: color-mix(in srgb, var(--soft) 82%, var(--brand));
}

.form-panel .button {
    margin-top: 18px;
}

.login-panel {
    max-width: 460px;
}

.settings-logo {
    max-width: 110px;
    max-height: 70px;
    margin-left: 8px;
    vertical-align: middle;
    object-fit: contain;
}

.logo-settings {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: end;
}

.logo-preview {
    display: grid;
    gap: 8px;
    min-width: 150px;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px;
    background: var(--panel-strong);
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.alert {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px 16px;
    font-weight: 800;
}

.flash-overlay {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 23, 42, .45);
    backdrop-filter: blur(6px);
}

.flash-modal {
    width: min(460px, 100%);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 18px;
    background: var(--panel);
    box-shadow: 0 28px 80px rgba(14, 60, 105, .26);
}

.flash-modal .alert {
    margin: 0;
    border-radius: 16px;
}

.flash-close {
    width: 100%;
    min-height: 42px;
    margin-top: 14px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--brand), #ffad3d);
    color: #fff;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(8px);
}

.loading-card {
    display: grid;
    justify-items: center;
    gap: 12px;
    width: min(420px, 100%);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 24px;
    background: var(--panel);
    box-shadow: 0 30px 90px rgba(14, 60, 105, .28);
    text-align: center;
}

.loading-card strong {
    color: var(--blue);
    font-size: 18px;
}

.loading-card p {
    margin: 0;
    color: var(--muted);
}

.loading-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid color-mix(in srgb, var(--brand) 22%, transparent);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.alert.success {
    background: color-mix(in srgb, #1f8f46 14%, var(--panel));
    color: color-mix(in srgb, #1f8f46 78%, var(--ink));
}

.alert.error {
    background: color-mix(in srgb, #b4232b 14%, var(--panel));
    color: color-mix(in srgb, #b4232b 82%, var(--ink));
}

.event-switch {
    display: grid;
    gap: 8px;
    max-width: 560px;
    margin-bottom: 18px;
}

.event-switch.panel {
    max-width: none;
    margin-bottom: 0;
}

.event-list {
    display: grid;
    gap: 10px;
}

.event-list a {
    display: grid;
    gap: 3px;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 13px;
    background: var(--panel-strong);
    text-decoration: none;
}

.event-list a.active {
    border-color: var(--brand);
    box-shadow: inset 4px 0 0 var(--brand), var(--shadow-soft);
}

.event-list span {
    color: var(--muted);
    font-size: 13px;
}

.event-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 16px;
    margin-top: 18px;
}

.event-card {
    display: grid;
    gap: 16px;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
    background: var(--panel);
    box-shadow: var(--shadow-soft);
}

.event-card.active {
    border-color: var(--brand);
    box-shadow: inset 4px 0 0 var(--brand), var(--shadow-soft);
}

.event-card h3 {
    margin: 12px 0 6px;
    color: var(--blue);
    font-size: 20px;
}

.event-card p {
    margin: 0;
    color: var(--muted);
    font-weight: 800;
}

.event-card dl {
    display: grid;
    gap: 10px;
    margin: 0;
}

.event-card dl div {
    display: grid;
    gap: 2px;
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

.event-card dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.event-card dd {
    margin: 0;
    color: var(--ink);
    overflow-wrap: anywhere;
}

.date-list-field {
    display: grid;
    gap: 10px;
}

.date-list {
    display: grid;
    gap: 8px;
}

.date-list-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    padding: 22px;
    background: rgba(15, 23, 42, .52);
    backdrop-filter: blur(8px);
}

.modal-backdrop[hidden] {
    display: none;
}

.modal-card {
    width: min(560px, 100%);
    max-height: min(88vh, 860px);
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 22px;
    background: var(--panel);
    box-shadow: 0 30px 90px rgba(14, 60, 105, .28);
}

.modal-card.large {
    width: min(980px, 100%);
}

.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.modal-head h2 {
    margin-bottom: 0;
}

.modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--soft);
    color: var(--ink);
    cursor: pointer;
}

.modal-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-top: 18px;
}

.actions,
.search,
.filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.search {
    margin-bottom: 16px;
}

.search input {
    max-width: 360px;
}

.filters {
    align-items: end;
    margin-bottom: 16px;
}

.filters label {
    min-width: min(180px, 100%);
    flex: 1 1 180px;
}

.filters button,
.filters .button {
    margin-top: 0;
}

.table-wrap {
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 18px;
}

.users-table {
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 860px;
    background: var(--panel);
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 13px 12px;
    text-align: left;
    vertical-align: top;
}

tr:last-child td {
    border-bottom: 0;
}

th {
    background: var(--panel-strong);
    color: var(--muted);
    font-size: 12px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.row-actions {
    white-space: nowrap;
}

.status-actions {
    white-space: nowrap;
    vertical-align: middle;
}

.status-actions > * {
    vertical-align: middle;
}

.status-actions > * + * {
    margin-left: 8px;
}

.status-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.document-actions {
    display: grid;
    gap: 10px;
}

.document-actions .button {
    width: 100%;
}

.status-button:hover .status-pill {
    box-shadow: var(--shadow-soft);
    transform: translateY(-1px);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.detail-grid div {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px;
    background: var(--panel-strong);
}

.detail-grid span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.detail-grid strong {
    display: block;
    margin-top: 5px;
    overflow-wrap: anywhere;
}

.edit-registration-form {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.status-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--soft);
    color: var(--ink);
    cursor: pointer;
}

.icon-button.active {
    background: rgba(16, 185, 129, .14);
    color: #059669;
}

.icon-button.inactive {
    background: rgba(148, 163, 184, .18);
    color: var(--muted);
}

.icon-button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

.mini-button {
    display: inline-flex;
    align-items: center;
    border: 0;
    min-height: 32px;
    border-radius: 8px;
    padding: 7px 10px;
    background: var(--brand);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
}

.mini-button.secondary {
    border: 1px solid var(--line);
    background: var(--soft);
    color: var(--ink);
}

.status-pill,
.sent-note {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 900;
}

.hidden {
    display: none !important;
}

.status-pill.pagado {
    background: rgba(16, 185, 129, .14);
    color: #059669;
}

.status-pill.pendiente {
    background: rgba(255, 139, 0, .16);
    color: #c56c00;
}

.status-pill.exento,
.status-pill.asistio {
    background: rgba(14, 60, 105, .12);
    color: var(--blue);
}

.status-pill.no_asistio {
    background: rgba(180, 35, 43, .14);
    color: #b4232b;
}

.sent-note {
    margin-top: 6px;
    background: rgba(14, 60, 105, .08);
    color: var(--blue);
}

@media (max-width: 1100px) {
    .stats-grid,
    .performance-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .app-shell {
        grid-template-columns: 240px minmax(0, 1fr);
    }
}

@media (max-width: 860px) {
    .topbar {
        align-items: center;
        flex-wrap: wrap;
    }

    .menu-toggle {
        display: inline-flex;
    }

    .topbar nav {
        display: none;
        width: 100%;
        padding-top: 8px;
        justify-content: flex-start;
    }

    .topbar nav.is-open {
        display: grid;
        grid-template-columns: 1fr;
    }

    .topbar nav a {
        border-radius: 8px;
        background: rgba(255, 255, 255, .08);
    }

    .hero,
    .page-head,
    .section-head {
        display: grid;
        align-items: start;
    }

    .two,
    .three,
    .admin-grid,
    .scanner-grid,
    .app-shell,
    .stats-grid,
    .performance-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 40;
        width: min(86vw, 320px);
        min-height: 100vh;
        padding: 18px;
        border-radius: 0;
        transform: translateX(-105%);
        transition: transform .28s ease;
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    body.sidebar-open::after {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 30;
        background: rgba(0, 0, 0, .42);
    }

    .sidebar-close {
        display: inline-flex;
    }

    .filters label,
    .filters .button,
    .filters button {
        width: 100%;
        flex: 1 1 100%;
    }
}

@media (max-width: 560px) {
    .container {
        width: min(100% - 20px, 1380px);
        padding-top: 18px;
    }

    .container:has(.app-shell) {
        width: 100%;
        padding-top: 0;
    }

    .form-panel,
    .panel,
    .stat-card,
    .metric-panel {
        padding: 16px;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .brand span {
        max-width: 180px;
    }

    h1 {
        font-size: 32px;
    }
}
