/* ==========================================================================
   GREENDECKS Terrace Configurator - 3-Column Engineering Blueprint Layout
   UX/UI Reference Architecture: greendecks.vistegra-admin.ru/calculator
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;

  /* Color Palette - GREENDECKS Brand */
  --primary: #1E4D3B;
  --primary-hover: #15372A;
  --primary-light: #EBF4F0;
  --accent: #C5A059;
  --accent-hover: #B08B45;

  --dark: #1A1D20;
  --dark-surface: #2B2D31;
  --dark-muted: #6C727F;
  --light-bg: #F8F9FA;
  --card-bg: #FFFFFF;
  --border-color: #E5E7EB;
  --border-focus: #1E4D3B;

  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 9999px;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);

  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Resets */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--light-bg);
  color: var(--dark);
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* Header & Top Menu Bar */
.calc-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo svg { width: 32px; height: 32px; }

.brand-text {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--primary);
}

.brand-text span { color: var(--accent); }

/* Top Navigation Bar: ПРОЕКТ | ВИД | ОФОРМЛЕНИЕ */
.top-menu-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.top-menu-dropdown {
  position: relative;
  display: inline-block;
}

.top-menu-btn {
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 700;
  color: var(--dark);
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.top-menu-btn:hover { background: var(--light-bg); color: var(--primary); }

.top-menu-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #ffffff;
  min-width: 220px;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 12px;
  z-index: 150;
}

.top-menu-dropdown:hover .top-menu-content { display: block; }

.layer-checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  color: var(--dark);
  cursor: pointer;
}

.header-contacts { display: flex; align-items: center; gap: 16px; }
.contact-phone { font-weight: 700; font-size: 15px; color: var(--dark); }

.btn-header-wa {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #25D366;
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 13px;
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-header-wa:hover { background: #20bd5a; }

/* Main Wrapper */
.calc-wrapper {
  max-width: 1440px;
  margin: 16px auto 60px auto;
  padding: 0 16px;
}

/* 3-COLUMN MAIN LAYOUT GRID */
.calc-3col-layout {
  display: grid;
  grid-template-columns: 320px 1fr 340px;
  gap: 16px;
  align-items: start;
}

@media (max-width: 1200px) {
  .calc-3col-layout {
    grid-template-columns: 1fr;
  }
}

/* LEFT PANEL: Parameters & Tools (320px) */
.left-tools-panel {
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.panel-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-light);
}

/* Step panels inside left column */
.calc-step-panel { display: none; }
.calc-step-panel.active { display: block; animation: fadeIn 0.25s ease; }

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

.step-header h3 { font-family: var(--font-heading); font-size: 18px; font-weight: 700; color: var(--dark); }
.step-header p { font-size: 12px; color: var(--dark-muted); margin-bottom: 14px; }

/* Inputs & Form Elements */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--dark); }
.form-control {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--dark);
  font-size: 14px;
  transition: var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 77, 59, 0.12);
}

.inputs-inline-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Shape Cards Selector */
.shape-selector-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.shape-card {
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-fast);
  background: var(--light-bg);
}

.shape-card:hover { border-color: var(--primary-light); }
.shape-card.active { border-color: var(--primary); background: var(--primary-light); }
.shape-card svg { width: 32px; height: 32px; stroke: var(--dark); fill: none; margin-bottom: 4px; }
.shape-card.active svg { stroke: var(--primary); }
.shape-title { font-weight: 600; font-size: 12px; }

