/**
 * KGMB Dashboard Styles
 */

:root {
    /* Primary Colors */
    --primary-50: #EEEEEE;
    --primary-100: #BFDCFF;
    --primary-200: #95C7FF;
    --primary-300: #6BB1FF;
    --primary-400: #519FFF;
    --primary-500: #458EFF;
    --primary-600: #138535;
    --primary-700: #486CEA;
    --primary-800: #4759D6;
    --primary-900: #4536B6;
    
    /* Neutral Colors */
    --neutral-50: #F5F6FA;
    --neutral-100: #F3F4F6;
    --neutral-200: #EBECEF;
    --neutral-300: #D1D5DB;
    --neutral-400: #9CA3AF;
    --neutral-500: #6B7280;
    --neutral-600: #4B5563;
    --neutral-700: #374151;
    --neutral-800: #1F2937;
    --neutral-900: #111827;
    
    /* Danger Colors */
    --danger-50: #FEF2F2;
    --danger-100: #FEE2E2;
    --danger-600: #DC2626;
    
    /* Success Colors */
    --success-50: #F0FDF4;
    --success-100: #DCFCE7;
    --success-600: #16A34A;
    
    /* Warning Colors */
    --warning-50: #FEFCE8;
    --warning-100: #FEF9C3;
    --warning-600: #FF9F29;
    
    /* Layout */
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 70px;
    --navbar-height: 64px;
    --footer-height: 60px;
    
    /* Other */
    --border-color: #d1d5db80;
    --card-shadow: 0px 4px 20px rgba(0, 0, 0, 0.08);
    --font-family: 'Inter', sans-serif;
}

/* General Styles */
body {
    font-family: var(--font-family);
    background-color: var(--neutral-50);
    margin: 0;
    padding: 0;
    color: var(--neutral-700);
}

.dashboard-body {
    min-height: 100vh;
    display: flex;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

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

.form-control:focus, 
.btn:focus {
    box-shadow: none;
    outline: none;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: #fff;
    border-right: 1px solid var(--border-color);
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

/* Sidebar Logo */
.sidebar-logo {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.5rem;
    margin-top:10px;
}

.sidebar-logo img {
    max-height: 120px;
    max-width: 80%;
}

.sidebar-logo .dark-logo,
.sidebar-logo .logo-icon {
    display: none;
}

.sidebar.active .light-logo,
.sidebar.active .dark-logo {
    display: none;
}

.sidebar.active .logo-icon {
    display: block;
    margin: 0 auto;
}

/* Sidebar Menu Area */
.sidebar-menu-area {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu > li {
    margin-bottom: 0.25rem;
}

.sidebar-menu > li > a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--neutral-600);
    font-weight: 500;
    position: relative;
    border-radius: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-menu > li > a:hover {
    background-color: var(--neutral-50);
    color: var(--primary-600);
}

.sidebar-menu > li > a.active,
.sidebar-menu > li.active-page > a {
    background-color: var(--primary-50);
    color: var(--primary-600);
    border-left: 3px solid var(--primary-600);
}

.sidebar-menu > li > a .menu-icon {
    margin-right: 12px;
    font-size: 20px;
    flex-shrink: 0;
}

.sidebar.active .sidebar-menu > li > a span {
    display: none;
}

.sidebar.active .sidebar-menu > li > a .menu-icon {
    margin-right: 0;
    margin-left: auto;
    margin-right: auto;
}

/* Submenu */
.sidebar-menu .dropdown > a::after {
    content: "\ea6e";
    font-family: "remixicon";
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    transition: all 0.2s ease;
}

.sidebar-menu .dropdown.open > a::after {
    transform: translateY(-50%) rotate(90deg);
}

.sidebar.active .sidebar-menu .dropdown > a::after {
    display: none;
}

.sidebar-submenu {
    list-style: none;
    padding: 0 0 0 42px;
    margin: 0;
    display: none;
}

.sidebar-submenu > li > a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--neutral-600);
    font-size: 0.9rem;
    border-radius: 4px;
}

.sidebar-submenu > li > a:hover {
    color: var(--primary-600);
}

.sidebar-submenu > li.active-page > a {
    color: var(--primary-600);
    font-weight: 500;
    background-color: #F5F6FA;
    border-radius: 10px 0 0 10px;
}

/* Main Content Area */
.dashboard-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.dashboard-main.active {
    margin-left: var(--sidebar-collapsed-width);
}

/* Navbar */
.navbar-header {
    height: var(--navbar-height);
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 999;
}

.sidebar-toggle {
    background: none !important;
    border: none !important;
    cursor: pointer;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center;
    color: var(--neutral-700) !important;
}

.sidebar-toggle .icon.active {
    display: none !important;
}

.sidebar-toggle.active .icon.non-active {
    display: none !important;
}

.sidebar-toggle.active .icon.active {
    display: block !important;
    color: green;
}

/* Upgrade Alert Banner */
.upgrade-alert .alert {
    border-radius: 4px;
    padding: 8px 16px;
}

/* User Dropdown */
.dropdown-menu {
    border: none;
    box-shadow: var(--card-shadow);
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: 10px;
    min-width: 220px;
}

.dropdown-menu.to-top {
    margin-top: -10px;
}

.to-top-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dropdown-item {
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
}

.dropdown-item:hover {
    background-color: var(--neutral-50);
}

.dropdown-item:active,
.dropdown-item:focus {
    background-color: var(--primary-50);
    color: var(--primary-600);
}

/* Main Content */
.dashboard-main-body {
    flex: 1;
    padding: 1.5rem;
    background-color: var(--neutral-50);
}

/* Breadcrumb */
.breadcrumb-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

.breadcrumb-nav li {
    display: flex;
    align-items: center;
}

.breadcrumb-nav li:not(:last-child) {
    margin-right: 0.5rem;
}

/* Dashboard Content */
.dashboard-content {
    margin-top: 1rem;
}

/* Cards */
.card {
    background-color: #fff;
    border-radius: 8px;
    border: none;
    box-shadow: var(--card-shadow);
    margin-bottom: 1.5rem;
}

.card-header {
    padding: 1rem 1.5rem !important;
    background-color: #fff;
    border-bottom: 1px solid var(--neutral-200);
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* Status Card (from your example) */
.status-card {
    background-color: #5ebea3;
    color: white;
    padding: 24px;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.status-card .status-title {
    font-size: 18px;
    margin-bottom: 12px;
}

.status-card .status-value {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 20px;
}

.status-card .status-arrow {
    position: absolute;
    right: -30px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 150px;
    opacity: 0.2;
}

.status-card .upgrade-btn {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 500;
}

/* Stats Cards */
.stats-card {
    border-radius: 8px;
    padding: 20px;
    background-color: #fff;
    box-shadow: var(--card-shadow);
}

.stats-card .stats-title {
    color: var(--neutral-500);
    font-size: 14px;
    margin-bottom: 8px;
}

.stats-card .stats-amount {
    font-size: 24px;
    font-weight: 600;
    color: var(--neutral-900);
    margin-bottom: 0;
}

.stats-card .stats-period {
    color: var(--neutral-500);
    font-size: 12px;
}

/* Tables */
.table {
    width: 100%;
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    color: var(--neutral-700);
    background-color: var(--neutral-50);
    border-bottom: 1px solid var(--neutral-200);
    padding: 12px 16px;
}

.table td {
    padding: 12px 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--neutral-200);
}

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

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

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

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

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

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

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

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Footer */
.d-footer {
    padding: 1rem 1.5rem;
    background-color: #fff;
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--neutral-500);
}

/* Responsive */
@media (max-width: 1199.98px) {
    .sidebar {
        left: -100%;
    }
    
    .sidebar.sidebar-open {
        left: 0;
    }
    
    .dashboard-main {
        margin-left: 0;
    }
    
    .dashboard-main.active {
        margin-left: 0;
    }
}

@media (max-width: 767.98px) {
    .navbar-header {
        padding: 0 1rem;
    }
    
    .dashboard-main-body {
        padding: 1rem;
    }
    
    .d-footer {
        padding: 0.75rem 1rem;
        text-align: center;
    }
    
    .d-footer .row {
        flex-direction: column;
    }
    
    .d-footer .col-auto {
        width: 100%;
    }
    
    .card-header, .card-body {
        padding: 1rem;
    }
}

@media (max-width: 575.98px) {
    .upgrade-alert {
        display: none;
    }
    
    .breadcrumb-nav {
        display: none !important;
    }
    
    .stats-card {
        margin-bottom: 1rem;
    }
}

/* Dark Mode Support */
[data-theme="dark"] {
    --neutral-50: #1a1a1a;
    --neutral-100: #262626;
    --neutral-200: #333333;
    --neutral-800: #f3f4f6;
    --neutral-900: #ffffff;
    
    color-scheme: dark;
}

[data-theme="dark"] .sidebar,
[data-theme="dark"] .navbar-header,
[data-theme="dark"] .d-footer,
[data-theme="dark"] .card,
[data-theme="dark"] .card-header {
    background-color: var(--neutral-100);
    border-color: var(--neutral-200);
}

[data-theme="dark"] .dashboard-main-body {
    background-color: var(--neutral-50);
}

[data-theme="dark"] .sidebar-menu > li > a {
    color: var(--neutral-400);
}

[data-theme="dark"] .sidebar-menu > li > a:hover {
    background-color: var(--neutral-200);
}

[data-theme="dark"] .sidebar-menu > li > a.active,
[data-theme="dark"] .sidebar-menu > li.active-page > a {
    background-color: rgba(72, 127, 255, 0.2);
}

/* Custom Elements for Your Design */
.status-section {
    margin-bottom: 24px;
}

.chart-container {
    background-color: #fff;
    border-radius: 8px;
    padding: 16px;
    box-shadow: var(--card-shadow);
    margin-bottom: 24px;
    height: 100%;
}

[data-theme="dark"] .chart-container {
    background-color: var(--neutral-100);
}

.status-box {
    background-color: #fff;
    border-radius: 8px;
    padding: 16px;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    text-align: center;
    height: 100%;
}

.status-box .status-amount {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
}

.status-box .status-label {
    color: var(--neutral-500);
    font-size: 14px;
}

[data-theme="dark"] .status-box {
    background-color: var(--neutral-100);
}

/* Data Tables Styling */
.data-table-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    padding: 16px;
    margin-bottom: 24px;
}

.data-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.data-table-header h5 {
    margin-bottom: 0;
    font-size: 18px;
    font-weight: 600;
}

.data-table-container .table {
    margin-top: 16px;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.success {
    background-color: var(--success-50);
    color: var(--success-600);
}

.status-badge.warning {
    background-color: var(--warning-50);
    color: var(--warning-600);
}

.status-badge.danger {
    background-color: var(--danger-50);
    color: var(--danger-600);
}

[data-theme="dark"] .data-table-container {
    background-color: var(--neutral-100);
}

/* Animation for sidebar */
@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

.sidebar-open {
    animation: slideIn 0.3s forwards;
}

/* Utility classes for spacing and typography */
.mb-8 {
    margin-bottom: 8px !important;
}

.mb-16 {
    margin-bottom: 16px !important;
}

.mb-24 {
    margin-bottom: 24px !important;
}

.mb-32 {
    margin-bottom: 32px !important;
}

.fw-medium {
    font-weight: 500 !important;
}

.fw-semibold {
    font-weight: 600 !important;
}

.text-sm {
    font-size: 14px !important;
}

.text-lg {
    font-size: 18px !important;
}

.text-xl {
    font-size: 20px !important;
}

.text-2xl {
    font-size: 24px !important;
}

/* Form Styling */
.form-control {
    height: 40px;
    border-radius: 4px;
    border: 1px solid var(--neutral-300);
    padding: 8px 12px;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary-600);
}

.form-label {
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--neutral-700);
}

.form-text {
    margin-top: 4px;
    font-size: 12px;
    color: var(--neutral-500);
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.theme-toggle:hover {
    background-color: var(--neutral-100);
}

.theme-toggle .icon {
    font-size: 20px;
    color: var(--neutral-700);
}

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

::-webkit-scrollbar-track {
    background: var(--neutral-100);
}

::-webkit-scrollbar-thumb {
    background: var(--neutral-300);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--neutral-400);
}

table.dataTable thead th, table.dataTable tfoot th {
    font-weight: bold;
    background-color: darkgreen !important;
    color: #fff;
}