/* ==========================================================================
   CSS RESET & VARIABLES (Modern Premium Light/White Theme)
   ========================================================================== */
:root {
    --bg-main: #f8fafc; /* Light Slate background */
    --bg-card: #ffffff; /* Pure White Card background */
    --border-color: #e2e8f0; /* Soft Slate Border */
    --border-color-hover: #cbd5e1;
    
    --text-primary: #0f172a; /* Dark Slate text */
    --text-secondary: #475569; /* Slate 600 */
    --text-muted: #94a3b8; /* Slate 400 */
    
    --primary: #4f46e5; /* Premium Indigo */
    --primary-glow: rgba(79, 70, 229, 0.08);
    --primary-hover: #4338ca;
    
    --success: #10b981; /* Emerald */
    --success-bg: rgba(16, 185, 129, 0.1);
    --info: #eab308; /* Yellow/Gold for In Progress */
    --info-bg: rgba(234, 179, 8, 0.1);
    --warning: #d97706; /* Amber (darker for readability in light mode) */
    --warning-bg: rgba(217, 119, 6, 0.1);
    --danger: #ef4444; /* Rose Red */
    --danger-bg: rgba(239, 68, 68, 0.1);
    
    --font-heading: 'Outfit', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    /* Subtle premium light shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 12px 24px -4px rgba(15, 23, 42, 0.12), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

/* Custom Webkit scrollbar for premium feel */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Background glowing meshes (adjusted for light theme to look extremely soft) */
.bg-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.06;
    z-index: -1;
    pointer-events: none;
}
.bg-glow-1 {
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    top: -200px;
    left: -100px;
}
.bg-glow-2 {
    background: radial-gradient(circle, var(--info) 0%, transparent 70%);
    bottom: -100px;
    right: -100px;
}

/* ==========================================================================
   APP CONTAINER & LAYOUT
   ========================================================================== */
.app-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   HEADER / NAVBAR
   ========================================================================== */
.app-header {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}
.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--info) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}
.logo-icon i {
    width: 22px;
    height: 22px;
}
.logo-text h1 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 1px;
    line-height: 1.2;
}
.logo-text h1 span {
    background: linear-gradient(90deg, var(--primary) 0%, var(--info) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.logo-text p {
    font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

/* View Switcher */
.view-switcher-container {
    display: flex;
    background: #f1f5f9; /* Soft grey background */
    padding: 5px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
}
.switcher-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 18px;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-fast);
}
.switcher-btn i {
    width: 16px;
    height: 16px;
}
.switcher-btn:hover {
    color: var(--text-primary);
}
.switcher-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

/* Header Actions */
.header-actions {
    display: flex;
    gap: 10px;
}

/* ==========================================================================
   BUTTONS & GENERAL UI ELEMENTS
   ========================================================================== */
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition-fast);
}
.action-btn i {
    width: 16px;
    height: 16px;
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.15);
}
.primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.secondary-btn {
    background: #ffffff;
    border-color: var(--border-color);
    color: var(--text-secondary);
}
.secondary-btn:hover {
    background: #f8fafc;
    border-color: var(--border-color-hover);
    color: var(--text-primary);
}

.danger-btn {
    background: var(--danger-bg);
    border-color: rgba(239, 68, 68, 0.2);
    color: #b91c1c;
}
.danger-btn:hover {
    background: var(--danger);
    color: white;
}

.icon-btn-secondary {
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}
.icon-btn-secondary:hover {
    background: #f8fafc;
    border-color: var(--border-color-hover);
    color: var(--text-primary);
}

/* ==========================================================================
   VIEW SECTIONS (MANAGER & STAFF)
   ========================================================================== */
.view-section {
    display: none;
    flex-direction: column;
    gap: 24px;
    animation: fadeIn var(--transition-normal);
}
.view-section.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   STAT CARDS ROW
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-color-hover);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}
.stat-icon i {
    width: 20px;
    height: 20px;
}

.stat-info {
    display: flex;
    flex-direction: column;
}
.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}
.stat-info h2 {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Stat colors mapping */
.total-tasks .stat-icon { background: rgba(79, 70, 229, 0.1); color: var(--primary); }
.status-not-started .stat-icon { background: rgba(148, 163, 184, 0.15); color: var(--text-secondary); }
.status-in-progress .stat-icon { background: var(--info-bg); color: #854d0e; }
.status-delayed .stat-icon { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.status-done .stat-icon { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.total-qty .stat-icon { background: rgba(217, 119, 6, 0.1); color: var(--warning); }

/* ==========================================================================
   PANELS & CONTAINERS
   ========================================================================== */
.dashboard-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafaf9; /* Clean subtle background header */
}
.panel-header h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}
.panel-header h3 i {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.panel-body {
    padding: 20px 24px;
    flex: 1;
}

/* Middle Layout Grid */
.dashboard-middle-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 20px;
}

/* ==========================================================================
   TABLE DESIGN
   ========================================================================== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    padding: 12px 16px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    background: #f8fafc;
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: #f8fafc;
}

.empty-text {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 0 !important;
    font-style: italic;
}

/* Progress bar in tables */
.progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 120px;
}
.progress-bar-wrapper {
    flex: 1;
    height: 6px;
    background: #e2e8f0;
    border-radius: var(--radius-full);
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--info) 100%);
    border-radius: var(--radius-full);
    width: 0%;
    transition: width var(--transition-normal);
}
.progress-text {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 32px;
}

/* Badges styling */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
}
.badge-status {
    border: 1px solid transparent;
}
.badge-status.done {
    background: var(--success-bg);
    border-color: rgba(16, 185, 129, 0.2);
    color: #047857; /* Dark emerald */
}
.badge-status.in-progress {
    background: var(--info-bg);
    border-color: rgba(234, 179, 8, 0.2);
    color: #854d0e; /* Dark gold/yellow */
}
.badge-status.not-started {
    background: rgba(148, 163, 184, 0.15);
    border-color: rgba(148, 163, 184, 0.3);
    color: #334155;
}
.badge-status.delayed {
    background: var(--danger-bg);
    border-color: rgba(239, 68, 68, 0.2);
    color: #b91c1c; /* Dark red */
}

.badge-tag {
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.table-action-btns {
    display: flex;
    gap: 6px;
}
.table-action-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}
.table-action-btn:hover {
    background: #f1f5f9;
}
.table-action-btn.edit:hover {
    color: var(--primary);
}
.table-action-btn.delete:hover {
    color: var(--danger);
}
.table-action-btn i {
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   STAFF WORKLOAD PANEL
   ========================================================================== */
.workload-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.workload-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.workload-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}
.workload-name {
    font-weight: 600;
    color: var(--text-primary);
}
.workload-count {
    color: var(--text-secondary);
    font-size: 12px;
}
.workload-bar-container {
    height: 10px;
    background: #e2e8f0;
    border-radius: var(--radius-full);
    overflow: hidden;
    display: flex;
}
.workload-segment {
    height: 100%;
    transition: width var(--transition-normal);
}
.workload-segment.done { background-color: var(--success); }
.workload-segment.in-progress { background-color: var(--info); }
.workload-segment.delayed { background-color: var(--danger); }
.workload-segment.not-started { background-color: #cbd5e1; } /* Slate 300 for grey */

/* ==========================================================================
   TABS & FILTER HEADER IN DETAIL PANEL
   ========================================================================== */
.tabs-header {
    padding: 0;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: stretch;
    border-bottom: 1px solid var(--border-color);
    background: #fafaf9;
}
.panel-title-tabs {
    display: flex;
    height: 54px;
}
.tab-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    padding: 0 24px;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
    transition: var(--transition-fast);
}
.tab-btn:hover {
    color: var(--text-primary);
    background: #f1f5f9;
}
.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}
.tab-btn i {
    width: 16px;
    height: 16px;
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 24px;
}
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}
.search-box i {
    position: absolute;
    left: 10px;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}
.search-box input {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 6px 12px 6px 32px;
    font-size: 13px;
    outline: none;
    width: 200px;
    transition: var(--transition-fast);
}
.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
    width: 240px;
}

.filter-select {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 6px 12px;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    transition: var(--transition-fast);
}
.filter-select:focus {
    border-color: var(--primary);
}

.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}

/* ==========================================================================
   TIMELINE / GANTT CHART COMPONENT
   ========================================================================== */
.timeline-header-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}
.timeline-header-controls span {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
}

.gantt-chart-container {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #f8fafc;
    position: relative;
}

.gantt-chart {
    min-width: 900px;
    display: grid;
    grid-template-columns: 240px 1fr;
}

/* Gantt Columns and Headers */
.gantt-head-left {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--text-secondary);
    background: #fafaf9;
}
.gantt-head-days {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}
.gantt-day-cell {
    flex: 1;
    min-width: 24px;
    text-align: center;
    padding: 12px 0;
    font-size: 11px;
    border-right: 1px solid rgba(0, 0, 0, 0.03);
    color: var(--text-muted);
    background: #fafaf9;
}
.gantt-day-cell.today {
    background: rgba(79, 70, 229, 0.1) !important;
    color: var(--primary);
    font-weight: 700;
}
.gantt-day-cell.weekend {
    background: #f5f5f4;
}

/* Gantt Rows */
.gantt-row {
    display: contents;
}
.gantt-task-info {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #ffffff;
}
.gantt-task-title {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gantt-task-subtitle {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.gantt-bar-cell {
    position: relative;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    background: #ffffff;
}

.gantt-bar {
    height: 24px;
    border-radius: var(--radius-sm);
    background: var(--primary);
    display: flex;
    align-items: center;
    padding: 0 10px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: transform var(--transition-fast), filter var(--transition-fast);
}
.gantt-bar:hover {
    transform: scaleY(1.05);
    filter: brightness(1.1);
}

/* Gantt Bar colors mapping */
.gantt-bar.done { background: linear-gradient(90deg, #10b981 0%, #059669 100%); }
.gantt-bar.in-progress { background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%); }
.gantt-bar.delayed { background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%); }
.gantt-bar.not-started { background: linear-gradient(90deg, #64748b 0%, #475569 100%); }

/* ==========================================================================
   STAFF VIEW: CONTROL BAR
   ========================================================================== */
.staff-control-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 16px 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.staff-selector-area {
    display: flex;
    align-items: center;
    gap: 10px;
}
.staff-selector-area label {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}
.staff-selector-area label i {
    color: var(--primary);
    width: 18px;
    height: 18px;
}
.staff-select {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    outline: none;
    min-width: 180px;
    cursor: pointer;
    transition: var(--transition-fast);
}
.staff-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

/* ==========================================================================
   KANBAN BOARD COMPONENT
   ========================================================================== */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    align-items: stretch;
}

.kanban-column {
    background: #f1f5f9; /* Slate 100 column background */
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 280px);
    overflow: hidden;
}

.column-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    background: #f8fafc;
}
.column-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.column-header h4 {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 13.5px;
    color: var(--text-primary);
}
.column-count {
    background: #ffffff;
    border: 1px solid var(--border-color);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
}

.not-started-header .column-indicator { background: var(--text-muted); }
.in-progress-header .column-indicator { background: var(--info); }
.delayed-header .column-indicator { background: var(--danger); }
.done-header .column-indicator { background: var(--success); }

/* Cards Container and Dragging state */
.kanban-cards-container {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    overflow-y: auto;
    transition: background-color var(--transition-fast);
}
.kanban-cards-container.drag-over {
    background-color: rgba(79, 70, 229, 0.05);
    outline: 2px dashed rgba(79, 70, 229, 0.3);
    outline-offset: -4px;
}

/* Kanban Card */
.kanban-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    cursor: grab;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.kanban-card:active {
    cursor: grabbing;
}
.kanban-card.dragging {
    opacity: 0.5;
    transform: scale(0.98);
}
.kanban-card:hover {
    border-color: var(--border-color-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

/* Top bar of Kanban Card */
.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.card-tag {
    font-size: 10px;
    padding: 1px 6px;
}
.card-tag.type-tag {
    background: rgba(79, 70, 229, 0.08);
    color: var(--primary);
    border: 1px solid rgba(79, 70, 229, 0.15);
}

.card-title {
    font-weight: 600;
    font-size: 13.5px;
    color: var(--text-primary);
    line-height: 1.4;
}

.card-project-info {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.card-project-info span {
    display: flex;
    align-items: center;
    gap: 4px;
}
.card-project-info i {
    width: 12px;
    height: 12px;
    color: var(--text-muted);
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 8px;
    margin-top: 4px;
}

.card-qty-dates {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
}
.card-qty {
    font-weight: 700;
    color: var(--warning);
}
.card-dates {
    color: var(--text-muted);
}

.card-actions {
    display: flex;
    gap: 4px;
}

/* Status-specific left borders for kanban cards */
.kanban-column[data-status="Not Started"] .kanban-card { border-left: 3px solid var(--text-muted); }
.kanban-column[data-status="In Progress"] .kanban-card { border-left: 3px solid var(--info); }
.kanban-column[data-status="Delayed"] .kanban-card { border-left: 3px solid var(--danger); }
.kanban-column[data-status="Done"] .kanban-card { border-left: 3px solid var(--success); }

/* ==========================================================================
   MODAL WINDOW (POPUP FORM)
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4); /* Slate translucent overlay */
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity var(--transition-normal);
}
.modal-backdrop.active {
    display: flex;
    opacity: 1;
}

.modal-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 600px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transform: translateY(20px);
    transition: transform var(--transition-normal);
}
.modal-backdrop.active .modal-card {
    transform: translateY(0);
}

.modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafaf9;
}
.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}
.close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}
.close-btn:hover {
    background: #f1f5f9;
    color: var(--text-primary);
}
.close-btn i {
    width: 18px;
    height: 18px;
}

/* Form Styling */
#task-form {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-group label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
}
.form-group label .required {
    color: var(--danger);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 10px 14px;
    font-size: 13.5px;
    font-family: var(--font-body);
    outline: none;
    transition: var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.form-row {
    display: flex;
    gap: 16px;
}
.flex-row { flex-direction: row; }
.flex-1 { flex: 1; }
.w-80 { width: 90px; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
}

/* ==========================================================================
   TOAST MESSAGE
   ========================================================================== */
.toast-message {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1100;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transform: translateY(20px);
    transition: transform var(--transition-normal), opacity var(--transition-normal);
    pointer-events: none;
}
.toast-message.active {
    opacity: 1;
    transform: translateY(0);
}
.toast-message.success { border-left-color: var(--success); }
.toast-message.error { border-left-color: var(--danger); }

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES
   ========================================================================== */
@media (max-width: 1200px) {
    .kanban-board {
        grid-template-columns: repeat(2, 1fr);
    }
    .kanban-column {
        max-height: 500px;
    }
}

@media (max-width: 992px) {
    .dashboard-middle-grid {
        grid-template-columns: 1fr;
    }
    .app-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    .logo-area {
        justify-content: center;
    }
    .view-switcher-container {
        justify-content: center;
    }
    .header-actions {
        justify-content: center;
    }
    .tabs-header {
        flex-direction: column;
    }
    .filter-controls {
        padding: 16px 20px;
        flex-wrap: wrap;
    }
}

@media (max-width: 600px) {
    .kanban-board {
        grid-template-columns: 1fr;
    }
    .flex-row {
        flex-direction: column;
    }
    .w-80 {
        width: 100%;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .view-switcher-container {
        flex-direction: column;
        border-radius: var(--radius-md);
    }
    .switcher-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================================
   PROJECT ON HAND LIST STYLES
   ========================================================================== */
.project-details-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.project-code-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.project-code {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 13.5px;
}
.project-type-tag {
    font-size: 10px;
    padding: 1px 6px;
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 600;
}
.project-name {
    font-size: 11.5px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

.bom-info-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 12px;
}
.bom-rev {
    font-weight: 600;
    color: var(--text-primary);
}
.bom-date {
    color: var(--text-muted);
    font-size: 11px;
}

.date-cell-iconic {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
}
.date-row {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
}
.date-row i {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
}
.date-row.testing i {
    color: var(--primary);
}
.date-row.ship i {
    color: var(--success);
}
.date-row.assembly i {
    color: #eab308; /* Yellow/Gold for assembly icon */
}

.pm-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary);
}
.avatar-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
}

.badge-priority {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-priority.high {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.badge-priority.medium {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.2);
}
.badge-priority.low {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.status-progress-cell {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 140px;
}
.status-badge-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.overdue-text {
    color: var(--danger);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
    font-size: 10px;
}

.view-details-link {
    transition: transform var(--transition-fast);
}
.view-details-link:hover {
    transform: translateX(2px);
}



