/* Emma Papelerías - CSS que sobrescribe Tailwind */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

body {
    background: linear-gradient(135deg, #E8E4F3 0%, #D4C5F9 100%) !important;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Ocultar elementos */
.hidden {
    display: none !important;
}

/* ============================================
   LOGIN SCREEN
============================================ */
#loginScreen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.glass-effect {
    background: white !important;
    border-radius: 24px !important;
    padding: 48px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15) !important;
    backdrop-filter: none !important;
    border: none !important;
}

/* ============================================
   SIDEBAR
============================================ */
.sidebar {
    width: 240px !important;
    background: white !important;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.05) !important;
    display: flex;
    flex-direction: column;
    padding: 0 !important;
}

.sidebar>div:first-child {
    padding: 24px 16px !important;
    border-bottom: 1px solid #E2E8F0 !important;
}

.sidebar i.fa-palette {
    width: 48px !important;
    height: 48px !important;
    background: linear-gradient(135deg, #E91E63 0%, #F06292 100%) !important;
    border-radius: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: white !important;
    font-size: 24px !important;
}

.sidebar h2 {
    font-size: 24px !important;
    font-weight: 700 !important;
    color: #E91E63 !important;
    line-height: 1 !important;
    margin: 0 !important;
}

.sidebar p {
    font-size: 11px !important;
    color: #718096 !important;
    margin: 0 !important;
}

.sidebar nav {
    padding: 16px !important;
}

.sidebar-item {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 12px 16px !important;
    border-radius: 12px !important;
    color: #4A5568 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    margin-bottom: 4px !important;
    background: transparent !important;
    border: none !important;
    border-left: none !important;
    transform: none !important;
}

.sidebar-item:hover {
    background: #F7FAFC !important;
    color: #E91E63 !important;
    transform: none !important;
}

.sidebar-item.active {
    background: linear-gradient(135deg, #E91E63 0%, #F06292 100%) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.25) !important;
    border: none !important;
    border-left: none !important;
}

.sidebar-item i {
    width: 20px !important;
    font-size: 16px !important;
}

/* Logout button */
.sidebar>div:last-child {
    margin-top: auto !important;
    padding: 16px !important;
    border-top: 1px solid #E2E8F0 !important;
    position: relative !important;
}

#logoutBtn {
    background: #EF4444 !important;
    color: white !important;
    padding: 12px !important;
    border-radius: 10px !important;
    width: 100% !important;
    border: none !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

#logoutBtn:hover {
    background: #DC2626 !important;
}

/* ============================================
   MAIN CONTENT
============================================ */
main {
    flex: 1 !important;
    overflow-y: auto !important;
    background: transparent !important;
}

main>div {
    padding: 32px !important;
}

/* ============================================
   STAT CARDS
============================================ */
.stat-card {
    background: white !important;
    border-radius: 16px !important;
    padding: 20px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
    transition: all 0.3s ease !important;
    color: inherit !important;
}

.stat-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
}

.stat-card p {
    font-size: 13px !important;
    color: #718096 !important;
    font-weight: 500 !important;
    margin-bottom: 8px !important;
    opacity: 1 !important;
}

.stat-card h3 {
    font-size: 32px !important;
    font-weight: 700 !important;
    color: #2D3748 !important;
    margin: 0 !important;
}

.stat-card i {
    color: #E91E63 !important;
    opacity: 0.3 !important;
}

/* ============================================
   BUTTONS
============================================ */
.btn-primary {
    background: linear-gradient(135deg, #E91E63 0%, #D81B60 100%) !important;
    color: white !important;
    padding: 12px 24px !important;
    border-radius: 12px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.3) !important;
}

.btn-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(233, 30, 99, 0.4) !important;
}

.btn-danger {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%) !important;
    color: white !important;
    padding: 8px 16px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    border: none !important;
    cursor: pointer !important;
}

/* ============================================
   INPUT FIELDS
============================================ */
.input-field {
    width: 100% !important;
    padding: 14px 16px !important;
    border: 2px solid #E2E8F0 !important;
    border-radius: 12px !important;
    font-size: 15px !important;
    transition: all 0.3s ease !important;
    background: #F7FAFC !important;
}

.input-field:focus {
    outline: none !important;
    border-color: #E91E63 !important;
    background: white !important;
    box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.1) !important;
}

/* ============================================
   TABLES
============================================ */
table {
    width: 100% !important;
    border-collapse: collapse !important;
}

thead {
    background: #F7FAFC !important;
}

th {
    padding: 12px 16px !important;
    text-align: left !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #4A5568 !important;
}

td {
    padding: 12px 16px !important;
    border-bottom: 1px solid #E2E8F0 !important;
    font-size: 14px !important;
    color: #2D3748 !important;
}

tr:hover {
    background: #F7FAFC !important;
}

/* ============================================
   CARDS
============================================ */
.bg-white {
    background: white !important;
}

.rounded-2xl {
    border-radius: 16px !important;
}

.shadow-lg {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
}

/* ============================================
   MODAL
============================================ */
.modal {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.7) !important;
    z-index: 1000 !important;
    align-items: center !important;
    justify-content: center !important;
}

.modal.active {
    display: flex !important;
}

.modal-content {
    background: white !important;
    border-radius: 16px !important;
    max-width: 800px !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) !important;
}

/* ============================================
   BADGES
============================================ */
.badge {
    padding: 4px 12px !important;
    border-radius: 12px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
}

.badge-success {
    background: #D1FAE5 !important;
    color: #065F46 !important;
}

.badge-warning {
    background: #FEF3C7 !important;
    color: #92400E !important;
}

.badge-danger {
    background: #FEE2E2 !important;
    color: #991B1B !important;
}

.badge-info {
    background: #DBEAFE !important;
    color: #1E40AF !important;
}

/* ============================================
   ML CALCULATOR
============================================ */
.ml-calculator {
    background: linear-gradient(135deg, #FBBF24 0%, #F59E0B 100%) !important;
    padding: 20px !important;
    border-radius: 12px !important;
    color: #78350F !important;
    margin-top: 20px !important;
}

/* ============================================
   STOCK CRÍTICO
============================================ */
.stock-critico {
    background: #FEE2E2 !important;
}

/* ============================================
   GRID LAYOUTS
============================================ */
.grid {
    display: grid !important;
}

.gap-6 {
    gap: 24px !important;
}

.gap-4 {
    gap: 16px !important;
}

/* ============================================
   FLEX LAYOUTS
============================================ */
.flex {
    display: flex !important;
}

.items-center {
    align-items: center !important;
}

.justify-between {
    justify-content: space-between !important;
}

.space-x-3>*+* {
    margin-left: 12px !important;
}

/* ============================================
   TEXT STYLES
============================================ */
.text-3xl {
    font-size: 24px !important;
}

.text-xl {
    font-size: 18px !important;
}

.font-bold {
    font-weight: 700 !important;
}

.text-gray-800 {
    color: #2D3748 !important;
}

.text-gray-600 {
    color: #718096 !important;
}

.text-gray-700 {
    color: #4A5568 !important;
}

/* ============================================
   RESPONSIVE
============================================ */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -240px;
        top: 0;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
    }

    .sidebar.open {
        left: 0;
    }
}