/* ═══════════════════════════════════════════════════════════
   GESTIONALE - Modern Professional Design
   Clean, minimal, data-focused interface
   ═══════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────
   CSS Variables - Professional Color System
   ───────────────────────────────────────────────────────────── */
:root {
    /* Primary - Deep professional blue */
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-300: #93c5fd;
    --primary-400: #60a5fa;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --primary-800: #1e40af;
    --primary-900: #1e3a8a;
    
    /* Neutral - Slate gray system */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    
    /* Semantic colors */
    --success-50: #f0fdf4;
    --success-500: #22c55e;
    --success-600: #16a34a;
    --success-700: #15803d;
    
    --warning-50: #fffbeb;
    --warning-500: #f59e0b;
    --warning-600: #d97706;
    
    --danger-50: #fef2f2;
    --danger-500: #ef4444;
    --danger-600: #dc2626;
    --danger-700: #b91c1c;
    
    --info-50: #ecfeff;
    --info-500: #06b6d4;
    --info-600: #0891b2;
    
    /* Surfaces */
    --surface-primary: #ffffff;
    --surface-secondary: var(--slate-50);
    --surface-tertiary: var(--slate-100);
    
    /* Text */
    --text-primary: var(--slate-900);
    --text-secondary: var(--slate-600);
    --text-tertiary: var(--slate-400);
    --text-inverse: #ffffff;
    
    /* Borders */
    --border-light: var(--slate-200);
    --border-medium: var(--slate-300);
    
    /* Shadows - Refined */
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Border radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* Spacing scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
}

/* ─────────────────────────────────────────────────────────────
   Base & Reset
   ───────────────────────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--slate-100);
    min-height: 100vh;
}

/* ─────────────────────────────────────────────────────────────
   Sidebar Layout
   ───────────────────────────────────────────────────────────── */
:root {
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 72px;
    --mobile-header-height: 60px;
}

body.has-sidebar .main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.has-sidebar .content-wrapper {
    flex: 1;
    padding: var(--space-6);
}

body.has-sidebar .container {
    max-width: 1400px;
    padding: 0;
}

/* ─────────────────────────────────────────────────────────────
   Sidebar (Dark Theme)
   ───────────────────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--slate-900);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: transform var(--transition-slow);
}

/* Sidebar Header */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-5) var(--space-5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo img {
    height: 32px;
    width: auto;
}

.sidebar-close {
    display: none;
    position: absolute;
    right: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--slate-400);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
}

.sidebar-close:hover {
    color: white;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: var(--space-4) 0;
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.sidebar-nav::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.sidebar-menu {
    list-style: none;
    padding: 0 var(--space-3);
    margin: 0;
}

.sidebar-item {
    margin-bottom: var(--space-1);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    color: var(--slate-400);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    opacity: 0.8;
}

.sidebar-link:hover {
    color: var(--slate-100);
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-link.active {
    color: white;
    background: var(--primary-600);
}

.sidebar-link.active i {
    opacity: 1;
}

.sidebar-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: var(--space-4) var(--space-4);
}

/* Sidebar Timer Card (Active Timbratura) */
.sidebar-timer-card {
    margin: var(--space-3);
    padding: var(--space-4);
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    border-radius: var(--radius-lg);
    color: white;
}

.sidebar-timer-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
    margin-bottom: var(--space-3);
}

.sidebar-timer-pulse {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: timerPulse 2s infinite;
}

@keyframes timerPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); }
    50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(74, 222, 128, 0); }
}

.sidebar-timer-project {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-timer-activity {
    font-size: 0.75rem;
    opacity: 0.85;
    margin-bottom: var(--space-3);
    line-height: 1.4;
}

.sidebar-timer-time {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-family: 'DM Sans', monospace;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--space-3);
}

.sidebar-timer-time i {
    font-size: 0.875rem;
    opacity: 0.8;
}

