input:disabled,
select:disabled,
textarea:disabled {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
    cursor: not-allowed;
    opacity: 1;
}

/* === Validación de formularios === */
.field-error {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    color: #b91c1c;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    animation: fadeInError 160ms ease-out;
}
.field-error i { font-size: 11px; }

[aria-invalid="true"] {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12) !important;
}
[aria-invalid="true"]:focus {
    border-color: #b91c1c !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.20) !important;
}

canvas[aria-invalid="true"] {
    outline: 2px solid #dc2626;
    outline-offset: 2px;
}

input[type="checkbox"][aria-invalid="true"] {
    outline: 2px solid #dc2626;
    outline-offset: 2px;
    box-shadow: none !important;
}
.check-required:has(input[aria-invalid="true"]) {
    color: #b91c1c;
    font-weight: 600;
}

.field-help {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 11px;
    line-height: 1.3;
}

@keyframes fadeInError {
    from { opacity: 0; transform: translateY(-2px); }
    to   { opacity: 1; transform: translateY(0); }
}


.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    margin-top: auto;
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 0;
}

.sidebar-brand__label {
    font-size: 10px;
    font-weight: 500;
    color: rgba(148, 163, 184, 0.55);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sidebar-brand__name {
    font-size: 12px;
    font-weight: 700;
    color: rgba(148, 163, 184, 0.75);
    letter-spacing: 0.03em;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s;
}

.sidebar-brand__name i {
    font-size: 11px;
    color: #3b82f6;
    opacity: 0.85;
}

.sidebar-brand:hover .sidebar-brand__name {
    color: rgba(203, 213, 225, 0.9);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: #cbd5e1;
    text-align: left;
    transition: all 0.2s;
    border-radius: 8px;
    margin: 4px 10px; /* Margen a los lados para que no choque */
    font-size: 14px;
    cursor: pointer;
    width: calc(100% - 20px); /* Ajuste de ancho compensando el margen */
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-item.active {
    background: #3b82f6; /* El azul vibrante del ejemplo */
    color: white;
}

.nav-item i {
    width: 24px;
    text-align: center;
    font-size: 1.1rem;
    color: inherit;
}


/* Ajustes para el avatar y detalles de usuario */
.sidebar-user {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
}

.user-details {
    display: flex;
    flex-direction: column;
}

#sidebarUserName {
    font-weight: 600;
    font-size: 14px;
    color: white;
}

#sidebarUserRol {
    font-size: 11px;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- REDISEÑO DEL NAVBAR (TOPBAR) --- */
#topBar {
    background: white;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 300;
    flex-shrink: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    height: 70px; /* Sincronizado con la altura del TopBar */
    min-height: 70px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    flex-shrink: 0;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.menu-toggle:hover {
    color: #334155;
    transform: scale(1.1);
    background: none;
    border: none;
    box-shadow: none;
}

.menu-toggle:focus {
    outline: none;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-info {
    display: flex;
    flex-direction: column;
    text-align: right;
    margin-right: 4px;
}

.info-label {
    font-size: 10px;
    color: #94a3b8;
    text-transform: none;
    line-height: 1;
    margin-bottom: 2px;
}

.info-value {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    line-height: 1;
}

/* Notificaciones Pro */
.notif-wrapper {
    position: relative;
}

.notif-btn {
    background: #f1f5f9; /* Círculo gris claro como el screen */
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    color: #475569;
    transition: all 0.2s;
}

.notif-btn:hover {
    background: #e2e8f0;
}

.notif-btn i {
    font-size: 18px;
}

.notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #dc2626; /* Rojo vibrante */
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

.notif-dropdown {
    position: absolute;
    top: 50px;
    right: 0;
    width: 320px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    z-index: 1000;
    overflow: hidden;
}

.notif-dropdown-header {
    padding: 14px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notif-dropdown-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Chip que muestra cuántas no leídas hay (junto al título "Notificaciones"). */
.notif-unread-count {
    background: var(--primary);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    line-height: 1;
}

/* Punto a la derecha de cada notificación no leída en la lista. */
.notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    flex-shrink: 0;
    margin-top: 6px;
}

.notif-list {
    max-height: 350px;
    overflow-y: auto;
}

.notif-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s;
    cursor: pointer;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.notif-item.notif-unread {
    background: #faf5ff;
    border-left: 3px solid var(--primary);
}

.notif-item:hover {
    background: #f1f5f9;
}

.notif-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notif-item i {
    width: 32px;
    height: 32px;
    background: #f5f3ff;
    color: #7c3aed;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.notif-item-body {
    flex: 1;
}

.notif-item-title {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 2px;
}

.notif-item-text {
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
}

.notif-item-time {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 4px;
}

/* User Pill */
.user-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    padding: 4px 4px 4px 16px;
    border-radius: 30px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.user-pill:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.user-role-badge {
    color: #6366f1;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-initials {
    width: 34px;
    height: 34px;
    background: #6366f1;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

/* --- MEJORA DE DASHBOARD CARDS (ADMINLTE STYLE) --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    position: relative;
    display: block;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    color: white !important;
    background: #17a2b8; /* Cyan por defecto */
    border: none !important;
    padding: 0 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    min-height: 140px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.stat-card .inner {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.stat-card .stat-value {
    font-size: 2.2rem;
    font-weight: 800;
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    color: white !important;
}

.stat-card .stat-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .icon {
    position: absolute;
    right: 15px;
    top: 15px;
    z-index: 0;
    font-size: 70px;
    color: rgba(0,0,0,0.15);
    transition: transform .3s linear;
}

.stat-card:hover .icon {
    transform: scale(1.1);
}

.stat-card .small-box-footer {
    background: rgba(0,0,0,0.1);
    color: rgba(255,255,255,0.8);
    display: block;
    padding: 3px 0;
    position: relative;
    text-align: center;
    text-decoration: none;
    z-index: 10;
    font-size: 13px;
    transition: background 0.2s;
}

.stat-card .small-box-footer:hover {
    background: rgba(0,0,0,0.15);
    color: #fff;
}

/* Colores específicos de las tarjetas */
.stat-card.blue { background: #17a2b8 !important; }
.stat-card.green { background: #28a745 !important; }
.stat-card.orange { background: #ffc107 !important; }
.stat-card.orange .stat-label, .stat-card.orange .stat-value { color: #1f2d3d !important; }
.stat-card.orange .icon { color: rgba(0,0,0,0.1); }
.stat-card.orange .small-box-footer { color: rgba(0,0,0,0.6); }
.stat-card.red { background: #dc3545 !important; }

/* Reemplazo de los estilos antiguos de stat-card */

/* Drawer / Modal Deslizable Profecional */
.modal.drawer {
    justify-content: flex-end;
    align-items: stretch;
    background-color: rgba(15, 23, 42, 0.4); /* Slate 900 con opacidad */
    backdrop-filter: blur(2px);
    padding: 0;
}

.modal.drawer .modal-content {
    width: 100%;
    max-width: 550px;
    height: 100vh;
    max-height: 100vh;
    margin: 0;
    border-radius: 5px 0 0 5px;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 25px -5px rgba(0, 0, 0, 0.1), -8px 0 10px -6px rgba(0, 0, 0, 0.1);
}

.modal.drawer.active .modal-content {
    transform: translateX(0);
}

.modal.drawer .modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--gray-100);
    background: white;
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal.drawer .close-btn {
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 18px;
}

.modal.drawer .close-btn:hover {
    background: #e2e8f0;
    color: var(--gray-800);
    transform: rotate(90deg);
}

.modal.drawer .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    background: #f8fafc; /* Slate 50 */
}

.modal.drawer .modal-footer {
    position: sticky;
    bottom: 0;
    background: white;
    padding: 20px 32px;
    border-top: 1px solid var(--gray-100);
    display: flex;
    gap: 16px;
    justify-content: flex-end;
    z-index: 10;
}

.modal.drawer .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.modal.drawer .form-group.full {
    grid-column: span 2;
}

.modal.drawer label {
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 6px;
    font-size: 13px;
}

.modal.drawer input, .modal.drawer select, .modal.drawer textarea {
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    width: 100%;
    transition: all 0.2s;
}

/* Sidebar Mini Support (Para el modo hamburguesa) */
#sidebar.mini {
    width: 70px;
}

#sidebar.mini .sidebar-header {
    justify-content: center;
    padding: 0;
}

#sidebar.mini .sidebar-logo-img {
    height: 30px;
}

#sidebar.mini .sidebar-user {
    padding: 16px 0;
    justify-content: center;
}

#sidebar.mini .user-details {
    display: none;
}

#sidebar.mini .nav-item {
    justify-content: center;
    padding: 12px 0;
    margin: 6px 10px;
    width: 50px; /* Tamaño fijo para que se vea como un botón cuadrado redondeado */
}

#sidebar.mini .nav-item span {
    display: none;
}

#sidebar.mini .nav-item i {
    font-size: 20px;
    margin: 0;
}

#sidebar.mini .sidebar-brand {
    padding: 6px 0;
}

#sidebar.mini .sidebar-brand__label {
    display: none;
}

#sidebar.mini .sidebar-brand__name span {
    display: none;
}

#sidebar.mini .sidebar-brand__name {
    font-size: 0;
}

#sidebar.mini .sidebar-brand__name i {
    font-size: 16px;
    opacity: 0.6;
}

#pageContent.mini-sidebar {
    margin-left: 70px;
    width: calc(100% - 70px);
}

@media (max-width: 900px) {
    #topBar {
        z-index: 300;
        position: sticky;
    }

    #sidebar {
        transform: translateX(-100%);
        z-index: 280;
        width: min(var(--sidebar-w, 240px), 85vw);
    }

    #sidebar.is-open,
    #sidebar.active {
        transform: translateX(0);
    }

    #sidebarOverlay {
        z-index: 270;
    }

    #pageContent {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .menu-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        position: relative;
        z-index: 301;
        min-width: 44px;
        min-height: 44px;
    }

    body.sidebar-mobile-open {
        overflow: hidden;
    }
}
.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 10px 0;
}

.bar-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bar-label {
    width: 120px;
    font-size: 12px;
    color: var(--gray-600);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bar-track {
    flex: 1;
    height: 24px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.bar-fill {
    height: 100%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    transition: width 0.6s ease-out;
    min-width: 2px;
}

.bar-fill span {
    color: white;
    font-size: 11px;
    font-weight: 600;
}

/* ── Progress chart (dashboard técnico) ─────────────────────────────────── */
.progress-chart-host {
    padding: 4px 0 8px;
}

.progress-chart__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.progress-chart__table thead th {
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-600);
    padding: 10px 12px;
    border-bottom: 2px solid #e9ecef;
    background: #f8fafc;
}

.progress-chart__table tbody tr {
    border-bottom: 1px solid #e9ecef;
}

.progress-chart__table tbody tr:last-child {
    border-bottom: none;
}

.progress-chart__label {
    padding: 12px;
    color: var(--gray-800);
    font-weight: 600;
    white-space: nowrap;
    width: 110px;
}

.progress-chart__bar-cell {
    padding: 12px 8px;
    width: 100%;
}

.progress-chart__track {
    height: 12px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress-chart__fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
    min-width: 0;
}

.progress-chart__value-cell {
    padding: 12px;
    text-align: center;
    width: 72px;
}

.progress-chart__badge {
    display: inline-block;
    min-width: 36px;
    padding: 4px 10px;
    border-radius: 4px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.chart-card--bordered {
    border: 1px solid #dee2e6;
    box-shadow: none;
}

.chart-card--bordered h3 {
    margin: 0;
    padding: 14px 16px;
    border-bottom: 1px solid #dee2e6;
    background: #fff;
    font-size: 15px;
}

.chart-card--bordered .progress-chart-host {
    padding: 8px 12px 12px;
}

.progress-chart__empty {
    color: #9ca3af;
    font-size: 13px;
    padding: 16px 12px;
    margin: 0;
}

.donut-chart-host {
    min-height: 280px;
    padding: 20px 24px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-card--bordered .donut-chart-host {
    padding: 18px 22px 22px;
}

.donut-chart {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px 40px;
    flex-wrap: wrap;
    width: 100%;
    max-width: 520px;
    min-height: 240px;
}

.donut-chart__visual {
    position: relative;
    flex: 1 1 220px;
    width: min(100%, 260px);
    max-width: 260px;
    aspect-ratio: 1;
}

.donut-chart__svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
}

.donut-chart__track {
    opacity: 1;
}

.donut-chart__ring {
    transition: stroke-dasharray 0.35s ease;
}

.donut-chart__center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    padding: 0 18%;
}

.donut-chart__total {
    font-size: 38px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
    letter-spacing: -0.02em;
}

.donut-chart__total-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 4px;
}

.donut-chart__legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    flex: 0 1 190px;
    min-width: 170px;
}

.donut-chart__legend-item {
    display: grid;
    grid-template-columns: 14px 1fr auto;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #334155;
    line-height: 1.3;
}

.donut-chart__dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px #fff;
}

.donut-chart__legend-label {
    font-weight: 500;
}

.donut-chart__legend-value {
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
}

.donut-chart__legend-value small {
    font-weight: 500;
    color: #94a3b8;
    font-size: 11px;
}

.donut-chart__empty {
    color: #9ca3af;
    font-size: 13px;
    padding: 16px 12px;
    margin: 0;
    text-align: center;
}

.charts-grid--tech {
    gap: 20px;
}

.charts-grid--tech .donut-chart-host {
    min-height: 300px;
}

.charts-grid--tech .donut-chart__visual {
    width: min(100%, 280px);
    max-width: 280px;
}

.charts-grid--tech .donut-chart__total {
    font-size: 42px;
}

@media (max-width: 900px) {
    .donut-chart {
        flex-direction: column;
        min-height: auto;
        gap: 20px;
    }

    .donut-chart__visual {
        width: min(100%, 240px);
        max-width: 240px;
    }

    .charts-grid--tech .donut-chart__visual {
        width: min(100%, 260px);
        max-width: 260px;
    }

    .donut-chart__legend {
        width: 100%;
        max-width: 280px;
    }
}

/* ── Data tables (User Directory style) ─────────────────────────────────── */
.data-table-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.data-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Acciones fijas en cualquier tabla dentro del scroll horizontal */
.data-table-scroll table th.col-acciones,
.data-table-scroll table td.col-acciones {
    position: sticky;
    right: 0;
    z-index: 2;
    background: #fff;
    box-shadow: -6px 0 10px -8px rgba(15, 23, 42, 0.18);
    white-space: nowrap;
    text-align: right;
    min-width: 96px;
}

.data-table-scroll table thead th.col-acciones {
    z-index: 3;
    background: #f8fafc;
}

.data-table-scroll table tbody tr:hover td.col-acciones {
    background: #f8fafc;
}

.data-table-footer {
    border-top: 1px solid #e9ecef;
    background: #fff;
    padding: 0 14px;
}

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

.data-table-card > .data-table-toolbar.orders-filters,
.data-table-card > #filtersOrdersContainer > .orders-filters {
    margin-bottom: 0;
    padding: 12px 14px;
    border-radius: 0;
    box-shadow: none;
    border: none;
    border-bottom: 1px solid #e2e8f0;
}

.data-table-card .data-table-body .data-table-footer,
.data-table-card > .data-table-body > .data-table-footer {
    padding: 0 14px;
}

.data-table-card .pg-footer {
    margin-top: 0;
    padding: 10px 0 12px;
    border-top: none;
}

.dt-col--hidden {
    display: none !important;
}

.data-table-card .ordenes-table {
    box-shadow: none;
    border-radius: 0;
}

/* Tablas: ancho según contenido; acciones fijas al scroll horizontal */
.data-table-card .ordenes-table.data-table {
    table-layout: auto;
    width: max-content;
    min-width: 100%;
}

.data-table-card .ordenes-table.data-table th {
    padding: 11px 14px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
    white-space: nowrap;
}

.data-table-card .ordenes-table.data-table td {
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

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

/* Columna de acciones pegada a la derecha */
.data-table-card .ordenes-table.data-table th.col-acciones,
.data-table-card .ordenes-table.data-table td.col-acciones {
    position: sticky;
    right: 0;
    z-index: 2;
    background: #fff;
    box-shadow: -6px 0 10px -8px rgba(15, 23, 42, 0.18);
    white-space: nowrap;
    text-align: right;
    min-width: 112px;
}

.data-table-card .ordenes-table.data-table thead th.col-acciones {
    z-index: 3;
    background: #f8fafc;
}

.data-table-card .ordenes-table.data-table tbody tr:hover td.col-acciones {
    background: #f8fafc;
}

.data-table-card .ordenes-table.data-table td.dt-col--cliente {
    min-width: 140px;
    max-width: 240px;
}

.data-table-card .ordenes-table.data-table td.dt-col--cliente .table-cell-text--2 {
    white-space: normal;
}

.data-table-card .ordenes-table.data-table td.dt-col--factura,
.data-table-card .ordenes-table.data-table th.dt-col--factura {
    max-width: none;
    overflow: visible;
    text-align: center;
}

.orden-factura-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    cursor: pointer;
}

.orden-factura-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    accent-color: #6d28d9;
}

.table-cell-text {
    display: block;
    min-width: 0;
    word-break: break-word;
}

.table-cell-text--1 {
    white-space: nowrap;
}

.table-cell-text--2 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.table-cell-text--strong {
    font-weight: 600;
    color: #1e293b;
}

.table-cell-text[title] {
    position: relative;
    cursor: help;
}

.table-cell-text[title]:hover::after {
    content: attr(title);
    position: absolute;
    left: 0;
    bottom: calc(100% + 8px);
    z-index: 300;
    min-width: 120px;
    max-width: min(360px, 80vw);
    padding: 8px 10px;
    background: #1e293b;
    color: #fff;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.45;
    white-space: normal;
    border-radius: 6px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.22);
    pointer-events: none;
    animation: tableCellTooltipIn 0.15s ease forwards;
}

.table-cell-text[title]:hover::before {
    content: '';
    position: absolute;
    left: 14px;
    bottom: calc(100% + 2px);
    z-index: 301;
    border: 6px solid transparent;
    border-top-color: #1e293b;
    pointer-events: none;
}

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

.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.user-cell__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-cell__name {
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
}

.user-cell__sub {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.3;
}

.user-cell__hint {
    color: #94a3b8;
    font-weight: 500;
}

.user-avatar {
    width: var(--avatar-size, 36px);
    height: var(--avatar-size, 36px);
    border-radius: 50%;
    background: var(--avatar-bg, #17a2b8);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: calc(var(--avatar-size, 36px) * 0.36);
    font-weight: 700;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.pill-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.pill-badge--info    { background: #dbeafe; color: #1d4ed8; }
.pill-badge--success { background: #dcfce7; color: #15803d; }
.pill-badge--warning { background: #fef3c7; color: #b45309; }
.pill-badge--danger  { background: #fee2e2; color: #b91c1c; }
.pill-badge--purple  { background: #ede9fe; color: #6d28d9; }
.pill-badge--slate   { background: #f1f5f9; color: #475569; }

.code-chip {
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.text-muted {
    color: #64748b;
    font-size: 13px;
}

.text-sm {
    font-size: 12px;
}

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

.text-nowrap {
    white-space: nowrap;
}

.input-select--compact {
    padding: 4px 28px 4px 8px;
    font-size: 12px;
    height: 32px;
    min-width: 120px;
}

.btn-table-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: none;
    background: none;
    color: var(--primary, #2563eb);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.btn-table-link:hover {
    text-decoration: underline;
    color: #1d4ed8;
}

.table-actions--stacked {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.modal--wide .modal-content--table {
    width: min(920px, 96vw);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
}

.modal-subtitle {
    margin: 4px 0 0;
    font-size: 13px;
    color: #64748b;
    font-weight: 400;
}

.modal-body--flush {
    padding: 0;
    overflow: auto;
}

.modal-footer--hint {
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px 20px;
    color: #64748b;
}

.modal-empty-hint,
.modal-error-hint {
    padding: 32px 24px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
}

.modal-error-hint {
    color: #dc2626;
}

.incidencia-orden-row {
    cursor: pointer;
    transition: background 0.15s ease;
}

.incidencia-orden-row:hover,
.incidencia-orden-row:focus {
    background: #f8fafc;
    outline: none;
}

.incidencia-orden-link {
    color: var(--primary, #2563eb);
}

.charts-grid .chart-card--bordered,
.dashboard-charts .chart-card--bordered {
    border: 1px solid #dee2e6;
    box-shadow: none;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
}

.charts-grid .chart-card--bordered h3,
.dashboard-charts .chart-card--bordered h3 {
    margin: 0;
    padding: 14px 16px;
    border-bottom: 1px solid #dee2e6;
    background: #fff;
    font-size: 15px;
    color: #334155;
}

.charts-grid .chart-card--bordered .progress-chart-host,
.dashboard-charts .chart-card--bordered .progress-chart-host {
    padding: 8px 12px 12px;
}

@media (max-width: 900px) {
    .progress-chart__label {
        width: 88px;
        font-size: 12px;
    }
}

/* Tags para categorías */
.tag-item {
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.tag-item:hover {
    border-color: var(--primary) !important;
    background: #f1f5f9 !important;
}

/* Repuestos Rows */
.repuesto-row {
    display: grid;
    grid-template-columns: 120px 1fr 80px 120px 1fr 40px;
    gap: 12px;
    margin-bottom: 12px;
    align-items: center;
    background: white;
    border-radius: 8px;
}
@media (max-width: 768px) {
    .repuesto-row {
        grid-template-columns: 1fr 1fr;
    }
}

.btn-remove-rep {
    background: #fee2e2;
    color: #ef4444;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-remove-rep:hover {
    background: #ef4444;
    color: white;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Action Buttons in Tables - RESTORED */
.btn-action-icon {
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    font-size: 14px !important;
    position: relative !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.btn-action-icon:hover {
    transform: translateY(-2px) !important;
    filter: brightness(0.9) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

.btn-action-icon:active {
    transform: translateY(0);
}

.btn-action-icon i {
    pointer-events: none;
}

/* Tipos de botones predefinidos */
.btn-edit-icon { background: #e0f2fe !important; color: #0369a1 !important; }
.btn-delete-icon { background: #fee2e2 !important; color: #b91c1c !important; }
.btn-success-icon { background: #dcfce7 !important; color: #15803d !important; }
.btn-view-icon { background: #f3f4f6 !important; color: #374151 !important; }
.btn-pdf-icon { background: #fff1f2 !important; color: #e11d48 !important; }
.btn-excel-icon { background: #f0fdf4 !important; color: #16a34a !important; }
.btn-history-icon { background: #f5f3ff !important; color: #7c3aed !important; }
.btn-info-icon { background: #eff6ff !important; color: #2563eb !important; }
.btn-warning-icon { background: #fef3c7 !important; color: #b45309 !important; }

/* Table action buttons — single row, responsive */
.table-actions {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-shrink: 0;
    min-width: max-content;
}

.table-actions .btn-action-icon {
    flex-shrink: 0;
}

.ordenes-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: white;
    border-radius: 5px;
    box-shadow: var(--shadow-sm);
}

.ordenes-table th.col-acciones,
.ordenes-table td.col-acciones {
    position: sticky;
    right: 0;
    z-index: 2;
    background: #fff;
    box-shadow: -6px 0 10px -8px rgba(15, 23, 42, 0.18);
    width: auto;
    min-width: 112px;
    white-space: nowrap;
    text-align: right;
    vertical-align: middle;
    padding-left: 8px;
    padding-right: 12px;
}

.ordenes-table thead th.col-acciones {
    z-index: 3;
    background: #f8fafc;
}

.ordenes-table tbody tr:hover td.col-acciones {
    background: #f8fafc;
}

@media (max-width: 768px) {
    .table-actions {
        gap: 5px;
    }

    .table-actions .btn-action-icon {
        width: 30px !important;
        height: 30px !important;
        font-size: 13px !important;
    }
}

@media (max-width: 480px) {
    .table-actions {
        gap: 4px;
    }

    .table-actions .btn-action-icon {
        width: 28px !important;
        height: 28px !important;
        font-size: 12px !important;
        border-radius: 6px !important;
    }

    .ordenes-table th.col-acciones,
    .ordenes-table td.col-acciones {
        padding-left: 6px;
        padding-right: 8px;
    }
}

/* Tooltip en botones de acción: nativo del navegador (sin pseudo-elemento global) */

/* Ajuste para botones dentro de tags */
.btn-delete-tag {
    width: 20px;
    height: 20px;
    font-size: 10px;
    border-radius: 50%;
}

/* Firmas */
.firmas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.firma-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.firma-canvas {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    cursor: crosshair;
    width: 100%;
    height: auto;
    touch-action: none;
    pointer-events: auto;
}

.firma-actions {
    display: flex;
    gap: 8px;
}

.btn-firma {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-firma:hover {
    background: #f1f5f9;
    color: #1e293b;
    border-color: #cbd5e1;
}

/* Detalle de orden — layout */
.detalle-orden-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.detalle-orden-par {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    align-items: stretch;
}

.detalle-orden-par .form-card {
    height: 100%;
}

.detalle-orden-full {
    grid-column: 1 / -1;
}

.detalle-campo {
    margin: 0 0 8px;
    line-height: 1.45;
}

.detalle-texto {
    background: #f8fafc;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-top: 6px;
    white-space: pre-wrap;
    line-height: 1.5;
    font-size: 14px;
    color: var(--gray-700);
}

@media (max-width: 900px) {
    .detalle-orden-par {
        grid-template-columns: 1fr;
    }
}

/* Firmas en detalle de orden (solo lectura) */
.detalle-firmas-card {
    grid-column: 1 / -1;
    max-width: 520px;
}

.detalle-firma-cliente {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.detalle-firmas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 4px;
}

.detalle-firma-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detalle-firma-label {
    font-weight: 600;
    font-size: 13px;
    color: var(--gray-700, #334155);
}

.detalle-firma-canvas-wrap {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.detalle-firma-img {
    max-width: 100%;
    max-height: 140px;
    object-fit: contain;
    display: block;
}

.detalle-firma-vacia {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #94a3b8;
    font-size: 13px;
    padding: 24px;
    text-align: center;
}

.detalle-firma-vacia i {
    font-size: 28px;
    opacity: 0.5;
}

.detalle-firma-meta {
    font-size: 13px;
    color: var(--gray-600, #475569);
    line-height: 1.6;
}

.detalle-firma-meta p {
    margin: 0;
}

/* Notification Banner */
.notif-banner {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-150px);
    background: white;
    color: var(--gray-800);
    padding: 20px 32px;
    border-radius: 12px;
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 20px;
    width: 90%; /* Ancho proporcional al contenedor */
    max-width: 1100px; /* Tamaño similar a las tarjetas de contenido */
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: 5px solid #f59e0b; /* Color naranja/ámbar para alertar */
}

.notif-banner.active {
    transform: translateX(-50%) translateY(0);
}

.notif-banner i {
    font-size: 32px;
    color: #f59e0b;
}

.notif-banner-content {
    flex: 1;
}

.notif-banner-title {
    font-weight: 800;
    font-size: 16px;
    margin-bottom: 4px;
    color: #1e293b;
}

.notif-banner-text {
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
}

/* Tabs System ... */
.tabs-container {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: #f1f5f9; /* Fondo gris muy suave para el contenedor */
    padding: 6px;
    border-radius: 12px;
    width: fit-content;
    border: 1px solid #e2e8f0;
}

.tab-btn {
    padding: 10px 24px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.tab-btn i {
    font-size: 15px;
    opacity: 0.7;
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.tab-btn.active i {
    opacity: 1;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

/* ── Formulario de Orden: modos por rol ─────────────────────────────────────
   El formulario tiene un único HTML. El modo se controla con una clase en el
   elemento <form>:
     - Sin clase (o .modo-tecnico): muestra todo — para técnico y edición
     - .modo-admin-inicial:         oculta secciones técnicas — para admin creando
*/

/* Por defecto las secciones técnicas son visibles */
.seccion-tecnico { display: block; }

/* En modo admin-inicial solo se ven los Datos Generales */
#ordenForm.modo-admin-inicial .seccion-tecnico {
    display: none !important;
}

/* Ocultar campos individuales dentro de Datos Generales que no aplican al admin */
#ordenForm.modo-admin-inicial .campo-solo-tecnico {
    display: none !important;
}

/* El botón de guardar cambia según el modo */
#btnGuardarOrden        { display: inline-flex; align-items: center; gap: 8px; }
#btnGuardarOrdenInicial { display: none !important; align-items: center; gap: 8px; }
#btnCerrarOrden         { display: none; align-items: center; gap: 8px; }

#ordenForm.modo-admin-inicial #btnGuardarOrden        { display: none !important; }
#ordenForm.modo-admin-inicial #btnGuardarOrdenInicial { display: inline-flex !important; }

#ordenForm.modo-tecnico.tiene-orden #btnCerrarOrden   { display: inline-flex !important; }

/* ── Trabajo Realizado (formulario de orden) ─────────────────────────────── */
.trabajo-realizado-card {
    margin-bottom: 24px;
}

.trabajo-realizado-asistente__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
    align-items: end;
    width: 100%;
    margin-bottom: 18px;
}

.trabajo-realizado-asistente__grid .form-group,
.trabajo-realizado-asistente__grid .searchable-select-wrap {
    width: 100%;
    min-width: 0;
}

.trabajo-realizado-principal {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.trabajo-realizado-principal .form-group textarea {
    width: 100%;
    resize: vertical;
    min-height: 88px;
    line-height: 1.5;
}

.trabajo-realizado-principal .form-group:last-child textarea {
    min-height: 104px;
}

.trabajo-realizado-notas {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200, #e2e8f0);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 20px;
}

.trabajo-realizado-notas .form-group textarea {
    width: 100%;
    resize: vertical;
    min-height: 88px;
}

@media (max-width: 768px) {
    .trabajo-realizado-asistente__grid {
        grid-template-columns: 1fr;
    }

    .trabajo-realizado-notas {
        grid-template-columns: 1fr;
    }
}


#btnCerrarOrden:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.searchable-select-native {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.searchable-select-wrap {
    position: relative;
    width: 100%;
}

.searchable-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    box-sizing: border-box;
    padding: 9px 12px;
    min-height: 40px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    color: var(--gray-800);
    background: #fff;
    transition: border-color 0.2s;
}

.searchable-select-trigger:focus,
.searchable-select-trigger:focus-visible {
    outline: none;
    border-color: var(--primary);
}

.searchable-select-trigger span {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.searchable-select-chevron {
    color: var(--gray-400);
    font-size: 12px;
    flex-shrink: 0;
}

.searchable-select-wrap.is-disabled .searchable-select-trigger,
.searchable-select-trigger:disabled {
    opacity: 1;
    cursor: not-allowed;
    background: #f1f5f9 !important;
    color: #475569 !important;
}

.form-group:has(select.searchable-select-native[aria-invalid="true"]) .searchable-select-trigger {
    border-color: var(--danger);
    box-shadow: 0 0 0 1px var(--danger);
}

.searchable-select-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1200;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

.searchable-select-search-wrap {
    padding: 8px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 10px 10px 0 0;
}

.searchable-select-search-wrap.search-input {
    display: block;
    width: 100%;
}

.searchable-select-search-wrap .searchable-select-search,
.searchable-select-search-wrap .input-search {
    width: 100%;
    box-sizing: border-box;
    min-height: 38px;
}

.searchable-select-list {
    list-style: none;
    margin: 0;
    padding: 4px 0;
    max-height: 240px;
    overflow-y: auto;
    border-radius: 0 0 10px 10px;
}

.searchable-select-option {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f8fafc;
    transition: background 0.12s ease;
}

.searchable-select-option:hover,
.searchable-select-option.is-selected {
    background: #f1f5f9;
}

.searchable-select-option__label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-800);
}

.searchable-select-option__meta {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    color: var(--gray-400);
}

.searchable-select-hint {
    padding: 12px 14px;
    font-size: 12px;
    color: var(--gray-500);
    line-height: 1.45;
}

.input.rep-desc-readonly,
.input.rep-desc[readonly] {
    background: var(--gray-50, #f8fafc);
    color: var(--gray-700);
    cursor: default;
}

/* Barra de filtros en una sola fila (incidencias, etc.) */
.filters-bar {
    margin-bottom: 12px;
    background: var(--white);
    padding: 16px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.filters-bar__grid {
    display: grid;
    grid-template-columns:
        minmax(128px, 1.05fr)
        minmax(148px, 1.25fr)
        minmax(148px, 1.25fr)
        minmax(116px, 0.9fr)
        minmax(116px, 0.9fr)
        auto;
    gap: 10px;
    align-items: center;
}

.filters-bar__grid .input,
.filters-bar__grid .searchable-select-wrap {
    width: 100%;
    min-width: 0;
}

.filters-bar__actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

@media (max-width: 1024px) {
    .filters-bar__grid {
        grid-template-columns: repeat(3, minmax(140px, 1fr));
    }

    .filters-bar__actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}

@media (max-width: 600px) {
    #modalImportarMarcas .map-grid,
    #modalImportarModelos .map-grid,
    #modalImportarRepuestos .map-grid {
        grid-template-columns: 1fr !important;
    }
    #modalImportarMarcas .map-grid > select,
    #modalImportarModelos .map-grid > select,
    #modalImportarRepuestos .map-grid > select {
        margin-bottom: 4px;
    }
}

/* ── Filter chips (átomo compartido) ─────────────────────────────────────── */
.filter-chip-wrap {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border: 1.5px dashed #cbd5e1;
    border-radius: 999px;
    background: #fff;
    color: #475569;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    white-space: nowrap;
}

.filter-chip:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.filter-chip--active {
    border-style: solid;
    border-color: #16a34a;
    background: #f0fdf4;
    color: #15803d;
}

.filter-chip--compound {
    display: inline-flex;
    align-items: center;
    padding: 0;
    overflow: hidden;
    cursor: default;
}

.filter-chip--compound .filter-chip__toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 100%;
    padding: 0 12px 0 14px;
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 500;
    cursor: pointer;
}

.filter-chip__divider {
    width: 1px;
    align-self: stretch;
    background: #bbf7d0;
    flex-shrink: 0;
}

.filter-chip__inline-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 100%;
    padding: 0;
    border: none;
    background: transparent;
    color: #15803d;
    cursor: pointer;
    flex-shrink: 0;
}

.filter-chip__inline-clear:hover {
    background: #dcfce7;
}

.filter-chip__icon {
    font-size: 11px;
    opacity: 0.7;
}

.filter-chip__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #16a34a;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.filter-chip-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 40;
    min-width: 200px;
    padding: 8px 0 6px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.filter-chip-dropdown__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.filter-chip-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 13px;
    color: #334155;
}

.filter-chip-option:hover {
    background: #f8fafc;
}

.filter-chip-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #16a34a;
    cursor: pointer;
}

.filter-chip-dropdown__clear {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 8px 14px 4px;
    border: none;
    border-top: 1px solid #f1f5f9;
    background: transparent;
    color: #64748b;
    font-size: 12px;
    text-align: left;
    cursor: pointer;
}

.filter-chip-dropdown__clear:hover {
    color: #334155;
    background: #f8fafc;
}

/* ── Selector de columnas (shared/ui/tables) ─────────────────────────────── */
.column-picker {
    position: relative;
    display: inline-flex;
}

.column-picker__toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.column-picker__panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 45;
    min-width: 210px;
    padding: 8px 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.column-picker__list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 280px;
    overflow-y: auto;
}

.column-picker__option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 13px;
    color: #334155;
}

.column-picker__option:hover {
    background: #f8fafc;
}

.column-picker__option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #3b82f6;
    cursor: pointer;
}

/* ── Filtros de órdenes (feature) ────────────────────────────────────────── */
.orders-filters {
    padding: 12px 14px;
    background: #fff;
}

.orders-filters.form-card {
    margin-bottom: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.orders-filters__toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.orders-filters__control-wrap {
    width: 100%;
    height: var(--orders-filter-h, 40px);
}

.orders-filters__search {
    flex: 1 1 220px;
    min-width: 200px;
}

.orders-filters__search .search-input {
    width: 100%;
}

.orders-filters__chips {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.orders-filters__columns {
    margin-left: auto;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.orders-filters__columns .column-picker__toggle {
    height: var(--orders-filter-h, 40px);
    padding: 0 14px;
    font-size: 13px;
    white-space: nowrap;
}

.orders-filters__chips .filter-chip {
    height: var(--orders-filter-h, 40px);
}

.orders-filters__control {
    height: var(--orders-filter-h, 40px);
    min-height: var(--orders-filter-h, 40px);
    box-sizing: border-box;
    font-size: 13px;
    line-height: 1.2;
}

.orders-filters__toolbar .input-search,
.orders-filters__toolbar .input-select {
    border: 1.5px solid var(--gray-200, #e2e8f0);
    border-radius: var(--radius, 8px);
    background: #fff;
}

.orders-filters__search .input-search {
    padding-left: 36px;
    padding-right: 12px;
}

.orders-filters__select {
    flex: 0 1 168px;
    min-width: 148px;
    padding: 0 12px;
    cursor: pointer;
}

.orders-filters__date {
    flex: 0 1 148px;
    min-width: 132px;
    padding: 0 10px;
    color: var(--gray-700, #334155);
}

.orders-filters__clear {
    flex-shrink: 0;
    height: var(--orders-filter-h, 40px);
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    white-space: nowrap;
}

.orders-filters__clear span {
    display: inline;
}

@media (max-width: 900px) {
    .orders-filters__search {
        flex: 1 1 100%;
    }

    .orders-filters__select,
    .orders-filters__date {
        flex: 1 1 calc(50% - 10px);
        min-width: 120px;
    }

    .orders-filters__clear {
        margin-left: auto;
    }

    .orders-filters__columns {
        margin-left: 0;
    }
}

@media (max-width: 520px) {
    .orders-filters__select,
    .orders-filters__date {
        flex: 1 1 100%;
    }

    .orders-filters__columns {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Resolución de marcas faltantes: tarjetas compactas con acciones inline. */
.import-resolucion-marca {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) auto minmax(180px, 1fr);
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
}
.import-resolucion-marca + .import-resolucion-marca {
    margin-top: 8px;
}
.import-resolucion-marca__nombre {
    font-weight: 600;
    color: #9a3412;
    font-size: 13px;
    word-break: break-word;
}
.import-resolucion-marca__action {
    display: flex;
    gap: 6px;
}
.import-resolucion-marca__action select {
    width: 100%;
    font-size: 13px;
}
@media (max-width: 600px) {
    .import-resolucion-marca {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   PAGINACIÓN — shared/ui/pagination
   ============================================================ */
.pg-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
    padding: 10px 4px 2px;
    border-top: 1px solid var(--gray-200);
}

.pg-footer__left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    min-width: 0;
}

.pg-page-size {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--gray-500);
    white-space: nowrap;
}

.pg-page-size__label {
    color: var(--gray-500);
}

.pg-page-size__select {
    height: 34px;
    min-width: 72px;
    padding: 0 28px 0 10px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: #fff;
    color: var(--gray-700);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.pg-page-size__select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.pg-info {
    font-size: 13px;
    color: var(--gray-400);
}

.pg-info strong {
    color: var(--gray-600);
    font-weight: 600;
}

.pg-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pg-btn {
    min-width: 34px;
    height: 34px;
    padding: 0 6px;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    background: white;
    color: var(--gray-600);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
    line-height: 1;
}

.pg-btn:hover:not(:disabled) {
    background: var(--gray-100);
    border-color: var(--gray-200);
    color: var(--gray-800);
}

.pg-btn:disabled {
    opacity: 0.38;
    cursor: not-allowed;
}

.pg-btn--active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
}

.pg-btn--active:hover {
    background: #2563eb !important;
    border-color: #2563eb !important;
    color: white !important;
}

.pg-btn--nav {
    color: var(--gray-400);
    font-size: 11px;
}

.pg-ellipsis {
    min-width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    font-size: 13px;
    pointer-events: none;
    user-select: none;
}

@media (max-width: 480px) {
    .pg-footer { flex-direction: column; align-items: flex-start; }
    .pg-footer__left { width: 100%; }
    .pg-controls { width: 100%; justify-content: center; }
}

/* Tabla órdenes: fila resaltada cuando un técnico pasa la orden a "en proceso" (SSE) */
.ordenes-table tbody tr.orden-fila-atencion {
    animation: ordenFilaAtencionPulse 1.15s ease-in-out 8;
}
@keyframes ordenFilaAtencionPulse {
    0%, 100% {
        background-color: transparent;
        box-shadow: none;
    }
    50% {
        background-color: rgba(14, 165, 233, 0.13);
        box-shadow: inset 0 0 0 1px rgba(14, 165, 233, 0.42);
    }
}
