@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --bg-main: #f2f2f7;
    --sidebar-dark: #122b40;
    --sidebar-w: 280px;
    --accent-orange: #f39c12;
    --accent-blue: #122b40;
    --card-shadow: 0 10px 30px rgba(0,0,0,0.05);
    --radius: 12px;
}

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

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-main);
    color: #333;
    overflow-x: hidden;
}

.wrapper { display: flex; min-height: 100vh; }

/* SIDEBAR: NAVY STYLE */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-dark);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    overflow: hidden;
}

.sidebar-menu::-webkit-scrollbar {
    width: 5px;
}

.sidebar-menu::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

.profile-section {
    padding: 3rem 1.5rem 2rem;
    text-align: center;
}

.profile-img-container {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid rgba(255,255,255,0.05);
    font-size: 2.5rem;
    color: white;
}

.profile-section h4 { font-weight: 700; font-size: 1.25rem; margin-bottom: 5px; text-transform: uppercase; letter-spacing: 1px; }
.profile-section p { font-size: 0.8rem; color: rgba(255,255,255,0.5); font-weight: 500; }

.sidebar-menu {
    list-style: none;
    padding: 1rem 0;
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-menu li a {
    text-decoration: none;
    color: rgba(255,255,255,0.7);
    padding: 1rem 2.5rem;
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 500;
    transition: 0.3s;
}

.sidebar-menu li a i { font-size: 1.1rem; width: 20px; }
.sidebar-menu li a:hover, .sidebar-menu li.active a {
    background: rgba(255,255,255,0.05);
    color: white;
    border-right: 4px solid var(--accent-orange);
}
.main-content {
    flex-grow: 1;
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    background: var(--bg-main);
}

.content-body {
    padding: 0 2rem 3rem;
}

.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3.5rem;
}

.dash-header h1 { 
    font-weight: 800; 
    font-size: 2rem; 
    color: var(--sidebar-dark); 
    letter-spacing: -1px;
}

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; margin-bottom: 2.5rem; }

.stat-card-image {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    position: relative;
    transition: 0.3s;
}

.stat-card-image.dark { background: var(--sidebar-dark); color: white; }
.stat-card-image .icon-top { position: absolute; top: 1.5rem; right: 1.5rem; font-size: 1.2rem; }
.stat-card-image .label { font-size: 0.8rem; color: #888; font-weight: 600; margin-bottom: 15px; display: block; }
.stat-card-image.dark .label { color: rgba(255,255,255,0.5); }
.stat-card-image .value { font-size: 2.2rem; font-weight: 400; }

.chart-container {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    padding: 2rem;
    margin-bottom: 2rem;
}

.chart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.chart-header h5 { color: #888; font-weight: 600; }

.bar-row { display: flex; align-items: flex-end; gap: 12px; height: 180px; padding-top: 20px; }
.bar-group { display: flex; flex-direction: column; align-items: center; gap: 5px; flex: 1; }
.bar-pill { width: 15px; border-radius: 3px; min-height: 10px; }
.bar-pill.primary { background: var(--sidebar-dark); }
.bar-pill.secondary { background: var(--accent-orange); }
.bar-label { font-size: 0.65rem; color: #aaa; margin-top: 10px; font-weight: 700; }

.circular-box { text-align: center; }
.circle-wrap { width: 120px; height: 120px; background: #f0f0f0; border-radius: 50%; margin: 0 auto 1.5rem; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.circle-wrap .mask { width: 120px; height: 120px; clip-path: polygon(50% 50%, 100% 0, 100% 100%, 0 100%, 0 0); background: var(--accent-orange); position: absolute; }
.circle-wrap .inner-circle { width: 90px; height: 90px; background: white; border-radius: 50%; z-index: 2; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: 800; }

.btn-check-now { background: var(--accent-orange); color: white; border: none; padding: 8px 20px; border-radius: 6px; font-size: 0.75rem; font-weight: 700; cursor: pointer; }

/* REFINED CONTENT AREA COMPONENTS */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary { background: var(--accent-orange); color: white; box-shadow: 0 4px 15px rgba(243, 156, 18, 0.2); }
.btn-primary:hover { background: #e67e22; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(243, 156, 18, 0.3); color: white; }

.btn-secondary { background: var(--sidebar-dark); color: white; }
.btn-secondary:hover { background: #1a3c5a; transform: translateY(-2px); color: white; }

.btn-light { background: #f8f9fa; color: #666; border: 1px solid #eee; }
.btn-light:hover { background: #eee; }

.topbar {
    height: auto;
    padding: 1.2rem 2rem 0.8rem;
    background: transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    backdrop-filter: blur(10px);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 25px;
    background: white;
    padding: 8px 12px 8px 25px;
    border-radius: 50px;
    box-shadow: var(--card-shadow);
}

.btn-logout {
    background: var(--brand-grad) !important;
    color: white !important;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    text-decoration: none;
    transition: 0.3s;
}

/* CONTENT ALIGNMENT & TABLES */
.table { 
    width: 100%; 
    border-collapse: separate; 
    border-spacing: 0 15px; 
    vertical-align: middle;
}

.table thead th { 
    text-align: center;
    padding: 1rem;
    color: #94a3b8;
    font-size: 0.7rem;
    letter-spacing: 1.5px;
}

.table tbody tr { 
    background: white; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
    border-radius: 15px;
    transition: 0.3s;
}

.table tbody td { 
    padding: 1.5rem 1rem; 
    text-align: center;
    vertical-align: middle;
    border: none;
    color: #475569;
    font-weight: 500;
}

.table tbody td:first-child { border-top-left-radius: 15px; border-bottom-left-radius: 15px; }
.table tbody td:last-child { border-top-right-radius: 15px; border-bottom-right-radius: 15px; }

.table tbody tr:hover { 
    transform: translateY(-3px); 
    box-shadow: 0 12px 25px rgba(0,0,0,0.06); 
}

/* MODERN ACTION LINKS AS BUTTONS */
.action-link {
    color: var(--brand-primary) !important;
    font-weight: 800;
    font-size: 0.75rem;
    text-transform: uppercase;
    text-decoration: none;
    padding: 8px 16px;
    background: rgba(18, 43, 64, 0.05);
    border-radius: 8px;
    transition: 0.2s;
}

.action-link:hover {
    background: var(--brand-grad);
    color: white !important;
}

/* SECTION HEADERS */
.section-header {
    margin-bottom: 4rem; /* More space below header */
    display: flex;
    align-items: center;
    gap: 25px; /* More gap */
}

/* GLOBAL SPACING FIX */
.container-fluid {
    padding: 0 !important;
}

/* RESPONSIVENESS */
@media (max-width: 1024px) {
    .content-body {
        padding: 0 1.5rem 2rem;
    }
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 10px 0 30px rgba(0,0,0,0.1);
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .content-body {
        padding: 0 1rem 2rem;
    }
    .topbar {
        padding: 0;
        height: auto;
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
        margin-bottom: 2.5rem;
    }
    .topbar-left h2 {
        font-size: 1.5rem;
    }
    .user-profile {
        width: 100%;
        justify-content: space-between;
        padding: 10px 20px;
    }
    .stat-grid {
        grid-template-columns: 1fr;
    }
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    /* Mobile Menu Toggle */
    .menu-toggle {
        display: flex !important;
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        background: var(--brand-grad);
        color: white;
        border-radius: 50%;
        align-items: center;
        justify-content: center;
        font-size: 1.2rem;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
        z-index: 1100;
        cursor: pointer;
    }
    
    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table thead { display: none; }
    .table tbody tr { 
        display: block; 
        margin-bottom: 1rem; 
        padding-bottom: 1rem;
    }
    .table tbody td { 
        display: flex; 
        justify-content: space-between; 
        align-items: center; 
        padding: 10px 20px;
        text-align: right;
    }
    .table tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        text-transform: uppercase;
        font-size: 0.65rem;
        color: #94a3b8;
        text-align: left;
    }
    .table tbody td:first-child, .table tbody td:last-child {
        border-radius: 0;
    }
}

.menu-toggle { display: none; }
