/* ========================================
   AQUAGAS PRO - SISTEMA CORPORATIVO
   Ultra Professional & Minimalist Design
   Version 2.0 - Enterprise Edition
======================================== */

:root {
    /* Corporate Color Palette - Professional & Elegant */
    --primary-dark: #0A2540;
    --primary-main: #1E3A5F;
    --primary-light: #2D5F8D;
    --primary-accent: #4A90E2;
    
    --secondary-dark: #1A1A2E;
    --secondary-main: #16213E;
    --secondary-light: #0F3460;
    
    --accent-gold: #D4AF37;
    --accent-gold-light: #F4D03F;
    --accent-blue: #3498DB;
    --accent-teal: #16A085;
    
    /* Neutral Professional Palette */
    --neutral-50: #FAFBFC;
    --neutral-100: #F4F6F8;
    --neutral-200: #E8ECF0;
    --neutral-300: #D1D8DD;
    --neutral-400: #9AA5B1;
    --neutral-500: #697386;
    --neutral-600: #4F566B;
    --neutral-700: #3C4257;
    --neutral-800: #2A2F45;
    --neutral-900: #1A1F36;
    
    /* Semantic Colors - Professional */
    --success-light: #D4EDDA;
    --success-main: #28A745;
    --success-dark: #1E7E34;
    
    --warning-light: #FFF3CD;
    --warning-main: #FFC107;
    --warning-dark: #E0A800;
    
    --danger-light: #F8D7DA;
    --danger-main: #DC3545;
    --danger-dark: #BD2130;
    
    --info-light: #D1ECF1;
    --info-main: #17A2B8;
    --info-dark: #117A8B;
    
    /* Background System */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F8F9FA;
    --bg-tertiary: #F1F3F5;
    --bg-elevated: #FFFFFF;
    --bg-overlay: rgba(10, 37, 64, 0.85);
    --bg-modal: rgba(255, 255, 255, 0.98);
    
    /* Text Hierarchy */
    --text-primary: #1A1F36;
    --text-secondary: #4F566B;
    --text-tertiary: #697386;
    --text-inverse: #FFFFFF;
    --text-muted: #9AA5B1;
    
    /* Premium Shadows - Subtle & Professional */
    --shadow-xs: 0 1px 2px 0 rgba(10, 37, 64, 0.04);
    --shadow-sm: 0 1px 3px 0 rgba(10, 37, 64, 0.08), 0 1px 2px 0 rgba(10, 37, 64, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(10, 37, 64, 0.08), 0 2px 4px -1px rgba(10, 37, 64, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(10, 37, 64, 0.08), 0 4px 6px -2px rgba(10, 37, 64, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(10, 37, 64, 0.08), 0 10px 10px -5px rgba(10, 37, 64, 0.03);
    --shadow-2xl: 0 25px 50px -12px rgba(10, 37, 64, 0.15);
    
    /* Professional Gradients */
    --gradient-primary: linear-gradient(135deg, #1E3A5F 0%, #0A2540 100%);
    --gradient-accent: linear-gradient(135deg, #4A90E2 0%, #3498DB 100%);
    --gradient-success: linear-gradient(135deg, #28A745 0%, #1E7E34 100%);
    --gradient-gold: linear-gradient(135deg, #F4D03F 0%, #D4AF37 100%);
    
    /* Border System */
    --border-width: 1px;
    --border-color: #E8ECF0;
    --border-color-dark: #D1D8DD;
    
    /* Radius System - Subtle & Professional */
    --radius-xs: 3px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 10px;
    --radius-xl: 12px;
    --radius-2xl: 16px;
    --radius-full: 9999px;
    
    /* Spacing Scale */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 28px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;
    --space-20: 80px;
    
    /* Typography Scale - Professional */
    --text-xs: 0.6875rem;    /* 11px */
    --text-sm: 0.8125rem;    /* 13px */
    --text-base: 0.9375rem;  /* 15px */
    --text-lg: 1.0625rem;    /* 17px */
    --text-xl: 1.1875rem;    /* 19px */
    --text-2xl: 1.375rem;    /* 22px */
    --text-3xl: 1.75rem;     /* 28px */
    --text-4xl: 2.125rem;    /* 34px */
    
    /* Animation System */
    --duration-fast: 150ms;
    --duration-normal: 250ms;
    --duration-slow: 350ms;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-in: cubic-bezier(0.4, 0, 1, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --bg-primary: #1A1F36;
    --bg-secondary: #0F1419;
    --bg-tertiary: #161B2E;
    --bg-elevated: #1A1F36;
    --bg-modal: rgba(26, 31, 54, 0.98);
    
    --text-primary: #FFFFFF;
    --text-secondary: #B0B8C1;
    --text-tertiary: #8B94A5;
    --text-muted: #697386;
    
    --border-color: #2A2F45;
    --border-color-dark: #3C4257;
    
    --neutral-100: #2A2F45;
    --neutral-200: #3C4257;
    --neutral-300: #4F566B;
}

/* ========================================
   RESET & BASE STYLES
======================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: var(--text-base);
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    transition: background-color var(--duration-normal) var(--ease);
}

/* ========================================
   PROFESSIONAL LOGIN PAGE
======================================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
    background: var(--gradient-primary);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle, rgba(74, 144, 226, 0.1) 0%, transparent 70%);
    animation: rotate 30s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.login-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 440px;
}

.login-box {
    background: var(--bg-modal);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-2xl);
    padding: var(--space-12);
    box-shadow: var(--shadow-2xl);
    position: relative;
}

.brand-section {
    text-align: center;
    margin-bottom: var(--space-10);
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

/* Professional Logo Design */
.logo-icon {
    width: 52px;
    height: 52px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.logo-icon::before {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.7) 100%);
    clip-path: path('M12 2L15 8L21 9L16.5 13L18 19L12 16L6 19L7.5 13L3 9L9 8L12 2Z');
}

.logo-text {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.system-title {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
    letter-spacing: -0.01em;
}

.system-subtitle {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    font-weight: 500;
}

.login-form {
    margin-bottom: var(--space-8);
}

.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.form-input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-base);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--duration-normal) var(--ease);
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.btn-login {
    width: 100%;
    padding: var(--space-4);
    font-size: var(--text-base);
    font-weight: 600;
    color: white;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease);
    box-shadow: var(--shadow-md);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-login:active {
    transform: translateY(0);
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.credentials-info {
    padding: var(--space-5);
    background: var(--neutral-100);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    text-align: center;
}

.credentials-label {
    display: block;
    font-size: var(--text-xs);
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: var(--space-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.credentials-details {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    font-size: var(--text-sm);
    color: var(--text-primary);
}

/* ========================================
   PROFESSIONAL HEADER
======================================== */
.header {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all var(--duration-normal) var(--ease);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-6);
    height: 70px;
}

.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background: var(--neutral-100);
    border: 1px solid var(--border-color);
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--duration-normal) var(--ease);
    color: var(--text-secondary);
}

.menu-toggle:hover {
    background: var(--neutral-200);
    color: var(--text-primary);
}

.brand-header {
    flex: 1;
    display: flex;
    justify-content: center;
}

.logo-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.logo-icon-small {
    width: 36px;
    height: 36px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.logo-icon-small::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.7) 100%);
    clip-path: path('M8 1.3L9.9 5.3L14 6L11 9L11.8 13L8 11L4.2 13L5 9L2 6L6.1 5.3L8 1.3Z');
}

.brand-name {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.header-actions {
    display: flex;
    gap: var(--space-3);
}

.btn-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--neutral-100);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease);
}

.btn-header:hover {
    color: var(--text-primary);
    background: var(--bg-primary);
    border-color: var(--border-color-dark);
    transform: translateY(-1px);
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--neutral-100);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease);
}

