* { box-sizing: border-box; }
:root {
    color-scheme: dark light;
}
body {
    --bg: #f4f6f8;
    --text: #1f2933;
    --muted: #64748b;
    --panel-bg: #ffffff;
    --panel-border: #e2e8f0;
    --input-bg: #ffffff;
    --input-border: #cbd5e1;
    --button-bg: #155e75;
    --button-text: #ffffff;
    --sidebar-bg: #102a43;
    --sidebar-text: #d9e2ec;
    --sidebar-active: #1f4e5f;
    --topbar-text: #1f2933;
    transition: background-color .2s ease, color .2s ease;
}
body.dark-mode {
    --bg: #0f172a;
    --text: #f8fafc;
    --muted: #cbd5e1;
    --panel-bg: #172033;
    --panel-border: #334155;
    --input-bg: #111827;
    --input-border: #475569;
    --button-bg: #0891b2;
    --button-text: #ffffff;
    --sidebar-bg: #071923;
    --sidebar-text: #dbeafe;
    --sidebar-active: #155e75;
    --topbar-text: #f8fafc;
}
body.light-mode {
    --bg: #f4f6f8;
    --text: #1f2933;
    --muted: #64748b;
    --panel-bg: #ffffff;
    --panel-border: #e2e8f0;
    --input-bg: #ffffff;
    --input-border: #cbd5e1;
    --button-bg: #155e75;
    --button-text: #ffffff;
    --sidebar-bg: #102a43;
    --sidebar-text: #d9e2ec;
    --sidebar-active: #1f4e5f;
    --topbar-text: #1f2933;
}
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}
a { color: #155e75; text-decoration: none; }
button, .button {
    display: inline-block;
    border: 0;
    background: var(--button-bg);
    color: var(--button-text);
    padding: 10px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
}
.button.secondary { background: #64748b; }
input, select, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text);
}
input[type="date"] {
    cursor: pointer;
}
textarea { min-height: 90px; resize: vertical; }
label { display: grid; gap: 6px; font-weight: 700; color: var(--text); }
fieldset {
    border: 1px solid #d7dee8;
    border-radius: 8px;
    padding: 14px;
}
legend { font-weight: 700; }

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(rgba(4, 23, 31, .64), rgba(4, 23, 31, .74)), url("../img/login-bg.svg") center/cover no-repeat;
}
.login-card {
    width: min(92vw, 420px);
    display: grid;
    gap: 16px;
    padding: 30px;
    border-radius: 8px;
    background: var(--panel-bg);
    background: color-mix(in srgb, var(--panel-bg) 94%, transparent);
    box-shadow: 0 20px 55px rgba(0,0,0,.28);
}
.login-logo {
    width: min(260px, 78%);
    height: auto;
    justify-self: center;
    margin-bottom: 4px;
    filter: drop-shadow(0 0 16px rgba(255, 255, 255, .88)) drop-shadow(0 0 34px rgba(34, 211, 238, .42));
}
.login-card p { margin: 0; color: var(--muted); }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 230px;
    background: var(--sidebar-bg);
    color: #fff;
    padding: 20px 14px;
}
.brand {
    font-size: 20px;
    font-weight: 800;
    margin: 0 8px 20px;
}
.sidebar nav { display: grid; gap: 5px; }
.sidebar a {
    color: var(--sidebar-text);
    padding: 11px 12px;
    border-radius: 6px;
}
.sidebar a.active, .sidebar a:hover { background: var(--sidebar-active); color: #fff; }
.content { margin-left: 230px; padding: 24px; }
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    color: var(--topbar-text);
}
.topbar h1 { margin: 0; font-size: 28px; }
.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}
.theme-toggle {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, .38);
    background: rgba(255, 255, 255, .14);
    color: currentColor;
    font-size: 17px;
    line-height: 1;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .12);
    backdrop-filter: blur(8px);
}
.theme-toggle:hover {
    transform: translateY(-1px);
}
.theme-toggle-floating {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 5;
    color: #fff;
    background: rgba(2, 18, 26, .48);
    border-color: rgba(255, 255, 255, .28);
}

.panel, .card {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 18px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.grid { display: grid; gap: 14px; }
.cards { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.card span { color: var(--muted); display: block; margin-bottom: 8px; }
.card strong { font-size: 25px; }
.card small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-weight: 700;
}
.dashboard-block {
    display: grid;
    gap: 14px;
    margin-bottom: 22px;
}
.dashboard-title {
    padding: 2px 0;
}
.dashboard-title h2 {
    margin: 4px 0 4px;
    font-size: 24px;
}
.section-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(6, 182, 212, .12);
    color: #0891b2;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
}
body.dark-mode .section-kicker {
    background: rgba(103, 232, 249, .12);
    color: #67e8f9;
}
.dashboard-kpis {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.kpi-card {
    position: relative;
    overflow: hidden;
    min-height: 118px;
    padding: 18px 18px 16px;
    border-left: 0;
}
.kpi-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: var(--kpi-accent, #06b6d4);
}
.kpi-card::after {
    content: "";
    position: absolute;
    right: -34px;
    top: -34px;
    width: 108px;
    height: 108px;
    border-radius: 999px;
    background: rgba(6, 182, 212, .12);
    background: color-mix(in srgb, var(--kpi-accent, #06b6d4) 16%, transparent);
}
.kpi-card span,
.kpi-card strong,
.kpi-card small {
    position: relative;
    z-index: 1;
}
.kpi-card span {
    margin-bottom: 10px;
    font-weight: 800;
}
.kpi-card strong {
    display: block;
    font-size: clamp(26px, 2.2vw, 34px);
    line-height: 1;
}
.kpi-success { --kpi-accent: #22c55e; }
.kpi-warning { --kpi-accent: #f59e0b; }
.kpi-info { --kpi-accent: #06b6d4; }
.kpi-violet { --kpi-accent: #8b5cf6; }
.kpi-night { --kpi-accent: #64748b; }
.kpi-access { --kpi-accent: #10b981; }
.kpi-money { --kpi-accent: #14b8a6; }
.dashboard-section {
    display: grid;
    gap: 18px;
    margin: 26px 0;
}
.section-title {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
}
.section-title h2,
.chart-panel h3,
.panel h3 {
    margin: 0 0 6px;
}
.section-title p,
.chart-panel p {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}
.section-subhead {
    display: grid;
    gap: 3px;
    margin-top: 2px;
}
.section-subhead h3 {
    margin: 0;
    font-size: 18px;
}
.section-subhead p {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}
.analytics-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: end;
}
.analytics-filters label {
    min-width: 180px;
}
.dashboard-filters {
    align-items: center;
    padding: 14px;
    margin-bottom: 2px;
}
.dashboard-filters label {
    color: var(--muted);
    font-size: 13px;
}
.dashboard-filters input,
.dashboard-filters select {
    min-height: 42px;
}
.income-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0;
}
.income-tabs a {
    padding: 11px 16px;
    border-radius: 8px;
    border: 1px solid var(--panel-border);
    background: var(--panel);
    color: var(--muted);
    font-weight: 900;
    text-decoration: none;
    transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.income-tabs a.active,
.income-tabs a:hover {
    border-color: rgba(6, 182, 212, .55);
    background: rgba(6, 182, 212, .12);
    color: var(--text);
}
.income-summary-cards {
    margin-bottom: 20px;
}
.analytics-filters .hidden {
    display: none;
}
.analytics-cards {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.analytics-summary {
    gap: 12px;
}
.metric-card {
    min-height: 108px;
    border-left: 4px solid #06b6d4;
}
.metric-card strong {
    font-size: 28px;
}
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.chart-panel canvas {
    width: 100%;
    height: 360px !important;
    max-height: 360px;
}
.chart-panel {
    display: grid;
    gap: 14px;
    padding: 20px;
}
.chart-panel-wide canvas {
    height: 390px !important;
    max-height: 390px;
}
.chart-panel-compact canvas {
    height: 300px !important;
    max-height: 300px;
}
.income-chart-panel canvas {
    height: 380px !important;
    max-height: 380px;
}
.chart-heading {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: start;
}
.chart-heading h3 {
    margin: 0 0 5px;
}
.insight-panel {
    display: grid;
    gap: 12px;
}
.distribution-list,
.comparison-list {
    display: grid;
    gap: 10px;
}
.distribution-item,
.comparison-item {
    display: grid;
    gap: 4px;
    padding: 13px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: rgba(148, 163, 184, .08);
}
.distribution-item {
    border-left: 4px solid rgba(6, 182, 212, .8);
}
.distribution-item strong,
.comparison-item strong {
    font-size: 18px;
}
.distribution-item span,
.distribution-item small,
.comparison-context {
    color: var(--muted);
    font-weight: 700;
}
.comparison-context {
    margin: 0 0 4px;
}
.comparison-item {
    grid-template-columns: 1fr auto auto;
    align-items: center;
}
.comparison-item span {
    color: var(--muted);
    font-weight: 800;
}
.comparison-item em {
    justify-self: end;
    min-width: 78px;
    text-align: center;
    padding: 5px 8px;
    border-radius: 999px;
    font-style: normal;
    font-weight: 900;
}
.comparison-item.positive em {
    background: rgba(34, 197, 94, .16);
    color: #16a34a;
}
.comparison-item.negative em {
    background: rgba(245, 158, 11, .18);
    color: #d97706;
}
.expiring-panel {
    padding: 0;
    overflow: hidden;
}
.expiring-table th,
.expiring-table td {
    padding: 14px 16px;
}
.table-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 800;
    border-top: 1px solid var(--line);
}
.button.disabled,
.button.disabled:hover {
    opacity: .48;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.client-link {
    font-weight: 900;
}
.days-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(245, 158, 11, .16);
    color: #d97706;
    font-weight: 900;
}
body.dark-mode .days-chip {
    color: #fbbf24;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.form-grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; padding: 0; border: 0; }
.span-2 { grid-column: 1 / -1; }
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}
.report-card {
    display: grid;
    align-content: start;
    gap: 12px;
}
.report-card h2 {
    margin: 0;
    font-size: 20px;
}
.report-card p {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}
.report-card form {
    margin: 0;
}
.settings-admin-card,
.settings-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}
.settings-section {
    display: grid;
    align-items: stretch;
}
.settings-section-heading,
.settings-section > div:first-child {
    display: grid;
    gap: 4px;
}
.settings-admin-card h2,
.settings-admin-card p,
.settings-section h2,
.settings-section p,
.settings-section h3 {
    margin: 0;
}
.settings-admin-card p,
.settings-section p {
    color: var(--muted);
    font-weight: 700;
}
.settings-plan-table {
    margin-top: 10px;
}
.settings-plan-form {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--panel-border);
}
.settings-plan-form-title {
    display: grid;
    gap: 4px;
    padding-bottom: 2px;
}
.muted-line {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}
.day-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    padding: 12px;
    border: 1px solid var(--input-border);
    border-radius: 8px;
}
.day-checks legend {
    padding: 0 6px;
    font-weight: 900;
}
.day-checks label,
.checkbox-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
}
.plan-active-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    width: fit-content;
    padding: 12px 14px;
    border: 1px solid rgba(34, 197, 94, .34);
    border-radius: 8px;
    background: rgba(34, 197, 94, .08);
}
.plan-active-toggle input {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}
.plan-active-toggle span {
    display: grid;
    gap: 2px;
}
.plan-active-toggle small {
    color: var(--muted);
    font-weight: 700;
}
.current-photo-control {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: rgba(148, 163, 184, .08);
}
.current-photo-control img {
    width: 74px;
    height: 74px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--panel-border);
}
.inline-form {
    display: inline;
}
.link-button {
    border: 0;
    background: transparent;
    color: var(--primary);
    padding: 0;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}
.link-button:hover {
    text-decoration: underline;
}
.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}
.inline-search { display: flex; gap: 8px; width: min(520px, 100%); }
.filters {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
th, td {
    padding: 10px;
    border-bottom: 1px solid var(--panel-border);
    text-align: left;
    vertical-align: top;
}
th { background: rgba(148, 163, 184, .12); color: var(--muted); }
.zebra-table tbody tr:nth-child(even) {
    background: rgba(148, 163, 184, .07);
}
.zebra-table tbody tr {
    transition: background .18s ease, box-shadow .18s ease;
}
.zebra-table tbody tr:hover {
    background: rgba(6, 182, 212, .11);
    box-shadow: inset 3px 0 0 var(--primary);
}
body.light-mode .zebra-table tbody tr:nth-child(even) {
    background: rgba(15, 23, 42, .035);
}
body.light-mode .zebra-table tbody tr:hover {
    background: rgba(8, 145, 178, .09);
}
.client-name-link {
    color: var(--primary);
    font-weight: 900;
    text-decoration: none;
}
.client-name-link:hover {
    text-decoration: underline;
}
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}
.badge.activo { background: #dcfce7; color: #166534; }
.badge.inactivo { background: #fee2e2; color: #991b1b; }
.alert {
    padding: 12px 14px;
    border-radius: 6px;
    margin-bottom: 14px;
    font-weight: 700;
}
.alert.success { background: #dcfce7; color: #166534; }
.alert.error { background: #fee2e2; color: #991b1b; }
.client-head {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 18px;
}
.photo {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}
.client-profile-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 16px;
}
.client-summary {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 20px;
    align-items: start;
}
.client-photo-large,
.client-photo-placeholder {
    width: 170px;
    height: 170px;
    border-radius: 8px;
    border: 1px solid var(--panel-border);
}
.client-photo-large {
    object-fit: cover;
    display: block;
}
.client-photo-placeholder {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #155e75, #22c55e);
    color: #fff;
    font-size: 64px;
    font-weight: 900;
}
.client-summary-main h2 {
    margin: 8px 0 14px;
    font-size: 30px;
}
.client-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.client-meta-grid span,
.info-list div {
    display: grid;
    gap: 4px;
    padding: 12px;
    border-radius: 8px;
    background: rgba(148, 163, 184, .1);
    border: 1px solid var(--panel-border);
}
.client-meta-grid strong,
.info-list span {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .02em;
}
.client-notes {
    margin: 14px 0 0;
    padding: 12px;
    border-radius: 8px;
    background: rgba(245, 158, 11, .1);
    border: 1px solid rgba(245, 158, 11, .25);
}
.client-actions {
    justify-content: flex-start;
    margin: 16px 0 0;
}
.payment-client-summary {
    display: grid;
    gap: 4px;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid rgba(6, 182, 212, .35);
    background: rgba(6, 182, 212, .08);
}
.payment-client-summary span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}
.payment-client-summary strong {
    font-size: 24px;
    line-height: 1.15;
}
.payment-client-summary small {
    color: var(--muted);
    font-weight: 800;
}
.payment-focus {
    border-color: rgba(6, 182, 212, .5);
    background: rgba(6, 182, 212, .06);
}
.status-pill {
    display: inline-flex;
    width: fit-content;
    padding: 7px 12px;
    border-radius: 999px;
    font-weight: 900;
    color: #fff;
}
.status-active { background: #16a34a; }
.status-expired { background: #d97706; }
.status-inactive { background: #dc2626; }
.status-none { background: #64748b; }
.plan-status-card {
    display: grid;
    align-content: center;
    gap: 8px;
    color: #fff;
}
.plan-status-card span {
    opacity: .86;
    font-weight: 800;
}
.plan-status-card strong {
    font-size: 32px;
}
.plan-status-card p {
    margin: 0;
    font-weight: 800;
}
.plan-status-card.status-active { background: linear-gradient(135deg, #15803d, #16a34a); }
.plan-status-card.status-expired { background: linear-gradient(135deg, #92400e, #d97706); }
.plan-status-card.status-inactive { background: linear-gradient(135deg, #991b1b, #dc2626); }
.plan-status-card.status-none { background: linear-gradient(135deg, #334155, #64748b); }
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.info-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.info-list strong {
    line-height: 1.3;
}
.badge-summary {
    display: grid;
    gap: 12px;
}
.badge-summary .level-pill {
    font-size: 16px;
}
.badge-summary strong {
    font-size: 22px;
}
.badge-summary p {
    margin: 0;
    color: var(--muted);
    font-weight: 800;
}
.client-progress {
    height: 18px;
}

.kiosk, .page-access.dark-mode {
    background: #061821;
}
.page-access.light-mode {
    --topbar-text: #ffffff;
    background: #e9eef3;
}
body.page-access {
    overflow: hidden;
}
.page-access .content {
    height: 100vh;
    min-height: 100vh;
    padding: 18px;
    overflow: hidden;
}
.page-access .topbar {
    position: relative;
    z-index: 1;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .5);
}
.main-kiosk {
    padding: 0;
    max-width: none;
    margin: 0;
}
.access-screen {
    position: relative;
    display: grid;
    gap: 18px;
    height: calc(100vh - 110px);
    min-height: 560px;
    place-items: center;
    padding: 42px;
    overflow: hidden;
}
.access-screen::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        linear-gradient(90deg, rgba(2, 18, 26, .82), rgba(2, 18, 26, .38), rgba(2, 18, 26, .86)),
        var(--access-bg, none) center/cover no-repeat;
}
body.light-mode .access-screen::before {
    background:
        linear-gradient(90deg, rgba(2, 18, 26, .54), rgba(2, 18, 26, .18), rgba(2, 18, 26, .62)),
        var(--access-bg, none) center/cover no-repeat;
}
.access-screen::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, .22), transparent 32%);
    pointer-events: none;
}
body.light-mode .access-screen::after {
    background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, .34), transparent 34%);
}
.access-screen > * {
    position: relative;
    z-index: 1;
}
.access-form {
    display: grid;
    gap: 16px;
    width: min(880px, 92vw);
    padding: 0;
    border-radius: 0;
    background: transparent;
    transition: opacity .25s ease, transform .25s ease;
}
.access-form.is-hidden-while-greeting {
    display: none;
}
.access-form h1 {
    margin: 0 0 14px;
    font-size: 52px;
    text-align: center;
    color: #fff;
    text-shadow: 0 3px 18px rgba(0, 0, 0, .55);
}
.access-logo {
    width: min(360px, 72vw);
    height: auto;
    justify-self: center;
    margin-bottom: 18px;
    filter: drop-shadow(0 0 18px rgba(255, 255, 255, .95)) drop-shadow(0 0 42px rgba(34, 211, 238, .55));
    animation: accessLogoBreath 3.4s ease-in-out infinite;
    transform-origin: center;
}
.access-form input {
    font-size: 34px;
    text-align: center;
    padding: 22px;
    border: 2px solid rgba(255, 255, 255, .76);
    border-radius: 8px;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    box-shadow: 0 0 34px rgba(255, 255, 255, .18);
}
body.light-mode .access-form input {
    background: rgba(255, 255, 255, .2);
    border-color: rgba(255, 255, 255, .86);
    color: #fff;
}
.access-form input::placeholder {
    color: rgba(255, 255, 255, .82);
}
.access-form button {
    font-size: 25px;
    padding: 20px 22px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(16, 185, 129, .96), rgba(8, 145, 178, .96));
    border: 1px solid rgba(255, 255, 255, .26);
    box-shadow: 0 18px 40px rgba(6, 182, 212, .22), 0 16px 36px rgba(0, 0, 0, .32);
    letter-spacing: .01em;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.access-form button:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
    box-shadow: 0 22px 48px rgba(16, 185, 129, .28), 0 18px 40px rgba(0, 0, 0, .34);
}
.access-form button:active {
    transform: translateY(1px) scale(.995);
}
body.light-mode .access-form button {
    background: linear-gradient(135deg, rgba(5, 150, 105, .96), rgba(14, 116, 144, .96));
}
@keyframes accessLogoBreath {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.07); }
}
.access-result {
    display: grid;
    gap: 10px;
    text-align: center;
    border-radius: 8px;
    padding: 24px 30px;
    color: #fff;
}
.access-result strong { font-size: 34px; line-height: 1.1; }
.access-result span { font-size: 24px; font-weight: 900; }
.access-result small { font-size: 17px; font-weight: 800; color: rgba(255, 255, 255, .86); }
.access-result.allowed { background: #15803d; }
.access-result.denied {
    width: min(720px, 92vw);
    margin-top: -18px;
    background: linear-gradient(135deg, rgba(78, 19, 8, .88), rgba(180, 83, 9, .82));
    border: 1px solid rgba(251, 191, 36, .62);
    box-shadow: 0 0 34px rgba(251, 146, 60, .28), 0 24px 54px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .14);
    backdrop-filter: blur(10px);
}
.access-status-pill {
    justify-self: start;
    width: fit-content;
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 17px;
    line-height: 1;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .45);
}
.access-status-pill.allowed {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    border: 1px solid rgba(187, 247, 208, .72);
    box-shadow: 0 0 28px rgba(34, 197, 94, .58), inset 0 1px 0 rgba(255, 255, 255, .28);
}
.access-status-pill.denied {
    justify-self: center;
    background: linear-gradient(135deg, #b91c1c, #f97316);
    border: 1px solid rgba(254, 202, 202, .62);
    box-shadow: 0 0 26px rgba(248, 113, 113, .42), inset 0 1px 0 rgba(255, 255, 255, .24);
}
.access-result .access-status-pill {
    justify-self: center;
    font-size: 17px;
}
.access-result .access-result-name {
    color: #67e8f9;
    text-shadow: 0 0 22px rgba(103, 232, 249, .82), 0 4px 18px rgba(0, 0, 0, .62);
}
.access-result-icon {
    justify-self: center;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 999px;
    background: rgba(251, 191, 36, .96);
    color: #431407;
    font-size: 34px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 0 26px rgba(251, 191, 36, .62);
}
.access-greeting {
    display: grid;
    grid-template-columns: minmax(560px, 56%) minmax(430px, 44%);
    gap: 18px;
    align-items: center;
    width: min(1320px, 96vw);
    min-height: 640px;
    padding: 14px 36px;
    border-radius: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .65s ease, transform .65s ease, filter .65s ease;
}
body.light-mode .access-greeting {
    color: #fff;
}
.access-greeting.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.access-greeting.is-leaving {
    opacity: 0;
    transform: translateY(-16px) scale(.985);
    filter: blur(2px);
}
.greeting-media {
    position: relative;
    min-height: 650px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    overflow: visible;
    background: transparent;
    transform: translateX(-24px);
}
.greeting-media::before {
    content: "";
    position: absolute;
    inset: 3%;
    border-radius: 999px;
    background: rgba(255, 255, 255, .78);
    filter: blur(76px);
    z-index: -1;
}
.greeting-media img {
    width: 100%;
    height: 100%;
    max-height: 690px;
    object-fit: contain;
    display: block;
    transform: scale(1.24);
    transform-origin: center bottom;
    filter: drop-shadow(0 34px 54px rgba(0, 0, 0, .46));
}
.greeting-placeholder {
    width: 100%;
    min-height: 420px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #155e75, #15803d);
    color: #fff;
    font-size: 34px;
    font-weight: 800;
    text-align: center;
    padding: 24px;
}
.greeting-copy {
    position: relative;
    display: grid;
    gap: 20px;
    color: #fff;
    max-width: 560px;
    text-shadow: 0 4px 22px rgba(0, 0, 0, .86), 0 0 2px rgba(0, 0, 0, .7);
}
.greeting-copy::before {
    content: "";
    position: absolute;
    inset: -36px -34px;
    z-index: -1;
    background: radial-gradient(circle at 38% 45%, rgba(0, 0, 0, .52), rgba(0, 0, 0, .2) 48%, transparent 72%);
    filter: blur(10px);
}
.greeting-copy p {
    margin: 0;
    font-size: 56px;
    line-height: 1.05;
    font-weight: 900;
    color: #fff;
    letter-spacing: 0;
}
.client-name-highlight {
    color: #67e8f9;
    text-shadow: 0 0 22px rgba(103, 232, 249, .85), 0 4px 22px rgba(0, 0, 0, .82);
}
.celebration-name-highlight {
    font-size: 1.12em;
    color: #86efac;
    text-shadow: 0 0 24px rgba(134, 239, 172, .9), 0 4px 22px rgba(0, 0, 0, .82);
}
.greeting-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.greeting-stats strong {
    padding: 13px 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .22);
    color: #fff;
    backdrop-filter: blur(6px);
    font-size: 16px;
}
.level-card {
    display: grid;
    gap: 13px;
    width: min(100%, 560px);
    padding: 20px;
    border: 1px solid rgba(103, 232, 249, .44);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(3, 18, 26, .82), rgba(6, 45, 58, .56));
    box-shadow: 0 0 32px rgba(103, 232, 249, .2), 0 24px 55px rgba(0, 0, 0, .36), inset 0 1px 0 rgba(255, 255, 255, .16);
    backdrop-filter: blur(10px);
}
body.light-mode .level-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, .78), rgba(224, 242, 254, .54));
    border-color: rgba(8, 145, 178, .48);
    color: #0f172a;
    box-shadow: 0 0 34px rgba(8, 145, 178, .18), 0 24px 55px rgba(0, 0, 0, .2), inset 0 1px 0 rgba(255, 255, 255, .38);
}
body.light-mode .attendance-total,
body.light-mode .progress-text {
    color: #0f172a;
    text-shadow: none;
}
body.light-mode .progress-track {
    background: rgba(15, 23, 42, .16);
    border-color: rgba(15, 23, 42, .18);
}
.level-pill {
    width: fit-content;
    padding: 10px 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(34, 197, 94, .95), rgba(6, 182, 212, .95));
    color: #fff;
    font-weight: 900;
    font-size: 21px;
    line-height: 1;
    box-shadow: 0 0 28px rgba(34, 211, 238, .58), inset 0 1px 0 rgba(255, 255, 255, .28);
    text-shadow: 0 2px 10px rgba(0, 0, 0, .5);
}
.attendance-total {
    color: #fff;
    font-weight: 900;
    font-size: 20px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .72);
}
.progress-track {
    position: relative;
    height: 26px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(2, 12, 18, .84);
    border: 1px solid rgba(255, 255, 255, .32);
    box-shadow: inset 0 3px 10px rgba(0, 0, 0, .55), 0 0 22px rgba(103, 232, 249, .18);
    transition: transform .36s ease, box-shadow .36s ease;
}
.progress-track::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .72), transparent);
    opacity: 0;
    transform: translateX(-120%);
    pointer-events: none;
}
.progress-track.is-progressing {
    transform: scale(1.035);
    box-shadow: inset 0 3px 10px rgba(0, 0, 0, .48), 0 0 32px rgba(103, 232, 249, .46);
}
.progress-track.is-progressing::after {
    animation: progressFlash 1s ease forwards;
}
.progress-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #22c55e, #06b6d4, #67e8f9);
    box-shadow: 0 0 26px rgba(34, 211, 238, .9);
    transition: width 1.2s cubic-bezier(.2, .8, .2, 1);
}
.progress-text {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 14px;
    color: #fff;
    font-size: 16px;
    font-weight: 900;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .65);
}
.badge-celebration {
    display: grid;
    place-items: center;
    gap: 28px;
    width: min(980px, 94vw);
    min-height: min(720px, calc(100vh - 120px));
    text-align: center;
    color: #fff;
    opacity: 0;
    transform: translateY(14px) scale(.98);
    transition: opacity .65s ease, transform .65s ease, filter .65s ease;
}
body.light-mode .badge-celebration {
    color: #fff;
}
.badge-celebration.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.badge-celebration.is-leaving {
    opacity: 0;
    transform: translateY(-16px) scale(.985);
    filter: blur(2px);
}
.celebration-copy {
    display: grid;
    gap: 16px;
    max-width: 860px;
    text-shadow: 0 5px 24px rgba(0, 0, 0, .82), 0 0 2px rgba(0, 0, 0, .75);
}
.celebration-copy .access-status-pill {
    justify-self: center;
}
.celebration-kicker {
    justify-self: center;
    padding: 9px 15px;
    border-radius: 999px;
    background: rgba(251, 191, 36, .18);
    border: 1px solid rgba(253, 224, 71, .58);
    color: #fde68a;
    font-size: 16px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0;
}
.celebration-copy h1 {
    margin: 6px 0 0;
    font-size: clamp(42px, 6.4vw, 76px);
    line-height: 1;
    color: #fff7c2;
}
.celebration-copy p {
    margin: 0;
    font-size: clamp(20px, 2.1vw, 28px);
    line-height: 1.34;
    font-weight: 900;
}
.celebration-message {
    display: grid;
    gap: 8px;
    justify-items: center;
}
.celebration-message-line {
    display: block;
}
.celebration-badge-wrap {
    position: relative;
    display: grid;
    place-items: center;
    width: min(390px, 72vw);
    aspect-ratio: 1;
    margin: 4px 0 0;
}
.golden-rays {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background:
        repeating-conic-gradient(from 0deg, rgba(253, 224, 71, .95) 0deg 9deg, transparent 9deg 18deg),
        radial-gradient(circle, rgba(251, 191, 36, .58) 0 22%, rgba(250, 204, 21, .22) 42%, transparent 68%);
    filter: blur(.3px) drop-shadow(0 0 30px rgba(250, 204, 21, .62));
    opacity: .82;
    animation: goldenSpin 7s linear infinite;
}
.celebration-badge {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 68%;
    filter: drop-shadow(0 24px 36px rgba(0, 0, 0, .48)) drop-shadow(0 0 28px rgba(253, 224, 71, .78));
    animation: badgePop .95s cubic-bezier(.18, .9, .2, 1.25) both;
}
.celebration-badge img {
    display: block;
    width: 100%;
    height: auto;
}
.celebration-badge strong {
    position: absolute;
    left: 50%;
    top: 48%;
    transform: translate(-50%, -50%);
    min-width: 42%;
    color: #fff7c2;
    font-size: clamp(54px, 9vw, 102px);
    line-height: 1;
    font-weight: 900;
    text-align: center;
    text-shadow: 0 4px 8px rgba(67, 20, 7, .7), 0 0 18px rgba(255, 247, 194, .68);
}
.celebration-level {
    display: grid;
    gap: 6px;
    padding: 15px 22px;
    border-radius: 8px;
    background: rgba(3, 18, 26, .62);
    border: 1px solid rgba(253, 224, 71, .48);
    box-shadow: 0 18px 42px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(255, 255, 255, .15);
    backdrop-filter: blur(8px);
    text-shadow: 0 3px 16px rgba(0, 0, 0, .62);
}
body.light-mode .celebration-level {
    background: rgba(255, 255, 255, .22);
    border-color: rgba(253, 224, 71, .68);
}
.celebration-level strong {
    color: #fde68a;
    font-size: clamp(25px, 3.4vw, 38px);
    line-height: 1;
}
.celebration-level span {
    color: #fff;
    font-size: clamp(17px, 2.3vw, 24px);
    font-weight: 900;
}
.celebration-level em {
    color: #fde68a;
    font-size: clamp(14px, 1.7vw, 18px);
    font-style: normal;
    font-weight: 900;
    opacity: .95;
}
.kiosk .access-greeting {
    min-height: calc(100vh - 84px);
}
.kiosk .access-screen {
    height: 100vh;
    min-height: 100vh;
}
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; }

