/* ==========================================================================
   Modern form controls: dropdown, date picker, phone, combo, money, stepper, switch.
   Loaded after app.css.
   ========================================================================== */
.dd, .dp, .combo { position: relative; min-width: 0; }
.dd-trigger {
    width: 100%; height: 40px; display: flex; align-items: center; gap: 9px; padding: 0 12px; text-align: left;
    background: #fff; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--text); font-size: 14px;
    transition: border-color .15s, box-shadow .15s, background .15s; cursor: pointer;
}
.dd-trigger:hover:not(:disabled) { border-color: #c9bfa9; background: var(--gold-tint); }
.dd-trigger:focus-visible, .dd.open .dd-trigger, .dp.open .dd-trigger { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(201, 150, 47, .14); background: #fff; }
.dd-trigger:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.dd-value { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-placeholder { flex: 1; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-lead { color: var(--gold-strong); }
.dd-caret { color: var(--muted); margin-left: auto; transition: transform .18s; }
.dd.open .dd-caret { transform: rotate(180deg); color: var(--gold-strong); }
.dd-scrim { position: fixed; inset: 0; z-index: 70; }
.dd-menu {
    position: fixed; z-index: 71; display: flex; flex-direction: column; overflow: hidden; background: #fff;
    border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 48px rgba(12, 10, 6, .18), 0 2px 6px rgba(12, 10, 6, .06);
    animation: pop .14s ease-out; max-height: 340px; outline: none;
}
.dd-search { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--faint); }
.dd-search input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 13.5px; min-width: 0; }
.dd-options { overflow-y: auto; padding: 6px; }
.dd-group { padding: 8px 10px 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.dd-option { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 9px; background: none; text-align: left; font-size: 13.5px; color: var(--text); }
.dd-option.active { background: var(--gold-tint); }
.dd-option.selected { font-weight: 600; }
.dd-option-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dd-option-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-option small { color: var(--muted); font-size: 12px; font-weight: 400; }
.dd-check { color: var(--gold-strong); }
.dd-create { color: var(--gold-strong); font-weight: 600; border-top: 1px dashed var(--line); border-radius: 0 0 9px 9px; margin-top: 2px; }
.swatch-box { display: inline-block; width: 26px; height: 16px; border-radius: 4px; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); background-image: linear-gradient(45deg, rgba(0,0,0,.04) 25%, transparent 25%); }
.swatch-box.lg { width: 44px; height: 28px; border-radius: 7px; }
.swatch-row { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.swatch-row > span:last-child { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-intro { margin: 6px 22px 12px; color: var(--muted); font-size: 13px; }
.toolbar.padded-x { padding: 0 22px; }
.small-note { font-size: 12.5px; margin: -6px 0 12px; }
.colour-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.colour-tile { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 12.5px; font-weight: 500; text-align: left; min-width: 0; transition: border-color .15s, box-shadow .15s; }
.colour-tile:hover { border-color: var(--gold); box-shadow: var(--shadow-sm); }
.colour-tile span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.colour-chip { width: 22px; height: 22px; border-radius: 6px; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.colour-editor { display: flex; flex-direction: column; gap: 14px; }
.colour-preview { height: 84px; border-radius: 14px; display: grid; place-items: end start; padding: 12px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); }
.colour-preview span { background: rgba(255, 255, 255, .92); padding: 4px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; }
.field-label { font-size: 12.5px; font-weight: 600; color: #4b463d; }
.palette { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; }
.palette-chip { aspect-ratio: 1; border: 0; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14); transition: transform .1s; }
.palette-chip:hover { transform: scale(1.1); }
.palette-chip.selected { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }
.tab .icon { opacity: .7; }
/* Order costing */
.line-extra summary { display: flex; align-items: center; gap: 12px; }
.summary-cost { margin-left: auto; font-weight: 500; color: var(--muted); font-size: 12.5px; }
.cost-block { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.cost-block-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cost-block-head b { display: block; font-size: 13.5px; }
.cost-block-head small { display: block; color: var(--muted); font-size: 12px; }
.cost-row { display: grid; gap: 10px; align-items: center; margin-top: 10px; }
.material-row { grid-template-columns: minmax(0, 2.4fr) 150px minmax(0, 1.2fr) 110px 34px; }
.service-row { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.3fr) 150px 150px 34px; }
.cost-cell { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.cost-cell small { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cost-amount { text-align: right; font-variant-numeric: tabular-nums; }
.line-extra .form-grid { margin-top: 12px; }
.cost-summary { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; padding: 10px 14px; border-radius: 10px; background: var(--gold-tint); border: 1px solid #efe2c3; font-size: 12.5px; color: var(--muted); }
.cost-summary b { color: var(--ink); margin-left: 4px; }
.cost-summary .grand { margin-left: auto; }
.totals-box .muted-row span, .totals-box .muted-row b { font-size: 12.5px; }
.costing-item { padding: 10px 0; border-top: 1px solid var(--line); }
.costing-item:first-of-type { border-top: 0; }
.costing-title { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.costing-title span { color: var(--muted); font-size: 12.5px; }
.costing-line { display: grid; grid-template-columns: minmax(0, 1fr) auto 110px; gap: 12px; align-items: center; padding: 5px 0 5px 14px; font-size: 13px; }
.costing-line b { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) {
    .material-row, .service-row { grid-template-columns: 1fr 1fr; }
    .material-row > .dd, .service-row > .combo:first-child { grid-column: 1 / -1; }
}
.rot-90 { transform: rotate(90deg); }
.method-list { display: flex; flex-direction: column; }
.method-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto auto 34px 34px; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.method-row:first-child { border-top: 0; }
.method-row.archived .method-text, .method-row.archived .method-icon { opacity: .5; }
.method-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold-strong); }
.method-text b { display: block; font-size: 14px; }
.method-text small { color: var(--muted); font-size: 12px; }
.method-row > .muted { font-size: 12px; white-space: nowrap; }
/* Attachments */
.rot-180 { transform: rotate(180deg); }
.upload-bar { display: grid; grid-template-columns: 300px 1fr; gap: 14px; align-items: end; margin-bottom: 16px; }
.dropzone { position: relative; min-height: 76px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 12px;
    border: 1.5px dashed #d9c79d; border-radius: 14px; background: var(--gold-tint); text-align: center; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone:focus-within { border-color: var(--gold); background: #fbf3e0; }
.dropzone input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone.busy { border-style: solid; }
.dropzone-icon { color: var(--gold-strong); }
.dropzone b { font-size: 13.5px; }
.dropzone small { color: var(--muted); font-size: 12px; }
.attach-filters { margin-bottom: 12px; }
.attach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.attach-tile { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; padding: 0; text-align: left; transition: box-shadow .15s, transform .15s, border-color .15s; }
.attach-tile:hover { border-color: var(--gold); box-shadow: var(--shadow); transform: translateY(-2px); }
.attach-thumb { position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; background: #f1ede5; overflow: hidden; }
.attach-thumb img, .attach-thumb video { width: 100%; height: 100%; object-fit: cover; }
.attach-thumb.kind-video { background: #111; }
.play-badge { position: absolute; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: rgba(11, 10, 8, .7); color: #fff; }
.file-badge { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--gold-strong); }
.file-badge b { font-size: 11px; letter-spacing: .08em; padding: 2px 8px; border-radius: 6px; background: #fff; color: var(--ink); }
.kind-pdf .file-badge { color: #c0392b; }
.kind-word .file-badge { color: #2b5797; }
.kind-sheet .file-badge { color: #1e7145; }
.kind-slides .file-badge { color: #d24726; }
.attach-meta { padding: 8px 10px; min-width: 0; }
.attach-meta b { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attach-meta small { color: var(--muted); font-size: 11.5px; }
/* Employee documents (ID cards, certificates…) inside the employee form */
.doc-checklist { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; font-size: 12.5px; }
.doc-check { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; border: 1px dashed var(--line-strong, #d8d0c0); color: var(--muted); background: #fff; }
.doc-check.done { border-style: solid; border-color: #b9dcc4; background: #eef8f1; color: #1f7a45; }
.doc-list { display: flex; flex-direction: column; gap: 8px; }
.doc-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.doc-row.staged { border-style: dashed; background: #fffcf5; }
.doc-thumb { flex: none; width: 52px; height: 40px; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: #f1ede5; border: 0; padding: 0; cursor: pointer; }
span.doc-thumb { cursor: default; }
.doc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.doc-thumb .file-badge { gap: 1px; }
.doc-thumb .file-badge b { font-size: 9px; padding: 0 4px; }
/* width 0 + grow: a long file name is cut with "…" instead of widening the form */
.doc-info { flex: 1 1 auto; width: 0; min-width: 0; }
.doc-info b { display: block; font-size: 13px; }
.doc-info small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-row .row-actions { flex: none; width: auto; display: flex; gap: 2px; }
.doc-count { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; margin-top: 2px; }
.doc-count.none { color: var(--muted); }


/* Full-screen viewer */
.viewer-backdrop { position: fixed; inset: 0; z-index: 85; display: flex; flex-direction: column; background: rgba(8, 7, 5, .97); color: #fff; outline: none; animation: fade .15s ease-out; }
.viewer-bar { display: flex; align-items: center; gap: 6px; padding: 12px 16px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.viewer-title { flex: 1; min-width: 0; }
.viewer-title b { display: block; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-title small { color: #a8a194; font-size: 12px; }
.viewer-count { color: #a8a194; font-size: 12.5px; margin-right: 8px; font-variant-numeric: tabular-nums; }
.viewer-btn { color: #d8d2c6 !important; width: 38px; height: 38px; }
.viewer-btn:hover { background: rgba(255, 255, 255, .1) !important; color: #fff !important; }
.viewer-btn.danger:hover { background: rgba(179, 55, 43, .35) !important; }
.viewer-edit { display: flex; gap: 10px; padding: 10px 16px; background: rgba(255, 255, 255, .04); align-items: center; }
.viewer-edit input { flex: 1; height: 36px; padding: 0 12px; border-radius: 9px; border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .06); color: #fff; outline: none; }
.viewer-edit .dd-trigger { background: #fff; }
.viewer-stage { flex: 1; min-height: 0; display: flex; align-items: center; gap: 10px; padding: 16px; }
/* The picture area takes exactly the space left (a 0-minimum grid track): a large photo scales down to fit instead of
   growing the area and spilling off screen. */
.viewer-content { flex: 1; align-self: stretch; min-width: 0; min-height: 0; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; overflow: hidden; }
.viewer-content img, .viewer-content video { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 8px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
/* While the viewer is open the page behind it doesn't scroll. */
body:has(.viewer-backdrop) { overflow: hidden; }
.viewer-content iframe { width: 100%; height: 100%; border: 0; border-radius: 8px; background: #fff; }
.viewer-content .doc-render { width: 100%; height: 100%; overflow: auto; border-radius: 8px; background: #fff; color: var(--text); }
.doc-loading { display: flex; align-items: center; justify-content: center; gap: 10px; height: 100%; color: var(--muted); }
.doc-render .docx-wrapper { background: #eceae4 !important; padding: 24px !important; }
.sheet-tabs { position: sticky; top: 0; display: flex; gap: 4px; padding: 8px; background: #faf9f6; border-bottom: 1px solid var(--line); z-index: 1; }
.sheet-tabs button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 5px 12px; font-size: 12.5px; }
.sheet-tabs button.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.sheet-body { padding: 12px; }
.sheet-body table { border-collapse: collapse; font-size: 12.5px; }
.sheet-body td { border: 1px solid #e3ded3; padding: 5px 9px; white-space: nowrap; }
.sheet-body tr:first-child td { background: #faf6ec; font-weight: 600; }
.audio-card { display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 40px; border-radius: 18px; background: rgba(255, 255, 255, .06); }
.audio-card audio { width: min(420px, 80vw); }
.no-preview { max-width: 420px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 30px; border-radius: 18px; background: #fff; color: var(--text); }
.no-preview h3 { font: 600 19px var(--serif); }
.no-preview p { margin: 0; color: var(--muted); font-size: 13.5px; }
.doc-render .no-preview { margin: 40px auto; }
.viewer-nav { flex: none; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .08); color: #fff; display: grid; place-items: center; }
.viewer-nav:hover:not(:disabled) { background: rgba(255, 255, 255, .18); }
.viewer-nav:disabled { opacity: .2; }
.viewer-strip { display: flex; gap: 8px; padding: 10px 16px 14px; overflow-x: auto; justify-content: center; }
.strip-thumb { flex: none; width: 58px; height: 44px; border-radius: 8px; overflow: hidden; border: 2px solid transparent; background: rgba(255, 255, 255, .08); color: #d8d2c6; font-size: 10px; font-weight: 700; padding: 0; }
.strip-thumb img { width: 100%; height: 100%; object-fit: cover; }
.strip-thumb.active { border-color: var(--gold-bright); }
@media (max-width: 700px) {
    .upload-bar { grid-template-columns: 1fr; }
    .viewer-nav { display: none; }
    .viewer-stage { padding: 8px; }
}
/* Garment line: give price and quantity enough room */
.line-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1.1fr) minmax(0, .8fr) 108px minmax(160px, 1.3fr) minmax(0, 1fr) 34px !important; }
.fabric-colours { display: inline-flex; gap: 12px; font-weight: 500; color: var(--text); font-size: 12.5px; }
.fabric-colours .swatch-box { width: 18px; height: 12px; }
@media (max-width: 1280px) {
    .line-main { grid-template-columns: repeat(3, minmax(0, 1fr)) 34px !important; }
    .line-main .field:first-child { grid-column: span 2; }
}
@media (max-width: 640px) {
    .line-main { grid-template-columns: 1fr 1fr !important; }
    .line-main .field:first-child { grid-column: 1 / -1; }
}
.icon-btn.restock { border: 1px solid var(--line); background: #fff; color: var(--gold-strong); }
.icon-btn.restock:hover { border-color: var(--gold); background: var(--gold-tint); }
/* Client types and group orders */
.segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: #efebe3; }
.segment { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; font-size: 13px; font-weight: 600; color: var(--muted); transition: background .15s, color .15s, box-shadow .15s; }
.segment:hover:not(:disabled) { color: var(--ink); }
.segment.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.segment.active .icon { color: var(--gold-strong); }
.line-people { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px dashed var(--line); }
.line-people.single { grid-template-columns: minmax(0, 340px); }
.type-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 7px; font-size: 12px; font-weight: 600; background: #f0ede6; color: #5c564c; white-space: nowrap; }
.type-pill.type-church { background: #f3e8f1; color: #7b3f6e; }
.type-pill.type-school { background: var(--info-soft); color: var(--info); }
.type-pill.type-organization { background: var(--success-soft); color: var(--success); }
.avatar.group { background: var(--ink); color: var(--gold-bright); border-radius: 10px; }
tr.group-row td { background: #fcfaf5; }
.member-of { display: flex; align-items: center; gap: 6px; margin: -2px 0 8px; color: var(--muted); font-size: 13.5px; }
.wearer-cell b { display: block; }
.wearer-cell small { display: flex; align-items: center; gap: 4px; }
.small-link { font-size: 12px; margin-top: 3px; }
.step.locked { cursor: not-allowed; opacity: .55; }
.step.locked .step-dot { border-style: dashed; }
.measure-chips.large { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.measure-chips.large b { font-size: 18px; }
.measure-chips em { display: block; font-size: 11px; color: var(--muted); font-style: normal; }
.sheet-profiles { margin-bottom: 14px; }
@media (max-width: 900px) { .line-people { grid-template-columns: 1fr; } }
.kc-wearer { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin: 4px 0 6px; font-size: 13px; font-weight: 600; color: var(--ink); }
.kc-wearer small { width: 100%; padding-left: 18px; font-weight: 500; color: var(--muted); font-size: 11.5px; }
.kc-measure { display: flex; align-items: center; gap: 6px; width: 100%; margin-top: 8px; padding: 6px 8px; border: 1px dashed #dcc9a0; border-radius: 8px; background: var(--gold-tint); color: var(--gold-strong); font-size: 12px; font-weight: 600; text-align: left; }
.kc-measure:hover { background: var(--gold-soft); border-style: solid; }
.kc-waiting { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.kanban-col.locked { background: repeating-linear-gradient(135deg, #efece5 0 10px, #ebe7de 10px 20px); }
.field-help { color: var(--muted); font-size: 12px; }
/* Validation */
.req { color: var(--danger); font-style: normal; margin-left: 3px; }
.field-error { display: flex; align-items: flex-start; gap: 5px; color: var(--danger); font-size: 12px; font-weight: 500; line-height: 1.35; animation: fade .15s ease-out; }
.field-error .icon { margin-top: 1px; flex: none; }
.has-error > input:not([type=checkbox]):not([type=radio]), .has-error > textarea, .has-error > select,
.has-error .dd-trigger, .has-error .phone-input, .has-error .affix-input, .has-error .stepper-input, .has-error .combo-field input,
.has-error .input-action input {
    border-color: var(--danger) !important; background-color: #fffafa;
}
.has-error > input:focus, .has-error > textarea:focus, .has-error .dd-trigger:focus-visible, .has-error .phone-input:focus-within,
.has-error .affix-input:focus-within, .has-error .combo-field input:focus { box-shadow: 0 0 0 4px rgba(179, 55, 43, .14) !important; }
.has-error .phone-input .dd-trigger { border-color: transparent !important; border-right-color: var(--line) !important; }
.has-error > .field-label { color: var(--danger); }
.form-alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; margin-bottom: 16px; border-radius: 12px; background: var(--danger-soft); color: var(--danger); border: 1px solid #f0cbc5; animation: pop .15s ease-out; }
.form-alert .icon { margin-top: 1px; flex: none; }
.form-alert b { display: block; font-size: 13.5px; }
.form-alert ul { margin: 4px 0 0; padding-left: 18px; font-size: 12.5px; color: #8e2d23; }
.cost-row.row-error, .size-row.row-error { border-radius: 10px; box-shadow: 0 0 0 1px var(--danger); background: #fffafa; }
.row-error-text { grid-column: 1 / -1; }
.dd-empty { padding: 16px; text-align: center; color: var(--muted); font-size: 13px; }
/* compact variants for toolbars and tables */
.dd-sm .dd-trigger, .dp-sm .dd-trigger { height: 36px; font-size: 13px; border-color: var(--line); min-width: 160px; }
.dd-xs .dd-trigger { height: 32px; font-size: 12.5px; border-color: var(--line); min-width: 132px; padding: 0 10px; }

/* Date picker */
.dp-trigger .dd-value { font-variant-numeric: tabular-nums; }
.dp-clear { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: var(--muted); margin-left: auto; }
.dp-clear:hover { background: var(--danger-soft); color: var(--danger); }
.dp-panel { width: 304px; padding: 12px; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dp-title { display: flex; gap: 2px; }
.dp-title-btn { border: 0; background: none; font: 600 15px var(--serif); padding: 5px 8px; border-radius: 8px; color: var(--ink); font-variant-numeric: lining-nums; }
.dp-title-btn:hover { background: var(--gold-tint); color: var(--gold-strong); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.dp-dow { text-align: center; font-size: 11px; font-weight: 600; color: var(--faint); padding: 4px 0 6px; }
.dp-day { height: 36px; border: 0; border-radius: 9px; background: none; font-size: 13px; font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; position: relative; }
.dp-day:hover:not(:disabled) { background: var(--gold-tint); color: var(--gold-strong); }
.dp-day.outside { color: #c3bdb1; }
.dp-day.today { color: var(--gold-strong); font-weight: 700; }
.dp-day.today::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--gold); }
.dp-day.focused { box-shadow: inset 0 0 0 1.5px var(--gold); }
.dp-day.selected { background: var(--ink); color: var(--gold-bright); font-weight: 700; }
.dp-day.selected::after { background: var(--gold-bright); }
.dp-day:disabled { opacity: .3; }
.dp-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px 0; }
.dp-months button { height: 44px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 13px; font-weight: 500; }
.dp-months button:hover { border-color: var(--gold); color: var(--gold-strong); }
.dp-months button.selected { background: var(--ink); color: var(--gold-bright); border-color: var(--ink); }
.dp-months button.today { border-color: var(--gold); }
.dp-foot { display: flex; align-items: center; gap: 2px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.dp-foot .btn-sm { height: 28px; padding: 0 9px; font-size: 12px; }

/* Phone input */
.phone-input { display: flex; align-items: stretch; height: 40px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.phone-input:focus-within { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(201, 150, 47, .14); }
.phone-input .phone-country { flex: none; }
.phone-input .phone-country .dd-trigger { height: 100%; border: 0; border-right: 1px solid var(--line); border-radius: 10px 0 0 10px; background: var(--surface-2); padding: 0 8px 0 10px; gap: 6px; box-shadow: none; }
.phone-input .phone-country .dd-trigger:hover { background: var(--gold-tint); }
.phone-input > input { flex: 1; min-width: 0; border: 0 !important; outline: 0; background: transparent; padding: 0 12px; height: 100% !important; box-shadow: none !important; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.phone-input.disabled { background: var(--surface-2); }
.phone-code { display: inline-flex; align-items: center; gap: 7px; }
.phone-code b { font-weight: 600; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.country-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.country-row > span:nth-child(2) { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.country-row small { color: var(--muted); font-variant-numeric: tabular-nums; }
.flag { position: relative; display: inline-grid; place-items: center; width: 22px; height: 16px; border-radius: 3px; overflow: hidden; background: #eeeae2; flex: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }
.flag img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.flag span { font-size: 8px; font-weight: 700; color: var(--muted); }

.phone-text { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: inherit; white-space: nowrap; font-variant-numeric: tabular-nums; }
.phone-text:hover { color: var(--gold-strong); }
small .phone-text { font-weight: 400; gap: 6px; }
small .phone-text .flag { width: 18px; height: 13px; }
/* Extra numbers stack under the main one */
.phone-text.extra { display: flex; width: fit-content; margin-top: 3px; font-weight: 500; }
.phone-list { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
/* The remove button sits inside the box, so every number is the same length as the main one. */
.phone-extra { position: relative; }
.phone-extra input[type=tel] { padding-right: 36px; }
.phone-extra > .icon-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; }
.add-phone { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; }

/* Combo (free text with suggestions) */
.combo-field { position: relative; display: flex; align-items: center; }
.combo-field > .dd-lead { position: absolute; left: 12px; pointer-events: none; }
.combo-field > .dd-caret { position: absolute; right: 12px; pointer-events: none; }
.combo-field input { width: 100%; height: 40px; padding: 0 34px 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
.combo-field > .dd-lead + input { padding-left: 38px !important; }
.combo-field input { padding-right: 34px !important; }
.combo-field input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(201, 150, 47, .14); }
.combo-field input:hover { border-color: #c9bfa9; }

/* Money and stepper */
.affix-input { display: flex; align-items: center; height: 40px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.affix-input:hover { border-color: #c9bfa9; }
.affix-input:focus-within { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(201, 150, 47, .14); }
.affix-input .affix { padding: 0 10px; height: 100%; display: grid; place-items: center; background: var(--surface-2); border-right: 1px solid var(--line); color: var(--gold-strong); font-size: 12.5px; font-weight: 700; }
.affix-input input { flex: 1; min-width: 0; height: 100%; border: 0 !important; outline: 0; padding: 0 12px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; background: transparent; box-shadow: none !important; }
.affix-input.disabled { background: var(--surface-2); }
.stepper-input { display: flex; align-items: center; height: 40px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.stepper-input:focus-within { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(201, 150, 47, .14); }
.stepper-input button { width: 30px; height: 100%; border: 0; background: var(--surface-2); color: var(--muted); display: grid; place-items: center; flex: none; }
.stepper-input button:hover:not(:disabled) { background: var(--gold-soft); color: var(--gold-strong); }
.stepper-input input { flex: 1; min-width: 0; width: 100%; height: 100%; border: 0 !important; outline: 0; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; box-shadow: none !important; padding: 0 !important; }
.affix-input.suffix .affix { border-right: 0; border-left: 1px solid var(--line); color: var(--muted); font-weight: 600; min-width: 52px; }
.affix-input.invalid { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(179, 55, 43, .12); }
.readonly-value { min-height: 40px; display: flex; flex-direction: column; justify-content: center; padding: 0 2px; font-weight: 600; }
.readonly-value small { font-weight: 400; color: var(--muted); font-size: 12px; }
.level-bar { width: 90px; height: 5px; margin: 5px 0 0 auto; border-radius: 99px; background: #efebe3; overflow: hidden; }
.level-bar i { display: block; height: 100%; border-radius: 99px; background: var(--success); }
.level-bar i.low-stock { background: var(--warning); }
.level-bar i.out-of-stock { background: var(--danger); }
.unit { font-weight: 500; color: var(--muted); font-size: 12px; }
tr.archived td { opacity: .55; }
.category-list { display: flex; flex-direction: column; gap: 8px; }
.category-row { display: grid; grid-template-columns: 1.4fr 1fr auto auto 34px; gap: 10px; align-items: center; }
.category-row > input, .category-add input { height: 38px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; outline: none; min-width: 0; }
.category-row > input:focus, .category-add input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(201, 150, 47, .14); }
.category-row .combo-field input { height: 38px; }
.category-row .muted { font-size: 12px; white-space: nowrap; }
.category-add { display: flex; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.category-add input { flex: 1; }
.totals-box .affix-input { width: 180px; height: 36px; }
.totals-box .dd { width: 180px; }
.totals-box .dd .dd-trigger { height: 36px; }

/* Switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track { position: relative; width: 42px; height: 24px; border-radius: 99px; background: #d9d3c6; transition: background .18s; flex: none; }
.switch-track i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .18s; }
.switch input:checked + .switch-track { background: var(--gold); }
.switch input:checked + .switch-track i { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 4px rgba(201, 150, 47, .25); }
.switch.disabled { opacity: .55; cursor: not-allowed; }
.switch-text b { display: block; font-size: 13.5px; font-weight: 600; }
.switch-text small { display: block; font-size: 12px; color: var(--muted); }

/* Native checkbox / radio restyle */
input[type=checkbox]:not([role=switch]), input[type=radio] {
    appearance: none; -webkit-appearance: none; width: 18px; height: 18px; margin: 0; flex: none; cursor: pointer;
    border: 1.5px solid var(--line-strong); background: #fff; display: inline-grid; place-items: center; transition: all .15s;
}
input[type=checkbox]:not([role=switch]) { border-radius: 5px; }
input[type=radio] { border-radius: 50%; }
input[type=checkbox]:not([role=switch]):hover, input[type=radio]:hover { border-color: var(--gold); }
input[type=checkbox]:not([role=switch]):checked {
    border-color: var(--ink);
    background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e3bd62' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat;
}
input[type=radio]:checked { border-color: var(--ink); background: radial-gradient(circle, var(--gold) 0 4px, #fff 5px); }
input[type=checkbox]:focus-visible, input[type=radio]:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(201, 150, 47, .25); }
.policy input[type=checkbox] { width: 20px; height: 20px; }

/* Text inputs */
.field textarea { line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--faint); }
.toolbar .dd, .toolbar .dp { flex: none; }
.field-inline .dp { min-width: 200px; }
.field-inline { gap: 10px; }

/* Size charts & conversions */
.chart-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.chip-count { display: inline-grid; place-items: center; min-width: 20px; height: 18px; margin-left: 6px; padding: 0 6px; border-radius: 99px; background: #eeeae2; color: var(--muted); font-size: 10.5px; }
.chip.active .chip-count { background: rgba(255, 255, 255, .16); color: var(--gold-bright); }
.chip:disabled { opacity: .55; cursor: not-allowed; }
.add-chip { display: inline-flex; align-items: center; gap: 5px; border-style: dashed; color: var(--gold-strong); }
.add-chip:hover { background: var(--gold-tint); border-color: var(--gold); }
.converter-inputs { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: end; }
.converter-inputs h3 { font: 600 18px var(--serif); margin: 2px 0 4px; }
.converter-inputs .small-note { margin: 0; }
.converter-result { display: flex; gap: 18px; margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--line); animation: fade .15s ease-out; }
.ghana-size { flex: none; width: 128px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; border-radius: 14px; background: var(--ink); color: #fff; padding: 16px 10px; }
.ghana-size small { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-bright); }
.ghana-size b { font: 700 34px var(--serif); line-height: 1; }
.converter-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.converter-body .small-note { margin: 0; }
.equivalents { display: flex; flex-wrap: wrap; gap: 6px; }
.equivalents span { display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 10px; border-radius: 9px; border: 1px solid var(--line); background: #fff; }
.equivalents small { font-size: 11px; color: var(--muted); font-weight: 600; }
.equivalents b { font-size: 13.5px; }
.equivalents span.active { border-color: var(--gold); background: var(--gold-soft); }
.size-chart-card .card-head { margin-bottom: 14px; }
.size-table th.sticky-col, .size-table td.sticky-col { position: sticky; left: 0; z-index: 1; box-shadow: inset -1px 0 0 var(--line); }
.size-table th.sticky-col { background: var(--surface-2); }
.size-table td.sticky-col { background: #fff; }
.size-table td.sticky-col b { font: 700 15px var(--serif); }
.size-table th.conv-col { color: var(--ink); }
.size-table th.measure-col { color: var(--gold-strong); }
.size-table tbody tr:hover td { background: var(--gold-tint); }
.size-table tr.highlight td, .size-table tr.highlight td.sticky-col { background: var(--gold-soft); }
.size-table.editing th { padding: 8px 6px; }
.size-table.editing td { padding: 5px 6px; }
.size-table.editing .row-actions { display: flex; gap: 2px; }
.col-head { display: flex; align-items: center; gap: 2px; }
.col-head input { width: 92px; height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: 0; color: inherit; }
.col-head .icon-btn { width: 26px; height: 26px; }
.cell-input { width: 100%; min-width: 64px; height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 13px; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.cell-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 150, 47, .14); }
.cell-input.strong { font-weight: 700; min-width: 0; }
.size-table.editing .sticky-col { width: 92px; min-width: 92px; }
.cell-input.num { text-align: right; }
.cell-input.invalid { border-color: var(--danger); background: #fffafa; }
.size-table tr.row-invalid td, .size-table tr.row-invalid td.sticky-col { background: #fff7f6; }
.chart-edit-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 0 22px 14px; }
.chart-edit-bar .form-alert { width: 100%; }
.size-chart-card > .form-alert { margin: 0 22px 14px; }
.inline-add { display: flex; gap: 6px; align-items: center; }
.inline-add input { width: 250px; height: 36px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; font-size: 13px; }
.inline-add input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(201, 150, 47, .14); }
.field.compact { flex-direction: row; align-items: center; gap: 8px; }
.chart-notes { padding: 14px 22px 20px; border-top: 1px solid var(--line); }
.measure-row.row-error { padding: 6px; margin: 0 -6px; border-radius: 10px; box-shadow: 0 0 0 1px var(--danger); background: #fffafa; }
@media (max-width: 900px) {
    .converter-inputs { grid-template-columns: 1fr; }
    .converter-result { flex-direction: column; }
    .ghana-size { width: 100%; flex-direction: row; gap: 12px; }
    .inline-add input { width: 100%; }
}

/* Order lines: sizing mode and size runs */
.line-item.has-issues { border-color: #efc2bb; box-shadow: 0 0 0 3px rgba(179, 55, 43, .06); }
.line-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.line-no { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.line-mode { display: flex; align-items: center; gap: 8px; }
.line-mode > small { font-size: 12px; color: var(--muted); font-weight: 600; }
.segmented.seg-sm { padding: 3px; border-radius: 10px; }
.segmented.seg-sm .segment { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; gap: 5px; }
.line-people.two { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.line-main { align-items: start !important; }
.line-main > .icon-btn { margin-top: 26px; }
.line-main .field-error { font-size: 11.5px; }
.sizes-summary { font-size: 13px; font-weight: 600 !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; display: block !important; line-height: 40px; }
.line-total { min-width: 0; }
.size-run { margin-top: 12px; padding: 12px 14px; border: 1px solid #e7d7b3; border-radius: 12px; background: #fff; }
.size-run-head { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: end; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.size-run-title b { display: flex; align-items: center; gap: 6px; font-size: 13.5px; }
.size-run-title b .icon { color: var(--gold-strong); }
.size-run-title small { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); line-height: 1.45; }
.size-run-title small b { display: inline; font-size: 12px; }
.size-run-title small .icon { vertical-align: -2px; }
.size-run > .field-error { margin-top: 8px; }
.size-rows { display: flex; flex-direction: column; }
.size-row { display: grid; grid-template-columns: minmax(150px, 1fr) 76px 116px minmax(0, 2.2fr) auto; gap: 10px; align-items: center; padding: 6px 4px; border-bottom: 1px solid #f3efe7; }
.size-row:last-child { border-bottom: 0; }
.size-row.head { padding-top: 10px; padding-bottom: 2px; border-bottom: 0; }
.size-row.head span { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.size-row.row-error { margin: 4px 0; }
.size-row .row-actions { display: flex; gap: 2px; }
.size-row .icon-btn.active { background: var(--gold-soft); color: var(--gold-strong); }
.ghana-eq { display: grid; place-items: center; height: 32px; border-radius: 8px; background: var(--ink); color: #fff; font-weight: 700; font-size: 13px; }
.ghana-eq.empty { background: var(--surface-2); color: var(--faint); border: 1px dashed var(--line-strong); }
.size-measure { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12.5px; color: var(--text); }
.size-measure > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.adjusted-tag { flex: none; font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--gold-soft); color: var(--gold-strong); }
.size-adjust { grid-column: 1 / -1; margin: 4px 0 6px; padding: 12px; border: 1px dashed #dcc9a0; border-radius: 10px; background: var(--gold-tint); display: flex; flex-direction: column; gap: 10px; animation: fade .15s ease-out; }
.size-adjust.has-error { border-color: var(--danger); background: #fffafa; }
.size-adjust-head b { display: block; font-size: 13px; }
.size-adjust-head small { display: block; font-size: 12px; color: var(--muted); }
.adjust-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.adjust-cell { display: flex; flex-direction: column; gap: 3px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.adjust-cell small { font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adjust-cell input { width: 100%; height: 30px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 7px; font-weight: 700; font-size: 14px; color: var(--ink); background: #fff; }
.adjust-cell input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 150, 47, .14); }
.adjust-cell em { font-style: normal; font-size: 11px; color: var(--faint); }
.adjust-cell.changed { border-color: var(--gold); background: #fffdf7; }
.adjust-cell.changed input { color: var(--gold-strong); border-color: var(--gold); }
.adjust-cell.changed em { color: var(--gold-strong); font-weight: 600; }
.size-adjust-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.size-adjust-foot .note-input { flex: 1; min-width: 220px; height: 34px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: #fff; font-size: 13px; }
.size-adjust-foot .note-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 150, 47, .14); }
.size-run-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.size-run-foot b { color: var(--ink); }
.totals-box > .field-error { justify-content: flex-end; padding: 0 0 8px; border-bottom: 1px dashed var(--line); }
.totals-box .has-error > span { color: var(--danger); }
.sizing-pref .segmented { align-self: flex-start; }
@media (max-width: 900px) {
    .size-run-head { grid-template-columns: 1fr; }
    .size-row { grid-template-columns: 1fr 70px 110px auto; }
    .size-row.head { display: none; }
    .size-measure { grid-column: 1 / -1; order: 5; }
    .line-people.two { grid-template-columns: 1fr; }
}
/* Size-run sheet (production) */
.size-sheet { display: flex; flex-direction: column; gap: 12px; }
.size-sheet-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; }
.size-sheet-item.adjusted { border-color: #e2cc97; background: #fffdf7; }
.size-sheet-item header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.size-sheet-label { display: flex; align-items: center; gap: 12px; }
.size-sheet-label .ghana-eq { width: 52px; height: 44px; font: 700 18px var(--serif); border-radius: 10px; }
.size-sheet-label b { display: block; font-size: 14.5px; }
.size-sheet-label small { display: block; font-size: 12px; color: var(--muted); }
.size-sheet-note { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; padding: 7px 10px; border-radius: 8px; background: var(--gold-soft); color: var(--gold-strong); font-size: 12.5px; font-weight: 600; }
.measure-chips span.changed { border-color: var(--gold); background: #fff6e2; }
.pref-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 7px; font-size: 12px; font-weight: 600; background: var(--gold-soft); color: var(--gold-strong); }
.sizing-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: -4px 0 12px; font-size: 12.5px; }
.ghana-eq, .ghana-size b, .size-table td.sticky-col b, .size-table .cell-input { font-variant-numeric: lining-nums; }
/* Letter-size conversion table */
.size-table .group-head th { background: #f3efe6; font-size: 10.5px; letter-spacing: .06em; padding-top: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.size-table .group-head .conv-group { text-align: center; color: var(--ink); border-right: 1px solid var(--line); }
.size-table .group-head .measures-head { text-align: center; color: var(--gold-strong); }
.size-table th.conv-col { text-align: center; }
.size-table th.conv-col:last-of-type { border-right: 1px solid var(--line); }
.size-table th.active-col { background: var(--gold-soft); color: var(--gold-strong); }
.size-table td.conv-cell { text-align: center; font-weight: 600; color: var(--muted); }
.size-table td.conv-cell.shifted { color: var(--gold-strong); background: #fff6e2; font-weight: 700; }
.size-table td.conv-cell.hit { box-shadow: inset 0 0 0 2px var(--gold); color: var(--ink); background: var(--gold-soft); }
.size-table .cell-input.center { text-align: center; text-transform: uppercase; min-width: 56px; }
.size-table .cell-input.center::placeholder { color: #cfc8ba; text-transform: none; }
.chart-legend { display: flex; align-items: center; gap: 8px; margin: 0; padding: 12px 22px 16px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }
.legend-shifted { display: inline-grid; place-items: center; min-width: 26px; height: 20px; border-radius: 5px; background: #fff6e2; color: var(--gold-strong); font-weight: 700; font-size: 11px; }
.conversion-line { margin: 0; font-size: 14px; }
.chart-note { max-width: 520px; text-align: right; }
.chart-edit-hint { margin: 0 22px 14px; }
.converter-inputs, .size-run-head { align-items: start; }
.size-run-head .size-run-title { align-self: center; }
/* Tape-measured garments have no size column */
.line-main.measured { grid-template-columns: minmax(0, 2fr) minmax(0, 1.1fr) 108px minmax(160px, 1.3fr) minmax(0, 1fr) 34px !important; }
@media (max-width: 1280px) {
    /* Style gets its own row; the rest share the next one. */
    .line-main { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 90px minmax(150px, 1.2fr) minmax(0, 1fr) 34px !important; }
    .line-main.measured { grid-template-columns: minmax(0, 1fr) 108px minmax(150px, 1.2fr) minmax(0, 1fr) 34px !important; }
    .line-main > .field:first-child { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
    .line-main, .line-main.measured { grid-template-columns: 1fr 1fr !important; }
}
/* Add another garment, below the list */
.add-line { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 46px; margin-top: 12px; border: 1.5px dashed #dcc9a0; border-radius: 12px; background: transparent; color: var(--gold-strong); font-size: 13.5px; font-weight: 600; transition: background .15s, border-color .15s; }
.add-line:hover { background: var(--gold-tint); border-color: var(--gold); }
.add-line:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(201, 150, 47, .2); }

/* ---------- 3D fit preview (js/body3d.js) ---------- */
.body3d { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 16px; align-items: stretch; }
.b3-stage { position: relative; height: min(620px, 70vh); border-radius: 14px; overflow: hidden; border: 1px solid var(--line);
    background: radial-gradient(ellipse at 50% 35%, #fffdf8 0%, #f5efe4 55%, #ece3d3 100%); }
.b3-stage canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.b3-stage canvas:active { cursor: grabbing; }
.b3-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.b3-tools { position: absolute; left: 12px; top: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.b3-tools button { height: 30px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .85);
    font-size: 12px; font-weight: 600; color: var(--ink); }
.b3-tools button:hover, .b3-tools button.on { border-color: var(--gold); color: var(--gold-strong); background: #fff; }
.b3-tag { position: absolute; transform: translate(-50%, -150%); padding: 4px 10px; border-radius: 8px; background: var(--ink); color: #fff;
    font-size: 12px; font-weight: 600; white-space: nowrap; pointer-events: none; box-shadow: var(--shadow); }
.b3-legend { display: flex; flex-direction: column; gap: 10px; min-width: 0; max-height: min(620px, 70vh); overflow-y: auto; }
.b3-summary { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.b3-summary b { font-size: 14px; }
.b3-summary span { font-size: 13px; color: var(--gold-strong); font-weight: 600; }
.b3-summary small { font-size: 12px; color: var(--muted); }
.b3-legend ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.b3-legend li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--line);
    background: #fff; font-size: 12.5px; cursor: default; border-left: 3px solid var(--gold); }
.b3-legend li b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.b3-legend li.est { border-left-color: #c9c3b8; color: var(--muted); }
.b3-legend li.active, .b3-legend li:focus { outline: none; border-color: var(--gold); background: #fff8ea; }
.b3-note { margin: 0; font-size: 11.5px; color: var(--muted); }
/* In the profile form: the figure sits beside the values and follows them as they are typed. */
.body3d.compact { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.body3d.compact .b3-stage { height: 440px; }
.body3d.compact .b3-legend { max-height: 220px; }
.measure-edit.with-preview { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.measure-edit.with-preview .body3d { position: sticky; top: 0; }
.measure-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.view-3d { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; white-space: nowrap; }
@media (max-width: 960px) {
    .body3d { grid-template-columns: minmax(0, 1fr); }
    .b3-legend { max-height: none; }
    .measure-edit.with-preview { grid-template-columns: minmax(0, 1fr); }
    .measure-edit.with-preview .body3d { position: static; }
}
.b3-tones { position: absolute; right: 12px; top: 12px; display: flex; gap: 6px; padding: 5px; border-radius: 99px; background: rgba(255, 255, 255, .85); border: 1px solid var(--line-strong); }
.b3-tones[hidden] { display: none; }
.b3-tones button { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-strong); padding: 0; }
.b3-tones button.on { box-shadow: 0 0 0 2px var(--gold); }

/* Email & notification settings */
.email-card .subhead { margin: 22px 0 10px; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.notify-rules { display: grid; gap: 10px; }
.notify-rule { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.notify-rule > :first-child { flex: 1 1 320px; }
.notify-rule-extra { display: flex; flex-direction: column; gap: 4px; min-width: 240px; }
.notify-rule-extra small { font-size: 12px; max-width: 300px; }
.email-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.email-test { display: flex; gap: 8px; flex: 1 1 320px; max-width: 460px; }
.email-test input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; font: inherit; background: var(--surface); }
.email-error { max-width: 340px; white-space: normal; }

/* Email an invoice */
.invoice-sent { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.attachment-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); font-size: 13px; }

/* The client's design references for one garment (order page, production board) */
.garment-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.gf-thumb { position: relative; width: 46px; height: 46px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); display: grid; place-items: center; padding: 0; cursor: pointer; flex: none; }
.gf-thumb:hover { border-color: var(--gold); }
.gf-thumb img, .gf-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.gf-video { position: relative; width: 100%; height: 100%; display: grid; place-items: center; }
.gf-video .icon { position: absolute; color: #fff; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.gf-ext { font-size: 10px; font-weight: 700; color: var(--muted); letter-spacing: .03em; }
.gf-add { position: relative; height: 46px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; border: 1.5px dashed var(--line-strong); border-radius: 8px; color: var(--gold-strong); font-size: 12.5px; font-weight: 600; cursor: pointer; background: transparent; }
.gf-add:hover { border-color: var(--gold); background: #fbf3e0; }
.gf-add input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.gf-add.busy { border-style: solid; color: var(--muted); }
.gf-add .spinner { width: 14px; height: 14px; border-width: 2px; }
.garment-files.compact { width: 100%; flex-direction: column; align-items: stretch; gap: 6px; margin: 2px 0 0; padding: 7px 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); text-align: left; font: inherit; cursor: pointer; }
.garment-files.compact:hover { border-color: var(--gold); background: #fbf3e0; }
.garment-files.compact .gf-label { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--ink, #1d1a16); }
.garment-files.compact .gf-thumbs { display: flex; gap: 5px; }
.garment-files.compact .gf-thumb { width: 40px; height: 40px; border-radius: 7px; background: #fff; }
.gf-more { width: 40px; height: 40px; border-radius: 7px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--muted); }
.viewer-garment { min-width: 240px; }
.attach-for { color: var(--gold-strong); }
.kanban-card .garment-files.compact { margin: 0 0 8px; }
.kc-notes { margin: 0 0 8px; font-size: 12px; font-style: italic; color: var(--muted); white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.upload-choices { display: flex; flex-direction: column; gap: 10px; }

/* Website orders */
.source-tag { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: #eef4ff; color: #2c5aa0; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; vertical-align: 1px; }
.unassigned { color: var(--gold-strong); font-weight: 600; }
.website-status { margin-top: 16px; }
.website-actions { display: flex; flex-wrap: wrap; gap: 8px; }


/* Website shop */
.notice-card { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.work-banner { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding: 12px 16px; border-radius: 12px; background: var(--gold-tint); color: var(--gold-strong); font-weight: 600; font-size: 13.5px; }
.work-banner .spinner { width: 16px; height: 16px; border-width: 2px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.shop-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); min-width: 0; }
.shop-photo { position: relative; aspect-ratio: 4 / 5; padding: 0; border: 0; background: var(--surface-2); cursor: zoom-in; overflow: hidden; }
.shop-photo:disabled { cursor: default; }
.shop-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shop-nophoto { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--faint, #b9b1a2); }
.shop-photo-count { position: absolute; right: 8px; bottom: 8px; padding: 3px 8px; border-radius: 99px; background: rgba(11, 10, 8, .7); color: #fff; font-size: 11px; font-weight: 600; }
.shop-status { position: absolute; left: 8px; top: 8px; }
.shop-status .badge { box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.shop-body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; flex: 1; }
.shop-name { font-size: 14.5px; line-height: 1.3; }
.shop-body > small { color: var(--muted); font-size: 12px; }
.shop-price { font-weight: 700; font-size: 15px; margin-top: 2px; }
.shop-sizes { display: flex; flex-wrap: wrap; gap: 4px; }
.shop-sizes span { padding: 1px 7px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); font-size: 11px; font-weight: 600; color: var(--muted); }
.shop-error { font-size: 11.5px; }
.shop-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 10px; }
.size-pick .chip { min-width: 46px; }
.field.switches { display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.product-photos { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.product-photos-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.product-photos-head small { color: var(--muted); font-size: 12px; }
.product-photo-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.product-photo { position: relative; width: 104px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.product-photo.main { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }
.product-photo-img { display: block; width: 100%; aspect-ratio: 4 / 5; padding: 0; border: 0; cursor: zoom-in; }
.product-photo-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-photo .main-tag { position: absolute; left: 6px; top: 6px; padding: 1px 7px; border-radius: 99px; background: var(--ink); color: var(--gold-bright); font-size: 10px; font-weight: 700; }
.product-photo-actions { display: flex; justify-content: space-between; padding: 2px; }
.product-photo-actions .icon-btn { width: 28px; height: 28px; }
.product-photo-add { width: 104px; height: auto; aspect-ratio: 4 / 5; flex-direction: column; justify-content: center; }
.subhead-row { margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.subhead-row small { display: block; margin-top: 3px; font-size: 12px; }

.hidden { display: none !important; }

/* Customer pages: order tracking (no sign-in; phones first) */
.public-shell { min-height: 100vh; display: flex; flex-direction: column; background: #f6f3ec; }
.public-head { background: #0b0a08; border-bottom: 3px solid #c8923a; }
.public-brand { max-width: 640px; margin: 0 auto; padding: 14px 16px; display: flex; align-items: center; gap: 12px; color: #f3d48c; text-decoration: none; }
.public-brand img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: #fff; }
.public-brand b { display: block; font-family: var(--serif, Georgia, serif); font-size: 18px; }
.public-brand small { display: block; color: #bfb6a6; font-size: 11.5px; letter-spacing: .03em; }
.public-main { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 18px 14px 28px; display: flex; flex-direction: column; gap: 14px; }
.public-foot { padding: 18px 16px 26px; text-align: center; color: #8a8275; font-size: 12.5px; line-height: 1.6; }
.public-foot a { color: #8a6420; }
.track-card { background: #fff; border: 1px solid #ece6da; border-radius: 16px; padding: 18px; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.track-card h1 { margin: 2px 0 4px; font-family: var(--serif, Georgia, serif); font-size: 24px; }
.track-card h2 { margin: 0 0 12px; font-size: 15px; font-weight: 700; }
.track-eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #a87a26; }
.track-sub { margin: 0; color: #7a7266; font-size: 14px; }
.track-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.track-status { padding: 6px 12px; border-radius: 99px; background: #fbf3e0; color: #8a6420; font-weight: 700; font-size: 13px; white-space: nowrap; }
.track-status.ready { background: #e7f5ec; color: #1f7a45; }
.track-status.cancelled { background: #fde9e7; color: #b3372b; }
.track-steps { list-style: none; margin: 4px 0 6px; padding: 0; display: flex; flex-direction: column; gap: 0; }
.track-steps li { position: relative; display: flex; align-items: center; gap: 12px; padding: 7px 0; color: #9a9284; font-size: 14.5px; }
.track-steps li:not(:last-child)::after { content: ""; position: absolute; left: 10px; top: 29px; height: calc(100% - 22px); width: 2px; background: #e6dfd2; }
.track-steps li.done::after { background: #c8923a; }
.track-steps .dot { width: 22px; height: 22px; flex: none; border-radius: 50%; border: 2px solid #d9d2c3; background: #fff; display: grid; place-items: center; color: #fff; z-index: 1; }
.track-steps li.done { color: #4a443b; }
.track-steps li.done .dot { background: #c8923a; border-color: #c8923a; }
.track-steps li.current { color: #0b0a08; font-weight: 700; }
.track-steps li.current .dot { border-color: #c8923a; box-shadow: 0 0 0 4px #f6e7c6; background: #fff; }
.track-note { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; background: #f8f5ef; color: #4a443b; font-size: 14px; }
.track-note.ready { background: #e7f5ec; color: #1f7a45; }
.track-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.track-items li { padding-bottom: 12px; border-bottom: 1px solid #f0ebe1; }
.track-items li:last-child { border-bottom: 0; padding-bottom: 0; }
.track-item-top { display: flex; justify-content: space-between; gap: 10px; font-size: 14.5px; }
.track-item-top span { color: #8a6420; font-weight: 600; font-size: 13px; white-space: nowrap; }
.track-items small { display: block; color: #8a8275; font-size: 12.5px; margin-top: 2px; }
.track-bar { height: 6px; border-radius: 99px; background: #efe9de; margin-top: 8px; overflow: hidden; }
.track-bar i { display: block; height: 100%; background: linear-gradient(90deg, #c8923a, #e2b75e); border-radius: 99px; }
.track-money { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0; font-size: 14.5px; }
.track-money dt { color: #7a7266; }
.track-money dd { margin: 0; font-weight: 700; text-align: right; }
.track-money dd.due { color: #b3372b; }
.track-money dd.paid { color: #1f7a45; }
.track-pay { margin-top: 12px; padding: 12px; border-radius: 10px; background: #f8f5ef; font-size: 13.5px; display: flex; flex-direction: column; gap: 4px; }
.track-pay small { color: #7a7266; margin-top: 4px; }
.track-cancel details summary { cursor: pointer; font-weight: 700; font-size: 15px; }
.track-cancel p { color: #4a443b; font-size: 14px; }
.track-form { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.track-field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: #4a443b; }
.track-field input, .track-field textarea { width: 100%; box-sizing: border-box; padding: 12px; border: 1px solid #d9d2c3; border-radius: 10px; font: inherit; font-size: 16px; font-weight: 400; background: #fff; }
.track-check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.track-check input { width: 18px; height: 18px; }
.track-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border: 0; border-radius: 12px; background: #0b0a08; color: #f3d48c; font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none; }
.track-btn.danger { background: #b3372b; color: #fff; }
.track-btn.ghost { background: #fff; color: #0b0a08; border: 1px solid #d9d2c3; }
.track-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.track-actions .track-btn { flex: 1 1 140px; white-space: nowrap; padding: 0 12px; }
.track-help p { color: #7a7266; font-size: 14px; margin: 0 0 12px; }
.track-alert { display: flex; gap: 8px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: #fde9e7; color: #8e2d23; font-size: 14px; margin-bottom: 12px; }
.track-alert.ok { background: #e7f5ec; color: #1f6b3e; }
.track-lookup h1 { margin-bottom: 6px; }

/* Staff side of customer tracking */
.cancel-request { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; border-color: #f0cbc5; background: #fdf3f1; color: #8e2d23; }
.cancel-request-text { flex: 1 1 320px; display: flex; flex-direction: column; gap: 3px; }
.cancel-request-text span { color: #6b3a33; font-size: 13.5px; }
.cancel-request-actions { display: flex; gap: 8px; }
.track-link-box { display: flex; gap: 6px; margin-bottom: 10px; }
.track-link-box input { flex: 1; min-width: 0; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font-size: 12.5px; color: var(--muted); }
.track-link-send { margin-bottom: 4px; }
td small.text-danger { display: block; font-weight: 600; }
.track-note svg { flex-shrink: 0; }