.theme-toggle:hover {
    color: var(--text-primary);
    background: var(--bg-primary);
    transform: translateY(-1px);
}

/* ========================================
   PROFESSIONAL NAVIGATION
======================================== */
.navigation {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 70px;
    z-index: 90;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    padding: 0 var(--space-6);
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-5);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease);
    white-space: nowrap;
    border-bottom: 2px solid transparent;
}

.nav-item:hover {
    color: var(--text-primary);
    background: var(--neutral-100);
}

.nav-item.active {
    color: var(--primary-accent);
    border-bottom-color: var(--primary-accent);
    background: rgba(74, 144, 226, 0.05);
}

.nav-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-label {
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* ========================================
   MAIN CONTENT
======================================== */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-10) var(--space-6);
    min-height: calc(100vh - 140px);
}

.content-section {
    display: none;
    animation: fadeIn var(--duration-slow) var(--ease);
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    margin-bottom: var(--space-10);
    text-align: center;
}

.section-title {
    font-size: var(--text-4xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-3);
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.section-subtitle {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ========================================
   PROFESSIONAL CONTROL PANEL
======================================== */
.control-panel {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    margin-bottom: var(--space-10);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-6);
    flex-wrap: wrap;
}

.search-section {
    flex: 1;
    min-width: 280px;
}

.search-container {
    position: relative;
}

.search-input-modern {
    width: 100%;
    padding: var(--space-3) var(--space-10) var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    color: var(--text-primary);
    background: var(--neutral-100);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--duration-normal) var(--ease);
    font-family: inherit;
}

