/* ============================================
   DESIGN SYSTEM - Dashboard Mobile Premium
   Inspired by iOS Native Apps
   ============================================ */

:root {
    /* ========================================
       BACKGROUND LAYERS
       ======================================== */
    --bg-primary: #0A0A0F;
    --bg-secondary: #12121A;
    --bg-tertiary: #1A1A24;
    --bg-elevated: #1E1E2A;

    /* ========================================
       ACCENT COLORS (iOS Palette)
       ======================================== */
    --accent-blue: #007AFF;
    --accent-green: #30D158;
    --accent-yellow: #FFD60A;
    --accent-orange: #FF9F0A;
    --accent-red: #FF453A;
    --accent-purple: #BF5AF2;
    --accent-cyan: #64D2FF;
    --accent-pink: #FF2D55;

    /* ========================================
       META/PROGRESS COLORS
       ======================================== */
    --color-meta-atingida: #30D158;
    --color-meta-proxima: #007AFF;
    --color-meta-atencao: #FFD60A;
    --color-meta-critico: #FF453A;
    --color-projecao: #007AFF;
    --color-falta: #FF453A;

    /* ========================================
       TEXT COLORS
       ======================================== */
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-tertiary: rgba(255, 255, 255, 0.5);
    --text-quaternary: rgba(255, 255, 255, 0.3);
    --text-success: #30D158;
    --text-warning: #FFD60A;
    --text-danger: #FF453A;

    /* ========================================
       GLASSMORPHISM
       ======================================== */
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-bg-hover: rgba(255, 255, 255, 0.06);
    --glass-bg-active: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-hover: rgba(255, 255, 255, 0.12);
    --glass-blur: 20px;
    --glass-blur-light: 10px;

    /* ========================================
       GRADIENTS
       ======================================== */
    --gradient-hero: linear-gradient(180deg, #1A1A2E 0%, #0A0A0F 100%);
    --gradient-card: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
    --gradient-glow-blue: radial-gradient(ellipse at center, rgba(0,122,255,0.15) 0%, transparent 70%);
    --gradient-glow-green: radial-gradient(ellipse at center, rgba(48,209,88,0.15) 0%, transparent 70%);
    --gradient-progress: linear-gradient(90deg, var(--accent-blue) 0%, var(--accent-cyan) 100%);
    --gradient-success: linear-gradient(90deg, var(--accent-green) 0%, #5AE87A 100%);

    /* ========================================
       SHADOWS
       ======================================== */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow-blue: 0 0 30px rgba(0, 122, 255, 0.25);
    --shadow-glow-green: 0 0 30px rgba(48, 209, 88, 0.25);
    --shadow-glow-orange: 0 0 20px rgba(255, 159, 10, 0.3);

    /* ========================================
       TYPOGRAPHY
       ======================================== */
    --font-primary: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', Consolas, monospace;

    /* Font Sizes - Modular Scale 1.25 */
    --text-xs: 0.64rem;      /* 10.24px */
    --text-sm: 0.8rem;       /* 12.8px */
    --text-base: 1rem;       /* 16px */
    --text-lg: 1.25rem;      /* 20px */
    --text-xl: 1.563rem;     /* 25px */
    --text-2xl: 1.953rem;    /* 31.25px */
    --text-3xl: 2.441rem;    /* 39px */
    --text-4xl: 3.052rem;    /* 48.8px */
    --text-5xl: 3.815rem;    /* 61px */

    /* Font Weights */
    --weight-regular: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;
    --weight-black: 900;

    /* Line Heights */
    --leading-tight: 1.1;
    --leading-snug: 1.25;
    --leading-normal: 1.5;

    /* Letter Spacing */
    --tracking-tight: -0.02em;
    --tracking-normal: 0;
    --tracking-wide: 0.02em;
    --tracking-wider: 0.05em;

    /* ========================================
       SPACING (4px base)
       ======================================== */
    --space-0: 0;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;

    /* ========================================
       BORDER RADIUS
       ======================================== */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    /* ========================================
       TRANSITIONS
       ======================================== */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
    --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

    /* ========================================
       Z-INDEX SCALE
       ======================================== */
    --z-base: 0;
    --z-elevated: 10;
    --z-sticky: 100;
    --z-modal: 1000;
    --z-tooltip: 1100;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Glass Card Base */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.glass-card:hover {
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-hover);
}

.glass-card:active {
    background: var(--glass-bg-active);
    transform: scale(0.98);
}

/* Glass Card with Top Highlight */
.glass-card-highlight {
    position: relative;
}

.glass-card-highlight::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-border-hover), transparent);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* Text Utilities */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-success { color: var(--text-success); }
.text-warning { color: var(--text-warning); }
.text-danger { color: var(--text-danger); }

