/* Modern Premium Styling for Garment Production Stage Tracking System */
:root {
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    
    --success: #10b981;
    --success-light: #ecfdf5;
    
    --danger: #ef4444;
    --danger-light: #fef2f2;
    
    --warning: #f59e0b;
    --warning-light: #fffbeb;

    /* Stage Colors (Cairo Custom Palette) */
    --stage-0: #3b82f6;       /* Design (Blue) */
    --stage-0-light: #eff6ff;
    --stage-0-bg: #dbeafe;
    
    --stage-1: #db2777;       /* Sublimation (Magenta/Pink) */
    --stage-1-light: #fdf2f8;
    --stage-1-bg: #fce7f3;
    
    --stage-2: #f97316;       /* Cutting (Orange) */
    --stage-2-light: #fff7ed;
    --stage-2-bg: #ffedd5;
    
    --stage-4: #8b5cf6;       /* Sewing (Purple) */
    --stage-4-light: #f5f3ff;
    --stage-4-bg: #ede9fe;
    
    --stage-5: #d946ef;       /* Logo Printing (Pink/Violet) */
    --stage-5-light: #fdf4ff;
    --stage-5-bg: #fae8ff;
    
    --stage-6: #059669;       /* Delivery (Green) */
    --stage-6-light: #ecfdf5;
    --stage-6-bg: #d1fae5;

    /* Sidebar Theme (Premium Dark Indigo) */
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active: #4f46e5;
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #ffffff;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-premium: 0 20px 25px -5px rgba(79, 70, 229, 0.05), 0 8px 10px -6px rgba(79, 70, 229, 0.05);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Tajawal', 'Cairo', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    height: 100vh;
}

/* App Layout Grid */
.app-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: 100vh;
    width: 100vw;
}

/* Sidebar Styling */
.sidebar {
    background-color: var(--sidebar-bg);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 10;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 8px 24px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 24px;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.logo-icon svg {
    width: 24px;
    height: 24px;
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(to left, #ffffff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    text-align: right;
    transition: var(--transition);
    width: 100%;
}

.nav-btn svg {
    width: 20px;
    height: 20px;
    opacity: 0.7;
    transition: var(--transition);
}

.nav-btn:hover {
    background-color: var(--sidebar-hover);
    color: #ffffff;
}

.nav-btn:hover svg {
    opacity: 1;
}

.nav-btn.active {
    background-color: var(--sidebar-active);
    color: var(--sidebar-text-active);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.nav-btn.active svg {
    opacity: 1;
}

.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    box-shadow: 0 0 10px rgba(79, 70, 229, 0.2);
}

.user-info .name {
    font-size: 14px;
    font-weight: 600;
    color: white;
}

.user-info .role {
    font-size: 12px;
    color: var(--text-muted);
}

/* Main Content Area */
.main-content {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    height: 100vh;
}

/* Header */
.main-header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 5;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.9);
}

.header-title h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 4px;
}

.header-title p {
    font-size: 14px;
    color: var(--text-muted);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #0f172a;
    color: white;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.btn-secondary:hover {
    background-color: #1e293b;
    transform: translateY(-1px);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--text-color);
}

.btn-outline:hover {
    background-color: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
    padding: 4px;
    border-radius: 50%;
}

.btn-close:hover {
    background-color: var(--border-color);
    color: var(--text-color);
}

/* Content Body */
.content-body {
    padding: 32px;
    flex-grow: 1;
}

.content-section {
    display: none;
    animation: fadeIn 0.4s ease;
}

.content-section.active {
    display: block;
}

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

/* Dashboard screen components */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background-color: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.card-design::after { background-color: var(--stage-0); }
.card-printing::after { background-color: var(--stage-1); }
.card-sewing::after { background-color: var(--success); }
.card-delivery::after { background-color: var(--stage-4); }

