﻿@charset "UTF-8";
/* 
   SKYNIX UNIFICADO - TEMA OSCURO PREMIUM
   =========================================
   Tema oscuro con acento amarillo (var(--sk-primary))
   VERSIÃ“N: RediseÃ±o Visual Completo
   FECHA: 2026-04-18
*/

/* ============================================================================
   1. VARIABLES CSS - TEMA OSCURO PREMIUM
   ============================================================================ */

/* Las variables CSS estÃ¡n en design-tokens.css (cargado via <link> en base.html) */

/* ============================================================================
   2. RESET Y ESTILOS BASE
   ============================================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--sk-font);
    font-size: var(--sk-text-md);
    background: var(--sk-bg);
    color: var(--sk-text);
    line-height: 1.5;
    overflow-x: auto;
}

/* ============================================================================
   3. LAYOUT PRINCIPAL
   ============================================================================ */

.app-container {
    display: flex;
    min-height: 100vh;
}

/* ============================================================================
   4. SIDEBAR - ESTILOS PREMIUM
   ============================================================================ */

.sidebar {
    width: 240px;
    background: var(--sk-bg-darker);
    border-right: 1px solid var(--sk-surface);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1000;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--sk-surface);
}

.logo {
    color: var(--sk-primary);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.logo-subtitle {
    color: var(--sk-text-3);
    font-size: 11px;
    font-weight: 500;
}

.sidebar-nav {
    padding: 16px 8px;
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 140px);
}

/* Scrollbar finito y discreto para el sidebar */
.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--sk-text-3);
    text-decoration: none;
    font-size: 13px;
    padding: 10px 16px;
    border-radius: 6px;
    margin: 1px 8px;
    transition: all 0.2s;
}

.nav-link:hover {
    background: var(--sk-surface);
    color: var(--sk-text-2);
}

.nav-link.active {
    background: var(--sk-primary);
    color: var(--sk-primary-text);
    font-weight: 700;
    box-shadow: inset 3px 0 0 rgba(0,0,0,0.25);
}

.nav-icon {
    width: 16px;
    height: 16px;
    color: currentColor;
}

.sidebar-section-label {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--sk-primary);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 12px 16px 4px 16px;
    margin: 4px 8px 0 8px;
    border-top: 1px solid var(--sk-surface);
}

.nav-link-sub {
    padding-left: 28px !important;
    font-size: 12px !important;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--sk-surface);
}

.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-name {
    color: var(--sk-text-3);
    font-size: 13px;
}

.logout-btn {
    background: transparent;
    border: none;
    color: var(--sk-danger);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--sk-radius-sm);
    transition: background 0.2s;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* ============================================================================
   5. CONTENIDO PRINCIPAL
   ============================================================================ */

.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 24px;
    min-height: 100vh;
}

/* ============================================================================
   6. HEADER DE PÃGINA
   ============================================================================ */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--sk-border);
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--sk-text);
}

/* Escritorio (Dashboard): titulo principal en amarillo */
.page-header .page-title:first-child {
    color: var(--sk-primary);
}

/* Dashboard: titulos de seccion en amarillo Lamborghini */
.dashboard-subtitle {
    font-size: 18px;
    font-weight: 700;
    color: var(--sk-primary);
}

.page-subtitle {
    font-size: 13px;
    color: var(--sk-text-3);
    margin-top: 4px;
}

.action-buttons {
    display: flex;
    gap: 12px;
}

