/*
 * Paleta y tokens de marca portados de frontend/src/index.css (prototipo React) —
 * ver docs/MIGRATION_PLAN.md. No usa Tailwind todavía (queda para cuando se arme el build
 * de assets, ver MIGRATION_PLAN §5); son las mismas variables como custom properties CSS
 * planas + un set mínimo de utilidades a mano para portar las pantallas 1:1.
 */
@import url('https://fonts.googleapis.com/css2?family=Arvo:ital,wght@0,400;0,700;1,400;1,700&family=Hanken+Grotesk:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --font-sans: "Hanken Grotesk", "Inter", system-ui, -apple-system, sans-serif;
    --font-serif: "Arvo", Georgia, serif;

    --color-brand-navy: #00172D;
    --color-brand-blue: #0060ab;
    --color-brand-cyan: #00b2e3;
    --color-brand-orange: #f38b20;
    --color-brand-red: #e33d45;
    --color-brand-green: #00ab66;
    --color-brand-magenta: #d81b60;
    --color-brand-purple: #6a1b9a;

    --color-on-surface: #171c1f;
    --color-on-primary: #ffffff;
    --color-secondary-fixed: #d3e3ff;
    --color-surface-variant: #dfe3e7;
    --color-on-secondary-container: #003664;
    --color-tertiary-fixed-dim: #6ad3ff;
    --color-surface-container-highest: #dfe3e7;
    --color-surface-container-low: #f0f4f8;
    --color-on-surface-variant: #43474d;
    --color-background: #f6fafe;
    --color-surface: #f6fafe;
    --color-surface-container-lowest: #ffffff;
    --color-primary: #000000;
    --color-secondary: #6a1b9a;
    --color-outline-variant: #c4c6cd;
    --color-primary-fixed-dim: #b3c8e5;
    --color-surface-container: #eaeef2;
    --color-on-background: #171c1f;
    --color-on-secondary: #ffffff;
    --color-secondary-container: #4ca0ff;
    --color-surface-container-high: #e4e9ed;
    --color-outline: #74777d;
    --color-error: #ba1a1a;

    /* Activo de sidebar/avatar: desacoplado de --color-secondary-container porque ese
       token también pinta el kind-badge de Propuesta (azul/cyan) — ver MIGRATION_PLAN. */
    --color-primary-active-bg: #6a1b9a;
    --color-primary-active-on: #ffffff;
}

* { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    tab-size: 4;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--color-background);
    color: var(--color-on-surface);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "kern" 1, "liga" 1;
}

h1, h2, h3, h4, h5, h6, p, dl, dd { margin: 0; }
button, input, select, textarea { font-family: inherit; }

a { color: var(--color-secondary); }

.neo-shadow { box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.05); }
.recessed-input { box-shadow: inset 0 2px 4px rgba(0,0,0,0.06); }

/* ---------- Layout: pantallas de auth (login / verify) ---------- */
.auth-screen {
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px;
    position: relative;
}

.auth-main { width: 100%; max-width: 440px; position: relative; z-index: 10; }
.auth-main--wide { max-width: 480px; }
/* Backlog ítem 4 (docs/MIGRATION_PLAN.md §25): el form de registro público tiene más
   campos que login/verify (name/email/tipo/puesto/compañía en `.form-grid` de 2
   columnas) — necesita más ancho que `.auth-main--wide` para no verse apretado. */
.auth-main--form { max-width: 620px; }

.auth-header { text-align: center; margin-bottom: 32px; display: flex; flex-direction: column; align-items: center; }
.auth-header__tagline {
    color: var(--color-on-surface-variant);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 4px;
}

.auth-card {
    background: var(--color-surface-container-lowest);
    border-radius: 32px;
    overflow: hidden;
    border: 1px solid rgba(196, 198, 205, 0.3);
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}
.auth-card__body { padding: 40px; }
.auth-card__stripe { height: 8px; width: 100%; display: flex; }
.auth-card__stripe span { flex: 1; }

.auth-title { font-size: 24px; font-weight: 700; color: var(--color-on-surface); margin: 0 0 6px; line-height: 1.2; }
.auth-subtitle { color: var(--color-on-surface-variant); font-size: 14px; line-height: 1.6; margin: 0; }

.form-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.form-label {
    color: var(--color-secondary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-left: 4px;
}
.form-input {
    width: 100%;
    height: 56px;
    padding: 0 16px;
    background: var(--color-surface-container-low);
    border: 1px solid var(--color-outline-variant);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-brand-navy);
    font-family: var(--font-sans);
}
.form-input:focus {
    outline: none;
    border-color: transparent;
    box-shadow: 0 0 0 2px var(--color-secondary);
}

.btn {
    width: 100%;
    height: 56px;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    font-family: var(--font-sans);
}
.btn-primary {
    background: var(--color-secondary);
    color: var(--color-on-primary);
    box-shadow: 0 10px 20px -5px rgba(106, 27, 154, 0.3);
}
.btn-primary:hover { opacity: .95; }
.btn-link {
    background: transparent;
    color: var(--color-secondary);
    font-weight: 700;
    font-size: 13px;
    height: auto;
    padding: 8px 0;
}
.btn-link:hover { text-decoration: underline; }

.auth-footer-note { padding-top: 20px; margin-top: 8px; border-top: 1px solid rgba(196,198,205,0.3); text-align: center; }
.auth-footer-note p { color: var(--color-on-surface-variant); font-size: 12px; font-weight: 500; margin: 0 0 8px; }

.sso-badge {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    color: var(--color-on-surface-variant);
    font-size: 12px;
    font-weight: 600;
    opacity: .8;
}
.sso-badge__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--color-outline); }

.auth-links { margin-top: 48px; text-align: center; }
.auth-links__row { display: flex; justify-content: center; gap: 16px; color: var(--color-on-surface-variant); font-size: 12px; font-weight: 600; }
.auth-links__row a { color: inherit; text-decoration: none; }
.auth-links__row a:hover { color: var(--color-brand-navy); }
.auth-links__copy { color: rgba(67,71,77,0.6); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-top: 8px; }

.footer-accent { position: fixed; bottom: 0; left: 0; width: 100%; height: 8px; display: flex; z-index: 0; }
.footer-accent span { flex: 1; }

.back-link {
    align-self: flex-start;
    color: var(--color-on-surface-variant);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    margin-bottom: 16px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
.back-link:hover { color: var(--color-brand-navy); }

/* ---------- OTP boxes ---------- */
.otp-boxes { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 32px; }
.otp-box {
    width: 48px;
    height: 60px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    background: var(--color-surface-container-low);
    border: 1px solid var(--color-outline-variant);
    border-radius: 10px;
    color: var(--color-brand-navy);
}
.otp-box:focus { outline: none; box-shadow: 0 0 0 2px var(--color-secondary); }
.otp-box.is-error { border-color: var(--color-brand-red); box-shadow: 0 0 0 1px rgba(227,61,69,0.3); }

.alert { padding: 10px 16px; border-radius: 10px; font-size: 12px; font-weight: 700; text-align: center; margin-bottom: 24px; }
.alert-error { background: rgba(227, 61, 69, 0.1); color: var(--color-brand-red); }
.alert-success { background: rgba(0, 171, 102, 0.1); color: var(--color-brand-green); }
.alert-debug { background: var(--color-secondary-fixed); color: var(--color-on-secondary-container); }

.otp-hint { text-align: center; font-size: 11px; color: var(--color-secondary); font-weight: 600; margin-top: 8px; }

/* ---------- Logo ---------- */
.logo { display: flex; align-items: center; gap: 12px; user-select: none; }
.logo--vertical { flex-direction: column; gap: 12px; }
.logo__icon { height: 64px; width: 64px; }
.logo__text { font-family: var(--font-serif); font-size: 28px; letter-spacing: -0.5px; line-height: 1; color: var(--color-brand-navy); }
.logo__text b { font-weight: 700; }
.logo__text span { font-weight: 400; opacity: .9; }
.logo--light .logo__text { color: #fff; }
.logo--light .logo__text span { opacity: .85; }

.logo__img {
    display: block;
    height: 75px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    transition: filter 0.2s ease, transform 0.2s ease;
}
.logo--vertical .logo__img {
    height: 75px;
}
.logo--light .logo__img {
    filter: brightness(0) invert(1);
}

/* ---------- App shell: sidebar fijo + header + contenido (Dashboard+) ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 280px;
    background: var(--color-brand-navy);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    z-index: 50;
    border-right: 1px solid rgba(255,255,255,0.05);
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), padding 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar__brand { padding: 0 24px; margin-bottom: 28px; display: flex; flex-direction: column; gap: 4px; }
.sidebar__brand-header { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.sidebar__brand .logo__icon { height: 32px; width: 32px; }
.sidebar__brand .logo__text { font-size: 20px; }
.sidebar__brand .logo__img { height: 55px; }
.sidebar__tagline { font-size: 10px; color: rgba(255,255,255,0.55); font-weight: 800; text-transform: uppercase; letter-spacing: 1.5px; }

.sidebar__toggle {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.7);
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.sidebar__toggle:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}
.sidebar__toggle-icon {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar__user {
    padding: 0 24px 20px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}
.sidebar__avatar {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: var(--color-primary-active-bg);
    color: var(--color-primary-active-on);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
}
.sidebar__user-name { font-size: 13px; font-weight: 700; color: #fff; line-height: 1.3; }
.sidebar__user-role { font-size: 11px; color: rgba(255,255,255,0.55); font-weight: 600; }

.sidebar__nav { flex: 1; overflow-y: auto; padding: 0 12px; display: flex; flex-direction: column; gap: 4px; }
.sidebar__section-label {
    padding: 16px 12px 6px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.45);
}
.sidebar__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 12px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    border-left: 3px solid transparent;
    position: relative;
    transition: background 0.15s ease, color 0.15s ease;
}
a.sidebar__link:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar__link.is-active {
    background: var(--color-primary-active-bg);
    color: var(--color-primary-active-on);
    font-weight: 800;
    border-left: 3px solid #fff;
}
.sidebar__link.is-cta { background: rgba(255,255,255,0.06); font-weight: 700; color: #fff; }
.sidebar__link.is-cta:hover { background: rgba(255,255,255,0.12); }
.sidebar__link.is-cta--propuesta { border-left: 3px solid var(--color-brand-cyan); }
.sidebar__link.is-cta--produccion { border-left: 3px solid var(--color-brand-red, #e33d45); }
.sidebar__link.is-cta.is-active {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    font-weight: 800;
}
.sidebar__link.is-cta--propuesta.is-active {
    border-left: 3px solid var(--color-brand-cyan) !important;
    box-shadow: inset 4px 0 12px -4px rgba(0, 178, 227, 0.35);
}
.sidebar__link.is-cta--produccion.is-active {
    border-left: 3px solid var(--color-brand-red, #e33d45) !important;
    box-shadow: inset 4px 0 12px -4px rgba(227, 61, 69, 0.35);
}
.sidebar__link.is-disabled { color: rgba(255,255,255,0.3); cursor: default; }
.sidebar__icon { width: 18px; height: 18px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.sidebar__link svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar__badge {
    margin-left: auto;
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 999px;
}
.sidebar__badge.is-soon { background: transparent; border: 1px solid rgba(255,255,255,0.2); color: rgba(255,255,255,0.45); text-transform: uppercase; letter-spacing: .5px; font-size: 9px; }
.sidebar__badge.is-count { background: rgba(243, 139, 32, 0.2); color: var(--color-brand-orange); }
/* §42 (docs/MIGRATION_PLAN.md): ícono de alerta en vez de un número — "Tipo de Cambio" no
   cuenta tickets/solicitudes, solo indica "hay algo pendiente este mes" (ver banner de
   `Currencies::index()`). El `svg` de adentro hereda el tamaño 18px de `.sidebar__link
   svg` por defecto — se achica acá para que quepa como badge, no como ícono principal. */
.sidebar__badge.is-alert {
    background: rgba(243, 139, 32, 0.2);
    color: var(--color-brand-orange);
    padding: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.sidebar__badge.is-alert svg { width: 12px; height: 12px; }

.sidebar__footer { margin-top: auto; padding: 16px 12px 0; border-top: 1px solid rgba(255,255,255,0.1); display: flex; flex-direction: column; gap: 2px; }

.app-content {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 40;
    height: 64px;
    background: var(--color-surface-container-lowest);
    border-bottom: 1px solid var(--color-outline-variant);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.app-header h1 { font-size: 18px; font-weight: 800; color: var(--color-brand-navy); letter-spacing: -0.2px; }
.sidebar-header-toggle {
    background: transparent;
    border: none;
    color: var(--color-on-surface-variant);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: all 0.15s ease;
}
.sidebar-header-toggle:hover {
    background: var(--color-surface-container);
    color: var(--color-brand-navy);
}

.app-header__user { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--color-on-surface-variant); }
.app-header__user .btn { width: auto; height: 36px; }
.app-header__user strong { color: var(--color-brand-navy); }
.app-header__user .role-badge {
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.app-header__user a { color: var(--color-on-surface-variant); text-decoration: none; font-weight: 700; }
.app-header__user a:hover { color: var(--color-brand-red); }

.app-main { max-width: 1100px; margin: 0 auto; padding: 40px 24px; width: 100%; }
.app-main--wide { max-width: 1440px; }

/* ---------- Estado Colapsado del Sidebar ---------- */
html.sidebar-collapsed .sidebar {
    width: 72px;
    padding: 20px 0;
}
html.sidebar-collapsed .sidebar__brand {
    padding: 0 12px;
    margin-bottom: 18px;
    align-items: center;
}
html.sidebar-collapsed .sidebar__brand-header {
    flex-direction: column;
    gap: 12px;
    align-items: center;
}
html.sidebar-collapsed .sidebar .logo,
html.sidebar-collapsed .sidebar__tagline {
    display: none;
}
html.sidebar-collapsed .sidebar__toggle-icon {
    transform: rotate(180deg);
}
html.sidebar-collapsed .sidebar__user {
    padding: 0 12px 14px;
    justify-content: center;
    margin-bottom: 12px;
}
html.sidebar-collapsed .sidebar__user > div:not(.sidebar__avatar) {
    display: none;
}
html.sidebar-collapsed .sidebar__section-label {
    display: none;
}
html.sidebar-collapsed .sidebar__nav {
    padding: 0 10px;
    gap: 6px;
}
html.sidebar-collapsed .sidebar__link {
    padding: 11px 0;
    justify-content: center;
    border-left: none;
    border-radius: 10px;
    position: relative;
}
html.sidebar-collapsed .sidebar__link span:not(.sidebar__icon):not(.sidebar__badge) {
    display: none;
}
html.sidebar-collapsed .sidebar__link .sidebar__badge {
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 8px;
    padding: 1px 4px;
    min-width: 14px;
    height: 14px;
    line-height: 12px;
}
html.sidebar-collapsed .sidebar__footer {
    padding: 12px 10px 0;
}
html.sidebar-collapsed .sidebar__footer .version-footer {
    display: none;
}
html.sidebar-collapsed .app-content {
    margin-left: 72px;
}

/* Tooltips flotantes cuando el sidebar está colapsado */
html.sidebar-collapsed .sidebar__link[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: #0f172a;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    pointer-events: none;
    z-index: 100;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

@media (max-width: 900px) {
    .sidebar { display: none; }
    .app-content { margin-left: 0; }
    html.sidebar-collapsed .app-content { margin-left: 0; }
}

/* ---------- Fase 4: Solicitud de Propuesta (listado / alta / detalle) ---------- */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.page-header h1 {
    font-family: var(--font-serif);
    color: var(--color-brand-navy);
    font-size: 26px;
    margin: 0 0 4px;
}
.page-header p { color: var(--color-on-surface-variant); font-size: 13px; margin: 0; }
.page-header__actions { display: flex; gap: 12px; }

.btn-inline { width: auto; height: 44px; padding: 0 20px; text-decoration: none; }
.btn-secondary {
    background: var(--color-surface-container-lowest);
    color: var(--color-secondary);
    border: 1px solid var(--color-outline-variant);
}
.btn-secondary:hover { background: var(--color-surface-container-low); }
/* Variantes por `kind` (§40) — "+ On Air/Digital/Activación" en `RfpRequests/view.php`
   ("Elementos de Producción" es exclusivo de Producción, pero se define también
   `--propuesta` por si algún botón `.btn-secondary` de un contexto de Propuesta quiere el
   mismo tratamiento más adelante). */
.btn-secondary--propuesta { color: var(--color-brand-cyan); }
.btn-secondary--produccion { color: var(--color-brand-magenta); }
.btn-danger { background: var(--color-brand-red); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--color-outline-variant); color: var(--color-on-surface); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; }

.card {
    background: var(--color-surface-container-lowest);
    border: 1px solid var(--color-outline-variant);
    border-radius: 20px;
    padding: 28px;
    margin-bottom: 24px;
}
.card h2 {
    font-family: var(--font-serif);
    color: var(--color-brand-navy);
    font-size: 18px;
    margin: 0 0 20px;
}
.card h2 small { display: block; font-family: var(--font-sans); font-weight: 500; font-size: 12px; color: var(--color-on-surface-variant); margin-top: 4px; text-transform: none; letter-spacing: normal; }

/* Filtro rápido del listado */
.filter-bar { display: flex; align-items: end; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-bar .form-group { margin-bottom: 0; min-width: 220px; }
.filter-bar .form-input { height: 44px; }

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
    text-align: left;
    padding: 10px 14px;
    color: var(--color-on-surface-variant);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom: 2px solid var(--color-outline-variant);
}
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--color-outline-variant); vertical-align: middle; }
.data-table tr:hover td { background: var(--color-surface-container-low); }
.data-table a { text-decoration: none; font-weight: 700; }
.empty-state { text-align: center; padding: 48px 24px; color: var(--color-on-surface-variant); }

.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 20px; list-style: none; padding: 0; font-size: 13px; }
.pagination a, .pagination span { padding: 6px 12px; border-radius: 8px; color: var(--color-secondary); text-decoration: none; }
.pagination .current span { background: var(--color-secondary); color: #fff; font-weight: 700; }
.pagination .disabled { color: var(--color-outline); }

/* Badge de estado — color según data-status (ver docs/PROJECT_CONTEXT.md §2.1) */
.badge-status {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    background: var(--color-surface-variant);
    color: var(--color-on-surface-variant);
    white-space: nowrap;
}
.badge-status[data-status="Borrador"] { background: var(--color-surface-variant); color: #43474d; }
.badge-status[data-status="Recibida"] { background: var(--color-secondary-fixed); color: var(--color-on-secondary-container); }
.badge-status[data-status="En Proceso"] { background: rgba(0, 178, 227, 0.15); color: #007599; }
.badge-status[data-status="Entregada"] { background: rgba(0, 171, 102, 0.15); color: #007a45; }
.badge-status[data-status="Esperando Feedback"] { background: rgba(243, 139, 32, 0.15); color: #a25a00; }
.badge-status[data-status="En Ajustes"] { background: rgba(227, 61, 69, 0.12); color: var(--color-brand-red); }
.badge-status[data-status="Aprobada"] { background: rgba(0, 171, 102, 0.85); color: #fff; }
.badge-status[data-status="Archivada"] { background: var(--color-outline); color: #fff; }

.badge-sla { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; }
.badge-sla[data-sla="Atrasado"] { color: var(--color-brand-red); }
.badge-sla[data-sla="Vence esta semana"] { color: var(--color-brand-orange); }
.badge-sla[data-sla="En tiempo"] { color: var(--color-brand-green); }

/* Formulario grande de alta (Solicitud de Propuesta) */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 24px; }
.form-grid--3 { grid-template-columns: repeat(3, 1fr); }
.form-grid .form-group--full { grid-column: 1 / -1; }
@media (max-width: 720px) { .form-grid, .form-grid--3 { grid-template-columns: 1fr; } }

textarea.form-input { height: auto; padding: 12px 16px; line-height: 1.5; resize: vertical; }
.form-hint { font-size: 11px; color: var(--color-on-surface-variant); margin-top: -4px; }

.check-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 720px) { .check-grid { grid-template-columns: 1fr 1fr; } }
.check-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--color-surface-container-low);
    border: 1px solid var(--color-outline-variant);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-brand-navy);
    cursor: pointer;
}
.check-pill input { margin: 0; }

.toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--color-surface-container-low);
    border-radius: 10px;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 600;
}
.toggle-row input { margin: 0; }

.repeater-row { display: flex; gap: 8px; margin-bottom: 8px; }
.repeater-row .form-input { flex: 1; }
.repeater-remove {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border: 1px solid var(--color-outline-variant);
    background: var(--color-surface-container-lowest);
    border-radius: 10px;
    cursor: pointer;
    color: var(--color-brand-red);
    font-weight: 700;
}
.repeater-add { margin-top: 4px; }

.form-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 8px; }
.form-actions .btn { width: auto; padding: 0 28px; }

