* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.wc-detailed-orders {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    padding: 20px;
    color: #333;
    max-width: 1400px;
    margin: 0 auto;
}

.wc-detailed-orders .container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 30px;
}

.wc-detailed-orders h1 {
    font-size: 28px;
    margin-bottom: 25px;
    font-weight: 600;
}

/* Tabs */
.detailed-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid #e0e0e0;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 20px;
    background-color: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    background-color: #f5f5f5;
}

.tab-btn.active {
    color: #0066cc;
    border-bottom: 3px solid #0066cc;
    font-weight: 600;
}

.tab-count {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    color: white;
    min-width: 24px;
    text-align: center;
    background-color: #0066cc;
}

/* Controles */
.orders-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 20px;
    flex-wrap: wrap;
}

.search-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

#globalSearch {
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 20px;
    font-size: 14px;
    width: 250px;
}

.search-btn {
    padding: 10px 25px;
    background-color: white;
    color: #0066cc;
    border: 1px solid #0066cc;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.search-btn:hover {
    background-color: #0066cc;
    color: white;
}

.refresh-btn {
    padding: 10px 20px;
    background-color: white;
    color: #0066cc;
    border: 2px solid #0066cc;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.refresh-btn:hover {
    background-color: #0066cc;
    color: white;
}

.date-range {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.date-input {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.export-btn {
    padding: 10px 20px;
    background-color: white;
    color: #0066cc;
    border: 2px solid #0066cc;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.export-btn:hover {
    background-color: #0066cc;
    color: white;
}

.info-text {
    font-size: 14px;
    color: #666;
    margin-left: 20px;
}

/* Tab Content */
.tabs-content {
    margin-top: 20px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.tab-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.debug-console-btn {
    padding: 8px 15px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: #666;
}

.debug-console-btn:hover {
    background-color: #e9ecef;
}

/* Tables */
.table-container {
    overflow-x: auto;
    margin-top: 15px;
}

.detailed-orders-table {
    width: 100% !important;
    border-collapse: collapse;
}

.detailed-orders-table thead th {
    background-color: #f8f9fa;
    padding: 15px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: #555;
    border-bottom: 2px solid #dee2e6;
}

.detailed-orders-table tbody td {
    padding: 15px 10px;
    border-bottom: 1px solid #e9ecef;
    font-size: 13px;
    vertical-align: middle;
}

.detailed-orders-table tbody tr:hover {
    background-color: #f8f9fa;
}

.order-id {
    color: #0066cc;
    font-weight: 600;
    cursor: pointer;
}

.order-id:hover {
    text-decoration: underline;
}

.company-name {
    font-weight: 500;
    color: #333;
}

.company-code {
    font-size: 11px;
    color: #999;
    display: block;
    margin-top: 3px;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    color: white;
    text-align: center;
    min-width: 30px;
}

.badge-orange {
    background-color: #ff9800;
}

.badge-red {
    background-color: #f44336;
}

/* DataTables Styles */
.dataTables_wrapper .dataTables_paginate {
    text-align: center;
    margin-top: 20px;
}

.dataTables_wrapper .dataTables_info {
    font-size: 13px;
    color: #666;
    padding-top: 15px;
}

.dataTables_wrapper .dataTables_length {
    font-size: 13px;
    color: #666;
}

.dataTables_wrapper .dataTables_length select {
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin: 0 10px;
}

/* Debug Panel */
.debug-panel {
    margin-bottom: 20px;
}

.debug-btn {
    padding: 10px 15px;
    margin-right: 10px;
    background-color: #ffc107;
    color: #212529;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.debug-btn:hover {
    background-color: #e0a800;
}

.debug-info-panel {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    z-index: 10000;
}

.debug-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.debug-header h4 {
    margin: 0;
}

.debug-header button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.debug-header button:hover {
    color: #333;
}

#debugContent {
    padding: 20px;
    max-height: calc(80vh - 60px);
    overflow: auto;
    background: #f8f9fa;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
}

/* Añade esto al CSS existente */

/* Indicadores de ordenamiento DataTables */
table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc,
table.dataTable thead .sorting_asc_disabled,
table.dataTable thead .sorting_desc_disabled {
    cursor: pointer;
    position: relative;
    padding-right: 26px !important;
}

table.dataTable thead .sorting:before,
table.dataTable thead .sorting:after,
table.dataTable thead .sorting_asc:before,
table.dataTable thead .sorting_asc:after,
table.dataTable thead .sorting_desc:before,
table.dataTable thead .sorting_desc:after {
    position: absolute;
    top: 50%;
    right: 8px;
    display: block;
    opacity: 0.3;
    font-size: 0.8em;
}

table.dataTable thead .sorting:before,
table.dataTable thead .sorting_asc:before,
table.dataTable thead .sorting_desc:before {
    content: "↑";
    margin-top: -10px;
}

table.dataTable thead .sorting:after,
table.dataTable thead .sorting_asc:after,
table.dataTable thead .sorting_desc:after {
    content: "↓";
    margin-top: 2px;
}

table.dataTable thead .sorting_asc:before,
table.dataTable thead .sorting_desc:after {
    opacity: 1;
    color: #0066cc;
}

/* Estilos específicos para DataTables */
.dataTables_wrapper {
    margin-top: 15px;
}

.dataTables_length,
.dataTables_filter {
    margin-bottom: 15px;
}

.dataTables_length label,
.dataTables_filter label {
    font-size: 13px;
    color: #666;
}

.dataTables_length select {
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin: 0 5px;
}

.dataTables_filter input {
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-left: 10px;
}

.dataTables_info {
    padding: 10px 0;
    font-size: 13px;
    color: #666;
}

.dataTables_paginate {
    margin-top: 10px;
}

.dataTables_paginate .paginate_button {
    padding: 5px 10px;
    margin: 0 2px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    border-radius: 3px;
    font-size: 12px;
}

.dataTables_paginate .paginate_button:hover {
    background: #f5f5f5;
}

.dataTables_paginate .paginate_button.current {
    background: #0066cc;
    color: white;
    border-color: #0066cc;
}

.dataTables_paginate .paginate_button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Asegurar que los contenedores de tablas sean visibles */
.tabs-content {
    position: relative;
    min-height: 400px;
}

.tab-pane {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tab-pane.active {
    display: block;
    opacity: 1;
}

/* Asegurar que DataTables no esté oculto */
.dataTables_wrapper {
    visibility: visible !important;
    display: block !important;
}

/* Asegurar que las tablas se vean bien */
#table-active,
#table-process,
#table-expiring,
#table-renewals,
#table-inactive,
#table-all {
    width: 100% !important;
    visibility: visible !important;
}

/* Override cualquier display:none */
.tab-pane.active .dataTables_wrapper,
.tab-pane.active table {
    display: block !important;
    visibility: visible !important;
}

/* Debug: poner borde rojo a elementos ocultos para debug */
.debug-hidden {
    border: 2px solid red !important;
}

 /* Estilos específicos para detalle-orden */
        .detalle-orden-container {
            max-width: 1580px;
            margin: 0 auto;
            font-family: -apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, \'Helvetica Neue\', Arial, sans-serif;
        }
        
        .detalle-orden-header {
            margin-bottom: 1rem;
        }
        
        .detalle-orden-volver-btn {
            color: #2563eb;
            text-decoration: none;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            background: none;
            border: none;
            cursor: pointer;
            font-size: 1rem;
            padding: 0.5rem 0;
        }
        
        .detalle-orden-volver-btn:hover {
            color: #1d4ed8;
        }
        
        .detalle-orden-card {
            background: white;
            border-radius: 0.5rem;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
            padding: 1.5rem;
            margin-bottom: 1rem;
        }
        
        .detalle-orden-header-info {
            display: flex;
            flex-wrap: wrap;
            gap: 1.5rem;
        }
        
        .detalle-orden-header-info > div {
            flex: 1;
            min-width: 200px;
        }
        
        .detalle-orden-label {
            color: #6b7280;
            font-size: 0.875rem;
            margin-bottom: 0.25rem;
        }
        
        .detalle-orden-number {
            font-size: 1.875rem;
            font-weight: bold;
            margin-bottom: 0.5rem;
        }
        
        .detalle-orden-info {
            color: #4b5563;
            font-size: 0.875rem;
        }
        
        .detalle-orden-price-large {
            font-size: 1.5rem;
            font-weight: bold;
            color: #1f2937;
        }
        
        .detalle-orden-main-layout {
            display: flex;
            gap: 1rem;
            flex-wrap: wrap;
        }
        
        .detalle-orden-main-content {
            flex: 2;
            min-width: 300px;
        }
        
        .detalle-orden-sidebar {
            flex: 1;
            min-width: 300px;
        }
        
        .detalle-orden-product-header {
            display: flex;
            justify-content: space-between;
            margin-bottom: 1rem;
        }
        
        .detalle-orden-product-title {
            font-size: 1.125rem;
            font-weight: 600;
            margin-bottom: 0.25rem;
        }
        
        .detalle-orden-product-sku {
            color: #6b7280;
            font-size: 0.875rem;
        }
        
        .detalle-orden-posts {
            text-align: right;
        }
        
        .detalle-orden-posts-number {
            font-size: 1.5rem;
            font-weight: bold;
        }
        
        .detalle-orden-table-header {
            display: flex;
            gap: 0.75rem;
            margin-bottom: 0.75rem;
            color: #6b7280;
            font-size: 0.875rem;
        }
        
        .detalle-orden-table-row {
            display: flex;
            gap: 0.75rem;
            align-items: center;
            margin-bottom: 0.75rem;
        }
        
        .detalle-orden-col-1 { width: 8.33%; display: flex; justify-content: center; }
        .detalle-orden-col-2 { width: 16.66%; }
        .detalle-orden-col-3 { width: 25%; }
        .detalle-orden-col-4 { width: 33.33%; }
        .detalle-orden-col-right { text-align: right; }
        
        .detalle-orden-input {
            width: 100%;
            padding: 0.5rem 0.75rem;
            border: 1px solid #d1d5db;
            border-radius: 0.375rem;
            font-size: 0.875rem;
        }
        
        .detalle-orden-input-wrapper {
            position: relative;
            width: 100%;
        }
        
        .detalle-orden-input-icon {
            position: absolute;
            right: 0.75rem;
            top: 50%;
            transform: translateY(-50%);
            color: #9ca3af;
        }
        
        .detalle-orden-file-button {
            width: 100%;
            padding: 0.5rem 0.75rem;
            border: 1px solid #d1d5db;
            border-radius: 0.375rem;
            font-size: 0.875rem;
            color: #6b7280;
            background: white;
            text-align: left;
            cursor: pointer;
        }
        
        .detalle-orden-file-button:hover {
            background: #f9fafb;
        }
        
        .detalle-orden-toggle-switch {
            position: relative;
            display: inline-block;
            width: 3rem;
            height: 1.5rem;
        }
        
        .detalle-orden-toggle-switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }
        
        .detalle-orden-slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: #2563eb;
            border-radius: 1.5rem;
            transition: 0.3s;
        }
        
        .detalle-orden-slider:before {
            position: absolute;
            content: "";
            height: 1rem;
            width: 1rem;
            left: 0.25rem;
            bottom: 0.25rem;
            background-color: white;
            border-radius: 50%;
            transition: 0.3s;
        }
        
        .detalle-orden-toggle-switch input:checked + .detalle-orden-slider:before {
            transform: translateX(1.5rem);
        }
        
        .detalle-orden-button-group {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding-top: 1rem;
        }
        
        .detalle-orden-button-flex {
            display: flex;
            gap: 0.75rem;
        }
        
        .detalle-orden-btn {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.5rem 1.25rem;
            border-radius: 9999px;
            font-weight: 500;
            cursor: pointer;
            border: none;
            font-size: 0.875rem;
        }
        
        .detalle-orden-btn-cancel {
            background: transparent;
            border: 2px solid #ef4444;
            color: #ef4444;
        }
        
        .detalle-orden-btn-cancel:hover {
            background: #fef2f2;
        }
        
        .detalle-orden-btn-save {
            background: #f97316;
            color: white;
        }
        
        .detalle-orden-btn-save:hover {
            background: #ea580c;
        }
        
        .detalle-orden-btn-activate {
            background: #22c55e;
            color: white;
        }
        
        .detalle-orden-btn-activate:hover {
            background: #16a34a;
        }
        
        .detalle-orden-btn-edit {
            background: #f97316;
            color: white;
        }
        
        .detalle-orden-btn-edit:hover {
            background: #ea580c;
        }
        
        .detalle-orden-company-title {
            color: #2563eb;
            font-size: 1.125rem;
            font-weight: 600;
            margin-bottom: 1rem;
            line-height: 1.4;
        }
        
        .detalle-orden-info-section {
            margin-bottom: 1rem;
        }
        
        .detalle-orden-info-label {
            color: #6b7280;
            font-size: 0.875rem;
            margin-bottom: 0.25rem;
        }
        
        .detalle-orden-info-value {
            color: #1f2937;
            font-weight: 500;
        }
        
        .detalle-orden-section-header {
            color: #374151;
            font-weight: 500;
            margin-bottom: 0.5rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
        
        .detalle-orden-divider {
            border-top: 1px solid #e5e7eb;
            padding-top: 1rem;
        }
        
        .detalle-orden-upload-zone {
            border: 2px dashed #d1d5db;
            border-radius: 0.5rem;
            padding: 1.5rem;
        }
        
        .detalle-orden-upload-content {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 0.75rem;
        }
        
        .detalle-orden-upload-text {
            font-size: 0.875rem;
            color: #4b5563;
        }
        
        .detalle-orden-upload-button {
            padding: 0.5rem 1rem;
            border: 1px solid #d1d5db;
            border-radius: 0.375rem;
            font-size: 0.875rem;
            color: #4b5563;
            background: white;
            cursor: pointer;
        }
        
        .detalle-orden-upload-button:hover {
            background: #f9fafb;
        }
        
        .detalle-orden-file-display {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-top: 0.5rem;
        }
        
        .detalle-orden-file-icon {
            color: #ef4444;
            font-size: 1.125rem;
        }
        
        .detalle-orden-file-name {
            font-size: 0.875rem;
            color: #374151;
        }
        
        .detalle-orden-id-label {
            font-weight: 500;
            font-size: 0.875rem;
        }
        
        .detalle-orden-price {
            font-weight: 500;
            font-size: 0.875rem;
        }
        
        .detalle-orden-alert,
        .detalle-orden-error {
            padding: 1rem;
            border-radius: 0.375rem;
            margin: 1rem 0;
        }
        
        .detalle-orden-alert {
            background-color: #fef3c7;
            color: #92400e;
            border: 1px solid #fde68a;
        }
        
        .detalle-orden-error {
            background-color: #fee2e2;
            color: #991b1b;
            border: 1px solid #fecaca;
        }
        
        @media (max-width: 1024px) {
            .detalle-orden-main-layout {
                flex-direction: column;
            }
            
            .detalle-orden-table-row {
                flex-wrap: wrap;
            }
        }
        
        @media (max-width: 768px) {
            .detalle-orden-header-info {
                flex-direction: column;
            }
            
            .detalle-orden-button-group {
                flex-direction: column;
                gap: 0.75rem;
            }
            
            .detalle-orden-button-flex {
                width: 100%;
                flex-direction: column;
            }
            
            .detalle-orden-btn {
                width: 100%;
                justify-content: center;
            }
            
            .detalle-orden-upload-content {
                flex-direction: column;
                gap: 0.5rem;
            }
        }
        
        
        /* order-detail-toggle.css */

/* Estilos para etiquetas de modo común */
.detalle-orden-common-label {
    color: #666;
    font-style: italic;
    font-size: 12px;
    padding: 8px 0;
    display: block;
}

/* Estilos para campos deshabilitados */
.detalle-orden-input.disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Estilo para Sin DarcoID */
.detalle-orden-no-darcoid {
    color: #999;
    font-size: 12px;
    font-style: italic;
}

/* Botones deshabilitados */
.upload-common-contract.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Estado del toggle */
.detalle-orden-toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.detalle-orden-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.detalle-orden-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.detalle-orden-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .detalle-orden-slider {
    background-color: #2196F3;
}

input:checked + .detalle-orden-slider:before {
    transform: translateX(26px);
}