/**
 * BAT System - Estilos principales
 * Dashboard responsive
 */

/* Reset y variables */
:root {
    --primary-color: #729fcf;
    --secondary-color: #355269;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-bg: #f8f9fa;
    --dark-text: #333;
    --border-color: #dee2e6;
    --sidebar-width: 250px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--dark-text);
    background-color: var(--light-bg);
}

/* Layout principal */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width 0.3s ease;
    z-index: 1000;
    left: 0;
    top: 0;
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar-header {
    padding: 15px 10px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: padding 0.3s ease;
}

.sidebar.collapsed .sidebar-header {
    padding: 15px 5px;
}

.sidebar-toggle-btn {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.sidebar.collapsed .sidebar-toggle-btn i {
    transform: rotate(180deg);
}

.sidebar-title {
    transition: opacity 0.3s ease, visibility 0.3s ease;
    flex: 1;
    min-width: 0;
}

.sidebar.collapsed .sidebar-title {
    opacity: 0;
    visibility: hidden;
    margin: 0;
}

.sidebar-header h3 {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 3px;
    white-space: nowrap;
}

.sidebar-header small {
    font-size: 11px;
    opacity: 0.8;
    display: block;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 0;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: white;
    text-decoration: none;
    transition: background 0.3s;
    position: relative;
}

.sidebar.collapsed .sidebar-menu a {
    padding: 12px 10px;
    justify-content: center;
    font-size: 0;
}

.sidebar.collapsed .sidebar-menu a i {
    font-size: 18px;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-menu i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar.collapsed .sidebar-menu i {
    margin-right: 0;
}

/* Tooltips para modo colapsado - el texto se oculta via font-size: 0 en el <a> */

/* Tooltip JS para sidebar colapsado */
.sidebar-tooltip {
    position: fixed;
    background: rgba(30, 30, 30, 0.95);
    color: white;
    padding: 7px 12px;
    border-radius: 5px;
    font-size: 13px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.15s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.sidebar-tooltip.visible {
    opacity: 1;
}

.sidebar-tooltip::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: rgba(30, 30, 30, 0.95);
}


/* Submenú */
.menu-item-with-submenu {
    position: relative;
}

.sidebar-menu .menu-toggle {
    cursor: pointer;
    position: relative;
    font-size: 14px;
}

.submenu-icon {
    position: absolute;
    right: 20px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.sidebar.collapsed .submenu-icon {
    display: none;
}

.menu-item-with-submenu.open .submenu-icon {
    transform: rotate(180deg);
}

.submenu {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0, 0, 0, 0.2);
}

.menu-item-with-submenu.open .submenu {
    max-height: 500px;
}

.sidebar.collapsed .submenu {
    display: none;
}

.submenu li {
    margin-bottom: 0;
}

.submenu a {
    padding-left: 50px;
    font-size: 13px;
}

.sidebar.collapsed .submenu a {
    padding-left: 10px;
}

/* Contenido principal */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.main-content.sidebar-collapsed {
    margin-left: 70px;
}

/* Navbar superior */
.topbar {
    background: white;
    padding: 15px 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.topbar .menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    margin-right: 15px;
    color: var(--dark-text);
}

.topbar h1 {
    font-size: 24px;
    color: var(--secondary-color);
}

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

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

/* Contenedor de página */
.page-container {
    padding: 30px;
}

/* Tarjetas */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 20px;
}

/* Estadísticas */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--primary-color);
}

.stat-card h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: bold;
    color: var(--secondary-color);
}

/* Tablas */
.table-responsive {
    overflow-x: auto;
}

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

table thead {
    background: var(--light-bg);
}

table th,
table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

table th {
    font-weight: 600;
    color: var(--secondary-color);
}

table tbody tr:hover {
    background: var(--light-bg);
}

/* Botones */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

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

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-outline-secondary {
    background: transparent;
    color: #6c757d;
    border: 1px solid #6c757d;
}

.btn-outline-secondary:hover {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
}

.btn[disabled],
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

/* Formularios */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--secondary-color);
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

select.form-control {
    cursor: pointer;
    background-color: white;
}

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