/* ============================================================================
   7. CARDS DASHBOARD - PREMIUM
   ============================================================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--sk-surface);
    border: 1px solid var(--sk-border);
    border-radius: var(--sk-radius);
    padding: 24px;
    box-shadow: var(--sk-shadow);
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.stat-card.ingresos::before {
    background: var(--sk-primary);
}

.stat-card.gastos::before {
    background: var(--sk-danger);
}

.stat-card.beneficio::before {
    background: var(--sk-success);
}

.stat-card.clientes::before {
    background: var(--sk-primary);
}

.stat-card:hover {
    border-color: var(--sk-primary);
    box-shadow: 0 0 0 1px var(--sk-primary), var(--sk-shadow-md);
    transform: translateY(-2px);
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--sk-text);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sk-text-3);
    font-weight: 600;
}

/* ============================================================================
   8. TABLAS - ESTILOS PREMIUM
   ============================================================================ */

.table-container {
    background: var(--sk-surface);
    border: 1px solid var(--sk-border);
    border-radius: var(--sk-radius);
    overflow-x: auto;
    margin-bottom: 24px;
    -webkit-overflow-scrolling: touch;
}

.table-container::-webkit-scrollbar {
    height: 6px;
}

.table-container::-webkit-scrollbar-track {
    background: var(--sk-surface-2);
    border-radius: 3px;
}

.table-container::-webkit-scrollbar-thumb {
    background: var(--sk-text-3);
    border-radius: 3px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: var(--sk-text-2);
}

.table, .sk-table {
    width: 100%;
    border-collapse: collapse;
}

.table thead, .sk-table thead {
    background: var(--sk-surface-3);
}

.table th, .sk-table th {
    color: var(--sk-text-3);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 12px 16px;
    font-weight: 600;
    border-bottom: 1px solid var(--sk-border);
    text-align: left;
}

.table td, .sk-table td {
    padding: 14px 16px;
    font-size: 15px;
    color: var(--sk-text-2);
    border-bottom: 1px solid #1f1f1f;
}

.table tbody tr:hover, .sk-table tbody tr:hover {
    background: #1f1f1f;
}

.table tbody tr:last-child td, .sk-table tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================================================
   9. BOTONES - ESTILOS PREMIUM
   ============================================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--sk-font);
    font-size: 14px;
    font-weight: 500;
    padding: 12px 32px;
    border-radius: var(--sk-radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--sk-primary);
    color: var(--sk-primary-text);
    font-weight: 700;
}

.btn-primary:hover {
    background: var(--sk-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--sk-primary-glow);
}

.btn-secondary {
    background: var(--sk-surface-2);
    color: var(--sk-text);
    font-weight: 600;
    border: 1px solid var(--sk-border-2);
}

.btn-secondary:hover {
    border-color: var(--sk-primary);
    color: var(--sk-text);
    background: var(--sk-surface);
}

.btn-danger {
    background: var(--sk-danger);
    color: white;
}

.btn-danger:hover {
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-new {
    background: var(--sk-primary);
    color: var(--sk-primary-text);
    font-weight: 700;
    padding: 10px 20px;
    border-radius: var(--sk-radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: all 0.15s;
}

.btn-new:hover {
    background: var(--sk-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--sk-primary-glow);
}

/* ============================================================================
   9.5 BOTONES DE ACCION (iconos en tablas) - OSCURO
   ============================================================================ */

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--sk-border);
    background: var(--sk-surface-2);
    color: var(--sk-text-2);
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.06);
}

/* Brillo superior (gloss 3D) */
.btn-action::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0) 100%);
    border-radius: 8px 8px 0 0;
    pointer-events: none;
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.08);
}

.btn-view {
    background: linear-gradient(135deg, var(--sk-surface-2) 0%, #2a2a2a 100%);
    color: var(--sk-text-2);
    border-color: var(--sk-border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.06);
}
.btn-view:hover {
    background: linear-gradient(135deg, var(--sk-primary-light) 0%, rgba(245,197,24,0.2) 100%);
    color: var(--sk-primary);
    border-color: var(--sk-primary);
    box-shadow: 0 4px 12px rgba(245,197,24,0.15), inset 0 1px 0 rgba(255,255,255,0.08);
}

.btn-edit {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.08) 100%);
    color: var(--sk-warning);
    border-color: rgba(245, 158, 11, 0.3);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.06);
}
.btn-edit:hover {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.35) 0%, rgba(245, 158, 11, 0.2) 100%);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.5);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2), inset 0 1px 0 rgba(255,255,255,0.08);
}