@keyframes greetingFadeIn {
    to { opacity: 1; transform: translateY(0); }
}

@keyframes greetingFadeOut {
    to { opacity: 0; transform: translateY(-10px); }
}

@keyframes progressFlash {
    0% { opacity: 0; transform: translateX(-120%); }
    25% { opacity: .8; }
    100% { opacity: 0; transform: translateX(120%); }
}

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

@keyframes badgePop {
    0% { opacity: 0; transform: scale(.72) rotate(-5deg); }
    68% { opacity: 1; transform: scale(1.08) rotate(2deg); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

@media (min-width: 1600px) {
    .access-greeting {
        width: min(1500px, 96vw);
        grid-template-columns: minmax(680px, 58%) minmax(480px, 42%);
    }
    .greeting-media {
        min-height: 740px;
    }
    .greeting-media img {
        max-height: 780px;
        transform: scale(1.28);
    }
    .greeting-copy p {
        font-size: 64px;
    }
}

@media (max-height: 820px) and (min-width: 1000px) {
    .access-screen {
        padding-top: 18px;
        padding-bottom: 18px;
    }
    .access-greeting {
        min-height: 600px;
        grid-template-columns: minmax(540px, 57%) minmax(390px, 43%);
        padding: 6px 30px;
    }
    .greeting-media {
        min-height: 610px;
    }
    .greeting-media img {
        max-height: 650px;
        transform: scale(1.28);
    }
    .greeting-copy {
        max-width: 520px;
    }
    .greeting-copy p {
        font-size: 46px;
    }
    .level-card {
        padding: 15px;
        gap: 9px;
    }
    .level-pill {
        font-size: 17px;
    }
    .attendance-total {
        font-size: 16px;
    }
    .progress-track {
        height: 20px;
    }
    .progress-text {
        font-size: 13px;
    }
    .badge-celebration {
        min-height: calc(100vh - 92px);
        gap: 16px;
    }
    .celebration-copy {
        gap: 12px;
    }
    .celebration-badge-wrap {
        width: min(310px, 54vh);
    }
    .celebration-copy h1 {
        font-size: 52px;
    }
    .celebration-copy p {
        font-size: 20px;
    }
}

@media (max-width: 1180px) {
    .analytics-grid {
        grid-template-columns: 1fr;
    }
    .chart-panel canvas,
    .chart-panel-wide canvas {
        height: 340px !important;
        max-height: 340px;
    }
}

@media (max-width: 760px) {
    .sidebar { position: static; width: auto; }
    .content { margin-left: 0; padding: 16px; }
    .topbar, .actions { align-items: stretch; flex-direction: column; }
    .form-grid, .form-grid.compact, .filters { grid-template-columns: 1fr; }
    .dashboard-kpis,
    .analytics-cards,
    .analytics-grid { grid-template-columns: 1fr; }
    .comparison-item { grid-template-columns: 1fr; }
    .analytics-filters { display: grid; }
    .analytics-filters label { min-width: 0; }
    .dashboard-title h2 { font-size: 21px; }
    .kpi-card { min-height: 104px; }
    .chart-panel { padding: 16px; }
    .chart-panel canvas,
    .chart-panel-wide canvas {
        height: 300px !important;
        max-height: 300px;
    }
    .client-head { grid-template-columns: 1fr; }
    .client-profile-grid,
    .client-summary,
    .detail-grid,
    .info-list,
    .client-meta-grid {
        grid-template-columns: 1fr;
    }
    .client-photo-large,
    .client-photo-placeholder {
        width: 140px;
        height: 140px;
    }
    .access-greeting { grid-template-columns: 1fr; min-height: auto; padding: 18px; }
    .greeting-media, .greeting-media img, .greeting-placeholder { min-height: 260px; }
    .greeting-copy h2 { font-size: 32px; }
    .greeting-copy p { font-size: 22px; }
    .level-card { width: 100%; }
    .badge-celebration {
        min-height: auto;
        padding: 18px;
    }
    .celebration-badge-wrap {
        width: min(300px, 78vw);
    }
    table { display: block; overflow-x: auto; }
}
