/**
 * ATELIER SAAS - DARK FASHION MANAGEMENT SYSTEM
 * Premium Dark Luxury UI Design System
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
    /* 1. LIENZOS & SUPERFICIES (Cyber Space & Obsidian Indigo) */
    --bg-main: #090d16;
    --bg-surface: #121829;
    --bg-card: #121829;
    --bg-card-hover: #1a2238;
    --bg-input: #0d121f;
    --bg-modal: #121829;
    
    /* 2. BORDES Y DELIMITADORES */
    --border-color: rgba(129, 140, 248, 0.14);
    --border-color-focus: rgba(129, 140, 248, 0.55);
    --border-subtle: rgba(255, 255, 255, 0.04);
    
    /* 3. ACENTO Y ACCIONES (Cyber Violet & Indigo Eléctrico - Cero Amarillo) */
    --accent: #818cf8;
    --accent-hover: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.28);
    --accent-light: #c7d2fe;
    --accent-text: #ffffff;
    
    /* 4. JERARQUÍA TIPOGRÁFICA */
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* 5. ESTADOS SEMÁNTICOS (Colores Modernos Nítidos) */
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.14);
    --warning: #fb923c;
    --warning-bg: rgba(251, 146, 60, 0.14);
    --danger: #f43f5e;
    --danger-bg: rgba(244, 63, 94, 0.14);
    --info: #00D2FF;
    --info-bg: rgba(0, 210, 255, 0.14);
    
    /* 6. MEDIDAS Y SOMBRAS */
    --sidebar-width: 260px;
    --topbar-height: 70px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.6);
    --shadow-dropdown: 0 10px 30px -5px rgba(0, 0, 0, 0.8);
}

/* Base resets & typography */
* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.925rem;
    line-height: 1.55;
    letter-spacing: -0.01em;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .brand-font {
    font-family: 'Space Grotesk', sans-serif;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    font-weight: 600;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--accent-hover);
}

/* Layout Architecture */
.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar Styles */
.app-sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1030;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    height: var(--topbar-height);
    padding: 0.6rem 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
    background: transparent;
    overflow: hidden;
}

.sidebar-brand-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.sidebar-brand-link:hover {
    opacity: 0.95;
    transform: scale(1.02);
}

.brand-banner {
    max-width: 100%;
    max-height: 48px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    user-select: none;
}

/* Visibilidad de banners según tema activo */
.brand-banner-dark {
    display: block !important;
}

.brand-banner-light {
    display: none !important;
}

/* Temas claros (Modo Diurno / Blanco y Modo Beige) */
[data-theme="light"] .brand-banner-dark,
[data-theme="beige"] .brand-banner-dark {
    display: none !important;
}

[data-theme="light"] .brand-banner-light,
[data-theme="beige"] .brand-banner-light {
    display: block !important;
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #2a2a35, #171720);
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    font-weight: 700;
    box-shadow: 0 0 15px var(--accent-glow);
}

.brand-info h4 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.brand-info small {
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.sidebar-body {
    flex: 1;
    padding: 1.25rem 0.85rem;
    overflow-y: auto;
}

.sidebar-body::-webkit-scrollbar {
    width: 4px;
}
.sidebar-body::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

.sidebar-section-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 0.75rem 0.75rem 0.35rem;
    margin-top: 0.5rem;
}

.sidebar-nav .nav-item {
    margin-bottom: 3px;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 0.85rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.885rem;
    transition: all 0.15s ease-in-out;
}

.sidebar-nav .nav-link i {
    font-size: 1.1rem;
    color: var(--text-muted);
    transition: color 0.15s ease;
}

.sidebar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.sidebar-nav .nav-link:hover i {
    color: var(--accent);
}

.sidebar-nav .nav-link.active {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.15), rgba(212, 175, 55, 0.03));
    color: #ffffff;
    border-left: 3px solid var(--accent);
    font-weight: 600;
}

.sidebar-nav .nav-link.active i {
    color: var(--accent);
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background-color: rgba(0, 0, 0, 0.2);
}

.sidebar-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    margin-bottom: 0.4rem;
}

.sidebar-stat-row:last-child {
    margin-bottom: 0;
}

/* Main Content Area */
.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
}

/* Topbar Styles */
.app-topbar {
    height: var(--topbar-height);
    background-color: rgba(18, 18, 23, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1020;
    padding: 0 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar-search {
    position: relative;
    width: 320px;
}

.topbar-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.95rem;
}

.topbar-search input {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.45rem 0.85rem 0.45rem 2.2rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.topbar-search input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.season-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.user-dropdown-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s;
}

.user-dropdown-btn:hover {
    background: rgba(255, 255, 255, 0.04);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

/* Page Body */
.app-content {
    padding: 1.75rem;
    flex: 1;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 1.45rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.page-subtitle {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

/* UI Cards - Ambient Glass & Depth */
.card-dark {
    background-color: var(--bg-card);
    background-image: radial-gradient(at 0% 0%, rgba(255, 255, 255, 0.03) 0px, transparent 50%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 1.5rem;
    position: relative;
}

.card-dark:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 30px -5px rgba(0, 0, 0, 0.6);
}

.card-header-dark {
    padding: 1.1rem 1.35rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header-dark h5 {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.card-body-dark {
    padding: 1.35rem;
}

/* Metric / Stat Cards - Ambient Top Highlight & Hover Glow */
.stat-card {
    padding: 1.35rem 1.4rem;
    background-color: var(--bg-card);
    background-image: radial-gradient(at 100% 0%, rgba(212, 175, 55, 0.06) 0px, transparent 60%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.5), transparent);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: rgba(212, 175, 55, 0.35);
    box-shadow: 0 14px 30px -8px rgba(0, 0, 0, 0.7), 0 0 20px -5px var(--accent-glow);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-content .stat-label {
    font-size: 0.73rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    margin-bottom: 0.35rem;
}

.stat-content .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    color: #ffffff;
    margin: 0;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.stat-content .stat-detail {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 0.45rem;
    font-weight: 500;
}

.stat-icon {
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--accent);
    transition: all 0.2s ease;
}

.stat-card:hover .stat-icon {
    transform: scale(1.08);
    border-color: var(--accent);
    background: var(--accent-glow);
}

/* Forms & Inputs - Consistency is Key */
.form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #d4d4d8;
    margin-bottom: 0.4rem;
    letter-spacing: 0.01em;
}

.form-control {
    background-color: var(--bg-input) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-sm) !important;
    padding: 0.55rem 0.85rem !important;
    font-size: 0.885rem !important;
    transition: border-color 0.15s, box-shadow 0.15s !important;
}

.form-select {
    background-color: var(--bg-input) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-sm) !important;
    padding: 0.55rem 2.25rem 0.55rem 0.85rem !important;
    font-size: 0.885rem !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23818cf8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    background-size: 14px 10px !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    cursor: pointer !important;
    transition: border-color 0.15s, box-shadow 0.15s !important;
}

.form-control:focus, .form-select:focus {
    background-color: var(--bg-input) !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px var(--accent-glow) !important;
    color: #ffffff !important;
    outline: none !important;
}

.form-control::placeholder {
    color: var(--text-muted) !important;
    font-size: 0.85rem;
}

.form-select option {
    background-color: var(--bg-surface) !important;
    color: var(--text-primary) !important;
}

.input-group-text {
    background-color: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-muted) !important;
    font-size: 0.85rem !important;
}

/* Consistent Buttons */
.btn-gold {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #ffffff !important;
    border: none;
    font-weight: 700;
    font-size: 0.865rem;
    padding: 0.55rem 1.15rem;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-gold:hover {
    background: linear-gradient(135deg, var(--accent-hover), var(--accent));
    box-shadow: 0 6px 20px var(--accent-glow);
    transform: translateY(-1px);
    color: #ffffff !important;
}

.btn-dark-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    font-weight: 500;
    font-size: 0.865rem;
    padding: 0.55rem 1.15rem;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: all 0.15s ease;
}

.btn-dark-outline:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.btn-danger-outline {
    background: transparent;
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
    font-weight: 500;
    font-size: 0.865rem;
    padding: 0.55rem 1.15rem;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: all 0.15s ease;
}

.btn-danger-outline:hover {
    background: var(--danger-bg);
    border-color: var(--danger);
    color: #ffffff;
}

.btn-action {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    font-size: 0.85rem;
    transition: all 0.15s;
}

.btn-action:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-action.edit:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.btn-action.history:hover,
.btn-action.view:hover {
    color: #38bdf8;
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
}

.btn-action.delete:hover {
    color: var(--danger);
    border-color: var(--danger);
}

/* Modals - Strict Dark Luxury */
.modal-content {
    background-color: var(--bg-modal) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.8) !important;
    color: var(--text-primary) !important;
}

.modal-header {
    border-bottom: 1px solid var(--border-color) !important;
    padding: 1.25rem 1.5rem !important;
}