/* ---------- Fase 23: footer fijo de acciones en formularios largos (backlog ítem 1, ver
   docs/MIGRATION_PLAN.md §23) — Cancelar/Guardar quedan siempre visibles sin scrollear
   hasta el final. `.form-footer-spacer` reserva en el flujo normal el mismo alto que la
   barra fija, para que ningún campo quede tapado detrás. `.form-footer-bar` es la franja
   full-bleed (fondo/borde/sombra); adentro, `.form-actions` se reutiliza tal cual (mismo
   flex/gap/justify-content de siempre) pero centrado a `max-width: 1280px` para que los
   botones queden alineados con el borde derecho de las tarjetas del formulario en vez de
   pegados al borde de la ventana. ---------- */
.form-footer-spacer { height: 96px; }
.form-footer-bar {
    position: fixed;
    left: 280px;
    right: 0;
    bottom: 0;
    z-index: 45;
    padding: 18px 32px;
    background: var(--color-surface-container-lowest);
    border-top: 1px solid var(--color-outline-variant);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
}
.form-footer-bar .form-actions { max-width: 1280px; margin: 0 auto; }
@media (max-width: 900px) {
    .form-footer-bar { left: 0; padding: 14px 20px; }
}

/* Vista de detalle */
.detail-header { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.detail-header h1 { font-family: var(--font-serif); color: var(--color-brand-navy); font-size: 24px; margin: 0 0 6px; }
.detail-header .meta { color: var(--color-on-surface-variant); font-size: 13px; }
.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }

.summary-list { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; font-size: 13px; }
.summary-list dt { color: var(--color-on-surface-variant); font-size: 11px; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 2px; }
.summary-list dd { margin: 0; color: var(--color-on-surface); font-weight: 600; }
.summary-list .form-group--full { grid-column: 1 / -1; }

.brief-block { margin-bottom: 16px; }
.brief-block h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--color-on-secondary-container); margin: 0 0 6px; }
.brief-block p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--color-on-surface); white-space: pre-line; }

.action-panel .btn { margin-bottom: 12px; }
.sla-box { padding: 16px; border-radius: 14px; background: var(--color-surface-container-low); margin-bottom: 20px; }
.sla-box .badge-sla { font-size: 15px; display: block; margin-bottom: 4px; }
.sla-box small { color: var(--color-on-surface-variant); }

.history-list { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.history-list li { padding: 10px 0; border-bottom: 1px solid var(--color-outline-variant); }
.history-list li:last-child { border-bottom: none; }
.history-list .history-transition { font-weight: 700; color: var(--color-brand-navy); }
.history-list .history-meta { color: var(--color-on-surface-variant); font-size: 11px; margin-top: 2px; }

.inline-form { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.inline-form .form-input { height: 44px; }
.inline-form .btn { width: auto; height: 44px; padding: 0 16px; }

/* ---------- Fase 5: Solicitud de Producción (elementos, badges de tipo/categoría) ---------- */
.kind-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-right: 6px;
}
.kind-badge[data-kind="propuesta"] { background: var(--color-secondary-fixed); color: var(--color-on-secondary-container); }
.kind-badge[data-kind="produccion"] { background: rgba(216, 27, 96, 0.12); color: var(--color-brand-magenta); }

/* ---------- Fase 17: RFPs de prueba (panel "Datos de Prueba", badge TEST) ---------- */
.test-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    background: rgba(227, 61, 69, 0.12);
    color: var(--color-brand-red);
    border: 1px solid rgba(227, 61, 69, 0.35);
    vertical-align: middle;
    margin-left: 4px;
}

.test-data-panel { border: 1px dashed var(--color-brand-orange); background: rgba(243, 139, 32, 0.05); }
.test-data-panel__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.test-data-panel__empty { font-size: 13px; color: var(--color-on-surface-variant); }

.completion-widget { text-align: center; }
.completion-widget .completion-value { font-size: 32px; font-weight: 800; color: var(--color-brand-navy); line-height: 1; }
.completion-widget small { color: var(--color-on-surface-variant); display: block; margin-top: 6px; }
.completion-bar { height: 8px; border-radius: 999px; background: var(--color-surface-variant); overflow: hidden; margin: 12px 0; }
.completion-bar span { display: block; height: 100%; background: var(--color-brand-magenta); }

.badge-category {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.badge-category[data-category="broadcast"] { background: rgba(0, 96, 171, 0.12); color: var(--color-brand-blue); }
.badge-category[data-category="digital"] { background: rgba(0, 178, 227, 0.15); color: #007599; }
.badge-category[data-category="activacion"] { background: rgba(243, 139, 32, 0.15); color: #a25a00; }

.element-row-title { font-weight: 700; color: var(--color-brand-navy); }
.element-row-subtitle { font-size: 12px; color: var(--color-on-surface-variant); }
.row-actions { display: flex; gap: 6px; }
.row-actions a, .row-actions button { text-decoration: none; }

.section-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

.linked-note {
    background: var(--color-surface-container-low);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 12px;
    color: var(--color-on-surface-variant);
    margin-bottom: 16px;
}
.linked-note a { font-weight: 700; }

/* ---------- Utilidades chicas (Fase 6) ---------- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-success { color: var(--color-brand-green); font-weight: 800; }
.text-danger { color: var(--color-brand-red); }
.text-muted { color: var(--color-on-surface-variant); opacity: .5; }
.font-bold { font-weight: 700; }

/* ---------- Fase 6: Dashboard operativo ---------- */
.page-header__actions { display: flex; align-items: center; gap: 10px; }
.page-header__actions select.form-input { height: 44px; min-width: 180px; }
.period-range { font-size: 11px; color: var(--color-on-surface-variant); font-weight: 600; white-space: nowrap; }

.card-header-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.card-header-row h3, .card > h3 { font-family: var(--font-serif); color: var(--color-brand-navy); font-size: 16px; margin: 0 0 2px; }
.card-subtitle { color: var(--color-on-surface-variant); font-size: 12px; font-weight: 500; margin: 0 0 18px; }

.dashboard-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 24px; align-items: stretch; }
.dashboard-grid > .card { margin-bottom: 0; }
.dashboard-grid__span2 { grid-column: span 2; }
.dashboard-grid__span3 { grid-column: span 3; }
@media (max-width: 960px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .dashboard-grid__span2, .dashboard-grid__span3 { grid-column: span 1; }
}

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 24px; }
@media (max-width: 960px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
/* Variantes con menos columnas (ej. Calendario, Fase 8: 3 KPIs en modo SLA, 2 en modo
   Aprobados/Entregados) — clases propias en vez de `style=""` inline para no perder el
   colapso a 1 columna en mobile. */
.kpi-grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.kpi-grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 720px) { .kpi-grid--cols-3, .kpi-grid--cols-2 { grid-template-columns: 1fr; } }
.kpi-card {
    background: var(--color-surface-container-lowest);
    border: 1px solid var(--color-outline-variant);
    border-radius: 20px;
    padding: 22px 24px;
}
.kpi-card__eyebrow { display: block; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--color-on-surface-variant); margin-bottom: 4px; }
.kpi-card__title { font-family: var(--font-serif); font-size: 14px; color: var(--color-brand-navy); margin: 0; }
.kpi-card__value-row { display: flex; align-items: baseline; gap: 8px; margin-top: 16px; }
.kpi-card__value { font-size: 34px; font-weight: 800; line-height: 1; }
.kpi-card__value--blue { color: var(--color-brand-blue); }
.kpi-card__value--purple { color: var(--color-brand-purple); }
.kpi-card__value--magenta { color: var(--color-brand-magenta); }
.kpi-card__value--orange { color: var(--color-brand-orange); }
.kpi-card__caption { font-size: 12px; font-weight: 600; color: var(--color-on-surface-variant); }

