/* Loose Stones — Taş Giriş Kaydı / Stone Entry (gold jewellery chrome) */
.stone-form {
  --stone-gold: #c5a059;
  --stone-gold-deep: #b08d45;
  --stone-gold-soft: #f7f0e2;
  --stone-gold-fill: linear-gradient(180deg, #fbf6eb 0%, #f3e8d0 100%);
  --stone-gold-glow: 0 0 0 1px #c5a059, 0 0 10px #c5a05955;
  --stone-ink: #2c3544;
  --stone-muted: #7a8494;
  --stone-line: #e2e5e9;
  --stone-page: #f0f1f3;
  margin-bottom: 16px;
  padding: 22px 24px 18px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e6e8ec;
  box-shadow: 0 2px 10px #18253a08;
}
.stone-form-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.stone-form-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #1f2937;
  letter-spacing: -0.02em;
}
.stone-last-product {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: #535f70;
  line-height: 1.4;
}
.stone-last-product strong {
  color: #243246;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.stone-last-product .stone-last-product-date {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  color: #7a8494;
}

.stone-section-label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: #535f70;
  letter-spacing: 0.01em;
}
.stone-required-mark {
  font-style: normal;
  font-weight: 800;
  color: #c0392b;
  margin-left: 2px;
}

.stone-wizard-hint {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: #7a8494;
}
.stone-form[data-category="DIAMOND"] .stone-wizard-hint,
.stone-form[data-category="COLORED"] .stone-wizard-hint { display: none; }

/* Top: Category | Origin (equal columns) */
.stone-top-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 24px;
  margin-bottom: 18px;
}
.stone-category-section,
.stone-origin-section,
.stone-colored-section {
  min-width: 0;
}
.stone-form[data-category="DIAMOND"] .stone-colored-only { display: none !important; }
.stone-form[data-category="COLORED"] .stone-diamond-only { display: none !important; }

.stone-category-picker,
.stone-origin-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stone-category-option,
.stone-origin-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  min-height: 96px;
  padding: 16px 18px;
  border: 1.5px solid var(--stone-line);
  border-radius: 10px;
  background: #fff;
  color: var(--stone-ink);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.stone-category-option:hover,
.stone-origin-option:hover {
  border-color: #d4b87a;
  background: #fffcf7;
}
.stone-category-option.is-selected,
.stone-category-option[aria-selected="true"],
.stone-origin-option.is-selected,
.stone-origin-option[aria-selected="true"] {
  border-color: var(--stone-gold);
  background: var(--stone-gold-fill);
  box-shadow: var(--stone-gold-glow);
}
.stone-category-option:focus-visible,
.stone-origin-option:focus-visible {
  outline: 2px solid var(--stone-gold);
  outline-offset: 1px;
}
.stone-category-option.is-selected::after,
.stone-origin-option.is-selected::after {
  content: "✓";
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--stone-gold);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}
.stone-card-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--stone-gold-deep);
  margin-bottom: 2px;
}
.stone-card-icon svg {
  width: 26px;
  height: 26px;
  display: block;
}
.stone-category-label,
.stone-origin-label {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .03em;
  line-height: 1.2;
  color: #1a1a1a;
  text-transform: none;
}
.stone-category-sub,
.stone-origin-sub {
  font-size: 12px;
  font-weight: 600;
  color: var(--stone-muted);
}

/* Colored type picker (right column when COLORED) */
.stone-colored-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 2px;
  scrollbar-width: thin;
  min-width: 0;
}
.stone-colored-group { display: contents; }
.stone-colored-group-title {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #929aa5;
}
.stone-colored-group:first-child .stone-colored-group-title { margin-top: 0; }
.stone-colored-option {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1.5px solid var(--stone-line);
  border-radius: 8px;
  background: #fff;
  color: var(--stone-ink);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.stone-colored-option:hover {
  border-color: #d4b87a;
  background: #fffcf7;
}
.stone-colored-option.is-selected,
.stone-colored-option[aria-selected="true"] {
  border-color: var(--stone-gold);
  background: var(--stone-gold-fill);
  box-shadow: var(--stone-gold-glow);
}
.stone-colored-option:focus-visible {
  outline: 2px solid var(--stone-gold);
  outline-offset: 1px;
}
.stone-colored-swatch {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid #d5dbe3;
  box-shadow: inset 0 0 0 1px #ffffff66;
}
.stone-colored-label {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  color: #2c3544;
}

.stone-form-grid { display: block; }
.stone-wizard-details {
  display: grid;
  gap: 18px;
}

/* Code row */
.stone-code-row {
  display: grid;
  grid-template-columns: 160px minmax(180px, 1fr) minmax(220px, 1.2fr);
  gap: 14px 16px;
  align-items: end;
}
.stone-form .field {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  color: #535f70;
}
.stone-form .field input,
.stone-form .field select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #d5dbe3;
  border-radius: 8px;
  background: #fff;
  color: #243246;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
}
.stone-form .field input:focus,
.stone-form .field select:focus {
  border-color: var(--stone-gold);
  outline: none;
  box-shadow: 0 0 0 3px #c5a05922;
}
.stone-form .field input[readonly],
.stone-form .field select:disabled {
  background: #f4f6f8;
  color: #667180;
}
.stone-code-input-wrap {
  position: relative;
}
.stone-code-input-wrap input {
  padding-right: 36px;
}
.stone-code-valid {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #2f9e64;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}
.stone-code-hint-box {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #eef2f6;
  border: 1px solid #dde3ea;
  color: #5a6678;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}
.stone-code-hint-box p { margin: 0; }
.stone-code-hint-icon {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #6b7c90;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  font-style: italic;
}

.stone-form.is-editing .stone-code-hint-box,
.stone-form.is-editing #stoneCodePrefixField { display: none; }
.stone-form.is-editing .stone-code-row {
  grid-template-columns: minmax(180px, 320px);
}

/* Shape + quality */
.stone-shape-quality-row {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.9fr);
  gap: 18px 22px;
  align-items: start;
}
.stone-shape-section { min-width: 0; }
.stone-shape-picker {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  max-height: none;
  overflow: visible;
  padding: 2px;
  min-width: 0;
}
.stone-shape-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 92px;
  padding: 12px 8px 10px;
  border: 1.5px solid var(--stone-line);
  border-radius: 10px;
  background: #fff;
  color: #354257;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.stone-shape-option:hover {
  border-color: #d4b87a;
  background: #fffcf7;
}
.stone-shape-option.is-selected,
.stone-shape-option[aria-selected="true"] {
  border-color: var(--stone-gold);
  background: var(--stone-gold-fill);
  box-shadow: var(--stone-gold-glow);
}
.stone-shape-option.is-selected::after {
  content: "✓";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--stone-gold);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}
.stone-shape-option:focus-visible {
  outline: 2px solid var(--stone-gold);
  outline-offset: 1px;
}
.stone-shape-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
}
.stone-shape-icon img,
.stone-shape-icon svg {
  width: 44px;
  height: 44px;
  display: block;
  object-fit: contain;
}
.stone-shape-label {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  color: #2c3544;
}

.stone-quality-column {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.stone-chip-section {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.stone-chip-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.stone-chip {
  min-height: 36px;
  padding: 0 12px;
  border: 1.5px solid var(--stone-line);
  border-radius: 8px;
  background: #fff;
  color: #2c3544;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.stone-square-chips .stone-chip {
  min-width: 40px;
  padding: 0 8px;
  border-radius: 8px;
  justify-content: center;
}
.stone-chip:hover {
  border-color: #d4b87a;
  background: #fffcf7;
}
.stone-chip.is-selected,
.stone-chip[aria-selected="true"] {
  border-color: var(--stone-gold);
  background: var(--stone-gold-fill);
  box-shadow: 0 0 0 1px #c5a05966;
  color: #5a4318;
}
.stone-chip:focus-visible {
  outline: 2px solid var(--stone-gold);
  outline-offset: 1px;
}

/* Specs row */
.stone-specs-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px 16px;
  align-items: start;
}
.stone-stepper {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: stretch;
  border: 1px solid #d5dbe3;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.stone-stepper input {
  border: 0 !important;
  border-radius: 0 !important;
  height: 44px !important;
  text-align: center;
  box-shadow: none !important;
  -moz-appearance: textfield;
}
.stone-stepper input::-webkit-outer-spin-button,
.stone-stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.stone-stepper-btn {
  border: 0;
  background: #f7f8fa;
  color: #4a5565;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.stone-stepper-btn:hover { background: #eef0f3; color: #1f2937; }
.stone-stepper-btn:focus-visible {
  outline: 2px solid var(--stone-gold);
  outline-offset: -2px;
}

.stone-basis-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.stone-basis-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border: 1.5px solid var(--stone-line);
  border-radius: 999px;
  background: #fff;
  color: #2c3544;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .02em;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
}
.stone-basis-option::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid #c5cad3;
  background: #fff;
  box-sizing: border-box;
}
.stone-basis-option:hover {
  border-color: #d4b87a;
  background: #fffcf7;
}
.stone-basis-option.is-selected,
.stone-basis-option[aria-selected="true"] {
  border-color: var(--stone-gold);
  background: var(--stone-gold-fill);
  box-shadow: var(--stone-gold-glow);
  color: #5a4318;
}
.stone-basis-option.is-selected::before,
.stone-basis-option[aria-selected="true"]::before {
  border-color: var(--stone-gold-deep);
  background: radial-gradient(circle at center, var(--stone-gold) 0 45%, #fff 48% 100%);
}
.stone-basis-option:focus-visible {
  outline: 2px solid var(--stone-gold);
  outline-offset: 1px;
}
.stone-basis-label {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .03em;
  line-height: 1.2;
  color: inherit;
}
.stone-basis-sub { display: none; }

.stone-form .field.stone-qty-active .stone-stepper {
  border-color: var(--stone-gold);
  box-shadow: 0 0 0 2px #c5a05922;
}
.stone-form .field.stone-qty-idle .stone-stepper {
  background: #f3f4f6;
  border-color: #e2e4e8;
}
.stone-form .field.stone-qty-idle .stone-stepper input {
  background: #f3f4f6;
  color: #8a929e;
}
.stone-form .field.stone-qty-idle span { color: #9aa3af; }
.stone-form .field.stone-qty-idle .stone-stepper-btn {
  background: #eceef1;
  color: #9aa3af;
}

.stone-form.has-certificate .stone-cert-extra {
  outline: 1px solid #cfd5dd;
  border-radius: 8px;
}
.stone-form.has-certificate .stone-cert-extra.field {
  padding: 8px;
  background: #fbfcfd;
}

/* Certificate + pricing */
.stone-cert-row,
.stone-pricing-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
.stone-money-wrap {
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: stretch;
  border: 1px solid #d5dbe3;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.stone-money-wrap:focus-within {
  border-color: var(--stone-gold);
  box-shadow: 0 0 0 3px #c5a05922;
}
.stone-money-prefix {
  display: grid;
  place-items: center;
  background: #f7f8fa;
  color: #6b7280;
  font-size: 14px;
  font-weight: 700;
  border-right: 1px solid #e5e7eb;
}
.stone-money-wrap input {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  height: 44px !important;
}

/* Summary strip */
.stone-summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
}
.stone-summary-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.stone-summary-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #8a7040;
  position: relative;
}
.stone-summary-icon::before {
  content: "";
  display: block;
  box-sizing: border-box;
}
.stone-summary-icon-cost::before {
  width: 14px;
  height: 14px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  box-shadow: 2px 2px 0 #c5a05955, 4px 4px 0 #c5a05933;
}
.stone-summary-icon-sale::before {
  width: 15px;
  height: 12px;
  border: 1.5px solid currentColor;
  border-radius: 0 0 3px 3px;
  border-top: 0;
  background:
    linear-gradient(currentColor, currentColor) top left / 100% 1.5px no-repeat;
  clip-path: polygon(0 20%, 18% 0, 82% 0, 100% 20%, 100% 100%, 0 100%);
}
.stone-summary-icon-profit::before {
  width: 14px;
  height: 12px;
  border-left: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  background:
    linear-gradient(135deg, transparent 45%, currentColor 45% 55%, transparent 55%) center / 100% 100% no-repeat,
    linear-gradient(currentColor, currentColor) 70% 20% / 5px 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) 78% 12% / 1.5px 5px no-repeat;
}
.stone-clear-x {
  width: 12px;
  height: 12px;
  position: relative;
  display: inline-block;
}
.stone-clear-x::before,
.stone-clear-x::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 0;
  width: 1.5px;
  height: 12px;
  background: currentColor;
  border-radius: 1px;
}
.stone-clear-x::before { transform: rotate(45deg); }
.stone-clear-x::after { transform: rotate(-45deg); }
.stone-save-disk {
  width: 14px;
  height: 14px;
  display: inline-block;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  position: relative;
  background:
    linear-gradient(currentColor, currentColor) 3px 2px / 8px 5px no-repeat,
    linear-gradient(#fff, #fff) 4px 8px / 6px 4px no-repeat;
  vertical-align: -2px;
}
.stone-save-disk::after {
  content: "";
  position: absolute;
  right: 2px;
  top: 2px;
  width: 3px;
  height: 3px;
  background: currentColor;
  border-radius: 1px;
}
.stone-summary-item small,
.stone-summary-item strong,
.stone-summary-item em {
  display: block;
}
.stone-summary-item small {
  font-size: 11px;
  font-weight: 700;
  color: #7a8494;
}
.stone-summary-item strong {
  margin-top: 2px;
  font-size: 18px;
  font-weight: 800;
  color: #1f2937;
  font-variant-numeric: tabular-nums;
}
.stone-summary-item em {
  margin-top: 2px;
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  color: #9aa3af;
}
.stone-summary-profit strong { color: #2f9e64; }

/* Footer actions */
.stone-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
  border-top: 1px solid #f0f1f3;
  margin-top: 2px;
  padding-top: 14px;
}
.stone-form-footer-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.stone-clear-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid #e2e5e9;
  border-radius: 8px;
  background: #fff;
  color: #657081;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.stone-clear-btn:hover {
  border-color: var(--stone-gold);
  color: #26364e;
}
.stone-save-btn,
.stone-form .stone-save-btn.primary-button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 8px;
  background: linear-gradient(180deg, #d4b36a 0%, #c5a059 55%, #b08d45 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 2px 6px #c5a05944;
}
.stone-save-btn:hover,
.stone-form .stone-save-btn.primary-button:hover {
  background: linear-gradient(180deg, #dcb978 0%, #c5a059 55%, #a8843d 100%);
}
.stone-form .secondary-button {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

.stone-carat-chips { margin-top: 2px; }
.stone-carat-chips .stone-chip {
  min-height: 30px;
  padding: 0 10px;
  font-size: 11px;
}

.stone-stock { width: 100%; min-width: 960px; }
.stone-stock th { background: #f7f1e4; }
.stone-stock td { padding: 10px 8px; font-size: 13px; }
.stone-stock .save-row { min-height: 32px; padding: 0 12px; }

@media (max-width: 1100px) {
  .stone-shape-picker { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .stone-shape-quality-row {
    grid-template-columns: 1fr;
  }
  .stone-specs-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .stone-top-row { grid-template-columns: 1fr; }
  .stone-code-row {
    grid-template-columns: 1fr 1fr;
  }
  .stone-code-hint-box { grid-column: 1 / -1; }
  .stone-shape-picker { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .stone-form { padding: 16px 14px 14px; }
  .stone-form-head h2 { font-size: 18px; }
  .stone-form-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .stone-form-footer-right {
    flex-direction: column;
    align-items: stretch;
  }
  .stone-code-row,
  .stone-cert-row,
  .stone-pricing-row,
  .stone-specs-row,
  .stone-summary-strip {
    grid-template-columns: 1fr;
  }
  .stone-category-picker,
  .stone-origin-picker,
  .stone-basis-picker,
  .stone-colored-picker,
  .stone-shape-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stone-colored-picker { max-height: 260px; }
}
