/* ============================================
   DNIPROGRAF v2 — Modern Dark UI
   Linear/Vercel aesthetic
   ============================================ */

:root {
  --bg-primary: #09090b;
  --bg-secondary: #0f0f12;
  --bg-card: #18181b;
  --bg-card-hover: #1f1f23;
  --bg-input: #111114;
  --bg-sidebar: #0c0c0f;
  --bg-topbar: rgba(9,9,11,0.8);
  --bg-surface: #1a1a1e;
  --bg-hover: rgba(255,255,255,0.04);

  --accent: #e8753a;
  --accent-hover: #f0854a;
  --accent-light: rgba(232,117,58,0.12);
  --accent-glow: rgba(232,117,58,0.25);

  --blue: #3b82f6;
  --blue-light: rgba(59,130,246,0.12);
  --green: #10b981;
  --green-light: rgba(16,185,129,0.12);
  --red: #ef4444;
  --red-light: rgba(239,68,68,0.12);
  --yellow: #f59e0b;
  --yellow-light: rgba(245,158,11,0.12);
  --purple: #8b5cf6;
  --purple-light: rgba(139,92,246,0.12);
  --cyan: #06b6d4;
  --cyan-light: rgba(6,182,212,0.12);
  --pink: #ec4899;
  --pink-light: rgba(236,72,153,0.12);

  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #52525b;
  --text-accent: #e8753a;

  --border: rgba(255,255,255,0.06);
  --border-light: rgba(255,255,255,0.1);
  --border-accent: rgba(232,117,58,0.25);

  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 4px 16px rgba(0,0,0,0.2);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 40px rgba(232,117,58,0.08);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 8px;

  --sidebar-width: 220px;
  --topbar-height: 56px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* ============ SIDEBAR ============ */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  transition: var(--transition-slow);
}

.sidebar.collapsed { transform: translateX(-100%); }

.sidebar-header {
  padding: 20px 16px 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent), #d35f25);
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: white;
}

.logo-text {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--text-primary);
}

.sidebar-nav {
  flex: 1;
  padding: 8px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 16px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 1px;
  position: relative;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-light);
  color: var(--accent);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 55%;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.nav-item i {
  width: 18px;
  text-align: center;
  font-size: 14px;
  opacity: 0.8;
}

.nav-item.active i { opacity: 1; }

.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 12px;
}

/* ============ MAIN CONTENT ============ */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: var(--transition-slow);
}

.main-content.expanded { margin-left: 0; }

/* ============ TOPBAR ============ */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-xs);
  transition: var(--transition);
  display: none;
}

