/* -----------------------------------
   NOVA ERP / INVENTORY – v2 design
   Egységes háttér • Topbar • Kártyák • Táblák • Reszponzív finomítások
----------------------------------- */

/* Háttér – minden oldalra */
body.nova-bg {
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(135deg, #6a82fb, #fc5c7d, #f7b733);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  font-family: 'Inter', sans-serif;
  /* no flex centering here – fixed topbar + normal document flow */
  display: block;
  position: relative;
}
    @keyframes gradientBG {
      0%{background-position:0% 50%}
      50%{background-position:100% 50%}
      100%{background-position:0% 50%}
    }

/* Faint center logo watermark */
body.nova-bg::before {
  content: "";
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(80vw, 720px);
  height: min(80vw, 720px);
  background: center/contain no-repeat url('/assets/Nova_storage_logo_tr.png');
  opacity: 0.12;
  pointer-events: none;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,0.12));
  transform: translateY(12px);
}


/* Alap dobozmodel és margin reset */
*,
*::before,
*::after { box-sizing: border-box; }

/* Shell (belső tartalom) */
.shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 80px 24px 48px 24px; /* top padding a fix topbar miatt */
  position: relative;
  z-index: 1;
}

/* Alternate page-shell used by some views */
.page-shell { max-width: 1200px; margin: 0 auto; padding: 80px 24px 48px; width: 100%; }

/* ---------- Topbar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  padding: 0 20px;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.brand {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.3px;
  display: flex; align-items: center; gap: 10px;
}
.brand .muted { opacity: .75; font-weight: 600; }

/* Make brand clickable like elsewhere, and keep hover subtle */
.brand a { color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
.brand a:hover { opacity: .9; }

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

/* Support both class names for topbar groups */
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; }

/* Menü gomb és panel */
.menu { position: relative; }
.menu-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  transition: transform .12s ease, background .2s ease, box-shadow .2s ease, border-color .2s ease;
  box-shadow: 0 6px 16px rgba(0,0,0,.25);
}
.menu-btn:hover { background: rgba(255,255,255,.18); transform: translateY(-1px); }
.menu-btn:active { transform: translateY(0); }

.menu-panel {
  display: none;
  position: absolute;
  top: calc(100% + 8px); right: 0;
  min-width: 240px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  backdrop-filter: blur(20px) saturate(140%);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  padding: 10px;
  z-index: 200;
}
.menu.open .menu-panel { display: block; }
.menu-panel a,
.menu-panel button {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: #103a8f;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 6px 0;
  transition: background .2s ease, border-color .2s ease, transform .12s ease, color .2s ease;
}
.menu-panel a:hover, .menu-panel button:hover {
  background: rgba(255,255,255,.2);
  border-color: rgba(16,58,143,.4);
  color: #0b2c74;
  transform: translateY(-1px);
}

/* --- Topbar menu hardening / compatibility selectors --- */
/* Some templates render the menu container with different class names.  
   Treat any of these as dropdown panels and hide them until the menu is open. */
.topbar .menu-panel,
.topbar .menu-dropdown,
.topbar .topmenu,
.topbar .menu-links,
.topbar .menu-items {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  padding: 10px;
  z-index: 200;
  display: none; /* hidden by default */
}
/* Show when menu wrapper has .open */
.topbar .menu.open .menu-panel,
.topbar .menu.open .menu-dropdown,
.topbar .menu.open .topmenu,
.topbar .menu.open .menu-links,
.topbar .menu.open .menu-items { display: block; }

/* Make links inside any of the panels look like buttons */
.topbar .menu-panel a, .topbar .menu-panel button,
.topbar .menu-dropdown a, .topbar .menu-dropdown button,
.topbar .topmenu a, .topbar .topmenu button,
.topbar .menu-links a, .topbar .menu-links button,
.topbar .menu-items a, .topbar .menu-items button {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: #fff;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 10px;
  padding: 10px 12px; margin: 6px 0;
  transition: background .2s ease, border-color .2s ease, transform .12s ease;
}
.topbar .menu-panel a:hover, .topbar .menu-panel button:hover,
.topbar .menu-dropdown a:hover, .topbar .menu-dropdown button:hover,
.topbar .topmenu a:hover, .topbar .topmenu button:hover,
.topbar .menu-links a:hover, .topbar .menu-links button:hover,
.topbar .menu-items a:hover, .topbar .menu-items button:hover {
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.25);
  transform: translateY(-1px);
}

/* Prevent raw links accidentally showing inline inside the topbar */
.topbar .menu > a:not(.menu-btn),
.topbar .menu > span > a {
  display: none;
}
.topbar .menu.open > a:not(.menu-btn),
.topbar .menu.open > span > a {
  display: flex; /* will be captured by the rules above */
}

/* Nyelvválasztó */
.langmenu select {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 14px;
}

/* Legacy language selector (same look as .langmenu) */
.langform select {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 14px;
}

/* Értesítés ikon */
.notif-bell {
  position: relative;
  background: none; border: none;
  color: #fff; font-size: 22px; cursor: pointer;
  transition: transform .12s ease, opacity .2s ease;
}
.notif-bell:hover { transform: translateY(-1px); opacity: .9; }
.notif-bell .badge {
  position: absolute; top: 2px; right: 0;
  background: #ef4444; color: #fff;
  border-radius: 999px; font-size: 11px; font-weight: 700;
  padding: 2px 6px; border: 1px solid rgba(255,255,255,.25);
}

/* Notification dropdown (glass panel like menu) */
.notif { position: relative; }  /* wrapper a harang köré */
.notif-panel,
.notif-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 320px;
  max-width: 90vw;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: 0 16px 40px rgba(0,0,0,.4);
  padding: 10px;
  z-index: 210;
}
.notif.open .notif-panel,
.notif.open .notif-dropdown { display: block; }

.notif-list { display: grid; gap: 8px; }
.notif-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 10px 12px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 10px;
}
.notif-item .meta { font-size: 12px; opacity: .85; }

/* Soft cream-red badge for NEW */
.badge-alert {
  background: #fde2e2;        /* krém piros */
  color: #b91c1c;             /* sötétebb piros szöveg */
  border: 1px solid rgba(185,28,28,.25);
}

/* Kijelentkezés */
.logout-btn {
  background: #ef4444; border: none; color: #fff;
  padding: 8px 16px; border-radius: 12px;
  font-weight: 600; cursor: pointer;
  transition: background .15s ease, transform .12s ease, box-shadow .2s ease;
  box-shadow: 0 8px 18px rgba(239,68,68,.25);
}
.logout-btn:hover { background: #dc2626; transform: translateY(-1px); }
.logout-btn:active { transform: translateY(0); }

/* ---------- Kártyák / Widgetek ---------- */
.card,
.glass-card {
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow: 0 18px 50px rgba(31, 41, 55, 0.28);
  padding: 18px;
  color: #0f172a;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease, background .25s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 58px rgba(31,41,55,.33);
  border-color: rgba(255,255,255,.6);
  background: rgba(255,255,255,.42);
}
.card h2 { margin: 0 0 8px; font-size: 18px; color: #0f172a; }

/* Lista elemek */
.list { display: grid; gap: 10px; }
.list .item {
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 12px;
  transition: background .2s ease, border-color .2s ease, transform .12s ease;
}
.list .item:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255,255,255,.2);
  transform: translateY(-1px);
}

/* ---------- Grid layout ---------- */
.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 12px;
}

/* ---------- Gombok ---------- */
.btn {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
  transition: background .2s, border-color .2s, transform .12s ease, box-shadow .2s ease;
  box-shadow: 0 8px 18px rgba(0,0,0,.2);
  font-weight: 700;
}
.btn:hover { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.25); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: #0f172a;
  color: #fff;
  border-color: rgba(255,255,255,.0);
  box-shadow: 0 10px 24px rgba(15,23,42,.35);
}
.btn.primary:hover { background: #111827; }
.btn.ghost {
  background: rgba(255,255,255,.85);
  color: #0f172a;
  border-color: rgba(255,255,255,.9);
  box-shadow: 0 10px 24px rgba(31,41,55,.15);
}
.btn.ghost:hover {
  background: rgba(255,255,255,.95);
}

/* Button variants */
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 10px; }
.btn.icon { width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }

/* Language pills like on the index hero */
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.85);
  color: #0f172a;
  font-weight: 700;
  font-size: 13px;
  border: 1px solid rgba(255,255,255,.95);
  box-shadow: 0 6px 16px rgba(31,41,55,.12);
}
.pill.active { background: #10bce0; color: #fff; border-color: transparent; }

/* ---------- Táblák ---------- */
table { width: 100%; border-collapse: collapse; color: #0f172a; }
th, td { padding: 10px 12px; border-top: 1px solid rgba(15, 23, 42, 0.08); }
th { color: rgba(15,23,42,.7); font-weight: 600; }

/* ---------- Form elemek ---------- */
select, textarea,
input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  background: rgba(255,255,255,.9);
  color: #0f172a;
  border: 1px solid rgba(15,23,42,.1);
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
input::placeholder, textarea::placeholder { color: rgba(15,23,42,.55); }
input:focus, select:focus, textarea:focus {
  border-color: rgba(37,99,235,.55);
  box-shadow: 0 0 0 3px rgba(37,99,235,.2);
  background: #fff;
}

/* ---------- Mikro animációk ---------- */
a { color: #1d4ed8; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Finom scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.2);
  border-radius: 10px;
  border: 2px solid rgba(0,0,0,0);
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.35); }

/* ---------- Modal (note dialog) ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }
.modal {
  width: min(560px, 92vw);
  background: rgba(255,255,255,.92);
  color: #0f172a;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 16px;
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 24px 70px rgba(31,41,55,.35);
  padding: 18px;
}
.modal header { font-weight: 800; margin-bottom: 10px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }

/* ---------- Feedback / Toast & inline save chip ---------- */

/* Inline "saved" badge you can place near a row or button */
.save-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  background: rgba(16, 185, 129, 0.16);            /* emerald-500 @ 16% */
  color: #065f46;                                   /* emerald-800 */
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: 0 8px 22px rgba(16, 185, 129, 0.20);
  backdrop-filter: blur(8px);
}
.save-badge.success {
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(16, 185, 129, 0.55);
}
.save-badge .dot {
  width: 8px; height: 8px; border-radius: 999px;
  background: #10b981;                              /* emerald-500 */
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

/* Bottom "toast" that slides up on save */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(12px);
  opacity: 0;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
  z-index: 10000;
  background: rgba(255,255,255,.92);
  color: #0f172a;
  border: 1px solid rgba(15,23,42,.12);
  box-shadow: 0 18px 40px rgba(31,41,55,.25);
  backdrop-filter: blur(10px);
  transition: transform .18s ease, opacity .18s ease;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.toast.success {
  background: linear-gradient(180deg, rgba(16,185,129,.95), rgba(5,150,105,.95));
  color: #fff;
  border: 1px solid rgba(16,185,129,.9);
  box-shadow: 0 20px 44px rgba(16,185,129,.35);
}

.toast.error {
  background: linear-gradient(180deg, rgba(239,68,68,.96), rgba(185,28,28,.96));
  color: #fff;
  border: 1px solid rgba(239,68,68,.9);
  box-shadow: 0 20px 44px rgba(239,68,68,.35);
}

/* --- Flash highlight on successful save (2s) --- */
/* Apply to a row or any input wrapper after a successful save, then remove after timeout */
tr.flash-ok,
.flash-ok,
.flash-ok input {
  outline: 2px solid #10b981; /* emerald-500 */
  box-shadow:
    0 0 0 3px rgba(16,185,129,.22),
    0 14px 34px rgba(16,185,129,.22);
  background: rgba(16,185,129,.08);
  transition: outline-color .25s ease, box-shadow .25s ease, background .25s ease;
}

/* ---------- Reszponzív finomítások ---------- */
@media (max-width: 900px) {
  .grid { gap: 14px; }
  .shell { padding: 70px 18px 36px; }
  .brand { font-size: 20px; }
}
@media (max-width: 600px) {
  .topbar { height: 50px; padding: 0 12px; }
  .shell { padding: 60px 14px 28px; }
  .brand { font-size: 18px; }
  .topright { gap: 8px; }
  .menu-panel { min-width: 220px; right: 0; }
  .btn, .menu-btn { padding: 8px 12px; font-size: 13px; }

  .topbar-left, .topbar-right, .topright { gap: 6px; }
  .menu-btn { padding: 6px 10px; }
}
@media (max-width: 400px) {
  .brand { font-size: 16px; }
  .topright { gap: 6px; }
  .langmenu select { padding: 4px 8px; font-size: 12px; }
}

/* ---------- Hasznos utilok ---------- */
.center { display: flex; align-items: center; justify-content: center; }
.row { display: flex; gap: 12px; align-items: center; }
.spacer { height: 16px; }
.maxw-1200 { max-width: 1200px; margin: 0 auto; }
.text-muted { color: rgba(255,255,255,.75); }

/* Index hero helper (big card) */
.hero-card {
  padding: 26px 28px;
  border-radius: 20px;
  background: rgba(255,255,255,.35);
  border: 1px solid rgba(255,255,255,.5);
  box-shadow: 0 22px 60px rgba(31,41,55,.28);
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ===== Warehouse page layout polish ===== */
.page-shell.container { max-width: 1280px; width: 100%; padding: 80px 16px 32px; margin: 0 auto; }

/* inline search bar */
.form-inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form-inline .search-input { flex: 1 1 360px; min-width: 220px; }

/* table spacing + zebra and hover */
.table { width: 100%; border-collapse: collapse; color: #0f172a; }
.table th, .table td { padding: 12px 14px; border-top: 1px solid rgba(15,23,42,.08); }
.table tr:nth-child(even) { background: rgba(255,255,255,.35); }
.table tr:hover { background: rgba(255,255,255,.5); }

/* adjust column width for qty controls*/
.col-adjust { width: 220px; }

/* page footer actions */
.page-actions { display: flex; justify-content: center; margin-top: 18px; }

/* small helper for the back link button that sits above tables */
.btn.back { background: rgba(255,255,255,.85); color: #0f172a; border-color: rgba(255,255,255,.95); }
.btn.back:hover { background: #fff; }


.form-inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.form-inline .search-input { flex: 1 1 480px; min-width: 220px; }

.modal-overlay.show {
  display: flex !important;
  opacity: 1;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
/* ===== Warehouse v2 – wide editable table polish ===== */

/* Wrap table to enable horizontal scroll on narrow screens while keeping a nice shadow */
/* stabilabb görgetés, ne mozduljon a body */
.table-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges; /* ahol támogatott: ne ugráljon a layout a scrollbar miatt */
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(31, 41, 55, 0.28);
  padding-bottom: 4px; /* hogy a vízszintes scrollbar ne takarja ki az alsó szegélyt */
}

/* kicsi, diszkrét vízszintes scrollbar csak a wrapra */
.table-wrap::-webkit-scrollbar { height: 10px; }
.table-wrap::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,.15);
  border-radius: 10px;
}

/* bal/jobb “fény” jelzés görgethető tartalomnál */
.table-wrap::before,
.table-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  width: 24px;
  height: 100%;
  pointer-events: none;
  opacity: .0;
  transition: opacity .15s ease;
  border-radius: 18px;
}
.table-wrap::before {
  left: 0;
  background: linear-gradient(to right, rgba(255,255,255,.55), rgba(255,255,255,0));
}
.table-wrap::after {
  right: 0;
  background: linear-gradient(to left, rgba(255,255,255,.55), rgba(255,255,255,0));
}
.table-wrap::before { opacity: calc(var(--has-scroll,0) * (1 - var(--at-start,0))); }
.table-wrap::after  { opacity: calc(var(--has-scroll,0) * (1 - var(--at-end,0))); }

/* ha szeretnél teljes megoldást: kis JS-sel jelezd amikor elindult/lejárt a scroll */

/* Dedicated warehouse table layout */
.table.warehouse {
  width: 100%;
  min-width: 1150px; /* keep columns readable on desktop */
  color: #0f172a;
  border-collapse: collapse;
  background: rgba(255,255,255,.35);
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 18px;
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
}
.table.warehouse th,
.table.warehouse td {
  padding: 12px 14px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  vertical-align: middle;
  white-space: nowrap;
}
.table.warehouse thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(255,255,255,.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Inputs inside cells: consistent height & radius */
.table.warehouse input[type="text"],
.table.warehouse input[type="number"] {
  height: 36px;
  border-radius: 10px;
  padding: 6px 10px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(15,23,42,.12);
  color: #0f172a;
}

/* Utility widths for tight columns */
.w-64  { width: 64px !important;  max-width: 64px !important; }
.w-80  { width: 80px !important;  max-width: 80px !important; }
.w-96  { width: 96px !important;  max-width: 96px !important; }
.w-120 { width: 120px !important; max-width: 120px !important; }
.w-160 { width: 160px !important; max-width: 160px !important; }

/* Apply narrower look to min/max/coord/extra fields */
.cell-narrow input { width: 80px; }
.cell-qty    input { width: 72px; text-align: center; }
.cell-code   input { width: 200px; }

/* Row "adjust" actions pinned to the right so they never jump out of view */
td.row-actions {
  position: sticky;
  right: 0;
  background: rgba(255,255,255,.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-left: 1px solid rgba(15,23,42,.08);
  box-shadow: -6px 0 14px rgba(31,41,55,.12);
  z-index: 2;
}

/* Compact action buttons in the adjust column */
.row-actions .btn { min-width: 34px; height: 34px; padding: 0 10px; font-size: 13px; border-radius: 10px; }
.row-actions .btn.icon { width: 34px; }

/* “Apply” button visual priority */
.row-actions .btn.apply {
  background: #0f172a;
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(15,23,42,.28);
}
.row-actions .btn.apply:hover { background: #111827; }

/* Better spacing for back button below the table */
.page-actions { margin-top: 22px; }

/* Mobile & tablet refinements */
@media (max-width: 1200px) {
  .table.warehouse { min-width: 1000px; }
}
@media (max-width: 992px) {
  .table.warehouse { min-width: 900px; }
  .cell-narrow input { width: 72px; }
}
@media (max-width: 768px) {
  .shell, .page-shell.container { padding-left: 12px; padding-right: 12px; }
  .table.warehouse { min-width: 760px; }
  .row-actions .btn { height: 32px; min-width: 32px; }
  .cell-code input { width: 250px; }
}
@media (max-width: 560px) {
  .table.warehouse { min-width: 700px; }
  .w-120 { width: 200px !important; }
  .cell-code input { width: 250px; }
}
/* ===== Toolbar layout (items & warehouse) ===== */
.toolbar { margin: 6px 0 12px; }
.toolbar__row{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;          /* prevent overlap on smaller widths */
}
.toolbar__left{
  display:flex;
  align-items:center;
  gap:12px;
  flex:1 1 auto;
  min-width:0;
}
.toolbar__right{
  margin-left:auto;        /* push right-side actions to the edge */
  flex:0 0 auto;
}
/* Stretch search input to the end of the container */
.input--lg.input--stretch{
  flex:1 1 640px;
  min-width:260px;
}
/* Make the search field solid white with dark text */
.toolbar--search .input,
.toolbar--search input[type="text"],
.toolbar--search input[type="search"]{
  background:#ffffff !important;
  color:#0f172a !important;
  border:1px solid rgba(15,23,42,.14);
}
.toolbar--search .input::placeholder,
.toolbar--search input::placeholder{
  color:#6b7280; /* neutral placeholder */
}
/* Keep the warehouse selector a stable width; prevent wrap jitter */
.toolbar--search .select{
  flex:0 0 260px;
  min-width:220px;
}

/* Avoid toolbar element overlap & keep buttons from stretching */
.toolbar__row > * { flex: 0 0 auto; }
.toolbar .btn { flex: 0 0 auto; }

/* Ensure the stretch input actually grows to the edge */
.toolbar__left .input--stretch,
.input--stretch.input--lg { flex: 1 1 640px; min-width: 260px; }

/* Solid white search field with dark text (enforced) */
.toolbar--search .search-input,
.toolbar--search .input--stretch,
.toolbar--search input[type="search"],
.toolbar--search input[type="text"] {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid rgba(15,23,42,.14);
}
.toolbar--search input::placeholder { color: #6b7280; }

/* Consolidated qty controls (single source of truth) */
.qty-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.qty-controls .btn {
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  line-height: 36px;
}
.qty-controls input[type="number"],
.qty-controls input[type="text"] {
  width: 72px;
  height: 36px;
  text-align: center;
}

/* Generic dropdown helper (used by ui.php or anywhere) */
.dropdown { position: relative; }
.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 14px;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: 0 16px 40px rgba(0,0,0,.4);
  padding: 10px;
  z-index: 200;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button {
  width: 100%;
  display: flex; gap: 10px; align-items: center;
  padding: 10px 12px; border-radius: 10px; text-decoration: none; color: #fff;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15);
  transition: background .2s, border-color .2s, transform .12s;
}
.dropdown-menu a:hover, .dropdown-menu button:hover {
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.25);
  transform: translateY(-1px);
}

/* keep actions from overlapping; wrap neatly on small widths */
.list .item > *:last-child {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hidden { display: none !important; }
.menu-btn { padding: 4px 8px; }
/* reinforce: nested inputs are also solid white */
.toolbar--search .input--stretch input,
.toolbar--search .search-input input {
  background: #fff !important;
  color: #0f172a !important;
}

/* --- TOPBAR --- */
.topbar.nova-topbar{
  position: sticky; top:0; z-index:1000;
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 18px; backdrop-filter: blur(12px);
  background: linear-gradient(180deg, rgba(255,255,255,0.20), rgba(255,255,255,0.08));
  border-bottom: 1px solid rgba(255,255,255,0.18);
}
.topbar .brand-link{ font-weight:800; letter-spacing:.4px; color:#fff; text-decoration:none; }
.topbar .brand-link span{ opacity:.9; font-weight:600; }

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

.btn{ border:0; border-radius:14px; padding:8px 14px; cursor:pointer; }
.btn-glass{
  background: rgba(255,255,255,.16); color:#fff;
  box-shadow: 0 8px 22px rgba(0,0,0,.2) inset, 0 8px 18px rgba(0,0,0,.08);
}
.icon-btn{ width:38px; height:38px; display:inline-flex; align-items:center; justify-content:center; }
.btn-danger{ background:#e23b3b; color:#fff; box-shadow:0 8px 18px rgba(226,59,59,.3); }
.btn-danger:hover{ filter:brightness(1.05); }

.lang-switch select{
  appearance:none; border-radius:14px; border:1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.9); color:#111; padding:8px 36px 8px 12px;
}

/* --- DROPDOWN --- */
.dropdown{ position:relative; }
.dropdown-menu{
  position:absolute; right:0; margin-top:10px; min-width:220px;
  background: rgba(255,255,255,.92); color:#111; border-radius:16px;
  box-shadow:0 12px 28px rgba(3,10,38,.28);
  padding:10px; border:1px solid rgba(255,255,255,.6);
}
.dropdown-sm{ min-width:280px; }
.dropdown-menu a{ display:block; padding:10px 12px; border-radius:10px; color:#111; text-decoration:none; }
.dropdown-menu a:hover{ background:rgba(0,0,0,.06); }

.dropdown-head{ font-weight:700; padding:6px 8px 8px; }
.dropdown-body{ max-height:260px; overflow:auto; }
.dropdown-foot{ padding-top:6px; text-align:right; }
.link{ color:#1e3a8a; text-decoration:underline; }

/* --- NOTIF BADGE --- */
.badge{ display:inline-flex; align-items:center; justify-content:center; font-size:11px; line-height:1; }
.badge-alert{
  position:absolute; right:-4px; top:-4px; min-width:18px; height:18px; border-radius:999px;
  background:#ff5d5d; color:#fff; padding:0 5px; box-shadow:0 0 0 2px rgba(0,0,0,.12);
}
.has-alert{ outline: 2px solid #ffb9b9; }

/* --- FOOTER --- */
.footer{ margin:40px auto 24px; text-align:center; color:#eee; opacity:.9; }

/* űveg input/gomb egységes stílus maradhat a meglévő fájlodban */

/* ===== Item New form polish (Új tétel) ===== */
.item-form {
  max-width: 980px; margin: 24px auto;
  padding: 20px; border-radius: 18px;
  background: rgba(255,255,255,.35);
  border: 1px solid rgba(255,255,255,.45);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow: 0 18px 50px rgba(31,41,55,.28);
  color: #0f172a;
}

/* rács: bal (alapmezők) + jobb (location/min/max/fájlok) */
.item-form .grid-2 {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 16px 22px;
}

/* egységes sorok */
.item-form .form-row { display: flex; flex-direction: column; gap: 6px; }
.item-form .form-row-inline { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.item-form label { font-weight: 600; color: rgba(15,23,42,.8); }

/* inputok egységesítése (örökli a globális definíciókat) */
.item-form input[type="text"],
.item-form input[type="number"],
.item-form input[type="email"],
.item-form input[type="password"],
.item-form select,
.item-form textarea {
  height: 40px; padding: 10px 12px; border-radius: 12px;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(15,23,42,.12);
}
.item-form textarea { height: 130px; resize: vertical; }

/* location mini-grid (sor / oszlop) – ha nincs extra markup, az attr szelektor is segít */
.item-form .loc-grid,
.item-form .qty-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.item-form input[name*="loc_row"], .item-form input[name*="loc_col"],
.item-form input[name*="min"], .item-form input[name*="max"] {
  text-align: left;
}

/* fájlfeltöltés blokk */
.item-form .files { padding: 10px; border-radius: 12px; background: rgba(255,255,255,.6); }
.item-form .hint { font-size: 12px; color: rgba(15,23,42,.6); }

/* alsó gombsor */
.item-form .actions {
  display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px;
}
.item-form .btn-primary {
  background: #0f172a; color: #fff; border: 0;
  box-shadow: 0 12px 28px rgba(15,23,42,.32);
}
.item-form .btn-primary:hover { background:#111827; }
.item-form .btn-ghost {
  background: rgba(255,255,255,.9); color:#0f172a; border:1px solid rgba(15,23,42,.12);
}

/* fejléccím */
.item-form .title { font-size: 24px; font-weight: 800; margin: 0 0 8px; }

/* reszponzív törés */
@media (max-width: 860px) {
  .item-form .grid-2 { grid-template-columns: 1fr; }
  .item-form .form-row-inline,
  .item-form .loc-grid,
  .item-form .qty-grid { grid-template-columns: 1fr; }
}

/* Modal centering fix (universal mobile/desktop) */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  overflow: hidden;
  backdrop-filter: blur(3px);
}

.modal {
  position: relative;
  background: #fff;
  color: #000;
  width: min(92vw, 480px);
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  overflow-y: auto;
  max-height: 85dvh;
  margin: 0 auto;
  transform: translateY(0);
  animation: modalFadeIn 0.25s ease-out;
}

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

html.modal-open, body.modal-open {
  overflow: hidden !important;
  height: 100%;
}

/* iOS specific fix */
@supports (-webkit-touch-callout: none) {
  .modal-backdrop {
    height: 100vh;
  }
}
