/* ==========================================================================
   URBAN STORE - PREMIUM DESIGN SYSTEM (STREETWEAR & LUXURY CONSOLE)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. VARIABLES & CORE TOKENS
   -------------------------------------------------------------------------- */
:root {
    /* Color Palette */
    --primary-emerald: #10b981;
    --primary-emerald-hover: #059669;
    --accent-mint: #d1fae5;
    --accent-mint-text: #065f46;
    
    --bg-slate-light: #f8fafc;
    --bg-slate-gray: #f1f5f9;
    --bg-white: #ffffff;
    
    --dark-obsidian: #1e2530;   /* Gris Espacial Mate (Premium Space-Grey) */
    --dark-charcoal: #2a3240;   /* Gris Titanio Medio (Titanium Accent) */
    --dark-card-hover: #3b4454; /* Gris Slate Activo (Hover Slate Highlight) */
    
    --text-primary: #1e293b;
    --text-muted: #64748b;
    --text-light: #f8fafc;
    
    /* Semantic Colors */
    --success: #10b981;
    --success-bg: #ecfdf5;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --info: #3b82f6;
    --info-bg: #eff6ff;

    /* Borders & Shadows */
    --border-gray: #e2e8f0;
    --border-dark: #3d4756;    /* Borde Gris Titanio Fino */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05);
    --shadow-glow: 0 0 15px rgba(16, 185, 129, 0.2);

    /* Fonts */
    --font-display: 'Outfit', -apple-system, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, sans-serif;
}

/* --------------------------------------------------------------------------
   2. GENERAL RESETS & SCROLLBAR
   -------------------------------------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-body);
}

body {
    background: var(--bg-slate-light);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Custom Premium Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 100px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Typography Headings */
h1, h2, h3, h4, .brand-title {
    font-family: var(--font-display);
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   3. SCREEN DE INICIO DE SESIÓN (LOGIN)
   -------------------------------------------------------------------------- */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: radial-gradient(circle at top left, #1e293b 0%, var(--dark-obsidian) 100%);
    position: relative;
    padding: 24px;
}

.login-body::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
    top: 10%;
    left: 10%;
    pointer-events: none;
}

.login-container {
    width: 100%;
    max-width: 440px;
    z-index: 10;
}

.login-box {
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-dark);
    padding: 48px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    transition: transform 0.3s ease;
}

.login-box:hover {
    transform: translateY(-2px);
}

.login-brand {
    text-align: center;
    margin-bottom: 32px;
}

.brand-badge {
    background: var(--primary-emerald);
    color: var(--dark-obsidian);
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 11px;
    letter-spacing: 2px;
    padding: 4px 12px;
    border-radius: 100px;
    display: inline-block;
    margin-bottom: 8px;
}

.brand-title {
    color: var(--text-light);
    font-size: 32px;
    letter-spacing: -0.5px;
    line-height: 1;
    margin-bottom: 6px;
}

.brand-subtitle {
    color: var(--primary-emerald);
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.login-form .form-group label {
    color: #94a3b8;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}

.input-container-modern {
    position: relative;
    width: 100%;
}

.input-icon-modern {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    opacity: 0.7;
}

.input-container-modern input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    background: rgba(9, 13, 22, 0.5);
    border: 1px solid var(--border-dark);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 14px;
    transition: all 0.3s ease;
}

.input-container-modern input:focus {
    outline: none;
    border-color: var(--primary-emerald);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
    background: rgba(9, 13, 22, 0.7);
}

.btn-login-modern {
    background: var(--primary-emerald);
    color: var(--dark-obsidian);
    font-weight: 700;
    padding: 14px;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    border: none;
    width: 100%;
    cursor: pointer;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-login-modern:hover {
    background: var(--primary-emerald-hover);
    color: var(--text-light);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

.error-message {
    color: var(--danger);
    margin-top: 15px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   4. APP LAYOUT CONTAINER & SIDEBAR (BARRA LATERAL)
   -------------------------------------------------------------------------- */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Estilo Sidebar Streetwear */
.sidebar {
    width: 280px;
    background: var(--dark-obsidian);
    border-right: 1px solid var(--border-dark);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: all 0.3s ease;
}

.sidebar-header {
    padding: 32px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.brand-badge-sidebar {
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary-emerald);
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2px;
    padding: 3px 10px;
    border-radius: 100px;
    display: inline-block;
    margin-bottom: 6px;
}

.brand-title-sidebar {
    color: var(--text-light);
    font-size: 22px;
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.brand-subtitle-sidebar {
    color: var(--text-muted);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 2px;
}

.sidebar-menu-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.menu-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu-group-title {
    color: var(--border-dark);
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
    padding-left: 12px;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.sidebar-menu a:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-light);
}

.sidebar-menu a.active {
    background: var(--primary-emerald);
    color: var(--dark-obsidian);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

/* Sidebar Footer User Info */
.sidebar-footer {
    padding: 24px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.user-profile-badge-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 8px;
}

.user-avatar-circle {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-emerald) 0%, var(--accent-mint) 100%);
    color: var(--dark-obsidian);
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.user-profile-info {
    display: flex;
    flex-direction: column;
}

.user-profile-name {
    color: var(--text-light);
    font-weight: 700;
    font-size: 14px;
    line-height: 1.2;
}

.user-profile-role {
    color: var(--text-muted);
    font-size: 11px;
}

.btn-logout-modern {
    background: transparent;
    border: 1px solid var(--border-dark);
    color: #ef4444;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    width: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-logout-modern:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

/* --------------------------------------------------------------------------
   5. CABECERA (TOP BAR) & BREADCRUMBS
   -------------------------------------------------------------------------- */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-bar {
    background: var(--bg-white);
    padding: 20px 32px;
    border-bottom: 1px solid var(--border-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 50;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-bar-breadcrumbs {
    display: flex;
    flex-direction: column;
}

.breadcrumb-mini {
    font-family: var(--font-display);
    font-size: 9px;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.top-bar h1 {
    font-size: 26px;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.5px;
}

.menu-toggle-btn {
    display: none;
    background: var(--bg-slate-gray);
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 20px;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

/* Search Bar Rounded Pill */
.search-bar-modern {
    position: relative;
    width: 260px;
}

.search-icon-modern {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0.5;
}

.search-input-modern {
    width: 100%;
    padding: 10px 16px 10px 38px;
    border: 1px solid var(--border-gray);
    border-radius: 100px;
    font-size: 13px;
    background: var(--bg-slate-light);
    transition: all 0.2s ease;
}

.search-input-modern:focus {
    outline: none;
    border-color: var(--primary-emerald);
    background: var(--bg-white);
    width: 300px;
    box-shadow: var(--shadow-sm);
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.notification-badge-container {
    position: relative;
    cursor: pointer;
    font-size: 18px;
    opacity: 0.8;
}

.notification-dot {
    position: absolute;
    width: 7px;
    height: 7px;
    background: var(--danger);
    border-radius: 50%;
    top: 0;
    right: 0;
    border: 1px solid var(--bg-white);
}

.user-avatar-badge {
    width: 36px;
    height: 36px;
    background: var(--dark-charcoal);
    color: var(--text-light);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* Content Area Scrollable */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    background: var(--bg-slate-light);
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* --------------------------------------------------------------------------
   6. METRICAS / EXECUTIVE STAT CARDS
   -------------------------------------------------------------------------- */
.stats-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card-modern {
    background: var(--bg-white);
    border: 1px solid var(--border-gray);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.3s ease;
}

.stat-card-modern:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-card-label {
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.stat-card-icon-wrapper {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* Soft icon colors */
.bg-soft-green { background: #e6f7ed; color: #10b981; }
.bg-soft-blue { background: #eff6ff; color: #3b82f6; }
.bg-soft-emerald { background: #ecfdf5; color: #059669; }
.bg-soft-amber { background: #fffbeb; color: #f59e0b; }

.stat-card-value {
    font-size: 30px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.stat-card-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.trend-indicator {
    font-weight: 700;
}

.trend-indicator.text-success {
    color: var(--primary-emerald);
}

.trend-context {
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   7. CHARTS GRID (CONTENEDOR DE GRÁFICOS)
   -------------------------------------------------------------------------- */
.charts-dashboard-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 28px;
}

@media (max-width: 1024px) {
    .charts-dashboard-container {
        grid-template-columns: 1fr;
    }
}

.chart-card-modern {
    background: var(--bg-white);
    border: 1px solid var(--border-gray);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chart-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.chart-card-subtitle {
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.chart-card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.chart-canvas-wrapper {
    position: relative;
    width: 100%;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

canvas {
    max-width: 100%;
}

/* --------------------------------------------------------------------------
   8. PESTAÑAS DE CATEGORIAS (TABS PILLS)
   -------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------
   8. PESTAÑAS DE CATEGORIAS (TABS PILLS)
   -------------------------------------------------------------------------- */
.categorias-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    padding: 6px;
    background: var(--bg-slate-gray);
    border-radius: 10px;
    border: none;
}

.tab-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: none;
}

.tab-btn:hover {
    color: var(--text-primary);
    transform: none;
    box-shadow: none;
}

.tab-btn.active {
    background: var(--bg-white);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    transform: none;
}

.tab-btn-total {
    margin-left: auto;
    background: var(--dark-charcoal);
    color: var(--text-light);
}

.tab-btn-total:hover {
    background: var(--dark-card-hover);
    color: var(--text-light);
}

.tab-btn-total.active {
    background: var(--primary-emerald);
    color: var(--dark-obsidian);
}

/* --------------------------------------------------------------------------
   9. TABLAS DE DATOS PREMIUM
   -------------------------------------------------------------------------- */
.table-container {
    background: var(--bg-white);
    border-radius: 12px;
    border: 1px solid var(--border-gray);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table thead {
    background: var(--bg-slate-light);
    border-bottom: 1px solid var(--border-gray);
}

.data-table th {
    padding: 16px 20px;
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.data-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--bg-slate-gray);
    color: var(--text-primary);
}

.data-table tbody tr {
    background: var(--bg-white);
    transition: background-color 0.2s ease;
}

.data-table tbody tr:hover {
    background: rgba(241, 245, 249, 0.5);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Stock indicators */
.text-danger {
    color: var(--danger);
    font-weight: 700;
}

/* Status Badges */
.stock-badge {
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    display: inline-block;
}

.stock-in { background: var(--success-bg); color: var(--success); }
.stock-low { background: var(--warning-bg); color: var(--warning); }
.stock-out { background: var(--danger-bg); color: var(--danger); }

/* Table Image Zoom */
.data-table td img {
    border-radius: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.data-table td img:hover {
    transform: scale(1.4);
    box-shadow: var(--shadow-md);
    z-index: 10;
    position: relative;
}

/* --------------------------------------------------------------------------
   10. PUNTO DE VENTA (POS LAYOUT)
   -------------------------------------------------------------------------- */
.punto-venta-container {
    display: grid;
    grid-template-columns: 1.8fr 1.2fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 1100px) {
    .punto-venta-container {
        grid-template-columns: 1fr;
    }
}

.punto-venta-left {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 16px;
    padding: 0;
    background: transparent;
}

/* Tarjetas de Producto Modernas */
.producto-card {
    background: var(--bg-white);
    border: 1px solid var(--border-gray);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.producto-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-emerald);
    box-shadow: var(--shadow-md);
}

.producto-imagen {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 12px;
    background: var(--bg-slate-gray);
}

.producto-nombre {
    font-weight: 700;
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 38px;
}

.producto-precio {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-emerald);
    margin-top: auto;
}

.producto-stock {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.producto-card.sin-stock {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Carrito de Compras */
.punto-venta-right {
    position: sticky;
    top: 24px;
    height: calc(100vh - 140px);
}

.carrito-container {
    background: var(--bg-white);
    border: 1px solid var(--border-gray);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.carrito-container h3 {
    font-size: 18px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-gray);
    padding-bottom: 12px;
}

.carrito-items {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}

.carrito-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-slate-light);
    border: 1px solid var(--border-gray);
    border-radius: 8px;
    margin-bottom: 8px;
}

.carrito-item-nombre {
    font-weight: 700;
    font-size: 13px;
    color: var(--text-primary);
}

.carrito-item-detalle {
    font-size: 11px;
    color: var(--text-muted);
}

.carrito-item-cantidad {
    display: flex;
    align-items: center;
    gap: 4px;
}

.cantidad-btn {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid var(--border-gray);
    background: var(--bg-white);
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cantidad-btn:hover {
    background: var(--primary-emerald);
    color: var(--dark-obsidian);
}

.cantidad-input {
    width: 32px;
    border: 1px solid var(--border-gray);
    border-radius: 4px;
    text-align: center;
    font-size: 12px;
    padding: 2px;
}

.carrito-item-total {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--primary-emerald);
}

.carrito-item-eliminar {
    background: transparent;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 16px;
}

.carrito-totales {
    border-top: 1px solid var(--border-gray);
    padding-top: 16px;
    margin-top: auto;
}

.total-line {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-muted);
    align-items: center;
    margin-bottom: 8px;
}

.total-amount {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 800;
    color: var(--primary-emerald);
}

.carrito-acciones {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* Buttons System */
.btn {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: var(--primary-emerald);
    color: var(--dark-obsidian);
    border: none;
}

.btn-primary:hover {
    background: var(--primary-emerald-hover);
    color: var(--text-light);
}

.btn-secondary {
    background: var(--bg-slate-gray);
    color: var(--text-primary);
    border: 1px solid var(--border-gray);
}

.btn-secondary:hover {
    background: #cbd5e1;
}

.btn-success {
    background: var(--primary-emerald);
    color: var(--dark-obsidian);
    border: none;
    flex: 2;
}

.btn-success:hover {
    background: var(--primary-emerald-hover);
    color: var(--text-light);
}

/* --------------------------------------------------------------------------
   11. HISTORIAL VENTAS HEADER & FILTER
   -------------------------------------------------------------------------- */
.ventas-dia-container {
    background: var(--bg-white);
    border-radius: 12px;
    border: 1px solid var(--border-gray);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-top: 28px;
}

.ventas-dia-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
}

.section-subtitle {
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.date-filter-modern {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
}

.date-input-modern {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-gray);
    font-size: 13px;
    outline: none;
}

.date-input-modern:focus {
    border-color: var(--primary-emerald);
}

.btn-search-modern {
    padding: 8px 16px;
}

/* --------------------------------------------------------------------------
   12. RESUMEN TOTAL DE INVENTARIO (INVENTARIO TOTAL)
   -------------------------------------------------------------------------- */
.inventario-total-container {
    background: var(--bg-white);
    border: 1px solid var(--border-gray);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.inventario-total-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card-total {
    background: var(--bg-slate-light);
    border: 1px solid var(--border-gray);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-icon-total {
    width: 40px;
    height: 40px;
    background: var(--primary-emerald);
    color: var(--dark-obsidian);
    font-size: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-info-total h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-info-total p {
    font-size: 11px;
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   13. FORMULARIOS, MODALES & TOASTS
   -------------------------------------------------------------------------- */
.form-container {
    background: var(--bg-white);
    border: 1px solid var(--border-gray);
    padding: 32px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    max-width: 800px;
    width: 100%;
}

.form-container h2 {
    font-size: 22px;
    margin-bottom: 24px;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-weight: 700;
}

/* Filas del Formulario (Alineación lado a lado) */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 18px;
    width: 100%;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0; /* Evita márgenes duplicados */
}

/* Grupo de Formulario (Estructura en Columna) */
.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 18px;
    width: 100%;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: block;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%; /* Ocupar todo el ancho asignado */
    padding: 11px 14px;
    border: 1px solid var(--border-gray);
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--font-body);
    background: var(--bg-white);
    color: var(--text-primary);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-emerald);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
    background: var(--bg-white);
}

@media (max-width: 600px) {
    .form-row {
        flex-direction: column;
        gap: 18px;
    }
}

/* Modal Styling */
.modal {
    display: none; /* Oculto por defecto */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(9, 13, 22, 0.6);
    backdrop-filter: blur(8px);
    z-index: 2000; /* Asegurar que se superpone a todo */
    overflow-y: auto;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: all 0.2s ease;
}

/* Soporte para transiciones flex */
.modal.active {
    display: flex !important;
}

.modal-content {
    background: var(--bg-white);
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-gray);
    max-width: 600px;
    width: 100%;
    position: relative;
    animation: modalEntry 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalEntry {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    background: var(--bg-slate-light);
    border-bottom: 1px solid var(--border-gray);
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.15s ease;
}

.modal-close:hover {
    color: var(--danger);
}

.modal-content form {
    padding: 24px;
}

/* Toasts / Notifications */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-white);
    border: 1px solid var(--border-gray);
    border-left: 4px solid var(--primary-emerald);
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 320px;
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.info {
    border-left-color: var(--info);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 700;
    font-size: 13px;
}

.toast-message {
    font-size: 12px;
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   14. MODO PRIVADO (PRIVACY DE BLURRING)
   -------------------------------------------------------------------------- */
.privacy-toggle-container {
    cursor: pointer;
    font-size: 16px;
    opacity: 0.8;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-slate-gray);
    transition: all 0.2s ease;
}

.privacy-toggle-container:hover {
    opacity: 1;
    background: var(--border-gray);
    transform: scale(1.05);
}

/* Modo Privado activo: difumina los valores monetarios por defecto */
.privacy-mode .stat-card-modern:nth-child(2) .stat-card-value,
.privacy-mode .stat-card-modern:nth-child(3) .stat-card-value,
.privacy-mode .stat-card-modern:nth-child(4) .stat-card-value,
.privacy-mode .data-table td strong,
.privacy-mode .data-table td:nth-child(5), /* Precio Inventario */
.privacy-mode .data-table td:nth-child(6), /* Precio Venta / Total */
.privacy-mode .line-chart-card .chart-canvas-wrapper {
    filter: blur(6px);
    user-select: none;
    pointer-events: none;
    transition: filter 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Permitir que el admin pase el cursor sobre un elemento específico para revelarlo temporalmente */
.privacy-mode .stat-card-modern:nth-child(2):hover .stat-card-value,
.privacy-mode .stat-card-modern:nth-child(3):hover .stat-card-value,
.privacy-mode .stat-card-modern:nth-child(4):hover .stat-card-value,
.privacy-mode .data-table tr:hover td strong,
.privacy-mode .data-table tr:hover td:nth-child(5),
.privacy-mode .data-table tr:hover td:nth-child(6),
.privacy-mode .line-chart-card:hover .chart-canvas-wrapper {
    filter: blur(0);
    pointer-events: auto;
}

/* --------------------------------------------------------------------------
   15. BUSCADOR MODERNIZADO DEL PUNTO DE VENTA (POS)
   -------------------------------------------------------------------------- */
.search-bar {
    position: relative;
    max-width: 480px;
    width: 100%;
    margin: 20px 0 24px 0;
}

.search-bar .search-input {
    width: 100%;
    padding: 12px 16px 12px 42px; /* Espacio extra a la izquierda para el icono */
    border: 1px solid var(--border-gray);
    border-radius: 12px; /* Esquinas redondeadas premium */
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-body);
    background: var(--bg-slate-light);
    color: var(--text-primary);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.search-bar .search-input::placeholder {
    color: var(--text-muted);
    opacity: 0.8;
}

.search-bar .search-input:focus {
    outline: none;
    border-color: var(--primary-emerald);
    background: var(--bg-white);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12);
}

/* Icono de Lupa posicionado de manera absoluta en el lado izquierdo */
.search-bar::before {
    content: "🔍";
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--text-muted);
    pointer-events: none;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.search-bar:focus-within::before {
    opacity: 1;
}

/* ==========================================================================
   16. RESPONSIVIDAD MÓVIL (MOBILE RESPONSIVENESS SYSTEM)
   ========================================================================== */
@media (max-width: 900px) {
    /* 1. Barra Lateral (Sidebar) & Backdrop */
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        height: 100vh;
        z-index: 2200; /* Superpone a todo */
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
    }
    
    .sidebar.active {
        left: 0;
        box-shadow: 10px 0 40px rgba(0, 0, 0, 0.25);
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(15, 21, 32, 0.4);
        backdrop-filter: blur(4px);
        z-index: 2100;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }
    
    /* Revelar el botón Hamburguesa en móvil */
    .menu-toggle-btn {
        display: block;
    }
    
    /* 2. Cabecera (Top Bar) */
    .top-bar {
        padding: 16px 20px;
    }
    
    /* Ocultar barra de búsqueda de la cabecera en móvil para ganar espacio */
    .search-bar-modern {
        display: none;
    }
    
    /* 3. Área de Contenido Principal */
    .content-area {
        padding: 20px 16px;
    }
    
    /* 4. Métricas / Executive Cards */
    .stats-grid-modern {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 20px;
    }
    
    /* 5. Contenedor de Gráficos (Dashboard) */
    .charts-dashboard-container {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 20px;
    }
    
    /* 6. Punto de Venta (POS) */
    .punto-venta-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .punto-venta-right {
        position: static;
        height: auto;
    }
    
    .carrito-container {
        height: auto;
        min-height: 350px;
    }
    
    /* 7. Tablas de Inventario Responsivas */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table th, 
    .data-table td {
        padding: 12px 14px;
        font-size: 13px;
        white-space: nowrap; /* Evita roturas de filas largas en móvil */
    }
    
    /* 8. Formularios */
    .form-container {
        padding: 20px 16px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 16px;
    }
    
    /* Historial Ventas Header */
    .ventas-dia-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .date-filter-modern {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    /* Ajustes extra para teléfonos compactos */
    .top-bar-breadcrumbs h1 {
        font-size: 20px;
    }
    
    .stat-card-value {
        font-size: 24px;
    }
    
    .productos-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 12px;
    }
    
    .producto-imagen {
        height: 100px;
    }
    
    .producto-nombre {
        font-size: 12px;
        height: 34px;
    }
    
    .producto-precio {
        font-size: 16px;
    }
}