.sidebar-timer-stop {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    width: 100%;
    padding: var(--space-2) var(--space-3);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.sidebar-timer-stop:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.sidebar-timer-stop i {
    font-size: 0.75rem;
}

/* Sidebar Footer / User */
.sidebar-footer {
    padding: var(--space-3);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.sidebar-user:hover {
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-user.open {
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-user-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.6875rem;
    color: var(--slate-400);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.sidebar-user-arrow {
    color: var(--slate-500);
    font-size: 0.75rem;
    transition: transform var(--transition-fast);
}

.sidebar-user.open .sidebar-user-arrow {
    transform: rotate(180deg);
}

/* User Dropdown */
.sidebar-user-dropdown {
    position: absolute;
    bottom: 100%;
    left: var(--space-3);
    right: var(--space-3);
    background: var(--slate-800);
    border-radius: var(--radius-md);
    padding: var(--space-2);
    margin-bottom: var(--space-2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-lg);
}

.sidebar-user-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sidebar-dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    color: var(--slate-300);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.sidebar-dropdown-item i {
    width: 16px;
    text-align: center;
    font-size: 0.875rem;
    opacity: 0.7;
}

.sidebar-dropdown-item:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-dropdown-item.logout {
    color: var(--danger-500);
}

.sidebar-dropdown-item.logout:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-400);
}

.sidebar-dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: var(--space-2) 0;
}

/* ─────────────────────────────────────────────────────────────
   Mobile Header
   ───────────────────────────────────────────────────────────── */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--mobile-header-height);
    background: var(--surface-primary);
    border-bottom: 1px solid var(--border-light);
    padding: 0 var(--space-4);
    align-items: center;
    justify-content: space-between;
    z-index: 1030;
}

.mobile-menu-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: var(--radius-md);
}

.mobile-menu-btn:hover {
    background: var(--slate-100);
    color: var(--text-primary);
}

.mobile-logo img {
    height: 28px;
    width: auto;
}

.mobile-user {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8125rem;
    font-weight: 600;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1035;
    opacity: 0;
    transition: opacity var(--transition-base);
    }
    
.sidebar-overlay.visible {
    opacity: 1;
    }
    
/* ─────────────────────────────────────────────────────────────
   App Footer
   ───────────────────────────────────────────────────────────── */
.app-footer {
        display: flex;
        align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--border-light);
    font-size: 0.75rem;
    color: var(--text-tertiary);
    background: var(--surface-primary);
    margin-top: auto;
}

.footer-version {
    padding: 0.125rem 0.5rem;
    background: var(--slate-100);
    border-radius: var(--radius-sm);
}


/* ─────────────────────────────────────────────────────────────
   Responsive - Mobile
   ───────────────────────────────────────────────────────────── */
@media (max-width: 1023px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-close {
        display: block;
    }
    
    .sidebar-overlay {
        display: block;
    }
    
    .mobile-header {
        display: flex;
    }
    
    body.has-sidebar .main-content {
        margin-left: 0;
        padding-top: var(--mobile-header-height);
    }
    
    body.has-sidebar .content-wrapper {
        padding: var(--space-4);
    }
    
    body.sidebar-open {
        overflow: hidden;
    }
}

/* ─────────────────────────────────────────────────────────────
   Typography
   ───────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h1, .h1 { font-size: 1.75rem; letter-spacing: -0.025em; }
h2, .h2 { font-size: 1.5rem; letter-spacing: -0.025em; }
h3, .h3 { font-size: 1.25rem; letter-spacing: -0.02em; }
h4, .h4 { font-size: 1.125rem; }
h5, .h5 { font-size: 1rem; }
h6, .h6 { font-size: 0.875rem; }

.text-muted { color: var(--text-secondary) !important; }
.text-success { color: var(--success-600) !important; }
.text-danger { color: var(--danger-600) !important; }
.text-warning { color: var(--warning-600) !important; }
.text-info { color: var(--info-600) !important; }
.text-primary { color: var(--primary-600) !important; }

.fw-medium { font-weight: 500; }
.small, small { font-size: 0.8125rem; }

/* ─────────────────────────────────────────────────────────────
   Layout (non-sidebar fallback)
   ───────────────────────────────────────────────────────────── */
.container {
    max-width: 1400px;
    padding-left: var(--space-6);
    padding-right: var(--space-6);
}

/* Dropdown menu (used in various places) */
.dropdown-menu {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--space-2);
    margin-top: var(--space-2) !important;
    min-width: 200px;
}

.dropdown-item {
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    background-color: var(--slate-100);
    color: var(--text-primary);
}

.dropdown-item.text-danger {
    color: var(--danger-600);
}

.dropdown-item.text-danger:hover {
    background-color: var(--danger-50);
    color: var(--danger-700);
}

.dropdown-divider {
    margin: var(--space-2) 0;
    border-color: var(--border-light);
}

/* ─────────────────────────────────────────────────────────────
   Cards
   ───────────────────────────────────────────────────────────── */
.card {
    background: var(--surface-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--transition-base);
    margin-bottom: 0;
}

.card:hover {
    box-shadow: var(--shadow-sm);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-light);
    padding: var(--space-5) var(--space-6);
    font-weight: 600;
}

.card-body {
    padding: var(--space-6);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0;
    color: var(--text-primary);
}

/* ─────────────────────────────────────────────────────────────
   Dashboard Metrics Cards
   ───────────────────────────────────────────────────────────── */
.metric-card {
    background: var(--surface-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    transition: all var(--transition-base);
    height: 100%;
}

.metric-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-medium);
}

.metric-card .metric-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: var(--space-4);
}

.metric-card .metric-icon.primary {
    background: var(--primary-100);
    color: var(--primary-600);
}

.metric-card .metric-icon.success {
    background: var(--success-50);
    color: var(--success-600);
}

.metric-card .metric-icon.danger {
    background: var(--danger-50);
    color: var(--danger-600);
}

.metric-card .metric-icon.info {
    background: var(--info-50);
    color: var(--info-600);
}

.metric-card .metric-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.metric-card .metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.metric-card .metric-value.positive {
    color: var(--success-600);
}

.metric-card .metric-value.negative {
    color: var(--danger-600);
}

.metric-card .metric-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--primary-600);
    text-decoration: none;
    margin-top: var(--space-4);
    transition: color var(--transition-fast);
}

.metric-card .metric-link:hover {
    color: var(--primary-700);
}

.metric-card .metric-link i {
    font-size: 0.75rem;
    transition: transform var(--transition-fast);
}

.metric-card .metric-link:hover i {
    transform: translateX(3px);
}

/* ─────────────────────────────────────────────────────────────
   Analytics Quick Links
   ───────────────────────────────────────────────────────────── */
.analytics-card {
    background: var(--surface-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    transition: all var(--transition-base);
    text-decoration: none !important;
    display: block;
    height: 100%;
}

.analytics-card:hover {
    border-color: var(--primary-300);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.analytics-card .analytics-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.analytics-card .analytics-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.analytics-card .analytics-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ─────────────────────────────────────────────────────────────
   Charts Container
   ───────────────────────────────────────────────────────────── */
.chart-container {
    position: relative;
    background: var(--surface-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--border-light);
}

.chart-header .chart-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.chart-body {
    padding: var(--space-6);
}

.chart-wrapper {
    position: relative;
    width: 100%;
}

.chart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-12) var(--space-6);
    color: var(--text-tertiary);
}

.chart-empty i {
    font-size: 3rem;
    margin-bottom: var(--space-4);
    opacity: 0.5;
}

.chart-empty p {
    font-size: 0.9375rem;
    margin: 0;
}

/* ─────────────────────────────────────────────────────────────
   Tables
   ───────────────────────────────────────────────────────────── */
.table {
    margin-bottom: 0;
    font-size: 0.875rem;
}

.table thead th {
    background: var(--slate-50);
    border-bottom: 1px solid var(--border-light);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    padding: var(--space-3) var(--space-4);
    white-space: nowrap;
}

.table tbody td {
    padding: var(--space-4);
    vertical-align: middle;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover {
    background-color: var(--slate-50);
}

.table-responsive {
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* ─────────────────────────────────────────────────────────────
   Badges
   ───────────────────────────────────────────────────────────── */
.badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.35em 0.7em;
    border-radius: var(--radius-sm);
    letter-spacing: 0.01em;
}

.text-bg-success, .badge.bg-success {
    background-color: var(--success-50) !important;
    color: var(--success-700) !important;
}

.text-bg-primary, .badge.bg-primary {
    background-color: var(--primary-100) !important;
    color: var(--primary-700) !important;
}

.text-bg-warning, .badge.bg-warning {
    background-color: var(--warning-50) !important;
    color: var(--warning-600) !important;
}

.text-bg-danger, .badge.bg-danger {
    background-color: var(--danger-50) !important;
    color: var(--danger-700) !important;
}

.text-bg-secondary, .badge.bg-secondary {
    background-color: var(--slate-100) !important;
    color: var(--slate-600) !important;
}

.text-bg-info, .badge.bg-info {
    background-color: var(--info-50) !important;
    color: var(--info-600) !important;
}

/* ─────────────────────────────────────────────────────────────
   Buttons
   ───────────────────────────────────────────────────────────── */
.btn {
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-primary {
    background-color: var(--primary-600);
    border-color: var(--primary-600);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-700);
    border-color: var(--primary-700);
}

.btn-outline-primary {
    color: var(--primary-600);
    border-color: var(--primary-300);
    background: transparent;
}

.btn-outline-primary:hover {
    background-color: var(--primary-600);
    border-color: var(--primary-600);
    color: white;
}

.btn-outline-secondary {
    color: var(--text-secondary);
    border-color: var(--border-medium);
    background: transparent;
}

.btn-outline-secondary:hover {
    background-color: var(--slate-100);
    border-color: var(--slate-300);
    color: var(--text-primary);
}

.btn-outline-danger {
    color: var(--danger-600);
    border-color: var(--danger-300);
}

.btn-outline-danger:hover {
    background-color: var(--danger-600);
    border-color: var(--danger-600);
    color: white;
}

.btn-outline-warning {
    color: var(--warning-600);
    border-color: var(--warning-500);
}

.btn-outline-warning:hover {
    background-color: var(--warning-500);
    border-color: var(--warning-500);
    color: white;
}

.btn-outline-success {
    color: var(--success-600);
    border-color: var(--success-500);
}

.btn-outline-success:hover {
    background-color: var(--success-600);
    border-color: var(--success-600);
    color: white;
}

.btn-light {
    background-color: var(--slate-100);
    border-color: var(--border-light);
    color: var(--text-secondary);
}

.btn-light:hover {
    background-color: var(--slate-200);
    border-color: var(--border-medium);
    color: var(--text-primary);
}

.btn-group .btn {
    border-radius: var(--radius-sm);
}

/* ─────────────────────────────────────────────────────────────
   Forms
   ───────────────────────────────────────────────────────────── */
.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.form-control, .form-select {
    font-size: 0.9375rem;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    background-color: var(--surface-primary);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px var(--primary-100);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-tertiary);
}

.input-group-text {
    background-color: var(--slate-50);
    border: 1px solid var(--border-medium);
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

/* ─────────────────────────────────────────────────────────────
   Alerts
   ───────────────────────────────────────────────────────────── */
.alert {
    border: none;
    border-radius: var(--radius-md);
    padding: var(--space-4) var(--space-5);
    font-size: 0.9375rem;
    font-weight: 500;
}

.alert-success {
    background-color: var(--success-50);
    color: var(--success-700);
    border-left: 4px solid var(--success-500);
}

.alert-danger {
    background-color: var(--danger-50);
    color: var(--danger-700);
    border-left: 4px solid var(--danger-500);
}

.alert-warning {
    background-color: var(--warning-50);
    color: var(--warning-600);
    border-left: 4px solid var(--warning-500);
}

.alert-info {
    background-color: var(--info-50);
    color: var(--info-600);
    border-left: 4px solid var(--info-500);
}

/* Footer styles moved to sidebar section (.app-footer) */

/* ─────────────────────────────────────────────────────────────
   Utilities & Animations
   ───────────────────────────────────────────────────────────── */
.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--slate-100);
}

::-webkit-scrollbar-thumb {
    background: var(--slate-300);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--slate-400);
}

/* ─────────────────────────────────────────────────────────────
   Page Header
   ───────────────────────────────────────────────────────────── */
.page-header {
    margin-bottom: var(--space-8);
}

.page-header h1 {
    margin-bottom: var(--space-1);
}

.page-header .text-muted {
    font-size: 0.9375rem;
}

/* ─────────────────────────────────────────────────────────────
   Section Titles
   ───────────────────────────────────────────────────────────── */
.section-title {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
}

/* ─────────────────────────────────────────────────────────────
   Responsive Adjustments
   ───────────────────────────────────────────────────────────── */
@media (max-width: 767.98px) {
    .container {
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }
    
    .metric-card {
        padding: var(--space-5);
    }
    
    .metric-card .metric-value {
    font-size: 1.5rem;
}

    .chart-body {
        padding: var(--space-4);
    }
    
    .card-body {
        padding: var(--space-4);
    }
    
    .table thead th,
    .table tbody td {
        padding: var(--space-3);
    }
}

/* ─────────────────────────────────────────────────────────────
   Legacy Support - Bootstrap overrides
   ───────────────────────────────────────────────────────────── */
.bg-light { background-color: var(--slate-50) !important; }
.bg-primary { background-color: var(--primary-600) !important; }
.border-0 { border: none !important; }

.bg-primary.bg-opacity-10 { 
    background-color: var(--primary-100) !important; 
}
.bg-success.bg-opacity-10 { 
    background-color: var(--success-50) !important; 
}
.bg-danger.bg-opacity-10 { 
    background-color: var(--danger-50) !important; 
}
.bg-info.bg-opacity-10 { 
    background-color: var(--info-50) !important; 
}

.rounded-circle {
    border-radius: var(--radius-full) !important;
}

.table-light {
    --bs-table-bg: var(--slate-50);
    --bs-table-border-color: var(--border-light);
}

/* Link styles */
a {
    color: var(--primary-600);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-700);
}

.text-decoration-none:hover {
    text-decoration: none !important;
}

/* ─────────────────────────────────────────────────────────────
   Utility classes
   ───────────────────────────────────────────────────────────── */
.h-100 { height: 100%; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 2rem !important; }
.me-1 { margin-right: 0.25rem !important; }
.p-0 { padding: 0 !important; }
