@font-face {
    font-family: Manrope;
    src: url('manrope.ttf') format('truetype');
    font-weight: 200 800;
    font-display: swap;
}

:root {
    color-scheme: dark;
    --bg: #111214;
    --surface: #191b1e;
    --surface-raised: #202226;
    --ink: #f0f1f3;
    --muted: #9da1a8;
    --line: #303237;
    --primary: #ff9400;
    --primary-dark: #ffac38;
    --accent: #ff9400;
    --ok: #7adbb1;
    --warn: #f3c76d;
    --danger: #ff939b;
    --shadow: none;
    --sidebar-width: 232px;
}

* { letter-spacing: 0; scrollbar-width: thin; scrollbar-color: #45484e #191b1e; }
body { font-family: Manrope, Arial, sans-serif; font-size: 13px; line-height: 1.55; }
button, input, select, textarea { font-family: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
button, .button, a { transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
h1, h2, h3, p, strong, label { overflow-wrap: break-word; }
h1, .workspace-module .topbar h1 { font-size: 27px; font-weight: 750; line-height: 1.25; margin: 0; }
h2 { font-size: 16px; font-weight: 700; }
h3 { font-size: 15px; }
.lucide { width: 18px; height: 18px; stroke-width: 1.7px; flex: 0 0 18px; }
.eyebrow { margin-bottom: 7px; font-size: 11px; font-weight: 600; color: var(--muted); }
.hint { line-height: 1.7; font-size: 12px; }

/* Shared application frame. The configured menu color remains a subtle tint. */
.sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 50;
    display: flex; flex-direction: column; width: var(--sidebar-width); height: 100dvh;
    gap: 0; padding: 0 14px; color: var(--ink);
    background: #0c0d0f;
    background: color-mix(in srgb, var(--menu-color, #0c0d0f) 16%, #0c0d0f);
    border-right: 1px solid #282a2e; overflow: hidden;
}
.brand { min-height: 90px; flex: 0 0 auto; gap: 10px; padding: 18px 3px; }
.brand-mark { width: 47px; height: 47px; flex: 0 0 47px; border-radius: 0; background: transparent; object-fit: contain; }
.brand > div { min-width: 0; }
.brand strong { display: block; font-size: 14px; line-height: 1.3; font-weight: 800; }
.brand div > span { display: block; font-size: 9px; color: #888c94; margin-top: 4px; }
.sidebar nav { display: flex; flex: 1; min-height: 0; flex-direction: column; gap: 3px; overflow: auto; padding: 0 3px 20px; }
.nav-section { padding: 15px 11px 7px; font-size: 10px; text-transform: uppercase; color: #8c9097; font-weight: 600; }
.nav-section:first-child { padding-top: 5px; }
.sidebar nav a { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; padding: 8px 11px; min-height: 36px; border: 1px solid transparent; border-radius: 5px; color: #b1b4ba; font-size: 12px; font-weight: 600; line-height: 1.4; }
.sidebar nav a .lucide { width: 17px; height: 17px; flex-basis: 17px; color: #888d95; }
.sidebar nav a:hover { color: #fff; background: #1b1d20; }
.sidebar nav a.active { color: #ffab36; background: #ff940013; border-color: #ff940024; box-shadow: inset 2px 0 0 var(--primary); }
.sidebar nav a.active .lucide { color: var(--primary); }
.userbox { margin-top: auto; display: flex; align-items: center; flex: 0 0 auto; gap: 9px; padding: 16px 2px; border-top: 1px solid var(--line); color: var(--ink); }
.user-avatar { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #36383d; border-radius: 6px; color: #c1c4ca; background: #202226; }
.userbox > div { min-width: 0; flex: 1; }
.userbox small { display: block; font-size: 10px; color: var(--muted); }
.userbox strong { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.userbox a { display: grid; place-items: center; width: 32px; min-height: 34px; padding: 7px; color: var(--muted); border: 0; background: transparent; }
.userbox a:hover { color: var(--primary); background: #222427; }
.workspace-bar { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; padding: 12px 30px; margin-left: var(--sidebar-width); background: #111214f5; border-bottom: 1px solid #292b30; backdrop-filter: blur(12px); }
.workspace-location { display: flex; gap: 14px; align-items: center; min-width: 0; font-size: 11px; }
.workspace-location span { color: var(--muted); font-weight: 600; }
.workspace-location i { color: #545860; font-style: normal; }
.workspace-location strong { font-size: 12px; font-weight: 600; }
.workspace-bar time { display: flex; gap: 9px; align-items: center; flex-shrink: 0; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.workspace-bar time .lucide { width: 15px; height: 15px; }
#navigation-toggle, .nav-close, .nav-backdrop { display: none; }
.workspace-logo { display: none; }
.shell { margin-left: var(--sidebar-width); min-width: 0; padding: 30px 30px 48px; }
.workspace-module { max-width: none; }
.topbar { min-height: 49px; margin-bottom: 26px; }
.topbar > div { min-width: 0; }
.topbar .button, .topbar .record-actions { flex-shrink: 0; }

/* Form controls and action hierarchy. */
label, .filter-bar label { color: #c9cbd1; font-size: 12px; font-weight: 600; gap: 8px; }
input, select, textarea { min-width: 0; max-width: 100%; min-height: 40px; padding: 9px 12px; background: #151619; border: 1px solid #3a3d43; border-radius: 5px; color: var(--ink); font-size: 13px; font-weight: 500; }
input:hover, select:hover, textarea:hover { border-color: #53565c; }
input:focus, select:focus, textarea:focus { outline: 2px solid #ff940045; outline-offset: 1px; border-color: var(--primary); }
input::placeholder, textarea::placeholder { color: #858a93; opacity: 1; }
input[readonly], input:disabled, select:disabled { background: #222428; color: var(--muted); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); }
input[type="file"] { padding: 7px; }
input[type="file"]::file-selector-button { padding: 5px 10px; margin-right: 12px; border: 0; border-radius: 3px; background: #34373d; color: #f2f3f5; font: inherit; }
button, .button, .workspace-module button, .workspace-module .button { gap: 8px; min-height: 40px; padding: 9px 14px; border-radius: 5px; background: #24262b; border: 1px solid #3a3d43; color: #e6e7ea; font-size: 12px; font-weight: 700; line-height: 1.5; text-align: center; }
button:hover, .button:hover { background: #2f3238; border-color: #62666f; }
button:disabled { opacity: .45; cursor: not-allowed; }
.primary, .workspace-module .primary { background: var(--primary); border-color: var(--primary); color: #15110b; }
.primary:hover, .workspace-module .primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #15110b; }
.module-actions .success { color: #d5d8dd; border-color: #3a3d43; background: #24262b; }
.module-actions .success:hover { border-color: #81868e; background: #2f3238; }
.module-actions { gap: 8px; margin-bottom: 20px; }
.record-actions .icon-button, .workspace-module .icon-button { padding: 8px; min-width: 36px; width: 36px; height: 36px; min-height: 36px; border-radius: 4px; }
.record-actions .icon-button { color: #c9cdd4; border-color: #3b3e44; background: #22252a; }
.record-actions .icon-button:hover { color: #fff; background: #34383e; border-color: #6f747e; }
.record-actions a[href*="socio_membresias"] { color: #ffae41; border-color: #5c452a; background: #2b251e; }
.record-actions a[href*="socio_membresias"]:hover { background: #403021; border-color: var(--primary); }
.module-filters, .filter-bar, .socios-search { gap: 10px; margin-bottom: 22px; }
.socios-search input { flex: 1 1 270px; max-width: 480px; min-height: 40px; }
.list-status { font-size: 11px; margin-left: auto; text-align: right; }
.module-form { max-width: 960px; }
.module-form-grid { gap: 22px 24px; }
.module-form .form-actions { border-top-color: var(--line); margin-top: 26px; }
.module-title { font-size: 18px; }
.permission-grid { border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 24px 0; margin: 6px 0; gap: 18px; }
.permission-grid legend { padding: 0 12px 0 0; color: var(--ink); }
.operation-section { font-size: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.purchase-line { padding: 0 0 18px; border-bottom: 1px solid var(--line); }
.operation-cancel { border-top: 1px solid var(--line); padding-top: 22px; }
.operation-cancel button, button.danger, .button.danger { color: var(--danger); background: #ff939b0a; border-color: #704049; }
.module-notice { background: #242117; border-left-color: #aa8437; color: #e6cb8f; font-size: 12px; padding: 14px 16px; }
.module-error { color: var(--danger); background: #2d1c20; border-color: #ad5560; }
.flash { color: #b0e3ca; border-color: #315746; background: #1a2b24; border-radius: 5px; font-size: 13px; }
.cash-label { color: var(--ok); font-size: 16px; }

/* Consistent tables; actions remain pinned while data scrolls. */
.module-table { border: 1px solid var(--line); border-radius: 6px; background: var(--surface); max-height: 68vh; }
table { font-size: 12px; font-variant-numeric: tabular-nums; }
th, .module-table th { font-size: 10px; line-height: 1.5; text-transform: uppercase; font-weight: 650; color: #a9aeb7; background: #23252a; padding: 13px 15px; }
td, .module-table td { padding: 12px 15px; border-color: #303238; color: #cdd0d6; font-size: 12px; line-height: 1.5; }
.module-table td { border-top-color: #303238; }
.module-table tr:nth-child(even) td { background: #1c1e22; }
.module-table tr:hover td, tbody tr:hover td { background: #272a2f; }
.record-table .record-controls { background: var(--surface); min-width: 96px; }
.record-table th.record-controls { background: #23252a; }
.record-table .table-link { color: #f1f2f4; font-size: 12px; font-weight: 650; }
.table-link { color: #ffb34d; font-weight: 650; }
.table-link:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 4px; }
.module-table .column-text { min-width: 205px; }
.module-table .column-date { min-width: 145px; }
.module-pagination { padding-top: 4px; font-size: 11px; }
.status-label, .badge { display: inline-flex; align-items: center; gap: 6px; width: fit-content; white-space: nowrap; padding: 3px 7px; min-height: 24px; border-radius: 4px; font-size: 10px; font-weight: 650; }
.status-label::before { content: ''; width: 5px; height: 5px; background: currentColor; border-radius: 50%; flex: 0 0 5px; }
.status-label.ok, .badge.ok { color: #8bdfb9; background: #19362a; }
.status-label.warn, .badge.warn { color: #f2ce81; background: #3b301b; }
.status-label.danger, .badge.danger { color: #ff9da4; background: #3d252b; }
.status-label.muted, .badge.muted { color: #b5b9c2; background: #2d3035; }
.module-table .empty-state, .empty-state { padding: 34px 18px; color: var(--muted); }
.panel, .checkin-detail-panel { background: transparent; box-shadow: none; border: 0; border-radius: 0; overflow: auto; margin-bottom: 24px; }
.panel > table, .panel .dashboard-table, .checkin-detail-panel > table { background: var(--surface); }
.panel-head, .panel-head.split { padding: 17px 0; min-height: 58px; }
.panel-head h2 { margin: 0; }
.panel-head.split .button { min-height: 32px; padding: 6px 10px; font-size: 11px; }
.module-tabs { gap: 0 24px; margin-bottom: 25px; }
.module-tabs a { font-size: 12px; padding: 13px 0; border-bottom-width: 2px; white-space: nowrap; }
.module-tabs a[aria-current="page"] { color: #ffad3b; }
.report-totals { gap: 22px 44px; padding: 22px 0; }
.report-totals dt { font-size: 11px; }
.report-totals dd { font-size: 24px; font-weight: 650; color: #f1f2f4; }
.member-attendance-filters { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 32px; }
.member-attendance-filters .module-filters { margin: 0; min-width: 0; }
.attendance-totals .attendance-period dd { font-size: 14px; line-height: 2; }
.member-info-routine { margin: 0; border-top: 1px solid var(--line); }
.member-info-routine > div { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.member-info-routine dt { color: var(--muted); font-size: 12px; }
.member-info-routine dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.member-sample-editor { padding: 24px 0; margin-bottom: 28px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.member-sample-editor .form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.module-logo { background: transparent; border: 0; border-radius: 0; }

/* The overview uses actual operational metrics, without decorative charts. */
.metrics { gap: 12px; margin-bottom: 22px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.metrics article { padding: 20px 18px; border-radius: 6px; border: 1px solid #34363b; background: #1b1d20; box-shadow: none; min-width: 0; }
.metrics article > div { display: flex; gap: 8px; align-items: center; min-height: 38px; }
.metrics .lucide { color: #acb0b8; width: 17px; height: 17px; }
.metrics span { font-size: 11px; color: #b2b6bf; }
.metrics strong { font-size: 29px; font-weight: 650; margin-top: 12px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.metrics article:last-child { border-top: 2px solid var(--primary); padding-top: 19px; }
.metrics article:last-child .lucide { color: var(--primary); }
.quick-actions { display: flex; flex-wrap: wrap; gap: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 8px 0; margin-bottom: 24px; }
.quick-actions a { display: flex; flex: 1 1 145px; align-items: center; gap: 10px; min-height: 48px; padding: 12px 14px; border: 0; border-right: 1px solid var(--line); border-radius: 0; box-shadow: none; background: transparent; }
.quick-actions a:last-child { border-right: 0; }
.quick-actions a:hover { background: #202226; transform: none; }
.quick-actions span { font-size: 12px; color: #e6e8eb; font-weight: 600; }
.quick-actions .lucide { color: #d39642; width: 17px; height: 17px; }
.quick-actions .lucide:last-child { margin-left: auto; color: #7d828b; width: 13px; height: 13px; }
.dashboard-split { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.dashboard-split .panel { min-width: 0; overflow: visible; }
.dashboard-table { overflow: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.dashboard-table table { display: table; white-space: normal; min-width: 400px; }
.dashboard-table td { padding: 14px 12px; }
.dashboard-table th { padding: 12px; }
.dashboard-table tr[data-member-row] { cursor: pointer; }
.dashboard-table .visitor-link { color: var(--ink); font-weight: 650; text-decoration: none; }
.dashboard-table .visitor-link:hover { color: var(--primary); }
.dashboard-table tr[data-member-row]:focus-within td { background: #272a2f; }
.dashboard-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 320px; color: var(--muted); }
.dashboard-empty .lucide { width: 32px; height: 32px; flex-basis: 32px; color: #656c78; margin-bottom: 5px; }
.dashboard-empty strong { color: #d5d7dd; font-size: 14px; font-weight: 600; }
.dashboard-empty span { font-size: 11px; }

/* Member details, membership forms and the access terminal share the same palette. */
.member-page { width: min(1200px, 100%); }
.member-detail-card { border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; padding: 24px 0; gap: 24px; box-shadow: none; }
.member-detail-card h2 { font-size: 22px; line-height: 1.4; margin-bottom: 20px; }
.member-detail-card dl { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 24px; }
.member-detail-card dl div { display: block; padding: 0; border: 0; border-radius: 0; background: transparent; min-height: 0; }
.member-detail-card dt { font-size: 10px; font-weight: 600; margin-bottom: 4px; }
.member-detail-card dd { font-size: 13px; font-weight: 500; }
.member-detail-card .member-photo.compact { background: #202328; border-color: #3a3e45; border-radius: 6px; }
.silhouette { display: grid; place-items: center; color: #959ba5; }
.silhouette::before, .silhouette::after { display: none; }
.silhouette .lucide { width: 72px; height: 72px; stroke-width: 1.2px; }
.member-detail-card .member-photo.compact .silhouette { width: 100%; height: 100%; transform: none; }
.member-photo.compact .silhouette .lucide { width: 70%; height: 70%; }
.member-kpis { gap: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 10px 0 20px; border-bottom: 1px solid var(--line); }
.member-kpis article { background: transparent; border: 0; border-right: 1px solid var(--line); border-radius: 0; padding: 4px 20px; box-shadow: none; }
.member-kpis article:first-child { padding-left: 0; }
.member-kpis article:last-child { border-right: 0; }
.metrics.member-kpis article:last-child { border-top: 0; padding-top: 4px; }
.member-kpis span { font-size: 10px; font-weight: 600; }
.member-kpis strong { font-size: 17px; line-height: 1.5; font-weight: 650; }
.member-payment-panel .panel-head { background: transparent; padding: 15px 0 20px; border-bottom: 0; }
.member-payment-panel .form-grid, .form-grid { padding: 0 0 22px; gap: 20px; }
.form-grid.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#member-payment-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#member-payment-form > label.wide:first-of-type { grid-column: span 2; }
#member-payment-form > label.wide:last-of-type { grid-column: auto; }
.membership-facts { background: #1b1d20; border: 0; border-radius: 0; padding: 18px; gap: 14px; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.membership-facts div { border-color: var(--line); }
.membership-facts span { font-size: 9px; font-weight: 600; }
.membership-facts strong { font-size: 13px; }
.member-payment-panel .form-actions .primary { min-width: 0; }
.info-grid { padding: 18px 0; gap: 20px; }
.info-grid div { padding: 0; border: 0; border-radius: 0; background: transparent; min-height: 0; }
.info-grid span { font-size: 10px; font-weight: 600; }
.detail-actions { padding: 16px 0; }
.routine-detail div { padding: 15px 0; }
.row-actions { background: #25282d; }
.row-actions a { background: #34373c; color: var(--ink); }
.row-actions a.primary { background: #352a1c; color: #ffb44d; border-color: #785328; }
.row-actions a.danger { background: #3d252b; color: var(--danger); border-color: #704049; }
.checkin-board { max-width: 1020px; background: #191b1e; border-radius: 6px; box-shadow: none; }
.checkin-header { padding: 22px 26px; background: #1d1f23; border-bottom: 1px solid var(--line); grid-template-columns: 1fr 82px; }
.checkin-header h2 { color: var(--ink); font-size: 23px; font-weight: 750; margin-bottom: 8px; }
.checkin-header p { color: var(--muted); font-size: 12px; }
.gym-logo { width: 82px; height: 82px; border-radius: 0; background: transparent; overflow: hidden; }
.checkin-search { padding: 24px 26px 18px; grid-template-columns: 1fr 220px auto; }
.checkin-search label { color: #ced1d6; font-size: 15px; text-align: left; }
.checkin-search input { font-size: 18px; min-height: 42px; border-radius: 5px; }
.birthday-greeting { display: grid; grid-template-columns: 48px minmax(0, 1fr) 36px; align-items: start; gap: 16px; margin: 0 26px 20px; padding: 22px 0 22px 18px; border-left: 3px solid var(--primary); border-block: 1px solid var(--line); }
.birthday-emblem { display: grid; place-items: center; width: 48px; height: 48px; color: var(--primary); }
.birthday-emblem svg { width: 36px; height: 36px; }
.birthday-message { min-width: 0; }
.birthday-message .birthday-eyebrow { margin: 0 0 7px; font-size: 10px; text-transform: uppercase; color: var(--primary); }
.birthday-message h2 { margin: 0 0 8px; font-size: 24px; line-height: 1.35; color: var(--ink); overflow-wrap: anywhere; }
.birthday-message h2 span { color: #ffb44d; }
.birthday-message p { margin: 0; font-size: 12px; line-height: 1.6; color: #c9ccd2; overflow-wrap: anywhere; }
.birthday-dismiss[hidden] { display: none; }
.birthday-confetti { position: fixed; inset: 0; z-index: 40; pointer-events: none; overflow: hidden; }
.birthday-confetti-piece { position: absolute; top: 0; width: 7px; height: 13px; border-radius: 1px; background: var(--confetti-color); opacity: 0; animation: birthday-fall var(--fall-duration) var(--fall-delay) linear both; }
.birthday-confetti-piece.ribbon { width: 4px; height: 46px; }
@keyframes birthday-fall {
    0% { transform: translate3d(0, -70px, 0) rotate(0deg); opacity: 0; }
    8%, 85% { opacity: 1; }
    100% { transform: translate3d(var(--drift), calc(100vh + 80px), 0) rotate(var(--spin)); opacity: 0; }
}
.checkin-profile { padding: 12px 26px 24px; grid-template-columns: 1fr 150px; }
.member-fields div { grid-template-columns: 110px minmax(0, 1fr); }
.member-fields strong { color: var(--muted); font-size: 12px; font-weight: 500; }
.member-fields span { min-width: 0; overflow-wrap: anywhere; background: #212429; color: var(--ink); font-size: 14px; padding: 7px 12px; border-radius: 3px; }
.routine-card { margin: 0 26px; border-color: var(--line); background: transparent; }
.routine-tabs { background: #24262b; padding: 0 8px; }
.routine-tabs span, .routine-tabs a { background: transparent; color: #d6d9df; padding: 10px; font-size: 11px; }
.routine-tabs a:hover, .routine-tabs a:focus-visible { background: #34373c; color: #ffb44d; }
.routine-grid { padding: 16px; gap: 6px 12px; min-height: 0; }
.routine-grid strong { color: var(--muted); font-size: 11px; font-weight: 500; }
.routine-grid span { color: #d4d7dd; font-size: 12px; }
.checkin-status { padding: 24px 26px; grid-template-columns: 1fr 120px 110px auto; }
.checkin-status span { color: var(--muted); font-size: 10px; font-weight: 500; }
.checkin-status strong { color: var(--ink); font-size: 21px; }
.checkin-status .badge.ok { color: var(--ok); }
.checkin-warning { background: #3d252b; color: var(--danger); font-size: 15px; }
.checkin-footer { background: #191b1e; border: 1px solid var(--line); border-radius: 5px; }
.checkin-footer label { display: flex; align-items: center; gap: 8px; }
.checkin-footer label input { width: 16px; height: 16px; margin: 0; flex: 0 0 16px; }
.checkin-footer > strong { font-size: 16px; }
.checkin-footer div strong { font-size: 27px; font-variant-numeric: tabular-nums; }
.checkin-footer div a { border-color: #4b4e55; background: #272a2f; }
.checkin-footer div a:hover { border-color: var(--primary); background: #33302a; }
.access-card { background: #1b1d20; border-radius: 5px; }
.report-tabs a, .config-tabs span, .report-note { background: var(--surface); }
.report-tabs a.active { background: var(--surface-raised); }
.config-panel { padding: 22px 0; }

.login-shell { background: #0d0e10; padding: 32px 20px; }
.login-card { width: min(420px, 100%); padding: 34px 36px; border: 1px solid #34373d; border-top: 3px solid var(--primary); background: #181a1d; border-radius: 8px; }
.login-logo { display: block; width: 86px; height: 86px; object-fit: contain; margin: 0 auto 22px; border-radius: 0; background: transparent; }
.login-card > .eyebrow, .login-card > h1, .login-card > .login-subtitle { text-align: center; }
.login-card .eyebrow { color: #ffb347; font-size: 12px; font-weight: 750; }
.login-card h1 { font-size: 28px; margin: 0 0 8px; }
.login-subtitle { color: var(--muted); font-size: 12px; margin-bottom: 30px; }
.login-card .stack { gap: 20px; }
.login-card .primary { justify-content: space-between; min-height: 44px; margin-top: 8px; }
.login-shell > .flash { position: absolute; top: 16px; max-width: calc(100% - 40px); }

@media screen and (min-width: 1280px) {
    .member-page:has(#member-payment-form) { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 0 28px; }
    .member-page:has(#member-payment-form) > .member-detail-card { grid-column: 1; grid-row: 1 / span 2; grid-template-columns: 1fr; align-content: start; padding: 22px 24px 22px 0; border-right: 1px solid var(--line); border-bottom: 0; }
    .member-page:has(#member-payment-form) .member-photo.compact { grid-row: 1; width: 88px; height: 88px; min-height: 88px; }
    .member-page:has(#member-payment-form) .member-detail-card h2 { font-size: 20px; }
    .member-page:has(#member-payment-form) .member-detail-card dl { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 14px; }
    .member-page:has(#member-payment-form) > .member-kpis { grid-column: 2; grid-row: 1; padding: 22px 0; margin-bottom: 0; border-top: 1px solid var(--line); }
    .member-page:has(#member-payment-form) > .member-kpis strong { font-size: 15px; }
    .member-page:has(#member-payment-form) > .member-payment-panel { grid-column: 2; grid-row: 2; padding-bottom: 0; margin-bottom: 18px; }
    .member-page:has(#member-payment-form) > .panel:not(.member-payment-panel):not(.member-detail-card) { grid-column: 1 / -1; }
    .member-page:has(#member-payment-form) .membership-facts { padding: 15px 12px; gap: 10px; }
    .member-page:has(#member-payment-form) .membership-facts strong { font-size: 12px; }
}

@media (max-width: 1200px) {
    :root { --sidebar-width: 214px; }
    .shell { padding: 26px 22px 40px; }
    .workspace-bar { padding-inline: 22px; }
    .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .dashboard-split { grid-template-columns: 1fr; }
    .dashboard-empty { min-height: 200px; }
    .form-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .membership-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .checkin-status { grid-template-columns: 1fr 1fr; }
    .checkin-status form { justify-self: end; }
}

@media (max-width: 980px) {
    .sidebar { position: fixed; display: flex; width: 264px; height: 100dvh; padding: 0 14px; gap: 0; transform: translateX(-100%); visibility: hidden; transition: transform .18s ease, visibility .18s ease; }
    .sidebar nav { display: flex; flex-direction: column; order: 0; gap: 3px; min-width: 0; overflow-y: auto; overflow-x: hidden; }
    .sidebar nav a { padding: 9px 11px; white-space: normal; }
    .sidebar .userbox { margin-top: auto; padding: 16px 2px; gap: 9px; }
    .sidebar .userbox > span { display: grid; }
    .nav-close { display: inline-flex; margin-left: auto; background: transparent; border: 0; padding: 6px; min-height: 30px; color: var(--muted); }
    #navigation-toggle { display: inline-flex; width: 34px; min-height: 34px; padding: 7px; background: transparent; }
    .workspace-logo { display: block; width: 30px; height: 30px; border-radius: 0; object-fit: contain; }
    .workspace-bar { margin-left: 0; min-height: 60px; gap: 12px; padding: 12px 20px; }
    .workspace-location { flex: 1; }
    .shell { margin-left: 0; padding: 26px 20px 40px; }
    .nav-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 45; width: 100%; height: 100dvh; border: 0; border-radius: 0; background: #0009; cursor: default; }
    body.navigation-open { overflow: hidden; }
    .navigation-open .sidebar { transform: translateX(0); visibility: visible; }
    .member-detail-card dl { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .member-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
    h1, .workspace-module .topbar h1 { font-size: 24px; }
    .shell { padding: 22px 16px 36px; }
    .workspace-bar { padding-inline: 16px; }
    .workspace-location span, .workspace-location i { display: none; }
    .workspace-bar time { font-size: 10px; }
    .topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 24px; }
    .topbar > div { flex: 1 1 200px; }
    .topbar .record-actions { flex: 0 1 auto; flex-wrap: wrap; }
    .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .metrics article { padding: 15px 14px; }
    .metrics article:last-child { padding-top: 14px; }
    .metrics article:last-child:nth-child(odd) { grid-column: 1 / -1; }
    .metrics article > div { min-height: 32px; }
    .metrics strong { font-size: 27px; margin-top: 10px; }
    .metrics span { font-size: 10px; }
    .quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .quick-actions a { padding: 11px 8px; border: 0; min-height: 44px; }
    .quick-actions a:nth-child(odd) { border-right: 1px solid var(--line); }
    .quick-actions a:last-child { grid-column: 1 / -1; border-right: 0; }
    .dashboard-split { gap: 4px; }
    .dashboard-table table { min-width: 390px; }
    .dashboard-empty { min-height: 180px; }
    .panel-head { padding: 14px 0; }
    .module-actions { gap: 8px; }
    .module-filters label, .module-filters .module-search { min-width: 0; }
    .module-filters label:has(input[type="datetime-local"]) { flex-basis: 100%; }
    .socios-search input { max-width: none; flex-basis: 100%; }
    .socios-search .button, .socios-search button { font-size: 11px; padding-inline: 10px; }
    .list-status { width: 100%; margin: 2px 0 0; text-align: left; }
    .module-tabs { gap: 0 20px; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 1px; }
    .module-tabs a { font-size: 12px; flex: 0 0 auto; }
    .module-form-grid, .form-grid, .form-grid.compact { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    #member-payment-form { grid-template-columns: minmax(0, 1fr); }
    #member-payment-form > label.wide:first-of-type { grid-column: auto; }
    .module-form .form-actions { gap: 8px; }
    .permission-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 10px; }
    .permission-grid .checkbox-label { align-items: start; font-size: 11px; }
    .permission-grid input { flex: 0 0 18px; }
    .module-table { max-height: 70vh; }
    .module-table td { min-width: 100px; }
    .record-table .record-controls { min-width: 96px; }
    .record-actions { gap: 5px; }
    .record-table .record-actions .icon-button { width: 36px; min-width: 36px; height: 40px; }
    .member-detail-card { grid-template-columns: minmax(0, 1fr) 70px; gap: 12px; padding: 20px 0; }
    .member-detail-card .member-photo.compact { width: 70px; height: 80px; min-height: 80px; }
    .member-detail-card h2 { font-size: 19px; margin-bottom: 18px; }
    .member-detail-card dl { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .member-detail-card dd { font-size: 12px; }
    .member-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 0; }
    .member-kpis article { padding: 0 14px; }
    .member-kpis article:nth-child(odd) { padding-left: 0; }
    .member-kpis article:nth-child(even) { border-right: 0; }
    .metrics.member-kpis article:last-child { grid-column: auto; padding: 0 14px; }
    .member-kpis strong { font-size: 16px; }
    .membership-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 16px; }
    .membership-facts div { border: 0; padding: 0; }
    .member-payment-panel .form-actions .primary { width: 100%; }
    .checkin-header { grid-template-columns: 1fr 64px; padding: 18px 16px; gap: 12px; }
    .checkin-header h2 { font-size: 19px; }
    .gym-logo { width: 64px; height: 64px; justify-self: end; }
    .checkin-search { grid-template-columns: minmax(0, 1fr) auto; padding: 20px 16px 14px; }
    .checkin-search label { grid-column: 1 / -1; font-size: 12px; }
    .checkin-search input { min-width: 0; font-size: 16px; }
    .birthday-greeting { margin: 0 16px 18px; padding: 18px 0 18px 12px; grid-template-columns: minmax(0, 1fr) 36px; gap: 10px; }
    .birthday-emblem { display: none; }
    .birthday-message h2 { font-size: 20px; }
    .checkin-profile { grid-template-columns: minmax(0, 1fr); padding: 8px 16px 20px; gap: 14px; }
    .member-fields div { grid-template-columns: 80px minmax(0, 1fr); gap: 8px; }
    .member-fields span { font-size: 12px; }
    .checkin-profile .member-photo { min-height: 90px; justify-self: start; }
    .checkin-profile .member-photo img { width: 90px; height: 90px; }
    .checkin-profile .silhouette { width: 126px; height: 126px; zoom: .7; }
    .routine-card { margin: 0 16px; }
    .routine-grid { grid-template-columns: 80px 1fr; }
    .checkin-status { padding: 20px 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .checkin-status strong { font-size: 18px; }
    .checkin-status form { grid-column: 1 / -1; justify-self: stretch; }
    .checkin-status form button { width: 100%; }
    .checkin-footer > strong { font-size: 14px; }
    .checkin-footer div strong { font-size: 24px; }
    .login-card { padding: 28px 24px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
    .birthday-confetti { display: none; }
    .birthday-confetti-piece { animation: none; }
}

@media print {
    .birthday-greeting, .birthday-confetti { display: none !important; }
    :root { color-scheme: light; --ink: #111; --muted: #555; --line: #ccc; --surface: #fff; --bg: #fff; }
    .sidebar, .workspace-bar, .nav-backdrop { display: none !important; }
    body, .shell, .module-table, .panel, td, th, .module-table td, .module-table th { background: white !important; color: #111 !important; }
    .shell { margin: 0 !important; padding: 0 !important; }
    .module-table { max-height: none; overflow: visible; border: 1px solid #aaa; }
    .module-table table { display: table; }
    .module-table th, .record-table .record-controls { position: static; }
    .status-label, .badge, .report-totals dd { color: #111 !important; background: transparent !important; }
}
.branch-switch{display:flex;align-items:center;gap:8px;margin-left:auto;min-width:0;max-width:360px}
.branch-switch label{font-size:12px;color:var(--muted,#a0a4ab)}
.branch-switch select{min-width:0;width:220px;max-width:100%;height:34px;padding:4px 8px;font-size:13px}
.branch-switch .icon-button{width:34px;height:34px;flex-shrink:0}
@media(max-width:760px){.workspace-location{display:none}.branch-switch{max-width:calc(100% - 80px)}.branch-switch select{width:160px}.branch-switch label{display:none}}
