/* ============================================================================
   Flooring Vision — designer + wizard + 3D overlay styles
   Sibling of counter_vision.css, fv- prefixed.
   ========================================================================== */

.fv-workspace { display: flex; flex-direction: column; gap: 8px; }

.fv-topbar {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
    padding: 8px 10px;
}
.fv-topbar-spacer { flex: 1; }
.fv-name-input {
    font-size: 15px; font-weight: 600; border: 1px solid transparent;
    border-radius: 6px; padding: 4px 8px; min-width: 220px;
}
.fv-name-input:hover, .fv-name-input:focus { border-color: #d1d5db; }
.fv-save-dot { width: 10px; height: 10px; border-radius: 50%; background: #d1d5db; display: inline-block; }
.fv-save-dot.dirty  { background: #f59e0b; }
.fv-save-dot.saved  { background: #22c55e; }
.fv-save-dot.failed { background: #dc2626; }
/* Wording next to the dot — a bare colour swatch never told anyone whether
   their change had actually been written. */
.fv-save-state { font-size: 11px; font-weight: 600; white-space: nowrap; }
.fv-save-state.dirty  { color: #b45309; }
.fv-save-state.saved  { color: #15803d; }
.fv-save-state.failed { color: #b91c1c; }
.fv-cal-chip { font-size: 11px; padding: 3px 8px; border-radius: 999px; }
.fv-cal-chip.ok   { background: #dcfce7; color: #166534; }
.fv-cal-chip.warn { background: #fef9c3; color: #854d0e; }

.fv-steps { display: flex; gap: 4px; flex-wrap: wrap; }
.fv-step {
    flex: 1; min-width: 130px; text-align: center; cursor: pointer;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 8px;
    padding: 8px 4px; font-size: 12px; color: #6b7280; user-select: none;
}
.fv-step.active { border-color: #2563eb; color: #1d4ed8; background: #eff6ff; font-weight: 600; }
.fv-step-num {
    display: inline-block; width: 20px; height: 20px; line-height: 20px;
    border-radius: 50%; background: #e5e7eb; color: #374151; font-size: 11px; margin-right: 4px;
}
.fv-step.active .fv-step-num { background: #2563eb; color: #fff; }

.fv-main { display: flex; gap: 10px; align-items: flex-start; position: relative; }

/* Collapsible side columns — same control the Counter Vision workspace uses,
   so the two editors behave identically when space is tight on a tablet. */
.fv-inventory.fv-collapsed,
.fv-side.fv-collapsed { display: none !important; }
.fv-collapse-tab {
    position: absolute; top: 8px; width: 22px; height: 44px; z-index: 20;
    background: #1e3a8a; color: #fff; border: none; border-radius: 4px;
    font-size: 13px; font-weight: 700; cursor: pointer; padding: 0;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.fv-collapse-tab:hover { background: #2563eb; }
.fv-collapse-tab.left  { left: 4px; }
.fv-collapse-tab.right { right: 4px; }
/* Page Inventory - deliberately styled to read like the Counter Vision
   ASSEMBLY INVENTORY sidebar: same 280px column, same uppercase rule-under
   title, same grouped rows with a monospace measurement on the right. The two
   products are used side by side, so they must not look like different apps. */
.fv-inventory {
    width: 280px; flex: 0 0 280px; max-height: 80vh; overflow: auto;
    border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; padding: 12px;
    box-shadow: 0 2px 8px rgba(15,23,42,.05);
}
.fv-inventory-head { display:flex; flex-direction:column; gap:3px; margin-bottom:8px;
    padding-bottom:6px; border-bottom:1px solid #e2e8f0; }
.fv-inventory-head strong { font-size:11px; text-transform:uppercase; letter-spacing:.5px;
    font-weight:700; color:#64748b; }
.fv-inventory-head .text-muted { font-size:10px; color:#94a3b8; }
.fv-inventory-scope { display:flex; gap:5px; margin-bottom:9px; }
.fv-inventory-scope .btn { flex:1; padding:5px 6px; font-size:11px; font-weight:600; }
.fv-inventory-summary { font-size:11px; color:#475569; background:#f8fafc; border:1px solid #e2e8f0;
    border-radius:6px; padding:7px 8px; margin-bottom:8px; }
.fv-inventory-summary strong { color:#0f172a; }
.fv-inventory-page { border:1px solid #e2e8f0; border-radius:8px; margin:8px 0; overflow:hidden; }
.fv-inventory-page.active { border-color:#93c5fd; box-shadow:0 0 0 1px rgba(147,197,253,.35); }
.fv-inventory-page-title { width:100%; display:flex; justify-content:space-between; align-items:center;
    gap:6px; text-align:left; border:0; background:#1e3a8a; padding:7px 9px; cursor:pointer;
    font-size:11px; font-weight:700; color:#fff; letter-spacing:.3px; }
.fv-inventory-page-title span:first-child { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.fv-page-count { flex:none; border-radius:10px; padding:1px 7px; background:rgba(255,255,255,.22);
    color:#fff; font-size:10px; font-weight:700; }
.fv-inventory-items { padding:5px 6px 6px; }
.fv-inventory-item { width:100%; display:flex; justify-content:space-between; align-items:center; gap:6px;
    background:#fff; border:1px solid #e2e8f0; border-left:3px solid #cbd5e1; border-radius:5px;
    padding:6px 7px; margin:4px 0; text-align:left; color:#0f172a; font-size:11px; font-weight:600;
    cursor:pointer; }
.fv-inventory-item:hover { border-left-color:#2563eb; background:#eff6ff; }
.fv-inventory-item.canvas-sel { outline:2px solid #f59e0b; outline-offset:-2px; background:#fffbeb !important;
    border-left-color:#f59e0b; color:#92400e; font-weight:700; }
.fv-inventory-item.canvas-sel small { color:#b45309; }
.fv-inventory-item span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.fv-inventory-item small { flex:none; font-family:monospace; font-weight:700; color:#1e3a8a; font-size:10px; }
.fv-inventory-tip { font-size:10px; color:#94a3b8; line-height:1.35; margin:10px 2px 2px; }
.fv-import-page-row { display:flex; align-items:flex-start; gap:7px; padding:7px 8px; margin:4px 0;
    border:1px solid #dbe3ec; border-radius:7px; background:#f8fafc; cursor:pointer; font-size:12px; }
.fv-import-page-row input { margin-top:2px; }
.fv-import-page-row small { display:block; color:#778397; font-size:10px; margin-top:2px; }
.fv-import-page-row:hover { border-color:#4f8fca; background:#f1f7fd; }
.fv-import-page-thumb { flex:none; width:64px; height:48px; display:flex; align-items:center; justify-content:center;
    background:#eef2f7; border:1px solid #dbe3ec; border-radius:4px; overflow:hidden; color:#94a3b8; font-size:18px; }
.fv-import-page-thumb img { width:100%; height:100%; object-fit:contain; display:block; }
.fv-import-page-meta { min-width:0; }
.fv-inventory-page.viewing .fv-inventory-page-title { background:#eef6ff; color:#1d4ed8; font-weight:700; }
.fv3d-scope { font-size:11px; color:#a9c7e4; padding:4px 8px; border:1px solid rgba(255,255,255,.2); border-radius:12px; }
.fv-canvas-wrap {
    flex: 1; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
    padding: 8px; overflow: hidden;
}
.fv-canvas-wrap canvas { max-width: 100%; touch-action: none; }
.fv-toolbar { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }

.fv-side {
    width: 330px; min-width: 280px; background: #fff; border: 1px solid #e5e7eb;
    border-radius: 10px; padding: 12px; max-height: 76vh; overflow-y: auto;
}
.fv-side h3 { margin: 0 0 6px; font-size: 15px; }
.fv-side h4 { margin: 10px 0 4px; font-size: 13px; }

.fv-btn-col { display: flex; flex-direction: column; gap: 6px; }
.fv-btn-col .btn { text-align: left; }

.fv-metric {
    margin: 10px 0; padding: 8px 10px; background: #f0fdf4;
    border: 1px solid #bbf7d0; border-radius: 8px; font-size: 13px; color: #14532d;
}
.fv-tip { margin-top: 10px; font-size: 12px; color: #6b7280; }

.fv-pattern-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px; }
.fv-pattern-btn {
    border: 1px solid #e5e7eb; background: #fff; border-radius: 8px;
    padding: 8px 6px; font-size: 12px; cursor: pointer; text-align: left;
}
.fv-pattern-btn.active { border-color: #2563eb; background: #eff6ff; color: #1d4ed8; font-weight: 600; }

.fv-form-row { margin: 8px 0; font-size: 13px; }
.fv-form-row label { display: flex; flex-direction: column; gap: 3px; }
.fv-form-row input, .fv-form-row textarea, .fv-form-row select {
    border: 1px solid #d1d5db; border-radius: 6px; padding: 6px 8px; font-size: 13px;
}

.fv-cat-label { font-size: 11px; font-weight: 700; color: #6b7280; margin: 10px 0 4px; text-transform: uppercase; }
.fv-mat-list { max-height: 44vh; overflow-y: auto; }
.fv-mat-card {
    display: flex; align-items: center; gap: 8px; padding: 6px;
    border: 1px solid #e5e7eb; border-radius: 8px; margin-bottom: 5px; cursor: pointer;
}
.fv-mat-card:hover { border-color: #93c5fd; }
.fv-mat-card.active { border-color: #2563eb; background: #eff6ff; }
.fv-mat-info { flex: 1; display: flex; flex-direction: column; font-size: 12px; }
.fv-swatch {
    width: 44px; height: 44px; border-radius: 6px; overflow: hidden;
    background: #f3f4f6; flex-shrink: 0; display: block;
}
.fv-swatch img, .fv-swatch canvas { width: 100%; height: 100%; object-fit: cover; display: block; }

.fv-pattern-preview {
    display: flex; align-items: center; gap: 8px; font-size: 12px;
    border: 1px solid #e5e7eb; border-radius: 8px; padding: 6px; margin-bottom: 8px;
}
.fv-pattern-preview img { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; }

.fv-trim-list, .fv-extras-list { max-height: 40vh; overflow-y: auto; }
.fv-trim-row {
    display: flex; align-items: center; gap: 6px; font-size: 12px;
    padding: 5px 6px; border-radius: 6px; flex-wrap: wrap;
}
.fv-trim-row.active { background: #eff6ff; }
.fv-trim-row label { flex: 1; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.fv-trim-row input[type="number"] { width: 70px; border: 1px solid #d1d5db; border-radius: 6px; padding: 3px 6px; }
.fv-trim-row select { border: 1px solid #d1d5db; border-radius: 6px; padding: 3px 6px; font-size: 12px; }

.fv-price-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 6px 0; }
.fv-price-table td { padding: 5px 4px; border-bottom: 1px solid #f3f4f6; }
.fv-total-row td { font-weight: 800; font-size: 16px; border-top: 2px solid #1e3a8a; color: #1e3a8a; }

.fv-layout-box {
    margin-top: 8px; padding: 8px 10px; font-size: 12px;
    background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; color: #1e40af;
}

.fv-page-card {
    width: 200px; border: 1px solid #e5e7eb; border-radius: 8px; padding: 6px;
    display: flex; flex-direction: column; gap: 6px;
}
.fv-page-card img { width: 100%; height: 130px; object-fit: contain; background: #f9fafb; border-radius: 6px; }

/* ── 3D overlay ─────────────────────────────────────────────────────────── */
#fv3d-overlay {
    position: fixed; inset: 0; z-index: 10000; background: #0f172a;
    display: flex; flex-direction: column;
}
.fv3d-bar {
    display: flex; align-items: center; gap: 6px; padding: 8px 12px;
    background: #1e293b; color: #f1f5f9; flex-wrap: wrap;
}
.fv3d-spacer { flex: 1; }
#fv3d-canvas { flex: 1; width: 100%; display: block; }

/* Mobile / tablet */
@media (max-width: 900px) {
    .fv-main { flex-direction: column; }
    .fv-inventory { width: auto; flex: none; max-height: 230px; }
    .fv-side { width: auto; max-height: none; }
    /* Stacked layout: the columns are already full width, so there is no
       horizontal space to reclaim — and left/right tabs would both land on top
       of the inventory instead of beside the panel they control. */
    .fv-collapse-tab { display: none; }
    .fv-inventory.fv-collapsed,
    .fv-side.fv-collapsed { display: block !important; }
}