/*:root {
    --bg: #0b0f19; --sidebar: #111827; --card: #1f2937;
    --text: #f3f4f6; --text-dim: #9ca3af; --green: #10b981;
    --orange: #f59e0b; --blue: #3b82f6; --border: #374151; --danger: #ef4444;
}*/
:root {
    --bg: #0b0f19;
    /*--bg: #141a21;*/
    --sidebar: #111827; 
    --card: #1f2937;
    /*--card: #1c252e;*/
    --card-2: #0e131f;
    --card-3: #111827;
    --text: #f3f4f6; 
    --text-dim: #9ca3af;
    --text-dim-hover: #bac0cc;
    --green: #10b981;
    --orange: #f59e0b; 
    --blue: #3b82f6; 
    --border: #374151; 
    --danger: #ef4444;
    --top-nav-bg: rgba(11, 15, 25, 0.8);
    --preloader-bg: #0b0f19;
    --box-shadow: 0 4px 8px -4px rgba(0, 0, 0, .16);
    --secondary-2: rgba(11, 15, 25, 0.3);
}

@font-face {
  font-family: 'Poppins';
  src: url('fonts/poppins_regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'retron2000';
  src: url('fonts/retron2000.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* --- THEMED SCROLLBARS --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; transition: 0.3s ease; }
::-webkit-scrollbar-thumb:hover { background: #4b5563; }
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }

/* --- CORE --- */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Poppins','Inter', sans-serif; }
body { background: var(--bg); color: var(--text); overflow: hidden;
    font-family: 'Poppins';
}
.container { display: flex; height: 100vh; overflow: hidden; }

/* Add the Light Theme variables */
body.light-mode {
    --bg: #f9fafb;
    --sidebar: #ffffff;
    --card: #ffffff;
    --card-2: #ffffff;
    --card-3: #ffffff;
    --text: #111827;
    --text-dim: #6b7280;
    --border: #e5e7eb;
    --top-nav-bg: rgba(255, 255, 255, 0.8);
    min-width: 320px;
    --box-shadow: 0 4px 8px -4px rgba(0, 0, 0, .16);
}

/* --- SIDEBAR --- */
.sidebar {
    width: 260px; height: 100vh; background: var(--sidebar); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; transition: 0.3s ease; z-index: 1051;
}
.sidebar-header { padding: 30px 24px; font-size: 22px; font-weight: 700; color: var(--green); letter-spacing: -0.5px; }
.sidebar-content { flex: 1; overflow-y: auto; padding: 0 12px; }
.nav-label { font-size: 10px; font-weight: 800; color: #4b5563; margin: 25px 14px 10px; text-transform: uppercase; letter-spacing: 1.5px; }

.sidebar-header .logo a {
    text-decoration: none;
    font-size: 22px;
    font-weight: 700;
    color: var(--green);
    letter-spacing: -0.5px;
}

.nav-item { 
    padding: 12px 14px; font-size: 14px; color: var(--text-dim); display: flex; 
    align-items: center; border-radius: 8px; cursor: pointer; transition: 0.2s;
    margin-bottom: 4px; border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,0.03); color: var(--text); border-left-color: rgba(16, 185, 129, 0.3); }
.nav-item.active,.nav-item.active a { background: rgba(16, 185, 129, 0.1); color: var(--green); border-left-color: var(--green); font-weight: 600; }
.nav-item.active a { background: none; text-decoration: none; }
.nav-item i:not(.arrow) { width: 20px; margin-right: 12px; font-size: 16px; }
.nav-item a { background: none; text-decoration: none; color: inherit; }

.arrow { margin-left: auto; font-size: 10px; transition: 0.3s; opacity: 0.5; }
.nav-item.expanded .arrow { transform: rotate(180deg); color: var(--green); opacity: 1; }

.nav-submenu { max-height: 0; overflow: hidden; transition: 0.3s ease; padding-left: 42px; }
.nav-submenu.active { max-height: 1000px; margin-bottom: 10px; }
.nav-subitem { display: block; padding: 10px 0; font-size: 13px; color: var(--text-dim); text-decoration: none; transition: 0.2s; }
.nav-subitem:hover { color: var(--text); /*padding-left: 5px;*/ }
.nav-subitem.active { color: var(--text); /*padding-left: 5px;*/ }

.sidebar-footer { padding: 20px 16px; border-top: 1px solid var(--border); background: rgba(0,0,0,0.1); }
.user-profile-bottom { display: flex; align-items: center; gap: 12px; }
.user-profile-bottom img { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); }
.u-info { flex: 1; }
.u-name { font-size: 13px; font-weight: 600; color: var(--text); }
.u-plan { font-size: 11px; color: var(--text-dim); }
.logout-mini { font-size: 14px; color: var(--text-dim); cursor: pointer; transition: 0.2s; }
.logout-mini:hover { color: var(--danger); }

/* --- TOP NAV --- */
.top-nav {
    background: var(--top-nav-bg);
    display: flex; justify-content: space-between; align-items: center; padding: 16px 24px;
    /*background: rgba(11, 15, 25, 0.8);*/
    backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 1000;
}
.nav-left, .top-actions, .action-group { display: flex; align-items: center; gap: 15px; }
.search-bar { background: var(--sidebar); border: 1px solid var(--border); padding: 8px 16px; border-radius: 20px; width: 220px; display: flex; justify-content: space-between; font-size: 13px; color: var(--text-dim); }
.breadcrumb { font-size: 14px; color: var(--text-dim); display: flex; align-items: center; gap: 8px; }
.breadcrumb span { color: var(--text); font-weight: 500; }
.action-icon { color: var(--text-dim); cursor: pointer; font-size: 18px; transition: 0.2s; }
.action-icon:hover { color: var(--text); }
.notif-trigger-wrapper { position: relative; }
.notif-dot { position: absolute; top: -2px; right: -2px; width: 8px; height: 8px; background: var(--danger); border-radius: 50%; border: 2px solid var(--bg); }

/* --- NOTIFICATION PANEL & CLOSE BUTTON --- */
.notification-drawer {
    position: fixed; top: 0; right: 0; width: 380px; height: 100vh;
    background: var(--sidebar); border-left: 1px solid var(--border); z-index: 2000;
    transform: translateX(100%); transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex; flex-direction: column; 
    /*box-shadow: -10px 0 30px rgba(0,0,0,0.5);*/
}
.notification-drawer.active { transform: translateX(0); }
.drawer-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: rgba(255,255,255,0.02); }

.btn-close-drawer {
    background: transparent; border: 1px solid var(--border); color: var(--text-dim);
    width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.25s ease;
}
.btn-close-drawer:hover {
    background: rgba(239, 68, 68, 0.1); color: var(--danger); border-color: rgba(239, 68, 68, 0.2);
    transform: rotate(90deg);
}

.btn-close {
    background: transparent; border: 1px solid var(--border); color: var(--text-dim);
    width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.25s ease;
}
.btn-close-2 {
    background: transparent; border: 0px solid var(--border); color: var(--text-dim);
    /*width: 34px; height: 34px;*/
    border-radius: 10px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.25s ease;
    font-size: 1.1rem;
}
.btn-close-2:hover {
    color: var(--text-dim-hover);
}

.badge-count { background: var(--blue); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 20px; font-weight: 600; }
.drawer-content { flex: 1; overflow-y: auto; padding: 12px; }
.notif-item { display: flex; gap: 16px; padding: 16px; border-radius: 18px; margin-bottom: 8px; transition: 0.2s; border: 1px solid transparent; }
.notif-item:hover { background: rgba(255,255,255,0.03); border-color: var(--border); }
.notif-item.unread { background: rgba(59, 130, 246, 0.05); }
.notif-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 18px; }
.notif-icon.success { background: rgba(16, 185, 129, 0.1); color: var(--green); }
.notif-icon.danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

