/* ==========================================================================
   estilo-dinaup.css — Estilo REAL de play.dinaup.com para prototipos Flex.
   Extraído 1:1 de:
     · wwwroot/css/var.css              (tokens Radzen material, tema claro)
     · Pages/Apps/AppHeaderU.razor.css  (header doble-piso)
     · Pages/Desktop/DesktopSubpage.razor.css + site.css (.app-desktop, glass, dot-grid)
     · Pages/Desktop/.../WidgetU/DashBoardU.razor.css (widgets)
   Único cambio: los iconos usaban RadzenIcon (::deep .rzi); aquí son <i class="msr">.
   ========================================================================== */

/* ─────────────────────────────  TOKENS (var.css, tema claro)  ───────────── */
:root {
    --rz-white: #ffffff;
    --rz-black: #000000;
    --rz-base-50: #f8fafb;
    --rz-base-100: #f3f6f9;
    --rz-base-200: #e3eaf2;
    --rz-base-300: #dfe5ec;
    --rz-base-400: #dbe0e6;
    --rz-base-700: #45494f;
    --rz-base-800: #45494f;
    --rz-base-900: #1b1d20;

    --rz-primary: #3481e5;
    --rz-primary-light: #bcd8ff;
    --rz-primary-lighter: rgba(0, 111, 255, 0.13);
    --rz-primary-dark: #375a8b;
    --rz-primary-darker: #00215d;

    --rz-success: #3e9108;
    --rz-warning: #ffc107;
    --rz-danger: #d35153;
    --rz-info: #085786;

    --rz-text-color: var(--rz-base-800);
    --rz-text-secondary-color: var(--rz-base-700);
    --rz-text-tertiary-color: #6b7686;
    --rz-text-disabled-color: #9aa7b2;

    --rz-base-background-color: #ffffff;
    --rz-border-color: #d5dbe1;
    --rz-base-200-solid: #e3eaf2;
}

/* ─────────────────────────────  BASE + FUENTES  ─────────────────────────── */
* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Roboto', system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--rz-text-color);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* Iconos = Material Symbols Rounded (idéntico a la barra real) */
.msr {
    font-family: 'Material Symbols Rounded';
    font-weight: normal;
    font-style: normal;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'opsz' 24;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    white-space: nowrap;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    user-select: none;
}

.ibm-plex-sans-regular {
    font-family: "IBM Plex Sans", sans-serif;
    font-weight: 400;
    font-style: normal;
}

/* ─────────────────────────────  LAYOUT (.app-desktop)  ──────────────────── */
/* Reproduce RadzenLayout: header arriba a todo el ancho, luego sidebar + body. */
.app-desktop {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.rz-header {
    position: sticky;
    top: 0;
    z-index: 20;
    /* glass claro sobre el fondo (site.css) */
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    color: var(--rz-text-color);
    box-shadow: 0 1px 0 rgba(52, 129, 229, 0.08);
    border-bottom: 1px solid rgba(52, 129, 229, 0.12);
}

.flex-main {
    display: flex;
    flex: 1;
    min-height: 0;
}

/* Sidebar (glass claro persistente) */
.rz-sidebar {
    width: 320px;
    flex-shrink: 0;
    overflow-y: auto;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(245, 249, 255, 0.82) 100%);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-right: 1px solid rgba(52, 129, 229, 0.12);
    box-shadow: 1px 0 0 rgba(52, 129, 229, 0.04);
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
}

/* Body (canvas con dot-grid azul sutil) */
.rz-body {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    background:
        radial-gradient(rgba(52, 129, 229, 0.10) 1.2px, transparent 1.2px) 0 0 / 28px 28px,
        linear-gradient(135deg, #F5F9FF 0%, #FFFFFF 45%, #E8F1FF 100%);
    background-attachment: fixed;
    box-shadow: inset 0 9px 12px -9px rgba(0, 33, 93, 0.16);
}

/* Sidebar plegada */
.app-desktop.sidebar-collapsed .rz-sidebar {
    width: 0;
    opacity: 0;
    border-right: 0;
    overflow: hidden;
}

/* ==========================================================================
   AppHeaderU — Doble piso sobre hairline.
   ========================================================================== */
.ah-shell {
    width: 100%;
    box-sizing: border-box;
    background: transparent; /* en Flex la .rz-header ya es glass */
    font-family: 'Roboto', system-ui, -apple-system, sans-serif;
    color: var(--rz-text-color);
}

.ah-shell a, .ah-shell button { cursor: pointer; }

/* ===== PISO 1 ===== */
.ah-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    min-height: 52px;
    padding: 4px 16px;
}

.ah-top-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ah-logo { display: inline-flex; align-items: center; text-decoration: none; }
.ah-logo img { height: 30px; display: block; }
.ah-top-right { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

/* Toggle de la sidebar (equiv. RadzenSidebarToggle) */
.rz-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 0;
    background: transparent;
    border-radius: 999px;
    color: var(--rz-text-color);
    transition: background .15s ease;
}
.rz-sidebar-toggle:hover { background: var(--rz-base-200); }
.rz-sidebar-toggle .msr { font-size: 24px; }

/* Botón ghost redondo (rejilla de apps + Ayuda) */
.ah-iconbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    background: transparent;
    border-radius: 999px;
    color: var(--rz-text-secondary-color);
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}
.ah-iconbtn:hover { background: var(--rz-base-200); color: var(--rz-text-color); }
.ah-iconbtn .msr { font-size: 22px; }

/* Píldora discreta que recuerda que esto es un prototipo */
.proto-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--rz-primary-darker);
    background: rgba(52, 129, 229, 0.12);
    border: 1px solid rgba(52, 129, 229, 0.22);
}

/* Avatar de cuenta (placeholder) */
.proto-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3481e5, #00215d);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    border: 3px solid #F7BD00; /* borde tipo Administrador */
    margin-left: 4px;
}

/* ===== PISO 2: switcher ===== */
.ah-nav {
    width: 100%;
    padding: 0 12px;
    border-top: 1px solid var(--rz-base-200);
}

.ah-list {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 4px;
    height: 46px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.ah-list li { display: inline-flex; align-items: stretch; }
.ah-sep-wrap { align-items: center; }

.ah-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 100%;
    padding: 0 12px;
    color: var(--rz-text-secondary-color);
    text-decoration: none;
    font: 500 14px/1 'Roboto', system-ui, sans-serif;
    letter-spacing: -.01em;
    border: 0;
    background: transparent;
    border-radius: 6px;
    white-space: nowrap;
    transition: color .15s ease, background .15s ease;
}
.ah-chip .msr { font-size: 20px; }
.ah-chip:hover { color: var(--rz-text-color); background: var(--rz-base-200); }

/* Activo = tinta de marca + semibold */
.ah-chip.is-active { color: var(--rz-primary); font-weight: 600; }
.ah-chip.is-active:hover { background: transparent; }