.search-input-modern:focus {
    outline: none;
    background: var(--bg-primary);
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.search-icon {
    position: absolute;
    right: var(--space-3);
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-tertiary);
    pointer-events: none;
}

.search-results-modern {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    z-index: 50;
    display: none;
}

.search-results-modern.active {
    display: block;
}

.search-result-item {
    padding: var(--space-4);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease);
    border-bottom: 1px solid var(--border-color);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--neutral-100);
}

.filters-section {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.filter-select-modern {
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
    background: var(--neutral-100);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease);
    min-width: 160px;
}

.filter-select-modern:focus {
    outline: none;
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.action-section {
    display: flex;
    gap: var(--space-3);
}

/* Professional Buttons */
.btn-primary-modern,
.btn-secondary-modern,
.btn-success-modern,
.btn-danger-modern {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    font-size: var(--text-sm);
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease);
    white-space: nowrap;
    letter-spacing: -0.01em;
}

.btn-primary-modern {
    color: white;
    background: var(--gradient-primary);
    box-shadow: var(--shadow-sm);
}

.btn-primary-modern:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary-modern {
    color: var(--text-secondary);
    background: var(--neutral-100);
    border: 1px solid var(--border-color);
}

.btn-secondary-modern:hover {
    color: var(--text-primary);
    background: var(--bg-primary);
    border-color: var(--border-color-dark);
    transform: translateY(-1px);
}

.btn-success-modern {
    color: white;
    background: var(--gradient-success);
    box-shadow: var(--shadow-sm);
}

.btn-success-modern:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-danger-modern {
    color: white;
    background: linear-gradient(135deg, var(--danger-main) 0%, var(--danger-dark) 100%);
    box-shadow: var(--shadow-sm);
}

.btn-danger-modern:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ========================================
   PROFESSIONAL CLIENT CARDS - COMPACT
======================================== */
.clients-grid {
    display: grid;
    gap: var(--space-5);
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.cliente-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    transition: all var(--duration-normal) var(--ease);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}

.cliente-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-primary);
    transform: scaleY(0);
    transition: transform var(--duration-normal) var(--ease);
}

.cliente-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-accent);
}

.cliente-card:hover::before {
    transform: scaleY(1);
}

.cliente-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-4);
    gap: var(--space-3);
}

.cliente-nombre {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    flex: 1;
    letter-spacing: -0.01em;
}

.cliente-actions {
    display: flex;
    gap: var(--space-2);
    flex-shrink: 0;
}

.btn-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--neutral-100);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease);
    color: var(--text-tertiary);
    font-size: var(--text-sm);
}

.btn-icon:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-sm);
}

.btn-icon.edit:hover {
    background: var(--primary-accent);
    color: white;
    border-color: var(--primary-accent);
}

