/* BTG Admin Theme - Modern Minimalist Design */

/* Import Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* CSS Variables - BTG Official Colors */
:root {
    --btg-primary: #0B6623;
    --btg-dark: #084a1a;
    --btg-secondary: #88C057;
    --btg-accent: #D4A017;
    --btg-charcoal: #111;
    --btg-bg: #F5F7FA;
    --btg-white: #FFFFFF;
    --btg-border: #E1E4E8;
    --btg-text: #2D3748;
    --btg-text-light: #64748B;
    --btg-shadow: 0 2px 6px rgba(11, 102, 35, 0.1);
    --btg-shadow-hover: 0 4px 12px rgba(11, 102, 35, 0.2);
    --sidebar-width: 240px;
}

/* Global Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--btg-bg);
    color: var(--btg-text);
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
    padding: 0;
}

/* Container */
.content-wrapper {
    padding: 20px;
    max-width: 100%;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--btg-charcoal);
    z-index: 1030;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.3s ease;
}

.sidebar-logo {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background-color: white;
}

.sidebar-logo img {
    max-height: 32px;
    margin-bottom: 8px;
    background-color: white;
    padding: 4px;
    border-radius: 4px;
}

.sidebar-logo h6 {
    color: var(--btg-primary);
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.sidebar-nav {
    padding: 8px 0;
}

.sidebar-nav .nav-item {
    display: block;
}

.sidebar-nav .nav-link:hover {
    color: white;
    background-color: rgba(63,178,79,0.15);
}

.sidebar-nav .nav-link.active {
    color: var(--btg-secondary);
    background-color: rgba(136, 192, 87, 0.15);
    font-weight: 600;
    border-left: 4px solid var(--btg-secondary);
}

.sidebar-nav .nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: var(--btg-secondary);
}

.sidebar-nav .nav-link {
    color: rgba(255,255,255,0.7);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    transition: all 0.2s ease;
}

.sidebar-nav .nav-link i {
    width: 24px;
    margin-right: 16px;
    font-size: 18px;
    flex-shrink: 0;
    text-align: center;
}

.sidebar-nav .nav-link > span {
    white-space: nowrap;
}

/* Sub-menu items */
.sidebar-nav .collapse {
    background-color: rgba(0,0,0,0.2);
}

.sidebar-nav .sub-menu {
    padding: 8px 20px 8px 56px;
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    border-left: 3px solid transparent;
}

.sidebar-nav .sub-menu:hover {
    color: rgba(255,255,255,0.9);
    background-color: rgba(63,178,79,0.1);
    border-left-color: var(--btg-secondary);
}

.sidebar-nav .sub-menu.active {
    color: var(--btg-secondary);
    background-color: rgba(136, 192, 87, 0.12);
    border-left-color: var(--btg-secondary);
    font-weight: 600;
}

.sidebar-nav .sub-menu i {
    width: 20px;
    margin-right: 12px;
    font-size: 14px;
}

/* Top Navigation */
.topnav {
    background: var(--btg-white);
    height: 64px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    position: fixed;
    top: 0;
    right: 0;
    left: var(--sidebar-width);
    z-index: 1020;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topnav-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.topnav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.welcome-text {
    font-size: 14px;
    color: var(--btg-text-light);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 8px;
    transition: background 0.2s ease;
    position: relative;
}

.user-profile::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    right: 0;
    height: 10px;
}

.user-profile:hover {
    background-color: var(--btg-bg);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--btg-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: 64px;
    min-height: calc(100vh - 64px);
    padding: 20px;
}

/* Page Header */
.page-header {
    margin-bottom: 24px;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--btg-text);
    margin: 0 0 4px 0;
}

.page-subtitle {
    font-size: 14px;
    color: var(--btg-text-light);
    margin: 0;
}

/* Cards */
.card {
    background: var(--btg-white);
    border-radius: 10px;
    box-shadow: var(--btg-shadow);
    border: none;
    margin-bottom: 20px;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--btg-border);
    background: transparent;
}

.card-header.highlight {
    border-left: 6px solid var(--btg-primary);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--btg-text);
    margin: 0;
}

.card-body {
    padding: 20px;
}

/* Stats Cards */
.stats-card {
    background: var(--btg-white);
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--btg-shadow);
    border-left: 6px solid var(--btg-primary);
    transition: all 0.2s ease;
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--btg-shadow-hover);
}

.stats-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background-color: rgba(63, 178, 79, 0.1);
    color: var(--btg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 16px;
}

.stats-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--btg-text);
    line-height: 1;
    margin-bottom: 4px;
}

.stats-label {
    font-size: 14px;
    color: var(--btg-text-light);
    font-weight: 500;
}

.stats-change {
    font-size: 13px;
    margin-top: 8px;
}

.stats-change.positive {
    color: var(--btg-primary);
}

.stats-change.negative {
    color: #EF4444;
}

/* Tables */
.table {
    font-size: 13px;
}

.table th {
    font-weight: 600;
    color: var(--btg-text);
    border-top: none;
    padding: 12px 16px;
    background-color: var(--btg-bg);
}

.table td {
    padding: 12px 16px;
    vertical-align: middle;
    border-color: var(--btg-border);
}

.table-hover tbody tr:hover {
    background-color: var(--btg-bg);
}

/* Buttons */
.btn {
    font-weight: 500;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

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

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

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

.btn-outline-primary:hover {
    background-color: var(--btg-primary);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* Forms */
.form-control {
    border-radius: 8px;
    border: 1px solid var(--btg-border);
    padding: 10px 12px;
    font-size: 14px;
}

.form-control:focus {
    border-color: var(--btg-primary);
    box-shadow: 0 0 0 3px rgba(63, 178, 79, 0.1);
}

.form-select {
    border-radius: 8px;
    border: 1px solid var(--btg-border);
    padding: 10px 12px;
    font-size: 14px;
}

.form-label {
    font-weight: 500;
    font-size: 14px;
    color: var(--btg-text);
    margin-bottom: 6px;
}

/* Badges */
.badge {
    font-weight: 500;
    font-size: 11px;
    padding: 3px 7px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
}

/* Sidebar Notification Badge */
.sidebar-nav .nav-link .badge {
    position: absolute;
    top: 8px;
    right: 20px;
    font-size: 9px;
    padding: 2px 5px;
    min-width: 16px;
    height: 16px;
    line-height: 12px;
    border-radius: 8px;
    background-color: var(--btg-secondary) !important;
    color: var(--btg-dark) !important;
    font-weight: 600;
}

/* Topnav Notification Badge */
.topnav .badge {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 8px;
    padding: 1px 4px;
    min-width: 14px;
    height: 14px;
    line-height: 11px;
    border-radius: 7px;
    background-color: #EF4444 !important;
    border: 2px solid white;
}

/* Dropdown Menu */
.dropdown-menu {
    border: 1px solid var(--btg-border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 8px;
    padding: 8px 0;
    margin-top: 10px;
    font-size: 14px;
}

.dropdown-menu .dropdown-item {
    padding: 8px 20px;
    color: var(--btg-text);
    transition: all 0.2s ease;
}

.dropdown-menu .dropdown-item:hover {
    background-color: var(--btg-bg);
    color: var(--btg-primary);
}

.dropdown-menu .dropdown-divider {
    margin: 8px 0;
    border-color: var(--btg-border);
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: slideIn 0.3s ease-out;
}

/* DataTables Custom Styling - Clean & Professional */
.table {
    font-size: 13px;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
    background-color: var(--btg-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.table thead th {
    border: none;
    border-bottom: 3px solid var(--btg-primary);
    font-weight: 700;
    color: var(--btg-text);
    background: linear-gradient(135deg, #F8F9FA 0%, var(--btg-bg) 100%) !important;
    padding: 16px 12px !important;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    white-space: nowrap;
}

.table thead th:first-child {
    border-top-left-radius: 12px;
}

.table thead th:last-child {
    border-top-right-radius: 12px;
}

.table tbody td {
    padding: 14px 12px !important;
    vertical-align: middle;
    border-bottom: 1px solid rgba(225, 228, 232, 0.2);
    font-size: 13px;
    color: var(--btg-text);
    line-height: 1.5;
    background-color: var(--btg-white) !important;
}

.table tbody tr {
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

.table tbody tr:hover {
    background: linear-gradient(90deg, rgba(11, 102, 35, 0.03) 0%, rgba(136, 192, 87, 0.03) 100%) !important;
    border-left-color: var(--btg-secondary);
    transform: translateX(1px);
}

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

.table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 12px;
}

.table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 12px;
}

/* DataTables Controls - Clean Modern Design */
.dataTables_wrapper {
    padding: 20px 0;
}

.dataTables_wrapper .row {
    margin: 0;
    align-items: center;
}

.dataTables_wrapper .dataTables_length {
    margin: 0;
    color: var(--btg-text);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--btg-border);
    border-radius: 8px;
    padding: 8px 12px;
    margin-left: 12px;
    background-color: var(--btg-white);
    color: var(--btg-text);
    font-size: 13px;
    height: 36px;
    min-width: 80px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
}

.dataTables_wrapper .dataTables_length select:focus {
    border-color: var(--btg-primary);
    box-shadow: 0 0 0 3px rgba(11, 102, 35, 0.15);
    outline: none;
}

.dataTables_wrapper .dataTables_filter {
    margin: 0;
    font-size: 13px;
    color: var(--btg-text);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.dataTables_wrapper .dataTables_filter input {
    border: 1px solid var(--btg-border);
    border-radius: 8px;
    padding: 8px 12px;
    margin-left: 12px;
    background-color: var(--btg-white);
    color: var(--btg-text);
    font-size: 13px;
    height: 36px;
    width: 250px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--btg-primary);
    box-shadow: 0 0 0 3px rgba(11, 102, 35, 0.15);
    outline: none;
}

.dataTables_wrapper .dataTables_filter input::placeholder {
    color: var(--btg-text-light);
}

.dataTables_wrapper .dataTables_info {
    clear: both;
    padding-top: 16px;
    color: var(--btg-text-light);
    font-size: 13px;
    font-weight: 600;
}

/* DataTables Pagination - Clean Design */
.dataTables_wrapper .dataTables_paginate {
    float: right;
    padding-top: 16px;
    margin: 0;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    color: var(--btg-text) !important;
    border: 1px solid var(--btg-border) !important;
    border-radius: 6px !important;
    margin: 0 2px !important;
    padding: 8px 12px !important;
    background: var(--btg-white) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
    min-width: 40px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--btg-primary) !important;
    border-color: var(--btg-primary) !important;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(11, 102, 35, 0.3) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--btg-primary) !important;
    border-color: var(--btg-primary) !important;
    color: white !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 6px rgba(11, 102, 35, 0.3) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--btg-bg) !important;
    color: var(--btg-text-light) !important;
    box-shadow: none !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    transform: none;
    box-shadow: none !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.first,
.dataTables_wrapper .dataTables_paginate .paginate_button.last {
    display: none;
}

/* Pagination ellipsis styling */
.dataTables_wrapper .dataTables_paginate .paginate_button.ellipsis {
    background: transparent !important;
    border: none !important;
    color: var(--btg-text-light) !important;
    font-weight: 400 !important;
    box-shadow: none !important;
}

/* DataTables Info */
.dataTables_info {
    color: var(--btg-text-light) !important;
    font-size: 12px !important;
}

/* Clear floats */
.dataTables_wrapper::after {
    content: "";
    display: table;
    clear: both;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .topnav {
        left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    .content-wrapper {
        padding: 16px;
    }

    .stats-value {
        font-size: 24px;
    }
}