/* Shared visual language; screen-only so receipts and exports retain their layout. */
@media screen {
    :root[data-theme], :root[data-theme] body {
        --bg: #101315;
        --surface: #181d20;
        --surface-raised: #262d31;
        --ink: #f4f5f6;
        --muted: #b5bec3;
        --line: #485156;
        --primary: #ff850c;
        --primary-dark: #ee7400;
        --accent: #ff850c;
        --gym-frame: #0d1012;
        --gym-panel: #191e21;
        --gym-field: #111619;
        --gym-head: #293135;
        --gym-line: #485156;
        --gym-hover: #293135;
        --gym-dim: #b5bec3;
        --gym-accent-ink: #ff9d40;
        --gym-positive: #9beaac;
        --gym-access: #8bd9df;
        --studio-panel: linear-gradient(145deg, #2a3034, #101416);
        --studio-hover: linear-gradient(145deg, #343d42, #1b2125);
        --studio-metal: #7d878c;
        --studio-glow: #ff850025;
        --studio-input: #121719;
        --studio-table-alt: #1c2225;
        --studio-backdrop: linear-gradient(#101315e8, #101315f8), url('checkin-studio-background.webp');
        --studio-login-backdrop: linear-gradient(#0d10121a, #0d101240), url('checkin-studio-background.webp');
    }
    :root[data-theme="light"], :root[data-theme="light"] body {
        --bg: #eef1f3;
        --surface: #ffffff;
        --surface-raised: #e5eaed;
        --ink: #182024;
        --muted: #4f5c64;
        --line: #bac3c8;
        --gym-frame: #f9fafb;
        --gym-panel: #ffffff;
        --gym-field: #f2f5f6;
        --gym-head: #e5eaed;
        --gym-line: #bac3c8;
        --gym-hover: #e6ecef;
        --gym-dim: #4f5c64;
        --gym-accent-ink: #a94300;
        --gym-positive: #176936;
        --gym-access: #176b74;
        --studio-panel: linear-gradient(145deg, #ffffff, #e9eef1);
        --studio-hover: linear-gradient(145deg, #ffffff, #dae3e8);
        --studio-metal: #a2afb6;
        --studio-glow: #ff850018;
        --studio-input: #ffffff;
        --studio-table-alt: #f1f5f7;
        --studio-backdrop: linear-gradient(#eef1f3ed, #eef1f3fa), url('checkin-studio-background.webp');
        --studio-login-backdrop: linear-gradient(#eef1f360, #eef1f399), url('checkin-studio-background.webp');
    }
    :root[data-theme] body { background: var(--bg); color: var(--ink); }
    :root[data-theme] body:not([data-page="registro"]) :is(.shell, .client-shell, .login-shell) { background: var(--studio-backdrop) center top / cover fixed; }
    :root[data-theme] :is(.workspace-bar.app-header, .client-header) { background: var(--studio-panel); border-bottom-color: var(--studio-metal); box-shadow: 0 2px 12px #00000022; }
    :root[data-theme] .header-brand strong, :root[data-theme] .client-brand strong { font-style: italic; font-weight: 800; }
    :root[data-theme] .top-navigation > a,
    :root[data-theme] .top-nav-group > summary { border-radius: 5px 5px 0 0; }
    :root[data-theme] .top-navigation a.active,
    :root[data-theme] .top-nav-group.is-active > summary { color: var(--gym-accent-ink); border-bottom-color: var(--primary); background: var(--studio-hover); }
    :root[data-theme] .top-nav-dropdown { background: var(--studio-panel); border-color: var(--studio-metal); border-radius: 8px; box-shadow: 0 8px 24px #00000040, inset 0 1px #ffffff1a; }
    :root[data-theme] .top-nav-dropdown a:hover { background: var(--studio-hover); }
    :root[data-theme] .header-account > summary { background: var(--studio-panel); border-radius: 7px; border-color: var(--studio-metal); }
    :root[data-theme] body:not([data-page="registro"]) :is(.topbar h1, .client-heading h1, .cp-welcome h1, .login-card h1) { font-style: italic; font-weight: 800; color: var(--ink); }
    :root[data-theme] body:not([data-page="registro"]) .topbar { border-bottom-color: var(--studio-metal); }
    :root[data-theme] body:not([data-page="registro"]) .topbar .eyebrow { gap: 10px; color: var(--muted); }
    :root[data-theme] body:not([data-page="registro"]) .topbar .eyebrow::before { content: ''; width: 19px; height: 8px; border-inline: 4px solid var(--primary); transform: skew(-24deg); }
    :root[data-theme] body :is(button, .button, .icon-button) { background: var(--studio-panel); color: var(--ink); border-color: var(--studio-metal); border-radius: 7px; box-shadow: inset 0 1px #ffffff20, 0 2px 4px #00000018; }
    :root[data-theme] body :is(button, .button, .icon-button):hover:not(:disabled):not([aria-disabled="true"]) { background: var(--studio-hover); color: var(--ink); border-color: var(--primary); }
    :root[data-theme] body :is(button.primary, a.primary) { background: linear-gradient(180deg, #c45000, #9f3200); color: #fff; border-color: #ff9c35; border-radius: 7px; box-shadow: inset 0 1px #ffffff35, 0 3px 12px var(--studio-glow); font-weight: 800; }
    :root[data-theme] body :is(button.primary, a.primary):hover:not(:disabled) { background: linear-gradient(180deg, #b94400, #8d2900); color: #fff; border-color: #ffaf60; }
    :root[data-theme] body :is(button.danger, a.danger, .operation-cancel button) { color: #ffbec6; background: linear-gradient(145deg, #4b2730, #2b161d); border-color: #a35b68; box-shadow: inset 0 1px #ffffff15; }
    :root[data-theme="light"] body :is(button.danger, a.danger, .operation-cancel button) { color: #9c2038; background: linear-gradient(#fff6f7, #f9dce2); border-color: #c47a88; }
    :root[data-theme] body :is(button, .button):disabled,
    :root[data-theme] body :is(button, .button)[aria-disabled="true"] { opacity: .5; box-shadow: none; cursor: not-allowed; }
    :root[data-theme] body .nav-backdrop { background: #0009; border: 0; border-radius: 0; box-shadow: none; }
    :root[data-theme] body .nav-close { background: transparent; border: 0; box-shadow: none; }
    :root[data-theme] body :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) { background-color: var(--studio-input); color: var(--ink); border-color: var(--studio-metal); border-radius: 7px; box-shadow: inset 0 1px 3px #00000012; }
    :root[data-theme] body :is(input, select, textarea):focus { outline: 2px solid #ff850050; outline-offset: 2px; border-color: var(--primary); }
    :root[data-theme] body :is(input, textarea)::placeholder { color: var(--muted); opacity: 1; }
    :root[data-theme] body :is(input[readonly], input:disabled, select:disabled, textarea:disabled) { background-color: var(--surface-raised); color: var(--muted); }
    :root[data-theme] input[type="checkbox"], :root[data-theme] input[type="radio"] { accent-color: var(--primary); }
    :root[data-theme] input[type="file"]::file-selector-button { background: var(--studio-panel); color: var(--ink); border: 1px solid var(--studio-metal); border-radius: 5px; }
    :root[data-theme] body :is(label, .filter-bar label, .portal-form label) { color: var(--ink); }
    :root[data-theme] .module-table,
    :root[data-theme] .table-wrap { border-color: var(--studio-metal); border-radius: 8px; background: var(--surface); }
    :root[data-theme] :is(th, .module-table th, .record-table th.record-controls) { background: var(--studio-panel); color: var(--muted); border-bottom-color: var(--studio-metal); }
    :root[data-theme] :is(td, .module-table td) { color: var(--ink); border-bottom-color: var(--line); }
    :root[data-theme] .module-table tr:nth-child(even) td { background: var(--studio-table-alt); }
    :root[data-theme] :is(.module-table tr:hover td, tbody tr:hover td, .dashboard-table tr[data-member-row]:focus-within td) { background: var(--gym-hover); }
    :root[data-theme] .record-actions .icon-button { border-radius: 6px; }
    :root[data-theme] .record-actions [data-membership-state="enabled"] { background: #19452a; border-color: #4da96c; color: #b8f9ca; }
    :root[data-theme] .record-actions [data-membership-state="disabled"] { background: #4b2730; border-color: #b16373; color: #ffc1cc; }
    :root[data-theme="light"] .record-actions [data-membership-state="enabled"] { background: #e0f3e6; border-color: #77aa89; color: #1e6337; }
    :root[data-theme="light"] .record-actions [data-membership-state="disabled"] { background: #fbe3e9; border-color: #bd7787; color: #9a263f; }
    :root[data-theme] :is(.status-label, .badge) { border-radius: 5px; }
    :root[data-theme] body:not([data-page="registro"]) :is(.badge.ok, .status-label.ok) { color: #b8f9ca; background: #19452a; border: 1px solid #44855a; }
    :root[data-theme] body:not([data-page="registro"]) :is(.badge.warn, .status-label.warn) { color: #ffe1a1; background: #45391d; border: 1px solid #9a7e38; }
    :root[data-theme] body:not([data-page="registro"]) :is(.badge.danger, .status-label.danger) { color: #ffc1cc; background: #4b2730; border: 1px solid #a35b68; }
    :root[data-theme="light"] body:not([data-page="registro"]) :is(.badge.ok, .status-label.ok) { color: #1e6337; background: #e0f3e6; border-color: #77aa89; }
    :root[data-theme="light"] body:not([data-page="registro"]) :is(.badge.warn, .status-label.warn) { color: #765000; background: #fff0ca; border-color: #c1a35b; }
    :root[data-theme="light"] body:not([data-page="registro"]) :is(.badge.danger, .status-label.danger) { color: #9a263f; background: #fbe3e9; border-color: #bd7787; }
    :root[data-theme] .metrics:not(.member-kpis) { gap: 14px; border: 0; }
    :root[data-theme] .metrics:not(.member-kpis) article { background: var(--studio-panel); border: 1px solid var(--studio-metal); border-radius: 8px; box-shadow: inset 0 1px #ffffff20; }
    :root[data-theme] .metrics:not(.member-kpis) article:last-child { border-right: 1px solid var(--studio-metal); }
    :root[data-theme] .metrics:not(.member-kpis) article::after { content: ''; position: absolute; top: auto; left: auto; right: -1px; bottom: -1px; width: 38%; height: 14px; border-right: 2px solid var(--primary); border-bottom: 2px solid var(--primary); border-radius: 0 0 8px; background: none; pointer-events: none; }
    :root[data-theme] .metrics:not(.member-kpis) article[data-metric="active"]::after { border-color: var(--gym-positive); }
    :root[data-theme] .metrics:not(.member-kpis) article[data-metric="access"]::after { border-color: var(--gym-access); }
    :root[data-theme] .quick-actions a { border: 1px solid var(--line); border-radius: 6px; background: var(--studio-panel); }
    :root[data-theme] .quick-actions a:hover { border-color: var(--primary); background: var(--studio-hover); }
    :root[data-theme] .quick-actions a span { color: var(--ink); }
    :root[data-theme] .panel-head h2 .lucide { color: var(--gym-accent-ink); }
    :root[data-theme] :is(.module-tabs, .report-tabs, .config-tabs, .campaign-tabs) { border-color: var(--line); }
    :root[data-theme] :is(.module-tabs a, .report-tabs a, .config-tabs a, .campaign-tabs a) { color: var(--muted); }
    :root[data-theme] :is(.module-tabs a[aria-current], .report-tabs a.active, .config-tabs a.active, .campaign-tabs a[aria-current]) { color: var(--gym-accent-ink); background: var(--studio-panel); border-bottom-color: var(--primary); }
    :root[data-theme] :is(.membership-facts, .report-summary, .report-totals, .sale-total) { background: var(--studio-panel); border-color: var(--line); }
    :root[data-theme] :is(.benefits-editor, .campaign-plan-picker, .module-form fieldset) { border-radius: 7px; border-color: var(--studio-metal); }
    :root[data-theme] body:not([data-page="registro"]) :is(.flash, .module-notice, .module-error) { border-radius: 7px; box-shadow: inset 0 1px #ffffff15; }
    :root[data-theme] body:not([data-page="registro"]) .login-shell,
    :root:not([data-theme]) .login-shell { min-height: 100vh; min-height: 100dvh; background: var(--studio-login-backdrop, url('checkin-studio-background.webp')) center / cover no-repeat; }
    :root[data-theme] .login-card { background: var(--studio-panel); border: 1px solid var(--studio-metal); border-top: 2px solid var(--primary); border-radius: 8px; box-shadow: 0 14px 42px #00000025, 0 -2px 14px var(--studio-glow); }
    :root[data-theme] .login-audience { border-radius: 6px; border-color: var(--studio-metal); overflow: hidden; }
    :root[data-theme] .login-audience a[aria-current] { color: var(--gym-accent-ink); background: var(--studio-hover); }
    :root[data-theme] .client-nav { border-color: var(--line); }
    :root[data-theme] .client-nav a { border-radius: 6px 6px 0 0; border-bottom: 2px solid transparent; }
    :root[data-theme] .client-nav a[aria-current] { color: var(--gym-accent-ink); background: var(--studio-panel); border-bottom-color: var(--primary); }
    :root[data-theme] :is(.cp-avatar, .client-offer) { border-color: var(--studio-metal); background: var(--studio-panel); box-shadow: inset 0 1px #ffffff20; }
    :root[data-theme] .cp-avatar { border-bottom-color: var(--primary); }
    :root[data-theme] .cp-welcome h1 { font-style: italic; }
    :root[data-theme] :is(.cp-week a, .client-days a) { background: var(--studio-panel); border-radius: 5px; }
    :root[data-theme] :is(.cp-week a[aria-current], .client-days a[aria-current]) { color: var(--gym-accent-ink); border-bottom: 2px solid var(--primary); background: var(--studio-hover); }
    :root[data-theme] :is(.benefit-icon, .cp-benefits li > .lucide) { color: var(--gym-accent-ink); }
    :root[data-theme] :is(.benefit-list, .cp-benefits) [data-included="0"] > .lucide,
    :root[data-theme] .benefit-list [data-included="0"] .benefit-icon { color: var(--muted); }
    :root[data-theme] :is(.cp-bottom-links, .client-links) a { border-bottom: 1px solid var(--line); }
    :root[data-theme] :is(.cp-bottom-links, .client-links) a:hover { border-bottom-color: var(--primary); }
}
@media screen and (max-width: 680px) {
    :root[data-theme] body:not([data-page="registro"]) :is(.shell, .client-shell, .login-shell) { background-attachment: scroll; }
    :root[data-theme] body:not([data-page="registro"]) .login-shell,
    :root:not([data-theme]) .login-shell { background-position: left center; }
    :root[data-theme] .metrics:not(.member-kpis) { gap: 10px; }
    :root[data-theme] .metrics:not(.member-kpis) article:nth-child(even) { border-right: 1px solid var(--studio-metal); }
}
