/* ==========================================================================
   MINIMALIST WORKFLOW STYLESHEET (styles.css)
   ========================================================================== */

/* Design Tokens & Theme Variables */
:root {
    /* Fonts */
    --font-primary: 'Inter', 'Sarabun', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Muted Minimal Palette */
    --bg-app: #f8f9fa;
    --bg-panel: #ffffff;
    --bg-card: #ffffff;
    
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    --border-focus: #475569;
    
    /* Brand Accent - Slate Blue */
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-light: #eff6ff;
    
    /* Kanban Muted Color Badges (Minimal Pastels) */
    --status-todo-bg: #f1f5f9;
    --status-todo-text: #475569;
    --status-todo-border: #cbd5e1;
    
    --status-progress-bg: #fef3c7;
    --status-progress-text: #b45309;
    --status-progress-border: #fde68a;
    
    --status-verify-bg: #f3e8ff;
    --status-verify-text: #7e22ce;
    --status-verify-border: #e9d5ff;
    
    --status-completed-bg: #dcfce7;
    --status-completed-text: #15803d;
    --status-completed-border: #bbf7d0;

    /* Danger / Delete Color */
    --danger-bg: #fee2e2;
    --danger-text: #b91c1c;
    --danger-border: #fecaca;
    
    /* Layout Tokens */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    
    /* Subtle shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -4px rgba(0, 0, 0, 0.02);
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base resets & styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-app);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* Helper Utilities */
.required {
    color: var(--danger-text);
    margin-left: 2px;
}
.font-bold {
    font-weight: 600;
}
.text-accent {
    color: var(--accent);
}
.text-danger {
    color: var(--danger-text) !important;
}

/* ==========================================================================
   HEADER & ROLE SELECTOR
   ========================================================================== */
.app-header {
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.8rem 1.5rem;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

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

.logo-icon {
    color: var(--text-main);
    width: 24px;
    height: 24px;
}

.logo-text h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.1;
    color: var(--text-main);
}

.logo-sub {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.15rem;
}

.logo-sub span {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}

.status-badge {
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.05rem 0.3rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.mode-local {
    background-color: var(--status-todo-bg);
    color: var(--status-todo-text);
    border: 1px solid var(--status-todo-border);
}

.mode-cloud {
    background-color: var(--status-completed-bg);
    color: var(--status-completed-text);
    border: 1px solid var(--status-completed-border);
}

/* Role Selector Panel */
.role-selector-panel {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-app);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.role-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.role-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
}

.active-user-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.badge-icon {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
}

#current-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
}

.sub-role {
    font-size: 0.75rem;
    background: var(--border-light);
    color: var(--text-muted);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-weight: 500;
}

.select-wrapper {
    position: relative;
}

.clean-select {
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.35rem 1.8rem 0.35rem 0.6rem;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    background-color: var(--bg-panel);
    color: var(--text-main);
    outline: none;
    cursor: pointer;
    appearance: none;
    transition: var(--transition-fast);
}

.clean-select:focus {
    border-color: var(--border-focus);
}

.select-wrapper::after {
    content: '';
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    border: 4px solid transparent;
    border-top-color: var(--text-muted);
    pointer-events: none;
}

/* ==========================================================================
   MAIN CONTAINERS & OVERVIEW
   ========================================================================== */
.main-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Stats Summary Cards */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.stat-details {
    display: flex;
    flex-direction: column;
}

.stat-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.stat-icon-wrapper {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon-wrapper i {
    width: 20px;
    height: 20px;
}

/* Stat color themes */
.color-all { background: #f1f5f9; color: #475569; }
.color-todo { background: #eff6ff; color: #2563eb; }
.color-progress { background: #fffbeb; color: #d97706; }
.color-verify { background: #faf5ff; color: #9333ea; }

/* ==========================================================================
   CONTROLS BAR (Search, Filters, Action)
   ========================================================================== */
.controls-bar {
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.8rem 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
}

.search-filter-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-grow: 1;
    flex-wrap: wrap;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
    max-width: 340px;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-light);
}

.clean-input, .clean-textarea {
    width: 100%;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    background-color: var(--bg-panel);
    color: var(--text-main);
    outline: none;
    transition: var(--transition-fast);
}

.clean-input {
    padding: 0.45rem 0.75rem 0.45rem 2.2rem;
}

.clean-textarea {
    padding: 0.6rem 0.75rem;
    resize: vertical;
}

.clean-input:focus, .clean-textarea:focus {
    border-color: var(--border-focus);
}

.filter-buttons {
    display: flex;
    background: var(--bg-app);
    padding: 2px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.filter-btn {
    font-family: var(--font-primary);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
    transition: var(--transition-fast);
}

.filter-btn:hover {
    color: var(--text-main);
}

.filter-btn.active {
    background: var(--bg-panel);
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

.action-group {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

/* My Tasks Toggle Switch (iOS Minimal Style) */
.my-tasks-toggle-wrapper {
    display: flex;
    align-items: center;
}

.switch-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-main);
    user-select: none;
}

.switch-label input {
    display: none;
}

.switch-slider {
    position: relative;
    width: 34px;
    height: 18px;
    background-color: var(--border-medium);
    border-radius: 100px;
    transition: var(--transition-normal);
}

.switch-slider::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: var(--transition-normal);
}

.switch-label input:checked + .switch-slider {
    background-color: var(--accent);
}

.switch-label input:checked + .switch-slider::before {
    transform: translateX(16px);
}

/* Standard Buttons */
.btn {
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.45rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-medium);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: var(--transition-fast);
}

.btn i {
    width: 15px;
    height: 15px;
}

.btn-primary {
    background: var(--text-main);
    color: white;
    border-color: var(--text-main);
}

.btn-primary:hover {
    background: #475569;
    border-color: #475569;
}

.btn-secondary {
    background: var(--bg-panel);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: var(--bg-app);
    border-color: var(--text-muted);
}

/* ==========================================================================
   KANBAN BOARD SECTION
   ========================================================================== */
.kanban-board-container {
    flex-grow: 1;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.kanban-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(280px, 1fr));
    gap: 1rem;
    min-height: 550px;
    align-items: start;
}

.kanban-column {
    background: #f1f5f9;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    max-height: 750px;
    transition: var(--transition-normal);
}

/* Drag over highlights */
.kanban-column.drag-over {
    background: #e2e8f0;
    border-color: var(--border-medium);
}

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

.column-title-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.dot-todo { background-color: var(--status-todo-text); }
.dot-progress { background-color: var(--status-progress-text); }
.dot-verify { background-color: var(--status-verify-text); }
.dot-completed { background-color: var(--status-completed-text); }

.column-header h2 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
}

.column-count {
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    padding: 0.15rem 0.5rem;
    border-radius: 100px;
}

.cards-list {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 150px;
    padding: 2px;
}

/* ==========================================================================
   KANBAN CARD ELEMENT
   ========================================================================== */
.task-card {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    padding: 0.85rem;
    box-shadow: var(--shadow-sm);
    cursor: grab;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-medium);
}

.task-card:active {
    cursor: grabbing;
}

/* Card image (Top section) */
.card-image-preview {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 0.6rem;
    border: 1px solid var(--border-light);
    background: var(--bg-app);
}

/* Card tags & header */
.card-header-tags {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.job-tag {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-main);
    background: var(--bg-app);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    border: 1px solid var(--border-light);
}

.dept-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    text-transform: uppercase;
}
.dept-sales {
    background-color: var(--accent-light);
    color: var(--accent);
    border: 1px solid #bfdbfe;
}
.dept-production {
    background-color: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.card-customer-id {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-main);
}

.card-material {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}

.card-specs {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.6rem;
}

.card-divider {
    border: 0;
    border-top: 1px solid var(--border-light);
    margin: 0.5rem 0;
}

/* Card Footer */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
}

.card-assignee-info {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--text-main);
    font-weight: 500;
    max-width: 60%;
}

.card-assignee-icon {
    width: 12px;
    height: 12px;
    color: var(--text-muted);
}

.card-assignee-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-quantity-badge {
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-app);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    border: 1px solid var(--border-light);
}

/* Dragging state helper classes */
.dragging {
    opacity: 0.5;
    border: 1px dashed var(--accent);
}

/* Empty placeholder inside cards list */
.empty-col-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 120px;
    color: var(--text-light);
    font-size: 0.75rem;
    border: 1px dashed var(--border-medium);
    border-radius: var(--radius-sm);
    padding: 1rem;
    text-align: center;
}

