/* ===================================================================
   SINQRA POS Backoffice – Dark Theme Styles
   =================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  color-scheme: dark;
  --bg: #0d1b2a;
  --surface: #1a2332;
  --surface2: #22303f;
  --border: #2d3f52;
  --primary: #0066FF;
  --primary-hover: #0052cc;
  --accent: #0066FF;
  --accent-h: #0052cc;
  --text: #e0e0e0;
  --text-muted: #7a9bba;
  --green: #0066FF;
  --red: #e06070;
}

html, body {
  overflow-x: hidden !important;
  max-width: 100vw !important;
  width: 100% !important;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════
   SYNQRA CUSTOM SCROLLBAR SYSTEM (NO WINDOWS GREY SCROLLBARS)
   ═══════════════════════════════════════════════════════════════ */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: rgba(13, 27, 42, 0.4);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  transition: background 0.2s;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary); /* #0066FF */
}

::-webkit-scrollbar-corner {
  background: transparent;
}

/* ---- LOGIN ---- */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: radial-gradient(ellipse at center, #1a2332 0%, #0d1b2a 70%);
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px 48px;
  width: 380px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.login-logo {
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}

.login-card h2 {
  text-align: center;
  font-size: 18px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* ---- APP LAYOUT ---- */
#app {
  display: flex;
  height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow: hidden !important;
}

.sidebar {
  width: 220px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-logo {
  font-size: 20px;
  font-weight: 700;
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 12px 0;
  flex: 1;
}

.nav-item {
  padding: 12px 20px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}

.nav-item:hover,
.nav-item.active {
  background: var(--surface2);
  color: var(--text);
  border-left-color: var(--accent);
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-label {
  font-size: 12px;
  color: var(--text-muted);
  word-break: break-all;
}

.main-content {
  flex: 1 1 0;
  min-width: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
  overflow-y: auto;
  overflow-x: hidden !important;
  padding: 24px;
  box-sizing: border-box !important;
}

/* ---- PAGES ---- */
.page {
  display: none;
}

.page.active {
  display: block;
}

.page.active.flex-page {
  display: flex !important;
  height: calc(100vh - 64px); /* 32px padding top+bottom from main-content */
}

.page h1 {
  font-size: 26px;
  font-weight: 600;
  margin-bottom: 24px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}

.page-header h1 {
  margin-bottom: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-actions .search-input {
  height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  box-sizing: border-box;
}

.header-actions .btn {
  height: 38px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  box-sizing: border-box;
}

/* ---- STATS ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card.premium {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s, box-shadow 0.2s;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

.stat-card.premium:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-content {
  flex: 1;
  min-width: 0 !important;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-cards-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  margin-top: 20px;
}

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

/* ---- TABLE ---- */
.table-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow-x: hidden !important;
  overflow-y: hidden;
  max-width: 100% !important;
  width: 100% !important;
  cursor: default !important;
  position: relative;
}

.table-wrapper:active {
  cursor: default !important;
}

.data-table {
  width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  background: var(--surface2);
  color: var(--text-muted);
  text-align: left;
  padding: 10px 8px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  box-sizing: border-box;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface2) !important;
  box-shadow: 0 1px 0 var(--border);
}

.data-table td {
  padding: 8px 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  white-space: nowrap;
  box-sizing: border-box;
}

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

.data-table tr:hover td {
  background: var(--surface2);
}

/* Dedicated Column Styling for Product Table */
.col-cb {
  width: 36px !important;
  min-width: 36px !important;
  max-width: 36px !important;
  text-align: center !important;
  padding: 8px 2px !important;
}

.col-id {
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  text-align: center !important;
  padding: 8px 2px !important;
}

.col-code {
  width: 58px !important;
  min-width: 58px !important;
  max-width: 58px !important;
  padding: 8px 4px !important;
}

.col-name {
  min-width: 140px !important;
  max-width: 0 !important;
  padding: 8px 8px !important;
}

.col-unit {
  width: 68px !important;
  min-width: 68px !important;
  max-width: 68px !important;
  text-align: center !important;
  padding: 8px 6px !important;
}

.col-stock {
  width: 86px !important;
  min-width: 86px !important;
  max-width: 86px !important;
  text-align: right !important;
  padding: 8px 12px 8px 6px !important;
}

.col-cost {
  width: 90px !important;
  min-width: 90px !important;
  max-width: 90px !important;
  text-align: right !important;
  padding: 8px 6px !important;
}

.col-price {
  width: 90px !important;
  min-width: 90px !important;
  max-width: 90px !important;
  text-align: right !important;
  padding: 8px 6px !important;
}

.col-margin {
  width: 56px !important;
  min-width: 56px !important;
  max-width: 56px !important;
  text-align: center !important;
  padding: 8px 2px !important;
}

.col-vat {
  width: 50px !important;
  min-width: 50px !important;
  max-width: 50px !important;
  text-align: center !important;
  padding: 8px 2px !important;
}

.col-barcode {
  width: 115px !important;
  min-width: 115px !important;
  max-width: 115px !important;
  padding: 8px 6px !important;
}

.col-active {
  width: 58px !important;
  min-width: 58px !important;
  max-width: 58px !important;
  text-align: center !important;
  padding: 8px 2px !important;
}

.col-actions {
  width: 110px !important;
  min-width: 110px !important;
  max-width: 110px !important;
  text-align: center !important;
  padding: 6px 2px !important;
  overflow: visible !important;
}

/* Products action column clean styling without sticky cutoff */
#page-products .data-table th:last-child,
#page-products .data-table td:last-child {
  text-align: center;
}

/* Termékkatalógus kiválasztott / aktív sor stílus (Bevételezés mintájára) */
#page-products .data-table tbody tr,
tr.active-product-row {
  cursor: pointer;
}

#page-products .data-table tr.active-product-row td,
.data-table tr.active-product-row td,
tr.active-product-row td {
  background: rgba(0, 102, 255, 0.16) !important;
  border-top: 1px solid rgba(0, 102, 255, 0.5) !important;
  border-bottom: 1px solid rgba(0, 102, 255, 0.5) !important;
}

#page-products .data-table tr.active-product-row td:first-child,
.data-table tr.active-product-row td:first-child,
tr.active-product-row td:first-child {
  border-left: 3px solid #0066FF !important;
}

#page-products .data-table tr.active-product-row:hover td,
.data-table tr.active-product-row:hover td,
tr.active-product-row:hover td {
  background: rgba(0, 102, 255, 0.24) !important;
}

/* ─────────────────────────────────────────────────────────────
   📦 TERMÉKKATALÓGUS: FIX ELRENDEZÉS ÉS BELSŐ GÖRGETÉS
   ───────────────────────────────────────────────────────────── */
.main-content.main-content-compact,
.main-content:has(#page-products.active) {
  padding: 8px 16px 8px 16px !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

/* Munkaállomás és lista oldalak: 100%-ban fix fejléc/lábléc és kizárólag belső görgetés (17. szabály) */
.main-content:has(#page-dashboard.active),
.main-content:has(#page-categories.active),
.main-content:has(#page-customers.active),
.main-content:has(#page-purchases.active),
.main-content:has(#page-invoices.active),
.main-content:has(#page-reports.active),
.main-content:has(#page-stock-history.active),
.main-content:has(#page-settings.active) {
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
}

#page-dashboard.active,
#page-categories.active,
#page-customers.active,
#page-invoices.active,
#page-reports.active,
#page-stock-history.active,
#page-settings.active {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 0 !important;
  min-height: 0 !important;
  height: 100% !important;
  overflow: hidden !important;
}

#page-dashboard .page-header,
#page-dashboard .stats-grid,
#page-categories .page-header,
#page-invoices .page-header,
#page-invoices .stats-grid,
#page-invoices > .card,
#page-reports .page-header,
#page-stock-history .page-header,
#page-settings .page-header {
  flex-shrink: 0 !important;
}

#page-categories .table-wrapper,
#page-invoices .table-wrapper,
#page-stock-history .table-wrapper {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

#page-dashboard .dashboard-cards-grid {
  flex: 1 1 0 !important;
  min-height: 0 !important;
}

#page-dashboard .dashboard-cards-grid > .card {
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

#page-dashboard .dashboard-cards-grid .card-title {
  flex-shrink: 0 !important;
}

#page-dashboard .dashboard-cards-grid .table-wrapper {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

#page-customers.active #customerDetailPane {
  overflow-y: auto !important;
}

#page-reports .page-scroll-body {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding-right: 4px;
}

#page-settings .settings-grid {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding-right: 4px;
  align-content: start;
}

#page-products.active {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 0 !important;
  min-height: 0 !important;
  height: 100% !important;
  margin: 0 !important;
  overflow: hidden !important;
}

#page-products .page-header {
  flex-shrink: 0;
  margin-bottom: 6px !important;
}

#page-products .stats-grid {
  flex-shrink: 0;
  gap: 8px !important;
  margin-bottom: 6px !important;
}

#page-products .stat-card.premium {
  padding: 6px 12px !important;
  gap: 8px !important;
}

#page-products > .card.product-filter-bar {
  flex-shrink: 0;
  padding: 5px 12px !important;
  margin-bottom: 6px !important;
  gap: 8px !important;
}

