/* MEJA Production — Custom Styles */

:root {
    --meja-gold: #C5A55A;
    --meja-dark: #4A4A4A;
    --meja-gray: #6B6B6B;
    --meja-light: #F5F0E8;
    --meja-accent: #C5A55A;
    --meja-blue: #4A4A4A;

    /* Override Pico spacing defaults for a denser UI */
    --pico-block-spacing-vertical: 0.75rem;
    --pico-block-spacing-horizontal: 1rem;
    --pico-typography-spacing-vertical: 0.5rem;
    --pico-grid-row-gap: 0;
    --pico-grid-column-gap: 1rem;
}

/* Tighten body / main container */
body { font-size: 0.9rem; }
main.container { padding-top: 0.75rem; padding-bottom: 1rem; }

/* Tighter headings */
h1 { font-size: 1.6rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.3rem; margin-bottom: 0.4rem; }
h3 { font-size: 1.1rem; margin-bottom: 0.3rem; }
h4 { font-size: 1rem; margin-bottom: 0.2rem; }

/* Tighter article cards (Pico default is very padded) */
article {
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}

/* Flash messages */
[role="alert"] {
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: var(--pico-border-radius);
    font-size: 0.85rem;
}
.flash-success { background: #d4edda; color: #155724; }
.flash-error { background: #f8d7da; color: #721c24; }
.flash-info { background: #d1ecf1; color: #0c5460; }
.flash-warning { background: #fff3cd; color: #856404; }

/* Nav */
nav {
    background: var(--meja-dark);
    padding: 0.3rem 1rem;
}
nav a { color: #fff !important; text-decoration: none; }
nav a[aria-current="page"] { border-bottom: 2px solid var(--meja-gold); }
nav strong { color: var(--meja-gold) !important; font-size: 1.1rem; }
.nav-logo { height: 64px; width: auto; vertical-align: middle; margin: -16px 0; }

/* Nav dropdown */
.nav-dropdown {
    position: relative;
}
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% - 6px);
    right: 0;
    background: var(--meja-dark);
    border-radius: 0 0 6px 6px;
    min-width: 160px;
    padding: 6px 0 0.2rem;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    list-style: none;
    margin: 0;
}
.nav-dropdown:hover .nav-dropdown-menu {
    display: block;
}
.nav-dropdown-menu li {
    padding: 0;
}
.nav-dropdown-menu a {
    display: block;
    padding: 0.3rem 0.8rem;
    font-size: 0.85rem;
    white-space: nowrap;
}
.nav-dropdown-menu a:hover {
    background: rgba(255,255,255,0.1);
}

/* Nav icon with badge (quote request count) */
.nav-icon-badge {
    position: relative !important;
}
.nav-badge {
    position: absolute;
    top: 2px;
    right: -2px;
    background: #dc2626;
    color: #fff !important;
    font-size: 0.55rem;
    font-weight: 700;
    min-width: 15px;
    height: 15px;
    line-height: 15px;
    text-align: center;
    border-radius: 8px;
    padding: 0 3px;
    pointer-events: none;
    z-index: 10;
}

/* Lucide icons — base sizing */
[data-lucide] {
    width: 16px;
    height: 16px;
    vertical-align: -3px;
    display: inline-block;
}

/* Nav icons — icon-only with tooltip, gold on dark, white when active */
nav > ul > li > a {
    padding: 0.3rem 0.5rem;
}
nav [data-lucide] {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 0;
    stroke: var(--meja-gold);
}
nav a[aria-current="page"] [data-lucide] {
    stroke: #fff;
}
.nav-dropdown-menu [data-lucide] {
    width: 14px;
    height: 14px;
    vertical-align: -2px;
    stroke: var(--meja-gold);
}

/* Page header button icons */
.page-header [data-lucide] {
    width: 16px;
    height: 16px;
    vertical-align: -3px;
    margin-right: 2px;
}

/* Dashboard summary card icons */
.summary-card [data-lucide] {
    width: 22px;
    height: 22px;
    stroke: var(--meja-gold);
    margin-bottom: 0.15rem;
}

/* Save bar icons — white on dark */
.save-bar [data-lucide] {
    width: 14px;
    height: 14px;
    vertical-align: -2px;
    margin-right: 2px;
    stroke: #fff;
}

/* Compact form fields — override Pico v2 defaults */
form:not(.login-form) {
    --pico-form-element-spacing-vertical: 0.3rem;
    --pico-form-element-spacing-horizontal: 0.5rem;
    font-size: 0.85rem;
}
form:not(.login-form) label {
    margin-bottom: 0.25rem;
}
form:not(.login-form) input,
form:not(.login-form) select,
form:not(.login-form) textarea {
    margin-bottom: 0.4rem;
}
form:not(.login-form) fieldset {
    padding: 0.5rem;
}
form:not(.login-form) h3,
form:not(.login-form) h4 {
    margin-top: 0.75rem;
    margin-bottom: 0.3rem;
}
form:not(.login-form) .grid {
    row-gap: 0;
}

/* Status badges */
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-draft { background: #e2e3e5; color: #383d41; }
.badge-quoted { background: #cce5ff; color: #004085; }
.badge-accepted { background: #d4edda; color: #155724; }
.badge-declined { background: #f8d7da; color: #721c24; }
.badge-cancelled { background: #f8d7da; color: #721c24; }
.badge-production { background: #fff3cd; color: #856404; }
.badge-shipped { background: #d1ecf1; color: #0c5460; }
.badge-completed { background: #c3e6cb; color: #155724; }
.badge-review { background: #fff3cd; color: #856404; }

/* Summary cards */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.summary-card {
    text-align: center;
    padding: 0.75rem 0.5rem;
}
.summary-card .number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--meja-gold);
    line-height: 1.2;
}
.summary-card .label {
    font-size: 0.75rem;
    color: #666;
    text-transform: uppercase;
}

/* Page header with action */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.3rem;
}
.page-header h1 { margin-bottom: 0; }
.back-link {
    color: var(--meja-gray);
    text-decoration: none;
    margin-right: 0.3rem;
}
.back-link:hover { color: var(--meja-dark); }
.back-link [data-lucide] { width: 20px; height: 20px; vertical-align: -3px; }
.page-header > div {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}
.page-header form { margin-bottom: 0; }

/* Inline editable tables */
table input, table select {
    margin-bottom: 0;
    padding: 0.25rem 0.4rem;
    font-size: 0.85rem;
}
table input[type="number"] {
    width: 5rem;
}
table input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* Compact table rows */
table td, table th {
    padding: 0.3rem 0.5rem;
    vertical-align: middle;
    font-size: 0.85rem;
}
table th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--meja-gray);
}

/* Tighter table wrapper (Pico figure adds margin) */
figure:has(table) {
    margin-bottom: 0.5rem;
}

/* Duplicate button in tables */
.btn-duplicate {
    background: none;
    border: none;
    color: var(--meja-primary, #2a6496);
    cursor: pointer;
    padding: 0.15rem;
    font-size: 0.85rem;
}
.btn-duplicate:hover { opacity: 0.7; }

/* Delete button in tables */
.btn-delete {
    background: none;
    border: none;
    color: #c0392b;
    cursor: pointer;
    padding: 0.15rem;
    font-size: 1rem;
}
.btn-delete:hover { opacity: 0.7; }

/* Version selector */
.version-tabs {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}
.version-tabs a {
    padding: 0.2rem 0.6rem;
    border-radius: var(--pico-border-radius);
    text-decoration: none;
    font-size: 0.8rem;
    background: #e2e3e5;
    color: #383d41;
}
.version-tabs a.active {
    background: var(--meja-gold);
    color: #fff;
}

/* Section headers inside quote detail */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.25rem;
    margin-bottom: 0.3rem;
    border-bottom: 2px solid var(--meja-gold);
    padding-bottom: 0.2rem;
}
.section-header h3 { margin-bottom: 0; font-size: 1rem; }

/* Feature panel (below each line item row) */
.feature-row td {
    padding-top: 0 !important;
    border-top: none !important;
    background: var(--meja-light);
}
.feature-panel {
    padding: 0.2rem 0.4rem 0.4rem 1.5rem;
    font-size: 0.8rem;
}
.feature-table {
    margin-bottom: 0.2rem;
}
.feature-table td, .feature-table th {
    padding: 0.15rem 0.4rem;
    font-size: 0.75rem;
}
.feature-table td:nth-last-child(2),
.feature-table th:nth-last-child(2) {
    text-align: right;
}
.feature-table td.price-included,
.feature-table td.price-optional {
    text-align: right;
}

/* Panel form rows (add feature / apply materials / add hardware) */
.panel-form {
    display: flex;
    gap: 0.3rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 0.2rem;
}
.panel-select,
.panel-label > .panel-select {
    width: auto !important;
    height: 1.4rem !important;
    margin-bottom: 0 !important;
    padding: 0 0.25rem !important;
    font-size: 0.75rem !important;
    border: 1px solid #ccc;
}
.panel-input,
.panel-label > .panel-input {
    height: 1.4rem !important;
    margin-bottom: 0 !important;
    padding: 0 0.2rem !important;
    font-size: 0.75rem !important;
    border: 1px solid #ccc;
    text-align: center;
}
.panel-label {
    margin-bottom: 0;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--meja-gray);
    line-height: 1.2;
}
.panel-label select {
    height: 1.4rem;
    margin-bottom: 0;
    padding: 0 0.25rem;
    font-size: 0.75rem;
    border: 1px solid #ccc;
}
.panel-btn {
    height: 1.4rem;
    padding: 0 0.4rem;
    font-size: 0.7rem;
    margin-bottom: 0;
    white-space: nowrap;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    width: auto !important;
}
.panel-checkbox {
    margin-bottom: 0;
    font-size: 0.7rem;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}
.panel-checkbox input[type="checkbox"] {
    margin: 0;
    width: auto;
}

/* Price color coding: included vs optional */
.price-included { color: #27ae60; font-weight: 600; text-align: right; }
.price-optional { color: #999; text-align: right; }

/* Shipping box stock indicators */
.stock-ok { color: #27ae60; font-weight: 600; }
.stock-low { color: #f39c12; font-weight: 600; }
.stock-out { color: #c0392b; font-weight: 600; }

/* Thumbnails in list views */
.thumb {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid #ddd;
}
.thumb-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 3px;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    font-size: 1rem;
}

/* Custom file upload button */
.file-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.75rem !important;
    font-size: 0.8rem !important;
    margin-bottom: 0.2rem;
    width: auto;
}
.file-btn [data-lucide] {
    width: 14px;
    height: 14px;
    vertical-align: -2px;
}

/* Photo preview in forms */
.photo-preview {
    max-width: 200px;
    max-height: 200px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* Sticky save bar */
.save-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--meja-dark);
    padding: 0.4rem 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.15);
    z-index: 50;
}
.save-bar span {
    color: #fff;
    font-size: 0.8rem;
}
.save-bar button {
    margin-bottom: 0;
    padding: 0.25rem 1rem;
    font-size: 0.8rem;
}
.save-bar .btn-discard {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.4);
    color: #fff;
}
.save-bar .btn-discard:hover {
    border-color: #fff;
}

/* HTMX form feedback */
#form-feedback {
    margin-bottom: 0.5rem;
}
#form-feedback [role="alert"] {
    transition: opacity 0.5s ease;
}

/* Compact buttons globally */
button, [role="button"], input[type="submit"] {
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
}
a[role="button"] {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

/* ===== Quote Detail Page ===== */

/* Info bar — single compact row */
.quote-info-bar {
    background: var(--meja-light);
    padding: 0.4rem 0.6rem;
    border-radius: var(--pico-border-radius);
    margin-bottom: 0.5rem;
}
.quote-info-bar .grid {
    row-gap: 0;
    align-items: end;
}
.quote-info-bar .grid > :last-child {
    align-self: end;
}
.quote-info-bar label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--meja-gray);
    margin-bottom: 0 !important;
    line-height: 1.2;
}
.quote-info-bar input,
.quote-info-bar select,
.quote-info-bar label > input,
.quote-info-bar label > select {
    height: 2rem;
    font-size: 0.8rem;
    padding: 0 0.35rem;
    margin-bottom: 0 !important;
    border: 1px solid #ccc;
}
.quote-info-bar button {
    height: 2rem;
    padding: 0 0.6rem;
    font-size: 0.8rem;
    margin-bottom: 0;
    white-space: nowrap;
    align-self: end;
    width: auto;
}

/* Product type group */
.product-group {
    margin-bottom: 0.5rem;
}
.product-group-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.2rem 0;
    border-bottom: 2px solid var(--meja-gold);
    margin-bottom: 0;
}
.product-group-header span {
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
}
.product-group-header small {
    color: var(--meja-gray);
    font-size: 0.65rem;
}
.product-group-header [data-lucide] {
    width: 13px;
    height: 13px;
    vertical-align: -2px;
    stroke: var(--meja-gold);
}
.product-group-total {
    margin-left: auto;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
}

/* Assembly total (below item price for assemblies) */
.asm-total {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--meja-gold);
}

/* New item highlight */
@keyframes highlight-pulse {
    0%, 60% { background-color: rgba(197, 165, 90, 0.28); }
    100%    { background-color: transparent; }
}
.item-highlight td { animation: highlight-pulse 10s ease-out; }
.item-block-highlight tr td:first-child { border-left: 5px solid var(--meja-gold) !important; }

/* Collapse chevron */
.collapse-chevron { transition: transform 0.15s ease; }
.collapse-chevron.collapsed { transform: rotate(-90deg); }

/* Section toggle legends (collapsible fieldsets) */
.section-toggle {
    user-select: none;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.section-toggle:hover { color: var(--meja-gold); }

/* Line item collapse — hide detail rows when tbody has .item-collapsed */
.item-collapsed .feature-row,
.item-collapsed tr.feature-row { display: none; }
.item-row-num { cursor: pointer; user-select: none; }
.item-row-num [data-lucide] { transition: transform 0.15s ease; }
.item-collapsed .item-row-num [data-lucide] { transform: rotate(-90deg); }

/* Line items table — tight, minimal */
.line-items-table {
    border-collapse: collapse;
    margin-bottom: 0;
    width: 100%;
    table-layout: auto;
}
.line-items-table thead th {
    border-bottom: 1px solid #ddd;
    border-top: none;
    padding: 0.15rem 0.3rem;
    font-size: 0.65rem;
    white-space: nowrap;
}
.line-items-table td {
    padding: 0.15rem 0.3rem;
    border: none;
    font-size: 0.8rem;
    vertical-align: middle;
}
.line-items-table tbody + tbody {
    border-top: none;
}
/* Override Pico defaults for inputs inside the line items table */
.line-items-table input[type="number"] {
    height: 1.6rem;
    width: 5.5rem;
    padding: 0 0.25rem;
    font-size: 0.8rem;
    margin: 0;
    border: 1px solid #ccc;
    text-align: center;
    -moz-appearance: textfield;
}
.line-items-table input[name="quantity"] {
    width: 2.5rem;
}
.line-items-table input[type="number"]::-webkit-inner-spin-button,
.line-items-table input[type="number"]::-webkit-outer-spin-button {
    opacity: 1;
    height: 1.6rem;
}
.line-items-table select {
    height: 1.6rem;
    padding: 0 0.25rem;
    font-size: 0.8rem;
    margin: 0;
    border: 1px solid #ccc;
}

/* Utility classes */
.text-muted { color: var(--meja-gray); }
.text-right { text-align: right; }
.text-bold { font-weight: 600; }

/* Icon-only action buttons */
.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.15rem;
    color: #aaa;
    line-height: 1;
}
.btn-icon:hover { color: var(--meja-dark); }
.btn-icon [data-lucide] { width: 12px; height: 12px; }
.btn-icon-danger:hover { color: #c0392b; }
.row-actions {
    white-space: nowrap;
    display: flex;
    gap: 0.1rem;
    align-items: center;
}

/* Quote totals */
.quote-totals {
    max-width: 240px;
    margin-left: auto;
    margin-top: 0.5rem;
    padding: 0.3rem 0.6rem;
    background: var(--meja-light);
    border-radius: var(--pico-border-radius);
}
.totals-table {
    margin-bottom: 0;
    border: none;
}
.totals-table td {
    padding: 0.1rem 0.25rem;
    border: none;
    font-size: 0.8rem;
}
.totals-table td:last-child {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.totals-grand td {
    font-weight: 700;
    font-size: 1rem;
    border-top: 2px solid var(--meja-gold);
    padding-top: 0.25rem;
}

/* Login page — keep spacious */
.login-container {
    max-width: 400px;
    margin: 3rem auto;
}
.login-container h1 {
    text-align: center;
    color: var(--meja-dark);
    font-size: 1.8rem;
}
.login-form input {
    font-size: 1rem;
    padding: 0.5rem 0.75rem;
}

/* Child item cards (assembly sub-items) */
.child-item-card {
    background: #f8f6f0;
    border: 1px solid #e0dbd0;
    border-left: 3px solid var(--meja-gold);
    border-radius: 4px;
    padding: 0.4rem 0.6rem;
    margin: 0.4rem 0;
}
.child-item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.2rem 0.5rem;
    padding-bottom: 0.25rem;
    margin-bottom: 0.3rem;
    border-bottom: 1px solid #e0dbd0;
}
.child-item-header span:first-child {
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--meja-dark);
}
.child-item-summary {
    font-size: 0.75rem;
    color: var(--meja-gray);
}
.child-item-dims {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.2rem 0;
}
.child-item-panels {
    padding-top: 0.2rem;
}

/* ===== Production / Work Orders ===== */

/* Work order status badges */
.wo-pending { background: #fff3cd; color: #856404; }
.wo-in-progress { background: #cce5ff; color: #004085; }
.wo-complete { background: #d4edda; color: #155724; }
.wo-on-hold { background: #e2e3e5; color: #383d41; }
.wo-cancelled { background: #f8d7da; color: #721c24; }

/* Cancelled work order banner */
.cancelled-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #c0392b;
    border-radius: var(--pico-border-radius);
    font-size: 0.85rem;
    font-weight: 600;
}
.cancelled-banner [data-lucide] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.cancelled-banner a {
    color: #721c24;
    text-decoration: underline;
}

/* Priority badges */
.priority-rush { background: #f8d7da; color: #721c24; font-weight: 700; }
.priority-high { background: #fff3cd; color: #856404; }
.priority-normal { background: #e2e3e5; color: #383d41; }
.priority-low { background: #d1ecf1; color: #0c5460; }

/* Mini progress bar */
.progress-mini {
    display: inline-block;
    width: 60px;
    height: 6px;
    background: #e2e3e5;
    border-radius: 3px;
    overflow: hidden;
    vertical-align: middle;
    margin-right: 0.25rem;
}
.progress-mini-bar {
    height: 100%;
    background: var(--meja-gold);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Workflow tracker */
.workflow-tracker {
    display: flex;
    gap: 0.25rem;
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: var(--meja-light);
    border-radius: var(--pico-border-radius);
}
.workflow-step {
    flex: 1;
    text-align: center;
    padding: 0.4rem 0.2rem;
    border-radius: 4px;
    border: 1px solid #ddd;
    background: #fff;
    font-size: 0.75rem;
}
.workflow-step.step-complete {
    background: #d4edda;
    border-color: #27ae60;
}
.workflow-step.step-active {
    background: #cce5ff;
    border-color: #004085;
    font-weight: 600;
}
.workflow-step.step-skipped {
    background: #f5f5f5;
    opacity: 0.5;
}
.step-icon [data-lucide] {
    width: 18px;
    height: 18px;
    margin-bottom: 0.1rem;
}
.step-label { font-weight: 600; font-size: 0.7rem; }
.step-status { font-size: 0.65rem; color: var(--meja-gray); margin-bottom: 0.15rem; }
.step-check [data-lucide] {
    width: 14px;
    height: 14px;
    color: #27ae60;
}
.step-btn {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    font-size: 0.6rem;
    margin: 0;
    border: 1px solid #ccc;
    background: #fff;
    border-radius: 3px;
    cursor: pointer;
    line-height: 1.3;
}
.step-btn:hover { background: #f0f0f0; }
.step-btn-complete {
    background: var(--meja-gold);
    color: #fff;
    border-color: var(--meja-gold);
}
.step-btn-complete:hover { background: #b8960e; }

/* Parts groups */
.parts-group {
    margin-bottom: 0.75rem;
}
.parts-group-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.2rem 0;
    border-bottom: 2px solid var(--meja-gold);
    margin-bottom: 0;
}
.parts-group-header span {
    font-weight: 600;
    font-size: 0.85rem;
}
.parts-group-header small {
    color: var(--meja-gray);
    font-size: 0.7rem;
}

/* Part cut through */
.part-cut td { text-decoration: line-through; opacity: 0.5; }

/* Feature badge on parts */
.badge-feature {
    display: inline-block;
    padding: 0.1rem 0.35rem;
    background: #f0e6cc;
    color: #8B7332;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 600;
    margin-right: 0.1rem;
}

/* Cut list */
.cut-list-group {
    margin-bottom: 1rem;
}
.cut-list-header {
    background: var(--meja-dark);
    color: #fff;
    padding: 0.3rem 0.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 4px 4px 0 0;
}

/* Workflow configurator (Product Type form) */
.workflow-config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
.workflow-col-header {
    background: var(--meja-dark);
    color: #ccc;
    padding: 0.3rem 0.5rem;
    font-weight: 600;
    font-size: 0.8rem;
    border-radius: 4px 4px 0 0;
}
.workflow-drop-zone {
    min-height: 60px;
    border: 2px dashed #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    padding: 0.3rem;
}
.workflow-drop-active {
    border-color: var(--meja-gold);
    background: #fcf9f0;
}
.workflow-drag-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.5rem;
    margin-bottom: 0.2rem;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: grab;
}
.workflow-drag-item:active { cursor: grabbing; }
.workflow-drag-assigned {
    border-color: var(--meja-gold);
    background: #fefdf8;
}
.wf-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--meja-gold);
    color: #fff;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}
.wf-step-icon { display: inline-flex; align-items: center; margin-right: 0.15rem; color: var(--meja-gold); }
.wf-step-icon svg, .wf-step-icon i { width: 14px; height: 14px; }
.sortable-ghost {
    opacity: 0.4;
    background: #e8e8e8;
}

/* Part configuration help & adjustment row */
.part-config-help {
    color: #666; font-size: 0.78rem; margin: 0.2rem 0 0.4rem;
    line-height: 1.4; background: #f8f9fa; padding: 0.4rem 0.6rem;
    border-radius: 4px; border-left: 3px solid var(--meja-gold);
}
.part-config-help code { background: #e9ecef; padding: 1px 4px; border-radius: 2px; font-size: 0.75rem; }
.part-adjust-row {
    display: flex; align-items: center; gap: 4px;
    font-size: 0.8rem; color: #555; padding: 2px 0;
}
.part-adjust-row input[type="number"] { width: 3.5rem; padding: 2px 4px; font-size: 0.8rem; margin: 0; flex: 0 0 auto; }
.part-adjust-row input.offset-input { width: 4.5rem; }
.part-adjust-row input.offset-input::-webkit-inner-spin-button,
.part-adjust-row input.offset-input::-webkit-outer-spin-button {
    opacity: 1;
    height: 1.2em;
}
.part-adjust-row select { width: 6rem; padding: 2px 4px; font-size: 0.8rem; margin: 0; flex: 0 0 auto; }
.part-adjust-row .op { font-weight: 600; color: #888; min-width: 0.8rem; text-align: center; flex: 0 0 auto; }
.part-adjust-label { font-size: 0.72rem; font-weight: 600; color: #999; min-width: 2.5rem; flex: 0 0 auto; }
.part-adjust-help {
    color: #999; font-size: 0.72rem; font-style: italic;
    padding: 1px 0 3px;
}
.part-adjust-help code { background: #e9ecef; padding: 1px 4px; border-radius: 2px; font-size: 0.7rem; font-style: normal; }
.part-adjust-header {
    display: flex; align-items: center; gap: 4px;
    padding: 0 0 1px; margin-bottom: 0;
}
.adj-col-head {
    font-size: 0.65rem; font-weight: 600; color: #aaa;
    text-transform: uppercase; letter-spacing: 0.03em;
    flex: 0 0 auto; text-align: center;
}
.adj-col-spacer { width: 0.8rem; flex: 0 0 auto; }

/* Workflow step management */
.step-inactive td { opacity: 0.45; }
.wf-icon-preview svg,
.wf-icon-preview i { width: 20px; height: 20px; vertical-align: middle; }

/* Workflow section headers on WO detail */
.workflow-section-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--meja-gray);
    margin: 0.5rem 0 0.15rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Listing description modal */
#listing-modal::backdrop { background: rgba(0, 0, 0, 0.4); }
#listing-modal textarea {
    font-family: 'Consolas', 'Courier New', monospace;
    line-height: 1.5;
    border: 1px solid #ddd;
    padding: 0.5rem;
}
#listing-modal input[type="text"] { border: 1px solid #ddd; }

/* --- Activity Timeline --- */
.activity-timeline {
    border-left: 2px solid #e0e0e0;
    margin-left: 0.5rem;
    padding-left: 0;
}
.activity-entry {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.3rem 0;
    margin-left: -9px;
}
.activity-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: var(--meja-gold, #C5A55A);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.activity-body {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    align-items: baseline;
}
.activity-desc {
    font-size: 0.8rem;
    color: #333;
}
.activity-quote-link {
    font-size: 0.7rem;
    color: #666;
    text-decoration: none;
}
.activity-quote-link:hover { color: var(--meja-gold, #C5A55A); }
.activity-time {
    font-size: 0.7rem;
    color: #999;
}

/* ── Image Library Tag Chips ── */
.tag-chip {
    display: inline-block;
    font-size: 0.65rem;
    padding: 1px 7px;
    border-radius: 10px;
    font-weight: 500;
    line-height: 1.6;
    white-space: nowrap;
}
.tag-product  { background: #e8daef; color: #4a235a; }
.tag-material { background: #d4edda; color: #155724; }
.tag-hardware { background: #d1ecf1; color: #0c5460; }
.tag-feature  { background: #fff3cd; color: #856404; }
.tag-custom   { background: #e2e3e5; color: #383d41; }
