/* ========================================
   KIRVIT - CSS Global Unificado
   Sistema de Monitoreo de Servicios Viales
   ======================================== */

/* ========================================
   1. RESET Y BASE
   ======================================== */

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

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #1e293b;
    background: #f8fafc;
}

a {
    color: #002855;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ========================================
   2. LAYOUT PRINCIPAL
   ======================================== */

.app-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #f8fafc;
}

.app-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.app-content {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    background: #f8fafc;
}

/* ========================================
   3. HEADER
   ======================================== */

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 1.25rem;
    background: #002855;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.header-brand {
    display: flex;
    align-items: center;
}

.header-logo {
    height: 28px;
    width: auto;
    filter: brightness(0) invert(1);
}

.header-title {
    flex: 1;
    text-align: center;
}

.header-title span {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    font-weight: 400;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-name {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.8rem;
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

/* ========================================
   4. SIDEBAR
   ======================================== */

.app-sidebar {
    width: 220px;
    background: white;
    border-right: 1px solid #e5e7eb;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-nav {
    list-style: none;
    margin: 0;
    padding: 0.75rem 0;
}

.sidebar-nav li {
    margin: 0;
    padding: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    margin: 2px 0.5rem;
    color: #4b5563;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 400;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.nav-link:hover {
    background: #f3f4f6;
    color: #1f2937;
    text-decoration: none;
}

.nav-link.active {
    background: #eff6ff;
    color: #002855;
    font-weight: 500;
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-icon svg {
    opacity: 0.6;
}

.nav-link:hover .nav-icon svg,
.nav-link.active .nav-icon svg {
    opacity: 1;
}

.nav-link.active .nav-icon svg {
    stroke: #002855;
}

.nav-text {
    flex: 1;
}

.nav-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 0.5rem 1rem;
}

/* ========================================
   5. LOGIN
   ======================================== */

.login-fondo {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.fondo-gradiente {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #f0f4f8 0%, #e8f0f8 50%, #dce8f4 100%);
    z-index: 0;
}

.fondo-formas {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
}

.forma {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.6;
    animation: flotar 20s ease-in-out infinite;
}

.forma-1 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, #BE1F24 0%, #e63946 100%);
    top: -15%;
    right: -10%;
    animation-delay: 0s;
    opacity: 0.3;
}

.forma-2 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #002855 0%, #1e6bb8 100%);
    bottom: -10%;
    left: -10%;
    animation-delay: -7s;
    opacity: 0.25;
}

.forma-3 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #BE1F24 0%, #ff6b6b 100%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
    opacity: 0.2;
}

@keyframes flotar {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(20px, 30px) scale(1.02); }
}

.login-glass {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 520px;
    margin: 1rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 20px 40px rgba(0, 40, 85, 0.12), 0 8px 16px rgba(0, 0, 0, 0.06);
    animation: aparecer 0.5s ease-out;
}

@keyframes aparecer {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.glass-contenido {
    padding: 2.5rem 2rem 2rem;
}

.glass-logo {
    display: block;
    width: 180px;
    max-width: 100%;
    margin: 0 auto 2rem;
}

.glass-contenido form {
    display: block;
    width: 100%;
}

.campo-grupo {
    display: block;
    width: 100%;
    margin-bottom: 1.5rem;
}

.campo-etiqueta {
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 0.5rem;
    display: block;
}

.campo-input {
    display: block;
    width: 100%;
    padding: 0.75rem 0;
    font-size: 1rem;
    color: #1e293b;
    background: transparent;
    border: none;
    border-bottom: 1.5px solid #cbd5e1;
    border-radius: 0;
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.campo-input::placeholder {
    color: #94a3b8;
}

.campo-input:hover {
    border-bottom-color: #94a3b8;
}

.campo-input:focus {
    border-bottom-color: #002855;
    border-bottom-width: 2px;
}

.codigo-contenedor {
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
    margin-top: 0.5rem;
}

.codigo-digito {
    width: 100%;
    max-width: 52px;
    height: 52px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    outline: none;
    transition: all 0.2s ease;
}

.codigo-digito::placeholder {
    color: #cbd5e1;
}

.codigo-digito:hover {
    border-color: #94a3b8;
}

.codigo-digito:focus {
    border-color: #002855;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 40, 85, 0.1);
}

.codigo-digito.lleno {
    border-color: #002855;
    background: #f0f7ff;
}

.campo-error {
    color: #BE1F24;
    font-size: 0.75rem;
    margin-top: 0.35rem;
    display: block;
}

.boton-acceder {
    width: 200px;
    margin: 1rem auto 0;
    padding: 0.875rem 2rem;
    background: #002855;
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
}

.boton-acceder:hover:not(:disabled) {
    background: #001d3d;
    transform: translateY(-1px);
}

.boton-acceder:active:not(:disabled) {
    transform: translateY(0);
}

.boton-acceder:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.boton-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: girar 0.8s linear infinite;
}

@keyframes girar {
    to { transform: rotate(360deg); }
}

.glass-enlace {
    display: block;
    text-align: center;
    margin-top: 1rem;
    color: #64748b;
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.2s ease;
}

.glass-enlace:hover {
    color: #002855;
    text-decoration: underline;
}

.copyright {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(0, 40, 85, 0.5);
    font-size: 0.8rem;
    z-index: 10;
}

/* ========================================
   6. DASHBOARD
   ======================================== */

.dashboard {
    max-width: 1400px;
    margin: 0 auto;
}

.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-titulo {
    font-size: 1.75rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 0.25rem;
}

.dashboard-subtitulo {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    position: relative;
}

.kpi-icono {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-icono-azul { background: #e0f2fe; color: #0284c7; }
.kpi-icono-verde { background: #dcfce7; color: #16a34a; }
.kpi-icono-morado { background: #f3e8ff; color: #9333ea; }
.kpi-icono-naranja { background: #ffedd5; color: #ea580c; }

.kpi-contenido {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.kpi-valor {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
}

.kpi-etiqueta {
    font-size: 0.85rem;
    color: #64748b;
}

.kpi-cambio {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.kpi-cambio-positivo { background: #dcfce7; color: #16a34a; }
.kpi-cambio-negativo { background: #fee2e2; color: #dc2626; }
.kpi-cambio-neutro { background: #f1f5f9; color: #64748b; }

.metricas-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.metrica-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.metrica-titulo {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

.estados-lista,
.servicios-lista,
.clientes-lista,
.financiero-lista {
    display: flex;
    flex-direction: column;
}

.estados-lista { gap: 0.75rem; }
.servicios-lista { gap: 0.5rem; }
.clientes-lista { gap: 0.75rem; }
.financiero-lista { gap: 0.75rem; }

.estado-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
}

.estado-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.estado-indicador {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.estado-ejecutado { background: #16a34a; }
.estado-rechazado { background: #dc2626; }
.estado-cotizacion { background: #0284c7; }
.estado-pendiente { background: #94a3b8; }

.estado-nombre {
    font-size: 0.875rem;
    color: #475569;
}

.estado-valores {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.estado-cantidad {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
}

.estado-porcentaje {
    font-size: 0.8rem;
    color: #64748b;
    background: #f1f5f9;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.tasa-conversion {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tasa-label {
    font-size: 0.85rem;
    color: #64748b;
}

.tasa-valor {
    font-size: 1.25rem;
    font-weight: 700;
    color: #002855;
}

.servicio-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
}

.servicio-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.servicio-codigo {
    font-size: 0.7rem;
    font-weight: 600;
    color: #002855;
    background: #e0f2fe;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.servicio-nombre {
    font-size: 0.85rem;
    color: #475569;
}

.servicio-cantidad {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.cliente-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.cliente-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #002855 0%, #003d7a 100%);
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cliente-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.cliente-nombre {
    font-size: 0.9rem;
    font-weight: 500;
    color: #1e293b;
}

.cliente-tipo {
    font-size: 0.75rem;
    color: #64748b;
}

.financiero-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.financiero-label {
    font-size: 0.875rem;
    color: #64748b;
}

.financiero-valor {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.financiero-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 0.5rem 0;
}

.financiero-destacado {
    background: #f0f7ff;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-top: 0.5rem;
}

.financiero-destacado .financiero-label {
    color: #002855;
    font-weight: 500;
}

.financiero-destacado .financiero-valor {
    color: #002855;
    font-size: 1.25rem;
}

/* ========================================
   7. SKELETON LOADING
   ======================================== */

.dashboard-skeleton {
    max-width: 1400px;
    margin: 0 auto;
}

.kpi-card-skeleton {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.skeleton-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

.skeleton-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.skeleton-line {
    height: 1rem;
    border-radius: 4px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

.skeleton-line.large {
    width: 60%;
    height: 1.75rem;
}

.skeleton-line.medium {
    width: 50%;
    height: 1.25rem;
}

.skeleton-line.small {
    width: 40%;
    height: 0.85rem;
}

.skeleton-line.mini {
    width: 30%;
    height: 0.75rem;
}

.grafica-card-skeleton {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.skeleton-chart {
    width: 100%;
    height: 200px;
    border-radius: 8px;
    margin-top: 1rem;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

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

.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 1rem;
    color: #991b1b;
    text-align: center;
    margin: 2rem auto;
    max-width: 600px;
}

/* ========================================
   8. BLAZOR UTILITIES
   ======================================== */

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
    font-size: 0.75rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

/* ========================================
   9. RESPONSIVE
   ======================================== */

@media (max-width: 1200px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .metricas-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-sidebar {
        position: fixed;
        left: -220px;
        top: 56px;
        height: calc(100vh - 56px);
        z-index: 50;
        transition: left 0.2s ease;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    }

    .app-sidebar.open {
        left: 0;
    }

    .header-title span {
        display: none;
    }

    .app-content {
        padding: 1rem;
    }

    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-titulo {
        font-size: 1.5rem;
    }

    .dashboard-skeleton {
        max-width: 1400px;
        margin: 0 auto;
    }

    .kpi-card-skeleton,
    .grafica-card-skeleton {
        width: 100%;
    }
}

    .kpi-valor {
        font-size: 1.5rem;
    }

    .servicio-nombre {
        font-size: 0.8rem;
    }
}

@media (max-width: 560px) {
    .login-glass {
        max-width: 95%;
    }

    .glass-contenido {
        padding: 2rem 1.5rem;
    }

    .glass-logo {
        width: 160px;
        margin-bottom: 1.5rem;
    }

    .codigo-digito {
        max-width: 44px;
        height: 44px;
        font-size: 1.25rem;
    }

    .boton-acceder {
        width: 180px;
    }

    .forma-1 { width: 300px; height: 300px; }
    .forma-2 { width: 250px; height: 250px; }
    .forma-3 { width: 200px; height: 200px; }
}

/* ========================================
   9. DASHBOARD GRÁFICAS
   ======================================== */

.graficas-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.grafica-card {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    grid-column: span 2;
}

.grafica-card-small {
    grid-column: span 1;
}

.grafica-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.grafica-titulo {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
}

.grafica-periodo {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* Dona Chart */
.dona-container {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto 1rem;
}

.dona-chart {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.dona-segmento {
    transition: opacity 0.2s ease;
}

.dona-segmento:hover {
    opacity: 0.8;
}

.dona-centro {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.dona-valor {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #002855;
}

.dona-label {
    display: block;
    font-size: 0.7rem;
    color: #64748b;
}

.dona-leyenda {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.leyenda-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #64748b;
}

.leyenda-color {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* Barras Chart */
.barras-container {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.barra-item {
    cursor: pointer;
    transition: transform 0.15s ease;
}

.barra-item:hover {
    transform: translateX(4px);
}

.barra-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.barra-codigo {
    font-size: 0.8rem;
    font-weight: 600;
    color: #002855;
}

.barra-valor {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
}

.barra-track {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.barra-fill {
    height: 100%;
    background: linear-gradient(90deg, #002855 0%, #0066cc 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Gauge Chart */
.gauge-container {
    position: relative;
    width: 100%;
    height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.gauge-chart {
    width: 120px;
    height: 70px;
}

.gauge-fill {
    transition: stroke-dashoffset 0.5s ease;
}

.gauge-valor {
    font-size: 1.5rem;
    font-weight: 700;
    color: #16a34a;
    margin-top: -0.5rem;
}

/* Sparkline Chart */
.sparkline-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.sparkline-chart {
    width: 100%;
    height: 50px;
}

.sparkline-info {
    text-align: center;
}

.sparkline-valor {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: #16a34a;
}

.sparkline-label {
    display: block;
    font-size: 0.7rem;
    color: #64748b;
}

/* Actividad Timeline */
.actividad-section {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.actividad-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.actividad-titulo {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
}

.btn-ver-todo {
    background: none;
    border: none;
    color: #002855;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background 0.15s ease;
}

.btn-ver-todo:hover {
    background: #eff6ff;
}

.actividad-timeline {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.timeline-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-radius: 8px;
    min-width: 220px;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.15s ease;
    border-left: 3px solid #94a3b8;
}

.timeline-item:hover {
    background: #f1f5f9;
    transform: translateY(-2px);
}

.timeline-item.cotizacion {
    border-left-color: #0284c7;
}

.timeline-item.servicio {
    border-left-color: #16a34a;
}

.timeline-item.programacion {
    border-left-color: #eab308;
}

.timeline-icono {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    flex-shrink: 0;
}

.timeline-item.cotizacion .timeline-icono {
    color: #0284c7;
}

.timeline-item.servicio .timeline-icono {
    color: #16a34a;
}

.timeline-item.programacion .timeline-icono {
    color: #eab308;
}

.timeline-contenido {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.timeline-titulo {
    font-size: 0.8rem;
    font-weight: 500;
    color: #1e293b;
}

.timeline-tiempo {
    font-size: 0.7rem;
    color: #94a3b8;
}

/* KPI Cards interactivos */
.kpi-card {
    cursor: pointer;
    transition: all 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Responsive Gráficas */
@media (max-width: 1200px) {
    .graficas-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .grafica-card-small {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .graficas-grid {
        grid-template-columns: 1fr;
    }
    
    .grafica-card,
    .grafica-card-small {
        grid-column: span 1;
    }
    
    .actividad-timeline {
        flex-direction: column;
    }
    
    .timeline-item {
        min-width: 100%;
    }
}

/* ========================================
   10. PÁGINAS CRUD
   ======================================== */

/* Page Container */
.page-container {
    max-width: 1400px;
    margin: 0 auto;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

/* Filters Bar */
.filters-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.filters-bar .form-group {
    margin-bottom: 0;
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: #002855;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-primary:hover:not(:disabled) {
    background: #001d3d;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 40, 85, 0.2);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-secondary:hover:not(:disabled) {
    background: #e2e8f0;
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-danger:hover:not(:disabled) {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 38, 38, 0.2);
}

.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-icon:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #002855;
}

.btn-icon.btn-danger:hover {
    background: #fee2e2;
    border-color: #fecaca;
    color: #dc2626;
}

.btn-icon.btn-warning {
    border-color: #fbbf24;
    color: #f59e0b;
}

.btn-icon.btn-warning:hover {
    background: #fef3c7;
    border-color: #fbbf24;
    color: #f59e0b;
}

.btn-icon.btn-success {
    border-color: #4ade80;
    color: #22c55e;
}

.btn-icon.btn-success:hover {
    background: #dcfce7;
    border-color: #4ade80;
    color: #16a34a;
}

/* Inline Action Buttons (Cotizaciones) */
.btn-action-success {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid #22c55e;
    background: #f0fdf4;
    color: #16a34a;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-action-success:hover {
    background: #22c55e;
    color: white;
}

.btn-action-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid #ef4444;
    background: #fef2f2;
    color: #dc2626;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-action-danger:hover {
    background: #ef4444;
    color: white;
}

/* Loading State */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    gap: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top-color: #002855;
    border-radius: 50%;
    animation: girar 0.8s linear infinite;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: girar 0.8s linear infinite;
    flex-shrink: 0;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

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

.skeleton-table {
    width: 100%;
    border-collapse: collapse;
}

.skeleton-table thead th {
    padding: 0.75rem 1rem;
    text-align: left;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

.skeleton-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
}

.skeleton-table tbody td {
    padding: 1rem;
}

.skeleton-row {
    height: 20px;
    margin: 4px 0;
}

.skeleton-badge {
    width: 60px;
    height: 24px;
    border-radius: 12px;
}

.skeleton-actions {
    display: flex;
    gap: 0.5rem;
}

.skeleton-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 12px;
    border: 2px dashed #e2e8f0;
}

.empty-state svg {
    color: #cbd5e1;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #475569;
    margin: 0 0 0.5rem;
}

.empty-state p {
    font-size: 0.875rem;
    color: #94a3b8;
    margin: 0 0 1.5rem;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: visible;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table thead {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.data-table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #475569;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s ease;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

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

.data-table td {
    padding: 1rem;
    color: #1e293b;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-primary {
    background: #dbeafe;
    color: #1e3a8a;
}

.badge-secondary {
    background: #f1f5f9;
    color: #475569;
}

.badge-purple {
    background: #f3e8ff;
    color: #6b21a8;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-small {
    max-width: 400px;
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.btn-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.btn-close:hover {
    background: #f1f5f9;
    color: #475569;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    color: #1e293b;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    outline: none;
    transition: all 0.15s ease;
    box-sizing: border-box;
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
    border-color: #94a3b8;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: #002855;
    box-shadow: 0 0 0 3px rgba(0, 40, 85, 0.1);
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
    background: #f1f5f9;
    cursor: not-allowed;
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.text-warning {
    color: #92400e;
    font-size: 0.875rem;
}

/* Utilities */
.mt-3 {
    margin-top: 1rem;
}

.text-warning {
    color: #f59e0b;
    font-size: 0.875rem;
}

/* Modal Sizes */
.modal-small {
    max-width: 500px;
}

.modal-large {
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
}

/* Spinner Small */
.spinner-small {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

/* Responsive Tables */
@media (max-width: 768px) {
    .table-container {
        overflow-x: auto;
    }

    .data-table {
        min-width: 600px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        max-width: 95vw;
        max-height: 95vh;
    }

    .modal-large {
        max-width: 95vw;
    }
}

/* ========================================
   DISPOSITIVOS - Estilos Específicos
   ======================================== */

/* Filtros */
.filters-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Full width para form groups */
.form-group.full-width {
    grid-column: 1 / -1;
}

/* Botones de cambio de estado */
.estado-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.btn-estado {
    width: 100%;
    padding: 0.875rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 500;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-estado:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-estado-disponible {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}

.btn-estado-disponible:hover {
    background: #bbf7d0;
    border-color: #4ade80;
}

.btn-estado-operativo {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}

.btn-estado-operativo:hover {
    background: #fde68a;
    border-color: #fbbf24;
}

.btn-estado-configurado {
    background: #dbeafe;
    color: #1e40af;
    border-color: #93c5fd;
}

.btn-estado-configurado:hover {
    background: #bfdbfe;
    border-color: #60a5fa;
}

/* ========================================
   PRESTACIONES - Estilos Especificos
   ======================================== */

/* Modal Tabs */
.modal-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.modal-tab {
    padding: 0.75rem 1.25rem;
    background: none;
    border: none;
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
}

.modal-tab:hover {
    color: #1e293b;
    background: #f8fafc;
}

.modal-tab.active {
    color: #002855;
    border-bottom-color: #002855;
}

/* Modal Section */
.modal-section {
    animation: fadeIn 0.2s ease;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}

/* Evidencias Grid */
.evidencias-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.evidencia-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: all 0.15s ease;
}

.evidencia-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.evidencia-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #e2e8f0;
}

.evidencia-icon.foto {
    color: #0284c7;
    background: #e0f2fe;
    border-color: #bae6fd;
}

.evidencia-icon.video {
    color: #9333ea;
    background: #f3e8ff;
    border-color: #e9d5ff;
}

.evidencia-icon.documento {
    color: #ea580c;
    background: #ffedd5;
    border-color: #fed7aa;
}

.evidencia-info {
    flex: 1;
}

.evidencia-nombre {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1e293b;
    margin: 0 0 0.25rem;
    word-break: break-word;
}

.evidencia-meta {
    font-size: 0.75rem;
    color: #64748b;
}

.evidencia-actions {
    display: flex;
    gap: 0.5rem;
}

/* Rating Stars */
.rating-container {
    display: flex;
    gap: 0.25rem;
}

.rating-star {
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: transform 0.15s ease;
}

.rating-star:hover {
    transform: scale(1.1);
}

.rating-star svg {
    width: 100%;
    height: 100%;
    color: #cbd5e1;
    transition: color 0.15s ease;
}

.rating-star.active svg,
.rating-star:hover svg {
    color: #fbbf24;
    fill: #fbbf24;
}

/* Info Card */
.info-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 0.8rem;
    color: #64748b;
}

.info-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1e293b;
}

/* Action Bar */
.action-bar {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
}

.btn-action-primary {
    background: #002855;
    color: white;
}

.btn-action-primary:hover:not(:disabled) {
    background: #001d3d;
}

.btn-action-success {
    background: #16a34a;
    color: white;
}

.btn-action-success:hover:not(:disabled) {
    background: #15803d;
}

.btn-action-warning {
    background: #f59e0b;
    color: white;
}

.btn-action-warning:hover:not(:disabled) {
    background: #d97706;
}

.btn-action-info {
    background: #0284c7;
    color: white;
}

.btn-action-info:hover:not(:disabled) {
    background: #0369a1;
}

.btn-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Sub-modal for adding items */
.sub-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    padding: 1rem;
}

.sub-modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.2s ease;
}

/* File Upload */
.file-upload {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.file-upload:hover {
    border-color: #002855;
    background: #f8fafc;
}

.file-upload.dragover {
    border-color: #002855;
    background: #eff6ff;
}

.file-upload-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    color: #94a3b8;
}

.file-upload-text {
    font-size: 0.875rem;
    color: #64748b;
}

.file-upload-text strong {
    color: #002855;
}

.file-selected {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 6px;
    margin-top: 1rem;
}

.file-selected-icon {
    width: 32px;
    height: 32px;
    color: #16a34a;
}

.file-selected-info {
    flex: 1;
}

.file-selected-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1e293b;
}

.file-selected-size {
    font-size: 0.75rem;
    color: #64748b;
}

/* Utilities */
.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: #64748b;
}

.d-flex {
    display: flex;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 1rem;
}

.align-items-center {
    align-items: center;
}

.justify-content-between {
    justify-content: space-between;
}

/* Form Full Width */
.form-group-full {
    grid-column: 1 / -1;
}

/* Modal Extra Large */
.modal-xl {
    max-width: 1000px;
}

.modal-xlarge {
    max-width: 1100px;
}

/* ========================================
   COTIZACIONES - Estilos Especificos
   ======================================== */

/* Filtros Cotizaciones */
.filtros-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
    align-items: flex-end;
}

.filtro-grupo {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 150px;
}

.filtro-grupo label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filtro-grupo .form-input {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

/* Dropdown Menu */
.dropdown-container {
    position: relative;
    z-index: 51;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 160px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border: 1px solid #e2e8f0;
    z-index: 100;
    animation: fadeIn 0.15s ease;
    overflow: hidden;
}

.dropdown-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: transparent;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: none;
    border: none;
    font-size: 0.8125rem;
    color: #475569;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
}

.dropdown-item:hover {
    background: #f8fafc;
    color: #1e293b;
}

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

/* Form Sections */
.form-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 1rem;
}

.form-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.form-section-header .form-section-title {
    margin: 0;
}

/* Form Grid Variations */
.form-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.form-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* Items Table */
.items-table {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.items-table thead {
    background: #f8fafc;
}

.items-table th {
    padding: 0.625rem 0.75rem;
    font-size: 0.75rem;
}

.items-table td {
    padding: 0.5rem 0.75rem;
    vertical-align: middle;
}

.items-table .form-input {
    padding: 0.5rem;
    font-size: 0.8125rem;
}

.items-table tfoot {
    background: #f8fafc;
    border-top: 2px solid #e2e8f0;
}

.items-table tfoot td {
    padding: 0.75rem;
}

.text-right {
    text-align: right;
}

/* Empty Items */
.empty-items {
    padding: 2rem;
    text-align: center;
    background: #f8fafc;
    border: 2px dashed #e2e8f0;
    border-radius: 8px;
}

.empty-items p {
    margin: 0;
    color: #64748b;
    font-size: 0.875rem;
}

/* Totales Container */
.totales-container {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-top: 1.5rem;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    color: #475569;
}

.total-row.descuento {
    color: #dc2626;
}

.total-row.total-final {
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    border-top: 2px solid #e2e8f0;
    font-size: 1.125rem;
    font-weight: 700;
    color: #002855;
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* Responsive Cotizaciones */
@media (max-width: 768px) {
    .filtros-container {
        flex-direction: column;
        align-items: stretch;
    }

    .filtro-grupo {
        min-width: 100%;
    }

    .form-grid-2,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }

    .modal-xlarge {
        max-width: 95vw;
    }

    .items-table {
        font-size: 0.75rem;
    }

    .items-table th,
    .items-table td {
        padding: 0.5rem;
    }
}

/* ========================================
   LIQUIDACIONES - Estilos Especificos
   ======================================== */

/* Section Card */
.section-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.section-card:last-child {
    margin-bottom: 0;
}

.section-card .section-title {
    margin-top: 0;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-item .info-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-item .info-value {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #1e293b;
}

.info-item .info-value.highlight {
    font-size: 1.125rem;
    font-weight: 700;
    color: #002855;
}

/* Highlight Boxes */
.highlight-box {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.75rem;
}

.success-box {
    background: #dcfce7;
    border-color: #86efac;
}

.success-box .info-value {
    color: #166534;
}

.danger-box {
    background: #fee2e2;
    border-color: #fca5a5;
}

.danger-box .info-value {
    color: #991b1b;
}

/* Pago Status */
.pago-status {
    margin-top: 0.5rem;
}

/* Form Inline */
.form-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    padding: 1rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.form-inline .form-group {
    flex: 1;
    min-width: 150px;
}

.form-inline .form-actions {
    margin-top: 0;
}

/* Form Input Small */
.form-input-small {
    width: 100px;
    padding: 0.375rem 0.5rem;
    font-size: 0.8125rem;
}

/* Text Utilities */
.text-success {
    color: #16a34a;
}

.text-danger {
    color: #dc2626;
}

/* Table Total Row */
.data-table tfoot .total-row td {
    background: #f8fafc;
    font-weight: 600;
    border-top: 2px solid #e2e8f0;
}

/* Button Info */
.btn-icon.btn-info {
    border-color: #60a5fa;
    color: #2563eb;
}

.btn-icon.btn-info:hover {
    background: #dbeafe;
    border-color: #3b82f6;
    color: #1d4ed8;
}

/* Button Danger in icon */
.btn-icon.btn-danger {
    border-color: #f87171;
    color: #dc2626;
}

.btn-icon.btn-danger:hover {
    background: #fee2e2;
    border-color: #ef4444;
    color: #b91c1c;
}

/* Responsive Liquidaciones */
@media (max-width: 992px) {
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .info-grid {
        grid-template-columns: 1fr;
    }

    .form-inline {
        flex-direction: column;
    }

    .form-inline .form-group {
        width: 100%;
    }
}

/* ========================================
   PROGRAMACION - Estilos Especificos
   ======================================== */

/* Vista Selector */
.vista-selector {
    display: flex;
    gap: 0.5rem;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 0.25rem;
}

.btn-vista {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-vista:hover {
    color: #1e293b;
}

.btn-vista.active {
    background: white;
    color: #002855;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Controles de Navegacion Mes */
.mes-selector {
    flex: 1;
    text-align: center;
}

.mes-actual {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    text-transform: capitalize;
}

.btn-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-nav:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #002855;
}

/* Calendario Container */
.calendario-container {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
}

.calendario-grid {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.calendario-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

.dia-semana {
    padding: 1rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Calendario - Layout por semanas (estilo Google Calendar) */
.calendario-cuerpo {
    display: flex;
    flex-direction: column;
}

.semana-fila {
    border-bottom: 1px solid #e2e8f0;
    min-height: 80px;
}

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

.semana-numeros {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.dia-celda {
    padding: 0.35rem 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s ease;
    border-right: 1px solid #f1f5f9;
}

.dia-celda:last-child {
    border-right: none;
}

.dia-celda:hover {
    background: #f8fafc;
}

.dia-celda.otro-mes {
    opacity: 0.4;
}

.dia-celda.otro-mes .celda-numero {
    color: #cbd5e1;
}

.dia-celda.hoy .celda-numero {
    background: #002855;
    color: white;
}

.dia-celda.seleccionado {
    background: #dbeafe;
}

.celda-numero {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #1e293b;
    border-radius: 50%;
}

/* Barras de servicios que abarcan múltiples días */
.semana-barras {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: min-content;
    padding: 2px 4px 8px;
    gap: 3px 0;
}

.servicio-barra {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
    transition: filter 0.15s ease;
}

.servicio-barra:hover {
    filter: brightness(0.85);
}

.servicio-barra.estado-programado {
    background: #94a3b8;
    color: white;
}

.servicio-barra.estado-ejecutando {
    background: #f59e0b;
    color: white;
}

.servicio-barra.estado-finalizado {
    background: #22c55e;
    color: white;
}

.servicio-barra.estado-cancelado {
    background: #ef4444;
    color: white;
}

.barra-texto {
    pointer-events: none;
}

.servicio-cliente {
    font-weight: 500;
}

.servicio-item.estado-programado {
    background: #f1f5f9;
    color: #475569;
    border-left: 2px solid #94a3b8;
}

.servicio-item.estado-confirmado {
    background: #dbeafe;
    color: #1e40af;
    border-left: 2px solid #3b82f6;
}

.servicio-item.estado-ejecutando {
    background: #fef3c7;
    color: #92400e;
    border-left: 2px solid #f59e0b;
}

.servicio-item.estado-finalizado {
    background: #dcfce7;
    color: #166534;
    border-left: 2px solid #22c55e;
}

/* Panel Lateral */
.panel-lateral {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    height: fit-content;
    max-height: calc(100vh - 250px);
    display: flex;
    flex-direction: column;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.panel-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    text-transform: capitalize;
}

.panel-body {
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
}

.servicios-lista {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.servicio-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.servicio-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.servicio-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.servicio-hora {
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
}

.servicio-card-body h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #002855;
    margin: 0 0 0.5rem;
}

.servicio-card-body p {
    font-size: 0.8125rem;
    color: #475569;
    margin: 0.25rem 0;
}

.servicio-card-body .servicio-cliente {
    font-weight: 500;
    color: #1e293b;
}

.servicio-ubicacion {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #64748b;
}

.empty-state-small {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    text-align: center;
}

.empty-state-small svg {
    color: #cbd5e1;
    margin-bottom: 0.75rem;
}

.empty-state-small p {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0;
}

/* Vista Lista */
.lista-container {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.resumen-mes {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.resumen-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-align: center;
}

.resumen-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.resumen-valor {
    font-size: 1.5rem;
    font-weight: 700;
    color: #002855;
}

/* Detalle Grid */
.detalle-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.detalle-seccion {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
}

.detalle-seccion h4 {
    margin: 0 0 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detalle-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.detalle-item:last-child {
    border-bottom: none;
}

.detalle-label {
    color: #64748b;
    font-size: 0.875rem;
}

.detalle-valor {
    font-weight: 500;
    color: #1e293b;
}

.recursos-asignados h4 {
    margin: 0 0 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
}

/* Responsive Programacion */
@media (max-width: 1200px) {
    .calendario-container {
        grid-template-columns: 1fr;
    }

    .panel-lateral {
        max-height: 500px;
    }

    .resumen-mes {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .calendario-celda {
        min-height: 80px;
        padding: 0.25rem;
    }

    .celda-numero {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
    }

    .celda-servicios .servicio-item {
        font-size: 0.65rem;
        padding: 0.15rem 0.35rem;
    }

    .detalle-grid {
        grid-template-columns: 1fr;
    }

    .resumen-mes {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        padding: 1rem;
    }

    .resumen-valor {
        font-size: 1.25rem;
    }

    .vista-selector {
        width: 100%;
    }

    .filtros-container {
        flex-wrap: wrap;
    }

    .mes-selector {
        order: -1;
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .mes-actual {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .calendario-celdas {
        font-size: 0.75rem;
    }

    .dia-semana {
        padding: 0.5rem;
        font-size: 0.65rem;
    }

    .calendario-celda {
        min-height: 60px;
    }

    .servicio-mas {
        display: none;
    }

    .resumen-mes {
        grid-template-columns: 1fr;
    }
}

/* ==================== REPORTES ==================== */

.report-filters {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.report-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.report-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.summary-card h3 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0 0 0.5rem 0;
}

.summary-card p {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

@media (max-width: 768px) {
    .report-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .report-actions {
        flex-direction: column;
    }

    .report-actions button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .report-summary {
        grid-template-columns: 1fr;
    }

    .summary-card h3 {
        font-size: 1.5rem;
    }
}

/* ==================== AUTH LOADING ==================== */

.auth-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: #002855;
}

.auth-loading-content {
    text-align: center;
}

.auth-loading-logo {
    height: 48px;
    margin-bottom: 24px;
}

.auth-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== LOGIN LAYOUT ==================== */

/* Layout de autenticación - sin navegación */
.login-layout {
    min-height: 100vh;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Ocultar errores de Blazor con estilo */
#blazor-error-ui {
    background: #BE1F24;
    color: white;
    padding: 1rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: none;
    text-align: center;
}

#blazor-error-ui .reload {
    color: white;
    text-decoration: underline;
    margin-left: 0.5rem;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

/* =============================================
   RECONNECT MODAL - KIRVIT
   Colores corporativos: Azul #002855, Rojo #BE1F24
   ============================================= */

/* Estados de visibilidad */
.components-reconnect-first-attempt-visible,
.components-reconnect-repeated-attempt-visible,
.components-reconnect-failed-visible,
.components-pause-visible,
.components-resume-failed-visible,
.components-reconnect-retrying-visible {
    display: none;
}

#components-reconnect-modal.components-reconnect-show .components-reconnect-first-attempt-visible,
#components-reconnect-modal.components-reconnect-paused .components-pause-visible,
#components-reconnect-modal.components-reconnect-resume-failed .components-resume-failed-visible,
#components-reconnect-modal.components-reconnect-retrying .components-reconnect-repeated-attempt-visible,
#components-reconnect-modal.components-reconnect-retrying .components-reconnect-retrying-visible,
#components-reconnect-modal.components-reconnect-failed .components-reconnect-failed-visible {
    display: block;
}

/* Modal principal */
#components-reconnect-modal {
    background: white;
    width: 100%;
    max-width: 380px;
    margin: 20vh auto;
    padding: 2.5rem 2rem;
    border: none;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    opacity: 0;
    animation: reconnect-fadeOut 0.3s ease-out both;
}

#components-reconnect-modal[open] {
    animation: reconnect-slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

#components-reconnect-modal::backdrop {
    background: linear-gradient(135deg, rgba(0, 40, 85, 0.8) 0%, rgba(0, 20, 50, 0.9) 100%);
    animation: reconnect-fadeIn 0.3s ease-out;
}

/* Contenedor del contenido */
.reconnect-modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
}

/* Logo */
.reconnect-logo {
    margin-bottom: 0.5rem;
}

.reconnect-logo img {
    height: 40px;
    width: auto;
}

/* Spinner animado */
.reconnect-animation {
    position: relative;
    width: 60px;
    height: 60px;
}

.reconnect-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid #e5e7eb;
    border-top-color: #002855;
    border-radius: 50%;
    animation: reconnect-spin 1s linear infinite;
}

/* Mensajes */
.reconnect-mensaje {
    margin: 0;
    font-size: 0.95rem;
    color: #374151;
    line-height: 1.6;
}

#components-seconds-to-next-attempt {
    font-weight: 600;
    color: #002855;
}

/* Botones */
.reconnect-boton {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #002855;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reconnect-boton:hover {
    background: #001a3d;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 40, 85, 0.3);
}

.reconnect-boton:active {
    transform: translateY(0);
}

.reconnect-boton svg {
    flex-shrink: 0;
}

/* Enlace de recargar */
.reconnect-enlace {
    color: #6b7280;
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.reconnect-enlace:hover {
    color: #002855;
    text-decoration: underline;
}

/* Animaciones */
@keyframes reconnect-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes reconnect-slideUp {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes reconnect-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes reconnect-fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Responsive */
@media (max-width: 480px) {
    #components-reconnect-modal {
        margin: 15vh 1rem;
        padding: 2rem 1.5rem;
    }
}

/* ==================== DEVICE REPORTS ==================== */
.reportes-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 60vh;
    overflow-y: auto;
}

.reporte-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
}

.reporte-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.reporte-header strong {
    color: #002855;
    font-size: 0.95rem;
}

.reporte-header span {
    color: #6b7280;
    font-size: 0.85rem;
}

.reporte-checklist {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
}

.checklist-item span {
    font-weight: bold;
    font-size: 1.1rem;
}

.item-ok {
    background: #ecfdf5;
    color: #047857;
}

.item-ok span {
    color: #10b981;
}

.item-error {
    background: #fef2f2;
    color: #dc2626;
}

.item-error span {
    color: #ef4444;
}

.reporte-observaciones {
    background: white;
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    border-left: 3px solid #002855;
    font-size: 0.9rem;
    color: #374151;
}

.reporte-observaciones strong {
    display: block;
    margin-bottom: 0.5rem;
    color: #002855;
}

.reporte-footer {
    display: flex;
    justify-content: flex-end;
}

.form-checklist {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.75rem;
    background: #f9fafb;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.form-check:hover {
    border-color: #002855;
    box-shadow: 0 1px 3px rgba(0, 40, 85, 0.1);
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-check-input:checked {
    background-color: #002855;
    border-color: #002855;
}

.form-check label {
    margin: 0;
    cursor: pointer;
    font-size: 0.9rem;
    color: #374151;
    user-select: none;
}
