/* ============================================================
   DIETA FÁCIL — Design System & Global Styles
   ============================================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&family=Poppins:wght@400;500;600;700&display=swap');

/* ============================================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================================ */
:root {
    /* Primary */
    --primary: #6C63FF;
    --primary-light: #8B83FF;
    --primary-dark: #5A52D5;
    --primary-bg: rgba(108, 99, 255, 0.08);
    --primary-bg-hover: rgba(108, 99, 255, 0.15);

    /* Secondary */
    --secondary: #00D9A6;
    --secondary-light: #33E3B9;
    --secondary-dark: #00B88A;

    /* Accent */
    --accent: #FF6B6B;
    --accent-light: #FF8E8E;
    --warning: #FFB347;
    --warning-light: #FFC570;
    --info: #3B82F6;

    /* Neutrals */
    --bg-body: #F5F7FA;
    --bg-card: #FFFFFF;
    --bg-glass: rgba(255, 255, 255, 0.72);
    --bg-sidebar: #1A1D29;
    --bg-sidebar-hover: rgba(255, 255, 255, 0.08);
    --bg-input: #F0F2F5;

    --text-primary: #1A1D29;
    --text-secondary: #6B7280;
    --text-tertiary: #9CA3AF;
    --text-inverse: #FFFFFF;

    --border: #E5E7EB;
    --border-light: #F0F2F5;
    --divider: rgba(0, 0, 0, 0.06);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6C63FF 0%, #00D9A6 100%);
    --gradient-warm: linear-gradient(135deg, #FF6B6B 0%, #FFB347 100%);
    --gradient-cool: linear-gradient(135deg, #3B82F6 0%, #6C63FF 100%);
    --gradient-green: linear-gradient(135deg, #00D9A6 0%, #10B981 100%);
    --gradient-hero: linear-gradient(135deg, #6C63FF 0%, #8B5CF6 50%, #00D9A6 100%);
    --gradient-sidebar: linear-gradient(180deg, #1A1D29 0%, #2D3142 100%);

    /* Shadows */
    --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 16px 60px rgba(0, 0, 0, 0.16);
    --shadow-primary: 0 4px 20px rgba(108, 99, 255, 0.25);
    --shadow-success: 0 4px 20px rgba(0, 217, 166, 0.25);
    --shadow-card-hover: 0 8px 30px rgba(108, 99, 255, 0.15);

    /* Radii */
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-accent: 'Poppins', sans-serif;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;

    /* Sidebar */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --header-height: 70px;
    --mobile-nav-height: 64px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: 0.5em;
}
h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; font-weight: 600; }

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition-fast);
}
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; display: block; }

/* ============================================================
   LAYOUT — Main Content Area
   ============================================================ */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: var(--space-xl);
    padding-top: calc(var(--header-height) + var(--space-xl));
    min-height: 100vh;
    transition: var(--transition);
}

@media (max-width: 991.98px) {
    .main-content {
        margin-left: 0;
        padding: var(--space-md);
        padding-top: calc(var(--header-height) + var(--space-md));
        padding-bottom: calc(var(--mobile-nav-height) + var(--space-xl));
    }
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
    margin-bottom: var(--space-xl);
}
.page-header .page-title {
    font-size: 1.75rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}
.page-header .page-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.text-muted-custom { color: var(--text-secondary) !important; }
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }
.font-accent { font-family: var(--font-accent) !important; }

.badge-soft {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--font-accent);
}
.badge-primary { background: var(--primary-bg); color: var(--primary); }
.badge-success { background: rgba(0, 217, 166, 0.1); color: var(--secondary-dark); }
.badge-warning { background: rgba(255, 179, 71, 0.12); color: #E09100; }
.badge-danger { background: rgba(255, 107, 107, 0.1); color: var(--accent); }
.badge-info { background: rgba(59, 130, 246, 0.1); color: var(--info); }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* ============================================================
   SKELETON LOADER
   ============================================================ */
.skeleton {
    background: linear-gradient(90deg, var(--bg-input) 25%, #e8eaed 50%, var(--bg-input) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}
.skeleton-text { height: 14px; margin-bottom: 8px; width: 80%; }
.skeleton-title { height: 22px; margin-bottom: 12px; width: 50%; }
.skeleton-circle { border-radius: 50%; }

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: var(--space-3xl) var(--space-xl);
    color: var(--text-secondary);
}
.empty-state i {
    font-size: 3rem;
    color: var(--border);
    margin-bottom: var(--space-md);
}
.empty-state h5 { color: var(--text-secondary); }

/* ============================================================
   RESPONSIVE TABLE WRAPPER
   ============================================================ */
.table-responsive-custom {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes bounceCheck {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}
.animate-fade-in { animation: fadeInUp 0.5s ease forwards; }
.animate-scale-in { animation: scaleIn 0.3s ease forwards; }
