:root {
    --primary-color: #0066ff;
    --primary-hover: #0052cc;
    --secondary-color: #6c757d;
    --success-color: #00c853;
    --info-color: #00b0ff;
    --warning-color: #ffab00;
    --danger-color: #ff3d00;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --body-bg: #f5f7fa;
    --sidebar-bg: #ffffff;
    --sidebar-width: 260px;
    --card-border: #eaeaea;
    --text-main: #1a1a1a;
    --text-secondary: #666666;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    background-color: var(--body-bg);
    color: var(--text-main);
    overflow-x: hidden;
    font-size: 0.95rem;
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

a:hover {
    color: var(--primary-hover);
}

/* Layout */
.d-flex {
    display: flex;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    min-height: 100vh;
    z-index: 100;
    transition: all 0.3s;
    flex-shrink: 0;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
}

/* Desktop Fixed Sidebar */
@media (min-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        overflow-y: auto;
    }
    
    .main-content {
        margin-left: var(--sidebar-width);
        width: calc(100% - var(--sidebar-width));
    }
}

.sidebar-brand {
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.sidebar-brand i {
    color: var(--primary-color);
    font-size: 1.4rem;
    margin-right: 0.5rem;
}

.sidebar .nav-item {
    margin: 0.2rem 0.8rem;
}

.sidebar .nav-link {
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.sidebar .nav-link:hover {
    color: var(--primary-color);
    background-color: rgba(0, 102, 255, 0.05);
}

.sidebar .nav-link.active {
    color: var(--primary-color);
    background-color: rgba(0, 102, 255, 0.1);
    font-weight: 600;
}

.sidebar .nav-link i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.sidebar-heading {
    padding: 1rem 1.5rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #999;
    letter-spacing: 0.5px;
}

.sidebar-divider {
    border-top: 1px solid #f0f0f0;
    margin: 1rem 0;
}

/* Main Content */
.main-content {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: all 0.3s;
    flex-grow: 1;
    width: 100%;
    overflow-x: hidden;
}

/* Topbar */
.topbar {
    height: 60px;
    background-color: transparent; /* Transparent to blend with body */
    /* box-shadow: 0 .15rem 1.75rem 0 rgba(58,59,69,.15); Remove shadow for cleaner look */
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    justify-content: space-between;
    border-bottom: 1px solid transparent;
}

.topbar .navbar-nav .nav-link {
    color: var(--text-secondary);
}

.topbar .btn-link {
    color: var(--text-secondary);
}

/* Page Content */
.container-fluid {
    padding: 1.5rem 2rem;
    max-width: 1600px; /* Limit width on large screens */
    margin: 0 auto;
}

h1.h3 {
    font-weight: 600;
    color: var(--text-main);
    font-size: 1.5rem;
    margin-bottom: 1.5rem !important;
}

/* Cards */
.card {
    border: 1px solid var(--card-border);
    border-radius: 12px;
    background-color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
    margin-bottom: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    /* Subtle hover effect */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--card-border);
    padding: 1rem 1.25rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: 1.5rem;
}

/* Buttons */
.btn {
    border-radius: 6px;
    padding: 0.375rem 1rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: #fff;
}

/* Custom Dashboard Stats (Big Numbers) */
.stat-card {
    border: none;
    background: transparent;
    box-shadow: none;
    margin-bottom: 1rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.2;
}

.stat-unit {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-left: 4px;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.stat-icon.primary { background: rgba(0, 102, 255, 0.1); color: var(--primary-color); }
.stat-icon.success { background: rgba(0, 200, 83, 0.1); color: var(--success-color); }
.stat-icon.warning { background: rgba(255, 171, 0, 0.1); color: var(--warning-color); }
.stat-icon.info { background: rgba(0, 176, 255, 0.1); color: var(--info-color); }

/* Tables */
.table-clean {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.table-clean thead th {
    background-color: transparent;
    border-bottom: 2px solid #f0f0f0;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 1rem;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}
.table-clean tbody td {
    padding: 1rem;
    border-bottom: 1px solid #f5f7fa;
    vertical-align: middle;
    color: var(--text-main);
}
.table-clean tbody tr:last-child td {
    border-bottom: none;
}
.table-clean tbody tr:hover {
    background-color: #f8faff;
}

/* Badges */
.badge {
    padding: 0.5em 0.8em;
    font-weight: 500;
    border-radius: 6px;
}
.badge-soft-primary { background-color: rgba(0, 102, 255, 0.1); color: var(--primary-color); }
.badge-soft-success { background-color: rgba(0, 200, 83, 0.1); color: var(--success-color); }
.badge-soft-danger { background-color: rgba(255, 61, 0, 0.1); color: var(--danger-color); }
.badge-soft-warning { background-color: rgba(255, 171, 0, 0.1); color: var(--warning-color); }
.badge-soft-info { background-color: rgba(0, 176, 255, 0.1); color: var(--info-color); }
 .badge-soft-secondary { background-color: rgba(108, 117, 125, 0.12); color: var(--secondary-color); }

/* Modern Forms */
.form-control {
    border: 1px solid #e0e0e0;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s;
}
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}
.input-group-text {
    border-color: #e0e0e0;
    background-color: #f8f9fa;
}

/* Tabs */
.nav-tabs {
    border-bottom: 2px solid #f0f0f0;
}
.nav-tabs .nav-link {
    border: none;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.8rem 1.5rem;
    margin-bottom: -2px;
    transition: all 0.2s;
}
.nav-tabs .nav-link:hover {
    border: none;
    color: var(--primary-color);
}
.nav-tabs .nav-link.active {
    border: none;
    border-bottom: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

/* Code Blocks */
pre {
    background-color: #1e1e1e !important;
    color: #d4d4d4;
    padding: 1rem;
    border-radius: 8px;
    font-family: 'Fira Code', monospace;
    border: 1px solid #333;
}

/* Card Header Refinement */
.card-header {
    background-color: transparent;
    border-bottom: 1px solid #f0f0f0;
    padding: 1.2rem 1.5rem;
}
.card-header h6 {
    font-weight: 600;
    letter-spacing: 0.3px;
    margin: 0;
}

/* Modals */
.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}
.modal-header {
    border-bottom: 1px solid #f0f0f0;
    padding: 1.2rem 1.5rem;
}
.modal-footer {
    border-top: 1px solid #f0f0f0;
    padding: 1.2rem 1.5rem;
}

/* Utilities */
.text-gray-800 { color: var(--text-main) !important; }
.text-gray-600 { color: var(--text-secondary) !important; }
.text-gray-400 { color: #999 !important; }

.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important; }
.shadow { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important; }
