/* ==================== CSS Variables (Behance Design Colors) ==================== */
:root {
    /* Primary Colors */
    --color-bg-primary: #000000;        /* Deep black - Main background */
    --color-bg-card: #0a0a0a;           /* Card background - Slightly lighter black */
    --color-bg-elevated: #141414;      /* Elevated surfaces - Dark gray */
    --color-bg-hover: #1a1a1a;          /* Hover states - Dark gray */
    
    /* Text Colors */
    --color-text-primary: #FFFFFF;      /* Main text - White */
    --color-text-secondary: #FFFFFF;    /* Muted text - White */
    --color-text-tertiary: #FFFFFF;     /* Labels, placeholders - White */
    
    /* Accent Colors */
    --color-accent-green: #5AE661;      /* Primary accent - Green */
    --color-accent-purple: #BFC6F4;     /* Secondary accent - Purple */
    --color-accent-red: #F04438;         /* Error/Warning - Red */
    --color-error: #F04438;              /* Error color - Red */
    
    /* Border & Divider */
    --color-border: #1a1a1a;            /* Borders, dividers - Dark gray */
    
    /* Spacing Scale (4px base unit) */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 24px;
    --spacing-2xl: 32px;
    --spacing-3xl: 48px;
    --spacing-4xl: 64px;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
    
    /* Typography */
    --font-family: 'Urbanist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-weight-light: 300;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-bold: 700;
}

/* ==================== Reset & Base Styles ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: 'Urbanist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 400; /* Regular (400) - Default body weight */
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text-primary);
    background-color: var(--color-bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ==================== Typography (Urbanist Font Hierarchy) ==================== */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Urbanist', sans-serif;
    line-height: 1.2;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-lg);
}

/* Heading Hierarchy - Bold (700) for main headings */
h1 { 
    font-size: 2.5rem; 
    font-weight: 700; /* Bold - Main page titles */
    font-family: 'Urbanist', sans-serif;
}
h2 { 
    font-size: 2rem; 
    font-weight: 700; /* Bold - Section headers */
    font-family: 'Urbanist', sans-serif;
}

/* Subheadings - Medium (500) for subsections */
h3 { 
    font-size: 1.5rem; 
    font-weight: 500; /* Medium - Subsection headers */
    font-family: 'Urbanist', sans-serif;
}
h4 { 
    font-size: 1.25rem; 
    font-weight: 500; /* Medium - Card titles */
    font-family: 'Urbanist', sans-serif;
}
h5 { 
    font-size: 1.125rem; 
    font-weight: 500; /* Medium - Labels */
    font-family: 'Urbanist', sans-serif;
}
h6 { 
    font-size: 1rem; 
    font-weight: 500; /* Medium - Small labels */
    font-family: 'Urbanist', sans-serif;
}

/* Body Text - Regular (400) */
p {
    margin-bottom: var(--spacing-lg);
    color: var(--color-text-primary);
    font-weight: 400; /* Regular - Body text */
    font-family: 'Urbanist', sans-serif;
}

body {
    font-weight: 400; /* Regular - Default body weight */
}

a {
    color: var(--color-accent-green);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-accent-purple);
}

/* ==================== Layout System ==================== */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Darker overlay for deep black theme */
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-left: 280px; /* Sidebar width */
    transition: margin-left 0.3s ease;
    min-width: 0; /* Prevents flex item from overflowing */
    overflow-x: hidden;
}

.content-wrapper {
    flex: 1;
    padding: var(--spacing-2xl);
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
    overflow-x: hidden;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 var(--spacing-xl);
    box-sizing: border-box;
    width: 100%;
}

/* ==================== Grid System ==================== */
.grid {
    display: grid;
    gap: var(--spacing-xl);
    width: 100%;
    box-sizing: border-box;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.grid > * {
    min-width: 0; /* Prevents grid items from overflowing */
}

/* ==================== Cards ==================== */
.card {
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    min-width: 0;
    overflow: hidden;
}

/* ==================== KPI Cards ==================== */
/* KPI Card Styles with Urbanist Typography Hierarchy */
.card.kpi-card {
    padding: 20px !important; /* 16-24px range */
    background-color: var(--color-bg-card) !important;
}

.card.kpi-card .card-body {
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0 !important;
}

.kpi-label {
    font-family: 'Urbanist', sans-serif !important;
    font-weight: 500 !important; /* Medium (500) */
    font-size: 14px !important; /* 14px */
    letter-spacing: 0.02em !important; /* +2% */
    color: #9CA3AF !important; /* Muted gray for dark theme */
    text-transform: uppercase !important;
    margin: 0 0 8px 0 !important; /* 8px spacing below */
    line-height: 1.4 !important;
    display: block !important;
}

.kpi-value {
    font-family: 'Urbanist', sans-serif !important;
    font-weight: 700 !important; /* Bold (700) */
    font-size: 32px !important; /* 32px for prominence */
    letter-spacing: -0.01em !important; /* -1% */
    color: #FFFFFF !important; /* White */
    margin: 0 0 12px 0 !important; /* 12px spacing below */
    line-height: 1.2 !important;
    display: flex !important;
    align-items: baseline !important;
    gap: 4px !important;
    font-weight: bold !important; /* Ensure bold */
}

.kpi-suffix {
    font-family: 'Urbanist', sans-serif !important;
    font-weight: 700 !important; /* Bold (700) */
    font-size: 32px !important; /* Same size as primary metric */
    letter-spacing: -0.01em !important; /* -1% */
    color: #FFFFFF !important; /* White */
    opacity: 0.8 !important; /* Slightly muted */
    font-weight: bold !important; /* Ensure bold */
}

.kpi-trend {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    font-family: 'Urbanist', sans-serif !important;
    font-weight: 400 !important; /* Regular (400) */
    font-size: 12px !important; /* 12px */
    letter-spacing: 0.01em !important; /* +1% */
    font-style: italic !important;
    margin: 4px 0 0 0 !important;
    line-height: 1.4 !important;
}

.kpi-trend.positive {
    color: #10B981 !important; /* Green for positive trend */
}

.kpi-trend.negative {
    color: #F04438 !important; /* Red for negative trend */
}

.kpi-trend .material-icons {
    font-size: 14px !important;
    width: 14px !important;
    height: 14px !important;
    font-style: normal !important;
    display: inline-block !important;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--color-border);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 500; /* Medium (500) - Card titles */
    font-family: 'Urbanist', sans-serif;
    color: var(--color-text-primary);
    margin-bottom: 0;
}