.btn-success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(34, 197, 94, 0.08) 100%);
    color: var(--sk-success);
    border-color: rgba(34, 197, 94, 0.3);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.06);
}
.btn-success:hover {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.35) 0%, rgba(34, 197, 94, 0.2) 100%);
    color: #4ade80;
    border-color: rgba(34, 197, 94, 0.5);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2), inset 0 1px 0 rgba(255,255,255,0.08);
}

.btn-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.08) 100%);
    color: var(--sk-warning);
    border-color: rgba(245, 158, 11, 0.3);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.06);
}
.btn-warning:hover {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.35) 0%, rgba(245, 158, 11, 0.2) 100%);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.5);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2), inset 0 1px 0 rgba(255,255,255,0.08);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--sk-danger);
    border-color: rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #f87171;
}

.actions-buttons {
    display: flex;
    gap: 6px;
    white-space: nowrap;
}

/* ============================================================================
   10. BADGES - ESTILOS PREMIUM
   ============================================================================ */

.badge,
.sk-badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9999px;
    border: 1px solid transparent;
}

.badge-success,
.sk-badge-success {
    background: var(--sk-success-light);
    color: var(--sk-success);
    border-color: rgba(34, 197, 94, 0.2);
}

.badge-warning,
.sk-badge-warning {
    background: var(--sk-warning-light);
    color: var(--sk-warning);
    border-color: rgba(245, 158, 11, 0.2);
}

.badge-danger,
.sk-badge-danger {
    background: var(--sk-danger-light);
    color: var(--sk-danger);
    border-color: rgba(239, 68, 68, 0.2);
}

/* Stock badges */
.sk-stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    font-size: 0.85rem;
}
.sk-stock-low {
    color: var(--sk-danger);
}
.sk-stock-ok {
    color: var(--sk-success);
}



.badge-neutral,
.sk-badge-neutral {
    background: var(--sk-surface-2);
    color: var(--sk-text-3);
    border-color: var(--sk-border);
}

.sk-badge-lilac {
    background: rgba(168, 85, 247, 0.12);
    color: rgb(168, 85, 247);
    border-color: rgba(168, 85, 247, 0.2);
}

.sk-badge-info {
    background: rgba(59, 130, 246, 0.12);
    color: rgb(59, 130, 246);
    border-color: rgba(59, 130, 246, 0.2);
}

/* Status badges para productos */
.sk-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.sk-status-active {
    background: var(--sk-success-light, rgba(34, 197, 94, 0.12));
    color: var(--sk-success, #16a34a);
    border-color: rgba(34, 197, 94, 0.2);
}
.sk-status-inactive {
    background: rgba(249, 115, 22, 0.12);
    color: #ea580c;
    border-color: rgba(249, 115, 22, 0.2);
}
.sk-status-archived {
    background: #f3f4f6;
    color: #6b7280;
    border-color: rgba(107, 114, 128, 0.2);
}

/* Status badges for list pages (pedidos_cliente, albaranes, proveedores, etc.) */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid transparent;
}
/* Eliminado: pseudo-elemento punto decorativo que se veia sobredimensionado */
.status-borrador {
    background: var(--sk-surface-2);
    color: var(--sk-text-2);
    border-color: var(--sk-border);
}
.status-pendiente {
    background: var(--sk-warning-light);
    color: var(--sk-warning);
    border-color: rgba(245, 158, 11, 0.2);
}
.status-aceptado, .status-pagada, .status-cobrada, .status-completado, .status-entregado, .status-recibido, .status-pedido_generado {
    background: var(--sk-success-light);
    color: var(--sk-success);
    border-color: rgba(34, 197, 94, 0.2);
}
.status-enviado, .status-expirado, .status-procesando {
    background: var(--sk-warning-light);
    color: var(--sk-warning);
    border-color: rgba(245, 158, 11, 0.2);
}
.status-en_proceso, .status-facturado {
    background: var(--sk-info-light);
    color: var(--sk-info);
    border-color: rgba(59, 130, 246, 0.2);
}
.status-albaran_generado {
    background: var(--sk-teal-light);
    color: var(--sk-teal);
    border-color: var(--sk-teal-border);
}
.status-rechazado, .status-cancelado, .status-anulada, .status-inactivo {
    background: var(--sk-danger-light);
    color: var(--sk-danger);
    border-color: rgba(239, 68, 68, 0.2);
}