.modal-title {
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
}

.modal-body {
    padding: 1.5rem !important;
}

.modal-footer {
    border-top: 1px solid var(--border-color) !important;
    padding: 1rem 1.5rem !important;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Badges - Modern Rounded Pill with Soft Luminescence */
.badge {
    border-radius: 9999px !important;
    padding: 0.35rem 0.75rem !important;
    font-weight: 600 !important;
    font-size: 0.76rem !important;
    letter-spacing: 0.02em;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    line-height: 1.3 !important;
}

.badge-stock {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.68rem;
    font-size: 0.74rem;
    font-weight: 600;
    border-radius: 9999px;
    letter-spacing: 0.02em;
}

.badge-stock.badge-ok {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-stock.badge-low {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-stock.badge-out {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-season {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    display: inline-block;
}

.badge-season-winter { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-season-summer { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-season-spring { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-season-autumn { background: rgba(217, 119, 6, 0.15); color: #f59e0b; border: 1px solid rgba(217, 119, 6, 0.3); }
.badge-season-all    { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.3); }

.color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    vertical-align: middle;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* DataTables & Modern Table Styling */
table.dataTable {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    width: 100% !important;
    color: var(--text-primary) !important;
    margin-top: 0.75rem !important;
    margin-bottom: 0.75rem !important;
}

.table-dark-custom {
    background: transparent !important;
}

.table-dark-custom thead th {
    background-color: rgba(0, 0, 0, 0.25) !important;
    color: #94a3b8 !important;
    font-size: 0.73rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding: 0.9rem 1rem !important;
}

.table-dark-custom tbody td {
    background-color: transparent !important;
    color: var(--text-primary) !important;
    border-bottom: 1px solid var(--border-subtle) !important;
    padding: 0.95rem 1rem !important;
    vertical-align: middle !important;
    font-size: 0.875rem !important;
}

.table-dark-custom tbody tr {
    transition: background-color 0.18s ease;
}

.table-dark-custom tbody tr:hover td {
    background-color: rgba(255, 255, 255, 0.035) !important;
}

div.dataTables_wrapper div.dataTables_length,
div.dt-container div.dt-length {
    color: var(--text-secondary) !important;
    font-size: 0.85rem !important;
    margin-bottom: 0.5rem !important;
}

div.dataTables_wrapper div.dataTables_length label,
div.dt-container div.dt-length label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
    color: var(--text-secondary) !important;
    font-size: 0.85rem !important;
}

div.dataTables_wrapper div.dataTables_length select,
div.dt-container div.dt-length select,
.dataTables_length select,
.dt-length select,
select[name$="_length"] {
    display: inline-block !important;
    width: auto !important;
    min-width: 76px !important;
    height: 35px !important;
    padding: 0.35rem 1.85rem 0.35rem 0.75rem !important;
    background-color: var(--bg-input) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-sm) !important;
    font-size: 0.85rem !important;
    line-height: 1.4 !important;
    vertical-align: middle !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23d4af37' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.6rem center !important;
    background-size: 12px 9px !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    cursor: pointer !important;
    margin: 0 0.35rem !important;
}

div.dataTables_wrapper div.dataTables_filter,
div.dt-container div.dt-search {
    text-align: right !important;
    margin-bottom: 0.5rem !important;
}

div.dataTables_wrapper div.dataTables_filter label,
div.dt-container div.dt-search label {
    display: inline-flex !important;
    align-items: center !important;
    color: var(--text-secondary) !important;
    font-size: 0.85rem !important;
}

div.dataTables_wrapper div.dataTables_filter input,
div.dt-container div.dt-search input {
    background-color: var(--bg-input) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-sm) !important;
    padding: 0.38rem 0.85rem !important;
    font-size: 0.85rem !important;
    margin-left: 0.5rem !important;
}

div.dataTables_wrapper div.dataTables_info {
    color: var(--text-muted) !important;
    font-size: 0.82rem !important;
    padding-top: 0.85rem !important;
}

div.dataTables_wrapper div.dataTables_paginate ul.pagination {
    margin-top: 0.85rem !important;
    gap: 3px;
}

.page-item .page-link {
    background-color: var(--bg-input) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-secondary) !important;
    font-size: 0.8rem !important;
    border-radius: var(--radius-sm) !important;
    padding: 0.35rem 0.75rem !important;
}

.page-item.active .page-link {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #09090b !important;
    font-weight: 700 !important;
}

.page-item.disabled .page-link {
    color: var(--text-muted) !important;
    opacity: 0.5 !important;
}

/* Image Upload Previews */
.image-upload-wrapper {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    text-align: center;
    background: rgba(0,0,0,0.2);
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.image-upload-wrapper:hover {
    border-color: var(--accent);
}

.image-preview-box {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 1px solid var(--border-color);
    background-color: var(--bg-input);
}

/* POS / Sales Module Specifics */
.pos-cart-panel {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
    position: sticky;
    top: calc(var(--topbar-height) + 15px);
}

.pos-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.pos-cart-item {
    background-color: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    margin-bottom: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.pos-cart-footer {
    padding: 1.25rem;
    border-top: 1px solid var(--border-color);
    background-color: rgba(0, 0, 0, 0.2);
}

.pos-product-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.15s;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.pos-product-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* SweetAlert Dark Theme Override */
div.swal2-popup.swal2-modal {
    background: var(--bg-modal) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-md) !important;
}

div.swal2-popup .swal2-title {
    color: var(--text-primary) !important;
    font-family: 'Space Grotesk', sans-serif !important;
}

div.swal2-popup .swal2-html-container {
    color: var(--text-secondary) !important;
}

div.swal2-popup .swal2-confirm {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover)) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    border-radius: var(--radius-sm) !important;
    box-shadow: 0 4px 14px var(--accent-glow) !important;
}

div.swal2-popup .swal2-cancel {
    background: transparent !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-sm) !important;
}

/* Auth Page specific */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1rem;
    position: relative;
    overflow: hidden;
    background: transparent !important;
    z-index: 10;
}