.empty-col-placeholder i {
    width: 20px;
    height: 20px;
    margin-bottom: 0.4rem;
}

/* ==========================================================================
   MODAL WINDOW DIALOGS
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4); /* Slate dark overlay */
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
}

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

.modal-window {
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    width: 90%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform var(--transition-fast);
}

.modal-window-large {
    max-width: 880px;
}

.modal-backdrop.show .modal-window {
    transform: scale(1);
}

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

.modal-title-icon {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 0.4rem;
    color: var(--text-main);
}

.modal-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.modal-close-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition-fast);
}

.modal-close-btn:hover {
    background: var(--bg-app);
    color: var(--text-main);
}

.modal-body {
    padding: 1.25rem;
    overflow-y: auto;
}

.modal-footer {
    padding: 0.8rem 1.25rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background-color: var(--bg-app);
}

/* Form Styles inside Modals */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.35rem;
}

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

/* Image Upload UI */
.image-upload-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    border: 1px solid var(--border-light);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--bg-app);
}

.file-uploader {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 1px dashed var(--border-medium);
    border-radius: var(--radius-sm);
    background: var(--bg-panel);
    transition: var(--transition-fast);
}

.file-uploader:hover {
    border-color: var(--border-focus);
}

.file-input-hidden {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem;
    cursor: pointer;
}

.file-upload-label span {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-main);
}

.upload-icon {
    width: 22px;
    height: 22px;
    margin-bottom: 0.4rem;
    color: var(--text-muted);
}

.file-limits {
    font-size: 0.65rem !important;
    color: var(--text-muted) !important;
    font-weight: 400 !important;
    margin-top: 0.2rem;
}

.preview-area {
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-light);
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 110px;
    position: relative;
}

.preview-area img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-height: 120px;
}

.no-image-text {
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 0.5rem;
    text-align: center;
}

/* Predefined Mock Images UI */
.mock-selection-group {
    margin-top: 0.75rem;
}

.mock-selection-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    display: block;
    margin-bottom: 0.3rem;
}

.mock-images-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.mock-image-option {
    height: 48px;
    border-radius: 4px;
    border: 2px solid var(--border-light);
    cursor: pointer;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 2px;
    transition: var(--transition-fast);
    filter: grayscale(40%);
}

.mock-image-option:hover {
    filter: none;
    border-color: var(--text-light);
}

.mock-image-option.selected {
    filter: none;
    border-color: var(--text-main);
    box-shadow: 0 0 0 1px var(--text-main);
}

.mock-badge {
    font-size: 0.6rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-main);
    padding: 1px 4px;
    border-radius: 2px;
    box-shadow: var(--shadow-sm);
}

/* Background image presets for the selector buttons */
.mock-image-option[data-mock="vinyl"] { background-image: url('https://images.unsplash.com/photo-1541701494587-cb58502866ab?auto=format&fit=crop&w=150&q=80'); }
.mock-image-option[data-mock="cnc"] { background-image: url('https://images.unsplash.com/photo-1610906265443-c23599e83cf3?auto=format&fit=crop&w=150&q=80'); }
.mock-image-option[data-mock="acrylic"] { background-image: url('https://images.unsplash.com/photo-1513542789411-b6a5d4f31634?auto=format&fit=crop&w=150&q=80'); }
.mock-image-option[data-mock="digital"] { background-image: url('https://images.unsplash.com/photo-1572375995301-3b08e27c5ad0?auto=format&fit=crop&w=150&q=80'); }

/* ==========================================================================
   TASK DETAILS DIALOG LAYOUT
   ========================================================================== */
.modal-grid-layout {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

.modal-left-column {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.modal-right-column {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.detail-spec-image-container {
    width: 100%;
    max-height: 250px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-light);
    background: #e2e8f0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.detail-spec-image-container img {
    max-width: 100%;
    max-height: 250px;
    object-fit: contain;
}

.detail-specs-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.detail-specs-card h3, .control-box-panel h3, .activity-history-panel h3 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 0.4rem;
    margin-bottom: 0.85rem;
    letter-spacing: 0.025em;
}

.specs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}

.spec-item {
    display: flex;
    flex-direction: column;
}

.spec-item.full-width {
    grid-column: span 2;
}

.spec-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

.spec-val {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
}

