* { 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;
}
[hidden] {
    display: none !important;
}
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%);
    aspect-ratio: 1;
    object-fit: contain;
    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); }
/* Contraste del botón de login (antes blanco sobre teal claro, ratio ~2.5) */
.login-card button { background: #0f766e; background-image: none; color: #fff; }
.login-card button:hover { background: #0b5e57; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 230px;
    background: var(--sidebar-bg);
    color: #fff;
    padding: 20px 14px;
}
.brand {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 8px 22px;
    min-height: 92px;
}
.brand img {
    width: min(150px, 100%);
    aspect-ratio: 1;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 0 10px rgba(34, 211, 238, .28));
}
.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(150px, 1fr));
    gap: 10px;
}
.kpi-card {
    position: relative;
    overflow: hidden;
    min-height: 108px;
    padding: 15px 15px 13px;
    border-left: 0;
}
.kpi-card.has-tooltip {
    overflow: visible;
    cursor: help;
}
.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: 94px;
    height: 94px;
    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: 9px;
    font-weight: 800;
    font-size: 15px;
}
.kpi-card strong {
    display: block;
    font-size: clamp(24px, 1.8vw, 31px);
    line-height: 1;
}
.kpi-card small {
    font-size: 13px;
    line-height: 1.2;
}
.kpi-card.is-clickable {
    cursor: pointer;
}
.kpi-card.is-clickable:hover,
.kpi-card.is-clickable:focus-visible {
    border-color: color-mix(in srgb, var(--kpi-accent, var(--primary)) 55%, var(--panel-border));
    box-shadow: 0 18px 45px rgba(2, 132, 199, .16);
    transform: translateY(-1px);
}
.kpi-card.is-clickable:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--kpi-accent, var(--primary)) 34%, transparent);
    outline-offset: 2px;
}
.plan-drawer-total span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}
.plan-drawer {
    position: fixed;
    inset: 0;
    z-index: 90;
    pointer-events: none;
    visibility: hidden;
}
.plan-drawer.is-open {
    pointer-events: auto;
    visibility: visible;
}
.plan-drawer-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(2, 6, 23, .58);
    opacity: 0;
    cursor: pointer;
    transition: opacity .18s ease;
}
.plan-drawer.is-open .plan-drawer-backdrop {
    opacity: 1;
}
.plan-drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(520px, calc(100vw - 18px));
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 22px;
    border-left: 1px solid var(--panel-border);
    background: var(--panel-bg);
    box-shadow: -24px 0 70px rgba(2, 6, 23, .28);
    transform: translateX(100%);
    transition: transform .2s ease;
}
.plan-drawer.is-open .plan-drawer-panel {
    transform: translateX(0);
}
.plan-drawer-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: color-mix(in srgb, #22c55e 8%, transparent);
}
.plan-drawer-total strong {
    color: var(--text);
    font-size: 26px;
    line-height: 1;
}
body.plan-drawer-open {
    overflow: hidden;
}
.plan-breakdown-heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}
.plan-breakdown-heading h3 {
    margin: 0;
    font-size: 19px;
}
.plan-breakdown-heading p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}
.plan-breakdown-heading > strong {
    min-width: 70px;
    padding: 7px 12px;
    border-radius: 999px;
    background: color-mix(in srgb, #22c55e 14%, transparent);
    color: var(--text);
    font-size: 22px;
    line-height: 1;
    text-align: center;
}
.plan-breakdown-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px 14px;
    overflow: auto;
    padding-right: 4px;
}
.plan-drawer-panel .plan-breakdown-list {
    flex: 1;
    min-height: 0;
}
.plan-breakdown-row {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) auto auto;
    gap: 8px 10px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: color-mix(in srgb, var(--panel-bg) 96%, transparent);
    font-weight: 800;
}
.plan-breakdown-row span {
    color: var(--text);
    min-width: 0;
}
.plan-breakdown-row b {
    color: var(--text);
    font-size: 18px;
}
.plan-breakdown-row em {
    min-width: 42px;
    padding: 4px 7px;
    border-radius: 999px;
    background: color-mix(in srgb, #22c55e 14%, transparent);
    color: var(--text);
    font-size: 13px;
    font-style: normal;
    text-align: center;
}
.plan-breakdown-row i {
    grid-column: 1 / -1;
    height: 7px;
    border-radius: 999px;
    background: rgba(148, 163, 184, .22);
    overflow: hidden;
}
.plan-breakdown-row i::before {
    content: "";
    display: block;
    width: var(--bar-width, 0%);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #22c55e, #06b6d4);
}
.kpi-tooltip {
    position: absolute;
    left: 0;
    top: calc(100% + 12px);
    z-index: 30;
    width: min(430px, 82vw);
    padding: 18px;
    border-radius: 8px;
    border: 1px solid color-mix(in srgb, var(--kpi-accent, #22c55e) 38%, var(--panel-border));
    background: color-mix(in srgb, var(--panel-bg) 96%, transparent);
    box-shadow: 0 24px 60px rgba(15, 23, 42, .22);
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}
body.dark-mode .kpi-tooltip {
    background: rgba(15, 23, 42, .96);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .48);
}
.kpi-card.has-tooltip:hover .kpi-tooltip,
.kpi-card.has-tooltip:focus-within .kpi-tooltip,
.kpi-card.has-tooltip:focus .kpi-tooltip {
    opacity: 1;
    transform: translateY(0);
}
.kpi-tooltip > strong {
    display: block;
    color: var(--text);
    font-size: 19px;
    line-height: 1.1;
    margin-bottom: 4px;
}
.kpi-tooltip p {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}
.kpi-tooltip-list {
    display: grid;
    gap: 11px;
}
.kpi-tooltip-row {
    display: grid;
    grid-template-columns: minmax(110px, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    font-size: 14px;
    font-weight: 800;
}
.kpi-tooltip-row span {
    margin: 0;
    color: var(--text);
}
.kpi-tooltip-row b {
    font-size: 19px;
    color: var(--text);
}
.kpi-tooltip-row em {
    min-width: 44px;
    padding: 4px 7px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--kpi-accent, #22c55e) 14%, transparent);
    color: var(--text);
    font-style: normal;
    text-align: center;
}
.kpi-tooltip-row i {
    grid-column: 1 / -1;
    height: 8px;
    border-radius: 999px;
    background: rgba(148, 163, 184, .22);
    overflow: hidden;
}
.kpi-tooltip-row i::before {
    content: "";
    display: block;
    width: var(--bar-width, 0%);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--kpi-accent, #22c55e), #06b6d4);
}
.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; }
.kpi-income { --kpi-accent: #f59e0b; }
.kpi-renewal { --kpi-accent: #06b6d4; }
.kpi-addons { --kpi-accent: #8b5cf6; }
.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;
    position: relative;
}
.chart-html-tooltip {
    position: absolute;
    z-index: 20;
    min-width: 210px;
    padding: 13px 15px;
    border: 1px solid rgba(148, 163, 184, .34);
    border-radius: 8px;
    background: rgba(255, 255, 255, .96);
    color: #1f2933;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .18);
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, calc(-100% - 12px));
    transition: opacity .12s ease;
    font-size: 15px;
    line-height: 1.35;
}
body.dark-mode .chart-html-tooltip {
    background: rgba(2, 6, 23, .95);
    color: #f8fafc;
    border-color: rgba(203, 213, 225, .22);
    box-shadow: 0 18px 42px rgba(0, 0, 0, .44);
}
.chart-html-tooltip-title {
    margin-bottom: 8px;
    font-weight: 900;
}
.chart-html-tooltip-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    white-space: nowrap;
}
.chart-html-tooltip-row strong {
    font-weight: 900;
}
.chart-html-tooltip-swatch {
    width: 13px;
    height: 13px;
    flex: 0 0 13px;
    border-radius: 2px;
}
.chart-html-tooltip-extra {
    padding-left: 21px;
}
.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;
}
.panel-tabs {
    display: inline-flex;
    gap: 6px;
    padding: 5px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: rgba(148, 163, 184, .08);
}
.panel-tabs button {
    min-height: 34px;
    padding: 7px 12px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
    box-shadow: none;
}
.panel-tabs button.active,
.panel-tabs button:hover {
    background: rgba(6, 182, 212, .14);
    color: var(--text);
    transform: none;
}
.attendance-heading-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}
.today-access-detail {
    display: grid;
    gap: 14px;
}
.today-access-detail[hidden] {
    display: none;
}
.today-access-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}
.today-access-detail-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: rgba(148, 163, 184, .06);
}
.today-access-summary small,
.today-access-detail-heading span,
.today-access-detail-heading small {
    color: var(--muted);
    font-weight: 900;
}
.today-access-detail-heading span {
    color: var(--text);
}
.today-access-count {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid var(--panel-border);
    background: rgba(255, 255, 255, .72);
    white-space: nowrap;
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
}
.today-access-count b {
    color: var(--text);
    font-size: 19px;
}
.today-access-count.is-allowed {
    border-color: rgba(16, 185, 129, .24);
    background: rgba(16, 185, 129, .1);
}
.today-access-count.is-denied {
    border-color: rgba(239, 68, 68, .24);
    background: rgba(239, 68, 68, .1);
}
.today-access-table-frame {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
}
.today-access-table th,
.today-access-table td {
    padding: 8px 12px;
    white-space: nowrap;
    font-size: 13px;
}
.today-access-table .level-pill.compact-level-pill {
    padding: 5px 9px;
    font-size: 12px;
    line-height: 1;
    box-shadow: 0 0 12px rgba(34, 211, 238, .22), inset 0 1px 0 rgba(255, 255, 255, .22);
    text-shadow: none;
}
.today-access-table tr.is-denied-access {
    background: rgba(239, 68, 68, .045);
}
.access-state-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}
.access-state-pill.is-allowed {
    background: rgba(16, 185, 129, .14);
    color: #047857;
}
.access-state-pill.is-denied {
    background: rgba(239, 68, 68, .14);
    color: #b91c1c;
}
.today-access-pagination {
    padding: 10px 0 0;
    border-top: 0;
}
.today-access-pagination .button {
    min-height: 34px;
    padding: 7px 11px;
    font-size: 12px;
}
.today-access-pagination .button:disabled {
    opacity: .48;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.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-x: auto;
}
.expiring-table th,
.expiring-table td {
    padding: 14px 16px;
    white-space: nowrap;
}
.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;
}
.renewal-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 112px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}
.renewal-status-warning {
    background: rgba(245, 158, 11, .17);
    color: #92400e;
}
.renewal-status-danger {
    background: rgba(239, 68, 68, .16);
    color: #991b1b;
}
body.dark-mode .renewal-status-warning {
    background: rgba(245, 158, 11, .2);
    color: #fbbf24;
}
body.dark-mode .renewal-status-danger {
    background: rgba(239, 68, 68, .22);
    color: #fecaca;
}
.compact-button {
    padding: 7px 10px;
    font-size: 12px;
}
.table-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.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-actions {
    display: flex;
    justify-content: flex-start;
}
.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-filter {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    margin-top: 4px;
}
.settings-plan-filter label {
    width: min(520px, 100%);
}
.settings-plan-filter label span,
.settings-plan-filter strong {
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
}
.settings-plan-filter input {
    min-height: 42px;
}
.settings-plan-table {
    margin: 0;
    min-width: 1200px;
}
.settings-plan-table-frame {
    max-height: 520px;
    margin-top: 10px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in srgb, var(--panel-bg) 72%, var(--bg));
}
.settings-plan-table-frame .settings-plan-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f6f8fa;
}
body.dark-mode .settings-plan-table-frame .settings-plan-table thead th {
    background: #172033;
}
.plan-schedule-summary {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: max-content;
    max-width: 100%;
    font-weight: 900;
    white-space: nowrap;
}
.plan-schedule-info-icon {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border: 1px solid rgba(6, 182, 212, .36);
    border-radius: 999px;
    background: rgba(6, 182, 212, .12);
    color: #047f94;
    font-size: 12px;
    font-style: normal;
    line-height: 1;
}
.plan-schedule-tooltip {
    position: absolute;
    left: 0;
    top: calc(100% + 10px);
    z-index: 20;
    display: grid;
    gap: 5px;
    width: max-content;
    max-width: min(520px, 72vw);
    padding: 10px 12px;
    border: 1px solid rgba(15, 23, 42, .16);
    border-radius: 8px;
    background: #0f172a;
    color: #f8fafc;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .22);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.45;
    white-space: normal;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity .16s ease, transform .16s ease;
}
.plan-schedule-tooltip span {
    display: block;
}
.plan-schedule-summary:hover .plan-schedule-tooltip,
.plan-schedule-summary:focus .plan-schedule-tooltip,
.plan-schedule-summary:focus-within .plan-schedule-tooltip {
    opacity: 1;
    transform: translateY(0);
}
body.dark-mode .plan-schedule-tooltip {
    border-color: rgba(148, 163, 184, .28);
    background: #020617;
}
.settings-plan-table-frame::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
.settings-plan-table-frame::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(8, 145, 178, .48);
    background-clip: padding-box;
}
.settings-plan-table-frame::-webkit-scrollbar-track {
    background: transparent;
}
.plan-order-actions {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.icon-button {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    min-width: 0;
    padding: 0;
    border-radius: 8px;
    background: rgba(6, 182, 212, .1);
    color: #047f94;
    border: 1px solid rgba(6, 182, 212, .24);
    box-shadow: none;
    font-size: 15px;
    line-height: 1;
}
.icon-button:hover {
    transform: none;
    background: rgba(6, 182, 212, .18);
    box-shadow: none;
}
.icon-button:disabled {
    opacity: .38;
    cursor: not-allowed;
}
.settings-plan-form {
    margin: 0;
    padding: 0;
    border: 0;
}
.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;
}
.settings-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.settings-modal.is-open {
    display: flex;
}
.settings-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, .68);
    backdrop-filter: blur(5px);
}
.settings-modal-card {
    position: relative;
    width: min(820px, 100%);
    max-height: min(86vh, 760px);
    overflow: auto;
    padding: 24px;
    border: 1px solid rgba(148, 163, 184, .45);
    border-radius: 8px;
    background: #172033;
    color: #f8fafc;
    box-shadow: 0 28px 90px rgba(2, 6, 23, .58);
}
body.light-mode .settings-modal-card {
    background: #ffffff;
    color: #1f2933;
    border-color: #cbd5e1;
    box-shadow: 0 28px 90px rgba(15, 23, 42, .28);
}
.settings-modal-card input,
.settings-modal-card select,
.settings-modal-card textarea {
    background: var(--input-bg);
    color: var(--text);
}
.plan-time-ranges {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
}
.plan-time-range-list {
    display: grid;
    gap: 10px;
    margin-bottom: 10px;
}
.plan-time-range-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
}
.custom-access-rules {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--input-border);
    border-radius: 8px;
}
.custom-access-rules-grid {
    display: grid;
    gap: 10px;
}
.custom-access-rule-row {
    display: grid;
    grid-template-columns: minmax(150px, .7fr) minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
}
.custom-access-rule-day,
.custom-day-range-list {
    display: grid;
    gap: 8px;
}
.custom-day-range-row {
    display: grid;
    grid-template-columns: minmax(105px, 1fr) minmax(105px, 1fr) auto;
    gap: 10px;
    align-items: end;
}
.custom-access-rule-row label {
    min-width: 0;
}
@media (max-width: 680px) {
    .plan-time-range-row,
    .custom-access-rule-row,
    .custom-day-range-row {
        grid-template-columns: 1fr;
    }
}
.settings-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    border: 0;
    background: rgba(148, 163, 184, .14);
    color: var(--text);
    font-size: 24px;
    font-weight: 900;
    line-height: 1;
    text-decoration: none;
    padding: 0;
    cursor: pointer;
}
.settings-modal-close:hover {
    background: rgba(6, 182, 212, .16);
}
.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;
}

/* Professional plan configuration modal. */
.settings-modal {
    padding: clamp(12px, 3vw, 28px);
}

.settings-modal-card {
    width: min(900px, 100%);
    max-height: min(86vh, 760px);
    overflow: hidden;
    padding: 0;
    border: 1px solid rgba(203, 213, 225, .9);
    border-radius: 14px;
    background: #ffffff;
    color: #1f2933;
    box-shadow: 0 24px 80px rgba(15, 23, 42, .28);
}

body.dark-mode .settings-modal-card,
body.light-mode .settings-modal-card {
    background: #ffffff;
    color: #1f2933;
    border-color: rgba(203, 213, 225, .9);
    box-shadow: 0 24px 80px rgba(15, 23, 42, .28);
}

.settings-modal-card .settings-plan-form {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 0;
    max-height: min(86vh, 760px);
    margin: 0;
    padding: 0;
    border: 0;
}

.settings-plan-form-title {
    gap: 4px;
    padding: 18px 64px 14px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
}

.settings-plan-form-title h3 {
    margin: 0;
    color: #0f172a;
    font-size: 22px;
}

.settings-plan-form-title p {
    max-width: 660px;
    margin: 0;
    color: #64748b;
    font-size: 14px;
}

.settings-plan-form-body {
    display: grid;
    gap: 12px;
    min-height: 0;
    overflow-y: auto;
    padding: 14px 24px 16px;
    background: #ffffff;
    scrollbar-width: thin;
    scrollbar-color: rgba(8, 145, 178, .42) transparent;
}

.settings-plan-form-body::-webkit-scrollbar {
    width: 10px;
}

.settings-plan-form-body::-webkit-scrollbar-thumb {
    border: 3px solid #ffffff;
    border-radius: 999px;
    background: rgba(8, 145, 178, .42);
    background-clip: padding-box;
}

.settings-plan-card {
    display: grid;
    gap: 10px;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}

.settings-plan-card h4 {
    margin: 0;
    color: #0f172a;
    font-size: 13px;
    font-weight: 850;
}

.settings-plan-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
    align-items: start;
}

.settings-plan-card-grid > .span-2 {
    grid-column: 1 / -1;
}

.settings-plan-card-grid > label {
    align-content: start;
    min-height: 74px;
}

.settings-plan-card-grid > label:not(:has(small)) {
    min-height: 58px;
}

.settings-plan-form label,
.settings-plan-form legend {
    color: #475569;
    font-size: 13px;
    font-weight: 750;
}

.settings-plan-form small {
    color: #64748b;
    font-size: 12px;
    font-weight: 500;
}

.settings-modal-card input,
.settings-modal-card select,
.settings-modal-card textarea {
    height: 40px;
    min-height: 40px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #ffffff;
    color: #1f2933;
    box-shadow: 0 1px 0 rgba(15, 23, 42, .02);
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.settings-modal-card select {
    appearance: auto;
}

.settings-modal-card input:focus,
.settings-modal-card select:focus,
.settings-modal-card textarea:focus {
    outline: 0;
    border-color: #0891b2;
    box-shadow: 0 0 0 3px rgba(8, 145, 178, .15);
}

.settings-modal-card input::placeholder {
    color: #94a3b8;
}

.plan-code-field input {
    border-color: #e2e8f0;
    background: #eef2f7;
    color: #64748b;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    cursor: default;
}

.plan-code-field input:focus {
    border-color: #cbd5e1;
    box-shadow: none;
}

.settings-modal-close {
    top: 18px;
    right: 20px;
    z-index: 3;
    width: 38px;
    height: 38px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #334155;
    font-size: 24px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .08);
    transition: background-color .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.settings-modal-close:hover {
    transform: translateY(-1px);
    border-color: rgba(8, 145, 178, .24);
    background: #ecfeff;
    box-shadow: 0 12px 26px rgba(8, 145, 178, .14);
}

.settings-plan-form-footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 24px;
    border-top: 1px solid #e2e8f0;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 -14px 30px rgba(15, 23, 42, .07);
    backdrop-filter: blur(10px);
}

.settings-plan-form-footer button,
.settings-plan-form-footer .button {
    min-height: 42px;
    min-width: 128px;
    border-radius: 9px;
    padding: 10px 16px;
}

.settings-plan-form-footer .button.secondary {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
}

.settings-plan-form-footer button[type="submit"] {
    background: var(--button-bg);
    color: var(--button-text);
    box-shadow: 0 12px 24px rgba(21, 94, 117, .22);
}

.settings-plan-form .plan-time-ranges,
.settings-plan-form .day-checks,
.settings-plan-form .custom-access-rules {
    border-color: #dbe4ef;
    background: #ffffff;
}

.settings-plan-form .custom-access-rules {
    gap: 8px;
    padding: 10px 12px 12px;
}

.settings-plan-form .custom-access-rules legend {
    padding: 0 6px;
}

.settings-plan-form .custom-access-rules-grid {
    gap: 6px;
}

.settings-plan-form .custom-access-rule-row {
    grid-template-columns: minmax(150px, .7fr) minmax(0, 1fr) auto;
    gap: 8px;
    align-items: start;
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.settings-plan-form .custom-access-rule-day,
.settings-plan-form .custom-day-range-list {
    display: grid;
    gap: 6px;
}

.settings-plan-form .custom-day-range-row {
    display: grid;
    grid-template-columns: minmax(96px, 1fr) minmax(96px, 1fr) auto;
    gap: 8px;
    align-items: end;
}

.settings-plan-form .custom-access-rule-row label {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 0;
    margin: 0;
    font-size: 12px;
}

.settings-plan-form .custom-access-rule-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-height: 16px;
}

.settings-plan-form .custom-access-rule-row input[type="time"] {
    height: 34px;
    min-height: 34px;
    padding: 6px 8px;
}

@media (max-width: 680px) {
    .settings-plan-form .custom-access-rule-row,
    .settings-plan-form .custom-day-range-row {
        grid-template-columns: 1fr;
    }
}

.settings-plan-inline-error {
    padding: 12px 14px;
    border: 1px solid rgba(220, 38, 38, .32);
    border-radius: 8px;
    background: #fff1f2;
    color: #9f1239;
}