.card-body {
    color: var(--color-text-secondary);
}

/* ==================== Buttons ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    font-family: 'Urbanist', sans-serif;
    font-size: 1rem;
    font-weight: 500; /* Medium (500) - Button text */
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    min-height: 44px; /* Touch-friendly */
}

.btn-primary {
    background-color: var(--color-accent-green);
    color: var(--color-bg-primary);
}

.btn-primary:hover {
    filter: brightness(110%);
    transform: scale(1.02);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background-color: transparent;
    border: 2px solid var(--color-accent-green);
    color: var(--color-accent-green);
}

.btn-secondary:hover {
    background-color: var(--color-accent-green);
    color: var(--color-bg-primary);
}

.btn-tertiary {
    background-color: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-accent-purple);
}

.btn-tertiary:hover {
    background-color: var(--color-bg-hover);
}

.btn-danger {
    background-color: var(--color-accent-red);
    color: var(--color-text-primary);
}

.btn-danger:hover {
    filter: brightness(110%);
}

/* ==================== Forms ==================== */
.form-group {
    margin-bottom: var(--spacing-xl);
}

.form-label {
    display: block;
    color: var(--color-text-secondary);
    font-weight: 500; /* Medium (500) - Form labels */
    font-family: 'Urbanist', sans-serif;
    font-size: 0.875rem;
    margin-bottom: var(--spacing-sm);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    color: var(--color-text-primary);
    font-family: 'Urbanist', sans-serif;
    font-size: 1rem;
    font-weight: 400; /* Regular (400) - Input text */
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    outline: none;
    border: 2px solid var(--color-accent-green);
    box-shadow: 0 0 0 3px rgba(90, 230, 97, 0.1);
}

.form-control::placeholder {
    color: var(--color-text-tertiary);
    font-weight: 300; /* Light (300) - Placeholder text */
    font-family: 'Urbanist', sans-serif;
}

/* ==================== Status Indicators ==================== */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500; /* Medium (500) - Badge text */
    font-family: 'Urbanist', sans-serif;
}

.badge-success {
    background-color: var(--color-accent-green);
    color: var(--color-bg-primary);
}

.badge-warning {
    background-color: var(--color-accent-purple);
    color: var(--color-bg-primary);
}

.badge-error {
    background-color: var(--color-accent-red);
    color: var(--color-text-primary);
}

.badge-neutral {
    background-color: var(--color-border);
    color: var(--color-text-secondary);
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: var(--spacing-sm);
}

.status-dot-success { background-color: var(--color-accent-green); }
.status-dot-warning { background-color: var(--color-accent-purple); }
.status-dot-error { background-color: var(--color-accent-red); }

/* ==================== Responsive Design ==================== */
@media (max-width: 1440px) {
    .content-wrapper {
        padding: var(--spacing-xl);
    }
    
    .container {
        padding: 0 var(--spacing-lg);
    }
}

@media (max-width: 1024px) {
    .main-content {
        margin-left: 0;
    }
    
    .content-wrapper {
        padding: var(--spacing-xl);
    }
    
    .container {
        padding: 0 var(--spacing-lg);
    }
    
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: var(--spacing-lg);
    }
    
    .grid-4,
    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.25rem; }
    
    .top-nav {
        padding: 0 var(--spacing-lg);
    }
    
    .search-bar {
        display: none;
    }
}

/* ==================== Utility Classes ==================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-secondary { color: var(--color-text-secondary); }
.text-tertiary { color: var(--color-text-tertiary); }

/* Font Weight Utilities (Urbanist) */
.font-light { font-weight: 300; font-family: 'Urbanist', sans-serif; } /* Light - For subtle text, captions */
.font-regular { font-weight: 400; font-family: 'Urbanist', sans-serif; } /* Regular - Body text */
.font-medium { font-weight: 500; font-family: 'Urbanist', sans-serif; } /* Medium - Labels, emphasis */
.font-bold { font-weight: 700; font-family: 'Urbanist', sans-serif; } /* Bold - Headings, strong emphasis */

/* Small text uses Light weight for subtle appearance */
small, .small, .text-small {
    font-size: 0.875rem;
    font-weight: 300; /* Light (300) - Small/subtle text */
    font-family: 'Urbanist', sans-serif;
}

/* Caption text uses Light weight */
.caption {
    font-size: 0.75rem;
    font-weight: 300; /* Light (300) - Captions */
    font-family: 'Urbanist', sans-serif;
}

.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }
.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }
.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }

