/**
 * Circularix — UI Design System v3 bridge
 * Dark-first palette with green-to-blue brand gradient.
 */

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
    color-scheme: dark;

    --cx-canvas: #0B0F14;
    --cx-surface: #11161D;
    --cx-surface-2: #161C25;
    --cx-surface-3: #1C2330;
    --cx-deep: #070A0E;
    --cx-border: rgba(255, 255, 255, 0.07);
    --cx-border-soft: rgba(255, 255, 255, 0.04);
    --cx-border-strong: rgba(141, 211, 79, 0.22);
    --cx-text: #F2F6FA;
    --cx-text-soft: #C5CED8;
    --cx-muted: #7A8593;
    --cx-muted-dim: #515E6D;
    --cx-green: #8CD34F;
    --cx-green-bright: #A8E469;
    --cx-green-soft: rgba(141, 211, 79, 0.10);
    --cx-blue: #00AEEF;
    --cx-blue-bright: #4DC5F4;
    --cx-blue-soft: rgba(0, 174, 239, 0.10);
    --cx-grad: linear-gradient(90deg, #8CD34F 0%, #00AEEF 100%);
    --cx-grad-vert: linear-gradient(180deg, #8CD34F 0%, #00AEEF 100%);
    --cx-grad-diag: linear-gradient(135deg, #8CD34F 0%, #00AEEF 100%);

    --canvas-bg: var(--cx-canvas);
    --text-primary: var(--cx-text);
    --text-secondary: var(--cx-text-soft);
    --text-muted-warm: var(--cx-muted);
    --accent-orange: var(--cx-green);
    --accent-orange-dim: var(--cx-green-soft);
    --border-arena: var(--cx-border);
    --border-light: var(--cx-border-soft);
    --surface-muted: var(--cx-surface-2);
    --surface-raised: var(--cx-surface);

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 68px;
    --header-height: 64px;

    /* Shadows remain reserved for overlays. */
    --shadow-xs: 0 1px 3px rgba(0, 174, 239, 0.10);
    --shadow-sm: 0 2px 8px rgba(0, 174, 239, 0.12);
    --shadow-md: 0 6px 20px rgba(0, 174, 239, 0.14);
    --shadow-lg: 0 12px 40px rgba(0, 174, 239, 0.18);

    /* Border radius scale */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* Transitions */
    --transition: 0.22s ease;
    --transition-slow: 0.35s ease;

    /* Aliases temporales para vistas legacy que aun usan prefijo rc. */
    --rc-canvas: var(--cx-canvas);
    --rc-surface: var(--cx-surface);
    --rc-surface-sunk: var(--cx-deep);
    --rc-surface-muted: var(--cx-surface-2);
    --rc-text: var(--cx-text);
    --rc-text-strong: var(--cx-text);
    --rc-text-soft: var(--cx-text-soft);
    --rc-text-muted: var(--cx-muted);
    --rc-border: var(--cx-border);
    --rc-border-soft: var(--cx-border-soft);
    --rc-accent: var(--cx-green);
    --rc-accent-strong: var(--cx-blue);
    --rc-accent-soft: var(--cx-green-soft);
    --rc-accent-ink: var(--cx-green-bright);
    --rc-orange: var(--accent-orange);
    --rc-black: var(--text-primary);
    --rc-charcoal: var(--text-secondary);
    --rc-muted: var(--text-muted-warm);
    --rc-sand: var(--border-arena);
    --rc-surface-muted: var(--surface-muted);
    --zapier-sand: var(--border-arena);

    /* Status semantic colors */
    --status-success-bg: rgba(74, 222, 128, 0.12);
    --status-success-text: #4ade80;
    --status-success-border: #4ade80;
    --status-warning-bg: rgba(250, 204, 21, 0.12);
    --status-warning-text: #facc15;
    --status-warning-border: #facc15;
    --status-danger-bg: rgba(248, 113, 113, 0.12);
    --status-danger-text: #f87171;
    --status-danger-border: #f87171;
    --status-info-bg: rgba(96, 165, 250, 0.12);
    --status-info-text: #60a5fa;
    --status-info-border: #60a5fa;
    --status-neutral-bg: var(--surface-muted);
    --status-neutral-text: var(--text-secondary);

    /* Typography scale */
    --fs-page-title: 1.5rem;
    --fs-section: 0.9375rem;
    --fs-body: 0.875rem;
    --fs-small: 0.8125rem;
    --fs-label: 0.75rem;
    --fs-stat-value: 1.75rem;
    --fs-stat-label: 0.72rem;

    /* Spacing scale (8px base) */
    --sp-1: 0.25rem;
    --sp-2: 0.5rem;
    --sp-3: 0.75rem;
    --sp-4: 1rem;
    --sp-5: 1.25rem;
    --sp-6: 1.5rem;
    --sp-8: 2rem;
    --sp-10: 2.5rem;
}

:root[data-theme="light"] {
    color-scheme: light;

    --cx-canvas: #F4F1EA;
    --cx-surface: #FFFEFB;
    --cx-surface-2: #EDEAE1;
    --cx-surface-3: #E2DED2;
    --cx-deep: #FFFFFF;
    --cx-border: rgba(11, 15, 20, 0.10);
    --cx-border-soft: rgba(11, 15, 20, 0.06);
    --cx-border-strong: rgba(141, 211, 79, 0.45);
    --cx-text: #0B0F14;
    --cx-text-soft: #2A3340;
    --cx-muted: #6B7280;
    --cx-muted-dim: #9CA3AF;
    --cx-green-soft: rgba(141, 211, 79, 0.14);
    --cx-blue-soft: rgba(0, 174, 239, 0.12);
}

/* ============================================================
   GLOBAL
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--canvas-bg);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.2;
}

/* Custom scrollbar */
html {
    scrollbar-width: auto;
    scrollbar-color: #b6afa1 var(--surface-raised);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--surface-raised);
    border-left: 1px solid var(--border-light);
}

::-webkit-scrollbar-thumb {
    background: #b6afa1;
    border: 2px solid var(--surface-raised);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: #918a7d;
}

::-webkit-scrollbar-corner {
    background: var(--surface-raised);
}

/* ============================================================
   SUCURSAL COMPANY SCOPE
   ============================================================ */
.sucursal-scope-banner {
    align-items: center;
    background: var(--rc-surface, var(--canvas-bg));
    border: 1px solid var(--rc-border-soft, var(--border-light));
    border-radius: 16px;
    display: flex;
    gap: var(--sp-3);
    margin: 0 0 var(--sp-5);
    padding: var(--sp-4) var(--sp-5);
}

.sucursal-scope-banner.is-preparation {
    background: var(--status-warning-bg);
    border-color: color-mix(in srgb, var(--status-warning-border) 34%, var(--border-light));
}

.sucursal-scope-banner.is-approved {
    background: var(--status-success-bg);
    border-color: color-mix(in srgb, var(--status-success-border) 28%, var(--border-light));
}

.sucursal-scope-banner__icon {
    align-items: center;
    background: var(--canvas-bg);
    border: 1px solid currentColor;
    border-radius: 12px;
    color: var(--status-warning-text);
    display: inline-flex;
    flex: 0 0 auto;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.sucursal-scope-banner.is-approved .sucursal-scope-banner__icon {
    color: var(--status-success-text);
}

.sucursal-scope-banner strong {
    color: var(--text-primary);
    display: block;
    font-family: var(--rc-font-display, inherit);
    font-size: 1rem;
    line-height: 1.2;
}

.sucursal-scope-banner p {
    color: var(--text-secondary);
    font-size: var(--fs-small);
    margin: 2px 0 0;
}

.sucursal-scope-banner__link {
    align-items: center;
    color: var(--text-primary);
    display: inline-flex;
    font-size: var(--fs-small);
    font-weight: 700;
    gap: 6px;
    margin-left: auto;
    text-decoration: none;
    white-space: nowrap;
}

.sucursal-scope-banner__link:hover {
    color: var(--accent-orange);
}

@media (max-width: 720px) {
    .sucursal-scope-banner {
        align-items: flex-start;
        flex-direction: column;
    }

    .sucursal-scope-banner__link {
        margin-left: 0;
    }
}

/* ============================================================
   SUCURSAL FORM UX
   ============================================================ */
.sucursal-form-workspace .detail-panel {
    overflow: hidden;
}

.sucursal-label {
    align-items: center;
    display: inline-flex;
    gap: 6px;
}

.sucursal-help {
    align-items: center;
    background: transparent;
    border: 0;
    color: var(--rc-muted, var(--text-muted-warm));
    cursor: help;
    display: inline-flex;
    height: 24px;
    justify-content: center;
    padding: 0;
    width: 24px;
}

.sucursal-help:hover,
.sucursal-help:focus-visible {
    color: var(--rc-accent, var(--accent-orange));
    outline: none;
}

.sucursal-panel-header {
    align-items: flex-start;
    gap: var(--sp-3);
}

.sucursal-panel-subtitle {
    color: var(--rc-muted, var(--text-muted-warm));
    font-size: var(--fs-small);
    margin: 4px 0 0;
}

.sucursal-address-search {
    border-bottom: 1px solid var(--rc-border-soft, var(--border-light));
    display: grid;
    gap: var(--sp-2);
    padding: var(--sp-5);
}

.sucursal-input-action {
    align-items: stretch;
    display: grid;
    gap: var(--sp-2);
    grid-template-columns: minmax(0, 1fr) auto;
}

.sucursal-input-action .btn-ds {
    min-height: 40px;
}

.rcl-address-combobox {
    min-width: 0;
    position: relative;
}

.rcl-address-suggestions {
    background: var(--rc-surface, var(--canvas-bg));
    border: 1px solid var(--rc-border, var(--border-arena));
    border-radius: var(--radius-md);
    inset-inline: 0;
    max-height: 288px;
    overflow-y: auto;
    position: absolute;
    top: calc(100% + 6px);
    z-index: 1070;
}

.rcl-address-suggestion,
.rcl-address-suggestion-empty {
    align-items: flex-start;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--rc-border-soft, var(--border-light));
    color: var(--rc-text, var(--text-primary));
    display: grid;
    gap: 2px;
    grid-template-columns: 24px minmax(0, 1fr);
    padding: 12px 14px;
    text-align: left;
    width: 100%;
}

.rcl-address-suggestion:last-child,
.rcl-address-suggestion-empty:last-child {
    border-bottom: 0;
}

.rcl-address-suggestion i {
    color: var(--rc-accent, var(--accent-orange));
    margin-top: 2px;
}

.rcl-address-suggestion strong {
    color: var(--rc-text, var(--text-primary));
    display: block;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rcl-address-suggestion span,
.rcl-address-suggestion-empty span {
    color: var(--rc-text-muted, var(--text-muted-warm));
    display: block;
    font-size: 0.82rem;
    line-height: 1.35;
}

.rcl-address-suggestion small {
    color: var(--rc-muted, var(--text-muted-warm));
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.3;
    margin-top: 3px;
    text-transform: uppercase;
}

.rcl-address-suggestion:hover,
.rcl-address-suggestion.is-active {
    background: var(--rc-accent-soft, var(--accent-orange-dim));
    color: var(--rc-text, var(--text-primary));
}

.rcl-address-suggestion-empty {
    grid-template-columns: minmax(0, 1fr);
}

.sucursal-location-layout {
    display: grid;
    gap: 0;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
}

.sucursal-location-fields {
    border-right: 1px solid var(--rc-border-soft, var(--border-light));
}

.sucursal-map-card {
    display: grid;
    gap: var(--sp-4);
    padding: var(--sp-5);
}

.sucursal-location-map {
    background: var(--surface-raised);
    border: 1px solid var(--rc-border-soft, var(--border-light));
    border-radius: var(--radius-lg);
    height: 360px;
    overflow: hidden;
    width: 100%;
}

.sucursal-technical-fields {
    background: var(--rc-surface-sunk, var(--surface-raised));
    border: 1px solid var(--rc-border-soft, var(--border-light));
    border-radius: var(--radius-md);
    padding: var(--sp-3);
}

.sucursal-technical-fields summary {
    align-items: center;
    color: var(--rc-text, var(--text-primary));
    cursor: pointer;
    display: flex;
    font-size: var(--fs-small);
    font-weight: 800;
    gap: var(--sp-2);
    list-style: none;
}

.sucursal-technical-fields summary::-webkit-details-marker {
    display: none;
}

.sucursal-technical-grid {
    display: grid;
    gap: var(--sp-3);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: var(--sp-3);
}

.sucursal-schedule-toolbar {
    align-items: end;
    border-bottom: 1px solid var(--rc-border-soft, var(--border-light));
    display: grid;
    gap: var(--sp-4);
    grid-template-columns: minmax(0, 1fr) auto;
    padding: var(--sp-5);
}

.sucursal-preset-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    margin-top: var(--sp-2);
}

.sucursal-preset {
    align-items: flex-start;
    background: var(--rc-surface, var(--canvas-bg));
    border: 1px solid var(--rc-border, var(--border-arena));
    border-radius: var(--radius-md);
    color: var(--rc-text, var(--text-primary));
    cursor: pointer;
    display: grid;
    gap: 2px;
    min-height: 54px;
    min-width: 132px;
    padding: 9px 12px;
    text-align: left;
}

.sucursal-preset span {
    font-weight: 800;
    line-height: 1.1;
}

.sucursal-preset small {
    color: var(--rc-muted, var(--text-muted-warm));
    font-size: 0.75rem;
    font-weight: 650;
}

.sucursal-preset:hover,
.sucursal-preset:focus-visible {
    border-color: var(--rc-accent, var(--accent-orange));
    outline: none;
}

.sucursal-preset.is-active {
    background: var(--rc-accent-soft, var(--accent-orange-dim));
    border-color: var(--rc-accent, var(--accent-orange));
    color: var(--rc-accent-ink, var(--text-primary));
}

.sucursal-bulk-hours {
    display: grid;
    gap: var(--sp-2);
}

.sucursal-bulk-hours__controls {
    align-items: center;
    display: flex;
    gap: var(--sp-2);
}

.sucursal-bulk-hours__controls .form-control {
    min-width: 112px;
}

.sucursal-schedule-grid {
    display: grid;
    gap: var(--sp-3);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: var(--sp-5);
}

.sucursal-day-card {
    background: var(--rc-surface, var(--canvas-bg));
    border: 1px solid var(--rc-border-soft, var(--border-light));
    border-radius: var(--radius-lg);
    display: grid;
    gap: var(--sp-4);
    padding: var(--sp-4);
}

.sucursal-day-card.is-closed {
    background: var(--rc-surface-sunk, var(--surface-raised));
}

.sucursal-day-card__head {
    align-items: center;
    display: flex;
    gap: var(--sp-3);
    justify-content: space-between;
}

.sucursal-day-card__title {
    align-items: center;
    display: flex;
    gap: var(--sp-3);
    min-width: 0;
}

.sucursal-day-card__title > span {
    align-items: center;
    background: var(--rc-accent-soft, var(--accent-orange-dim));
    border: 1px solid color-mix(in srgb, var(--rc-accent, var(--accent-orange)) 26%, var(--rc-border-soft, var(--border-light)));
    border-radius: 12px;
    color: var(--rc-accent-ink, var(--text-primary));
    display: inline-flex;
    font-size: 0.72rem;
    font-weight: 900;
    height: 38px;
    justify-content: center;
    text-transform: uppercase;
    width: 44px;
}

.sucursal-day-card__title strong,
.sucursal-day-card__title small {
    display: block;
}

.sucursal-day-card__title small {
    color: var(--rc-muted, var(--text-muted-warm));
    font-size: 0.75rem;
    font-weight: 650;
}

.sucursal-day-toggle {
    align-items: center;
    display: flex;
    flex-direction: row-reverse;
    gap: var(--sp-2);
    margin: 0;
}

.sucursal-day-toggle .form-check-label {
    color: var(--rc-text, var(--text-primary));
    font-size: var(--fs-small);
    font-weight: 800;
}

.sucursal-day-card__hours {
    display: grid;
    gap: var(--sp-3);
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sucursal-day-card__hours label {
    display: grid;
    gap: 6px;
}

.sucursal-day-card.is-closed .sucursal-day-card__hours {
    opacity: 0.58;
}

.sucursal-danger-zone {
    border-top: 1px solid var(--rc-border-soft, var(--border-light));
    display: grid;
    gap: var(--sp-3);
    margin-top: var(--sp-4);
    padding-top: var(--sp-4);
}

.sucursal-danger-zone__copy {
    display: grid;
    gap: 3px;
}

.sucursal-danger-zone__copy strong {
    color: var(--status-danger-text);
    font-weight: 850;
}

.sucursal-danger-zone__copy span {
    color: var(--rc-muted, var(--text-muted-warm));
    font-size: var(--fs-small);
    line-height: 1.35;
}

.sucursal-danger-zone .btn-ds {
    justify-content: center;
    width: 100%;
}

.detail-head__actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    justify-content: flex-end;
}

/* ============================================================
   CONTEXT SELECTOR
   ============================================================ */
.context-page {
    max-width: 1120px;
}

.context-current {
    align-items: center;
    background: var(--rc-surface, var(--surface-card));
    border: 1px solid var(--rc-border-soft, var(--border-light));
    border-radius: var(--rc-radius-xl, var(--radius-lg));
    display: grid;
    gap: var(--sp-3);
    grid-template-columns: 44px minmax(0, 1fr) auto;
    padding: var(--sp-4);
}

.context-current--warning {
    background: var(--rc-warning-bg, #fbf1de);
    border-color: color-mix(in srgb, var(--rc-warning, #b87514) 34%, var(--rc-border-soft, #e2ddd0));
}

.context-current__icon,
.context-note__icon {
    align-items: center;
    background: var(--rc-accent-soft, var(--accent-orange-dim));
    border-radius: var(--rc-radius-lg, var(--radius-md));
    color: var(--rc-accent-strong, var(--accent-orange));
    display: inline-flex;
    height: 44px;
    justify-content: center;
    width: 44px;
}

.context-current__body {
    min-width: 0;
}

.context-current__label {
    color: var(--rc-muted, var(--text-muted-warm));
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    line-height: 1;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
}

.context-current strong {
    color: var(--rc-text, var(--text-primary));
    display: block;
    font-family: var(--rc-font-display, 'Bricolage Grotesque', sans-serif);
    font-size: clamp(1.05rem, 1.7vw, 1.35rem);
    font-weight: 800;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.context-current p,
.context-note p,
.context-selector__subtitle {
    color: var(--rc-muted, var(--text-muted-warm));
    font-size: var(--fs-small);
    line-height: 1.4;
    margin: 0;
}

.context-selector .panel__header {
    align-items: flex-start;
}

.context-selector__subtitle {
    margin-top: 0.3rem;
}

.context-note {
    align-items: flex-start;
    background: var(--rc-surface-sunk, var(--surface-raised));
    border-bottom: 1px solid var(--rc-border-soft, var(--border-light));
    display: grid;
    gap: var(--sp-3);
    grid-template-columns: 44px minmax(0, 1fr);
    padding: var(--sp-4) var(--sp-5);
}

.context-note strong {
    color: var(--rc-text, var(--text-primary));
    display: block;
    font-weight: 850;
    margin-bottom: 0.2rem;
}

.context-selector__grid {
    display: grid;
    gap: var(--sp-4);
    grid-template-columns: minmax(220px, 0.9fr) minmax(260px, 1.1fr);
    padding: var(--sp-5);
}

.context-field {
    display: grid;
    gap: 0.45rem;
    margin: 0;
    min-width: 0;
}

.context-field .select2-container,
.context-field .form-select {
    width: 100% !important;
}

.context-actions {
    align-items: center;
    border-top: 1px solid var(--rc-border-soft, var(--border-light));
    display: flex;
    gap: var(--sp-2);
    justify-content: flex-end;
    padding: var(--sp-4) var(--sp-5);
}

.context-form-status {
    background: var(--rc-warning-bg, #fbf1de);
    border-top: 1px solid color-mix(in srgb, var(--rc-warning, #b87514) 26%, var(--rc-border-soft, #e2ddd0));
    color: var(--rc-warning, #b87514);
    font-size: var(--fs-small);
    font-weight: 700;
    padding: var(--sp-3) var(--sp-5);
}

.context-actions .btn-ds {
    min-width: 170px;
    justify-content: center;
}

.detail-empty-value.is-error {
    color: var(--status-danger-text);
}

/* ============================================================
   PROFILE
   ============================================================ */
.profile-workspace {
    max-width: 1180px;
}

.detail-grid.profile-grid {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
}

.profile-account-panel {
    margin-bottom: 0;
}

.profile-readonly-row {
    background: color-mix(in srgb, var(--rc-surface, var(--canvas-bg)) 76%, var(--rc-surface-sunk, var(--surface-raised)));
}

.profile-readonly-value {
    color: var(--rc-text, var(--text-primary));
    display: inline-block;
    font-weight: 800;
    line-height: 1.3;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.profile-section {
    border-top: 1px solid var(--rc-border-soft, var(--border-light));
    display: grid;
    gap: var(--rc-space-4, var(--sp-4));
    padding: var(--rc-space-5, var(--sp-5));
}

.profile-section__head {
    align-items: center;
    display: flex;
    gap: var(--rc-space-2, var(--sp-2));
    justify-content: space-between;
}

.profile-password-grid,
.profile-passkey-control {
    display: grid;
    gap: var(--rc-space-4, var(--sp-4));
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-field {
    display: grid;
    gap: 0.45rem;
    margin: 0;
    min-width: 0;
}

.profile-field .detail-empty-value {
    margin: 0;
}

.profile-form-actions {
    align-items: center;
    border-top: 1px solid var(--rc-border-soft, var(--border-light));
    display: flex;
    justify-content: flex-end;
    padding: var(--rc-space-4, var(--sp-4)) var(--rc-space-5, var(--sp-5));
}

.profile-passkey-body {
    display: grid;
    gap: var(--rc-space-4, var(--sp-4));
}

.profile-passkey-control {
    align-items: end;
    grid-template-columns: minmax(0, 1fr) auto;
}

.profile-passkey-control .btn-ds {
    min-height: 40px;
}

.profile-feedback:empty {
    display: none;
}

.profile-passkey-list {
    gap: var(--rc-space-3, var(--sp-3));
}

.profile-passkey-item {
    background: var(--rc-surface-sunk, var(--surface-raised));
    border: 1px solid var(--rc-border-soft, var(--border-light));
    border-radius: var(--rc-radius-md, var(--radius-md));
    padding: var(--rc-space-3, var(--sp-3));
}

.profile-passkey-delete {
    margin-top: var(--rc-space-2, var(--sp-2));
    min-height: 32px;
    padding-inline: var(--rc-space-3, var(--sp-3));
}

.profile-passkey-empty {
    background: var(--rc-surface-sunk, var(--surface-raised));
    border: 1px dashed var(--rc-border, var(--border-arena));
    border-radius: var(--rc-radius-md, var(--radius-md));
    min-height: 132px;
}

.profile-summary-card .panel__body {
    display: grid;
    gap: var(--rc-space-3, var(--sp-3));
    justify-items: center;
    padding: var(--rc-space-5, var(--sp-5));
    text-align: center;
}

.profile-avatar {
    align-items: center;
    background: var(--rc-accent-soft, var(--accent-orange-dim));
    border: 1px solid color-mix(in srgb, var(--rc-accent, var(--accent-orange)) 26%, var(--rc-border-soft, var(--border-light)));
    border-radius: 18px;
    color: var(--rc-accent-ink, var(--accent-orange));
    display: inline-flex;
    font-family: var(--rc-font-display, inherit);
    font-size: 2.35rem;
    font-weight: 800;
    height: 88px;
    justify-content: center;
    width: 88px;
}

.profile-summary-name {
    color: var(--rc-text, var(--text-primary));
    font-family: var(--rc-font-display, inherit);
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.15;
    margin: 0;
    overflow-wrap: anywhere;
}

.profile-summary-email {
    color: var(--rc-text-muted, var(--text-muted-warm));
    font-size: 0.875rem;
    margin: calc(var(--rc-space-2, var(--sp-2)) * -1) 0 0;
    overflow-wrap: anywhere;
}

.profile-badge-row,
.profile-inline-status {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--rc-space-2, var(--sp-2));
    justify-content: center;
}

.profile-panel-copy {
    margin-bottom: var(--rc-space-3, var(--sp-3));
}

.profile-notification-button {
    margin-top: var(--rc-space-3, var(--sp-3));
    width: 100%;
}

.profile-status-panel .detail-data-row,
.profile-validation-panel .decision-indicator {
    min-height: auto;
}

.profile-status-row {
    align-items: start;
    grid-template-columns: minmax(96px, 0.35fr) minmax(0, 1fr);
    padding-block: var(--rc-space-4, var(--sp-4));
}

.cliente-source-grid {
    display: grid;
    gap: var(--rc-space-3, 0.75rem);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0 var(--rc-space-5, 1.25rem) var(--rc-space-4, 1rem);
}

.cliente-source-option {
    align-items: flex-start;
    background: var(--rc-surface-sunk, var(--rc-surface));
    border: 1px solid var(--rc-border, rgba(255, 255, 255, 0.08));
    border-radius: var(--rc-radius-lg, 10px);
    color: var(--rc-text, inherit);
    cursor: pointer;
    display: flex;
    gap: var(--rc-space-3, 0.75rem);
    min-height: 96px;
    padding: var(--rc-space-4, 1rem);
    transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.cliente-source-option:hover,
.cliente-source-option.is-selected {
    background: color-mix(in srgb, var(--rc-accent, #8CD34F) 10%, var(--rc-surface));
    border-color: color-mix(in srgb, var(--rc-accent, #8CD34F) 48%, var(--rc-border));
}

.cliente-source-option:has(input:focus-visible) {
    outline: 3px solid color-mix(in srgb, var(--rc-accent, #8CD34F) 24%, transparent);
    outline-offset: 2px;
}

.cliente-source-option input {
    margin-top: 0.25rem;
}

.cliente-source-option__icon {
    align-items: center;
    background: var(--rc-accent-soft, rgba(141, 211, 79, 0.12));
    border-radius: var(--rc-radius-md, 8px);
    color: var(--rc-accent-ink, #8CD34F);
    display: inline-flex;
    flex: 0 0 38px;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.cliente-source-option strong,
.cliente-source-option small {
    display: block;
}

.cliente-source-option strong {
    font-weight: 800;
    line-height: 1.15;
}

.cliente-source-option small {
    color: var(--rc-text-muted, #7A8593);
    line-height: 1.35;
    margin-top: var(--rc-space-1, 0.25rem);
}

.venta-clientes-empty {
    background: var(--rc-surface, #11161D);
    border: 1px solid color-mix(in srgb, var(--rc-warning, #facc15) 44%, var(--rc-border));
    border-radius: var(--rc-radius-xl, 14px);
    margin: var(--rc-space-4, 1rem) 0;
    min-height: 190px;
}

.venta-clientes-empty strong {
    color: var(--rc-text, inherit);
    font-size: 1.1rem;
}

.venta-clientes-empty span {
    max-width: 44rem;
}

.ds-empty-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--rc-space-3, 0.75rem);
    justify-content: center;
    margin-top: var(--rc-space-3, 0.75rem);
}

@media (max-width: 1199.98px) {
    .detail-grid.profile-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 767.98px) {
    .cliente-source-grid {
        grid-template-columns: minmax(0, 1fr);
        padding-inline: var(--rc-space-4, 1rem);
    }

    .profile-password-grid,
    .profile-passkey-control,
    .profile-status-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .profile-passkey-control .btn-ds,
    .profile-form-actions .btn-ds,
    .profile-workspace .detail-head__actions .btn-ds {
        width: 100%;
    }

    .profile-section__head {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 1199.98px) {
    .sucursal-location-layout,
    .sucursal-schedule-toolbar,
    .context-selector__grid {
        grid-template-columns: 1fr;
    }

    .sucursal-location-fields {
        border-right: 0;
        border-bottom: 1px solid var(--rc-border-soft, var(--border-light));
    }
}

@media (max-width: 767.98px) {
    .sucursal-input-action,
    .sucursal-schedule-grid,
    .sucursal-technical-grid,
    .sucursal-day-card__hours {
        grid-template-columns: 1fr;
    }

    .sucursal-bulk-hours__controls {
        align-items: stretch;
        flex-direction: column;
    }

    .sucursal-bulk-hours__controls span {
        display: none;
    }

    .sucursal-location-map {
        height: 300px;
    }

    .context-current {
        grid-template-columns: 44px minmax(0, 1fr);
    }

    .context-current .badge-ds {
        grid-column: 2;
        justify-self: start;
    }

    .context-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .context-actions .btn-ds {
        width: 100%;
    }
}

/* ============================================================
   GOOGLE PLACES STAGING
   ============================================================ */
.staging-tabs-header {
    align-items: flex-start;
    gap: var(--sp-4);
}

.staging-panel-subtitle {
    margin: var(--sp-1) 0 0;
    color: var(--text-secondary);
    font-size: var(--fs-small);
}

.staging-summary-chips {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: var(--sp-3);
}

.staging-summary-chips span {
    align-items: baseline;
    background: var(--surface-raised);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    display: inline-flex;
    font-size: var(--fs-small);
    font-weight: 700;
    gap: 6px;
    min-height: 28px;
    padding: 0 10px;
}

.staging-summary-chips strong {
    color: var(--text-primary);
    font-family: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.95rem;
}

.staging-view-tabs {
    gap: var(--sp-2);
    flex-shrink: 0;
}

.staging-view-tabs .nav-link {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding: 0 var(--sp-4);
    border: 1px solid var(--border-arena);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 700;
}

.staging-view-tabs .nav-link.active {
    background: var(--text-primary);
    border-color: var(--text-primary);
    color: var(--canvas-bg);
}

.staging-tab-content {
    border-top: 1px solid var(--border-light);
}

.staging-table td {
    vertical-align: middle;
}

.staging-create-btn {
    min-height: 32px;
    padding: 0 var(--sp-3);
    font-size: var(--fs-small);
    white-space: nowrap;
}

.staging-row-actions {
    align-items: center;
    display: inline-flex;
    gap: 6px;
    justify-content: flex-end;
    min-width: 126px;
}

.staging-action-btn {
    align-items: center;
    border: 1px solid var(--border-arena);
    border-radius: var(--radius-md);
    display: inline-flex;
    font-size: 0.8125rem;
    font-weight: 800;
    gap: 6px;
    height: 34px;
    justify-content: center;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

.staging-action-btn--ghost {
    background: var(--canvas-bg);
    color: var(--text-secondary);
    width: 34px;
}

.staging-action-btn--ghost:hover {
    background: var(--surface-muted);
    color: var(--text-primary);
}

.staging-action-btn--primary {
    background: var(--accent-orange);
    border-color: var(--accent-orange);
    color: var(--text-primary);
    padding: 0 12px;
    min-width: 76px;
}

.staging-action-btn--primary:hover {
    background: color-mix(in srgb, var(--accent-orange) 84%, var(--text-primary));
    border-color: color-mix(in srgb, var(--accent-orange) 84%, var(--text-primary));
    color: var(--text-primary);
}

.staging-action-btn.is-disabled {
    opacity: 0.38;
    pointer-events: none;
}

.staging-map-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: var(--sp-4);
    padding: var(--sp-4);
}

.staging-map-shell {
    min-width: 0;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface-raised);
}

.staging-map-canvas {
    min-height: 620px;
}

.staging-map-canvas .leaflet-popup-content-wrapper {
    border: 1px solid rgba(11, 15, 20, 0.10);
    background: #FFFEFB;
    color: #0B0F14;
    box-shadow: 0 18px 42px rgba(11, 15, 20, 0.22);
}

.staging-map-canvas .leaflet-popup-content {
    color: #0B0F14;
}

.staging-map-canvas .leaflet-popup-tip {
    background: #FFFEFB;
}

.staging-map-canvas .leaflet-popup-close-button {
    color: #475569 !important;
}

:root[data-theme="dark"] .staging-map-canvas .leaflet-popup-content-wrapper {
    border-color: rgba(141, 211, 79, 0.30);
    background: #0B0F14;
    color: #F2F6FA;
    box-shadow: 0 20px 56px rgba(0, 0, 0, 0.48);
}

:root[data-theme="dark"] .staging-map-canvas .leaflet-popup-content {
    color: #F2F6FA;
}

:root[data-theme="dark"] .staging-map-canvas .leaflet-popup-tip {
    background: #0B0F14;
}

:root[data-theme="dark"] .staging-map-canvas .leaflet-popup-close-button {
    color: #C5CED8 !important;
}

.staging-map-canvas .leaflet-control-attribution {
    border-radius: var(--radius-sm);
    background: rgba(255, 254, 251, 0.92);
    color: #334155;
}

.staging-map-detail {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    background: var(--canvas-bg);
    padding: var(--sp-5);
    align-self: start;
    position: sticky;
    top: calc(var(--header-height) + var(--sp-4));
}

.staging-map-detail__eyebrow {
    display: block;
    margin-bottom: var(--sp-2);
    color: var(--text-muted-warm);
    font-size: var(--fs-label);
    font-weight: 800;
    text-transform: uppercase;
}

.staging-map-detail h3 {
    margin: 0;
    font-size: 1.25rem;
}

.staging-map-detail p {
    margin: var(--sp-2) 0 var(--sp-5);
    color: var(--text-secondary);
    font-size: var(--fs-small);
}

.staging-map-detail__meta {
    display: grid;
    gap: var(--sp-3);
    margin: 0 0 var(--sp-5);
}

.staging-map-detail__meta div {
    display: flex;
    justify-content: space-between;
    gap: var(--sp-3);
    padding-bottom: var(--sp-3);
    border-bottom: 1px solid var(--border-light);
}

.staging-map-detail__meta dt {
    color: var(--text-muted-warm);
    font-size: var(--fs-label);
    font-weight: 800;
    text-transform: uppercase;
}

.staging-map-detail__meta dd {
    margin: 0;
    color: var(--text-primary);
    font-weight: 800;
    text-align: right;
}

.staging-map-detail__actions {
    display: grid;
    gap: var(--sp-2);
}

.staging-map-detail__actions .btn-ds {
    justify-content: center;
}

.staging-map-detail__actions .disabled {
    opacity: 0.52;
    pointer-events: none;
}

.staging-popup {
    display: grid;
    gap: 5px;
    min-width: 210px;
    color: #0B0F14;
}

.staging-popup strong {
    color: #071019;
    font-size: 0.95rem;
    line-height: 1.2;
}

.staging-popup span,
.staging-popup small {
    color: #475569;
    line-height: 1.35;
}

:root[data-theme="dark"] .staging-popup {
    color: #F2F6FA;
}

:root[data-theme="dark"] .staging-popup strong {
    color: #FFFFFF;
}

:root[data-theme="dark"] .staging-popup span,
:root[data-theme="dark"] .staging-popup small {
    color: #C5CED8;
}

.staging-popup__action {
    display: inline-flex;
    justify-content: center;
    margin-top: var(--sp-2);
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    background: var(--cx-grad);
    color: #071019;
    font-weight: 800;
    text-decoration: none;
}

.staging-popup__action:hover,
.staging-popup__action:focus {
    color: #071019;
    filter: brightness(1.04);
}

.staging-prefill-panel {
    padding: 0;
}

.staging-prefill {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    padding: var(--sp-4) var(--sp-5);
}

.staging-prefill__icon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--accent-orange-dim);
    color: var(--accent-orange);
    flex-shrink: 0;
}

.staging-prefill > div > strong,
.staging-prefill > div > span {
    display: block;
}

.staging-prefill > div > span {
    color: var(--text-secondary);
    font-size: var(--fs-small);
}

.initial-center-panel {
    padding: 0;
}

.initial-center-card {
    align-items: flex-start;
    display: grid;
    gap: var(--sp-4);
    grid-template-columns: 44px minmax(0, 1fr) auto;
    padding: var(--sp-5);
}

.initial-center-card__icon {
    align-items: center;
    background: var(--accent-orange-dim);
    border: 1px solid color-mix(in srgb, var(--accent-orange) 42%, var(--border-light));
    border-radius: var(--radius-md);
    color: var(--accent-orange);
    display: inline-flex;
    height: 44px;
    justify-content: center;
    width: 44px;
}

.initial-center-card__heading {
    color: var(--text-primary);
    font-family: var(--rc-font-display, inherit);
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.2;
}

.initial-center-card__body p {
    color: var(--text-secondary);
    font-size: var(--fs-small);
    margin: 4px 0 0;
    max-width: 68ch;
}

.initial-center-preview {
    display: grid;
    gap: var(--sp-3);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: var(--sp-4) 0 0;
}

.initial-center-preview div {
    background: var(--rc-surface-sunk, var(--surface-muted));
    border: 1px solid var(--rc-border-soft, var(--border-light));
    border-radius: var(--radius-md);
    padding: var(--sp-3);
}

.initial-center-preview dt {
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.initial-center-preview dd {
    color: var(--text-primary);
    font-size: var(--fs-small);
    font-weight: 700;
    margin: 0;
}

.initial-center-toggle {
    align-items: center;
    background: var(--rc-canvas, var(--canvas-bg));
    border: 1px solid var(--rc-border-soft, var(--border-light));
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    cursor: pointer;
    display: inline-flex;
    gap: var(--sp-2);
    min-height: 42px;
    padding: 0 var(--sp-4);
    white-space: nowrap;
}

.initial-center-toggle span {
    font-size: var(--fs-small);
    font-weight: 800;
}

@media (max-width: 1180px) {
    .staging-map-layout {
        grid-template-columns: 1fr;
    }

    .staging-map-detail {
        position: static;
    }
}

@media (max-width: 768px) {
    .staging-tabs-header,
    .staging-prefill,
    .initial-center-card {
        flex-direction: column;
        align-items: stretch;
    }

    .initial-center-card {
        display: flex;
    }

    .initial-center-preview {
        grid-template-columns: 1fr;
    }

    .initial-center-toggle {
        justify-content: center;
        white-space: normal;
    }

    .staging-view-tabs .nav-item,
    .staging-view-tabs .nav-link {
        width: 100%;
    }

    .staging-map-layout {
        padding: var(--sp-3);
    }

    .staging-map-canvas {
        min-height: 440px;
    }
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: var(--text-primary);
    color: #fff;
    z-index: 1040;
    transition: width var(--transition-slow), transform var(--transition-slow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(54, 52, 46, 0.5);
}

/* Subtle top accent */
.sidebar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--accent-orange);
}

/* ---- Brand ---- */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 1rem 0 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    min-width: 0;
}

.sidebar-brand:hover { color: #fff; }

.sidebar-logo-mark {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    padding: 2px;
    flex-shrink: 0;
    overflow: hidden;
    background:
        radial-gradient(circle at 16% 16%, rgba(140, 211, 79, 0.34), transparent 42%),
        linear-gradient(135deg, #0B0F14 0%, #11161D 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-logo {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    display: block;
    object-fit: cover;
}

.sidebar-brand-icon {
    width: 32px;
    height: 32px;
    background: var(--accent-orange);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.header-context-label {
    max-width: 260px;
}

.header-context-switcher {
    position: relative;
}

.header-context-toggle {
    max-width: min(38vw, 380px);
}

.header-context-toggle .header-context-label {
    min-width: 0;
}

.header-context-caret {
    font-size: 0.72rem;
    opacity: 0.7;
}

.header-context-menu {
    max-height: min(78vh, 620px);
    overflow-y: auto;
    padding: 0;
    width: min(92vw, 420px);
}

.header-context-menu__head {
    border-bottom: 1px solid var(--rc-border-soft);
    display: grid;
    gap: 0.2rem;
    padding: 0.95rem 1rem 0.85rem;
}

.header-context-menu__head strong {
    color: var(--rc-text);
    font-family: var(--rc-font-display);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.15;
}

.header-context-menu__head span {
    color: var(--rc-text-muted);
    font-size: 0.82rem;
    line-height: 1.35;
}

.header-context-form {
    display: grid;
    gap: 0.85rem;
    padding: 1rem;
}

.header-context-field {
    display: grid;
    gap: 0.35rem;
    margin: 0;
}

.header-context-field > span {
    color: var(--rc-text-muted);
    font-family: var(--rc-font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
}

.header-context-field .form-select {
    min-height: 40px;
    width: 100%;
}

.header-context-form-status {
    background: var(--cx-warning-bg);
    border: 1px solid color-mix(in srgb, var(--cx-warning) 35%, transparent);
    border-radius: var(--rc-radius-md);
    color: var(--cx-warning);
    font-size: 0.8rem;
    font-weight: 650;
    line-height: 1.35;
    margin: 0;
    padding: 0.6rem 0.75rem;
}

.header-context-actions {
    display: flex;
    justify-content: flex-end;
}

.header-context-actions .btn-ds {
    min-height: 40px;
    width: 100%;
}

.header-context-global-form {
    border-top: 1px solid var(--rc-border-soft);
    margin: 0;
    padding: 0.75rem 1rem 0;
}

.header-context-global-btn {
    align-items: center;
    background: transparent;
    border: 1px solid var(--rc-border);
    border-radius: var(--rc-radius-md);
    color: var(--rc-text-soft);
    cursor: pointer;
    display: inline-flex;
    font-size: 0.84rem;
    font-weight: 700;
    gap: 0.45rem;
    justify-content: center;
    min-height: 38px;
    padding: 0 0.85rem;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
    width: 100%;
}

.header-context-global-btn:hover,
.header-context-global-btn:focus-visible {
    background: var(--rc-surface-muted);
    border-color: var(--rc-border-strong);
    color: var(--rc-text);
}

.header-context-empty {
    align-items: flex-start;
    color: var(--rc-text-muted);
    display: flex;
    gap: 0.65rem;
    line-height: 1.35;
    padding: 1rem;
}

.header-context-empty i {
    color: var(--cx-warning);
    margin-top: 0.1rem;
}

.header-context-advanced {
    align-items: center;
    border-top: 1px solid var(--rc-border-soft);
    color: var(--rc-text-soft);
    display: flex;
    font-size: 0.85rem;
    font-weight: 700;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    text-decoration: none;
}

.header-context-advanced:hover,
.header-context-advanced:focus-visible {
    background: var(--rc-surface-muted);
    color: var(--rc-text);
}

@media (max-width: 767.98px) {
    .header-context-toggle {
        height: 38px;
        padding: 0;
        width: 38px;
    }
}

.header-status-chip {
    background: var(--rc-warning-bg);
    border: 1px solid color-mix(in srgb, var(--rc-warning) 36%, var(--rc-border-soft));
    border-radius: var(--rc-radius-md, var(--radius-md));
    color: var(--rc-warning);
    font-size: 0.875rem;
    font-weight: 750;
    gap: var(--rc-space-2, 0.5rem);
    min-height: 38px;
    padding: 0 0.875rem;
    white-space: nowrap;
}

.header-status-chip i {
    color: currentColor;
}

.header-notif-menu {
    max-height: min(70vh, 520px);
    overflow-y: auto;
    width: min(380px, calc(100vw - 1.5rem));
}

.header-notif-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.75rem 1rem;
    white-space: normal;
}

.header-notif-item:hover,
.header-notif-item:focus {
    background: var(--rc-surface-sunk, rgba(255, 78, 0, 0.06));
}

.header-notif-title {
    color: var(--rc-text, var(--text-primary));
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1.25;
}

.header-notif-message {
    color: var(--rc-muted, var(--text-muted));
    font-size: 0.8rem;
    line-height: 1.35;
}

.header-notif-meta {
    color: var(--rc-muted, var(--text-muted));
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.header-user-menu {
    min-width: 210px;
}

.header-user-name {
    color: var(--text-primary);
    font-size: .875rem;
    font-weight: 500;
}

.header-menu-icon {
    opacity: .65;
    width: 16px;
}

.header-muted-icon {
    opacity: .25;
}

.sidebar-brand-text {
    transition: opacity var(--transition), width var(--transition);
    overflow: hidden;
}

.sidebar-brand-sub {
    font-size: 0.625rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255,255,255,0.45);
    display: block;
    line-height: 1;
}

/* ---- Collapse Button ---- */
.sidebar-collapse-btn {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    flex-shrink: 0;
    transition: all var(--transition);
}

.sidebar-collapse-btn:hover {
    background: rgba(255,255,255,0.14);
    color: #fff;
    border-color: rgba(255,255,255,0.25);
}

.sidebar-collapse-btn i {
    transition: transform var(--transition-slow);
}

/* ---- Scroll area ---- */
.sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.75rem 0 1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.26) rgba(255, 255, 255, 0.04);
}

.sidebar-scroll::-webkit-scrollbar {
    width: 8px;
}

.sidebar-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.24);
    border: 2px solid #201515;
    border-radius: var(--radius-full);
}

.sidebar-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 174, 239, 0.78);
}

.sidebar-scroll::-webkit-scrollbar-corner {
    background: #201515;
}

/* ---- Menu ---- */
.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    position: relative;
}

.sidebar-heading {
    padding: 1rem 1.25rem 0.35rem;
    font-size: 0.675rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.35);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity var(--transition);
    margin-top: 0.25rem;
}

.sidebar-menu > li > a,
.sidebar-menu > li > form > button {
    display: flex;
    align-items: center;
    padding: 0.6rem 1.25rem;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    transition: background var(--transition), color var(--transition), padding var(--transition);
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 0;
    position: relative;
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.sidebar-menu > li > form {
    margin: 0;
}

.sidebar-menu > li > a:hover,
.sidebar-menu > li > form > button:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

.sidebar-menu > li > a.active {
    background: var(--cx-green-soft, rgba(141, 211, 79, 0.16));
    color: #fff;
}

.sidebar-menu > li > a.active::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--accent-orange);
    border-radius: 0 2px 2px 0;
}

.sidebar-menu .menu-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    font-size: 0.9rem;
    flex-shrink: 0;
    opacity: 0.8;
    transition: margin var(--transition);
}

.sidebar-menu > li > a.active .menu-icon,
.sidebar-menu > li > a:hover .menu-icon {
    opacity: 1;
}

.sidebar-menu .menu-text {
    flex: 1;
    transition: opacity var(--transition);
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-menu .badge {
    font-size: 0.65rem;
    padding: 0.2rem 0.45rem;
    background: var(--accent-orange) !important;
    color: #fff !important;
    border-radius: var(--radius-full);
    transition: opacity var(--transition);
}

/* ---- Sidebar footer ---- */
.sidebar-footer {
    flex-shrink: 0;
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(255,255,255,0.07);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
    overflow: hidden;
}

.sidebar-user:hover {
    background: rgba(255,255,255,0.07);
}

.sidebar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--accent-orange);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.sidebar-user-info {
    min-width: 0;
    transition: opacity var(--transition);
}

.sidebar-user-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.4);
    text-transform: capitalize;
}

/* ============================================================
   SIDEBAR — COLLAPSED STATE (desktop)
   ============================================================ */
.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .sidebar-brand-text,
.sidebar.collapsed .sidebar-heading,
.sidebar.collapsed .menu-text,
.sidebar.collapsed .sidebar-user-info,
.sidebar.collapsed .badge {
    opacity: 0;
    pointer-events: none;
    width: 0;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-collapse-btn i {
    transform: rotate(180deg);
}

.sidebar.collapsed .sidebar-menu > li > a {
    padding: 0.65rem 0;
    justify-content: center;
}

.sidebar.collapsed .sidebar-menu .menu-icon {
    margin-right: 0;
    width: 100%;
    font-size: 1rem;
}

.sidebar.collapsed .sidebar-user {
    justify-content: center;
}

.sidebar.collapsed .sidebar-footer {
    padding: 0.75rem 0.5rem;
}

.sidebar.collapsed .sidebar-header {
    padding: 0;
    justify-content: center;
}

.sidebar.collapsed .sidebar-collapse-btn {
    width: 36px;
    height: 36px;
}

.sidebar.collapsed .sidebar-brand {
    display: none;
}

/* ============================================================
   SIDEBAR — MOBILE OVERLAY STATE
   ============================================================ */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(32, 21, 21, 0.55);
    z-index: 1039;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-slow);
    backdrop-filter: blur(2px);
}

.sidebar-overlay.show {
    opacity: 1;
    pointer-events: all;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width) !important;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .main-content {
        margin-left: 0 !important;
    }

    .sidebar-collapse-btn {
        display: none;
    }
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left var(--transition-slow);
    display: flex;
    flex-direction: column;
}

.main-content.sidebar-collapsed {
    margin-left: var(--sidebar-collapsed-width);
}

.content-area {
    flex: 1;
    padding: 1.5rem 1.75rem;
}

@media (max-width: 575.98px) {
    .content-area { padding: 1rem; }
}

/* ============================================================
   HEADER / TOP NAVBAR
   ============================================================ */
.header-navbar {
    height: var(--header-height);
    background: rgba(255, 254, 251, 0.90);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1030;
    gap: 1rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Mobile hamburger */
.btn-sidebar-toggle {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--canvas-bg);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}

.btn-sidebar-toggle:hover {
    background: var(--surface-muted);
    color: var(--text-primary);
    border-color: var(--border-arena);
}

/* Page title in header */
.header-page-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- Notification Bell ---- */
.notif-btn {
    position: relative;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--canvas-bg);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.notif-btn:hover {
    background: var(--surface-muted);
    color: var(--text-primary);
    border-color: var(--border-arena);
}

.notif-dot {
    position: absolute;
    top: 6px; right: 6px;
    width: 8px; height: 8px;
    background: var(--accent-orange);
    border-radius: var(--radius-full);
    border: 2px solid var(--canvas-bg);
}

/* ---- User Menu ---- */
.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem 0.35rem 0.35rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--canvas-bg);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
}

.user-menu-btn:hover {
    background: var(--surface-muted);
    border-color: var(--border-arena);
    color: var(--text-primary);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--accent-orange);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.72rem;
    flex-shrink: 0;
}

/* ---- Dropdown refinement ---- */
.dropdown-menu {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 0.4rem;
    background: var(--canvas-bg);
    animation: dropdownIn 0.18s ease;
}

@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: background var(--transition);
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
}

.dropdown-logout-form {
    margin: 0;
}

.dropdown-item:hover {
    background: var(--surface-muted);
    color: var(--text-primary);
}

.dropdown-item.text-danger:hover {
    background: #fee2e2;
}

/* ---- PWA Push Toggle ---- */
.pwa-toggle {
    gap: 0.5rem;
}

.pwa-toggle[hidden] {
    display: none !important;
}

.pwa-toggle.is-active {
    color: var(--status-success-text, #065f46);
}

.pwa-toggle.is-active i {
    color: var(--status-success-text, #065f46);
}

.pwa-toggle.is-blocked {
    color: var(--text-muted-warm, #939084);
    cursor: not-allowed;
}

.pwa-toggle--dropdown {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
}

.pwa-toggle--dropdown:disabled {
    opacity: 0.72;
}

.dropdown-divider {
    border-color: var(--border-light);
    margin: 0.3rem 0;
}

.dropdown-header {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted-warm);
    padding: 0.5rem 0.75rem 0.25rem;
}

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0 0 1.25rem;
    font-size: 0.8rem;
}

.breadcrumb-item a {
    color: var(--text-muted-warm);
    text-decoration: none;
    transition: color var(--transition);
}

.breadcrumb-item a:hover { color: var(--accent-orange); }

.breadcrumb-item.active { color: var(--text-primary); font-weight: 500; }

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--border-arena);
    content: "/";
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--canvas-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: none !important;
    margin-bottom: 1.25rem;
    transition: border-color var(--transition);
}

.card:hover {
    border-color: var(--border-arena);
}

.card-header {
    background: var(--surface-raised);
    border-bottom: 1px solid var(--border-light);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    padding: 0.875rem 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    background: var(--surface-raised);
    border-top: 1px solid var(--border-light);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    padding: 0.875rem 1.25rem;
}

/* ---- Stat Cards ---- */
.stat-card {
    border-left: 3px solid var(--accent-orange);
    transition: transform 0.2s ease, border-color var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    border-left-color: var(--accent-orange);
    border-color: var(--border-arena);
    box-shadow: none !important;
}

.stat-card .stat-icon {
    font-size: 2rem;
    opacity: 0.18;
    color: var(--accent-orange);
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent-orange);
    letter-spacing: -0.02em;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted-warm);
    margin-top: 0.25rem;
}

.stat-card .stat-change {
    font-size: 0.78rem;
    font-weight: 500;
    margin-top: 0.35rem;
}

.stat-change.positive { color: #2d6a4f; }
.stat-change.negative { color: #c1292e; }

/* ============================================================
   FORMS
   ============================================================ */
.form-section {
    background: var(--canvas-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}

.form-section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    padding-bottom: 0.625rem;
    border-bottom: 1px solid var(--border-light);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-label {
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}

.form-control,
.form-select {
    border: 1px solid var(--border-arena);
    border-radius: var(--radius-sm);
    background: var(--canvas-bg);
    color: var(--text-primary);
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent-orange);
    box-shadow: 0 0 0 3px var(--cx-green-soft, rgba(141, 211, 79, 0.10));
    background: var(--canvas-bg);
    color: var(--text-primary);
    outline: none;
}

.form-control::placeholder { color: var(--border-arena); }

.form-control.is-valid { border-color: #2d6a4f; }
.form-control.is-invalid { border-color: #c1292e; }
.form-select.is-invalid { border-color: #c1292e; }

.valid-feedback { color: #2d6a4f; font-size: 0.8rem; }
.invalid-feedback { color: #c1292e; font-size: 0.8rem; }

.compra-validation-summary {
    margin: 12px 16px 16px;
    padding: 12px 14px;
    border: 1px solid rgba(193, 41, 46, 0.28);
    border-radius: var(--radius-sm);
    background: rgba(193, 41, 46, 0.07);
    color: var(--status-danger-text);
}

.compra-validation-summary strong {
    display: block;
    margin-bottom: 6px;
}

.compra-validation-summary ul {
    margin: 0;
    padding-left: 18px;
}

.compra-line-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
}

.compra-row-error {
    margin-top: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--status-danger-text);
}

.venta-price-note {
    color: var(--rc-text-muted);
    font-size: 0.75rem;
    font-weight: 650;
    line-height: 1.35;
    margin-top: 0.45rem;
    min-height: 1rem;
}

.venta-price-note.is-muted {
    color: color-mix(in srgb, var(--rc-text-muted) 86%, var(--rc-text));
}

.venta-price-note.is-manual {
    color: var(--rc-warning);
}

.venta-price-note.is-danger {
    color: var(--status-danger-text);
}

.detail-table tr.is-row-invalid > td {
    background: rgba(193, 41, 46, 0.035);
}

.form-text {
    color: var(--text-muted-warm);
    display: block;
    font-size: 0.78rem;
    line-height: 1.4;
    margin-top: 0.5rem;
    max-width: 34rem;
    text-wrap: pretty;
}

label.required::after {
    content: " *";
    color: var(--accent-orange);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    transition: all var(--transition);
    letter-spacing: 0.01em;
}

.btn-sm { font-size: 0.8rem; padding: 0.35rem 0.75rem; }
.btn-lg { font-size: 0.95rem; padding: 0.65rem 1.35rem; }

.btn-primary {
    background: var(--cx-grad, var(--accent-orange));
    border-color: transparent;
    color: #0B0F14;
}
.btn-primary:hover {
    background: var(--cx-grad, var(--accent-orange));
    border-color: transparent;
    color: #0B0F14;
}
.btn-primary:focus {
    box-shadow: 0 0 0 3px var(--cx-blue-soft, rgba(0, 174, 239, 0.25));
}

.btn-outline-primary {
    color: var(--accent-orange);
    border-color: var(--accent-orange);
    background: transparent;
}
.btn-outline-primary:hover {
    background: var(--cx-grad, var(--accent-orange));
    border-color: transparent;
    color: #0B0F14;
}

.btn-secondary {
    background: var(--surface-muted);
    border-color: var(--border-arena);
    color: var(--text-secondary);
}
.btn-secondary:hover {
    background: var(--border-arena);
    border-color: var(--border-arena);
    color: var(--text-primary);
}

.btn-outline-secondary {
    color: var(--text-secondary);
    border-color: var(--border-arena);
    background: transparent;
}
.btn-outline-secondary:hover {
    background: var(--surface-muted);
    border-color: var(--border-arena);
    color: var(--text-primary);
}

.btn-success {
    background: #2d6a4f;
    border-color: #2d6a4f;
    color: #fff;
}
.btn-success:hover { background: #1b4332; border-color: #1b4332; color: #fff; }

.btn-danger {
    background: #c1292e;
    border-color: #c1292e;
    color: #fff;
}
.btn-danger:hover { background: #a11d22; border-color: #a11d22; color: #fff; }

.btn-warning {
    background: #f59e0b;
    border-color: #f59e0b;
    color: var(--text-primary);
}
.btn-warning:hover { background: #d97706; border-color: #d97706; color: var(--text-primary); }

.btn-info {
    background: #6366f1;
    border-color: #6366f1;
    color: #fff;
}
.btn-info:hover { background: #4f46e5; border-color: #4f46e5; color: #fff; }

.btn-outline-success {
    color: #2d6a4f; border-color: #2d6a4f;
}
.btn-outline-success:hover { background: #2d6a4f; color: #fff; }

.btn-outline-danger {
    color: #c1292e; border-color: #c1292e;
}
.btn-outline-danger:hover { background: #c1292e; color: #fff; }

.btn-outline-warning {
    color: #92400e; border-color: #f59e0b;
}
.btn-outline-warning:hover { background: #f59e0b; color: var(--text-primary); }

.btn-outline-info {
    color: #3730a3; border-color: #6366f1;
}
.btn-outline-info:hover { background: #6366f1; color: #fff; }

/* ============================================================
   TABLES
   ============================================================ */
.table-responsive {
    background: var(--canvas-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.table {
    margin: 0;
    font-size: 0.875rem;
}

.table thead th {
    background: var(--surface-raised);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border-light) !important;
    border-top: none;
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

.table tbody td {
    padding: 0.75rem 1rem;
    border-color: var(--border-light);
    color: var(--text-primary);
    vertical-align: middle;
}

.table-hover tbody tr:hover td {
    background: var(--surface-raised);
}

.table-striped > tbody > tr:nth-of-type(odd) > td {
    background: rgba(236, 234, 227, 0.35);
}

.table-bordered,
.table-bordered th,
.table-bordered td {
    border-color: var(--border-light);
}

/* ============================================================
   BADGES & PILLS
   ============================================================ */
.badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.3em 0.6em;
    border-radius: var(--radius-full);
    letter-spacing: 0.02em;
}

.badge-estado {
    padding: 0.3rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    letter-spacing: 0.02em;
}

.badge-activo    { background: #d1fae5; color: #065f46; }
.badge-inactivo  { background: #fee2e2; color: #991b1b; }
.badge-pendiente { background: #fef3c7; color: #92400e; }
.badge-revision  { background: #e0e7ff; color: #3730a3; }

.pill {
    display: inline-block;
    background: var(--surface-muted);
    border: 1px solid var(--border-arena);
    border-radius: var(--radius-full);
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Bootstrap badge overrides */
.badge.bg-success   { background: #d1fae5 !important; color: #065f46 !important; }
.badge.bg-danger    { background: #fee2e2 !important; color: #991b1b !important; }
.badge.bg-warning   { background: #fef3c7 !important; color: #92400e !important; }
.badge.bg-info      { background: #e0e7ff !important; color: #3730a3 !important; }
.badge.bg-secondary { background: var(--surface-muted) !important; color: var(--text-secondary) !important; }
.badge.bg-primary   { background: var(--accent-orange-dim) !important; color: var(--cx-green-bright) !important; }
.badge.bg-dark      { background: var(--text-primary) !important; color: var(--canvas-bg) !important; }

/* ============================================================
   ALERTS — Inline (flash + validation)
   ============================================================ */
.alert {
    border: none;
    border-radius: var(--radius-md);
    border-left: 4px solid transparent;
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d1fae5;
    border-left-color: #059669;
    color: #065f46;
}

.alert-danger,
.alert-error {
    background: #fee2e2;
    border-left-color: #dc2626;
    color: #991b1b;
}

.alert-warning {
    background: #fef3c7;
    border-left-color: #f59e0b;
    color: #92400e;
}

.alert-info {
    background: #e0e7ff;
    border-left-color: #6366f1;
    color: #3730a3;
}

.alert .btn-close {
    filter: none;
    opacity: 0.5;
    padding: 0.875rem;
}

.alert .btn-close:hover { opacity: 1; }

/* ============================================================
   TOAST SYSTEM
   ============================================================ */
.toast-container-custom {
    position: fixed;
    top: calc(var(--header-height) + 1rem);
    right: 1.25rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
    max-width: 360px;
    width: calc(100vw - 2.5rem);
}

.toast-item {
    background: var(--canvas-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 0.875rem 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    pointer-events: all;
    animation: toastSlideIn 0.3s ease forwards;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast-item.hiding {
    opacity: 0;
    transform: translateX(20px);
}

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

.toast-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast-item.toast-success .toast-icon { background: #d1fae5; color: #059669; }
.toast-item.toast-error   .toast-icon { background: #fee2e2; color: #dc2626; }
.toast-item.toast-warning .toast-icon { background: #fef3c7; color: #f59e0b; }
.toast-item.toast-info    .toast-icon { background: #e0e7ff; color: #6366f1; }

.toast-body {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.toast-message {
    font-size: 0.8rem;
    color: var(--text-muted-warm);
    line-height: 1.4;
}

.toast-close {
    width: 20px;
    height: 20px;
    border: none;
    background: none;
    color: var(--text-muted-warm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    border-radius: var(--radius-xs);
    flex-shrink: 0;
    transition: all var(--transition);
    padding: 0;
    margin-top: 2px;
}

.toast-close:hover {
    background: var(--surface-muted);
    color: var(--text-primary);
}

/* Accent line at left based on type */
.toast-item.toast-success { border-left: 3px solid #059669; }
.toast-item.toast-error   { border-left: 3px solid #dc2626; }
.toast-item.toast-warning { border-left: 3px solid #f59e0b; }
.toast-item.toast-info    { border-left: 3px solid #6366f1; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    background: var(--canvas-bg);
}

.modal-header {
    background: var(--surface-raised);
    border-bottom: 1px solid var(--border-light);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 1rem 1.25rem;
}

.modal-title {
    font-size: 0.95rem;
    font-weight: 700;
}

.modal-footer {
    background: var(--canvas-bg);
    border-top: 1px solid var(--border-light);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: 0.875rem 1.25rem;
}

.modal-header.bg-danger {
    background: #c1292e !important;
    color: #fff !important;
}
.modal-header.bg-success {
    background: #2d6a4f !important;
    color: #fff !important;
}
.modal-header .btn-close { opacity: 0.7; }
.modal-header .btn-close:hover { opacity: 1; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    padding: 0.75rem 1.75rem;
    border-top: 1px solid var(--border-light);
    background: var(--canvas-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--text-muted-warm);
}

.footer-brand {
    font-weight: 600;
    color: var(--text-secondary);
}

/* ============================================================
   UTILITY COMPONENTS
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 4rem 1.5rem;
    color: var(--text-muted-warm);
}

.empty-state-icon {
    font-size: 2.5rem;
    opacity: 0.3;
    margin-bottom: 1rem;
    display: block;
}

.empty-state-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}

.empty-state-text {
    font-size: 0.875rem;
    max-width: 300px;
    margin: 0 auto;
}

.stat-label, .field-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted-warm);
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.section-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted-warm);
    margin-bottom: 1.25rem;
}

/* Divider */
.divider, hr {
    border-color: var(--border-light);
    opacity: 1;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(32, 21, 21, 0.45);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.show { display: flex; }

.loading-spinner {
    background: var(--canvas-bg);
    padding: 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-lg);
}

/* ============================================================
   SELECT2 CUSTOMIZATION
   ============================================================ */
.select2-container--default .select2-selection--single {
    height: calc(1.5em + 1rem + 2px);
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-arena);
    border-radius: var(--radius-sm);
    background: var(--canvas-bg);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: calc(1.5em + 0.5rem);
    padding-left: 0;
    color: var(--text-primary);
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: calc(1.5em + 1rem + 2px);
}

.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--accent-orange);
    box-shadow: 0 0 0 3px var(--cx-green-soft, rgba(141, 211, 79, 0.10));
}

.select2-dropdown {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    background: var(--canvas-bg);
}

.select2-results__option--selected { background: var(--surface-muted); }
.select2-results__option--highlighted { background: var(--accent-orange) !important; }

/* ============================================================
   FLATPICKR CUSTOMIZATION
   ============================================================ */
.flatpickr-calendar {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: var(--accent-orange) !important;
    border-color: var(--accent-orange) !important;
}

.flatpickr-day.selected:hover { background: var(--cx-blue) !important; }

/* ============================================================
   DROPZONE
   ============================================================ */
.dropzone {
    border: 2px dashed var(--border-arena);
    border-radius: var(--radius-md);
    background: var(--surface-raised);
    padding: 2rem;
    transition: all var(--transition);
}

.dropzone:hover,
.dropzone.dz-drag-hover {
    border-color: var(--accent-orange);
    background: var(--accent-orange-dim);
}

.dropzone .dz-message {
    font-size: 0.95rem;
    color: var(--text-muted-warm);
}

/* Override del vendor: el default aplica scale(1.05) + blur(8px) en hover
   sobre la imagen, lo que el QA reporta como "distorsion al pasar el cursor".
   Reemplazamos por una microinteraccion estable: marco fijo, sin reflow,
   transicion solo de transform y opacity. */
.dropzone .dz-preview .dz-image {
    width: 120px;
    height: 120px;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: var(--surface-muted);
    box-shadow: 0 1px 2px rgba(0,0,0,.06);
    transition: box-shadow var(--transition), transform var(--transition);
    will-change: transform;
}

.dropzone .dz-preview .dz-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: none !important;
    filter: none !important;
    transition: none;
}

.dropzone .dz-preview:hover .dz-image,
.dropzone .dz-preview:focus-within .dz-image {
    box-shadow: 0 4px 10px rgba(0,0,0,.10);
    transform: translateY(-1px);
}

.dropzone .dz-preview:hover .dz-image img,
.dropzone .dz-preview:focus-within .dz-image img {
    transform: none !important;
    filter: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .dropzone .dz-preview .dz-image,
    .dropzone .dz-preview:hover .dz-image {
        transition: none;
        transform: none;
    }
}

/* ============================================================
   PAGINATION
   ============================================================ */
.page-link {
    color: var(--text-primary);
    border-color: var(--border-light);
    background: var(--canvas-bg);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    transition: all var(--transition);
}

.page-link:hover {
    background: var(--surface-muted);
    border-color: var(--border-arena);
    color: var(--accent-orange);
}

.page-item.active .page-link {
    background: var(--accent-orange);
    border-color: var(--accent-orange);
    color: #fff;
}

/* ============================================================
   PROGRESS BARS
   ============================================================ */
.progress {
    background: var(--surface-muted);
    border-radius: var(--radius-full);
    height: 6px;
}

.progress-bar { border-radius: var(--radius-full); }
.progress-bar.bg-success { background: #2d6a4f !important; }
.progress-bar.bg-danger  { background: #c1292e !important; }
.progress-bar.bg-warning { background: #f59e0b !important; }
.progress-bar.bg-info    { background: #6366f1 !important; }
.progress-bar.bg-primary { background: var(--accent-orange) !important; }

/* ============================================================
   BOOTSTRAP COLOR OVERRIDES — Warm Palette Compliance
   ============================================================ */

/* Text */
.text-muted     { color: var(--text-muted-warm) !important; }
.text-primary   { color: var(--accent-orange) !important; }
.text-success   { color: #065f46 !important; }
.text-danger    { color: #991b1b !important; }
.text-warning   { color: #92400e !important; }
.text-info      { color: #3730a3 !important; }
.text-dark      { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }

/* Backgrounds */
.bg-primary   { background: var(--accent-orange) !important; color: #fff !important; }
.bg-success   { background: #d1fae5 !important; color: #065f46 !important; }
.bg-danger    { background: #fee2e2 !important; color: #991b1b !important; }
.bg-warning   { background: #fef3c7 !important; color: #92400e !important; }
.bg-info      { background: #e0e7ff !important; color: #3730a3 !important; }
.bg-secondary { background: var(--surface-muted) !important; color: var(--text-secondary) !important; }
.bg-dark      { background: var(--text-primary) !important; color: var(--canvas-bg) !important; }
.bg-light     { background: var(--surface-raised) !important; color: var(--text-primary) !important; }
.bg-white     { background: var(--canvas-bg) !important; }

/* Card header overrides */
.card-header.bg-success { background: #d1fae5 !important; color: #065f46 !important; }
.card-header.bg-danger  { background: #fee2e2 !important; color: #991b1b !important; }
.card-header.bg-primary { background: var(--accent-orange-dim) !important; color: var(--accent-orange) !important; }
.card-header.bg-info    { background: #e0e7ff !important; color: #3730a3 !important; }
.card-header.bg-warning { background: #fef3c7 !important; color: #92400e !important; }
.card-header.text-white,
.card-header .text-white { color: var(--canvas-bg) !important; }

/* Borders */
.border { border-color: var(--border-light) !important; }
.border-arena { border-color: var(--border-arena) !important; }

/* Warm utility classes */
.text-warm-black    { color: var(--text-primary) !important; }
.text-warm-green    { color: #2d6a4f !important; }
.text-warm-orange   { color: var(--accent-orange) !important; }
.text-warm-charcoal { color: var(--text-secondary) !important; }
.text-warm-muted    { color: var(--text-muted-warm) !important; }
.bg-warm-cream      { background: var(--canvas-bg) !important; }
.bg-warm-surface    { background: var(--surface-muted) !important; }
.border-warm-sand   { border-color: var(--border-arena) !important; }

/* ============================================================
   SKELETON LOADING
   ============================================================ */
.skeleton {
    background: linear-gradient(90deg, var(--surface-muted) 25%, var(--surface-raised) 50%, var(--surface-muted) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================================
   RCL — REUSABLE COMPONENT LIBRARY
   Uniform classes for all admin views
   ============================================================ */

/* ---- Page Header ---- */
.rcl-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--sp-6);
    gap: var(--sp-4);
    flex-wrap: wrap;
}

.rcl-page-header h1 {
    font-size: var(--fs-page-title);
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.rcl-page-header .rcl-page-actions {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    flex-shrink: 0;
}

/* ---- Stat Row ---- */
.rcl-stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--sp-4);
    margin-bottom: var(--sp-6);
}

.rcl-stat-card {
    background: var(--canvas-bg);
    border: 1px solid var(--border-light);
    border-left: 3px solid var(--accent-orange);
    border-radius: var(--radius-sm);
    padding: var(--sp-5);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);
    transition: border-color var(--transition), transform 0.2s ease;
}

.rcl-stat-card:hover {
    border-color: var(--border-arena);
    transform: translateY(-1px);
}

.rcl-stat-card.accent-success { border-left-color: var(--status-success-border); }
.rcl-stat-card.accent-warning { border-left-color: var(--status-warning-border); }
.rcl-stat-card.accent-danger  { border-left-color: var(--status-danger-border); }
.rcl-stat-card.accent-info    { border-left-color: var(--status-info-border); }
.rcl-stat-card.accent-neutral { border-left-color: var(--border-arena); }

.rcl-stat-value {
    font-size: var(--fs-stat-value);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.rcl-stat-card.accent-success .rcl-stat-value { color: var(--status-success-border); }
.rcl-stat-card.accent-warning .rcl-stat-value { color: var(--status-warning-border); }
.rcl-stat-card.accent-danger  .rcl-stat-value { color: var(--status-danger-border); }
.rcl-stat-card.accent-info    .rcl-stat-value { color: var(--status-info-border); }
.rcl-stat-card .rcl-stat-value                { color: var(--accent-orange); }

.rcl-stat-label {
    font-size: var(--fs-stat-label);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted-warm);
    margin-top: var(--sp-1);
}

.rcl-stat-icon {
    font-size: 1.5rem;
    opacity: 0.2;
    color: var(--text-muted-warm);
    flex-shrink: 0;
}

/* ---- KPI Card (centered, for dashboards) ---- */
.rcl-kpi-card {
    background: var(--canvas-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: var(--sp-6) var(--sp-5);
    text-align: center;
    transition: border-color var(--transition);
}

.rcl-kpi-card:hover { border-color: var(--border-arena); }

.rcl-kpi-value {
    font-size: var(--fs-stat-value);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
}

.rcl-kpi-label {
    font-size: var(--fs-small);
    color: var(--text-muted-warm);
    margin-top: var(--sp-2);
}

.rcl-kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    margin-bottom: var(--sp-3);
}

.rcl-kpi-icon.orange  { background: var(--accent-orange-dim); color: var(--accent-orange); }
.rcl-kpi-icon.green   { background: var(--status-success-bg); color: var(--status-success-border); }
.rcl-kpi-icon.blue    { background: var(--status-info-bg); color: var(--status-info-border); }
.rcl-kpi-icon.amber   { background: var(--status-warning-bg); color: var(--status-warning-border); }
.rcl-kpi-icon.red     { background: var(--status-danger-bg); color: var(--status-danger-border); }
.rcl-kpi-icon.neutral { background: var(--surface-muted); color: var(--text-muted-warm); }

/* ---- Filter Panel ---- */
.rcl-filter-panel {
    background: var(--canvas-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: var(--sp-5);
    margin-bottom: var(--sp-5);
}

.rcl-filter-panel .form-label {
    font-size: var(--fs-label);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted-warm);
}

/* ---- Content Card (table wrapper) ---- */
.rcl-content-card {
    background: var(--canvas-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: var(--sp-5);
}

.rcl-content-card .card-header {
    background: var(--surface-raised);
    border-bottom: 1px solid var(--border-light);
    padding: var(--sp-3) var(--sp-5);
    font-weight: 600;
    font-size: var(--fs-body);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rcl-content-card .card-footer {
    background: var(--surface-raised);
    border-top: 1px solid var(--border-light);
    padding: var(--sp-3) var(--sp-5);
    font-size: var(--fs-small);
    color: var(--text-muted-warm);
}

/* ---- RCL Table ---- */
.rcl-table {
    width: 100%;
    font-size: var(--fs-body);
    margin: 0;
}

.rcl-table thead th {
    background: var(--surface-raised);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: var(--fs-label);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border-light);
    border-top: none;
    padding: var(--sp-3) var(--sp-4);
    white-space: nowrap;
}

.rcl-table tbody td {
    padding: var(--sp-3) var(--sp-4);
    border-color: var(--border-light);
    color: var(--text-primary);
    vertical-align: middle;
}

.rcl-table tbody tr:hover td {
    background: var(--surface-raised);
}

.rcl-table tbody tr:last-child td {
    border-bottom: none;
}

.rcl-table tfoot td {
    background: var(--surface-raised);
    padding: var(--sp-3) var(--sp-4);
    font-weight: 600;
    border-top: 1px solid var(--border-light);
}

/* ---- Status Badges ---- */
.rcl-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25em;
    padding: 0.25rem 0.625rem;
    font-size: var(--fs-label);
    font-weight: 600;
    border-radius: var(--radius-full);
    letter-spacing: 0.02em;
    line-height: 1.4;
}

.rcl-badge-success { background: var(--status-success-bg); color: var(--status-success-text); }
.rcl-badge-warning { background: var(--status-warning-bg); color: var(--status-warning-text); }
.rcl-badge-danger  { background: var(--status-danger-bg);  color: var(--status-danger-text); }
.rcl-badge-info    { background: var(--status-info-bg);    color: var(--status-info-text); }
.rcl-badge-neutral { background: var(--status-neutral-bg); color: var(--status-neutral-text); }

/* ---- Empty State ---- */
.rcl-empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted-warm);
}

.rcl-empty-state .rcl-empty-icon {
    font-size: 2.5rem;
    opacity: 0.25;
    margin-bottom: var(--sp-4);
    display: block;
}

.rcl-empty-state .rcl-empty-title {
    font-size: var(--fs-body);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--sp-1);
}

.rcl-empty-state .rcl-empty-text {
    font-size: var(--fs-small);
    max-width: 320px;
    margin: 0 auto var(--sp-4);
}

/* ---- Section Title ---- */
.rcl-section-title {
    font-size: var(--fs-section);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--sp-4);
    padding-bottom: var(--sp-2);
    border-bottom: 1px solid var(--border-light);
}

/* ---- Form Card ---- */
.rcl-form-card {
    background: var(--canvas-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    margin-bottom: var(--sp-5);
}

.rcl-form-card .card-header {
    background: var(--surface-raised);
    border-bottom: 1px solid var(--border-light);
    padding: var(--sp-3) var(--sp-5);
    font-weight: 600;
    font-size: var(--fs-body);
    color: var(--text-primary);
}

.rcl-form-card .card-body {
    padding: var(--sp-5);
}

.rcl-form-card .card-footer {
    background: var(--surface-raised);
    border-top: 1px solid var(--border-light);
    padding: var(--sp-3) var(--sp-5);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--sp-2);
}

/* ---- Action Group ---- */
.rcl-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.rcl-actions .btn {
    padding: 0.3rem 0.55rem;
    font-size: var(--fs-small);
    border-color: var(--border-light);
    color: var(--text-muted-warm);
}

.rcl-actions .btn:hover {
    color: var(--text-primary);
    border-color: var(--border-arena);
    background: var(--surface-muted);
}

/* ---- Info Banner ---- */
.rcl-info-banner {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    background: var(--status-info-bg);
    border-radius: var(--radius-sm);
    margin-bottom: var(--sp-5);
    font-size: var(--fs-body);
    color: var(--status-info-text);
}

.rcl-info-banner i { font-size: 1.1rem; flex-shrink: 0; }

/* ---- Welcome Card (dashboard) ---- */
.rcl-welcome-card {
    background: var(--surface-raised);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: var(--sp-6) var(--sp-5);
    margin-bottom: var(--sp-5);
}

.rcl-welcome-card h2 {
    font-size: var(--fs-page-title);
    font-weight: 700;
    margin-bottom: var(--sp-2);
}

.rcl-welcome-card p {
    font-size: var(--fs-body);
    color: var(--text-muted-warm);
    margin: 0;
}

/* ============================================================
   RCL — BUTTON SYSTEM
   ============================================================ */

.rcl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-1);
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-weight: 600;
    font-size: var(--fs-body);
    line-height: 1;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
    white-space: nowrap;
    min-height: 40px;
    padding: var(--sp-2) var(--sp-4);
}

.rcl-btn:active { transform: scale(0.97); }

/* Primary — Circularix CTA */
.rcl-btn--primary {
    background: var(--cx-grad, var(--accent-orange));
    color: #0B0F14;
    border-color: transparent;
}
.rcl-btn--primary:hover {
    background: var(--cx-grad, var(--accent-orange));
    border-color: transparent;
    color: #0B0F14;
}

/* Secondary — raised surface */
.rcl-btn--secondary {
    background: var(--surface-raised);
    color: var(--text-primary);
    border-color: var(--border-light);
}
.rcl-btn--secondary:hover {
    background: var(--surface-muted);
    border-color: var(--border-arena);
}

/* Ghost — minimal */
.rcl-btn--ghost {
    background: transparent;
    color: var(--text-muted-warm);
    border-color: var(--border-light);
}
.rcl-btn--ghost:hover {
    background: var(--surface-raised);
    color: var(--text-primary);
    border-color: var(--border-arena);
}

/* Success */
.rcl-btn--success {
    background: var(--status-success-border);
    color: #fff;
    border-color: var(--status-success-border);
}
.rcl-btn--success:hover {
    background: #245a42;
    border-color: #245a42;
    color: #fff;
}

/* Danger */
.rcl-btn--danger {
    background: transparent;
    color: var(--status-danger-border);
    border-color: var(--status-danger-border);
}
.rcl-btn--danger:hover {
    background: var(--status-danger-bg);
    color: var(--status-danger-text);
}

/* Sizes */
.rcl-btn--sm {
    font-size: var(--fs-small);
    padding: 0.3rem 0.6rem;
    min-height: 32px;
}

.rcl-btn--lg {
    font-size: var(--fs-section);
    padding: var(--sp-3) var(--sp-6);
    min-height: 48px;
}

/* Full width */
.rcl-btn--block { width: 100%; }

/* Disabled */
.rcl-btn:disabled,
.rcl-btn[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Icon only */
.rcl-btn--icon {
    width: 36px;
    padding: 0;
}
.rcl-btn--icon.rcl-btn--sm { width: 30px; }

/* ============================================================
   RCL — INPUT / SELECT SYSTEM
   ============================================================ */

.rcl-input,
.rcl-select {
    width: 100%;
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: var(--fs-body);
    color: var(--text-primary);
    background: var(--canvas-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    min-height: 40px;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.rcl-input::placeholder {
    color: var(--text-muted-warm);
    opacity: 0.7;
}

.rcl-input:hover,
.rcl-select:hover {
    border-color: var(--border-arena);
}

.rcl-input:focus,
.rcl-select:focus {
    border-color: var(--accent-orange);
    box-shadow: 0 0 0 3px var(--accent-orange-dim);
}

.rcl-input--error {
    border-color: var(--status-danger-border) !important;
}
.rcl-input--error:focus {
    box-shadow: 0 0 0 3px rgba(193, 41, 46, 0.15) !important;
}

/* Select */
.rcl-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b6560' d='M6 8.82L1.18 4h9.64z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.25rem;
    cursor: pointer;
}

/* Textarea */
.rcl-textarea {
    min-height: 80px;
    resize: vertical;
}

/* Input with icon (input group replacement) */
.rcl-input-group {
    position: relative;
    display: flex;
    align-items: stretch;
}

.rcl-input-group .rcl-input {
    flex: 1;
}

.rcl-input-group--icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted-warm);
    pointer-events: none;
    font-size: var(--fs-body);
}

.rcl-input-group--icon + .rcl-input,
.rcl-input-group .rcl-input--has-icon {
    padding-left: 2.5rem;
}

/* ============================================================
   RCL — MODAL
   ============================================================ */

.rcl-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(32, 21, 21, 0.45);
    backdrop-filter: blur(4px);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-4);
}

.rcl-modal {
    background: var(--canvas-bg);
    border: 1px solid var(--border-arena);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
}

.rcl-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-4) var(--sp-5);
    border-bottom: 1px solid var(--border-light);
}

.rcl-modal__title {
    font-size: var(--fs-section);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.rcl-modal__close {
    background: none;
    border: none;
    color: var(--text-muted-warm);
    cursor: pointer;
    padding: var(--sp-1);
    font-size: 1.25rem;
    line-height: 1;
}

.rcl-modal__body {
    padding: var(--sp-5);
}

.rcl-modal__footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-5);
    border-top: 1px solid var(--border-light);
    background: var(--surface-raised);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ============================================================
   RCL — PERIOD TOGGLE (dashboard filter)
   ============================================================ */

.rcl-period-toggle {
    display: inline-flex;
    gap: 0;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.rcl-period-toggle .rcl-period-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.85rem;
    font-size: var(--fs-small);
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--canvas-bg);
    border: none;
    border-right: 1px solid var(--border-light);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
}

.rcl-period-toggle .rcl-period-btn:last-child {
    border-right: none;
}

.rcl-period-toggle .rcl-period-btn:hover {
    background: var(--surface-raised);
    color: var(--text-primary);
}

.rcl-period-toggle .rcl-period-btn.active {
    background: var(--accent-orange);
    color: #fffefb;
    font-weight: 600;
}

/* ============================================================
   RCL — QUICK ACTION CARD (dashboard)
   ============================================================ */

.rcl-quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--sp-3);
}

.rcl-quick-action {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-4);
    background: var(--canvas-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition);
}

.rcl-quick-action:hover {
    border-color: var(--accent-orange);
    background: var(--accent-orange-dim);
}

.rcl-quick-action__icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: grid;
    place-items: center;
    background: var(--surface-muted);
    color: var(--text-secondary);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.rcl-quick-action__label {
    font-size: var(--fs-small);
    font-weight: 500;
}

/* ============================================================
   RCL — LIST (replaces Bootstrap list-group)
   ============================================================ */

.rcl-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rcl-list__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-3) 0;
    border-bottom: 1px solid var(--border-light);
    font-size: var(--fs-body);
    color: var(--text-primary);
}

.rcl-list__item:last-child {
    border-bottom: none;
}

.rcl-list__label {
    font-weight: 500;
}

.rcl-list__value {
    font-weight: 600;
    color: var(--text-secondary);
}

/* ============================================================
   RCL — FORM CARD (override Bootstrap card for forms)
   ============================================================ */

.rcl-form-card {
    background: var(--canvas-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    margin-bottom: var(--sp-5);
}

.rcl-form-card__header {
    background: var(--surface-raised);
    border-bottom: 1px solid var(--border-light);
    padding: var(--sp-3) var(--sp-5);
    font-weight: 600;
    font-size: var(--fs-body);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

.rcl-form-card__body {
    padding: var(--sp-5);
}

.rcl-form-card__footer {
    background: var(--surface-raised);
    border-top: 1px solid var(--border-light);
    padding: var(--sp-3) var(--sp-5);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--sp-2);
}

/* ============================================================
   Bootstrap form-control / form-select RCL overrides
   ============================================================ */

.form-control,
.form-select {
    font-size: var(--fs-body);
    border-color: var(--border-light);
    border-radius: var(--radius-sm);
    min-height: 40px;
    color: var(--text-primary);
    background-color: var(--canvas-bg);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent-orange);
    box-shadow: 0 0 0 3px var(--accent-orange-dim);
    background-color: var(--canvas-bg);
}

.form-control::placeholder {
    color: var(--text-muted-warm);
    opacity: 0.7;
}

.input-group-text {
    background: var(--surface-raised);
    border-color: var(--border-light);
    color: var(--text-muted-warm);
    font-size: var(--fs-body);
}

/* ============================================================
   RESPONSIVE — small screens
   ============================================================ */
@media (max-width: 399px) {
    .rcl-stat-row {
        grid-template-columns: 1fr;
    }
    .rcl-page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .rcl-page-header .rcl-page-actions {
        width: 100%;
    }
    .rcl-page-header .rcl-page-actions .rcl-btn {
        flex: 1;
        justify-content: center;
    }
}

/* ============================================================
   RCL BUTTONS (BEM)
   ============================================================ */
.rcl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35em;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-weight: 500;
    font-size: var(--fs-body);
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}

.rcl-btn--sm { font-size: var(--fs-small); padding: 0.3rem 0.65rem; }
.rcl-btn--lg { font-size: 0.95rem; padding: 0.6rem 1.25rem; }

.rcl-btn--primary {
    background: var(--cx-grad, var(--accent-orange));
    border-color: transparent;
    color: #0B0F14;
}
.rcl-btn--primary:hover { background: var(--cx-grad, var(--accent-orange)); border-color: transparent; color: #0B0F14; }

.rcl-btn--secondary {
    background: var(--surface-muted);
    border-color: var(--border-arena);
    color: var(--text-secondary);
}
.rcl-btn--secondary:hover { background: var(--border-arena); color: var(--text-primary); }

.rcl-btn--ghost {
    background: transparent;
    border-color: var(--border-arena);
    color: var(--text-secondary);
}
.rcl-btn--ghost:hover { background: var(--surface-muted); color: var(--text-primary); }

.rcl-btn--success {
    background: #2d6a4f;
    border-color: #2d6a4f;
    color: #fff;
}
.rcl-btn--success:hover { background: #1b4332; border-color: #1b4332; color: #fff; }

.rcl-btn--danger {
    background: var(--status-danger-border);
    border-color: var(--status-danger-border);
    color: #fff;
}
.rcl-btn--danger:hover { background: #a11d22; border-color: #a11d22; color: #fff; }

/* ============================================================
   RCL FORM CARD (BEM)
   ============================================================ */
.rcl-form-card {
    background: var(--canvas-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    margin-bottom: var(--sp-5);
    overflow: hidden;
}

.rcl-form-card__header {
    background: var(--surface-raised);
    border-bottom: 1px solid var(--border-light);
    padding: var(--sp-3) var(--sp-5);
    font-weight: 600;
    font-size: var(--fs-body);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rcl-form-card__body {
    padding: var(--sp-5);
}

.rcl-form-card__footer {
    background: var(--surface-raised);
    border-top: 1px solid var(--border-light);
    padding: var(--sp-3) var(--sp-5);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--sp-2);
}

/* ============================================================
   RCL PERIOD TOGGLE
   ============================================================ */
.rcl-period-toggle {
    display: flex;
    gap: 0.25rem;
    background: var(--surface-muted);
    border-radius: var(--radius-sm);
    padding: 0.2rem;
}

.rcl-period-btn {
    padding: 0.35rem 0.85rem;
    font-size: var(--fs-small);
    font-weight: 500;
    border-radius: calc(var(--radius-sm) - 1px);
    color: var(--text-muted-warm);
    text-decoration: none;
    transition: all var(--transition);
}

.rcl-period-btn:hover { color: var(--text-primary); }

.rcl-period-btn.active {
    background: var(--accent-orange);
    color: #fff;
    box-shadow: var(--shadow-xs);
}

/* ============================================================
   RCL LIST
   ============================================================ */
.rcl-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rcl-list__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-3) 0;
    border-bottom: 1px solid var(--border-light);
    font-size: var(--fs-body);
}

.rcl-list__item:last-child { border-bottom: none; }

.rcl-list__label { color: var(--text-primary); }

.rcl-list__value {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

/* ============================================================
   RCL QUICK ACTIONS
   ============================================================ */
.rcl-quick-actions {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

.rcl-quick-action {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-primary);
    font-size: var(--fs-body);
    font-weight: 500;
    transition: all var(--transition);
}

.rcl-quick-action:hover {
    border-color: var(--accent-orange);
    background: var(--accent-orange-dim);
    color: var(--accent-orange);
}

.rcl-quick-action__icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-orange-dim);
    color: var(--accent-orange);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    flex-shrink: 0;
}

.rcl-quick-action__label { flex: 1; }

/* ============================================================
   PRINT
   ============================================================ */
@media print {
    .sidebar,
    .header-navbar,
    .footer,
    .no-print {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}