.settings-plan-inline-error strong {
    display: block;
    margin-bottom: 6px;
    color: #9f1239;
    font-size: 15px;
}

.settings-plan-inline-error ul {
    display: grid;
    gap: 4px;
    margin: 0;
    padding-left: 18px;
    font-weight: 800;
}

.settings-plan-form .is-invalid-group {
    border-color: rgba(220, 38, 38, .55) !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .12);
}

.settings-plan-form .custom-access-rule-row.is-invalid-group {
    background: #fff7f7;
}

body.dark-mode .settings-plan-inline-error {
    border-color: rgba(251, 113, 133, .42);
    background: rgba(127, 29, 29, .22);
    color: #fecdd3;
}

body.dark-mode .settings-plan-inline-error strong {
    color: #fecdd3;
}

.settings-plan-form .plan-active-toggle {
    width: 100%;
    border-color: rgba(8, 145, 178, .22);
    background: #ffffff;
}

@media (max-width: 680px) {
    .settings-modal {
        align-items: stretch;
        padding: 10px;
    }

    .settings-modal-card,
    .settings-modal-card .settings-plan-form {
        max-height: calc(100vh - 20px);
    }

    .settings-plan-form-title {
        padding: 20px 58px 16px 18px;
    }

    .settings-plan-form-body {
        padding: 14px 16px 18px;
    }

    .settings-plan-card {
        padding: 14px;
    }

    .settings-plan-card-grid {
        grid-template-columns: 1fr;
    }

    .settings-plan-form-footer {
        padding: 12px 16px;
        flex-direction: column-reverse;
    }

    .settings-plan-form-footer button,
    .settings-plan-form-footer .button {
        width: 100%;
    }
}
.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;
}
.danger-link {
    color: #dc2626;
}
.disabled-action {
    color: var(--muted);
    font-weight: 900;
    opacity: .55;
    cursor: not-allowed;
}
.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%); }
.clients-filter-form {
    width: min(780px, 100%);
}
.clients-filter-form select {
    max-width: 230px;
}
.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; }
.alert.warning { background: #fef3c7; color: #92400e; }
.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-wrap {
    display: grid;
    gap: 10px;
    align-content: 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-mini-badge {
    width: 170px;
    display: grid;
    gap: 3px;
    padding: 10px 11px;
    border: 1px solid rgba(6, 182, 212, .32);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(20, 184, 166, .16), rgba(6, 182, 212, .08));
    color: var(--text);
}
.client-mini-badge span {
    color: #0f766e;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}
.client-mini-badge strong {
    font-size: 16px;
    line-height: 1.1;
}
.client-mini-badge small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}
body.dark-mode .client-mini-badge span {
    color: #67e8f9;
}
.client-level-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-left: auto;
    min-height: 31px;
    max-width: 100%;
    padding: 6px 10px;
    border: 1px solid rgba(6, 182, 212, .32);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(20, 184, 166, .16), rgba(6, 182, 212, .08));
    color: var(--text);
    line-height: 1;
    white-space: nowrap;
}
.client-level-pill span,
.client-level-pill small {
    color: #0f766e;
    font-size: 11px;
    font-weight: 900;
}
.client-level-pill span {
    text-transform: uppercase;
}
.client-level-pill strong {
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
}
.client-level-pill small {
    color: var(--muted);
    font-weight: 800;
}
body.dark-mode .client-level-pill span {
    color: #67e8f9;
}
.client-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 14px;
}
.client-summary-main h2 {
    margin: 0;
    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-notes summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    font-weight: 900;
    list-style: none;
}
.client-notes summary::-webkit-details-marker {
    display: none;
}
.client-notes summary em {
    flex: 0 0 auto;
    color: #0f766e;
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
    text-transform: uppercase;
}
.client-notes p {
    margin: 10px 0 0;
    font-weight: 700;
}
.client-sport-card {
    display: grid;
    gap: 14px;
    margin-top: 14px;
    padding: 16px;
    border: 1px solid rgba(8, 145, 178, .18);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(8, 145, 178, .06), rgba(148, 163, 184, .07));
}
.client-sport-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}
.client-sport-photo {
    width: 58px;
    height: 58px;
    overflow: hidden;
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    background: rgba(8, 145, 178, .12);
}
.client-sport-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.client-sport-photo span {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: #0f766e;
    font-size: 24px;
    font-weight: 900;
}
.client-sport-head h3 {
    margin: 4px 0 3px;
    font-size: 18px;
}
.client-sport-head p {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}
.client-routine-status {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(100, 116, 139, .12);
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}
.client-routine-status.pending {
    background: rgba(245, 158, 11, .16);
    color: #b45309;
}
.client-routine-status.clear {
    background: rgba(34, 197, 94, .13);
    color: #047857;
}
body.dark-mode .client-routine-status.pending {
    color: #fbbf24;
}
body.dark-mode .client-routine-status.clear {
    color: #86efac;
}
.client-sport-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
.client-sport-grid div {
    display: grid;
    gap: 4px;
    padding: 11px;
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    background: color-mix(in srgb, var(--panel-bg) 80%, transparent);
}
.client-sport-grid span,
.client-sport-tags b {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .02em;
}
.client-sport-grid strong {
    min-width: 0;
    overflow-wrap: anywhere;
}
.client-sport-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.client-sport-tags span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 0 11px;
    border: 1px solid rgba(8, 145, 178, .18);
    border-radius: 999px;
    background: rgba(8, 145, 178, .09);
    color: var(--text);
    font-weight: 800;
}
.client-sport-notes {
    display: grid;
    gap: 10px;
}
.client-sport-note {
    display: grid;
    gap: 6px;
    padding: 12px;
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    background: rgba(148, 163, 184, .08);
}
.client-sport-note.important {
    border-color: rgba(245, 158, 11, .38);
    background: rgba(245, 158, 11, .1);
}
.client-sport-note strong {
    font-size: 13px;
}
.client-sport-note p {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
    line-height: 1.45;
}
.sport-profile-modal[hidden] {
    display: none;
}
.sport-profile-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: grid;
    place-items: center;
    padding: 34px;
}
.sport-profile-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, .76);
    backdrop-filter: blur(6px);
}
.sport-profile-dialog {
    position: relative;
    z-index: 1;
    width: min(1120px, calc(100vw - 68px));
    max-height: min(860px, calc(100vh - 68px));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 18px;
    background: linear-gradient(180deg, #101827, #0b1220);
    color: #f8fafc;
    box-shadow: 0 28px 90px rgba(2, 6, 23, .55);
}
.sport-profile-header,
.sport-profile-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 26px;
    border-color: rgba(148, 163, 184, .16);
}
.sport-profile-header {
    border-bottom: 1px solid rgba(148, 163, 184, .16);
}
.sport-profile-footer {
    border-top: 1px solid rgba(148, 163, 184, .16);
    background: rgba(15, 23, 42, .62);
}
.sport-profile-identity {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}
.sport-profile-photo {
    width: 92px;
    height: 92px;
    flex: 0 0 auto;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, .24);
    border-radius: 16px;
    background: rgba(8, 145, 178, .12);
}
.sport-profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.sport-profile-photo span {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: #67e8f9;
    font-size: 36px;
    font-weight: 900;
}
.sport-profile-header h2 {
    margin: 5px 0 4px;
    color: #fff;
    font-size: 30px;
    line-height: 1.08;
}
.sport-profile-header p {
    margin: 0;
    color: #a8b3c7;
    font-weight: 700;
}
.sport-profile-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.sport-profile-close {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: 11px;
    background: rgba(15, 23, 42, .82);
    color: #e2e8f0;
    font-size: 18px;
    font-weight: 900;
    cursor: pointer;
}
.sport-profile-close:hover {
    background: rgba(30, 41, 59, .95);
}
.sport-profile-body {
    display: grid;
    gap: 18px;
    padding: 22px 26px;
    overflow: auto;
}
.sport-profile-section {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, .15);
    border-radius: 14px;
    background: rgba(15, 23, 42, .7);
}
.sport-profile-section h3 {
    margin: 0;
    color: #f8fafc;
    font-size: 18px;
}
.sport-profile-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.sport-profile-dialog .client-sport-grid div,
.sport-profile-dialog .client-sport-note {
    border-color: rgba(148, 163, 184, .16);
    background: rgba(2, 6, 23, .22);
}
.sport-profile-dialog .client-sport-grid span,
.sport-profile-dialog .client-sport-tags b {
    color: #9fb0c8;
}
.sport-profile-dialog .client-sport-tags span {
    border-color: rgba(34, 211, 238, .18);
    background: rgba(34, 211, 238, .08);
    color: #f8fafc;
}
.sport-profile-dialog .client-sport-note p {
    color: #cbd5e1;
}
.sport-weight-history {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
.sport-weight-history div {
    display: grid;
    gap: 5px;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, .16);
    border-radius: 12px;
    background: rgba(2, 6, 23, .22);
}
.sport-weight-history strong {
    color: #f8fafc;
    font-size: 18px;
}
.sport-weight-history span,
.sport-weight-empty {
    color: #9fb0c8;
    font-size: 13px;
    font-weight: 800;
}
.sport-weight-empty {
    margin: 0;
}
.sport-profile-footer .button {
    min-height: 40px;
    padding: 10px 16px;
}
@media (max-width: 900px) {
    .sport-profile-modal {
        padding: 14px;
    }
    .sport-profile-dialog {
        width: min(100%, calc(100vw - 20px));
        max-height: calc(100vh - 20px);
        border-radius: 14px;
    }
    .sport-profile-header,
    .sport-profile-footer {
        padding: 16px;
    }
    .sport-profile-header {
        align-items: flex-start;
    }
    .sport-profile-identity {
        align-items: flex-start;
    }
    .sport-profile-photo {
        width: 68px;
        height: 68px;
        border-radius: 13px;
    }
    .sport-profile-header h2 {
        font-size: 22px;
    }
    .sport-profile-header-actions {
        flex-direction: column-reverse;
        align-items: flex-end;
        gap: 8px;
    }
    .sport-profile-body {
        padding: 16px;
    }
    .sport-profile-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .sport-weight-history {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 560px) {
    .sport-profile-header,
    .sport-profile-footer {
        flex-direction: column;
        align-items: stretch;
    }
    .sport-profile-header-actions {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    .sport-profile-grid {
        grid-template-columns: 1fr;
    }
    .sport-weight-history {
        grid-template-columns: 1fr;
    }
    .sport-profile-footer .button {
        width: 100%;
        justify-content: center;
    }
}
.client-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    margin: 16px 0 0;
}
.client-actions .button,
.client-actions button {
    min-height: 40px;
    padding: 10px 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    line-height: 1.1;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease, color .16s ease;
}
.client-actions .button:hover,
.client-actions button:hover {
    transform: translateY(-1px);
}
.client-actions .inline-form {
    margin: 0;
}
.client-action-primary {
    background: linear-gradient(135deg, #0788a7, #10a99d);
    color: #fff;
    box-shadow: 0 10px 22px rgba(8, 145, 178, .22);
}
.client-action-primary:hover {
    box-shadow: 0 12px 28px rgba(8, 145, 178, .28);
}
.client-action-modify.button.secondary {
    border-color: rgba(21, 94, 117, .28);
    background: var(--button-bg);
    color: #fff;
    box-shadow: 0 8px 18px rgba(21, 94, 117, .18);
}
.client-action-modify.button.secondary:hover {
    background: #0f4f63;
}
.client-action-pass.button.secondary {
    border-color: #9bd8e3;
    background: #e7fafe;
    color: #075985;
}
.client-action-pass.button.secondary:hover {
    background: #cff3fa;
    border-color: #63c6d7;
}
.client-action-edit.button.secondary {
    border-color: #cbd5e1;
    background: #eef2f7;
    color: #334155;
}
.client-action-edit.button.secondary:hover {
    background: #e2e8f0;
}
.client-action-delete.button.secondary,
.client-action-void-plan.button.secondary {
    border-color: #fecaca;
    background: #fff1f2;
    color: #be123c;
    box-shadow: none;
}
.client-action-delete.button.secondary:hover,
.client-action-void-plan.button.secondary:hover {
    border-color: #fda4af;
    background: #ffe4e6;
    color: #9f1239;
}
.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);
}
.payment-operation-select {
    max-width: 420px;
}
.payment-sale-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
    padding: 0;
    border: 0;
}
.payment-sale-grid > label:first-child {
    grid-column: 1 / -1;
    order: 1;
}
.payment-sale-grid > label:nth-of-type(2) {
    order: 2;
}
.payment-sale-grid > label:nth-of-type(4) {
    order: 3;
}
.payment-sale-grid > label:nth-of-type(5) {
    order: 4;
}
.payment-sale-grid > [data-duration-summary] {
    order: 3;
}
.payment-sale-grid > [data-membership-period-summary] {
    order: 5;
}
.payment-sale-grid > [data-sale-value] {
    order: 4;
}
.payment-sale-grid > label:nth-of-type(6) {
    grid-column: 1 / -1;
    order: 8;
}
.payment-sale-grid > [data-immediate-only] {
    order: 9;
}
.payment-sale-grid > .payment-plan-field {
    grid-column: 1 / -1;
    order: 2;
}
.payment-sale-grid > .payment-summary-grid {
    grid-column: 1 / -1;
    order: 3;
}
.payment-sale-grid > .payment-details-grid {
    grid-column: 1 / -1;
    order: 8;
}
.payment-sale-grid > .payment-date-field {
    order: 8;
}
.payment-sale-grid > .payment-method-field {
    order: 9;
}
.payment-sale-grid > .payment-comment-field {
    order: 10;
}
.payment-sale-grid > .payment-amount-field {
    order: 11;
}
.payment-sale-grid > .readonly-summary-field {
    grid-column: auto;
}
.payment-sale-grid > .payment-date-field,
.payment-sale-grid > .payment-method-field,
.payment-sale-grid > .payment-comment-field,
.payment-sale-grid > .payment-amount-field {
    display: grid;
    grid-template-rows: auto 46px minmax(17px, auto);
    align-content: start;
}
.payment-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.payment-details-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.payment-summary-grid .readonly-summary-field {
    min-width: 0;
}
.payment-details-grid > label {
    min-width: 0;
    display: grid;
    grid-template-rows: auto 46px minmax(17px, auto);
    align-content: start;
}
.payment-start-field {
    position: relative;
    grid-template-rows: auto 46px minmax(17px, auto) auto;
}
.payment-details-grid .field-warning {
    grid-column: 1 / -1;
    z-index: 20;
    width: min(720px, 100%);
    margin-top: 8px;
    padding: 14px 16px;
    border: 1px solid rgba(217, 119, 6, .34);
    border-radius: 8px;
    background: #fff7ed;
    color: #7c2d12;
    font-weight: 700;
    box-shadow: 0 18px 44px rgba(15, 23, 42, .14);
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .16s ease, transform .16s ease;
}
.payment-details-grid .plan-history-warning {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}
.plan-history-warning-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #f59e0b;
    color: #fff;
    font-size: 1rem;
    font-weight: 900;
}
.plan-history-warning-copy {
    display: grid;
    gap: 6px;
}
.plan-history-warning-copy strong {
    color: #7c2d12;
    font-size: .98rem;
}
.plan-history-warning-copy p,
.plan-history-warning-copy small {
    margin: 0;
    color: #9a3412;
    line-height: 1.4;
}
.plan-history-warning-copy a {
    color: #0f766e;
    font-weight: 900;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.plan-history-warning-action {
    justify-self: start;
    width: auto;
    min-height: 0;
    padding: 8px 12px;
    border: 1px solid rgba(15, 118, 110, .28);
    border-radius: 8px;
    background: #0f766e;
    color: #fff;
    font-size: .9rem;
    font-weight: 900;
    cursor: pointer;
}
.plan-history-warning-action:hover,
.plan-history-warning-action:focus {
    background: #115e59;
}
.payment-details-grid .field-warning.is-visible {
    opacity: 1;
    transform: translateY(0);
}
body.dark-mode .payment-details-grid .field-warning {
    background: rgba(67, 42, 21, .98);
    border-color: rgba(251, 191, 36, .35);
    color: #fef3c7;
}
body.dark-mode .plan-history-warning-copy strong,
body.dark-mode .plan-history-warning-copy p,
body.dark-mode .plan-history-warning-copy small {
    color: #fef3c7;
}
body.dark-mode .plan-history-warning-copy a {
    color: #5eead4;
}
body.dark-mode .plan-history-warning-action {
    background: #14b8a6;
    color: #042f2e;
}
[data-historical-payment-row].is-highlighted {
    animation: historical-payment-highlight 2.4s ease;
}
@keyframes historical-payment-highlight {
    0%, 70% { background: #fff7ed; box-shadow: inset 4px 0 0 #f59e0b; }
    100% { background: transparent; box-shadow: inset 0 0 0 transparent; }
}
.is-voided-payment {
    opacity: .58;
    background: #f8fafc;
}
.is-voided-payment td:not(.table-actions) {
    text-decoration: line-through;
    text-decoration-thickness: 1px;
    text-decoration-color: rgba(100, 116, 139, .7);
}
.is-voided-payment .muted-line,
.is-voided-payment .payment-voided-badge {
    text-decoration: none;
}
.payment-voided-badge {
    display: inline-flex;
    margin-left: 8px;
    background: #64748b;
    color: #fff;
}
.void-payment-modal[hidden] {
    display: none;
}
.void-payment-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 18px;
}
.void-payment-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .48);
}
.void-payment-dialog {
    position: relative;
    z-index: 1;
    width: min(520px, 100%);
    display: grid;
    gap: 14px;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, .32);
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .24);
}
.void-payment-dialog header,
.void-payment-dialog footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.void-payment-dialog header strong {
    color: #0f172a;
    font-size: 1.05rem;
}
.void-payment-warning {
    display: grid;
    gap: 5px;
    padding: 12px;
    border: 1px solid rgba(217, 119, 6, .28);
    border-radius: 8px;
    background: #fff7ed;
    color: #7c2d12;
}
.void-payment-dialog p {
    margin: 0;
    color: #475569;
    font-weight: 800;
}
.void-payment-dialog label {
    display: grid;
    gap: 7px;
    color: #334155;
    font-weight: 800;
}
.void-payment-dialog textarea {
    min-height: 96px;
    resize: vertical;
}
.payment-sale-grid > label:nth-of-type(2),
.payment-sale-grid > label:nth-of-type(4),
.payment-sale-grid > label:nth-of-type(5) {
    display: grid;
    grid-template-rows: auto 46px minmax(17px, auto);
    align-content: start;
}
.payment-plan-field {
    position: relative;
    display: grid;
    gap: 7px;
}
.payment-plan-field > label {
    color: var(--muted);
    font-weight: 600;
}
.payment-plan-field.is-enhanced > select {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}
.payment-plan-field.is-open {
    z-index: 50;
}
.plan-picker {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: start;
}
.plan-quick-picks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-content: start;
}
.plan-quick-chip {
    min-height: 34px;
    padding: 0 11px;
    border-radius: 999px;
    background: rgba(6, 182, 212, .11);
    color: #047f94;
    border: 1px solid rgba(6, 182, 212, .22);
    box-shadow: none;
    font-size: 12px;
}
body.dark-mode .plan-quick-chip {
    color: #b9f2ff;
    background: rgba(34, 211, 238, .1);
}
.plan-quick-chip.is-selected,
.plan-quick-chip:hover {
    background: linear-gradient(135deg, var(--button-bg), #14b8a6);
    color: #fff;
}
.plan-search-control {
    position: relative;
}
.plan-search-control input {
    padding-right: 42px;
}
.plan-search-clear {
    position: absolute;
    top: 50%;
    right: 8px;
    width: 30px;
    height: 30px;
    min-width: 0;
    padding: 0;
    transform: translateY(-50%);
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    box-shadow: none;
    font-size: 18px;
}
.plan-search-clear:hover {
    transform: translateY(-50%);
    background: rgba(6, 182, 212, .1);
    box-shadow: none;
}
.plan-picker-list {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 45;
    max-height: 280px;
    overflow: auto;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    background: color-mix(in srgb, var(--panel-bg) 92%, transparent);
    display: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 8px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .22);
}
.payment-plan-field.is-open .plan-picker-list {
    display: grid;
}
.plan-picker-category {
    display: contents;
    gap: 5px;
    padding: 0;
    align-content: start;
}
.plan-picker-category + .plan-picker-category {
    border-top: 0;
}
.plan-picker-category h4 {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .02em;
}
.plan-picker-option {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    justify-content: space-between;
    gap: 5px;
    width: 100%;
    min-height: 88px;
    padding: 10px;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    border: 1px solid transparent;
    box-shadow: none;
    text-align: left;
}
.plan-picker-option:hover,
.plan-picker-option:focus,
.plan-picker-option.is-selected {
    transform: none;
    background: rgba(6, 182, 212, .1);
    border-color: rgba(6, 182, 212, .22);
    box-shadow: none;
}
.plan-picker-option strong,
.plan-picker-option small {
    display: block;
}
.plan-picker-option strong {
    font-size: 13px;
    line-height: 1.2;
}
.plan-picker-option small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}
.plan-picker-option em {
    flex: 0 0 auto;
    order: -1;
    color: #0f766e;
    font-style: normal;
    font-weight: 800;
    font-size: 14px;
}
body.dark-mode .plan-picker-option em {
    color: #67e8f9;
}
.plan-picker-empty {
    grid-column: 1 / -1;
    padding: 14px;
    color: var(--muted);
    font-size: 13px;
}
.readonly-summary-field {
    display: grid;
    gap: 8px;
    align-content: start;
    min-height: 86px;
    padding: 14px 16px;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, .42);
}
body.dark-mode .readonly-summary-field {
    background: rgba(15, 23, 42, .34);
}
.readonly-summary-field span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}
.readonly-summary-field strong {
    font-size: 20px;
    line-height: 1.1;
}
.readonly-summary-field small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.25;
}
.group-members-section {
    display: block;
}
.group-members-section[hidden] {
    display: none;
}
.group-members-header,
.group-member-list,
.group-member-results {
    display: grid;
    gap: 10px;
}
.group-member-chip,
.group-member-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: color-mix(in srgb, var(--panel-bg) 94%, transparent);
    text-align: left;
}
.group-member-chip strong,
.group-member-result strong {
    display: block;
}
.group-member-chip small,
.group-member-result span {
    display: block;
    color: var(--muted);
}
.group-member-result {
    width: 100%;
    color: var(--text);
    cursor: pointer;
}
.group-member-result:disabled {
    opacity: .58;
    cursor: not-allowed;
}
.group-member-result.has-historical-overlap {
    border-color: rgba(245, 158, 11, .45);
    background: rgba(255, 251, 235, .78);
}
.group-member-result em {
    display: block;
    margin-top: 4px;
    color: #b45309;
    font-size: 12px;
    font-style: normal;
    font-weight: 850;
}
.group-member-search {
    display: grid;
    gap: 12px;
    margin-top: 12px;
}
#paymentValueDisplay {
    color: #0f766e;
}
body.dark-mode #paymentValueDisplay {
    color: #67e8f9;
}
.immediate-plan-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(245, 158, 11, .38);
    border-radius: 8px;
    background: rgba(245, 158, 11, .1);
}
.immediate-plan-summary div {
    display: grid;
    gap: 4px;
}
.immediate-plan-summary span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}
.immediate-plan-summary strong {
    font-size: 16px;
}
.immediate-plan-summary p {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--muted);
    font-weight: 800;
}
.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;
    position: relative;
    overflow: hidden;
}
.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); }
.plan-status-card.status-active::before {
    content: "";
    position: absolute;
    right: 14px;
    bottom: 14px;
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, .34);
    border-radius: 50%;
}
.plan-status-card.status-active::after {
    content: "";
    position: absolute;
    right: 29px;
    bottom: 33px;
    width: 19px;
    height: 11px;
    border-left: 4px solid rgba(255, 255, 255, .78);
    border-bottom: 4px solid rgba(255, 255, 255, .78);
    transform: rotate(-45deg);
    transform-origin: center;
}
.client-status-stack {
    display: grid;
    gap: 12px;
}
.client-status-stack .plan-status-card {
    min-height: 164px;
}
.client-status-stack:not(:has(.today-access-card)) .plan-status-card {
    align-content: start;
    padding-top: 24px;
}
.client-status-stack:has(.today-access-card) .plan-status-card p {
    max-width: calc(100% - 64px);
}
.client-status-stack:not(:has(.today-access-card)) .plan-status-card.status-active::before {
    right: 20px;
    bottom: 26px;
    width: 56px;
    height: 56px;
}
.client-status-stack:not(:has(.today-access-card)) .plan-status-card.status-active::after {
    right: 38px;
    bottom: 48px;
    width: 22px;
    height: 12px;
}
.today-access-card {
    display: grid;
    align-content: center;
    gap: 6px;
    border-color: rgba(6, 182, 212, .35);
    background: linear-gradient(135deg, rgba(20, 184, 166, .16), rgba(6, 182, 212, .08));
}
.today-access-card span {
    color: #0f766e;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.15;
    text-transform: uppercase;
}
.today-access-card strong {
    font-size: 16px;
    line-height: 1.16;
}
.today-access-card p {
    margin: 0;
    font-size: 20px;
    font-weight: 900;
}
.today-access-card small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.3;
}
body.dark-mode .today-access-card {
    background: linear-gradient(135deg, rgba(20, 184, 166, .2), rgba(6, 182, 212, .12));
}
body.dark-mode .today-access-card span {
    color: #67e8f9;
}
.section-heading-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
}
.section-heading-row h2,
.section-heading-row p {
    margin-bottom: 0;
}
.client-record-tabs {
    display: grid;
    gap: 14px;
}
.client-profile-tabs {
    padding: 16px;
}
.client-profile-tabbar {
    width: 100%;
    overflow-x: auto;
}
.client-profile-tabbar .client-record-tab {
    white-space: nowrap;
}
.client-record-tabbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px;
    width: fit-content;
    max-width: 100%;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: rgba(148, 163, 184, .08);
}
.client-record-tab {
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, .72);
    color: #475569;
    font-weight: 900;
    cursor: pointer;
    transition: background .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.client-record-tab.is-active {
    border-color: rgba(8, 145, 178, .55);
    background: #0891b2;
    color: #fff;
    box-shadow: 0 10px 22px rgba(8, 145, 178, .28);
}
body.dark-mode .client-record-tab {
    background: rgba(15, 23, 42, .7);
    color: #cbd5e1;
}
body.dark-mode .client-record-tab.is-active {
    background: #06b6d4;
    color: #082f49;
}
.client-record-panel[hidden] {
    display: none;
}
.client-record-panel {
    min-width: 0;
}
.client-profile-tabs .client-record-panel {
    overflow-x: auto;
}
.client-profile-tab-panel {
    display: grid;
    gap: 12px;
}
.client-profile-tab-panel h2 {
    margin: 0;
    font-size: 22px;
}
.client-profile-tabs .client-record-panel > h2,
.client-profile-tabs .client-record-panel > .section-heading-row h2,
.client-profile-tabs .client-record-panel > .section-heading-row .muted-line,
.client-profile-tabs .guest-history-card h3 {
    display: none;
}
.client-profile-tabs .guest-visits-panel > .section-heading-row {
    display: none;
}
.client-profile-tab-panel table {
    margin-top: 2px;
}
.client-plan-summary-panel .client-plan-summary-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}
.client-plan-summary-panel .client-plan-summary-grid div {
    padding: 10px 12px;
}
.client-plan-summary-panel .client-summary-wide,
.client-plan-summary-panel .client-group-summary {
    grid-column: span 2;
}
.client-plan-summary-panel .group-members-inline {
    margin-top: 0;
}
.client-plan-summary-panel .group-members-inline h3 {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
}
.client-plan-summary-panel .group-members-inline h3 span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}
.guest-visits-panel {
    display: grid;
    gap: 16px;
}
.client-profile-tabs .guest-visits-panel {
    gap: 10px;
}
.client-profile-tabs .guest-visits-panel .section-heading-row {
    margin-bottom: 0;
}
.client-profile-tabs .guest-visits-panel .section-heading-row h2 {
    font-size: 21px;
}
.client-profile-tabs .guest-visits-panel .muted-line {
    font-size: 13px;
}
.guest-counter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 132px;
    padding: 9px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 900;
}
.guest-counter.is-available {
    background: #dcfce7;
    color: #166534;
}
.guest-counter.is-full {
    background: #fee2e2;
    color: #991b1b;
}
.guest-visit-form {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: rgba(148, 163, 184, .08);
}
.client-profile-tabs .guest-visit-form {
    gap: 8px;
    padding: 10px;
}
.client-profile-tabs .guest-visit-form label {
    gap: 4px;
    font-size: 13px;
}
.client-profile-tabs .guest-visit-form input {
    padding: 8px 9px;
}
.guest-search-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
    gap: 12px;
    align-items: start;
}
.guest-search-field {
    position: relative;
}
.guest-observation-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: end;
}
.guest-observation-field label {
    min-width: 0;
}
.guest-search-results {
    width: 100%;
    max-width: 100%;
    margin-top: 10px;
}
.guest-search-results .group-member-result {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    min-height: 42px;
    padding: 8px 12px;
}
.guest-search-results .group-member-result strong,
.guest-search-results .group-member-result span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.guest-selected-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 12px;
    border: 1px solid rgba(22, 163, 74, .36);
    border-radius: 8px;
    background: rgba(22, 163, 74, .09);
}
.client-profile-tabs .guest-selected-card {
    padding: 8px 10px;
}
.guest-selected-card strong,
.guest-selected-card small {
    display: block;
}
.guest-selected-card small {
    color: var(--muted);
}
.guest-form-actions {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
}
.client-profile-tabs .guest-form-actions {
    gap: 8px;
}
.client-profile-tabs .guest-form-actions .button {
    min-height: 32px;
    padding: 7px 10px;
    font-size: 13px;
}
.guest-form-actions small {
    color: var(--muted);
    font-weight: 800;
}
.client-profile-tabs .guest-form-actions small {
    font-size: 12px;
    line-height: 1.25;
}
.guest-history-card {
    padding: 14px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: rgba(148, 163, 184, .08);
}
.client-profile-tabs .guest-history-card {
    padding: 10px;
}
.guest-visits-panel h3 {
    margin-bottom: 10px;
    font-size: 16px;
}
.client-profile-tabs .guest-visits-panel h3 {
    margin-bottom: 7px;
    font-size: 15px;
}
.client-profile-tabs .guest-visits-panel .alert {
    margin-bottom: 0;
    padding: 8px 10px;
    font-size: 13px;
}
.client-profile-tabs .guest-inline-error {
    flex: 0 1 420px;
    margin-left: auto;
    padding: 7px 10px;
    line-height: 1.25;
}
.client-profile-tabs .guest-history-card th,
.client-profile-tabs .guest-history-card td {
    padding: 6px 8px;
    line-height: 1.25;
}
.inline-access-note {
    display: grid;
    gap: 4px;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid rgba(6, 182, 212, .3);
    border-radius: 8px;
    background: rgba(6, 182, 212, .08);
}
.inline-access-note strong {
    color: #0f766e;
}
.inline-access-note span {
    color: var(--muted);
    font-weight: 800;
}
body.dark-mode .inline-access-note strong {
    color: #67e8f9;
}
.group-members-inline {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: rgba(148, 163, 184, .08);
}
.group-members-inline h3 {
    margin-bottom: 10px;
    font-size: 16px;
}
.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;
}
.kiosk-fullscreen-button {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 80;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    min-width: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 8px;
    background: rgba(2, 6, 23, .18);
    color: rgba(255, 255, 255, .42);
    opacity: 0;
    box-shadow: none;
    backdrop-filter: blur(8px);
    transition: opacity .18s ease, background .18s ease, color .18s ease, border-color .18s ease;
}
.kiosk-fullscreen-button svg {
    width: 21px;
    height: 21px;
}
.kiosk:hover .kiosk-fullscreen-button,
.kiosk-fullscreen-button:focus-visible {
    opacity: .74;
}
.kiosk-fullscreen-button:hover,
.kiosk-fullscreen-button:focus-visible {
    opacity: 1;
    background: rgba(2, 6, 23, .62);
    color: #fff;
    border-color: rgba(255, 255, 255, .34);
    transform: none;
}
.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);
    aspect-ratio: 1;
    object-fit: contain;
    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 {
    position: fixed;
    left: 50%;
    bottom: clamp(26px, 6vh, 58px);
    z-index: 8;
    width: min(560px, calc(100vw - 32px));
    display: grid;
    gap: 8px;
    text-align: center;
    border-radius: 8px;
    padding: 20px 24px;
    color: #fff;
    transform: translateX(-50%);
    border: 1px solid rgba(103, 232, 249, .34);
    background: linear-gradient(135deg, rgba(3, 18, 26, .92), rgba(7, 42, 55, .84));
    box-shadow: 0 0 34px rgba(8, 145, 178, .22), 0 24px 56px rgba(0, 0, 0, .48), inset 0 1px 0 rgba(255, 255, 255, .12);
    backdrop-filter: blur(14px);
}
.access-result strong { font-size: clamp(27px, 2.6vw, 38px); line-height: 1.08; }
.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 {
    border-color: rgba(134, 239, 172, .42);
    background: linear-gradient(135deg, rgba(3, 45, 34, .92), rgba(6, 95, 70, .82));
}
.access-result.denied {
    border-color: rgba(251, 191, 36, .5);
    background: linear-gradient(135deg, rgba(3, 18, 26, .94), rgba(42, 35, 12, .86));
    box-shadow: 0 0 30px rgba(251, 191, 36, .16), 0 24px 56px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.kiosk-ranking {
    position: absolute;
    top: 14px;
    right: 36px;
    z-index: 3;
    width: min(350px, calc(100vw - 44px));
    padding: 10px 12px;
    border: 1px solid rgba(103, 232, 249, .28);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(0, 0, 0, .2), rgba(1, 24, 31, .1));
    color: #e6fbff;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .06);
    backdrop-filter: blur(5px);
    text-shadow: 0 2px 7px rgba(0, 0, 0, .88), 0 0 14px rgba(0, 0, 0, .62);
}
.kiosk-ranking.is-hidden-while-greeting {
    display: none;
}
.kiosk-ranking-title {
    display: flex;
    align-items: center;
    margin-bottom: 3px;
    padding: 0 2px 6px;
    border-bottom: 1px solid rgba(103, 232, 249, .22);
}
.kiosk-ranking-title span {
    color: #dffbff;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .03em;
    text-transform: uppercase;
    white-space: nowrap;
}
.kiosk-ranking ol {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}
.kiosk-ranking li {
    display: grid;
    grid-template-columns: 60px minmax(0, 1fr);
    gap: 0 8px;
    align-items: center;
    min-height: 62px;
    padding: 5px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    position: relative;
}
.kiosk-ranking li + li::before {
    content: "";
    position: absolute;
    top: 0;
    left: 10px;
    right: 10px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(148, 220, 232, .32), transparent);
}
.kiosk-ranking-medal {
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    border-radius: 0;
    background: transparent;
    color: #fff;
    font-size: 18px;
    font-weight: 950;
}
.kiosk-ranking-medal img {
    width: 58px;
    height: 58px;
    object-fit: contain;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .55));
}
.kiosk-ranking-client {
    min-width: 0;
}
.kiosk-ranking-client strong {
    display: flex;
    align-items: baseline;
    gap: 5px;
    overflow: hidden;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.1;
    white-space: nowrap;
}
.kiosk-ranking-client strong span {
    overflow: hidden;
    min-width: 0;
    text-overflow: ellipsis;
}
.kiosk-ranking-client strong em {
    flex: 0 0 auto;
    color: rgba(235, 250, 255, .86);
    font-size: 10px;
    font-style: normal;
    font-weight: 650;
}
.kiosk-ranking-client small {
    display: flex;
    align-items: baseline;
    gap: 6px;
    overflow: hidden;
    color: rgba(235, 250, 255, .92);
    font-size: 11px;
    font-weight: 650;
    line-height: 1.12;
    white-space: nowrap;
}
.kiosk-ranking-client small b {
    color: #facc15;
    font-weight: 850;
}
.kiosk-ranking-client small span {
    overflow: hidden;
    min-width: 0;
    color: rgba(255, 255, 255, .94);
    text-overflow: ellipsis;
}
.kiosk-ranking-client time {
    display: block;
    overflow: hidden;
    color: #91b8ca;
    font-size: 10px;
    font-weight: 650;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@media (min-width: 1900px) and (min-height: 900px) {
    .kiosk-ranking {
        top: 52px;
        right: 36px;
        width: min(460px, calc(100vw - 72px));
        bottom: auto;
        height: min(765px, calc(100vh - 216px));
        max-height: none;
        padding: 22px 24px;
        overflow: hidden;
        border-radius: 16px;
        border-color: rgba(103, 232, 249, .42);
        background:
            radial-gradient(circle at 18% 8%, rgba(103, 232, 249, .12), transparent 30%),
            linear-gradient(145deg, rgba(0, 12, 20, .6), rgba(1, 27, 34, .3));
        box-shadow: 0 24px 64px rgba(0, 0, 0, .34), 0 0 34px rgba(8, 145, 178, .1), inset 0 1px 0 rgba(255, 255, 255, .1);
        backdrop-filter: blur(10px);
    }
    .kiosk-ranking::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: 0;
        background: linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, .07) 42%, transparent 62%);
        opacity: .38;
        pointer-events: none;
        transform: translateX(-72%);
        animation: kioskRankingSheen 9s ease-in-out infinite;
    }
    .kiosk-ranking-title {
        position: relative;
        z-index: 1;
        margin-bottom: 14px;
        padding: 0 2px 16px;
        border-bottom-color: rgba(103, 232, 249, .34);
    }
    .kiosk-ranking-title span {
        color: #f0fdff;
        font-size: 18px;
        letter-spacing: .04em;
        text-shadow: 0 0 18px rgba(103, 232, 249, .4), 0 2px 10px rgba(0, 0, 0, .82);
    }
    .kiosk-ranking-title::after {
        content: "";
        position: absolute;
        left: 0;
        bottom: -1px;
        width: 52%;
        height: 2px;
        border-radius: 999px;
        background: linear-gradient(90deg, rgba(34, 211, 238, .86), rgba(250, 204, 21, .58), transparent);
        box-shadow: 0 0 16px rgba(34, 211, 238, .32);
    }
    .kiosk-ranking ol {
        position: relative;
        z-index: 1;
        gap: 0;
    }
    .kiosk-ranking li {
        grid-template-columns: 86px minmax(0, 1fr);
        gap: 0 18px;
        min-height: 106px;
        padding: 14px 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }
    .kiosk-ranking li:nth-child(-n+5) {
        grid-template-columns: 94px minmax(0, 1fr);
        padding-left: 12px;
        border-radius: 14px;
    }
    .kiosk-ranking li:nth-child(-n+3) {
        min-height: 114px;
    }
    .kiosk-ranking li:nth-child(1) {
        background: linear-gradient(90deg, rgba(250, 204, 21, .09), rgba(34, 211, 238, .025), transparent 74%);
        box-shadow: inset 3px 0 0 rgba(250, 204, 21, .62), 0 0 28px rgba(250, 204, 21, .07);
        animation: kioskTopPulse 5.6s ease-in-out infinite;
    }
    .kiosk-ranking li:nth-child(2) {
        background: linear-gradient(90deg, rgba(192, 132, 252, .07), rgba(34, 211, 238, .02), transparent 74%);
        box-shadow: inset 3px 0 0 rgba(192, 132, 252, .42);
    }
    .kiosk-ranking li:nth-child(3) {
        background: linear-gradient(90deg, rgba(248, 113, 113, .07), rgba(34, 211, 238, .018), transparent 74%);
        box-shadow: inset 3px 0 0 rgba(248, 113, 113, .36);
    }
    .kiosk-ranking li:nth-child(4) {
        border-radius: 14px;
        background: linear-gradient(90deg, rgba(34, 197, 94, .06), rgba(34, 211, 238, .016), transparent 74%);
        box-shadow: inset 3px 0 0 rgba(34, 197, 94, .32), 0 0 22px rgba(34, 197, 94, .045);
    }
    .kiosk-ranking li:nth-child(5) {
        border-radius: 14px;
        background: linear-gradient(90deg, rgba(59, 130, 246, .06), rgba(34, 211, 238, .016), transparent 74%);
        box-shadow: inset 3px 0 0 rgba(59, 130, 246, .32), 0 0 22px rgba(59, 130, 246, .045);
    }
    .kiosk-ranking li + li::before {
        left: 0;
        right: 0;
        background: linear-gradient(90deg, transparent, rgba(103, 232, 249, .14), rgba(250, 204, 21, .12), rgba(103, 232, 249, .14), transparent);
        box-shadow: 0 0 12px rgba(34, 211, 238, .08);
    }
    .kiosk-ranking-medal,
    .kiosk-ranking-medal img {
        width: 78px;
        height: 78px;
    }
    .kiosk-ranking-medal {
        font-size: 28px;
        filter: drop-shadow(0 0 14px rgba(103, 232, 249, .16));
    }
    .kiosk-ranking-medal img {
        filter: drop-shadow(0 12px 20px rgba(0, 0, 0, .7)) drop-shadow(0 0 18px rgba(103, 232, 249, .22));
    }
    .kiosk-ranking li:nth-child(-n+3) .kiosk-ranking-medal,
    .kiosk-ranking li:nth-child(-n+3) .kiosk-ranking-medal img {
        width: 84px;
        height: 84px;
    }
    .kiosk-ranking li:nth-child(1) .kiosk-ranking-medal img {
        filter: drop-shadow(0 14px 22px rgba(0, 0, 0, .72)) drop-shadow(0 0 24px rgba(250, 204, 21, .34));
    }
    .kiosk-ranking li:nth-child(2) .kiosk-ranking-medal img {
        filter: drop-shadow(0 12px 20px rgba(0, 0, 0, .68)) drop-shadow(0 0 20px rgba(192, 132, 252, .24));
    }
    .kiosk-ranking li:nth-child(3) .kiosk-ranking-medal img {
        filter: drop-shadow(0 12px 20px rgba(0, 0, 0, .68)) drop-shadow(0 0 20px rgba(248, 113, 113, .22));
    }
    .kiosk-ranking-client {
        display: grid;
        gap: 7px;
        overflow: hidden;
        max-width: 100%;
        min-width: 0;
    }
    .kiosk-ranking-client strong {
        display: block;
        overflow: hidden;
        max-width: 100%;
        min-width: 0;
        font-size: 17px;
        line-height: 1.15;
        text-shadow: 0 0 16px rgba(255, 255, 255, .18), 0 2px 10px rgba(0, 0, 0, .86);
        white-space: normal;
    }
    .kiosk-ranking-client strong span {
        display: block;
        width: 100%;
        overflow: hidden;
        max-width: 100%;
        min-width: 0;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .kiosk-ranking-client strong em {
        display: block;
        max-width: 100%;
        overflow: hidden;
        margin-top: 6px;
        color: rgba(235, 250, 255, .64);
        font-size: 11px;
        font-weight: 750;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .kiosk-ranking-client small {
        display: grid;
        grid-template-columns: max-content minmax(0, 1fr);
        gap: 10px;
        margin-top: 0;
        font-size: 13px;
        line-height: 1.22;
    }
    .kiosk-ranking-client small span {
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .kiosk-ranking-client small b {
        color: #facc15;
        font-weight: 950;
        text-shadow: 0 0 12px rgba(250, 204, 21, .26);
    }
    .kiosk-ranking-client time {
        margin-top: 0;
        color: rgba(173, 226, 242, .84);
        font-size: 12px;
        line-height: 1.25;
    }
    @keyframes kioskRankingSheen {
        0%, 62%, 100% { transform: translateX(-72%); }
        78% { transform: translateX(72%); }
    }
    @keyframes kioskTopPulse {
        0%, 100% { box-shadow: inset 3px 0 0 rgba(250, 204, 21, .58), 0 0 24px rgba(250, 204, 21, .06); }
        50% { box-shadow: inset 3px 0 0 rgba(250, 204, 21, .78), 0 0 34px rgba(250, 204, 21, .11); }
    }
}
@media (min-width: 1900px) and (min-height: 900px) and (prefers-reduced-motion: reduce) {
    .kiosk-ranking::before,
    .kiosk-ranking li:nth-child(1) {
        animation: none;
    }
}
.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, #f59e0b, #06b6d4);
    border: 1px solid rgba(253, 224, 71, .54);
    box-shadow: 0 0 24px rgba(251, 191, 36, .34), 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: linear-gradient(135deg, #f59e0b, #67e8f9);
    color: #061821;
    font-size: 34px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 0 26px rgba(251, 191, 36, .42);
}
.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);
}
.level-card .level-pill,
.badge-summary .level-pill {
    font-size: clamp(24px, 2.4vw, 34px);
    padding: 13px 20px;
    line-height: 1.05;
}
.level-card .level-pill {
    box-shadow: 0 0 34px rgba(34, 211, 238, .7), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.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(34px, 5.2vw, 68px);
    line-height: .98;
    font-weight: 900;
    color: #67e8f9;
    text-shadow: 0 0 28px rgba(103, 232, 249, .9), 0 5px 20px rgba(0, 0, 0, .72);
}
.celebration-level em {
    display: block;
    margin-top: 8px;
    color: #fde68a;
    font-size: clamp(14px, 1.7vw, 18px);
    line-height: 1.15;
    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 (min-width: 1000px) and (max-width: 1400px) and (max-height: 820px) {
    .access-screen {
        padding-top: 8px;
        padding-bottom: 10px;
        min-height: 100vh;
    }
    .access-greeting {
        min-height: 0;
        height: calc(100vh - 22px);
        grid-template-columns: minmax(500px, 55%) minmax(390px, 45%);
        padding: 0 30px;
        align-items: center;
    }
    .greeting-media {
        min-height: 0;
        height: calc(100vh - 36px);
        align-self: center;
        place-items: end center;
        transform: translate(-28px, -10px);
    }
    .greeting-media img {
        height: auto;
        max-height: min(640px, calc(100vh - 28px));
        transform: scale(1.05);
        object-position: center bottom;
    }
    .greeting-copy {
        max-width: 520px;
        align-self: center;
        gap: 12px;
        transform: translateY(-8px);
    }
    .greeting-copy p {
        font-size: clamp(34px, 4vw, 44px);
        line-height: 1.04;
    }
    .level-card {
        padding: 15px;
        gap: 9px;
        width: min(100%, 520px);
    }
    .level-card .level-pill {
        font-size: clamp(20px, 2.2vw, 28px);
        padding: 10px 16px;
    }
    .attendance-total {
        font-size: 16px;
    }
    .progress-track {
        height: 20px;
    }
    .progress-text {
        font-size: 13px;
    }
    .badge-celebration {
        min-height: 0;
        height: calc(100vh - 18px);
        gap: 8px;
        align-content: center;
        width: min(840px, 92vw);
    }
    .celebration-copy {
        gap: 6px;
    }
    .celebration-kicker {
        padding: 6px 12px;
        font-size: 13px;
    }
    .celebration-badge-wrap {
        width: min(245px, 33vh);
        margin: 0;
    }
    .celebration-copy h1 {
        font-size: clamp(34px, 4.4vw, 48px);
        margin-top: 0;
    }
    .celebration-copy p {
        font-size: 17px;
        line-height: 1.22;
    }
    .celebration-message {
        gap: 4px;
    }
    .celebration-level {
        width: min(620px, 78vw);
        padding: 12px 18px;
        gap: 4px;
    }
    .celebration-level strong {
        font-size: clamp(23px, 3vw, 34px);
    }
    .celebration-level span {
        font-size: clamp(34px, 5vw, 58px);
        line-height: .94;
    }
    .celebration-level em {
        margin-top: 7px;
        font-size: 14px;
    }
    .celebration-badge strong {
        font-size: clamp(48px, 7vw, 84px);
    }
}

@media (max-height: 720px) and (min-width: 1000px) {
    .access-greeting {
        grid-template-columns: minmax(450px, 54%) minmax(360px, 46%);
    }
    .greeting-media {
        transform: translate(-24px, -4px);
    }
    .greeting-media img {
        max-height: min(600px, calc(100vh - 18px));
        transform: scale(1);
    }
    .greeting-copy {
        gap: 9px;
    }
    .greeting-copy p {
        font-size: clamp(30px, 3.6vw, 38px);
    }
    .greeting-stats strong {
        padding: 10px 12px;
        font-size: 14px;
    }
    .level-card {
        padding: 12px;
        gap: 7px;
    }
    .kiosk-ranking {
        top: 12px;
        right: 24px;
        bottom: auto;
        width: 306px;
        padding: 8px 10px;
    }
    .kiosk-ranking li {
        grid-template-columns: 54px minmax(0, 1fr);
        min-height: 56px;
        padding: 4px 0;
    }
    .kiosk-ranking-medal,
    .kiosk-ranking-medal img {
        width: 52px;
        height: 52px;
    }
    .kiosk-ranking-client strong {
        font-size: 12px;
    }
    .kiosk-ranking-client strong em,
    .kiosk-ranking-client small,
    .kiosk-ranking-client time {
        font-size: 10px;
    }
    .attendance-total {
        font-size: 14px;
    }
    .progress-text {
        font-size: 12px;
    }
    .badge-celebration {
        gap: 6px;
        height: calc(100vh - 10px);
    }
    .celebration-copy .access-status-pill {
        padding: 7px 12px;
        font-size: 13px;
    }
    .celebration-kicker {
        padding: 5px 10px;
        font-size: 12px;
    }
    .celebration-copy h1 {
        font-size: clamp(30px, 4vw, 42px);
    }
    .celebration-copy p {
        font-size: 15px;
    }
    .celebration-badge-wrap {
        width: min(205px, 30vh);
    }
    .celebration-level {
        padding: 10px 14px;
    }
    .celebration-level span {
        font-size: clamp(28px, 4.5vw, 48px);
    }
    .celebration-level em {
        margin-top: 6px;
    }
}

@media (max-width: 1180px) {
    .kiosk-ranking {
        width: min(330px, calc(100vw - 28px));
    }

    .kiosk-ranking ol {
        grid-template-columns: 1fr;
    }

    .analytics-grid {
        grid-template-columns: 1fr;
    }
    .chart-panel canvas,
    .chart-panel-wide canvas {
        height: 340px !important;
        max-height: 340px;
    }
}

@media (max-width: 1400px) {
    .client-profile-grid {
        grid-template-columns: minmax(0, 1fr) 240px;
        align-items: stretch;
        gap: 10px;
    }

    .client-profile-header {
        grid-template-columns: 112px minmax(0, 1fr);
        gap: 14px;
        align-items: start;
        padding: 14px;
        margin-bottom: 10px;
    }

    .client-photo-large,
    .client-photo-placeholder {
        width: 104px;
        height: 104px;
    }

    .client-photo-placeholder {
        font-size: 42px;
    }

    .client-mini-badge {
        display: none;
    }

    .client-title-row {
        gap: 8px;
        margin-bottom: 10px;
    }

    .client-level-pill {
        min-height: 28px;
        padding: 6px 10px;
        gap: 7px;
    }

    .client-level-pill span,
    .client-level-pill small {
        font-size: 11px;
    }

    .client-level-pill strong {
        font-size: 13px;
    }

    .client-summary-main h2 {
        font-size: 24px;
        line-height: 1.12;
    }

    .status-pill {
        padding: 5px 10px;
        font-size: 12px;
        line-height: 1.1;
    }

    .client-meta-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 8px;
    }

    .client-meta-grid span {
        min-height: 0;
        gap: 2px;
        padding: 8px 10px;
        font-size: 13px;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    .client-meta-grid strong {
        font-size: 10px;
    }

    .client-notes {
        margin-top: 10px;
        padding: 9px 11px;
        font-size: 13px;
    }

    .client-notes p {
        margin-top: 8px;
    }

    .client-status-stack {
        align-self: stretch;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr);
        gap: 8px;
        margin-bottom: 10px;
    }

    .client-status-stack:has(.today-access-card) {
        grid-template-rows: minmax(0, 1fr) auto;
    }

    .client-status-stack .plan-status-card,
    .client-status-stack .today-access-card {
        min-height: 96px;
        align-content: start;
        justify-items: start;
        grid-template-columns: 1fr;
        row-gap: 7px;
        padding: 22px 14px;
        margin-bottom: 0;
    }

    .client-status-stack .plan-status-card {
        min-height: 0;
    }

    .client-status-stack .plan-status-card span,
    .client-status-stack .today-access-card span {
        grid-column: 1;
        align-self: center;
        font-size: 11px;
        text-transform: uppercase;
    }

    .client-status-stack .plan-status-card strong,
    .client-status-stack .today-access-card strong {
        grid-column: 1;
        align-self: start;
        font-size: 28px;
        line-height: 1.05;
    }

    .client-status-stack .plan-status-card p,
    .client-status-stack .today-access-card p,
    .client-status-stack .today-access-card small {
        grid-column: 1;
        font-size: 13px;
        line-height: 1.3;
    }

    .client-status-stack:has(.today-access-card) .plan-status-card {
        padding-top: 14px;
        padding-bottom: 14px;
        row-gap: 5px;
    }

    .client-status-stack:has(.today-access-card) .plan-status-card strong {
        font-size: 24px;
    }

    .client-status-stack:has(.today-access-card) .plan-status-card p {
        font-size: 12px;
        max-width: calc(100% - 54px);
    }

    .client-status-stack .plan-status-card.status-active::before {
        right: 14px;
        bottom: 22px;
        width: 58px;
        height: 58px;
    }

    .client-status-stack .plan-status-card.status-active::after {
        right: 33px;
        bottom: 41px;
        width: 23px;
        height: 13px;
    }

    .client-status-stack:has(.today-access-card) .plan-status-card.status-active::before {
        right: 12px;
        bottom: 12px;
        width: 38px;
        height: 38px;
        border-width: 3px;
    }

    .client-status-stack:has(.today-access-card) .plan-status-card.status-active::after {
        right: 24px;
        bottom: 27px;
        width: 16px;
        height: 9px;
        border-left-width: 4px;
        border-bottom-width: 4px;
    }

    .client-actions {
        gap: 8px;
        margin-top: 12px;
    }

    .client-actions .button,
    .client-actions button {
        min-height: 34px;
        padding: 8px 11px;
        border-radius: 7px;
        font-size: 13px;
    }

    .detail-grid {
        gap: 12px;
    }

    .client-profile-tabs {
        padding: 14px;
    }

    .client-plan-summary-panel .client-plan-summary-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (min-width: 1000px) and (max-width: 1400px) and (max-height: 820px) {
    .content:not(.main-kiosk) {
        padding-top: 16px;
    }

    .content:not(.main-kiosk) .topbar {
        min-height: 54px;
        margin-bottom: 12px;
        padding-top: 4px;
        padding-bottom: 4px;
    }

    .content:not(.main-kiosk) .topbar h1 {
        font-size: 24px;
    }

    .content:not(.main-kiosk) .topbar-title {
        gap: 2px;
    }

    .content:not(.main-kiosk) .topbar-title > span {
        font-size: 11px;
    }

    .content:not(.main-kiosk) .topbar-actions {
        gap: 8px;
    }

    .content:not(.main-kiosk) .sidebar-toggle,
    .content:not(.main-kiosk) .theme-toggle {
        min-height: 32px;
        height: 32px;
    }

    .content:not(.main-kiosk) .sidebar-toggle {
        min-width: 78px;
        padding-inline: 10px;
    }

    .content:not(.main-kiosk) .user-chip {
        min-height: 32px;
        padding: 5px 9px 5px 11px;
    }

    .content:has(.client-profile) {
        padding-top: 16px;
    }

    .client-detail-grid {
        gap: 10px;
    }

    .client-profile-grid {
        margin-bottom: 10px;
    }

    .client-profile-header {
        grid-template-columns: 94px minmax(0, 1fr);
        gap: 12px;
        padding: 12px;
    }

    .client-photo-wrap {
        gap: 5px;
    }

    .client-photo-large,
    .client-photo-placeholder {
        width: 88px;
        height: 88px;
    }

    .client-photo-placeholder {
        font-size: 34px;
    }

    .client-mini-badge {
        display: none;
    }

    .client-title-row {
        margin-bottom: 8px;
    }

    .client-meta-grid {
        gap: 7px;
    }

    .client-meta-grid span {
        padding: 7px 9px;
        font-size: 12px;
    }

    .client-actions {
        margin-top: 10px;
    }

    .client-actions .button,
    .client-actions button {
        min-height: 31px;
        padding: 7px 10px;
        font-size: 12px;
    }

    .client-status-stack .plan-status-card,
    .client-status-stack .today-access-card {
        padding: 22px 14px;
    }

    .client-status-stack .today-access-card {
        min-height: 80px;
    }

    .client-status-stack .plan-status-card strong {
        font-size: 30px;
        line-height: 1.08;
    }

    .client-status-stack .today-access-card strong {
        font-size: 16px;
    }

    .client-status-stack .plan-status-card p {
        font-size: 13px;
        line-height: 1.25;
    }

    .client-status-stack:has(.today-access-card) .plan-status-card {
        padding: 14px 12px;
    }

    .client-status-stack:has(.today-access-card) .today-access-card {
        padding: 10px 12px;
        row-gap: 4px;
    }

    .client-status-stack:has(.today-access-card) .plan-status-card strong {
        font-size: 24px;
    }

    .client-status-stack:has(.today-access-card) .plan-status-card p {
        font-size: 12px;
    }

    .client-status-stack .today-access-card p,
    .client-status-stack .today-access-card small {
        font-size: 11px;
    }

    .client-profile-tabs {
        gap: 10px;
        padding: 12px;
    }

    .client-profile-tabbar {
        gap: 6px;
        padding: 5px;
    }

    .client-profile-tabbar .client-record-tab {
        min-height: 34px;
        padding: 8px 12px;
        font-size: 13px;
    }

    .client-profile-tab-panel {
        gap: 9px;
    }

    .client-profile-tab-panel h2 {
        font-size: 21px;
    }

    .client-plan-summary-panel .client-plan-summary-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .client-detail-grid > .panel {
        padding: 14px;
        margin-bottom: 10px;
    }

    .client-detail-grid h2 {
        margin: 0 0 12px;
        font-size: 23px;
        line-height: 1.12;
    }

    .client-plan-summary-grid {
        gap: 6px;
    }

    .client-plan-summary-grid div {
        min-height: 0;
        gap: 2px;
        padding: 7px 9px;
    }

    .client-plan-summary-grid span {
        font-size: 9px;
        line-height: 1.15;
    }

    .client-plan-summary-grid strong {
        font-size: 14px;
        line-height: 1.2;
    }

    .client-plan-summary-card .inline-access-note {
        margin-top: 9px;
        padding: 9px 11px;
        gap: 2px;
        font-size: 13px;
    }

    .client-progress-card .badge-summary {
        gap: 8px;
    }

    .client-progress-card .badge-summary .level-pill {
        padding: 10px 16px;
        font-size: clamp(20px, 2vw, 27px);
        line-height: 1;
        box-shadow: 0 0 22px rgba(34, 211, 238, .5), inset 0 1px 0 rgba(255, 255, 255, .25);
    }

    .client-progress-card .badge-summary strong {
        font-size: 19px;
        line-height: 1.2;
    }

    .client-progress-card .badge-summary p {
        font-size: 13px;
        line-height: 1.3;
    }

    .client-progress-card .client-progress {
        height: 12px;
    }

    .client-plan-summary-panel .group-members-inline,
    .client-plan-summary-card .group-members-inline {
        margin-top: 8px;
        padding: 8px;
    }

    .client-plan-summary-panel .group-members-inline h3,
    .client-plan-summary-card .group-members-inline h3 {
        margin: 0 0 6px;
        font-size: 15px;
        line-height: 1.15;
    }

    .client-plan-members-table {
        font-size: 13px;
    }

    .client-plan-members-table th,
    .client-plan-members-table td {
        padding: 7px 8px;
        line-height: 1.25;
    }

    .client-plan-members-table .badge {
        padding: 3px 7px;
        font-size: 10px;
    }

    .client-profile-tabs .guest-counter {
        min-width: 112px;
        padding: 7px 10px;
        font-size: 12px;
    }

    .client-profile-tabs .guest-observation-field {
        gap: 6px;
    }

    .client-profile-tabs .guest-search-grid {
        gap: 8px;
    }

    .client-profile-tabs .guest-search-results {
        margin-top: 6px;
    }

    .client-profile-tabs .guest-search-results .group-member-result {
        min-height: 34px;
        padding: 6px 9px;
        font-size: 12px;
    }
}

@media (max-height: 720px) {
    .client-detail-grid > .panel {
        padding: 12px;
    }

    .client-detail-grid h2 {
        margin-bottom: 10px;
        font-size: 21px;
    }

    .client-plan-summary-grid {
        gap: 7px;
    }

    .client-plan-summary-grid div {
        padding: 8px 10px;
    }

    .client-progress-card .badge-summary .level-pill {
        padding: 9px 14px;
        font-size: clamp(19px, 1.8vw, 24px);
    }

    .client-progress-card .badge-summary strong {
        font-size: 18px;
    }

    .client-plan-members-table th,
    .client-plan-members-table td {
        padding: 6px 8px;
    }
}

@media (max-width: 760px) {
    .payment-summary-grid,
    .payment-details-grid {
        grid-template-columns: 1fr;
    }

    .sidebar { position: static; width: auto; }
    .content { margin-left: 0; padding: 16px; }
    .topbar, .actions { align-items: stretch; flex-direction: column; }
    .form-grid, .form-grid.compact, .payment-sale-grid, .filters { grid-template-columns: 1fr; }
    .payment-sale-grid > label:first-child,
    .payment-sale-grid > label:nth-of-type(6) {
        grid-column: 1;
    }
    .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,
    .guest-search-grid,
    .info-list,
    .client-meta-grid {
        grid-template-columns: 1fr;
    }
    .section-heading-row,
    .guest-form-actions,
    .guest-selected-card {
        align-items: stretch;
        flex-direction: column;
    }
    .client-profile-tabs .guest-inline-error {
        width: 100%;
        margin-left: 0;
    }
    .client-record-tabbar {
        width: 100%;
    }
    .client-record-tab {
        flex: 1 1 120px;
    }
    .guest-counter {
        width: 100%;
    }
    .client-photo-large,
    .client-photo-placeholder {
        width: 104px;
        height: 104px;
    }
    .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; }
}

