/* --- Global styles and Variables --- */
:root {
    --bg-dark: #090d16;
    --bg-panel: rgba(17, 24, 39, 0.55);
    --border-color: rgba(255, 255, 255, 0.07);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    
    --primary: #06b6d4; /* Vibrant Cyan */
    --primary-hover: #0891b2;
    --primary-glow: rgba(6, 182, 212, 0.25);
    
    --purple: #8b5cf6; /* Vibrant Violet */
    --purple-glow: rgba(139, 92, 246, 0.2);
    
    --success: #10b981; /* Emerald Green */
    --success-glow: rgba(16, 185, 129, 0.2);
    
    --warning: #f59e0b; /* Amber */
    
    --danger: #ef4444; /* Rose Red */
    --danger-glow: rgba(239, 68, 68, 0.25);
    
    --glass-blur: blur(20px);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-stack: 'Outfit', 'Noto Sans SC', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-stack);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Glassmorphism Background Effect */
.glass-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    background: radial-gradient(circle at 10% 20%, rgba(6, 182, 212, 0.08) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.08) 0%, transparent 40%),
                radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.03) 0%, transparent 50%);
    background-color: #0b0f19;
}

/* Scrollbar customizations */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* --- Header & Tab Navigation --- */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(15, 23, 42, 0.4);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: var(--glass-blur);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 28px;
    height: 28px;
    color: var(--primary);
    filter: drop-shadow(0 0 8px var(--primary-glow));
    animation: pulse 3s infinite alternate;
}

.logo-area h1 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    background: linear-gradient(to right, var(--text-primary), #a5f3fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.25rem;
    border-radius: 9999px;
    border: 1px solid var(--border-color);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition-smooth);
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.header-status {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.02);
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--success);
    animation: indicatorPulse 2s infinite;
}

.clock {
    font-weight: 600;
    font-family: monospace;
    font-size: 1rem;
    color: var(--primary);
}

/* --- Views and Layouts --- */
.main-content {
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
}

.tab-view {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.tab-view.active {
    display: block;
}

/* General Frosted Glass Panel class */
.glass {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    backdrop-filter: var(--glass-blur);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: var(--transition-smooth);
}

.glass:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.4);
}

/* --- KPI Metric Cards --- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kpi-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
}

.kpi-card.warning::before { background: var(--danger); }
.kpi-card.highlight::before { background: var(--purple); }
.kpi-card.success::before { background: var(--success); }
#kpi-pending-delivery-card::before { background: var(--warning); }

.kpi-info h3 {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.kpi-info .value {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 0.25rem;
}

/* 双值 KPI 样式（"XX个订单 XX件产品"） */
.kpi-info .value {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 2px;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 0.25rem;
}
.v-main {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}
.v-main-sm {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-left: 6px;
}
.v-unit {
    font-size: 0.58em;
    font-weight: 400;
    color: var(--text-secondary);
    margin: 0 2px;
}

.kpi-info .subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.kpi-icon {
    font-size: 2.5rem;
    opacity: 0.25;
    transition: var(--transition-smooth);
}

.kpi-card:hover .kpi-icon {
    opacity: 0.6;
    transform: scale(1.1);
}

/* --- Charts Section --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-container h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
    border-left: 3px solid var(--primary);
    padding-left: 0.5rem;
}

.canvas-wrapper {
    position: relative;
    height: 280px;
    width: 100%;
}

/* --- Tables & Lists --- */
.table-container {
    overflow-x: auto;
    margin-top: 1rem;
}

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

.data-table th, .data-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.text-center { text-align: center; }

