/* ═══════════════════════════════════════════════════
   Product Catalog — Table + Detail Panel
   (matches admin table conventions)
   ═══════════════════════════════════════════════════ */

.catalog-page {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 16px 24px 0;
}

/* ── Toolbar (search + count) ── */
.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.catalog-toolbar-left {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.catalog-result-count {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ── Search ── */
.catalog-search-bar {
  position: relative;
  width: 260px;
}

.catalog-search-bar input {
  width: 100%;
  padding: 7px 12px 7px 30px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  font-size: 13px;
  outline: none;
  background: var(--bg-inset);
  color: var(--text-primary);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.catalog-search-bar input::placeholder {
  color: var(--text-muted);
}

.catalog-search-bar input:focus {
  border-color: var(--input-focus-border);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.catalog-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.catalog-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}

.catalog-search-clear:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

/* ── Toolbar right group ── */
.catalog-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Filter button ── */
.catalog-filter-wrap {
  position: relative;
}

.catalog-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background: var(--bg-inset);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition:
    border-color 0.15s,
    color 0.15s,
    background 0.15s;
  white-space: nowrap;
}

.catalog-filter-btn:hover {
  border-color: var(--input-focus-border);
  color: var(--text-primary);
}

.catalog-filter-btn.has-filters {
  border-color: var(--accent-color, #0066cc);
  color: var(--accent-color, #0066cc);
}

.catalog-filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent-color, #0066cc);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

/* ── Filter popover ── */
.catalog-filter-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  min-width: 200px;
  padding: 8px 4px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--bg-surface);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  animation: filter-pop-in 0.12s ease;
}

@keyframes filter-pop-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.catalog-filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 5px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.12s;
  user-select: none;
}

.catalog-filter-option:hover {
  background: var(--card-hover-bg);
}

.catalog-filter-option input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent-color, #0066cc);
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Content area: table + panel side-by-side ── */
.catalog-content {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--card-border);
  border-radius: 10px;
}

/* ── Table wrapper — scrolls independently ── */
.catalog-table-wrapper {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: auto;
}

/* ── Loading overlay ── */
.catalog-loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface-overlay, rgba(255, 255, 255, 0.6));
  z-index: 10;
}

.catalog-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--accent-color, #0066cc);
  border-radius: 50%;
  animation: catalog-spin 0.7s linear infinite;
}

@keyframes catalog-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Empty state ── */
.catalog-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
}

/* ── Table (matches admin-table) ── */
.catalog-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.catalog-table thead {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg-inset);
}

.catalog-table th {
  padding: 10px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--card-border);
  white-space: nowrap;
  user-select: none;
}

.catalog-table td {
  padding: 12px 16px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.catalog-table tbody tr:last-child td {
  border-bottom: none;
}

.catalog-row {
  transition: background 0.15s;
  cursor: pointer;
}

.catalog-row:hover {
  background: var(--card-hover-bg);
}

.catalog-row.selected-row {
  background: var(--accent-subtle, rgba(0, 102, 204, 0.06));
  box-shadow: inset 3px 0 0 var(--accent-color, #0066cc);
}

.catalog-row.selected-row:hover {
  background: var(--accent-subtle-hover, rgba(0, 102, 204, 0.1));
  box-shadow: inset 3px 0 0 var(--accent-color, #0066cc);
}

.catalog-row.inactive-row {
  opacity: 0.55;
}

/* ── Column widths ── */
.col-name {
  min-width: 200px;
}

.col-part,
.col-manufacturer,
.col-vendor {
  min-width: 120px;
}

.col-price,
.col-cost {
  min-width: 90px;
  text-align: right;
}

th.col-price,
th.col-cost {
  text-align: right;
}

.col-onhand {
  min-width: 70px;
  text-align: center;
}

th.col-onhand {
  text-align: center;
}

.col-status {
  min-width: 80px;
  text-align: center;
}

th.col-status {
  text-align: center;
}

.col-updated {
  min-width: 110px;
  white-space: nowrap;
}

/* ── Cell helpers ── */
.item-name-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.item-name {
  font-weight: 600;
  color: var(--text-primary);
}

.item-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.3;
}

.vendor-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.vendor-sku {
  font-size: 11px;
  color: var(--text-muted);
}

.mono {
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Menlo, monospace;
  font-size: 12px;
}

/* ── On-hand badge ── */
.onhand-badge {
  display: inline-block;
  min-width: 28px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.onhand-zero {
  background: var(--status-inactive-bg, #fee2e2);
  color: var(--status-inactive-color, #dc2626);
}

.onhand-low {
  background: var(--status-pending-bg, #fef3c7);
  color: var(--status-pending-color, #d97706);
}

.onhand-ok {
  background: var(--status-active-bg, #dcfce7);
  color: var(--status-active-color, #16a34a);
}

/* ── Status badge ── */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-active {
  background: var(--status-active-bg, #dcfce7);
  color: var(--status-active-color, #16a34a);
}

.status-inactive {
  background: var(--status-inactive-bg, #fee2e2);
  color: var(--status-inactive-color, #dc2626);
}

/* ── Pagination footer ── */
.catalog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  flex-shrink: 0;
}

.catalog-page-info {
  font-size: 13px;
  color: var(--text-secondary);
}

.catalog-pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.catalog-page-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
}

.catalog-page-btn:hover:not(:disabled) {
  background: var(--hover-bg);
  border-color: var(--input-focus-border);
}

.catalog-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.catalog-page-btn.active {
  background: var(--accent-color, #0066cc);
  color: #fff;
  border-color: var(--accent-color, #0066cc);
}

.catalog-page-ellipsis {
  padding: 0 4px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ═══════════════════════════════════════════════════
   Detail Panel — slides in from right, scrolls independently
   ═══════════════════════════════════════════════════ */

.detail-panel {
  width: 380px;
  min-width: 380px;
  display: flex;
  flex-direction: column;
  background: var(--bg-inset);
  border-left: 1px solid var(--card-border);
  overflow: hidden;
}

/* ── Panel header ── */
.detail-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  flex-shrink: 0;
}

.detail-panel-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.detail-panel-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  word-break: break-word;
}

.detail-panel-identifier {
  font-size: 12px;
  color: var(--text-secondary);
}

.detail-panel-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}

.detail-panel-close:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

/* ── Panel body — scrolls independently ── */
.detail-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

/* ── Sections ── */
.detail-section {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.detail-section:last-child {
  border-bottom: none;
}

.detail-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--bg-surface);
  color: var(--text-secondary);
}

.detail-section-heading {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.detail-section-heading svg {
  color: var(--text-muted);
}

/* ── Field grid ── */
.detail-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
}

.detail-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.detail-field-full {
  grid-column: 1 / -1;
}

.detail-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.detail-value {
  font-size: 13px;
  color: var(--text-primary);
  word-break: break-word;
}

.detail-notes {
  margin: 0;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.5;
  white-space: pre-wrap;
}

/* ═══════════════════════════════════════════════════
   Linked Items — section within detail panel
   ═══════════════════════════════════════════════════ */

.detail-section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.detail-section-heading-row .detail-section-heading {
  margin-bottom: 0;
}

.linked-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.linked-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    border-color 0.15s,
    color 0.15s,
    background 0.15s;
}

.linked-add-btn:hover {
  border-color: var(--accent-color, #0066cc);
  color: var(--accent-color, #0066cc);
  background: var(--accent-subtle, rgba(0, 102, 204, 0.06));
}

.linked-error {
  margin: 0;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--status-inactive-color, #dc2626);
  background: var(--status-inactive-bg, #fee2e2);
}

.linked-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 0;
}

.linked-empty {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 8px 0;
}

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

.linked-item-wrap {
  border-radius: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  transition: border-color 0.15s;
}

.linked-item-wrap:hover {
  border-color: var(--card-border);
}

.linked-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
}

.linked-item:hover {
  background: var(--card-hover-bg);
}

.linked-item.linked-item-expanded {
  background: var(--card-hover-bg);
}

.linked-item-inactive {
  opacity: 0.55;
}

.linked-item-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.linked-item-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.linked-item-id {
  font-size: 11px;
  color: var(--text-muted);
}

.linked-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.linked-item-price {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.linked-chevron {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.15s ease;
}

.linked-chevron-open {
  transform: rotate(180deg);
}

/* ── Expanded linked detail ── */
.linked-detail {
  padding: 8px 10px 10px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-inset);
}

.linked-detail-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}

.linked-detail-field {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.linked-detail-full {
  grid-column: 1 / -1;
}

.linked-unlink-btn-full {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  margin-top: 10px;
  padding: 5px 0;
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s;
}

.linked-unlink-btn-full:hover {
  background: var(--status-inactive-bg, #fee2e2);
  color: var(--status-inactive-color, #dc2626);
  border-color: var(--status-inactive-color, #dc2626);
}

.linked-unlink-btn-full:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════
   Link Modal — overlay for searching & linking items
   ═══════════════════════════════════════════════════ */

.link-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
  background: rgba(0, 0, 0, 0.35);
  animation: link-overlay-in 0.12s ease;
}

@keyframes link-overlay-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.link-modal {
  width: 760px;
  max-width: 92vw;
  height: 560px;
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--card-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  animation: link-modal-in 0.15s ease;
}

@keyframes link-modal-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.link-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.link-modal-header-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.link-modal-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.link-modal-context {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-modal-context strong {
  font-weight: 600;
  color: var(--text-secondary);
}

.link-modal-search {
  position: relative;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.link-modal-search-icon {
  position: absolute;
  left: 26px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.link-modal-search input {
  width: 100%;
  padding: 7px 12px 7px 30px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  font-size: 13px;
  outline: none;
  background: var(--bg-inset);
  color: var(--text-primary);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.link-modal-search input::placeholder {
  color: var(--text-muted);
}

.link-modal-search input:focus {
  border-color: var(--input-focus-border);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.link-modal-body {
  display: flex;
  min-height: 260px;
  flex: 1;
  overflow: hidden;
}

.link-modal-pane {
  flex: 1 1 55%;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.link-modal-body.has-preview .link-modal-pane {
  border-right: 1px solid var(--border-subtle);
}

.link-modal-results {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
  min-height: 100px;
}

.link-modal-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
}

.link-modal-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.link-modal-divider {
  height: 1px;
  margin: 2px 10px;
  background: var(--border-subtle);
}

.link-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
}

.link-result-row:hover {
  background: var(--card-hover-bg);
}

.link-result-selected {
  background: var(--card-hover-bg);
}

.link-result-pending {
  outline: 1px dashed var(--accent-subtle, rgba(0, 102, 204, 0.35));
}

.link-result-inactive {
  opacity: 0.55;
}

.link-result-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.link-result-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-result-id {
  font-size: 11px;
  color: var(--text-muted);
}

.link-result-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--accent-color, #0066cc);
}

.link-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: var(--bg-inset);
  color: var(--accent-color, #0066cc);
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
}

.link-action-btn:hover {
  border-color: var(--accent-subtle, rgba(0, 102, 204, 0.35));
}

.link-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.link-action-remove {
  color: var(--status-inactive-color, #dc2626);
}

.link-action-active {
  background: var(--accent-subtle, rgba(0, 102, 204, 0.15));
  border-color: var(--accent-color, #0066cc);
  color: var(--accent-color, #0066cc);
}

.link-modal-preview {
  flex: 1 1 45%;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-inset);
  min-width: 0;
}

.link-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.link-preview-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.link-preview-id {
  font-size: 11px;
  color: var(--text-muted);
}

.link-preview-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.link-preview-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.link-preview-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}

.link-preview-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.link-preview-full {
  grid-column: 1 / -1;
}

.link-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.link-modal-warning {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #d97706;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 4px;
}

.link-modal-warning svg {
  flex-shrink: 0;
}

.link-modal-summary {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.link-modal-summary-divider {
  color: var(--text-muted);
}

.link-modal-commit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--accent-color, #0066cc);
  background: var(--accent-color, #0066cc);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.link-modal-commit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
