html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

:root {
    --primary-light: #a7d0e3;
    --primary: #8fddf6;
    --primary-dark: #5ec2e6;
    --secondary-light: #d6e4ff;
    --secondary: #a3bffa;
    --accent-pink: #ffd6e8;
    --accent-pink-dark: #ffb1d0;
    --accent-purple: #e2d6ff;
    --accent-purple-dark: #c9b2ff;
    --text-dark: #2d3748;
    --text-light: #718096;
    --background: #f9fafb;
    --card-bg: #ffffff;
    --border-radius: 16px;
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 6px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 15px 35px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ? Base typography and responsive font size */
html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    background-color: var(--background);
    color: var(--text-dark);
    font-family: 'Poppins', sans-serif;
    min-height: 100vh;
    padding-bottom: 2rem;
    margin-bottom: 60px; /* merged */
}

/* ? Focus styles */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.dashboard-header {
    background: linear-gradient(120deg, var(--primary-light), var(--secondary-light));
    color: var(--text-dark);
    padding: 2rem 0;
    border-radius: var(--border-radius);
    margin: 1rem 0 2.5rem 0;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

    .dashboard-header::before {
        content: '';
        position: absolute;
        top: -50%;
        right: -50%;
        width: 100%;
        height: 200%;
        background: rgba(255, 255, 255, 0.3);
        transform: rotate(25deg);
    }

    .dashboard-header h2 {
        margin: 0;
        font-weight: 700;
        font-size: 2.2rem;
        position: relative;
    }

.header-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-top: 0.5rem;
    font-weight: 400;
    position: relative;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stats-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    height: 100%;
    position: relative;
    overflow: hidden;
    border: none;
    backdrop-filter: blur(10px);
}

    .stats-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 5px;
        height: 100%;
        background: linear-gradient(to bottom, var(--primary-light), var(--secondary-light));
    }

    .stats-card:hover {
        transform: translateY(-5px);
        box-shadow: var(--shadow-lg);
    }

    .stats-card .card-body {
        padding: 1.8rem 1.5rem 1.8rem 2rem;
        display: flex;
        flex-direction: column;
    }

    .stats-card .icon-container {
        width: 60px;
        height: 60px;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 1.2rem;
        background: linear-gradient(45deg, var(--primary-light), var(--secondary-light));
        color: var(--text-dark);
        font-size: 1.5rem;
        box-shadow: 0 5px 15px rgba(142, 221, 246, 0.3);
    }

    .stats-card .card-title {
        font-size: 0.95rem;
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 0.5rem;
        color: var(--text-light);
    }

    .stats-card .card-value {
        font-size: 2.2rem;
        font-weight: 700;
        margin-bottom: 0;
        color: var(--text-dark);
        line-height: 1.2;
    }

    .stats-card.primary .icon-container {
        background: linear-gradient(45deg, var(--primary-light), var(--primary-dark));
    }

    .stats-card.success .icon-container {
        background: linear-gradient(45deg, var(--accent-purple), var(--accent-purple-dark));
    }

    .stats-card.info .icon-container {
        background: linear-gradient(45deg, var(--secondary-light), var(--secondary));
    }

    .stats-card.warning .icon-container {
        background: linear-gradient(45deg, var(--accent-pink), var(--accent-pink-dark));
    }

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.chart-container {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    height: 100%;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

    .chart-container:hover {
        box-shadow: var(--shadow-md);
    }

.chart-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1.8rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

    .chart-title i {
        margin-right: 0.8rem;
        color: var(--primary-dark);
        background: rgba(142, 221, 246, 0.2);
        width: 40px;
        height: 40px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

.small-chart {
    width: 100% !important;
    height: 300px !important;
    margin: auto;
}

.full-width-chart {
    grid-column: 1 / -1;
}

@media (max-width: 1200px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-header h2 {
        font-size: 1.8rem;
    }

    .stats-card .card-value {
        font-size: 1.8rem;
    }

    .chart-container {
        padding: 1.5rem;
    }
}

.canvas-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    z-index: -1;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: var(--primary);
    top: -150px;
    right: -150px;
}

.shape-2 {
    width: 200px;
    height: 200px;
    background: var(--accent-pink-dark);
    bottom: -100px;
    left: -100px;
}
