/* ============================================================
   WIGGLES INNOVATIONS — Garment Designer
   designer.css — Full-viewport app layout
   ============================================================ */

/* ── Reset / base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-page:      #0F1117;
  --bg-panel:     #1A1D27;
  --bg-canvas:    #555D75;
  --bg-input:     #1E2130;
  --text-primary: #E8EAED;
  --text-muted:   #808898;
  --border:       #2A2E3A;
  --border-focus: #E05A00;
  --brand:        #E05A00;
  --brand-dark:   #C84E00;
  --brand-light:  #2A1A10;
  --danger:       #DC2626;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.3);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.4);
  --radius:       8px;
  --topbar-h:     52px;
  --panel-w:      260px;
}

.gd-body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  background: var(--bg-page);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── Top bar ─────────────────────────────────────────────── */
.gd-topbar {
  height: var(--topbar-h);
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  z-index: 100;
  overflow-x: auto;
  position: relative;
}

.gd-logo-link { display: flex; align-items: center; flex-shrink: 0; }
.gd-logo { height: 32px; width: auto; }

.gd-garment-picker,
.gd-view-tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
  flex-shrink: 0;
}

.gd-garment-tab,
.gd-view-tab,
a.gd-garment-tab {
  text-decoration: none;
}
.gd-garment-tab,
.gd-view-tab {
  padding: 4px 12px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.gd-garment-tab:hover,
.gd-view-tab:hover { background: rgba(224,90,0,0.08); color: var(--brand); }
.gd-garment-tab.active,
.gd-view-tab.active { background: var(--brand); color: #fff; }
.gd-view-tab.disabled { opacity: 0.35; pointer-events: none; }

/* ── Designer mode switcher (centred) ───────────────────── */
.gd-mode-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}
.gd-mode-center > * { pointer-events: auto; }

.gd-mode-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}

.gd-designer-switcher {
  display: flex;
  gap: 3px;
  background: var(--brand-light);
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  padding: 3px;
  flex-shrink: 0;
}

.gd-mode-btn {
  padding: 6px 20px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
}
.gd-mode-btn:hover { background: rgba(224,90,0,0.15); color: var(--brand); }
.gd-mode-btn.active { background: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(224,90,0,0.4); }

.gd-topbar-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}

.gd-icon-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary);
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.gd-icon-btn svg { width: 16px; height: 16px; }
.gd-icon-btn:hover { background: var(--brand-light); border-color: var(--brand); color: var(--brand); }
.gd-icon-btn:disabled { opacity: 0.4; pointer-events: none; }
.gd-icon-btn--danger:hover { background: #FEE2E2; border-color: var(--danger); color: var(--danger); }

.gd-icon-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Object action button grid */
.gd-obj-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  margin-bottom: 4px;
}
.gd-obj-btn {
  font-size: 10px;
  font-weight: 600;
  padding: 4px 4px;
  border-radius: var(--radius);
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.12s, border-color 0.12s;
}
.gd-obj-btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.gd-obj-btn--danger { background: var(--danger); border-color: var(--danger); }
.gd-obj-btn--danger:hover { background: #a93226; border-color: #a93226; }

.gd-zoom-label {
  font-size: 12px;
  font-weight: 600;
  min-width: 42px;
  text-align: center;
  color: var(--text-muted);
}

.gd-sep {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 4px;
  flex-shrink: 0;
}

/* ── Designer switcher pill ──────────────────────────────── */
.gd-designer-switcher {
  display: flex;
  align-items: center;
  background: var(--bg-body);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  flex-shrink: 0;
  margin: 0 6px;
}

.gd-switcher-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.gd-switcher-btn:hover {
  background: var(--bg-hover, rgba(123,47,242,0.1));
  color: var(--brand);
}
.gd-switcher-btn--active {
  background: var(--brand);
  color: #fff;
}
.gd-switcher-btn--active svg { stroke: #fff; }

.gd-back-link {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0 8px;
  white-space: nowrap;
}
.gd-back-link:hover { color: var(--brand); }

/* ── Main layout ─────────────────────────────────────────── */
.gd-main {
  display: grid;
  grid-template-columns: var(--panel-w) 1fr var(--panel-w);
  flex: 1;
  overflow: hidden;
}

/* ── Left panel ──────────────────────────────────────────── */
.gd-left-panel {
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.gd-panel-section {
  padding: 14px 14px;
  border-bottom: 1px solid var(--border);
}

.gd-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* Collapsible panel sections */
.gd-collapsible-toggle {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
  user-select: none;
}
.gd-collapsible-toggle:hover { color: var(--brand); }
.gd-chevron {
  font-size: 14px;
  line-height: 1;
  transition: transform 0.2s ease;
  display: inline-block;
}
.gd-collapsible.open .gd-chevron { transform: rotate(180deg); }
.gd-collapsible-body {
  display: none;
  margin-top: 10px;
}
.gd-collapsible.open .gd-collapsible-body { display: block; }

/* Upload zone */
.gd-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-align: center;
}
.gd-upload-zone:hover,
.gd-upload-zone.drag-over { border-color: var(--brand); background: var(--brand-light); }
.gd-upload-icon { width: 28px; height: 28px; color: var(--brand); }
.gd-upload-hint { font-size: 11px; color: var(--text-muted); }

/* Buttons */
.gd-btn-primary {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}
.gd-btn-primary:hover { background: var(--brand-dark); }
.gd-btn-outline {
  background: transparent;
  color: var(--brand);
  border: 1.5px solid var(--brand);
  border-radius: var(--radius);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.gd-btn-outline:hover { background: var(--brand-light); }
.gd-btn--danger-outline { color: #c0392b; border-color: #c0392b; }
.gd-btn--danger-outline:hover { background: rgba(192,57,43,0.08); }
.gd-full-width { width: 100%; }
.gd-mt-4 { margin-top: 8px; }

/* Form controls */
.gd-input {
  width: 100%;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: var(--bg-input);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s;
}
.gd-input:focus { border-color: var(--border-focus); }
.gd-select {
  width: 100%;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-input);
  font-size: 12px;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
}
.gd-select:focus { border-color: var(--border-focus); }
.gd-input-sm { width: 70px; }

.gd-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.gd-field-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

/* Font picker */
.gd-font-picker { position: relative; flex: 1; }
.gd-font-list {
  max-height: 120px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-panel);
  margin-top: 4px;
  display: none;
}
.gd-font-list.open { display: block; }
.gd-font-item {
  padding: 5px 9px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.1s;
}
.gd-font-item:hover { background: var(--brand-light); color: var(--brand); }
.gd-font-item.active { background: var(--brand); color: #fff; }
.gd-font-category {
  padding: 4px 9px 2px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-page);
  letter-spacing: 0.06em;
}

/* Text style buttons */
.gd-text-style-btns { display: flex; gap: 3px; }
.gd-style-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg-input);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gd-style-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.gd-style-btn:hover { border-color: var(--brand); }

/* Text align */
.gd-text-align-btns { display: flex; gap: 3px; }
.gd-align-btn {
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg-input);
  cursor: pointer;
  font-size: 10px;
}
.gd-align-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Text controls collapsed by default until text selected */
.gd-text-controls { margin-top: 10px; }

/* Shape buttons */
.gd-shape-btns { display: flex; gap: 6px; }
.gd-shape-btn {
  flex: 1;
  padding: 8px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: var(--bg-input);
  cursor: pointer;
  font-size: 18px;
  transition: border-color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gd-shape-btn:hover { border-color: var(--brand); background: var(--brand-light); }

/* Colour picker */
.gd-colour-input {
  width: 36px;
  height: 28px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 5px;
  cursor: pointer;
  background: none;
}

/* Garment colour swatches */
.gd-colour-swatches {
  display: grid;
  grid-template-columns: repeat(7, 28px);
  gap: 6px;
  margin-bottom: 8px;
}
.gd-colour-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
  position: relative;
}
.gd-colour-swatch:hover { transform: scale(1.18); }
.gd-colour-swatch.active { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
.gd-colour-swatch[data-hex="#FFFFFF"],
.gd-colour-swatch[data-hex="#F8F8F8"] { border-color: #CBD5E1; }
.gd-colour-name { font-size: 11px; color: var(--text-muted); }

/* Toggle switch */
.gd-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.gd-toggle-row:last-child { margin-bottom: 0; }
.gd-switch { position: relative; display: inline-block; width: 36px; height: 20px; }
.gd-switch input { opacity: 0; width: 0; height: 0; }
.gd-slider {
  position: absolute; inset: 0;
  background: var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.2s;
}
.gd-slider::before {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.gd-switch input:checked + .gd-slider { background: var(--brand); }
.gd-switch input:checked + .gd-slider::before { transform: translateX(16px); }

/* ── Canvas area ─────────────────────────────────────────── */
.gd-canvas-area {
  position: relative;
  overflow: hidden;
  background: var(--bg-canvas);
  display: grid;
  grid-template-columns: 20px 1fr;
  grid-template-rows: 20px 1fr;
}

.gd-ruler-corner {
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.gd-ruler { display: block; }

.gd-canvas-scroll {
  position: relative;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  min-width: 0;
  min-height: 0;
}

/* ── Dimension tooltip ───────────────────────────────────── */
#gd-dim-tip {
  position: absolute;
  background: rgba(15,20,40,0.88);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-body, Inter, sans-serif);
  padding: 3px 8px;
  border-radius: 4px;
  pointer-events: none;
  display: none;
  white-space: nowrap;
  transform: translateX(-50%);
  z-index: 20;
}

.gd-canvas-wrapper {
  position: relative;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
  border-radius: 4px;
  background: #646C85;
  /* transform-origin set by JS for zoom */
}

/* Fabric canvas — no pointer events on the upper-canvas override */
.gd-canvas-wrapper canvas { display: block; }

/* Sheet background — base (garment designer: plain transparent) */
.gd-sheet-bg {
  position: absolute;
  background: transparent;
  border-radius: 4px;
  box-shadow: none;
  pointer-events: none;
  z-index: 0;
}


/* Range input */
.gd-range {
  -webkit-appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  outline: none;
  cursor: pointer;
}
.gd-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--brand);
  cursor: pointer;
}

/* DPI labels */
.gd-dpi-good { color: #065F46; font-weight: 700; font-size: 12px; }
.gd-dpi-warn { color: #92400E; font-weight: 700; font-size: 12px; }
.gd-dpi-bad  { color: var(--danger); font-weight: 700; font-size: 12px; }

/* File list */
.gd-file-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.gd-file-item {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 4px 6px;
  font-size: 11px;
}
.gd-file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
}
.gd-file-lock-btn,
.gd-file-remove {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  padding: 0 2px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.gd-file-remove:hover { color: var(--danger); }
.gd-file-lock-btn:hover { color: var(--brand); }

/* Order form wrap */
.gd-order-form-wrap { overflow-y: auto; flex: 1; }

/* Selected colour dot */
.gd-selected-colour-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* Submit status */
.gd-submit-status {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-top: 8px;
}
.gd-submit-status.error { background: #FEE2E2; color: var(--danger); }
.gd-submit-status.success { background: #D1FAE5; color: #065F46; }

/* ── Right panel — order form ────────────────────────────── */
.gd-right-panel {
  background: var(--bg-panel);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.gd-order-header {
  padding: 14px 16px 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.gd-order-summary {
  padding: 12px 18px;
  margin: 6px 10px;
  border-radius: 6px;
  background: var(--brand-light);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.gd-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.gd-summary-val {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.gd-swatch-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.gd-order-form {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.gd-form-group { display: flex; flex-direction: column; gap: 4px; }
.gd-form-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.gd-form-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  background: var(--bg-input);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}
.gd-form-input:focus { border-color: var(--border-focus); }
.gd-form-input.error { border-color: var(--danger); }
.gd-textarea { resize: vertical; min-height: 60px; }
.gd-form-hint { font-size: 11px; color: var(--text-muted); margin-top: -4px; }
.gd-form-divider { border: none; border-top: 1px solid var(--border); margin: 2px 0; }

/* View checkboxes */
.gd-view-checks { display: flex; gap: 10px; flex-wrap: wrap; }
.gd-check-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-primary);
}
.gd-check-label input[type="checkbox"] {
  accent-color: var(--brand);
  width: 15px;
  height: 15px;
}

/* Size buttons */
.gd-size-btns { display: flex; gap: 4px; flex-wrap: wrap; }
.gd-size-btn {
  padding: 5px 8px;
  border: 1.5px solid var(--border);
  border-radius: 5px;
  background: var(--bg-input);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.gd-size-btn:hover { border-color: var(--brand); }
.gd-size-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Order submit button */
.gd-btn-order {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #C84E00, #F07828);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
  margin-top: auto;
}
.gd-btn-order:hover { opacity: 0.9; }
.gd-btn-order:disabled { opacity: 0.5; pointer-events: none; }

/* ── Modal ───────────────────────────────────────────────── */
.gd-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.gd-modal {
  background: var(--bg-panel);
  border-radius: 14px;
  padding: 32px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 12px 48px rgba(0,0,0,0.24);
  position: relative;
  text-align: center;
}
.gd-modal--wide { max-width: 640px; text-align: left; }
.gd-modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted);
}
.gd-modal-close:hover { color: var(--text-primary); }
.gd-modal-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}
.gd-modal-summary {
  font-size: 13px;
  color: var(--text-muted);
  text-align: left;
  background: var(--bg-page);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
  line-height: 1.7;
}
.gd-modal-views {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.gd-modal-view-item { text-align: center; font-size: 11px; color: var(--text-muted); }
.gd-modal-view-item img {
  display: block;
  width: 80px;
  height: 80px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 4px;
  background: var(--bg-input);
}
.gd-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}
.gd-modal-msg {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.5;
}
.gd-modal-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  font-weight: 700;
}
.gd-modal-icon--success { background: #D1FAE5; color: #065F46; }
.gd-modal-icon--error   { background: #FEE2E2; color: var(--danger); }
.gd-modal-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.gd-ref-number {
  font-size: 22px;
  font-weight: 800;
  color: var(--brand);
  font-family: monospace;
  background: var(--brand-light);
  border-radius: var(--radius);
  padding: 10px 20px;
  margin: 12px auto;
  letter-spacing: 0.08em;
  display: inline-block;
}

/* Shortcuts modal */
.gd-shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 8px;
}
.gd-shortcut-group h4 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.gd-shortcut {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-primary);
}
kbd {
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  font-family: monospace;
  white-space: nowrap;
}

/* ── Toast ───────────────────────────────────────────────── */
.gd-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1C1C1C;
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s;
  opacity: 0;
  pointer-events: none;
  max-width: 380px;
  text-align: center;
  box-shadow: var(--shadow-md);
}
.gd-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.gd-toast.success { background: #065F46; }
.gd-toast.error   { background: var(--danger); }

/* ── Scrollbar styling ───────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #9CA3AF; }

/* ── Grid overlay (drawn on separate canvas by JS) ───────── */
.gd-grid-canvas {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  opacity: 0.35;
}

/* ══════════════════════════════════════════════════════════
   STICKER MODE ADDITIONS
   ══════════════════════════════════════════════════════════ */

/* Right-panel wrapper — takes the 3rd grid column,
   lets garment and sticker panels share the same slot.    */
.gd-right-wrap {
  display: contents; /* children participate in parent grid */
}
.gd-right-wrap > aside {
  grid-column: 3;
  grid-row: 1;       /* both asides overlap the same cell */
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  min-width: 0;
}

/* ── Mode toggle ─────────────────────────────────────────── */
.gd-mode-toggle {
  display: flex;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
  gap: 2px;
  flex-shrink: 0;
}

.gd-mode-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.gd-mode-btn:hover { background: rgba(224,90,0,0.08); color: var(--brand); }
.gd-mode-btn.active { background: var(--brand); color: #fff; }

/* ── Sticker size picker ─────────────────────────────────── */
.gd-sticker-picker {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.gd-size-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  justify-content: center;
  gap: 1px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  min-width: 68px;
}
.gd-size-card:hover { border-color: var(--brand); background: var(--brand-light); }
.gd-size-card.active { border-color: var(--brand); background: var(--brand-light); }

.gd-size-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}
.gd-size-dim {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1;
}
.gd-size-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
  line-height: 1.2;
  margin-top: 2px;
}
.gd-size-price small {
  font-size: 9px;
  font-weight: 400;
  color: var(--text-muted);
}
.gd-size-card.active .gd-size-label,
.gd-size-card.active .gd-size-price { color: var(--brand); }

/* ── Sticker live pricing box ────────────────────────────── */
.sk-pricing-box {
  background: var(--brand-light);
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sk-pricing-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}
.sk-pricing-total {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  padding-top: 4px;
  border-top: 1px solid var(--border);
  margin-top: 2px;
}
.sk-pricing-total span:last-child { color: var(--brand); }
.sk-pricing-note {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Sheet coverage indicator ────────────────────────────── */
.sk-coverage-wrap {
  margin: 0 16px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
}
.sk-coverage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
  font-size: 11px;
  color: var(--text-muted);
}
.sk-coverage-pct {
  font-size: 13px;
  font-weight: 700;
}
.sk-coverage-pct.sk-cov-good { color: #065F46; }
.sk-coverage-pct.sk-cov-warn { color: #92400E; }
.sk-coverage-pct.sk-cov-low  { color: var(--text-muted); }
.sk-coverage-track {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}
.sk-coverage-bar {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

/* ── Print Zone Calibrator ───────────────────────────────── */
.gd-cal-panel {
  position: fixed;
  bottom: 20px;
  left: 280px;
  z-index: 9998;
  width: 310px;
  background: var(--bg-panel);
  border: 2px solid var(--brand);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  font-size: 12px;
}
.gd-cal-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--brand);
  margin-bottom: 4px;
}
.gd-cal-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.gd-cal-group { margin-bottom: 12px; }
.gd-cal-group-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.gd-cal-grid4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 6px; }
.gd-cal-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.gd-cal-lbl { display: block; font-size: 10px; color: var(--text-muted); margin-bottom: 2px; }
.gd-cal-inp { width: 100% !important; }
.gd-cal-code {
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-family: 'Courier New', monospace;
  font-size: 10px;
  color: #79c0ff;
  white-space: pre;
  line-height: 1.6;
  cursor: pointer;
  user-select: all;
}
.gd-cal-actions { display: flex; gap: 8px; margin-top: 4px; }
.gd-cal-actions button { flex: 1; font-size: 12px; }

/* Hide native spinner arrows on number inputs */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }
