@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
@import './tokens.css';
@import './layout.css';
@import './components.css';
@import './views.css';
@import './activity-timeline.css';

/* Warehouse Workforce Dashboard Utility Styles */
:root {
    /* Color Palette */
    --wwd-bg-dark: #0a0a0f;
    --wwd-bg-darker: #050508;
    --wwd-primary: #6366f1;
    --wwd-primary-dark: #4f46e5;
    --wwd-primary-light: #818cf8;
    --wwd-text-light: #f8fafc;
    --wwd-text-gray: #94a3b8;
    --wwd-text-gray-dark: #475569;
    --wwd-border: rgba(255, 255, 255, 0.08);
    
    --wwd-success: #10b981;
    --wwd-warning: #f59e0b;
    --wwd-danger: #f43f5e;
    
    /* Effects */
    --wwd-glass-bg: rgba(17, 24, 39, 0.65);
    --wwd-glass-border: rgba(255, 255, 255, 0.08);
    --wwd-glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.35);
    
    /* Font Scale (Default) */
    --wwd-font-scale: 1;
}

.wwd-light-mode {
    --wwd-bg-dark: #f3f4f6;
    --wwd-bg-darker: #ffffff;
    --wwd-primary: #4f46e5;
    --wwd-primary-dark: #4338ca;
    --wwd-primary-light: #6366f1;
    --wwd-text-light: #111827;
    --wwd-text-gray: #4b5563;
    --wwd-text-gray-dark: #9ca3af;
    --wwd-border: rgba(0, 0, 0, 0.08);
    --wwd-glass-bg: rgba(255, 255, 255, 0.85);
    --wwd-glass-border: rgba(0, 0, 0, 0.05);
    --wwd-glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

/* ======================================================
   PREMIUM EMPLOYEE TABLE STYLES
   ====================================================== */

/* Row */
.wwd-emp-row {
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.1s ease;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.wwd-emp-row:hover {
    background: linear-gradient(90deg, rgba(99,102,241,0.06) 0%, rgba(99,102,241,0.02) 100%);
}
.wwd-emp-row:hover .wwd-emp-avatar {
    box-shadow: 0 0 0 2px rgba(99,102,241,0.5);
    transform: scale(1.08);
}

/* Avatar */
.wwd-emp-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    flex-shrink: 0;
    background: hsl(var(--emp-hue, 240deg), 60%, 28%);
    color: hsl(var(--emp-hue, 240deg), 80%, 85%);
    border: 1.5px solid hsl(var(--emp-hue, 240deg), 60%, 40%);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    user-select: none;
}

/* ID cell */
.wwd-emp-id-cell { padding: 0.6rem 1rem; }
.wwd-emp-id-inner {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}
.wwd-emp-id-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.wwd-emp-id-label {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--wwd-primary-light);
    letter-spacing: 0.03em;
}
.wwd-emp-id-sub {
    font-size: 0.6875rem;
    color: var(--wwd-text-gray-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 10ch;
}

/* Num cells */
.wwd-num-cell { color: var(--wwd-text-light); }
.wwd-num-val { font-size: 0.8125rem; font-weight: 600; }
.wwd-sph-val { font-size: 0.875rem; font-weight: 700; color: var(--wwd-text-light); }
.wwd-sph-unit { font-size: 0.65rem; color: var(--wwd-text-gray-dark); margin-left: 1px; }
.wwd-time-cell { font-size: 0.8rem; color: var(--wwd-text-gray); }

/* Efficiency pill */
.wwd-eff-cell { padding: 0.5rem 1rem; }
.wwd-eff-pill {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 0.3rem 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid;
    min-width: 80px;
    max-width: 110px;
}
.wwd-eff-value {
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1;
}
.wwd-eff-bar-bg {
    width: 100%;
    height: 3px;
    border-radius: 9999px;
    background: rgba(255,255,255,0.07);
    overflow: hidden;
}
.wwd-eff-bar {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.4s cubic-bezier(0.4,0,0.2,1);
}
.wwd-eff-target {
    font-size: 0.6rem;
    color: var(--wwd-text-gray-dark);
    line-height: 1;
}

/* Downtime cell */
.wwd-dt-td { padding: 0.5rem 1rem; }
.wwd-dt-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.wwd-dt-value {
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}
.wwd-dt-ratio {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.15rem 0.35rem;
    border-radius: 9999px;
    white-space: nowrap;
}
.wwd-dt-ring-ok { background: rgba(16,185,129,0.12); color: #10b981; }
.wwd-dt-ring-mid { background: rgba(245,158,11,0.15); color: #f59e0b; }
.wwd-dt-ring-high {
    background: rgba(244,63,94,0.15);
    color: #f43f5e;
    animation: wwd-dt-pulse 2s ease-in-out infinite;
}
@keyframes wwd-dt-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(244,63,94,0); }
    50% { box-shadow: 0 0 0 3px rgba(244,63,94,0.25); }
}

/* Process badges in table */
.wwd-proc-cell { padding: 0.5rem 1rem; }
.wwd-proc-list { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.wwd-proc-badge {
    font-size: 0.6rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 0.25rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--wwd-text-gray);
    letter-spacing: 0.02em;
    white-space: nowrap;
    max-width: 14ch;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wwd-proc-badge-primary {
    background: rgba(99,102,241,0.15);
    border-color: rgba(99,102,241,0.4);
    color: var(--wwd-primary-light);
}
.wwd-proc-more {
    font-size: 0.6rem;
    color: var(--wwd-text-gray-dark);
    padding: 0 0.2rem;
}

/* Light mode overrides for employee table */
.wwd-light-mode .wwd-emp-row:hover {
    background: rgba(79,70,229,0.04);
}
.wwd-light-mode .wwd-emp-id-label { color: var(--wwd-primary); }
.wwd-light-mode .wwd-emp-id-sub { color: #9ca3af; }

/* ======================================================
   DOWNTIME TIMELINE VIEW - PREMIUM REDESIGN
   ====================================================== */

/* Cards in the downtime per-user feed */
.wwd-user-timeline-card {
    position: relative;
    overflow: hidden;
}
.wwd-user-timeline-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px;
    height: 100%;
    background: var(--wwd-primary);
    opacity: 0;
    transition: opacity 0.2s ease;
    border-radius: 0 2px 2px 0;
}
.wwd-user-timeline-card:hover::before { opacity: 1; }

/* Downtime event row in the log table */
.wwd-dt-log-row-break td:first-child {
    border-left: 3px solid var(--wwd-danger);
    padding-left: calc(1rem - 3px);
}
.wwd-dt-log-row-switch td:first-child {
    border-left: 3px solid var(--wwd-warning);
    padding-left: calc(1rem - 3px);
}

/* KPI mini-cards in downtime view */
.wwd-dt-kpi-mini {
    background: var(--wwd-glass-bg);
    border: 1px solid var(--wwd-border);
    border-radius: 0.75rem;
    padding: 0.875rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.wwd-dt-kpi-mini:hover {
    border-color: rgba(99,102,241,0.3);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.wwd-dt-kpi-mini .wwd-kpi-label {
    font-size: 0.7rem;
    color: var(--wwd-text-gray-dark);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.wwd-dt-kpi-mini .wwd-kpi-value {
    font-size: 1.375rem;
    font-weight: 800;
    color: var(--wwd-text-light);
    line-height: 1;
}

/* ======================================================
   LIGHT MODE SHARED
   ====================================================== */
.wwd-light-mode .wwd-text-white {
    color: var(--wwd-text-light) !important;
}
.wwd-light-mode .wwd-bg-dark\/40 {
    background-color: rgba(0, 0, 0, 0.04) !important;
}
.wwd-light-mode .wwd-bg-dark\/50 {
    background-color: rgba(0, 0, 0, 0.06) !important;
}

/* Reset & Scoping */
.wwd-wrapper {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--wwd-text-light);
    line-height: 1.5;
    box-sizing: border-box;
    width: 100%;
}
.wwd-wrapper h1,
.wwd-wrapper h2,
.wwd-wrapper h3,
.wwd-wrapper h4,
.wwd-wrapper h5,
.wwd-wrapper h6 {
    color: var(--wwd-text-light);
}
.wwd-wrapper *, .wwd-wrapper *::before, .wwd-wrapper *::after {
    box-sizing: inherit;
}

/* Layout Utilities */
.wwd-flex { display: flex; }
.wwd-flex-wrap { flex-wrap: wrap; }
.wwd-flex-col { flex-direction: column; }
.wwd-flex-1 { flex: 1 1 0%; }
.wwd-items-center { align-items: center; }
.wwd-items-start { align-items: flex-start; }
.wwd-justify-center { justify-content: center; }
.wwd-justify-between { justify-content: space-between; }
.wwd-justify-end { justify-content: flex-end; }
.wwd-gap-2 { gap: 0.5rem; }
.wwd-gap-3 { gap: 0.75rem; }
.wwd-gap-4 { gap: 1rem; }
.wwd-gap-6 { gap: 1.5rem; }
.wwd-grid { display: grid; }
.wwd-grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.wwd-grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wwd-grid-cols-auto { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.wwd-grid-cols-auto-lg { grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); }
/* Responsive grid columns — used in PHP HTML with md:/lg: prefix */
@media (min-width: 768px) {
    .\3A md\:wwd-grid-cols-2, [class*="md:wwd-grid-cols-2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .\3A md\:wwd-grid-cols-4, [class*="md:wwd-grid-cols-4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .\3A md\:wwd-grid-cols-6, [class*="md:wwd-grid-cols-6"] { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .\3A md\:wwd-col-span-2, [class*="md:wwd-col-span-2"] { grid-column: span 2 / span 2; }
}
@media (min-width: 1024px) {
    .\3A lg\:wwd-grid-cols-3, [class*="lg:wwd-grid-cols-3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .\3A lg\:wwd-col-span-2, [class*="lg:wwd-col-span-2"] { grid-column: span 2 / span 2; }
}

/* Sizing & Spacing */
.wwd-w-full { width: 100%; }
.wwd-w-auto { width: auto; }
.wwd-h-screen { height: 100vh; }
.wwd-h-full { height: 100%; }
.wwd-w-64 { width: 16rem; }
.wwd-h-16 { height: 4rem; }
.wwd-w-16 { width: 4rem; }
.wwd-w-12 { width: 3rem; }
.wwd-h-12 { height: 3rem; }
.wwd-w-5 { width: 1.25rem; }
.wwd-h-5 { height: 1.25rem; }
.wwd-w-4 { width: 1rem; }
.wwd-h-4 { height: 1rem; }
.wwd-w-3 { width: 0.75rem; }
.wwd-h-3 { height: 0.75rem; }
.wwd-w-8 { width: 2rem; }
.wwd-h-8 { height: 2rem; }
/* Explicit width utilities used in UI forms */
.wwd-w-24 { width: 6rem; }
.wwd-w-28 { width: 7rem; }
.wwd-w-36 { width: 9rem; }
.wwd-w-48 { width: 12rem; }
.wwd-w-96 { width: 24rem; }
.wwd-max-w-2xl { max-width: 42rem; }
.wwd-min-w-\[320px\] { min-width: 320px; }
/* Col-span utilities */
.wwd-col-span-2 { grid-column: span 2 / span 2; }
.wwd-col-span-full { grid-column: 1 / -1; }
.wwd-mx-auto { margin-left: auto; margin-right: auto; }
.wwd-mb-1 { margin-bottom: 0.25rem; }
.wwd-mb-2 { margin-bottom: 0.5rem; }
.wwd-mb-3 { margin-bottom: 0.75rem; }
.wwd-mb-4 { margin-bottom: 1rem; }
.wwd-mb-6 { margin-bottom: 1.5rem; }
.wwd-mt-1 { margin-top: 0.25rem; }
.wwd-mt-2 { margin-top: 0.5rem; }
.wwd-mt-6 { margin-top: 1.5rem; }
.wwd-mt-12 { margin-top: 3rem; }
.wwd-mr-2 { margin-right: 0.5rem; }
.wwd-p-3 { padding: 0.75rem; }
.wwd-p-4 { padding: 1rem; }
.wwd-p-6 { padding: 1.5rem; }
.wwd-p-12 { padding: 3rem; }
.wwd-px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }

/* Colors & Backgrounds */
.wwd-bg-dark { background-color: var(--wwd-bg-dark); }
.wwd-bg-darker { background-color: var(--wwd-bg-darker); }
.wwd-bg-primary { background-color: var(--wwd-primary); }
.wwd-bg-primary-dark { background-color: var(--wwd-primary-dark); }
.wwd-text-primary { color: var(--wwd-primary); }
.wwd-text-primary-light { color: var(--wwd-primary-light); }
.wwd-text-light { color: var(--wwd-text-light); }
.wwd-text-white { color: #fff; }
.wwd-text-gray-300 { color: var(--wwd-text-gray); }
.wwd-text-gray-400 { color: var(--wwd-text-gray); }
.wwd-text-gray-500 { color: var(--wwd-text-gray-dark); }
.wwd-text-success { color: var(--wwd-success); }
.wwd-text-warning { color: var(--wwd-warning); }
.wwd-text-danger { color: var(--wwd-danger); }
.wwd-border-r { border-right-width: 1px; border-right-style: solid; }
.wwd-border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.wwd-border-t { border-top-width: 1px; border-top-style: solid; }
.wwd-border-2 { border-width: 2px; }
.wwd-border-dashed { border-style: dashed; }
.wwd-border-gray-800 { border-color: var(--wwd-border); }
.wwd-border-gray-700 { border-color: var(--wwd-border); }
.wwd-bg-red-900 { background-color: rgba(239, 68, 68, 0.2); }
.wwd-text-red-400 { color: var(--wwd-danger); }
.wwd-bg-green-900 { background-color: rgba(16, 185, 129, 0.2); }
.wwd-text-green-400 { color: var(--wwd-success); }
.wwd-bg-blue-900 { background-color: rgba(59, 130, 246, 0.2); }
.wwd-text-blue-400 { color: #60a5fa; }

/* Typography */
.wwd-text-xs { font-size: calc(0.75rem * var(--wwd-font-scale, 1)); }
.wwd-text-sm { font-size: calc(0.875rem * var(--wwd-font-scale, 1)); }
.wwd-text-md { font-size: calc(1rem * var(--wwd-font-scale, 1)); }
.wwd-text-lg { font-size: calc(1.125rem * var(--wwd-font-scale, 1)); }
.wwd-text-xl { font-size: calc(1.25rem * var(--wwd-font-scale, 1)); }
.wwd-text-3xl { font-size: calc(1.875rem * var(--wwd-font-scale, 1)); }
/* Arbitrary font sizes used in inline HTML */
.wwd-text-\[10px\] { font-size: 10px; }
.wwd-text-\[11px\] { font-size: 11px; }
.wwd-text-2xl { font-size: calc(1.5rem * var(--wwd-font-scale, 1)); }
.wwd-font-medium { font-weight: 500; }
.wwd-font-semibold { font-weight: 600; }
.wwd-font-bold { font-weight: 700; }
.wwd-font-extrabold { font-weight: 800; }
.wwd-text-center { text-align: center; }
.wwd-text-left { text-align: left; }
.wwd-text-right { text-align: right; }
.wwd-uppercase { text-transform: uppercase; }
.wwd-italic { font-style: italic; }

/* Effects & Utility */
.wwd-hidden { display: none !important; }
.wwd-block { display: block; }
.wwd-inline { display: inline-block; }
.wwd-overflow-hidden { overflow: hidden; }
.wwd-overflow-y-auto { overflow-y: auto; }
.wwd-relative { position: relative; }
.wwd-rounded-lg { border-radius: 0.5rem; }
.wwd-rounded-xl { border-radius: 0.75rem; }
.wwd-rounded-full { border-radius: 9999px; }
.wwd-transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 300ms; }
.wwd-transition-colors { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 300ms; }
.wwd-duration-300 { transition-duration: 300ms; }

.wwd-text-gradient {
    background: linear-gradient(135deg, var(--wwd-primary-light), var(--wwd-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* Glassmorphism */
.wwd-glass-panel {
    background: var(--wwd-glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--wwd-glass-border);
    box-shadow: var(--wwd-glass-shadow);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease;
}
.wwd-glass-panel:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.4);
}

/* Animations */
@keyframes wwd-spin {
    to { transform: rotate(360deg); }
}
.wwd-animate-spin {
    animation: wwd-spin 1s linear infinite;
}

@keyframes wwd-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .7; transform: scale(1.05); }
}
.wwd-animate-pulse {
    animation: wwd-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Custom Scrollbar */
.wwd-wrapper ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.wwd-wrapper ::-webkit-scrollbar-track {
    background: transparent;
}
.wwd-wrapper ::-webkit-scrollbar-thumb {
    background: var(--wwd-border);
    border-radius: 4px;
}
.wwd-wrapper ::-webkit-scrollbar-thumb:hover {
    background: var(--wwd-text-gray-dark);
}

/* Components */
.wwd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: calc(0.875rem * var(--wwd-font-scale, 1));
    font-weight: 600;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 0.5rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.wwd-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.wwd-btn-primary {
    background: linear-gradient(135deg, var(--wwd-primary), var(--wwd-primary-dark));
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.wwd-btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
    background: linear-gradient(135deg, var(--wwd-primary-light), var(--wwd-primary));
}
.wwd-btn-outline {
    background-color: transparent;
    border-color: var(--wwd-border);
    color: var(--wwd-text-light);
}
.wwd-btn-outline:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--wwd-text-gray);
    transform: translateY(-1px);
}
.wwd-btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: calc(0.75rem * var(--wwd-font-scale, 1));
}

.wwd-input {
    background-color: rgba(0,0,0,0.2);
    border: 1px solid var(--wwd-border);
    color: var(--wwd-text-light) !important;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: calc(0.875rem * var(--wwd-font-scale, 1));
    outline: none;
    transition: border-color 0.2s;
    height: auto !important;
    min-height: 38px;
    line-height: 1.2;
}
.wwd-input:focus {
    border-color: var(--wwd-primary);
}
select.wwd-input option {
    background-color: var(--wwd-bg-darker);
    color: var(--wwd-text-light);
}

.wwd-nav-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    color: var(--wwd-text-gray);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    font-weight: 500;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
}
.wwd-nav-btn::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s;
}
.wwd-nav-btn:hover:not(:disabled)::before {
    transform: translateX(100%);
}
.wwd-nav-btn:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--wwd-text-light);
    transform: translateX(4px);
}
.wwd-nav-btn.wwd-active {
    background: linear-gradient(90deg, var(--wwd-primary-dark), transparent);
    color: #fff;
    border-left: 3px solid var(--wwd-primary);
}
.wwd-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.wwd-kpi-card {
    padding: 1.5rem;
    border-radius: 1rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0) 100%), var(--wwd-glass-bg);
}
.wwd-kpi-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 40px -10px rgba(0, 0, 0, 0.6);
    border-color: rgba(255,255,255,0.15);
}

.wwd-dropzone {
    cursor: pointer;
}
.wwd-dropzone:hover, .wwd-dropzone.wwd-dragover {
    border-color: var(--wwd-primary);
    background-color: rgba(59, 130, 246, 0.05);
}

/* Ensure topbar filters are above other content and clickable */
.wwd-main-content > header {
    position: relative;
    z-index: 60;
}

#wwd-global-filters, .wwd-global-filters {
    z-index: 70;
    pointer-events: auto;
}

/* Keep KPI cards visually behind the header area to avoid overlap */
.wwd-kpi-card {
    position: relative;
    z-index: 1;
}

/* Tables */
.wwd-table-container {
    overflow-x: auto;
    max-height: 800px;
}
.wwd-table {
    border-collapse: collapse;
    width: 100%;
    font-size: calc(0.875rem * var(--wwd-font-scale, 1));
}
.wwd-table th {
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: var(--wwd-text-gray);
    position: sticky;
    top: 0;
    background-color: var(--wwd-bg-darker);
    z-index: 10;
    border-bottom: 1px solid var(--wwd-border);
}
.wwd-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--wwd-border);
}
.wwd-table tr:hover td {
    background-color: rgba(255,255,255,0.02);
}
.wwd-sortable {
    cursor: pointer;
    user-select: none;
}
.wwd-sortable:hover {
    color: var(--wwd-text-light);
}

/* Toggle Switch */
.wwd-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.wwd-switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}
.wwd-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--wwd-border);
  transition: .4s;
}
.wwd-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
}
input:checked + .wwd-slider {
  background-color: var(--wwd-primary);
}
input:checked + .wwd-slider:before {
  transform: translateX(20px);
}
.wwd-slider.wwd-round {
  border-radius: 24px;
}
.wwd-slider.wwd-round:before {
  border-radius: 50%;
}

/* Badges */
.wwd-badge {
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: calc(0.75rem * var(--wwd-font-scale, 1));
    font-weight: 500;
}
.wwd-badge-success { background: rgba(16, 185, 129, 0.2); color: var(--wwd-success); }
.wwd-badge-warning { background: rgba(245, 158, 11, 0.2); color: var(--wwd-warning); }
.wwd-badge-danger { background: rgba(239, 68, 68, 0.2); color: var(--wwd-danger); }

/* Timeline */
.wwd-timeline {
    position: relative;
    margin-top: 1rem;
}
.wwd-timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--wwd-border);
}
.wwd-timeline-item {
    position: relative;
    padding-left: 3rem;
    margin-bottom: 1.5rem;
}
.wwd-timeline-marker {
    position: absolute;
    left: 0;
    top: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--wwd-bg-darker);
    border: 2px solid var(--wwd-border);
    z-index: 1;
}
.wwd-timeline-marker svg { width: 16px; height: 16px; }
.wwd-marker-primary { border-color: var(--wwd-primary); color: var(--wwd-primary); }
.wwd-marker-danger { border-color: var(--wwd-danger); color: var(--wwd-danger); }
.wwd-timeline-content {
    border-radius: 0.75rem;
    padding: 1rem;
}
.wwd-border-danger { border: 1px solid rgba(239, 68, 68, 0.3); }

.wwd-py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.wwd-pt-4 { padding-top: 1rem; }
.wwd-cursor-pointer { cursor: pointer; }
.wwd-expand-icon { transition: transform 0.3s ease; }
.wwd-detail-row { animation: wwd-slide-down 0.3s ease-out; }

.wwd-timeline-details {
    animation: wwd-slide-down 0.2s ease-out;
}

.wwd-timeline-expandable:hover {
    border-color: var(--wwd-primary);
    background-color: rgba(255, 255, 255, 0.02);
}

.wwd-bg-dark\/40 { background-color: rgba(0, 0, 0, 0.4); }
.wwd-bg-dark\/50 { background-color: rgba(0, 0, 0, 0.5); }


@keyframes wwd-slide-down {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.wwd-detail-content {
    border-left: 4px solid var(--wwd-primary);
}

/* Print Styles */
@media print {
    @page {
        size: A4 portrait;
        margin: 15mm 15mm 15mm 15mm;
    }

    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* If printing the user report card specifically */
    body.wwd-printing-report-card {
        position: relative !important;
        background: #ffffff !important;
        color: #111827 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    body.wwd-printing-report-card #warehouse-dashboard-root {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: auto !important;
        min-height: 100% !important;
        z-index: 9999999 !important;
        background: #ffffff !important;
        display: block !important;
        color: #111827 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body.wwd-printing-report-card #wwd-app,
    body.wwd-printing-report-card .wwd-main-content,
    body.wwd-printing-report-card #wwd-content-area {
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
        position: relative !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
        display: block !important;
    }

    body.wwd-printing-report-card #wwd-sidebar,
    body.wwd-printing-report-card header,
    body.wwd-printing-report-card #wwd-view-user-analysis > .wwd-glass-panel:first-of-type,
    body.wwd-printing-report-card #wwd-print-user-report,
    body.wwd-printing-report-card .wwd-print-hidden,
    body.wwd-printing-report-card #wwd-peer-process-select,
    body.wwd-printing-report-card #wwd-user-rank-badge {
        display: none !important;
    }

    body.wwd-printing-report-card .wwd-view-section:not(#wwd-view-user-analysis) {
        display: none !important;
    }

    body.wwd-printing-report-card #wwd-view-user-analysis {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    /* Force Light Mode Color Tokens for Print */
    body.wwd-printing-report-card {
        --wwd-bg-dark: #ffffff;
        --wwd-bg-darker: #f9fafb;
        --wwd-text-light: #111827;
        --wwd-text-gray: #4b5563;
        --wwd-text-gray-dark: #9ca3af;
        --wwd-border: #e5e7eb;
        --wwd-glass-bg: #ffffff;
        --wwd-glass-border: #e5e7eb;
        --wwd-glass-shadow: none;
    }

    /* Force Darker/Readable Text Colors on white background */
    body.wwd-printing-report-card h1,
    body.wwd-printing-report-card h2,
    body.wwd-printing-report-card h3,
    body.wwd-printing-report-card h4,
    body.wwd-printing-report-card h5,
    body.wwd-printing-report-card h6,
    body.wwd-printing-report-card p,
    body.wwd-printing-report-card td,
    body.wwd-printing-report-card th,
    body.wwd-printing-report-card label,
    body.wwd-printing-report-card span:not(.wwd-badge):not(.wwd-text-danger):not(.wwd-text-success) {
        color: #111827 !important;
    }

    body.wwd-printing-report-card .wwd-text-gray-400,
    body.wwd-printing-report-card .wwd-text-gray-500 {
        color: #4b5563 !important;
    }

    body.wwd-printing-report-card .wwd-text-light {
        color: #111827 !important;
    }

    /* Layout fixes to prevent stretched widgets and cutoffs */
    body.wwd-printing-report-card .wwd-grid-cols-auto {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 12px !important;
    }

    body.wwd-printing-report-card .wwd-kpi-card {
        padding: 1rem !important;
        border-radius: 0.5rem !important;
        background: #ffffff !important;
        border: 1px solid #e5e7eb !important;
        height: auto !important;
    }

    body.wwd-printing-report-card .wwd-grid-cols-2 {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    body.wwd-printing-report-card .wwd-chart-container,
    body.wwd-printing-report-card canvas {
        width: 100% !important;
        max-width: 100% !important;
    }

    body.wwd-printing-report-card .wwd-table-container {
        max-height: none !important;
        overflow: visible !important;
        width: 100% !important;
    }

    body.wwd-printing-report-card .wwd-table {
        width: 100% !important;
        table-layout: auto !important;
    }

    body.wwd-printing-report-card .wwd-table th,
    body.wwd-printing-report-card .wwd-table td {
        padding: 6px 8px !important;
        font-size: 11px !important;
    }

    /* Fallback general print layout (if printing whole dashboard) */
    body:not(.wwd-printing-report-card) #wwd-sidebar, 
    body:not(.wwd-printing-report-card) header,
    body:not(.wwd-printing-report-card) #wpadminbar {
        display: none !important;
    }
    body:not(.wwd-printing-report-card) #warehouse-dashboard-root,
    body:not(.wwd-printing-report-card) #wwd-app,
    body:not(.wwd-printing-report-card) .wwd-main-content,
    body:not(.wwd-printing-report-card) #wwd-content-area {
        height: auto !important;
        overflow: visible !important;
        position: relative !important;
    }

    .wwd-glass-panel {
        break-inside: avoid !important;
        page-break-inside: avoid !important;
        box-shadow: none !important;
        border: 1px solid var(--wwd-glass-border) !important;
        background: #ffffff !important;
    }
    .wwd-pdf-page-break {
        page-break-before: always !important;
        break-before: page !important;
        margin-top: 30px !important;
    }
}


/* Mode wide toggling */
.wwd-mode-wide {
    max-width: none !important;
    width: 100% !important;
}

.wwd-mode-wide .wwd-max-w-2xl {
    max-width: none !important;
}

.wwd-mode-wide .wwd-table-container {
    max-height: none !important;
}

.wwd-main-content {
    transition: max-width 0.4s ease;
}

/* New Views Styles */
.wwd-heatmap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 4px;
    padding: 1rem;
    background: rgba(0,0,0,0.2);
    border-radius: 0.5rem;
}
.wwd-heatmap-cell {
    aspect-ratio: 1;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.wwd-heatmap-cell:hover {
    transform: scale(1.2);
    z-index: 10;
    box-shadow: 0 0 15px var(--wwd-primary);
}
.wwd-heatmap-hot {
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
    animation: wwd-pulse 2s infinite;
}

/* Premium Effects */
.wwd-kpi-card.wwd-high-perf {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(99, 102, 241, 0.1) 100%), var(--wwd-glass-bg);
    border-color: var(--wwd-success);
}

.wwd-text-gradient-gold {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.wwd-glow-primary {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

@keyframes wwd-gradient-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.wwd-animate-gradient {
    background: linear-gradient(-45deg, #6366f1, #a855f7, #ec4899, #f43f5e);
    background-size: 400% 400%;
    animation: wwd-gradient-flow 15s ease infinite;
}

/* Responsive Grid fixes */
.wwd-grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 768px) {
    .wwd-grid-cols-2 {
        grid-template-columns: 1fr;
    }
}
/* Additional spacing utilities */
.wwd-ml-2 { margin-left: 0.5rem; }
.wwd-ml-4 { margin-left: 1rem; }
.wwd-mr-1 { margin-right: 0.25rem; }
.wwd-mt-3 { margin-top: 0.75rem; }
.wwd-mb-5 { margin-bottom: 1.25rem; }
.wwd-pb-2 { padding-bottom: 0.5rem; }
.wwd-px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.wwd-py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.wwd-space-y-1 > * + * { margin-top: 0.25rem; }
.wwd-space-y-2 > * + * { margin-top: 0.5rem; }
.wwd-space-y-4 > * + * { margin-top: 1rem; }
.wwd-space-y-6 > * + * { margin-top: 1.5rem; }
.wwd-inline-flex { display: inline-flex; }
.wwd-shrink-0 { flex-shrink: 0; }
/* Colors used inline in PHP/JS templates */
.wwd-bg-purple-900 { background-color: rgba(126, 34, 206, 0.2); }
.wwd-text-purple-400 { color: #c084fc; }
.wwd-bg-amber-900\/40 { background-color: rgba(120, 53, 15, 0.4); }
.wwd-text-amber-400 { color: #fbbf24; }
.wwd-text-amber-300\/90 { color: rgba(252, 211, 77, 0.9); }
.wwd-text-orange-400 { color: #fb923c; }
.wwd-bg-indigo-950\/80 { background-color: rgba(30, 27, 75, 0.8); }
.wwd-border-indigo-500\/40 { border-color: rgba(99, 102, 241, 0.4); }
.wwd-border-amber-600\/60 { border-color: rgba(217, 119, 6, 0.6); }
.wwd-border-orange-600\/60 { border-color: rgba(234, 88, 12, 0.6); }
.wwd-bg-amber-950\/30 { background-color: rgba(69, 26, 3, 0.3); }
.wwd-border-amber-800\/40 { border-color: rgba(146, 64, 14, 0.4); }
.wwd-max-h-64 { max-height: 16rem; }
.wwd-max-h-96 { max-height: 24rem; }
.wwd-py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.wwd-px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.wwd-mb-8 { margin-bottom: 2rem; }

/* Gantt Chart Styles */
.wwd-gantt-container {
    background: rgba(0,0,0,0.15);
    border-radius: 0.5rem;
    padding: 1rem;
    border: 1px solid var(--wwd-border);
}
.wwd-gantt-bar {
    display: flex;
    width: 100%;
    height: 48px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid var(--wwd-border);
}
.wwd-gantt-segment {
    height: 100%;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}
.wwd-gantt-segment:hover {
    filter: brightness(1.2);
    transform: scaleY(1.04);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
    z-index: 2;
}
.wwd-gantt-segment.active {
    background-color: var(--wwd-primary);
    opacity: 0.75;
}
.wwd-gantt-segment.active:hover {
    opacity: 1;
}
.wwd-gantt-segment.downtime {
    background-color: var(--wwd-danger);
    opacity: 0.75;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
}
.wwd-gantt-segment.downtime:hover {
    opacity: 1;
    box-shadow: 0 0 12px var(--wwd-danger);
}

.wwd-print-hidden {
    display: none !important;
}

/* Downtime Timeline View Styles */
.wwd-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--wwd-text-gray);
    font-weight: 500;
}
.wwd-legend-dot {
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 50%;
    display: inline-block;
}
.wwd-user-timeline-card {
    background: var(--wwd-glass-bg);
    border: 1px solid var(--wwd-border);
    border-radius: 0.75rem;
    padding: 1.25rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.wwd-user-timeline-card:hover {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

/* Step Pipeline Styles */
.wwd-step-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #94a3b8;
    font-size: 0.75rem;
    transition: all 0.3s ease;
}
.wwd-step-item.wwd-step-active {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.4);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}
.wwd-step-item.wwd-step-done {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
}
.wwd-step-number {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}
.wwd-step-active .wwd-step-number {
    background: var(--wwd-primary);
    color: #ffffff;
}
.wwd-step-done .wwd-step-number {
    background: #10b981;
    color: #ffffff;
}