.btn-icon.delete:hover {
    background: var(--danger-main);
    color: white;
    border-color: var(--danger-main);
}

.cliente-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    font-size: var(--text-sm);
}

.info-label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-tertiary);
    min-width: 60px;
    flex-shrink: 0;
}

.info-value {
    color: var(--text-primary);
    font-weight: 500;
    flex: 1;
    line-height: 1.4;
}

/* Client Value Indicators */
.cliente-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
    margin-top: var(--space-2);
}

.cliente-badge.vip {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, rgba(244, 208, 63, 0.1) 100%);
    color: var(--accent-gold);
    border: 1px solid var(--accent-gold);
}

.cliente-badge.frequent {
    background: rgba(74, 144, 226, 0.1);
    color: var(--primary-accent);
    border: 1px solid var(--primary-accent);
}

/* ========================================
   PROFESSIONAL METRICS DASHBOARD
======================================== */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-10);
}

.metric-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--duration-normal) var(--ease);
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.metric-card.revenue::before {
    background: var(--gradient-success);
}

.metric-card.pending::before {
    background: linear-gradient(135deg, var(--warning-main) 0%, var(--warning-dark) 100%);
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-5);
}

.metric-label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.metric-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.metric-card.revenue .metric-icon {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-main);
}

.metric-card.pending .metric-icon {
    background: rgba(255, 193, 7, 0.1);
    color: var(--warning-main);
}

.metric-value {
    font-size: var(--text-4xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-3);
    letter-spacing: -0.02em;
    line-height: 1;
}

.metric-trend {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--text-xs);
    font-weight: 600;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.metric-trend.positive {
    color: var(--success-dark);
    background: var(--success-light);
}

.metric-trend.warning {
    color: var(--warning-dark);
    background: var(--warning-light);
}

/* ========================================
   PROFESSIONAL SALES CARDS - COMPACT
======================================== */
.sales-grid {
    display: grid;
    gap: var(--space-5);
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.venta-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    transition: all var(--duration-normal) var(--ease);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}

.venta-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.venta-card.pagada::before {
    background: var(--gradient-success);
}

.venta-card.pendiente::before {
    background: linear-gradient(180deg, var(--warning-main), var(--warning-dark));
}

.venta-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-accent);
}

.venta-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-4);
    gap: var(--space-3);
}

.venta-producto {
    font-size: 24px;
    margin-right: var(--space-2);
}

.venta-cliente {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    flex: 1;
    letter-spacing: -0.01em;
}

.venta-monto {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--success-main);
    flex-shrink: 0;
    letter-spacing: -0.01em;
}

.venta-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.venta-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--text-sm);
    padding: var(--space-2) var(--space-3);
    background: var(--neutral-100);
    border-radius: var(--radius-sm);
    transition: all var(--duration-fast) var(--ease);
}

.venta-info-item:hover {
    background: rgba(74, 144, 226, 0.05);
}

.venta-info-label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-tertiary);
}

.venta-info-value {
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
}

.badge-success {
    color: var(--success-dark);
    background: var(--success-light);
}

.badge-warning {
    color: var(--warning-dark);
    background: var(--warning-light);
}

.venta-actions {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.venta-actions .btn-primary-modern,
.venta-actions .btn-secondary-modern,
.venta-actions .btn-success-modern,
.venta-actions .btn-danger-modern {
    flex: 1;
    min-width: 0;
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
}

/* ========================================
   PREDICTION CARDS - PROFESSIONAL
======================================== */
.prediction-grid {
    display: grid;
    gap: var(--space-6);
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}

.prediccion-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    transition: all var(--duration-normal) var(--ease);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.prediccion-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.prediccion-card.high::before {
    background: var(--gradient-success);
}

.prediccion-card.medium::before {
    background: var(--gradient-accent);
}

.prediccion-card.low::before {
    background: linear-gradient(135deg, var(--neutral-400) 0%, var(--neutral-500) 100%);
}

.prediccion-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-accent);
}

.prediccion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
}