/* Campos de solo lectura (Holded) - SOLO para inputs y textareas (excluye input[type=file]), NO para selects */
input.form-control:not([type="file"])[readonly],
input.form-control:not([type="file"]):read-only,
textarea.form-control[readonly],
textarea.form-control:read-only {
    background-color: #e9ecef;
    cursor: not-allowed;
    color: #6c757d;
    border-color: #ced4da;
}

input.form-control:not([type="file"])[readonly]:focus,
input.form-control:not([type="file"]):read-only:focus,
textarea.form-control[readonly]:focus,
textarea.form-control:read-only:focus {
    border-color: #ced4da;
    box-shadow: none;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.badge-primary {
    background: var(--primary-color);
    color: white;
}

.badge-success {
    background: var(--success-color);
    color: white;
}

.badge-danger {
    background: var(--danger-color);
    color: white;
}

.badge-warning {
    background: var(--warning-color);
    color: #000;
}

.badge-info {
    background: var(--info-color);
    color: white;
}

.badge-secondary {
    background: #6c757d;
    color: white;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Alarmas */
.alarmas-card {
    margin-bottom: 25px;
}

.alarmas-card .card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
}

.alarma-item {
    padding: 15px;
    margin-bottom: 10px;
    border-left: 4px solid #ff6b6b;
    background: #fff5f5;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alarma-item:last-child {
    margin-bottom: 0;
}

.alarma-mensaje {
    flex: 1;
}

.alarma-accion {
    margin-left: 15px;
}

/* Login */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

/* Card used in login & recuperar pages */
.login-card,
.login-box {
    background: white;
    padding: 30px 36px;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.14);
    width: 100%;
    max-width: 480px;
}

.login-header {
    text-align: center;
    margin-bottom: 18px;
}

.login-header h2 {
    margin: 0 0 6px 0;
    color: var(--secondary-color);
    font-size: 20px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.login-subtitle {
    color: #6c757d;
    font-size: 13px;
}

/* Form specific */
.login-form .form-group {
    margin-bottom: 16px;
}

.login-form .input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--border-color);
    padding: 8px 10px;
    border-radius: 4px;
}

.login-form .input-group i {
    color: var(--secondary-color);
    min-width: 20px;
    text-align: center;
    font-size: 14px;
}

.login-form .input-group input[type="email"],
.login-form .input-group input[type="text"],
.login-form .input-group input[type="password"] {
    border: none;
    outline: none;
    flex: 1;
    font-size: 14px;
    background: transparent;
}

