/* ===========================================================
   GLOBAL ROOT VARIABLES
   =========================================================== */
:root {
    --primary: #6C63FF;
    --primary-light: #8B85FF;
    --primary-dark: #554FD8;

    --secondary: #63A5FF;
    --secondary-light: #85BCFF;
    --secondary-dark: #4F87D8;

    --danger: #FF6363;
    --danger-light: #FF8585;
    --danger-dark: #D84F4F;

    --success: #36D399;
    --warning: #FBBD23;
    --info: #3ABFF8;
    --error: #F87272;

    --bg-primary: #F0F2F5;
    --bg-secondary: #FFFFFF;
    --bg-sidebar: #1A2035;
    --bg-card: #FFFFFF;

    --text-primary: #2D3748;
    --text-secondary: #718096;
    --text-muted: #A0AEC0;
    --text-light: #FFFFFF;

    --border-color: #E2E8F0;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);

    --sidebar-width: 280px;
    --sidebar-mini-width: 80px;
    --header-height: 80px;
    --footer-height: 60px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 16px;
}

/* ===========================================================
   DARK THEME COLORS
   =========================================================== */
body.dark-theme {
    --bg-primary: #0F172A;
    --bg-secondary: #1E293B;
    --bg-sidebar: #0F172A;
    --bg-card: #1E293B;

    --text-primary: #F1F5F9;
    --text-secondary: #CBD5E1;
    --text-muted: #94A3B8;

    --border-color: #334155;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

/* ===========================================================
   RESET + BASE
   =========================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: var(--transition);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Remove scrollbars but allow scrolling */
body::-webkit-scrollbar {
    width: 0;
    background: transparent;
}

/* ===========================================================
   MAIN LAYOUT
   =========================================================== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.sidebar.mini ~ .main-content {
    margin-left: var(--sidebar-mini-width);
}

/* ===========================================================
   CONTENT AREA
   =========================================================== */
.content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

.content::-webkit-scrollbar {
    width: 6px;
}

.content::-webkit-scrollbar-thumb {
    background: #cfcfcf;
    border-radius: 6px;
}

.content::-webkit-scrollbar-thumb:hover {
    background: #b3b3b3;
}

/* ===========================================================
   UTILITY CLASSES
   =========================================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.flex-column { display: flex; flex-direction: column; }
.flex-wrap { display: flex; flex-wrap: wrap; }
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mt-40 { margin-top: 40px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }
.p-20 { padding: 20px; }
.p-30 { padding: 30px; }
.w-full { width: 100%; }
.h-full { height: 100%; }

/* ===========================================================
   BUTTON STYLES
   =========================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 99, 255, 0.3);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background: var(--secondary-dark);
    transform: translateY(-2px);
}

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

.btn-danger:hover {
    background: var(--danger-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 99, 99, 0.3);
}

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

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

.btn-outline-danger {
    background: transparent;
    color: var(--danger);
    border: 2px solid var(--danger);
}

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

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

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

.btn-error {
    background: var(--error);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
}

.btn-danger:focus-visible,
.btn-outline-danger:focus-visible {
    outline: 2px solid var(--danger);
    outline-offset: 2px;
}

.form-control:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ===========================================================
   FORM ELEMENTS
   =========================================================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* ===========================================================
   TABLE STYLES
   =========================================================== */
.table-container {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 32px;
}

.table-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.table-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.table-search {
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    width: 250px;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: var(--bg-primary);
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
}

.table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color) !important;
    border-right: 1px solid var(--border-color) !important;
    color: var(--text-primary);
    font-size: 14px;
}

.table tbody tr {
    transition: var(--transition);
}

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

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

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

/* Table Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-active {
    background: rgba(54, 211, 153, 0.1);
    color: var(--success);
}

.status-pending {
    background: rgba(251, 189, 35, 0.1);
    color: var(--warning);
}

.status-inactive {
    background: rgba(248, 114, 114, 0.1);
    color: var(--error);
}

.status-completed {
    background: rgba(58, 191, 248, 0.1);
    color: var(--info);
}

/* Table Actions */
.table-actions-cell {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    padding-right: 20px !important;
}

.action-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    background: var(--bg-primary);
    color: var(--primary);
}

/* Table Pagination */
.table-pagination {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
}

