:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --text-color: #2c3e50;
    --sidebar-width: 280px;
    --header-height: 60px;
    --sidebar-bg: #f8f9fa;
    /* Base font sizes */
    --font-size-xs: 0.75rem;    /* 12px */
    --font-size-sm: 0.875rem;   /* 14px */
    --font-size-base: 0.9375rem; /* 15px */
    --font-size-md: 1rem;       /* 16px */
    --font-size-lg: 1.125rem;   /* 18px */
    --font-size-xl: 1.25rem;    /* 20px */
}

html {
    font-size: 15px;
    position: relative;
    min-height: 100vh;
}

@media (min-width: 768px) {
    html {
        font-size: 15px;
    }
}

body {
    margin: 0;
    padding: 0;
    color: var(--text-color);
    background-color: #f5f6fa;
    min-height: 100vh;
    font-size: var(--font-size-base);
    line-height: 1.5;
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

/* Main Wrapper */
.main-wrapper {
    display: flex;
    flex: 1;
    min-height: calc(100vh - var(--header-height));
}

/* Navbar Styling */
.navbar {
    background-color: #fff !important;
    box-shadow: 0 2px 4px rgba(0,0,0,.08);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand {
    font-weight: 600;
    color: var(--primary-color) !important;
    font-size: var(--font-size-lg);
}

/* Left Sidebar */
.left-sidebar {
    background-color: var(--sidebar-bg);
    width: var(--sidebar-width);
    padding: 20px;
    border-right: 1px solid #dee2e6;
    position: sticky;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding-bottom: 15px;
    border-bottom: 2px solid var(--accent-color);
    margin-bottom: 20px;
}

.sidebar-header h5 {
    margin: 0;
    color: var(--primary-color);
    font-weight: 600;
    font-size: var(--font-size-md);
}

.sidebar-menu {
    flex: 1;
}

/* Main Content Area */
.main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.main-content-full {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.content-wrapper {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,.05);
    padding: 20px;
    min-height: calc(100vh - var(--header-height) - 40px);
}

/* Sidebar Menu Items */
.sidebar-menu .nav-link {
    color: var(--secondary-color);
    padding: 10px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 5px;
    font-size: var(--font-size-base);
}

.sidebar-menu .nav-link:hover {
    background-color: rgba(52, 152, 219, 0.1);
    color: var(--accent-color);
    transform: translateX(5px);
}

.sidebar-menu .nav-link.active {
    background-color: var(--accent-color);
    color: white;
}

.sidebar-menu .nav-link i {
    font-size: var(--font-size-lg);
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
    font-size: var(--font-size-sm);
}

/* Cards and Forms */
.card {
    border: none;
    box-shadow: 0 0 10px rgba(0,0,0,.05);
    border-radius: 8px;
    margin-bottom: 20px;
}

.card-header {
    background-color: #fff;
    border-bottom: 2px solid var(--accent-color);
    padding: 15px 20px;
    font-size: var(--font-size-md);
    font-weight: 600;
}

.form-control {
    border-radius: 8px;
    border: 1px solid #ced4da;
    padding: 8px 12px;
    transition: all 0.3s ease;
    font-size: var(--font-size-base);
}

.form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 8px 16px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: var(--font-size-base);
}

.btn i {
    font-size: 1.1em;
}

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

.btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
    transform: translateY(-1px);
}

/* Button icon styles */
.btn-icon {
    padding: 0.25rem 0.5rem;
    font-size: var(--font-size-sm);
    line-height: 1;
}

.btn-icon i {
    font-size: 1rem;
}

.btn-group-sm .btn-icon {
    padding: 0.25rem 0.4rem;
}

.btn-group .btn + .btn {
    margin-left: -1px;
}

.btn-outline-primary:hover i,
.btn-outline-danger:hover i,
.btn-outline-info:hover i {
    color: #fff;
}

/* Tooltip enhancement */
[title] {
    position: relative;
    cursor: pointer;
}

/* Tables */
.table {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0;
    font-size: var(--font-size-base);
    border: 1px solid #dee2e6;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid var(--accent-color);
    border-right: 1px solid #dee2e6;
    color: var(--primary-color);
    font-weight: 600;
    padding: 10px 12px;
    font-size: var(--font-size-sm);
}

.table thead th:last-child {
    border-right: none;
}

.table tbody td {
    padding: 10px 12px;
    vertical-align: middle;
    font-size: var(--font-size-base);
    border-right: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
}

.table tbody td:last-child {
    border-right: none;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover {
    background-color: rgba(52, 152, 219, 0.05);
}

/* Ensure all tables in reports have borders */
.table-bordered {
    border: 1px solid #dee2e6 !important;
}

.table-bordered th,
.table-bordered td {
    border: 1px solid #dee2e6 !important;
}

/* Dropdown Menu */
.dropdown-menu {
    border: none;
    box-shadow: 0 0 20px rgba(0,0,0,.1);
    border-radius: 8px;
    padding: 8px;
    font-size: var(--font-size-base);
}

.dropdown-item {
    border-radius: 6px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--font-size-base);
}

.dropdown-item:hover {
    background-color: rgba(52, 152, 219, 0.1);
    color: var(--accent-color);
}

.dropdown-divider {
    margin: 8px 0;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Active Menu Indicator */
.sidebar-menu .nav-item {
    position: relative;
}

.sidebar-menu .nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 70%;
    background-color: var(--accent-color);
    border-radius: 0 4px 4px 0;
}

/* Dashboard Styles */
.dashboard .welcome-message {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: var(--font-size-lg);
}

.dashboard .welcome-message i {
    font-size: var(--font-size-xl);
}

.stat-card {
    border: none;
    border-radius: 10px;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

.stat-card h2 {
    font-size: var(--font-size-xl);
    font-weight: 600;
}

.stat-card .card-title {
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* New stat card colors */
.bg-purple {
    background-color: #6f42c1;
}

.bg-teal {
    background-color: #20c997;
}

.dashboard .card {
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.dashboard .table th {
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dashboard .table td {
    vertical-align: middle;
    font-size: var(--font-size-base);
}

.dashboard canvas {
    max-height: 300px;
}

/* DataTable custom styles */
.table.dataTable {
    margin-top: 16px !important;
}

.dataTables_wrapper .dataTables_length select {
    min-width: 80px;
}

.dataTables_wrapper .dataTables_filter input {
    min-width: 250px;
}

.dataTables_wrapper .dataTables_info {
    padding-top: 0.5em !important;
}

.dataTables_wrapper .dataTables_paginate {
    padding-top: 0.5em !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 0.25em 0.6em !important;
    border-radius: 4px !important;
    font-size: var(--font-size-sm);
}

.progress {
    height: 0.75rem;
    font-size: var(--font-size-xs);
    border-radius: 1rem;
    background-color: #e9ecef;
}

.progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 500;
    transition: width 0.6s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-wrapper {
        flex-direction: column;
    }
    
    .left-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        top: 0;
    }
    
    .main-content,
    .main-content-full {
        width: 100%;
    }
    
    .content-wrapper {
        min-height: auto;
    }
}