:root {
    --mud-typography-default-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    --mud-typography-h1-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    --mud-typography-h2-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    --mud-typography-h3-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    --mud-typography-h4-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    --mud-typography-h5-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    --mud-typography-h6-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    --mud-typography-subtitle1-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    --mud-typography-subtitle2-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    --mud-typography-body1-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    --mud-typography-body2-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    --mud-typography-button-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    --mud-typography-caption-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    --mud-typography-overline-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

html, body {
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    margin: 0;
    padding: 0;
    background: #f4f6fa;
    color: #1f2937;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* ---------- Marco de la aplicación ---------- */

.app-barra {
    position: fixed;
    z-index: 1100;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1.25rem;
    box-sizing: border-box;
    background: #1b4f9c;
    color: #ffffff;
    box-shadow: 0 1px 4px rgba(15, 42, 92, 0.25);
}

.app-marca {
    color: #ffffff;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-decoration: none;
}

.app-barra-espacio {
    flex: 1;
}

.app-usuario {
    font-size: 0.85rem;
    opacity: 0.9;
}

.app-salir {
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 6px;
    padding: 0.35rem 0.7rem;
}

.app-salir:hover {
    background: rgba(255, 255, 255, 0.12);
}

.app-menu-boton {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
}

.app-menu-boton:hover {
    background: rgba(255, 255, 255, 0.12);
}

.app-menu {
    position: fixed;
    z-index: 1000;
    top: 64px;
    bottom: 0;
    left: 0;
    width: 260px;
    overflow-y: auto;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    box-sizing: border-box;
}

.app-menu-fondo {
    display: none;
}

.app-contenido {
    margin-left: 260px;
    padding: 1.5rem;
    padding-top: calc(64px + 1.5rem);
    box-sizing: border-box;
    min-height: 100vh;
}

.app-contenido-interior {
    max-width: 1600px;
    margin: 0 auto;
}

@media (max-width: 960px) {
    .app-menu-boton {
        display: inline-flex;
    }

    .app-menu {
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        box-shadow: 8px 0 24px rgba(15, 42, 92, 0.18);
    }

    body.menu-abierto .app-menu {
        transform: translateX(0);
    }

    .app-menu-fondo {
        display: none;
        position: fixed;
        z-index: 900;
        inset: 64px 0 0 0;
        background: rgba(15, 23, 42, 0.42);
    }

    body.menu-abierto .app-menu-fondo {
        display: block;
    }

    .app-contenido {
        margin-left: 0;
        padding: 1rem;
        padding-top: calc(64px + 1rem);
    }
}

@media (max-width: 600px) {
    .app-barra {
        padding: 0 0.75rem;
        gap: 0.4rem;
    }

    .app-marca {
        font-size: 1rem;
    }

    .app-usuario {
        display: none;
    }

    .app-salir {
        padding: 0.3rem 0.55rem;
    }
}

.app-menu-boton .mud-icon-root {
    fill: currentColor;
}


h1:focus {
    outline: none;
}

/* ---------- Páginas públicas (login, error, acceso denegado) ---------- */

.publico {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    box-sizing: border-box;
    background: linear-gradient(160deg, #0f2a5c 0%, #1b4f9c 55%, #2f7dc0 100%);
}

.publico-encabezado {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #ffffff;
    margin-bottom: 1.5rem;
}

.publico-marca {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.publico-subtitulo {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    opacity: 0.8;
}

.publico-contenido {
    width: 100%;
    max-width: 26rem;
}

.publico-pie {
    margin-top: 2rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
}

.tarjeta-auth {
    background: #ffffff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 18px 40px rgba(9, 30, 66, 0.28);
}

.tarjeta-auth-titulo {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
}

.tarjeta-auth-texto {
    font-size: 0.9rem;
    color: #4b5563;
    margin: 0 0 1.5rem;
    line-height: 1.5;
}

.campo-grupo {
    margin-bottom: 1.1rem;
}

.campo-etiqueta {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.35rem;
}

.campo {
    width: 100%;
    box-sizing: border-box;
    padding: 0.6rem 0.75rem;
    font-size: 0.95rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #111827;
}

.campo:focus {
    outline: none;
    border-color: #1b4f9c;
    box-shadow: 0 0 0 3px rgba(27, 79, 156, 0.18);
}

.campo-fila {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.campo-fila .campo-etiqueta {
    margin-bottom: 0;
    font-weight: 400;
    color: #4b5563;
}

.campo-checkbox {
    width: 1rem;
    height: 1rem;
}

.boton-primario,
.boton-secundario {
    display: inline-block;
    width: 100%;
    box-sizing: border-box;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
}

.boton-primario {
    background: #1b4f9c;
    color: #ffffff;
}

.boton-primario:hover {
    background: #163f7d;
}

.boton-secundario {
    background: transparent;
    color: #1b4f9c;
    border-color: #cbd5e1;
}

.boton-secundario:hover {
    background: #f1f5fb;
}

.acciones-formulario {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 1rem;
}

.alerta-error,
.alerta-info {
    border-radius: 8px;
    padding: 0.7rem 0.85rem;
    font-size: 0.875rem;
    margin-bottom: 1.1rem;
}

.alerta-error {
    background: #fdecec;
    border: 1px solid #f5b5b5;
    color: #8a1c1c;
}

.alerta-info {
    background: #eaf3fd;
    border: 1px solid #b9d7f7;
    color: #16406e;
}

.mensaje-validacion,
.validation-message {
    display: block;
    color: #b91c1c;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.texto-secundario {
    color: #6b7280;
    font-size: 0.85rem;
    word-break: break-all;
}

.cargando-pagina {
    padding: 3rem 0;
    text-align: center;
    color: #6b7280;
}

/* ---------- Catálogo ---------- */

.tarjeta-paquete {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.chips-etiquetas {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.6rem;
}

.precio-usd {
    margin-top: 0.75rem;
    font-weight: 700;
    color: #0f2a5c;
}

/* ---------- CRM ---------- */

.seccion-crm {
    display: block;
}

.linea-tiempo {
    margin-top: 1rem;
    padding-left: 1rem;
    border-left: 3px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.nota-texto {
    white-space: pre-wrap;
}

.texto-vencido {
    color: #b91c1c;
    font-weight: 600;
}

.kanban {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.kanban-columna {
    min-width: 235px;
    width: 235px;
    background: #eef2f7;
    border-radius: 10px;
    padding: 0.6rem;
    min-height: 220px;
}

.kanban-encabezado {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.kanban-tarjeta {
    background: #ffffff;
    border-radius: 8px;
    padding: 0.6rem;
    margin-bottom: 0.6rem;
    box-shadow: 0 1px 3px rgba(15, 42, 92, 0.12);
    cursor: grab;
}

.kanban-enlace {
    display: inline-block;
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: #1b4f9c;
    text-decoration: none;
}

.kanban-enlace:hover {
    text-decoration: underline;
}

.kanban-vacio {
    display: block;
    text-align: center;
    padding: 1rem 0;
}

.fila-agenda {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.25rem;
    border-bottom: 1px solid #edf0f5;
    flex-wrap: wrap;
}

.fila-agenda:last-child {
    border-bottom: none;
}

.agenda-hora {
    min-width: 3.2rem;
    font-weight: 600;
}

.agenda-detalle {
    flex: 1;
    min-width: 12rem;
}

.fila-vencida {
    background: #fff1f1;
    border-left: 4px solid #dc2626;
}

.campo-archivo {
    width: 100%;
}

/* ---------- POS y facturación ---------- */

.fila-extra {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.25rem 0;
}

.fila-resumen {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    font-size: 0.95rem;
}

.logo-preview {
    max-height: 70px;
    max-width: 220px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.35rem;
    background: #ffffff;
}

.comprobante-preview {
    width: 100%;
    height: 420px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
}

.whatsapp-qr {
    width: 240px;
    height: 240px;
    max-width: 100%;
    image-rendering: pixelated;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
}

.whatsapp-codigo {
    letter-spacing: 0.18em;
    font-variant-numeric: tabular-nums;
}

/* ---------- Error de Blazor ---------- */

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}