.pending-assignment { border: 2px solid rgba(0, 178, 227, 0.3); padding: 0; overflow: hidden; }
.pending-assignment__header { display: flex; align-items: center; gap: 10px; padding: 18px 24px; background: rgba(0, 178, 227, 0.08); border-bottom: 1px solid var(--color-outline-variant); }
.pending-assignment__header h3 { font-family: var(--font-serif); font-size: 14px; color: var(--color-brand-navy); margin: 0; }
.pending-assignment__count { margin-left: auto; font-size: 11px; font-weight: 800; color: var(--color-brand-cyan); background: #fff; padding: 2px 10px; border-radius: 999px; }
.pending-assignment__list { list-style: none; margin: 0; padding: 0; }
.pending-assignment__list li { border-bottom: 1px solid var(--color-outline-variant); }
.pending-assignment__list li:last-child { border-bottom: none; }
.pending-assignment__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px; text-decoration: none; }
.pending-assignment__row:hover { background: var(--color-surface-container-low); }
.pending-assignment__info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pending-assignment__info strong { font-size: 13px; color: var(--color-brand-navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pending-assignment__info small { font-size: 11px; color: var(--color-on-surface-variant); }
.pending-assignment__cta { flex-shrink: 0; font-size: 12px; font-weight: 800; color: var(--color-brand-cyan); }

.pipeline-lane { margin-bottom: 22px; }
.pipeline-lane:last-child { margin-bottom: 0; }
.pipeline-lane__label { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--color-on-surface-variant); margin-bottom: 10px; }
.pipeline-lane__total { font-weight: 700; opacity: .6; text-transform: none; letter-spacing: 0; }
.pipeline-dot { width: 8px; height: 8px; border-radius: 999px; display: inline-block; }
.pipeline-dot--propuesta { background: var(--color-brand-cyan); }
.pipeline-dot--produccion { background: var(--color-brand-magenta); }

.pipeline-chips { display: flex; align-items: stretch; gap: 6px; flex-wrap: wrap; }
.pipeline-chip {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 84px;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid transparent;
    text-decoration: none;
    /* Fase 22: son <button> (antes <a>), abren el RFP Drawer en vez de navegar — reset de
       estilos por defecto del navegador, ver docs/MIGRATION_PLAN.md §22. */
    font: inherit;
    text-align: left;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}
.pipeline-chip:disabled { cursor: not-allowed; }
.pipeline-chip--propuesta { background: rgba(0, 178, 227, 0.1); border-color: rgba(0, 178, 227, 0.2); }
.pipeline-chip--propuesta:hover { filter: brightness(0.95); transform: translateY(-1px); }
.pipeline-chip--produccion { background: rgba(216, 27, 96, 0.1); border-color: rgba(216, 27, 96, 0.2); }
.pipeline-chip--produccion:hover { filter: brightness(0.95); transform: translateY(-1px); }
.pipeline-chip--archivada { background: #fef2f2; border-color: #fecaca; }
.pipeline-chip--archivada:hover { filter: brightness(0.97); transform: translateY(-1px); }
.pipeline-chip--empty { background: var(--color-surface-container-low); opacity: .55; }
.pipeline-chip__count { font-size: 17px; font-weight: 800; line-height: 1; color: var(--color-brand-navy); }
.pipeline-chip--empty .pipeline-chip__count { color: var(--color-on-surface-variant); }
.pipeline-chip--archivada .pipeline-chip__count { color: var(--color-brand-red); }
.pipeline-chip__label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: var(--color-on-surface-variant); line-height: 1.2; }
.pipeline-arrow { align-self: center; color: var(--color-outline-variant); font-size: 13px; }
.pipeline-dashed { align-self: center; width: 14px; border-top: 2px dashed #fca5a5; margin: 0 2px; }

.pipeline-connector {
    display: inline-block;
    margin-top: 8px;
    font-size: 10px;
    font-weight: 700;
    color: var(--color-on-surface-variant);
    background: var(--color-surface-container-low);
    border: 1px solid var(--color-outline-variant);
    border-radius: 999px;
    padding: 4px 12px;
    text-decoration: none;
    /* Fase 22: <button>, abre el RFP Drawer (mode=linked) — ver docs/MIGRATION_PLAN.md §22. */
    font-family: inherit;
    cursor: pointer;
}
.pipeline-connector:hover:not(:disabled) { background: var(--color-surface-container); transform: translateY(-1px); }
.pipeline-connector:disabled { cursor: default; }
.pipeline-connector:hover { background: var(--color-surface-container-high); }
.pipeline-connector--empty { opacity: .6; cursor: default; }

.donut-chart__ring { position: relative; width: 160px; height: 160px; margin: 8px auto 0; }
.donut-chart__svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-chart__center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.donut-chart__center-value { font-size: 22px; font-weight: 800; color: var(--color-brand-navy); line-height: 1; margin: 0; }
.donut-chart__center-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--color-on-surface-variant); margin: 4px 0 0; }
.donut-chart__legend { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--color-outline-variant); display: flex; flex-direction: column; gap: 10px; }
.donut-chart__legend-row { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; }
.donut-chart__legend-label { color: var(--color-on-surface-variant); flex: 1; }
.donut-chart__legend-value { color: var(--color-brand-navy); font-weight: 700; }
.donut-chart__dot { width: 10px; height: 10px; border-radius: 999px; flex-shrink: 0; }

.sla-buckets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 960px) { .sla-buckets { grid-template-columns: 1fr; } }
.sla-bucket {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--color-surface-container-low);
    border: 1px solid var(--color-surface-container);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    width: 100%;
    /* Fase 22: <button> (antes <div>), abre el RFP Drawer (mode=sla) — reset de estilos
       por defecto del navegador, ver docs/MIGRATION_PLAN.md §22. */
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: background-color .15s;
}
.sla-bucket:hover { background: var(--color-surface-bright); }
.sla-bucket__dot { width: 12px; height: 12px; border-radius: 999px; flex-shrink: 0; }
.sla-bucket__count { margin-left: auto; font-weight: 800; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: rgba(0,0,0,0.04); }
.sla-compliance { background: var(--color-brand-navy); color: #fff; border-radius: 12px; padding: 14px; text-align: center; display: flex; flex-direction: column; justify-content: center; }
.sla-compliance__label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; opacity: .8; margin: 0 0 4px; }
.sla-compliance__value { font-size: 18px; font-weight: 800; color: var(--color-brand-cyan); margin: 0; }

.market-load { display: flex; flex-direction: column; gap: 16px; }
.market-load__top { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--color-on-surface-variant); margin-bottom: 6px; }
.market-load__top span:last-child { color: var(--color-brand-navy); }
.market-load__track { height: 16px; background: var(--color-surface-container-low); border: 1px solid var(--color-outline-variant); border-radius: 8px; overflow: hidden; }
.market-load__fill { height: 100%; background: var(--color-secondary); border-radius: 8px; }

.conversion-legend { display: flex; gap: 14px; align-items: center; font-size: 10px; font-weight: 700; color: var(--color-on-surface-variant); }
.conversion-legend .dot { width: 9px; height: 9px; border-radius: 999px; display: inline-block; margin-right: 4px; }
.conversion-funnel { display: flex; align-items: end; gap: 24px; height: 160px; padding: 0 8px; margin-top: 12px; }
.conversion-funnel__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.conversion-funnel__bar { width: 100%; border-radius: 12px 12px 0 0; display: flex; align-items: center; justify-content: center; }
.conversion-funnel__bar span { color: #fff; font-weight: 800; font-size: 14px; }
.conversion-funnel__bar--blue { background: var(--color-secondary); }
.conversion-funnel__bar--green { background: var(--color-brand-green); }
.conversion-funnel__label { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--color-on-surface-variant); }
.conversion-ratio { margin-top: 16px; padding: 14px; background: var(--color-surface-container-low); border: 1px dashed var(--color-outline-variant); border-radius: 12px; text-align: center; }
.conversion-ratio__label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--color-on-surface-variant); margin: 0 0 4px; }
.conversion-ratio__value { font-size: 16px; font-weight: 800; color: var(--color-secondary); margin: 0; }

.three-d-pie { position: relative; width: 100%; max-width: 340px; margin: 0 auto; aspect-ratio: 400 / 365; }
.three-d-pie__svg { width: 100%; height: 100%; overflow: visible; }
.three-d-pie__slice { transition: transform .3s; }
.three-d-pie__slice:hover { transform: translateY(-2px); }
.three-d-pie__badge {
    position: absolute;
    background: #fff;
    border-radius: 12px;
    border-width: 2px;
    border-style: solid;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    padding: 5px 10px;
    min-width: 82px;
    text-align: center;
    transition: transform .2s;
}
.three-d-pie__badge:hover { transform: scale(1.05); }
.three-d-pie__badge-label { display: block; font-size: 7px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; white-space: nowrap; }
.three-d-pie__badge-value { display: block; font-size: 13px; font-weight: 800; color: #1e293b; margin-top: 2px; }
.three-d-pie-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--color-surface-container); }
.three-d-pie-legend span { font-size: 10px; font-weight: 700; color: var(--color-on-surface-variant); text-transform: uppercase; letter-spacing: .3px; }
.three-d-pie-legend .dot { width: 9px; height: 9px; border-radius: 999px; display: inline-block; margin-right: 5px; vertical-align: middle; }

.stage-badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.stage-badge[data-stage-color="blue"] { background: rgba(0, 96, 171, 0.1); color: var(--color-brand-blue); }
.stage-badge[data-stage-color="purple"] { background: rgba(106, 27, 154, 0.1); color: var(--color-brand-purple); }
.stage-badge[data-stage-color="orange"] { background: rgba(243, 139, 32, 0.1); color: var(--color-brand-orange); }
.stage-badge[data-stage-color="green"] { background: rgba(0, 171, 102, 0.1); color: var(--color-brand-green); }

.sla-dot { display: inline-block; width: 8px; height: 8px; border-radius: 999px; margin-right: 6px; vertical-align: middle; }
.sla-dot[data-status="En tiempo"] { background: var(--color-brand-green); }
.sla-dot[data-status="Atrasado"] { background: var(--color-brand-red); }
.sla-dot[data-status="Vence esta semana"] { background: var(--color-brand-orange); }

.table-cell-stack { display: flex; flex-direction: column; gap: 2px; }
.table-cell-stack small { color: var(--color-on-surface-variant); font-size: 11px; }

.analytics-tabs__nav { display: flex; gap: 24px; border-bottom: 1px solid var(--color-surface-container); padding-bottom: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.analytics-tabs__btn { background: none; border: none; border-bottom: 2px solid transparent; padding: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--color-on-surface-variant); cursor: pointer; }
.analytics-tabs__btn.is-active { color: var(--color-brand-blue); border-bottom-color: var(--color-brand-blue); }
.analytics-tabs__btn:hover:not(.is-active) { color: var(--color-brand-navy); }

.analytics-tab__header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.analytics-tab__header h3 { font-family: var(--font-serif); font-size: 15px; color: var(--color-brand-navy); margin: 0 0 2px; }
.analytics-tab__header p { font-size: 12px; color: var(--color-on-surface-variant); margin: 0; }
.analytics-tab__header .form-input { height: 40px; min-width: 170px; }
.analytics-tab__grid { display: grid; grid-template-columns: 35% 65%; gap: 28px; }
@media (max-width: 900px) { .analytics-tab__grid { grid-template-columns: 1fr; } }

.bar-list__caption { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--color-on-surface-variant); margin: 0 0 14px; }
.bar-list__row { margin-bottom: 14px; }
.bar-list__row-top { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--color-brand-navy); margin-bottom: 5px; }
.bar-list__track { height: 8px; border-radius: 999px; background: var(--color-surface-container-low); overflow: hidden; }
.bar-list__fill { height: 100%; background: var(--color-brand-blue); border-radius: 999px; }

.data-table--compact th, .data-table--compact td { padding: 10px 12px; font-size: 12px; }
.data-table--compact thead th { border-bottom: 1px solid var(--color-outline-variant); text-transform: uppercase; letter-spacing: .4px; font-size: 10px; }

/* Fase 7 — Gestión de Usuarios (templates/Users/*.php) */
.kpi-card__value--green { color: var(--color-brand-green); }
.kpi-card__value--red { color: var(--color-brand-red); }

.user-cell { display: flex; align-items: center; gap: 12px; }
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    /* --role-color: color del rol (roles.color, §47); se oscurece para que la inicial blanca se lea. */
    background: color-mix(in srgb, var(--role-color, var(--color-secondary)) 85%, #000);
    flex-shrink: 0;
}
.user-cell__name { font-weight: 700; color: var(--color-brand-navy); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.user-cell__email { font-size: 12px; color: var(--color-on-surface-variant); }
.user-cell__date { display: block; border-top:1px solid #ddd; padding-top: 5px; margin-top: 5px; font-size: 11px; color: var(--color-on-surface-variant); }
.user-cell__you {
    background: rgba(0, 23, 45, 0.06);
    color: var(--color-brand-navy);
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 1px 6px;
    border-radius: 6px;
}

.role-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    white-space: nowrap;
    /* --role-color: color del rol (roles.color, §47). Fondo tenue + texto oscurecido para que
       se lea con cualquier color que se elija en el picker. */
    --role-color: var(--color-on-surface-variant);
    background: color-mix(in srgb, var(--role-color) 14%, #fff);
    color: color-mix(in srgb, var(--role-color) 70%, #000);
    border: 1px solid color-mix(in srgb, var(--role-color) 35%, #fff);
}

.tipo-usuario-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    border: 1px solid var(--color-outline-variant);
    color: var(--color-on-surface-variant);
}
.tipo-usuario-badge[data-tipo="NBCU"] { border-color: rgba(0, 96, 171, 0.3); color: var(--color-brand-blue); }
.tipo-usuario-badge[data-tipo="Otro"] { border-color: rgba(243, 139, 32, 0.4); color: #a25a00; }

.status-toggle { border: none; background: none; padding: 0; cursor: pointer; }
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.status-pill__dot { width: 6px; height: 6px; border-radius: 999px; }
.status-pill[data-status="Activo"] { background: rgba(0, 171, 102, 0.1); color: var(--color-brand-green); }
.status-pill[data-status="Activo"] .status-pill__dot { background: var(--color-brand-green); }
.status-pill[data-status="Inactivo"] { background: var(--color-surface-variant); color: var(--color-on-surface-variant); }
.status-pill[data-status="Inactivo"] .status-pill__dot { background: var(--color-outline); }
/* Backlog ítem 4 (docs/MIGRATION_PLAN.md §25): alta pública sin aprobar todavía. */
.status-pill[data-status="Pendiente"] { background: rgba(243, 139, 32, 0.12); color: var(--color-brand-orange); cursor: default; }
.status-pill[data-status="Pendiente"] .status-pill__dot { background: var(--color-brand-orange); }

/* ---------- Holiday notice (Fase 8 — Calendario/Feriados, ver docs/MIGRATION_PLAN.md §14) ---------- */
.holiday-notice {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(106, 27, 154, 0.1);
    color: var(--color-brand-purple);
    font-size: 11px;
    font-weight: 700;
}
.holiday-notice::before { content: "\1F30E"; font-size: 12px; }
.holiday-notice--badge { margin-top: 0; margin-left: 4px; padding: 3px 10px; }

/* ---------- Pantalla de Calendario (Fase 8, ver docs/MIGRATION_PLAN.md §14) ---------- */
.calendar-mode-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 24px; }
@media (max-width: 720px) { .calendar-mode-grid { grid-template-columns: 1fr; } }
.calendar-mode-btn {
    display: block;
    padding: 18px 20px;
    border-radius: 16px;
    border: 2px solid var(--color-outline-variant);
    border-left-width: 5px;
    background: #fff;
    text-align: left;
    text-decoration: none;
    transition: border-color .15s ease;
}
.calendar-mode-btn { border-left-color: var(--color-brand-red); }
.calendar-mode-btn--completed { border-left-color: var(--color-brand-green); }
.calendar-mode-btn:hover { border-color: rgba(0, 23, 45, 0.3); }
.calendar-mode-btn.is-active { background: var(--color-brand-navy); border-color: var(--color-brand-navy); box-shadow: 0 8px 20px rgba(0,23,45,0.15); }
.calendar-mode-btn__title { display: block; font-size: 15px; font-weight: 800; color: var(--color-brand-navy); }
.calendar-mode-btn.is-active .calendar-mode-btn__title { color: #fff; }
.calendar-mode-btn__subtitle { display: block; font-size: 11px; font-weight: 500; color: var(--color-on-surface-variant); margin-top: 2px; }
.calendar-mode-btn.is-active .calendar-mode-btn__subtitle { color: rgba(255,255,255,0.7); }

.calendar-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.calendar-nav__title { font-family: var(--font-serif); font-size: 18px; color: var(--color-brand-navy); margin: 0; }
.calendar-nav__controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.calendar-nav__controls select.form-input { height: 36px; font-size: 12px; font-weight: 700; padding: 0 8px; min-width: auto; }
.calendar-nav__btn {
    padding: 7px 12px;
    border-radius: 8px;
    border: 1px solid var(--color-outline-variant);
    background: #fff;
    font-size: 12px;
    font-weight: 700;
    color: var(--color-on-surface-variant);
    text-decoration: none;
    cursor: pointer;
}
.calendar-nav__btn:hover { background: var(--color-surface-container-low); }

.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--color-outline-variant); border: 1px solid var(--color-outline-variant); border-radius: 12px; overflow: hidden; }
.calendar-weekday { background: var(--color-surface-container-low); text-align: center; padding: 8px 0; font-size: 10px; font-weight: 800; color: var(--color-on-surface-variant); text-transform: uppercase; letter-spacing: 1px; }
.calendar-day { min-height: 92px; background: #fff; padding: 6px; display: flex; flex-direction: column; gap: 3px; }
.calendar-day.is-out-of-month { opacity: .4; }
.calendar-day.has-holiday { background: rgba(106, 27, 154, 0.05); }
.calendar-day__head { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.calendar-day__number { width: 20px; height: 20px; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: var(--color-on-surface-variant); flex-shrink: 0; }
.calendar-day__number.is-today { background: var(--color-secondary); color: #fff; }
.calendar-day__holiday-icon { font-size: 10px; flex-shrink: 0; }
.calendar-day__holiday-label { font-size: 8.5px; font-weight: 700; color: var(--color-brand-purple); line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; margin: 0; }
.calendar-day__entries { flex: 1; display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.calendar-chip { display: flex; align-items: center; gap: 4px; padding: 2px 6px; border-radius: 6px; font-size: 9px; font-weight: 700; text-decoration: none; min-width: 0; }
.calendar-chip__dot { width: 6px; height: 6px; border-radius: 999px; flex-shrink: 0; }
.calendar-chip__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.calendar-chip[data-severity="overdue"] { background: rgba(227, 61, 69, 0.1); color: var(--color-brand-red); }
.calendar-chip[data-severity="overdue"] .calendar-chip__dot { background: var(--color-brand-red); }
.calendar-chip[data-severity="due-soon"] { background: rgba(243, 139, 32, 0.1); color: var(--color-brand-orange); }
.calendar-chip[data-severity="due-soon"] .calendar-chip__dot { background: var(--color-brand-orange); }
.calendar-chip[data-severity="scheduled"] { background: rgba(0, 96, 171, 0.1); color: var(--color-brand-blue); }
.calendar-chip[data-severity="scheduled"] .calendar-chip__dot { background: var(--color-brand-blue); }
.calendar-chip[data-kind="propuesta"] { background: var(--color-secondary-fixed); color: var(--color-on-secondary-container); }
.calendar-chip[data-kind="propuesta"] .calendar-chip__dot { background: var(--color-on-secondary-container); }
.calendar-chip[data-kind="produccion"] { background: rgba(216, 27, 96, 0.12); color: var(--color-brand-magenta); }
.calendar-chip[data-kind="produccion"] .calendar-chip__dot { background: var(--color-brand-magenta); }
.calendar-day__extra { font-size: 9px; font-weight: 700; color: var(--color-on-surface-variant); opacity: .6; padding: 0 2px; margin: 0; }

.calendar-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--color-outline-variant); }
.calendar-legend__item { display: flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 700; color: var(--color-on-surface-variant); }
.calendar-legend__dot { width: 10px; height: 10px; border-radius: 999px; flex-shrink: 0; }
.calendar-legend__note { font-size: 10px; font-weight: 500; color: var(--color-on-surface-variant); opacity: .6; margin-left: auto; }

/* ---------- Pantalla de Tipos de Pieza (porta PieceTypesView.tsx, ver docs/MIGRATION_PLAN.md §15) ---------- */
.piece-types__toolbar { display: flex; justify-content: flex-end; margin-bottom: 16px; }
.piece-types-table-wrap { overflow-x: auto; border: 1px solid var(--color-outline-variant); border-radius: 16px; }
.piece-types-table { width: 100%; min-width: 1100px; border-collapse: collapse; text-align: left; }
.piece-types-table th {
    padding: 12px; color: #fff; font-size: 10px; font-weight: 800; text-transform: uppercase;
    letter-spacing: .5px; white-space: nowrap;
}
.piece-types-table__head--navy { background: var(--color-brand-navy); }
.piece-types-table__head--fuchsia { background: #c026d3; }
.piece-types-table__head--orange { background: #ea580c; }
.piece-types-table__head--indigo { background: #4f46e5; }
.piece-types-table__col-tipo { width: 220px; }
.piece-types-table td { padding: 12px; font-size: 11px; line-height: 1.5; vertical-align: top; border-top: 1px solid rgba(0, 0, 0, 0.05); }
.piece-row { position: relative; }
.piece-row td:first-child { position: relative; }
.piece-row td:first-child::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; }
.piece-row__tipo { font-size: 12px; font-weight: 800; text-transform: uppercase; margin: 0; }
.piece-row__otros { font-size: 10px; font-style: italic; color: var(--color-on-surface-variant); margin: 4px 0 0; line-height: 1.4; }

.piece-row--0 { background: #fdf2f8; } .piece-row--0 td:first-child::before { background: #ec4899; } .piece-row--0 .piece-row__tipo { color: #be185d; }
.piece-row--1 { background: #fef2f2; } .piece-row--1 td:first-child::before { background: #ef4444; } .piece-row--1 .piece-row__tipo { color: #b91c1c; }
.piece-row--2 { background: #ecfeff; } .piece-row--2 td:first-child::before { background: #06b6d4; } .piece-row--2 .piece-row__tipo { color: #0e7490; }
.piece-row--3 { background: #eef2ff; } .piece-row--3 td:first-child::before { background: #6366f1; } .piece-row--3 .piece-row__tipo { color: #4338ca; }
.piece-row--4 { background: #faf5ff; } .piece-row--4 td:first-child::before { background: #a855f7; } .piece-row--4 .piece-row__tipo { color: #7e22ce; }
.piece-row--5 { background: #ecfdf5; } .piece-row--5 td:first-child::before { background: #10b981; } .piece-row--5 .piece-row__tipo { color: #047857; }
.piece-row--6 { background: #fff7ed; } .piece-row--6 td:first-child::before { background: #f97316; } .piece-row--6 .piece-row__tipo { color: #c2410c; }
.piece-row--7 { background: #f1f5f9; } .piece-row--7 td:first-child::before { background: #334155; } .piece-row--7 .piece-row__tipo { color: #334155; }

/* ---------- Fase 18: rediseño visual del detalle de Solicitud (RFPDetailView.tsx) ---------- */
/* Reemplaza el layout "2 columnas / <dl> plano" original por el lenguaje visual real del
   prototipo: header con badges, grilla "bento" de resumen, stepper de workflow, tarjetas
   con acento de color por campo. Ver docs/MIGRATION_PLAN.md §18. Las variables --accent-*
   se resuelven inline por `kind` (cyan = Propuesta, magenta = Producción, mismo criterio
   que RFP_KIND_COLORS del prototipo) para no duplicar CSS por kind. */
.rfp-detail { display: flex; flex-direction: column; gap: 24px; max-width: 1120px; margin: 0 auto; }

.icon { width: 18px; height: 18px; display: block; }

.rfp-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(196, 198, 205, 0.3);
}
.rfp-detail-header__title-row { display: flex; align-items: center; gap: 10px; }
.rfp-detail-back {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 10px; border: none; cursor: pointer;
    background: transparent; color: var(--color-on-surface-variant); text-decoration: none;
    transition: background-color .15s, color .15s;
}
.rfp-detail-back:hover { background: var(--color-surface-container-low); color: var(--color-brand-navy); }
.rfp-detail-back .icon { width: 20px; height: 20px; }
.rfp-detail-title { font-family: var(--font-sans); font-size: 20px; font-weight: 800; color: var(--color-brand-navy); margin: 0; }
.rfp-detail-title span { color: var(--color-on-surface-variant); font-weight: 600; }
.rfp-detail-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 6px 0 0 42px; }
.rfp-detail-created { color: var(--color-on-surface-variant); font-size: 12px; font-weight: 700; }
.rfp-detail-help {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 999px; border: none; cursor: default;
    background: transparent; color: var(--color-on-surface-variant);
}

.pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px; border-radius: 999px;
    font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px;
    border: 1px solid transparent; box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.pill__dot { width: 6px; height: 6px; border-radius: 999px; flex-shrink: 0; }
.pill--cyan { background: rgba(0, 178, 227, 0.1); color: #00819e; border-color: rgba(0, 178, 227, 0.25); }
.pill--cyan .pill__dot { background: var(--color-brand-cyan); }
.pill--magenta { background: rgba(216, 27, 96, 0.1); color: var(--color-brand-magenta); border-color: rgba(216, 27, 96, 0.2); }
.pill--magenta .pill__dot { background: var(--color-brand-magenta); }
.pill--test { background: rgba(227, 61, 69, 0.1); color: var(--color-brand-red); border-color: rgba(227, 61, 69, 0.3); }

.bento-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 900px) { .bento-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .bento-grid { grid-template-columns: 1fr; } }

.bento-card {
    display: flex; align-items: center; gap: 14px;
    background: #fff; padding: 18px; border-radius: 16px;
    border: 1px solid var(--color-surface-container);
    box-shadow: 0px 4px 20px rgba(0,0,0,0.05);
}
.bento-card--accent-propuesta { border-left: 4px solid var(--color-brand-cyan); }
.bento-card--accent-produccion { border-left: 4px solid var(--color-brand-magenta); }
.bento-card__icon { flex-shrink: 0; background: var(--color-surface-container-low); padding: 12px; border-radius: 12px; }
.bento-card__icon .icon { color: var(--color-secondary); width: 19px; height: 19px; }
.bento-card--accent-propuesta .bento-card__icon { background: rgba(0, 178, 227, 0.1); }
.bento-card--accent-propuesta .bento-card__icon .icon { color: var(--color-brand-cyan); }
.bento-card--accent-produccion .bento-card__icon { background: rgba(216, 27, 96, 0.1); }
.bento-card--accent-produccion .bento-card__icon .icon { color: var(--color-brand-magenta); }
.bento-card__body { min-width: 0; }
.bento-card__body + .bento-card__body { margin-top: 6px; }
.bento-card__label { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--color-on-surface-variant); margin: 0; }
.bento-card__value { font-size: 15px; font-weight: 800; color: var(--color-brand-navy); margin: 2px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bento-card__value--sm { font-size: 13px; }

.workflow-row { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; align-items: stretch; }
@media (max-width: 900px) { .workflow-row { grid-template-columns: 1fr; } }

.stepper-card { background: #fff; border-radius: 16px; border: 1px solid var(--color-surface-container); box-shadow: 0px 4px 20px rgba(0,0,0,0.05); padding: 18px; }
.stepper-card__title { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--color-brand-navy); margin: 0 0 16px; }

.stepper-track-wrap { position: relative; display: flex; justify-content: space-between; align-items: center; padding: 0 4px; margin-bottom: 18px; }
.stepper-track { position: absolute; left: 0; right: 0; top: 12px; height: 3px; background: var(--color-surface-container-highest); border-radius: 999px; z-index: 0; }
.stepper-track__fill { height: 100%; border-radius: 999px; transition: width .4s; }
.stepper-track__fill--propuesta { background: var(--color-brand-cyan); }
.stepper-track__fill--produccion { background: var(--color-brand-magenta); }

.stepper-step { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; flex: 1; }
.stepper-step__circle {
    width: 26px; height: 26px; border-radius: 999px; display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 800; background: var(--color-surface-container-highest); color: rgba(67,71,77,.4);
    box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.stepper-step__circle .icon { width: 13px; height: 13px; }
.stepper-step--done.stepper-step--propuesta .stepper-step__circle { background: var(--color-brand-cyan); color: #fff; }
.stepper-step--done.stepper-step--produccion .stepper-step__circle { background: var(--color-brand-magenta); color: #fff; }
.stepper-step--active.stepper-step--propuesta .stepper-step__circle { background: #fff; border: 2px solid var(--color-brand-cyan); color: var(--color-brand-cyan); box-shadow: 0 0 0 2px #fff; }
.stepper-step--active.stepper-step--produccion .stepper-step__circle { background: #fff; border: 2px solid var(--color-brand-magenta); color: var(--color-brand-magenta); box-shadow: 0 0 0 2px #fff; }
.stepper-step--completed .stepper-step__circle { background: var(--color-brand-green); color: #fff; }
.stepper-step__label {
    margin-top: 6px; font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px;
    text-align: center; max-width: 70px; line-height: 1.3; color: rgba(67,71,77,.4);
}
.stepper-step--done .stepper-step__label, .stepper-step--active .stepper-step__label { color: var(--color-brand-navy); }

.stepper-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stepper-btn {
    display: inline-flex; align-items: center; border: none; cursor: pointer;
    padding: 7px 14px; border-radius: 10px; font-size: 10px; font-weight: 800;
    text-transform: none; text-decoration: none; transition: opacity .15s, background-color .15s;
}
.stepper-btn--primary-propuesta { background: var(--color-brand-cyan); color: #fff; }
.stepper-btn--primary-produccion { background: var(--color-brand-magenta); color: #fff; }
.stepper-btn--primary-propuesta:hover, .stepper-btn--primary-produccion:hover { opacity: .9; }
.stepper-btn--outline { background: #fff; border: 1px solid var(--color-outline-variant); color: var(--color-on-surface-variant); }
.stepper-btn--outline:hover { background: var(--color-surface-container-low); }
.stepper-btn--ghost { background: transparent; color: rgba(67,71,77,.6); padding-left: 10px; padding-right: 10px; }
.stepper-btn--ghost:hover { color: var(--color-on-surface-variant); }
.stepper-note { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: rgba(67,71,77,.6); margin: 0; }

.status-widget {
    background: linear-gradient(to bottom right, #fff, rgba(76, 160, 255, .04));
    border-radius: 16px; border: 1px solid var(--color-surface-container); box-shadow: 0px 4px 20px rgba(0,0,0,0.05);
    padding: 18px; display: flex; flex-direction: column; justify-content: center; align-items: center;
    text-align: center; gap: 4px;
}
.status-widget .icon { width: 24px; height: 24px; color: var(--color-brand-cyan); margin-bottom: 4px; }
.status-widget--produccion .icon { color: var(--color-brand-magenta); }
.status-widget--delayed .icon { color: var(--color-brand-red); }
.status-widget__label { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--color-on-surface-variant); margin: 0; }
.status-widget__value { font-size: 14px; font-weight: 900; font-style: italic; color: var(--color-brand-navy); margin: 2px 0; }
.status-widget__note { font-size: 9px; font-weight: 800; margin: 2px 0; }
.status-widget__note--orange { color: var(--color-brand-orange); }
.status-widget__note--red { color: var(--color-brand-red); text-transform: uppercase; }
.status-widget__action {
    margin-top: 6px; padding: 6px 12px; border-radius: 10px; background: #fff;
    border: 1px solid var(--color-outline-variant); color: var(--color-on-surface-variant);
    font-size: 9px; font-weight: 800; text-decoration: none; cursor: pointer;
}
.status-widget__action:hover { background: var(--color-surface-container-low); }

.proposal-link-card {
    background: #fff; padding: 16px 18px; border-radius: 16px; border: 1px solid var(--color-surface-container);
    box-shadow: 0px 4px 20px rgba(0,0,0,0.05);
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
}
.proposal-link-card__label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; color: var(--color-brand-navy); flex-shrink: 0; }
.proposal-link-card__label .icon { color: var(--color-secondary); width: 16px; height: 16px; }
.proposal-link-card__label small { font-size: 9px; font-weight: 600; color: rgba(67,71,77,.6); text-transform: none; }
.proposal-link-card__value { flex: 1; min-width: 200px; font-size: 12px; color: var(--color-on-surface-variant); }
.proposal-link-card__value a { font-weight: 700; word-break: break-all; }

.brief-card { background: #fff; border-radius: 20px; border: 1px solid var(--color-surface-container); box-shadow: 0px 4px 20px rgba(0,0,0,0.05); overflow: hidden; }
.brief-card__header { padding: 20px 24px 16px; border-bottom: 1px solid rgba(196,198,205,.2); }
.brief-card__header--propuesta { background: rgba(0, 178, 227, 0.08); }
.brief-card__header--produccion { background: rgba(216, 27, 96, 0.08); }
.brief-card__header h3 { font-size: 14px; font-weight: 800; color: var(--color-brand-navy); display: flex; align-items: center; gap: 8px; margin: 0; }
.brief-card__header h3 .icon { width: 16px; height: 16px; color: var(--color-secondary); }
.brief-card__header--propuesta h3 .icon { color: var(--color-brand-cyan); }
.brief-card__header--produccion h3 .icon { color: var(--color-brand-magenta); }
.brief-card__header p { font-size: 11px; color: var(--color-on-surface-variant); font-weight: 500; margin: 3px 0 0; }
.brief-card__body { padding: 22px 24px; display: flex; flex-direction: column; gap: 22px; }
/* Íconos de Pre-Buy/Post-Buy dentro de "Flujo de Control de Campaña" (§40) — mismo acento
   que el header de la tarjeta, en vez de quedar siempre azules sin importar `kind`. */
.brief-card--propuesta .stat-mini-card__icon .icon { color: var(--color-brand-cyan); }
.brief-card--produccion .stat-mini-card__icon .icon { color: var(--color-brand-magenta); }

.stat-mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 700px) { .stat-mini-grid { grid-template-columns: 1fr; } }
.stat-mini-grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 700px) { .stat-mini-grid--2 { grid-template-columns: 1fr; } }
.stat-mini-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--color-surface-container-low); border: 1px solid rgba(196,198,205,.15); }
.stat-mini-card__icon { flex-shrink: 0; padding: 8px; background: #fff; border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.stat-mini-card__icon .icon { width: 15px; height: 15px; color: var(--color-secondary); }
.stat-mini-card__label { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: var(--color-on-surface-variant); margin: 0; }
.stat-mini-card__value { font-size: 12px; font-weight: 800; color: var(--color-brand-navy); margin: 1px 0 0; }

.brief-subgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 700px) { .brief-subgrid { grid-template-columns: 1fr; } }
.brief-subgrid__label { display: flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: var(--color-on-surface-variant); margin: 0 0 8px; }
.brief-subgrid__label .icon { width: 12px; height: 12px; }
.brief-subgrid__link { font-size: 12px; font-weight: 700; color: var(--color-secondary); word-break: break-all; }
.brief-subgrid__text { font-size: 12px; font-weight: 600; color: var(--color-brand-navy); line-height: 1.6; margin: 0; }
.brief-subgrid__empty { font-size: 12px; color: rgba(67,71,77,.5); font-style: italic; }

.pill-row { display: flex; flex-wrap: wrap; gap: 6px; }
.pill-tag { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 10px; font-weight: 800; background: rgba(0, 178, 227, 0.1); color: var(--color-brand-cyan); }

.brief-divider { padding-top: 6px; border-top: 1px solid rgba(196,198,205,.2); }
.brief-divider__title { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--color-on-surface-variant); display: flex; align-items: center; gap: 6px; margin: 0 0 14px; }
.brief-divider__title .icon { width: 14px; height: 14px; color: var(--color-secondary); }

.brief-fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 700px) { .brief-fields-grid { grid-template-columns: 1fr; } }
.brief-field-card { padding: 16px; border-radius: 12px; background: var(--color-surface-container-low); border-left: 4px solid var(--color-secondary); }
.brief-field-card--span2 { grid-column: 1 / -1; }
.brief-field-card--warn { background: rgba(243, 139, 32, 0.05); border-left-color: var(--color-brand-orange); }
.brief-field-card--danger { background: rgba(227, 61, 69, 0.05); border-left-color: var(--color-brand-red); }
.brief-field-card__label { display: flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: var(--color-secondary); margin: 0 0 6px; }
.brief-field-card__label .icon { width: 13px; height: 13px; }
.brief-field-card--warn .brief-field-card__label { color: var(--color-brand-orange); }
.brief-field-card--danger .brief-field-card__label { color: var(--color-brand-red); }
.brief-field-card__text { font-size: 12px; font-weight: 500; color: var(--color-on-surface); line-height: 1.6; margin: 0; white-space: pre-line; }

.campaign-flow-links { display: flex; flex-direction: column; gap: 6px; }
.campaign-flow-links a { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--color-secondary); word-break: break-all; }
.campaign-flow-links a .icon { width: 13px; height: 13px; flex-shrink: 0; }

.secondary-row { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 900px) { .secondary-row { grid-template-columns: 1fr; } }
.management-card .btn { width: 100%; margin-bottom: 10px; text-align: center; justify-content: center; }
.management-card .btn:last-child { margin-bottom: 0; }

/* ---------- Fase 20: version del sitio en el footer ---------- */
.version-footer { display: block; font-size: 10px; font-weight: 600; letter-spacing: .2px; }
.sidebar__footer .version-footer { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.1); color: rgba(255,255,255,0.35); }
.auth-version-footer { position: fixed; left: 0; bottom: 12px; width: 100%; z-index: 1; text-align: center; }
.auth-version-footer .version-footer { color: var(--color-on-surface-variant); opacity: .6; }

/* ---------- Fase 22: "RFP Drawer" — panel lateral de pipeline/SLA (porta SLADrawer.tsx,
   ver docs/MIGRATION_PLAN.md §22). Reutiliza tokens/clases ya existentes donde se puede
   (.stage-badge, .sla-dot, .pipeline-dot, .test-badge) en vez de duplicar color. ---------- */
.rfp-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 23, 45, 0.4);
    backdrop-filter: blur(2px);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease;
}
.rfp-drawer-backdrop.is-open { opacity: 1; visibility: visible; }

.rfp-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 100%;
    max-width: 420px;
    background: #fff;
    box-shadow: -12px 0 32px rgba(0, 0, 0, 0.18);
    z-index: 201;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .25s cubic-bezier(.32, .72, 0, 1);
    font-family: inherit;
}
.rfp-drawer.is-open { transform: translateX(0); }

.rfp-drawer__header { padding: 24px; border-bottom: 1px solid rgba(196, 198, 205, 0.3); position: relative; }
.rfp-drawer__header[data-theme="propuesta"] { background: rgba(0, 178, 227, 0.08); }
.rfp-drawer__header[data-theme="produccion"] { background: rgba(216, 27, 96, 0.08); }
.rfp-drawer__header[data-theme="red"] { background: rgba(227, 61, 69, 0.08); }
.rfp-drawer__header[data-theme="orange"] { background: rgba(243, 139, 32, 0.08); }
.rfp-drawer__header[data-theme="green"] { background: rgba(0, 171, 102, 0.08); }

.rfp-drawer__close {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 8px;
    border: none;
    background: transparent;
    color: var(--color-on-surface-variant);
    border-radius: 12px;
    cursor: pointer;
    transition: all .15s;
}
.rfp-drawer__close:hover { background: rgba(255, 255, 255, 0.6); color: var(--color-brand-navy); }
.rfp-drawer__close .icon { width: 18px; height: 18px; }

.rfp-drawer__title-row { display: flex; align-items: flex-start; gap: 14px; padding-right: 32px; }
.rfp-drawer__icon { padding: 10px; background: #fff; border-radius: 16px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); border: 1px solid rgba(196, 198, 205, 0.2); flex-shrink: 0; }
.rfp-drawer__icon .icon { width: 22px; height: 22px; }
.rfp-drawer__icon[data-theme="propuesta"] .icon { color: var(--color-brand-cyan); }
.rfp-drawer__icon[data-theme="produccion"] .icon { color: var(--color-brand-magenta); }
.rfp-drawer__icon[data-theme="red"] .icon { color: var(--color-brand-red); }
.rfp-drawer__icon[data-theme="orange"] .icon { color: var(--color-brand-orange); }
.rfp-drawer__icon[data-theme="green"] .icon { color: var(--color-brand-green); }

.rfp-drawer__title { font-size: 17px; font-weight: 800; color: var(--color-brand-navy); line-height: 1.2; margin: 0; }
.rfp-drawer__subtitle { font-size: 11px; font-weight: 500; color: var(--color-on-surface-variant); margin: 4px 0 0; line-height: 1.4; }

.rfp-drawer__count { display: inline-block; margin-top: 14px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; padding: 4px 10px; border-radius: 999px; }
.rfp-drawer__count[data-theme="propuesta"] { background: rgba(0, 178, 227, 0.15); color: #007b9e; }
.rfp-drawer__count[data-theme="produccion"] { background: rgba(216, 27, 96, 0.15); color: var(--color-brand-magenta); }
.rfp-drawer__count[data-theme="red"] { background: rgba(227, 61, 69, 0.15); color: var(--color-brand-red); }
.rfp-drawer__count[data-theme="orange"] { background: rgba(243, 139, 32, 0.15); color: var(--color-brand-orange); }
.rfp-drawer__count[data-theme="green"] { background: rgba(0, 171, 102, 0.15); color: var(--color-brand-green); }

.rfp-drawer__search { padding: 14px 16px; border-bottom: 1px solid rgba(196, 198, 205, 0.2); background: var(--color-surface-container-low); flex-shrink: 0; }
.rfp-drawer__search-wrap { position: relative; }
.rfp-drawer__search-wrap .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--color-on-surface-variant); pointer-events: none; }
.rfp-drawer__search-input {
    width: 100%;
    height: 38px;
    padding: 0 12px 0 36px;
    border: 1px solid rgba(196, 198, 205, 0.6);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-brand-navy);
    background: #fff;
    font-family: inherit;
}
.rfp-drawer__search-input:focus { outline: none; border-color: var(--color-secondary); box-shadow: 0 0 0 2px rgba(106, 27, 154, 0.15); }

.rfp-drawer__list { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: rgba(240, 244, 248, 0.4); }

.rfp-drawer__loading { padding: 48px 16px; text-align: center; color: var(--color-on-surface-variant); font-size: 11px; font-weight: 700; }

.rfp-drawer__empty { padding: 48px 16px; text-align: center; color: var(--color-on-surface-variant); }
.rfp-drawer__empty .icon { width: 34px; height: 34px; opacity: .4; margin-bottom: 8px; color: var(--color-on-surface-variant); }
.rfp-drawer__empty p { margin: 0; }
.rfp-drawer__empty p:first-of-type { font-weight: 800; font-size: 12px; color: var(--color-brand-navy); margin-top: 4px; }
.rfp-drawer__empty p:last-of-type { font-size: 11px; margin-top: 2px; }

.rfp-drawer__card {
    position: relative;
    overflow: hidden;
    padding: 14px 14px 14px 18px;
    background: #fff;
    border: 1px solid rgba(196, 198, 205, 0.3);
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    cursor: pointer;
    transition: all .15s;
}
.rfp-drawer__card:hover { box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08); background: var(--color-surface-container-low); }
.rfp-drawer__card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; }
.rfp-drawer__card[data-theme="propuesta"]::before { background: var(--color-brand-cyan); }
.rfp-drawer__card[data-theme="produccion"]::before { background: var(--color-brand-magenta); }
.rfp-drawer__card[data-theme="red"]::before { background: var(--color-brand-red); }
.rfp-drawer__card[data-theme="orange"]::before { background: var(--color-brand-orange); }
.rfp-drawer__card[data-theme="green"]::before { background: var(--color-brand-green); }

.rfp-drawer__card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.rfp-drawer__card-id { display: block; font-size: 10px; font-weight: 800; color: var(--color-secondary); text-transform: uppercase; }
.rfp-drawer__card-client { font-size: 13px; font-weight: 800; color: var(--color-brand-navy); margin-top: 2px; }
.rfp-drawer__card-product { font-size: 11px; color: var(--color-on-surface-variant); font-weight: 600; margin-top: 6px; }
.rfp-drawer__card-footer { display: flex; justify-content: space-between; align-items: center; font-size: 10px; font-weight: 700; color: var(--color-on-surface-variant); margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(196, 198, 205, 0.2); }
.rfp-drawer__card-footer strong { color: var(--color-brand-navy); }
/* Los puntos de color reusan `.sla-dot`/`.pipeline-dot` (definidos más arriba), que no
   traen su propio margen/alineación acá dentro del pie de la tarjeta del drawer. */
.rfp-drawer__card-footer .sla-dot,
.rfp-drawer__card-footer .pipeline-dot { margin-right: 5px; vertical-align: middle; }

.rfp-drawer__footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(196, 198, 205, 0.2);
    background: var(--color-surface-container-low);
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--color-on-surface-variant);
    flex-shrink: 0;
}
.rfp-drawer__footer span:last-child { opacity: .6; }

@media (max-width: 480px) { .rfp-drawer { max-width: 100%; } }

/* ---------- Panel lateral de alta/edición de Elementos de Producción (Broadcast/Digital/
   Activación), docs/MIGRATION_PLAN.md §35 — porta el drawer de RFPDetailView.tsx. Mismo
   mecanismo que `.rfp-drawer` de arriba (backdrop + transform slide-in), pero el body es
   el fragmento HTML real de `templates/{BroadcastElements,DigitalElements,Activations}/
   form.php` (fetch + innerHTML), no una lista armada en JS — de ahí los overrides de abajo
   para que ese HTML (pensado para página completa) quepa bien en un panel angosto. ---------- */
.element-panel-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 23, 45, 0.4);
    backdrop-filter: blur(2px);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease;
}
.element-panel-backdrop.is-open { opacity: 1; visibility: visible; }

.element-panel {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 100%;
    max-width: 480px;
    background: #fff;
    box-shadow: -12px 0 32px rgba(0, 0, 0, 0.18);
    z-index: 201;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .25s cubic-bezier(.32, .72, 0, 1);
    font-family: inherit;
}
.element-panel.is-open { transform: translateX(0); }

.element-panel__header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(196, 198, 205, 0.3);
    background: var(--color-surface-container-low);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.element-panel__title { font-family: var(--font-serif); font-size: 16px; color: var(--color-brand-navy); margin: 0; }
.element-panel__close {
    border: none;
    background: none;
    padding: 6px;
    border-radius: 10px;
    cursor: pointer;
    color: var(--color-on-surface-variant);
}
.element-panel__close:hover { background: rgba(0, 0, 0, 0.06); color: var(--color-brand-navy); }
.element-panel__close .icon { width: 18px; height: 18px; }

.element-panel__body { flex: 1; overflow-y: auto; padding: 20px; }
.element-panel__loading { padding: 32px 8px; text-align: center; color: var(--color-on-surface-variant); font-size: 12px; font-weight: 700; }

/* Footer de acciones (Cancelar/Guardar) — pedido del cliente en §36: siempre a la vista,
   fuera del área que scrollea. El JS del panel (`templates/RfpRequests/view.php`) saca
   `.form-footer-bar`/`.form-actions` del fragmento inyectado y lo cuelga acá — este
   contenedor vive fuera de `.element-panel__body`, así que nunca se scrollea con el
   contenido del form. */
.element-panel__footer {
    flex-shrink: 0;
    padding: 16px 20px;
    border-top: 1px solid var(--color-outline-variant);
    background: var(--color-surface-container-lowest);
}
/* `.form-footer-bar` (backlog ítem 1, §23) trae estilos pensados para página completa con
   sidebar (`position: fixed; left: 280px`) — una vez reubicado acá adentro, se neutralizan
   porque el contenedor de arriba ya hace de barra fija. */
.element-panel__footer .form-footer-bar {
    position: static;
    left: auto;
    padding: 0;
    box-shadow: none;
    background: none;
    border: none;
}
.element-panel__footer .form-actions,
.element-panel__footer .form-footer-bar .form-actions { max-width: none; }

@media (max-width: 480px) { .element-panel { max-width: 100%; } }

/* El fragmento inyectado es el mismo `form.php` que se usa como página completa — estos
   overrides lo acomodan al ancho del panel sin tocar los templates. */
.element-panel__body .page-header { display: none; }
.element-panel__body .card { padding: 18px; border-radius: 14px; margin-bottom: 16px; }
.element-panel__body .form-grid,
.element-panel__body .form-grid--3 { grid-template-columns: 1fr; }

/* Tabs simples para separar secciones largas de un form.php (Broadcast: "Datos de la
   Pieza" / "Contenido y Assets", pedido del cliente en §36) — click+toggle en JS, sin
   ningún framework. Funcionan igual dentro del panel o como página completa. */
.form-tabs__nav {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--color-outline-variant);
    margin-bottom: 20px;
}
.form-tabs__tab {
    border: none;
    background: none;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 700;
    color: var(--color-on-surface-variant);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.form-tabs__tab:hover { color: var(--color-brand-navy); }
.form-tabs__tab.is-active { color: var(--color-secondary); border-bottom-color: var(--color-secondary); }

/* Panel de detalle del Tipo de Pieza seleccionado (§37, pedido del cliente: reemplaza los
   dos `.alert.alert-debug` planos de §36 — reusa `.brief-field-card` (Descripción/
   Requerimientos, mismo lenguaje visual que "Brief de la Propuesta" en RfpRequests/
   view.php) y `.stat-mini-card` (Tiempos de Producción, mismo que Pre-Buy/Post-Buy) en vez
   de un bloque de texto suelto sobre fondo azul liso. Acento magenta (§38, pedido del
   cliente: "color rojo de producción" en todo el form — coherencia con `--accent-produccion`
   ya usado en el resto de la app, ver `.bento-card--accent-produccion`/`.kind-badge` en
   RfpRequests/view.php) en vez del azul genérico por defecto — los 3 form.php de
   elementos son exclusivos de Solicitudes de Producción, nunca aparecen en una Propuesta,
   así que no hace falta una variante condicional. Los overrides de `.brief-field-card`/
   `.stat-mini-card__icon` quedan scoped adentro de `.piece-info-panel` para no recolorear
   esos dos componentes donde SÍ siguen siendo azules (ej. "Brief de la Propuesta"). */
.piece-info-panel {
    margin: 4px 0 20px;
    border: 1px solid rgba(216, 27, 96, 0.2);
    border-radius: 14px;
    background: var(--color-surface-container-lowest);
    overflow: hidden;
}
.piece-info-panel__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(216, 27, 96, 0.08);
    border-bottom: 1px solid rgba(216, 27, 96, 0.15);
}
.piece-info-panel__header .icon { width: 15px; height: 15px; color: var(--color-brand-magenta); flex-shrink: 0; }
.piece-info-panel__header-title { font-size: 12px; font-weight: 800; color: var(--color-brand-navy); }
.piece-info-panel__header-subtitle { font-size: 11px; font-weight: 500; color: var(--color-on-surface-variant); }
.piece-info-panel__body { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.piece-info-panel__sla-title { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: var(--color-on-surface-variant); margin: 0 0 8px; }
.piece-info-panel__sla-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (max-width: 380px) { .piece-info-panel__sla-grid { grid-template-columns: 1fr; } }

.piece-info-panel .brief-field-card { border-left-color: var(--color-brand-magenta); }
.piece-info-panel .brief-field-card__label { color: var(--color-brand-magenta); }
.piece-info-panel .stat-mini-card__icon .icon { color: var(--color-brand-magenta); }

/* Tabs "Datos de la Pieza"/"Contenido y Assets" (§36) — mismo acento magenta, mismo
   motivo que el panel de arriba. `.form-tabs__tab` en sí queda genérico/azul por si se
   reusa en algún form fuera de Producción más adelante. */
.form-tabs__nav--produccion .form-tabs__tab.is-active { color: var(--color-brand-magenta); border-bottom-color: var(--color-brand-magenta); }

/* Labels y botón primario de los 3 form.php de elementos de Producción (§39, pedido del
   cliente: "¿los labels y el botón no deberían estar en rojo también?"). `.form-label` y
   `.btn-primary` son clases genéricas usadas en TODA la app (incluidos los forms de
   Propuesta) — no se tocan sus reglas base acá, solo se agregan overrides scoped a estos
   3 forms específicos (`.element-form--produccion`, la clase que llevan sus `<form>`).
   El botón de submit necesita un segundo selector: el JS del panel (§36) lo saca del
   `<form>` y lo cuelga en `#element-panel-footer` (ver `relocateFooter()` en
   `RfpRequests/view.php`), así que ese caso ya no es descendiente de `.element-form--
   produccion` en el DOM — pero `#element-panel-footer` únicamente existe en la pantalla
   de detalle de una Producción, así que el selector es igual de seguro. */
.element-form--produccion .form-label { color: var(--color-brand-magenta); }
.element-form--produccion .btn-primary,
#element-panel-footer .btn-primary {
    background: var(--color-brand-magenta);
    box-shadow: 0 10px 20px -5px rgba(216, 27, 96, 0.3);
}

/* ---------- Modal centrado de "Asignar/Cambiar responsable" (docs/MIGRATION_PLAN.md §41)
   — a diferencia de `.element-panel` (drawer lateral ancho, para formularios largos con
   varios campos), este es un modal chico centrado en la pantalla: la asignación es un
   único `<select>`. Mismo mecanismo de fetch+innerHTML que el panel, reusa
   `.element-panel__close`/`.element-panel__loading` (genéricos, sin necesidad de
   duplicarlos) para el botón de cerrar y el estado de carga. ---------- */
.assign-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 23, 45, 0.4);
    backdrop-filter: blur(2px);
    z-index: 210;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease;
}
.assign-modal-backdrop.is-open { opacity: 1; visibility: visible; }

