/* Dashboard Layout and Structure */

/* Dashboard Container */
.dashboard-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background-color: var(--bg-secondary);
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #6B4226 0%, #8B6858 100%);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-base);
    box-shadow: 0 0 30px rgba(107, 66, 38, 0.2);
    z-index: var(--z-sticky);
    border-right: 2px solid #D4A574;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: calc(var(--z-modal) - 1);
    transition: opacity 0.3s ease;
}

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

.sidebar.collapsed {
    width: 80px;
}

.sidebar-header {
    padding: var(--space-lg);
    background: rgba(192, 57, 43, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    border-bottom: 2px solid rgba(107, 66, 38, 0.3);
}

.sidebar.collapsed .sidebar-header {
    padding: var(--space-lg) var(--space-md);
    justify-content: center;
}

.walmart-spark {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.walmart-wordmark {
    height: 24px;
    transition: opacity var(--transition-base);
}

.sidebar.collapsed .walmart-wordmark {
    display: none;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md) 0;
}

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

.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
}

.nav-section {
    margin-bottom: var(--space-xl);
}

.nav-section-title {
    color: rgba(255, 255, 255, 0.5);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0 var(--space-lg);
    margin-bottom: var(--space-sm);
    transition: opacity var(--transition-base);
}

.sidebar.collapsed .nav-section-title {
    opacity: 0;
    height: 0;
    margin: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all var(--transition-fast);
    position: relative;
    gap: var(--space-md);
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: var(--space-md);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--walmart-yellow);
}

.nav-item.emergency {
    color: #ff6b6b;
}

.nav-item.emergency:hover {
    background: rgba(255, 107, 107, 0.2);
}

.nav-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    fill: currentColor;
}

.nav-text {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    white-space: nowrap;
    transition: opacity var(--transition-base);
}

.sidebar.collapsed .nav-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.nav-badge {
    margin-left: auto;
    background: var(--danger-red);
    color: white;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    min-width: 20px;
    text-align: center;
    transition: opacity var(--transition-base);
}

.nav-badge.success {
    background: var(--success-green);
}

.nav-badge.warning {
    background: var(--warning-yellow);
    color: var(--text-primary);
}

.nav-badge.info {
    background: var(--walmart-spark-blue);
    color: white;
}

.sidebar.collapsed .nav-badge {
    opacity: 0;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: var(--space-md);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-toggle {
    width: 100%;
    padding: var(--space-sm);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.sidebar-toggle svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Top Bar */
.topbar {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    padding: var(--space-md) var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    z-index: var(--z-sticky);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    flex: 1;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: var(--font-size-xl);
    cursor: pointer;
    color: var(--text-primary);
    padding: var(--space-xs);
}

.menu-toggle svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* Search Bar */
.search-bar {
    position: relative;
    width: 100%;
    max-width: 500px;
}

.search-input {
    width: 100%;
    padding: var(--space-sm) var(--space-md) var(--space-sm) 44px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--walmart-blue);
    box-shadow: 0 0 0 3px rgba(0, 113, 206, 0.1);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    fill: var(--text-secondary);
}

/* Top Bar Right */
.topbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.topbar-btn {
    position: relative;
    background: none;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-primary);
}

.topbar-btn:hover {
    border-color: var(--walmart-blue);
    background: rgba(0, 113, 206, 0.05);
}

.topbar-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.notification-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--danger-red);
    border-radius: var(--radius-full);
    border: 2px solid white;
}

/* User Menu */
.user-menu {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.user-menu:hover {
    border-color: var(--walmart-blue);
    background: rgba(0, 113, 206, 0.05);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--walmart-blue);
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-sm);
}

.user-info {
    text-align: left;
}

.user-name {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

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

.dropdown-arrow {
    width: 16px;
    height: 16px;
    fill: var(--text-secondary);
}

/* Content Area */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
    background: var(--bg-secondary);
}

/* Module Container */
.module {
    display: none;
    animation: fadeIn var(--transition-base);
}

.module.active {
    display: block;
}

/* Dashboard Header */
.dashboard-header {
    margin-bottom: var(--space-xl);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.dashboard-title {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.dashboard-subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    gap: var(--space-md);
}

/* Alert Banner */
.alert-banner {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border-left: 4px solid var(--warning-yellow);
    padding: var(--space-md) var(--space-lg);
    margin-bottom: var(--space-xl);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    position: relative;
}

.alert-banner.warning {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border-color: var(--warning-yellow);
}

.alert-banner.danger {
    background: linear-gradient(135deg, #f8d7da, #ffcccb);
    border-color: var(--danger-red);
}

.alert-icon {
    font-size: var(--font-size-2xl);
    width: 24px;
    height: 24px;
    fill: #856404;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: var(--font-weight-semibold);
    color: #856404;
    margin-bottom: var(--space-xs);
}

.alert-text {
    font-size: var(--font-size-sm);
    color: #664d03;
}

.alert-action {
    padding: var(--space-sm) var(--space-md);
    background: white;
    border: 2px solid #856404;
    border-radius: var(--radius-md);
    color: #856404;
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    font-size: var(--font-size-sm);
}

.alert-action:hover {
    background: #856404;
    color: white;
}

.alert-dismiss {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    background: none;
    border: none;
    font-size: var(--font-size-xl);
    color: #856404;
    cursor: pointer;
    padding: var(--space-xs);
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.metric-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid;
    transition: all var(--transition-fast);
}

.metric-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.metric-card.primary { border-color: var(--walmart-blue); }
.metric-card.success { border-color: var(--success-green); }
.metric-card.warning { border-color: var(--warning-yellow); }
.metric-card.info { border-color: var(--info-blue); }

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.metric-title {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: var(--font-weight-medium);
}

.metric-trend {
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    display: flex;
    align-items: center;
    gap: 2px;
}

.metric-trend.up {
    background: #d4edda;
    color: #155724;
}

.metric-trend.down {
    background: #f8d7da;
    color: #721c24;
}

.metric-value {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: var(--space-sm);
}

.metric-subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.metric-badge {
    background: var(--walmart-blue);
    color: white;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
}

/* Progress Bar */
.progress-bar {
    height: 8px;
    background: var(--border-light);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-top: var(--space-sm);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--walmart-blue), var(--walmart-light-blue));
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

/* Staff Indicators */
.metric-staff {
    display: flex;
    gap: var(--space-xs);
    margin-top: var(--space-sm);
}

.staff-indicator {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: white;
}

.staff-indicator.active {
    background: var(--success-green);
}

.staff-indicator.break {
    background: var(--warning-yellow);
    color: var(--text-primary);
}

.staff-indicator.offline {
    background: var(--walmart-gray-500);
}

/* Timeline */
.metric-timeline {
    display: flex;
    gap: var(--space-xs);
    margin-top: var(--space-sm);
}

.timeline-item {
    flex: 1;
    height: 4px;
    background: var(--border-light);
    border-radius: var(--radius-full);
}

.timeline-item.completed {
    background: var(--success-green);
}

.timeline-item.active {
    background: var(--walmart-blue);
    animation: pulse 2s infinite;
}

/* Quick Actions */
.quick-actions {
    margin-bottom: var(--space-xl);
}

.section-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
}

.action-card {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.action-card:hover {
    border-color: var(--walmart-blue);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.action-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-icon svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.action-icon.vaccine { background: linear-gradient(135deg, #4CAF50, #8BC34A); }
.action-icon.inventory { background: linear-gradient(135deg, #2196F3, #03A9F4); }
.action-icon.schedule { background: linear-gradient(135deg, #9C27B0, #E91E63); }
.action-icon.report { background: linear-gradient(135deg, #FF9800, #FFC107); }

.action-text {
    flex: 1;
}

.action-title {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-bottom: 2px;
}

.action-subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-xl);
}

.dashboard-left,
.dashboard-right {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

/* Responsive Design - Mobile First Approach */

/* Extra Large Screens (1400px and up) */
@media (min-width: 1400px) {
    .metrics-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .actions-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Large Screens (1024px to 1399px) */
@media (max-width: 1399px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablets (768px to 1023px) */
@media (max-width: 1023px) {
    .sidebar {
        position: fixed;
        left: -280px;
        height: 100%;
        z-index: var(--z-modal);
        transition: left 0.3s ease;
    }
    
    .sidebar.active {
        left: 0;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: calc(var(--z-modal) - 1);
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: transparent;
        border: none;
        cursor: pointer;
        color: var(--text-primary);
    }
    
    .topbar {
        padding: var(--space-md) var(--space-lg);
    }
    
    .search-bar {
        max-width: 400px;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
    }
    
    .header-actions {
        width: 100%;
    }
    
    .header-actions {
        display: flex;
        justify-content: center;
    }
    
    .header-actions .btn {
        max-width: 200px;
        padding: var(--space-sm) var(--space-md);
    }
    
    .header-actions .btn svg {
        width: 20px !important;
        height: 20px !important;
        margin-right: var(--space-xs);
    }
}

/* Mobile Devices (480px to 767px) */
@media (max-width: 767px) {
    .topbar {
        padding: var(--space-sm) var(--space-md);
        flex-wrap: wrap;
    }
    
    .topbar-left {
        width: 100%;
        margin-bottom: var(--space-sm);
    }
    
    .topbar-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .search-bar {
        width: calc(100% - 50px);
        max-width: none;
    }
    
    .user-info {
        display: none;
    }
    
    .user-menu {
        padding: var(--space-sm);
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
    
    .metric-card {
        min-height: 120px;
    }
    
    .actions-grid {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }
    
    .action-card {
        padding: var(--space-md);
    }
    
    .content-area {
        padding: var(--space-md);
    }
    
    .card {
        border-radius: var(--radius-md);
        margin-bottom: var(--space-md);
    }
    
    .card-header {
        padding: var(--space-md);
        flex-wrap: wrap;
        gap: var(--space-sm);
    }
    
    .card-title {
        font-size: var(--font-size-lg);
    }
    
    .card-body {
        padding: var(--space-md);
    }
    
    /* Queue Items Mobile Optimization */
    .queue-item {
        padding: var(--space-md);
    }
    
    .queue-item-content {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }
    
    .queue-item-info {
        width: 100%;
    }
    
    .queue-item-actions {
        width: 100%;
        display: flex;
        justify-content: space-between;
    }
    
    /* Alert Banner Mobile */
    .alert-banner {
        flex-direction: column;
        padding: var(--space-md);
        text-align: center;
    }
    
    .alert-action {
        width: 100%;
        margin-top: var(--space-sm);
    }
    
    /* Staff Status Mobile */
    .staff-grid {
        grid-template-columns: 1fr;
    }
    
    /* Activity Feed Mobile */
    .activity-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .activity-time {
        margin-top: var(--space-xs);
        font-size: var(--font-size-xs);
    }
}

/* Small Mobile Devices (320px to 479px) */
@media (max-width: 479px) {
    .dashboard-title {
        font-size: 20px;
    }
    
    .dashboard-subtitle {
        font-size: var(--font-size-sm);
        display: flex;
        flex-direction: column;
        gap: var(--space-xs);
    }
    
    .metric-value {
        font-size: 28px;
    }
    
    .btn {
        padding: var(--space-sm) var(--space-md);
        font-size: var(--font-size-sm);
    }
    
    .notification-btn,
    .topbar-btn {
        width: 36px;
        height: 36px;
        padding: 6px;
    }
    
    .topbar-btn svg {
        width: 24px !important;
        height: 24px !important;
    }
    
    /* Sidebar Mobile Optimization */
    .sidebar {
        width: 100%;
        left: -100%;
    }
    
    .nav-item {
        padding: var(--space-md);
    }
    
    .nav-text {
        font-size: var(--font-size-base);
    }
    
    /* Table Responsive */
    .data-table {
        font-size: var(--font-size-sm);
    }
    
    .data-table th,
    .data-table td {
        padding: var(--space-sm);
    }
    
    /* Form Elements Mobile */
    .form-group {
        margin-bottom: var(--space-md);
    }
    
    .form-label {
        font-size: var(--font-size-sm);
    }
    
    .form-control {
        padding: var(--space-sm) var(--space-md);
        font-size: var(--font-size-base);
    }
}

/* Landscape Mobile Orientation */
@media (max-width: 767px) and (orientation: landscape) {
    .sidebar {
        width: 280px;
        left: -280px;
    }
    
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-header {
        flex-direction: row;
    }
    
    .topbar {
        padding: var(--space-xs) var(--space-md);
    }
}

/* Print Styles */
@media print {
    .sidebar,
    .topbar,
    .alert-banner,
    .btn,
    .action-card {
        display: none !important;
    }
    
    .main-content {
        margin: 0;
        width: 100%;
    }
    
    .content-area {
        padding: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
    
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}