/* =====================================================
   STAFF DASHBOARD LAYOUT - ZONE GRID SYSTEM
   4-Zone Layout: Announcements -> Quick Access -> Metrics -> Secondary
   ===================================================== */

/* =====================================================
   ZONE VARIABLES
   ===================================================== */
:root {
    /* Zone spacing */
    --zone-gap: 1.5rem;
    --zone-padding: 1.5rem;

    /* Announcement colors */
    --announcement-bg: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    --announcement-border: #f59e0b;
    --announcement-urgent: #dc2626;
    --announcement-training: #7c3aed;
    --announcement-process: #2563eb;
    --announcement-general: #059669;
}

/* =====================================================
   2026 SALES GOAL BANNER
   Prominent banner showing annual target and progress
   ===================================================== */
.sales-goal-banner {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #1e40af 100%);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.sales-goal-content {
    display: flex;
    align-items: center;
    gap: 2rem;
    max-width: 1400px;
    width: 100%;
    justify-content: center;
}

.sales-goal-icon {
    font-size: 2rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.9; }
}

.sales-goal-info {
    text-align: center;
}

.sales-goal-title {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
    margin-bottom: 0.25rem;
}

.sales-goal-amount {
    font-size: 1.75rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.sales-goal-progress {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 200px;
}

.sales-goal-progress .progress-bar {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    overflow: hidden;
}

.sales-goal-progress .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    border-radius: 5px;
    transition: width 1s ease;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.sales-goal-progress .progress-text {
    color: #ffffff !important;
    font-size: 1.1rem;
    text-align: center;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.sales-goal-progress .progress-text span {
    color: #ffffff !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sales-goal-content {
        flex-direction: column;
        gap: 1rem;
    }

    .sales-goal-progress {
        min-width: 100%;
        max-width: 300px;
    }
}

/* =====================================================
   MAIN DASHBOARD ZONES CONTAINER
   ===================================================== */
.dashboard-zones {
    display: flex;
    flex-direction: column;
    gap: var(--zone-gap);
    padding: var(--zone-padding);
    max-width: 1400px;
    margin: 0 auto;
}

/* Zone ordering */
.zone-announcements { order: 1; }
.zone-quick-access { order: 2; }
.zone-metrics { order: 3; }
.zone-secondary { order: 4; }

/* =====================================================
   ZONE 1: ANNOUNCEMENTS HERO
   Top position - Training/Process updates with visual prominence
   ===================================================== */
.announcements-hero {
    background: var(--announcement-bg);
    border-left: 4px solid var(--announcement-border);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    position: relative;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 80px;
}

.announcements-hero.empty {
    display: none;
}

/* Priority Badge - Positioned top-left */
.announcement-priority-badge {
    position: absolute;
    top: -10px;
    left: 20px;
    background: var(--announcement-training);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.6875rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: pulse-badge 2s infinite;
}

.announcement-priority-badge.training {
    background: var(--announcement-training);
}

.announcement-priority-badge.process {
    background: var(--announcement-process);
}

.announcement-priority-badge.urgent {
    background: var(--announcement-urgent);
    animation: pulse-urgent 1s infinite;
}

.announcement-priority-badge.general {
    background: var(--announcement-general);
}

.announcement-priority-badge i {
    font-size: 0.75rem;
}

@keyframes pulse-badge {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.02);
    }
}

@keyframes pulse-urgent {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4);
    }
    50% {
        opacity: 0.95;
        box-shadow: 0 0 0 8px rgba(220, 38, 38, 0);
    }
}

/* Announcement Icon */
.announcement-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.announcement-icon i {
    font-size: 1.5rem;
    color: var(--announcement-border);
}

/* Announcement Content */
.announcement-content {
    flex: 1;
    min-width: 0;
}

.announcement-title {
    font-size: 1rem;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.announcement-preview {
    font-size: 0.875rem;
    color: #a16207;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Announcement Controls */
.announcement-controls {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-dismiss {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(146, 64, 14, 0.2);
    color: #92400e;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    transition: all 0.2s;
}

.btn-dismiss:hover {
    background: white;
    border-color: #92400e;
    transform: translateY(-1px);
}

.btn-view-all {
    background: transparent;
    border: none;
    color: #92400e;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-view-all:hover {
    text-decoration: underline;
}

/* All Announcements List (Expandable) */
.announcements-list {
    background: white;
    border-radius: 8px;
    margin-top: 1rem;
    box-shadow: var(--shadow);
    overflow: hidden;
    display: none;
}

.announcements-list.expanded {
    display: block;
}

.announcement-item {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: background 0.2s;
}

.announcement-item:last-child {
    border-bottom: none;
}

.announcement-item:hover {
    background: var(--hover-bg);
}

.announcement-item-badge {
    font-size: 0.625rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    flex-shrink: 0;
}

.announcement-item-badge.training {
    background: rgba(124, 58, 237, 0.1);
    color: var(--announcement-training);
}

.announcement-item-badge.process {
    background: rgba(37, 99, 235, 0.1);
    color: var(--announcement-process);
}

.announcement-item-badge.urgent {
    background: rgba(220, 38, 38, 0.1);
    color: var(--announcement-urgent);
}

.announcement-item-content {
    flex: 1;
}

.announcement-item-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.announcement-item-date {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* =====================================================
   ZONE 2: QUICK ACCESS TOOLS
   Primary action area - Quote builders, calculators
   ===================================================== */
.zone-quick-access {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.zone-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

.zone-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.zone-title i {
    color: var(--wsu-crimson);
}

/* Quick Access Grid - 2x2 layout */
.quick-access-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* Tool Category Card */
.tool-category {
    background: var(--light-bg);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid var(--border-light);
}

.tool-category-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.tool-category-icon {
    width: 32px;
    height: 32px;
    background: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.tool-category-icon i {
    font-size: 0.875rem;
    color: var(--wsu-crimson);
}

.tool-category-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Tool Buttons */
.tool-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.625rem 1.25rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.tool-btn:hover {
    background: var(--wsu-crimson);
    color: white;
    border-color: var(--wsu-crimson);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.tool-btn--legacy {
    opacity: 0.55;
    font-style: italic;
}
.tool-btn--legacy:hover {
    opacity: 1;
}

.tool-btn i {
    font-size: 0.75rem;
}

/* Wide button for long text */
.tool-btn-wide {
    font-size: 0.75rem;
    padding: 0.625rem 1rem;
    letter-spacing: -0.01em;
}

/* Tool Dropdown */
.tool-dropdown {
    position: relative;
}

.tool-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    justify-content: space-between;
}

.tool-dropdown-btn:hover {
    border-color: var(--wsu-crimson);
}

.tool-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    display: none;
    margin-top: 4px;
}

.tool-dropdown-menu.open {
    display: block;
}

.tool-dropdown-item {
    display: block;
    padding: 0.625rem 0.875rem;
    font-size: 0.8125rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.15s;
}

.tool-dropdown-item:hover {
    background: var(--hover-bg);
}

.tool-dropdown-item:first-child {
    border-radius: 6px 6px 0 0;
}

.tool-dropdown-item:last-child {
    border-radius: 0 0 6px 6px;
}

/* =====================================================
   ZONE 3: SALES METRICS
   ShopWorks data - Revenue, Team Performance
   ===================================================== */
.zone-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 1rem;
}

/* Revenue Card */
.metrics-revenue-card {
    grid-column: 1;
    grid-row: 1;
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.metrics-revenue-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.metrics-revenue-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metrics-revenue-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
}

.metrics-date-range {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 0.375rem;
    font-weight: 500;
}

.metrics-revenue-comparison {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.metrics-comparison-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 600;
}

.metrics-comparison-badge.positive {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.metrics-comparison-badge.negative {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.metrics-comparison-label {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Date Range Toggle */
.date-range-toggle {
    display: flex;
    background: var(--light-bg);
    border-radius: 6px;
    padding: 2px;
}

.date-range-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.date-range-btn.active {
    background: white;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.date-range-btn:hover:not(.active) {
    color: var(--text-primary);
}

/* Team Performance Card */
.metrics-team-card {
    grid-column: 2;
    grid-row: 1;
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

/* Production Widget Card (in metrics zone) */
.production-widget-card {
    grid-column: 2;
    grid-row: 2;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.metrics-team-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

.metrics-team-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.metrics-team-title i {
    color: var(--wsu-crimson);
}

/* Rep Cards */
.rep-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.rep-card {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--light-bg);
    border-radius: 8px;
    transition: background 0.2s;
}

.rep-card:hover {
    background: var(--hover-bg);
}

.rep-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rep-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--wsu-crimson);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.rep-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
}

.rep-name-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rep-subtitle {
    font-size: 0.6875rem;
    color: var(--text-muted);
    font-weight: 400;
}

.rep-yoy {
    font-size: 0.6875rem;
    font-weight: 500;
}

.rep-yoy.positive {
    color: #059669;
}

.rep-yoy.negative {
    color: #dc2626;
}

.rep-yoy.new {
    color: #6366f1;
}

.metrics-team-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rep-progress {
    height: 8px;
    background: var(--border-light);
    border-radius: 4px;
    overflow: hidden;
}

.rep-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--wsu-crimson), #c41e3a);
    border-radius: 4px;
    transition: width 0.5s ease-out;
}

.rep-stats {
    text-align: right;
    min-width: 80px;
}

.rep-revenue {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.rep-orders {
    font-size: 0.6875rem;
    color: var(--text-light);
}

/* Dual Metrics Display (Orders Processed vs Account Sales) */
.rep-stats {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    text-align: right;
    min-width: 80px;
}

.rep-revenue-group,
.rep-account-sales-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.rep-revenue-label,
.rep-account-sales-label {
    font-size: 0.6rem;
    color: var(--text-muted, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.rep-account-sales {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent-color, #10b981);
}

/* Gap Details Button */
.gap-details-btn {
    background: none;
    border: none;
    color: var(--text-muted, #6b7280);
    cursor: pointer;
    padding: 2px 6px;
    font-size: 0.75rem;
    border-radius: 4px;
    margin-left: 4px;
    transition: all 0.2s ease;
}

.gap-details-btn:hover {
    color: var(--accent-color, #10b981);
    background: rgba(16, 185, 129, 0.1);
}

/* Outbound gap: orders BY rep for non-CRM customers */
.gap-details-btn.gap-outbound {
    color: var(--warning, #f59e0b);
}

.gap-details-btn.gap-outbound:hover {
    color: var(--warning, #f59e0b);
    background: rgba(245, 158, 11, 0.1);
}

/* Inbound gap: orders by OTHER reps for CRM customers */
.gap-details-btn.gap-inbound {
    color: var(--info, #3b82f6);
}

.gap-details-btn.gap-inbound:hover {
    color: var(--info, #3b82f6);
    background: rgba(59, 130, 246, 0.1);
}

/* Gap Report Modal */
.gap-report-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.gap-report-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.gap-report-modal {
    background: var(--card-bg, #1e293b);
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.gap-report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color, #334155);
    background: var(--card-header-bg, #0f172a);
}

.gap-report-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary, #f1f5f9);
    display: flex;
    align-items: center;
    gap: 8px;
}

.gap-report-header h2 i {
    color: var(--accent-color, #10b981);
}

.gap-report-close {
    background: none;
    border: none;
    color: var(--text-muted, #6b7280);
    cursor: pointer;
    padding: 6px;
    font-size: 1.1rem;
    border-radius: 4px;
}

.gap-report-close:hover {
    color: var(--text-primary, #f1f5f9);
    background: rgba(255, 255, 255, 0.1);
}

.gap-report-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1;
}

.gap-report-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted, #6b7280);
    margin-bottom: 1rem;
}

.gap-report-summary {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color, #334155);
}

.gap-stat {
    text-align: center;
}

.gap-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color, #10b981);
}

.gap-stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted, #6b7280);
}

.gap-report-table-wrapper {
    overflow-x: auto;
}

.gap-report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.gap-report-table th {
    text-align: left;
    padding: 0.5rem;
    font-weight: 600;
    color: var(--text-muted, #6b7280);
    font-size: 0.75rem;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color, #334155);
}

.gap-report-table th.expand-col {
    width: 30px;
}

.gap-customer-row {
    cursor: pointer;
}

.gap-customer-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.gap-customer-row td {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--border-color, #334155);
    color: var(--text-primary, #f1f5f9);
}

.expand-toggle {
    color: var(--text-muted, #6b7280);
}

.gap-company-name {
    font-weight: 500;
}

.gap-customer-id {
    font-size: 0.75rem;
    color: var(--text-muted, #6b7280);
}

.gap-orders-row {
    background: rgba(0, 0, 0, 0.2);
}

.gap-orders-row td {
    padding: 0;
}

.gap-order-list {
    padding: 0.75rem 1rem 0.75rem 2.5rem;
}

.gap-order-item {
    display: flex;
    gap: 1rem;
    padding: 0.4rem 0;
    font-size: 0.8rem;
    border-bottom: 1px solid var(--border-color, #334155);
}

.gap-order-item:last-child {
    border-bottom: none;
}

.gap-order-number {
    font-family: monospace;
    font-weight: 600;
    color: var(--accent-color, #10b981);
    min-width: 70px;
}

.gap-order-amount {
    color: var(--success, #22c55e);
    min-width: 70px;
}

.gap-order-date {
    color: var(--text-muted, #6b7280);
}

.gap-order-rep {
    color: var(--info, #3b82f6);
    font-size: 0.75rem;
    padding: 2px 6px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 4px;
}

.gap-rep-names {
    font-size: 0.8rem;
    color: var(--info, #3b82f6);
}

.gap-report-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color, #334155);
    font-size: 0.8rem;
    color: var(--text-muted, #6b7280);
}

.gap-report-footer i {
    margin-right: 4px;
}

.gap-report-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-muted, #6b7280);
}

.gap-report-loading .loading {
    width: 32px;
    height: 32px;
    margin-bottom: 1rem;
}

.gap-report-empty {
    text-align: center;
    padding: 3rem;
}

.gap-report-empty i {
    font-size: 3rem;
    color: var(--success, #22c55e);
    margin-bottom: 1rem;
}

.gap-report-empty h3 {
    margin: 0;
    color: var(--text-primary, #f1f5f9);
}

.gap-report-empty p {
    color: var(--text-muted, #6b7280);
    margin-top: 0.5rem;
}

.gap-report-error {
    text-align: center;
    padding: 2rem;
    color: var(--error, #ef4444);
}

.gap-report-error i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Loading State for Metrics */
.metrics-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.metrics-loading .loading {
    width: 24px;
    height: 24px;
    margin-bottom: 0.5rem;
}

/* =====================================================
   ZONE 4: SECONDARY CONTENT
   Production Schedule, Policies - Collapsible
   ===================================================== */
.zone-secondary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Collapsible Widget */
.widget-collapsible {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--light-bg);
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.widget-header:hover {
    background: var(--hover-bg);
}

.widget-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.widget-title i {
    color: var(--wsu-crimson);
}

.widget-toggle {
    color: var(--text-secondary);
    transition: transform 0.3s;
}

.widget-collapsible.collapsed .widget-toggle {
    transform: rotate(-90deg);
}

.widget-content {
    padding: 1.25rem;
    transition: max-height 0.3s ease, padding 0.3s ease;
    max-height: 500px;
    overflow: hidden;
}

.widget-collapsible.collapsed .widget-content {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* Production Schedule Mini Cards */
.production-mini-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.production-mini-card {
    text-align: center;
    padding: 0.75rem;
    background: var(--light-bg);
    border-radius: 6px;
    border: 1px solid var(--border-light);
}

.production-mini-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
}

.production-mini-status {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.production-mini-status.busy {
    color: var(--warning);
}

.production-mini-status.full {
    color: var(--danger);
}

/* Policy Cards */
.policy-mini-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.policy-mini-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--light-bg);
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.2s;
}

.policy-mini-card:hover {
    background: var(--hover-bg);
}

.policy-mini-icon {
    width: 32px;
    height: 32px;
    background: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.policy-mini-icon i {
    font-size: 0.875rem;
    color: var(--wsu-crimson);
}

.policy-mini-content {
    flex: 1;
    min-width: 0;
}

.policy-mini-title {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
}

.policy-mini-date {
    font-size: 0.6875rem;
    color: var(--text-light);
}

.policy-mini-badge {
    font-size: 0.5625rem;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

/* =====================================================
   RESPONSIVE DESIGN
   ===================================================== */
@media (max-width: 1024px) {
    .zone-metrics {
        grid-template-columns: 1fr;
    }

    .metrics-revenue-card,
    .metrics-team-card,
    .production-widget-card,
    .garment-tracker-card {
        grid-column: 1;
        grid-row: auto;
    }

    .zone-secondary {
        grid-template-columns: 1fr;
    }

    .quick-access-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-zones {
        padding: 1rem;
        gap: 1rem;
    }

    .announcements-hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.5rem 1rem 1rem;
    }

    .announcement-controls {
        width: 100%;
        justify-content: flex-start;
        margin-top: 0.75rem;
    }

    .zone-quick-access {
        padding: 1rem;
    }

    .rep-card {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .rep-stats {
        text-align: left;
    }

    .production-mini-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .metrics-revenue-value {
        font-size: 1.75rem;
    }
}

/* =====================================================
   SIDEBAR NAVIGATION SECTIONS
   Collapsible navigation with proper colors
   ===================================================== */

/* Nav Section Container */
.nav-section {
    margin-bottom: 0.25rem;
    border-radius: 8px;
    overflow: hidden;
}

/* Section Header (clickable) */
.nav-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    color: white;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.25s ease;
    user-select: none;
    position: relative;
}

.nav-section-header:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(3px);
}

/* Active/expanded section styling */
.nav-section:not(.collapsed) .nav-section-header {
    background: rgba(255, 255, 255, 0.08);
}

/* Section Title with Icon */
.nav-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
}

/* Chevron Toggle */
.nav-section-header .chevron {
    font-size: 0.625rem;
    color: rgba(255, 255, 255, 0.6);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-section.collapsed .chevron {
    transform: rotate(-90deg);
}

.nav-section-header:hover .chevron {
    color: rgba(255, 255, 255, 0.9);
}

/* Ensure all text elements in nav sections inherit white color */
.nav-section-header span,
.nav-section-title span {
    color: inherit;
}

/* Section Content (links) */
.nav-section-content {
    padding-left: 0.5rem;
    margin-top: 0.25rem;
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.nav-section.collapsed .nav-section-content {
    max-height: 0;
    margin-top: 0;
}

/* Nav Links inside sections */
.nav-section-content .nav-link {
    display: block;
    padding: 0.5rem 0.75rem 0.5rem 1.5rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.8125rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    position: relative;
    margin: 2px 0;
}

.nav-section-content .nav-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: white;
    transform: translateX(4px);
}

.nav-section-content .nav-link:active {
    transform: translateX(2px);
    background: rgba(255, 255, 255, 0.15);
}

.nav-section-content .nav-link span {
    color: inherit;
}

/* Single-link sections (Company Policies style) */
.nav-section-header-link {
    text-decoration: none;
    display: block;
}

.nav-section-header-link .nav-section-header {
    color: white;
    transition: all 0.25s ease;
}

.nav-section-header-link:hover .nav-section-header {
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(3px);
}

/* =====================================================
   ADDITIONAL METRICS STATES
   ===================================================== */

/* Neutral comparison badge (for N/A) */
.metrics-comparison-badge.neutral {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

/* No data placeholder */
.no-data {
    color: var(--text-light);
    font-weight: 400;
}

/* Partial data warning notice */
.partial-data-notice {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 6px;
    color: #92400e;
    font-size: 0.8125rem;
    margin-bottom: 1rem;
}

.partial-data-notice i {
    color: #f59e0b;
}

/* Partial data source badge */
.data-source-badge.partial {
    background: rgba(245, 158, 11, 0.1);
    color: #92400e;
}

/* =====================================================
   USER MENU / PROFILE WIDGET
   Top-right header user authentication display
   ===================================================== */
.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: background 0.2s;
}

.user-menu:hover {
    background: var(--gray-50, #f9fafb);
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--wsu-crimson, #981e32);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 6px rgba(152, 30, 50, 0.3);
    transition: all 0.3s ease;
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(152, 30, 50, 0.4);
}

.user-info {
    text-align: right;
}

.user-name {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary, #1f2937);
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary, #6b7280);
}

.user-menu-chevron {
    font-size: 0.625rem;
    color: var(--text-secondary, #6b7280);
    transition: transform 0.3s;
}

.user-menu.active .user-menu-chevron {
    transform: rotate(180deg);
}

/* User Dropdown Menu */
.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    z-index: 1000;
    margin-top: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: white;
    transform: rotate(45deg);
    border-left: 1px solid rgba(0, 0, 0, 0.08);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.dropdown-header {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    background: var(--light-bg, #f9fafb);
}

.dropdown-user-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.9375rem;
}

.dropdown-user-email {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.dropdown-divider {
    height: 1px;
    background: #eee;
    margin: 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: #374151;
    transition: background 0.2s;
    font-size: 0.875rem;
}

.dropdown-item:hover {
    background: #f3f4f6;
}

.dropdown-item i {
    width: 16px;
    color: #6b7280;
}

/* =====================================================
   ASK BARNABY THEME - Forest Green/Pacific Northwest
   Barnaby is NWCA's Sasquatch mascot
   ===================================================== */
.barnaby-theme {
    background: linear-gradient(135deg, #e8f5e0 0%, #d4edda 100%);
    border: 2px solid #4a7c23;
}

.barnaby-icon {
    background: linear-gradient(135deg, #2d5016 0%, #3d6b1e 100%);
    box-shadow: 0 2px 4px rgba(45, 80, 22, 0.3);
}

.barnaby-svg {
    width: 18px;
    height: 18px;
    fill: white;
}

.barnaby-theme .tool-category-title {
    color: #2d5016;
    font-weight: 700;
    font-size: 0.875rem;
}

/* Barnaby button hover - forest green instead of crimson */
.barnaby-theme .tool-btn:hover {
    background: #2d5016;
    border-color: #2d5016;
}

/* Barnaby accent button - forest green filled (Quote Management) */
.barnaby-theme .tool-btn.barnaby-accent {
    background: linear-gradient(135deg, #2d5016 0%, #3d6b1e 100%);
    color: white;
    border-color: #2d5016;
}

.barnaby-theme .tool-btn.barnaby-accent:hover {
    background: linear-gradient(135deg, #3d6b1e 0%, #4a7c23 100%);
    border-color: #4a7c23;
}

/* Embroidery group - stacked with subtle thread-blue accent */
.barnaby-theme .emb-stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.barnaby-theme .tool-btn.emb-group {
    border-left: 3px solid #4a90a4;
}

/* =====================================================
   DARK MODE SUPPORT (Future)
   ===================================================== */
@media (prefers-color-scheme: dark) {
    /* Reserve for future dark mode implementation */
}