/* Top Mode & Coverage Tabs */
.tab-group { display: flex; gap: 4px; background: var(--light-bg); padding: 3px; border-radius: var(--radius-pill); margin-bottom: 14px; }
.tab-btn { flex: 1; padding: 6px 10px; border-radius: var(--radius-pill); border: none; background: transparent; font-size: 12px; font-weight: 600; color: var(--dark-muted); cursor: pointer; transition: var(--transition-fast); text-align: center; }
.tab-btn.active { background: var(--primary); color: #fff; }

/* CENTER: LARGE INTERACTIVE EDITOR WORKSPACE */
.center-editor-workspace {
  background: var(--dark-surface);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.editor-toolbar {
  background: #1A1D20;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tool-group { display: flex; align-items: center; gap: 6px; }

.tool-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.tool-btn:hover { background: var(--accent); color: #1A1D20; }

.svg-canvas-container {
  height: 540px;
  position: relative;
  background: #1A1D20;
  overflow: hidden;
}

.svg-canvas-container svg { width: 100%; height: 100%; display: block; }

.vertex-handle { cursor: grab; transition: fill 0.15s ease, r 0.15s ease; }
.vertex-handle:hover { fill: #E5C158; cursor: grab; }
.vertex-handle-group:active .vertex-handle { cursor: grabbing; fill: #ffffff; }

.add-vertex-btn { transition: transform 0.15s ease, fill 0.15s ease; }
.add-vertex-group:hover .add-vertex-btn { transform: scale(1.3); fill: #2563EB; stroke: #ffffff; }

.edge-stair-btn { transition: transform 0.15s ease, fill 0.15s ease; }
.edge-stair-group:hover .edge-stair-btn { transform: scale(1.3); fill: #C5A059; stroke: #ffffff; }

.dim-badge-interactive { transition: transform 0.15s ease; }
.dim-badge-interactive:hover rect { fill: #C5A059; stroke: #ffffff; }
.dim-badge-interactive:hover text { fill: #1A1D20; }

/* RIGHT PANEL: Project, Materials & Calculation (340px) */
.right-summary-panel {
  background: var(--dark-surface);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-lg);
}

.project-header-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.project-code-badge {
  background: rgba(255, 255, 255, 0.1);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
}

.right-total-box {
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.total-caption { font-size: 11px; color: #9CA3AF; text-transform: uppercase; letter-spacing: 0.5px; }
.total-amount { font-family: var(--font-heading); font-size: 26px; font-weight: 800; color: var(--accent); }

.right-action-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.btn-right-action { padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.08); color: #fff; font-size: 12px; font-weight: 600; cursor: pointer; transition: var(--transition-fast); text-align: center; }
.btn-right-action:hover { background: var(--accent); color: #1A1D20; }

.btn-calculate-big {
  width: 100%;
  height: 44px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 16px;
  transition: var(--transition-fast);
}

.btn-calculate-big:hover { background: var(--primary-hover); }

.materials-summary-list {
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 16px;
}

.mat-item { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 6px; }
.mat-label { color: #9CA3AF; }
.mat-val { font-weight: 700; color: #fff; }

.btn-whatsapp-full {
  width: 100%;
  height: 44px;
  background: #25D366;
  color: #fff;
  border-radius: var(--radius-pill);
  border: none;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-whatsapp-full:hover { background: #20bd5a; }

/* Product Cards Grid */
.products-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 16px; }
.product-card { border: 1px solid var(--border-color); border-radius: var(--radius-sm); overflow: hidden; background: #fff; cursor: pointer; position: relative; transition: var(--transition-fast); display: flex; flex-direction: column; }
.product-card:hover { border-color: var(--primary); }
.product-card.active { border: 2px solid var(--primary); }

.card-badge { position: absolute; top: 6px; left: 6px; background: var(--primary); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: var(--radius-pill); z-index: 2; }
.card-image-wrap { height: 110px; overflow: hidden; background: #f1f3f5; }
.card-image-wrap img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 10px; display: flex; flex-direction: column; flex-grow: 1; }
.card-title { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.card-specs { display: flex; gap: 4px; margin-bottom: 6px; }
.spec-tag { font-size: 10px; background: var(--light-bg); padding: 1px 4px; border-radius: 3px; color: var(--dark-muted); }
.card-price { font-weight: 800; font-size: 14px; color: var(--primary); }

/* Color Swatches Grid */
.color-cards-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.color-card { display: flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--border-color); border-radius: var(--radius-pill); cursor: pointer; background: #fff; font-size: 12px; }
.color-card.active { border-color: var(--primary); background: var(--primary-light); }
.color-circle { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.2); }

/* Subframe Cards */
.subframe-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 16px; }
.subframe-card { border: 1px solid var(--border-color); border-radius: var(--radius-sm); padding: 10px; cursor: pointer; background: #fff; }
.subframe-card.active { border: 2px solid var(--primary); background: var(--primary-light); }
.sf-title { font-weight: 700; font-size: 13px; }
.sf-price { font-weight: 700; color: var(--primary); font-size: 12px; }

/* Hardware Row */
.hw-item-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border-color); font-size: 12px; }
.hw-name { font-weight: 600; }
.hw-price { font-weight: 700; color: var(--primary); }

/* Step Navigation Footer Actions */
.step-actions-bar { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--border-color); }
.btn-nav { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 18px; border-radius: var(--radius-pill); font-weight: 600; font-size: 13px; cursor: pointer; border: none; }
.btn-secondary { background: var(--light-bg); color: var(--dark); border: 1px solid var(--border-color); }
.btn-primary { background: var(--primary); color: #fff; }

/* Compact Specification List for 320px Left Panel */
.spec-compact-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.spec-compact-item {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  transition: var(--transition-fast);
}

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

.spec-compact-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.spec-compact-title {
  font-weight: 700;
  font-size: 12px;
  color: var(--dark);
  line-height: 1.3;
  flex: 1;
}

.spec-compact-total {
  font-weight: 800;
  font-size: 13px;
  color: var(--primary);
  white-space: nowrap;
}

.spec-compact-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--dark-muted);
}

.spec-badge-qty {
  background: var(--light-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 1px 6px;
  font-weight: 600;
  color: var(--dark);
}

.spec-compact-price {
  font-size: 11px;
  color: var(--dark-muted);
}

.spec-totals-box { background: var(--light-bg); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 14px; border: 1px solid var(--border-color); }
.total-row { display: flex; justify-content: space-between; margin-bottom: 5px; font-size: 12px; color: var(--dark); }
.total-row.grand-total { font-size: 15px; font-weight: 800; margin-top: 6px; padding-top: 6px; border-top: 2px solid var(--border-color); }
.total-highlight { color: var(--primary); }

.lead-form-box {
  background: var(--light-bg);
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.lead-form-box h4 {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--dark);
}

/* Modal Window */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.6); display: none; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.modal-overlay.active { display: flex; }
.modal-content { background: #fff; border-radius: var(--radius-lg); max-width: 440px; width: 100%; padding: 28px; text-align: center; box-shadow: var(--shadow-lg); }
.modal-icon { font-size: 40px; margin-bottom: 12px; }
.modal-title { font-family: var(--font-heading); font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.modal-text { font-size: 14px; color: var(--dark-muted); margin-bottom: 20px; }

/* Sticky Mobile Bar */
.sticky-mobile-bar { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: var(--dark-surface); color: #fff; padding: 10px 16px; align-items: center; justify-content: space-between; z-index: 90; box-shadow: 0 -4px 16px rgba(0,0,0,0.2); }

@media (max-width: 991px) {
  .sticky-mobile-bar { display: flex; }
}

/* Layers Control Widget Card */
.layers-control-card {
  background: var(--light-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 16px;
}

.layers-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--border-color);
}

.layers-card-title {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--dark);
  margin: 0;
}

.layers-actions {
  display: flex;
  gap: 6px;
}

.btn-layer-action {
  font-size: 10px;
  font-weight: 600;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--primary);
  cursor: pointer;
  transition: var(--transition-fast);
}

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

.layers-toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.layer-toggle-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--dark);
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  transition: var(--transition-fast);
}

.layer-toggle-btn:hover {
  border-color: var(--primary);
}

.layer-toggle-btn input[type="checkbox"] {
  accent-color: var(--primary);
  cursor: pointer;
}

/* ==========================================================================
   UI REDESIGN STYLES MATCHING REFERENCE SCREENSHOTS 1, 2, 3, 4
   ========================================================================== */

/* SCREENSHOT 1: LEFT SIDEBAR SELECTION CARDS */
.left-selection-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 20px 16px;
  margin-bottom: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  text-align: center;
}

.selection-card-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 12px;
}

.selection-card-icon-box {
  width: 48px;
  height: 48px;
  background: #f3f4f6;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px auto;
  color: #374151;
}

.selection-card-status {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  line-height: 1.3;
}

.selection-card-sub {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
  margin-bottom: 14px;
}

.btn-card-choose {
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 9999px;
  padding: 8px 32px;
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-block;
}

.btn-card-choose:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.terrace-height-field {
  margin-top: 18px;
  text-align: left;
}

.terrace-height-field .height-label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 8px;
}

.height-input-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f3f4f6;
  border-radius: 12px;
  padding: 10px 16px;
}

.height-input-wrap input {
  background: transparent;
  border: none;
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  width: 100%;
  outline: none;
}

.height-input-wrap .height-unit {
  font-size: 14px;
  font-weight: 700;
  color: #6b7280;
  margin-left: 8px;
}

/* SCREENSHOT 4: RIGHT PANEL STACKED CARDS (ПРОЕКТ & МАТЕРИАЛЫ) */
.right-card, .card-project, .card-materials {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 18px 16px;
  margin-bottom: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.right-card-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  text-align: center;
  margin-bottom: 12px;
}

.proj-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}

.proj-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s ease;
}

.proj-icon-btn:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.card-divider {
  border: none;
  border-top: 1px solid #f3f4f6;
  margin: 12px 0;
}

.card-kv-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-kv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.card-kv-row .kv-label {
  color: #6b7280;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-kv-row .kv-value {
  color: #111827;
  font-weight: 600;
}

.card-kv-row .muted-val {
  color: #9ca3af;
  font-weight: 400;
}

.btn-edit-pencil {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  margin-left: 4px;
}

.badge-status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
}

.badge-red {
  background: #fee2e2;
  color: #ef4444;
}

.badge-green {
  background: #d1fae5;
  color: #10b981;
}

/* MATERIALS CARD STYLING */
.materials-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}

.mat-tab-btn {
  width: 44px;
  height: 40px;
  border-radius: 12px;
  border: none;
  background: #f3f4f6;
  color: #4b5563;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mat-tab-btn.active, .mat-tab-btn:hover {
  background: #e5e7eb;
  color: #111827;
}

.btn-calculate-gray {
  width: 100%;
  background: #6b7280;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 16px;
  transition: background 0.2s ease;
}

.btn-calculate-gray:hover {
  background: #4b5563;
}

.last-calc-title {
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
  margin-bottom: 6px;
}

.last-calc-progress {
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  margin-bottom: 14px;
}

.bold-price {
  font-size: 15px;
  font-weight: 800 !important;
  color: #111827;
}

/* SCREENSHOTS 2 & 3: CATALOG MODAL DIALOGS */
.catalog-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.catalog-modal-window {
  background: #ffffff;
  border-radius: 20px;
  width: 100%;
  max-width: 1020px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
  overflow: hidden;
}

.catalog-modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.catalog-modal-header .header-titles h2 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

.catalog-modal-header .header-titles p {
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f3f4f6;
  border-radius: 9999px;
  padding: 6px 14px;
  width: 220px;
}

.search-input-wrap svg {
  color: #9ca3af;
}

.search-input-wrap input {
  background: transparent;
  border: none;
  outline: none;
  font-size: 13px;
  width: 100%;
}

.view-toggles {
  display: flex;
  gap: 4px;
  background: #f3f4f6;
  padding: 2px;
  border-radius: 8px;
}

.view-btn {
  background: transparent;
  border: none;
  padding: 6px 8px;
  border-radius: 6px;
  color: #6b7280;
  cursor: pointer;
}

.view-btn.active {
  background: #ffffff;
  color: #111827;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.btn-close-modal {
  background: #f3f4f6;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 14px;
  color: #4b5563;
  cursor: pointer;
}

.btn-close-modal:hover {
  background: #e5e7eb;
}

.catalog-modal-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.catalog-filter-sidebar {
  width: 220px;
  border-right: 1px solid #f3f4f6;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.filter-group-header {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 8px;
  cursor: pointer;
}

.filter-checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #374151;
  padding: 4px 0;
  cursor: pointer;
}

.color-filter-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.color-radio-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #374151;
  padding: 3px 0;
  cursor: pointer;
}