.form-actions {
    margin-top: 18px;
    padding-top: 0;
    border-top: none;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-full {
    width: 100%;
}

.login-links {
    margin-top: 14px;
    text-align: center;
}

.login-links a {
    color: #007bff;
    background: transparent;
    text-decoration: none;
    display: inline-block;
    padding: 6px 10px;
    border-radius: 4px;
}

.login-card .alert {
    margin-top: 10px;
}

.alert i {
    margin-right: 8px;
}

/* Recovery page helpers */
.reset-info-box {
    background: var(--light-bg);
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
}

.reset-link-box {
    word-break: break-all;
    font-family: monospace;
    background: white;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.actions-center {
    text-align: center;
    margin-top: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content,
    .main-content.sidebar-collapsed {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .page-container {
        padding: 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    table {
        font-size: 12px;
    }
    
    table th,
    table td {
        padding: 8px;
    }
}

/* Overlay para móvil */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

/* Claims específicos */
.row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.col-md-4 {
    flex: 0 0 calc(33.333% - 10px);
}

.col-md-6 {
    flex: 0 0 calc(50% - 7.5px);
}

.col-md-8 {
    flex: 0 0 calc(66.666% - 5px);
}

.form-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
}

.text-danger {
    color: var(--danger-color);
}

.form-text {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #6c757d;
}

@media (max-width: 768px) {
    .col-md-4,
    .col-md-6,
    .col-md-8 {
        flex: 0 0 100%;
    }
}

/* ========================================================= */
/* INTERFAZ DE SUBIDA DE ARCHIVOS - ADAPTADA AL DISEÑO BAT */
/* ========================================================= */

.upload-container {
    margin-top: 20px;
}

/* Zona de subida */
.upload-zone {
    width: 320px;
    height: 280px;
    border: 3px dashed #cbd5e0;
    border-radius: 15px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8fafc;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.upload-zone:hover {
    border-color: var(--primary-color);
    background: #f0f4ff;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(114, 159, 207, 0.1);
}

/* Estado cuando se arrastra archivo encima */
.upload-zone.drag-over {
    border-color: #48bb78;
    background: #f0fff4;
    border-style: solid;
    transform: scale(1.02);
    box-shadow: 0 15px 30px rgba(72, 187, 120, 0.2);
}

/* Estado cuando archivo está cargado */
.upload-zone.file-loaded {
    border-color: #48bb78;
    background: linear-gradient(135deg, #68d391 0%, #48bb78 100%);
    color: white;
    border-style: solid;
    box-shadow: 0 10px 25px rgba(72, 187, 120, 0.3);
}

.upload-zone.file-loaded:hover {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

/* Iconos */
.upload-icon {
    font-size: 60px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    opacity: 0.7;
    color: #4a5568;
    font-weight: 300;
}

.upload-zone:hover .upload-icon {
    opacity: 1;
    transform: scale(1.1);
}

.upload-zone.drag-over .upload-icon {
    transform: scale(1.2) rotate(45deg);
    color: #48bb78;
}

.upload-zone.file-loaded .upload-icon {
    color: white;
    font-size: 50px;
}

/* Textos */
.upload-text {
    text-align: center;
    color: #4a5568;
    font-size: 16px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.upload-subtext {
    text-align: center;
    color: #a0aec0;
    font-size: 14px;
    transition: all 0.3s ease;
}

.upload-zone.file-loaded .upload-text,
.upload-zone.file-loaded .upload-subtext {
    color: white;
}

/* Input file oculto */
.file-input {
    display: none;
}

/* Información del archivo */
.file-info {
    margin-top: 20px;
    padding: 15px;
    background: #f7fafc;
    border-radius: 10px;
    border-left: 4px solid #48bb78;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.file-info.show {
    opacity: 1;
    transform: translateY(0);
}

/* Lista de archivos */
.files-list {
    margin-bottom: 15px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: white;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.file-item:last-child {
    margin-bottom: 0;
}

.file-name {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 2px;
}

.file-size {
    color: #718096;
    font-size: 12px;
}

.file-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.file-status.success {
    background: #48bb78;
    color: white;
}

.file-status.processing {
    background: #ed8936;
    color: white;
}

/* Animación de carga */
.loading-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 2s ease;
    border-radius: 0 0 12px 12px;
}

.upload-zone.loading .loading-bar {
    width: 100%;
}

/* Responsive para upload */
@media (max-width: 600px) {
    .upload-zone {
        width: 100%;
        height: 180px;
        margin: 0;
    }

    .upload-icon {
        font-size: 40px;
    }
    
    .upload-text {
        font-size: 14px;
    }
    
    .upload-subtext {
        font-size: 12px;
    }
}

/* Estilos para documentos existentes */
.documento-existente {
    margin-bottom: 8px;
}

.documento-existente:last-child {
    margin-bottom: 0;
}

.documento-existente .btn {
    margin-left: 4px;
    padding: 4px 8px;
}

.documento-existente:hover {
    transform: translateY(-1px);
    transition: transform 0.2s ease;
}

/* ========================================================= */
/* CUBOS DE DOCUMENTOS - SISTEMA ESCALABLE */
/* ========================================================= */

.documentos-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}

@media (min-width: 768px) {
    .documentos-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1200px) {
    .documentos-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.documento-cubo {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

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

/* Estados del cubo */
.documento-cubo.completado {
    border-color: #48bb78;
    background: linear-gradient(135deg, #f0fff4 0%, #e6fffa 100%);
}

.documento-cubo.procesando {
    border-color: #ed8936;
    background: #fffaf0;
}

.documento-cubo.error {
    border-color: #f56565;
    background: #fef2f2;
}

.documento-cubo.pendiente-firmas {
    border-color: #d69e2e;
    background: linear-gradient(135deg, #fffff0 0%, #fefcbf 100%);
    box-shadow: 0 2px 8px rgba(214, 158, 46, 0.2);
}

/* Header del cubo */
.cubo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.cubo-header h4 {
    margin: 0;
    color: var(--secondary-color);
    font-size: 18px;
    font-weight: 600;
}

.cubo-estado {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.cubo-estado.pendiente {
    background: #e2e8f0;
    color: #4a5568;
}

.cubo-estado.completado {
    background: #48bb78;
    color: white;
}

.cubo-estado.pendiente-firmas {
    background: #d69e2e;
    color: white;
}

.cubo-estado.procesando {
    background: #ed8936;
    color: white;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Zona de upload dentro del cubo */
.cubo-upload-zone {
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.cubo-upload-zone:hover {
    border-color: var(--primary-color);
    background: #f0f4ff;
    transform: scale(1.02);
}

.cubo-upload-zone.drag-over {
    border-color: #48bb78;
    background: #f0fff4;
    border-style: solid;
    transform: scale(1.05);
}

.cubo-upload-zone.completado {
    border-color: #48bb78;
    background: linear-gradient(135deg, #68d391 0%, #48bb78 100%);
    color: white;
    border-style: solid;
}

.cubo-upload-zone.procesando {
    border-color: #ed8936;
    background: #fffaf0;
}

.cubo-upload-zone.pendiente-firmas {
    border-color: #d69e2e;
    background: linear-gradient(135deg, #fefcbf 0%, #f6e05e 100%);
    color: #744210;
    border-style: solid;
}

/* Iconos del cubo */
.cubo-icon {
    font-size: 40px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    opacity: 0.7;
    color: #4a5568;
}

.cubo-upload-zone:hover .cubo-icon {
    opacity: 1;
    transform: scale(1.1);
}

.cubo-upload-zone.drag-over .cubo-icon {
    transform: scale(1.2) rotate(45deg);
    color: #48bb78;
}

.cubo-upload-zone.completado .cubo-icon {
    color: white;
    font-size: 36px;
}

.cubo-upload-zone.pendiente-firmas .cubo-icon {
    color: #744210;
    font-size: 36px;
}

/* Textos del cubo */
.cubo-text {
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 5px;
    transition: all 0.3s ease;
}

.cubo-subtext {
    font-size: 12px;
    color: #a0aec0;
    transition: all 0.3s ease;
}

.cubo-upload-zone.completado .cubo-text,
.cubo-upload-zone.completado .cubo-subtext {
    color: white;
}

.cubo-upload-zone.pendiente-firmas .cubo-text,
.cubo-upload-zone.pendiente-firmas .cubo-subtext {
    color: #744210;
}

/* Barra de carga del cubo */
.cubo-loading-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 2s ease;
    border-radius: 0 0 6px 6px;
}

.cubo-upload-zone.procesando .cubo-loading-bar {
    width: 100%;
}

/* Input file oculto del cubo */
.cubo-file-input {
    display: none;
}

/* Información del documento (cuando ya está subido) */
.cubo-info {
    margin-top: 15px;
    padding: 15px;
    background: #f7fafc;
    border-radius: 8px;
    border-left: 4px solid #48bb78;
}

.documento-detalles {
    margin-bottom: 12px;
}

.documento-nombre {
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 4px;
    font-size: 14px;
}

.documento-fecha {
    font-size: 12px;
    color: #666;
}

.documento-acciones {
    display: flex;
    gap: 8px;
}

.documento-acciones .btn {
    flex: 1;
    font-size: 12px;
    padding: 6px 12px;
}

/* Responsive para cubos */
@media (max-width: 768px) {
    .documentos-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .documento-cubo {
        padding: 15px;
    }
    
    .cubo-upload-zone {
        padding: 20px 15px;
        min-height: 100px;
    }
    
    .cubo-icon {
        font-size: 32px;
    }
    
    .cubo-text {
        font-size: 13px;
    }
    
    .cubo-subtext {
        font-size: 11px;
    }
    
    /* Botones en mobile - stack vertical para mejor usabilidad */
    .documento-acciones {
        flex-direction: column;
        gap: 5px;
    }
    
    .documento-acciones .btn {
        flex: none;
        font-size: 11px;
        padding: 5px 10px;
    }
}

/*PEDIDOS VER*/
.tabs {
    display: flex;
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 25px;
    overflow-x: auto;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    cursor: pointer;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
}

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

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

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

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

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

.form-group {
    margin-bottom: 15px;
}

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

.nota-item {
    transition: transform 0.2s;
}

.nota-item:hover {
    transform: translateX(5px);
}

/* ===============================
   ESTILOS DE PAGINACIÓN
   =============================== */

.pagination-info {
    font-size: 14px;
    color: #6c757d;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.pagination-info div:first-child {
    font-weight: 500;
}

.pagination-controls {
    margin-top: 20px;
    border-top: 1px solid #dee2e6;
    padding-top: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination-controls .btn {
    min-width: 40px;
    height: 38px;
    border-radius: 4px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    text-decoration: none;
    border: 1px solid #dee2e6;
}

.pagination-controls .btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    text-decoration: none;
}

.pagination-controls .btn:active {
    transform: translateY(0);
}

.pagination-controls .btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Página actual (activa) */
.pagination-controls .btn-primary {
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(114, 159, 207, 0.3);
}

/* Botones de navegación (primera/anterior/siguiente/última) */
.pagination-controls .btn i {
    font-size: 14px;
}

/* Espaciado especial para separar grupos de botones */
.pagination-controls .btn:first-child {
    margin-right: 5px;
}

.pagination-controls .btn:nth-child(2) {
    margin-right: 15px;
}

.pagination-controls .btn:nth-last-child(2) {
    margin-left: 15px;
}

.pagination-controls .btn:last-child {
    margin-left: 5px;
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .pagination-info {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 15px !important;
    }
    
    .pagination-controls {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }
    
    .pagination-controls .btn {
        min-width: 35px;
        height: 35px;
        font-size: 12px;
    }
    
    /* Remover márgenes especiales en móvil */
    .pagination-controls .btn:first-child,
    .pagination-controls .btn:nth-child(2),
    .pagination-controls .btn:nth-last-child(2),
    .pagination-controls .btn:last-child {
        margin: 0;
    }
}

/* ========================================== */
/* PANEL DE PERSONALIZACIÓN DE COLUMNAS */
/* ========================================== */

#panel-columnas {
    animation: slideDown 0.3s ease-out;
}

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

.columna-checkbox-label {
    transition: background-color 0.2s;
}

.columna-checkbox-label:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.columna-checkbox {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

#panel-columnas h6 {
    color: var(--secondary-color);
    font-weight: 600;
}

/* Animación para mensajes flotantes */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.alert {
    animation: fadeIn 0.3s ease-out;
}
/* ===================================================================
   BADGES DE ESTADO DE ENVÍO
   =================================================================== */
.estado-envio-badge {
    display: inline-block;
    padding: 4px 8px;
    margin: 2px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.estado-envio-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* Select de estado con color dinámico */
select[name="estado_envio"] {
    transition: all 0.3s ease;
    font-weight: 600;
    border-width: 2px;
}

select[name="estado_envio"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(114, 159, 207, 0.25);
}

/* Estilos para la celda de estado_envio en tablas */
.col-estado_envio {
    min-width: 150px;
    white-space: nowrap;
}


/* ========================================================= */
/* CHIPS DE LOGÍSTICA - ESTILO BAT */
/* ========================================================= */
.logistica-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px 5px 5px;
    border-radius: 20px;
    border: 2px solid #d0d5dd;
    background: #f9fafb;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    transition: border-color .15s, background .15s, color .15s, box-shadow .15s;
    user-select: none;
}
.logistica-chip:hover {
    border-color: var(--primary-color, #1a7f8f);
    background: #f0fbfc;
}
.logistica-chip-selected {
    border-color: var(--primary-color, #1a7f8f);
    background: var(--primary-color, #1a7f8f);
    color: #fff;
    box-shadow: 0 2px 6px rgba(26,127,143,.25);
}
.logistica-chip-selected:hover {
    background: color-mix(in srgb, var(--primary-color, #1a7f8f) 85%, black);
}
.chip-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255,255,255,.3);
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}
.logistica-chip:not(.logistica-chip-selected) .chip-avatar {
    background: #e0e7ef;
    color: #374151;
}
#logistica-chips:focus-within {
    border-color: var(--primary-color, #1a7f8f);
    box-shadow: 0 0 0 3px rgba(26,127,143,.12);
}