/* FORMULARIOS Y CAMPOS BASE */
.form-group {
    margin-bottom: 15px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13px;
    color: #333333;
    transition: color 0.3s ease;
}

.label-obligatorio {
    color: #d9534f !important;
}

.label-obligatorio::after {
    content: " (Este campo es obligatorio)";
    color: #d9534f;
    font-size: 0.85em;
    font-weight: normal;
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 14px;
    outline: none;
    text-transform: uppercase;
    transition: border-color 0.3s ease;
    background-color: #fff;
    color: #333;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    border-color: #007bff;
}

.input-vacio {
    border-color: #d9534f !important;
}

/* BOTONES 3D MODERNOS */
.btn {
    padding: 10px 20px;
    background: linear-gradient(180deg, #1a88ff 0%, #0066cc 100%);
    color: white;
    border: 1px solid #0052a3;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    text-align: center;
    box-shadow: 0 4px 0 #004488, 0 0 12px rgba(0, 123, 255, 0.4);
    transform: translateY(0);
    transition: all 0.15s ease-in-out;
    user-select: none;
}

.btn:hover {
    background: linear-gradient(180deg, #3395ff 0%, #0073e6 100%);
    box-shadow: 0 5px 0 #004488, 0 0 18px rgba(0, 123, 255, 0.7);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #004488, 0 0 6px rgba(0, 123, 255, 0.5);
}

/* BOTÓN ACCIÓN AZUL MARINO (#161E4A) PARA NUEVA ORDEN Y NUEVO CLIENTE */
.btn-navy-action {
    background: linear-gradient(180deg, #242f6c 0%, #161e4a 100%) !important;
    border-color: #0e1433 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 0 #0b0f24, 0 6px 14px rgba(22, 30, 74, 0.45) !important;
    padding: 10px 20px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    user-select: none;
    transform: translateY(0);
    transition: all 0.15s ease-in-out;
}

.btn-navy-action:hover {
    background: linear-gradient(180deg, #2e3c87 0%, #1c275e 100%) !important;
    box-shadow: 0 5px 0 #0b0f24, 0 0 18px rgba(36, 47, 108, 0.75) !important;
    transform: translateY(-1px);
}

.btn-navy-action:active {
    transform: translateY(3px) !important;
    box-shadow: 0 1px 0 #0b0f24, 0 0 6px rgba(22, 30, 74, 0.5) !important;
}

.btn-navy-icon {
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 0 5px #38bdf8);
}

/* SUB-NAVEGACIÓN DE LOS 8 BOTONES DE ARCHIVOS MAESTROS (#DCEDCE) */
.archivos-subnav {
    display: flex;
    gap: 10px;
    margin-bottom: 22px;
    border-bottom: 2px solid #cbd5e1;
    padding-bottom: 14px;
    flex-wrap: wrap;
}

.archivos-tab-btn {
    width: 150px !important;
    min-width: 150px !important;
    max-width: 150px !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 8px !important;
    font-size: 11.5px !important;
    font-weight: 800 !important;
    color: #1c3d10 !important;
    background: #dcedce !important;
    background-color: #dcedce !important;
    background-image: linear-gradient(180deg, #eef7e6 0%, #dcedce 100%) !important;
    border: 1px solid #9dc48d !important;
    border-radius: 8px !important;
    box-shadow: 0 3px 0 #7ca86b, 0 2px 5px rgba(0, 0, 0, 0.08) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    cursor: pointer !important;
    user-select: none !important;
    text-align: center !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
    transform: translateY(0);
    transition: all 0.12s ease-in-out !important;
}

.archivos-tab-btn:hover {
    background: #e6f5db !important;
    background-color: #e6f5db !important;
    border-color: #8cb97c !important;
    box-shadow: 0 4px 0 #7ca86b, 0 4px 8px rgba(0, 0, 0, 0.12) !important;
    transform: translateY(-1px) !important;
    color: #0f2407 !important;
}

.archivos-tab-btn:active {
    transform: translateY(2px) !important;
    box-shadow: 0 1px 0 #7ca86b, 0 1px 2px rgba(0, 0, 0, 0.1) !important;
}

.archivos-tab-btn.active {
    background: linear-gradient(180deg, #bfe4ab 0%, #a9d991 100%) !important;
    color: #0d2605 !important;
    border-color: #659950 !important;
    box-shadow: 0 3px 0 #52803e, 0 0 10px rgba(124, 168, 107, 0.5) !important;
    transform: translateY(0);
}

/* BOTONES DE CREAR REGISTRO EN ARCHIVOS MAESTROS (#161E4A) */
.btn-crear-maestro {
    padding: 10px 18px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    background: linear-gradient(180deg, #242f6c 0%, #161e4a 100%) !important;
    border: 1px solid #0e1433 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 0 #0b0f24, 0 6px 14px rgba(22, 30, 74, 0.45) !important;
    cursor: pointer;
    user-select: none;
    transform: translateY(0);
    transition: all 0.15s ease-in-out;
}

.btn-crear-maestro:hover {
    background: linear-gradient(180deg, #2f3d8a 0%, #1c275e 100%) !important;
    box-shadow: 0 5px 0 #0b0f24, 0 0 18px rgba(22, 30, 74, 0.75) !important;
    transform: translateY(-1px);
}

.btn-crear-maestro:active {
    transform: translateY(3px) !important;
    box-shadow: 0 1px 0 #0b0f24, 0 0 6px rgba(22, 30, 74, 0.5) !important;
}

.btn-success {
    background: linear-gradient(180deg, #34d058 0%, #28a745 100%);
    border-color: #1e7e34;
    box-shadow: 0 4px 0 #19692c, 0 0 12px rgba(40, 167, 69, 0.45);
}
.btn-success:hover {
    background: linear-gradient(180deg, #44db67 0%, #2bb44a 100%);
    box-shadow: 0 5px 0 #19692c, 0 0 18px rgba(40, 167, 69, 0.75);
}
.btn-success:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #19692c, 0 0 6px rgba(40, 167, 69, 0.5);
}

.btn-danger {
    background: linear-gradient(180deg, #ef4d5d 0%, #dc3545 100%);
    border-color: #bd2130;
    box-shadow: 0 4px 0 #941724, 0 0 12px rgba(220, 53, 69, 0.45);
    padding: 6px 12px;
    font-size: 13px;
}
.btn-danger:hover {
    background: linear-gradient(180deg, #f75b6a 0%, #e04150 100%);
    box-shadow: 0 5px 0 #941724, 0 0 18px rgba(220, 53, 69, 0.75);
}
.btn-danger:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #941724, 0 0 6px rgba(220, 53, 69, 0.5);
}

.btn-warning {
    background: linear-gradient(180deg, #ffd338 0%, #ffc107 100%);
    border-color: #d39e00;
    color: #212529;
    box-shadow: 0 4px 0 #b38600, 0 0 12px rgba(255, 193, 7, 0.5);
    padding: 6px 12px;
    font-size: 13px;
}
.btn-warning:hover {
    background: linear-gradient(180deg, #ffdc52 0%, #ffc71a 100%);
    box-shadow: 0 5px 0 #b38600, 0 0 18px rgba(255, 193, 7, 0.8);
}
.btn-warning:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #b38600, 0 0 6px rgba(255, 193, 7, 0.5);
}

.btn-info {
    background: linear-gradient(180deg, #24c2db 0%, #17a2b8 100%);
    border-color: #117a8b;
    color: white;
    box-shadow: 0 4px 0 #0d5d6a, 0 0 12px rgba(23, 162, 184, 0.45);
    padding: 6px 12px;
    font-size: 13px;
}
.btn-info:hover {
    background: linear-gradient(180deg, #37cbe3 0%, #1ab1c9 100%);
    box-shadow: 0 5px 0 #0d5d6a, 0 0 18px rgba(23, 162, 184, 0.75);
}
.btn-info:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #0d5d6a, 0 0 6px rgba(23, 162, 184, 0.5);
}

.btn-wa {
    background: linear-gradient(180deg, #33e176 0%, #25d366 100%);
    border-color: #1aa64e;
    color: white;
    box-shadow: 0 4px 0 #14803c, 0 0 12px rgba(37, 211, 102, 0.5);
    padding: 6px 12px;
    font-size: 13px;
}
.btn-wa:hover {
    background: linear-gradient(180deg, #46e883 0%, #2ae06f 100%);
    box-shadow: 0 5px 0 #14803c, 0 0 18px rgba(37, 211, 102, 0.8);
}
.btn-wa:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #14803c, 0 0 6px rgba(37, 211, 102, 0.5);
}

.btn-pago {
    background: linear-gradient(180deg, #8755e3 0%, #6f42c1 100%);
    border-color: #532f94;
    color: white;
    box-shadow: 0 4px 0 #3e2172, 0 0 12px rgba(111, 66, 193, 0.5);
    padding: 6px 12px;
    font-size: 13px;
    font-weight: bold;
}
.btn-pago:hover {
    background: linear-gradient(180deg, #9464ee 0%, #7b4ecf 100%);
    box-shadow: 0 5px 0 #3e2172, 0 0 18px rgba(111, 66, 193, 0.8);
}
.btn-pago:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #3e2172, 0 0 6px rgba(111, 66, 193, 0.5);
}

/* BOTÓN DE IMPRESIÓN PERSONALIZADO (#1D4726) */
.btn-print {
    background: linear-gradient(180deg, #2a6336 0%, #1d4726 100%);
    border-color: #133019;
    color: white;
    box-shadow: 0 4px 0 #0e2212, 0 0 12px rgba(29, 71, 38, 0.5);
    padding: 6px 12px;
    font-size: 13px;
}
.btn-print:hover {
    background: linear-gradient(180deg, #377d46 0%, #23572e 100%);
    box-shadow: 0 5px 0 #0e2212, 0 0 18px rgba(29, 71, 38, 0.8);
}
.btn-print:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #0e2212, 0 0 6px rgba(29, 71, 38, 0.5);
}

/* BOTÓN DE EDITAR ORDEN PERSONALIZADO (#853E24) */
.btn-edit-orden {
    background: linear-gradient(180deg, #a74f2f 0%, #853e24 100%);
    border-color: #5d2b19;
    color: white;
    box-shadow: 0 4px 0 #462013, 0 0 12px rgba(133, 62, 36, 0.5);
    padding: 6px 12px;
    font-size: 13px;
}
.btn-edit-orden:hover {
    background: linear-gradient(180deg, #bd5a36 0%, #99482b 100%);
    box-shadow: 0 5px 0 #462013, 0 0 18px rgba(133, 62, 36, 0.8);
}
.btn-edit-orden:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #462013, 0 0 6px rgba(133, 62, 36, 0.5);
}

.btn-secondary {
    background: linear-gradient(180deg, #7e8790 0%, #6c757d 100%);
    border-color: #545b62;
    color: white;
    box-shadow: 0 4px 0 #3e444a, 0 0 10px rgba(108, 117, 125, 0.4);
}
.btn-secondary:hover {
    background: linear-gradient(180deg, #8a949d 0%, #768088 100%);
    box-shadow: 0 5px 0 #3e444a, 0 0 15px rgba(108, 117, 125, 0.6);
}
.btn-secondary:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #3e444a, 0 0 5px rgba(108, 117, 125, 0.4);
}

/* COLUMNA ACCIONES EN UNA SOLA FILA */
.acciones-btns-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
}

.btn-icon {
    width: 28px !important;
    height: 28px !important;
    padding: 0 !important;
    font-size: 13px !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 6px !important;
    margin: 0 !important;
    box-shadow: 0 2px 0 rgba(0,0,0,0.25), 0 0 6px rgba(0,0,0,0.15);
    cursor: pointer;
    vertical-align: middle;
    flex-shrink: 0;
    pointer-events: auto;
}
.btn-icon * {
    pointer-events: none;
}

.btn-icon:hover {
    box-shadow: 0 3px 0 rgba(0,0,0,0.25), 0 0 8px rgba(0,0,0,0.25);
    transform: translateY(-1px);
}
.btn-icon:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 rgba(0,0,0,0.25);
}

/* PATRÓN DE DESBLOQUEO PROPORCIONAL Y COMPACTO (110x110) */
.pattern-container {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background: #ffffff;
    padding: 3px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    width: 116px;
    height: 116px;
    margin: 0 auto;
    box-sizing: border-box;
}

.pattern-canvas-elem {
    width: 110px !important;
    height: 110px !important;
    display: block;
    cursor: crosshair;
    touch-action: none;
    background-color: #fafafa;
    border: 1px dashed #bbb;
    border-radius: 4px;
    box-sizing: content-box;
}

/* TABLAS */
table {
    width: 100%;
    background: white;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-top: 20px;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 12px;
    color: #333;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.fila-orden-clic {
    cursor: pointer;
    transition: background-color 0.18s ease;
}
.fila-orden-clic:hover {
    background-color: #f1f7ff !important;
}

/* BOTÓN DE ESTADO INTERACTIVO */
.status-badge-btn {
    width: 120px;
    height: 30px;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 8px;
    font-weight: 700;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.15;
    background-color: #6c757d;
    box-shadow: 0 3px 0 rgba(0,0,0,0.25), 0 2px 5px rgba(0, 0, 0, 0.15);
    user-select: none;
    letter-spacing: 0.2px;
    white-space: normal;
    word-break: break-word;
    box-sizing: border-box;
    border: none;
    cursor: pointer;
    transform: translateY(0);
    transition: all 0.15s ease-in-out;
}

.status-badge-btn:hover {
    filter: brightness(1.12);
    transform: translateY(-2px);
    box-shadow: 0 5px 0 rgba(0,0,0,0.25), 0 4px 10px rgba(0,0,0,0.2);
}

.status-badge-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 rgba(0,0,0,0.25);
}

/* KPIS */
.kpi-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.kpi-box {
    background: white;
    border-radius: 8px;
    padding: 15px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border-left: 5px solid #007bff;
}
.kpi-box h4 {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #666;
    text-transform: uppercase;
}
.kpi-box .kpi-num {
    font-size: 22px;
    font-weight: bold;
    color: #1e3c72;
}

/* DASHBOARD CARDS */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.card {
    padding: 16px 18px;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
    transform: translateY(0);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
                box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: visible;
}

.card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.14), 0 6px 12px rgba(0, 0, 0, 0.08);
    z-index: 100;
}

.card-icon {
    font-size: 24px;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 10px;
    flex-shrink: 0;
}

.card-content { flex: 1; }
/* TAMAÑOS FIJOS PARA EVITAR QUE LA TARJETA CAMBIE DE ALTURA Y MUEVA LA GRILLA */
.card-content h3 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 700;
    color: #ffffff !important;
    line-height: 1.2;
}
.card-content p {
    margin: 0;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.35;
    color: #ffffff !important;
}

/* SE ELIMINA EL CAMBIO DE FONT-SIZE EN HOVER PARA MANTENER LA HOJA ESTÁTICA */
.card:hover .card-content h3 {
    color: #ffffff !important;
}
.card:hover .card-content p {
    color: #ffffff !important;
}

/* TOOLTIPS */
.card-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.96);
    color: #ffffff;
    padding: 10px 14px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.35);
    z-index: 500;
    pointer-events: none;
    min-width: 230px;
    max-width: 290px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.2);
}

.card-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -6px;
    border-width: 6px;
    border-style: solid;
    border-color: rgba(15, 23, 42, 0.96) transparent transparent transparent;
}

.card:hover .card-tooltip {
    display: block;
    animation: fadeInTooltip 0.18s ease-in-out;
}

@keyframes fadeInTooltip {
    from { opacity: 0; transform: translate(-50%, 6px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.card-tooltip-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #38bdf8;
}

.card-tooltip-desc {
    font-size: 13px;
    color: #f1f5f9;
    line-height: 1.4;
    margin: 0;
}

.card-blue { background: linear-gradient(135deg, #1d8cf8 0%, #33bbf5 100%); }
.card-navy { background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%); }
.card-purple { background: linear-gradient(135deg, #7928ca 0%, #b800e6 100%); }
.card-orange { background: linear-gradient(135deg, #f57c00 0%, #ffb74d 100%); }
.card-green { background: linear-gradient(135deg, #0ba360 0%, #3cba92 100%); }
.card-ia { background: linear-gradient(135deg, #4f46e5 0%, #9333ea 100%); }

.panel-form {
    background: #fdfdfd;
    border: 1px solid #eee;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    color: #333;
}

/* BOTONES KPIS 3D INTERACTIVOS DEL PANEL PRINCIPAL */
.kpi-btn-3d {
    border: none;
    outline: none;
    border-radius: 10px;
    padding: 15px 18px;
    cursor: pointer;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 95px;
    color: #ffffff;
    user-select: none;
    transform: translateY(0);
    transition: all 0.15s ease-in-out;
}

.kpi-btn-3d:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
}

.kpi-btn-3d:active {
    transform: translateY(3px);
}

.kpi-btn-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.kpi-btn-3d .kpi-icon {
    font-size: 18px;
}

.kpi-btn-3d .kpi-num {
    font-size: 28px;
    font-weight: 900;
    line-height: 1;
    margin-top: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.25);
}

/* Color Amarillo (Pendientes) */
.kpi-btn-amarillo {
    background: linear-gradient(180deg, #ffc720 0%, #d99b00 100%);
    border: 1px solid #b38000;
    box-shadow: 0 5px 0 #8c6400, 0 6px 14px rgba(217, 155, 0, 0.4);
    color: #212529 !important;
}
.kpi-btn-amarillo.active {
    box-shadow: 0 2px 0 #8c6400, 0 0 16px rgba(255, 199, 32, 0.9);
    border: 2px solid #ffffff;
}

/* Color Celeste (En Reparación) */
.kpi-btn-celeste {
    background: linear-gradient(180deg, #1cbcd6 0%, #118193 100%);
    border: 1px solid #0c616e;
    box-shadow: 0 5px 0 #07434c, 0 6px 14px rgba(17, 129, 147, 0.45);
}
.kpi-btn-celeste.active {
    box-shadow: 0 2px 0 #07434c, 0 0 16px rgba(28, 188, 214, 0.9);
    border: 2px solid #ffffff;
}

/* Color Verde (Listos para Entregar) */
.kpi-btn-verde {
    background: linear-gradient(180deg, #30c953 0%, #1f8a37 100%);
    border: 1px solid #166427;
    box-shadow: 0 5px 0 #0e441a, 0 6px 14px rgba(31, 138, 55, 0.45);
}
.kpi-btn-verde.active {
    box-shadow: 0 2px 0 #0e441a, 0 0 16px rgba(48, 201, 83, 0.9);
    border: 2px solid #ffffff;
}

/* Color Rojo 3D (Atrasadas en Taller) */
.kpi-btn-rojo {
    background: linear-gradient(180deg, #f04858 0%, #b81b2a 100%);
    border: 1px solid #8e1420;
    box-shadow: 0 5px 0 #630c15, 0 6px 14px rgba(184, 27, 42, 0.45);
}
.kpi-btn-rojo.active {
    box-shadow: 0 2px 0 #630c15, 0 0 16px rgba(240, 72, 88, 0.9);
    border: 2px solid #ffffff;
}

/* ==========================================================================
   ESTRUCTURA DE BOTONES KPI PREMIUM & ELEGANTE
   ========================================================================== */
.kpi-container-elegante {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 25px;
}

.kpi-card-elegante {
    position: relative;
    border-radius: 14px;
    padding: 16px 18px;
    cursor: pointer;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 125px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.03);
    outline: none;
    user-select: none;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

/* Efecto de elevación al apoyar el mouse */
.kpi-card-elegante:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.09), 0 3px 6px rgba(0, 0, 0, 0.04);
}

.kpi-card-elegante:active {
    transform: translateY(1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

/* Encabezado interno */
.kpi-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kpi-badge-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.kpi-etiqueta-tag {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 3px 8px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
}

/* Cuerpo central: Título y Número */
.kpi-card-body {
    margin: 12px 0 8px 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.kpi-titulo-elegante {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    max-width: 130px;
}

.kpi-num-elegante {
    font-size: 34px;
    font-weight: 900;
    line-height: 1;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    letter-spacing: -0.5px;
}

/* Pie del botón */
.kpi-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    padding-top: 8px;
    border-top: 1px dashed rgba(0, 0, 0, 0.08);
    opacity: 0.85;
}

.kpi-arrow {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.kpi-card-elegante:hover .kpi-arrow {
    transform: translateX(4px);
}

/* -------------------------------------------------------------
   PALETA DE COLORES EJECUTIVA & GRADIENTES VISTOSOS
   ------------------------------------------------------------- */

/* 1. Ámbar Suave (Pendientes) */
.kpi-card-ambar {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #fde68a;
    color: #92400e;
}
.kpi-card-ambar .kpi-etiqueta-tag { color: #b45309; }
.kpi-card-ambar.active {
    border: 2px solid #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.22), 0 10px 24px rgba(217, 119, 6, 0.18);
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

/* 2. Cyan Tecnológico (En Reparación) */
.kpi-card-cyan {
    background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%);
    border-color: #99f6e4;
    color: #0f766e;
}
.kpi-card-cyan .kpi-etiqueta-tag { color: #0d9488; }
.kpi-card-cyan.active {
    border: 2px solid #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.22), 0 10px 24px rgba(13, 148, 136, 0.18);
    background: linear-gradient(135deg, #ccfbf1 0%, #99f6e4 100%);
}

/* 3. Esmeralda Ejecutivo (Listos) */
.kpi-card-esmeralda {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #bbf7d0;
    color: #166534;
}
.kpi-card-esmeralda .kpi-etiqueta-tag { color: #15803d; }
.kpi-card-esmeralda.active {
    border: 2px solid #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.22), 0 10px 24px rgba(22, 163, 74, 0.18);
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
}

/* 4. Carmesí Alerta (Atrasadas en Taller) */
.kpi-card-carmesi {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #fecaca;
    color: #991b1b;
}
.kpi-card-carmesi .kpi-etiqueta-tag { color: #b91c1c; }
.kpi-card-carmesi.active {
    border: 2px solid #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.22), 0 10px 24px rgba(220, 38, 38, 0.18);
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
}

/* ==========================================================================
   HOMOGENEIZACIÓN DE TAMAÑO COMPACTO PARA TODAS LAS GRILLAS DEL SISTEMA
   (Idéntico al formato de Equipos con Diagnóstico / Reparación Pendiente)
   ========================================================================== */
.tabla-responsive-container,
.tabla-contenedor-compacto {
    max-height: 280px !important;
    overflow-y: auto !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    background: #ffffff !important;
    margin-top: 15px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

/* Quitar margen superior extra de la tabla interna para que encaje perfecto */
.tabla-responsive-container table,
.tabla-contenedor-compacto table {
    margin-top: 0 !important;
    font-size: 12px !important;
    width: 100% !important;
}

/* Encabezado fijo y celdas compactas idénticas al panel de inicio */
.tabla-responsive-container th,
.tabla-contenedor-compacto th {
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    background: #f8fafc !important;
    padding: 8px 10px !important;
    font-size: 11.5px !important;
    color: #1e3c72 !important;
    border-bottom: 1px solid #cbd5e1 !important;
}

.tabla-responsive-container td,
.tabla-contenedor-compacto td {
    padding: 8px 10px !important;
    font-size: 12px !important;
    border-bottom: 1px solid #f1f5f9 !important;
}