/* Flex: tinte propio */
.ah-chip--flex { color: #3481e5; }
.ah-chip--flex:hover { color: #2f6fd0; background: rgba(52, 129, 229, .08); }
.ah-chip--flex.is-active { color: #2f6fd0; }

.ah-sep {
    width: 1px;
    align-self: center;
    height: 20px;
    background: var(--rz-border-color);
    margin: 0 6px;
}

/* ===== Flechita "Más" + panel de avanzadas ===== */
.ah-more-wrap { position: relative; display: inline-flex; align-items: stretch; }
.ah-more .ah-caret { transition: transform .2s ease; }
.ah-more.is-open .ah-caret { transform: rotate(180deg); }

.ah-adv {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 1200;
    min-width: 210px;
    padding: 6px;
    background: var(--rz-base-background-color);
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(22, 34, 46, .16);
}
.ah-adv[hidden] { display: none; }
.ah-adv-title {
    padding: 8px 10px 6px;
    font: 600 11px/1 'Roboto', system-ui, sans-serif;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--rz-text-disabled-color);
}
.ah-adv-item {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 40px;
    padding: 0 10px;
    border-radius: 7px;
    color: var(--rz-text-color);
    text-decoration: none;
    font: 500 14px/1 'Roboto', system-ui, sans-serif;
}
.ah-adv-item:hover { background: var(--rz-base-200); }
.ah-adv-item .msr { font-size: 20px; color: var(--rz-text-secondary-color); }

/* ===== HAIRLINE con glow + brillo que recorre ===== */
.ah-ribbon-wrap { position: relative; width: 100%; height: 2px; }
.ah-ribbon { display: flex; height: 2px; width: 100%; position: relative; z-index: 1; overflow: hidden; }
.ah-ribbon-glow {
    display: flex; height: 3px; width: 100%;
    position: absolute; top: -1px; left: 0; z-index: 0;
    filter: blur(6px); opacity: .9; pointer-events: none;
}
.ah-ribbon i, .ah-ribbon-glow i { flex: 1; background: var(--c); }
.ah-ribbon--flex {
    background: linear-gradient(90deg, transparent 0%, #3481e5 20%, #bcd8ff 50%, #3481e5 80%, transparent 100%);
}
.ah-ribbon::after {
    content: "";
    position: absolute; top: 0; left: -50%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .65), transparent);
    pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
    .ah-ribbon::after { animation: ah-shimmer 3.2s ease-in-out infinite; }
}
@keyframes ah-shimmer { 0% { left: -50%; } 100% { left: 150%; } }

/* ==========================================================================
   FLEX — Sidebar
   ========================================================================== */
.flex-sidebar-inner { display: flex; flex-direction: column; height: 100%; }

.flex-sidebar-header {
    display: flex; align-items: center; gap: 10px;
    padding: 22px 22px 16px;
    border-bottom: 1px solid rgba(52, 129, 229, 0.1);
}
.flex-sidebar-header-icon { color: var(--rz-primary); font-size: 22px; }
.flex-sidebar-title {
    font-family: "IBM Plex Sans", system-ui, sans-serif;
    font-size: 20px; font-weight: 600; color: #00215d; margin: 0; letter-spacing: -0.01em;
}

.flex-sidebar-list { flex: 1; overflow-y: auto; padding: 12px 10px 20px; }
.flex-sidebar-empty { padding: 20px 14px; font-size: 13px; color: var(--rz-text-secondary-color); text-align: center; }
.flex-sidebar-section-title {
    font-size: 10px; text-transform: uppercase; letter-spacing: 0.16em;
    color: var(--rz-text-secondary-color); padding: 18px 14px 8px; font-weight: 700;
}

.flex-sidebar-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 12px;
    text-decoration: none; color: var(--rz-text-color);
    transition: background 0.15s ease, color 0.15s ease;
    min-height: 44px; margin-bottom: 2px; border: 1px solid transparent;
    cursor: pointer;
}
.flex-sidebar-item:hover { background: rgba(52, 129, 229, 0.08); color: var(--rz-primary); }
.flex-sidebar-item.active {
    background: linear-gradient(135deg, rgba(52, 129, 229, 0.12) 0%, rgba(188, 216, 255, 0.28) 100%);
    border-color: rgba(52, 129, 229, 0.22);
    color: var(--rz-primary-darker);
    font-weight: 600;
}
.flex-sidebar-item-nested { margin-left: 14px; }
.flex-sidebar-item-icon { width: 22px; height: 22px; object-fit: contain; flex-shrink: 0; }
.flex-sidebar-item-icon-mi { font-size: 22px; color: var(--rz-primary); flex-shrink: 0; }
.flex-sidebar-item-title {
    font-size: 14px; flex: 1; line-height: 1.3;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ==========================================================================
   FLEX — Canvas / Breadcrumb / Home
   ========================================================================== */
.flex-canvas { position: relative; min-height: calc(100vh - 80px); overflow-x: hidden; }

.flex-canvas-breadcrumb {
    display: flex; align-items: center; gap: 10px;
    padding: 24px 32px 12px; font-size: 13px;
    color: var(--rz-text-secondary-color); flex-wrap: wrap;
}
.flex-breadcrumb-home {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(52, 129, 229, 0.12);
    color: var(--rz-primary); text-decoration: none; font-weight: 500;
    transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
    min-height: 32px; cursor: pointer;
}
.flex-breadcrumb-home .msr { font-size: 18px; }
.flex-breadcrumb-home:hover { background: rgba(255, 255, 255, 0.92); border-color: rgba(52, 129, 229, 0.3); transform: translateY(-1px); }
.flex-breadcrumb-current { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; font-weight: 600; color: var(--rz-text-color); }
.flex-breadcrumb-icon { width: 18px; height: 18px; object-fit: contain; }
.flex-breadcrumb-icon.msr { font-size: 18px; color: var(--rz-primary); }

.flex-canvas-surface { position: relative; padding: 8px 32px 48px; max-width: 1600px; margin: 0 auto; }

.flex-home { max-width: 1200px; margin: 0 auto; padding: 56px 32px 80px; }
.flex-home-intro { text-align: center; margin-bottom: 48px; }
.flex-home-eyebrow {
    display: inline-block; font-size: 11px; font-weight: 600;
    letter-spacing: 0.24em; text-transform: uppercase;
    color: var(--rz-primary); margin-bottom: 16px;
}
.flex-home-title {
    font-family: "IBM Plex Sans", system-ui, sans-serif;
    font-size: clamp(34px, 5vw, 52px); font-weight: 600;
    color: #00215d; margin: 0 0 12px; letter-spacing: -0.03em; line-height: 1.12;
}
.flex-home-subtitle { font-size: 16px; color: var(--rz-text-secondary-color); margin: 0; font-weight: 400; }

.flex-home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 20px;
}
.flex-home-card {
    position: relative; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 16px;
    padding: 28px 20px 32px; min-height: 180px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.88) 0%, rgba(255, 255, 255, 0.62) 100%);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.9); border-radius: 24px;
    box-shadow:
        0 4px 24px -4px rgba(52, 129, 229, 0.12),
        0 2px 8px -2px rgba(0, 33, 93, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    text-decoration: none; color: var(--rz-text-color); cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s ease;
    overflow: hidden;
}
.flex-home-card::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(52, 129, 229, 0) 0%, rgba(52, 129, 229, 0.06) 100%);
    opacity: 0; transition: opacity 0.25s ease; pointer-events: none;
}
.flex-home-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 16px 40px -8px rgba(52, 129, 229, 0.28),
        0 4px 16px -4px rgba(0, 33, 93, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
    border-color: rgba(52, 129, 229, 0.3);
}
.flex-home-card:hover::before { opacity: 1; }
.flex-home-card-icon-wrap {
    display: flex; align-items: center; justify-content: center;
    width: 64px; height: 64px; border-radius: 18px;
    background: linear-gradient(145deg, rgba(52, 129, 229, 0.08) 0%, rgba(188, 216, 255, 0.2) 100%);
    border: 1px solid rgba(52, 129, 229, 0.12);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.flex-home-card:hover .flex-home-card-icon-wrap { transform: scale(1.05); }
.flex-home-card-icon { width: 40px; height: 40px; object-fit: contain; }
.flex-home-card-icon.msr { font-size: 34px; color: var(--rz-primary); width: auto; height: auto; }
.flex-home-card-title { font-size: 14px; font-weight: 600; text-align: center; line-height: 1.35; color: var(--rz-text-color); z-index: 1; }
.flex-home-card-arrow {
    position: absolute; top: 16px; right: 16px; font-size: 18px; color: var(--rz-primary);
    opacity: 0; transform: translateX(-6px); transition: opacity 0.25s ease, transform 0.25s ease;
}
.flex-home-card:hover .flex-home-card-arrow { opacity: 1; transform: translateX(0); }

/* ==========================================================================
   FLEX — Panel modo LISTA (filas wdg-row)
   ========================================================================== */
.dash-list { display: flex; flex-direction: column; width: 100%; }

.wdg-row {
    display: flex; align-items: center; gap: 12px;
    min-height: 52px; padding: 10px 12px; border-radius: 12px;
    cursor: pointer; transition: background-color .15s ease, color .15s ease;
    text-decoration: none; color: var(--rz-text-color);
}
.wdg-row + .wdg-row {
    border-top: 1px solid rgba(52, 129, 229, 0.1);
    border-top-left-radius: 0; border-top-right-radius: 0;
}
.wdg-row:hover { background: rgba(52, 129, 229, 0.08); color: var(--rz-primary); }
.wdg-row-icon {
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 38px; height: 38px; border-radius: 11px;
    background: linear-gradient(145deg, rgba(52, 129, 229, 0.08) 0%, rgba(188, 216, 255, 0.2) 100%);
    border: 1px solid rgba(52, 129, 229, 0.12);
}
.wdg-row-icon img { width: 26px; height: 26px; object-fit: contain; }
.wdg-row-icon .msr { font-size: 22px; color: var(--rz-primary); }
.wdg-row-title { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; line-height: 1.25; color: var(--rz-text-color); }
.wdg-row-arrow {
    display: flex; align-items: center; flex-shrink: 0; color: var(--rz-text-tertiary-color);
    opacity: 0; transition: opacity .15s ease, transform .15s ease, color .15s ease;
}
.wdg-row-arrow .msr { font-size: 22px; }
.wdg-row:hover .wdg-row-arrow { color: var(--rz-primary); opacity: 1; transform: translateX(3px); }

/* ==========================================================================
   FLEX — Panel modo LIENZO (widgets posicionados)
   ========================================================================== */
.dash-canvas {
    position: relative;
    background-color: lightgray;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-radius: 6px;
    margin: 0 auto;
}
.widget {
    position: absolute;
    padding: 9px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.82) 0%, rgba(255, 255, 255, 0.62) 100%);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 24px;
    box-shadow:
        0 4px 24px -4px rgba(52, 129, 229, 0.12),
        0 2px 8px -2px rgba(0, 33, 93, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transition: box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s ease;
    cursor: pointer; overflow: hidden;
}
.widget:hover {
    box-shadow:
        0 10px 32px -4px rgba(52, 129, 229, 0.22),
        0 4px 16px -2px rgba(0, 33, 93, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
}
.widget-inner { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; height: 100%; text-align: center; }
.widget-inner.compact { flex-direction: row; justify-content: flex-start; gap: 8px; padding: 4px; }
.widget-title { font-family: "IBM Plex Sans", sans-serif; font-size: 16px; color: var(--rz-text-color); }
.widget-inner.compact .widget-title { font-size: 14px; }
.widget-icon { width: 52px; height: 52px; object-fit: contain; }
.widget-inner.compact .widget-icon { width: 32px; height: 32px; }
.widget-icon.msr { font-size: 46px; color: var(--rz-primary); width: auto; height: auto; }
.widget-inner.compact .widget-icon.msr { font-size: 30px; }
.widget-actions { display: flex; gap: 8px; }

/* Botones "Nuevo"/"Lista" tipo Radzen text */
.rz-btn {
    display: inline-flex; align-items: center; gap: 4px;
    border: 0; background: transparent; cursor: pointer;
    font: 500 13px 'Roboto', sans-serif; padding: 4px 8px; border-radius: 6px;
    transition: background .15s ease;
}
.rz-btn .msr { font-size: 18px; }
.rz-btn--success { color: var(--rz-success); }
.rz-btn--success:hover { background: rgba(62, 145, 8, 0.1); }
.rz-btn--secondary { color: var(--rz-text-secondary-color); }
.rz-btn--secondary:hover { background: var(--rz-base-200); }

/* ==========================================================================
   TOAST (aviso "Ready to go no disponible")
   ========================================================================== */
.toast-stack {
    position: fixed; top: 18px; right: 18px; z-index: 3000;
    display: flex; flex-direction: column; gap: 10px;
    max-width: min(92vw, 420px);
}
.toast {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 14px 16px; border-radius: 14px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(52, 129, 229, 0.22);
    box-shadow: 0 12px 32px -8px rgba(0, 33, 93, 0.28);
    animation: toast-in .22s cubic-bezier(0.4, 0, 0.2, 1);
}
.toast.leaving { animation: toast-out .2s ease forwards; }
.toast-icon {
    flex-shrink: 0; display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 10px;
    background: rgba(52, 129, 229, 0.12); color: var(--rz-primary);
}
.toast-icon .msr { font-size: 22px; }
.toast-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.toast-title { font-size: 14px; font-weight: 700; color: var(--rz-primary-darker); }
.toast-text { font-size: 13px; color: var(--rz-text-secondary-color); line-height: 1.35; }
@keyframes toast-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px); } }

