/* ===========================
   Global Smart Theme
=========================== */
:root {
    --primary: #4f46e5;        /* Vibrant Indigo */
    --primary-dark: #3730a3;   /* Deep Indigo */
    --secondary: #64748b;      /* Cool Gray */
    --sidebar-bg: #1e293b;     /* Dark Slate */
    --sidebar-hover: #334155;  /* Hover Slate */
    --light: #f9fafb;          /* Soft Light */
    --gray: #e2e8f0;           /* Neutral Gray */
    --text: #111827;           /* Dark Text */
    --shadow: 0 4px 12px rgba(0,0,0,0.12);
    --radius: 10px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Poppins", "Segoe UI", Roboto, sans-serif;
    background: var(--light);
    color: var(--text);
    line-height: 1.6;
}

/* ===========================
   Sidebar
=========================== */
.sidebar {
    height: 100%;
    width: 250px;
    position: fixed;
    top: 0;
    left: 0;
    background: var(--sidebar-bg);
    padding-top: 20px;
    color: white;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.sidebar a {
    padding: 14px 25px;
    text-decoration: none;
    font-size: 15px;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 3px solid transparent;
    transition: var(--transition);
    font-weight: 500;
}

.sidebar a:hover,
.sidebar a.active {
    background: var(--sidebar-hover);
    border-left: 3px solid var(--primary);
    color: white;
}

/* ===========================
   Main Content
=========================== */
.main-content {
    margin-left: 250px;
    padding: 30px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

/* ===========================
   Cards
=========================== */
.card-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    flex: 1;
    min-width: 260px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-top: 4px solid var(--primary);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.15);
}

/* ===========================
   Chart Styling
=========================== */
.chart-container {
    position: relative;
    width: 100%;
    max-width: 600px;   /* keeps chart from being too wide */
    margin: 20px auto;
}

.chart-container canvas {
    width: 100% !important;
    height: auto !important;
    max-height: 350px;  /* prevents charts from being too tall */
}


/* ===========================
   Tables
=========================== */
.table-container {
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

table th,
table td {
    border: 1px solid var(--gray);
    padding: 12px;
    text-align: left;
}

table th {
    background: var(--primary);
    color: white;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* ===========================
   Forms & Buttons
=========================== */
.form-group {
    margin-bottom: 15px;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius);
    font-size: 15px;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(79,70,229,0.25);
}

.btn {
    display: inline-block;
    padding: 10px 22px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* ===========================
   Responsive
=========================== */
@media (max-width: 992px) {
    .main-content {
        margin-left: 0;
    }
    .sidebar {
        width: 220px;
        position: fixed;
        top: 0;
        left: -220px;
        transition: left 0.3s ease;
        z-index: 1000;
    }
    .sidebar.show {
        left: 0;
    }
}

@media (max-width: 576px) {
    .card-container {
        flex-direction: column;
    }
}