.sidebar-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.topbar-title {
  font-size: 15px;
  font-weight: 600;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-time {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ============ PAGE CONTAINER ============ */
.page-container {
  padding: 28px;
  max-width: 1400px;
}

/* ============ CARDS ============ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  transition: var(--transition);
}

.card:hover {
  border-color: var(--border-light);
}

.card-body {
  padding: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title i { color: var(--accent); font-size: 13px; }

/* ============ STAT CARDS ============ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: var(--transition);
}

.stat-card:hover {
  border-color: var(--border-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
}

.stat-icon.orange { background: var(--accent-light); color: var(--accent); }
.stat-icon.blue { background: var(--blue-light); color: var(--blue); }
.stat-icon.green { background: var(--green-light); color: var(--green); }
.stat-icon.red { background: var(--red-light); color: var(--red); }
.stat-icon.purple { background: var(--purple-light); color: var(--purple); }
.stat-icon.cyan { background: var(--cyan-light); color: var(--cyan); }
.stat-icon.yellow { background: var(--yellow-light); color: var(--yellow); }

.stat-info h4 {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 3px;
}

.stat-info p {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ============ GRID LAYOUTS ============ */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

/* ============ TABLES ============ */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
}

table th {
  background: var(--bg-secondary);
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

table td {
  padding: 10px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

table tr:hover td {
  background: var(--bg-hover);
}

table tr:last-child td { border-bottom: none; }

/* ============ BUTTONS ============ */
.btn {
  padding: 8px 16px;
  border-radius: var(--radius-xs);
  border: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 2px 12px var(--accent-glow);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--text-muted);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 6px 10px;
}

.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-success { background: var(--green); color: white; }
.btn-success:hover { background: #0ea572; }

.btn-danger {
  background: transparent;
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.2);
}

.btn-danger:hover {
  background: var(--red);
  color: white;
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  font-size: 13px;
}

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 11px 22px; font-size: 14px; }
.btn-group { display: flex; gap: 6px; }

/* ============ FORMS ============ */
.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2752525b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

textarea.form-control { resize: vertical; min-height: 72px; }

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

/* ============ BADGES & TAGS ============ */
.badge {
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-orange { background: var(--accent-light); color: var(--accent); }
.badge-blue { background: var(--blue-light); color: var(--blue); }
.badge-green { background: var(--green-light); color: var(--green); }
.badge-red { background: var(--red-light); color: var(--red); }
.badge-purple { background: var(--purple-light); color: var(--purple); }
.badge-cyan { background: var(--cyan-light); color: var(--cyan); }
.badge-yellow { background: var(--yellow-light); color: var(--yellow); }

.tag {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Pill chips — process/material tags */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: var(--transition);
}

.pill .pill-remove {
  cursor: pointer;
  opacity: 0.4;
  font-size: 10px;
  transition: var(--transition);
}

.pill:hover .pill-remove { opacity: 1; color: var(--red); }

.pill.pill-process { border-color: rgba(139,92,246,0.3); color: var(--purple); }
.pill.pill-material { border-color: rgba(16,185,129,0.3); color: var(--green); }
.pill.pill-equipment { border-color: rgba(59,130,246,0.3); color: var(--blue); }

/* ============ TABS ============ */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.tab {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: var(--transition);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
}

.tab:hover { color: var(--text-primary); }

.tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ============ MODAL ============ */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active { display: flex; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal.wide { max-width: 720px; }
.modal.extra-wide { max-width: 960px; }

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 15px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  transition: var(--transition);
  border-radius: var(--radius-xs);
}

.modal-close:hover { color: var(--red); background: var(--bg-hover); }

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ============ SLIDE PANEL ============ */
.slide-panel-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.slide-panel-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.slide-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 480px;
  max-width: 90vw;
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 40px rgba(0,0,0,0.4);
  z-index: 901;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.slide-panel.active { transform: translateX(0); }

.slide-panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.slide-panel-header h3 {
  font-size: 15px;
  font-weight: 600;
}

.slide-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.slide-panel-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

/* ============ TOASTS ============ */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.3s ease;
  box-shadow: var(--shadow);
  min-width: 240px;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast.success { background: var(--green); color: white; }
.toast.error { background: var(--red); color: white; }
.toast.warning { background: var(--yellow); color: #1a1a1a; }
.toast.info { background: var(--blue); color: white; }

/* ============ EMPTY STATE ============ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state i { font-size: 40px; margin-bottom: 14px; opacity: 0.2; }
.empty-state h3 { font-size: 16px; margin-bottom: 6px; color: var(--text-secondary); }
.empty-state p { font-size: 13px; margin-bottom: 16px; }

/* ============ TOOLBAR ============ */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.toolbar-left { display: flex; align-items: center; gap: 12px; }
.toolbar-right { display: flex; align-items: center; gap: 8px; }

.search-input { position: relative; }
.search-input input { padding-left: 34px; width: 220px; }
.search-input i {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
}

/* ============ SECTION HEADER ============ */
.section-header { margin-bottom: 20px; }
.section-header h2 { font-size: 18px; font-weight: 600; margin-bottom: 3px; }
.section-header p { font-size: 13px; color: var(--text-secondary); }

/* ============ ITEM LIST ============ */
.item-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.item-row {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
  cursor: pointer;
}

.item-row:hover {
  background: var(--bg-hover);
  border-color: var(--border);
}

.item-row-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.item-row-info { flex: 1; min-width: 0; }
.item-row-info h4 {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-row-info p {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-row-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.item-row-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  opacity: 0;
  transition: var(--transition);
}

.item-row:hover .item-row-actions { opacity: 1; }

/* ============ CALCULATOR ============ */
.calc-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  align-items: start;
}

.calc-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.calc-product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 124px;
  gap: 8px;
}

.calc-product-card:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.calc-product-card.selected {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: 0 0 15px rgba(232, 117, 58, 0.15);
}

.calc-product-media {
  width: 100%;
  height: 68px;
  border-radius: var(--radius-xs);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.calc-product-card:hover .calc-product-media {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.3);
}

.calc-product-card.selected .calc-product-media {
  border-color: var(--accent);
  background: rgba(232, 117, 58, 0.05);
}

.calc-product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-slow);
}

