:root {
    --primary: #0B5E20;
    --primary-dark: #084518;
    --gold: #C89B3C;
    --gold-light: #d4a84a;
    --sidebar-width: 250px;
    --sidebar-collapsed: 70px;
    --header-height: 56px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f6fa;
    overflow-x: hidden;
}

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

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: #084518;
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transition: width 0.3s ease;
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-header {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    min-height: 60px;
}

.sidebar-header a {
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-header a i {
    font-size: 1.5rem;
    color: var(--gold);
}

.sidebar-nav {
    flex: 1;
    padding: 10px 0;
    overflow-y: auto;
}

.sidebar-nav .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    white-space: nowrap;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.sidebar-nav .nav-link.active {
    background: rgba(255,255,255,0.15);
    color: var(--gold);
    border-left-color: var(--gold);
}

.sidebar-nav .nav-link i {
    font-size: 1.1rem;
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 10px 0;
}

.sidebar.collapsed .sidebar-text,
.sidebar.collapsed .sidebar-header a span,
.sidebar.collapsed .sidebar-footer .flex-grow-1 {
    display: none;
}

.sidebar.collapsed .sidebar-nav .nav-link {
    justify-content: center;
    padding: 12px 0;
}

/* Main Content */
#page-content-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
    min-height: 100vh;
}

#page-content-wrapper.expanded {
    margin-left: var(--sidebar-collapsed);
}

/* Cards */
.dashboard-card {
    transition: transform 0.2s;
    border-radius: 12px !important;
}

.dashboard-card:hover {
    transform: translateY(-3px);
}

.card-label {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 5px;
    font-weight: 500;
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Navbar */
.navbar {
    min-height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 999;
}

/* Tables */
.table > thead > tr > th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    border-bottom: 2px solid #e9ecef;
}

.table > tbody > tr:hover {
    background-color: rgba(11, 94, 32, 0.03);
}

/* Buttons */
.btn-success {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

.btn-success:hover {
    background-color: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
}

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

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

/* Modal */
.modal-header {
    background-color: var(--primary);
    color: #fff;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

/* Badge */
.badge {
    font-weight: 500;
}

/* Pagination */
.page-item.active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
}

.page-link {
    color: var(--primary);
}

/* Notification dropdown */
.notification-dropdown {
    width: 320px;
}

/* Form focus */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(11, 94, 32, 0.15);
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

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

/* Responsive */
@media (max-width: 991.98px) {
    .sidebar {
        width: var(--sidebar-width) !important;
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    #page-content-wrapper {
        margin-left: 0 !important;
    }
    
    .dashboard-card {
        margin-bottom: 10px;
    }
}

@media (max-width: 767.98px) {
    .container-fluid {
        padding: 12px !important;
    }
}

/* Tinymce fullscreen fix */
.tox.tox-tinymce.tox-fullscreen {
    z-index: 1055 !important;
}

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 2px;
}

/* Alert */
.alert {
    border-radius: 8px;
    border: none;
}

/* Card */
.card {
    border-radius: 12px !important;
}

/* Table responsiveness */
.table-responsive {
    border-radius: 8px;
}

/* Dark mode support */
[data-bs-theme="dark"] body {
    background-color: #1a1a2e;
}

[data-bs-theme="dark"] .card {
    background-color: #16213e;
    border-color: #0f3460;
}

[data-bs-theme="dark"] .table {
    color: #e0e0e0;
}

[data-bs-theme="dark"] .table-light {
    background-color: #1a1a3e;
    color: #fff;
}

[data-bs-theme="dark"] .navbar {
    background-color: #16213e !important;
}