/* ==========================================================================
   Aviso file:// (cuando se abre por doble-click sin servidor)
   ========================================================================== */
.fs-overlay {
    position: fixed; inset: 0; z-index: 5000;
    display: flex; align-items: center; justify-content: center; padding: 24px;
    background: linear-gradient(135deg, #F5F9FF 0%, #FFFFFF 45%, #E8F1FF 100%);
}
.fs-card {
    max-width: 560px; background: #fff; border-radius: 20px; padding: 36px 32px;
    border: 1px solid rgba(52, 129, 229, 0.18);
    box-shadow: 0 24px 60px -16px rgba(0, 33, 93, 0.28); text-align: center;
}
.fs-card h1 { font-family: "IBM Plex Sans", system-ui, sans-serif; font-weight: 600; letter-spacing: -0.02em; color: #00215d; font-size: 26px; margin: 12px 0 8px; }
.fs-card p { color: var(--rz-text-secondary-color); font-size: 15px; line-height: 1.5; margin: 0 0 18px; }
.fs-card code {
    display: inline-block; background: var(--rz-base-100); border: 1px solid var(--rz-base-200);
    border-radius: 8px; padding: 8px 14px; font-family: Consolas, monospace; font-size: 14px; color: var(--rz-primary-darker);
}
.fs-card .msr { font-size: 46px; color: var(--rz-primary); }

/* ─── Responsive ─── */
@media (max-width: 900px) {
    .ah-list { gap: 2px; }
    .ah-chip { padding: 0 8px; }
    .ah-chip span { display: none; }
    .ah-chip .msr { font-size: 23px; }
    .rz-sidebar { width: 260px; }
}
@media (max-width: 768px) {
    .flex-home { padding: 32px 18px 60px; }
    .flex-home-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
    .flex-canvas-surface { padding: 4px 14px 32px; }
}
@media (prefers-reduced-motion: reduce) {
    .flex-home-card, .flex-breadcrumb-home, .flex-sidebar-item, .widget { transition: none !important; }
}

/* ==========================================================================
   MODALES — réplica de DnzDialogLayout + DnzReportView + DnzFormView.
   Tokens copiados de DinaZen/src/wwwroot/dinazen-forms.css (sección 1).
   ========================================================================== */
:root {
    --dnz-input-height: 30px;
    --dnz-label-font-size: 11px;
    --dnz-input-font-size: 13px;
    --dnz-input-radius: 6px;
    --dnz-input-bg: #fff;
    --dnz-input-border: #dfe5ec;
    --dnz-label-color: #6b7280;
    --dnz-header-bg: #fff;
    --dnz-header-border: #eef1f5;
    --dnz-surface-raised: #f8fafb;
    --dnz-tab-content-bg: #f0f1f3;
    --dnz-modified-bg: #f0f9ff;
    --dnz-modified-border: #7dd3fc;
    --dnz-modified-dot: #0ea5e9;
    --dnz-error-bg: #fef2f2;
    --dnz-error-border: #fca5a5;
    --dnz-error-color: #dc2626;
    --dnz-focus-ring: 0 0 0 3px rgba(52, 129, 229, .15);
}

/* ── Overlay + caja ── */
.dnz-overlay {
    position: fixed; inset: 0; z-index: 4000;
    display: flex; align-items: center; justify-content: center; padding: 24px;
    background: rgba(11, 25, 48, 0.42);
    backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
    animation: dnz-fade .16s ease;
}
/* Nombre de keyframe distinto al de entrada: si se repite el nombre, el navegador
   no reinicia la animación y nunca llega el animationend que retira el overlay. */
.dnz-overlay.leaving { animation: dnz-fade-out .14s ease forwards; pointer-events: none; }

.dnz-modal {
    display: flex; flex-direction: column;
    width: min(1220px, 96vw); max-height: 90vh;
    background: var(--dnz-header-bg);
    border-radius: 14px; overflow: hidden;
    box-shadow: 0 30px 80px -20px rgba(0, 33, 93, .5), 0 2px 8px rgba(0, 33, 93, .12);
    animation: dnz-pop .18s cubic-bezier(0.4, 0, 0.2, 1);
}
.dnz-modal--form { width: min(1000px, 96vw); }
@keyframes dnz-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes dnz-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes dnz-pop { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }

/* ── Header ── */
.dnz-modal-header {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 16px; min-height: 56px;
    background: linear-gradient(135deg, var(--dnz-surface-raised) 0%, var(--dnz-header-bg) 100%);
    border-bottom: 1px solid var(--dnz-header-border);
    font-size: 14px; font-weight: 600; color: var(--rz-text-color);
}
.dnz-modal-header-icon {
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 34px; height: 34px; border-radius: 8px;
    background: linear-gradient(145deg, rgba(52, 129, 229, 0.08) 0%, rgba(188, 216, 255, 0.22) 100%);
    border: 1px solid rgba(52, 129, 229, 0.14);
}
.dnz-modal-header-icon .msr { font-size: 20px; color: var(--rz-primary); }
.dnz-modal-header-icon img { width: 22px; height: 22px; object-fit: contain; }
.dnz-modal-title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dnz-modal-toolbar { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-shrink: 0; }
.dnz-loadtime { font-size: 11.5px; color: var(--rz-text-tertiary-color); white-space: nowrap; }

/* ── Botones tipo Radzen ── */
.rzb {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 32px; padding: 0 12px; border: 0; border-radius: 6px; cursor: pointer;
    font: 500 13px 'Roboto', system-ui, sans-serif; letter-spacing: .01em; white-space: nowrap;
    transition: background .15s ease, box-shadow .15s ease, color .15s ease;
}
.rzb .msr { font-size: 18px; }
.rzb--icon { width: 32px; padding: 0; }
.rzb--primary { background: var(--rz-primary); color: #fff; box-shadow: 0 1px 2px rgba(0, 33, 93, .18); }
.rzb--primary:hover { background: #2f6fd0; }
.rzb--success { background: var(--rz-success); color: #fff; box-shadow: 0 1px 2px rgba(0, 33, 93, .18); }
.rzb--success:hover { background: #357c07; }
.rzb--success-out { background: transparent; color: var(--rz-success); box-shadow: inset 0 0 0 1px var(--rz-success); }
.rzb--success-out:hover { background: rgba(62, 145, 8, .08); }
.rzb--text { background: transparent; color: var(--rz-text-secondary-color); }
.rzb--text:hover { background: var(--rz-base-200); color: var(--rz-text-color); }
.rzb--danger-text { background: transparent; color: var(--rz-danger); }
.rzb--danger-text:hover { background: rgba(211, 81, 83, .1); }
.rzb--light { background: var(--rz-base-100); color: var(--rz-text-secondary-color); box-shadow: inset 0 0 0 1px var(--rz-base-300); }
.rzb--light:hover { background: var(--rz-base-200); }

/* ── Buscador (DnzSearchInput) ── */
.dnz-search { position: relative; display: inline-flex; align-items: center; }
.dnz-search .msr { position: absolute; left: 8px; font-size: 18px; color: var(--rz-text-disabled-color); pointer-events: none; }
.dnz-search input {
    height: 32px; width: 230px; max-width: 34vw;
    padding: 0 10px 0 30px; font-size: 13px;
    border: 1px solid var(--dnz-input-border); border-radius: var(--dnz-input-radius);
    background: var(--dnz-input-bg); color: var(--rz-text-color); outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.dnz-search input:focus { border-color: var(--rz-primary); box-shadow: var(--dnz-focus-ring); }

/* ── Cuerpo ── */
.dnz-modal-body { flex: 1; min-height: 0; overflow: auto; background: #fff; }
.dnz-modal-body--gris { background: var(--dnz-tab-content-bg); }

/* ── Footer ── */
.dnz-modal-footer {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 9px 14px; min-height: 52px;
    background: linear-gradient(135deg, var(--dnz-surface-raised) 0%, var(--dnz-header-bg) 100%);
    border-top: 1px solid var(--dnz-header-border);
}
.dnz-footer-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* ==========================================================================
   MODAL LISTA — DataGrid (DnzReportView)
   ========================================================================== */
.dnz-grid { width: 100%; border-collapse: collapse; font-size: 13px; }
.dnz-grid thead th {
    position: sticky; top: 0; z-index: 2;
    padding: 9px 10px; text-align: left; white-space: nowrap;
    font-size: 12px; font-weight: 600; color: var(--rz-text-color);
    background: #fff; border-bottom: 1px solid var(--rz-base-300);
    box-shadow: 0 1px 0 var(--rz-base-300);
}
.dnz-grid thead th.num { text-align: right; }
.dnz-th { display: inline-flex; align-items: center; gap: 6px; }
.dnz-th .msr { font-size: 15px; color: var(--rz-text-disabled-color); opacity: .7; cursor: pointer; }
.dnz-th .msr:hover { color: var(--rz-primary); opacity: 1; }
.dnz-grid tbody td {
    padding: 7px 10px; border-bottom: 1px solid var(--dnz-header-border);
    color: var(--rz-text-color); vertical-align: middle;
}
.dnz-grid tbody tr { cursor: pointer; transition: background .12s ease; }
.dnz-grid tbody tr:hover { background: rgba(52, 129, 229, 0.07); }
.dnz-grid tbody tr:nth-child(even) { background: rgba(243, 246, 249, .5); }
.dnz-grid tbody tr:nth-child(even):hover { background: rgba(52, 129, 229, 0.07); }
.dnz-grid .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dnz-grid .cod { font-family: 'Consolas', 'SF Mono', monospace; font-size: 12.5px; color: var(--rz-text-secondary-color); }
.dnz-grid .rel { color: var(--rz-primary); font-weight: 500; }
.dnz-grid .neg { color: var(--rz-danger); }
.dnz-grid tfoot td {
    position: sticky; bottom: 0;
    padding: 8px 10px; font-size: 12px; color: var(--rz-text-secondary-color);
    background: var(--dnz-surface-raised); border-top: 1px solid var(--rz-base-300);
}
.dnz-grid tfoot b { color: var(--rz-text-color); }
.dnz-grid-empty {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 56px 20px; color: var(--rz-text-tertiary-color); font-size: 14px;
}
.dnz-grid-empty .msr { font-size: 34px; opacity: .5; }

/* Badges de estado (DnzBadgetAutoColor) */
.dnz-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 9px; border-radius: 999px;
    font-size: 11.5px; font-weight: 600; line-height: 18px; white-space: nowrap;
}
.dnz-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.dnz-badge--ok { background: rgba(22, 163, 74, .12); color: #14803c; }
.dnz-badge--warn { background: rgba(245, 158, 11, .16); color: #9a6100; }
.dnz-badge--danger { background: rgba(220, 38, 38, .12); color: #c02626; }
.dnz-badge--info { background: rgba(52, 129, 229, .13); color: #1f5fb0; }
.dnz-badge--neutral { background: rgba(107, 114, 128, .13); color: #4b5563; }

/* Paginador */
.dnz-pager { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--rz-text-secondary-color); flex-wrap: wrap; }
.dnz-pager select {
    height: 30px; border: 1px solid var(--dnz-input-border); border-radius: var(--dnz-input-radius);
    background: #fff; font-size: 13px; padding: 0 6px; color: var(--rz-text-color);
}
.dnz-pager .rzb[disabled] { opacity: .4; pointer-events: none; }

/* ==========================================================================
   MODAL FORMULARIO — DnzFormView
   ========================================================================== */
.dnz-form-strip { height: 3px; flex-shrink: 0; }
.dnz-form-strip--nuevo { background: linear-gradient(90deg, var(--rz-success), rgba(62, 145, 8, .25)); }
.dnz-form-strip--editar { background: linear-gradient(90deg, var(--rz-primary), rgba(52, 129, 229, .25)); }

.dnz-chip-badge {
    display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px;
    font-size: 11px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
}
.dnz-chip-badge[hidden] { display: none; }   /* el display:inline-flex gana al [hidden] del navegador */
.dnz-chip-badge--nuevo { background: rgba(62, 145, 8, .14); color: #2f6d06; }
.dnz-chip-badge--editar { background: rgba(52, 129, 229, .14); color: #1f5fb0; }
.dnz-annot { display: inline-flex; align-items: center; gap: 3px; color: var(--rz-text-tertiary-color); font-size: 12px; font-weight: 500; padding: 3px 6px; border-radius: 6px; cursor: pointer; }
.dnz-annot:hover { background: var(--rz-base-200); color: var(--rz-text-color); }
.dnz-annot .msr { font-size: 17px; }

/* Pestañas */
.dnz-tabs { display: flex; gap: 2px; padding: 0 12px; background: #fff; border-bottom: 1px solid var(--dnz-header-border); overflow-x: auto; }
.dnz-tab {
    padding: 10px 14px; border: 0; background: transparent; cursor: pointer; white-space: nowrap;
    font: 500 13px 'Roboto', system-ui, sans-serif; color: var(--rz-text-secondary-color);
    border-bottom: 2px solid transparent; transition: color .15s ease, border-color .15s ease;
}
.dnz-tab:hover { color: var(--rz-text-color); background: rgba(52, 129, 229, .05); }
.dnz-tab.is-active { color: var(--rz-primary); border-bottom-color: var(--rz-primary); font-weight: 600; }

/* Rejilla de campos */
.dnz-form-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px 14px; padding: 18px; }
.dnz-form-pane[hidden] { display: none; }
.dnz-field { display: flex; flex-direction: column; gap: var(--dnz-label-gap, 3px); min-width: 0; }
/* :not(.dnz-check) para no pisar el label del checkbox, que va dentro del campo */
.dnz-field > label:not(.dnz-check) {
    font-size: var(--dnz-label-font-size); font-weight: 500; color: var(--dnz-label-color);
    letter-spacing: .02em; text-transform: uppercase; user-select: none;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dnz-field.req > label:not(.dnz-check)::after { content: '*'; color: var(--dnz-error-color); font-weight: 700; font-size: 13px; margin-left: 3px; }
.dnz-field.is-modified > label:not(.dnz-check) { color: #0369a1; }

.dnz-input {
    width: 100%; height: var(--dnz-input-height);
    padding: 0 10px; font: 400 var(--dnz-input-font-size) 'Roboto', system-ui, sans-serif;
    color: var(--rz-text-color); background: var(--dnz-input-bg);
    border: 1px solid var(--dnz-input-border); border-radius: var(--dnz-input-radius);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04); outline: none;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
select.dnz-input { padding: 0 6px; cursor: pointer; }
textarea.dnz-input { height: auto; padding: 8px 10px; line-height: 1.5; resize: vertical; }
.dnz-input:focus { border-color: var(--rz-primary); box-shadow: var(--dnz-focus-ring); }
.dnz-input::placeholder { color: var(--rz-text-disabled-color); }
.dnz-field.is-modified .dnz-input { background: var(--dnz-modified-bg); border-color: var(--dnz-modified-border); }
.dnz-field.is-error .dnz-input { background: var(--dnz-error-bg); border-color: var(--dnz-error-border); }
.dnz-field.is-error > label:not(.dnz-check) { color: var(--dnz-error-color); }
.dnz-help { font-size: 11px; color: var(--rz-text-tertiary-color); line-height: 1.35; }

/* Checkbox (DnzControl BOOL) */
.dnz-check { display: flex; align-items: center; gap: 8px; height: var(--dnz-input-height); }
.dnz-check input { width: 17px; height: 17px; accent-color: var(--rz-primary); cursor: pointer; }
.dnz-check span { font-size: 13px; color: var(--rz-text-color); }

/* Relación (DnzDropDown / DnzRowSelector) */
.dnz-rel { display: flex; gap: 4px; }
.dnz-rel .dnz-input { flex: 1; min-width: 0; background: #fff; cursor: pointer; }
.dnz-rel .rzb { height: var(--dnz-input-height); width: var(--dnz-input-height); }

/* Moneda / sufijos */
.dnz-suffix { position: relative; display: flex; }
.dnz-suffix .dnz-input { padding-right: 30px; text-align: right; font-variant-numeric: tabular-nums; }
.dnz-suffix > span {
    position: absolute; right: 10px; top: 0; height: var(--dnz-input-height);
    display: flex; align-items: center; font-size: 12.5px; color: var(--rz-text-tertiary-color); pointer-events: none;
}
/* Sin flechitas: el numérico real va con ShowUpDown=false */
.dnz-suffix input[type="number"] { -moz-appearance: textfield; }
.dnz-suffix input[type="number"]::-webkit-outer-spin-button,
.dnz-suffix input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Tags (DnzTagListEditor) */
.dnz-tags {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    min-height: var(--dnz-input-height); padding: 4px 6px;
    background: #fff; border: 1px solid var(--dnz-input-border); border-radius: var(--dnz-input-radius);
}
.dnz-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 9px; border-radius: 999px; background: rgba(52, 129, 229, .12); color: #1f5fb0; font-size: 12px; font-weight: 500; }
.dnz-tag .msr { font-size: 15px; cursor: pointer; opacity: .6; }
.dnz-tag .msr:hover { opacity: 1; }
.dnz-tags input { flex: 1; min-width: 90px; border: 0; outline: none; font-size: 13px; background: transparent; height: 22px; }

/* Editor HTML (DnzHtmlEditor) */
.dnz-html { border: 1px solid var(--dnz-input-border); border-radius: var(--dnz-input-radius); overflow: hidden; background: #fff; }
.dnz-html-bar { display: flex; align-items: center; gap: 2px; padding: 4px 6px; background: var(--dnz-surface-raised); border-bottom: 1px solid var(--dnz-header-border); }
.dnz-html-bar .msr { font-size: 17px; color: var(--rz-text-secondary-color); padding: 4px; border-radius: 5px; cursor: pointer; }
.dnz-html-bar .msr:hover { background: var(--rz-base-200); color: var(--rz-text-color); }
.dnz-html-area { min-height: 110px; padding: 10px 12px; font-size: 13px; line-height: 1.55; outline: none; }
.dnz-html-area:empty::before { content: attr(data-placeholder); color: var(--rz-text-disabled-color); }

/* Archivos (DnzFileUploaderButton) */
.dnz-upload {
    display: flex; align-items: center; gap: 10px; padding: 12px 14px;
    border: 1px dashed rgba(52, 129, 229, .38); border-radius: 10px;
    background: rgba(52, 129, 229, .04); color: var(--rz-text-secondary-color); font-size: 13px; cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}
.dnz-upload:hover { background: rgba(52, 129, 229, .09); border-color: var(--rz-primary); }
.dnz-upload .msr { font-size: 22px; color: var(--rz-primary); }

/* Separador de bloque dentro del formulario */
.dnz-form-sep {
    grid-column: 1 / -1; display: flex; align-items: center; gap: 10px;
    margin: 4px 0 -4px; font-size: 11px; font-weight: 700; letter-spacing: .1em;
    text-transform: uppercase; color: var(--rz-primary-darker);
}
.dnz-form-sep::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(52, 129, 229, .28), transparent); }

/* Ficha de líneas (lista embebida tipo DnzFormPrimaryList) */
.dnz-lines { grid-column: 1 / -1; border: 1px solid var(--dnz-input-border); border-radius: 10px; overflow: hidden; background: #fff; }
.dnz-lines-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--dnz-surface-raised); border-bottom: 1px solid var(--dnz-header-border); font-size: 12px; font-weight: 600; color: var(--rz-text-secondary-color); text-transform: uppercase; letter-spacing: .04em; }
.dnz-lines-head .rzb { margin-left: auto; height: 26px; }
.dnz-lines .dnz-th .msr { display: none; }   /* la lista embebida no filtra */
.dnz-lines .dnz-grid tbody tr { cursor: default; }
.dnz-lines .dnz-grid tbody tr:hover { background: rgba(52, 129, 229, .05); }

@media (max-width: 820px) {
    .dnz-overlay { padding: 0; }
    .dnz-modal { width: 100vw; max-height: 100vh; height: 100vh; border-radius: 0; }
    .dnz-form-grid { grid-template-columns: repeat(4, 1fr); padding: 14px; }
    .dnz-search input { width: 150px; }
}