.status-rectificada {
    background: var(--sk-purple-light);
    color: var(--sk-purple);
    border-color: var(--sk-purple-border);
}

.status-active {
    background: var(--sk-success-light);
    color: var(--sk-success);
    border-color: rgba(34, 197, 94, 0.2);
}

.status-archived {
    background: #f3f4f6;
    color: #6b7280;
    border-color: rgba(107, 114, 128, 0.2);
    text-decoration: line-through;
}

/* status-rectificativa eliminado - usar status-rectificada (rojo) en su lugar */

/* ============================================================================
   10.5. TÃTULOS CLICKEABLES
   ============================================================================ */

.clickable-title {
    text-decoration: none;
    color: inherit;
    display: inline-block;
    transition: all 0.2s;
}

.clickable-title:hover {
    color: var(--sk-primary);
    text-decoration: underline;
    text-decoration-color: var(--sk-primary);
    text-underline-offset: 3px;
}

.clickable-title strong {
    font-weight: 600;
}

/* ============================================================================
   11. FORMULARIOS - ESTILOS PREMIUM
   ============================================================================ */

.form-container {
    background: var(--sk-surface);
    border: 1px solid var(--sk-border);
    border-radius: var(--sk-radius);
    padding: 32px;
    max-width: 720px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--sk-text-3);
    font-weight: 600;
    margin-bottom: 8px;
}


/* ============================================================================
   REGLAS GENERALES PARA TODOS LOS FORMULARIOS
   ============================================================================ */
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    background: var(--sk-surface-2) !important;
    color: var(--sk-text) !important;
    border: 1px solid var(--sk-border-2) !important;
    font-family: var(--sk-font) !important;
}

input::placeholder,
textarea::placeholder {
    color: var(--sk-text-3) !important;
    opacity: 1 !important;
}

/* Para opciones de select en tema oscuro */
select option {
    background: var(--sk-surface-2) !important;
    color: var(--sk-text) !important;
}

/* Estados de focus */
input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
    border-color: var(--sk-primary) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(245, 197, 24, 0.15) !important;
}

/* ============================================================================
   CLASES ESPECÃFICAS DE FORMULARIO (compatibilidad)
   ============================================================================ */.form-control {
    width: 100%;
    background: var(--sk-surface-2);
    border: 1px solid var(--sk-border-2);
    color: var(--sk-text);
    border-radius: var(--sk-radius-sm);
    padding: 10px 14px;
    font-size: 14px;
    font-family: var(--sk-font);
    transition: all 0.2s;
}