/* Modern SaaS refresh */
body {
    --primary: #0891b2;
    --primary-strong: #0e7490;
    --primary-soft: rgba(8, 145, 178, .12);
    --accent: #14b8a6;
    --line: rgba(148, 163, 184, .24);
    --panel: var(--panel-bg);
    --shadow-soft: 0 18px 44px rgba(15, 23, 42, .08);
    --shadow-card: 0 10px 28px rgba(15, 23, 42, .07);
    --radius: 8px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background:
        linear-gradient(180deg, rgba(8, 145, 178, .06), transparent 280px),
        var(--bg);
}

body.light-mode {
    --bg: #f3f7fa;
    --text: #102033;
    --muted: #64748b;
    --panel-bg: rgba(255, 255, 255, .94);
    --panel-border: rgba(148, 163, 184, .26);
    --input-bg: #ffffff;
    --input-border: #d6e0ea;
    --button-bg: #0e7490;
    --sidebar-bg: #071923;
    --sidebar-text: #b8c7d8;
    --sidebar-active: rgba(8, 145, 178, .18);
    --topbar-text: #102033;
}

body.dark-mode {
    --bg: #0b1220;
    --text: #eef6ff;
    --muted: #9fb0c3;
    --panel-bg: rgba(17, 27, 44, .92);
    --panel-border: rgba(148, 163, 184, .18);
    --input-bg: rgba(9, 17, 30, .9);
    --input-border: rgba(148, 163, 184, .24);
    --button-bg: #0891b2;
    --sidebar-bg: #050f1c;
    --sidebar-text: #afbed0;
    --sidebar-active: rgba(34, 211, 238, .14);
    --topbar-text: #eef6ff;
    --shadow-soft: 0 18px 48px rgba(0, 0, 0, .28);
    --shadow-card: 0 12px 30px rgba(0, 0, 0, .22);
}

