/* =============================================================
   Etalon Tools CRM — design-tokenek + alap-réteg (F0)
   Világos = default (final-gpt készlet) · Sötét = GPT navy készlet
   Betű: self-hosted Inter (400/500/600/700, latin + latin-ext)
   ============================================================= */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/Inter-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/Inter-Medium.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/Inter-SemiBold.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/Inter-Bold.woff2') format('woff2');
}

:root {
  color-scheme: light;

  /* brand */
  --brand: #FD4F00;
  --brand-hover: #e94800;
  --brand-active: #d43f00;
  --on-brand: #17130f;          /* SÖTÉT felirat a narancson — 5,54:1 */
  --brand-ink: #a93300;
  --brand-soft: #fff0e8;

  /* felületek */
  --canvas: #f4f2ed;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-subtle: #efede7;
  --surface-inset: #e8e5dd;
  --surface-hover: #f6f4ef;
  --surface-selected: #fff1e9;
  --text: #1b1c19;
  --text-strong: #10110f;
  --text-muted: #66675f;
  --text-faint: #85867e;
  --border: #d9d6ce;
  --border-strong: #b9b6ad;
  --grid: rgba(26, 28, 24, 0.04);

  /* szemantikus */
  --success: #087a4c;
  --success-soft: #e5f6ee;
  --warning: #8a5700;
  --warning-soft: #fff3d3;
  --danger: #b4232c;
  --danger-soft: #ffeaec;
  --info: #1e5c93;
  --info-soft: #e7f1fb;
  --vacation: #6b4bb8;
  --vacation-soft: #f0eafd;
  --focus: #7b2fff;

  /* tevékenység-színek (koppintó) */
  --c-home: #0d9488;
  --c-admin: #2563eb;
  --c-vez: #b45309;
  --c-hely: #15803d;
  --c-magan: #7c3aed;
  --c-szunet: #64748b;
  --c-warn: #b4232c;

  /* sötét oldalsáv / tab-sáv (mindkét témában ink) */
  --sidebar: #181a18;
  --sidebar-raised: #232520;
  --sidebar-active: #2d2b25;
  --sidebar-text: #f6f3ec;
  --sidebar-muted: #a5a89d;
  --sidebar-border: #353832;

  /* spacing-skála (rem: a gyökér-betűmérettel együtt skálázódik) */
  --sp-1: 0.25rem;  --sp-2: 0.5rem;  --sp-3: 0.75rem; --sp-4: 1rem;
  --sp-5: 1.25rem; --sp-6: 1.5rem; --sp-8: 2rem; --sp-10: 2.5rem; --sp-12: 3rem;

  /* rádiuszok */
  --r-xs: 4px; --r-sm: 7px; --r-md: 11px; --r-lg: 16px; --r-xl: 22px; --r-pill: 999px;

  --shadow-1: 0 1px 2px rgba(21, 23, 19, 0.07), 0 8px 24px rgba(21, 23, 19, 0.04);
  --shadow-2: 0 18px 50px rgba(21, 23, 19, 0.16);

  --font-ui: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;

  /* tipó-skála (rem — 16px-es alapon a korábbi px-értékek pontos megfelelői) */
  --fs-11: 0.6875rem; --fs-12: 0.75rem; --fs-13: 0.8125rem; --fs-14: 0.875rem;
  --fs-16: 1rem; --fs-18: 1.125rem; --fs-20: 1.25rem; --fs-24: 1.5rem;
  --fs-30: 1.875rem; --fs-36: 2.25rem;

  /* sűrűség-tokenek (rem) */
  --row-compact: 2.125rem;
  --row-default: 2.625rem;
  --control: 2.5rem;
  --control-lg: 3rem;
  --tap-min: 2.75rem;

  --rail-wide: 13.5rem;
  --rail-narrow: 4.75rem;
  --nav-h: 62px;
  --dock-h: 76px;

  /* KÖZÖS TARTALOM-PLAFON — minden oldal ugyanazzal a kerettel dolgozik (F9).
     110rem = 1760px alap-betűméretnél; a skálázással együtt nő, felette középre zárva. */
  --content-max: 110rem;
}

/* Sötét téma = a GPT navy tokenkészlete (Egon explicit döntése) */
:root[data-theme="dark"] {
  color-scheme: dark;
  --brand-ink: #fd6725;
  --brand-soft: rgba(253, 79, 0, 0.14);

  --canvas: #0c1119;
  --surface: #111923;
  --surface-raised: #17212e;
  --surface-subtle: #17212e;
  --surface-inset: #0a0f16;
  --surface-hover: #1d2a39;
  --surface-selected: #2b2019;
  --text: #f3f6fa;
  --text-strong: #ffffff;
  --text-muted: #91a0b1;
  --text-faint: #6c7b8d;
  --border: #293748;
  --border-strong: #4b5e73;
  --grid: rgba(255, 255, 255, 0.03);

  --success: #49d69a;
  --success-soft: rgba(73, 214, 154, 0.14);
  --warning: #f3bd49;
  --warning-soft: rgba(243, 189, 73, 0.14);
  --danger: #ff7681;
  --danger-soft: rgba(255, 118, 129, 0.14);
  --info: #65c8ff;
  --info-soft: rgba(101, 200, 255, 0.14);
  --vacation: #c3a8ff;
  --vacation-soft: rgba(195, 168, 255, 0.16);
  --focus: #7ed0ff;

  --c-home: #2dd4bf;
  --c-admin: #60a5fa;
  --c-vez: #fbbf24;
  --c-hely: #4ade80;
  --c-magan: #c4b5fd;
  --c-szunet: #94a3b8;
  --c-warn: #ff7681;

  --sidebar: #080d14;
  --sidebar-raised: #121b28;
  --sidebar-active: #1d2a39;
  --sidebar-text: #f3f6fa;
  --sidebar-muted: #91a0b1;
  --sidebar-border: #1d2836;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.25), 0 12px 28px rgba(0, 0, 0, 0.16);
  --shadow-2: 0 20px 52px rgba(0, 0, 0, 0.4);
}

/* ---------- F23/K1: címke-paletta (token-kulcs → soft-bg + ink, kontraszt-garantált) ---------- */
:root {
  --cimke-brand-bg: #ffe7dc; --cimke-brand-ink: #b23400;
  --cimke-kek-bg: #dbeafe; --cimke-kek-ink: #1e40af;
  --cimke-zold-bg: #dcfce7; --cimke-zold-ink: #166534;
  --cimke-sarga-bg: #fef9c3; --cimke-sarga-ink: #854d0e;
  --cimke-narancs-bg: #ffedd5; --cimke-narancs-ink: #9a3412;
  --cimke-piros-bg: #fee2e2; --cimke-piros-ink: #991b1b;
  --cimke-lila-bg: #ede9fe; --cimke-lila-ink: #5b21b6;
  --cimke-szurke-bg: #e5e7eb; --cimke-szurke-ink: #374151;
  --cimke-indigo-bg: #e0e7ff; --cimke-indigo-ink: #3730a3;
  --cimke-turkiz-bg: #ccfbf1; --cimke-turkiz-ink: #115e59;
  --cimke-rozsaszin-bg: #fce7f3; --cimke-rozsaszin-ink: #9d174d;
  --cimke-barna-bg: #ece1d5; --cimke-barna-ink: #7c4a12;
}
:root[data-theme="dark"] {
  --cimke-brand-bg: #4a2213; --cimke-brand-ink: #ffb896;
  --cimke-kek-bg: #1e3a5f; --cimke-kek-ink: #93c5fd;
  --cimke-zold-bg: #14532d; --cimke-zold-ink: #86efac;
  --cimke-sarga-bg: #4d3f14; --cimke-sarga-ink: #fde047;
  --cimke-narancs-bg: #4a2a12; --cimke-narancs-ink: #fdba74;
  --cimke-piros-bg: #4c1d1d; --cimke-piros-ink: #fca5a5;
  --cimke-lila-bg: #2e1e4d; --cimke-lila-ink: #c4b5fd;
  --cimke-szurke-bg: #374151; --cimke-szurke-ink: #cbd5e1;
  --cimke-indigo-bg: #272460; --cimke-indigo-ink: #a5b4fc;
  --cimke-turkiz-bg: #134e4a; --cimke-turkiz-ink: #5eead4;
  --cimke-rozsaszin-bg: #4a1d33; --cimke-rozsaszin-ink: #f9a8d4;
  --cimke-barna-bg: #453222; --cimke-barna-ink: #d9b991;
}

/* ---------- alap-réteg ---------- */
* { box-sizing: border-box; }

html { min-width: 320px; background: var(--canvas); }

/* ARÁNYOS SKÁLÁZÁS (F9): 1366px viewportnál 100%, 1920px-ig fokozatosan ~112%-ra nő,
   felette FIX. Mobil/tablet (≤1366) marad 100%. A tokenek rem-alapúak → az egész UI együtt nő.
   Képlet: +1,92px a 16px-es alapra 554px viewport-növekedés alatt (1,92/554 ≈ 0,003466). */
@media (min-width: 1025px) {
  html { font-size: clamp(100%, calc(100% + (100vw - 1366px) * 0.003466), calc(100% + 1.92px)); }
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 32px 32px,
    var(--canvas);
  color: var(--text);
  font: 400 var(--fs-14)/1.45 var(--font-ui);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { color: inherit; font: inherit; }
button, select { cursor: pointer; }
button:disabled, select:disabled { cursor: not-allowed; opacity: .5; }
a { color: inherit; }
img, svg { display: block; }

.icon {
  width: 1.125rem; height: 1.125rem;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
  flex: 0 0 auto;
  display: inline-block; vertical-align: -4px;
}
.icon-sm { width: 0.9375rem; height: 0.9375rem; }
.icon-lg { width: 1.375rem; height: 1.375rem; }
.icon-xl { width: 1.875rem; height: 1.875rem; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.num { font-variant-numeric: tabular-nums lining-nums; }
.mono { font-family: var(--font-mono); }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