/* Status Badges */
.badge {
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.badge.success {
    background: var(--success-glow);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge.primary {
    background: var(--primary-glow);
    color: var(--primary);
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge.danger {
    background: var(--danger-glow);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* --- Daily Logs Tab Layout --- */
.logs-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 1.5rem;
    align-items: start;
}

.table-scroll {
    max-height: 520px;
    overflow-y: auto;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

/* --- Form Fields & Design --- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    font-family: var(--font-stack);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition-smooth);
}

.form-group input:focus, 
.form-group select:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* --- Buttons --- */
.btn {
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn.primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #fff;
    border: none;
    box-shadow: 0 4px 10px rgba(6, 182, 212, 0.25);
}

.btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(6, 182, 212, 0.35);
}

.btn.secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn.secondary:hover {
    background: rgba(255, 255, 255, 0.09);
}

/* Action items in headers */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.filter-group {
    display: flex;
    gap: 0.75rem;
}

.filter-group input, .filter-group select {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    font-size: 0.85rem;
    outline: none;
}

.filter-group input:focus, .filter-group select:focus {
    border-color: var(--primary);
}

.action-btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    border: none;
    transition: var(--transition-smooth);
}

.action-btn.primary {
    background: var(--primary);
    color: #fff;
}
.action-btn.primary:hover { background-color: var(--primary-hover); }

/* --- Gantt Timeline Design --- */
.gantt-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.gantt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.gantt-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.gantt-legend {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.legend-color {
    width: 14px;
    height: 10px;
    border-radius: 3px;
    display: inline-block;
}

.legend-color.plan { background: rgba(6, 182, 212, 0.25); border: 1px solid var(--primary); }
.legend-color.actual { background: rgba(16, 185, 129, 0.45); border: 1px solid var(--success); }
.legend-color.delayed { background: rgba(239, 68, 68, 0.4); border: 1px solid var(--danger); }

.search-box input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 0.45rem 0.85rem;
    border-radius: 6px;
    font-size: 0.85rem;
    width: 240px;
    outline: none;
}

.search-box input:focus {
    border-color: var(--primary);
}

.gantt-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 55vh;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.15);
}

.gantt-timeline-header {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-dark);
    position: sticky;
    top: 0;
    z-index: 30;
    width: max-content;
    min-width: 100%;
    overflow-x: hidden;
    overflow-y: visible;
}

.gantt-col-name {
    width: 240px;
    min-width: 240px;
    padding: 0.75rem 1rem;
    border-right: 1px solid var(--border-color);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    position: sticky;
    left: 0;
    z-index: 22;
    background: var(--bg-dark);
}

.gantt-col-dates {
    display: flex;
    flex-grow: 1;
}

.gantt-date-cell {
    width: 32px;
    min-width: 32px;
    text-align: center;
    padding: 0.5rem 0;
    font-size: 0.7rem;
    color: var(--text-secondary);
    border-right: 1px dashed rgba(255, 255, 255, 0.04);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.gantt-date-cell.today-line {
    background: rgba(6, 182, 212, 0.06);
    color: var(--primary);
    font-weight: 700;
    border-right: 1px solid var(--primary);
}

.gantt-date-cell span {
    font-size: 0.6rem;
    opacity: 0.7;
}

/* Gantt Row styling */
.gantt-row {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    width: max-content;
    min-width: 100%;
}

.gantt-order-header {
    display: flex;
    align-items: center;
    width: 240px;
    min-width: 240px;
    padding: 0.75rem 1rem;
    border-right: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.85rem;
    background: var(--bg-dark);
    cursor: pointer;
    justify-content: space-between;
    transition: var(--transition-smooth);
    position: sticky;
    left: 0;
    z-index: 15;
}

.gantt-order-header:hover {
    background: #121824;
}

.gantt-order-info {
    display: flex;
    flex-direction: column;
}

.gantt-order-info .order-spec {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-top: 0.15rem;
}

.gantt-expand-icon {
    font-size: 0.75rem;
    transition: transform 0.3s;
    color: var(--text-secondary);
}

.gantt-row.expanded .gantt-expand-icon {
    transform: rotate(90deg);
}

/* Sub-process Gantt Row */
.gantt-subrows-wrapper {
    display: none;
    background: rgba(0, 0, 0, 0.2);
}

.gantt-row.expanded + .gantt-subrows-wrapper {
    display: block;
}

.gantt-subrow {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    width: max-content;
    min-width: 100%;
}

.gantt-proc-title {
    width: 240px;
    min-width: 240px;
    padding: 0.5rem 1.5rem;
    border-right: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    position: sticky;
    left: 0;
    z-index: 15;
    background: var(--bg-dark);
}

.gantt-timeline-cells {
    display: flex;
    flex-grow: 1;
    position: relative;
    padding: 0.4rem 0;
    min-height: 36px;
}

/* Gantt Bar Capsule styles */
.gantt-bar {
    position: absolute;
    height: 8px;
    border-radius: 4px;
    transition: var(--transition-smooth);
    z-index: 5;
}

.gantt-bar.plan-bar {
    background: rgba(6, 182, 212, 0.15);
    border: 1px solid var(--primary);
    top: 6px;
}

.gantt-bar.actual-bar {
    background: rgba(16, 185, 129, 0.4);
    border: 1px solid var(--success);
    top: 18px;
}

.gantt-bar.actual-bar.delayed {
    background: rgba(239, 68, 68, 0.3);
    border: 1px solid var(--danger);
}

.gantt-bar:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.95);
    color: #fff;
    border: 1px solid var(--border-color);
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* Grid ticks behind bars */
.gantt-grid-tick {
    width: 32px;
    min-width: 32px;
    border-right: 1px dashed rgba(255, 255, 255, 0.02);
    height: 100%;
}