.pagination-info {
    color: var(--text-muted);
    font-size: 14px;
}

.pagination-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pagination-btn {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-pages {
    display: flex;
    gap: 4px;
}

.pagination-page {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
}

.pagination-page.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination-page:hover:not(.active) {
    background: var(--bg-primary);
}

/* ===========================================================
   DARK THEME TABLE FIXES (Full Support)
   =========================================================== */
body.dark-theme .table-container {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
}

body.dark-theme .table th {
    background: #162036 !important;
    color: var(--text-secondary) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

body.dark-theme .table td {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

body.dark-theme .table tbody tr:hover {
    background: #1f2a40 !important;
    transform: scale(1.002);
}

body.dark-theme .table tbody tr:last-child td {
    border-bottom: none !important;
}

body.dark-theme .action-btn {
    background: #2b3b55 !important;
    color: var(--text-secondary) !important;
}

body.dark-theme .action-btn:hover {
    background: var(--primary) !important;
    color: white !important;
}

body.dark-theme .table-header {
    background: var(--bg-card) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

body.dark-theme .table-title {
    color: var(--text-primary) !important;
}

body.dark-theme .table-search {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

body.dark-theme .table-search::placeholder {
    color: var(--text-muted) !important;
}

/* Status badges dark-mode fix */
body.dark-theme .status-badge {
    border: 1px solid rgba(255,255,255,0.08);
}

/* Modal Fix */
body.dark-theme .modal-box {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
}

/* ===========================================================
   PREMIUM TABLE UI (Full Upgrade)
   =========================================================== */

/* Smooth shadow around table */
.table-container {
    border: 1px solid var(--border-color);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
}

/* Cleaner header */
.table th {
    background: #f7f9fc; /* subtle gloss */
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

/* Subtle top inner-shadow on header row */
.table th::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--border-color);
    opacity: 0.6;
}

/* PREMIUM CELL HEIGHT + alignment */
.table td {
    vertical-align: middle;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-color) !important;
    border-right: 1px solid var(--border-color) !important;
}

/* Fix last column lining perfectly */
.table td:last-child {
    border-right: none !important;
}

/* Fix border-height alignment (main fix!) */
.table tr td:first-child {
    border-left: none !important;
}

/* Remove bottom border on last row */
.table tbody tr:last-child td {
    border-bottom: none !important;
}

/* PREMIUM HOVER EFFECT */
.table tbody tr:hover {
    background: #f5f7fb;
    transform: scale(1.002);
}

/* First row top-left & top-right rounded */
.table tr:first-child th:first-child { border-top-left-radius: 12px; }
.table tr:first-child th:last-child { border-top-right-radius: 12px; }

/* Last row rounded */
.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; }

/* PREMIUM ACTION BUTTON FIX */
.table-actions-cell {
    padding-right: 12px !important;
}

.action-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #f1f3f9;
}

.action-btn:hover {
    background: var(--primary);
    color: #fff;
}

/* PERFECT BORDER SEPARATION FIX */
.table {
    border-spacing: 0;
    border-collapse: separate;  /* IMPORTANT: fixes all alignment issues */
    margin-top: -1px; /* aligns header & rows in same line */
}

/* ===========================================================
   TOGGLE SWITCH
   =========================================================== */
.toggle-switch {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-switch input {
    display:none;
}

.slider {
    width: 46px;
    height: 24px;
    background: #ccc;
    border-radius: 50px;
    position: relative;
    cursor: pointer;
    transition: .3s;
}

.slider:before {
    content:"";
    width: 20px;
    height: 20px;
    background:white;
    border-radius:50%;
    position:absolute;
    top:2px;
    left:2px;
    transition:.3s;
}

input:checked + .slider {
    background: #36D399;
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.switch-label {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ===========================================================
   SIDEBAR MAIN
   =========================================================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    transition: var(--transition);
    z-index: 100;
    overflow-y: auto;
    padding-bottom: var(--footer-height);
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
}

/* Sidebar Mini Mode */
.sidebar.mini {
    width: var(--sidebar-mini-width);
}

.sidebar.mini .menu-text,
.sidebar.mini .submenu-toggle {
    display: none;
}

/* ===========================================================
   SIDEBAR HEADER
   =========================================================== */
.sidebar-header {
    padding: 28px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 28px;
    color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-text {
    font-weight: 700;
    font-size: 32px;
    color: var(--text-light);
}

.sidebar.mini .logo-text {
    display: none;
}

/* Toggle Button */
.toggle-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.sidebar.mini .toggle-btn {
    transform: rotate(180deg);
}

/* ===========================================================
   SIDEBAR MENU LIST
   =========================================================== */
.sidebar-menu {
    padding: 24px 0;
    flex: 1;
}

/* Menu Item */
.menu-item {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    margin: 4px 12px;
    border-radius: 12px;
    cursor: pointer;
}

.menu-item i {
    font-size: 20px;
    width: 24px;
    margin-right: 16px;
}

.menu-text {
    font-weight: 500;
    font-size: 15px;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    transform: translateX(5px);
}

.menu-item.active {
    background: var(--primary);
    color: var(--text-light);
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.3);
}

/* ===========================
   MULTI-LEVEL SUBMENU (FULL WIDTH)
=========================== */

.submenu {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease;
    
    background: rgba(255, 255, 255, 0.06);
    border-radius: 12px;

    /* FULL WIDTH under the sidebar */
    margin: 4px 12px;
    padding: 8px 12px;
}

/* Open state */
.submenu.open {
    max-height: 800px;
    opacity: 1;
    visibility: visible;
}

.submenu-item {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    border-radius: 10px;
    text-decoration: none;
    transition: var(--transition);
}

.submenu-item:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-light);
}

/* Submenu Toggle Arrow */
.submenu-toggle {
    font-size: 14px;
    transition: var(--transition);
}

.menu-item.open .submenu-toggle {
    transform: rotate(90deg);
}

/* ============================================
   ACTIVE SUBMENU ITEM (Muted Premium Style)
============================================ */
.submenu-item.active {
    background: rgba(255, 255, 255, 0.15) !important;
    color: var(--primary-light) !important;
    font-weight: 600;
    border-radius: 10px;
}

.submenu-item.active .submenu-icon {
    color: var(--primary) !important;
}

/* Bottom Collapse Button */
.sidebar-collapse-btn {
    margin-top: auto;
    padding: 20px;
    display: flex;
    justify-content: flex-end; /* move button to right */
}

.sidebar-collapse-btn .toggle-btn {
    width: 46px;
    height: 46px;
    background: rgba(255,255,255,0.12);
    border-radius: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
}

/* Button hover */
.sidebar-collapse-btn .toggle-btn:hover {
    background: rgba(255,255,255,0.18);
    transform: scale(1.05);
}

.sidebar-collapse-btn .toggle-btn:hover {
    background: rgba(255,255,255,0.18);
    transform: scale(1.05);
}

/* Mini Mode rotate the icon */
.sidebar.mini .sidebar-collapse-btn .toggle-btn i {
    transform: rotate(180deg);
    transition: var(--transition);
}


/* ===========================
   SUBMENU ICONS
=========================== */
.submenu-icon {
    font-size: 14px;
    width: 20px;
    display: inline-block;
    color: var(--primary-light);
    margin-right: 12px;
    transition: var(--transition);
}

.submenu-item:hover .submenu-icon {
    color: var(--primary);
}

/* Mini mode hides arrows */
.sidebar.mini .submenu-toggle {
    display: none;
}

/* Submenu spacing ONLY expands when open */
.submenu.open .submenu-item {
    margin-top: 2px;
    margin-bottom: 2px;
}

.submenu-item {
    padding: 12px 16px !important;
}

/* ============================================
   FIX: PERFECT UNIFORM MENU SPACING
   ============================================ */

.menu-item,
.menu-item.has-submenu {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;

    padding: 14px 20px !important;
    height: 52px !important;
    line-height: 1 !important;

    margin: 4px 12px !important;
    border-radius: 12px !important;
}

/* Force same icon width everywhere */
.menu-item i,
.menu-item.has-submenu i {
    width: 24px !important;
    min-width: 24px !important;
    text-align: center !important;
}

/* Ensures arrow alignment */
.submenu-toggle {
    margin-left: auto !important;
}

/* Rotate arrow when submenu is ACTIVE (PHP state) */
.menu-item.has-submenu.active .submenu-toggle {
    transform: rotate(90deg);
}

/* =======================
   MODAL STYLES
======================= */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.55);
    z-index: 300;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease;
}

.modal-box {
    width: 450px;
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
    animation: slideDown 0.25s ease;
}

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

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
}

.close-btn {
    background: var(--primary);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 26px;
    cursor: pointer;
    color: var(--text-secondary);
}

.close-btn:hover {
    color: var(--text-light);
}

@keyframes slideDown {
    from { transform: translateY(-20px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* ===========================================================
   HEADER BAR
   =========================================================== */
.header {
    height: var(--header-height);
    background-color: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 99;
}

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

.header-left h1 {
    font-size: 28px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.header-actions {
    display: flex;
    gap: 12px;
}

/* ===========================================================
   THEME TOGGLE BUTTON
   =========================================================== */
.theme-toggle {
    background: var(--bg-primary);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 20px;
}

.theme-toggle:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* ===========================================================
   USER PROFILE DROPDOWN
   =========================================================== */
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    position: relative;
    padding: 8px 16px;
    border-radius: 12px;
    transition: var(--transition);
}

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

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.3);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 16px;
}

.user-role {
    font-size: 13px;
    color: var(--text-muted);
}

/* Dropdown Box */
.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 240px;
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 16px 0;
    margin-top: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 101;
    border: 1px solid var(--border-color);
}

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

.dropdown-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 8px;
}

.dropdown-header .user-name {
    font-size: 17px;
    margin-bottom: 4px;
}

.dropdown-header .user-email {
    font-size: 14px;
    color: var(--text-muted);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

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

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

/* ===========================================================
   MOBILE MENU BUTTON
   =========================================================== */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
}

/* ===========================================================
   WELCOME BANNER
   =========================================================== */
.welcome-banner {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--border-radius);
    padding: 32px;
    color: white;
    margin-bottom: 32px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.welcome-text h2 {
    font-size: 28px;
    margin-bottom: 8px;
}

.welcome-text p {
    opacity: 0.9;
    font-size: 16px;
}

/* ===========================================================
   STATISTIC CARDS
   =========================================================== */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

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

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.users {
    background: linear-gradient(135deg, #6C63FF, #8B85FF);
    color: white;
}

.stat-icon.courses {
    background: linear-gradient(135deg, #36D399, #4ADE80);
    color: white;
}

.stat-icon.applications {
    background: linear-gradient(135deg, #FBBD23, #FBBF24);
    color: white;
}

.stat-icon.revenue {
    background: linear-gradient(135deg, #FF6584, #F87272);
    color: white;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 12px;
}

.stat-change {
    display: flex;
    align-items: center;
    font-size: 14px;
    margin-top: auto;
}

.stat-change.positive {
    color: #36D399;
}

.stat-change.negative {
    color: #F87272;
}

/* ===========================================================
   DASHBOARD GRID + CHART CARDS
   =========================================================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.chart-card {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-title {
    font-size: 20px;
    font-weight: 600;
}

.card-actions {
    display: flex;
    gap: 10px;
}

.card-action {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 18px;
    transition: var(--transition);
}

.card-action:hover {
    color: var(--primary);
}

.chart-placeholder {
    height: 300px;
    background: var(--bg-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 16px;
}

/* ===========================================================
   RECENT ACTIVITIES
   =========================================================== */
.recent-activities {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.activity-icon.user {
    background: linear-gradient(135deg, #6C63FF, #8B85FF);
    color: white;
}

.activity-icon.course {
    background: linear-gradient(135deg, #36D399, #4ADE80);
    color: white;
}

.activity-icon.application {
    background: linear-gradient(135deg, #FBBD23, #FBBF24);
    color: white;
}

.activity-details {
    flex: 1;
}

.activity-title {
    font-weight: 500;
    margin-bottom: 4px;
    font-size: 15px;
}

.activity-time {
    font-size: 13px;
    color: var(--text-muted);
}

/* Perfect empty-state box styling */
.text-muted.mt-20 {
    display: block;
    background: var(--bg-card);
    padding: 18px 20px;
    margin: 15px;
    border-radius: 12px;
    text-align: center;
    color: var(--text-muted) !important;
    font-size: 14px;
    border: 1px dashed var(--border-color);
    opacity: 0.9;
}

/* ===========================================================
   FOOTER
   =========================================================== */
.footer {
    height: var(--footer-height);
    background-color: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.footer p {
    color: var(--text-secondary);
    font-size: 14px;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.footer a:hover {
    text-decoration: underline;
}

/* Force-hide elements */
.hidden {
    display: none !important;
}

/* Fix guide modal alignment */
.alert-box ul {
    list-style: disc;
    margin-left: 24px;
    padding-left: 0;
}

.activity-list.full-width .activity-item {
    padding-left: 0 !important;
    margin-left: 0 !important;
}

/* 🔥 FINAL GRID FIX — FORCE CENTER FOR ALL STEPS */
.grid-box {
    display: flex !important;
    justify-content: center !important;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 30px;
    width: 100%;
    padding: 20px 0;
}

/* Equal fixed card width */
.option-card {
    width: 240px !important;
}

/* Make all option cards uniform */
.option-card {
    width: 240px;                   /* fixed width for perfect row alignment */
    background: var(--bg-card);
    border-radius: 14px;
    padding: 24px 20px;
    text-align: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: 0.25s ease;
    animation: fadeIn .4s ease;
}

.option-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 28px rgba(0,0,0,.12);
}

.option-card i {
    font-size: 32px;
    margin-bottom: 12px;
    color: var(--primary);
}

.option-card.selected-card {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(108,99,255,.08), rgba(67, 58, 255, 0.08));
    transform: translateY(-4px);
}

/* Make wizard buttons stay at bottom inside card */
.wizard-actions-fixed {
    margin-top: auto;
    padding-top: 25px;
    display: flex;
    justify-content: space-between;
}

/* Make wizard main card a flex vertical box */
.chart-card {
    display: flex;
    flex-direction: column;
}

/* Next/Back Buttons wider + premium */
.wizard-btn {
    min-width: 140px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* ===========================================================
   OVERLAY (MOBILE SIDEBAR)
   =========================================================== */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 90;
    display: none;
}

.overlay.active {
    display: block;
}

/* ===========================================================
   RESPONSIVE DESIGN
   =========================================================== */

/* Large Tablets */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablets & Small Laptops */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
        z-index: 200;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

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

    .mobile-menu-btn {
        display: block;
    }
    
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile */
@media (max-width: 768px) {
    .stats-container {
        grid-template-columns: 1fr;
    }

    .header {
        padding: 0 20px;
    }

    .content {
        padding: 20px;
    }

    .user-info {
        display: none;
    }

    .welcome-banner {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .table-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .table-search {
        width: 100%;
    }
    
    .table-pagination {
        flex-direction: column;
        gap: 16px;
        align-items: center;
    }
}

/* ===========================================================
   MINI SIDEBAR BEHAVIOR
   =========================================================== */
.sidebar.mini .menu-item {
    padding: 16px 18px;
    justify-content: center;
}

.sidebar.mini .menu-item i {
    margin: 0;
}

.sidebar.mini .submenu {
    display: none !important;
}

/* ===========================================================
   DARK THEME SPECIAL FIXES
   =========================================================== */
body.dark-theme .welcome-banner {
    background: linear-gradient(135deg, #4c46c7, #322fb1);
}

body.dark-theme .chart-placeholder {
    background: #1e2538;
}

body.dark-theme .stat-card:hover {
    box-shadow: 0 10px 25px rgba(255, 255, 255, 0.05);
}

body.dark-theme .menu-item:hover {
    background: rgba(255, 255, 255, 0.12);
}

body.dark-theme .table-search {
    background: var(--bg-primary);
    color: var(--text-primary);
}

body.dark-theme .table-search::placeholder {
    color: var(--text-muted);
}

/* ===========================================================
   ANIMATION EFFECTS
   =========================================================== */
.menu-item,
.submenu-item {
    transition: var(--transition);
}

.welcome-banner,
.stat-card,
.chart-card,
.filter-card,
.table-container,
.recent-activities {
    animation: fadeIn 0.5s ease forwards;
    opacity: 0;
}

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

/* Smooth hover scaling */
.menu-item:hover {
    transform: translateX(5px);
}

/* ===========================================================
   END OF FILE
   =========================================================== */