.prediccion-cliente {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.prediccion-probabilidad {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--primary-accent);
    letter-spacing: -0.02em;
}

.prediccion-producto {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-5);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.prediccion-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.prediccion-detalles {
    padding: var(--space-4);
    background: var(--neutral-100);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    line-height: 1.6;
    color: var(--text-secondary);
}

.prediccion-actions {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-4);
}

.btn-block {
    width: 100%;
}

/* ========================================
   PROFESSIONAL MODALS
======================================== */
.modal-modern {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
}

.modal-modern.active {
    display: flex;
    animation: modalFadeIn var(--duration-normal) var(--ease);
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(8px);
}

.modal-container {
    background: var(--bg-modal);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    z-index: 10;
    animation: modalSlideUp var(--duration-normal) var(--ease);
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-6);
    border-bottom: 1px solid var(--border-color);
    background: var(--neutral-100);
}

.modal-title {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.modal-close-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-tertiary);
    transition: all var(--duration-normal) var(--ease);
}

.modal-close-btn:hover {
    background: var(--danger-main);
    color: white;
    border-color: var(--danger-main);
    transform: scale(1.1);
}

.modal-form {
    padding: var(--space-6);
    max-height: 60vh;
    overflow-y: auto;
}

.form-row {
    display: grid;
    gap: var(--space-5);
    margin-bottom: var(--space-5);
}

.form-row.half {
    grid-template-columns: 1fr 1fr;
}

.form-group-modern {
    display: flex;
    flex-direction: column;
}

.form-label-modern {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.form-input-modern,
.form-textarea-modern,
.form-select-modern {
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    color: var(--text-primary);
    background: var(--neutral-100);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--duration-normal) var(--ease);
    font-family: inherit;
}

.form-input-modern:focus,
.form-textarea-modern:focus,
.form-select-modern:focus {
    outline: none;
    background: var(--bg-primary);
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.form-textarea-modern {
    resize: vertical;
    min-height: 100px;
}

.radio-group-modern {
    display: flex;
    gap: var(--space-3);
}

.radio-option {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
    padding: var(--space-3);
    border-radius: var(--radius-md);
    transition: all var(--duration-normal) var(--ease);
    flex: 1;
    border: 1px solid var(--border-color);
    background: var(--neutral-100);
}

.radio-option:hover {
    background: var(--bg-primary);
    border-color: var(--primary-accent);
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-indicator {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color-dark);
    border-radius: 50%;
    position: relative;
    transition: all var(--duration-normal) var(--ease);
    flex-shrink: 0;
}

.radio-option input[type="radio"]:checked + .radio-indicator {
    border-color: var(--primary-accent);
    background: var(--primary-accent);
}

.radio-option input[type="radio"]:checked + .radio-indicator::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
}

.radio-label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.checkbox-modern {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
    padding: var(--space-3);
    border-radius: var(--radius-md);
    transition: all var(--duration-normal) var(--ease);
    border: 1px solid var(--border-color);
    background: var(--neutral-100);
}

.checkbox-modern:hover {
    background: var(--bg-primary);
    border-color: var(--primary-accent);
}

.checkbox-modern input[type="checkbox"] {
    display: none;
}

.checkbox-indicator {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color-dark);
    border-radius: var(--radius-xs);
    position: relative;
    transition: all var(--duration-normal) var(--ease);
    flex-shrink: 0;
}

.checkbox-modern input[type="checkbox"]:checked + .checkbox-indicator {
    border-color: var(--primary-accent);
    background: var(--primary-accent);
}

.checkbox-modern input[type="checkbox"]:checked + .checkbox-indicator::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 11px;
    font-weight: 700;
}

.checkbox-label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.modal-footer {
    display: flex;
    gap: var(--space-3);
    justify-content: flex-end;
    padding: var(--space-6);
    border-top: 1px solid var(--border-color);
    background: var(--neutral-100);
}

/* ========================================
   LOADING & EMPTY STATES
======================================== */
.loader,
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-16);
    color: var(--text-tertiary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--neutral-200);
    border-top-color: var(--primary-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: var(--space-4);
}

.loading-text {
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--text-secondary);
}

.empty-state,
.no-predicciones,
.coming-soon {
    text-align: center;
    padding: var(--space-16);
}

.empty-state-icon,
.no-predicciones-icon,
.coming-soon-icon {
    font-size: 48px;
    margin-bottom: var(--space-4);
    opacity: 0.4;
}

.empty-state h3,
.no-predicciones h3,
.coming-soon h3 {
    font-size: var(--text-2xl);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-3);
}

.empty-state p,
.no-predicciones p,
.coming-soon p {
    font-size: var(--text-base);
    color: var(--text-secondary);
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ========================================
   TOAST NOTIFICATIONS
======================================== */
.toast-notification,
#toast {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    max-width: 400px;
    padding: var(--space-4) var(--space-5);
    background: var(--bg-modal);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    transform: translateX(500px);
    transition: transform var(--duration-slow) var(--ease);
    z-index: 2000;
    font-size: var(--text-sm);
    font-weight: 500;
}

.toast-notification.show,
#toast.show {
    transform: translateX(0);
}

.toast-notification.success,
#toast.success {
    border-left: 4px solid var(--success-main);
    color: var(--success-dark);
}

.toast-notification.error,
#toast.error {
    border-left: 4px solid var(--danger-main);
    color: var(--danger-dark);
}

.error-message {
    background: var(--danger-light);
    color: var(--danger-dark);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-5);
    font-size: var(--text-sm);
    font-weight: 500;
    border-left: 3px solid var(--danger-main);
/* RESPONSIVE MÓVIL - SIMPLE Y FUNCIONAL */
@media (max-width: 768px) {
    /* Header compacto */
    .header-content {
        padding: 0 12px;
        height: 60px;
        display: flex;
        align-items: center;
        gap: 12px;
    }
    
    .menu-toggle {
        display: flex;
        width: 44px;
        height: 44px;
        align-items: center;
        justify-content: center;
        background: var(--neutral-100);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        cursor: pointer;
        flex-shrink: 0;
    }
    
    .menu-toggle:active {
        transform: scale(0.95);
    }
    
    .brand-header {
        flex: 1;
        justify-content: center;
    }
    
    .header-actions {
        display: flex;
        gap: 8px;
        flex-shrink: 0;
    }
    
    .theme-toggle,
    .btn-header {
        width: 40px;
        height: 40px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .logo-icon-small {
        width: 32px;
        height: 32px;
    }
    
    .brand-name {
        font-size: 18px;
    }
    
    .btn-header .btn-label {
        display: none;
    }
    
    /* Navegación */
    .navigation {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        transform: translateY(-100%);
        transition: transform 0.3s;
        z-index: 999;
    }
    
    .navigation.nav-open {
        transform: translateY(0);
    }
    
    .nav-container {
        flex-direction: column;
    }
    
    .nav-item {
        padding: 16px;
        border-bottom: 1px solid var(--border-color);
    }
    
    /* Contenido */
    .main-content {
        padding: 20px 12px;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    /* Control panel */
    .control-panel {
        flex-direction: column;
        gap: 12px;
    }
    
    .search-section,
    .filters-section,
    .action-section {
        width: 100%;
    }
    
    .filters-section,
    .action-section {
        flex-direction: column;
    }
    
    /* Tarjetas - 3 por fila */
    .clients-grid,
    .sales-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .cliente-card,
    .venta-card {
        padding: 10px;
        font-size: 12px;
    }
    
    .cliente-nombre,
    .venta-cliente {
        font-size: 13px;
    }
    
    .btn-icon {
        width: 28px;
        height: 28px;
    }
    
    /* Predicciones - 2 por fila */
    .prediction-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Métricas - 2 por fila */
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Modales */
    .modal-container {
        margin: 20px;
    }
    
    .form-row.half {
        grid-template-columns: 1fr;
    }
}

/* Pantallas muy pequeñas - 2 por fila */
@media (max-width: 400px) {
    .clients-grid,
    .sales-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}