a {
    color: var(--primary);
    font-weight: 800;
}

button,
.button {
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--button-bg), #14b8a6);
    box-shadow: 0 10px 22px rgba(8, 145, 178, .18);
    transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

button:hover,
.button:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
    box-shadow: 0 14px 28px rgba(8, 145, 178, .24);
}

.button.secondary {
    background: rgba(100, 116, 139, .16);
    color: var(--text);
    border: 1px solid var(--panel-border);
    box-shadow: none;
}

.sidebar {
    width: 198px;
    padding: 18px 12px;
    background:
        linear-gradient(180deg, rgba(8, 145, 178, .16), transparent 260px),
        var(--sidebar-bg);
    border-right: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 14px 0 34px rgba(2, 6, 23, .18);
}

.brand {
    min-height: 0;
    margin: 0 0 18px;
    padding: 6px 8px 16px;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    text-align: center;
}

.brand img {
    width: 76px;
    aspect-ratio: 1;
    object-fit: contain;
    flex: 0 0 auto;
    filter: drop-shadow(0 0 14px rgba(34, 211, 238, .22));
}

.settings-logo-upload {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
}

.settings-logo-upload img {
    width: 112px;
    aspect-ratio: 1;
    object-fit: contain;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 10px;
    background: rgba(15, 23, 42, .36);
}

