/* DaySmart-accurate Desktop Product Dialog Styling */

.product-desktop-dialog {
  width: 820px;
  max-width: 96vw;
  padding: 0;
  border: 1px solid #7a7e85;
  border-radius: 6px;
  background-color: #eceff2;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  color: #1e2024;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 13px;
  overflow: hidden;
}

.product-desktop-dialog::backdrop {
  background: rgba(18, 12, 36, 0.55);
  backdrop-filter: blur(2px);
}

.product-dialog-window {
  display: flex;
  flex-direction: column;
  background-color: #e6e9ed;
}

/* Titlebar */
.product-dialog-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px 4px 14px;
  background: linear-gradient(180deg, #f7f8fa 0%, #e1e4e8 100%);
  border-bottom: 1px solid #c2c6cd;
  user-select: none;
}

.product-dialog-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: #24272c;
  letter-spacing: -0.1px;
}

.product-dialog-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 20px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: #494d55;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.1s, color 0.1s;
}

.product-dialog-close-btn:hover {
  background-color: #e81123;
  color: #ffffff;
  border-color: #e81123;
}

/* Tab Navigation Strip */
.product-dialog-tabs {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding: 6px 12px 0 12px;
  background: #eceff2;
  border-bottom: 1px solid var(--theme-border, #c8cbd2);
  overflow-x: auto;
  user-select: none;
}

.product-tab-btn {
  padding: 5px 12px 6px 12px;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  background: transparent;
  color: #4e535e;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  top: 1px;
}

.product-tab-btn:hover:not(.is-active) {
  color: #111;
  background: #e2e5ea;
}

.product-tab-btn.is-active {
  background: var(--theme-panel, #ffffff);
  color: #1a1d20;
  font-weight: 600;
  border-color: var(--theme-border, #c8cbd2);
  border-bottom: 1px solid #ffffff;
  z-index: 2;
}

/* Inner White Content Card */
.product-editor-dialog form,
#product-editor-dialog .product-dialog-form {
  display: flex !important;
  flex-direction: column !important;
  grid-template-columns: none !important;
  gap: 0 !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

.product-tab-pane {
  background: var(--theme-panel, #ffffff);
  padding: 16px 20px 20px 20px;
  min-height: 380px;
  width: 100%;
  box-sizing: border-box;
  border-bottom: 1px solid var(--theme-border, #c8cbd2);
  box-shadow: inset 0 1px 0 #ffffff;
}

.product-tab-pane[hidden] {
  display: none !important;
}

/* 2x2 Quadrant Grid */
.product-quadrant-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 26px;
  row-gap: 16px;
}

.product-quadrant-section {
  margin: 0;
  padding: 0;
  border: none;
  min-width: 0;
}

.product-section-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0 0 10px 0;
  padding: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: #2b303a;
  letter-spacing: -0.1px;
}

.product-section-legend span {
  flex-shrink: 0;
}

.product-section-legend hr {
  flex: 1;
  height: 1px;
  border: none;
  background-color: #d7dbe0;
  margin: 0;
}

/* Section Body with Left Icon + Right Fields */
.product-section-body {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.product-section-icon {
  flex-shrink: 0;
  width: 44px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 2px;
}

.product-section-fields {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

/* Form Row Layout */
.product-form-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-form-row label {
  flex-shrink: 0;
  width: 82px;
  text-align: right;
  font-size: 12px;
  color: #2b2e35;
  user-select: none;
}

.product-input-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.product-input {
  width: 100%;
  height: 24px;
  padding: 2px 7px;
  border: 1px solid #9aa0a6;
  border-radius: 2px;
  background-color: var(--theme-panel, #ffffff);
  color: #111827;
  font-family: inherit;
  font-size: 12px;
  box-sizing: border-box;
}

.product-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6;
}

.product-id-input {
  background-color: #ffffdd;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 600;
  color: #0b3866;
}

.product-id-input:focus {
  background-color: var(--theme-panel, #ffffff);
}

.product-helper-text {
  font-size: 10.5px;
  color: #555b66;
  margin-top: 2px;
  line-height: 1.2;
}

/* Dropdown + Inline Buttons */
.product-input-btn-group {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.product-select {
  flex: 1;
  height: 24px;
  padding: 1px 6px;
  border: 1px solid #9aa0a6;
  border-radius: 2px;
  background-color: var(--theme-panel, #ffffff);
  color: #111827;
  font-family: inherit;
  font-size: 12px;
  box-sizing: border-box;
  min-width: 0;
}

.product-btn-inline {
  flex-shrink: 0;
  height: 23px;
  padding: 0 10px;
  border: 1px solid #9ca3af;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--theme-panel, #ffffff) 0%, #e8ecf0 100%);
  color: #2b303a;
  font-family: inherit;
  font-size: 11.5px;
  cursor: pointer;
  white-space: nowrap;
}

.product-btn-inline:hover {
  background: linear-gradient(180deg, #f4f8fc 0%, #dbe4ee 100%);
  border-color: #6b7280;
}

.product-btn-inline:active {
  background: #d4dce6;
}

.product-supplier-group {
  align-items: flex-start;
}

.product-btn-stack {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
}

.product-btn-stack .product-btn-inline {
  height: 22px;
  padding: 0 8px;
  font-size: 11px;
}

/* Number & Currency Spinner Inputs */
.product-num-wrap {
  max-width: 76px;
}

.product-currency-input-wrap {
  display: flex;
  align-items: center;
  position: relative;
  max-width: 104px;
}

.product-currency-symbol {
  position: absolute;
  left: 6px;
  color: var(--theme-quiet, #4b5563);
  font-size: 12px;
  pointer-events: none;
}

.product-currency-input {
  padding-left: 16px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

/* Checkbox Stack in Miscellaneous */
.product-checkbox-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
  padding-left: 8px;
}

.product-checkbox-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: #262930;
  cursor: pointer;
  user-select: none;
}

.product-checkbox-row input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #2563eb;
  cursor: pointer;
}

/* Supplier Actions */
.product-supplier-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 6px;
}

/* Loyalty Points Tab */
.product-loyalty-section {
  margin: 0;
  padding: 0;
  border: none;
}

.product-loyalty-body {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding-top: 6px;
}

.product-loyalty-icon {
  flex-shrink: 0;
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-loyalty-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-loyalty-desc {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: #2b303a;
}

.product-loyalty-input-row {
  justify-content: flex-start;
  margin-top: 14px;
}

.product-loyalty-input-row label {
  width: auto;
  min-width: 90px;
  text-align: left;
  font-weight: 600;
}

.product-loyalty-note {
  margin: 70px 0 0 0;
  padding: 10px 12px;
  border-top: 1px solid var(--theme-border, #e2e5ea);
  font-size: 11.5px;
  line-height: 1.4;
  color: #555e6d;
}

/* General Placeholder Tab Panes (Ordering, Balances, Aliases, Custom, Commission) */
.product-generic-pane-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 600px;
  padding-top: 8px;
}

.product-generic-pane-desc {
  margin: 0 0 8px 0;
  font-size: 12px;
  color: var(--theme-quiet, #4b5563);
}

/* Footer Action Bar */
.product-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 16px;
  background-color: #eceff2;
}

.product-dialog-btn {
  min-width: 74px;
  height: 25px;
  padding: 0 14px;
  border: 1px solid #8e95a0;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--theme-panel, #ffffff) 0%, #e2e6eb 100%);
  color: #1f2328;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}

.product-dialog-btn:hover {
  background: linear-gradient(180deg, var(--theme-panel, #ffffff) 0%, #d8dfe6 100%);
  border-color: #636b77;
}

.product-dialog-btn:active {
  background: #cbd3dc;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
}

.product-dialog-btn-save {
  font-weight: 600;
  border-color: #6d7582;
}

/* SVG Icon details */
.svg-icon-shadow {
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.22));
}

/* Product Detail Panel Desktop Edit Trigger */
body[data-view="products"] .product-detail-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.product-edit-desktop-btn {
  flex-shrink: 0;
  padding: 5px 14px;
  border: 1px solid #c2c6cd;
  border-radius: 6px;
  background: var(--theme-panel, #ffffff);
  color: var(--theme-text, #21133d);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 0.15s ease;
}

.product-edit-desktop-btn:hover {
  background: #f0f4f8;
  border-color: #2563eb;
  color: #1d4ed8;
}

.product-edit-desktop-btn:active {
  background: var(--theme-panel, #e2e8f0);
}

