/**
 * ISWFacturacion - CSS Principal
 * Estilo ProyectosPlus
 */

/* ==================== CONTENEDOR PRINCIPAL ==================== */
.isw-container {
    padding: 20px;
    font-size: 14px;
    max-width: 1400px;
    margin: 0 auto;
}

.isw-container p,
.isw-container td,
.isw-container th,
.isw-container label,
.isw-container input,
.isw-container select,
.isw-container textarea {
    font-size: 14px;
}

/* ==================== TÍTULO ==================== */
.isw-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 3px solid #1565c0;
}

.isw-title h1 {
    margin: 0;
    color: #1a237e;
    font-weight: 700;
    font-size: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ==================== BOTONES ==================== */
.isw-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.isw-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.isw-btn-primary { 
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%); 
    color: #fff; 
}
.isw-btn-primary:hover { 
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%); 
    color: #fff; 
}

.isw-btn-success { 
    background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%); 
    color: #fff; 
}
.isw-btn-success:hover { 
    background: linear-gradient(135deg, #388e3c 0%, #2e7d32 100%); 
    color: #fff; 
}
.isw-btn-primary,
.isw-btn-primary i,
.isw-btn-success,
.isw-btn-success i,
.isw-btn-warning,
.isw-btn-warning i {
    color: #fff !important;
}
.isw-btn-warning { 
    background: linear-gradient(135deg, #f57c00 0%, #e65100 100%); 
    color: #fff; 
}
.isw-btn-warning:hover { 
    background: linear-gradient(135deg, #fb8c00 0%, #f57c00 100%); 
    color: #fff; 
}
.isw-btn-help {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    background: transparent;
    color: #1565c0;
    border: none;
    box-shadow: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}
.isw-btn-help:hover {
    background: transparent;
    color: #0d47a1;
    transform: scale(1.1);
    box-shadow: none;
}
.isw-btn-danger { 
    background: linear-gradient(135deg, #c62828 0%, #b71c1c 100%); 
    color: #fff; 
}
.isw-btn-danger:hover { 
    background: linear-gradient(135deg, #d32f2f 0%, #c62828 100%); 
    color: #fff; 
}

.isw-btn-secondary { 
    background: #f5f5f5; 
    color: #424242; 
    border: 1px solid #e0e0e0;
}
.isw-btn-secondary:hover { 
    background: #eeeeee; 
    color: #212121; 
}

.isw-btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}

/* ==================== TABLAS ==================== */
.isw-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.isw-table thead tr.liste_titre th {
    background: linear-gradient(135deg, #37474f 0%, #263238 100%);
    padding: 16px 14px;
    text-align: left;
    font-weight: 600;
    color: #fff;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
}

.isw-table thead tr.liste_titre th.right {
    text-align: right;
}

.isw-table thead tr.liste_titre th.center {
    text-align: center;
}

.isw-table tr.liste_titre_filter td {
    background: #fafafa;
    padding: 12px 14px;
    border-bottom: 2px solid #e0e0e0;
}

.isw-table tr.liste_titre_filter input,
.isw-table tr.liste_titre_filter select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.isw-table tr.liste_titre_filter input:focus,
.isw-table tr.liste_titre_filter select:focus {
    outline: none;
    border-color: #1565c0;
    box-shadow: 0 0 0 3px rgba(21,101,192,0.1);
}

.isw-table tbody td {
    padding: 14px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
    color: #424242;
}

.isw-table tbody tr:hover {
    background: #f5f5f5;
}

.isw-table tbody tr.isw-clickable {
    cursor: pointer;
    transition: background 0.15s ease;
}

.isw-table tbody tr.isw-clickable:hover {
    background: #e3f2fd;
}

.isw-table tbody td.right {
    text-align: right;
}

.isw-table tbody td.center {
    text-align: center;
}

/* ==================== BADGES ==================== */
.isw-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.isw-badge-success { 
    background: #c8e6c9; 
    color: #2e7d32; 
}

.isw-badge-warning { 
    background: #fff3e0; 
    color: #e65100; 
}

.isw-badge-danger { 
    background: #ffcdd2; 
    color: #c62828; 
}

.isw-badge-info { 
    background: #bbdefb; 
    color: #1565c0; 
}

.isw-badge-secondary { 
    background: #e0e0e0; 
    color: #616161; 
}

.isw-badge-light {
    background: #f5f5f5;
    color: #757575;
    border: 1px solid #e0e0e0;
}

/* ==================== ALERTAS ==================== */
.isw-alert {
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.isw-alert-success { 
    background: #e8f5e9; 
    color: #2e7d32; 
    border-left: 4px solid #2e7d32; 
}

.isw-alert-error { 
    background: #ffebee; 
    color: #c62828; 
    border-left: 4px solid #c62828; 
}

.isw-alert-warning { 
    background: #fff3e0; 
    color: #e65100; 
    border-left: 4px solid #ff9800; 
}

.isw-alert-info { 
    background: #e3f2fd; 
    color: #1565c0; 
    border-left: 4px solid #1565c0; 
}

/* ==================== EMPTY STATE ==================== */
.isw-empty {
    text-align: center;
    padding: 60px 20px;
    color: #9e9e9e;
}

.isw-empty i {
    font-size: 64px;
    color: #e0e0e0;
    margin-bottom: 20px;
    display: block;
}

.isw-empty p {
    margin: 0;
    font-size: 15px;
}

.isw-empty a {
    color: #1565c0;
    text-decoration: none;
    font-weight: 500;
}

.isw-empty a:hover {
    text-decoration: underline;
}

/* ==================== FORMULARIOS ==================== */
.isw-form-group {
    margin-bottom: 20px;
}

.isw-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #37474f;
    font-size: 13px;
}

.isw-form-group input[type="text"],
.isw-form-group input[type="number"],
.isw-form-group input[type="date"],
.isw-form-group input[type="email"],
.isw-form-group select,
.isw-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}

.isw-form-group input:focus,
.isw-form-group select:focus,
.isw-form-group textarea:focus {
    outline: none;
    border-color: #1565c0;
    box-shadow: 0 0 0 3px rgba(21,101,192,0.15);
}

.isw-form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.isw-form-row .isw-form-group {
    flex: 1;
    min-width: 200px;
}

.isw-required {
    color: #c62828;
}

/* ==================== CARDS ==================== */
.isw-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.isw-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.isw-card:hover {
    border-color: #1565c0;
    box-shadow: 0 8px 24px rgba(21,101,192,0.12);
    transform: translateY(-2px);
}

.isw-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    margin-bottom: 16px;
}

.isw-card-title {
    font-weight: 700;
    font-size: 16px;
    color: #1a237e;
    margin-bottom: 8px;
}

.isw-card-desc {
    color: #616161;
    font-size: 13px;
    line-height: 1.5;
}

/* ==================== BOTONES DE BÚSQUEDA ==================== */
.button_search,
.button_removefilter {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 4px;
}

.button_search:hover {
    background: #1565c0;
    border-color: #1565c0;
    color: #fff;
}

.button_removefilter:hover {
    background: #c62828;
    border-color: #c62828;
    color: #fff;
}

/* ==================== PANEL LATERAL - ESTILOS ADICIONALES ==================== */
#isw-panel-overlay {
    backdrop-filter: blur(2px);
}

#isw-panel {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.isw-panel-tab:hover {
    background: rgba(21,101,192,0.05);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .isw-container {
        padding: 12px;
    }
    
    .isw-title {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .isw-title h1 {
        font-size: 20px;
    }
    
    .isw-table thead tr.liste_titre th {
        padding: 12px 10px;
        font-size: 11px;
    }
    
    .isw-table tbody td {
        padding: 10px;
        font-size: 13px;
    }
    
    .isw-form-row {
        flex-direction: column;
    }
    
    #isw-panel {
        width: 100% !important;
        right: -100% !important;
    }
    
    #isw-panel.open {
        right: 0 !important;
    }
}

/* ==================== ANIMACIONES ==================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.isw-alert {
    animation: fadeIn 0.3s ease;
}

/* ==================== PRINT ==================== */
@media print {
    .isw-btn,
    .button_search,
    .button_removefilter,
    .liste_titre_filter,
    #isw-panel,
    #isw-panel-overlay {
        display: none !important;
    }
    
    .isw-table {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .isw-table thead tr.liste_titre th {
        background: #f5f5f5 !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
    }
/**
 * ISWFacturacion - CSS ADICIONES v2.0
 * Archivo: css/iswfacturacion.css
 * 
 * INSTRUCCIONES:
 * Añadir estas reglas CSS al final del archivo iswfacturacion.css existente
 */

/* ==================== MODO LECTURA - CAMPOS ==================== */
.isw-read-field {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.isw-read-field:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.isw-read-label {
    font-size: 10px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    display: block;
}

.isw-read-value {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    line-height: 1.5;
}

.isw-read-value.empty {
    color: #999;
    font-style: italic;
}

/* ==================== LAYOUT 3 COLUMNAS ==================== */
.isw-read-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.isw-read-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

/* Responsive para móvil */
@media (max-width: 768px) {
    .isw-read-row,
    .isw-read-row-3 {
        grid-template-columns: 1fr;
    }
}

/* ==================== CARDS ==================== */
.isw-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 16px;
    transition: box-shadow 0.2s ease;
}

.isw-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.isw-card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==================== VEHÍCULO CARD ==================== */
.isw-vehiculo-card {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid #e65100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.isw-vehiculo-card .isw-matricula {
    font-family: 'Courier New', Courier, monospace;
    font-size: 22px;
    font-weight: 700;
    color: #e65100;
    margin-bottom: 8px;
}

.isw-vehiculo-card .isw-v-detail {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.isw-vehiculo-card .isw-v-detail i {
    color: #e65100;
    font-size: 12px;
}

/* ==================== AUTORIZACIONES BADGES ==================== */
.isw-auth-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.isw-auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: all 0.2s ease;
}

.isw-auth-badge:hover {
    background: #c8e6c9;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.12);
}

.isw-auth-badge i {
    font-size: 10px;
}

/* ==================== BADGE ISW SECCIÓN TALLER ==================== */
.isw-badge-taller {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #e65100 0%, #ff6f00 100%);
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(230,81,0,0.3);
    text-transform: uppercase;
}

/* ==================== MODO EDICIÓN - TRANSICIONES ==================== */
.isw-edit-toggle {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.isw-edit-mode {
    background: #fff9e6;
    border-left: 4px solid #f57c00;
    animation: editPulse 0.3s ease;
}

@keyframes editPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }
    50% {
        transform: scale(1.01);
        box-shadow: 0 4px 16px rgba(245,124,0,0.2);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }
}

/* ==================== PANEL LATERAL - BOTONES FOOTER ==================== */
.isw-panel-footer {
    padding: 12px 16px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.isw-panel-footer .isw-btn {
    flex: 0 0 auto;
}

/* ==================== TOTALES ==================== */
.isw-totals {
    background: linear-gradient(135deg, #e8f5e9, #e3f2fd);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.isw-totals-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 15px;
    color: #424242;
}

.isw-totals-row.total {
    font-size: 20px;
    font-weight: 700;
    color: #2e7d32;
    border-top: 2px solid rgba(46,125,50,0.2);
    padding-top: 16px;
    margin-top: 12px;
}

/* ==================== ESTADOS Y BADGES ==================== */
.isw-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.isw-status-badge.borrador {
    background: #f57c00;
}

.isw-status-badge.validada {
    background: #388e3c;
}

.isw-status-badge.cerrada {
    background: #616161;
}

.isw-status-badge.cancelada {
    background: #d32f2f;
}

/* ==================== FORMULARIOS ==================== */
.isw-form-group {
    margin-bottom: 14px;
}

.isw-form-group label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
    font-weight: 500;
}

.isw-form-group input,
.isw-form-group select,
.isw-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    background: #fff;
}

.isw-form-group input:focus,
.isw-form-group select:focus,
.isw-form-group textarea:focus {
    outline: none;
    border-color: #1565c0;
    box-shadow: 0 0 0 3px rgba(21,101,192,0.1);
}

.isw-form-group input:disabled,
.isw-form-group select:disabled,
.isw-form-group textarea:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
    color: #999;
}

/* ==================== GRID FORMULARIOS ==================== */
.isw-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.isw-form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

@media (max-width: 768px) {
    .isw-form-row,
    .isw-form-row-3 {
        grid-template-columns: 1fr;
    }
}

/* ==================== ALERTAS ==================== */
.isw-alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.isw-alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.isw-alert-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.isw-alert-warning {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffe0b2;
}

.isw-alert-info {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #bbdefb;
}

/* ==================== READONLY NOTICE ==================== */
.isw-readonly-notice {
    background: #fff3e0;
    color: #e65100;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 12px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #ffe0b2;
}

/* ==================== LOADING ==================== */
.isw-loading {
    text-align: center;
    padding: 40px;
    color: #1565c0;
}

.isw-loading i {
    font-size: 32px;
    margin-bottom: 12px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==================== EMPTY STATE ==================== */
.isw-empty {
    text-align: center;
    padding: 40px 20px;
    color: #9e9e9e;
}

.isw-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

/* ==================== TABS PERSONALIZADOS ==================== */
.isw-panel-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
    overflow-x: auto;
}

.isw-panel-tab {
    flex: 1;
    padding: 12px 8px;
    text-align: center;
    font-size: 11px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.isw-panel-tab:hover {
    background: rgba(21,101,192,0.05);
}

.isw-panel-tab.active {
    color: #1565c0;
    border-bottom-color: #1565c0;
    background: #fff;
}

/* ==================== LÍNEAS DE DETALLE ==================== */
.isw-line-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    transition: all 0.2s;
}

.isw-line-item:hover {
    border-color: #1565c0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.isw-line-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.isw-line-desc {
    font-weight: 500;
    color: #333;
    font-size: 14px;
    flex: 1;
    word-break: break-word;
}

.isw-line-total {
    font-size: 16px;
    font-weight: 700;
    color: #2e7d32;
    white-space: nowrap;
}

.isw-line-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #666;
    margin-top: 8px;
    flex-wrap: wrap;
}

.isw-line-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 600;
    margin-right: 8px;
}

.isw-line-badge.mano_obra {
    background: #e8f5e9;
    color: #2e7d32;
}

.isw-line-badge.material {
    background: #e3f2fd;
    color: #1565c0;
}

.isw-line-badge.recambio {
    background: #e3f2fd;
    color: #1565c0;
}

.isw-line-badge.servicio {
    background: #f3e5f5;
    color: #7b1fa2;
}

.isw-line-badge.subcontrata {
    background: #fff3e0;
    color: #e65100;
}

/* ==================== UTILIDADES ==================== */
.paddingright {
    padding-right: 6px;
}

.paddingleft {
    padding-left: 6px;
}

.text-muted {
    color: #999;
}

.text-bold {
    font-weight: 600;
}

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

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

/* ==================== RESPONSIVE HELPERS ==================== */
@media (max-width: 992px) {
    .isw-card {
        padding: 16px;
    }
    
    .isw-vehiculo-card {
        padding: 16px;
    }
}

@media (max-width: 576px) {
    .isw-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .isw-panel-footer {
        flex-direction: column;
    }
    
    .isw-panel-footer .isw-btn {
        width: 100%;
    }
}

/* ==================== ANIMACIONES ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.isw-fade-in {
    animation: fadeIn 0.3s ease;
}

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

.isw-slide-in {
    animation: slideInRight 0.3s ease;
}

/**
 * ISWFacturacion - CSS ADICIONES: Sección Terceros
 * Archivo: css/iswfacturacion.css
 *
 * INSTRUCCIONES:
 * Añadir estas reglas al FINAL del archivo iswfacturacion.css existente
 */

/* ==================== TERCEROS: TABS ==================== */
.isw-tc-tabs {
    display: flex;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-bottom: 2px solid #ddd;
    border-radius: 4px 4px 0 0;
}

.isw-tc-tab {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-right: 1px solid #ddd;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.isw-tc-tab:last-child {
    border-right: none;
}

.isw-tc-tab:hover {
    background: #e9ecef;
    color: #333;
    text-decoration: none;
}

.isw-tc-tab.active {
    background: #fff;
    color: #0277bd;
    border-bottom: 3px solid #0277bd;
    margin-bottom: -2px;
    font-weight: 600;
}

.isw-tc-content {
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    background: #fff;
    padding: 20px;
}

.isw-tc-section {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
}

/* ==================== TERCEROS: TARJETAS DATOS ==================== */
.isw-tc-data-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.isw-tc-data-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
}

