/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    --font-primary: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Colors */
    --color-bg-sidebar: #5b4185;
    --color-bg-sidebar-active: #3e2860;
    --color-bg-main: #f9f5fc;
    --color-white: #ffffff;

    /* Text colors */
    --color-text-dark: #1e293b;
    --color-text-muted: #64748b;
    --color-text-white: #ffffff;

    /* Chart Colors */
    --chart-blue: #0d6efd;
    --chart-green: #198754;
    --chart-yellow: #ffc107;
    --chart-orange: #fd7e14;
    --chart-red: #dc3545;
    --chart-purple: #6f42c1;

    /* Transitions */
    --transition-normal: 0.3s ease;
    --transition-fast: 0.2s ease;
}

body {
    font-family: var(--font-primary) !important;
    background-color: var(--color-bg-main);
    color: var(--color-text-dark);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

/* Layout Wrapper */
.app-container {
    display: flex;
    width: 100vw;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Sidebar Styling */
.sidebar {
    width: 260px;
    background-color: var(--color-bg-sidebar);
    color: var(--color-text-white);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    flex-shrink: 0;
    transition: width var(--transition-normal);
    position: relative;
    box-shadow: 4px 0 24px rgba(15, 76, 186, 0.15);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px 32px 12px;
}

.sidebar-brand-icon {
    width: 36px;
    height: 36px;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-brand-name {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
    padding-left: 0;
}

.sidebar-item a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border-radius: 12px;
    transition: all var(--transition-fast);
}

.sidebar-item a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--color-text-white);
}

.sidebar-item.active a {
    background-color: var(--color-bg-sidebar-active);
    color: var(--color-text-white);
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 16px;
}

.sidebar-item.logout a {
    color: rgba(255, 255, 255, 0.8);
}

.sidebar-item.logout a:hover {
    background-color: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

/* Main Content Styling */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-y: auto;
}

/* Header Styling */
.header {
    background-color: var(--color-white);
    border-bottom: 1px solid #e2e8f0;
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--color-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 8px;
    transition: background var(--transition-fast);
}

.sidebar-toggle:hover {
    background-color: #f1f5f9;
}

.header-title h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text-dark);
    margin-bottom: 2px;
}

.header-title p {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-bottom: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.notification-btn {
    background: none;
    border: none;
    position: relative;
    cursor: pointer;
    color: var(--color-text-muted);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast);
}

.notification-btn:hover {
    background-color: #f1f5f9;
}

.notification-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background-color: #ef4444;
    color: var(--color-white);
    font-size: 10px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--color-white);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 8px;
    border-radius: 30px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.user-profile:hover {
    background-color: #f1f5f9;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #eff6ff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    overflow: hidden;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-dark);
}

.profile-arrow {
    color: var(--color-text-muted);
    font-size: 12px;
}

/* Page Content Wrapper */
.content-body {
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    flex-grow: 1;
}

/* Custom CSS/SVG Bar Chart */
.bar-chart-container {
    height: 250px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding-top: 20px;
    padding-bottom: 24px;
}

.bar-chart-grid-lines {
    position: absolute;
    top: 20px;
    bottom: 48px;
    left: 28px;
    right: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
}

.grid-line {
    border-top: 1px dashed #e2e8f0;
    width: 100%;
    position: relative;
}

.grid-label {
    position: absolute;
    left: -28px;
    top: -8px;
    font-size: 11px;
    color: var(--color-text-muted);
    width: 24px;
    text-align: right;
}

.bar-chart-bars {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: calc(100% - 48px);
    margin-left: 28px;
    position: relative;
    z-index: 2;
}

.bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 60px;
    height: 100%;
    justify-content: flex-end;
    position: relative;
}

.bar-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-dark);
    margin-bottom: 8px;
    transition: opacity var(--transition-fast);
}

.bar-fill {
    width: 32px;
    border-radius: 6px 6px 0 0;
    transition: height 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.bar-fill.bg-success { background-color: var(--chart-green) !important; }
.bar-fill.bg-warning { background-color: var(--chart-yellow) !important; }
.bar-fill.bg-info { background-color: var(--chart-orange) !important; }
.bar-fill.bg-danger { background-color: var(--chart-red) !important; }

.bar-label {
    position: absolute;
    bottom: -24px;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-muted);
    white-space: nowrap;
}

/* Custom SVG Donut Chart */
.donut-chart-container {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 250px;
}

.donut-chart-wrapper {
    position: relative;
    width: 160px;
    height: 160px;
    flex-shrink: 0;
}

.donut-chart-svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.donut-segment {
    fill: none;
    stroke-width: 18;
    transition: stroke-dashoffset var(--transition-normal);
}

.donut-segment.primary { stroke: var(--chart-blue); }
.donut-segment.success { stroke: var(--chart-green); }
.donut-segment.warning { stroke: var(--chart-yellow); }
.donut-segment.info { stroke: var(--chart-purple); }

.donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.donut-center-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text-dark);
}

.donut-center-label {
    font-size: 11px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        box-shadow: 0 4px 24px rgba(15, 76, 186, 0.15);
    }

    .sidebar-brand {
        padding-bottom: 16px;
    }

    .content-body {
        padding: 20px;
        gap: 20px;
    }

    .header {
        padding: 16px 20px;
    }
}

/* Table Card & Custom Table Styles */
.table-card {
    background-color: var(--color-white);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.table-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    background-color: #f8fafc;
}

.table-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text-dark);
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
}

.custom-table th {
    text-align: left;
    padding: 14px 24px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
    background-color: var(--color-white);
}

.custom-table td {
    padding: 16px 24px;
    font-size: 14px;
    color: var(--color-text-dark);
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.custom-table tbody tr {
    transition: background-color var(--transition-fast);
}

.custom-table tbody tr:hover {
    background-color: #f1f5f9;
}

.custom-table tbody tr:last-child td {
    border-bottom: none;
}

/* Badges / Small Buttons */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.badge.blue {
    background-color: #f3e8fa;
    color: #9e79db;
    border: 1px solid #e0c8f4;
}

.badge.blue:hover {
    background-color: #9e79db;
    color: white;
}

.badge.red {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.badge.red:hover {
    background-color: #dc2626;
    color: white;
}

/* Override Bootstrap Primary Button */
.btn-primary {
    background-color: #c9a0dc !important;
    border-color: #c9a0dc !important;
    color: #ffffff !important;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background-color: #b188c6 !important;
    border-color: #b188c6 !important;
    color: #ffffff !important;
}

.user-profile.dropdown-toggle::after {
    display: none !important;
}
