/* Layout Styles */

/* Top Navigation */
.topnav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 100;
}

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

.sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

.sidebar-toggle:hover {
    color: var(--primary-color);
}

.topnav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--primary-color);
}

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

.topnav-item {
    position: relative;
}

.topnav-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    position: relative;
}

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

.badge-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background-color: var(--danger-color);
    border-radius: 50%;
    border: 2px solid white;
}

.topnav-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-md);
    transition: background-color 0.2s;
}

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

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

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

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    display: none;
    z-index: 1000;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu-right {
    right: 0;
    left: auto;
}

.dropdown-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-body {
    padding: 0.5rem 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: background-color 0.2s;
}

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

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

/* Notification Item */
.notification-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

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

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

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
}

.notification-content p {
    margin: 0;
    font-size: 0.8125rem;
}

/* Sidebar Navigation */
.sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    width: 260px;
    background-color: #1e40af;
    border-right: 1px solid var(--border-color);
    z-index: 90;
    transition: transform 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar.hidden {
    transform: translateX(-100%);
}

/* Mobile overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 89;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .topnav-user .user-name {
        display: none;
    }
}

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

.sidebar-nav {
    display: flex;
    flex-direction: column;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    color: #ffffff;
    background-color: #1e40af;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background-color: #1e3a8a;
    color: #ffffff;
}

.sidebar-link.active {
    background-color: #1d4ed8;
    color: #ffffff;
    border-left-color: #93c5fd;
    font-weight: 500;
}

/* Main Content */
.main-content {
    margin-top: 60px;
    margin-left: 260px;
    padding: 2rem;
    min-height: calc(100vh - 60px);
    transition: margin-left 0.3s ease;
}

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

/* Page Header */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.page-header-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 80px;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background-color: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 1rem 1.25rem;
    min-width: 300px;
    max-width: 400px;
    border-left: 4px solid;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    animation: slideIn 0.3s ease;
}

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

.toast.success {
    border-left-color: var(--success-color);
}

.toast.error {
    border-left-color: var(--danger-color);
}

.toast.warning {
    border-left-color: var(--warning-color);
}

.toast.info {
    border-left-color: var(--info-color);
}

.toast-icon {
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

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

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    line-height: 1;
}

.toast-close:hover {
    color: var(--text-primary);
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .user-name {
        display: none;
    }
}

@media (max-width: 640px) {
    .topnav {
        padding: 0 1rem;
    }
    
    .topnav-brand span {
        display: none;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .main-content {
        padding: 1rem;
    }
}