/*
 * Számlaletöltő – felület
 * Tokenek: Vikingo Design System (packages/ui/dist/tokens.css), csak a használt sorok.
 * Visszatérő motívum: a perforált szélű számlacetli (.receipt, .doc-tile).
 */

@font-face {
  font-family: 'Clash Display';
  src: url('fonts/ClashDisplay-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'DM Sans';
  src: url('fonts/dm-sans-latin-ext-wght-normal.woff2') format('woff2-variations');
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'DM Sans';
  src: url('fonts/dm-sans-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper: #F6EFE8;
  --paper-deep: #EFE5DA;
  --surface: #FFFFFF;
  --ink: #3E2E45;
  --ink-deep: #2A1F30;
  --ink-soft: #4E3A58;
  --coral: #FF544D;
  --coral-deep: #E83D36;
  --coral-wash: rgba(255, 84, 77, 0.12);
  --text: #3E2E45;
  --muted: #7A6A82;
  --subtle: #9B8FA3;
  --line: #E6DED5;
  --line-strong: #CFC4B9;
  --ok: #15803D;
  --ok-wash: rgba(34, 197, 94, 0.13);
  --warn: #B45309;
  --warn-wash: rgba(245, 158, 11, 0.15);
  --bad: #C62828;
  --bad-wash: rgba(239, 68, 68, 0.11);

  --font-display: 'Clash Display', 'DM Sans', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, monospace;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(62, 46, 69, 0.06);
  --shadow-md: 0 6px 18px rgba(62, 46, 69, 0.08);
  --shadow-lg: 0 24px 48px -12px rgba(42, 31, 48, 0.22);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: clamp(16px, 4vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

/* Ikonok alapmérete; a komponensek felülírhatják (a :where nulla specificitású). */
:where(svg[aria-hidden="true"]) { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.12; letter-spacing: -0.015em; margin: 0; }
h1 { font-size: clamp(1.9rem, 1.35rem + 2.2vw, 2.75rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0; }
/* Arculati szabály: legfeljebb 500-as betűvastagság, a böngésző félkövérjét is beleértve. */
b, strong, th, h1, h2, h3, h4 { font-weight: 500; }
a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--coral-deep); }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--font-mono); font-size: 0.92em; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.spacer { height: 16px; }

/* ===== Gombok ===== */

.btn {
  --bg: var(--coral); --bg-hover: var(--coral-deep); --fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 46px; padding: 11px 20px;
  font: inherit; font-weight: 500; font-size: 0.975rem; line-height: 1.2;
  color: var(--fg); background: var(--bg);
  border: 1.5px solid transparent; border-radius: var(--r-full);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { background: var(--bg-hover); color: var(--fg); }
.btn svg { width: 18px; height: 18px; }
.btn--block { width: 100%; }
.btn--lg { min-height: 54px; font-size: 1.05rem; padding: 14px 24px; }
.btn--sm { min-height: 36px; padding: 7px 14px; font-size: 0.9rem; }
.btn--ink { --bg: var(--ink); --bg-hover: var(--ink-soft); }
.btn--ghost { --bg: var(--surface); --bg-hover: var(--paper); --fg: var(--text); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--quiet { --bg: transparent; --bg-hover: rgba(62, 46, 69, 0.07); --fg: var(--text); min-height: 40px; padding: 8px 12px; }
.btn--light { --bg: #fff; --bg-hover: var(--paper); --fg: var(--ink); }
.btn[aria-busy="true"] { opacity: .75; cursor: progress; }
.btn[aria-busy="true"] .btn__label::after { content: '…'; }

/* ===== Mezők ===== */

.field { display: grid; gap: 7px; }
.field label { font-weight: 500; font-size: 0.925rem; }
.field__hint { font-size: 0.85rem; color: var(--muted); }

.input-wrap { position: relative; }
.input-wrap > svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 19px; height: 19px; color: var(--subtle); pointer-events: none; }
.input-wrap .input { padding-left: 46px; }

.input {
  width: 100%; min-height: 52px; padding: 12px 16px;
  font: inherit; font-size: 1.05rem; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: var(--r-md);
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--subtle); }
.input:focus { outline: none; border-color: var(--coral); box-shadow: 0 0 0 4px var(--coral-wash); }
.input:focus + svg, .input-wrap:focus-within > svg { color: var(--coral-deep); }
.input[aria-invalid="true"] { border-color: var(--bad); }
.input--sm { min-height: 42px; font-size: 0.95rem; }
.turnstile { min-height: 65px; }

/* ===== Üzenetek, címkék ===== */

.alert {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 13px 16px; border-radius: var(--r-md); font-size: 0.935rem;
  background: var(--bad-wash); color: var(--bad);
}
.alert > svg { width: 20px; height: 20px; margin-top: 1px; }
.alert--ok { background: var(--ok-wash); color: var(--ok); }
.alert--info { background: var(--paper); color: var(--text); border: 1px solid var(--line); }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--r-full);
  font-size: 0.75rem; font-weight: 500; line-height: 1.3;
  background: var(--paper); color: var(--text);
}
.badge svg { width: 13px; height: 13px; }
.badge--bad { background: var(--bad-wash); color: var(--bad); }
.badge--warn { background: var(--warn-wash); color: var(--warn); }
.badge--ok { background: var(--ok-wash); color: var(--ok); }
.badge--ink { background: var(--ink); color: #fff; }

.icon-chip {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex: none;
  background: var(--paper); color: var(--ink);
}
.icon-chip svg { width: 21px; height: 21px; }
.icon-chip--lg { width: 64px; height: 64px; border-radius: 19px; }
.icon-chip--lg svg { width: 30px; height: 30px; }
.icon-chip--coral { background: var(--coral-wash); color: var(--coral-deep); }
.icon-chip--ink { background: var(--ink); color: #fff; }
.icon-chip--ok { background: var(--ok-wash); color: var(--ok); }
.icon-chip--warn { background: var(--warn-wash); color: var(--warn); }
.icon-chip--bad { background: var(--bad-wash); color: var(--bad); }
.icon-chip--muted { background: var(--paper); color: var(--muted); }
.icon-chip--accent { background: var(--coral-wash); color: var(--coral-deep); }

/* ===== Számlacetli (motívum) ===== */

.receipt {
  --zig: 7px;
  background: var(--surface);
  padding: 18px 18px calc(18px + var(--zig));
  border-radius: 10px 10px 0 0;
  font-family: var(--font-mono);
  color: var(--ink);
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--zig)) 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--zig)) 100%;
}
.receipt__brand { display: flex; align-items: center; gap: 6px; font-family: var(--font-body); font-weight: 500; font-size: 0.72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--coral-deep); }
.receipt__brand--ft { color: var(--ink-soft); }
.receipt__no { font-size: 0.95rem; font-weight: 500; margin-top: 8px; }
.receipt__lines { margin: 12px 0; display: grid; gap: 6px; }
.receipt__lines span { height: 6px; border-radius: 3px; background: var(--paper-deep); }
.receipt__lines span:nth-child(2) { width: 72%; }
.receipt__lines span:nth-child(3) { width: 48%; }
.receipt__total { display: flex; justify-content: space-between; border-top: 1.5px dashed var(--line-strong); padding-top: 9px; font-size: 0.82rem; font-weight: 500; }

/* ===== Vásárlói keret ===== */

.site-header { padding: 18px var(--gutter); }
.site-header__inner, .site-footer__inner { max-width: 1040px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand .logo { height: 40px; width: auto; display: block; }
.brand__sub { font-weight: 500; font-size: 0.92rem; color: var(--muted); padding-left: 12px; border-left: 1.5px solid var(--line-strong); line-height: 1.2; }
main { flex: 1; width: 100%; padding: 8px var(--gutter) 56px; }
.site-footer { padding: 24px var(--gutter) 32px; color: var(--muted); font-size: 0.85rem; }
.site-footer__inner { flex-wrap: wrap; gap: 8px 24px; }
.site-footer a { color: var(--muted); }

.narrow { max-width: 520px; margin: 0 auto; }
.wide { max-width: 920px; margin: 0 auto; }

.card {
  background: var(--surface); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg); padding: clamp(24px, 5vw, 40px);
}
.card .icon-chip--lg { margin-bottom: 4px; }
.center .icon-chip--lg { margin-left: auto; margin-right: auto; }

.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 0.78rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--coral-deep); }
.eyebrow svg { width: 15px; height: 15px; }
.lead { font-size: 1.05rem; color: var(--muted); }

/* Kezdőlap: kétoszlopos kártya, bal oldalt a számlacetlik */
.auth {
  max-width: 1040px; margin: 0 auto;
  display: grid; grid-template-columns: 1.05fr 1fr;
  background: var(--surface); border-radius: 28px; overflow: hidden; box-shadow: var(--shadow-lg);
}
.auth__panel {
  position: relative; overflow: hidden;
  background: var(--ink);
  background-image: radial-gradient(circle at 85% 0%, rgba(255, 84, 77, .28), transparent 55%), radial-gradient(circle at 0% 100%, rgba(255, 255, 255, .06), transparent 50%);
  color: #fff; padding: clamp(28px, 5vw, 52px);
  display: flex; flex-direction: column; gap: 28px;
}
.auth__panel .eyebrow { color: #FFB4AF; }
.auth__panel h1 { color: #fff; max-width: 13ch; }
.auth__panel .lead { color: rgba(246, 239, 232, .78); max-width: 38ch; }
.auth__form { padding: clamp(28px, 5vw, 52px); display: flex; flex-direction: column; justify-content: center; }
.auth__form h2 { font-size: 1.5rem; }

.receipts { position: relative; height: 230px; margin-top: auto; }
.receipts .receipt { position: absolute; width: 210px; box-shadow: 0 18px 30px -12px rgba(0, 0, 0, .45); }
.receipts .receipt:nth-child(1) { left: 0; top: 34px; transform: rotate(-7deg); }
.receipts .receipt:nth-child(2) { left: 120px; top: 10px; transform: rotate(3deg); z-index: 1; }
.receipts .receipt:nth-child(3) { left: 245px; top: 46px; transform: rotate(9deg); }

.how { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.how li { display: flex; align-items: center; gap: 14px; font-size: 0.95rem; color: var(--muted); }
.how li strong { color: var(--text); font-weight: 500; }
.how .icon-chip { width: 38px; height: 38px; border-radius: 11px; }
.how .icon-chip svg { width: 18px; height: 18px; }

.trust { display: flex; align-items: flex-start; gap: 10px; font-size: 0.85rem; color: var(--muted); padding-top: 18px; border-top: 1px solid var(--line); }
.trust svg { width: 17px; height: 17px; margin-top: 2px; color: var(--ok); }

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; border-radius: 22px; }
  .auth__panel { gap: 18px; padding-bottom: 0; }
  .auth__panel h1 { font-size: 1.85rem; }
  .auth__panel .lead { font-size: 0.97rem; }
  /* Mobilon a cetlik csak kikandikálnak a panel aljából, hogy az űrlap feljebb kerüljön. */
  .receipts { height: 74px; margin-top: 0; overflow: hidden; }
  .receipts .receipt { width: 168px; padding: 12px 14px calc(12px + var(--zig)); }
  .receipts .receipt:nth-child(1) { left: 0; top: 18px; }
  .receipts .receipt:nth-child(2) { left: 96px; top: 6px; }
  .receipts .receipt:nth-child(3) { left: 192px; top: 22px; }
  .receipts .receipt__no { font-size: 0.85rem; }
  .receipts .receipt .receipt__lines, .receipts .receipt .receipt__total { display: none; }
}

.tips { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.tips li { display: flex; gap: 14px; align-items: flex-start; }
.tips .icon-chip { width: 38px; height: 38px; border-radius: 11px; }
.tips .icon-chip svg { width: 18px; height: 18px; }
.tips strong { display: block; }
.tips span { color: var(--muted); font-size: 0.93rem; }

/* ===== Számlalista ===== */

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px 24px; margin-bottom: 24px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; color: var(--muted); font-size: 0.93rem; }
.meta-row span { display: inline-flex; align-items: center; gap: 7px; }
.meta-row svg { color: var(--subtle); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-size: 0.92rem; font-weight: 500;
  padding: 8px 14px; border-radius: var(--r-full);
  border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--text); cursor: pointer;
}
.chip__count { font-size: 0.78rem; padding: 1px 7px; border-radius: var(--r-full); background: var(--paper); color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip[aria-pressed="true"] .chip__count { background: rgba(255, 255, 255, .16); color: #fff; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--coral); flex: none; }
.dot--FT { background: var(--ink-soft); }
.chip[aria-pressed="true"] .dot--FT { background: #fff; }

.toolbar .input-wrap { width: min(100%, 280px); }
.toolbar .input { min-height: 42px; font-size: 0.95rem; border-radius: var(--r-full); }
.toolbar .input-wrap > svg { width: 17px; height: 17px; }

.year-group + .year-group { margin-top: 30px; }
.year-group__title { display: flex; align-items: center; gap: 10px; font-family: var(--font-body); font-size: 0.8rem; font-weight: 500; letter-spacing: .1em; color: var(--muted); margin: 0 0 10px 4px; }
.year-group__title::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.invoice-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-md); overflow: hidden; }
.invoice { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 18px; padding: 16px 20px; transition: background .15s; }
.invoice + .invoice { border-top: 1px solid var(--line); }
.invoice:hover { background: #FCFAF7; }

/* Mini számlacetli márkaszínnel */
.doc-tile {
  --zig: 3px;
  width: 42px; height: 50px; display: grid; place-items: center; flex: none;
  border-radius: 7px 7px 0 0; background: var(--coral-wash); color: var(--coral-deep);
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--zig)) 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--zig)) 100%;
}
.doc-tile svg { width: 20px; height: 20px; margin-bottom: 3px; }
.doc-tile--FT { background: var(--ink); color: #fff; }
.doc-tile--storno { background: var(--bad-wash); color: var(--bad); }

.invoice__number { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-family: var(--font-mono); font-weight: 500; font-size: 0.98rem; }
.tag-e { display: inline-flex; align-items: center; gap: 3px; font-family: var(--font-body); font-size: 0.68rem; font-weight: 500; letter-spacing: .04em; padding: 2px 7px 2px 5px; border-radius: var(--r-full); background: var(--paper); color: var(--muted); }
.tag-e svg { width: 11px; height: 11px; color: var(--coral-deep); }
.invoice__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 4px; color: var(--muted); font-size: 0.86rem; }
.invoice__meta > span { display: inline-flex; align-items: center; gap: 6px; }
.invoice__meta svg { width: 14px; height: 14px; color: var(--subtle); }
.invoice__amount { font-weight: 500; font-size: 1.02rem; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.invoice__amount--neg { color: var(--bad); }

.list-empty { padding: 28px; text-align: center; color: var(--muted); }

.empty { text-align: center; padding: 52px 24px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-md); }
.empty .icon-chip--lg { margin: 0 auto 16px; }

.foot-notes { margin-top: 28px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.foot-note { display: flex; gap: 12px; align-items: flex-start; font-size: 0.875rem; color: var(--muted); }
.foot-note svg { width: 18px; height: 18px; margin-top: 1px; color: var(--ink-soft); }
.foot-note strong { color: var(--text); }

@media (max-width: 640px) {
  .invoice { grid-template-columns: auto 1fr auto; grid-template-areas: "tile main amount" "tile action action"; row-gap: 12px; padding: 16px; gap: 14px; }
  .doc-tile { grid-area: tile; align-self: start; }
  .invoice__main { grid-area: main; min-width: 0; }
  .invoice__amount { grid-area: amount; align-self: start; }
  .invoice__action { grid-area: action; }
  .invoice__action .btn { width: 100%; }
  .page-head__actions, .page-head__actions .btn { width: 100%; }
  .toolbar .input-wrap { width: 100%; }
  .brand .logo { height: 32px; }
  .brand__sub { font-size: 0.85rem; padding-left: 10px; }
}

/* ===== Admin előnézet sáv ===== */

.preview-bar { position: sticky; top: 0; z-index: 20; background: var(--ink-deep); color: #fff; padding: 10px var(--gutter); font-size: 0.93rem; }
.preview-bar__inner { max-width: 1040px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.preview-bar__text { display: inline-flex; align-items: center; gap: 10px; }
.preview-bar__text svg { color: var(--coral); width: 19px; height: 19px; }

/* ===== Admin keret: oldalsáv + tartalom ===== */

.admin { flex: 1; display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  background: var(--ink-deep); color: rgba(246, 239, 232, .72);
  display: flex; flex-direction: column; padding: 22px 14px;
}
.sidebar .brand { color: #fff; padding: 0 10px 24px; flex-direction: column; align-items: flex-start; gap: 8px; }
.sidebar .brand .logo { height: 46px; }
.sidebar .brand__sub { border: 0; padding: 0; font-size: 0.75rem; letter-spacing: .1em; text-transform: uppercase; color: rgba(246, 239, 232, .55); }
.nav { display: grid; gap: 3px; }
.nav__label { font-size: 0.7rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: rgba(246, 239, 232, .4); padding: 14px 12px 6px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--r-full); text-decoration: none; font-weight: 500; font-size: 0.95rem; color: inherit; transition: background .15s, color .15s; }
.nav a svg { width: 19px; height: 19px; }
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a[aria-current="page"] { background: var(--coral); color: #fff; }
.sidebar__user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 10px 0; border-top: 1px solid rgba(255, 255, 255, .09); }
.sidebar__user .avatar { width: 34px; height: 34px; font-size: 0.8rem; }
.sidebar__who { flex: 1; min-width: 0; font-size: 0.85rem; line-height: 1.3; }
.sidebar__who strong { display: block; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__who span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.78rem; }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: inherit; cursor: pointer; }
.icon-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.icon-btn svg { width: 18px; height: 18px; }

.admin-main { padding: 32px clamp(16px, 3.5vw, 44px) 56px; min-width: 0; }
.admin-main__inner { max-width: 1160px; margin: 0 auto; }
.admin-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 26px; }
.admin-head h1 { font-size: clamp(1.7rem, 1.3rem + 1.4vw, 2.2rem); }
.admin-head p { color: var(--muted); margin-top: 6px; }
.crumb { display: inline-flex; align-items: center; gap: 6px; font-size: 0.875rem; color: var(--muted); text-decoration: none; margin-bottom: 10px; }
.crumb svg { width: 15px; height: 15px; }

@media (max-width: 900px) {
  .admin { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 15; height: auto; flex-direction: row; align-items: center; gap: 8px; padding: 10px 12px; overflow-x: auto; }
  .sidebar .brand { padding: 0 6px 0 2px; }
  .sidebar .brand .logo { height: 26px; }
  .sidebar .brand__sub, .nav__label { display: none; }
  .nav { display: flex; gap: 2px; }
  .nav a { padding: 9px 11px; font-size: 0.9rem; white-space: nowrap; }
  .sidebar__user { margin: 0 0 0 auto; padding: 0; border: 0; }
  .sidebar__who { display: none; }
}

.panel { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--line); padding: 22px 24px; }
.panel + .panel, .grid-2 + .panel, .panel + .grid-2 { margin-top: 20px; }
.panel__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.panel__head h2 { display: flex; align-items: center; gap: 10px; font-size: 1.12rem; }
.panel__head h2 svg { width: 19px; height: 19px; color: var(--coral-deep); }
.panel__head a { font-size: 0.85rem; font-weight: 500; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px 6px 14px; border: 1.5px solid var(--line-strong); border-radius: var(--r-full); transition: border-color .15s, background .15s; }
.panel__head a:hover { border-color: var(--ink); background: var(--paper); color: var(--text); }
.panel__head a svg { width: 15px; height: 15px; }

.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
.grid-2 > .panel { margin-top: 0; min-width: 0; }
@media (max-width: 1000px) { .grid-2 { grid-template-columns: 1fr; } }

/* Kereső a műszerfalon */
.search-hero { display: flex; gap: 10px; }
.search-hero .input-wrap { flex: 1; }
.search-hero .input { min-height: 56px; font-size: 1.05rem; }
@media (max-width: 640px) { .search-hero { flex-direction: column; } }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin: 20px 0; }
@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat { flex-direction: column; gap: 10px; padding: 14px 16px; }
  .stat:last-child { grid-column: 1 / -1; }
}
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; display: flex; gap: 14px; align-items: flex-start; }
.stat__label { font-size: 0.8rem; font-weight: 500; color: var(--muted); }
.stat__value { font-family: var(--font-display); font-size: 1.65rem; line-height: 1.15; margin-top: 2px; }
.stat__hint { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }

/* Eseményfolyam */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; }
.feed li + li { border-top: 1px solid var(--line); }
.feed .icon-chip { width: 34px; height: 34px; border-radius: 10px; }
.feed .icon-chip svg { width: 16px; height: 16px; }
.feed__body { flex: 1; min-width: 0; font-size: 0.92rem; }
.feed__body strong { font-weight: 500; }
.feed__sub { color: var(--muted); font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed__time { color: var(--subtle); font-size: 0.78rem; white-space: nowrap; }

/* Szinkron-sorozatok */
.series-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.series { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; display: grid; gap: 12px; }
.series__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.series__code { font-family: var(--font-mono); font-weight: 500; font-size: 1rem; }
.series__num { font-family: var(--font-display); font-size: 2rem; line-height: 1; }
.series__num small { font-family: var(--font-body); font-size: 0.8rem; color: var(--muted); font-weight: 500; margin-left: 6px; }
.series dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 0.84rem; }
.series dt { color: var(--muted); }
.series dd { margin: 0; text-align: right; }
.series__error { font-size: 0.8rem; color: var(--bad); background: var(--bad-wash); padding: 8px 10px; border-radius: 8px; }
.mini-series { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.mini-series li { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 0.9rem; }

/* Vásárló-profil */
.avatar { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--coral); color: #fff; font-weight: 500; font-size: 1.1rem; letter-spacing: .02em; }
.profile { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 22px; }
.profile__id { flex: 1; min-width: 220px; }
.profile__id h1 { font-family: var(--font-mono); font-weight: 500; font-size: clamp(1.25rem, 1rem + 1vw, 1.65rem); letter-spacing: -0.02em; word-break: break-all; }
.profile__facts { display: flex; flex-wrap: wrap; gap: 20px 28px; }
.fact__label { font-size: 0.75rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.fact__value { font-weight: 500; font-size: 1.05rem; margin-top: 2px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.tile { margin: 0; }
.tile button, .tile a {
  width: 100%; height: 100%; text-align: left; display: flex; gap: 14px; align-items: flex-start;
  padding: 16px; border-radius: var(--r-lg); border: 1.5px solid var(--line); background: var(--surface);
  font: inherit; color: inherit; cursor: pointer; text-decoration: none; transition: border-color .15s, box-shadow .15s;
}
.tile button:hover, .tile a:hover { border-color: var(--ink); box-shadow: var(--shadow-md); color: inherit; }
.tile__text strong { display: block; font-size: 0.97rem; }
.tile__desc { display: block; color: var(--muted); font-size: 0.84rem; margin-top: 2px; }

.copy-box { display: flex; gap: 8px; margin-top: 12px; }
.copy-box .input { font-family: var(--font-mono); font-size: 0.85rem; min-height: 46px; }
@media (max-width: 640px) { .copy-box { flex-direction: column; } }

/* Táblázat */
.table-wrap { overflow-x: auto; margin: 0 -24px; padding: 0 24px; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.925rem; }
table.data th { text-align: left; font-size: 0.72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: #FCFAF7; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell-doc { display: flex; align-items: center; gap: 12px; }
.cell-doc .doc-tile { width: 32px; height: 38px; }
.cell-doc .doc-tile svg { width: 16px; height: 16px; }
.cell-icon { display: inline-flex; align-items: center; gap: 8px; }
.cell-icon .icon-chip { width: 30px; height: 30px; border-radius: 9px; }
.cell-icon .icon-chip svg { width: 15px; height: 15px; }

.email-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.email-chip { display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px 7px 7px; border-radius: var(--r-full); background: var(--paper); text-decoration: none; font-weight: 500; font-size: 0.92rem; border: 1.5px solid transparent; }
.email-chip:hover { border-color: var(--ink); color: var(--text); }
.email-chip .avatar { width: 28px; height: 28px; font-size: 0.68rem; }
.email-chip em { font-style: normal; color: var(--muted); font-weight: 500; font-size: 0.82rem; }

.pager { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.explain { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.explain div { display: flex; gap: 12px; align-items: flex-start; font-size: 0.9rem; color: var(--muted); }
.explain strong { display: block; color: var(--text); }

pre.detail { white-space: pre-wrap; font-size: 0.75rem; background: var(--paper); padding: 12px; border-radius: var(--r-sm); overflow-x: auto; text-align: left; }

/* A térköz-segéd a fájl végén van, hogy a komponensek margó-nullázását felülírja. */
.stack > * + * { margin-top: var(--stack, 16px); }
.stack--sm { --stack: 10px; }
.stack--md { --stack: 20px; }
.stack--lg { --stack: 28px; }

@media (prefers-reduced-motion: no-preference) {
  .receipts .receipt { animation: deal .7s var(--ease) both; }
  .receipts .receipt:nth-child(2) { animation-delay: .08s; }
  .receipts .receipt:nth-child(3) { animation-delay: .16s; }
  @keyframes deal { from { opacity: 0; translate: 0 24px; } }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