.settings-logo-upload span {
    display: grid;
    gap: 7px;
}

.brand span {
    color: #f8fafc;
    font-size: 12px;
    line-height: 1.15;
    font-weight: 900;
    max-width: 120px;
}

.sidebar nav {
    min-height: calc(100vh - 106px);
    gap: 7px;
    align-content: start;
}

.sidebar nav a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 11px 12px;
    border-radius: var(--radius);
    color: var(--sidebar-text);
    font-size: 14px;
    font-weight: 850;
    border: 1px solid transparent;
    transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}

.sidebar nav a:hover {
    transform: translateX(2px);
    background: rgba(255, 255, 255, .07);
    color: #ffffff;
}

.sidebar nav a.active {
    background: linear-gradient(135deg, rgba(8, 145, 178, .28), rgba(20, 184, 166, .16));
    color: #ffffff;
    border-color: rgba(103, 232, 249, .22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 10px 26px rgba(8, 145, 178, .13);
}
.sidebar nav a.has-routine-requests {
    animation: routineSidebarPulse 2.4s ease-in-out infinite;
}
.sidebar nav a.has-routine-requests .nav-alert-count {
    margin-left: auto;
    min-width: 24px;
    height: 24px;
    display: inline-grid;
    place-items: center;
    padding: 0 7px;
    border-radius: 999px;
    background: #f59e0b;
    color: #111827;
    font-size: 12px;
    font-weight: 950;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, .18);
}
@keyframes routineSidebarPulse {
    0%, 100% {
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 10px 26px rgba(8, 145, 178, .13);
    }
    50% {
        background: linear-gradient(135deg, rgba(245, 158, 11, .22), rgba(8, 145, 178, .32));
        box-shadow: 0 0 0 4px rgba(245, 158, 11, .12), 0 0 24px rgba(34, 211, 238, .2);
    }
}

.sidebar nav a.active::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 999px;
    background: #67e8f9;
}

.nav-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 9px;
    background: rgba(255, 255, 255, .09);
    color: #b9f2ff;
}

.nav-icon svg {
    width: 22px;
    height: 22px;
}

.sidebar-logout {
    margin-top: auto;
    color: #fecaca !important;
}

.content {
    margin-left: 198px;
    padding: 22px 26px 34px;
    max-width: 1780px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    margin: -22px -26px 22px;
    padding: 18px 26px;
    background: color-mix(in srgb, var(--bg) 84%, transparent);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

.topbar-title {
    display: grid;
    gap: 4px;
}

.topbar-title > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.topbar h1 {
    font-size: 26px;
    line-height: 1.1;
    font-weight: 900;
}

.topbar-actions {
    gap: 10px;
}

.theme-toggle {
    width: auto;
    min-width: 74px;
    height: 38px;
    padding: 0 13px;
    border-radius: var(--radius);
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
    box-shadow: var(--shadow-card);
}

.theme-toggle::before {
    content: "";
    width: 8px;
    height: 8px;
    margin-right: 7px;
    display: inline-block;
    border-radius: 999px;
    background: var(--primary);
    box-shadow: 0 0 12px rgba(34, 211, 238, .72);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 10px 7px 12px;
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    background: var(--panel-bg);
    color: var(--text);
    font-weight: 900;
    box-shadow: var(--shadow-card);
}

.user-chip small {
    padding: 4px 7px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-strong);
    font-size: 11px;
    text-transform: uppercase;
}

.panel,
.card {
    border-radius: var(--radius);
    border-color: var(--panel-border);
    padding: 20px;
    box-shadow: var(--shadow-card);
}

.panel:hover,
.card:hover {
    box-shadow: var(--shadow-soft);
}

.kpi-card,
.metric-card {
    min-height: 116px;
    padding: 18px;
}

.kpi-card::before {
    width: 4px;
    border-radius: 999px;
}

.kpi-card::after {
    display: none;
}

.card span,
.kpi-card span,
.metric-card span {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
}

.card strong,
.kpi-card strong,
.metric-card strong {
    color: var(--text);
    font-weight: 950;
}

.section-kicker {
    padding: 5px 10px;
    border: 1px solid rgba(8, 145, 178, .18);
    background: var(--primary-soft);
    color: var(--primary-strong);
    font-size: 11px;
}

input,
select,
textarea {
    min-height: 42px;
    border-radius: var(--radius);
    background: var(--input-bg);
    border-color: var(--input-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(8, 145, 178, .72);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, .14);
}

label {
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
}

label input,
label select,
label textarea {
    color: var(--text);
    font-size: 14px;
    font-weight: 650;
}

fieldset {
    border-color: var(--panel-border);
    border-radius: var(--radius);
}

.actions {
    gap: 14px;
}

.inline-search {
    gap: 10px;
}

table {
    border-collapse: separate;
    border-spacing: 0;
}

th,
td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--line);
}

th {
    background: rgba(148, 163, 184, .08);
    color: var(--muted);
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
}

th:first-child {
    border-top-left-radius: var(--radius);
}

th:last-child {
    border-top-right-radius: var(--radius);
}

.zebra-table tbody tr:nth-child(even) {
    background: rgba(148, 163, 184, .045);
}

.zebra-table tbody tr:hover {
    background: rgba(8, 145, 178, .075);
    box-shadow: inset 3px 0 0 var(--primary);
}

.table-actions a,
.table-actions button,
td > a {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 8px;
    border-radius: 7px;
    background: rgba(8, 145, 178, .1);
    color: var(--primary-strong);
    font-size: 12px;
    font-weight: 900;
}

.client-name-link,
td > a.client-name-link {
    display: inline;
    min-height: 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: var(--primary);
    font-size: inherit;
}

.link-button,
.inline-form .link-button {
    min-height: 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: var(--primary);
    box-shadow: none;
    transform: none;
}

.link-button:hover,
.inline-form .link-button:hover {
    transform: none;
    box-shadow: none;
}

.danger-link,
.inline-form .danger-link {
    color: #dc2626;
}

.badge {
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 950;
}

.badge.activo {
    background: rgba(20, 184, 166, .14);
    color: #0f766e;
}

.badge.inactivo {
    background: rgba(245, 158, 11, .16);
    color: #92400e;
}

body.dark-mode .badge.activo {
    color: #5eead4;
}

body.dark-mode .badge.inactivo {
    color: #fbbf24;
}

body.dark-mode .client-action-primary {
    background: linear-gradient(135deg, #008fa1, #00d4c7);
    color: #fff;
    box-shadow: 0 12px 26px rgba(0, 183, 194, .24);
}

body.dark-mode .client-action-primary:hover {
    background: linear-gradient(135deg, #00a8bb, #17e6d9);
    box-shadow: 0 14px 32px rgba(0, 212, 199, .28);
}

body.dark-mode .client-action-modify.button.secondary {
    border-color: rgba(34, 211, 238, .28);
    background: var(--button-bg);
    color: #fff;
    box-shadow: 0 10px 22px rgba(8, 145, 178, .28);
}

body.dark-mode .client-action-modify.button.secondary:hover {
    border-color: rgba(34, 211, 238, .42);
    background: #0e7490;
}

body.dark-mode .client-action-pass.button.secondary {
    border-color: rgba(0, 212, 199, .28);
    background: rgba(0, 183, 194, .14);
    color: #bffcff;
}

body.dark-mode .client-action-pass.button.secondary:hover {
    border-color: rgba(0, 212, 199, .46);
    background: rgba(0, 183, 194, .22);
}

body.dark-mode .client-action-edit.button.secondary {
    border-color: rgba(148, 214, 225, .2);
    background: #162f3d;
    color: #d7e7ee;
}

body.dark-mode .client-action-edit.button.secondary:hover {
    border-color: rgba(148, 214, 225, .32);
    background: #1d3a49;
}

body.dark-mode .client-action-delete.button.secondary,
body.dark-mode .client-action-void-plan.button.secondary {
    border-color: rgba(251, 113, 133, .28);
    background: rgba(190, 18, 60, .16);
    color: #fecdd3;
}

body.dark-mode .client-action-delete.button.secondary:hover,
body.dark-mode .client-action-void-plan.button.secondary:hover {
    border-color: rgba(251, 113, 133, .46);
    background: rgba(190, 18, 60, .24);
    color: #fff1f2;
}

.alert {
    border-radius: var(--radius);
    border: 1px solid transparent;
    box-shadow: var(--shadow-card);
}

.alert.success {
    background: rgba(20, 184, 166, .13);
    color: #0f766e;
    border-color: rgba(20, 184, 166, .22);
}

.alert.error {
    background: rgba(239, 68, 68, .12);
    color: #b91c1c;
    border-color: rgba(239, 68, 68, .22);
}

.alert.warning {
    background: rgba(245, 158, 11, .13);
    color: #92400e;
    border-color: rgba(245, 158, 11, .24);
}

.client-photo-large,
.client-photo-placeholder,
.photo,
.current-photo-control img {
    border-radius: var(--radius);
}

.client-photo-placeholder {
    background: linear-gradient(135deg, #0e7490, #14b8a6);
}

.client-meta-grid span,
.info-list div,
.readonly-summary-field,
.distribution-item,
.comparison-item,
.payment-client-summary {
    border-radius: var(--radius);
    background: rgba(148, 163, 184, .07);
    border-color: var(--line);
}

.status-pill {
    background: var(--primary) !important;
    border-radius: 999px;
}

.status-expired,
.status-none {
    background: #f59e0b !important;
}

.plan-status-card.status-active {
    background: linear-gradient(135deg, #0e7490, #14b8a6);
}

.plan-status-card.status-expired,
.plan-status-card.status-none {
    background: linear-gradient(135deg, #92400e, #f59e0b);
}

.table-pagination {
    border-top-color: var(--line);
}

.table-pagination .button {
    min-height: 34px;
}

.settings-modal-card {
    border-radius: var(--radius);
}

.settings-section .report-card {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(148, 163, 184, .055);
}

.badge-level-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.badge-level-preview span,
.badge-level-preview em {
    padding: 7px 10px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-strong);
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
}

.badge-modal-card {
    width: min(780px, 100%);
}

.settings-badge-form {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    max-height: min(90vh, 820px);
    gap: 0;
    margin: 0;
    padding: 0;
}

.badge-level-editor {
    display: grid;
    gap: 10px;
    min-height: 0;
    max-height: min(56vh, 520px);
    overflow-y: auto;
    padding: 16px 20px 18px 26px;
    scrollbar-width: thin;
    scrollbar-color: rgba(8, 145, 178, .42) transparent;
}

.badge-level-editor::-webkit-scrollbar {
    width: 10px;
}

.badge-level-editor::-webkit-scrollbar-thumb {
    border: 3px solid #ffffff;
    border-radius: 999px;
    background: rgba(8, 145, 178, .42);
    background-clip: padding-box;
}

.badge-level-row {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.badge-level-row span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
}

.badge-level-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    padding: 16px 26px;
    border-top: 1px solid #e2e8f0;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 -14px 30px rgba(15, 23, 42, .07);
    backdrop-filter: blur(10px);
}

.badge-level-actions button,
.badge-level-actions .button {
    min-height: 42px;
    border-radius: 9px;
    padding: 10px 16px;
}

.group-delete-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fff1f2;
}

.group-delete-panel strong {
    display: block;
    color: #991b1b;
}

.group-delete-panel p {
    margin: 4px 0 0;
    color: #7f1d1d;
}

@media (max-width: 680px) {
    .group-delete-panel {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 680px) {
    .settings-modal-card .settings-badge-form {
        max-height: calc(100vh - 20px);
    }

    .badge-level-editor {
        padding: 14px 14px 16px 18px;
    }

    .badge-level-row {
        grid-template-columns: 74px minmax(0, 1fr);
    }

    .badge-level-actions {
        flex-direction: column-reverse;
        padding: 12px 16px;
    }

    .badge-level-actions button,
    .badge-level-actions .button {
        width: 100%;
    }
}

#respaldos .reports-grid {
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    align-items: start;
}

#respaldos .report-card {
    gap: 14px;
    min-width: 0;
}

.backup-export-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
    margin: 0;
}

.backup-export-form label {
    min-width: 0;
}

.backup-export-form input,
.backup-export-form select {
    width: 100%;
}

.backup-export-action {
    grid-column: 1 / -1;
}

.backup-export-action button {
    width: 100%;
    min-height: 42px;
    white-space: normal;
    line-height: 1.15;
}

.dashboard-kpis .kpi-card,
.income-summary-cards .kpi-card {
    border-left: 0;
    border-top: 0;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--kpi-accent, var(--primary)) 7%, transparent), transparent 58%),
        var(--panel-bg);
}

.dashboard-kpis .kpi-card::before,
.income-summary-cards .kpi-card::before {
    display: block;
    background: var(--kpi-accent, var(--primary));
}

.income-summary-cards .kpi-card span {
    color: var(--muted);
}

.income-summary-cards .kpi-card strong {
    color: var(--text);
}

.income-summary-cards .kpi-card small {
    color: var(--muted);
}

.attendance-chart-panel canvas {
    height: 320px !important;
    max-height: 320px;
}