.form-control:focus {
    border-color: var(--sk-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(245, 197, 24, 0.15);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23606060' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* ============================================================================
   12. BUSCADOR MEJORADO CON FILTROS
   ============================================================================ */

.filters-container {
    background: var(--sk-surface);
    border: 1px solid var(--sk-border);
    border-radius: var(--sk-radius);
    padding: 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-label {
    font-size: 12px;
    color: var(--sk-text-3);
    white-space: nowrap;
}

.filter-input {
    background: var(--sk-surface-2);
    border: 1px solid var(--sk-border-2);
    color: var(--sk-text);
    border-radius: var(--sk-radius-sm);
    padding: 8px 12px;
    font-size: 13px;
    min-width: 200px;
}

.filter-select {
    background: var(--sk-surface-2);
    border: 1px solid var(--sk-border-2);
    color: var(--sk-text);
    border-radius: var(--sk-radius-sm);
    padding: 8px 12px;
    font-size: 13px;
    min-width: 140px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23606060' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px;
    padding-right: 32px;
}

.clear-filters {
    margin-left: auto;
    background: var(--sk-primary);
    color: #ffffff;
    font-weight: 700;
    border: 1px solid var(--sk-border-2);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.clear-filters:hover {
    background: var(--sk-primary-hover);
    color: #ffffff;
    border-color: var(--sk-border-2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--sk-primary-glow);
}

/* ============================================================================
   13. LOGIN - ESTILOS PREMIUM
   ============================================================================ */

.login-body {
    background: var(--sk-bg);
    background-image: radial-gradient(ellipse at 50% 0%, rgba(245, 197, 24, 0.08) 0%, transparent 60%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: var(--sk-surface);
    border: 1px solid var(--sk-border);
    width: 400px;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
}

.login-logo {
    color: var(--sk-primary);
    font-size: 24px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 32px;
    letter-spacing: -0.5px;
}

/* ============================================================================
   14. UTILIDADES
   ============================================================================ */

.separator {
    height: 1px;
    background: var(--sk-border);
    margin: 24px 0;
}

/* ============================================================================
   14.5 SISTEMA DE ALERTAS (sk-alert) Y COMPONENTES SK-SISTEMA
   ============================================================================ */

.sk-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}
.sk-alert-icon { font-size: 18px; flex-shrink: 0; }
.sk-alert-body { flex: 1; color: var(--sk-text); }
.sk-alert-success {
    background: var(--sk-success-light);
    border: 1px solid rgba(34,197,94,0.3);
    color: var(--sk-text);
}
.sk-alert-danger {
    background: var(--sk-danger-light);
    border: 1px solid rgba(239,68,68,0.3);
    color: var(--sk-text);
}
.sk-alert-warning {
    background: var(--sk-warning-light);
    border: 1px solid rgba(245,158,11,0.3);
    color: var(--sk-text);
}
.sk-alert-info {
    background: var(--sk-primary-light);
    border: 1px solid var(--sk-primary-glow);
    color: var(--sk-text);
}

.sk-btn-close {
    background: transparent;
    border: none;
    color: var(--sk-text-3);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
}
.sk-btn-close:hover { background: rgba(255,255,255,0.08); }

.sk-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--sk-font);
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    white-space: nowrap;
}
.sk-btn-sm { padding: 6px 14px; font-size: 13px; }
.sk-btn-primary {
    background: var(--sk-primary);
    color: var(--sk-primary-text);
}
.sk-btn-primary:hover {
    background: var(--sk-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--sk-primary-glow);
}
.sk-btn-secondary {
    background: var(--sk-surface-2);
    color: var(--sk-text-2);
    border: 1px solid var(--sk-border-2);
}
.sk-btn-secondary:hover {
    border-color: var(--sk-primary);
    color: var(--sk-text);
    background: var(--sk-surface);
}

.sk-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: var(--sk-radius-sm);
    border: 1px solid transparent;
    background: transparent;
    color: var(--sk-text-3);
    text-decoration: none;
    transition: all 0.15s;
    cursor: pointer;
    padding: 0;
    font-family: var(--sk-font);
}
.sk-btn-icon:hover {
    background: var(--sk-surface-2);
    border-color: var(--sk-border-2);
    color: var(--sk-text);
}
.sk-btn-icon svg {
    width: 16px;
    height: 16px;
    pointer-events: none;
}
.sk-btn-icon--edit   { color: #60a5fa; }
.sk-btn-icon--edit:hover   { background: rgba(96,165,250,0.12); border-color: rgba(96,165,250,0.3); color: #93c5fd; }
.sk-btn-icon--success { color: var(--sk-success); }
.sk-btn-icon--success:hover { background: rgba(34,197,94,0.12); border-color: rgba(34,197,94,0.3); color: #4ade80; }
.sk-btn-icon--info   { color: var(--sk-info); }
.sk-btn-icon--info:hover   { background: rgba(59,130,246,0.12); border-color: rgba(59,130,246,0.3); color: #93c5fd; }
.sk-btn-icon--warning { color: var(--sk-warning); }
.sk-btn-icon--warning:hover { background: rgba(245,158,11,0.12); border-color: rgba(245,158,11,0.3); color: #fcd34d; }
.sk-btn-icon--danger { color: var(--sk-danger); }
.sk-btn-icon--danger:hover { background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.3); color: #f87171; }
.sk-btn-icon--muted  { color: var(--sk-text-3); }
.sk-btn-icon--muted:hover  { background: var(--sk-surface-2); border-color: var(--sk-border-2); color: var(--sk-text-2); }

.sk-btn-icon--disabled {
    opacity: 0.3;
    pointer-events: none;
    cursor: not-allowed;
}

.sk-clickable {
    color: var(--sk-primary);
    text-decoration: none;
    font-weight: 700;
    transition: color 0.15s;
}
.sk-clickable:hover {
    color: var(--sk-primary-hover);
}

.sk-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding-right: 12px;
    white-space: nowrap;
}
@media (max-width: 640px) {
    .sk-actions { gap: 4px; padding-right: 4px; }
    .sk-actions i[data-lucide] { width: 16px !important; height: 16px !important; }
    .sk-actions .sk-btn-icon { width: 26px; height: 26px; }
}
/* Uniform icon sizing inside action bars â€” overrides inline styles */
.sk-actions i[data-lucide] {
    width: 18px !important;
    height: 18px !important;
}

/* Actions column in list tables: fixed width, padding-right for room at end */
.sk-card .sk-table td:last-child {
    width: auto;
    min-width: unset;
    padding-right: 16px;
}

.sk-card .sk-table th:last-child {
    min-width: 200px;
    text-align: center;
}

/* === Presupuestos: layout fijo definitivo de columnas === */
.sk-table:has(#tabla-presupuestos) {
    table-layout: fixed;
    width: 100%;
}

/* Column widths â€” via thead > th (respected under table-layout:fixed) */
.sk-table:has(#tabla-presupuestos) th:nth-child(1) { width: 160px; }
.sk-table:has(#tabla-presupuestos) th:nth-child(2) { width: 160px; }
.sk-table:has(#tabla-presupuestos) th:nth-child(3) { width: 110px; }
.sk-table:has(#tabla-presupuestos) th:nth-child(4) { width: 120px; }
.sk-table:has(#tabla-presupuestos) th:nth-child(5) { width: 90px; }
.sk-table:has(#tabla-presupuestos) th:nth-child(6) { width: 90px; }
.sk-table:has(#tabla-presupuestos) th:nth-child(7) { width: 100px; }
.sk-table:has(#tabla-presupuestos) th:nth-child(8) { width: 155px; }
.sk-table:has(#tabla-presupuestos) th:nth-child(9) { width: 200px; }

/* Redundant td widths to enforce in all rows */
#tabla-presupuestos td:nth-child(8) {
    overflow: hidden;
    white-space: nowrap;
}
/* Estado badge: max-width so it doesn't creep into Acciones */
#tabla-presupuestos td:nth-child(8) span {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
    font-size: 12px;
    padding: 3px 8px;
}
/* Acciones: contenedor flex dentro del td */
#tabla-presupuestos td:nth-child(9) .sk-actions {
    display: flex;
    gap: 7px;
    align-items: center;
    justify-content: flex-end;
    padding-right: 12px;
}

.sk-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    margin-top: 24px;
}

.stat-meta {
    font-size: 12px;
    color: var(--sk-text-3);
    margin-top: 8px;
}

.sk-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--sk-text-3);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-text {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--sk-text-2);
}

.empty-subtext {
    font-size: 13px;
    color: var(--sk-text-3);
}

/* Estado vacÃ­o con prefijo sk- (usado en tablas) */
.sk-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--sk-text-3);
}
.sk-empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.4;
}
.sk-empty-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--sk-text-2);
    margin-bottom: 6px;
}
.sk-empty-subtext {
    font-size: 13px;
    color: var(--sk-text-3);
}
.sk-empty-subtext a {
    color: var(--sk-text-2);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.sk-empty-subtext a:hover {
    color: var(--sk-text);
}

/* ============================================================================
   15. RESPONSIVE
   ============================================================================ */

@media (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }
    
    .main-content {
        margin-left: 200px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 16px;
    }
    
    .filters-container {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-input,
    .filter-select {
        min-width: 0;
        flex: 1;
    }
    
    .clear-filters {
        margin-left: 0;
        width: 100%;
    }
}

/* ============================================================================
   @media (max-width: 480px) {
  .sk-table th,
  .sk-table td {
    padding: 10px 10px;
  }
  .sk-table td:last-child .sk-actions {
    flex-wrap: wrap;
    gap: 4px;
  }
  .sk-page-header h1 {
    font-size: 1.25rem;
  }
}

16. ANIMACIONES Y TRANSICIONES
   ============================================================================ */

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================================
   17. ESTILOS ESPECÃFICOS PARA TEMPLATES
   ============================================================================ */

/* Dashboard */
.dashboard-welcome {
    font-size: 18px;
    color: var(--sk-text-2);
    margin-bottom: 24px;
}

/* Resumen fiscal */
.tax-highlight {
    background: var(--sk-surface-2);
    border-left: 4px solid var(--sk-primary);
    padding: 16px;
    border-radius: var(--sk-radius-sm);
    margin: 16px 0;
}

.tax-note {
    font-size: 12px;
    color: var(--sk-text-3);
    line-height: 1.6;
    margin-top: 16px;
}

/* ============================================================================
   18. ESTILOS PARA IMPRESIÃ“N
   ============================================================================ */

@media print {
    .sidebar,
    .action-buttons,
    .btn-new,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
        padding: 0;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .table-container {
        border: 1px solid #ddd;
        box-shadow: none;
    }
}

/* ============================================================================
   19. MENSAJES FLASH (Ã‰XITO/ERROR)
   ============================================================================ */

.msg-exito {
    background: var(--sk-success-light);
    color: var(--sk-success);
    border-left: 3px solid var(--sk-success);
    padding: 10px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 500;
}

.msg-error {
    background: var(--sk-danger-light);
    color: var(--sk-danger);
    border-left: 3px solid var(--sk-danger);
    padding: 10px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 500;
}



/* ============================================================================
   20. TABS SISTEMA (Dashboard, config, resÃºmenes)
   ============================================================================ */

.sk-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--sk-border, var(--sk-border));
    margin-bottom: var(--sk-space-6, 24px);
}

.sk-tab {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    color: var(--sk-text-3, var(--sk-text-3));
    font-weight: 600;
    font-size: var(--sk-text-base, 13px);
    cursor: pointer;
    transition: color var(--sk-transition, 0.15s), border-color var(--sk-transition, 0.15s);
    font-family: var(--sk-font, var(--sk-font));
}
.sk-tab:hover { color: var(--sk-text, var(--sk-text)); }
.sk-tab.active {
    color: var(--sk-primary, var(--sk-primary));
    border-bottom-color: var(--sk-primary, var(--sk-primary));
}

.sk-tab-panel { display: none; }
.sk-tab-panel.active { display: block; }

@media (max-width: 640px) {
    .sk-tabs { overflow-x: auto; gap: 0; }
    .sk-tab { white-space: nowrap; padding: 10px 14px; font-size: 12px; }
}
/* ============================================================================
   TABLA DE LÃNEAS (facturas, presupuestos, albaranes, pedidos)
   ============================================================================ */
.lineas-table { width: 100%; border-collapse: collapse; }
.lineas-table th {
    background: var(--sk-surface-3);
    padding: 10px 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--sk-text-3);
    text-align: left;
    border-bottom: 1px solid var(--sk-border);
}
.lineas-table td { padding: 6px 4px; border-bottom: 1px solid var(--sk-border); vertical-align: middle; }
.lineas-table tbody tr:last-child td { border-bottom: none; }
.lineas-table .linea-input,
.lineas-table .linea-input-sm {
    width: 100%;
    padding: 7px 8px;
    border: 1px solid var(--sk-border);
    border-radius: 5px;
    font-size: 13px;
    background: var(--sk-surface-2);
    color: var(--sk-text);
    box-sizing: border-box;
}
.lineas-table .linea-input:focus,
.lineas-table .linea-input-sm:focus {
    outline: none;
    border-color: var(--sk-primary);
    box-shadow: 0 0 0 2px rgba(245,197,24,.15);
}
.lineas-table .linea-input-sm { text-align: right; }
.lineas-table .linea-subtotal { text-align: right; font-weight: 600; color: var(--sk-text); font-size: 13px; white-space: nowrap; }
.btn-remove-line { background: none; border: none; color: var(--sk-danger); cursor: pointer; padding: 4px 6px; font-size: 18px; line-height: 1; border-radius: 4px; }
.btn-remove-line:hover { background: var(--sk-danger-light); }

/* ============================================================================
   PAGINADOR RESPONSIVE
   ============================================================================ */
@media (max-width: 640px) {
    div[style*="flex-wrap: wrap"] > *,
    .sk-pagination > * {
        font-size: 11px !important;
    }
    div[style*="flex-wrap: wrap"] > a,
    .sk-pagination a {
        padding: 3px 6px !important;
    }
    div[style*="flex-wrap: wrap"] + a,  /* sk-btn for stock.html */
    .sk-pagination .sk-btn-icon {
        padding: 3px 8px !important;
    }
    .sk-pagination {
        gap: 2px !important;
    }
    /* Hide total count span on very small screens */
    .sk-pagination > span:first-child {
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        margin-right: 4px !important;
    }
}

/* === PAGINACIÃ“N === */
.sk-pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.sk-page-btn {
    padding: 6px 12px;
    font-size: 13px;
    border: 1px solid var(--sk-border);
    border-radius: 6px;
    text-decoration: none;
    color: var(--sk-text);
    background: transparent;
    transition: all 0.15s;
}

.sk-page-btn:hover {
    background: var(--sk-hover);
    border-color: var(--sk-accent);
}

.sk-page-btn.active {
    background: var(--sk-accent);
    color: #000;
    border-color: var(--sk-accent);
    font-weight: 600;
    pointer-events: none;
}

.sk-page-btn.disabled {
    opacity: 0.35;
    pointer-events: none;
}

/* Center action icons in Clientes, Cobros, Proveedores, Pedidos Prov, Albaranes Ent, Gastos */
#tabla-clientes td:last-child .sk-actions,
#tabla-cobros td:last-child .sk-actions,
#tabla-proveedores td:last-child .sk-actions,
#tabla-albaranes-entrada td:last-child .sk-actions,
#tabla-pedidos-proveedor td:last-child .sk-actions,
#tabla-gastos td:last-child .sk-actions {
    justify-content: center;
    padding-right: 0;
}

/* ============================================================================
   ANIMACIONES SUTILES
   ============================================================================ */

@keyframes sk-fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.content-area {
    animation: sk-fadeIn 0.3s ease-out;
}