/* --- MAIN CONTENT & IMPROVED FOOTER --- */
.main-content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.dashboard-scroll-area { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.dashboard-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding: 24px; flex: 1; }
.card { background: var(--card); border-radius: 10px; padding: 24px; }
.hero-banner { grid-column: span 2; background: linear-gradient(135deg, #1e3a8a, #065f46); color: #fff; }
.table-card { grid-column: span 3; }

.main-footer { padding: 20px 24px 20px; border-top: 1px solid var(--border); background: rgba(17, 24, 39, 0.4); margin-top: auto; }
.footer-top { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 40px; margin-bottom: 40px; }
.footer-brand .logo { color: var(--green); font-size: 20px; font-weight: 700; margin-bottom: 12px; }
.footer-brand p { color: var(--text-dim); font-size: 13px; line-height: 1.6; max-width: 250px; }
.footer-group { display: flex; flex-direction: column; gap: 10px; }
.footer-label { font-size: 10px; font-weight: 800; color: #4b5563; text-transform: uppercase; letter-spacing: 1.2px; margin-bottom: 5px; }
.footer-group a { color: var(--text-dim); text-decoration: none; font-size: 13px; transition: 0.2s; }
.footer-group a:hover { color: var(--text); padding-left: 4px; }

.footer-bottom,.footer-bottom-2 { display: flex; justify-content: space-between; align-items: center; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.05); }
.footer-bottom-2 { border-top: none; padding-top: 10px; }
.footer-bottom p,.footer-bottom-2 p { font-size: 12px; color: var(--text-dim); }
.version-tag { font-size: 10px; font-weight: 700; color: var(--text-dim); background: var(--border); padding: 4px 10px; border-radius: 6px; }

/* --- UPDATED TABLE CELL STYLES --- */
.table-responsive,.table-container { overflow-x: auto; margin-top: 20px; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table th { 
    padding: 16px; 
    font-size: 11px; 
    color: var(--text-dim); 
    border-bottom: 2px solid var(--border); 
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.01);
}
.data-table td { padding: 16px; border-bottom: 1px solid var(--border); font-size: 14px; }

.user-cell { display: flex; align-items: center; gap: 14px; }
.avatar-container { position: relative; width: 40px; height: 40px; flex-shrink: 0; }
.avatar-container img { width: 100%; height: 100%; border-radius: 10px; object-fit: cover; border: 1px solid var(--border); }
.online-dot { 
    position: absolute; bottom: -2px; right: -2px; width: 10px; height: 10px; 
    background: var(--green); border: 2px solid var(--card); border-radius: 50%; 
}
.user-info { display: flex; flex-direction: column; line-height: 1.4; }
.user-name { font-weight: 600; color: var(--text); font-size: 14px; }
.user-email { font-size: 12px; color: var(--text-dim); }

.profile-avatar {
    width: 100%;
}

/* --- COMPREHENSIVE BUTTON SYSTEM --- */
.action-buttons { display: flex; gap: 8px; justify-content: flex-end; }
.btn-sm, .btn-icon {
    border: none; cursor: pointer; border-radius: 8px; font-weight: 600;
    transition: all 0.2s ease; display: inline-flex; align-items: center; justify-content: center;
}
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon { width: 32px; height: 32px; font-size: 14px; }

.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { filter: brightness(1.1); }

.btn-secondary { background: var(--blue); color: #fff; }

.btn-success { background: rgba(16, 185, 129, 0.15); color: var(--green); border: 1px solid rgba(16, 185, 129, 0.2); }
.btn-success:hover { background: var(--green); color: #fff; }

.btn-warning { background: rgba(245, 158, 11, 0.15); color: var(--orange); border: 1px solid rgba(245, 158, 11, 0.2); }
.btn-warning:hover { background: var(--orange); color: #fff; }

.btn-danger { background: rgba(239, 68, 68, 0.15); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.2); }
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-info { background: rgba(59, 130, 246, 0.15); color: var(--blue); border: 1px solid rgba(59, 130, 246, 0.2); }
.btn-info:hover { background: var(--blue); color: #fff; }

.btn-muted { background: var(--border); color: var(--text-dim); }
.btn-muted:hover { background: #4b5563; color: var(--text); }

.btn-secondary-2 { background: var(--secondary-2); color: #fff; }

/* --- STATUS BADGES --- */
.status-badge { padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 600; display: inline-block; }
.status-badge.success { background: rgba(16, 185, 129, 0.1); color: var(--green); }
.status-badge.warning { background: rgba(245, 158, 11, 0.1); color: var(--orange); }
.status-badge.danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

/* --- PROFILE DROPDOWN --- */
.profile-wrapper { position: relative; }
.avatar-trigger { width: 38px; height: 38px; border-radius: 12px; cursor: pointer; border: 2px solid var(--border); overflow: hidden; }
.profile-dropdown {
    position: absolute; top: calc(100% + 15px); right: 0; width: 240px; background: var(--sidebar);
    border: 1px solid var(--border); border-radius: 10px; padding: 8px;
    visibility: hidden; opacity: 0; transform: translateY(10px); transition: 0.3s; z-index: 1100;
    font-size: 0.8rem;
}
.profile-dropdown.active { visibility: visible; opacity: 1; transform: translateY(0); }
.dropdown-header { padding: 12px 16px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.profile-dropdown a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; color: var(--text-dim); text-decoration: none; 
    font-size: 0.8rem; border-radius: 8px; }
.profile-dropdown a:hover { background: rgba(255,255,255,0.05); color: var(--green); }
.profile-dropdown .dropdown-divider {
    background: var(--border);
    border: 0px solid var(--border);
    height: 1px;
}
/*.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 6px 0;
}*/

/* --- OVERLAY --- */
.sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); visibility: hidden; opacity: 0; z-index: 1050; transition: 0.3s; }
.sidebar-overlay.active { visibility: visible; opacity: 1; }

/* --- MODAL SYSTEM --- */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 3000;
    visibility: hidden; opacity: 0;
    transition: 0.3s ease;
}

.modal-container {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -40%) scale(0.95);
    width: 90%; max-width: 500px;
    background: var(--sidebar);
    border: 1px solid var(--border);
    border-radius: 10px;
    z-index: 3001;
    visibility: hidden; opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    display: flex; flex-direction: column;
    max-height: 90vh; /* Prevent modal from exceeding screen height */
    display: flex;
    flex-direction: column;
}

/* Active State for Modals */
.modal-overlay.active, 
.modal-container.active { visibility: visible; opacity: 1; }
.modal-container.active { transform: translate(-50%, -50%) scale(1); }

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
}
.modal-header h3 { font-size: 18px; display: flex; align-items: center; gap: 10px; color: var(--text); }

.modal-body { padding: 24px; color: var(--text-dim); line-height: 1.6; font-size: 14px;
    /* Enable scrolling */
    overflow-y: scroll; 
    flex: 1; /* Allow body to take available space */
}

.alert-box {
    margin-top: 20px; padding: 12px 16px;
    background: rgba(59, 130, 246, 0.1);
    border-left: 4px solid var(--blue);
    border-radius: 8px; color: var(--blue);
    font-size: 13px; display: flex; align-items: center; gap: 10px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex; justify-content: flex-end; gap: 12px;
    background: rgba(255,255,255,0.02);
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
}

/* Stacked Effect: Push the second modal slightly lower and scale it */
.modal-container.active ~ .modal-container.active {
    transform: translate(-50%, -45%) scale(0.98);
}

/* Ensure the overlay covers everything behind the top modal */
.modal-overlay {
    transition: opacity 0.3s ease, z-index 0s; /* Z-index should change instantly */
}

/* Allow modals to have dynamic z-index from JS */
/*.modal-container {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}
.modal-container > * {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}*/

/* --- MODAL SIZES --- */
/* Default is already 500px in your current code */

.modal-sm { max-width: 300px; }
.modal-md { max-width: 500px; }
.modal-lg { max-width: 800px; }
.modal-xl { max-width: 1140px; }

/* Responsive adjustment: ensure large modals don't overflow on small screens */
@media (max-width: 1200px) {
    .modal-xl { max-width: 90%; }
}
@media (max-width: 850px) {
    .modal-lg { max-width: 90%; }
}

@media (max-width: 1024px) { .footer-top { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: span 2; } }
@media (max-width: 768px) {
    .sidebar { position: fixed; left: -260px; }
    .sidebar.active { left: 0; }
    .notification-drawer { width: 100%; }
    .search-bar { display: none; }
    .footer-top { grid-template-columns: 1fr; }
    .footer-brand { grid-column: span 1; }
}

/* --- NEW FORM STYLES (MATCHES CURRENT THEME) --- */
.form-group { margin-bottom: 20px; }
.form-label { 
    display: block; font-size: 13px; font-weight: 600; 
    color: var(--text); margin-bottom: 8px; 
}

/* Inputs, Number, Select */
.form-control {
    width: 100%; padding: 12px 16px; background: var(--bg);
    border: 1px solid var(--border); border-radius: 10px;
    color: var(--text); font-size: 14px; transition: 0.3s;
    outline: none;
}
.form-control:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1); }