.isw-tc-data-label {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.isw-tc-data-value {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

/* ==================== TERCEROS: TARJETAS STATS ==================== */
.isw-tc-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.isw-tc-stat {
    flex: 1;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.isw-tc-stat-vehiculos {
    background: #e8f5e9;
}

.isw-tc-stat-ots {
    background: #fff3e0;
}

.isw-tc-stat-docs {
    background: #e3f2fd;
}

.isw-tc-stat-facturado {
    background: #fce4ec;
}

.isw-tc-stat-icon {
    font-size: 20px;
    display: inline-block;
}

.isw-tc-stat-number {
    font-size: 18px;
    font-weight: 700;
    margin-left: 8px;
}

/* ==================== TERCEROS: MATRÍCULA BADGE ==================== */
.isw-tc-matricula {
    font-family: monospace;
    font-size: 15px;
    font-weight: 700;
    color: #e65100;
    background: #fff3e0;
    padding: 3px 10px;
    border-radius: 4px;
    display: inline-block;
}

/* ==================== TERCEROS: TIPO DOCUMENTO BADGES ==================== */
.isw-tc-tipo-pre {
    display: inline-block;
    padding: 3px 10px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.isw-tc-tipo-pro {
    display: inline-block;
    padding: 3px 10px;
    background: #e3f2fd;
    color: #1565c0;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.isw-tc-tipo-fac {
    display: inline-block;
    padding: 3px 10px;
    background: #fce4ec;
    color: #c62828;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

/* ==================== TERCEROS: RESUMEN DOCUMENTOS ==================== */
.isw-tc-doc-resumen {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.isw-tc-doc-resumen-card {
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

/* ==================== TERCEROS: FILA TOTALES ==================== */
.isw-tc-total-row {
    background: #f5f5f5;
    font-weight: 700;
}

.isw-tc-total-row td {
    padding: 12px 14px !important;
}

/* ==================== TERCEROS: ITV ALERTS ==================== */
.isw-tc-itv-ok {
    color: #2e7d32;
    font-size: 12px;
    font-weight: 600;
}

.isw-tc-itv-warning {
    color: #f57c00;
    font-size: 12px;
    font-weight: 600;
}

.isw-tc-itv-expired {
    color: #d32f2f;
    font-size: 12px;
    font-weight: 600;
}

.isw-tc-itv-expired-label {
    font-size: 10px;
    color: #d32f2f;
    font-weight: 700;
    display: block;
}

/* ==================== TERCEROS: PANEL NUEVO VEHÍCULO ==================== */
.isw-tc-veh-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99998;
    backdrop-filter: blur(2px);
}

.isw-tc-veh-panel {
    position: fixed;
    top: 0;
    right: -520px;
    width: 500px;
    max-width: 100%;
    height: 100%;
    background: #fff;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.3);
    z-index: 99999;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.isw-tc-veh-panel.open {
    right: 0;
}

.isw-tc-veh-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.isw-tc-veh-panel-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.isw-tc-veh-panel-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.isw-tc-veh-panel-close:hover {
    color: #333;
}

.isw-tc-veh-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.isw-tc-veh-form-full {
    grid-column: 1 / -1;
}

.isw-tc-veh-form-label {
    display: block;
    font-weight: 600;
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.isw-tc-veh-alert {
    display: none;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 13px;
}

.isw-tc-veh-alert.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.isw-tc-veh-alert.error {
    background: #fce4ec;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

/* ==================== TERCEROS: LISTA - BADGES CONTADORES ==================== */
.isw-tc-count-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 13px;
}

.isw-tc-count-vehiculos {
    background: #e8f5e9;
    color: #2e7d32;
}

.isw-tc-count-ots {
    background: #fff3e0;
    color: #e65100;
}

.isw-tc-count-docs {
    background: #e3f2fd;
    color: #1565c0;
}

/* ==================== TERCEROS: CABECERA ==================== */
.isw-tc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.isw-tc-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.isw-tc-header-title {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.isw-tc-header-actions {
    display: flex;
    gap: 8px;
}

.isw-tc-label-taller {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #01579b 0%, #0277bd 100%);
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ==================== TERCEROS: RESPONSIVE ==================== */
@media (max-width: 992px) {
    .isw-tc-data-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

@media (max-width: 768px) {
    .isw-tc-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .isw-tc-tab {
        padding: 10px 12px;
        font-size: 12px;
        white-space: nowrap;
    }

    .isw-tc-data-grid {
        grid-template-columns: 1fr;
    }

    .isw-tc-stats {
        flex-wrap: wrap;
    }

    .isw-tc-stat {
        min-width: calc(50% - 8px);
    }

    .isw-tc-doc-resumen {
        grid-template-columns: 1fr;
    }

    .isw-tc-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .isw-tc-header-actions {
        width: 100%;
        flex-wrap: wrap;
    }

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

@media (max-width: 576px) {
    .isw-tc-content {
        padding: 12px;
    }

    .isw-tc-stat {
        min-width: 100%;
    }
}
