/* ==========================================================================
   SMARTPRAYS PRO — MOYSKLAD PRICE LIST GENERATOR STYLESHEET
   Design: Modern Glassmorphism Dashboard + Pixel-Perfect A4 Printable Sheet
   ========================================================================== */

:root {
  /* Control Panel Colors (Dark Executive Palette) */
  --bg-app: #090d16;
  --bg-panel: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-hover: rgba(51, 65, 85, 0.85);
  --bg-input: #1e293b;
  --border-panel: rgba(255, 255, 255, 0.08);
  --border-focus: #38bdf8;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  /* Brand Accents */
  --accent-blue: #2563eb;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  
  /* Price Sheet Configurable Variables (Default Corporate) */
  --sheet-primary: #1e3a8a;
  --sheet-primary-light: #eff6ff;
  --sheet-accent: #0284c7;
  --sheet-border: #cbd5e1;
  --sheet-bg: #ffffff;
  --sheet-text: #0f172a;
  --sheet-text-muted: #475569;
  --sheet-font-size: 13px;
  
  /* Radii & Transitions */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --shadow-sheet: 0 20px 40px -15px rgba(0, 0, 0, 0.35), 0 0 1px 1px rgba(0,0,0,0.1);
}

/* ==========================================
   RESET & CORE BASE
   ========================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ==========================================
   TOPBAR NAVIGATION
   ========================================== */
.app-topbar {
  height: 64px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-panel);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  font-size: 24px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #ffffff;
}

.brand-title span {
  color: #38bdf8;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.header-divider {
  width: 1px;
  height: 28px;
  background: var(--border-panel);
}

.active-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #34d399;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ==========================================
   BUTTONS & COMMON UI
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
}

.btn-outline {
  background: rgba(30, 41, 59, 0.6);
  color: var(--text-main);
  border: 1px solid var(--border-panel);
}

.btn-outline:hover {
  background: rgba(51, 65, 85, 0.8);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.text-emerald { color: #34d399 !important; }
.text-cyan { color: #38bdf8 !important; }
.text-danger { color: #fb7185 !important; }
.text-amber { color: #f59e0b !important; }

/* ==========================================
   LAYOUT: SIDEBAR + MAIN WORKSPACE
   ========================================== */
.app-main {
  display: flex;
  flex: 1;
  height: calc(100vh - 64px);
  overflow: hidden;
}

/* LEFT CONTROL PANEL */
.control-panel {
  width: 520px;
  min-width: 480px;
  max-width: 580px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border-panel);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  z-index: 10;
}

/* TABS NAVIGATION */
.nav-tabs {
  display: flex;
  background: rgba(15, 23, 42, 0.9);
  border-bottom: 1px solid var(--border-panel);
  padding: 8px 12px 0;
  gap: 4px;
  overflow-x: auto;
}

.nav-tabs::-webkit-scrollbar {
  height: 3px;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  color: #38bdf8;
  border-bottom-color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
}

.tab-count {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
}

/* TAB CONTENT */
.tab-content-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px 20px 140px 20px;
}

.tab-content-area::-webkit-scrollbar {
  width: 6px;
}

.tab-content-area::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.tab-pane {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.tab-pane.active {
  display: flex;
  animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel-section-header {
  margin-bottom: 4px;
}

.panel-section-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-section-header h3 i {
  color: #38bdf8;
}

.section-sub {
  font-size: 12px;
  color: var(--text-muted);
}

/* ==========================================
   FORMS & INPUTS
   ========================================== */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-panel);
}

.form-card-title i {
  color: #38bdf8;
  font-size: 13px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  font-family: inherit;
  font-size: 13px;
  color: #ffffff;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  outline: none;
  transition: all var(--transition-fast);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.form-textarea {
  resize: vertical;
  line-height: 1.5;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

.form-hint {
  font-size: 11px;
  color: var(--text-dim);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

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

.checkbox-row label {
  font-size: 12.5px;
  font-weight: 600;
  color: #cbd5e1;
  cursor: pointer;
}

/* File Upload Box */
.file-upload-box {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.file-input-hidden {
  display: none;
}

.upload-hint {
  font-size: 11.5px;
  color: var(--text-dim);
}

/* ==========================================
   TAB 1: PRODUCTS TAB SPECIAL COMPONENTS
   ========================================== */
.search-filter-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon i {
  position: absolute;
  left: 12px;
  color: var(--text-dim);
  font-size: 13px;
  pointer-events: none;
}

.input-with-icon input {
  width: 100%;
  font-family: inherit;
  font-size: 13px;
  color: #ffffff;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 10px 36px 10px 36px;
  outline: none;
  transition: all var(--transition-fast);
}

.input-with-icon input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.clear-search-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  display: none;
}

.category-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.cat-pill {
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-panel);
  border-radius: 20px;
  padding: 5px 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.cat-pill:hover {
  background: rgba(51, 65, 85, 0.8);
  color: #ffffff;
}

.cat-pill.active {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

/* Bulk tools bar */
.bulk-tools-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  background: rgba(30, 41, 59, 0.4);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-panel);
}

.selection-actions {
  display: flex;
  gap: 6px;
}

.tool-btn {
  background: rgba(51, 65, 85, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tool-btn:hover {
  background: #3b82f6;
  color: #ffffff;
}

.discount-widget {
  display: flex;
  align-items: center;
  gap: 8px;
}

.discount-label {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.discount-control {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.btn-step {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 8px;
  cursor: pointer;
}

.btn-step:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.discount-control input {
  width: 44px;
  background: transparent;
  border: none;
  color: #34d399;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  outline: none;
}

.percent-sign {
  font-size: 11px;
  color: var(--text-dim);
  padding-right: 4px;
}

.btn-apply-discount {
  background: #10b981;
  border: none;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 8px;
  cursor: pointer;
}

.btn-apply-discount:hover {
  background: #059669;
}

/* Price columns config card */
.price-columns-card {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.card-title-small {
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.price-columns-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.col-selector-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.col-selector-item label {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
}

.col-input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.col-input-row.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* Folders Quick Actions Bar */
.folders-quick-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-md);
  padding: 8px 12px;
}

.folders-count-text {
  font-size: 12px;
  font-weight: 700;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.folder-btns-group {
  display: flex;
  gap: 6px;
}

/* Product Ordering & Sorting Bar */
.sorting-card {
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sorting-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

.sorting-title {
  font-size: 12px;
  font-weight: 700;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sorting-tip {
  font-size: 10.5px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 4px;
}

.sorting-actions-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
}

.sort-btn {
  font-size: 11px;
  padding: 6px 4px;
  text-align: center;
  justify-content: center;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.sort-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

/* MoySklad Folders Container */
.folders-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  overflow: visible;
}

/* MoySklad Folder Accordion Cards (Collapsible) */
.folder-accordion-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-md);
  margin-bottom: 0;
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.folder-accordion-card.collapsed {
  border-color: rgba(255, 255, 255, 0.06);
}

.folder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  background: rgba(30, 41, 59, 0.75);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast);
  border-bottom: 1px solid var(--border-panel);
}

.folder-accordion-card.collapsed .folder-header {
  border-bottom-color: transparent;
  background: rgba(30, 41, 59, 0.4);
}

.folder-header:hover {
  background: rgba(51, 65, 85, 0.85);
}

.folder-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.folder-chk {
  width: 17px;
  height: 17px;
  accent-color: #2563eb;
  cursor: pointer;
}

.folder-icon {
  font-size: 16px;
  color: #f59e0b;
  transition: transform 0.2s ease;
}

.folder-titles {
  display: flex;
  flex-direction: column;
}

.folder-title {
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.2px;
}

.folder-path {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.folder-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.folder-quick-actions {
  display: flex;
  align-items: center;
  gap: 3px;
}

.btn-folder-action {
  width: 22px;
  height: 22px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9.5px;
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 0;
}

.btn-folder-action:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.folder-count-badge {
  font-size: 11px;
  font-weight: 600;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 3px 8px;
  border-radius: 12px;
}

.chevron-icon {
  font-size: 12px;
  color: var(--text-muted);
  transition: transform 0.25s ease;
}

.folder-accordion-card.collapsed .chevron-icon {
  transform: rotate(-90deg);
}

.folder-accordion-card.collapsed .folder-icon {
  color: #94a3b8;
}

.folder-body {
  display: block;
  max-height: none !important;
  overflow: visible !important;
}

.folder-accordion-card.collapsed .folder-body {
  display: none !important;
}

/* Products list wrapper */
.products-list-wrapper {
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.products-list-header {
  display: grid;
  grid-template-columns: 46px 38px 1fr 48px 84px 68px;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.9);
  border-bottom: 1px solid var(--border-panel);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.products-scroll-area {
  max-height: none !important;
  overflow: visible !important;
  display: flex;
  flex-direction: column;
}

.products-scroll-area::-webkit-scrollbar {
  width: 5px;
}

.products-scroll-area::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

/* Product list item */
.product-row-item {
  display: grid;
  grid-template-columns: 46px 38px 1fr 48px 84px 68px;
  align-items: center;
  padding: 7px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background var(--transition-fast), border-color var(--transition-fast);
  position: relative;
  user-select: none;
}

.product-row-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.product-row-item.is-dragging {
  opacity: 0.35;
  background: rgba(37, 99, 235, 0.2) !important;
  border-top: 1px dashed #38bdf8 !important;
  border-bottom: 1px dashed #38bdf8 !important;
}

.product-row-item.drag-over-top {
  border-top: 2px solid #38bdf8 !important;
}

.product-row-item.drag-over-bottom {
  border-bottom: 2px solid #38bdf8 !important;
}

.product-row-item.excluded {
  opacity: 0.45;
  background: rgba(0, 0, 0, 0.15);
}

.prod-handle-check {
  display: flex;
  align-items: center;
  gap: 4px;
}

.drag-handle {
  color: #64748b;
  cursor: grab;
  padding: 4px 1px;
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  transition: color var(--transition-fast);
}

.drag-handle:hover {
  color: #38bdf8;
}

.drag-handle:active {
  cursor: grabbing;
}

.prod-checkbox {
  width: 15px;
  height: 15px;
  accent-color: #2563eb;
  cursor: pointer;
}

.prod-thumb-box {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.prod-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.prod-thumb-box i {
  color: #94a3b8;
  font-size: 14px;
}

.prod-info-box {
  display: flex;
  flex-direction: column;
  padding-right: 6px;
  overflow: hidden;
}

.prod-name {
  font-size: 12px;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prod-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--text-dim);
}

.prod-code-badge {
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 4px;
  border-radius: 3px;
  font-family: 'JetBrains Mono', monospace;
}

.prod-unit {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.prod-price-input {
  width: 80px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 4px 5px;
  text-align: right;
  outline: none;
}

.prod-price-input:focus {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
}

.prod-row-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  justify-content: flex-end;
}

.btn-row-action {
  width: 19px;
  height: 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9.5px;
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 0;
}

.btn-row-action:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.btn-row-action.btn-remove-prod:hover {
  background: rgba(244, 63, 94, 0.2);
  border-color: rgba(244, 63, 94, 0.4);
  color: #fb7185;
}

/* Category header in products list */
.cat-divider-row {
  background: rgba(30, 41, 59, 0.9);
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-top: 1px solid var(--border-panel);
  border-bottom: 1px solid var(--border-panel);
}

/* ==========================================
   CURRENCY & EXCHANGE RATE CONTROLS
   ========================================== */
.currency-card {
  background: var(--bg-card);
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.currency-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.currency-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 700;
  color: #f8fafc;
}

.currency-title i {
  color: #f59e0b;
  font-size: 14px;
}

.currency-pills-selector {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(15, 23, 42, 0.7);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-panel);
}

.curr-pill-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.curr-pill-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.curr-pill-btn.active {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
}

.currency-settings-body {
  border-top: 1px dashed var(--border-panel);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.curr-rate-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.rate-input-group {
  flex: 1;
  min-width: 170px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rate-input-group label {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
}

.rate-input-wrapper {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-sm);
  padding: 0 8px;
  height: 34px;
  transition: border-color var(--transition-fast);
}

.rate-input-wrapper:focus-within {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.rate-prefix {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: #f59e0b;
  margin-right: 4px;
  font-size: 13px;
}

.rate-suffix {
  font-size: 11px;
  color: var(--text-dim);
  margin-left: 4px;
  font-weight: 500;
}

.rate-input {
  border: none !important;
  background: none !important;
  padding: 0 !important;
  height: 100% !important;
  width: 100%;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  outline: none;
}

.rate-quick-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-fetch-cbu {
  padding: 7px 10px;
  font-size: 11px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-panel);
  color: #38bdf8;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  height: 34px;
}

.btn-fetch-cbu:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #ffffff;
}

.btn-rate-step {
  height: 34px;
  padding: 0 8px;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-panel);
  color: #cbd5e1;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-rate-step:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.curr-options-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Toolbar Currency Selector */
.tb-currency-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.8);
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-panel);
}

.tb-curr-label {
  font-size: 12px;
}

.tb-curr-group {
  display: flex;
  align-items: center;
  gap: 2px;
}

.tb-curr-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 3px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tb-curr-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.tb-curr-btn.active {
  background: #2563eb;
  color: #ffffff;
}

.tb-rate-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 700;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: 4px;
}

/* Dual currency pills in the table & preview sheet */
.price-dual-pill {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: #64748b;
  margin-top: 2px;
}

.td-price-alt .price-dual-pill {
  color: #047857;
}

.td-price-diler .price-dual-pill {
  color: #b45309;
}

/* Rate row in document header */
.doc-rate-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
}

.doc-rate-badge {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  font-family: 'JetBrains Mono', monospace;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

/* ==========================================
   TAB 4: TEMPLATES & DESIGN SELECTORS
   ========================================== */
.template-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.template-card {
  background: var(--bg-card);
  border: 2px solid var(--border-panel);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.template-card:hover {
  border-color: rgba(56, 189, 248, 0.5);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.template-card.active {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.2);
}

.tpl-preview {
  height: 60px;
  background: #ffffff;
  border-radius: var(--radius-sm);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.tpl-corp .tpl-bar { height: 10px; background: #1e3a8a; border-radius: 2px; }
.tpl-corp .tpl-lines span { display: block; height: 4px; background: #e2e8f0; margin-bottom: 3px; border-radius: 2px; }

.tpl-emerald .tpl-bar { height: 10px; background: #059669; border-radius: 2px; }
.tpl-emerald .tpl-lines span { display: block; height: 4px; background: #d1fae5; margin-bottom: 3px; border-radius: 2px; }

.tpl-minimal .tpl-bar { height: 4px; background: #0f172a; border-radius: 1px; }
.tpl-minimal .tpl-lines span { display: block; height: 3px; background: #94a3b8; margin-bottom: 4px; border-radius: 1px; }

.tpl-compact .tpl-bar { height: 6px; background: #334155; border-radius: 2px; }
.tpl-compact .tpl-lines span { display: block; height: 2px; background: #cbd5e1; margin-bottom: 2px; }

.tpl-catalog .tpl-grid-boxes { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; height: 100%; }
.tpl-catalog .tpl-grid-boxes div { background: #e2e8f0; border-radius: 2px; }

.tpl-meta {
  display: flex;
  flex-direction: column;
}

.tpl-title {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

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

.toggles-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.toggle-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #2563eb;
  cursor: pointer;
}

.toggle-item label {
  font-size: 12px;
  color: #cbd5e1;
  cursor: pointer;
}

.color-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-input {
  width: 40px;
  height: 36px;
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-sm);
  background: none;
  cursor: pointer;
}

.color-code-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
}

/* Background Art Options in Tab 4 */
.bg-design-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bg-design-card {
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.5);
  border: 1.5px solid var(--border-panel);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
  gap: 12px;
}

.bg-design-card input[type="radio"] {
  accent-color: #38bdf8;
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
}

.bg-design-card:hover {
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(30, 41, 59, 0.6);
}

.bg-design-card.active {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
}

.bg-design-thumb {
  width: 38px;
  height: 50px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.bg-thumb-geometric {
  background: #ffffff;
}

.bg-thumb-geometric .poly-mock-tl {
  position: absolute;
  top: 0;
  left: 0;
  width: 15px;
  height: 12px;
  background: #e0e3ed;
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

.bg-thumb-geometric .poly-mock-mr {
  position: absolute;
  right: 0;
  top: 50%;
  width: 12px;
  height: 15px;
  background: #faeed4;
  clip-path: polygon(100% 0, 0 50%, 100% 100%);
}

.bg-thumb-geometric .poly-mock-bot {
  position: absolute;
  bottom: 0;
  left: 32%;
  width: 16px;
  height: 13px;
  background: #d8dce8;
  clip-path: polygon(0 100%, 50% 0, 100% 100%);
}

.bg-thumb-white {
  background: #ffffff;
}

.bg-thumb-gradient {
  background: linear-gradient(135deg, #ffffff, #cbd5e1);
}

.bg-design-info {
  display: flex;
  flex-direction: column;
}

.bg-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #f1f5f9;
}

.bg-desc {
  font-size: 11px;
  color: var(--text-dim);
}

/* Table Style Options */
.table-style-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tstyle-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.5);
  border: 1.5px solid var(--border-panel);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tstyle-card input[type="radio"] {
  accent-color: #38bdf8;
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
}

.tstyle-card:hover {
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(30, 41, 59, 0.6);
}

.tstyle-card.active {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
}

.tstyle-info {
  display: flex;
  flex-direction: column;
}

.tstyle-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #f1f5f9;
}

.tstyle-desc {
  font-size: 11px;
  color: var(--text-dim);
}

.tool-btn.active-accent {
  background: rgba(245, 158, 11, 0.18) !important;
  border-color: rgba(245, 158, 11, 0.45) !important;
  color: #fbbf24 !important;
}

/* ==========================================
   TAB 5: PRESETS TAB
   ========================================== */
.save-preset-row {
  display: flex;
  gap: 8px;
}

.presets-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preset-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.6);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-panel);
}

.preset-info {
  display: flex;
  flex-direction: column;
}

.preset-name {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

.preset-date {
  font-size: 11px;
  color: var(--text-dim);
}

.preset-actions {
  display: flex;
  gap: 6px;
}

/* ==========================================
   RIGHT SIDE: LIVE PREVIEW & CANVAS
   ========================================== */
.preview-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #060911;
  overflow: hidden;
  position: relative;
}

/* SHEET TOOLBAR */
.sheet-toolbar {
  height: 48px;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-panel);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 5;
}

.sheet-meta-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sheet-badge {
  font-size: 12px;
  font-weight: 700;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sheet-paper-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 8px;
  border-radius: 4px;
}

.edit-hint {
  font-size: 11px;
  color: #34d399;
  display: flex;
  align-items: center;
  gap: 5px;
}

.sheet-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.zoom-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-card);
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-panel);
}

.zoom-btn {
  background: none;
  border: none;
  color: #cbd5e1;
  font-size: 11px;
  padding: 4px 6px;
  cursor: pointer;
  border-radius: 3px;
}

.zoom-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.zoom-level {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  min-width: 38px;
  text-align: center;
}

/* Quick Toolbar Language & Currency Selector */
.tb-lang-wrapper,
.tb-currency-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-panel);
}

.tb-lang-label,
.tb-curr-label {
  font-size: 11px;
  display: flex;
  align-items: center;
  padding: 0 2px;
}

.tb-lang-group,
.tb-curr-group {
  display: flex;
  gap: 3px;
}

.tb-lang-btn,
.tb-curr-btn {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tb-lang-btn:hover,
.tb-curr-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.tb-lang-btn.active {
  background: rgba(6, 182, 212, 0.22);
  border-color: rgba(6, 182, 212, 0.55);
  color: #22d3ee;
  font-weight: 700;
}

.tb-curr-btn.active {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(245, 158, 11, 0.55);
  color: #fbbf24;
  font-weight: 700;
}

.tb-rate-badge {
  font-size: 10.5px;
  font-weight: 700;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}

/* Document Language Selector Card in Tab 2 */
.lang-selector-card {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.65) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 1px solid rgba(6, 182, 212, 0.25);
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.06);
}

.card-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.badge-lang-active {
  font-size: 11px;
  font-weight: 700;
  color: #22d3ee;
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.35);
  padding: 3px 8px;
  border-radius: 12px;
}

.lang-pills-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.lang-pill-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.6);
  border: 1.5px solid var(--border-panel);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}

.lang-pill-btn:hover {
  background: rgba(51, 65, 85, 0.6);
  border-color: rgba(6, 182, 212, 0.4);
}

.lang-pill-btn.active {
  background: rgba(6, 182, 212, 0.15);
  border-color: #06b6d4;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.2);
}

.lang-pill-btn .lang-flag {
  font-size: 20px;
  line-height: 1;
}

.lang-pill-text {
  display: flex;
  flex-direction: column;
}

.lang-pill-text strong {
  font-size: 12px;
  color: #f1f5f9;
}

.lang-pill-text small {
  font-size: 10px;
  color: var(--text-dim);
}

.lang-pill-btn.active .lang-pill-text strong {
  color: #22d3ee;
}

.lang-quick-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.lang-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: #cbd5e1;
  cursor: pointer;
}

.lang-toggle-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: #06b6d4;
  cursor: pointer;
}

/* CANVAS WRAPPER (SCROLLABLE CONTAINER) */
.sheet-canvas-wrapper {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  padding: 40px 20px 80px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 24px 24px;
}

.sheet-canvas-wrapper::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.sheet-canvas-wrapper::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

/* ==========================================================================
   THE A4 PRICE SHEET (PRINTABLE DOCUMENT)
   Exact A4 Proportions: 210mm width (approx 800px on web view)
   ========================================================================== */
/* Background Geometric Decorations (from User Reference Document) */
.sheet-background-decorations {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.sheet-bg-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.price-sheet {
  width: 820px;
  min-height: auto;
  height: fit-content;
  background-color: #ffffff;
  color: var(--sheet-text);
  box-shadow: var(--shadow-sheet);
  border-radius: 4px;
  padding: 34px 40px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden; /* keeps geometric facets neatly bound to paper edges */
  transform-origin: top center;
  transition: transform 0.1s ease;
  font-size: var(--sheet-font-size);
  line-height: 1.4;
}

/* Background modes */
.price-sheet.bg-geometric .sheet-background-decorations {
  display: block;
}

.price-sheet.bg-none .sheet-background-decorations {
  display: none !important;
}

.price-sheet.bg-gradient {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 40%, #edf2f7 100%) !important;
}
.price-sheet.bg-gradient .sheet-background-decorations {
  display: none !important;
}

/* Ensure document contents float cleanly over the geometric background */
.sheet-header,
.sheet-body,
.sheet-footer {
  position: relative;
  z-index: 1;
}

/* Editable outlines for WYSIWYG mode */
[contenteditable="true"]:hover {
  outline: 1px dashed rgba(56, 189, 248, 0.6);
  border-radius: 2px;
  background: rgba(56, 189, 248, 0.05);
}

[contenteditable="true"]:focus {
  outline: 2px solid #2563eb;
  background: #ffffff;
  color: #0f172a;
  border-radius: 2px;
}

/* ==========================================
   SHEET HEADER (TEPPA YOZUVLAR)
   ========================================== */
.sheet-header {
  border-bottom: 2px solid var(--sheet-primary);
  padding-bottom: 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.header-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

/* Company Brand & Logo */
.company-brand-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.company-logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sheet-logo-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  color: var(--sheet-primary);
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.sheet-logo-rings {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.aspect-concentric-rings-svg {
  width: 40px;
  height: 40px;
  display: block;
}

.logo-text-group {
  display: flex;
  flex-direction: column;
}

.logo-text-bold {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 1.5px;
  line-height: 1.1;
  color: var(--sheet-primary);
}

.logo-subtext {
  font-size: 8.5px;
  letter-spacing: 1px;
  opacity: 0.85;
  text-transform: uppercase;
  color: var(--sheet-text-muted);
}

.sheet-logo-image {
  max-height: 50px;
  max-width: 180px;
  object-fit: contain;
}

.company-full-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--sheet-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Document Meta Details (Right Side) */
.sheet-doc-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.doc-badge-pill {
  background: var(--sheet-primary-light);
  color: var(--sheet-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid rgba(30, 58, 138, 0.2);
}

.doc-date-row, .doc-currency-row {
  font-size: 11.5px;
  display: flex;
  gap: 6px;
}

.doc-date-label {
  color: var(--sheet-text-muted);
}

.doc-date-value, .doc-currency-value {
  font-weight: 700;
  color: var(--sheet-text);
}

/* Header Titles */
.header-titles-block {
  text-align: center;
  margin: 6px 0;
}

.sheet-main-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--sheet-primary);
  letter-spacing: -0.5px;
  text-transform: uppercase;
}

.sheet-sub-title {
  font-size: 12px;
  color: var(--sheet-text-muted);
  margin-top: 2px;
}

/* Contacts Strip */
.header-contacts-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  background: var(--sheet-primary-light);
  border: 1px solid rgba(0, 0, 0, 0.05);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 11px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--sheet-text);
}

.contact-item i {
  color: var(--sheet-accent);
  font-size: 11px;
}

.contact-item span {
  font-weight: 600;
}

/* Discount Banner */
.discount-banner {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
}

/* ==========================================
   SHEET BODY & TABLE
   ========================================== */
.sheet-body {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
}

.table-container {
  width: 100%;
  overflow: visible;
}

.sheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: inherit;
}

.sheet-table thead tr {
  background: var(--sheet-primary);
  color: #ffffff;
}

.sheet-table th {
  padding: 8px 10px;
  font-weight: 700;
  text-align: left;
  border: 1px solid rgba(0, 0, 0, 0.15);
  font-size: 11.5px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.th-num { width: 34px; text-align: center; }
.th-img { width: 48px; text-align: center; }
.th-code { width: 68px; }
.th-unit { width: 75px; text-align: center; }
.th-price { width: 115px; text-align: right; }

.sheet-table td {
  padding: 7px 10px;
  border: 1px solid var(--sheet-border);
  vertical-align: middle;
}

/* Category Subheader Row inside Table */
.sheet-cat-row td {
  background: var(--sheet-primary-light);
  color: var(--sheet-primary);
  font-weight: 800;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 10px;
  border-left: 3px solid var(--sheet-primary);
}

.sheet-table tbody tr.data-row {
  cursor: default;
  transition: background-color 0.15s ease;
}

.sheet-table tbody tr.data-row:hover {
  background-color: rgba(56, 189, 248, 0.05);
}

.sheet-table tbody tr.data-row.is-dragging {
  opacity: 0.35;
  background-color: rgba(37, 99, 235, 0.15) !important;
}

.sheet-table tbody tr.data-row.drag-over-top td {
  border-top: 2px solid #2563eb !important;
}

.sheet-table tbody tr.data-row.drag-over-bottom td {
  border-bottom: 2px solid #2563eb !important;
}

.sheet-table tbody tr.data-row:nth-child(even) {
  background-color: #f8fafc;
}

/* Official Table Grid Framing (from User Reference Document) */
.price-sheet.table-grid-official .table-container {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(2px);
  border-radius: 2px;
}

.price-sheet.table-grid-official .sheet-table {
  border: 1.5px solid var(--sheet-primary) !important;
  border-collapse: collapse !important;
}

.price-sheet.table-grid-official .sheet-table thead th {
  border: 1px solid var(--sheet-primary) !important;
  border-bottom: 2px solid var(--sheet-primary) !important;
  background: rgba(255, 255, 255, 0.95) !important;
  color: var(--sheet-primary) !important;
  font-weight: 800;
}

.price-sheet.table-grid-official .sheet-table tbody td {
  border: 1px solid var(--sheet-primary) !important;
  background: rgba(255, 255, 255, 0.65);
}

.price-sheet.table-grid-official .sheet-table tbody tr.data-row:nth-child(even) td {
  background-color: rgba(248, 250, 252, 0.75);
}

.price-sheet.table-grid-official .sheet-table tbody tr.data-row:hover td {
  background-color: rgba(255, 255, 255, 0.95);
}

.price-sheet.table-grid-official .sheet-cat-row td {
  border: 1px solid var(--sheet-primary) !important;
  background: rgba(30, 58, 138, 0.08) !important;
  color: var(--sheet-primary) !important;
  font-weight: 800;
}

.td-num {
  text-align: center;
  font-weight: 600;
  color: var(--sheet-text-muted);
  position: relative;
  user-select: none;
}

.sheet-drag-handle {
  display: none;
  font-size: 10px;
  color: #94a3b8;
  margin-left: 3px;
  cursor: grab;
}

.sheet-table tbody tr.data-row:hover .sheet-drag-handle {
  display: inline-block;
}

.td-img {
  text-align: center;
  padding: 4px !important;
}

.table-thumb-box {
  width: 38px;
  height: 38px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.table-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.td-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--sheet-text-muted);
  font-weight: 600;
}

.td-name {
  font-weight: 600;
  color: var(--sheet-text);
}

.td-unit {
  text-align: center;
  font-size: 11.5px;
  color: var(--sheet-text-muted);
  font-weight: 500;
}

.td-price {
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--sheet-primary);
  white-space: nowrap;
}

.td-price-alt {
  color: #059669;
}

.td-price-diler {
  color: #d97706;
}

/* Summary Bar */
.sheet-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding: 8px 12px;
  background: #f1f5f9;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  color: var(--sheet-text-muted);
}

.verified-seal {
  color: #059669;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ==========================================
   CATALOG GRID VIEW (FOR PHOTO CATALOG THEME)
   ========================================== */
.sheet-catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 10px;
}

.catalog-card {
  border: 1px solid var(--sheet-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #ffffff;
  display: flex;
  flex-direction: column;
}

.catalog-img-box {
  height: 120px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-bottom: 1px solid var(--sheet-border);
}

.catalog-img-box img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.catalog-card-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 4px;
}

.catalog-card-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--sheet-text-muted);
}

.catalog-card-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--sheet-text);
  line-height: 1.3;
}

.catalog-card-unit {
  font-size: 11px;
  color: var(--sheet-text-muted);
}

.catalog-card-prices {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px dashed var(--sheet-border);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.catalog-price-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 800;
  color: var(--sheet-primary);
}

/* ==========================================
   SHEET FOOTER (PASTKI YOZUVLAR)
   ========================================== */
.sheet-footer {
  margin-top: 24px;
  border-top: 2px solid var(--sheet-primary);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Terms 2-column or 3-column Grid */
.footer-terms-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.terms-card {
  background: #f8fafc;
  border: 1px solid var(--sheet-border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

.terms-card-notes {
  grid-column: span 2;
  background: var(--sheet-primary-light);
  border-color: rgba(30, 58, 138, 0.2);
}

.terms-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--sheet-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.terms-text {
  font-size: 11px;
  color: var(--sheet-text-muted);
  line-height: 1.4;
}

/* Footer Bottom Strip (Signatures + Stamp + QR) */
.footer-bottom-strip {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-top: 6px;
}

.signatures-block {
  display: flex;
  align-items: flex-end;
  gap: 24px;
}

.sign-person {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sign-name {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--sheet-text);
}

.sign-line {
  font-size: 11px;
  color: var(--sheet-text-muted);
}

.stamp-box {
  width: 72px;
  height: 72px;
  border: 2px dashed rgba(30, 58, 138, 0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stamp-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(30, 58, 138, 0.6);
  font-weight: 800;
  font-size: 12px;
  line-height: 1.1;
}

.stamp-circle small {
  font-size: 8px;
  letter-spacing: 0.5px;
}

/* Dynamic QR Code */
.qr-code-block {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1px solid var(--sheet-border);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}

.qr-container {
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-container img {
  width: 100%;
  height: 100%;
}

.qr-label {
  display: flex;
  flex-direction: column;
}

.qr-label strong {
  font-size: 11px;
  color: var(--sheet-text);
}

.qr-label span {
  font-size: 9.5px;
  color: var(--sheet-text-muted);
}

/* Copyright Row */
.footer-copyright-row {
  text-align: center;
  font-size: 10px;
  color: var(--sheet-text-muted);
  border-top: 1px solid #e2e8f0;
  padding-top: 8px;
}

/* ==========================================================================
   THEMES / TEMPLATES FOR THE SHEET
   ========================================================================== */

/* 1. ASPECT EMERALD THEME */
.price-sheet.theme-emerald {
  --sheet-primary: #059669;
  --sheet-primary-light: #ecfdf5;
  --sheet-accent: #10b981;
}

/* 2. MODERN MINIMALIST THEME */
.price-sheet.theme-minimalist {
  --sheet-primary: #0f172a;
  --sheet-primary-light: #f8fafc;
  --sheet-accent: #475569;
}
.price-sheet.theme-minimalist .sheet-table thead tr {
  background: #0f172a;
}
.price-sheet.theme-minimalist .sheet-header {
  border-bottom: 2px solid #0f172a;
}

/* 3. HIGH-DENSITY COMPACT THEME */
.price-sheet.theme-compact {
  --sheet-font-size: 11px;
  padding: 24px 28px;
}
.price-sheet.theme-compact .sheet-table th,
.price-sheet.theme-compact .sheet-table td {
  padding: 4px 6px;
}
.price-sheet.theme-compact .table-thumb-box {
  width: 28px;
  height: 28px;
}

/* ==========================================
   FONT SIZE OVERRIDES
   ========================================== */
.price-sheet.font-compact { --sheet-font-size: 11px; }
.price-sheet.font-normal { --sheet-font-size: 12.5px; }
.price-sheet.font-large { --sheet-font-size: 14px; }

/* ==========================================
   TOAST & MODALS
   ========================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.toast {
  background: #1e293b;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-panel);
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  animation: slideInRight 0.25s ease-out;
}

.toast.toast-success { border-color: #10b981; }
.toast.toast-success i { color: #34d399; }
.toast.toast-info { border-color: #38bdf8; }
.toast.toast-info i { color: #38bdf8; }
.toast.toast-error { border-color: #f43f5e; }
.toast.toast-error i { color: #fb7185; }

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.loading-card {
  background: #1e293b;
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-lg);
  padding: 32px 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
}

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(56, 189, 248, 0.2);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-card h4 {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
}

.loading-card p {
  font-size: 13px;
  color: var(--text-muted);
}

/* ==========================================================================
   PRINT STYLES (@media print)
   Optimized for Standard A4 Paper
   ========================================================================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 10mm 8mm 10mm 8mm;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    overflow: visible !important;
  }

  .app-topbar,
  .control-panel,
  .sheet-toolbar,
  .toast-container,
  .loading-overlay {
    display: none !important;
  }

  .app-main {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
  }

  .preview-panel {
    background: transparent !important;
    overflow: visible !important;
  }

  .sheet-canvas-wrapper {
    padding: 0 !important;
    background: none !important;
    overflow: visible !important;
    display: block !important;
  }

  .price-sheet {
    width: 100% !important;
    min-height: auto !important;
    height: auto !important;
    box-shadow: none !important;
    padding: 24px 28px !important;
    margin: 0 !important;
    transform: none !important;
    border-radius: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    position: relative !important;
    overflow: hidden !important;
  }

  .sheet-background-decorations {
    display: block !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .price-sheet.bg-none .sheet-background-decorations {
    display: none !important;
  }

  .sheet-body {
    flex: none !important;
    display: block !important;
    height: auto !important;
  }

  .sheet-header {
    page-break-after: avoid;
  }

  .sheet-table tr {
    page-break-inside: avoid;
  }

  .sheet-cat-row {
    page-break-after: avoid;
  }

  .sheet-footer {
    page-break-inside: avoid;
  }

  [contenteditable="true"] {
    outline: none !important;
    background: transparent !important;
  }
}