.auth-canvas-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

/* Ambient Glow Orbs: Cian (#00D2FF) y Azul Eléctrico (#0072FF) */
.auth-ambient-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    -webkit-filter: blur(100px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.55;
    animation: floatGlow 14s ease-in-out infinite alternate;
}

.auth-ambient-glow.glow-1,
.auth-ambient-glow.glow-cyan {
    width: 520px;
    height: 520px;
    top: -120px;
    left: -100px;
    background: radial-gradient(circle, rgba(0, 210, 255, 0.35) 0%, rgba(0, 210, 255, 0.05) 65%, transparent 100%);
}

.auth-ambient-glow.glow-2,
.auth-ambient-glow.glow-blue {
    width: 560px;
    height: 560px;
    bottom: -140px;
    right: -120px;
    background: radial-gradient(circle, rgba(0, 114, 255, 0.35) 0%, rgba(0, 114, 255, 0.05) 65%, transparent 100%);
    animation-delay: -5s;
}

.auth-ambient-glow.glow-3,
.auth-ambient-glow.glow-center {
    width: 420px;
    height: 420px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(0, 210, 255, 0.18) 0%, rgba(0, 114, 255, 0.06) 60%, transparent 100%);
    animation-delay: -9s;
}

@keyframes floatGlow {
    0% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(30px) scale(1.08);
    }
    100% {
        transform: translateY(-25px) scale(0.95);
    }
}

.auth-card {
    width: 100%;
    max-width: 480px;
    background-color: rgba(11, 17, 32, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 210, 255, 0.28);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.95), 0 0 35px -10px rgba(0, 210, 255, 0.25);
    padding: 2.25rem;
    position: relative;
    z-index: 1;
}

/* Offcanvas Sidebar for Mobile */
@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
    }
    .app-sidebar.show-mobile {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.8);
    }
    .app-main {
        margin-left: 0;
    }
    .topbar-search {
        width: 200px;
    }
}

/* Clothing System Custom Styling */
.clothing-family-bar {
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.btn-size-tag {
    min-width: 42px;
    font-weight: 600;
    transition: all 0.15s ease;
}

.btn-color-tag {
    font-weight: 500;
    transition: all 0.15s ease;
}

.btn-size-tag.active, .btn-color-tag.active {
    border-color: var(--accent) !important;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover)) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 0 14px var(--accent-glow) !important;
}

.matrix-row input {
    background-color: var(--bg-input) !important;
    border-color: var(--border-color) !important;
}

.matrix-row input:focus {
    border-color: var(--accent) !important;
}

/* Image Lightbox & Zoom Viewer */
.img-zoomable {
    cursor: zoom-in !important;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}
.img-zoomable:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 16px var(--accent-glow) !important;
    position: relative;
    z-index: 10;
}
.lightbox-modal-content {
    background: transparent !important;
    border: none !important;
}
.lightbox-img-view {
    max-height: 80vh;
    max-width: 90vw;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.9);
}

/* ========================================================================= */
/* 4 TEMAS PROFESIONALES DE BOUTIQUE & RETAIL (CERO AMARILLOS) */
/* ========================================================================= */

/* 1. TEMA PRINCIPAL: CYBER VIOLET & ROYAL INDIGO */
[data-theme="nordic"], [data-theme="luxury-dark"] {
    --bg-main: #090d16;
    --bg-surface: #121829;
    --bg-card: #121829;
    --bg-card-hover: #1a2238;
    --bg-input: #0d121f;
    --bg-modal: #121829;
    --border-color: rgba(129, 140, 248, 0.14);
    --border-color-focus: rgba(129, 140, 248, 0.55);
    --border-subtle: rgba(255, 255, 255, 0.04);
    --accent: #818cf8;
    --accent-hover: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.28);
    --accent-light: #c7d2fe;
    --accent-text: #ffffff;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
}
[data-theme="nordic"] .btn-gold, [data-theme="luxury-dark"] .btn-gold {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}
[data-theme="nordic"] .btn-gold:hover, [data-theme="luxury-dark"] .btn-gold:hover {
    background: linear-gradient(135deg, #818cf8, #7c3aed);
    box-shadow: 0 6px 22px rgba(99, 102, 241, 0.45);
}

/* 2. TEMA NEON CYAN & ELECTRIC BLUE */
[data-theme="indigo"], [data-theme="cyan"] {
    --bg-main: #050a12;
    --bg-surface: #0b1424;
    --bg-card: #0b1424;
    --bg-card-hover: #121e33;
    --bg-input: #070d18;
    --bg-modal: #0b1424;
    --border-color: rgba(0, 210, 255, 0.16);
    --border-color-focus: rgba(0, 210, 255, 0.55);
    --border-subtle: rgba(255, 255, 255, 0.04);
    --accent: #00D2FF;
    --accent-hover: #0072FF;
    --accent-glow: rgba(0, 210, 255, 0.3);
    --accent-light: #bae6fd;
    --accent-text: #ffffff;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
}
[data-theme="indigo"] .btn-gold, [data-theme="cyan"] .btn-gold {
    background: linear-gradient(135deg, #00D2FF, #0072FF);
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0, 210, 255, 0.35);
}
[data-theme="indigo"] .btn-gold:hover, [data-theme="cyan"] .btn-gold:hover {
    background: linear-gradient(135deg, #38bdf8, #0284c7);
    box-shadow: 0 6px 22px rgba(0, 210, 255, 0.45);
}

/* 3. TEMA EMERALD & MINT AURORA */
[data-theme="emerald"] {
    --bg-main: #050d0a;
    --bg-surface: #0c1a14;
    --bg-card: #0c1a14;
    --bg-card-hover: #142820;
    --bg-input: #07120d;
    --bg-modal: #0c1a14;
    --border-color: rgba(16, 185, 129, 0.18);
    --border-color-focus: rgba(16, 185, 129, 0.55);
    --border-subtle: rgba(255, 255, 255, 0.04);
    --accent: #10b981;
    --accent-hover: #059669;
    --accent-glow: rgba(16, 185, 129, 0.3);
    --accent-light: #a7f3d0;
    --accent-text: #ffffff;
    --text-primary: #f0fdf4;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
}
[data-theme="emerald"] .btn-gold {
    background: linear-gradient(135deg, #10b981, #06b6d4);
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
}
[data-theme="emerald"] .btn-gold:hover {
    background: linear-gradient(135deg, #34d399, #0891b2);
    box-shadow: 0 6px 22px rgba(16, 185, 129, 0.45);
}

/* 4. TEMA SUNSET CRIMSON & ELECTRIC ROSE */
[data-theme="slate"], [data-theme="rose"] {
    --bg-main: #0d070f;
    --bg-surface: #170e1c;
    --bg-card: #170e1c;
    --bg-card-hover: #23152b;
    --bg-input: #0f0813;
    --bg-modal: #170e1c;
    --border-color: rgba(244, 63, 94, 0.18);
    --border-color-focus: rgba(244, 63, 94, 0.55);
    --border-subtle: rgba(255, 255, 255, 0.05);
    --accent: #f43f5e;
    --accent-hover: #e11d48;
    --accent-glow: rgba(244, 63, 94, 0.3);
    --accent-light: #fecdd3;
    --accent-text: #ffffff;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
}
[data-theme="slate"] .btn-gold, [data-theme="rose"] .btn-gold {
    background: linear-gradient(135deg, #f43f5e, #ec4899);
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(244, 63, 94, 0.35);
}
[data-theme="slate"] .btn-gold:hover, [data-theme="rose"] .btn-gold:hover {
    background: linear-gradient(135deg, #fb7185, #db2777);
    box-shadow: 0 6px 22px rgba(244, 63, 94, 0.45);
}

/* Modern Non-Yellow Text & Badge Overrides */
.text-warning {
    color: var(--accent) !important;
}
.border-warning {
    border-color: var(--accent) !important;
}
.badge.bg-warning, .badge.text-bg-warning {
    background: var(--accent-glow) !important;
    color: var(--accent) !important;
    border: 1px solid var(--accent) !important;
}

/* Selector Visual de Temas en Configuración */
.theme-picker-card {
    border-radius: var(--radius-md);
    padding: 1.25rem 1rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 2px solid transparent;
    text-align: center;
}
.theme-picker-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.theme-picker-card.active {
    border-color: var(--accent) !important;
    box-shadow: 0 0 18px var(--accent-glow) !important;
}
.theme-preview-palette {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 0.75rem;
}
.palette-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.2);
}

/* ========================================================================= */
/* SWEETALERT2 DARK & TOAST LUXURY THEME */
/* ========================================================================= */
.swal2-popup {
    background: #18181b !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
    border-radius: var(--radius-md) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7) !important;
    font-family: var(--font-sans) !important;
}

.swal2-title {
    color: #ffffff !important;
    font-family: var(--font-sans) !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
}

.swal2-html-container {
    color: #d4d4d8 !important;
    font-size: 0.92rem !important;
}

/* SweetAlert2 Toast Styles (Top Right) */
.swal2-popup.swal2-toast,
.swal2-toast-dark {
    background: #18181b !important;
    border: 1px solid rgba(212, 175, 55, 0.4) !important;
    color: #ffffff !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8) !important;
    border-radius: var(--radius-sm) !important;
    padding: 0.75rem 1.15rem !important;
}

.swal2-toast .swal2-title {
    color: #ffffff !important;
    font-size: 0.92rem !important;
    font-weight: 600 !important;
    margin: 0 !important;
}

.swal2-toast .swal2-html-container {
    color: #a1a1aa !important;
    font-size: 0.82rem !important;
}

.swal2-timer-progress-bar {
    background: var(--accent) !important;
}

.swal2-icon.swal2-success {
    border-color: #22c55e !important;
    color: #22c55e !important;
}

.swal2-icon.swal2-success [class^='swal2-success-line'] {
    background-color: #22c55e !important;
}

.swal2-icon.swal2-success .swal2-success-ring {
    border-color: rgba(34, 197, 94, 0.3) !important;
}

/* ========================================================================= */
/* MODERN POS & PRODUCT CARD STYLES */
/* ========================================================================= */
.pos-product-card {
    border-radius: var(--radius-md) !important;
    overflow: hidden;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border: 1px solid var(--border-color) !important;
    background: var(--bg-card) !important;
    position: relative;
}

.pos-product-card:hover:not(.opacity-50) {
    transform: translateY(-4px) !important;
    border-color: rgba(212, 175, 55, 0.45) !important;
    box-shadow: 0 14px 28px -6px rgba(0, 0, 0, 0.75), 0 0 16px -4px var(--accent-glow) !important;
}

.pos-product-img-wrapper {
    position: relative;
    overflow: hidden;
    background: #000;
    height: 125px;
}

.pos-product-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pos-product-card:hover:not(.opacity-50) .pos-product-img-wrapper img {
    transform: scale(1.08);
}

.pos-price-pill {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: rgba(9, 9, 11, 0.88);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(212, 175, 55, 0.35);
    color: #f3e5ab;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.pos-stock-pill {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(16, 185, 129, 0.22);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #34d399;
    font-weight: 700;
    font-size: 0.72rem;
    padding: 0.15rem 0.45rem;
    border-radius: 9999px;
}

.pos-stock-pill.low {
    background: rgba(245, 158, 11, 0.22);
    border-color: rgba(245, 158, 11, 0.35);
    color: #fbbf24;
}

.pos-stock-pill.out {
    background: rgba(239, 68, 68, 0.22);
    border-color: rgba(239, 68, 68, 0.35);
    color: #f87171;
}

.cart-item-row {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.75rem;
    margin-bottom: 0.5rem;
    transition: all 0.15s ease;
}

.cart-item-row:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(212, 175, 55, 0.25);
}