/* Custom Checkbox & Radio */
.form-check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.form-check input { 
    appearance: none; width: 18px; height: 18px; 
    border: 2px solid var(--border); border-radius: 4px; 
    cursor: pointer; position: relative; transition: 0.2s;
}
.form-check input[type="radio"] { border-radius: 50%; }
.form-check input:checked { background: var(--green); border-color: var(--green); }
.form-check input:checked::after {
    content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
    font-size: 10px; color: white; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
}

/* --- CUSTOM SELECT STYLE --- */
select.form-control {
    appearance: none; /* Removes default browser styling */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px; /* Space for the arrow */
    cursor: pointer;
}

/* Update focus state to match your theme's green accent */
select.form-control:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2310b981'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
}

/* Style for the options dropdown (Limited browser support for styling options) */
select.form-control option {
    background-color: var(--sidebar);
    color: var(--text);
    padding: 10px;
}


/* --- CUSTOM FILE INPUT STYLE --- */
.form-control[type="file"] {
    padding: 8px 12px; /* Adjusted padding to accommodate the button */
    cursor: pointer;
    line-height: 1.5;
}

/* Styles the "Choose File" button inside the input */
.form-control[type="file"]::file-selector-button {
    background: var(--sidebar);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: 6px;
    margin-right: 16px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Hover effect for the file button */
.form-control[type="file"]::file-selector-button:hover {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}

/* Focus state for the entire input */
.form-control[type="file"]:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Toggle Switch */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; inset: 0;
    background-color: var(--border); transition: .4s; border-radius: 34px;
}
.slider:before {
    position: absolute; content: ""; height: 16px; width: 16px;
    left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%;
}
input:checked + .slider { background-color: var(--green); }
input:checked + .slider:before { transform: translateX(18px); }

/* Layout Helpers */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group-flex {
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(255, 255, 255, 0.03); padding: 12px; border-radius: 12px;
}


/* --- COMPREHENSIVE BUTTON SYSTEM --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1;
}

/* Sizing Variants */
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: 12px; }

/* 1. Primary (Green) */
.btn-primary { 
    background: var(--green); 
    color: #ffffff; 
}
.btn-primary:hover { 
    filter: brightness(1.1); 
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* 2. Secondary (Blue) */
.btn-secondary { 
    background: var(--blue); 
    color: #ffffff; 
}
.btn-secondary:hover { 
    filter: brightness(1.1); 
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* 3. Success (Subtle Green) */
.btn-success { 
    background: rgba(16, 185, 129, 0.15); 
    color: var(--green); 
    border-color: rgba(16, 185, 129, 0.2); 
}
.btn-success:hover { 
    background: var(--green); 
    color: #ffffff; 
}

/* 4. Warning (Subtle Orange) */
.btn-warning { 
    background: rgba(245, 158, 11, 0.15); 
    color: var(--orange); 
    border-color: rgba(245, 158, 11, 0.2); 
}
.btn-warning:hover { 
    background: var(--orange); 
    color: #ffffff; 
}

/* 5. Danger (Subtle Red) */
.btn-danger { 
    background: rgba(239, 68, 68, 0.15); 
    color: var(--danger); 
    border-color: rgba(239, 68, 68, 0.2); 
}
.btn-danger:hover { 
    background: var(--danger); 
    color: #ffffff; 
}

/* 6. Info (Subtle Blue) */
.btn-info { 
    background: rgba(59, 130, 246, 0.15); 
    color: var(--blue); 
    border-color: rgba(59, 130, 246, 0.2); 
}
.btn-info:hover { 
    background: var(--blue); 
    color: #ffffff; 
}

/* 7. Muted (Border Color) */
.btn-muted { 
    background: var(--border); 
    color: var(--text-dim); 
}
.btn-muted:hover { 
    background: #4b5563; 
    color: var(--text); 
}

/* Icon Button (Square) */
.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-dim);
}
.btn-icon:hover {
    background: var(--border);
    color: var(--text);
}


/* --- COMPREHENSIVE BADGE SYSTEM --- */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid transparent;
}

/* 1. Primary (Green) */
.badge-primary {
    background: rgba(16, 185, 129, 0.1);
    color: var(--green);
    border-color: rgba(16, 185, 129, 0.2);
}

/* 2. Secondary (Blue) */
.badge-secondary {
    background: rgba(59, 130, 246, 0.1);
    color: var(--blue);
    border-color: rgba(59, 130, 246, 0.2);
}

/* 3. Success (Same as Primary for this theme) */
.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--green);
    border-color: rgba(16, 185, 129, 0.2);
}

/* 4. Warning (Orange) */
.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--orange);
    border-color: rgba(245, 158, 11, 0.2);
}

/* 5. Danger (Red) */
.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}

/* 6. Info (Blue/Light Blue) */
.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--blue);
    border-color: rgba(59, 130, 246, 0.1);
}

/* 7. Muted (Gray) */
.badge-muted {
    background: var(--border);
    color: var(--text-dim);
}

/* Optional: Solid Variants */
.badge-solid-primary { background: var(--green); color: #fff; }
.badge-solid-danger { background: var(--danger); color: #fff; }


/* --- ACCORDION SYSTEM --- */
.accordion {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.accordion-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.accordion-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.accordion-header:hover {
    background: rgba(255, 255, 255, 0.02);
}

.accordion-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.accordion-icon {
    font-size: 12px;
    color: var(--text-dim);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Content Area */
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

/* Active State */
.accordion-item.active {
    border-color: var(--green);
}

.accordion-item.active .accordion-content {
    max-height: 500px; /* Adjust based on content */
    opacity: 1;
    padding: 0 20px 20px;
}

.accordion-item.active .accordion-icon {
    transform: rotate(180deg);
    color: var(--green);
}

/* --- CUSTOM GRID SYSTEM --- */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -12px;
    margin-left: -12px;
    text-align: left;
    vertical-align: top;
}

/* Common column styles */
[class*="col-"] {
    position: relative;
    width: 100%;
    padding-right: 12px;
    padding-left: 12px;
    margin-bottom: 24px; /* Matches your dashboard-grid gap */
}

/* Column Widths */
.col-1  { flex: 0 0 8.333333%; max-width: 8.333333%; }
.col-2  { flex: 0 0 16.666667%; max-width: 16.666667%; }
.col-3  { flex: 0 0 25%; max-width: 25%; }
.col-4  { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-5  { flex: 0 0 41.666667%; max-width: 41.666667%; }
.col-6  { flex: 0 0 50%; max-width: 50%; }
.col-7  { flex: 0 0 58.333333%; max-width: 58.333333%; }
.col-8  { flex: 0 0 66.666667%; max-width: 66.666667%; }
.col-9  { flex: 0 0 75%; max-width: 75%; }
.col-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
.col-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

/* Mobile Responsiveness */
@media (max-width: 768px) {
    [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* --- RESPONSIVE GRID SYSTEM --- */

[class*="col-"] {
    position: relative;
    width: 100%; /* Default: Auto-stack to 100% on smallest screens */
    padding-right: 12px;
    padding-left: 12px;
    margin-bottom: 24px;
}

/* Base columns (Small/Mobile - always stack unless specified) */
.col-sm-12 { flex: 0 0 100%; max-width: 100%; }
.col-sm-6  { flex: 0 0 50%; max-width: 50%; }

/* Medium devices (Tablets, 768px and up) */
@media (min-width: 768px) {
    .col-md-1  { flex: 0 0 8.333333%; max-width: 8.333333%; }
    .col-md-2  { flex: 0 0 16.666667%; max-width: 16.666667%; }
    .col-md-3  { flex: 0 0 25%; max-width: 25%; }
    .col-md-4  { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-md-6  { flex: 0 0 50%; max-width: 50%; }
    .col-md-8  { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-md-12 { flex: 0 0 100%; max-width: 100%; }
}

/* Large devices (Desktops, 1024px and up) */
@media (min-width: 1024px) {
    .col-lg-1  { flex: 0 0 8.333333%; max-width: 8.333333%; }
    .col-lg-2  { flex: 0 0 16.666667%; max-width: 16.666667%; }
    .col-lg-3  { flex: 0 0 25%; max-width: 25%; }
    .col-lg-4  { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-lg-6  { flex: 0 0 50%; max-width: 50%; }
    .col-lg-8  { flex: 0 0 66.666667%; max-width: 66.666667%; }
    .col-lg-12 { flex: 0 0 100%; max-width: 100%; }
}


/* --- COMPREHENSIVE ALERT SYSTEM --- */
.alert {
    position: relative;
    padding: 16px 20px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.alert-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
}

.alert-close {
    cursor: pointer;
    opacity: 0.5;
    transition: 0.2s;
    background: none;
    border: none;
    color: inherit;
    font-size: 16px;
}

.alert-close:hover {
    opacity: 1;
}

/* 1. Primary (Green) */
.alert-primary {
    background: rgba(16, 185, 129, 0.1);
    color: var(--green);
    border-color: rgba(16, 185, 129, 0.2);
}

/* 2. Secondary (Blue) */
.alert-secondary {
    background: rgba(59, 130, 246, 0.1);
    color: var(--blue);
    border-color: rgba(59, 130, 246, 0.2);
}

/* 3. Success */
.alert-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--green);
    border-color: rgba(16, 185, 129, 0.3);
}

/* 4. Warning (Orange) */
.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--orange);
    border-color: rgba(245, 158, 11, 0.2);
}

/* 5. Danger (Red) */
.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}

/* 6. Info */
.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--blue);
    border-color: rgba(59, 130, 246, 0.1);
}

/* 7. Muted */
.alert-muted {
    background: var(--card);
    color: var(--text-dim);
    border-color: var(--border);
}


/* --- TOAST NOTIFICATION SYSTEM --- */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    width: 320px;
    background: var(--sidebar);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: toastSlideIn 0.3s ease-out forwards;
    position: relative;
    overflow: hidden;
}

@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
    display: block;
}

