/* Global Styles - Professional Dashboard */

/* Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    line-height: 1.5;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8f9fa;
    color: #2c3e50;
    font-size: 14px;
    line-height: 1.6;
}

/* Color Palette - Professional Blue Scale */
:root {
    /* Primary Colors - Blue Scale */
    --primary-50: #f0f4f8;
    --primary-100: #d9e2ec;
    --primary-200: #bcccdc;
    --primary-300: #9fb3c8;
    --primary-400: #829ab1;
    --primary-500: #627d98;
    --primary-600: #486581;
    --primary-700: #334e68;
    --primary-800: #243b53;
    --primary-900: #102a43;

    /* Neutral Colors */
    --gray-50: #f7fafc;
    --gray-100: #edf2f7;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e0;
    --gray-400: #a0aec0;
    --gray-500: #718096;
    --gray-600: #4a5568;
    --gray-700: #2d3748;
    --gray-800: #1a202c;
    --gray-900: #171923;

    /* Status Colors */
    --success: #38a169;
    --warning: #d69e2e;
    --error: #e53e3e;
    --info: #3182ce;

    /* Spacing */
    --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;

    /* Border Radius */
    --radius-sm: 3px;
    --radius-md: 6px;
    --radius-lg: 8px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

    /* Transitions */
    --transition: 0.2s ease;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--gray-800);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: var(--space-4);
}

h1 {
    font-size: 24px;
}

h2 {
    font-size: 20px;
}

h3 {
    font-size: 18px;
}

h4 {
    font-size: 16px;
}

h5 {
    font-size: 14px;
}

h6 {
    font-size: 12px;
}

p {
    color: var(--gray-600);
    margin-bottom: var(--space-3);
}

a {
    color: var(--primary-600);
    text-decoration: none;
    transition: color var(--transition);
}

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

/* Layout */
.dashboard-layout {
    display: grid;
    grid-template-areas:
        "header header"
        "sidebar main"
        "sidebar footer";
    grid-template-columns: 260px 1fr;
    grid-template-rows: 64px 1fr auto;
    min-height: 100vh;
}

.dashboard-header {
    grid-area: header;
    background: white;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-6);
    box-shadow: var(--shadow-sm);
    z-index: 100;
}

.dashboard-sidebar {
    grid-area: sidebar;
    background: var(--primary-900);
    color: white;
    overflow-y: auto;
    border-right: 1px solid var(--primary-800);
}

.dashboard-main {
    grid-area: main;
    padding: var(--space-6);
    background: var(--gray-50);
    overflow-y: auto;
}

.dashboard-footer {
    grid-area: footer;
    background: white;
    border-top: 1px solid var(--gray-200);
    padding: var(--space-3) var(--space-6);
}

/* Cards */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.card-header {
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

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

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2) var(--space-4);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition);
    gap: var(--space-2);
}

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

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

.btn-secondary {
    background: white;
    color: var(--gray-700);
    border-color: var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-50);
    color: var(--gray-800);
}

.btn-sm {
    padding: var(--space-1) var(--space-3);
    font-size: 12px;
}

/* Forms */
.form-group {
    margin-bottom: var(--space-4);
}

.form-label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: 500;
    color: var(--gray-700);
}

.form-control {
    width: 100%;
    padding: var(--space-3);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: border-color var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(98, 125, 152, 0.1);
}

/* Navigation */
.nav-menu {
    list-style: none;
}

.nav-item {
    margin-bottom: var(--space-2);
}

.nav-link {
    display: flex;
    align-items: center;
    padding: var(--space-3);
    color: var(--primary-200);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition);
    gap: var(--space-3);
}

.nav-link:hover {
    background: var(--primary-800);
    color: white;
}

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

.nav-section {
    margin-bottom: var(--space-6);
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary-400);
    margin-bottom: var(--space-3);
}

/* Grid System */
.grid {
    display: grid;
    gap: var(--space-6);
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Chart Containers */
.chart-container {
    position: relative;
    width: 100%;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-container canvas {
    max-width: 100%;
    max-height: 100%;
}

/* Loading States */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-12);
    color: var(--gray-500);
}

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--gray-200);
    border-top: 2px solid var(--primary-600);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--space-3);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Error States */
.error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-12);
    text-align: center;
    color: var(--error);
}

.error-message {
    margin-bottom: var(--space-4);
    color: var(--gray-600);
}

/* Stats & KPIs */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.stat-card {
    background: white;
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    text-align: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-700);
    margin-bottom: var(--space-2);
}

.stat-label {
    font-size: 12px;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* KPI Cards */
.kpi-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    transition: all var(--transition);
    min-height: 80px;
}

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

/* Utilities */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--gray-500);
}

.text-primary {
    color: var(--primary-600);
}

.text-success {
    color: var(--success);
}

.text-warning {
    color: var(--warning);
}

.text-error {
    color: var(--error);
}

.bg-white {
    background: white;
}

.bg-gray {
    background: var(--gray-50);
}

.border {
    border: 1px solid var(--gray-200);
}

.border-top {
    border-top: 1px solid var(--gray-200);
}

.border-bottom {
    border-bottom: 1px solid var(--gray-200);
}

.rounded {
    border-radius: var(--radius-md);
}

.rounded-lg {
    border-radius: var(--radius-lg);
}

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

.shadow-md {
    box-shadow: var(--shadow-md);
}

.mb-2 {
    margin-bottom: var(--space-2);
}

.mb-3 {
    margin-bottom: var(--space-3);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.mb-6 {
    margin-bottom: var(--space-6);
}

.p-3 {
    padding: var(--space-3);
}

.p-4 {
    padding: var(--space-4);
}

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

/* Responsive */
@media (max-width: 768px) {
    .dashboard-layout {
        grid-template-areas: "header" "main";
        grid-template-columns: 1fr;
        grid-template-rows: 60px 1fr;
    }

    .dashboard-sidebar {
        display: none;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .dashboard-main {
        padding: var(--space-4);
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}



/* Print Styles */
@media print {

    .dashboard-sidebar,
    .dashboard-header {
        display: none;
    }

    .dashboard-main {
        padding: 0;
    }
}