.gantt-grid-tick.today-line {
    background: rgba(6, 182, 212, 0.015);
    border-right: 1px solid rgba(6, 182, 212, 0.3);
}

/* --- Modals (Edit Form popups) --- */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-backdrop.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    width: 680px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 20px;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 订单弹窗加宽版（用于展示交付批次页签） */
.modal-content-wide {
    width: 820px;
}

.modal-backdrop.active .modal-content {
    transform: scale(1);
}

/* 工序并行作业提示 */
.parallel-hint {
    background: rgba(6, 182, 212, 0.08);
    border-left: 3px solid var(--primary);
    border-radius: 6px;
    padding: 0.7rem 0.9rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

/* 交付批次相关样式 */
.delivery-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.delivery-summary .ds-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    text-align: center;
}

.delivery-summary .ds-card .ds-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 0.25rem;
}

.delivery-summary .ds-card .ds-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.delivery-summary .ds-card.success .ds-value { color: var(--success); }
.delivery-summary .ds-card.warning .ds-value { color: var(--warning); }
.delivery-summary .ds-card.primary .ds-value { color: var(--primary); }

.delivery-section {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border-color);
}

.delivery-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.85rem;
    color: var(--text-primary);
}

/* 订单列表中的交付进度条 */
.delivery-progress {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.delivery-progress .dp-bar {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    overflow: hidden;
    min-width: 50px;
}

.delivery-progress .dp-bar .dp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    border-radius: 3px;
    transition: width 0.4s ease;
}

.delivery-progress .dp-text {
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
}

.modal-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.close-btn:hover { color: #fff; }

.modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.25rem;
    gap: 1.25rem;
}

.modal-tabs button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 0.25rem;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
    border-bottom: 2px solid transparent;
    transition: var(--transition-smooth);
}

.modal-tabs button:hover { color: #fff; }

.modal-tabs button.modal-tabactive {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.modal-tab-view {
    display: none;
}

.modal-tab-view.active {
    display: block;
}

/* Schedule inner layout */
.process-schedule-table {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(0,0,0,0.1);
    overflow: hidden;
}

.table-header-row, .process-row {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.process-row:last-child {
    border-bottom: none;
}

.cell {
    padding: 0.65rem 0.5rem;
    font-size: 0.85rem;
}

.cell.header {
    font-weight: 600;
    color: var(--text-secondary);
}

.cell.title {
    width: 90px;
    min-width: 90px;
    font-weight: 600;
    text-align: center;
}

.cell.date-input {
    flex-grow: 1;
}

.cell.date-input input {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 0.4rem;
    border-radius: 6px;
    width: 100%;
    outline: none;
    font-size: 0.8rem;
    transition: var(--transition-smooth);
}

.cell.date-input input:focus { border-color: var(--primary); }

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

/* --- Notifications --- */
.toast-message {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 0.85rem 1.5rem;
    border-radius: 10px;
    z-index: 2000;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    backdrop-filter: var(--glass-blur);
    display: none;
    animation: slideUp 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

.toast-message.success { border-left: 4px solid var(--success); }
.toast-message.error { border-left: 4px solid var(--danger); }

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

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

@keyframes indicatorPulse {
    0% { transform: scale(0.9); opacity: 0.6; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.6; }
}

@keyframes pulse {
    0% { transform: scale(1); filter: drop-shadow(0 0 4px var(--primary-glow)); }
    100% { transform: scale(1.05); filter: drop-shadow(0 0 12px var(--primary)); }
}

/* Action button edit/delete inside tables */
.row-actions {
    display: flex;
    gap: 0.5rem;
}

.table-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: var(--transition-smooth);
}

.table-btn.edit {
    color: var(--primary);
    background: var(--primary-glow);
    border: 1px solid rgba(6, 182, 212, 0.2);
}
.table-btn.edit:hover { background-color: rgba(6, 182, 212, 0.3); }

.table-btn.delete {
    color: var(--danger);
    background: var(--danger-glow);
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.table-btn.delete:hover { background-color: rgba(239, 68, 68, 0.35); }

/* --- Theme Toggle Button Styling --- */
.theme-toggle-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: var(--transition-smooth);
    outline: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.theme-toggle-btn:hover {
    transform: rotate(30deg) scale(1.08);
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
}

/* --- Light Theme Variables & Overrides --- */
body.light-theme {
    --bg-dark: #f1f5f9;
    --bg-panel: rgba(255, 255, 255, 0.65);
    --border-color: rgba(15, 23, 42, 0.08);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    
    --primary: #0891b2;
    --primary-hover: #0369a1;
    --primary-glow: rgba(8, 145, 178, 0.15);
    
    --purple: #6d28d9;
    --purple-glow: rgba(109, 40, 217, 0.12);
    
    --success: #059669;
    --success-glow: rgba(5, 150, 105, 0.12);
    
    --warning: #d97706;
    
    --danger: #dc2626;
    --danger-glow: rgba(220, 38, 38, 0.12);
    
    --glass-blur: blur(25px);
}

body.light-theme .glass-bg {
    background: radial-gradient(circle at 10% 20%, rgba(6, 182, 212, 0.05) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 40%),
                radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.02) 0%, transparent 50%);
    background-color: #f8fafc;
}

body.light-theme .glass {
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.05);
}

body.light-theme .glass:hover {
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.08);
    border-color: rgba(15, 23, 42, 0.15);
}

body.light-theme .app-header {
    background: rgba(248, 250, 252, 0.65);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.03);
}

body.light-theme .tab-btn:hover {
    background: rgba(15, 23, 42, 0.04);
}

body.light-theme .tab-btn.active {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.25);
}

body.light-theme .clock {
    color: var(--primary);
}

body.light-theme .data-table tbody tr:hover {
    background: rgba(15, 23, 42, 0.02);
}

body.light-theme .form-group input, 
body.light-theme .form-group select, 
body.light-theme .form-group textarea {
    background: rgba(0, 0, 0, 0.02);
    color: var(--text-primary);
}

body.light-theme .form-group input:focus, 
body.light-theme .form-group select:focus {
    background: #fff;
    box-shadow: 0 0 10px rgba(8, 145, 178, 0.12);
}

body.light-theme .form-group label {
    color: var(--text-secondary);
}

body.light-theme .gantt-wrapper {
    background: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

body.light-theme .gantt-timeline-header {
    background: var(--bg-dark);
}

body.light-theme .gantt-order-header {
    background: var(--bg-dark);
}

body.light-theme .gantt-order-header:hover {
    background: #e2e8f0;
}

body.light-theme .gantt-proc-title {
    background: var(--bg-dark);
}

body.light-theme .gantt-subrows-wrapper {
    background: rgba(0, 0, 0, 0.01);
}

body.light-theme .gantt-date-cell.today-line {
    background: rgba(8, 145, 178, 0.06);
}

body.light-theme .gantt-grid-tick {
    border-right-color: rgba(0, 0, 0, 0.03);
}

body.light-theme .gantt-grid-tick.today-line {
    background: rgba(8, 145, 178, 0.015);
    border-right-color: rgba(8, 145, 178, 0.25);
}

body.light-theme .gantt-bar.plan-bar {
    background: rgba(8, 145, 178, 0.12);
}

body.light-theme .gantt-bar.actual-bar {
    background: rgba(5, 150, 105, 0.35);
}

body.light-theme .gantt-bar.actual-bar.delayed {
    background: rgba(220, 38, 38, 0.25);
}

body.light-theme .gantt-bar:hover::after {
    background: #fff;
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

body.light-theme .modal-backdrop {
    background: rgba(15, 23, 42, 0.4);
}

body.light-theme .process-schedule-table {
    background: rgba(0, 0, 0, 0.02);
}

body.light-theme .cell.date-input input {
    background: #fff;
    color: var(--text-primary);
}

body.light-theme .toast-message {
    background: #fff;
    color: var(--text-primary);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

body.light-theme .btn.secondary {
    background: rgba(0, 0, 0, 0.02);
    color: var(--text-primary);
}

body.light-theme .btn.secondary:hover {
    background: rgba(0, 0, 0, 0.05);
}

body.light-theme .filter-group input, 
body.light-theme .filter-group select {
    background: rgba(0, 0, 0, 0.02);
    color: var(--text-primary);
}

body.light-theme .search-box input {
    background: rgba(0, 0, 0, 0.02);
    color: var(--text-primary);
}

body.light-theme .search-box input:focus {
    background: #fff;
}

