/* Top Navigation */
.top-nav {
    background-color: var(--bg-white);
    padding: var(--space-sm) 24px var(--space-sm) 12px; /* top right bottom left */
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    height: 60px;
    margin-bottom: var(--sidebar-gap);
    box-shadow: var(--shadow-xs);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.platform-title-container {
    display: none; /* Hidden since platform name is now in breadcrumb */
}

.platform-title {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* COORDINATED: Breadcrumb Navigation Styles */
.breadcrumb-container {
    display: flex;
    align-items: center;
    /* Remove margin since platform title is hidden */
}

.breadcrumb-nav {
    display: flex;
    align-items: center;
    /* KISS: No gap - let separator margins control all spacing */
}

.breadcrumb-item,
.breadcrumb-link {
    display: flex;
    align-items: center;
    padding: 4px 6px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: var(--text-base);
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    text-decoration: none;
    font-family: inherit;
}

.breadcrumb-item:hover,
.breadcrumb-link:hover {
    background: var(--bg-secondary);
    color: var(--text-body);
}

.breadcrumb-item svg,
.breadcrumb-link svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.breadcrumb-separator {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    margin: 0 6px;
}

.breadcrumb-separator svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

.breadcrumb-current {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* Navigation Right */
.nav-right {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.notifications {
    position: relative;
    cursor: pointer;
    padding: var(--space-sm);
    border-radius: var(--radius-lg);
    transition: background-color 0.2s var(--ease-out);
}

.notifications:hover {
    background-color: var(--bg-secondary);
}

.notification-icon {
    color: var(--text-muted);
    transition: color 0.2s var(--ease-out);
}

.notifications:hover .notification-icon {
    color: var(--text-body);
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background-color: var(--color-error);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    line-height: 1;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: var(--text-sm);
    cursor: pointer;
    transition: transform 0.2s var(--ease-out);
}

.user-avatar:hover {
    transform: scale(1.05);
}

/* User Menu Dropdown */
.user-menu-dropdown {
    position: fixed;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 240px;
    z-index: 1000;
    animation: slideDown 0.2s var(--ease-out);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-menu-header {
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-light);
}

.user-name {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.user-email {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.user-role {
    font-size: var(--text-xs);
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-menu-divider {
    height: 1px;
    background: var(--border-light);
}

.user-menu-items {
    padding: var(--space-sm);
}

.user-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    text-align: left;
}

.user-menu-item:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.user-menu-item.danger {
    color: var(--color-error);
}

.user-menu-item.danger:hover {
    background: #fef2f2;
}

.user-menu-item svg {
    flex-shrink: 0;
}

/*
===============================
ENHANCED PROFESSIONAL SIDEBAR - COORDINATED ANIMATION VERSION
===============================
*/

.sidebar {
    width: var(--sidebar-width-expanded);
    background-color: var(--bg-white);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    transition: var(--sidebar-transition);
    border-top-right-radius: var(--radius-2xl);
    border-bottom-right-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    position: relative;
    z-index: 50;
}

.sidebar[data-state="collapsed"] {
    width: var(--sidebar-width-collapsed);
}

/* ================================
   GENERIC DETAIL VIEW CONTAINER 
   ================================ */

/* Generic detail view workspace container - reusable across all modules */
.detail-container {
    position: absolute;
    top: 0;
    left: 16px;
    right: 16px;
    bottom: 0;
    background: var(--bg-workspace);
    z-index: 100;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform var(--coordinated-duration) var(--coordinated-easing);
}

/* Detail view animation states */
.detail-container.sliding-in {
    transform: translateX(0);
    /* Uses base ease-out timing for natural settling */
}

.detail-container.sliding-out {
    transform: translateX(100%);
    /* Override with ease-in timing for natural acceleration away */
    transition: transform var(--coordinated-duration) var(--coordinated-exit-easing);
}

/* SHARED: Back button styling for all detail views */
.detail-container .back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-sm) var(--space-sm) 0;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-primary);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all 0.15s var(--ease-out);
    text-decoration: none;
    position: relative;
}

.detail-container .back-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.detail-container .back-btn:active {
    background: var(--bg-secondary);
}

.detail-container .back-arrow {
    font-size: 24px;
    font-weight: 900;
    line-height: 1;
    transition: transform 0.15s var(--ease-out);
    color: var(--text-primary);
    text-shadow: none;
}

.detail-container .back-text {
    display: none; /* Hide text for Chrome-like circular button */
}

.detail-container .back-btn:hover .back-arrow {
    transform: translateX(-1px);
    color: var(--color-primary);
}

/* Hamburger Menu as Nav Item - Uses same L1 style */
.sidebar-toggle.nav-item {
    border-bottom: 1px solid var(--border-light);
    margin-bottom: var(--space-sm);
}

/* Hide Menu text always - never show "Menu" label */
.sidebar-toggle .nav-label {
    display: none;
}

/* Hide arrow when sidebar is collapsed */
.sidebar[data-state="collapsed"] .sidebar-toggle .nav-expand-arrow {
    display: none;
}

/* Enhanced Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 0 0 var(--space-lg) 0;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Expandable Navigation Structure */
.nav-expandable {
    position: relative;
}

.nav-expand-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-left: var(--space-xs);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s var(--ease-out);
    color: var(--text-muted);
    order: 3;
}

.nav-expand-arrow:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--text-body);
}

.nav-expand-arrow svg {
    width: 14px;
    height: 14px;
    transition: transform 0.2s var(--ease-out);
}

.nav-expandable-content {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-sublist {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

/* Simplified Navigation Items - Base */
.nav-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 4px var(--space-sm) 4px 8px;
    margin: 0 var(--space-xs);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    color: var(--text-muted);
    font-weight: 500;
    font-size: var(--text-sm);
    position: relative;
    height: 32px;
    text-decoration: none;
    outline: none;
    z-index: 1;
}

/* L1: Top Level Items (Overview, Corporate, Hotels) */
.nav-item.l1 {
    padding: 6px var(--space-sm) 6px 8px;
    margin: 0 var(--space-xs) 2px var(--space-xs);
    height: 36px;
    font-weight: 600;
    font-size: var(--text-base);
    color: var(--text-secondary);
}

/* L2: All Sub-items (Corporate Departments & Hotel Departments) */
.nav-item.l2 {
    padding: 4px var(--space-sm) 4px var(--space-lg);
    margin: 0 var(--space-xs) 1px var(--space-sm);
    height: 30px;
    font-size: var(--text-sm);
}

/* Refined Hover State */
.nav-item:hover {
    background-color: rgba(0, 0, 0, 0.04);
    color: var(--text-body);
    z-index: 2;
}

/* Professional Active State */
.nav-item.active {
    background-color: rgba(22, 163, 74, 0.08);
    color: var(--color-primary);
    font-weight: 600;
    margin: 0 var(--space-sm);
    z-index: 3;
}

/* Navigation Section Headers (for role-based navigation) */
.nav-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 16px 8px 16px;
    margin-top: 12px;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-section-header:first-child {
    margin-top: 8px;
}

.nav-section-header .section-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
}

.nav-section-header .section-icon svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-muted);
}

.nav-section-header .section-title {
    flex: 1;
}

/* Collapsed sidebar - adjust section headers */
.sidebar[data-state="collapsed"] .nav-section-header {
    padding: 12px 0;
    justify-content: center;
}

.sidebar[data-state="collapsed"] .nav-section-header .section-title {
    display: none;
}

.nav-item.active .nav-icon svg {
    stroke: var(--color-primary);
}

/* Enhanced Focus States */
.nav-item:focus-visible {
    background-color: rgba(0, 0, 0, 0.04);
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
    z-index: 4;
}

/* Navigation Icon Container */
.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-right: var(--space-sm);
    flex-shrink: 0;
    pointer-events: none;
    order: 1;
}

.nav-icon svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    transition: stroke 0.2s var(--ease-out);
    pointer-events: none;
}

/* L1 items have icons that align with hamburger menu */
.nav-item.l1 .nav-icon {
    display: flex;
    width: 20px;
    height: 20px;
    margin-right: var(--space-sm);
}

.nav-item.l1 .nav-icon svg {
    width: 18px;
    height: 18px;
}

/* Navigation Label */
.nav-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: var(--text-base);
    line-height: 1.4;
    transition: all 0.3s var(--ease-out);
    pointer-events: none;
    order: 2;
}

/* Collapsed State Adjustments */
.sidebar[data-state="collapsed"] .nav-label {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* Hide expansion arrows when collapsed */
.sidebar[data-state="collapsed"] .nav-expand-arrow {
    display: none;
}

/* Hide expandable content when sidebar is collapsed */
.sidebar[data-state="collapsed"] .nav-expandable-content {
    display: none !important;
}

/* Enhanced Tooltips */
.nav-tooltip {
    position: fixed;
    left: calc(var(--sidebar-width-collapsed) + 8px);
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--text-primary);
    color: white;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.15s var(--ease-out);
    z-index: 9999;
    pointer-events: none;
    box-shadow: var(--shadow-lg);
}

.nav-tooltip::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: var(--text-primary);
}

/* Show tooltips on hover when sidebar is collapsed */
.sidebar[data-state="collapsed"] .nav-item:hover .nav-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(4px);
}

/* Enhanced Sidebar Footer */
.sidebar-footer {
    border-top: 1px solid var(--border-light);
    padding: var(--space-md) 0;
    background-color: var(--bg-white);
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 8px var(--space-md) 8px 8px;
    margin: 0 var(--space-sm);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    color: var(--text-muted);
    font-weight: 500;
    font-size: var(--text-base);
    position: relative;
    height: 44px;
    outline: none;
    z-index: 1;
}

.settings-item:hover {
    background-color: rgba(0, 0, 0, 0.04);
    color: var(--text-body);
}

.settings-item:focus-visible {
    background-color: rgba(0, 0, 0, 0.04);
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
}

.settings-item .nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-right: var(--space-md);
    flex-shrink: 0;
    pointer-events: none;
}

.settings-item .nav-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.3s var(--ease-out);
    pointer-events: none;
}

.sidebar[data-state="collapsed"] .settings-item .nav-label {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* Enhanced Buttons - Now in styles-unified.css */
/* REMOVED: Duplicate button definitions - see styles-unified.css */

/* Workspace Containers - Simplified for Department Operations */
.dashboard-content,
.services-content,
.calendar-content,
.reports-content,
.proposals-content {
    height: 100%;
    background: var(--bg-workspace);
    border-radius: var(--radius-2xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-sm);
    margin: 0;
    display: block;
}

/* Placeholder for non-initialized modules within workspace */
.dashboard-content:empty,
.services-content:empty,
.calendar-content:empty,
.reports-content:empty,
.proposals-content:empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-style: italic;
}

.dashboard-content:empty::before,
.services-content:empty::before,
.calendar-content:empty::before,
.reports-content:empty::before,
.proposals-content:empty::before {
    content: "Module ready for implementation";
}

/* Notification Container and Components */
#notification-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.notification {
    background: var(--color-info);
    color: white;
    padding: 16px 20px;
    border-radius: 12px;
    font-weight: 500;
    font-size: 14px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    max-width: 400px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: auto;
}

.notification-success {
    background: var(--color-success);
}

.notification-error {
    background: var(--color-error);
}

.notification-warning {
    background: var(--color-warning);
}

.notification-info {
    background: var(--color-info);
}

.notification button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    opacity: 0.7;
    margin-left: 12px;
    font-size: 16px;
}

/* COORDINATED: Smooth transitions for all interactive elements with consistent timing */
.nav-item,
.settings-item,
.btn-primary,
.btn-secondary {
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Hotel Dashboard Styles */
.departments-quick-access {
    margin-top: var(--space-2xl);
}

.departments-quick-access h2 {
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
    font-size: var(--text-xl);
    font-weight: 600;
}

.departments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-lg);
}

.department-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    box-shadow: var(--shadow-xs);
}

.department-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.department-card .dept-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-bottom: var(--space-md);
    color: var(--color-primary);
}

.department-card .dept-icon svg {
    width: 24px;
    height: 24px;
}

.department-card h3 {
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
    font-size: var(--text-lg);
    font-weight: 600;
}

.department-card p {
    color: var(--text-muted);
    font-size: var(--text-sm);
    margin: 0;
}

/* Responsive breadcrumb adjustments */
@media (max-width: 768px) {
    .breadcrumb-container {
        margin-left: var(--space-md);
    }
    
    .departments-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: var(--space-md);
    }
    
    .breadcrumb-current {
        max-width: 150px;
    }
    
    .nav-left {
        gap: var(--space-md);
    }
}

@media (max-width: 480px) {
    .breadcrumb-container {
        display: none; /* Hide on very small screens */
    }
}