/* Alapszinek, arnyekok es ujrahasznalhato valtozok */
:root {
  --bg: #f2efe8;
  --panel: rgba(255, 252, 245, 0.92);
  --panel-strong: #fffaf0;
  --text: #1f1a14;
  --muted: #6e655a;
  --line: rgba(31, 26, 20, 0.12);
  --accent: #c96f1a;
  --accent-deep: #8d4b12;
  --steel: #374151;
  --warning: #d97706;
  --info: #2563eb;
  --success: #15803d;
  --danger: #b91c1c;
  --shadow: 0 24px 60px rgba(40, 25, 10, 0.12);
  --hero-text: rgba(255, 248, 240, 0.84);
  --hero-stat-bg: rgba(255, 248, 240, 0.1);
  --hero-stat-border: rgba(255, 248, 240, 0.18);
  --hero-stat-label: rgba(255, 248, 240, 0.76);
  --switch-bg: rgba(255, 252, 245, 0.92);
  --input-bg: rgba(255, 255, 255, 0.85);
  --checkbox-bg: rgba(255, 255, 255, 0.7);
  --table-bg: rgba(255, 255, 255, 0.8);
  --table-head-bg: #f4ecde;
  --theme-btn-bg: rgba(255, 252, 245, 0.92);
  --theme-btn-text: #473b30;
  --theme-btn-border: rgba(31, 26, 20, 0.08);
}

body[data-theme="dark"] {
  --bg: #1d232b;
  --panel: rgba(37, 45, 54, 0.94);
  --panel-strong: #293340;
  --text: #d8e2ee;
  --muted: #93a4b8;
  --line: rgba(147, 164, 184, 0.18);
  --accent: #4aa3ff;
  --accent-deep: #0f5ea8;
  --steel: #c2d0de;
  --warning: #f59e0b;
  --info: #60a5fa;
  --success: #22c55e;
  --danger: #f87171;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
  --hero-text: rgba(225, 233, 243, 0.84);
  --hero-stat-bg: rgba(15, 23, 42, 0.42);
  --hero-stat-border: rgba(96, 165, 250, 0.16);
  --hero-stat-label: rgba(203, 213, 225, 0.78);
  --switch-bg: rgba(37, 45, 54, 0.96);
  --input-bg: rgba(20, 26, 34, 0.9);
  --checkbox-bg: rgba(20, 26, 34, 0.9);
  --table-bg: rgba(20, 26, 34, 0.88);
  --table-head-bg: #2b3642;
  --theme-btn-bg: rgba(37, 45, 54, 0.96);
  --theme-btn-text: #d8e2ee;
  --theme-btn-border: rgba(96, 165, 250, 0.16);
}

/* Altalanos box modell */
* {
  box-sizing: border-box;
}

/* Oldal teljes hattere es alap tipografia */
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(201, 111, 26, 0.18), transparent 24%),
    linear-gradient(135deg, #e6dfd2 0%, #f7f2e8 45%, #efe6d8 100%);
}

body[data-theme="dark"] {
  background:
    radial-gradient(circle at top left, rgba(74, 163, 255, 0.14), transparent 24%),
    radial-gradient(circle at top right, rgba(15, 94, 168, 0.1), transparent 24%),
    linear-gradient(145deg, #171c22 0%, #20262e 45%, #12171d 100%);
}

/* Halos mintazatu, finom overlay a hatter felett */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.025) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent);
}

/* A teljes tartalmi keret szelessege es kulso terkozei */
.site-shell {
  width: min(1300px, calc(100% - 32px));
  margin: 0 auto;
  padding: 14px 0 48px;
}

.login-shell {
  display: grid;
  align-items: center;
  min-height: 100vh;
  padding: 32px 0;
}

.login-page {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 22px;
  align-items: center;
  min-height: calc(100vh - 64px);
}

.login-copy {
  display: grid;
  gap: 18px;
  padding: 28px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(12, 18, 26, 0.22);
  box-shadow: var(--shadow);
}

.brand-logo {
  display: block;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 16px 28px rgba(0, 0, 0, 0.22));
}

.brand-logo-login {
  max-width: 152px;
}

.brand-logo-hero {
  max-width: 132px;
  margin-bottom: 2px;
}

.login-copy h1 {
  margin: 0;
  font-family: "Bahnschrift", "Arial Narrow", "Segoe UI", sans-serif;
  font-size: clamp(2.2rem, 4vw, 4rem);
  line-height: 0.98;
  text-transform: uppercase;
}

.login-panel {
  max-width: 520px;
  width: 100%;
  justify-self: end;
}

body[data-theme="dark"] .login-copy {
  background:
    radial-gradient(circle at top left, rgba(74, 163, 255, 0.16), transparent 34%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015)),
    rgba(20, 26, 34, 0.74);
}

/* Temavaltas gomb a hero felett */
.theme-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  position: sticky;
  top: 10px;
  z-index: 20;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.session-chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 800;
  box-shadow: var(--shadow);
}

.secondary-theme-btn {
  box-shadow: none;
}

.is-hidden {
  display: none !important;
}

.theme-toggle-btn {
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--theme-btn-border);
  background: var(--theme-btn-bg);
  color: var(--theme-btn-text);
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 180ms ease, background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

.install-prompt {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 40;
  display: grid;
  gap: 12px;
  width: min(360px, calc(100vw - 24px));
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.install-prompt strong {
  display: block;
  margin-bottom: 6px;
  font-size: 0.98rem;
}

.install-prompt p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.install-prompt-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.install-prompt .primary-btn,
.install-prompt .theme-toggle-btn {
  min-width: 104px;
}

.theme-toggle-btn:hover {
  transform: translateY(-1px);
}

/* Felso hero blokk ket oszlopos elrendezessel */
.hero {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 11px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 19px;
  background:
    linear-gradient(120deg, rgba(33, 28, 22, 0.9), rgba(65, 49, 31, 0.83)),
    linear-gradient(90deg, rgba(201, 111, 26, 0.12), transparent);
  color: #fff8f0;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

body[data-theme="dark"] .hero {
  border-color: rgba(255, 255, 255, 0.08);
  background: var(--panel);
  color: var(--text);
}

/* Halvany, fekvo muszaki rajz jellegu csoszereles a hero hattereben */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  -webkit-mask-image: none;
  mask-image: none;
  background: none;
}

body[data-theme="dark"] .hero::before {
  opacity: 0;
  filter: none;
}

/* Dekorativ kor a hero jobb also reszen */
.hero::after {
  content: "";
  position: absolute;
  inset: auto -8% -45% auto;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  z-index: 0;
  background: radial-gradient(circle, rgba(201, 111, 26, 0.32), transparent 68%);
}

body[data-theme="dark"] .hero::after {
  background: radial-gradient(circle, rgba(74, 163, 255, 0.12), transparent 68%);
}

.hero-copy,
.hero-panel {
  position: relative;
  z-index: 1;
}

/* Kis cimkek: oldalazonosito, uj tetel, attekintes */
.eyebrow,
.section-tag {
  margin: 0 0 5px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.62rem;
  font-weight: 700;
}

/* Focim es panelcimek tipografiaja */
.hero h1,
.panel h2 {
  margin: 0;
  font-family: "Bahnschrift", "Arial Narrow", "Segoe UI", sans-serif;
  font-weight: 600;
  line-height: 1.05;
  text-transform: uppercase;
}

/* Hero focim merete */
.hero h1 {
  max-width: 11ch;
  font-size: clamp(1.2rem, 2.3vw, 1.95rem);
}

/* Hero leiro szoveg */
.hero-text {
  max-width: 52ch;
  margin: 5px 0 0;
  color: var(--hero-text);
  font-size: 0.78rem;
  line-height: 1.28;
}

/* Hero jobb oldali stat dobozok tartalya */
.hero-panel {
  display: grid;
  gap: 10px;
  align-content: end;
}

/* Hero stat kartya */
.hero-stat {
  min-height: 94px;
  padding: 16px 18px 14px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 242, 231, 0.82));
  border: 1px solid rgba(31, 26, 20, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.hero-stat-active {
  background: linear-gradient(180deg, rgba(243, 244, 246, 0.98), rgba(229, 231, 235, 0.86));
  border-color: rgba(107, 114, 128, 0.18);
}

.hero-stat-draft {
  background: linear-gradient(180deg, rgba(254, 226, 226, 0.98), rgba(254, 202, 202, 0.88));
  border-color: rgba(185, 28, 28, 0.28);
}

.hero-stat-urgent {
  background: linear-gradient(180deg, rgba(255, 237, 213, 0.98), rgba(253, 186, 116, 0.88));
  border-color: rgba(234, 88, 12, 0.24);
}

body[data-theme="dark"] .hero-stat {
  background: linear-gradient(180deg, rgba(35, 42, 50, 0.98), rgba(26, 32, 39, 0.94));
  border-color: rgba(96, 165, 250, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body[data-theme="dark"] .hero-stat-active {
  background: linear-gradient(180deg, rgba(55, 65, 81, 0.98), rgba(31, 41, 55, 0.94));
  border-color: rgba(156, 163, 175, 0.22);
}

body[data-theme="dark"] .hero-stat-draft {
  background: linear-gradient(180deg, rgba(82, 35, 41, 0.98), rgba(58, 24, 29, 0.94));
  border-color: rgba(248, 113, 113, 0.24);
}

body[data-theme="dark"] .hero-stat-urgent {
  background: linear-gradient(180deg, rgba(116, 56, 14, 0.98), rgba(90, 40, 10, 0.94));
  border-color: rgba(251, 146, 60, 0.28);
}

/* Hero stat kartya felirata */
.hero-stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 8px;
}

/* Hero stat kartya szama */
.hero-stat strong {
  font-family: "Bahnschrift", "Arial Narrow", "Segoe UI", sans-serif;
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Fo tartalom oszlopai / blokkjai */
.dashboard {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 12px;
  align-items: start;
}

.dashboard.is-disabled {
  opacity: 0.45;
  pointer-events: none;
  filter: grayscale(0.12);
}

/* Uj tetel / Attekintes valto gombsor */
.view-switch {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: min(100%, 640px);
  padding: 8px;
  border-radius: 20px;
  background: var(--switch-bg);
  border: 1px solid rgba(31, 26, 20, 0.08);
  box-shadow: var(--shadow);
}

.view-switch-wide {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(100%, 860px);
}

body[data-theme="dark"] .view-switch {
  border-color: rgba(96, 165, 250, 0.16);
}

/* Valto gombok alap stilusa */
.view-switch-btn {
  padding: 12px 16px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

/* Aktiv nezet gomb */
.view-switch-btn.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  box-shadow: 0 12px 24px rgba(141, 75, 18, 0.18);
}

/* Hover effekt a valto gombokra */
.view-switch-btn:hover {
  transform: translateY(-1px);
}

/* Alapbol minden kapcsolhato panel rejtett */
.panel[data-view-panel] {
  display: none;
}

/* Csak az aktiv panel latszik */
.panel[data-view-panel].is-active {
  display: block;
}

/* Altalanos paneldoboz stilus */
.panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 26px;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

/* Panel fejlec also margoja */
.panel-heading {
  margin-bottom: 22px;
}

.auth-panel {
  margin-top: 12px;
}

.auth-layout,
.user-admin-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

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

.users-panel-side {
  display: grid;
  gap: 14px;
}

.compact-filters {
  grid-template-columns: 1.4fr 0.8fr;
}

.users-filters {
  grid-template-columns: 1.4fr 0.8fr 0.8fr;
}

.audit-filters {
  grid-template-columns: 1.4fr 0.8fr;
  margin-bottom: 12px;
}

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

.four-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.item-entry-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.15fr 1.05fr 0.8fr 1fr 0.9fr;
  gap: 14px;
  align-items: end;
}

.line-items-editor-head {
  display: grid;
  grid-template-columns: 0.9fr 1.15fr 1.05fr 0.8fr 1fr 0.9fr;
  gap: 14px;
  margin-bottom: 10px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.line-items-editor {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.line-item-row {
  padding: 0;
  align-items: center;
}

.line-item-row label {
  margin: 0;
}

.line-item-remove-btn {
  grid-column: 1 / -1;
  justify-self: flex-end;
}

.edit-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(74, 163, 255, 0.12);
}

.panel-users .user-admin-panel {
  display: grid;
  gap: 16px;
}

.auth-form,
.user-form,
.auth-info-box {
  display: grid;
  gap: 14px;
}

.auth-info-box {
  align-content: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .auth-info-box {
  background: rgba(20, 26, 34, 0.66);
}

.profile-meta {
  display: grid;
  gap: 12px;
}

.profile-meta-row {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

body[data-theme="dark"] .profile-meta-row {
  background: rgba(11, 17, 24, 0.72);
}

.profile-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-meta-row strong {
  font-size: 1rem;
  color: var(--text);
}

.profile-role-help {
  margin-top: -2px;
}

.auth-info-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.5;
}

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

.login-role-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
}

.login-role-card span {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}

.login-role-card strong,
.login-role-card small {
  font-size: 0.9rem;
}

.login-role-card code {
  font-size: 0.86rem;
}

.inline-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.inline-note[data-state="success"] {
  color: var(--success);
}

.inline-note[data-state="error"] {
  color: var(--danger);
}

.auth-panel.is-logged-in .auth-form {
  display: none;
}

.users-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.4);
}

body[data-theme="dark"] .users-table-wrap {
  background: rgba(20, 26, 34, 0.66);
}

.users-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
}

.users-table th,
.users-table td {
  padding: 14px;
  text-align: left;
  border-top: 1px solid var(--line);
}

.users-table thead th {
  border-top: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Panel cim merete */
.panel h2 {
  font-size: 2rem;
}

/* Urlap es szuro reszek alap gridje */
.order-form,
.filters {
  display: grid;
  gap: 16px;
}

.inline-heading {
  display: grid;
  gap: 4px;
}

.inline-heading strong {
  font-size: 0.95rem;
}

.inline-heading span {
  color: var(--muted);
  font-size: 0.82rem;
}

/* Ketoszlopos urlapmezok */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

/* Label megjelenese */
label {
  display: grid;
  gap: 8px;
  font-size: 0.93rem;
  color: var(--steel);
  font-weight: 700;
}

/* Azonos font a form elemeknek es gomboknek */
input,
select,
textarea,
button {
  font: inherit;
}

/* Mezo alapstilus */
input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--input-bg);
  padding: 14px 14px;
  color: var(--text);
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

select {
  -webkit-appearance: none;
  appearance: none;
}

body[data-theme="dark"] select,
body[data-theme="dark"] textarea,
body[data-theme="dark"] input {
  color-scheme: dark;
}

body[data-theme="dark"] select option,
body[data-theme="dark"] select optgroup {
  background: #141a22;
  color: #d8e2ee;
}

/* Fokusz allapot a mezokre */
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(201, 111, 26, 0.8);
  box-shadow: 0 0 0 4px rgba(201, 111, 26, 0.12);
  transform: translateY(-1px);
}

/* Megjegyzes mezo meretezese */
textarea {
  resize: vertical;
  min-height: 110px;
}

/* Surgos checkbox doboza */
.checkbox-row {
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--checkbox-bg);
}

/* A checkbox tenyleges stilusa */
.checkbox-row input {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
  padding: 0;
  box-shadow: none;
  transform: none;
}

/* Kattinthato gombok kozos alapjai */
.primary-btn,
.secondary-btn,
.status-btn,
.delete-btn {
  border: 0;
  cursor: pointer;
  transition: transform 180ms ease, opacity 180ms ease, box-shadow 180ms ease;
}

/* Hover megemeles a gombokon */
.primary-btn:hover,
.secondary-btn:hover,
.status-btn:hover,
.delete-btn:hover {
  transform: translateY(-1px);
}

.form-actions-row {
  display: flex;
  justify-content: flex-start;
}

/* Fo mentes gomb */
.primary-btn {
  padding: 15px 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: white;
  font-weight: 800;
  box-shadow: 0 16px 28px rgba(141, 75, 18, 0.22);
}

.secondary-btn {
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(201, 111, 26, 0.12);
  color: var(--accent-deep);
  font-weight: 800;
}

body[data-theme="dark"] .secondary-btn {
  background: rgba(74, 163, 255, 0.16);
  color: #a9d5ff;
}

.draft-box {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.45);
}

body[data-theme="dark"] .draft-box {
  background: rgba(20, 26, 34, 0.66);
}

.draft-box-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.draft-box-head strong {
  font-size: 0.95rem;
}

.draft-box-head span {
  color: var(--muted);
  font-size: 0.82rem;
}

.draft-items {
  display: grid;
  gap: 10px;
}

.draft-empty {
  color: var(--muted);
  font-size: 0.88rem;
}

.draft-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(31, 26, 20, 0.08);
}

.draft-item-index {
  min-width: 78px;
  font-weight: 800;
  color: var(--muted);
}

.draft-item-details {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.draft-item-details span {
  display: block;
  margin-bottom: 4px;
  font-size: 0.76rem;
  color: var(--muted);
}

.draft-item-details strong {
  display: block;
  line-height: 1.35;
}

.draft-item-controls {
  display: grid;
  gap: 8px;
  min-width: 150px;
}

body[data-theme="dark"] .draft-item {
  background: rgba(35, 42, 50, 0.9);
  border-color: rgba(96, 165, 250, 0.12);
}

.draft-item strong {
  display: block;
  margin-bottom: 4px;
}

.draft-item small {
  display: block;
  color: var(--muted);
  line-height: 1.45;
}

.draft-remove-btn {
  border: 0;
  border-radius: 12px;
  background: rgba(185, 28, 28, 0.1);
  color: var(--danger);
  padding: 8px 10px;
  font-weight: 800;
  cursor: pointer;
}

.order-badge {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(74, 163, 255, 0.12);
  color: var(--info);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.batch-row td {
  padding: 0;
}

.batch-card {
  display: grid;
  gap: 14px;
  padding: 16px 18px;
}

.batch-summary {
  display: grid;
  grid-template-columns: 1.7fr 0.65fr 0.85fr 0.65fr 0.75fr 0.75fr 0.75fr 0.9fr;
  gap: 14px;
  align-items: center;
  cursor: pointer;
  border-radius: 16px;
  padding: 10px;
  transition: background-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.batch-summary:hover {
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.batch-summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

body[data-theme="dark"] .batch-summary:hover {
  background: rgba(255, 255, 255, 0.04);
}

.batch-main strong,
.batch-meta strong {
  display: block;
  font-size: 0.95rem;
}

.batch-main {
  min-width: 0;
}

.batch-main small,
.batch-meta small {
  color: var(--muted);
  line-height: 1.4;
}

.batch-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .batch-meta {
  background: rgba(12, 18, 26, 0.26);
}

.batch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
}

.batch-edit-timer {
  display: grid;
  gap: 2px;
  min-width: 132px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.18);
  text-align: left;
}

.batch-edit-timer strong {
  font-size: 0.78rem;
  color: #fbbf24;
}

.batch-edit-timer small {
  color: #fde68a;
  font-size: 0.8rem;
  line-height: 1.3;
}

.batch-status-select {
  min-width: 118px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--input-bg);
  color: var(--text);
  padding: 8px 10px;
  font-weight: 700;
}

.batch-toggle-btn,
.batch-delete-btn {
  border: 0;
  border-radius: 12px;
  padding: 8px 10px;
  font-weight: 800;
  cursor: pointer;
}

.batch-toggle-btn {
  background: rgba(55, 65, 81, 0.1);
  color: var(--steel);
}

.batch-delete-btn {
  background: rgba(185, 28, 28, 0.1);
  color: var(--danger);
}

body[data-theme="dark"] .batch-toggle-btn {
  background: rgba(148, 163, 184, 0.16);
  color: #d8e2ee;
}

.batch-items {
  display: grid;
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid rgba(31, 26, 20, 0.08);
}

.batch-info-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 4px 2px 10px;
  font-size: 0.84rem;
  color: var(--muted);
}

body[data-theme="dark"] .batch-items {
  border-top-color: rgba(147, 164, 184, 0.12);
}

.batch-item {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 1fr auto;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

body[data-theme="dark"] .batch-item {
  background: rgba(255, 255, 255, 0.04);
}

.batch-item strong {
  display: block;
  margin-bottom: 4px;
}

.batch-item small {
  color: var(--muted);
  line-height: 1.35;
}

.batch-item-side {
  display: grid;
  gap: 3px;
  align-content: start;
}

.batch-item-side span {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.batch-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  align-content: start;
}

/* Attekintes panel fejlec: cim balra, szurok jobbra */
.board-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
}

/* Szuro blokk max szelessege */
.filters {
  min-width: min(100%, 430px);
  align-items: start;
}

.board-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

/* Felso statusz stat kartyak racsa */
.stats-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 14px;
  margin-bottom: 20px;
}

/* Egy stat kartya alap megjelenese */
.stat-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 190px;
  max-width: 220px;
  padding: 16px 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 242, 231, 0.82));
  border: 1px solid rgba(31, 26, 20, 0.08);
  cursor: pointer;
  text-align: left;
}

/* Uj statusz stat kartya */
.stat-card-uj {
  background: linear-gradient(180deg, rgba(254, 226, 226, 0.98), rgba(254, 202, 202, 0.88));
  border-color: rgba(185, 28, 28, 0.28);
}

/* Rendelve statusz stat kartya */
.stat-card-rendelve {
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.96), rgba(219, 234, 254, 0.84));
  border-color: rgba(37, 99, 235, 0.18);
}

/* Uton statusz stat kartya */
.stat-card-uton {
  background: linear-gradient(180deg, rgba(241, 245, 249, 0.96), rgba(226, 232, 240, 0.84));
  border-color: rgba(100, 116, 139, 0.18);
}

/* Megjott statusz stat kartya */
.stat-card-megjott {
  background: linear-gradient(180deg, rgba(240, 253, 244, 0.96), rgba(220, 252, 231, 0.84));
  border-color: rgba(21, 128, 61, 0.18);
}

.stat-card-reszbenmegjott {
  background: linear-gradient(180deg, rgba(254, 249, 195, 0.98), rgba(253, 230, 138, 0.86));
  border-color: rgba(202, 138, 4, 0.2);
}

.stat-card-ossz {
  background: linear-gradient(180deg, rgba(243, 244, 246, 0.98), rgba(229, 231, 235, 0.86));
  border-color: rgba(107, 114, 128, 0.18);
}

body[data-theme="dark"] .stat-card {
  background: linear-gradient(180deg, rgba(35, 42, 50, 0.98), rgba(26, 32, 39, 0.94));
  border-color: rgba(96, 165, 250, 0.14);
}

body[data-theme="dark"] .stat-card-uj {
  background: linear-gradient(180deg, rgba(82, 35, 41, 0.98), rgba(58, 24, 29, 0.94));
  border-color: rgba(248, 113, 113, 0.24);
}

body[data-theme="dark"] .stat-card-rendelve {
  background: linear-gradient(180deg, rgba(28, 48, 77, 0.98), rgba(18, 34, 56, 0.94));
  border-color: rgba(96, 165, 250, 0.24);
}

body[data-theme="dark"] .stat-card-uton {
  background: linear-gradient(180deg, rgba(46, 53, 63, 0.98), rgba(31, 38, 47, 0.94));
  border-color: rgba(148, 163, 184, 0.22);
}

body[data-theme="dark"] .stat-card-megjott {
  background: linear-gradient(180deg, rgba(24, 59, 46, 0.98), rgba(17, 43, 34, 0.94));
  border-color: rgba(34, 197, 94, 0.22);
}

body[data-theme="dark"] .stat-card-reszbenmegjott {
  background: linear-gradient(180deg, rgba(91, 62, 18, 0.98), rgba(63, 43, 13, 0.94));
  border-color: rgba(245, 158, 11, 0.24);
}

body[data-theme="dark"] .stat-card-ossz {
  background: linear-gradient(180deg, rgba(55, 65, 81, 0.98), rgba(31, 41, 55, 0.94));
  border-color: rgba(156, 163, 175, 0.22);
}

/* Stat kartya felirata */
.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 8px;
}

/* Stat kartya szamerteke */
.stat-card strong {
  font-family: "Bahnschrift", "Arial Narrow", "Segoe UI", sans-serif;
  font-size: 2rem;
  letter-spacing: 0.02em;
  color: var(--text);
}

.stat-card-uj strong {
  color: #fca5a5;
}

.stat-card-rendelve strong {
  color: #93c5fd;
}

.stat-card-uton strong {
  color: #cbd5e1;
}

.stat-card-reszbenmegjott strong {
  color: #fbbf24;
}

.stat-card-megjott strong {
  color: #86efac;
}

.stat-card-ossz strong {
  color: #e5e7eb;
}

.stat-card.is-active {
  box-shadow: 0 0 0 2px rgba(126, 184, 255, 0.4), 0 18px 34px rgba(0, 0, 0, 0.16);
  transform: translateY(-1px);
}

/* Tabla kulso kerete */
.table-wrap {
  overflow: auto;
  border-radius: 24px;
  border: 1px solid rgba(31, 26, 20, 0.08);
  background: var(--table-bg);
}

body[data-theme="dark"] .table-wrap {
  border-color: rgba(96, 165, 250, 0.16);
}

/* Tabla alap viselkedese */
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 880px;
}

/* Tabla fejlec */
thead th {
  position: sticky;
  top: 0;
  text-align: left;
  padding: 16px;
  background: var(--table-head-bg);
  color: #473b30;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

body[data-theme="dark"] thead th {
  color: #d8e2ee;
}

.sort-btn {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

.sort-btn.is-active {
  color: var(--accent);
}

/* Tabla cellak */
tbody td {
  padding: 16px;
  border-top: 1px solid rgba(31, 26, 20, 0.08);
  vertical-align: top;
}

body[data-theme="dark"] tbody td {
  border-top-color: rgba(147, 164, 184, 0.12);
}

/* Tabla sorok animacioja */
tbody tr {
  transition: background-color 150ms ease;
}

/* Sor kiemeles hoverre */
tbody tr:hover {
  background: rgba(201, 111, 26, 0.05);
}

body[data-theme="dark"] tbody tr:hover {
  background: rgba(74, 163, 255, 0.08);
}

/* Anyag neve, statusz es prioritas badge-ek alapjai */
.material-cell strong,
.status-pill,
.priority-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
}

/* Anyag nev stilusa */
.material-cell strong {
  margin-bottom: 8px;
  font-size: 1rem;
}

/* Anyag alatti kiegeszito szoveg */
.material-cell small {
  display: block;
  color: var(--muted);
  line-height: 1.5;
}

/* Statusz es prioritas pillak */
.status-pill,
.priority-pill {
  padding: 7px 11px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Statusz badge szinek */
.status-uj { background: rgba(185, 28, 28, 0.16); color: var(--danger); }
.status-rendelve { background: rgba(37, 99, 235, 0.12); color: var(--info); }
.status-uton { background: rgba(100, 116, 139, 0.12); color: var(--steel); }
.status-megjott { background: rgba(21, 128, 61, 0.13); color: var(--success); }
.status-reszbenmegjott { background: rgba(202, 138, 4, 0.16); color: #b45309; }

/* Teljes sorszin az Uj allapothoz */
.status-row-uj {
  background: linear-gradient(90deg, rgba(185, 28, 28, 0.14), rgba(255, 255, 255, 0.66));
}

/* Teljes sorszin a Rendelve allapothoz */
.status-row-rendelve {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.1), rgba(255, 255, 255, 0.7));
}

/* Teljes sorszin az Uton allapothoz */
.status-row-uton {
  background: linear-gradient(90deg, rgba(100, 116, 139, 0.12), rgba(255, 255, 255, 0.72));
}

/* Teljes sorszin a Megjott allapothoz */
.status-row-megjott {
  background: linear-gradient(90deg, rgba(21, 128, 61, 0.1), rgba(255, 255, 255, 0.72));
}

.status-row-reszbenmegjott {
  background: linear-gradient(90deg, rgba(202, 138, 4, 0.12), rgba(255, 255, 255, 0.72));
}

body[data-theme="dark"] .status-row-uj {
  background: linear-gradient(90deg, rgba(127, 29, 29, 0.44), rgba(39, 45, 54, 0.92));
}

body[data-theme="dark"] .status-row-rendelve {
  background: linear-gradient(90deg, rgba(30, 64, 175, 0.34), rgba(39, 45, 54, 0.92));
}

body[data-theme="dark"] .status-row-uton {
  background: linear-gradient(90deg, rgba(71, 85, 105, 0.34), rgba(39, 45, 54, 0.92));
}

body[data-theme="dark"] .status-row-megjott {
  background: linear-gradient(90deg, rgba(21, 128, 61, 0.3), rgba(39, 45, 54, 0.92));
}

body[data-theme="dark"] .status-row-reszbenmegjott {
  background: linear-gradient(90deg, rgba(180, 83, 9, 0.3), rgba(39, 45, 54, 0.92));
}

/* Prioritas badge szinek */
.priority-surgos { background: rgba(251, 146, 60, 0.18); color: #c2410c; }
.priority-normal { background: rgba(55, 65, 81, 0.1); color: var(--steel); }

/* Muveleti gombok kontenere egy soron belul */
.actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Soron beluli statusz es torles gombok */
.status-btn,
.delete-btn {
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 700;
}

/* Kovetkezo statusz gomb */
.status-btn {
  background: rgba(201, 111, 26, 0.12);
  color: var(--accent-deep);
}

body[data-theme="dark"] .status-btn {
  background: rgba(74, 163, 255, 0.16);
  color: #a9d5ff;
}

/* Torles gomb */
.delete-btn {
  background: rgba(185, 28, 28, 0.1);
  color: var(--danger);
}

/* Ures lista allapot */
.empty-state {
  padding: 30px 20px;
  text-align: center;
  color: var(--muted);
}

.archive-row td {
  padding: 10px 0 4px;
}

.archive-toggle-btn {
  width: 100%;
  justify-content: center;
  text-align: center;
  border: 1px dashed rgba(120, 156, 199, 0.28);
  background: rgba(120, 156, 199, 0.08);
}

.audit-table-wrap {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.38);
}

body[data-theme="dark"] .audit-table-wrap {
  background: rgba(20, 26, 34, 0.66);
}

.audit-table {
  width: 100%;
  min-width: 840px;
  border-collapse: collapse;
}

.audit-table th,
.audit-table td {
  padding: 12px 14px;
  text-align: left;
  border-top: 1px solid var(--line);
  vertical-align: top;
}

.audit-table thead th {
  border-top: 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.audit-table code {
  display: inline-block;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.75rem;
}

/* Tablet / kisebb desktop torrespont */
@media (max-width: 1120px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero::before {
    opacity: 0;
    -webkit-mask-image: none;
    mask-image: none;
    background: none;
  }

  .brand-logo-login {
    max-width: 118px;
  }

  .brand-logo-hero {
    max-width: 108px;
  }

  .stats-grid {
    gap: 10px;
  }

  .login-page,
  .profile-grid,
  .auth-layout,
  .user-admin-layout {
    grid-template-columns: 1fr;
  }

  .login-panel {
    justify-self: stretch;
    max-width: none;
  }

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

  .batch-main,
  .batch-actions {
    grid-column: 1 / -1;
  }
}

/* Mobil nezet: egymas ala rendezes es kartyas tabla */
@media (max-width: 720px) {
  .site-shell {
    width: min(100% - 18px, 1300px);
    padding-top: 12px;
  }

  .login-shell {
    padding: 18px 0 28px;
  }

  .theme-toolbar {
    align-items: stretch;
    flex-direction: column;
    position: static;
  }

  .toolbar-actions {
    justify-content: stretch;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .hero,
  .panel {
    padding: 18px;
    border-radius: 22px;
  }

  .hero h1 {
    font-size: 1.35rem;
  }

  .hero-text {
    font-size: 0.84rem;
  }

  .board-heading,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .item-entry-grid {
    grid-template-columns: 1fr;
  }

  .line-items-editor-head {
    display: none;
  }

  .login-page,
  .profile-grid,
  .auth-layout,
  .user-admin-layout {
    grid-template-columns: 1fr;
  }

  .three-grid,
  .four-grid,
  .compact-filters {
    grid-template-columns: 1fr;
  }

  .view-switch,
  .view-switch-wide {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .view-switch-btn {
    padding: 11px 12px;
    font-size: 0.88rem;
  }

  .login-page {
    gap: 16px;
    min-height: auto;
  }

  .login-copy {
    padding: 18px;
    border-radius: 22px;
  }

  .login-role-grid,
  .stats-grid {
    gap: 10px;
  }

  .login-role-card {
    padding: 12px;
    border-radius: 14px;
  }

  .batch-summary,
  .batch-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .batch-actions {
    justify-content: flex-start;
    display: grid;
    grid-template-columns: 1fr;
  }

  .batch-item-actions {
    justify-content: flex-start;
  }

  .batch-meta,
  .batch-status-select,
  .batch-toggle-btn,
  .batch-delete-btn,
  .status-btn,
  .delete-btn,
  .secondary-btn,
  .primary-btn {
    width: 100%;
  }

  .batch-card {
    padding: 14px;
  }

  .batch-summary {
    padding: 0;
    background: transparent;
    box-shadow: none;
  }

  .batch-info-bar {
    display: grid;
    gap: 8px;
  }

  .draft-item {
      grid-template-columns: 1fr;
    }

  .draft-item-details {
      grid-template-columns: 1fr;
    }

  .draft-item-controls {
    display: grid;
    grid-template-columns: 1fr;
  }

  .board-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .stat-card {
    min-width: 145px;
    max-width: 185px;
    padding: 12px 12px 10px;
    border-radius: 16px;
  }

  .stat-card span {
    font-size: 0.74rem;
    margin-bottom: 6px;
  }

  .stat-card strong {
    font-size: 1.38rem;
  }

  .hero-panel {
    gap: 8px;
  }

  .hero-stat {
    min-height: 76px;
    padding: 12px 12px 10px;
    border-radius: 16px;
  }

  .hero-stat-label {
    font-size: 0.74rem;
    margin-bottom: 6px;
  }

  .hero-stat strong {
    font-size: 1.38rem;
  }

  .table-wrap,
  .users-table-wrap,
  .audit-table-wrap {
    border-radius: 18px;
  }

  .board-heading {
    display: grid;
  }

  table,
  thead,
  tbody,
  th,
  td,
  tr {
    display: block;
  }

  table {
    min-width: 100%;
  }

  thead {
    display: none;
  }

  tbody tr {
    padding: 8px 0;
  }

  tbody td {
    padding: 0;
  }
}