.assign-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(.96);
    width: 100%;
    max-width: 420px;
    max-height: 85vh;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
    z-index: 211;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
    font-family: inherit;
}
.assign-modal.is-open { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
@media (max-width: 480px) { .assign-modal { width: calc(100% - 32px); } }

.assign-modal__header {
    padding: 18px 20px;
    border-bottom: 1px solid rgba(196, 198, 205, 0.3);
    background: var(--color-surface-container-low);
    border-radius: 20px 20px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.assign-modal__title { font-family: var(--font-serif); font-size: 15px; color: var(--color-brand-navy); margin: 0; }
.assign-modal__body { padding: 20px; overflow-y: auto; }
/* El fragmento inyectado es `templates/RfpRequests/assign.php`, pensado también para
   página completa — mismo criterio que `.element-panel__body` con `form.php`. */
.assign-modal__body .page-header,
.assign-modal__body .assign-card > h2 { display: none; }
.assign-modal__body .assign-card,
.assign-modal__body .card { padding: 0; border: none; box-shadow: none; margin: 0; }
.assign-modal__body .form-actions { margin-top: 16px; }

/* ---------- Fase 24: mensajes de error/éxito visibles en pantalla (backlog ítems 2 y 3,
   ver docs/MIGRATION_PLAN.md §24). `templates/element/flash/*.php` ya imprimía
   `<div class="message error">…</div>` (login/OTP ya llamaban `Flash->error()` con el
   mensaje correcto) pero esta clase no tenía NINGÚN estilo en todo el proyecto — el
   mensaje estaba en el HTML pero era invisible (sin color/fondo/borde), por eso el
   cliente lo veía como "no muestra error". Estilo único para las 5 variantes que ya
   existen en `templates/element/flash/` (`error`/`success`/`warning`/`info`/`default`,
   estos dos últimos renderizan la misma clase base `message`) — se usa en TODA pantalla
   que llama `$this->Flash->render()` (login/verify vía Fase 3, y el resto de la app vía
   `templates/layout/default.php`), no solo login. */
.message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    background: rgba(0, 96, 171, 0.08);
    border: 1px solid rgba(0, 96, 171, 0.2);
    color: var(--color-brand-blue);
    cursor: pointer;
}
.message.hidden { display: none; }
.message.error { background: rgba(227, 61, 69, 0.1); border-color: rgba(227, 61, 69, 0.25); color: var(--color-brand-red); }
.message.success { background: rgba(0, 171, 102, 0.1); border-color: rgba(0, 171, 102, 0.25); color: var(--color-brand-green); }
.message.warning { background: rgba(243, 139, 32, 0.1); border-color: rgba(243, 139, 32, 0.25); color: var(--color-brand-orange); }

/* .message es flex (arriba) porque las 5 variantes de templates/element/flash/ son
   siempre una sola línea de texto — con `display:flex` + `align-items:center` alineado
   verticalmente no cambia nada ahí. Pero el banner de aprobación pendiente
   (templates/Users/form.php) reutiliza `.message.warning` con un párrafo largo que
   envuelve un link (`postLink` "rechazá la solicitud") en el medio del texto: en flex,
   cada elemento hijo real (el <a>) se vuelve su propio flex item, separado de los
   textos que lo rodean — el párrafo deja de fluir como una sola oración y el link queda
   flotando lejos del resto ("si no corresponde." termina pegado al borde derecho en vez
   de seguir inmediatamente después del link). `.message--prose` vuelve a `display:block`
   para que el texto fluya normal, y le da al link un estilo que combina con el resto del
   párrafo en vez del azul de link por default. */
.message--prose { display: block; line-height: 1.6; cursor: default; }
.message--prose a { color: inherit; font-weight: 800; text-decoration: underline; text-underline-offset: 2px; }

/* Pantalla "Ver" de un usuario (templates/Users/view.php, ver docs/MIGRATION_PLAN.md §27):
   dos variantes nuevas de `.status-pill` (ver §13/§25 más arriba) para la columna
   "Resultado" de la tabla de accesos — mismo criterio de color que Activo/Inactivo. */
.status-pill[data-status="Exitoso"] { background: rgba(0, 171, 102, 0.1); color: var(--color-brand-green); }
.status-pill[data-status="Exitoso"] .status-pill__dot { background: var(--color-brand-green); }
.status-pill[data-status="Fallido"] { background: rgba(227, 61, 69, 0.1); color: var(--color-brand-red); }
.status-pill[data-status="Fallido"] .status-pill__dot { background: var(--color-brand-red); }

/* Gráfico "Accesos por Mes" (templates/element/access_chart.php) — a diferencia del
   donut/pie (más abajo, `.donut-chart__*`), que necesitan SVG para dibujar arcos, un
   gráfico de barras rectas es más simple como `<div>`s con altura en píxeles dentro de
   una fila flex: sin viewBox ni cálculo de path que mantener. La altura de cada barra
   viene precalculada desde `UsersController::buildLoginChart()`. */
.access-chart { display: flex; align-items: flex-end; gap: 10px; padding: 8px 4px 0; overflow-x: auto; }
.access-chart__col { flex: 1; min-width: 28px; display: flex; flex-direction: column; align-items: center; }
.access-chart__value { font-size: 11px; font-weight: 700; color: var(--color-brand-navy); min-height: 14px; margin-bottom: 2px; }
.access-chart__bar { width: 100%; max-width: 28px; background: var(--color-brand-blue); border-radius: 4px 4px 0 0; min-height: 2px; }
.access-chart__label { font-size: 10px; font-weight: 600; color: var(--color-on-surface-variant); text-transform: uppercase; margin-top: 6px; text-align: center; }

/* Registro de Actividad (misma pantalla) — el diff de `action_logs.changes` es JSON
   crudo, se muestra colapsado atrás de un <details>/<summary> nativo (sin JS) para no
   ensuciar la tabla con auditoría que la mayoría de las veces nadie necesita abrir. */
.audit-changes {
    margin-top: 8px;
    padding: 10px 12px;
    background: var(--color-surface-container);
    border: 1px solid var(--color-outline-variant);
    border-radius: 8px;
    font-size: 11px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: pre-wrap;
    word-break: break-word;
    max-width: 360px;
}
.data-table--compact details summary { cursor: pointer; font-size: 12px; font-weight: 700; color: var(--color-brand-blue); }

/* Modal de Loading (backlog #9, ver docs/MIGRATION_PLAN.md §19/§30) — overlay global,
   mostrado automaticamente al enviar cualquier <form method="post"> sin data-no-loading,
   para que el usuario no dude si el click "prendio" en submits que tardan (altas,
   transiciones de estado). z-index por encima del sidebar (50) y form-footer-bar (45). */
.loading-modal { position: fixed; inset: 0; z-index: 1000; display: none; align-items: center; justify-content: center; background: rgba(0, 23, 45, 0.45); }
.loading-modal.is-visible { display: flex; }
.loading-modal__card { background: #fff; border-radius: 16px; padding: 28px 36px; display: flex; flex-direction: column; align-items: center; gap: 14px; box-shadow: 0 20px 60px -12px rgba(0, 23, 45, 0.35); }
.loading-modal__spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--color-outline-variant); border-top-color: var(--color-brand-cyan); animation: loading-modal-spin 0.7s linear infinite; }
.loading-modal__text { font-family: var(--font-sans); font-size: 13px; font-weight: 700; color: var(--color-brand-navy); }
@keyframes loading-modal-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .loading-modal__spinner { animation-duration: 1.8s; }
}

/* Switch on/off — Tickets de Error "Resuelto" (docs/MIGRATION_PLAN.md §33). Un
   `Form->postLink()` (sin JS propio, mismo criterio "server-rendered" del resto de la
   app) estilizado como track+thumb en vez del botón por defecto. */
.switch-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 700;
}
.switch-toggle__track {
    width: 36px;
    height: 20px;
    border-radius: 999px;
    background: var(--color-outline-variant);
    position: relative;
    transition: background 0.15s ease;
    flex-shrink: 0;
}
.switch-toggle__track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 23, 45, 0.25);
    transition: transform 0.15s ease;
}
.switch-toggle[data-on="true"] .switch-toggle__track { background: var(--color-brand-green); }
.switch-toggle[data-on="true"] .switch-toggle__track::after { transform: translateX(16px); }
.switch-toggle__label { color: var(--color-on-surface-variant); }
.switch-toggle[data-on="true"] .switch-toggle__label { color: var(--color-brand-green); }
/* Variante "preferencia de vista" (no un estado de negocio): color primario en vez de verde. */
.currency-axis-toggle { margin-left: 8px; }
.currency-axis-toggle[data-on="true"] .switch-toggle__track { background: var(--color-secondary); }
.currency-axis-toggle[data-on="true"] .switch-toggle__label { color: var(--color-secondary); }

/* ---------- §47: color del badge de rol (Roles/form.php) ---------- */
.role-color-field { display: flex; align-items: center; gap: 14px; }
.role-color-field__picker { width: 56px; height: 44px; padding: 2px; border: 1px solid var(--color-outline-variant); border-radius: 10px; background: #fff; cursor: pointer; }
.text-muted-strong { color: var(--color-on-surface-variant); font-size: 12px; font-weight: 600; }

/* ---------- §61: mensajes del sistema como toasts flotantes (element/toasts.php) ----------
   Solo dentro de .toast-stack: `.message` se sigue usando también para avisos fijos en página. */
.toast-stack {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(400px, calc(100vw - 32px));
    pointer-events: none;
}
.toast-stack .message {
    pointer-events: auto;
    margin: 0;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 14px 14px 16px;
    background: var(--color-surface-container-lowest);
    border: 1px solid var(--color-outline-variant);
    border-left: 4px solid var(--color-secondary);
    border-radius: 12px;
    color: var(--color-on-surface);
    box-shadow: 0 14px 30px -10px rgba(0, 23, 45, 0.28);
    animation: toast-in 0.25s ease-out;
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast-stack .message.success { border-left-color: var(--color-brand-green); }
.toast-stack .message.error { border-left-color: var(--color-brand-red); }
.toast-stack .message.warning { border-left-color: var(--color-brand-orange); }
.toast-stack .message.is-leaving { opacity: 0; transform: translateX(16px); }
.toast-stack .toast-text { flex: 1; min-width: 0; }
.toast-stack .toast-text a { color: var(--color-secondary); }
.toast-close {
    flex-shrink: 0;
    border: none;
    background: none;
    padding: 0 2px;
    font-size: 18px;
    line-height: 1;
    color: var(--color-on-surface-variant);
    cursor: pointer;
}
.toast-close:hover { color: var(--color-on-surface); }
/* Fuera del contenedor de toasts (si algún día se renderiza un Flash suelto) no se muestra la ×. */
.message:not(.toast-stack .message) > .toast-close { display: none; }
@keyframes toast-in {
    from { opacity: 0; transform: translateX(16px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ---------- §58: botón "Notificar" de la solicitud ---------- */
.rfp-detail-header__actions { display: flex; align-items: flex-start; gap: 14px; }
.rfp-notify { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.rfp-notify__btn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.rfp-notify__btn .icon { width: 18px; height: 18px; }
.rfp-notify__btn--propuesta { background: var(--color-brand-cyan); box-shadow: 0 10px 20px -5px rgba(0, 178, 227, 0.35); }
.rfp-notify__btn--produccion { background: var(--color-brand-magenta); box-shadow: 0 10px 20px -5px rgba(216, 27, 96, 0.35); }
.rfp-notify__meta { font-size: 11px; color: var(--color-on-surface-variant); text-align: right; max-width: 320px; }

.notify-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.notify-chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.notify-chip--propuesta { background: color-mix(in srgb, var(--color-brand-cyan) 15%, #fff); color: color-mix(in srgb, var(--color-brand-cyan) 65%, #000); }
.notify-chip--produccion { background: color-mix(in srgb, var(--color-brand-magenta) 12%, #fff); color: var(--color-brand-magenta); }
.notify-switches { display: flex; flex-direction: column; gap: 6px; max-width: 560px; }

/* ---------- §56: acción no disponible (ej. eliminar un rol con usuarios) ---------- */
.btn-disabled { opacity: .45; cursor: not-allowed; }

/* ---------- §52: usuarios en varios mercados ---------- */
.market-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.market-chip { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--color-surface-container); color: var(--color-on-surface); font-size: 11px; font-weight: 600; white-space: nowrap; }
.market-chip--more { background: var(--color-surface-container-high); color: var(--color-on-surface-variant); cursor: help; }

.check-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.check-chips-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.check-chip { position: relative; display: inline-flex; cursor: pointer; }
.check-chip input { position: absolute; opacity: 0; pointer-events: none; }
.check-chip span { display: inline-block; padding: 7px 14px; border: 1px solid var(--color-outline-variant); border-radius: 999px; background: var(--color-surface-container-lowest); font-size: 13px; font-weight: 600; color: var(--color-on-surface); transition: all 0.15s ease; }
.check-chip:hover span { border-color: var(--color-secondary); }
.check-chip input:checked + span { background: var(--color-secondary); border-color: var(--color-secondary); color: #fff; }
.check-chip input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-secondary) 30%, #fff); }

.market-users__toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.market-users__toolbar .form-input { max-width: 320px; height: 40px; }
.market-users__groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.market-users__group { margin: 0; padding: 12px 14px; border: 1px solid var(--color-outline-variant); border-radius: 12px; background: var(--color-surface-container-low); min-width: 0; }
.market-users__group-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.market-users__list { display: flex; flex-direction: column; gap: 2px; max-height: 280px; overflow-y: auto; }
.market-user { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.market-user:hover { background: var(--color-surface-container-lowest); }
.market-user input { accent-color: var(--color-secondary); margin: 0; }
.market-user small { color: var(--color-on-surface-variant); font-size: 11px; }

/* ---------- §51: breadcrumbs de catálogos ---------- */
.breadcrumbs { margin: 0 0 18px; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; font-size: 12px; font-weight: 600; }
.breadcrumbs li { display: inline-flex; align-items: center; gap: 6px; color: var(--color-on-surface-variant); }
.breadcrumbs li + li::before { content: '›'; color: var(--color-outline); font-weight: 700; }
.breadcrumbs a { color: var(--color-secondary); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs [aria-current="page"] { color: var(--color-brand-navy); font-weight: 700; }

/* ---------- §50: rol clickeable + usuarios por rol ---------- */
a.role-badge--link { text-decoration: none; cursor: pointer; transition: box-shadow 0.15s ease; }
a.role-badge--link:hover { box-shadow: 0 0 0 2px color-mix(in srgb, var(--role-color) 35%, #fff); }
.avatar-stack-link { text-decoration: none; }
.avatar-stack { display: inline-flex; align-items: center; }
.avatar-stack__item { width: 28px; height: 28px; font-size: 11px; border: 2px solid var(--color-surface-container-lowest); margin-left: -8px; }
.avatar-stack__item:first-child { margin-left: 0; }
.avatar-stack__count { margin-left: 8px; font-size: 12px; font-weight: 700; color: var(--color-on-surface-variant); }
.avatar-stack-link:hover .avatar-stack__count { color: var(--color-secondary); }
.role-users-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.role-user-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--color-outline-variant); border-radius: 12px; text-decoration: none; min-width: 0; }
.role-user-card:hover { border-color: var(--color-secondary); background: var(--color-surface-container-low); }
.role-user-card .user-cell__name, .role-user-card .user-cell__email { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- §48: permisos por rol (Roles/form.php) ---------- */
.perm-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .perm-groups { grid-template-columns: 1fr; } }
.perm-group { margin: 0; padding: 16px 18px; border: 1px solid var(--color-outline-variant); border-radius: 14px; background: var(--color-surface-container-low); min-width: 0; }
.perm-group__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; margin-bottom: 10px; border-bottom: 1px solid var(--color-outline-variant); }
.perm-group__title { padding: 0; font-family: var(--font-serif); font-size: 15px; font-weight: 700; color: var(--color-brand-navy); display: flex; align-items: center; gap: 8px; }
.perm-group__count { font-family: var(--font-sans); font-size: 11px; font-weight: 700; color: var(--color-on-surface-variant); background: var(--color-surface-container-lowest); border: 1px solid var(--color-outline-variant); border-radius: 999px; padding: 2px 8px; }
.perm-group__list { display: flex; flex-direction: column; gap: 4px; }

.perm-switch { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 7px 4px; cursor: pointer; border-radius: 8px; }
.perm-switch:hover { background: var(--color-surface-container-lowest); }
.perm-switch input { position: absolute; opacity: 0; pointer-events: none; }
.perm-switch__track { position: relative; flex-shrink: 0; width: 34px; height: 19px; margin-top: 1px; border-radius: 999px; background: var(--color-outline-variant); transition: background 0.15s ease; }
.perm-switch__track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); transition: transform 0.15s ease; }
.perm-switch input:checked + .perm-switch__track { background: var(--color-secondary); }
.perm-switch input:checked + .perm-switch__track::after { transform: translateX(15px); }
.perm-switch input:focus-visible + .perm-switch__track { box-shadow: 0 0 0 2px var(--color-surface-container-lowest), 0 0 0 4px var(--color-secondary); }
.perm-switch__label { font-size: 13px; line-height: 1.4; color: var(--color-on-surface); }
.perm-switch__label small { display: block; font-size: 11px; color: var(--color-on-surface-variant); }
.perm-switch.is-locked { cursor: not-allowed; opacity: .75; }
.perm-switch--group { padding: 0; align-items: center; }
.perm-switch--group:hover { background: none; }
.perm-switch--group .perm-switch__label { font-size: 12px; font-weight: 700; color: var(--color-on-surface-variant); }

/* ---------- §44: importación masiva de cotizaciones (Currencies/import.php) ---------- */
.import-upload .form-group { margin-bottom: 16px; }
.import-upload__input { height: auto; padding: 12px 16px; cursor: pointer; }
.import-upload__input::file-selector-button {
    margin-right: 12px;
    padding: 6px 14px;
    border: 1px solid var(--color-outline-variant);
    border-radius: 8px;
    background: var(--color-surface-container-lowest);
    color: var(--color-secondary);
    font-weight: 700;
    cursor: pointer;
}

.import-summary { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.import-chip { padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.import-chip strong { font-size: 14px; margin-right: 2px; }
.import-chip--new { background: rgba(0, 171, 102, 0.1); color: var(--color-brand-green); }
.import-chip--loaded { background: var(--color-surface-container); color: var(--color-on-surface-variant); }
.import-chip--loaded_diff { background: rgba(243, 139, 32, 0.12); color: var(--color-brand-orange); }
.import-chip--invalid { background: rgba(227, 61, 69, 0.1); color: var(--color-brand-red); }

.import-note { font-size: 12px; color: var(--color-brand-orange); font-weight: 600; margin: 0 0 16px; }
.import-note--muted { color: var(--color-on-surface-variant); font-weight: 500; margin-top: 16px; }

.import-matrix-wrap { overflow-x: auto; }
.import-matrix td { vertical-align: top; }
.import-matrix th:first-child,
.import-matrix td:first-child { position: sticky; left: 0; z-index: 1; background: var(--color-surface-container-lowest); }
.import-matrix__name { display: block; font-size: 11px; color: var(--color-on-surface-variant); }
.import-cell { display: flex; flex-direction: column; gap: 2px; padding: 6px 10px; border-radius: 8px; border-left: 3px solid transparent; min-width: 132px; }
.import-cell__value { font-family: monospace; font-size: 12px; font-weight: 700; color: var(--color-on-surface); }
.import-cell__status { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; }
.import-cell__current { font-size: 11px; color: var(--color-on-surface-variant); }
.import-cell--new { background: rgba(0, 171, 102, 0.08); border-left-color: var(--color-brand-green); }
.import-cell--new .import-cell__status { color: var(--color-brand-green); }
.import-cell--loaded { background: var(--color-surface-container-low); border-left-color: var(--color-outline-variant); }
.import-cell--loaded .import-cell__status { color: var(--color-on-surface-variant); }
.import-cell--loaded_diff { background: rgba(243, 139, 32, 0.08); border-left-color: var(--color-brand-orange); }
.import-cell--loaded_diff .import-cell__status { color: var(--color-brand-orange); }
.import-cell--invalid { background: rgba(227, 61, 69, 0.08); border-left-color: var(--color-brand-red); }
.import-cell--invalid .import-cell__status { color: var(--color-brand-red); }
.import-cell--empty { color: var(--color-outline-variant); }

.import-subtitle { font-size: 13px; color: var(--color-brand-navy); margin: 20px 0 8px; }
.import-list { margin: 0 0 8px; padding-left: 18px; font-size: 12px; color: var(--color-on-surface); }
.import-list li { margin-bottom: 4px; }
.import-new-currencies { margin-top: 20px; padding: 16px 18px; border: 1px solid var(--color-outline-variant); border-radius: 14px; background: var(--color-surface-container-low); }
.import-new-currencies__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.import-new-currencies__header .import-subtitle { margin-top: 0; }
.import-new-currencies__header .import-note { margin: 0 0 12px; }
.import-new-currencies__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px; max-height: 320px; overflow-y: auto; padding-right: 4px; }
.import-new-currency { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; border-radius: 8px; background: var(--color-surface-container-lowest); border: 1px solid transparent; cursor: pointer; font-size: 12px; }
.import-new-currency:has(input:checked) { border-color: var(--color-secondary); }
.import-new-currency input { margin-top: 2px; accent-color: var(--color-secondary); }
.import-new-currency__meta { display: block; color: var(--color-on-surface-variant); font-size: 11px; }
.import-new-currency__unit { color: var(--color-on-surface-variant); }
.import-list summary { cursor: pointer; }
.import-list__codes { margin: 6px 0 0; font-size: 11px; line-height: 1.6; color: var(--color-on-surface-variant); }

/* Formatos en varios canales (§66) */
.filter-bar__total { margin-left: auto; align-self: center; font-size: 13px; color: var(--color-on-surface-variant); }
.format-row[hidden], #format-no-results[hidden] { display: none; }
.market-chip--all { background: color-mix(in srgb, var(--color-brand-purple) 12%, transparent); color: var(--color-brand-purple); }
.market-chip--warn { background: rgba(243, 139, 32, 0.15); color: #a25a00; cursor: help; }
.format-all-channels { margin-bottom: 14px; padding: 10px 12px; border: 1px solid var(--color-outline-variant); border-radius: 12px; background: var(--color-surface-container-low); }
.format-channels.is-all .check-chips, .format-channels.is-all .check-chips-header .perm-switch { opacity: .45; }
.format-channels__all-note { display: none; margin: 4px 0 0; font-size: 12px; color: var(--color-on-surface-variant); }
.format-channels.is-all .format-channels__all-note { display: block; }
.error-message { margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--color-brand-red); }
@media (max-width: 640px) { .filter-bar__total { margin-left: 0; } }
.channel-formats__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); column-gap: 12px; max-height: 360px; }
.market-user.is-locked { cursor: help; color: var(--color-on-surface-variant); }
.market-users__toolbar .row-actions { align-items: center; flex-wrap: nowrap; gap: 8px; }
.market-users__toolbar .row-actions .form-input { width: 260px; flex: 0 1 260px; }
.market-user[hidden] { display: none; }
.catalog-row[hidden], .catalog-no-results[hidden] { display: none; }
a.market-chip--link { text-decoration: none; transition: background .15s ease, color .15s ease; }
a.market-chip--link:hover, a.market-chip--link:focus-visible { background: var(--color-brand-purple); color: #fff; }

/* Top 5 mercados del dashboard (§71) */
.market-load__top span.market-load__rank { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-right: 8px; border-radius: 50%; background: color-mix(in srgb, var(--color-brand-purple) 12%, transparent); color: var(--color-brand-purple); font-size: 11px; font-weight: 700; }

/* Conversión y mix de medios con datos reales (§72) */
.conversion-funnel__value { font-size: 18px; font-weight: 800; color: var(--color-brand-navy); }
.conversion-funnel__track { flex: 1; width: 100%; display: flex; align-items: flex-end; border-bottom: 2px solid var(--color-surface-container); }
.conversion-funnel__track .conversion-funnel__bar { min-height: 3px; transition: height .3s ease; }
.media-declared { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--color-surface-container); }
.media-declared__label { margin: 0 0 8px; font-size: 11px; font-weight: 700; color: var(--color-on-surface-variant); }
.media-declared__bar { display: flex; height: 22px; border-radius: 999px; overflow: hidden; background: var(--color-surface-container); }
.media-declared__bar span { display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; color: #fff; white-space: nowrap; overflow: hidden; }
.media-declared__tv { background: #0060ab; }
.media-declared__digital { background: #00b2e3; }

/* Confirmación propia (reemplaza el confirm() del navegador, §73) */
.confirm-dialog-backdrop { position: fixed; inset: 0; background: rgba(0, 23, 45, 0.45); z-index: 1200; }
.confirm-dialog { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(440px, calc(100vw - 32px)); background: var(--color-surface-container-lowest); border-radius: 18px; padding: 24px; box-shadow: 0 24px 60px -12px rgba(0, 23, 45, 0.35); z-index: 1201; }
.confirm-dialog[hidden], .confirm-dialog-backdrop[hidden] { display: none; }
.confirm-dialog__title { margin: 0 0 8px; font-size: 18px; color: var(--color-brand-navy); }
.confirm-dialog__message { margin: 0 0 20px; font-size: 14px; line-height: 1.5; color: var(--color-on-surface); }
.confirm-dialog__actions { display: flex; justify-content: flex-end; gap: 10px; }

/* Estado del envío de "Notificar" en segundo plano (§74) */
.rfp-notify__state { font-weight: 700; }
.rfp-notify__state--sending { color: var(--color-brand-blue); }
.rfp-notify__state--error { color: var(--color-brand-red); }
