/* Global app styles: variables, navbar, sidebar, footer, and scrollbar hiding */
:root {
    --primary-color: #4a90e2;
    --secondary-color: #7bb7ff;
    --accent-color: #d9eaff;
    --dark-color: #1b4f9c;
    --light-color: #eaf3ff;
    --bg-color: #f8f9fa;
    --card-color: #ffffff;
    --text-color: #333;
    --text-muted: #666;
    --border-color: #e0e0e0;
    --sidebar-width: 260px;
    --footer-height: 60px;
    --topbar-height: 70px;
    --transition: all 0.3s ease;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

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

/* Hide native scrollbars but keep scrolling functional */
html,
body {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.table-wrapper {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.table-wrapper::-webkit-scrollbar {
    height: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
}

/* Top navbar */
.top-navbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background: linear-gradient(to right, var(--primary-color), var(--dark-color));
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    z-index: 1000;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

body.sidebar-collapsed .top-navbar {
    left: 80px;
}

.top-nav-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.sidebar-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

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

.logo-small img {
    height: 35px;
    border-radius: 5px;
}

.logo-text {
    font-weight: 600;
    font-size: 18px;
    color: white;
}

.top-nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.navbar-icon-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.navbar-icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #4a90e2;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
}

/* Navbar Profile Dropdown Styling */
.top-navbar .custom-dropdown {
    position: relative;
    background: transparent !important;
}

.top-navbar .dropdown-btn {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 0 !important;
    cursor: pointer !important;
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    color: white !important;
    transition: var(--transition);
    font-size: 14px;
}

.top-navbar .dropdown-btn:hover {
    background: none !important;
    opacity: 0.8;
}

.top-navbar .dropdown-content {
    right: 0 !important;
    left: auto !important;
    width: 150px !important;
}

/* General Dropdown Styling (for pages) */
.custom-dropdown {
    position: relative;
}

.dropdown-content {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 160px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 8px;
    display: none;
    flex-direction: column;
    z-index: 1100;
    border: 1px solid var(--border-color);
}

.dropdown-content.show {
    display: flex;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition);
    font-size: 14px;
}

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

.dropdown-item i {
    font-size: 16px;
    color: var(--primary-color);
    width: 20px;
    text-align: center;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
}

.user-name {
    color: white;
    font-size: 13px;
    font-weight: 500;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--card-color);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    transition: var(--transition);
    overflow-y: auto;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.sidebar-logo {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
    border: 3px solid var(--accent-color);
}

.sidebar-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-title {
    font-weight: 700;
    font-size: 16px;
    color: var(--dark-color);
    margin-bottom: 5px;
}

.sidebar-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.3;
}

.sidebar-menu {
    padding: 20px 0;
    flex: 1;
}

.menu-section {
    margin-bottom: 25px;
}

.menu-title {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0 20px;
    margin-bottom: 10px;
    font-weight: 600;
}

.menu-items {
    list-style: none;
}

.menu-item {
    margin-bottom: 5px;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    min-height: 44px;
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
    cursor: pointer;
}

.menu-link:hover {
    background-color: rgba(74, 144, 226, 0.05);
    color: var(--dark-color);
    border-left-color: var(--accent-color);
}

.menu-item.active .menu-link {
    background-color: rgba(74, 144, 226, 0.12);
    color: var(--dark-color);
    border-left-color: var(--primary-color);
    font-weight: 600;
}

.menu-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 16px;
    color: var(--primary-color);
    flex-shrink: 0;
}

.menu-text {
    font-size: 14px;
}

.sidebar-profile {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
}

.sidebar-profile-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    font-size: 14px;
    flex-shrink: 0;
}

.sidebar-profile-info {
    flex: 1;
    min-width: 0;
}

.sidebar-profile-name {
    font-weight: 700;
    font-size: 13px;
    color: var(--dark-color);
}

.sidebar-profile-email {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* collapsed sidebar adjustments */
body.sidebar-collapsed .sidebar {
    width: 80px;
    transform: translateX(0);
}

body.sidebar-collapsed .sidebar-header {
    padding: 20px 0;
    align-items: center;
}

body.sidebar-collapsed .sidebar-logo {
    width: 40px;
    height: 40px;
    margin: 0 auto 10px;
    border-width: 0;
}

body.sidebar-collapsed .sidebar-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body.sidebar-collapsed .sidebar-title,
body.sidebar-collapsed .sidebar-subtitle,
body.sidebar-collapsed .menu-title,
body.sidebar-collapsed .sidebar-profile-info {
    display: none;
}

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

body.sidebar-collapsed .menu-link .menu-icon {
    margin-right: 0;
    width: 36px;
    height: 36px;
    font-size: 16px;
}

body.sidebar-collapsed .menu-text {
    display: none;
}

body.sidebar-collapsed .sidebar-profile {
    justify-content: center;
    padding: 15px 0;
}

/* Footer */
.footer {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--footer-height);
    background: var(--card-color);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.03);
    transition: var(--transition);
    z-index: 999;
}

body.sidebar-collapsed .footer {
    left: 80px;
}

@media (max-width: 992px) {
    .footer {
        left: 0;
    }
}

.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    padding: 30px;
    padding-bottom: calc(var(--footer-height) + 30px);
    min-height: calc(100vh - var(--topbar-height) - var(--footer-height));
    transition: var(--transition);
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

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

    .top-navbar {
        left: 0;
    }
}

/* keep this file limited to layout/global rules only */