.spec-text-block {
    font-size: 0.8rem;
    background: var(--bg-app);
    padding: 0.6rem;
    border-radius: 4px;
    border-left: 3px solid var(--border-medium);
    margin-top: 0.2rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.control-box-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.control-btn-group {
    display: flex;
    justify-content: space-between;
    margin-top: 1.25rem;
    gap: 0.5rem;
}

.control-btn-group .btn {
    flex-grow: 1;
}

/* Job ID tag in Header */
.job-id-tag {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--accent);
    background-color: var(--accent-light);
    border: 1px solid #bfdbfe;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 0.2rem;
}

#detail-customer-id-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
}

/* Timeline Activity Log */
.activity-history-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1rem;
    max-height: 260px;
    overflow-y: auto;
}

.timeline-container {
    position: relative;
    padding-left: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.timeline-container::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 5px;
    bottom: 5px;
    width: 2px;
    background: var(--border-light);
}

.timeline-item {
    position: relative;
}

.timeline-dot {
    position: absolute;
    left: -1.2rem;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-medium);
    border: 2px solid var(--bg-panel);
}

.timeline-item:first-child .timeline-dot {
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.timeline-content {
    display: flex;
    flex-direction: column;
    font-size: 0.75rem;
}

.timeline-time {
    color: var(--text-light);
    font-size: 0.65rem;
    font-weight: 500;
}

.timeline-action {
    color: var(--text-main);
    font-weight: 600;
    margin: 0.1rem 0;
}

.timeline-operator {
    color: var(--text-muted);
}

.timeline-note {
    font-style: italic;
    color: var(--text-muted);
    background-color: var(--bg-app);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    margin-top: 0.15rem;
}

/* ==========================================================================
   APP FOOTER
   ========================================================================== */
.app-footer {
    background: var(--bg-panel);
    border-top: 1px solid var(--border-light);
    text-align: center;
    padding: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: auto;
}

/* ==========================================================================
   RESPONSIVE LAYOUT STYLES
   ========================================================================== */
@media (max-width: 1024px) {
    .kanban-grid {
        grid-template-columns: repeat(2, 1fr);
        min-height: auto;
    }
    .modal-grid-layout {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}

@media (max-width: 650px) {
    .header-container {
        flex-direction: column;
        align-items: flex-start;
    }
    .role-selector-panel {
        width: 100%;
        justify-content: space-between;
    }
    .controls-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .search-input-wrapper {
        max-width: none;
    }
    .action-group {
        justify-content: space-between;
        margin-top: 0.25rem;
    }
    .kanban-grid {
        grid-template-columns: 1fr;
    }
    .form-row-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .image-upload-wrapper {
        grid-template-columns: 1fr;
    }
}

/* Spec input fields that mimic normal labels when disabled */
.spec-input-field {
    border: 1px solid transparent !important;
    background: transparent !important;
    padding: 0 !important;
    color: var(--text-main) !important;
    outline: none;
    box-shadow: none !important;
    cursor: default;
    appearance: none;
    width: 100%;
}

.spec-input-field:not(:disabled) {
    border: 1px solid var(--border-medium) !important;
    background: var(--bg-panel) !important;
    padding: 0.35rem 0.5rem !important;
    border-radius: var(--radius-sm) !important;
    cursor: text;
}

.spec-input-field:not(:disabled):focus {
    border-color: var(--border-focus) !important;
}

textarea.spec-text-block {
    font-family: var(--font-primary);
    resize: vertical;
}

textarea.spec-text-block:not(:disabled) {
    background: var(--bg-panel) !important;
    border: 1px solid var(--border-medium) !important;
    border-left: 3px solid var(--accent) !important;
    padding: 0.6rem !important;
    cursor: text;
}

/* Login Lock Screen Overlay */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.7); /* Muted slate background */
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000; /* Over everything */
    opacity: 1;
    pointer-events: auto;
    transition: opacity var(--transition-normal);
}

.login-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.login-card {
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-light);
    width: 90%;
    max-width: 380px;
    padding: 2rem;
    transform: scale(1);
    transition: transform var(--transition-normal);
}

.login-overlay.hidden .login-card {
    transform: scale(0.95);
}

.login-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.login-icon-lock {
    width: 40px;
    height: 40px;
    color: var(--accent);
    background: var(--accent-light);
    padding: 0.5rem;
    border-radius: 50%;
    margin-bottom: 0.75rem;
}

.login-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

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