@media (min-width: 901px) and (max-height: 820px) {
    .page-dashboard .content {
        padding-top: 18px;
    }

    .page-dashboard .topbar {
        margin-top: -18px;
        margin-bottom: 10px;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .page-dashboard .dashboard-block {
        gap: 8px;
        margin-bottom: 10px;
    }

    .page-dashboard .dashboard-title h2 {
        margin-bottom: 0;
        font-size: 21px;
    }

    .page-dashboard .section-kicker {
        padding: 3px 9px;
        font-size: 10px;
    }

    .page-dashboard .dashboard-kpis {
        gap: 8px;
    }

    .page-dashboard .dashboard-kpis .kpi-card {
        min-height: 72px;
        padding: 10px 14px 9px;
    }

    .page-dashboard .dashboard-kpis .kpi-card span {
        margin-bottom: 6px;
        font-size: 11px;
        line-height: 1.15;
    }

    .page-dashboard .dashboard-kpis .kpi-card strong {
        font-size: 25px;
    }

    .page-dashboard .dashboard-kpis .kpi-card small {
        margin-top: 5px;
        font-size: 11px;
        line-height: 1.15;
    }

    .page-dashboard .dashboard-section {
        gap: 6px;
        margin: 10px 0;
    }

    .page-dashboard .attendance-chart-panel {
        gap: 6px;
        padding: 12px 16px 10px;
    }

    .page-dashboard .attendance-chart-panel canvas {
        height: 220px !important;
        max-height: 220px;
    }

    .page-dashboard .chart-heading h3 {
        margin-bottom: 0;
        font-size: 17px;
    }

    .page-dashboard .attendance-heading-actions {
        gap: 8px;
    }

    .page-dashboard .today-access-count {
        padding: 4px 10px;
        font-size: 12px;
    }

    .page-dashboard .today-access-count b {
        font-size: 17px;
    }

    .page-dashboard .panel-tabs {
        padding: 4px;
    }

    .page-dashboard .panel-tabs button {
        min-height: 30px;
        padding: 5px 10px;
        font-size: 12px;
    }
}

.theme-toggle {
    font-size: 0;
}

.theme-toggle::after {
    content: "Tema";
    font-size: 13px;
}

@media (max-width: 900px) {
    .client-sport-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .client-sport-head {
        grid-template-columns: auto minmax(0, 1fr);
    }
    .client-routine-status {
        grid-column: 1 / -1;
        width: fit-content;
    }
    .client-sport-grid {
        grid-template-columns: 1fr;
    }
    .client-sport-card {
        padding: 13px;
    }
}

@media (max-width: 900px) {
    .sidebar {
        position: static;
        width: auto;
        padding: 12px;
    }

    .brand {
        padding-bottom: 10px;
        margin-bottom: 10px;
    }

    .sidebar nav {
        min-height: 0;
        grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
    }

    .sidebar-logout {
        margin-top: 0;
    }

    .content {
        margin-left: 0;
        padding: 18px;
    }

    .topbar {
        position: static;
        margin: -18px -18px 18px;
        padding: 16px 18px;
    }
}

@media (max-width: 760px) {
    .plan-picker-list {
        grid-template-columns: 1fr;
        max-height: 250px;
    }

    .topbar,
    .actions {
        align-items: stretch;
        flex-direction: column;
    }

    .topbar-actions,
    .inline-search,
    .clients-filter-form {
        width: 100%;
        flex-wrap: wrap;
    }

    .clients-filter-form select,
    .clients-filter-form input {
        max-width: none;
    }

    .user-chip {
        justify-content: space-between;
    }

    #respaldos .reports-grid,
    .backup-export-form {
        grid-template-columns: 1fr;
    }

    th,
    td {
        padding: 12px;
    }
}

/* Typography tuning: keep the brand strong, make small UI text calmer. */
body {
    font-weight: 500;
    line-height: 1.45;
    letter-spacing: 0;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

p,
td,
input,
select,
textarea,
.alert,
.muted-line,
.info-list div,
.group-member-chip small,
.group-member-result span {
    line-height: 1.45;
    letter-spacing: 0;
}

input,
select,
textarea,
td {
    font-weight: 500;
}

label,
.analytics-filters label,
.dashboard-filters label,
.backup-export-form label,
.payment-sale-grid label,
.settings-plan-form label,
.group-member-search label,
.day-checks label,
.checkbox-line {
    color: var(--muted);
    font-weight: 600;
    line-height: 1.34;
}

label input,
label select,
label textarea {
    color: var(--text);
    font-weight: 500;
}

small,
.card small,
.kpi-card small,
.metric-card small,
.payment-client-summary small,
.readonly-summary-field small,
.settings-admin-card p,
.settings-section p,
.section-title p,
.section-subhead p,
.plan-breakdown-heading p,
.immediate-plan-summary p,
.today-access-card small,
.badge-summary p,
.plan-active-toggle small,
.settings-plan-form-title p,
.distribution-item small,
.comparison-item small,
.muted-line {
    font-weight: 500;
    line-height: 1.45;
}

.section-kicker,
.topbar-title > span,
.card span,
.kpi-card span,
.metric-card span,
.readonly-summary-field span,
.immediate-plan-summary span,
.payment-client-summary span,
.today-access-card span,
th {
    font-weight: 700;
    letter-spacing: .02em;
}

.topbar h1 {
    font-weight: 800;
    line-height: 1.12;
}

h2,
.dashboard-title h2,
.section-title h2,
.settings-section h2,
.settings-plan-form-title h3,
.plan-breakdown-heading h3 {
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: 0;
}

h3,
legend,
.section-subhead h3 {
    font-weight: 700;
    line-height: 1.22;
    letter-spacing: 0;
}

button,
.button,
.sidebar nav a,
.theme-toggle,
.user-chip,
.client-name-link,
td > a.client-name-link,
.table-actions a,
.table-actions button,
.link-button,
.inline-form .link-button {
    font-weight: 800;
}

.brand span,
.card strong,
.kpi-card strong,
.metric-card strong,
.payment-client-summary strong,
.plan-status-card strong,
.today-access-card p,
.access-result span,
.badge-celebration strong {
    font-weight: 850;
}

.readonly-summary-field strong,
.immediate-plan-summary strong,
.group-member-chip strong,
.group-member-result strong,
.settings-plan-table strong,
.client-meta-grid strong,
.info-list strong {
    font-weight: 700;
}

.badge,
.status-pill,
.badge-level-preview span,
.badge-level-preview em,
.badge-level-row span {
    font-weight: 700;
    letter-spacing: 0;
}

.plan-active-toggle strong,
.plan-breakdown-row,
.distribution-item strong,
.comparison-item strong {
    font-weight: 700;
}

th {
    font-size: 12px;
    line-height: 1.35;
}

td {
    font-size: 14px;
}

/* Payment form visual polish. */
.payment-focus {
    padding: 18px;
    background: color-mix(in srgb, var(--bg) 84%, #e0f7fb);
    border-color: rgba(6, 182, 212, .26);
}

body.dark-mode .payment-focus {
    background: rgba(8, 47, 73, .2);
}

.payment-sale-grid {
    row-gap: 18px;
}

.payment-operation-field,
.payment-plan-field {
    grid-column: 1 / -1;
    min-width: 0;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: 8px;
    background: color-mix(in srgb, var(--panel-bg) 90%, #ffffff);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5);
}

body.dark-mode .payment-operation-field,
body.dark-mode .payment-plan-field {
    background: rgba(15, 23, 42, .42);
    border-color: rgba(148, 163, 184, .2);
}

.payment-sale-grid > .payment-operation-field {
    display: none !important;
}

.form-grid > .payment-operation-field {
    margin-bottom: -8px;
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
}

.form-grid > .payment-operation-field + .payment-focus {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    padding-top: 24px;
}

.payment-operation-field {
    display: grid;
    gap: 10px;
    padding: 16px 16px 14px;
    background:
        linear-gradient(135deg, rgba(8, 145, 178, .12), rgba(20, 184, 166, .08)),
        color-mix(in srgb, var(--bg) 84%, #dff7fb);
}

body.dark-mode .payment-operation-field {
    background: linear-gradient(135deg, rgba(34, 211, 238, .15), rgba(20, 184, 166, .1)), rgba(8, 47, 73, .36);
}

.payment-operation-field > span,
.payment-section-title span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.payment-operation-select {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.payment-operation-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    align-items: end;
}

.payment-operation-tab {
    position: relative;
    display: grid;
    gap: 4px;
    min-height: 74px;
    padding: 14px 16px;
    border: 1px solid rgba(8, 145, 178, .22);
    border-radius: 8px;
    background: rgba(255, 255, 255, .72);
    color: var(--text);
    box-shadow: none;
    text-align: left;
}

.payment-operation-tab:hover {
    transform: translateY(-1px);
    box-shadow: none;
}

.payment-operation-tab.is-active {
    z-index: 1;
    border-color: rgba(8, 145, 178, .54);
    background: linear-gradient(135deg, #0891b2, #14b8a6);
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(8, 145, 178, .18);
}

body.dark-mode .payment-operation-tab {
    background: rgba(15, 23, 42, .62);
    border-color: rgba(34, 211, 238, .18);
    color: var(--text);
}

body.dark-mode .payment-operation-tab.is-active {
    border-color: rgba(34, 211, 238, .5);
    background: linear-gradient(135deg, #0e7490, #0f766e);
    color: #ffffff;
}

.payment-operation-tab:disabled {
    opacity: .48;
    cursor: not-allowed;
}

.payment-operation-tab strong,
.payment-operation-tab small {
    display: block;
}

.payment-operation-tab strong {
    font-size: 15px;
    line-height: 1.1;
}

.payment-operation-tab small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.payment-operation-tab.is-active small {
    color: rgba(255, 255, 255, .86);
}

.payment-operation-field > small[data-renewal-only] {
    display: none !important;
}

.operation-mode-hint {
    display: block;
    margin-bottom: 12px;
    max-width: 980px;
}

.payment-section-title {
    display: grid;
    gap: 3px;
}

.payment-section-title strong {
    font-size: 17px;
    line-height: 1.2;
}

.payment-sale-grid > label,
.payment-plan-field > label,
.group-member-search label {
    gap: 8px;
}

.payment-sale-grid > label:not(.payment-comment-field),
.payment-date-field,
.payment-start-field,
.payment-method-field,
.payment-comment-field {
    padding-top: 3px;
}

.payment-sale-grid small,
.payment-plan-field small,
.group-members-section small {
    margin-top: 2px;
}

.payment-summary-grid,
.payment-details-grid {
    gap: 14px;
}

.payment-summary-grid {
    margin-top: 0;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, .24);
    border-radius: 8px;
    background: color-mix(in srgb, var(--bg) 90%, #ffffff);
}

body.dark-mode .payment-summary-grid {
    background: rgba(2, 6, 23, .18);
    border-color: rgba(148, 163, 184, .16);
}

.payment-details-grid {
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 8px;
    background: color-mix(in srgb, var(--panel-bg) 86%, #f8fafc);
}

body.dark-mode .payment-details-grid {
    background: rgba(15, 23, 42, .32);
    border-color: rgba(148, 163, 184, .16);
}

.readonly-summary-field {
    min-height: 104px;
    padding: 18px;
    background: color-mix(in srgb, var(--panel-bg) 92%, #ffffff);
    border-color: rgba(148, 163, 184, .3);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55);
}

body.dark-mode .readonly-summary-field {
    background: rgba(15, 23, 42, .5);
    border-color: rgba(148, 163, 184, .22);
}

.readonly-summary-field span {
    margin-bottom: 3px;
}

.readonly-summary-field strong {
    margin-top: 2px;
    font-size: 22px;
}

.group-members-section {
    padding: 18px;
    background: color-mix(in srgb, var(--bg) 88%, #e0f7fb);
    border-color: rgba(6, 182, 212, .24);
}

.group-member-chip {
    background: color-mix(in srgb, var(--panel-bg) 96%, #ffffff);
}

/* Collapsible sidebar. */
.sidebar,
.content,
.topbar {
    transition:
        transform .24s ease,
        opacity .2s ease,
        margin-left .24s ease,
        padding .24s ease,
        box-shadow .24s ease;
}

body.sidebar-collapsed .sidebar {
    transform: translateX(-102%);
    opacity: 0;
    pointer-events: none;
    box-shadow: none;
}

body.sidebar-collapsed .content {
    margin-left: 0;
    max-width: none;
}

.sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 88px;
    height: 38px;
    padding: 0 12px;
    border-radius: var(--radius);
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    color: var(--text);
    box-shadow: var(--shadow-card);
    font-size: 13px;
    line-height: 1;
}

.sidebar-toggle:hover {
    transform: translateY(-1px);
}

.sidebar-toggle-icon {
    position: relative;
    display: grid;
    gap: 4px;
    width: 18px;
    flex: 0 0 18px;
}

.sidebar-toggle-icon span {
    display: block;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform .22s ease, opacity .18s ease, width .22s ease;
}

.sidebar-toggle-icon span:nth-child(2) {
    width: 13px;
}

.sidebar-toggle-icon span:nth-child(3) {
    width: 16px;
}

.sidebar-toggle-icon span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.sidebar-toggle-icon span:nth-child(2) {
    opacity: 0;
}

.sidebar-toggle-icon span:nth-child(3) {
    width: 18px;
    transform: translateY(-6px) rotate(-45deg);
}

body.sidebar-collapsed .sidebar-toggle-icon span:nth-child(1),
body.sidebar-collapsed .sidebar-toggle-icon span:nth-child(3) {
    transform: none;
}

body.sidebar-collapsed .sidebar-toggle-icon span:nth-child(2) {
    opacity: 1;
}

body.sidebar-collapsed .sidebar-toggle-icon span:nth-child(3) {
    width: 16px;
}

.topbar .sidebar-toggle + .topbar-title {
    min-width: 0;
}

@media (min-width: 761px) {
    .payment-focus .payment-sale-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .payment-focus .payment-sale-grid > [data-duration-summary],
    .payment-focus .payment-sale-grid > [data-sale-value],
    .payment-focus .payment-sale-grid > [data-membership-period-summary],
    .payment-focus .payment-sale-grid > .payment-date-field,
    .payment-focus .payment-sale-grid > .payment-method-field,
    .payment-focus .payment-sale-grid > .payment-comment-field,
    .payment-focus .payment-sale-grid > .payment-amount-field {
        grid-column: span 1 !important;
    }

    .payment-focus .payment-sale-grid > label:first-child,
    .payment-focus .payment-sale-grid > .payment-plan-field,
    .payment-focus .payment-sale-grid > .payment-plan-payment-block,
    .payment-focus .payment-sale-grid > .payment-summary-grid,
    .payment-focus .payment-sale-grid > .payment-details-grid,
    .payment-focus .payment-sale-grid > .immediate-plan-summary,
    .payment-focus .payment-sale-grid > .alert.warning {
        grid-column: 1 / -1 !important;
    }
}

@media (max-width: 900px) {
    .payment-summary-grid,
    .payment-details-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .plan-picker-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .today-access-summary {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    body.sidebar-collapsed .sidebar {
        position: absolute;
        width: 100%;
    }

    body.sidebar-collapsed .content {
        margin-left: 0;
    }
}

/* Compact, high-contrast payment screen tuned for gym displays around 1360x768. */
.content:has(.payment-form) {
    --payment-section-surface: #e2eef4;
    --payment-section-surface-border: #b8cfdd;
    --payment-section-inner-card: #ffffff;
    --payment-section-danger-surface: #fff3e7;
    --payment-section-danger-border: #f4bf7b;
    background: #eaf2f6;
}

.content:has(.payment-form) .topbar {
    margin-bottom: 22px;
    padding: 18px 26px;
}

.content:has(.payment-form) .topbar h1 {
    font-size: 26px;
    line-height: 1.1;
}

.payment-form {
    gap: 12px;
    padding: 14px;
    margin-bottom: 12px;
    border-color: #cbd9e5;
    background: #f8fbfd;
    box-shadow: 0 16px 42px rgba(15, 23, 42, .08);
}

.operation-compact-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 18px;
    min-height: 56px;
    padding: 9px 12px;
    border: 1px solid #9bd8e3;
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(8, 145, 178, .14), rgba(20, 184, 166, .1)),
        #eef7fa;
    box-shadow: 0 10px 28px rgba(8, 145, 178, .08);
}

.operation-client-info {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
    flex: 0 1 42%;
}

.operation-client-info strong {
    min-width: 0;
    overflow: hidden;
    color: #0f172a;
    font-size: 22px;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.operation-client-info small {
    flex: 0 0 auto;
    color: #52637a;
    font-size: 15px;
    font-weight: 900;
    white-space: nowrap;
}

.operation-mode-selector {
    flex: 1 1 560px;
    min-width: min(100%, 500px);
    max-width: 720px;
}

.operation-mode-selector .payment-operation-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
}

.operation-mode-selector .operation-mode-option {
    min-height: 38px;
    padding: 6px 10px;
    align-content: center;
    border-left-width: 1px;
    gap: 2px;
    text-align: center;
}

.operation-mode-selector .operation-mode-option strong {
    font-size: 14px;
}

.operation-mode-selector .operation-mode-option small {
    font-size: 11px;
    line-height: 1.05;
}

.operation-compact-header + .payment-focus {
    border-color: #9bd8e3;
    background: #eef7fa;
}

.payment-form .payment-client-summary {
    min-height: 76px;
    padding: 12px 14px;
    border-color: #cbd9e5;
    background: #ffffff;
}

.payment-form .payment-client-summary span,
.payment-form .payment-section-title span,
.payment-form .payment-operation-field > span,
.payment-form label,
.payment-form legend,
.payment-form .readonly-summary-field span,
.payment-form .immediate-plan-summary span,
.payment-form .group-members-header strong {
    color: #42526a;
}

.payment-form .payment-client-summary strong {
    font-size: 22px;
    color: #0f172a;
}

.payment-form .payment-client-summary small,
.payment-form small,
.payment-form .readonly-summary-field small,
.payment-form .group-member-chip small,
.payment-form .group-member-result span {
    color: #52637a;
}

.payment-form > .payment-operation-field {
    margin-bottom: -6px;
    padding: 12px 14px 10px;
    border-color: #9bd8e3;
    background:
        linear-gradient(135deg, rgba(8, 145, 178, .18), rgba(20, 184, 166, .12)),
        #dff3f7;
    box-shadow: 0 10px 28px rgba(8, 145, 178, .08);
}

.payment-form > .payment-operation-field + .payment-focus {
    border-color: #9bd8e3;
    background: #eef7fa;
}

.payment-operation-tabs {
    gap: 8px;
}

.payment-operation-tab {
    min-height: 58px;
    padding: 10px 13px;
    border-color: #b8c8d7;
    background: #ffffff;
    color: #172033;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.payment-operation-tab:hover,
.payment-operation-tab:focus {
    border-color: #0891b2;
    background: #f2fbfd;
    box-shadow: 0 8px 20px rgba(8, 145, 178, .1);
}

.payment-operation-tab.is-active {
    border-color: #07859f;
    background: linear-gradient(135deg, #0788a7, #10a99d);
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(8, 145, 178, .26);
}

.payment-operation-tab strong {
    font-size: 15px;
}

.payment-operation-tab small {
    color: #5a6b80;
}

.payment-focus {
    padding: 14px;
}

.payment-focus legend {
    padding: 0 8px;
    font-size: 15px;
    color: #0f172a;
}

.payment-sale-grid {
    gap: 12px;
}

.payment-plan-field,
.payment-plan-payment-block,
.payment-summary-grid,
.payment-details-grid {
    border-color: #d4e0ea;
    background: #ffffff;
}

.payment-plan-field {
    gap: 9px;
    padding: 13px 14px;
    margin-bottom: 2px;
}

.payment-plan-field + .payment-plan-payment-block {
    margin-top: 4px;
}

.payment-plan-payment-block {
    grid-column: 1 / -1;
    display: grid;
    gap: 10px;
    padding: 13px 14px;
    border: 1px solid #d4e0ea;
    border-radius: 8px;
}

.payment-sale-grid > .payment-plan-payment-block {
    order: 3;
}

.payment-plan-payment-block > .payment-section-title {
    order: 1;
}

.payment-plan-payment-block > .payment-summary-grid {
    order: 2;
}

.payment-plan-payment-block > .payment-details-grid {
    order: 3;
}

.payment-plan-payment-block > .payment-amount-field {
    order: 4;
    width: min(420px, 100%);
}

.payment-plan-payment-block + .immediate-plan-summary,
.payment-plan-payment-block + .alert.warning {
    margin-top: 2px;
}

.payment-section-title {
    gap: 2px;
}

.payment-section-title strong {
    font-size: 16px;
    color: #0f172a;
}

.plan-quick-picks {
    gap: 7px;
}

.plan-quick-chip {
    min-height: 30px;
    padding: 0 12px;
    border-color: #9bd8e3;
    background: #e9f9fc;
    color: #075985;
    font-size: 12px;
}

.plan-quick-chip.is-selected,
.plan-quick-chip:hover {
    border-color: #0788a7;
    background: linear-gradient(135deg, #0788a7, #10a99d);
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(8, 145, 178, .18);
}

.payment-form input,
.payment-form select,
.payment-form textarea {
    min-height: 38px;
    padding: 8px 10px;
    border-color: #b9c8d6;
    border-radius: 7px;
    background: #ffffff;
    color: #0f172a;
}

.payment-form input:focus,
.payment-form select:focus,
.payment-form textarea:focus,
.plan-search-control input:focus {
    outline: 0;
    border-color: #0891b2;
    box-shadow: 0 0 0 3px rgba(8, 145, 178, .14);
}

.plan-search-control input {
    min-height: 38px;
    border-color: #b9c8d6;
}

.payment-summary-grid {
    padding: 10px;
    gap: 10px;
    border: 0;
    border-bottom: 1px solid #dce6ee;
    border-radius: 0;
    background: transparent;
    padding: 0 0 11px;
}

.readonly-summary-field {
    min-height: 86px;
    padding: 13px 15px;
    border-color: #d1dbe7;
    background: #ffffff;
    box-shadow: 0 1px 0 rgba(15, 23, 42, .03);
}

.readonly-summary-field span {
    font-size: 11px;
}

.readonly-summary-field strong {
    font-size: 21px;
    color: #06192f;
}

#paymentValueDisplay {
    color: #04766e;
}

.readonly-summary-field small {
    font-size: 11px;
    line-height: 1.25;
}

.payment-details-grid {
    padding: 0;
    gap: 10px;
    border: 0;
    background: transparent;
}

.payment-details-grid > label {
    grid-template-rows: auto 38px;
}

.payment-details-grid > label small:not(.field-warning) {
    display: none;
}

.payment-form label {
    gap: 6px;
    font-size: 12px;
    font-weight: 800;
}

.payment-form small {
    font-size: 11px;
    line-height: 1.25;
}

.immediate-plan-summary {
    padding: 12px 14px;
    gap: 9px;
    border-color: #f3bd67;
    background: #fff8e8;
}

.immediate-plan-summary strong {
    color: #0f172a;
}

.immediate-plan-summary p {
    color: #6f4d17;
}

.group-members-section {
    padding: 13px 14px;
    border-color: #9bd8e3;
    background: #eef7fa;
}

.group-members-section legend {
    padding: 0 8px;
    color: #0f172a;
}

.group-members-header {
    gap: 6px;
}

.group-members-header > div {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.group-member-list {
    gap: 7px;
}

.group-member-chip,
.group-member-result {
    min-height: 48px;
    padding: 8px 10px;
    border-color: #d1dbe7;
    background: #ffffff;
}

.group-member-chip strong,
.group-member-result strong {
    font-size: 14px;
    color: #0f172a;
}

.group-member-chip .badge {
    padding: 5px 9px;
    background: #d9f7ef;
    color: #087466;
    border: 1px solid #a9e7d8;
}

.group-member-chip .danger-link {
    padding: 6px 10px;
    border-radius: 7px;
    background: #fff1f2;
    color: #be123c;
    text-decoration: none;
}

.group-member-search {
    gap: 8px;
    margin-top: 9px;
}

.group-member-search input:disabled {
    background: #eef2f7;
    color: #6b7280;
    border-style: dashed;
}

.payment-form > .actions {
    margin: 0;
    padding-top: 2px;
}

.payment-form > .actions button[type="submit"] {
    min-height: 40px;
    padding: 10px 18px;
    border-radius: 8px;
    background: linear-gradient(135deg, #0788a7, #10a99d);
    box-shadow: 0 10px 22px rgba(8, 145, 178, .22);
}

.payment-form > .actions .button.secondary {
    min-height: 40px;
    padding: 10px 16px;
    border: 1px solid #cbd5e1;
    background: #e5eaf0;
    color: #0f172a;
    box-shadow: none;
}

.payment-form .group-delete-panel {
    padding: 12px 14px;
    border-color: #fecb8b;
    background: #fff7ed;
}

.payment-form .group-delete-panel strong {
    color: #9a3412;
}

.payment-form .group-delete-panel p {
    color: #7c2d12;
}

.payment-form .payment-focus + .group-members-section {
    margin-top: 4px;
}

/* Default spacious header for the payment operation screen. */
.content:has(.payment-form) .topbar {
    min-height: auto;
    margin-bottom: 22px;
    padding: 18px 26px;
}

.content:has(.payment-form) .topbar h1 {
    font-size: 26px;
}

.payment-form .payment-client-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 2px 12px;
    min-height: 46px;
    padding: 8px 11px;
}

.payment-form .payment-client-summary span {
    grid-column: 1 / -1;
    font-size: 11px;
    white-space: nowrap;
}

.payment-form .payment-client-summary strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 20px;
}

.payment-form .payment-client-summary small {
    white-space: nowrap;
    font-size: 11px;
}

.payment-form > .payment-operation-field {
    padding: 7px 9px;
}

.payment-form > .payment-operation-field > span {
    display: none;
}

.payment-form .payment-focus legend {
    display: none;
}

.payment-operation-tab {
    min-height: 40px;
    padding: 7px 10px;
    align-content: center;
    border-left-width: 4px;
}

.payment-operation-tab strong {
    font-size: 14px;
}

.payment-operation-tab small {
    font-size: 11px;
}

.payment-operation-tab[data-operation-tab="renewal"] {
    border-left-color: #0891b2;
}

.payment-operation-tab[data-operation-tab="add_on"] {
    border-left-color: #14b8a6;
}

.payment-operation-tab[data-operation-tab="immediate_change"] {
    border-left-color: #0891b2;
}

.payment-operation-tab[data-operation-tab="add_on"].is-active {
    background: linear-gradient(135deg, #0d9488, #2dd4bf);
}

.payment-operation-tab[data-operation-tab="immediate_change"].is-active {
    background: linear-gradient(135deg, #0788a7, #10a99d);
}

.payment-focus {
    padding: 11px 12px;
}

.payment-sale-grid {
    gap: 9px;
}

.payment-plan-field,
.payment-plan-payment-block {
    padding: 9px 11px;
    border-color: var(--payment-section-surface-border);
    background: var(--payment-section-surface);
}

.payment-plan-field {
    gap: 7px;
}

.payment-plan-payment-block {
    gap: 7px;
}

.payment-section-title {
    margin-bottom: -2px;
}

.payment-section-title strong {
    font-size: 15px;
}

.payment-plan-field > small,
.payment-form .payment-date-field > small:not(.field-warning),
.payment-form .payment-start-field > small:not(.field-warning) {
    display: none;
}

.plan-quick-chip {
    min-height: 27px;
    padding-inline: 10px;
}

.plan-picker {
    gap: 6px;
}

.selected-plan-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 8px;
    align-items: center;
    min-height: 24px;
    padding: 5px 8px;
    border: 1px solid rgba(8, 145, 178, .2);
    border-radius: 7px;
    background: rgba(8, 145, 178, .08);
    color: #334155;
    font-size: 11px;
    font-weight: 800;
}

.selected-plan-summary:empty {
    display: none;
}

.selected-plan-summary b {
    color: #0f766e;
}

.plan-picker-list {
    max-height: 240px;
}

.plan-picker-option {
    min-height: 70px;
    padding: 8px;
}

.payment-summary-grid {
    gap: 7px;
    padding-bottom: 7px;
    align-items: stretch;
}

.payment-summary-grid:has([data-duration-summary][hidden]) {
    grid-template-columns: minmax(220px, 360px);
}

.readonly-summary-field {
    min-height: 58px;
    padding: 8px 10px;
    gap: 4px;
    background: var(--payment-section-inner-card);
}

.readonly-summary-field strong {
    font-size: 17px;
}

.readonly-summary-field small {
    font-size: 10px;
}

.new-plan-validity {
    display: grid;
    gap: 14px;
}

.current-plan-summary,
.new-plan-validity-main,
.current-plan-block,
.new-plan-block {
    display: grid;
    align-content: center;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 5px 7px;
    min-width: 0;
}

.current-plan-summary,
.current-plan-block {
    position: relative;
    padding-right: 18px;
    border-right: 1px solid rgba(148, 163, 184, .22);
}

.current-plan-block::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -5px;
    width: 9px;
    height: 9px;
    border-top: 1px solid rgba(8, 145, 178, .42);
    border-right: 1px solid rgba(8, 145, 178, .42);
    background: var(--panel-bg);
    transform: translateY(-50%) rotate(45deg);
}

.plan-compare-badge {
    display: inline-flex;
    flex: 0 0 auto;
    width: fit-content;
    padding: 2px 6px;
    border: 1px solid rgba(8, 145, 178, .22);
    border-radius: 999px;
    background: rgba(8, 145, 178, .08);
    color: #0f5f75;
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.new-plan-block .plan-compare-badge {
    border-color: rgba(20, 184, 166, .28);
    background: rgba(20, 184, 166, .1);
    color: #0f766e;
}

.current-plan-summary strong,
.new-plan-validity-main strong {
    overflow: hidden;
    color: #334155;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.readonly-summary-field .plan-compare-dates {
    display: block;
    grid-column: 1 / -1;
    color: #0f172a;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: 0;
    white-space: nowrap;
}

.payment-form.is-operation-modify .payment-summary-grid,
.payment-form.is-operation-membership .payment-summary-grid:has(.new-plan-validity.has-current-plan) {
    grid-template-columns: minmax(130px, .58fr) minmax(130px, .58fr) minmax(440px, 1.84fr);
}

.payment-form.is-operation-modify .new-plan-validity {
    grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
    align-items: stretch;
}

.payment-form.is-operation-membership .new-plan-validity.has-current-plan {
    grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
    align-items: stretch;
}

.payment-details-grid {
    gap: 7px;
}

.payment-details-grid > label {
    grid-template-rows: auto 34px;
}

.payment-form input,
.payment-form select,
.payment-form textarea,
.plan-search-control input {
    min-height: 34px;
    padding-top: 6px;
    padding-bottom: 6px;
}

.payment-form.is-operation-product .payment-plan-payment-block {
    background: var(--payment-section-surface);
}

.payment-form.is-operation-product .payment-summary-grid {
    border-bottom: 0;
    padding-bottom: 0;
}

.payment-form.is-operation-product .readonly-summary-field {
    max-width: 360px;
}

.group-members-section {
    padding: 9px 11px;
    border-color: var(--payment-section-surface-border);
    background: var(--payment-section-surface);
}

.group-members-section legend {
    font-size: 14px;
}

.group-members-header {
    gap: 4px;
}

.group-member-list {
    gap: 6px;
}

.group-member-chip,
.group-member-result {
    min-height: 34px;
    padding: 5px 8px;
    background: var(--payment-section-inner-card);
}

.group-member-chip .badge,
.group-member-chip .danger-link {
    padding: 4px 8px;
}

.group-member-search {
    gap: 6px;
    margin-top: 7px;
}

.payment-form .group-delete-panel {
    padding: 9px 12px;
    gap: 10px;
    border-color: var(--payment-section-danger-border);
    background: var(--payment-section-danger-surface);
}

.payment-form .group-delete-panel p {
    margin-top: 3px;
    line-height: 1.25;
}

@media (min-width: 1000px) and (max-width: 1400px) and (max-height: 820px) {
    .content:has(.payment-form) {
        padding-top: 14px;
        padding-bottom: 12px;
    }

    .content:has(.payment-form) .topbar {
        min-height: 44px;
        margin-bottom: 8px;
    }

    .content:has(.payment-form) .topbar h1 {
        font-size: 23px;
    }

    .payment-form {
        gap: 9px;
        padding: 12px;
    }

    .operation-compact-header {
        min-height: 46px;
        padding: 7px 10px;
    }

    .operation-client-info strong {
        font-size: 20px;
    }

    .operation-mode-selector .operation-mode-option {
        min-height: 34px;
        padding: 5px 9px;
    }

    .payment-form .payment-client-summary {
        min-height: 44px;
        padding: 7px 10px;
    }

    .payment-form .payment-client-summary strong {
        font-size: 20px;
    }

    .payment-form > .payment-operation-field {
        padding: 9px 12px 8px;
        margin-bottom: -5px;
    }

    .payment-operation-tab {
        min-height: 38px;
        padding: 6px 10px;
    }

    .payment-operation-tab strong {
        font-size: 14px;
    }

    .payment-focus,
    .group-members-section {
        padding: 11px 12px;
    }

    .payment-sale-grid {
        gap: 9px;
    }

    .payment-plan-field {
        padding: 10px 12px;
    }

    .payment-plan-payment-block {
        padding: 10px 12px;
        gap: 8px;
    }

    .payment-summary-grid,
    .payment-details-grid {
        padding: 0;
    }

    .payment-summary-grid {
        padding-bottom: 9px;
    }

    .readonly-summary-field {
        min-height: 54px;
        padding: 7px 9px;
        gap: 5px;
    }

    .readonly-summary-field strong {
        font-size: 16px;
    }

    .payment-form input,
    .payment-form select,
    .payment-form textarea,
    .plan-search-control input {
        min-height: 33px;
    }

    .payment-details-grid > label {
        grid-template-rows: auto 33px;
    }

    .immediate-plan-summary {
        padding: 10px 12px;
    }

    .group-member-chip,
    .group-member-result {
        min-height: 32px;
        padding: 5px 8px;
    }
}

@media (max-width: 1100px) {
    .payment-details-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .payment-form.is-operation-modify .payment-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .payment-form.is-operation-modify .new-plan-validity,
    .payment-form.is-operation-membership .new-plan-validity.has-current-plan {
        grid-template-columns: 1fr;
        grid-column: 1 / -1;
    }

    .payment-form.is-operation-modify .current-plan-summary {
        padding-right: 0;
        padding-bottom: 7px;
        border-right: 0;
        border-bottom: 1px solid rgba(148, 163, 184, .22);
    }

    .payment-form.is-operation-modify .current-plan-block::after {
        top: auto;
        right: 50%;
        bottom: -5px;
        transform: translateX(50%) rotate(135deg);
    }
}

@media (max-width: 760px) {
    .operation-compact-header {
        align-items: stretch;
        flex-direction: column;
        gap: 9px;
    }

    .operation-client-info {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }

    .operation-mode-selector {
        width: 100%;
        min-width: 0;
    }

    .payment-operation-tabs,
    .payment-summary-grid {
        grid-template-columns: 1fr;
    }

    .payment-details-grid {
        grid-template-columns: 1fr;
    }

    .payment-form .payment-client-summary {
        grid-template-columns: 1fr;
    }
}

/* Dark payment screen: navy surfaces, turquoise focus, strong readability. */
body.dark-mode .content:has(.payment-form) {
    --dark-bg: #071923;
    --dark-surface: #0f2430;
    --dark-card: #162f3d;
    --dark-card-soft: #1d3a49;
    --dark-border: rgba(148, 214, 225, .22);
    --dark-border-strong: rgba(148, 214, 225, .34);
    --dark-text: #f3f8fb;
    --dark-muted: #b8cbd4;
    --primary: #00b7c2;
    --primary-strong: #00d4c7;
    --payment-section-surface: #102c38;
    --payment-section-surface-border: rgba(148, 214, 225, .26);
    --payment-section-inner-card: #162f3d;
    --payment-section-danger-surface: rgba(88, 28, 35, .36);
    --payment-section-danger-border: rgba(251, 113, 133, .32);
    background: radial-gradient(circle at 30% 0, rgba(0, 183, 194, .12), transparent 34%), var(--dark-bg);
}

body.dark-mode .content:has(.payment-form) .topbar {
    min-height: auto;
    margin-bottom: 22px;
    padding: 18px 26px;
    background: rgba(7, 25, 35, .86);
    border-bottom-color: rgba(148, 214, 225, .16);
}

body.dark-mode .content:has(.payment-form) .topbar h1 {
    color: var(--dark-text);
    line-height: 1.2;
}

body.dark-mode .payment-form {
    border-color: var(--dark-border);
    background: linear-gradient(180deg, rgba(15, 36, 48, .98), rgba(10, 29, 39, .98));
    box-shadow: 0 18px 48px rgba(0, 0, 0, .32);
}

body.dark-mode .operation-compact-header {
    border-color: rgba(34, 211, 238, .28);
    background: linear-gradient(135deg, rgba(34, 211, 238, .12), rgba(20, 184, 166, .08)), #0f2430;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .22);
}

body.dark-mode .payment-form .payment-client-summary,
body.dark-mode .payment-plan-field,
body.dark-mode .payment-plan-payment-block,
body.dark-mode .payment-summary-grid,
body.dark-mode .payment-details-grid,
body.dark-mode .group-members-section {
    border-color: var(--dark-border);
    background: var(--dark-surface);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035), 0 10px 28px rgba(0, 0, 0, .14);
}

body.dark-mode .payment-form .payment-client-summary strong,
body.dark-mode .operation-client-info strong,
body.dark-mode .payment-form .payment-section-title strong,
body.dark-mode .payment-form legend,
body.dark-mode .readonly-summary-field strong,
body.dark-mode .immediate-plan-summary strong,
body.dark-mode .group-member-chip strong,
body.dark-mode .group-member-result strong {
    color: var(--dark-text);
}

body.dark-mode .payment-form .payment-client-summary span,
body.dark-mode .payment-form .payment-section-title span,
body.dark-mode .payment-form .payment-operation-field > span,
body.dark-mode .payment-form label,
body.dark-mode .readonly-summary-field span,
body.dark-mode .immediate-plan-summary span,
body.dark-mode .group-members-header strong {
    color: #d7e7ee;
}

body.dark-mode .payment-form .payment-client-summary small,
body.dark-mode .operation-client-info small,
body.dark-mode .payment-form small,
body.dark-mode .payment-form .readonly-summary-field small,
body.dark-mode .payment-form .group-member-chip small,
body.dark-mode .payment-form .group-member-result span {
    color: var(--dark-muted);
}

body.dark-mode .payment-form > .payment-operation-field {
    border-color: rgba(0, 212, 199, .28);
    background:
        linear-gradient(135deg, rgba(0, 183, 194, .18), rgba(0, 212, 199, .1)),
        var(--dark-surface);
    box-shadow: 0 14px 34px rgba(0, 0, 0, .24), inset 0 1px 0 rgba(255, 255, 255, .04);
}

body.dark-mode .payment-form > .payment-operation-field + .payment-focus {
    border-color: rgba(0, 212, 199, .24);
    background: #0b202b;
}

body.dark-mode .payment-operation-tab {
    border-color: var(--dark-border);
    background: var(--dark-card);
    color: var(--dark-text);
}

body.dark-mode .payment-operation-tab small {
    color: var(--dark-muted);
}

body.dark-mode .payment-operation-tab:hover,
body.dark-mode .payment-operation-tab:focus {
    border-color: rgba(0, 212, 199, .48);
    background: var(--dark-card-soft);
    box-shadow: 0 10px 24px rgba(0, 183, 194, .12);
}

body.dark-mode .payment-operation-tab.is-active {
    border-color: rgba(0, 212, 199, .62);
    background: linear-gradient(135deg, #008fa1, #00c2b3);
    color: #ffffff;
    box-shadow: 0 12px 32px rgba(0, 183, 194, .26), 0 0 0 1px rgba(255, 255, 255, .04) inset;
}

body.dark-mode .payment-operation-tab.is-active small {
    color: rgba(255, 255, 255, .88);
}

body.dark-mode .payment-focus {
    border-color: rgba(0, 212, 199, .22);
    background: #0b202b;
}

body.dark-mode .plan-quick-chip {
    border-color: rgba(0, 212, 199, .28);
    background: rgba(0, 183, 194, .12);
    color: #bffcff;
}

body.dark-mode .plan-quick-chip.is-selected,
body.dark-mode .plan-quick-chip:hover {
    border-color: rgba(0, 212, 199, .7);
    background: linear-gradient(135deg, #008fa1, #00c2b3);
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(0, 183, 194, .22);
}

body.dark-mode .payment-form input,
body.dark-mode .payment-form select,
body.dark-mode .payment-form textarea,
body.dark-mode .plan-search-control input {
    border-color: var(--dark-border-strong);
    background: #0b1f2a;
    color: var(--dark-text);
}

body.dark-mode .payment-form input::placeholder,
body.dark-mode .payment-form textarea::placeholder,
body.dark-mode .plan-search-control input::placeholder {
    color: #90a9b5;
}

body.dark-mode .payment-form input:focus,
body.dark-mode .payment-form select:focus,
body.dark-mode .payment-form textarea:focus,
body.dark-mode .plan-search-control input:focus {
    border-color: var(--primary-strong);
    box-shadow: 0 0 0 3px rgba(0, 212, 199, .16);
}

body.dark-mode .plan-search-clear {
    color: #a9c4cf;
}

body.dark-mode .plan-picker-list {
    border-color: var(--dark-border-strong);
    background: #0b1f2a;
    box-shadow: 0 18px 44px rgba(0, 0, 0, .42);
}

body.dark-mode .plan-picker-option {
    color: var(--dark-text);
}

body.dark-mode .plan-picker-option:hover,
body.dark-mode .plan-picker-option:focus,
body.dark-mode .plan-picker-option.is-selected {
    border-color: rgba(0, 212, 199, .34);
    background: rgba(0, 183, 194, .12);
}

body.dark-mode .plan-picker-option small,
body.dark-mode .plan-picker-empty {
    color: var(--dark-muted);
}

body.dark-mode .selected-plan-summary {
    border-color: rgba(0, 212, 199, .24);
    background: rgba(0, 183, 194, .12);
    color: var(--dark-muted);
}

body.dark-mode .selected-plan-summary b {
    color: #bffcff;
}

body.dark-mode .readonly-summary-field {
    border-color: var(--dark-border);
    background: var(--dark-card);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}

body.dark-mode #paymentValueDisplay {
    color: var(--primary-strong);
}

body.dark-mode .payment-details-grid {
    background: var(--dark-surface);
}

body.dark-mode .payment-plan-payment-block {
    border-color: var(--payment-section-surface-border);
    background: var(--payment-section-surface);
}

body.dark-mode .payment-plan-field {
    border-color: var(--payment-section-surface-border);
    background: var(--payment-section-surface);
}

body.dark-mode .payment-form.is-operation-product .payment-plan-payment-block {
    background: var(--payment-section-surface);
}

body.dark-mode .payment-plan-payment-block .payment-summary-grid {
    border-bottom-color: rgba(148, 214, 225, .18);
    background: transparent;
}

body.dark-mode .payment-plan-payment-block .payment-details-grid {
    background: transparent;
}

body.dark-mode .current-plan-summary {
    border-right-color: rgba(148, 214, 225, .2);
    border-bottom-color: rgba(148, 214, 225, .2);
}

body.dark-mode .current-plan-block::after {
    border-color: rgba(34, 211, 238, .34);
    background: var(--dark-card);
}

body.dark-mode .current-plan-summary strong {
    color: var(--dark-text);
}

body.dark-mode .readonly-summary-field .plan-compare-dates {
    color: var(--dark-text);
}

body.dark-mode .plan-compare-badge {
    border-color: rgba(34, 211, 238, .24);
    background: rgba(34, 211, 238, .1);
    color: #bffcff;
}

body.dark-mode .new-plan-block .plan-compare-badge {
    border-color: rgba(20, 184, 166, .28);
    background: rgba(20, 184, 166, .12);
    color: #99f6e4;
}

body.dark-mode .group-members-section {
    border-color: var(--payment-section-surface-border);
    background: var(--payment-section-surface);
}

body.dark-mode .group-member-chip,
body.dark-mode .group-member-result {
    border-color: var(--dark-border);
    background: var(--dark-card);
}
body.dark-mode .group-member-result.has-historical-overlap {
    border-color: rgba(251, 191, 36, .34);
    background: rgba(120, 53, 15, .2);
}
body.dark-mode .group-member-result em {
    color: #fde68a;
}

body.dark-mode .group-member-chip .badge {
    border-color: rgba(0, 212, 199, .3);
    background: rgba(0, 183, 194, .18);
    color: #bffcff;
}

body.dark-mode .group-member-chip .danger-link {
    background: rgba(190, 18, 60, .18);
    color: #fecdd3;
}

body.dark-mode .group-member-search input:disabled {
    border-color: rgba(148, 214, 225, .15);
    background: rgba(11, 31, 42, .68);
    color: #8eabb7;
}

body.dark-mode .payment-form > .actions button[type="submit"] {
    background: linear-gradient(135deg, #008fa1, #00d4c7);
    box-shadow: 0 12px 28px rgba(0, 183, 194, .28);
}

body.dark-mode .payment-form > .actions button[type="submit"]:hover {
    background: linear-gradient(135deg, #00a8bb, #17e6d9);
    box-shadow: 0 14px 34px rgba(0, 212, 199, .32);
}

body.dark-mode .payment-form > .actions .button.secondary {
    border-color: var(--dark-border);
    background: var(--dark-card);
    color: var(--dark-text);
}

body.dark-mode .payment-form > .actions .button.secondary:hover {
    border-color: rgba(0, 212, 199, .34);
    background: var(--dark-card-soft);
}

body.dark-mode .payment-form .group-delete-panel {
    border-color: var(--payment-section-danger-border);
    background: var(--payment-section-danger-surface);
}

body.dark-mode .payment-form .group-delete-panel strong {
    color: #fecdd3;
}

body.dark-mode .payment-form .group-delete-panel p {
    color: #fda4af;
}

/* The payment fieldset is only structural; visual grouping lives on each section card. */
.payment-form .payment-focus {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

body.dark-mode .payment-form .payment-focus {
    border: 0;
    background: transparent;
    box-shadow: none;
}

.payment-confirm-modal[hidden] {
    display: none;
}

.payment-confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 22px;
}

.payment-confirm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .58);
    backdrop-filter: blur(5px);
}

.payment-confirm-dialog {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: min(940px, calc(100vw - 44px));
    max-height: min(720px, calc(100vh - 44px));
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, .35);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
}

.payment-confirm-header {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 20px 22px;
    border-bottom: 1px solid #dbe7ef;
    background: linear-gradient(135deg, #f8fafc, #e6f7fb);
}

.payment-confirm-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 8px;
    background: #0891b2;
    color: #fff;
    font-size: 26px;
    font-weight: 900;
}

.payment-confirm-header strong {
    display: block;
    color: #0f172a;
    font-size: 26px;
    line-height: 1.08;
}

.payment-confirm-header p {
    margin: 5px 0 0;
    color: #475569;
    font-size: 15px;
    font-weight: 800;
}

.payment-confirm-body {
    display: grid;
    gap: 14px;
    padding: 18px 22px;
    overflow: auto;
}

.payment-confirm-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.payment-confirm-fact {
    display: grid;
    gap: 5px;
    min-height: 74px;
    padding: 13px 14px;
    border: 1px solid #d7e3ea;
    border-radius: 8px;
    background: #f8fafc;
}

.payment-confirm-fact span {
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.payment-confirm-fact strong {
    color: #0f172a;
    font-size: 17px;
    line-height: 1.18;
}

.payment-confirm-fact.is-new,
.payment-confirm-fact.is-changed {
    border-color: rgba(8, 145, 178, .45);
    background: #e8f8fb;
}

.payment-confirm-fact.is-new span,
.payment-confirm-fact.is-changed span,
.payment-confirm-before-after article:last-child span {
    color: #004cff;
}

.payment-confirm-fact.is-new strong,
.payment-confirm-fact.is-changed strong,
.payment-confirm-before-after article:last-child strong {
    color: #0f3f4f;
}

.payment-confirm-before-after {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
}

.payment-confirm-before-after article {
    display: grid;
    gap: 7px;
    min-height: 116px;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #d7e3ea;
    background: #f8fafc;
}

.payment-confirm-before-after article:last-child {
    border-color: rgba(8, 145, 178, .5);
    background: #e8f8fb;
}

.payment-confirm-before-after span,
.payment-confirm-section h3 {
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.payment-confirm-before-after strong {
    color: #0f172a;
    font-size: 22px;
    line-height: 1.1;
}

.payment-confirm-before-after small {
    color: #475569;
    font-size: 14px;
    font-weight: 850;
}

.payment-confirm-warning {
    padding: 15px 16px;
    border: 1px solid rgba(245, 158, 11, .45);
    border-radius: 8px;
    background: #fff7ed;
}

.payment-confirm-warning strong {
    display: block;
    color: #9a3412;
    font-size: 18px;
}

.payment-confirm-warning p {
    margin: 5px 0 0;
    color: #7c2d12;
    font-weight: 850;
}

.payment-confirm-warning.is-replace {
    border-color: rgba(6, 182, 212, .4);
    background: #ecfeff;
}

.payment-confirm-warning.is-replace strong,
.payment-confirm-warning.is-replace p {
    color: #155e75;
}

.payment-confirm-warning.is-replace strong {
    color: #92400e;
}

.payment-confirm-warning.is-replace p {
    color: #0f3f4f;
}

.payment-confirm-warning.is-soft {
    border-color: rgba(100, 116, 139, .28);
    background: #f8fafc;
}

.payment-confirm-warning.is-soft strong,
.payment-confirm-warning.is-soft p {
    color: #334155;
}

.payment-confirm-section {
    display: grid;
    gap: 8px;
}

.payment-confirm-change-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.payment-confirm-change-list li {
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid #d7e3ea;
    background: #f8fafc;
    color: #0f172a;
    font-weight: 850;
}

.payment-confirm-change-list li.is-add {
    border-color: rgba(22, 163, 74, .35);
    background: #f0fdf4;
}

.payment-confirm-change-list li.is-remove {
    border-color: rgba(220, 38, 38, .28);
    background: #fff1f2;
}

.payment-confirm-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 22px;
    border-top: 1px solid #dbe7ef;
    background: #f8fafc;
}

.payment-confirm-footer .button,
.payment-confirm-footer button {
    min-height: 42px;
    padding-inline: 18px;
}

.payment-confirm-modal[data-tone="modify"] .payment-confirm-icon {
    background: #0e7490;
}

.payment-confirm-modal[data-tone="danger"] .payment-confirm-icon,
.payment-confirm-modal[data-tone="danger"] .payment-confirm-footer .button:not(.secondary) {
    background: #dc2626;
}

.payment-confirm-modal[data-tone="product"] .payment-confirm-icon {
    background: #7c3aed;
}

body.modal-open {
    overflow: hidden;
}

body.dark-mode .payment-confirm-dialog,
body.dark-mode .payment-confirm-header,
body.dark-mode .payment-confirm-footer {
    background: #0b1324;
    border-color: rgba(125, 211, 252, .18);
}

body.dark-mode .payment-confirm-dialog {
    box-shadow: 0 26px 80px rgba(0, 0, 0, .42);
}

body.dark-mode .payment-confirm-header {
    background: linear-gradient(135deg, #0f1b31, #0b2d3a);
}

body.dark-mode .payment-confirm-footer {
    background: #0d182b;
}

body.dark-mode .payment-confirm-header strong,
body.dark-mode .payment-confirm-before-after strong,
body.dark-mode .payment-confirm-fact strong,
body.dark-mode .payment-confirm-change-list li {
    color: #f3fbff;
}

body.dark-mode .payment-confirm-header p,
body.dark-mode .payment-confirm-before-after small {
    color: #c5d7e8;
}

body.dark-mode .payment-confirm-fact,
body.dark-mode .payment-confirm-before-after article,
body.dark-mode .payment-confirm-change-list li {
    background: #101b30;
    border-color: rgba(148, 163, 184, .22);
}

body.dark-mode .payment-confirm-before-after article:last-child,
body.dark-mode .payment-confirm-fact.is-new,
body.dark-mode .payment-confirm-fact.is-changed {
    background: linear-gradient(135deg, rgba(8, 145, 178, .22), rgba(20, 184, 166, .1));
    border-color: rgba(34, 211, 238, .38);
}

body.dark-mode .payment-confirm-before-after span,
body.dark-mode .payment-confirm-section h3,
body.dark-mode .payment-confirm-fact span {
    color: #8fb1c9;
}

body.dark-mode .payment-confirm-before-after article:last-child span,
body.dark-mode .payment-confirm-fact.is-new span,
body.dark-mode .payment-confirm-fact.is-changed span {
    color: #39ff5f;
}

body.dark-mode .payment-confirm-before-after article:last-child strong,
body.dark-mode .payment-confirm-fact.is-new strong,
body.dark-mode .payment-confirm-fact.is-changed strong {
    color: #ffffff;
}

body.dark-mode .payment-confirm-before-after article:last-child small {
    color: #dff8ff;
}

body.dark-mode .payment-confirm-warning {
    background: linear-gradient(135deg, rgba(14, 116, 144, .24), rgba(20, 184, 166, .13));
    border-color: rgba(103, 232, 249, .38);
}

body.dark-mode .payment-confirm-warning strong {
    color: #a5f3fc;
}

body.dark-mode .payment-confirm-warning p {
    color: #d9fbff;
}

body.dark-mode .payment-confirm-warning.is-add {
    background: linear-gradient(135deg, rgba(146, 64, 14, .28), rgba(8, 145, 178, .16));
    border-color: rgba(251, 191, 36, .38);
}

body.dark-mode .payment-confirm-warning.is-add strong {
    color: #fde68a;
}

body.dark-mode .payment-confirm-warning.is-add p {
    color: #fff7d6;
}

body.dark-mode .payment-confirm-warning.is-replace strong {
    color: #d6ff2f;
}

body.dark-mode .payment-confirm-warning.is-replace p {
    color: #f4fbff;
}

body.dark-mode .payment-confirm-warning.is-soft {
    background: rgba(30, 41, 59, .7);
    border-color: rgba(148, 163, 184, .28);
}

body.dark-mode .payment-confirm-change-list li.is-add {
    background: rgba(20, 83, 45, .34);
    border-color: rgba(74, 222, 128, .32);
}

body.dark-mode .payment-confirm-change-list li.is-remove {
    background: rgba(127, 29, 29, .28);
    border-color: rgba(251, 113, 133, .34);
}

body.dark-mode .payment-confirm-footer .button.secondary {
    background: #172238;
    border-color: rgba(148, 163, 184, .28);
    color: #f3fbff;
}

body.dark-mode .payment-confirm-footer .button.secondary:hover {
    background: #1f2f4c;
}

@media (min-width: 1000px) and (max-width: 1400px) and (max-height: 820px) {
    .payment-confirm-modal {
        padding: 14px;
    }

    .payment-confirm-dialog {
        width: min(900px, calc(100vw - 28px));
        max-height: calc(100vh - 28px);
    }

    .payment-confirm-header {
        grid-template-columns: 46px minmax(0, 1fr);
        gap: 12px;
        padding: 14px 16px;
    }

    .payment-confirm-icon {
        width: 42px;
        height: 42px;
        font-size: 22px;
    }

    .payment-confirm-header strong {
        font-size: 22px;
    }

    .payment-confirm-header p {
        font-size: 13px;
    }

    .payment-confirm-body {
        gap: 10px;
        padding: 12px 16px;
    }

    .payment-confirm-grid {
        gap: 8px;
    }

    .payment-confirm-fact {
        min-height: 62px;
        padding: 10px 12px;
    }

    .payment-confirm-fact strong {
        font-size: 15px;
    }

    .payment-confirm-before-after article {
        min-height: 96px;
        padding: 12px;
    }

    .payment-confirm-before-after strong {
        font-size: 18px;
    }

    .payment-confirm-warning {
        padding: 11px 13px;
    }

    .payment-confirm-warning strong {
        font-size: 16px;
    }

    .payment-confirm-warning p,
    .payment-confirm-change-list li {
        font-size: 13px;
    }

    .payment-confirm-footer {
        padding: 12px 16px;
    }
}

@media (max-width: 760px) {
    .payment-confirm-modal {
        padding: 10px;
    }

    .payment-confirm-dialog {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
    }

    .payment-confirm-grid,
    .payment-confirm-before-after {
        grid-template-columns: 1fr;
    }

    .payment-confirm-footer {
        display: grid;
    }
}

@media (min-width: 1000px) and (max-width: 1400px) and (max-height: 820px) {
    body.dark-mode .content:has(.payment-form) .topbar {
        min-height: 54px;
        padding-top: 8px;
        padding-bottom: 8px;
    }
}

/* Keep the plan editor independent from the global dark/light surface rules. */
.settings-modal-card .settings-plan-form,
.settings-modal-card .settings-plan-form-title,
.settings-modal-card .settings-plan-form-body,
.settings-modal-card .settings-plan-form-footer {
    background-color: #ffffff;
    color: #1f2933;
}

.settings-modal-card .settings-plan-card {
    background: #f8fafc;
}

.settings-modal-card .settings-plan-form label,
.settings-modal-card .settings-plan-form legend {
    color: #475569;
}

.settings-modal-card .settings-plan-form small,
.settings-modal-card .settings-plan-form-title p {
    color: #64748b;
}

.settings-modal-card .settings-plan-form input,
.settings-modal-card .settings-plan-form select,
.settings-modal-card .settings-plan-form textarea {
    height: 44px;
    min-height: 44px;
    background: #ffffff;
    color: #1f2933;
}

.settings-modal-card .plan-code-field input {
    background: #eef2f7;
    color: #64748b;
}

/* Client profile compact mode lives at the end so global typography polish cannot loosen it. */
@media (min-width: 1000px) and (max-width: 1400px) and (max-height: 820px) {
    .client-plan-summary-grid div {
        line-height: 1.2;
    }

    .client-plan-summary-grid span {
        line-height: 1.15;
    }

    .client-plan-summary-grid strong,
    .client-progress-card .badge-summary strong {
        line-height: 1.2;
    }

    .client-progress-card .badge-summary p {
        line-height: 1.3;
    }
}

/* Shared compact header for laptop-height screens such as 1360x768. */
@media (min-width: 1000px) and (max-width: 1400px) and (max-height: 820px) {
    .content:not(.main-kiosk) {
        padding-top: 16px;
    }

    .content:not(.main-kiosk) .topbar {
        min-height: 54px;
        margin-top: -16px;
        margin-bottom: 12px;
        padding-top: 4px;
        padding-bottom: 4px;
    }

    .content:not(.main-kiosk) .topbar-title {
        gap: 2px;
    }

    .content:not(.main-kiosk) .topbar-title > span {
        font-size: 11px;
        line-height: 1.1;
    }

    .content:not(.main-kiosk) .topbar h1 {
        font-size: 24px;
        line-height: 1.08;
    }

    .content:not(.main-kiosk) .topbar-actions {
        gap: 8px;
    }

    .content:not(.main-kiosk) .sidebar-toggle,
    .content:not(.main-kiosk) .theme-toggle,
    .content:not(.main-kiosk) .user-chip {
        min-height: 32px;
        height: 32px;
    }

    .content:not(.main-kiosk) .sidebar-toggle {
        min-width: 78px;
        padding-inline: 10px;
    }

    .content:not(.main-kiosk) .theme-toggle {
        min-width: 68px;
        padding-inline: 11px;
    }

    .content:not(.main-kiosk) .user-chip {
        padding: 5px 9px 5px 11px;
    }
}

.routine-admin-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.routine-admin-tabs a {
    padding: 10px 14px;
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    background: color-mix(in srgb, var(--panel-bg) 86%, transparent);
    color: var(--text);
    font-weight: 800;
}
.routine-admin-tabs a.active,
.routine-admin-tabs a:hover {
    background: var(--button-bg);
    color: var(--button-text);
    border-color: var(--button-bg);
}
.routine-admin-tabs a.has-routine-requests {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    animation: routineRequestTabPulse 2.2s ease-in-out infinite;
}
.routine-admin-tabs a.has-routine-requests b {
    min-width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    padding: 0 7px;
    border-radius: 999px;
    background: #f59e0b;
    color: #111827;
    font-size: 12px;
    font-weight: 950;
}
@keyframes routineRequestTabPulse {
    0%, 100% {
        box-shadow: 0 0 0 rgba(245, 158, 11, 0);
    }
    50% {
        border-color: rgba(245, 158, 11, .6);
        box-shadow: 0 0 0 4px rgba(245, 158, 11, .12);
    }
}
.routine-admin-panel h2,
.routine-builder h2 {
    margin-top: 0;
}
.routine-exercise-form {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.routine-wide {
    grid-column: 1 / -1;
}
.routine-exercise-table th,
.routine-exercise-table td {
    vertical-align: middle;
}
.inline-form {
    display: inline;
}
.routine-admin-video-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(2, 8, 23, .78);
}
.routine-admin-video-dialog {
    width: min(900px, 94vw);
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, .35);
    border-radius: 8px;
    background: var(--panel-bg);
    box-shadow: 0 24px 70px rgba(0,0,0,.35);
}
.routine-admin-video-dialog > button {
    justify-self: end;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 999px;
}
.routine-admin-video-dialog iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: 6px;
    background: #000;
}
.routine-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.routine-section-heading h2,
.routine-summary-head h2,
.routine-edit-dialog h2 {
    margin: 0;
}
.routine-section-heading p,
.routine-summary-head p {
    margin: 5px 0 0;
    color: var(--muted);
}
.routine-plans-table th,
.routine-plans-table td {
    vertical-align: middle;
}
.routine-plan-actions {
    min-width: 300px;
}
.routine-plan-actions form,
.routine-plan-actions button {
    margin: 2px;
}
.routine-request-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}
.routine-request-admin-card {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: var(--input-bg);
}
.routine-request-admin-card img {
    width: 74px;
    height: 74px;
    border-radius: 999px;
    object-fit: cover;
}
.routine-request-admin-card span,
.routine-request-admin-card dd {
    color: var(--muted);
}
.routine-request-admin-card dl {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 5px 10px;
    margin: 0;
}
.routine-request-assign {
    border: 1px solid rgba(8, 145, 178, .24);
    border-radius: 8px;
    padding: 10px;
    background: color-mix(in srgb, var(--panel-bg) 82%, transparent);
}
.routine-request-assign summary {
    cursor: pointer;
    color: #0891b2;
    font-weight: 900;
}
.routine-request-assign form {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}
.routine-assign-search {
    display: grid;
    gap: 8px;
}
.routine-assign-search label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-weight: 800;
}
.routine-assign-search input {
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid rgba(8, 145, 178, .35);
    border-radius: 8px;
    background: color-mix(in srgb, var(--panel-bg) 72%, #020617);
    color: var(--text);
}
.routine-assign-search input:focus {
    outline: 0;
    border-color: #0891b2;
    box-shadow: 0 0 0 3px rgba(8, 145, 178, .14);
}
.routine-assign-selected {
    min-height: 34px;
    padding: 8px 10px;
    border: 1px solid rgba(34, 197, 94, .22);
    border-radius: 8px;
    background: rgba(34, 197, 94, .08);
    color: var(--text);
    font-weight: 900;
}
.routine-assign-results {
    display: grid;
    gap: 6px;
    max-height: 260px;
    overflow: auto;
    padding: 4px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: rgba(2, 6, 23, .16);
}
.routine-assign-results button {
    display: grid;
    gap: 3px;
    width: 100%;
    min-height: 50px;
    padding: 9px 11px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}
.routine-assign-results button:hover,
.routine-assign-results button.is-selected {
    border-color: rgba(8, 145, 178, .42);
    background: rgba(8, 145, 178, .14);
}
.routine-assign-results button span,
.routine-assign-empty {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}
.routine-assign-empty {
    padding: 8px 10px;
}
.routine-request-admin-card dt {
    font-weight: 900;
}
.routine-request-admin-card dd {
    margin: 0;
}
.routine-builder-modal[hidden] {
    display: none;
}
.routine-builder-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 24px;
}
.routine-builder-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, .72);
    backdrop-filter: blur(5px);
}
.routine-builder-dialog {
    position: relative;
    z-index: 1;
    width: min(1500px, calc(100vw - 44px));
    max-height: calc(100vh - 44px);
    overflow: auto;
    margin: 0;
}
.routine-builder-modal-head {
    position: sticky;
    top: 0;
    z-index: 4;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin: -4px -4px 16px;
    padding: 12px 4px 14px;
    border-bottom: 1px solid var(--panel-border);
    background: var(--panel-bg);
}
.routine-builder-modal-head h2 {
    margin: 2px 0 0;
}
.routine-type-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(14, 165, 233, .14);
    color: #38bdf8;
    font-size: 12px;
    font-weight: 900;
}
.routine-type-pill.personal {
    background: rgba(34, 197, 94, .16);
    color: #22c55e;
}
.routine-summary-dialog,
.routine-edit-dialog {
    width: min(980px, 94vw);
    max-height: min(860px, calc(100vh - 34px));
    overflow: auto;
}
.routine-summary-dialog > button,
.routine-edit-dialog > button {
    position: sticky;
    top: 0;
    margin-left: auto;
    z-index: 2;
}
.routine-summary-head {
    display: grid;
    gap: 8px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--panel-border);
}
.routine-summary-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.routine-summary-meta span {
    padding: 6px 9px;
    border-radius: 999px;
    background: rgba(148, 163, 184, .14);
    color: var(--muted);
    font-weight: 800;
}
.routine-summary-days {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}
.routine-summary-day {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: color-mix(in srgb, var(--panel-bg) 92%, transparent);
}
.routine-summary-day h3 {
    margin: 0;
    font-size: 17px;
}
.routine-summary-exercise,
.routine-summary-text {
    display: grid;
    gap: 5px;
    padding: 10px;
    border-radius: 8px;
    background: var(--input-bg);
}
.routine-summary-text {
    border-left: 4px solid #38bdf8;
}
.routine-summary-exercise {
    border-left: 4px solid #22c55e;
}
.routine-summary-exercise div {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.routine-summary-exercise small {
    padding: 4px 7px;
    border-radius: 999px;
    background: rgba(148, 163, 184, .14);
    color: var(--muted);
    font-weight: 800;
}
.routine-summary-text p,
.routine-summary-empty {
    margin: 0;
    color: var(--muted);
}
.routine-edit-form {
    display: grid;
    gap: 12px;
}
.routine-edit-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
}
.routine-edit-options label {
    display: flex;
    align-items: center;
    gap: 8px;
}
.routine-edit-options input {
    width: auto;
}
.routine-builder-head {
    display: grid;
    grid-template-columns: minmax(240px, 2fr) minmax(120px, .7fr);
    gap: 14px;
    margin-bottom: 14px;
}
.routine-destination {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, max-content)) minmax(260px, 1fr);
    gap: 12px;
    align-items: start;
    margin-bottom: 16px;
    padding: 12px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
}
.routine-destination label {
    display: flex;
    align-items: center;
    gap: 8px;
}
.routine-destination input[type="radio"] {
    width: auto;
}
.routine-client-picker {
    display: grid;
    gap: 8px;
}
.routine-client-results {
    display: grid;
    gap: 6px;
}
.routine-client-results button {
    width: 100%;
    text-align: left;
    background: color-mix(in srgb, var(--panel-bg) 82%, var(--button-bg));
    color: var(--text);
}
.routine-client-chip {
    width: fit-content;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(34, 197, 94, .16);
    color: #22c55e;
    font-weight: 800;
}
.routine-client-chip {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    border-radius: 8px;
}
.routine-client-selected {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 7px;
    border-radius: 999px;
    background: rgba(34, 197, 94, .14);
}
.routine-client-selected button {
    width: 22px;
    height: 22px;
    padding: 0;
    border-radius: 999px;
    background: rgba(15, 23, 42, .22);
    color: currentColor;
}
.routine-builder-grid {
    display: grid;
    grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}
.routine-library,
.routine-preview {
    min-height: 520px;
    padding: 14px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: color-mix(in srgb, var(--panel-bg) 92%, transparent);
}
.routine-preview {
    box-shadow: inset 0 0 0 1px rgba(34, 211, 238, .05);
}
.routine-library-tools {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}
.routine-library-list {
    display: grid;
    gap: 8px;
    max-height: 560px;
    overflow: auto;
    padding-right: 4px;
}
.routine-library-card {
    position: relative;
    display: grid;
    gap: 4px;
    padding: 11px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--input-bg) 94%, #0ea5e9), var(--input-bg));
    cursor: grab;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.routine-library-card:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--button-bg) 58%, var(--panel-border));
    box-shadow: 0 10px 24px rgba(2, 8, 23, .16);
}
.routine-library-card:active {
    cursor: grabbing;
}
.routine-library-card.is-dragging,
.routine-preview-item.is-dragging {
    opacity: .54;
    border-color: #0891b2;
    box-shadow: 0 14px 32px rgba(8, 145, 178, .22);
}
.routine-library-card strong {
    padding-right: 18px;
}
.routine-library-card::after {
    content: "↕";
    position: absolute;
    top: 10px;
    right: 10px;
    color: var(--muted);
    font-weight: 900;
}
.routine-library-card span {
    color: var(--muted);
    font-size: 13px;
}
.routine-text-source {
    margin-bottom: 10px;
    border-style: dashed;
    border-color: #0ea5e9;
    background: #dbeafe;
    color: #075985;
    font-weight: 900;
}
body.dark-mode .routine-text-source {
    border-color: rgba(103, 232, 249, .72);
    background: rgba(8, 47, 73, .72);
    color: #cffafe;
}
body.dark-mode .routine-library-card.is-dragging,
body.dark-mode .routine-preview-item.is-dragging {
    border-color: #67e8f9;
    box-shadow: 0 16px 36px rgba(34, 211, 238, .18);
}
.routine-day-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.routine-day-tabs button {
    background: #64748b;
    border: 1px solid transparent;
}
.routine-day-tabs button.active {
    background: var(--button-bg);
    border-color: rgba(255, 255, 255, .34);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, .14);
}
.routine-day-drop {
    position: relative;
    display: grid;
    align-content: start;
    gap: 10px;
    min-height: 430px;
    padding: 12px;
    border: 1px dashed color-mix(in srgb, var(--panel-border) 70%, var(--button-bg));
    border-radius: 8px;
}
.routine-day-drop::before {
    content: "Dia activo";
    position: absolute;
    top: -11px;
    left: 12px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--panel-bg);
    color: #67e8f9;
    font-size: 11px;
    font-weight: 900;
}
.routine-drop-empty {
    display: grid;
    place-items: center;
    min-height: 160px;
    color: var(--muted);
    text-align: center;
    font-weight: 800;
}
.routine-drop-indicator {
    position: relative;
    height: 18px;
    margin: 1px 0;
    border-radius: 999px;
    background: rgba(8, 145, 178, .12);
    box-shadow: inset 0 0 0 1px rgba(8, 145, 178, .34), 0 8px 18px rgba(8, 145, 178, .12);
    pointer-events: none;
}
.routine-drop-indicator::before {
    content: "";
    position: absolute;
    inset: 7px 10px auto;
    height: 3px;
    border-radius: 999px;
    background: #0891b2;
    box-shadow: 0 0 12px rgba(8, 145, 178, .38), 0 0 0 1px rgba(255, 255, 255, .35);
}
.routine-drop-indicator span {
    position: absolute;
    top: 50%;
    left: 18px;
    transform: translateY(-50%);
    padding: 2px 7px;
    border-radius: 999px;
    background: #f8fafc;
    color: #075985;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0;
}
body.dark-mode .routine-drop-indicator {
    background: rgba(34, 211, 238, .16);
    box-shadow: inset 0 0 0 1px rgba(103, 232, 249, .30), 0 8px 20px rgba(34, 211, 238, .12);
}
body.dark-mode .routine-drop-indicator::before {
    background: #67e8f9;
    box-shadow: 0 0 14px rgba(34, 211, 238, .54), 0 0 0 1px rgba(255, 255, 255, .16);
}
body.dark-mode .routine-drop-indicator span {
    background: #083344;
    color: #e0faff;
}
.routine-preview-item {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: var(--input-bg);
    border-left: 4px solid #22c55e;
    cursor: grab;
}
.routine-preview-item:has(textarea) {
    border-left-color: #38bdf8;
}
.routine-preview-item::before {
    content: "↕";
    position: absolute;
    top: 9px;
    right: 52px;
    color: var(--muted);
    font-weight: 900;
}
.routine-preview-item span {
    color: var(--muted);
    font-size: 13px;
}
.routine-preview-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.routine-preview-meta small {
    padding: 4px 7px;
    border-radius: 999px;
    background: rgba(148, 163, 184, .14);
    color: var(--muted);
    font-weight: 800;
}
.routine-preview-item textarea {
    grid-column: 1;
    min-height: 74px;
}
.routine-editing-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid rgba(34, 197, 94, .35);
    border-radius: 8px;
    background: rgba(34, 197, 94, .12);
}
.routine-editing-banner strong {
    color: #22c55e;
}
.routine-preview-item button {
    grid-column: 2;
    grid-row: 1 / span 2;
    width: 34px;
    height: 34px;
    padding: 0;
    background: #dc2626;
    border-radius: 999px;
    font-size: 18px;
    line-height: 1;
}
.routine-save-row {
    justify-content: flex-end;
    margin-top: 14px;
}
@media (max-width: 1000px) {
    .routine-exercise-form,
    .routine-builder-head,
    .routine-destination,
    .routine-builder-grid {
        grid-template-columns: 1fr;
    }
}