/* Font Weight Utilities */
.font-medium { font-weight: var(--weight-medium); }
.font-semibold { font-weight: var(--weight-semibold); }
.font-bold { font-weight: var(--weight-bold); }
.font-black { font-weight: var(--weight-black); }

/* Tracking Utilities */
.tracking-tight { letter-spacing: var(--tracking-tight); }
.tracking-wide { letter-spacing: var(--tracking-wide); }
.tracking-wider { letter-spacing: var(--tracking-wider); }

/* Tabular Numbers */
.tabular-nums {
    font-variant-numeric: tabular-nums;
}

/* Glow Effects */
.glow-blue {
    box-shadow: var(--shadow-glow-blue);
}

.glow-green {
    box-shadow: var(--shadow-glow-green);
}

/* Selection Color */
.mobile-dashboard-v2 *::selection {
    background: rgba(0, 122, 255, 0.3);
    color: var(--text-primary);
}

/* ============================================
   LIGHT MODE OVERRIDES
   Ativado pela classe .theme-light no container
   ============================================ */
.theme-light {
    /* Background Layers */
    --bg-primary: #F8F9FA;
    --bg-secondary: #F0F1F3;
    --bg-tertiary: #E8E8ED;
    --bg-elevated: #FFFFFF;

    /* Text Colors */
    --text-primary: #1D1D1F;
    --text-secondary: rgba(0, 0, 0, 0.6);
    --text-tertiary: rgba(0, 0, 0, 0.45);
    --text-quaternary: rgba(0, 0, 0, 0.3);
    --text-success: #248A3D;
    --text-warning: #B25000;
    --text-danger: #D70015;

    /* Glassmorphism - Light (com mais opacidade para separacao visual) */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-bg-hover: rgba(255, 255, 255, 0.85);
    --glass-bg-active: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(0, 0, 0, 0.1);
    --glass-border-hover: rgba(0, 0, 0, 0.18);

    /* Gradients - Light */
    --gradient-hero: linear-gradient(180deg, #EEF1F6 0%, #F8F9FA 100%);
    --gradient-card: linear-gradient(135deg, rgba(0,0,0,0.03) 0%, rgba(0,0,0,0.01) 100%);
    --gradient-glow-blue: radial-gradient(ellipse at center, rgba(0,122,255,0.06) 0%, transparent 70%);
    --gradient-glow-green: radial-gradient(ellipse at center, rgba(48,209,88,0.06) 0%, transparent 70%);

    /* Shadows - Light */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-glow-blue: 0 4px 20px rgba(0, 122, 255, 0.1);
    --shadow-glow-green: 0 4px 20px rgba(48, 209, 88, 0.1);
    --shadow-glow-orange: 0 4px 16px rgba(255, 159, 10, 0.1);

    /* Accent Colors - Ajustados para contraste em fundo claro */
    --accent-green: #248A3D;
    --accent-yellow: #B25000;
    --accent-orange: #C93400;
    --accent-red: #D70015;
    --accent-purple: #8944AB;
    --accent-cyan: #0071A4;
    --accent-pink: #D30F45;

    /* Meta/Progress Colors */
    --color-meta-atingida: #248A3D;
    --color-meta-atencao: #B25000;
    --color-meta-critico: #D70015;

    /* Card shadow para separacao visual no modo claro */
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Cards glassmorphism ganham shadow no modo claro */
.theme-light .glass-card,
.theme-light .kpi-item,
.theme-light .meta-chip,
.theme-light .insight-card,
.theme-light .chart-card-mobile,
.theme-light .familia-item,
.theme-light .ranking-item,
.theme-light .produto-item,
.theme-light .projecao-section,
.theme-light .daily-target-card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Highlight lines desaparecem no claro (nao fazem sentido em fundo branco) */
.theme-light .kpi-item::before,
.theme-light .meta-chip::before,
.theme-light .insight-card::before,
.theme-light .chart-card-mobile::before {
    display: none;
}
