:root {
    --primary-purple: #6f42c1;
    --primary-blue: #0d6efd;
    --light-blue: #e7f1ff;
    --bg-light: #f4f7fe;
    --white: #ffffff;
    --text-main: #334155;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --sidebar-width: 260px;
    --transition: all 0.3s ease;
}

body {
    background-color: var(--bg-light);
    color: var(--text-main);
    font-family: 'Sarabun', sans-serif;
    overflow-x: hidden;
}

/* Layout Structure */
#wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

/* Sidebar Styling */
#sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-purple) 0%, #5a32a3 100%);
    color: var(--white);
    transition: var(--transition);
    min-height: 100vh;
    box-shadow: 4px 0 10px rgba(0,0,0,0.05);
    z-index: 1000;
}

#sidebar .sidebar-header {
    padding: 25px;
    background: rgba(0,0,0,0.1);
    text-align: center;
}

#sidebar ul.components {
    padding: 20px 0;
}

#sidebar ul p {
    padding: 10px 25px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 5px;
}

#sidebar ul li a {
    padding: 12px 25px;
    font-size: 1rem;
    display: block;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: var(--transition);
}

#sidebar ul li a:hover, #sidebar ul li.active > a {
    color: var(--white);
    background: rgba(255,255,255,0.1);
    border-left: 4px solid var(--white);
}

#sidebar ul li a i {
    margin-right: 10px;
    width: 20px;
}

/* Main Content Area */
#content {
    width: 100%;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.container-fluid {
    width: 100%;
    padding: 0 1.5rem 1.5rem 1.5rem;
    flex: 1;
}

.top-navbar {
    background: var(--white);
    padding: 15px 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    margin-bottom: 30px;
}

/* UI Components */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
}

.btn-primary {
    background-color: var(--primary-blue);
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 500;
}

.btn-purple {
    background-color: var(--primary-purple);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
}
.btn-purple:hover { color: white; background-color: #5a32a3; }

.btn-blue {
    background-color: var(--primary-blue);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
}
.btn-blue:hover { color: white; background-color: #0a58ca; }

/* Dashboard Summary Cards */
.stat-card {
    padding: 25px;
    border-radius: 15px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    overflow: hidden;
    position: relative;
}

.stat-card i {
    font-size: 3rem;
    opacity: 0.3;
    position: absolute;
    right: -10px;
    bottom: -10px;
}

.bg-purple { background: linear-gradient(45deg, #6f42c1, #a06ee1); }
.bg-blue { background: linear-gradient(45deg, #0d6efd, #4d94ff); }
.bg-info-custom { background: linear-gradient(45deg, #0dcaf0, #56e2f9); }

/* Helper Classes */
.bg-purple-light { background-color: rgba(111, 66, 193, 0.1); }
.bg-blue-light { background-color: rgba(13, 110, 253, 0.1); }
.bg-success-light { background-color: rgba(25, 135, 84, 0.1); }
.bg-warning-light { background-color: rgba(255, 193, 7, 0.1); }
.bg-danger-light { background-color: rgba(220, 53, 69, 0.1); }

.text-purple { color: var(--primary-purple) !important; }
.text-blue { color: var(--primary-blue) !important; }

/* Responsive Adjustments */
@media (max-width: 768px) {
    #sidebar {
        margin-left: calc(var(--sidebar-width) * -1);
    }
    #sidebar.active {
        margin-left: 0;
    }
    .top-navbar {
        padding: 15px;
    }
}