#page-products .table-wrapper {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  width: 100% !important;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
}

#page-products .data-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface2) !important;
  color: var(--text-muted);
  font-weight: 600;
  box-shadow: 0 1px 0 var(--border);
  padding: 6px 8px !important;
  font-size: 11.5px !important;
}

#page-products .data-table td {
  padding: 4px 8px !important;
  font-size: 12px !important;
  line-height: 1.25 !important;
}

#productPaginationBar {
  flex-shrink: 0 !important;
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 0 0 8px 8px !important;
  padding: 4px 16px !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px !important;
  color: var(--text-muted);
  box-sizing: border-box;
  margin: 0 !important;
  height: 38px !important;
}

/* Products Catalog Category Filter & Explorer Panel */
.prod-cat-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #0d1b2a;
  border: 1px solid #2d3f52;
  border-radius: 6px;
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
  color: #fff;
  cursor: pointer;
  transition: all 0.18s ease;
  max-width: 320px;
  user-select: none;
  outline: none;
}

.prod-cat-trigger-btn:hover {
  border-color: #0066FF;
  background: #112238;
}

.prod-cat-trigger-btn.has-filter {
  background: rgba(0, 102, 255, 0.14) !important;
  border-color: #0066FF !important;
  color: #60a5fa !important;
  font-weight: 600;
}

.prod-cat-trigger-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
  font-weight: 500;
}

.prod-cat-trigger-clear {
  display: none;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.15s ease;
  margin-left: 2px;
}

.prod-cat-trigger-clear:hover {
  background: #ef4444;
}

.prod-cat-trigger-btn.has-filter .prod-cat-trigger-clear {
  display: inline-flex;
}

.prod-cat-trigger-caret {
  color: #64748b;
  font-size: 10px;
  margin-left: auto;
  transition: transform 0.2s ease;
}

.prod-cat-trigger-btn.open .prod-cat-trigger-caret {
  transform: rotate(180deg);
}

/* Category Floating Dropdown Panel with Search at Top */
.prod-cat-dropdown-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 440px;
  min-width: 360px;
  max-width: 90vw;
  background: #0d1b2a;
  border: 1px solid #2d3f52;
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: prodCatFadeIn 0.15s ease-out;
}

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

.prod-cat-dropdown-search-wrap {
  padding: 8px 10px;
  background: #132235;
  border-bottom: 1px solid #2d3f52;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.prod-cat-dropdown-search-input {
  flex: 1;
  background: #0d1b2a;
  border: 1px solid #2d3f52;
  border-radius: 6px;
  padding: 6px 10px;
  color: #fff;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.prod-cat-dropdown-search-input:focus {
  border-color: #0066FF;
  box-shadow: 0 0 0 2px rgba(0, 102, 255, 0.25);
}

.prod-cat-dropdown-search-input::placeholder {
  color: #64748b;
  font-size: 12px;
}

.prod-cat-dropdown-search-clear {
  cursor: pointer;
  color: #94a3b8;
  font-size: 13px;
  padding: 2px 4px;
  transition: color 0.15s;
}

.prod-cat-dropdown-search-clear:hover {
  color: #fff;
}

.prod-cat-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #0d1b2a;
  border: 1px solid #2d3f52;
  border-radius: 6px;
  color: #cbd5e1;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  user-select: none;
}

.prod-cat-toggle-btn:hover {
  background: #1d3049;
  border-color: #0066FF;
  color: #fff;
}

.prod-cat-toggle-btn:active {
  transform: translateY(1px);
}

.cat-tree-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  cursor: pointer;
  color: #64748b;
  font-size: 10px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  margin-right: 2px;
}

.cat-tree-arrow:hover {
  color: #60a5fa;
  background: rgba(0, 102, 255, 0.15);
}

.prod-cat-dropdown-list {
  min-height: 220px;
  max-height: 380px;
  overflow-y: auto;
  padding: 4px 0;
  scrollbar-width: thin;
  scrollbar-color: #2d3f52 #0d1b2a;
}

.prod-cat-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 12px;
  font-size: 13px;
  color: #cbd5e1;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
  user-select: none;
  white-space: nowrap;
}

.prod-cat-dropdown-item:hover {
  background: rgba(0, 102, 255, 0.14);
  color: #fff;
}

.prod-cat-dropdown-item.selected {
  background: rgba(0, 102, 255, 0.25) !important;
  color: #60a5fa !important;
  font-weight: 700;
}

.prod-cat-dropdown-item.is-root {
  font-weight: 600;
  color: #e2e8f0;
}

.prod-cat-dropdown-item .item-count {
  font-size: 11px;
  color: #64748b;
  background: rgba(255, 255, 255, 0.05);
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: auto;
}

.prod-cat-dropdown-item.selected .item-count {
  color: #93c5fd;
  background: rgba(0, 102, 255, 0.3);
}

.prod-stock-pill {
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.prod-stock-pill:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.prod-stock-pill.active {
  background: #0066FF !important;
  color: #fff !important;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 102, 255, 0.35);
}

.sortable-th {
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, color 0.15s;
}
.sortable-th:hover {
  background: rgba(0, 102, 255, 0.12) !important;
  color: #fff !important;
}
.sort-indicator {
  display: inline-block;
  margin-left: 3px;
  font-size: 10px;
  color: #0066FF;
}

/* ---- TREE & SORTING ---- */
.tree-toggle {
  cursor: pointer;
  display: inline-block;
  width: 20px;
  text-align: center;
  user-select: none;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.tree-toggle:hover {
  color: var(--text);
}

.tree-toggle.collapsed {
  transform: rotate(-90deg);
}

.sortable-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: grab;
  user-select: none;
  transition: box-shadow 0.2s, background 0.2s;
}

.sortable-item:hover {
  background: var(--surface2);
}

.sortable-item.dragging {
  cursor: grabbing;
  opacity: 0.5;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  background: var(--surface2);
}

.sortable-actions button {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
}

.sortable-actions button:hover {
  color: var(--accent);
}

.tree-item {
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 4px;
  user-select: none;
}

.tree-item:hover {
  background: var(--surface);
}

.tree-item.selected {
  background: var(--accent);
  color: white;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.badge-green {
  background: #1a4030;
  color: #4caf80;
}

.badge-red {
  background: #3a1522;
  color: #e06070;
}

.badge-yellow {
  background: #3a2e10;
  color: #d4a040;
}

/* ---- INPUTS ---- */
.input-field {
  width: 100%;
  padding: 14px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

.input-field:focus {
  border-color: var(--accent);
}

.search-input {
  padding: 12px 18px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  width: 300px;
}

.search-input:focus {
  border-color: var(--accent);
}

/* ---- BUTTONS ---- */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary {
  background: var(--primary);
  border: 1px solid var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-block {
  width: 100%;
}

/* ---- MISC ---- */
.error-msg {
  color: #e06070;
  font-size: 13px;
  text-align: center;
  min-height: 18px;
}

/* ---- MODALS ---- */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(13, 27, 42, 0.85);
  /* Semi-transparent background matching --bg */
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 800px;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: var(--surface);
}

.modal-header h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.btn-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 24px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-shrink: 0;
  background: var(--surface);
}

/* ---- FORMS ---- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

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

.checkbox-group {
  flex-direction: row;
  align-items: center;
  gap: 16px;
  padding-top: 24px;
  /* Align with inputs */
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: normal;
  cursor: pointer;
}

/* ─── Backoffice Redesign (Tablet Parity) ─────────────────────────────────── */

.modal-content.large-modal {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  border-radius: 0;
  border: none;
  margin: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card-title {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Tabs */
.tab-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.tab-buttons {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 16px;
  gap: 8px;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: bold;
}

.tab-content {
  display: none;
  flex: 1;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Specific elements */
.profit-display {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 24px;
}

.profit-display.positive {
  color: var(--green);
}

.profit-display.negative {
  color: var(--red);
}

.vat-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.vat-btn {
  flex: 1;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.vat-btn.active {
  background: rgba(46, 204, 113, 0.1);
  border-color: var(--green);
  color: var(--green);
  font-weight: bold;
}

/* ─── Aronium-style 3-Panel Purchase Editor ───────────────────────────────── */

.pur-row-selected {
  background: rgba(180, 30, 50, 0.35) !important;
  color: var(--text) !important;
}

.pur-row-selected td {
  border-color: rgba(180, 30, 50, 0.5) !important;
}

#purchaseItemsBody tr:hover {
  background: var(--surface2);
  cursor: pointer;
}

#purchaseItemsBody tr.pur-row-selected:hover {
  background: rgba(180, 30, 50, 0.4) !important;
}

.pur-search-item:hover {
  background: var(--surface2);
}

/* Ensure purchase modal table header stays visible */
#purchaseItemsBody {
  border-collapse: separate;
}

/* Smooth transition for right panel visibility */
#pur_rightForm {
  transition: opacity 0.15s ease;
}

/* Premium Product Editor Enhancements */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--surface2);
  border: 1px solid var(--border);
  transition: .3s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 2px;
  background-color: var(--text-muted);
  transition: .3s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: var(--primary);
  border-color: var(--primary);
}

input:checked + .toggle-slider:before {
  transform: translateX(20px);
  background-color: white;
}

.input-group {
  display: flex;
  align-items: center;
}

.input-group .input-field {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  flex: 1;
}

.input-group .btn-append {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-left: none;
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
  padding: 8.5px 12px;
  color: var(--primary);
  cursor: pointer;
  font-weight: 500;
  font-size: 13px;
  transition: filter 0.2s;
}

.input-group .btn-append:hover {
  filter: brightness(1.2);
}

/* ─── Customer 2-Pane Editor UI ───────────────────────────────────────────── */

.customer-tabs {
  background: var(--surface2);
  border-radius: 8px;
  overflow: hidden;
  display: inline-flex;
}

.customer-tabs .tab-btn {
  background: transparent;
  color: var(--text-muted);
  border: none;
  font-size: 14px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.customer-tabs .tab-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.customer-tabs .tab-btn.active {
  background: var(--surface);
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border-radius: 6px;
}

.customer-list-item {
  border: 1px solid transparent;
  position: relative;
}

.customer-list-item:hover {
  background: var(--surface2) !important;
}

.customer-list-item.active {
  border-color: rgba(0, 102, 255, 0.45);
  background: rgba(0, 102, 255, 0.14) !important;
}

.customer-list-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10%;
  bottom: 10%;
  width: 3px;
  background: var(--primary);
  border-radius: 0 4px 4px 0;
}
.fullscreen-override { width: 100vw !important; max-width: 100vw !important; height: 100vh !important; max-height: 100vh !important; margin: 0 !important; border-radius: 0 !important; }

/* ─── Reporting Styles ────────────────────────────────────────────────────── */

#page-reports .card {
    background: var(--surface);
    border: 1px solid var(--border);
}

#page-reports .stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 1024px) {
    #page-reports .stats-grid {
        grid-template-columns: 1fr;
    }
}

.report-payment-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--surface2);
    border-radius: 8px;
    border-left: 4px solid var(--accent);
}

.report-payment-row .pm-label {
    font-weight: 600;
}

.report-payment-row .pm-value {
    font-size: 16px;
    font-weight: bold;
    color: var(--text);
}

#reportEmpty {
    transition: all 0.3s ease;
}

/* --- Ultra Premium Reporting Styles --- */
.skeleton-shimmer {
  background: var(--surface2);
  background-image: linear-gradient(90deg, var(--surface2) 0px, var(--border) 40px, var(--surface2) 80px);
  background-size: 600px;
  animation: shimmer 1.5s infinite linear;
}
@keyframes shimmer {
  0% { background-position: -300px; }
  100% { background-position: 300px; }
}

.drill-down-row {
  background: rgba(0,0,0,0.15) !important;
  border-top: none;
}
.drill-down-table {
  width: 100%;
  background: var(--surface2);
  border-radius: 8px;
  overflow: hidden;
  margin: 8px 0;
  border-collapse: collapse;
}
.drill-down-table th {
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  padding: 8px 12px;
  text-align: left;
}
.drill-down-table td {
  padding: 8px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}

.clickable-row {
  cursor: pointer;
  transition: background 0.2s;
}
.clickable-row:hover {
  background: var(--surface2) !important;
}

.export-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.export-btn:hover {
  background: var(--surface);
  border-color: var(--primary);
}


/* ═══════════════════════════════════════════════════════════════
   SETTINGS PAGE (SYNQRA STYLING)
   ═══════════════════════════════════════════════════════════════ */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 20px;
  margin-top: 16px;
}
.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.settings-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}
.settings-card-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.settings-card-header .badge {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════════════════════════
   ADVANCED STOCK RECEIPT WORKBENCH (2-COLUMN TG PWA ENGINE)
   ═══════════════════════════════════════════════════════════════ */
.adv-workbench-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 26, 0.95);
  backdrop-filter: blur(8px);
  z-index: 900;
  display: flex;
  flex-direction: column;
}
.adv-workbench-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}
.adv-workbench-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  background: var(--bg);
  position: relative;
}
.adv-left-col {
  width: 52%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
.adv-right-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  padding: 18px 20px;
}

/* Splitter Resizer Handle between workbench columns */
.workbench-resizer {
  width: 8px;
  background: var(--border);
  cursor: col-resize;
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  flex-shrink: 0;
  transition: background 0.15s;
}
.workbench-resizer::after {
  content: '';
  width: 2px;
  height: 36px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: background 0.15s, height 0.15s;
}
.workbench-resizer:hover,
.workbench-resizer.is-dragging {
  background: var(--primary); /* #0066FF */
}
.workbench-resizer:hover::after,
.workbench-resizer.is-dragging::after {
  background: #ffffff;
  height: 52px;
}

/* ═══════════════════════════════════════════════════════════════
   SYNQRA CENTER POP-IN DIALOG SYSTEM
   ═══════════════════════════════════════════════════════════════ */
.synqra-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 26, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.synqra-dialog-card {
  background: #1a2332;
  border: 1px solid var(--border);
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(0, 102, 255, 0.25);
  border-radius: 16px;
  width: 440px;
  max-width: 92vw;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: synqraPopIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes synqraPopIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.synqra-dialog-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(0, 102, 255, 0.12);
  border: 1px solid rgba(0, 102, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #60a5fa;
  margin: 0 auto;
}

.synqra-dialog-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
}

.synqra-dialog-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.synqra-dialog-message {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
  white-space: pre-line;
  word-break: break-word;
}

.synqra-dialog-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 6px;
}

.synqra-dialog-actions button {
  flex: 1;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
}

/* Items list table & selection */
.adv-items-table {
  width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse;
}
.adv-items-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface2) !important;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 1px 0 var(--border);
}
.adv-items-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.adv-item-row {
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.adv-item-row:hover {
  background: rgba(255, 255, 255, 0.03);
}
.adv-item-row.selected {
  background: rgba(33, 150, 243, 0.15) !important;
  border-left: 4px solid #2196f3;
}
.adv-item-row.mapped-row {
  background: rgba(42, 122, 78, 0.05);
}

/* Fuzzy suggestion cards */
.fuzzy-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 8px;
}
.fuzzy-card:hover {
  border-color: #2196f3;
  transform: translateY(-1px);
  background: rgba(33, 150, 243, 0.1);
}
.score-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}
.score-high { background: rgba(42,122,78,0.2); color: #4caf50; border: 1px solid #4caf50; }
.score-med { background: rgba(255,152,0,0.2); color: #ff9800; border: 1px solid #ff9800; }

/* Price diff box */
.price-diff-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  text-align: center;
}
.price-diff-item .lbl {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.price-diff-item .val {
  font-size: 16px;
  font-weight: 700;
}

/* Floating Tray Dock (Tálca) */
.workbench-tray-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column-reverse;
  gap: 12px;
  pointer-events: none;
}

.receipt-tray-dock {
  background: #1e293b;
  border: 2px solid var(--primary);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  border-radius: 12px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  pointer-events: auto;
  animation: pulseTray 2s infinite;
  transition: transform 0.15s, border-color 0.15s;
}
.receipt-tray-dock:hover {
  transform: translateY(-2px);
  border-color: #3b82f6;
}
@keyframes pulseTray {
  0% { box-shadow: 0 0 0 0 rgba(0, 102, 255, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(0, 102, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 102, 255, 0); }
}

/* ─────────────────────────────────────────────────────────────────────────────
   Category Workbench (Kategória & Termékcsoport Szervező Munkapad)
   ───────────────────────────────────────────────────────────────────────────── */

.cw-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.cw-col-left {
  flex: 0 0 52%;
  min-width: 380px;
  max-width: 75%;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow: hidden;
}

.cw-col-right {
  flex: 1;
  min-width: 360px;
  display: flex;
  flex-direction: column;
  background: var(--surface2);
  overflow-y: auto;
  padding: 16px;
  gap: 16px;
}

.cw-toolbar {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cw-filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.cw-filter-btn {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.cw-filter-btn:hover {
  color: var(--text);
  border-color: #0066FF;
}

.cw-filter-btn.active {
  background: #0066FF;
  color: #fff;
  border-color: #0066FF;
  font-weight: 600;
}

.cw-list-container {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cw-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--surface2);
  border: 1px solid transparent;
  transition: all 0.15s;
  user-select: none;
}

.cw-item:hover {
  background: rgba(0, 102, 255, 0.08);
  border-color: rgba(0, 102, 255, 0.25);
}

.cw-item.selected {
  background: rgba(0, 102, 255, 0.15);
  border-color: #0066FF;
}

.cw-item.dragging {
  opacity: 0.35;
  border: 2px dashed #0066FF;
}

.cw-item.drag-over {
  background: rgba(0, 102, 255, 0.25);
  border: 2px dashed #0066FF !important;
  transform: scale(1.01);
}

.cw-drag-handle {
  cursor: grab;
  color: var(--text-muted);
  font-size: 14px;
  padding: 0 4px;
}

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

.cw-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.cw-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.cw-card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.cw-pillar-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.cw-pillar-card:hover {
  border-color: #0066FF;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 102, 255, 0.25);
}

.cw-pillar-card.drag-over {
  border: 2px dashed #0066FF;
  background: rgba(0, 102, 255, 0.2);
  transform: scale(1.03);
}

.cw-badge-pill {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.cw-action-mini-btn {
  padding: 3px 8px;
  font-size: 11px;
  border-radius: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}

.cw-action-mini-btn:hover {
  border-color: #0066FF;
  color: #0066FF;
}

.cw-action-mini-btn.danger {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
}
.cw-action-mini-btn.danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #fca5a5;
}

.cw-action-mini-btn.primary {
  color: #60a5fa;
  border-color: rgba(0, 102, 255, 0.4);
}
.cw-action-mini-btn.primary:hover {
  background: rgba(0, 102, 255, 0.15);
  border-color: #0066FF;
  color: #fff;
}

/* ─── Multi-Barcode Tags ─── */
.barcode-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  transition: all 0.15s;
}

.barcode-chip.primary {
  background: rgba(0, 102, 255, 0.18);
  border: 1px solid #0066FF;
}

.barcode-chip.secondary {
  background: var(--surface2);
  border: 1px solid var(--border);
}

.barcode-chip:hover {
  border-color: #0066FF;
}



/* ─── Product Image Upload & Preview ─── */
.product-img-box {
  width: 120px;
  height: 120px;
  border-radius: 12px;
  border: 2px dashed rgba(0, 102, 255, 0.4);
  background: rgba(0, 102, 255, 0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.product-img-box:hover {
  border-color: #0066FF;
  background: rgba(0, 102, 255, 0.08);
}

.product-img-box.has-image {
  border-style: solid;
  border-color: var(--border);
  background: #0d1b2a;
}

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

.product-img-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 26, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.2s;
}

.product-img-box:hover .product-img-overlay {
  opacity: 1;
}

/* ─── SYNQRA Képsegéd Modul Styling ─── */
.btn-kepseged-pro {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 120px;
  height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, rgba(47, 107, 255, 0.25) 0%, rgba(0, 102, 255, 0.35) 100%);
  border: 1px solid rgba(47, 107, 255, 0.55);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  box-shadow: 0 2px 8px rgba(0, 102, 255, 0.25);
}

.btn-kepseged-pro:hover {
  background: linear-gradient(135deg, rgba(47, 107, 255, 0.4) 0%, rgba(0, 102, 255, 0.5) 100%);
  border-color: #2F6BFF;
  box-shadow: 0 0 14px rgba(47, 107, 255, 0.45);
  transform: translateY(-1px);
}

.kepseged-pro-badge {
  background: linear-gradient(135deg, #2F6BFF, #0066FF);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  display: inline-block;
  line-height: 1;
}

.kepseged-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  max-height: 440px;
  overflow-y: auto;
  padding: 6px 2px;
}

.kepseged-card {
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
  border: 2px solid transparent;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.kepseged-card:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: #0066FF;
  box-shadow: 0 8px 20px rgba(0, 102, 255, 0.4);
}

.kepseged-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.kepseged-card .select-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 102, 255, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s;
  font-weight: 700;
  font-size: 11px;
}

.kepseged-card:hover .select-overlay {
  opacity: 1;
}

/* ─── SYNQRA AI Studio Pro Styling ─── */
.btn-ai-pro {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 120px;
  height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #e0e7ff;
  background: linear-gradient(135deg, rgba(0, 102, 255, 0.18) 0%, rgba(124, 58, 237, 0.28) 100%);
  border: 1px solid rgba(124, 58, 237, 0.55);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.2);
}

.btn-ai-pro:hover {
  background: linear-gradient(135deg, rgba(0, 102, 255, 0.3) 0%, rgba(124, 58, 237, 0.45) 100%);
  border-color: #a855f7;
  box-shadow: 0 0 14px rgba(124, 58, 237, 0.45);
  transform: translateY(-1px);
  color: #fff;
}

.ai-pro-badge {
  background: linear-gradient(135deg, #7c3aed, #0066FF);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  display: inline-block;
  line-height: 1;
}

.ai-pricing-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s;
}

.ai-pricing-card.popular {
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.45);
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.15);
}

.ai-pricing-card:hover {
  transform: translateY(-2px);
  border-color: rgba(124, 58, 237, 0.6);
}

.ai-style-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.ai-style-option:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(124, 58, 237, 0.4);
}

.ai-style-option.active {
  background: rgba(124, 58, 237, 0.16);
  border-color: #a855f7;
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.25);
}

.ai-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(124, 58, 237, 0.2);
  border-top-color: #a855f7;
  border-radius: 50%;
  animation: ai-spin 0.9s linear infinite;
}

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

/* ─────────────────────────────────────────────────────────────
   📦 BEVÉTELEZÉSEK: FIX FEJLÉC ÉS 100% ILLESZKEDÉS (NINCS OLDALRA GÖRGETÉS)
   ───────────────────────────────────────────────────────────── */
#page-purchases.active {
  display: flex !important;
  flex-direction: column;
  height: calc(100vh - 48px);
  overflow: hidden !important;
}

#page-purchases .page-header,
#page-purchases > .card {
  flex-shrink: 0;
}

.purchases-table-wrapper {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100% !important;
  cursor: default !important;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.purchases-data-table {
  width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse;
  font-size: 12px;
}

.purchases-data-table th,
.purchases-data-table td {
  padding: 8px 10px !important;
  font-size: 12px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
  box-sizing: border-box;
}

.purchases-data-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface2) !important;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 1px 0 var(--border);
}

.purchases-data-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.purchases-data-table tr:last-child td {
  border-bottom: none;
}

.purchases-data-table th:last-child,
.purchases-data-table td:last-child {
  width: 180px !important;
  text-align: right !important;
  padding-right: 16px !important;
}

.purchases-data-table tr.active-invoice-row td {
  background: rgba(0, 102, 255, 0.12) !important;
  border-top: 1px solid rgba(0, 102, 255, 0.45) !important;
  border-bottom: 1px solid rgba(0, 102, 255, 0.45) !important;
}

.purchases-data-table tr.active-invoice-row td:first-child {
  border-left: 3px solid #0066FF !important;
}

.cell-ellipsis {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.pur-date-filter-box {
  height: 42px;
  min-height: 42px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  border-radius: 6px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pur-date-filter-box:focus-within {
  border-color: #0066FF !important;
  box-shadow: 0 0 0 2px rgba(0, 102, 255, 0.25);
}

/* Lenyitható állapot szűrő (Bevételezések) - kizárólag sötét téma */
.pur-status-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  padding: 6px 14px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pur-status-trigger-btn.is-pending {
  border-color: #ff9800 !important;
  color: #ff9800;
}

.pur-status-trigger-btn.is-saved {
  border-color: #0066FF !important;
  color: #60a5fa;
}

.pur-status-trigger-btn.is-received {
  border-color: #4caf50 !important;
  color: #4caf50;
}

.pur-status-trigger-btn.is-pending.active {
  background: rgba(255, 152, 0, 0.14) !important;
  border-color: #ff9800 !important;
  color: #ffb74d;
  box-shadow: 0 0 0 1px rgba(255, 152, 0, 0.35);
}

.pur-status-trigger-btn.is-saved.active {
  background: rgba(0, 102, 255, 0.18) !important;
  border-color: #0066FF !important;
  color: #93c5fd;
  box-shadow: 0 0 0 1px rgba(0, 102, 255, 0.35);
}

.pur-status-trigger-btn.is-received.active {
  background: rgba(76, 175, 80, 0.14) !important;
  border-color: #4caf50 !important;
  color: #66bb6a;
  box-shadow: 0 0 0 1px rgba(76, 175, 80, 0.35);
}

.pur-status-trigger-btn.is-all-status {
  border-color: #2d3f52 !important;
  color: #e2e8f0;
}

.pur-status-trigger-btn.is-all-status.active {
  background: rgba(0, 102, 255, 0.18) !important;
  border-color: #0066FF !important;
  color: #ffffff;
  box-shadow: 0 0 0 1px rgba(0, 102, 255, 0.35);
}

.pur-status-caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
  padding-left: 7px;
  margin-left: 4px;
  opacity: 0.9;
  transition: transform 0.18s ease;
}

.pur-status-trigger-btn.is-open .pur-status-caret svg {
  transform: rotate(180deg);
}

.pur-status-caret svg {
  transition: transform 0.18s ease;
}

.pur-status-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 235px;
  background: #0d1b2a;
  border: 1px solid #2d3f52;
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
  z-index: 250;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pur-status-option {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  background: #162436;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #e2e8f0;
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.pur-status-option:hover {
  background: #1e3148;
  border-color: #2d3f52;
  color: #ffffff;
}

.pur-status-option.active {
  background: rgba(0, 102, 255, 0.2);
  border-color: #0066FF;
  color: #ffffff;
}

.pur-status-option[data-status-key="PENDING"].active {
  background: rgba(255, 152, 0, 0.16);
  border-color: #ff9800;
}

.pur-status-option[data-status-key="SAVED"].active {
  background: rgba(0, 102, 255, 0.2);
  border-color: #0066FF;
}

.pur-status-option[data-status-key="RECEIVED"].active {
  background: rgba(76, 175, 80, 0.16);
  border-color: #4caf50;
}

.pur-opt-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.pur-opt-count {
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 2px 8px;
  border-radius: 999px;
  background: #0d1b2a;
  border: 1px solid #2d3f52;
  color: #cbd5e1;
}

/* ─────────────────────────────────────────────────────────────
   📅 SINQRA DARK DATEPICKER (100% SÖTÉT TÉMA, NULLA FEHÉR POPUP)
   ───────────────────────────────────────────────────────────── */
.pur-date-input-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #0d1b2a;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 10px;
  height: 30px;
  box-sizing: border-box;
  font-size: 12px;
  color: #fff;
  cursor: pointer;
  user-select: none;
  font-variant-numeric: tabular-nums;
  transition: all 0.15s ease;
}

.pur-date-input-box:hover {
  border-color: #0066FF;
  background: #13243a;
}

.pur-date-val {
  color: #fff;
  font-size: 12px;
}

.pur-date-val.empty {
  color: #6c8299;
  font-size: 11px;
}

.pur-cal-icon {
  font-size: 11px;
  opacity: 0.7;
}

.sinqra-date-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #0d1b2a;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 3px 8px;
  font-size: 11px;
  color: #fff;
  cursor: pointer;
  user-select: none;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.15s ease, background 0.15s ease;
  min-width: 72px;
  justify-content: center;
}

.sinqra-date-btn:hover {
  border-color: #0066FF;
  background: #142234;
}

.sinqra-date-btn.active {
  border-color: #0066FF;
  box-shadow: 0 0 0 2px rgba(0, 102, 255, 0.3);
}

.sinqra-dark-calendar {
  position: fixed;
  z-index: 100050;
  width: 256px;
  background: #162436;
  border: 1px solid #2d3f52;
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.85);
  font-family: inherit;
  user-select: none;
  box-sizing: border-box;
}

.sdc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sdc-title {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.3px;
}

.sdc-nav {
  background: transparent;
  border: 1px solid #2d3f52;
  color: #8899a6;
  border-radius: 5px;
  width: 24px;
  height: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  transition: all 0.15s ease;
  line-height: 1;
  padding: 0;
}

.sdc-nav:hover {
  background: #0066FF;
  border-color: #0066FF;
  color: #fff;
}

.sdc-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: #8899a6;
  margin-bottom: 6px;
}

.sdc-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.sdc-day {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 500;
  color: #e0e6ed;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease;
}

.sdc-day:hover {
  background: rgba(0, 102, 255, 0.25);
  color: #fff;
}

.sdc-day.other-month {
  color: #43546a;
}

.sdc-day.today {
  border: 1px solid #0066FF;
  font-weight: 700;
}

.sdc-day.selected {
  background: #0066FF !important;
  color: #ffffff !important;
  font-weight: 700;
}

.sdc-footer {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sdc-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid #2d3f52;
  color: #cbd5e1;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.sdc-btn-close {
  background: #0066FF;
  border-color: #0066FF;
  color: #fff;
}

.sdc-btn-close:hover {
  background: #0052cc;
}

/* ─────────────────────────────────────────────────────────────
   🖨️ PRINT RULES (Tiszta, papírbarát nyomtatás)
   ───────────────────────────────────────────────────────────── */
@media print {
  .sidebar, .nav-btn, .btn, .search-box, .pur-date-filter-box,
  #receiptTrayDock, .sdc-popup, .adv-workbench-overlay, #quickProductCreateModal, #invoicePreviewModal {
    display: none !important;
  }
  body, .main-content, .page {
    background: #fff !important;
    color: #000 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }
}

/* ─────────────────────────────────────────────────────────────
   ✨ SYNQRA QUICK PRODUCT CREATE MODAL (ÚJ TERMÉK GYORS FELVITELE)
   ───────────────────────────────────────────────────────────── */
.qp-modal-container {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  margin: 0 !important;
  overflow: hidden;
  background: linear-gradient(180deg, #0f172a 0%, #090e1a 100%);
  border: none !important;
  box-shadow: none !important;
  display: flex;
  flex-direction: column;
}

/* Teljes képernyős munkapanelek kényszerítése (Szabályzat 6. pont) */
#synqraKepsegedModal .modal-content,
#categoryModal .modal-content,
#customerModal .modal-content,
#categoryProductsModal .modal-content,
#sortingModal .modal-content {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  margin: 0 !important;
  display: flex;
  flex-direction: column;
}

#synqraKepsegedModal .modal-content > div:nth-child(2) {
  flex: 1 !important;
  max-height: none !important;
}

.qp-modal-header {
  padding: 18px 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, rgba(0, 102, 255, 0.12) 0%, rgba(16, 185, 129, 0.08) 100%);
  flex-shrink: 0;
}

.qp-header-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(0, 102, 255, 0.25));
  border: 1px solid rgba(16, 185, 129, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.qp-source-badge {
  background: rgba(16, 185, 129, 0.16);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.qp-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.qp-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fff;
}

.qp-modal-body {
  padding: 24px 32px;
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 24px;
  overflow-y: auto;
  flex: 1;
}

.qp-photo-col {
  background: rgba(19, 28, 49, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.qp-data-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.qp-card {
  background: rgba(19, 28, 49, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 20px 24px;
}

.qp-section-title {
  font-size: 12px;
  font-weight: 800;
  color: #cbd5e1;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.qp-field-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 7px;
}

.qp-image-box {
  width: 100%;
  flex: 1;
  min-height: 220px;
  max-height: 340px;
  border-radius: 10px;
  background: #070b14;
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.qp-image-box:hover {
  border-color: #2F6BFF;
  box-shadow: 0 0 0 2px rgba(47, 107, 255, 0.2);
}

.qp-image-box.has-image .product-img-overlay {
  display: flex;
}

.qp-image-placeholder {
  text-align: center;
  padding: 14px;
}

.qp-kepseged-cta-link {
  font-size: 11px;
  color: #10b981;
  font-weight: 700;
  text-decoration: underline;
  margin-top: 5px;
  cursor: pointer;
  transition: color 0.15s ease;
}

.qp-kepseged-cta-link:hover {
  color: #34d399;
}

.qp-photo-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.qp-btn-kepseged {
  flex: 1;
  height: 36px;
  padding: 0 10px !important;
  font-size: 12px !important;
  border-radius: 8px !important;
  justify-content: center;
}

.qp-photo-sub-btn {
  height: 36px;
  padding: 0 11px;
  border-radius: 8px;
  background: rgba(47, 107, 255, 0.14);
  border: 1px solid rgba(47, 107, 255, 0.35);
  color: #93c5fd;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.qp-photo-sub-btn:hover {
  background: rgba(47, 107, 255, 0.28);
  border-color: #2F6BFF;
  color: #fff;
}

.qp-photo-folder-btn {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  padding: 0 10px;
}

.qp-paste-hint {
  font-size: 10.5px;
  color: #64748b;
  text-align: center;
  margin-top: 10px;
}

.qp-paste-hint kbd {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  padding: 1px 5px;
  color: #cbd5e1;
  font-family: inherit;
  font-weight: 700;
  font-size: 10px;
}

.qp-kepseged-info-card {
  margin-top: auto;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 10px;
  padding: 12px;
}

.qp-kepseged-status-line {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 11px;
  font-weight: 700;
  color: #10b981;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: opacity 0.15s ease;
}

.qp-kepseged-status-line:hover {
  opacity: 0.85;
  text-decoration: underline;
}

.qp-grid-alapadatok {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 16px;
}

.qp-grid-codes {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 18px;
}

.qp-grid-pricing {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 22px;
}

.qp-input,
.qp-input-lg {
  background: #070b14 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 8px !important;
  color: #ffffff !important;
  height: 40px;
  padding: 0 12px !important;
  font-size: 13.5px !important;
  box-sizing: border-box;
  width: 100%;
}

.qp-input-lg {
  font-size: 14.5px !important;
  font-weight: 700 !important;
}

.qp-input:focus,
.qp-input-lg:focus {
  border-color: #2F6BFF !important;
  box-shadow: 0 0 0 2px rgba(47, 107, 255, 0.25) !important;
}

.qp-cat-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #070b14;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  height: 40px;
  padding: 0 12px;
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}

.qp-cat-input-wrap:focus-within {
  border-color: #2F6BFF;
  box-shadow: 0 0 0 2px rgba(47, 107, 255, 0.25);
}

.qp-cat-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  width: 100%;
}

.qp-cat-search-input::placeholder {
  color: #64748b;
  font-weight: 500;
}

.qp-category-dropdown {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  background: #131c31;
  border: 1px solid rgba(47, 107, 255, 0.45);
  border-radius: 10px;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.8);
  max-height: 240px;
  overflow-y: auto;
  z-index: 200;
  padding: 6px 0;
}

.qp-cat-option {
  padding: 8px 14px;
  font-size: 13px;
  color: #e2e8f0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.12s ease;
}

.qp-cat-option:hover,
.qp-cat-option.selected {
  background: rgba(47, 107, 255, 0.2);
  color: #ffffff;
}

.qp-action-btn {
  height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.qp-btn-blue {
  background: rgba(47, 107, 255, 0.18);
  border: 1px solid rgba(47, 107, 255, 0.45);
  color: #60a5fa;
}

.qp-btn-blue:hover {
  background: #2F6BFF;
  color: #fff;
}

.qp-btn-indigo {
  background: rgba(139, 92, 246, 0.18);
  border: 1px solid rgba(139, 92, 246, 0.45);
  color: #c4b5fd;
}

.qp-btn-indigo:hover {
  background: #7c3aed;
  color: #fff;
}

.qp-barcode-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.qp-invoice-summary-box {
  background: #070b14;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.qp-inv-sum-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #94a3b8;
}

.qp-margin-badge {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
}

.qp-currency-input-wrap {
  display: flex;
  align-items: center;
  background: #070b14;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  height: 40px;
  padding: 0 12px;
  box-sizing: border-box;
}

.qp-currency-input-wrap:focus-within {
  border-color: #2F6BFF;
  box-shadow: 0 0 0 2px rgba(47, 107, 255, 0.25);
}

.qp-currency-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  width: 100%;
}

.qp-currency-suffix {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  margin-left: 6px;
}

.qp-mult-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr) 172px;
  gap: 6px;
}

.qp-mult-btn {
  height: 42px;
  border-radius: 7px;
  background: #070b14;
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #cbd5e1;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.qp-mult-btn:hover {
  border-color: #2F6BFF;
  color: #fff;
}

.qp-mult-btn.active {
  background: #2F6BFF;
  border-color: #2F6BFF;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(47, 107, 255, 0.4);
}

.qp-mult-hint {
  font-size: 10.5px;
  font-weight: 600;
  color: #60a5fa;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.qp-custom-mult-wrap {
  display: flex;
  align-items: stretch;
  background: rgba(47, 107, 255, 0.08);
  border: 1.5px dashed rgba(96, 165, 250, 0.7);
  border-radius: 7px;
  height: 42px;
  padding: 0;
  box-sizing: border-box;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.qp-custom-mult-wrap:focus-within {
  border-style: solid;
  border-color: #2F6BFF;
  box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.25);
}

.qp-mult-step {
  flex: 0 0 38px;
  width: 38px;
  border: none;
  background: rgba(47, 107, 255, 0.18);
  color: #93c5fd;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.qp-mult-step:hover {
  background: #2F6BFF;
  color: #fff;
}

.qp-mult-step:active {
  background: #1d4ed8;
  color: #fff;
}

.qp-custom-mult-center {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.qp-custom-mult-caption {
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #60a5fa;
  line-height: 1;
  margin-bottom: 1px;
}

.qp-custom-mult-inputrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
}

.qp-custom-mult-inputrow input {
  width: 52px;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-align: right;
  padding: 0;
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Natív mini fel-le nyilak elrejtése – helyette nagy − / + gombok */
.qp-custom-mult-inputrow input::-webkit-outer-spin-button,
.qp-custom-mult-inputrow input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qp-custom-mult-inputrow span {
  font-size: 12px;
  color: #93c5fd;
  font-weight: 700;
}

.qp-retail-input-wrap {
  display: flex;
  align-items: center;
  background: rgba(16, 185, 129, 0.08);
  border: 1.5px solid #10b981;
  border-radius: 10px;
  height: 48px;
  padding: 0 16px;
  box-sizing: border-box;
  transition: box-shadow 0.15s ease;
}

.qp-current-retail-wrap {
  display: flex;
  align-items: center;
  background: rgba(47, 107, 255, 0.08);
  border: 1.5px solid rgba(47, 107, 255, 0.45);
  border-radius: 10px;
  height: 48px;
  padding: 0 14px;
  box-sizing: border-box;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.qp-current-retail-wrap:hover {
  background: rgba(47, 107, 255, 0.16);
  border-color: #2F6BFF;
  box-shadow: 0 0 0 2px rgba(47, 107, 255, 0.25);
}

.qp-current-retail-val {
  flex: 1;
  color: #ffffff;
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.qp-current-retail-suffix {
  font-size: 13px;
  font-weight: 700;
  color: #60a5fa;
  margin-left: 6px;
}

.qp-apply-price-pill {
  margin-left: 8px;
  background: #2F6BFF;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 5px;
  white-space: nowrap;
}

.qp-retail-input-wrap:focus-within {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

.qp-retail-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #10b981;
  font-size: 22px;
  font-weight: 800;
  width: 100%;
}

.qp-retail-suffix {
  font-size: 14px;
  font-weight: 700;
  color: #10b981;
  margin-left: 8px;
}

.qp-modal-footer {
  padding: 14px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(7, 11, 20, 0.85);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.qp-cancel-btn {
  padding: 10px 26px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

.qp-save-btn {
  padding: 11px 28px !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  border-radius: 10px !important;
  background: linear-gradient(135deg, #2F6BFF 0%, #0066FF 100%) !important;
  border: 1px solid #60a5fa !important;
  color: #ffffff !important;
  box-shadow: 0 4px 18px rgba(0, 102, 255, 0.4) !important;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.qp-save-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════════════
   CONFIDENTIAL DATA PRIVACY & ROLE BASED ACCESS CONTROL (RBAC)
   ═══════════════════════════════════════════════════════════════ */
body.hide-cost-and-margin .col-cost,
body.hide-cost-and-margin .col-margin,
body.hide-cost-and-margin #prodKpiCostCard,
body.hide-cost-and-margin #prodKpiMarginCard,
body.hide-cost-and-margin .confidential-cost-margin {
  display: none !important;
}

body.hide-financials .confidential-financial {
  display: none !important;
}

body.readonly-products .btn-edit-product,
body.readonly-products .btn-delete-product,
body.readonly-products #prodBulkActionBar,
body.readonly-products #btnNewProductTop {
  display: none !important;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE MULTI-PLATFORM SYSTEM (DESKTOP, TABLET, PHONE)
   ═══════════════════════════════════════════════════════════════ */

/* Compact Icon Buttons */
.btn-icon-sm {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  vertical-align: middle !important;
  border-radius: 6px !important;
}

/* Mobile Top Navigation Bar (Hidden by default on Desktop) */
.mobile-top-bar {
  display: none;
  height: 52px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1100;
  flex-shrink: 0;
  box-sizing: border-box;
  width: 100%;
}

.mobile-menu-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: #fff;
  border-radius: 8px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
  line-height: 1;
}

.mobile-menu-btn:hover,
.mobile-menu-btn:active {
  background: var(--surface2);
  border-color: #0066FF;
  color: #0066FF;
}

.mobile-top-logo {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.mobile-page-title {
  font-size: 13px;
  font-weight: 600;
  color: #93c5fd;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Drawer Backdrop */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(3px);
  z-index: 9990;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.sidebar-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ─── TABLET & SMALL LAPTOP (max-width: 1024px) ─── */
@media (max-width: 1024px) {
  #app {
    flex-direction: column !important;
  }

  .mobile-top-bar {
    display: flex !important;
  }

  .sidebar-backdrop {
    display: block;
  }

  .sidebar {
    position: fixed !important;
    top: 0;
    left: 0;
    bottom: 0;
    width: 270px !important;
    height: 100vh !important;
    z-index: 10000 !important;
    background: #0d1b2a !important;
    border-right: 1px solid var(--border) !important;
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.7) !important;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .sidebar.mobile-open {
    transform: translateX(0) !important;
  }

  #sidebarCloseBtn {
    display: inline-flex !important;
  }

  .main-content {
    padding: 16px !important;
    height: calc(100vh - 52px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
  }

  .main-content:has(.page.active) {
    overflow-y: auto !important;
  }

  .page.active {
    height: auto !important;
    overflow: visible !important;
  }

  .page-header {
    position: sticky;
    top: -16px;
    z-index: 25;
    background: var(--bg);
    padding: 10px 0 12px 0;
    margin-bottom: 12px !important;
  }

  /* Hide secondary table columns on Tablet */
  .col-code,
  .col-unit,
  .col-vat {
    display: none !important;
  }

  /* Stats grid: 2x2 */
  .stats-grid,
  #page-products .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 14px !important;
  }

  /* Full-Screen Workbenches single column stack on Tablet */
  #productForm {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    padding: 16px !important;
  }

  .qp-modal-body {
    grid-template-columns: 1fr !important;
    padding: 16px !important;
    gap: 16px !important;
  }

  .user-workbench-grid {
    grid-template-columns: 1fr !important;
    padding: 16px !important;
    gap: 16px !important;
  }

  .adv-workbench-body {
    flex-direction: column !important;
    overflow-y: auto !important;
  }

  .adv-left-col,
  .adv-right-col {
    width: 100% !important;
  }

  .customer-layout {
    height: calc(100vh - 180px);
    min-height: 520px;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(220px, 0.9fr) minmax(260px, 1.1fr);
  }

  .dashboard-cards-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 16px !important;
  }
}

/* ─── MOBILE PHONES (max-width: 768px) ─── */
@media (max-width: 768px) {
  .dashboard-cards-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
  }
  .main-content {
    padding: 10px 12px !important;
  }

  .page h1 {
    font-size: 18px !important;
    margin-bottom: 12px !important;
  }

  .page-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    margin-bottom: 12px !important;
  }

  .header-actions {
    width: 100% !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  .header-actions .btn {
    flex: 1 1 auto !important;
    justify-content: center !important;
  }

  /* Stats Cards Compact 2x2 */
  .stats-grid,
  #page-products .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
  }

  .stat-card.premium {
    padding: 10px 12px !important;
    gap: 8px !important;
  }

  .stat-icon {
    width: 34px !important;
    height: 34px !important;
    font-size: 16px !important;
    border-radius: 8px !important;
  }

  .stat-label {
    font-size: 11px !important;
  }

  .stat-value {
    font-size: 16px !important;
  }

  /* Product Filter Bar Mobile Responsive */
  .product-filter-bar {
    padding: 10px !important;
    gap: 8px !important;
  }

  .product-filter-bar > div:first-child {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .product-filter-bar .search-input {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .product-filter-bar select {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .product-filter-bar .prod-stock-pills {
    display: flex !important;
    width: 100% !important;
    justify-content: space-between !important;
    box-sizing: border-box !important;
  }

  .product-filter-bar .prod-stock-pill {
    flex: 1 !important;
    text-align: center !important;
    padding: 6px 2px !important;
    font-size: 11px !important;
  }

  .product-filter-bar > div:last-child {
    width: 100% !important;
    justify-content: space-between !important;
  }

  /* Hide table columns on Mobile Phones: keeping only Name, Stock, Price, Actions */
  .col-cb,
  .col-id,
  .col-code,
  .col-unit,
  .col-cost,
  .col-margin,
  .col-vat,
  .col-barcode,
  .col-active {
    display: none !important;
  }

  .col-name {
    min-width: 105px !important;
    font-size: 12px !important;
  }

  .col-stock {
    width: 60px !important;
    font-size: 12px !important;
  }

  .col-price {
    width: 75px !important;
    font-size: 12px !important;
  }

  .col-actions {
    width: 96px !important;
    min-width: 96px !important;
  }

  .col-actions .btn-icon-sm {
    width: 26px !important;
    height: 24px !important;
    font-size: 11px !important;
  }

  /* Users table mobile */
  .col-user-pin,
  .col-user-menus,
  .col-user-finance,
  .col-user-status {
    display: none !important;
  }

  /* User workbench permissions 1-col */
  .user-perm-grid {
    grid-template-columns: 1fr !important;
  }

  /* Purchases table mobile */
  .purchases-data-table th:nth-child(2),
  .purchases-data-table td:nth-child(2),
  .purchases-data-table th:nth-child(4),
  .purchases-data-table td:nth-child(4),
  .purchases-data-table th:nth-child(5),
  .purchases-data-table td:nth-child(5) {
    display: none !important;
  }

  /* Modals on mobile */
  .modal-header,
  .adv-workbench-header,
  .qp-modal-header {
    padding: 10px 14px !important;
  }

  .modal-header h2,
  .adv-workbench-header h2,
  .qp-modal-header h2 {
    font-size: 15px !important;
  }
}





/* ═══════════════════════════════════════════════════════════════
   📁 KATEGÓRIÁK: FA + RÉSZLETEK (Master–Detail) ÉS SZERVEZŐ MUNKAPAD
   ═══════════════════════════════════════════════════════════════ */
#page-categories .page-header {
  flex-wrap: wrap;
}

#page-categories .header-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

#page-categories .header-actions .btn {
  height: 40px;
}

.cat-search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.cat-search-box > span {
  position: absolute;
  left: 12px;
  font-size: 13px;
  color: var(--text-muted);
  pointer-events: none;
}

.cat-search-box .search-input {
  width: 240px;
  max-width: 100%;
  height: 40px;
  padding: 0 34px;
  box-sizing: border-box;
  border-radius: 8px;
  background: #162436;
  border: 1px solid var(--border);
  color: #fff;
  font-size: 13px;
}

.cat-search-box .search-input:focus {
  outline: none;
  border-color: #0066FF;
  box-shadow: 0 0 0 2px rgba(0, 102, 255, 0.25);
}

.cat-search-clear {
  position: absolute;
  right: 5px;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  font-size: 13px;
}

.cat-search-clear:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.cat-seg {
  display: inline-flex;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.cat-seg button {
  height: 100%;
  padding: 0 13px;
  border: none;
  background: var(--surface2);
  color: var(--text);
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
}

.cat-seg button + button {
  border-left: 1px solid var(--border);
}

.cat-seg button:hover {
  background: rgba(0, 102, 255, 0.2);
  color: #fff;
}

.cat-layout {
  display: grid;
  grid-template-columns: minmax(320px, 42%) minmax(0, 1fr);
  gap: 16px;
  flex: 1 1 0;
  min-height: 0;
}

.cat-tree-panel,
.cat-detail-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.cat-panel-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 11px 16px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-muted);
}

.cat-legend {
  font-size: 11.5px;
  white-space: nowrap;
}

.cat-tree-scroll {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px;
  outline: none;
}

.cat-empty {
  padding: 36px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.cat-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 6px 0 4px;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
}

.cat-row:hover {
  background: rgba(0, 102, 255, 0.08);
}

.cat-row.root {
  margin-top: 3px;
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  font-weight: 700;
}

.cat-row.root:hover {
  background: rgba(0, 102, 255, 0.1);
}

.cat-row.selected,
.cat-row.root.selected {
  background: rgba(0, 102, 255, 0.2);
  border-color: rgba(0, 102, 255, 0.55);
  border-left-color: #0066FF;
}

.cat-indent {
  flex-shrink: 0;
  align-self: stretch;
  background-image: repeating-linear-gradient(to right, rgba(122, 155, 186, 0.28) 0 1px, transparent 1px 18px);
  background-position: 8px 0;
}

.cat-chevron {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.15s, background 0.15s;
}

.cat-chevron.open {
  transform: rotate(90deg);
  color: #93c5fd;
}

.cat-chevron:not(.leaf):hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.cat-chevron.leaf {
  opacity: 0.35;
  cursor: default;
}

.cat-name {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
}

.cat-row:not(.root) .cat-name {
  color: var(--text);
  font-weight: 500;
}

.cat-hit {
  background: rgba(0, 102, 255, 0.4);
  color: #fff;
  border-radius: 3px;
  padding: 0 1px;
}

.cat-badges {
  display: inline-flex;
  gap: 6px;
  flex-shrink: 0;
}

.cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 11px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  background: rgba(0, 102, 255, 0.14);
  color: #93c5fd;
  border: 1px solid rgba(0, 102, 255, 0.3);
  font-family: inherit;
  flex-shrink: 0;
}

.cat-badge.prod {
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  border-color: var(--border);
}

button.cat-badge.prod:hover {
  border-color: #0066FF;
  color: #fff;
}

.cat-badge.zero {
  opacity: 0.38;
}

.cat-more {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.6;
}

.cat-row:hover .cat-more,
.cat-row.selected .cat-more,
.cw-item:hover .cat-more {
  opacity: 1;
}

.cat-more:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* ── Részletek panel ── */
.cat-detail-scroll {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cat-crumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  font-size: 12.5px;
}

.cat-crumb {
  background: none;
  border: none;
  padding: 4px 7px;
  border-radius: 6px;
  color: #60a5fa;
  font-size: 12.5px;
  cursor: pointer;
}

.cat-crumb:hover {
  background: rgba(0, 102, 255, 0.15);
}

.cat-crumb.current {
  color: #fff;
  font-weight: 600;
  cursor: default;
}

.cat-crumb.current:hover {
  background: none;
}

.cat-crumb-sep {
  color: var(--text-muted);
}

.cat-d-title {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  overflow-wrap: anywhere;
}

.cat-d-sub {
  margin: 4px 0 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

.cat-type-pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 700;
  background: rgba(0, 102, 255, 0.16);
  color: #93c5fd;
  border: 1px solid rgba(0, 102, 255, 0.4);
}

.cat-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.cat-kpi {
  background: #162436;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  min-width: 0;
}

.cat-kpi .l {
  font-size: 11px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.cat-kpi .v {
  margin-top: 2px;
  font-size: 26px;
  font-weight: 800;
  color: #fff;
}

.cat-kpi .s {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.cat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cat-actions .btn {
  height: 42px;
  padding: 0 16px;
  font-size: 13px;
}

.cat-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.cat-section-title span {
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11.5px;
  color: #93c5fd;
  background: rgba(0, 102, 255, 0.14);
}

.cat-sub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}

.cat-sub-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 62px;
  padding: 10px 12px;
  text-align: left;
  background: #162436;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  min-width: 0;
}

.cat-sub-card:hover {
  border-color: #0066FF;
  background: rgba(0, 102, 255, 0.1);
}

.cat-sub-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.cat-sub-meta {
  display: flex;
  gap: 12px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.cat-danger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: auto;
  padding: 14px 16px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.06);
}

/* ── Lebegő, sötét műveleti menü ── */
.cat-float-menu {
  position: fixed;
  z-index: 2500;
  min-width: 240px;
  padding: 6px;
  background: #0d1b2a;
  border: 1px solid #2d3f52;
  border-radius: 10px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
}

.cat-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: none;
  border-radius: 7px;
  background: none;
  color: #e0e0e0;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.cat-menu-item:hover {
  background: rgba(0, 102, 255, 0.22);
  color: #fff;
}

.cat-menu-item.danger {
  color: #fca5a5;
}

.cat-menu-item.danger:hover {
  background: rgba(239, 68, 68, 0.18);
}

.cat-menu-sep {
  height: 1px;
  margin: 5px 4px;
  background: #2d3f52;
}

/* ── Szervező Munkapad ── */
.cw-col-right {
  padding: 0;
  gap: 0;
  overflow: hidden;
  background: var(--surface2);
}

.cw-toolbar {
  flex-shrink: 0;
}

.cw-toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.cw-toolbar-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.cw-link-btn {
  height: 30px;
  padding: 0 8px;
  border: none;
  border-radius: 6px;
  background: none;
  color: #60a5fa;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.cw-link-btn:hover {
  background: rgba(0, 102, 255, 0.15);
  color: #fff;
}

.cw-list-container {
  min-height: 0;
  gap: 3px;
}

.cw-item {
  min-height: 44px;
  gap: 8px;
  padding: 4px 8px;
  cursor: pointer;
}

.cw-item-main {
  flex: 1 1 0;
  min-width: 0;
}

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

.cw-item-name.root {
  font-weight: 700;
  color: #fff;
}

.cw-item-path {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: var(--text-muted);
}

.cw-trunc {
  padding: 12px;
  text-align: center;
  font-size: 12px;
  color: #fbbf24;
}

.cw-sel-bar {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.cw-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 26px;
}

.cw-chips-empty {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 26px;
}

.cw-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 4px 0 10px;
  border-radius: 13px;
  font-size: 12px;
  color: #fff;
  background: rgba(0, 102, 255, 0.2);
  border: 1px solid rgba(0, 102, 255, 0.5);
  max-width: 200px;
  white-space: nowrap;
}

.cw-chip.more {
  padding: 0 10px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
}

.cw-chip button {
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: none;
  color: #93c5fd;
  font-size: 11px;
  cursor: pointer;
}

.cw-chip button:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.cw-rtabs {
  flex-shrink: 0;
  display: flex;
  gap: 6px;
  padding: 10px 18px 0 18px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}

.cw-rtab {
  height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  background: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.cw-rtab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.cw-rtab.active {
  color: #fff;
  background: var(--surface);
  border-color: var(--border);
  box-shadow: inset 0 2px 0 #0066FF;
}

.cw-pane {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cw-pane-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
}

.cw-pane-hint {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-muted);
}

.cw-box {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.cw-label {
  display: block;
  margin-bottom: 4px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.cw-pillar-grid {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

.cw-pillar-card {
  min-height: 62px;
  padding: 10px 12px;
  gap: 4px;
  justify-content: center;
}

.cw-pillar-card:hover {
  transform: none;
  background: rgba(0, 102, 255, 0.1);
}

.cw-pillar-card.root {
  border-color: rgba(0, 102, 255, 0.5);
  background: rgba(0, 102, 255, 0.07);
}

.cw-pillar-card.ghost {
  border-style: dashed;
  border-color: rgba(0, 102, 255, 0.45);
  background: transparent;
}

.cw-pt-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.cw-pt-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
  color: #fff;
}

.cw-pt-icon {
  font-size: 18px;
  line-height: 1;
}

.cw-pt-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}

.cw-pt-go {
  margin-left: 4px;
  font-weight: 700;
  color: #60a5fa;
}

@media (max-width: 1024px) {
  .cat-layout {
    height: calc(100vh - 170px);
    min-height: 520px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(220px, 1fr) minmax(240px, 1fr);
  }

  .cat-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .cat-kpis {
    grid-template-columns: minmax(0, 1fr);
  }

  .cat-search-box,
  .cat-search-box .search-input {
    width: 100%;
  }
}

/* ─── Sidebar Expandable Partner Submenu & Partnerkezelő v2 ─────────────── */
.sidebar-nav {
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-group {
  display: flex;
  flex-direction: column;
}

.nav-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.nav-chevron {
  font-size: 11px;
  color: var(--text-muted);
  transition: transform 0.18s ease;
  flex-shrink: 0;
}

.nav-group:not(.open) .nav-chevron {
  transform: rotate(-90deg);
}

.nav-submenu {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 2px 0 6px 0;
  background: rgba(13, 27, 42, 0.45);
}

.nav-group.open .nav-submenu {
  display: flex;
}

.nav-subitem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 14px 9px 30px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}

.nav-subitem:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.nav-subitem.active {
  background: rgba(0, 102, 255, 0.14);
  color: #fff;
  font-weight: 600;
  border-left-color: #0066FF;
}

.nav-sublabel {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-subcount {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-muted);
  flex-shrink: 0;
}

.nav-subitem.active .nav-subcount {
  background: rgba(0, 102, 255, 0.28);
  color: #93c5fd;
}

/* ── #page-customers Master–Detail ── */
.cust-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  flex-shrink: 0;
  margin-bottom: 14px !important;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.cust-header-left {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  min-width: 0;
}

.cust-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.cust-page-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: rgba(0, 102, 255, 0.14);
  border: 1px solid rgba(0, 102, 255, 0.35);
  flex-shrink: 0;
}

.cust-page-sub {
  margin: 2px 0 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

.customer-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  background: var(--surface2);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.customer-tabs .tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  min-height: 36px;
  white-space: nowrap;
}

.customer-tabs .tab-btn.active {
  background: #0066FF;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 102, 255, 0.35);
}

.cust-tab-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
}

.customer-tabs .tab-btn.active .cust-tab-badge {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.customer-layout {
  display: grid;
  grid-template-columns: minmax(320px, 37%) minmax(0, 1fr);
  gap: 16px;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}

.cust-list-col,
.cust-detail-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.cust-search-wrap {
  padding: 12px 14px 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cust-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 10px;
  height: 40px;
}

.cust-search-box:focus-within {
  border-color: #0066FF;
}

.cust-search-box input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 13.5px;
  outline: none;
}

.cust-search-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
}

.cust-list-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

.cust-list-scroll {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cust-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  min-height: 56px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  position: relative;
  transition: background 0.15s, border-color 0.15s;
}

.cust-row:hover {
  background: var(--surface2);
}

.cust-row.active {
  background: rgba(0, 102, 255, 0.14);
  border-color: rgba(0, 102, 255, 0.45);
}

.cust-row.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #0066FF;
}

.cust-row-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.cust-row-main {
  flex: 1 1 0;
  min-width: 0;
}

.cust-row-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cust-row-sub {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.cust-row-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 102, 255, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(0, 102, 255, 0.3);
  white-space: nowrap;
  flex-shrink: 0;
}

.cust-row-pill.amber {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}

.cust-detail-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
}

.cust-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.7;
}

.cust-detail-empty h2 {
  margin: 0 0 8px 0;
  font-size: 18px;
  color: #fff;
}

.cust-detail-empty p {
  max-width: 420px;
  font-size: 13.5px;
  line-height: 1.5;
  margin: 0;
}

.cust-detail-scroll {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.cust-det-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.cust-det-identity {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  flex: 1 1 260px;
}

.cust-det-avatar {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.cust-det-title-wrap {
  min-width: 0;
}

.cust-det-title-wrap h2 {
  margin: 0 0 8px 0;
  font-size: 22px;
  color: #fff;
  word-break: break-word;
}

.cust-det-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cust-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}

.cust-badge-blue {
  background: rgba(0, 102, 255, 0.18);
  color: #93c5fd;
  border: 1px solid rgba(0, 102, 255, 0.4);
}

.cust-badge-muted {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.cust-badge-warn {
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.cust-det-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-danger-outline {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
  min-height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  cursor: pointer;
}

.btn-danger-outline:hover {
  background: rgba(239, 68, 68, 0.22);
  color: #fff;
}

.cust-det-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.cust-det-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  min-width: 0;
}

.cust-det-card-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.cust-kv-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cust-kv-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 6px;
}

.cust-kv-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.cust-kv-label {
  font-size: 12.5px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.cust-kv-val {
  font-size: 13.5px;
  color: #fff;
  text-align: right;
  word-break: break-word;
}

.cust-mini-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.cust-mini-kpi {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}

.cust-mini-kpi-label {
  font-size: 11.5px;
  color: var(--text-muted);
}

.cust-mini-kpi-val {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-top: 2px;
}

.cust-rel-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.cust-rel-table th,
.cust-rel-table td {
  padding: 8px 10px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cust-rel-table th {
  text-align: left;
  font-size: 11.5px;
  color: var(--text-muted);
  background: var(--bg);
}

/* ── Full-screen Partner Workbench Modal ── */
.cust-wb-body {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px 32px;
  background: var(--bg);
}

.cust-wb-form {
  max-width: 1280px;
  margin: 0 auto;
}

.cust-wb-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.cust-wb-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.cust-wb-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.cust-wb-label {
  display: block;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 600;
}

.cust-cat-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.cust-cat-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  min-height: 58px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}

.cust-cat-opt:hover {
  border-color: rgba(0, 102, 255, 0.55);
}

.cust-cat-opt.active {
  background: rgba(0, 102, 255, 0.16);
  border-color: #0066FF;
  box-shadow: 0 0 0 1px #0066FF;
}

.cust-cat-opt-ico {
  font-size: 20px;
  flex-shrink: 0;
}

.cust-cat-opt-txt {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cust-cat-opt-txt strong {
  font-size: 13px;
  color: #fff;
}

.cust-cat-opt-txt small {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cust-wb-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 28px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

@media (max-width: 1024px) {
  .cust-det-grid,
  .cust-wb-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .cust-cat-picker {
    grid-template-columns: minmax(0, 1fr);
  }

  .cust-mini-kpis {
    grid-template-columns: minmax(0, 1fr);
  }
}
