:root {
    --primary-color: #0c92c4;
    --secondary-color: #f8f9fa;
    --accent-color: #2c3e50;
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --white: #ffffff;
    --light-gray: #f5f6fa;
    --border-color: #e9ecef;
    --hover-color: #0a7ca0;
    --sidebar-width: 280px;
    --header-height: 70px;
    --border-radius: 8px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--light-gray);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Header Styles */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 1.5rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.mobile-toggle:hover {
    background-color: var(--secondary-color);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo i {
    font-size: 1.8rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    background: var(--secondary-color);
    width: 300px;
    transition: all 0.3s ease;
    border-radius: var(--border-radius);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(12, 146, 196, 0.1);
    width: 350px;
}

.search-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-btn {
    width: 36px;
    height: 36px;
    border: 2px solid var(--border-color);
    background: var(--white);
    border-radius: var(--border-radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: var(--text-secondary);
}

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

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

.notification-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 8px;
    height: 8px;
    background-color: #dc3545;
    border-radius: 50%;
}

/* Dropdown Styles */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 350px;
    max-width: 90vw;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    max-height: 80vh;
    overflow: hidden;
}

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

/* Adjust dropdown position to prevent cutoff */
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-right: none;
    transform: rotate(45deg);
    z-index: -1;
}

.dropdown-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.dropdown-title {
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.dropdown-count {
    background: var(--primary-color);
    color: var(--white);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.dropdown-body {
    max-height: 350px;
    overflow-y: auto;
}

.dropdown-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

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

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

.notification-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.notification-icon.success {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.notification-icon.warning {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.notification-icon.info {
    background: rgba(12, 146, 196, 0.1);
    color: var(--primary-color);
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.notification-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.message-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--hover-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.message-content {
    flex: 1;
    min-width: 0;
}

.message-sender {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.message-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.message-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.dropdown-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    flex-shrink: 0;
}

.dropdown-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

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

/* User Profile Dropdown */
.user-dropdown {
    width: 280px;
    max-width: 85vw;
}

.user-dropdown::before {
    right: 30px;
}

.user-profile-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--hover-color));
    color: var(--white);
    border-radius: 12px 12px 0 0;
    flex-shrink: 0;
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.profile-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
}

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

.profile-details h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
}

.profile-details p {
    margin: 0;
    font-size: 0.8rem;
    opacity: 0.9;
    word-wrap: break-word;
}

.profile-menu-item {
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.profile-menu-item:hover {
    background-color: var(--secondary-color);
    color: var(--text-primary);
}

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

.profile-menu-item i {
    width: 20px;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.profile-menu-item span {
    flex: 1;
    min-width: 0;
}

/* Custom scrollbar for dropdown body */
.dropdown-body::-webkit-scrollbar {
    width: 6px;
}

.dropdown-body::-webkit-scrollbar-track {
    background: var(--secondary-color);
}

.dropdown-body::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.dropdown-body::-webkit-scrollbar-thumb:hover {
    background: var(--hover-color);
}

/* Mobile responsive dropdowns */
@media (max-width: 768px) {
    .dropdown-menu {
        width: 320px;
        max-width: 95vw;
        right: -20px;
        left: auto;
        transform-origin: top right;
    }

    .user-dropdown {
        width: 260px;
        max-width: 90vw;
        right: -10px;
    }

    .dropdown-menu::before {
        right: 30px;
    }

    .user-dropdown::before {
        right: 20px;
    }

    .dropdown-item {
        padding: 0.75rem 1rem;
    }

    .profile-menu-item {
        padding: 0.75rem 1rem;
    }

    .dropdown-header {
        padding: 0.75rem 1rem;
    }

    .dropdown-footer {
        padding: 0.75rem 1rem;
    }

    .user-profile-header {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .dropdown-menu {
        width: 300px;
        max-width: 98vw;
        right: -40px;
        max-height: 70vh;
    }

    .user-dropdown {
        width: 240px;
        max-width: 95vw;
        right: -20px;
    }

    .dropdown-body {
        max-height: 250px;
    }

    .notification-text,
    .message-text {
        font-size: 0.75rem;
    }

    .notification-title,
    .message-sender {
        font-size: 0.85rem;
    }
}

/* Ensure dropdowns don't get cut off by viewport */
@media (max-height: 600px) {
    .dropdown-menu {
        max-height: 60vh;
    }

    .dropdown-body {
        max-height: 200px;
    }
}

/* Handle very wide screens */
@media (min-width: 1200px) {
    .dropdown-menu {
        width: 380px;
    }

    .user-dropdown {
        width: 300px;
    }
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

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

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

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: var(--white);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    transition: all 0.3s ease;
    z-index: 999;
}

.sidebar-content {
    padding: 1.5rem 0;
}

.menu-section {
    margin-bottom: 2rem;
}

.menu-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 1.5rem;
    margin-bottom: 1rem;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.menu-item:hover {
    background-color: var(--secondary-color);
    color: var(--primary-color);
}

.menu-item.active {
    background-color: rgba(12, 146, 196, 0.1);
    color: var(--primary-color);
    border-right: 3px solid var(--primary-color);
}

.menu-item i {
    width: 20px;
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

.menu-item .badge {
    margin-left: auto;
    background-color: var(--primary-color);
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 2rem;
    min-height: calc(100vh - var(--header-height));
    transition: all 0.3s ease;
}

.content-header {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mobile-toggle {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
        z-index: 1001;
    }

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

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    .search-input {
        width: 200px;
    }

    .search-input:focus {
        width: 220px;
    }

    .user-info {
        display: none;
    }

    .header-content {
        padding: 0 1rem;
    }

    .content-header {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .search-box {
        display: none;
    }

    .header-actions {
        gap: 0.25rem;
    }

    .action-btn {
        padding: 0.5rem;
    }

    .main-content {
        padding: 0.75rem;
    }

    .page-title {
        font-size: 1.25rem;
    }

    /* App-like styling for mobile */
    .header {
        border-radius: 0;
    }

    .content-header {
        border-radius: 8px;
        margin-bottom: 1rem;
    }
}

/* Overlay for mobile */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Subtle animations */
.menu-item {
    position: relative;
    overflow: hidden;
}

.menu-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(12, 146, 196, 0.1), transparent);
    transition: width 0.3s ease;
}

.menu-item:hover::before {
    width: 100%;
}

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

.sidebar::-webkit-scrollbar-track {
    background: var(--secondary-color);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--hover-color);
}