.color-dot-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(0,0,0,0.1);
}

.btn-reset-filters {
  margin-top: auto;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 9999px;
  padding: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
}

.btn-reset-filters:hover {
  background: #f9fafb;
}

.catalog-products-container {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-content: start;
}

@media (max-width: 900px) {
  .catalog-products-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* CATALOG ITEM CARD STYLING */
.catalog-item-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.catalog-item-card:hover {
  border-color: #9ca3af;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.catalog-item-card.selected {
  border: 2px solid #111827;
  box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.1);
}

.catalog-item-img {
  width: 100%;
  height: 110px;
  object-fit: contain;
  margin-bottom: 8px;
}

.catalog-item-title {
  font-size: 12px;
  font-weight: 700;
  color: #111827;
  line-height: 1.3;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 32px;
}

.catalog-color-select {
  width: 100%;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #374151;
  outline: none;
  margin-top: auto;
  cursor: pointer;
}

.catalog-modal-footer {
  padding: 14px 24px;
  border-top: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.btn-modal-action {
  padding: 8px 24px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-modal-action.btn-ghost {
  background: #ffffff;
  border: 1px solid #d1d5db;
  color: #374151;
}

.btn-modal-action.btn-ghost:hover {
  background: #f9fafb;
}

.btn-modal-action.btn-confirm {
  background: #6b7280;
  border: none;
  color: #ffffff;
}

.btn-modal-action.btn-confirm.active, .btn-modal-action.btn-confirm:hover {
  background: #111827;
}