.toast-message {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 14px;
    padding: 0;
}

/* Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
}

.toast-progress-fill {
    height: 100%;
    width: 100%;
    transform-origin: left;
}

/* --- TOAST VARIANTS --- */
.toast-primary .toast-icon, .toast-primary .toast-progress-fill { background-color: var(--green); color: var(--green); }
.toast-success .toast-icon, .toast-success .toast-progress-fill { background-color: var(--green); color: var(--green); }
.toast-secondary .toast-icon, .toast-secondary .toast-progress-fill { background-color: var(--blue); color: var(--blue); }
.toast-info .toast-icon, .toast-info .toast-progress-fill { background-color: var(--blue); color: var(--blue); }
.toast-warning .toast-icon, .toast-warning .toast-progress-fill { background-color: var(--orange); color: var(--orange); }
.toast-danger .toast-icon, .toast-danger .toast-progress-fill { background-color: var(--danger); color: var(--danger); }
.toast-muted .toast-icon, .toast-muted .toast-progress-fill { background-color: var(--text-dim); color: var(--text-dim); }

/* Transparent icons for toast headers */
.toast-icon { background: none !important; }


/* CAROUSEL  */
/* --- CAROUSEL SYSTEM --- */
.carousel-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 16px;
    background: var(--card);
    border: 1px solid var(--border);
}

.carousel-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
}

.carousel-slide {
    min-width: 100%;
    position: relative;
}

.carousel-slide img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    display: block;
    opacity: 0.8; /* Maintains the dark aesthetic */
}

.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 24px 24px;
    background: linear-gradient(transparent, rgba(11, 15, 25, 0.9));
    color: var(--text);
}

.carousel-caption h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.carousel-caption p {
    color: var(--text-dim);
    font-size: 14px;
}

/* Navigation Controls */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.btn-prev { left: 16px; }
.btn-next { right: 16px; }

/* Indicators */
.carousel-indicators {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 11;
}

.indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: 0.3s;
}

.indicator.active {
    background: var(--green);
    width: 24px;
    border-radius: 4px;
}


/* --- PAGINATION SYSTEM --- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    padding: 12px;
}

.page-item, .page-item-2 {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border-radius: 10px;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    text-align: center;
}
.page-item-2 {
    margin-top: 4px;
    margin-bottom: 4px;
    margin-left: 4px;
    margin-right: 4px;
    vertical-align: middle;
    padding-top: 8px;
}

.page-item:hover:not(.disabled), .page-item-2:hover:not(.disabled) {
    border-color: var(--green);
    color: var(--green);
    background: rgba(16, 185, 129, 0.05);
}

.page-item.active, .page-item-2.active {
    background: var(--green);
    border-color: var(--green);
    color: #ffffff;
}

.page-item.disabled, .page-item-2.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-item i, .page-item-2 i {
    font-size: 12px;
}

/* Pagination Info (Optional) */
.pagination-info {
    font-size: 13px;
    color: var(--text-dim);
    margin-right: auto; /* Pushes pagination to the right if used in a flex container */
}


/* --- PROGRESS BAR SYSTEM --- */
.progress {
    display: flex;
    height: 8px;
    overflow: hidden;
    font-size: 10px;
    background-color: var(--border); /* Uses the existing border color for the track */
    border-radius: 10px;
    margin-bottom: 1rem;
    width: 100%;
}

.progress-bar {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    background-color: var(--green);
    transition: width 0.6s ease;
    border-radius: 10px;
}

/* Progress Bar Variants */
.progress-primary .progress-bar { 
    background-color: var(--green); 
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2); 
}

.progress-secondary .progress-bar { 
    background-color: var(--blue); 
}

.progress-success .progress-bar { 
    background-color: var(--green); 
}

.progress-warning .progress-bar { 
    background-color: var(--orange); 
}

.progress-danger .progress-bar { 
    background-color: var(--danger); 
}

.progress-info .progress-bar { 
    background-color: var(--blue); 
    opacity: 0.8;
}

.progress-muted .progress-bar { 
    background-color: var(--text-dim); 
}

/* Optional: Striped Animation */
.progress-bar-animated {
    background-image: linear-gradient(45deg, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
    background-size: 1rem 1rem;
    animation: progress-bar-stripes 1s linear infinite;
}

@keyframes progress-bar-stripes {
    from { background-position: 1rem 0; }
    to { background-position: 0 0; }
}



/* --- TOOLTIP SYSTEM --- */
[data-tooltip] {
    position: relative;
    cursor: pointer;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    padding: 6px 12px;
    background: var(--sidebar);
    color: var(--text);
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    white-space: nowrap;
    visibility: hidden;
    opacity: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 2000;
}

/* Arrow */
[data-tooltip]::after {
    content: "";
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    border-width: 5px;
    border-style: solid;
    border-color: var(--border) transparent transparent transparent;
    visibility: hidden;
    opacity: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* --- TOOLTIP VARIANTS --- */

/* Primary (Green) */
.tooltip-primary[data-tooltip]::before {
    border-color: var(--green);
    background: var(--green);
    color: #fff;
}
.tooltip-primary[data-tooltip]::after { border-top-color: var(--green); }

/* Secondary (Blue) */
.tooltip-secondary[data-tooltip]::before {
    border-color: var(--blue);
    background: var(--blue);
    color: #fff;
}
.tooltip-secondary[data-tooltip]::after { border-top-color: var(--blue); }

/* Success */
.tooltip-success[data-tooltip]::before {
    border-color: var(--green);
    background: rgba(16, 185, 129, 0.2);
    backdrop-filter: blur(4px);
    color: var(--green);
}
.tooltip-success[data-tooltip]::after { border-top-color: var(--green); }

/* Warning */
.tooltip-warning[data-tooltip]::before {
    border-color: var(--orange);
    background: var(--orange);
    color: #fff;
}
.tooltip-warning[data-tooltip]::after { border-top-color: var(--orange); }

/* Danger */
.tooltip-danger[data-tooltip]::before {
    border-color: var(--danger);
    background: var(--danger);
    color: #fff;
}
.tooltip-danger[data-tooltip]::after { border-top-color: var(--danger); }

/* Info */
.tooltip-info[data-tooltip]::before {
    border-color: var(--blue);
    background: rgba(59, 130, 246, 0.2);
    backdrop-filter: blur(4px);
    color: var(--blue);
}
.tooltip-info[data-tooltip]::after { border-top-color: var(--blue); }

/* Muted */
.tooltip-muted[data-tooltip]::before {
    border-color: var(--border);
    background: var(--card);
    color: var(--text-dim);
}
.tooltip-muted[data-tooltip]::after { border-top-color: var(--border); }


/* --- COMPREHENSIVE CARD SYSTEM --- */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

/* Base Variant Style */
.card-variant {
    border-left: 4px solid transparent;
}

/* 1. Primary (Green) */
.card-primary {
    border-left-color: var(--green);
}
.card-primary .card-title { color: var(--green); }

/* 2. Secondary (Blue) */
.card-secondary {
    border-left-color: var(--blue);
}
.card-secondary .card-title { color: var(--blue); }

/* 3. Success */
.card-success {
    border-left-color: var(--green);
    background: linear-gradient(to right, rgba(16, 185, 129, 0.05), transparent);
}

/* 4. Warning (Orange) */
.card-warning {
    border-left-color: var(--orange);
}
.card-warning .card-title { color: var(--orange); }

/* 5. Danger (Red) */
.card-danger {
    border-left-color: var(--danger);
    background: linear-gradient(to right, rgba(239, 68, 68, 0.03), transparent);
}
.card-danger .card-title { color: var(--danger); }

/* 6. Info (Light Blue) */
.card-info {
    border-left-color: var(--blue);
}

/* 7. Muted (Gray) */
.card-muted {
    border-left-color: var(--text-dim);
    opacity: 0.8;
}

.card-bg-2 {
    background-color: var(--card-2);
}
.card-bg-3 {
    background-color: var(--card-3);
}

/* --- SPINNER SYSTEM --- */
.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--green); /* Default to Primary */
    animation: spin 0.8s linear infinite;
}

/* Sizing */
.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.spinner-lg { width: 40px; height: 40px; border-width: 4px; }

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- SPINNER VARIANTS --- */
.spinner-primary   { border-top-color: var(--green); }
.spinner-secondary { border-top-color: var(--blue); }
.spinner-success   { border-top-color: var(--green); }
.spinner-warning   { border-top-color: var(--orange); }
.spinner-danger    { border-top-color: var(--danger); }
.spinner-info      { border-top-color: var(--blue); }
.spinner-muted     { border-top-color: var(--text-dim); }

/* --- BUTTON LOADING STATE --- */
.btn .spinner {
    margin-right: 8px;
    width: 14px;
    height: 14px;
    border-width: 2px;
    border-top-color: currentColor; /* Inherits text color of the button */
}


/* --- POPOVER SYSTEM --- */
.popover-wrapper {
    position: relative;
    display: inline-block;
}

.popover {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 200px;
    background: var(--sidebar);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    visibility: hidden;
    opacity: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1200;
}

.popover.active {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.popover-header {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
    display: block;
}

.popover-body {
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.4;
}

/* Arrow */
.popover::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: var(--border) transparent transparent transparent;
}

/* --- POPOVER VARIANTS --- */
.popover-primary { border-top: 3px solid var(--green); }
.popover-secondary { border-top: 3px solid var(--blue); }
.popover-success { border-top: 3px solid var(--green); }
.popover-warning { border-top: 3px solid var(--orange); }
.popover-danger { border-top: 3px solid var(--danger); }
.popover-info { border-top: 3px solid var(--blue); }
.popover-muted { border-top: 3px solid var(--text-dim); }


/* --- TABS SYSTEM --- */
.tabs-container {
    width: 100%;
}

.tabs-header {
    display: flex;
    gap: 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.tab-link {
    padding: 12px 4px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dim);
    cursor: pointer;
    position: relative;
    transition: 0.2s;
    border: none;
    background: none;
}

.tab-link:hover {
    color: var(--text);
}

.tab-link.active {
    color: var(--green);
}

/* The animated bottom border */
.tab-link.active::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--green);
    border-radius: 2px 2px 0 0;
}

.tab-content {
    display: none;
    animation: fadeInTab 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeInTab {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}



/* --- DROPDOWN SYSTEM --- */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 180px;
    background: var(--sidebar);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    visibility: hidden;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1100;
}

/* Alignment variants */
.dropdown-right { left: auto; right: 0; }

.dropdown.active .dropdown-menu {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    transition: 0.2s;
    cursor: pointer;
    border: none;
    width: 100%;
    background: none;
    text-align: left;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--green);
}

.dropdown-item i {
    font-size: 14px;
    width: 18px;
    text-align: center;
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 6px 0;
}

/* --- DESKTOP SIDEBAR TOGGLE --- */
@media (min-width: 769px) {
    .sidebar.collapsed {
        margin-left: -260px;
    }
    .sidebar.collapsed + .main-content {
        width: 100%;
    }
}
.sidebar {
    transition: 0.3s ease;
}

/* --- COMPREHENSIVE LINK SYSTEM --- */
.link {
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

.link:hover {
    /*text-decoration: underline;*/
    text-underline-offset: 4px;
}

/* 1. Primary (Green) */
.link-primary {
    color: var(--green);
}
.link-primary:hover {
    color: #14d392; /* Slightly brighter green */
}

/* 2. Secondary (Blue) */
.link-secondary {
    color: var(--blue);
}
.link-secondary:hover {
    color: #60a5fa; /* Slightly brighter blue */
}

/* 3. Success */
.link-success {
    color: var(--green);
}

/* 4. Warning (Orange) */
.link-warning {
    color: var(--orange);
}
.link-warning:hover {
    opacity: 0.8;
}

/* 5. Danger (Red) */
.link-danger {
    color: var(--danger);
}
.link-danger:hover {
    color: #f87171;
}

/* 6. Info (Blue) */
.link-info {
    color: var(--blue);
}

/* 7. Muted (Gray) */
.link-muted {
    color: var(--text-dim);
}
.link-muted:hover {
    color: var(--text);
}

/* Underline variant (Always visible) */
.link-underlined {
    border-bottom: 1px solid currentColor;
}
.link-underlined:hover {
    text-decoration: none;
    border-bottom-width: 2px;
}

/* --- COMPREHENSIVE TEXT SYSTEM --- */

/* 1. Primary (Green) */
.text-primary {
    color: var(--green) !important;
}

/* 2. Secondary (Blue) */
.text-secondary {
    color: var(--blue) !important;
}

/* 3. Success (Green) */
.text-success {
    color: var(--green) !important;
}

/* 4. Warning (Orange) */
.text-warning {
    color: var(--orange) !important;
}

/* 5. Danger (Red) */
.text-danger {
    color: var(--danger) !important;
}

/* 6. Info (Blue) */
.text-info {
    color: var(--blue) !important;
}

/* 7. Muted (Gray) */
.text-muted {
    color: var(--text-dim) !important;
}

/* Extra: Gradient Text (Matches your Hero Banner) */
.text-gradient {
    background: linear-gradient(135deg, #10b981, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

/* --- TEXT HOVER SYSTEM --- */

/* Base transition for smooth color changes */
.text-hover {
    transition: color 0.2s ease;
    cursor: pointer;
}

/* 1. Primary (Green) - Brightens slightly on hover */
.text-hover-primary:hover {
    color: #14d392 !important; /* Brighter emerald */
}

/* 2. Secondary (Blue) - Brightens slightly on hover */
.text-hover-secondary:hover {
    color: #60a5fa !important; /* Brighter blue */
}

/* 3. Success (Green) - Same as Primary */
.text-hover-success:hover {
    color: #14d392 !important;
}

/* 4. Warning (Orange) - Shifts to a lighter amber */
.text-hover-warning:hover {
    color: #fbbf24 !important;
}

/* 5. Danger (Red) - Shifts to a lighter coral/red */
.text-hover-danger:hover {
    color: #f87171 !important;
}

/* 6. Info (Blue) - Same as Secondary */
.text-hover-info:hover {
    color: #60a5fa !important;
}

/* 7. Muted (Gray) - Transitions to the main white text color */
.text-hover-muted:hover {
    color: var(--text) !important;
}

/* Interaction: Underline on hover (Optional utility) */
.text-hover-underline:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* --- BUTTON SIZING SYSTEM --- */

/* Extra Small (xs) - For tight spaces/inline actions */
.btn-xs {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 6px;
    gap: 4px;
}
.btn-xs i { font-size: 10px; }

/* Small (sm) - Standard for table actions */
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 8px;
    gap: 6px;
}
.btn-sm i { font-size: 12px; }

/* Medium (md) - The default dashboard size */
.btn-md {
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 10px;
    gap: 8px;
}
.btn-md i { font-size: 14px; }

/* Large (lg) - For primary forms or calls to action */
.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
    border-radius: 12px;
    gap: 10px;
}
.btn-lg i { font-size: 18px; }

/* Extra Large (xl) - For hero sections or landing pages */
.btn-xl {
    padding: 18px 36px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 14px;
    gap: 12px;
}
.btn-xl i { font-size: 20px; }

/* Icon-only Square Variants */
.btn-icon.btn-xs { width: 24px; height: 24px; padding: 0; }
.btn-icon.btn-sm { width: 32px; height: 32px; padding: 0; }
.btn-icon.btn-md { width: 42px; height: 42px; padding: 0; }
.btn-icon.btn-lg { width: 52px; height: 52px; padding: 0; }
.btn-icon.btn-xl { width: 64px; height: 64px; padding: 0; }

.btn-bg-transparent { background: transparent !important; }
.btn-bg-hover-transparent:hover { background: transparent !important; }

.cursor-pointer { cursor: pointer; }


.mr-0 { margin-right: 0rem !important; }
.mr-1 {
    margin-right: 0.5rem !important;
}
.mr-2 {
    margin-right: 1rem !important;
}
.mr-3 {
    margin-right: 1.5rem !important;
}
.mr-4 {
    margin-right: 2rem !important;
}
.mr-5 {
    margin-right: 2.5rem !important;
}
.ml-0 { margin-left: 0rem !important; }
.ml-1 {
    margin-left: 0.5rem !important;
}
.ml-2 {
    margin-left: 1rem !important;
}
.ml-3 {
    margin-left: 1.5rem !important;
}
.ml-4 {
    margin-left: 2rem !important;
}
.ml-5 {
    margin-left: 2.5rem !important;
}
.mt-0 { margin-top: 0rem !important; }
.mt-1 {
    margin-top: 0.5rem !important;
}
.mt-2 {
    margin-top: 1rem !important;
}
.mt-3 {
    margin-top: 1.5rem !important;
}
.mt-4 {
    margin-top: 2rem !important;
}
.mt-5 {
    margin-top: 2.5rem !important;
}
.mb-0 { margin-bottom: 0rem !important; }
.mb-1 {
    margin-bottom: 0.5rem !important;
}
.mb-2 {
    margin-bottom: 1rem !important;
}
.mb-3 {
    margin-bottom: 1.5rem !important;
}
.mb-4 {
    margin-bottom: 2rem !important;
}
.mb-5 {
    margin-bottom: 2.5rem !important;
}

.m-0 { margin: 0rem; }
.m-1 { margin: 0.5rem; }
.m-2 { margin: 1rem; }
.m-3 { margin: 1.5rem; }
.m-4 { margin: 2rem; }
.m-5 { margin: 2.5rem; }

.m-2-1 { margin: 2px; }
.m-2-2 { margin: 4px; }
.m-2-3 { margin: 6px; }
.m-2-4 { margin: 8px; }
.m-2-5 { margin: 10px; }

.m-opts-1 { margin: 4px; }


.mx-0 { margin-left: 0rem; margin-right: 0rem; }
.mx-1 { margin-left: 0.5rem; margin-right: 0.5rem; }
.mx-2 { margin-left: 1rem; margin-right: 1rem; }
.mx-3 { margin-left: 1.5rem; margin-right: 1.5rem; }
.mx-4 { margin-left: 2rem; margin-right: 2rem; }
.mx-5 { margin-left: 2.5rem; margin-right: 2.5rem; }

.my-0 { margin-top: 0rem; margin-bottom: 0rem; }
.my-1 { margin-top: 0.5rem; margin-bottom: 0.5rem; }
.my-2 { margin-top: 1rem; margin-bottom: 1rem; }
.my-3 { margin-top: 1.5rem; margin-bottom: 1.5rem; }
.my-4 { margin-top: 2rem; margin-bottom: 2rem; }
.my-5 { margin-top: 2.5rem; margin-bottom: 2.5rem; }

.px-0 { padding-left: 0rem; padding-right: 0rem; }
.px-1 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-2 { padding-left: 1rem; padding-right: 1rem; }
.px-3 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-4 { padding-left: 2rem; padding-right: 2rem; }
.px-5 { padding-left: 2.5rem; padding-right: 2.5rem; }

.py-0 { padding-top: 0rem; padding-bottom: 0rem; }
.py-1 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2 { padding-top: 1rem; padding-bottom: 1rem; }
.py-3 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-4 { padding-top: 2rem; padding-bottom: 2rem; }
.py-5 { padding-top: 2.5rem; padding-bottom: 2.5rem; }

.p-0 { padding: 0rem; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }
.p-5 { padding: 2.5rem; }
.pb-0 { padding-bottom: 0rem !important; }
.pb-1 { padding-bottom: 0.5rem !important; }
.pb-2 { padding-bottom: 1rem !important; }
.pb-3 { padding-bottom: 1.5rem !important; }
.pb-4 { padding-bottom: 2rem !important; }
.pb-5 { padding-bottom: 2.5rem !important; }
.pt-0 { padding-top: 0rem !important; }
.pt-1 { padding-top: 0.5rem !important; }
.pt-2 { padding-top: 1rem !important; }
.pt-3 { padding-top: 1.5rem !important; }
.pt-4 { padding-top: 2rem !important; }
.pt-5 { padding-top: 2.5rem !important; }
.pl-0 { padding-left: 0rem !important; }
.pl-1 { padding-left: 0.5rem !important; }
.pl-2 { padding-left: 1rem !important; }
.pl-3 { padding-left: 1.5rem !important; }
.pl-4 { padding-left: 2rem !important; }
.pl-5 { padding-left: 2.5rem !important; }
.pr-0 { padding-right: 0rem !important; }
.pr-1 { padding-right: 0.5rem !important; }
.pr-2 { padding-right: 1rem !important; }
.pr-3 { padding-right: 1.5rem !important; }
.pr-4 { padding-right: 2rem !important; }
.pr-5 { padding-right: 2.5rem !important; }

.px-2-1 { padding-left: 10px; padding-right: 10px; }
.px-2-2 { padding-left: 15px; padding-right: 15px; }
.px-2-3 { padding-left: 20px; padding-right: 20px; }

.py-2-1 { padding-top: 10px; padding-bottom: 10px; }
.py-2-2 { padding-top: 15px; padding-bottom: 15px; }
.py-2-3 { padding-top: 20px; padding-bottom: 20px; }

.cfs-1 { font-size: 0.5rem; }
.cfs-2 { font-size: 0.8rem; }
.cfs-3 { font-size: 1rem; }
.cfs-4 { font-size: 1.2rem; }
.cfs-5 { font-size: 1.4rem; }
.cfs-6 { font-size: 1.6rem; }
.cfs-7 { font-size: 1.8rem; }
.cfs-8 { font-size: 2rem; }

.br-0 { border-radius: 0; }
.br-1 { border-radius: 5px; }
.br-2 { border-radius: 10px; }
.br-3 { border-radius: 15px; }
.br-4 { border-radius: 20px; }

.mw-100-p { max-width: 100%; }
.w-100-p { width: 100%; }

.ts-1 { text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3); }
.ts-2 { text-shadow: 2px 2px 4px rgba(0, 0, 0, 1); }

.bs-1 { box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3); }
.bs-2 { box-shadow: 2px 2px 4px rgba(0, 0, 0, 1); }
.bs-3 { box-shadow: var(--box-shadow); }

.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

.text-center {
    text-align: center;
}


.br-px-0 { border-radius: 0px !important; }
.br-px-1 { border-radius: 5px !important; }
.br-px-2 { border-radius: 10px !important; }
.br-px-3 { border-radius: 15px !important; }
.br-px-4 { border-radius: 20px !important; }
.br-px-5 { border-radius: 25px !important; }

.br-0 { border-radius: 0rem !important; }
.br-1 { border-radius: .5rem !important; }
.br-2 { border-radius: 1rem !important; }
.br-3 { border-radius: 1.5rem !important; }
.br-4 { border-radius: 2rem !important; }
.br-5 { border-radius: 2.5rem !important; }

.br-p-50 { border-radius: 50% !important; }

.br-tl-0 { border-top-left-radius: 0px !important; }
.br-tr-0 { border-top-right-radius: 0px !important; }
.br-bl-0 { border-bottom-left-radius: 0px !important; }
.br-br-0 { border-bottom-right-radius: 0px !important; }

.tbl-col-act-1 { width: 110px !important; min-width: 110px !important; max-width: 110px !important; }
.tbl-col-common-1 { width: 110px !important; min-width: 110px !important; max-width: 110px !important; }
.tbl-col-details-1 { width: 160px !important; min-width: 160px !important; max-width: 160px !important; }
.tbl-col-time-1 { width: 200px !important; min-width: 200px !important; max-width: 200px !important; }

.border-0 { border: 0px !important; }
.b-l-0 { border-left: 0px !important; }
.b-r-0 { border-right: 0px !important; }
.b-t-0 { border-top: 0px !important; }
.b-b-0 { border-bottom: 0px !important; }


.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

.inline-block { display: inline-block; }