.calc-product-card:hover .calc-product-media img {
  transform: scale(1.05);
}

.calc-product-media i {
  font-size: 24px;
  color: var(--accent);
  margin-bottom: 0;
  display: block;
}

.calc-product-card span {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.25;
}

.calc-product-card.selected span { color: var(--accent); }

.calc-qty-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.calc-qty-presets button {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.calc-qty-presets button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.calc-price-display {
  text-align: center;
  padding: 24px 20px;
}

.calc-price-big {
  font-size: 40px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}

.calc-price-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.calc-price-row {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.calc-price-item { text-align: center; }
.calc-price-item .value { font-size: 18px; font-weight: 600; }
.calc-price-item .label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Accordion */
.accordion-trigger {
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: inherit;
  transition: var(--transition);
}

.accordion-trigger:hover { color: var(--text-primary); background: var(--bg-hover); }
.accordion-trigger i { transition: transform 0.2s; }
.accordion-trigger.open i { transform: rotate(180deg); }

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.accordion-body.open { max-height: 5000px; }

/* ============ CALC LOG (Printboost-style) ============ */
.calc-log-section { margin-bottom: 16px; }
.calc-log-section:last-child { margin-bottom: 0; }
.calc-log-header {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--accent); padding: 6px 0; border-bottom: 1px solid var(--border); margin-bottom: 6px;
}
.calc-log-row {
  display: grid; grid-template-columns: 1fr; gap: 1px;
  padding: 6px 8px; border-radius: 6px; margin-bottom: 2px;
  font-size: 12px; background: var(--bg-secondary);
}
.calc-log-row:nth-child(odd) { background: transparent; }
.calc-log-highlight { background: var(--accent-alpha) !important; border: 1px solid var(--accent); }
.calc-log-highlight .calc-log-result strong { color: var(--accent); font-size: 14px; }
.calc-log-skipped { opacity: 0.45; }
.calc-log-label { font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.calc-log-formula {
  font-size: 11px; color: var(--text-muted); font-style: italic;
}
.calc-log-calc {
  font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 11px;
  color: var(--blue); background: var(--bg-tertiary); border-radius: 4px;
  padding: 2px 6px; display: inline-block; margin: 2px 0;
}
.calc-log-result { display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.calc-log-eq { color: var(--text-muted); font-size: 11px; }
.calc-log-result strong { color: var(--green); font-size: 13px; }
.calc-log-unit { font-size: 10px; color: var(--text-muted); }
.calc-log-note { font-size: 10px; color: var(--yellow); font-style: italic; }

/* ============ PRODUCT EDITOR ============ */
.editor-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
}

.editor-sidebar {
  position: sticky;
  top: calc(var(--topbar-height) + 28px);
}

.recipe-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}

.recipe-card-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.recipe-card-header h4 {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.recipe-card-body { padding: 12px 16px; }

.recipe-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.recipe-add-btn {
  width: 100%;
  padding: 8px;
  background: transparent;
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.recipe-add-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* ============ SIZE PRESETS ============ */
.size-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.size-preset {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.size-preset:hover { border-color: var(--accent); color: var(--accent); }
.size-preset.active { background: var(--accent-light); border-color: var(--accent); color: var(--accent); }

/* ============ PRODUCT LIST ============ */
.product-list-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  cursor: pointer;
}

.product-list-row:hover { background: var(--bg-hover); }

.product-list-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-xs);
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--accent);
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid transparent;
  transition: var(--transition);
}

.product-list-icon.has-image {
  background: rgba(0, 0, 0, 0.2);
  border-color: var(--border);
}

.product-list-info { flex: 1; min-width: 0; }
.product-list-info h4 { font-size: 14px; font-weight: 500; }
.product-list-info p { font-size: 12px; color: var(--text-muted); }

.product-list-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: var(--transition);
}

.product-list-row:hover .product-list-actions { opacity: 1; }

/* ============ ANIMATIONS ============ */
.fade-in { animation: fadeIn 0.25s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ PROCESS FORMULA ============ */
.formula-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  min-height: 28px;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: block; }
  .calc-layout { grid-template-columns: 1fr; }
  .editor-layout { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .page-container { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search-input input { width: 100%; }
  .form-row { grid-template-columns: 1fr; }
}

/* ============ UTILITY ============ */
.text-accent { color: var(--accent); }
.text-blue { color: var(--blue); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.flex { display: flex; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }
