/* styles.css — Ipari/utilitarian sötét téma, narancs akcentus */
:root {
  --bg: #0e0f12; --surface: #16181d; --surface-2: #1d2027; --border: #2a2e37;
  --text: #e8e9ec; --text-dim: #9aa0ab; --accent: #ff6a1a; --accent-dim: #cc5414;
  --done: #3ddc84; --danger: #ff4d4d;
  --radius: 14px; --gap: 12px; --tap-min: 48px;
  --font-mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --font-sans: 'IBM Plex Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* ── Header ─────────────────────────────────────────────────────────── */
.app-header {
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--surface) 0%, rgba(22,24,29,.92) 100%);
  border-bottom: 1px solid var(--border);
  /* 2. fix: safe area top (iPhone notch/torch) */
  padding: calc(10px + env(safe-area-inset-top)) 16px 12px;
  position: sticky; top: 0; z-index: 20;
}
.app-header::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-dim));
}
/* header-top: cím balra, akció gombok MINDIG fix jobb szélen (abszolút) */
.header-top   {
  position: relative;
  display: flex; align-items: center;
  /* jobb padding: 2 × 38px gomb + 6px rés közöttük + 4px lélegzőtér = 86px */
  padding-right: 86px;
}
.title-wrap   { display: flex; align-items: baseline; gap: 10px; min-width: 0; overflow: hidden; }
/* A két akció gomb (Notes + Frissítés) HELYHEZ KÖTÖTT a header jobb szélén */
.header-right {
  position: absolute;
  right: 0; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; gap: 6px;
}
.app-title   { font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.count-badge {
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  color: #1a0d05; background: var(--accent);
  padding: 3px 9px; border-radius: 20px;
  box-shadow: 0 0 14px rgba(255,106,26,.35);
}
.icon-btn {
  width: 38px; height: 38px; border: 1px solid var(--border);
  background: var(--surface-2); border-radius: 11px;
  color: var(--text-dim); display: grid; place-items: center; cursor: pointer;
  transition: color .15s, border-color .15s;
}
.icon-btn:active { color: var(--accent); border-color: var(--accent-dim); }
.icon-btn.spin svg { animation: spin .6s linear; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Keresés ─────────────────────────────────────────────────────────── */
.search {
  margin-top: 11px; display: flex; align-items: center; gap: 9px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 11px; padding: 0 12px; height: 40px;
}
.search input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); font-family: var(--font-mono); font-size: 13px;
}
.search input::placeholder { color: var(--text-dim); }

/* ── Offline sáv ─────────────────────────────────────────────────────── */
#offline-bar {
  display: none; align-items: center; gap: 8px;
  padding: 7px 16px; font-size: 12px;
  background: rgba(255,106,26,.10); border-bottom: 1px solid rgba(255,106,26,.25);
  color: #ffb88a; font-family: var(--font-mono);
}
#offline-bar .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 8px var(--accent); flex-shrink: 0;
}

/* ── [v1.3] Tab panelek ──────────────────────────────────────────────── */
.tab-panel {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;  /* flexbox overflow bugfix */
}
.tab-panel.active { display: flex; }

/* ── Scroll terület ──────────────────────────────────────────────────── */
#scroll-area {
  flex: 1; overflow-y: auto;
  padding: 12px 12px calc(14px + env(safe-area-inset-bottom));
  scrollbar-width: none;
}
#scroll-area::-webkit-scrollbar { display: none; }

/* ── Supplier blokk ──────────────────────────────────────────────────── */
.supplier-block {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: var(--gap);
  overflow: hidden;
  animation: rise .4s ease both;
}
@keyframes rise { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:none; } }

.supplier-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px; background: var(--surface-2);
  cursor: pointer; user-select: none; min-height: var(--tap-min);
}
.chev { color: var(--text-dim); transition: transform .2s ease; flex-shrink: 0; }
.supplier-block.collapsed .chev { transform: rotate(-90deg); }
.supplier-name {
  flex: 1; font-family: var(--font-mono); font-weight: 600;
  font-size: 14px; letter-spacing: .06em; text-transform: uppercase;
}
.supplier-count {
  font-family: var(--font-mono); font-size: 12px; color: var(--text-dim);
  background: var(--bg); border: 1px solid var(--border);
  padding: 2px 8px; border-radius: 14px;
}
.supplier-block.collapsed .items { display: none; }

/* ── Tételsor ────────────────────────────────────────────────────────── */
.item-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px; border-top: 1px solid var(--border);
  min-height: 58px; cursor: pointer; position: relative;
  transition: background .15s;
}
.item-row:active { background: var(--surface-2); }
.item-main { flex: 1; min-width: 0; }
.item-name { font-size: 14.5px; font-weight: 500; line-height: 1.3; }
.item-sku  {
  font-family: var(--font-mono); font-size: 11.5px;
  color: #bcc4cc; margin-top: 3px; letter-spacing: .02em;
}
.item-pack {
  font-family: var(--font-mono); font-size: 10.5px;
  color: #9aa0ab; margin-top: 2px;
}
.qty {
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  color: var(--accent); white-space: nowrap; flex-shrink: 0; text-align: right;
}
.qty-sub { display: block; font-size: 10px; font-weight: 500; color: #bcc4cc; margin-top: 2px; }

/* Progress sáv (részleges) */
.progress { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; }
.progress-fill {
  height: 100%; background: var(--accent);
  transition: width .3s ease; box-shadow: 0 0 6px var(--accent);
}

/* Check gomb */
.check-btn {
  width: 30px; height: 30px; min-width: 30px;
  border: 2px solid var(--border); border-radius: 9px;
  background: transparent; display: grid; place-items: center;
  cursor: pointer; transition: background .15s, border-color .15s;
}
.check-btn svg { opacity: 0; transform: scale(.5); transition: opacity .15s, transform .15s; }
.check-btn.done, .check-btn[aria-pressed="true"] {
  background: var(--done); border-color: var(--done);
}
.check-btn.done svg, .check-btn[aria-pressed="true"] svg { opacity: 1; transform: scale(1); }
.check-btn.partial { border-color: var(--accent); }
.check-btn.partial::after {
  content: ""; width: 12px; height: 3px;
  border-radius: 2px; background: var(--accent);
}
.check-btn.partial svg { display: none; }

/* ── Skeleton ────────────────────────────────────────────────────────── */
.skeleton { display: none; }
.sk-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: var(--gap); padding: 14px;
}
.sk-line {
  height: 12px; border-radius: 6px; margin-bottom: 12px;
  background: linear-gradient(90deg, var(--surface-2) 25%, #262a33 50%, var(--surface-2) 75%);
  background-size: 200% 100%; animation: shimmer 1.3s infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

body.state-loading .skeleton { display: block; }
body.state-loading #supplier-list { display: none; }

/* ── Üres állapot ────────────────────────────────────────────────────── */
#empty-state { display: none; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 60px 40px; gap: 14px; color: var(--text-dim); }
.empty-badge {
  width: 64px; height: 64px; border-radius: 50%;
  border: 2px solid var(--done); display: grid; place-items: center;
  color: var(--done); box-shadow: 0 0 24px rgba(61,220,132,.18);
}
#empty-state h3 { color: var(--text); font-size: 17px; font-weight: 600; }
body.state-empty #empty-state { display: flex; }
body.state-empty #supplier-list { display: none; }

/* ── Hiba állapot ────────────────────────────────────────────────────── */
#error-state { display: none; flex-direction: column; align-items: center;
  padding: 60px 40px; gap: 12px; text-align: center; }
#error-state h3 { color: var(--danger); font-size: 16px; }
body.state-error #error-state { display: flex; }
body.state-error #supplier-list { display: none; }
.retry-btn {
  padding: 10px 20px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-2); color: var(--text); cursor: pointer; font-size: 14px;
}
.retry-btn:active { background: var(--surface); }

/* ── Modal (bottom sheet, full screen) ──────────────────────────────── */
#modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
  align-items: flex-end;
}
#modal-overlay.open { display: flex; }
/* 4. fix: teljes képernyő, safe area top figyelembe vételével */
.modal-sheet {
  width: 100%; background: var(--surface);
  border-radius: 20px 20px 0 0;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  padding-top: calc(20px + env(safe-area-inset-top));
  display: flex; flex-direction: column; gap: 16px;
  height: calc(100dvh - env(safe-area-inset-top));
  max-height: calc(100dvh - env(safe-area-inset-top));
  overflow-y: auto;
}
.modal-handle {
  width: 36px; height: 4px; border-radius: 2px;
  background: var(--border); align-self: center; margin-bottom: 4px;
}
/* 5. fix: nagyobb partner név a modalban */
.modal-supplier {
  font-family: var(--font-mono); font-size: 14px; font-weight: 600;
  color: var(--accent); text-transform: uppercase; letter-spacing: .06em;
}
.modal-title { font-size: 19px; font-weight: 700; line-height: 1.3; }
.modal-meta { font-family: var(--font-mono); font-size: 13px; color: var(--text-dim); }
.modal-meta-pack { margin-top: 3px; }

/* Léptető */
.modal-stepper {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; background: var(--surface-2); border-radius: var(--radius); padding: 14px 16px;
}
.step-btn {
  width: 48px; height: 48px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--bg); color: var(--text);
  font-size: 24px; display: grid; place-items: center; cursor: pointer;
}
.step-btn:active { background: var(--surface); }
.modal-step-val  { font-family: var(--font-mono); font-size: 28px; font-weight: 600; text-align: center; }
.modal-step-sub  { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); text-align: center; }

/* Pontos mező */
.modal-exact-wrap { display: flex; flex-direction: column; gap: 6px; }
.modal-exact-wrap label { font-size: 12px; color: var(--text-dim); font-family: var(--font-mono); }
.modal-exact {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: 11px; padding: 11px 14px; color: var(--text);
  font-family: var(--font-mono); font-size: 16px; outline: none;
}
.modal-exact:focus { border-color: var(--accent); }

/* Gyorsgombok */
.modal-quick { display: flex; gap: 8px; }
.modal-btn-none, .modal-btn-all {
  flex: 1; padding: 10px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface-2); color: var(--text);
  font-size: 13px; cursor: pointer; text-align: center;
}
.modal-btn-none:active, .modal-btn-all:active { background: var(--surface); }

/* Akció gombok */
.modal-actions { display: flex; gap: 10px; margin-top: 4px; }
.modal-cancel {
  flex: 1; padding: 14px; border: 1px solid var(--border);
  border-radius: 12px; background: transparent; color: var(--text-dim);
  font-size: 15px; cursor: pointer;
}
.modal-save {
  flex: 2; padding: 14px; border: none;
  border-radius: 12px; background: var(--accent); color: #fff;
  font-size: 15px; font-weight: 600; cursor: pointer;
}
.modal-save:active { background: var(--accent-dim); }

/* ── 3. fejlesztés: „Mind kész" bulk gomb ───────────────────────────── */
.bulk-row {
  padding: 10px 14px; border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.bulk-btn {
  width: 100%; padding: 12px; border: 1px solid var(--accent-dim);
  border-radius: 10px; background: rgba(255,106,26,.08);
  color: var(--accent); font-size: 13px; font-weight: 600;
  font-family: var(--font-mono); cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap-min); letter-spacing: .02em;
  transition: background .15s;
}
.bulk-btn:active { background: rgba(255,106,26,.18); }
.supplier-block.collapsed .bulk-row { display: none; }

/* Bulk confirm overlay */
#bulk-confirm-overlay {
  display: none; position: fixed; inset: 0; z-index: 60;
  background: rgba(0,0,0,.65); backdrop-filter: blur(6px);
  align-items: center; justify-content: center; padding: 24px;
}
#bulk-confirm-overlay.open { display: flex; }
.bulk-confirm-dialog {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 28px 24px; width: 100%; max-width: 340px;
  display: flex; flex-direction: column; gap: 14px; text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.bulk-confirm-icon {
  width: 56px; height: 56px; border-radius: 50%;
  border: 2px solid var(--done); display: grid; place-items: center;
  color: var(--done); align-self: center;
  box-shadow: 0 0 20px rgba(61,220,132,.2);
}
.bulk-confirm-title { font-size: 17px; font-weight: 700; }
.bulk-confirm-supplier {
  font-size: 14px; color: var(--accent); font-family: var(--font-mono);
  font-weight: 600; letter-spacing: .04em;
}
.bulk-confirm-count { font-size: 13px; color: var(--text-dim); }
.bulk-confirm-btns { display: flex; gap: 10px; margin-top: 4px; }
.bulk-confirm-no {
  flex: 1; padding: 13px; border: 1px solid var(--border);
  border-radius: 12px; background: transparent; color: var(--text-dim);
  font-size: 15px; cursor: pointer;
}
.bulk-confirm-yes {
  flex: 2; padding: 13px; border: none;
  border-radius: 12px; background: var(--done); color: #0e0f12;
  font-size: 15px; font-weight: 700; cursor: pointer;
}
.bulk-confirm-yes:active { filter: brightness(.9); }

/* ── 6. fix: Megerősítő dialog (középen) ────────────────────────────── */
#confirm-overlay {
  display: none; position: fixed; inset: 0; z-index: 60;
  background: rgba(0,0,0,.65); backdrop-filter: blur(6px);
  align-items: center; justify-content: center; padding: 24px;
}
#confirm-overlay.open { display: flex; }
.confirm-dialog {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 28px 24px; width: 100%; max-width: 340px;
  display: flex; flex-direction: column; gap: 16px; text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.confirm-icon {
  width: 52px; height: 52px; border-radius: 50%;
  border: 2px solid var(--accent); display: grid; place-items: center;
  color: var(--accent); align-self: center;
  box-shadow: 0 0 20px rgba(255,106,26,.2);
}
.confirm-title { font-size: 16px; font-weight: 700; }
.confirm-item-name {
  font-size: 13px; color: var(--text-dim); line-height: 1.4;
  font-family: var(--font-mono);
}
.confirm-btns { display: flex; gap: 10px; margin-top: 4px; }
.confirm-no {
  flex: 1; padding: 13px; border: 1px solid var(--border);
  border-radius: 12px; background: transparent; color: var(--text-dim);
  font-size: 15px; cursor: pointer;
}
.confirm-yes {
  flex: 2; padding: 13px; border: none;
  border-radius: 12px; background: var(--accent); color: #fff;
  font-size: 15px; font-weight: 700; cursor: pointer;
}
.confirm-yes:active { background: var(--accent-dim); }

/* ── Toast ───────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: calc(20px + env(safe-area-inset-bottom));
  left: 50%; transform: translateX(-50%) translateY(60px);
  background: var(--surface-2); color: var(--text);
  padding: 10px 18px; border-radius: 20px; font-size: 13px;
  border: 1px solid var(--border); opacity: 0;
  transition: opacity .25s, transform .25s; white-space: nowrap; z-index: 100;
}
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── [Phase E1] Modal info szekció (cím, telefon, megjegyzés) ─────────── */
.modal-info { margin: 0 -4px; }
.modal-info-inner {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 7px;
}
.info-row {
  display: grid; grid-template-columns: 18px 90px 1fr; align-items: baseline; gap: 6px;
  font-size: 13px;
}
.info-icon  { font-size: 13px; }
.info-label { color: var(--text-dim); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.info-value { color: var(--text); font-size: 13px; word-break: break-word; }
.info-link  { color: var(--accent); text-decoration: none; }
.info-link:active { color: var(--accent-dim); }
.info-code  { font-family: var(--font-mono); font-size: 14px; font-weight: 700; color: var(--done); letter-spacing: .08em; }
.info-eleli-note { color: var(--accent); font-style: italic; }

/* ── [Phase E2] pwa_note textarea ────────────────────────────────────── */
.modal-note-wrap {
  display: flex; flex-direction: column; gap: 6px;
}
.modal-note-wrap label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text-dim);
}
.modal-note {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; color: var(--text); font-size: 14px;
  font-family: var(--font-sans); resize: none; line-height: 1.5;
  transition: border-color .15s;
}
.modal-note:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255,106,26,.15);
}
.modal-note::placeholder { color: var(--text-dim); }

/* ── [Phase F2] PWA harang ikon ──────────────────────────────────────── */
.bell-btn {
  display: flex; align-items: center; gap: 4px;
  background: none; border: none; cursor: pointer;
  color: var(--accent); padding: 4px 6px;
  border-radius: 8px; position: relative;
}
.bell-btn:active { opacity: .7; }
.bell-badge {
  min-width: 16px; height: 16px;
  background: var(--danger); color: #fff;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  border-radius: 10px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}


/* [Phase F2] app_note megjelenítése a tételkártyán */
.item-app-note {
  font-size: 11px;
  color: var(--accent);
  margin-top: 3px;
  line-height: 1.4;
  opacity: 0.9;
}

/* [Phase F3] Bell modal — ELELI megjegyzések */
.bell-modal-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 300;
}
.bell-modal-overlay.open { display: flex; align-items: center; justify-content: center; }
.bell-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(3px);
}
.bell-modal-sheet {
  position: relative; z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: calc(100% - 32px);
  max-width: 420px;
  max-height: 80vh;
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
}
.bell-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.bell-modal-title {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  color: var(--accent);
}
.bell-modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-dim); font-size: 22px; line-height: 1;
  padding: 0 4px;
}
.bell-modal-close:active { opacity: .6; }
.bell-modal-body {
  overflow-y: auto;
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.bell-modal-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.bell-modal-item-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 5px;
}
.bell-modal-order {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  color: var(--accent);
  background: rgba(255,106,26,.12);
  border-radius: 5px; padding: 2px 6px;
  white-space: nowrap;
}
.bell-modal-name {
  font-size: 12px; color: var(--text-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bell-modal-note {
  font-size: 13px; color: var(--text);
  line-height: 1.45;
}
.bell-modal-empty {
  text-align: center; color: var(--text-dim);
  font-size: 13px; padding: 20px 0;
}
.bell-modal-item-head {
  display: flex; align-items: center; gap: 8px;
}
.bell-ack-btn {
  margin-left: auto; flex-shrink: 0;
  background: none; border: none; cursor: pointer;
  color: var(--text-dim); font-size: 18px; line-height: 1;
  padding: 0 2px;
  transition: color .15s;
}
.bell-ack-btn:active { color: var(--done); }
.bell-modal-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.bell-modal-ack-all {
  background: var(--done); color: #0e0f12;
  border: none; border-radius: 8px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  padding: 8px 14px; cursor: pointer;
}
.bell-modal-ack-all:active { opacity: .8; }
.bell-modal-close-btn {
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  font-family: var(--font-mono); font-size: 12px;
  padding: 8px 14px; cursor: pointer;
}
.bell-modal-close-btn:active { opacity: .8; }

/* ── [v1.5] Notes fejléc ikon + modal tartalom ───────────────────────── */

/* Jegyzetek ikon gomb — azonos méretű és stílusú mint a refresh-btn,
   position:relative kell az abszolút badge-hez */
.notes-header-btn {
  position: relative;   /* badge: top-right sarokba */
  /* Minden más (.icon-btn) örökli: 38×38px, keret, háttér, grid-center */
}
.notes-header-btn:hover  { color: var(--accent); border-color: var(--accent-dim); }
.notes-header-btn:active { color: var(--accent); border-color: var(--accent-dim); }

/* Szám badge: jobb felső sarokba abszolút pozícionálva */
.notes-header-badge {
  position: absolute; top: -5px; right: -5px;
  min-width: 16px; height: 16px;
  background: var(--accent); color: #fff;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  border-radius: 99px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}

/* Bejegyzés kártya a notes modalban */
.notes-modal-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
}
.notes-modal-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  word-break: break-word;
}
.notes-modal-date {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 5px;
  opacity: .7;
}

/* ── [v1.3] Tab bar (alap navigáció) ────────────────────────────────── */
.tab-bar {
  flex-shrink: 0;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  position: relative; z-index: 10;
}
.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px 6px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 9px;
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  transition: color .15s;
  min-height: 52px;
  position: relative;
}
.tab-btn.active { color: var(--accent); }
.tab-btn.active::before {
  content: "";
  position: absolute; top: 0; left: 20%; right: 20%; height: 2px;
  background: var(--accent);
  border-radius: 0 0 3px 3px;
}
.tab-btn.tab-disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.tab-soon {
  font-size: 7px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 5px;
  letter-spacing: .03em;
  color: var(--text-dim);
}

/* ── [v1.3] Részletei tab — tartalomterület ─────────────────────────── */
#details-area {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px calc(14px + env(safe-area-inset-bottom));
  scrollbar-width: none;
}
#details-area::-webkit-scrollbar { display: none; }

.details-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
}

/* Rendelés kártya */
.order-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: var(--gap);
  overflow: hidden;
  animation: rise .4s ease both;
}
.order-card-head {
  padding: 12px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.order-card-number {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .07em;
  text-transform: uppercase;
}
.order-card-partner {
  font-size: 15px;
  font-weight: 600;
  margin-top: 4px;
  line-height: 1.25;
}
.order-card-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 3px;
}
.detail-item {
  padding: 11px 14px;
  border-top: 1px solid var(--border);
}
.detail-item-name {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
}
.detail-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 8px;
  margin-top: 6px;
}
.detail-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 7px;
  white-space: nowrap;
}
.detail-tag.price-buy  { color: #8fa4c8; }
.detail-tag.price-sell { color: var(--done); }

/* ── [v1.4] Jegyzet tab — valódi implementáció ──────────────────────── */

#notes-area {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 0;
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
}

/* Beviteli sor: input + gombok egy sorban */
.notes-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 2;
}

.notes-input {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 11px 14px;
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}
.notes-input:focus {
  border-color: var(--accent);
}
.notes-input::placeholder {
  color: var(--text-dim);
  opacity: .6;
}

/* Gomb csoport: mentés + kuka egymás mellett */
.notes-input-btns {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Alap ikon gomb */
.note-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.3;
  transition: opacity .15s, background .15s;
  flex-shrink: 0;
}
.note-icon-btn:not(:disabled) {
  opacity: 1;
}
.note-icon-btn:not(:disabled):hover {
  background: var(--surface-2);
}
.note-icon-btn:not(:disabled):active {
  filter: brightness(.85);
}
.note-icon-btn:disabled {
  cursor: default;
  pointer-events: none;
}

/* Veszélyes (kuka) gomb — aktív állapotban piros tónus */
.note-icon-btn-danger:not(:disabled) {
  color: #e07070;
  border-color: rgba(224, 112, 112, .3);
}
.note-icon-btn-danger:not(:disabled):hover {
  background: rgba(224, 112, 112, .1);
}

/* Mentett bejegyzések listája */
#notes-list {
  flex: 1;
  padding: 8px 0;
}

.note-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  animation: rise .3s ease both;
}
.note-item:last-child {
  border-bottom: none;
}

.note-item-body {
  flex: 1;
  min-width: 0;
}

.note-item-text {
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.45;
  word-break: break-word;
}

.note-item-date {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #bcc4cc;
  margin-top: 4px;
}

/* Egyedi kuka gomb a mentett bejegyzéseknél */
.note-trash-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #bcc4cc;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: color .15s, background .15s;
  margin-top: 1px;
}
.note-trash-btn:hover {
  opacity: 1;
  color: #e07070;
  background: rgba(224, 112, 112, .08);
}
.note-trash-btn:active {
  filter: brightness(.85);
}

/* Státusz üzenetek (üres, töltés, hiba) */
.notes-status {
  padding: 40px 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
}
.notes-error {
  color: #e07070;
}

/* Notes confirm overlay — azonos mintázat mint a meglévő confirm-overlay */
#notes-confirm-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(6px);
  align-items: center; justify-content: center;
  padding: 24px;
}
#notes-confirm-overlay.open { display: flex; }
