/* ══════════════════════════════════════
   FriendsParts — Shared Styles
   style.css
   ══════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── CSS VARIABLES ── */
:root {
  --nav-bg: #1a1a1a;
  --nav-hover: #2a2a2a;
  --nav-active: #e8581a;
  --sidebar-bg: #f7f5f2;
  --sidebar-border: #e8e0d5;
  --toolbar-bg: #faf8f5;
  --toolbar-border: #e8e0d5;
  --header-bg: #1a1a1a;
  --header-text: #ffffff;
  --accent: #e8581a;
  --accent-hover: #c94710;
  --accent-light: #fde8db;
  --accent-mid: #f8d0bc;
  --text-primary: #1a1a1a;
  --text-secondary: #4a4035;
  --text-muted: #9a8f83;
  --row-hover: #fdf5ef;
  --row-selected: #fde8db;
  --border: #ede5db;
  --status-green: #1a7a3a;
  --status-green-bg: #d5f5df;
  --status-orange: #9a4a00;
  --status-orange-bg: #fde8c8;
  --white: #ffffff;
  --font: 'Manrope', -apple-system, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

/* ── RESET ── */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--white);
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d5c9bc; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #c4b5a5; }

/* ── TOP HEADER ── */
.app-header {
  background: var(--header-bg);
  color: var(--header-text);
  display: flex;
  align-items: center;
  height: 52px;
  padding: 0 16px;
  flex-shrink: 0;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  z-index: 100;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 20px;
}

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

.app-title {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-left: 1px solid rgba(255,255,255,0.2);
  padding-left: 14px;
}

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-btn {
  padding: 6px 14px;
  border-radius: 4px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.9);
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: all 0.15s;
  text-decoration: none;
}
.header-btn:hover { background: rgba(255,255,255,0.16); border-color: rgba(255,255,255,0.25); }
.header-btn.accent { background: var(--accent); border-color: var(--accent); }
.header-btn.accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.header-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.user-badge {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #fff;
  cursor: pointer;
  flex-shrink: 0;
}

/* ── STATUS BADGES ── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.status-badge.active { background: var(--status-green-bg); color: var(--status-green); }
.status-badge.order  { background: var(--status-orange-bg); color: var(--status-orange); }
.status-badge.inactive { background: #f0ebe5; color: var(--text-muted); }

.status-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}

/* ── BRAND BADGE ── */
.brand-badge {
  display: inline-block;
  padding: 2px 7px;
  background: #f0ebe5;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
}

/* ── STATUS BAR ── */
.status-bar {
  padding: 5px 16px;
  background: var(--toolbar-bg);
  border-top: 1px solid var(--toolbar-border);
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}
.status-bar-accent { color: var(--accent); font-weight: 700; }

/* ── RIBBON BUTTON ── */
.ribbon-btn {
  padding: 5px 12px;
  border-radius: 5px;
  background: transparent;
  border: 1px solid var(--sidebar-border);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.12s;
  white-space: nowrap;
}
.ribbon-btn:hover { background: var(--row-hover); border-color: var(--accent); color: var(--accent); }
.ribbon-btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.ribbon-btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* ── NOTIFICATION ── */
.notification {
  position: fixed;
  bottom: 24px; right: 24px;
  background: #1a1a1a;
  color: #fff;
  padding: 12px 20px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  z-index: 1000;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.25s;
  pointer-events: none;
}
.notification.show { opacity: 1; transform: translateY(0); }
.notification .notif-icon { color: var(--accent); font-size: 18px; }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.show { opacity: 1; pointer-events: all; }

.modal {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.22);
  width: 420px;
  max-width: 90vw;
  padding: 28px;
  transform: translateY(12px) scale(0.97);
  transition: transform 0.22s cubic-bezier(.4,0,.2,1);
}
.modal-overlay.show .modal { transform: translateY(0) scale(1); }

.modal-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: #fff3ec;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  color: var(--accent);
}
.modal-icon svg { width: 24px; height: 24px; }

.modal h3 { font-size: 17px; font-weight: 800; color: var(--text-primary); margin-bottom: 8px; }
.modal p  { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 6px; }

.modal-count {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff3ec; color: var(--accent);
  font-size: 13px; font-weight: 700;
  padding: 5px 12px; border-radius: 5px;
  margin: 10px 0 20px;
}
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.modal-btn {
  padding: 8px 20px; border-radius: 5px;
  font-family: var(--font); font-size: 13px; font-weight: 600;
  cursor: pointer; border: none; transition: all 0.15s;
}
.modal-btn.cancel {
  background: var(--sidebar-bg); color: var(--text-secondary);
  border: 1px solid var(--sidebar-border);
}
.modal-btn.cancel:hover { background: var(--row-hover); }
.modal-btn.danger  { background: var(--accent); color: #fff; }
.modal-btn.danger:hover { background: var(--accent-hover); }

/* ── SPINNER ── */
.spinner {
  width: 38px; height: 38px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── ANIMATIONS ── */
@keyframes fadeInRow {
  from { opacity: 0; transform: translateY(3px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ════════════════════════════════
   INDEX.HTML — specific styles
   ════════════════════════════════ */

body.page-index {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.main-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── LEFT SIDEBAR ── */
.sidebar {
  width: 224px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.24s cubic-bezier(.4,0,.2,1);
}
.sidebar.collapsed { width: 46px; }

.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 7px 9px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--sidebar-border);
}
.sidebar.collapsed .sidebar-toggle { justify-content: center; }

.toggle-btn {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
  cursor: pointer;
  background: transparent;
  border: none;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.toggle-btn:hover { background: #eaddd2; color: var(--accent); }
.toggle-btn svg { width: 16px; height: 16px; transition: transform 0.24s; }
.sidebar.collapsed .toggle-btn svg { transform: rotate(180deg); }

.accordion-group { border-bottom: 1px solid var(--sidebar-border); }

.accordion-header {
  padding: 9px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 10px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background 0.15s, opacity 0.2s;
  white-space: nowrap;
  overflow: hidden;
}
.accordion-header:hover { background: #ede0d4; color: var(--accent); }

.sidebar.collapsed .accordion-header {
  opacity: 0; pointer-events: none; height: 0; padding: 0;
}

.accordion-arrow {
  margin-left: auto;
  width: 12px; height: 12px;
  transition: transform 0.22s ease;
  opacity: 0.5;
  flex-shrink: 0;
}
.accordion-group.collapsed .accordion-arrow { transform: rotate(-90deg); }

.accordion-body {
  overflow: hidden;
  max-height: 600px;
  transition: max-height 0.28s ease, opacity 0.22s ease;
  opacity: 1;
}
.accordion-group.collapsed .accordion-body { max-height: 0; opacity: 0; }
.sidebar.collapsed .accordion-group.collapsed .accordion-body { max-height: 600px; opacity: 1; }

.sidebar-item {
  padding: 8px 0 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  transition: background 0.1s;
  border-left: 3px solid transparent;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-item:hover { background: #ede0d4; }
.sidebar-item.active {
  background: var(--accent-light);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}
.sidebar-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.7; }
.sidebar-item.active svg { opacity: 1; }

.sidebar.collapsed .sidebar-item {
  padding: 10px 0;
  justify-content: center;
  border-left: 3px solid transparent;
}
.sidebar.collapsed .sidebar-item.active { border-left-color: var(--accent); }

.sidebar-label { transition: opacity 0.18s, width 0.24s; opacity: 1; overflow: hidden; }
.sidebar.collapsed .sidebar-label { opacity: 0; width: 0; }

.sidebar-badge {
  margin-left: auto;
  margin-right: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  flex-shrink: 0;
  transition: opacity 0.18s;
}
.sidebar.collapsed .sidebar-badge {
  opacity: 0; width: 0; padding: 0; margin: 0; min-width: 0; overflow: hidden;
}

.sidebar.collapsed .sidebar-item { position: relative; }
.sidebar.collapsed .sidebar-item::after {
  content: attr(data-label);
  position: absolute;
  left: 48px; top: 50%; transform: translateY(-50%);
  background: #1a1a1a; color: #fff;
  font-size: 12px; font-weight: 500;
  padding: 4px 9px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity 0.15s;
  z-index: 999;
  box-shadow: 0 2px 8px rgba(0,0,0,0.22);
}
.sidebar.collapsed .sidebar-item:hover::after { opacity: 1; }

/* ── CONTENT ── */
.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
}

/* ── IMPORT ZONE ── */
.import-zone {
  margin: 20px;
  padding: 28px;
  border: 2px dashed var(--sidebar-border);
  border-radius: 8px;
  text-align: center;
  background: var(--sidebar-bg);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.import-zone:hover, .import-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-light);
}
.import-zone.hidden { display: none; }

.import-icon {
  width: 48px; height: 48px;
  margin: 0 auto 12px;
  background: var(--accent-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
}
.import-icon svg { width: 24px; height: 24px; }
.import-title { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.import-sub   { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; }
.import-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 20px;
  background: var(--accent); color: #fff;
  border: none; border-radius: 5px;
  font-size: 13px; font-weight: 600; font-family: var(--font);
  cursor: pointer; transition: background 0.15s;
}
.import-btn:hover { background: var(--accent-hover); }

/* ── FILTER BAR ── */
.filter-bar {
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.search-box { position: relative; flex: 1; max-width: 300px; }
.search-box svg {
  position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px;
  color: var(--text-muted); pointer-events: none;
}
.search-box input {
  width: 100%;
  padding: 6px 10px 6px 30px;
  border: 1px solid var(--sidebar-border);
  border-radius: 5px;
  font-family: var(--font); font-size: 13px;
  color: var(--text-primary); background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2.5px rgba(232,88,26,0.18);
}

.filter-select {
  padding: 5px 10px;
  border: 1px solid var(--sidebar-border);
  border-radius: 5px;
  font-family: var(--font); font-size: 13px;
  color: var(--text-primary); background: #fff;
  outline: none; cursor: pointer;
  transition: border-color 0.15s;
}
.filter-select:focus { border-color: var(--accent); }

.filter-bar-right { margin-left: auto; display: flex; gap: 6px; }

/* ── PROGRESS BAR ── */
.progress-bar-wrap { height: 3px; background: var(--border); flex-shrink: 0; }
.progress-bar { height: 100%; background: var(--accent); width: 0%; transition: width 0.1s; }

/* ── TABLE ── */
.doc-table-wrap {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  min-height: 0;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1100px;
  table-layout: fixed;
}

.doc-table thead {
  position: sticky; top: 0;
  background: var(--sidebar-bg);
  z-index: 2;
}

.doc-table th {
  text-align: left;
  padding: 9px 12px;
  font-size: 11px; font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer; user-select: none;
  letter-spacing: 0.04em; text-transform: uppercase;
  transition: color 0.1s;
  overflow: hidden;
  text-overflow: ellipsis;
}
.doc-table th:hover { color: var(--accent); }
.doc-table th.sorted { color: var(--accent); }

.th-inner { display: flex; align-items: center; gap: 4px; }
.sort-icon { font-size: 10px; opacity: 0.5; }

.doc-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.doc-table td.mono { font-family: var(--mono); font-size: 12px; }

.doc-table tbody tr { cursor: pointer; transition: background 0.08s; }
.doc-table tbody tr:hover { background: var(--row-hover); }
.doc-table tbody tr.selected { background: var(--row-selected); }

.doc-table input[type="checkbox"] {
  width: 15px; height: 15px;
  cursor: pointer; accent-color: var(--accent);
}

.doc-name { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-oem  { font-size: 11px; color: var(--text-muted); font-family: var(--mono); margin-top: 2px; }

.price-cell {
  font-weight: 700; font-size: 13px;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ── EMPTY STATE ── */
.empty-state {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--text-muted); gap: 10px; padding: 40px;
}
.empty-state svg { width: 48px; height: 48px; opacity: 0.35; }
.empty-state h3 { font-size: 16px; font-weight: 700; color: var(--text-secondary); }
.empty-state p  { font-size: 13px; text-align: center; max-width: 320px; line-height: 1.6; }

/* ── LOADING OVERLAY ── */
.loading-overlay {
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.85);
  display: none;
  flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px; z-index: 50;
}
.loading-overlay.show { display: flex; }
.loading-text { font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.loading-sub  { font-size: 12px; color: var(--text-muted); }

/* ════════════════════════════════
   CARD.HTML — specific styles
   ════════════════════════════════ */

body.page-card {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--sidebar-bg);
}

/* ── CARD HEADER ── */
.card-header-bar {
  background: var(--header-bg);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 52px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.card-oem-pill {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 3px 10px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.card-title-text {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* ── TABS ── */
.card-tabs {
  display: flex;
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  flex-shrink: 0;
}

.card-tab {
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  display: flex;
  align-items: center;
  gap: 7px;
  user-select: none;
}
.card-tab:hover { color: var(--text-primary); }
.card-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.card-tab svg { width: 15px; height: 15px; }

/* ── TAB PANELS ── */
.card-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.tab-panel { display: none; animation: fadeIn 0.18s ease; }
.tab-panel.active { display: block; }

/* ── DESCRIPTION PANEL ── */

.desc-pane {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.desc-pane-header {
  padding: 10px 14px;
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 7px;
}
.desc-pane-header svg { width: 13px; height: 13px; }

.desc-pane-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-secondary);
}
.desc-pane-body p    { margin-bottom: 8px; }
.desc-pane-body strong { font-weight: 700; color: var(--text-primary); }
.desc-pane-body em   { font-style: italic; }

.desc-raw {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-all;
}

/* ── DATA PANEL ── */
.data-sections {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.data-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.data-section-header {
  padding: 10px 16px;
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}
.data-section-header svg { width: 13px; height: 13px; color: var(--accent); opacity: 0.8; }

.data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0;
}

.data-field {
  padding: 10px 16px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.data-field:last-child { border-right: none; }

.data-field-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.data-field-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
}
.data-field-value.empty { color: var(--text-muted); font-weight: 400; font-style: italic; }
.data-field-value.mono  { font-family: var(--mono); font-size: 12px; }
.data-field-value.price { color: var(--accent); font-size: 16px; font-weight: 800; }

.data-field-value a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.data-field-value a:hover { text-decoration: underline; }

/* Wide field spanning full row */
.data-field.wide {
  grid-column: 1 / -1;
}

/* URL list */
.url-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.url-list a {
  font-size: 12px;
  font-family: var(--mono);
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  max-width: 100%;
}
.url-list a:hover { text-decoration: underline; }

/* ── QUILL EDITOR CUSTOM STYLES ── */
.ql-container {
  font-family: var(--font);
  font-size: 14px;
  height: calc(100% - 42px) !important;
}

.ql-editor {
  padding: 16px;
  min-height: 200px;
  overflow-y: auto;
}

.ql-toolbar {
  border-top: none;
  border-left: none;
  border-right: none;
  border-bottom: 1px solid var(--border);
  background: var(--sidebar-bg);
  border-radius: 0;
}

.ql-toolbar button:hover,
.ql-toolbar button.ql-active {
  color: var(--accent) !important;
}

.ql-toolbar button:hover .ql-stroke,
.ql-toolbar button.ql-active .ql-stroke {
  stroke: var(--accent) !important;
}

.ql-toolbar button:hover .ql-fill,
.ql-toolbar button.ql-active .ql-fill {
  fill: var(--accent) !important;
}

.ql-picker-label:hover,
.ql-picker-label.ql-active {
  color: var(--accent) !important;
}

.ql-picker-label:hover .ql-stroke,
.ql-picker-label.ql-active .ql-stroke {
  stroke: var(--accent) !important;
}

/* Стили для кнопок вставки плейсхолдеров */
.editor-action-btn {
  padding: 4px 8px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

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

/* Стили для HTML preview */
.desc-raw {
  font-family: var(--mono);
  line-height: 1.6;
  background: #faf8f5;
  padding: 12px;
  border-radius: 4px;
  border: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-all;
}

/* Кнопка копирования */
.copy-btn {
  padding: 4px 8px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.copy-btn:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

/* Стили для сохраненной кнопки */
#saveBtn {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

#saveBtn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* Левая панель с полями */
.data-panel {
  width: 460px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}

.data-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

.data-field-item {
  display: flex;
  align-items: center;
  padding: 4px 12px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
  gap: 8px;
  min-height: 32px;
}

.data-field-item:hover {
  background: var(--row-hover);
}

.data-field-item-label {
  width: 130px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.data-field-item-value {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  min-width: 0;
  padding: 2px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-field-item-value.editable {
  background: #fff;
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: text;
  outline: none;
}

.data-field-item-value.editable:hover {
  border-color: var(--border);
}

.data-field-item-value.editable:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(232,88,26,0.1);
  background: #fff;
  white-space: normal;
  word-break: break-word;
}

.data-field-insert-btn {
  width: 22px;
  height: 22px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0;
}

.data-field-item:hover .data-field-insert-btn {
  opacity: 1;
}

.data-field-insert-btn:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

/* Layout трёх колонок */
.desc-layout {
  display: grid;
  grid-template-columns: 460px 1fr 1fr;
  gap: 16px;
  height: calc(100vh - 120px);
}
/* Стили для редактора Quill, имитирующие отображение Авито */
.ql-editor {
  /* Межстрочный интервал как на Авито */
  line-height: 1.5 !important;
  /* Разрешить перенос строк по словам, даже если нет тегов <br> */
  white-space: pre-wrap !important;
  /* Основной шрифт (можно заменить на тот, что использует Авито) */
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
  font-size: 14px !important;
  color: #222 !important;
}

/* Отступы между параграфами */
.ql-editor p {
  margin: 0 0 12px 0 !important;
  padding: 0 !important;
}

/* Если используются заголовки — тоже добавим отступы */
.ql-editor h1, .ql-editor h2, .ql-editor h3, .ql-editor h4 {
  margin: 16px 0 8px 0 !important;
  font-weight: 700 !important;
}

/* Списки — отступы и маркеры */
.ql-editor ul, .ql-editor ol {
  margin: 6px 0 12px 0 !important;
  padding-left: 24px !important;
}

.ql-editor li {
  margin-bottom: 4px !important;
}

/* Ссылки как на Авито */
.ql-editor a {
  color: #0066cc !important;
  text-decoration: underline !important;
}
.photo-cell img {
    width: 44px !important;
    height: 44px !important;
    object-fit: contain;          /* вместо cover — не обрезает, но может быть пустое место */
    image-rendering: crisp-edges; /* или pixelated — для чёткости мелких картинок */
    background: #f8f9fa;          /* на случай прозрачности */
}

.photo-cell img:not([src]),
.photo-cell img[src=""] {
    display: none;                /* скрываем битые img, чтобы placeholder был виден */
}