.card-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-design .card-icon { background-color: var(--stage-0-light); color: var(--stage-0); }
.card-printing .card-icon { background-color: var(--stage-1-light); color: var(--stage-1); }
.card-sewing .card-icon { background-color: var(--success-light); color: var(--success); }
.card-delivery .card-icon { background-color: var(--stage-4-light); color: var(--stage-4); }

.card-icon svg {
    width: 28px;
    height: 28px;
}

.card-data h3 {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* Dashboard Panel Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
}

.dashboard-panel {
    background-color: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.panel-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.panel-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-color);
}

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

/* SVG Chart Styles */
.chart-container {
    height: 280px;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    padding-top: 20px;
}

.custom-bar-chart {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.chart-bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
    height: 100%;
    justify-content: flex-end;
}

.chart-bar-wrapper {
    width: 100%;
    max-width: 48px;
    height: 80%;
    background-color: var(--bg-color);
    border-radius: 6px;
    position: relative;
    display: flex;
    align-items: flex-end;
}

.chart-bar {
    width: 100%;
    border-radius: 6px;
    transition: height 1s ease-out;
    cursor: pointer;
    position: relative;
    min-height: 5px;
}

.chart-bar:hover::before {
    content: attr(data-count) " طلب";
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--text-color);
    color: white;
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 1;
    box-shadow: var(--shadow-sm);
}

.chart-label {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Urgent Orders List */
.urgent-orders-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    list-style: none;
}

.urgent-order-card {
    background-color: var(--bg-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-right: 4px solid var(--danger);
    transition: var(--transition);
}

.urgent-order-card:hover {
    transform: translateX(-4px);
    background-color: #f1f5f9;
}

.uo-details h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 4px;
}

.uo-details p {
    font-size: 12px;
    color: var(--text-muted);
}

.uo-badge {
    background-color: var(--danger-light);
    color: var(--danger);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

/* Kanban Board Styling */
.kanban-board-wrapper {
    overflow-x: auto;
    padding-bottom: 12px;
    height: calc(100vh - 180px);
}

.kanban-board {
    display: flex;
    gap: 12px;
    height: 100%;
}

.kanban-column {
    background-color: var(--bg-color);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    overflow: hidden;
    max-height: 100%;
}

/* Kanban Desktop Layout: Prevent column squishing, scroll if needed */
@media (min-width: 1025px) {
    .kanban-board-wrapper {
        overflow-x: auto;
    }
    .kanban-board {
        width: max-content;
        min-width: 100%;
    }
    .kanban-column {
        flex: 1 0 240px;
        min-width: 240px;
    }
}

/* Kanban Mobile/Tablet Layout: Horizontal scrolling to prevent squishing */
@media (max-width: 1024px) {
    .kanban-board-wrapper {
        overflow-x: auto;
    }
    .kanban-board {
        width: max-content;
        min-width: 100%;
    }
    .kanban-column {
        flex: 1 0 280px;
        min-width: 280px;
    }
}

.kanban-column-header {
    padding: 12px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid transparent;
    color: white;
    font-weight: 700;
    min-height: 72px;
}

/* Custom Headers per Stage */
.col-stage-0 .kanban-column-header { background: linear-gradient(135deg, var(--stage-0), #60a5fa); border-color: var(--stage-0); }
.col-stage-1 .kanban-column-header { background: linear-gradient(135deg, var(--stage-1), #f472b6); border-color: var(--stage-1); }
.col-stage-2 .kanban-column-header { background: linear-gradient(135deg, var(--stage-2), #fb923c); border-color: var(--stage-2); }
.col-stage-4 .kanban-column-header { background: linear-gradient(135deg, var(--stage-4), #a78bfa); border-color: var(--stage-4); }
.col-stage-5 .kanban-column-header { background: linear-gradient(135deg, var(--stage-5), #e879f9); border-color: var(--stage-5); }
.col-stage-6 .kanban-column-header { background: linear-gradient(135deg, var(--stage-6), #34d399); border-color: var(--stage-6); }

.column-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.column-count {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

.kanban-cards-container {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    flex-grow: 1;
}

/* Kanban Cards styling */
.kanban-card {
    background-color: var(--card-bg);
    border-radius: var(--radius-sm);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    border-right: 4px solid transparent;
    cursor: grab;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 10px;
    user-select: none;
    position: relative;
    text-align: right;
    align-items: stretch;
}

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

.col-stage-0 .kanban-card { border-right-color: var(--stage-0); }
.col-stage-1 .kanban-card { border-right-color: var(--stage-1); }
.col-stage-2 .kanban-card { border-right-color: var(--stage-2); }
.col-stage-4 .kanban-card { border-right-color: var(--stage-4); }
.col-stage-5 .kanban-card { border-right-color: var(--stage-5); }
.col-stage-6 .kanban-card { border-right-color: var(--stage-6); }

.card-header-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.card-id-badge {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    background-color: var(--primary-light);
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.card-date-badge {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.card-date-badge.overdue {
    color: var(--danger);
    font-weight: 700;
}

.card-client {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-align: right;
}

.client-highlight {
    color: #0f766e; /* Premium deep teal */
    font-weight: 700;
    font-size: 13px;
    background-color: #f0fdfa; /* Light teal tint */
    padding: 2px 8px;
    border-radius: 6px;
    display: inline-block;
    border: 1px solid #ccfbf1;
}

.card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-color);
    text-align: right;
}

.card-linked-info {
    font-size: 11px;
    color: var(--text-muted);
    background-color: var(--bg-color);
    padding: 8px 10px;
    border-radius: 6px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 10px;
    text-align: right;
}

.card-linked-info .info-label {
    color: var(--text-muted);
}

.card-linked-info .info-value {
    color: var(--text-color);
    font-weight: 700;
    text-align: left;
}

.btn-card-delete {
    position: absolute;
    top: 10px;
    left: 10px;
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
}

.kanban-card:hover .btn-card-delete {
    opacity: 0.6;
}

.kanban-card .btn-card-delete:hover {
    opacity: 1;
    color: var(--danger);
}

.card-quantity-badge {
    align-self: flex-start;
    background-color: #f1f5f9;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
}

/* Progress bar inside card */
.card-progress {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.progress-label-row {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
}

.progress-bar-bg {
    width: 100%;
    height: 6px;
    background-color: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
}

.col-stage-0 .progress-bar-fill { background-color: var(--stage-0); }
.col-stage-1 .progress-bar-fill { background-color: var(--stage-1); }
.col-stage-2 .progress-bar-fill { background-color: var(--stage-2); }
.col-stage-4 .progress-bar-fill { background-color: var(--stage-4); }
.col-stage-5 .progress-bar-fill { background-color: var(--stage-5); }
.col-stage-6 .progress-bar-fill { background-color: var(--stage-6); }

.card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
    margin-top: 4px;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-card-action {
    background-color: var(--primary-light);
    color: var(--primary);
    border: none;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn-card-action:hover {
    background-color: var(--primary);
    color: white;
}

.btn-card-view {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 11px;
}

.btn-card-view:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Orders Table Styling */
.table-container-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.filter-bar {
    display: flex;
    gap: 16px;
    width: 100%;
}

.form-control {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
    background-color: var(--card-bg);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.text-input {
    flex-grow: 1;
}

.select-input {
    min-width: 200px;
}

.table-card {
    background-color: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.table-responsive {
    overflow-x: auto;
}

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

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

.data-table th {
    background-color: #f8fafc;
    font-weight: 700;
    color: var(--text-color);
    font-size: 14px;
}

.data-table td {
    font-size: 14px;
    color: #334155;
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background-color: #f8fafc;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.badge-stage-0 { background-color: var(--stage-0-light); color: var(--stage-0); }
.badge-stage-1 { background-color: var(--stage-1-light); color: var(--stage-1); }
.badge-stage-2 { background-color: var(--stage-2-light); color: var(--stage-2); }
.badge-stage-4 { background-color: var(--stage-4-light); color: var(--stage-4); }
.badge-stage-5 { background-color: var(--stage-5-light); color: var(--stage-5); }
.badge-stage-6 { background-color: var(--stage-6-light); color: var(--stage-6); }
.badge-completed { background-color: var(--success-light); color: var(--success); }

/* Workers Section Styling */
.workers-header-bar {
    margin-bottom: 24px;
    display: flex;
    justify-content: flex-end;
}

.workers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.worker-card {
    background-color: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    transition: var(--transition);
}

.worker-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.worker-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 16px;
}

.worker-card.idle .worker-avatar {
    background-color: var(--border-color);
    color: var(--text-muted);
}

.worker-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 4px;
}

.worker-specialty {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.worker-status-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 12px;
    margin-bottom: 12px;
}

.worker-status-badge.active {
    background-color: var(--success-light);
    color: var(--success);
}

.worker-status-badge.idle {
    background-color: #f1f5f9;
    color: #475569;
}

.worker-assignment {
    width: 100%;
    text-align: center;
    padding: 10px;
    background-color: var(--bg-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-color);
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.worker-action-delete {
    position: absolute;
    top: 12px;
    left: 12px;
    background: transparent;
    border: none;
    color: #cbd5e1;
    cursor: pointer;
    transition: var(--transition);
}

.worker-action-delete:hover {
    color: var(--danger);
}

.worker-action-edit {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    color: #cbd5e1;
    cursor: pointer;
    transition: var(--transition);
}

.worker-action-edit:hover {
    color: var(--primary);
}

/* Timeline/Log Screen Styling */
.logs-timeline {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
}

.logs-timeline::before {
    content: '';
    position: absolute;
    top: 24px;
    bottom: 24px;
    right: 48px;
    width: 2px;
    background-color: var(--border-color);
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    position: relative;
}

.timeline-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--bg-color);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    z-index: 2;
    transition: var(--transition);
}

.timeline-item:hover .timeline-icon {
    border-color: var(--primary);
    color: var(--primary);
    background-color: var(--primary-light);
}

.timeline-icon svg {
    width: 20px;
    height: 20px;
}

.timeline-content {
    background-color: var(--bg-color);
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    flex-grow: 1;
    border: 1px solid var(--border-color);
}

.timeline-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.timeline-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 6px;
}

.timeline-desc {
    font-size: 13px;
    color: #475569;
}

.timeline-note {
    margin-top: 8px;
    padding: 8px 12px;
    background-color: var(--card-bg);
    border-right: 3px solid var(--primary);
    font-style: italic;
    font-size: 12px;
    border-radius: 4px;
}

/* Modals styling */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background-color: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: var(--transition);
}

.modal-backdrop.open .modal-card {
    transform: translateY(0);
}

.modal-card.modal-sm {
    max-width: 500px;
}

.modal-card.modal-lg {
    max-width: 900px;
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-color);
}

.modal-form {
    padding: 24px;
}

.modal-body {
    padding: 16px 20px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.form-group label .required {
    color: var(--danger);
}

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

.order-info-badge {
    background-color: var(--primary-light);
    border: 1px solid rgba(79, 70, 229, 0.1);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.order-info-badge strong {
    color: var(--primary);
}

/* Details view timeline */
.details-timeline {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.details-timeline-item {
    display: flex;
    gap: 12px;
    position: relative;
    padding-bottom: 4px;
}

.details-timeline-item:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 24px;
    right: 12px;
    bottom: -10px;
    width: 2px;
    background-color: var(--border-color);
}

.details-timeline-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background-color: var(--border-color);
    border: 2px solid white;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.details-timeline-dot.active {
    background-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.details-timeline-dot.completed {
    background-color: var(--success);
}

.details-timeline-content {
    background-color: var(--bg-color);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    flex-grow: 1;
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.details-timeline-text h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-color);
}

.details-timeline-text p {
    font-size: 12px;
    color: var(--text-muted);
}

.details-timeline-date {
    font-size: 11px;
    color: var(--text-muted);
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 24px;
    padding: 24px;
}

.details-summary {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.details-summary-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 5px;
    font-size: 13px;
}

.details-summary-row span:first-child {
    color: var(--text-muted);
    font-weight: 500;
}

.details-summary-row span:last-child {
    color: var(--text-color);
    font-weight: 700;
}

.details-notes-box {
    margin-top: 14px;
    background-color: #fffbeb;
    border-right: 4px solid var(--warning);
    padding: 12px;
    border-radius: 4px;
    font-size: 12px;
    color: #78350f;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Responsive styles */
@media (max-width: 1024px) {
    .app-container {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        display: flex;
        position: fixed;
        right: -280px;
        top: 0;
        height: 100vh;
        width: 280px;
        transition: right 0.3s ease;
        z-index: 1000;
        box-shadow: -4px 0 24px rgba(0,0,0,0.5);
    }
    
    .sidebar.open {
        right: 0;
    }
    
    .mobile-menu-btn {
        display: flex !important;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    
    .sidebar-overlay.open {
        display: block !important;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Login Screen Styling */
.login-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 10% 20%, rgb(15, 23, 42) 0%, rgb(30, 41, 59) 90.1%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-md);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 420px;
    padding: 40px 32px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    animation: loginFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    max-height: 60px;
    width: auto;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
    margin-bottom: 16px;
    background-color: transparent;
}

.login-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 6px;
}

.login-header p {
    font-size: 13px;
    color: var(--text-muted);
}

.login-error {
    background-color: var(--danger-light);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    padding: 10px;
    margin-top: 15px;
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.btn-logout {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.15);
    color: var(--sidebar-text);
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    margin-right: auto;
}

.btn-logout:hover {
    background-color: var(--danger);
    color: white;
    border-color: var(--danger);
}

/* Image Upload Frames */
.image-upload-frame {
    transition: all 0.2s ease-in-out;
}

.image-upload-frame:hover {
    border-color: var(--primary) !important;
    background-color: #f8fafc !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.btn-remove-image {
    transition: all 0.2s ease-in-out;
    display: flex;
}

.btn-remove-image:hover {
    transform: scale(1.1);
    background-color: var(--danger) !important;
}



:root {
    --stage-3: #06b6d4;       /* Heat Press (Cyan) */
    --stage-3-light: #cffafe;
    --stage-3-bg: #ecfeff;
}
.col-stage-3 .kanban-column-header { background: linear-gradient(135deg, var(--stage-3), #22d3ee); border-color: var(--stage-3); }
.col-stage-3 .kanban-card { border-right-color: var(--stage-3); }
.col-stage-3 .progress-bar-fill { background-color: var(--stage-3); }
.badge-stage-3 { background-color: var(--stage-3-light); color: var(--stage-3); }
#reports-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px !important;
}

#reports-data-table th {
    background-color: #1e293b !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    padding: 8px 6px !important;
    font-size: 11px !important;
    border: 1px solid #334155 !important;
    white-space: nowrap !important; /* Keep header text horizontal and prevent clipping */
    vertical-align: middle !important;
    line-height: 1.3;
}

#reports-data-table td {
    padding: 6px 6px !important;
    font-size: 11px !important;
    border: 1px solid #e2e8f0 !important;
    color: #334155 !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
    line-height: 1.3;
}

/* Responsive Table Adjustments */
@media (max-width: 1024px) {
    #reports-data-table {
        min-width: 1600px !important; /* Force horizontal scroll on mobile for 21 columns to prevent squishing */
    }
    .data-table {
        min-width: 900px !important; /* Prevent main orders table from squishing on mobile */
    }
}

@media (min-width: 1025px) {
    #reports-data-table {
        min-width: unset !important; /* Fit screen on desktop */
    }
}

#reports-data-table tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

#reports-data-table tbody tr:hover {
    background-color: #f1f5f9 !important;
}

