/* ============================================================
   Stúdió HQ — design system
   ============================================================ */

:root {
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --display: "Inter Tight", "Inter", system-ui, sans-serif;

  --bg: #f4f3ee;
  --bg-soft: #ecebe3;
  --card: #ffffff;
  --card-2: #faf9f5;
  --ink: #181b18;
  --ink-soft: #3d433b;
  --muted: #6a7166;
  --faint: #9aa091;

  --accent: #2e7d4f;
  --accent-2: #5cb384;
  --accent-soft: #e2f0e7;
  --ring: rgba(46, 125, 79, 0.24);
  --grad: linear-gradient(135deg, #2e7d4f 0%, #5cb384 100%);

  --line: #e5e2d8;
  --line-soft: #efede4;

  --hot: #d23c28;
  --warm: #c07d10;
  --maybe: #4f83cc;

  --st-új: #68737e;
  --st-megkeresve: #2f6fed;
  --st-ajánlat: #7c5cd6;
  --st-nyert: #2e9e5b;
  --st-vesztett: #d64545;
  --st-hold: #9a8f5f;

  --danger: #c93c30;
  --info: #2f6fed;

  --sh-sm: 0 1px 2px rgba(35, 32, 22, 0.05), 0 2px 8px rgba(35, 32, 22, 0.04);
  --sh-md: 0 2px 6px rgba(35, 32, 22, 0.05), 0 12px 32px rgba(35, 32, 22, 0.07);
  --sh-lg: 0 4px 12px rgba(35, 32, 22, 0.06), 0 24px 64px rgba(35, 32, 22, 0.14);

  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;

  --sidebar: 16rem;
  --pad: clamp(1rem, 2.6vw, 2rem);
  --tap: 2.75rem;

  --ease: cubic-bezier(0.22, 0.8, 0.28, 1);
}

[data-theme="dark"] {
  --bg: #0d100e;
  --bg-soft: #101410;
  --card: #151a15;
  --card-2: #1a201a;
  --ink: #e9ede6;
  --ink-soft: #c4cbbf;
  --muted: #8d948a;
  --faint: #666e63;

  --accent: #63bd8b;
  --accent-2: #3f9e6c;
  --accent-soft: #1b2b21;
  --ring: rgba(99, 189, 139, 0.32);
  --grad: linear-gradient(135deg, #3f9e6c 0%, #63bd8b 100%);

  --line: #242b24;
  --line-soft: #1d241d;

  --hot: #e5705f;
  --warm: #dd9c45;
  --maybe: #7aa3d8;

  --st-új: #97a1ad;
  --st-megkeresve: #7ba3f5;
  --st-ajánlat: #ab92ea;
  --st-nyert: #63c98c;
  --st-vesztett: #e87878;
  --st-hold: #b3a878;

  --danger: #e87878;
  --info: #7ba3f5;

  --sh-sm: 0 1px 2px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.22);
  --sh-md: 0 2px 6px rgba(0, 0, 0, 0.26), 0 12px 32px rgba(0, 0, 0, 0.32);
  --sh-lg: 0 4px 12px rgba(0, 0, 0, 0.3), 0 24px 64px rgba(0, 0, 0, 0.48);
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }
html { color-scheme: light; scroll-behavior: smooth; }
[data-theme="dark"] { color-scheme: dark; }

body {
  margin: 0;
  font-family: var(--font);
  font-feature-settings: "cv11", "ss01";
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }

::selection { background: var(--accent-soft); color: var(--ink); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

svg { display: block; }

[hidden], .hidden { display: none !important; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--faint); border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

kbd {
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 650;
  color: var(--muted);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 0.08rem 0.38rem;
  line-height: 1.5;
}

/* ---------- buttons / chips / avatar ---------- */

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  padding: 0.72rem 1.05rem;
  min-height: var(--tap);
  font-size: 0.92rem;
  font-weight: 650;
  cursor: pointer;
  background: transparent;
  transition: transform 0.12s var(--ease), background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 1.05rem; height: 1.05rem; }

.btn-primary {
  color: #fff;
  background: var(--grad);
  box-shadow: 0 6px 18px rgba(46, 125, 79, 0.32);
}
[data-theme="dark"] .btn-primary { color: #0c130e; box-shadow: 0 6px 18px rgba(99, 189, 139, 0.22); }
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 8px 24px rgba(46, 125, 79, 0.4); }

.btn-ghost {
  color: var(--ink-soft);
  border-color: var(--line);
  background: var(--card);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.btn-quiet {
  color: var(--ink-soft);
  border-color: var(--line);
  background: var(--card-2);
}
.btn-quiet:hover { border-color: var(--accent); color: var(--accent); }

.btn-danger-ghost {
  color: var(--danger);
  border-color: transparent;
}
.btn-danger-ghost:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }

.btn-sm { min-height: 2.3rem; padding: 0.42rem 0.8rem; font-size: 0.84rem; }

.icon-btn {
  appearance: none;
  display: inline-grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  transition: transform 0.12s var(--ease), background 0.15s, color 0.15s, border-color 0.15s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 1.1rem; height: 1.1rem; }
.icon-btn.icon-flip svg { transform: scaleX(-1); }
.icon-btn:disabled { opacity: 0.35; cursor: default; pointer-events: none; }

.link-btn {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 650;
  white-space: nowrap;
  background: var(--bg-soft);
  color: var(--muted);
}
.chip-dot { width: 0.42rem; height: 0.42rem; border-radius: 50%; background: currentColor; }

.chip.pri-hot { color: var(--hot); background: color-mix(in srgb, var(--hot) 11%, transparent); }
.chip.pri-warm { color: var(--warm); background: color-mix(in srgb, var(--warm) 12%, transparent); }
.chip.pri-maybe { color: var(--maybe); background: color-mix(in srgb, var(--maybe) 12%, transparent); }

.chip.st-új { color: var(--st-új); background: color-mix(in srgb, var(--st-új) 11%, transparent); }
.chip.st-megkeresve { color: var(--st-megkeresve); background: color-mix(in srgb, var(--st-megkeresve) 11%, transparent); }
.chip.st-ajánlat { color: var(--st-ajánlat); background: color-mix(in srgb, var(--st-ajánlat) 12%, transparent); }
.chip.st-nyert { color: var(--st-nyert); background: color-mix(in srgb, var(--st-nyert) 12%, transparent); }
.chip.st-vesztett { color: var(--st-vesztett); background: color-mix(in srgb, var(--st-vesztett) 11%, transparent); }
.chip.st-hold { color: var(--st-hold); background: color-mix(in srgb, var(--st-hold) 12%, transparent); }

.avatar {
  display: inline-grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 11px;
  flex: none;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #fff;
  background: linear-gradient(135deg, hsl(var(--av-h, 150), 38%, 42%), hsl(calc(var(--av-h, 150) + 24), 44%, 56%));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
}
[data-theme="dark"] .avatar {
  background: linear-gradient(135deg, hsl(var(--av-h, 150), 32%, 34%), hsl(calc(var(--av-h, 150) + 24), 38%, 46%));
}
.avatar.av-sm { width: 1.7rem; height: 1.7rem; border-radius: 8px; font-size: 0.62rem; }
.avatar.av-lg { width: 2.9rem; height: 2.9rem; border-radius: 14px; font-size: 0.95rem; }
.avatar.av-xl { width: 3.4rem; height: 3.4rem; border-radius: 16px; font-size: 1.1rem; }
.avatar.av-owner { background: var(--grad); }

.rating {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--ink-soft);
  white-space: nowrap;
}
.rating-star { width: 0.85rem; height: 0.85rem; color: var(--warm); }
.rating-star svg { width: 100%; height: 100%; }
.rating.is-empty { color: var(--faint); font-weight: 500; }

/* ---------- gate (login) ---------- */

.theme-fab {
  position: fixed;
  top: 1.15rem;
  right: 1.15rem;
  z-index: 5;
  width: 2.6rem;
  height: 2.6rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--sh-md);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.15s var(--ease);
}
.theme-fab:hover { transform: rotate(14deg) scale(1.05); }
.theme-fab svg { width: 1.15rem; height: 1.15rem; }

html[data-theme="light"] .icon-moon,
html[data-theme="dark"] .icon-sun { display: none; }

body.app-on .theme-fab { display: none; }

.gate {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  overflow: hidden;
}

.gate-ambient { position: fixed; inset: 0; pointer-events: none; }
.glow { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.55; }
.glow.g-a { width: 34rem; height: 34rem; top: -10rem; left: -8rem; background: radial-gradient(circle, rgba(92, 179, 132, 0.35), transparent 65%); }
.glow.g-b { width: 30rem; height: 30rem; bottom: -12rem; right: -6rem; background: radial-gradient(circle, rgba(192, 125, 16, 0.16), transparent 65%); }
[data-theme="dark"] .glow.g-a { background: radial-gradient(circle, rgba(99, 189, 139, 0.2), transparent 65%); }
[data-theme="dark"] .glow.g-b { background: radial-gradient(circle, rgba(124, 92, 214, 0.14), transparent 65%); }

.gate-card {
  position: relative;
  width: min(26rem, 100%);
  padding: 2.1rem 1.9rem 1.4rem;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: blur(14px);
  box-shadow: var(--sh-lg);
  animation: popIn 0.5s var(--ease) both;
}
.gate-card.shake { animation: shake 0.4s var(--ease); }

.gate-logo { width: 3rem; height: 3rem; margin-bottom: 1.1rem; }

.gate-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.gate-title {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: 2.1rem;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.gate-lead { margin: 0 0 1.5rem; color: var(--muted); font-size: 0.94rem; }

.gate-card .field + .field { margin-top: 0.85rem; }
.field { display: grid; gap: 0.42rem; min-width: 0; }
.field > label { font-size: 0.78rem; font-weight: 700; color: var(--ink-soft); }

.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--card-2);
  border-radius: var(--r-sm);
  padding: 0.74rem 0.9rem;
  min-height: var(--tap);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.field textarea { min-height: 6rem; resize: vertical; line-height: 1.55; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent);
  outline: none;
  background: var(--card);
  box-shadow: 0 0 0 3px var(--ring);
}

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 3rem; }

.pw-toggle {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.3rem;
  height: 2.3rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  border-radius: 8px;
}
.pw-toggle:hover { color: var(--ink); background: var(--bg-soft); }
.pw-toggle svg { width: 1.15rem; height: 1.15rem; }
.pw-toggle .icon-eye-off { display: none; }
.pw-toggle[aria-pressed="true"] .icon-eye { display: none; }
.pw-toggle[aria-pressed="true"] .icon-eye-off { display: block; }

.gate-err { min-height: 1.15rem; margin: 0.55rem 0 0.85rem; color: var(--danger); font-size: 0.84rem; font-weight: 550; }

#login-form .btn-primary { width: 100%; }

.gate-foot {
  margin: 1.2rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line-soft);
  text-align: center;
  color: var(--faint);
  font-size: 0.78rem;
}

/* ---------- app shell ---------- */

.app {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.app-ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

.sidebar {
  position: sticky;
  top: 0;
  z-index: 12;
  height: 100dvh;
  padding: 1.3rem 0.9rem 1rem;
  background: color-mix(in srgb, var(--card) 82%, transparent);
  backdrop-filter: blur(12px);
  border-right: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.brand { display: flex; align-items: center; gap: 0.7rem; padding: 0 0.4rem; }
.brand-mark { width: 2.3rem; height: 2.3rem; flex: none; }
.brand-name { font-family: var(--display); font-weight: 800; font-size: 1.06rem; letter-spacing: -0.03em; }
.brand-sub { font-size: 0.74rem; color: var(--muted); }

.palette-trigger {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  min-height: 2.6rem;
  padding: 0.4rem 0.55rem 0.4rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--card-2);
  color: var(--faint);
  font-size: 0.86rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.palette-trigger:hover { border-color: var(--accent); color: var(--muted); box-shadow: 0 0 0 3px var(--ring); }
.palette-trigger > svg { width: 1rem; height: 1rem; flex: none; }
.palette-trigger-label { flex: 1; text-align: left; }

.nav { display: grid; gap: 0.2rem; }

.nav-caption {
  margin: 0.4rem 0 0.5rem 0.75rem;
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}
.nav a + .nav-caption { margin-top: 1.15rem; }

.nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.7rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--r-sm);
  color: var(--ink-soft);
  transition: background 0.15s, color 0.15s;
}
.nav a:hover { background: var(--bg-soft); color: var(--ink); }

.nav a.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}
.nav a.active::before {
  content: "";
  position: absolute;
  left: -0.9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 3.5px;
  height: 1.4rem;
  border-radius: 0 4px 4px 0;
  background: var(--grad);
}

.nav-ico { width: 1.15rem; height: 1.15rem; flex: none; }
.nav-ico svg { width: 100%; height: 100%; }
.nav-label { flex: 1; font-size: 0.92rem; }

.nav-count {
  min-width: 1.5rem;
  height: 1.4rem;
  padding: 0 0.42rem;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}
.nav a.active .nav-count { background: var(--card); color: var(--accent); }

.sidebar-foot { margin-top: auto; display: grid; gap: 0.7rem; }

.side-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--card-2);
}
.side-user-text { flex: 1; min-width: 0; display: grid; }
.side-user-name { font-weight: 700; font-size: 0.88rem; line-height: 1.25; }
.side-user-role { font-size: 0.72rem; color: var(--muted); }
.side-user .icon-btn { width: 2rem; height: 2rem; border-color: transparent; background: transparent; }
.side-user .icon-btn:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); border-color: transparent; }

.theme-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--card-2);
}
.theme-seg-opt {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.15rem;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.theme-seg-opt svg { width: 0.95rem; height: 0.95rem; }
.theme-seg-opt.is-on { background: var(--card); color: var(--accent); box-shadow: var(--sh-sm); }

.main { min-width: 0; display: grid; grid-template-rows: auto 1fr auto; position: relative; z-index: 1; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem var(--pad) 0.8rem;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.top-titles { flex: 1; min-width: 0; }
.top-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.035em;
  line-height: 1.15;
}
.top-sub { margin: 0.1rem 0 0; color: var(--muted); font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.top-actions { display: flex; align-items: center; gap: 0.6rem; }

.top-date { display: inline-flex; align-items: center; gap: 0.42rem; color: var(--muted); font-size: 0.84rem; font-weight: 550; }
.top-date svg { width: 1rem; height: 1rem; }

.mode {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 650;
}
.mode-dot { width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--warm); }
.mode.live .mode-dot { background: var(--st-nyert); box-shadow: 0 0 0 3px color-mix(in srgb, var(--st-nyert) 22%, transparent); }
.mode.live { color: var(--st-nyert); border-color: color-mix(in srgb, var(--st-nyert) 30%, transparent); }
.deploy-info {
  display: inline-flex;
  align-items: center;
  padding: 0.32rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--faint);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}
.gate-deploy {
  margin: 0.55rem 0 0;
  text-align: center;
  color: var(--faint);
  font-size: 0.72rem;
  font-weight: 600;
}
.gate-deploy[hidden] { display: none; }
.deploy-info[hidden] { display: none; }

.page { padding: 1.4rem var(--pad) 2rem; min-width: 0; max-width: 76rem; width: 100%; margin: 0 auto; }

.page-enter { animation: fadeUp 0.38s var(--ease) both; }

.burger { display: none; }

.scrim {
  position: fixed;
  inset: 0;
  z-index: 14;
  background: rgba(20, 20, 14, 0.4);
  backdrop-filter: blur(2px);
}

/* ---------- panels / bento ---------- */

.panel {
  border-radius: var(--r-lg);
  border: 1px solid var(--line-soft);
  background: var(--card);
  box-shadow: var(--sh-sm);
  padding: 1.15rem 1.2rem 1.25rem;
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.95rem;
}
.panel-title { margin: 0; font-family: var(--display); font-weight: 700; font-size: 1.04rem; letter-spacing: -0.02em; }
.panel-tag {
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--muted);
  background: var(--bg-soft);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}
.panel-ico { width: 1.1rem; height: 1.1rem; color: var(--faint); }
.panel-ico svg { width: 100%; height: 100%; }
.panel-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--accent);
}
.panel-link:hover { text-decoration: underline; }
.panel-link-ico { width: 0.85rem; height: 0.85rem; }
.panel-link-ico svg { width: 100%; height: 100%; }
.panel-note { margin: 0.85rem 0 0; font-size: 0.78rem; color: var(--faint); }

.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0.9rem; margin-top: 0.9rem; }
.span-7 { grid-column: span 7; }
.span-5 { grid-column: span 5; }
.span-12 { grid-column: span 12; }

/* ---------- overview: greet + kpi ---------- */

.greet { margin: 0.15rem 0 1.05rem; }
.greet-title { margin: 0; font-family: var(--display); font-size: 1.65rem; font-weight: 800; letter-spacing: -0.035em; }
.greet-sub { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.94rem; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.9rem; }

.kpi {
  appearance: none;
  position: relative;
  display: grid;
  justify-items: start;
  gap: 0.1rem;
  text-align: left;
  padding: 1rem 1.05rem 1.1rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--sh-sm);
  cursor: pointer;
  color: inherit;
  overflow: hidden;
  transition: transform 0.16s var(--ease), box-shadow 0.2s, border-color 0.16s;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--sh-md); border-color: var(--line); }

.kpi-ico {
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 11px;
  margin-bottom: 0.55rem;
}
.kpi-ico svg { width: 1.1rem; height: 1.1rem; }
.kpi.tone-green .kpi-ico { background: var(--accent-soft); color: var(--accent); }
.kpi.tone-red .kpi-ico { background: color-mix(in srgb, var(--hot) 12%, transparent); color: var(--hot); }
.kpi.tone-blue .kpi-ico { background: color-mix(in srgb, var(--info) 11%, transparent); color: var(--info); }
.kpi.tone-violet .kpi-ico { background: color-mix(in srgb, var(--st-ajánlat) 12%, transparent); color: var(--st-ajánlat); }

.kpi-n {
  font-family: var(--display);
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.kpi-l { font-size: 0.84rem; font-weight: 650; color: var(--ink-soft); }
.kpi-sub { font-size: 0.74rem; color: var(--faint); margin-top: 0.12rem; }

.kpi-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3.5px;
  background: var(--line-soft);
}
.kpi-bar span { display: block; height: 100%; border-radius: 99px; transition: width 0.7s var(--ease); }
.kpi.tone-green .kpi-bar span { background: var(--grad); }
.kpi.tone-red .kpi-bar span { background: var(--hot); }
.kpi.tone-blue .kpi-bar span { background: var(--info); }
.kpi.tone-violet .kpi-bar span { background: var(--st-ajánlat); }

/* ---------- overview: funnel / prio ---------- */

.funnel { display: grid; gap: 0.55rem; }

.funnel-row {
  appearance: none;
  display: grid;
  grid-template-columns: 7.2rem 1fr 1.8rem;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  border: 0;
  background: none;
  padding: 0.2rem 0.15rem;
  border-radius: 8px;
  cursor: pointer;
  color: inherit;
  text-align: left;
}
.funnel-row:hover .funnel-label { color: var(--ink); }

.funnel-label { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.86rem; font-weight: 600; color: var(--ink-soft); }
.funnel-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; flex: none; }
.funnel-dot.st-új { background: var(--st-új); }
.funnel-dot.st-megkeresve { background: var(--st-megkeresve); }
.funnel-dot.st-ajánlat { background: var(--st-ajánlat); }
.funnel-dot.st-nyert { background: var(--st-nyert); }

.funnel-track { height: 0.85rem; border-radius: 99px; background: var(--bg-soft); overflow: hidden; }
.funnel-bar { display: block; height: 100%; border-radius: 99px; transition: width 0.8s var(--ease); }
.funnel-bar.st-új { background: var(--st-új); }
.funnel-bar.st-megkeresve { background: var(--st-megkeresve); }
.funnel-bar.st-ajánlat { background: var(--st-ajánlat); }
.funnel-bar.st-nyert { background: var(--st-nyert); }

.funnel-n { font-weight: 750; font-size: 0.9rem; text-align: right; font-variant-numeric: tabular-nums; }

.prio { display: grid; gap: 0.35rem; }

.prio-row {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  border: 0;
  background: none;
  padding: 0.45rem 0.3rem;
  border-radius: var(--r-sm);
  cursor: pointer;
  color: inherit;
  text-align: left;
  transition: background 0.15s;
}
.prio-row:hover { background: var(--card-2); }

.prio-ico {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 9px;
  flex: none;
}
.prio-ico svg { width: 1rem; height: 1rem; }
.prio-ico.pri-hot { background: color-mix(in srgb, var(--hot) 12%, transparent); color: var(--hot); }
.prio-ico.pri-warm { background: color-mix(in srgb, var(--warm) 13%, transparent); color: var(--warm); }
.prio-ico.pri-maybe { background: color-mix(in srgb, var(--maybe) 12%, transparent); color: var(--maybe); }

.prio-mid { flex: 1; min-width: 0; }
.prio-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.28rem; }
.prio-label { font-size: 0.86rem; font-weight: 650; }
.prio-n { font-size: 0.8rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.prio-track { display: block; height: 0.5rem; border-radius: 99px; background: var(--bg-soft); overflow: hidden; }
.prio-bar { display: block; height: 100%; border-radius: 99px; transition: width 0.8s var(--ease); }
.prio-bar.pri-hot { background: var(--hot); }
.prio-bar.pri-warm { background: var(--warm); }
.prio-bar.pri-maybe { background: var(--maybe); }
.prio-pct { font-size: 0.74rem; font-weight: 700; color: var(--faint); width: 2.2rem; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- overview: focus / feed / team strip ---------- */

.focus-list { display: grid; gap: 0.5rem; }

.focus-card {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line-soft);
  background: var(--card-2);
  border-radius: var(--r-md);
  padding: 0.75rem 0.85rem;
  cursor: pointer;
  color: inherit;
  transition: border-color 0.15s, background 0.15s, transform 0.14s var(--ease);
}
.focus-card:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateX(2px); }

.focus-ico {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  flex: none;
}
.focus-ico svg { width: 1.05rem; height: 1.05rem; }
.focus-ico.tone-red { background: color-mix(in srgb, var(--hot) 12%, transparent); color: var(--hot); }
.focus-ico.tone-amber { background: color-mix(in srgb, var(--warm) 13%, transparent); color: var(--warm); }
.focus-ico.tone-blue { background: color-mix(in srgb, var(--info) 11%, transparent); color: var(--info); }
.focus-ico.tone-violet { background: color-mix(in srgb, var(--st-ajánlat) 12%, transparent); color: var(--st-ajánlat); }

.focus-text { flex: 1; min-width: 0; }
.focus-title { display: block; font-weight: 700; font-size: 0.92rem; }
.focus-sub { display: block; color: var(--muted); font-size: 0.78rem; margin-top: 0.1rem; }

.focus-n {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.focus-chev { width: 1rem; height: 1rem; color: var(--faint); }
.focus-chev svg { width: 100%; height: 100%; }

.empty-mini {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem;
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  color: var(--muted);
  font-size: 0.88rem;
}
.empty-ico { width: 1.2rem; height: 1.2rem; color: var(--accent); flex: none; }
.empty-ico svg { width: 100%; height: 100%; }

.feed { display: grid; gap: 1rem; max-height: 24rem; overflow: auto; margin: -0.15rem -0.4rem 0; padding: 0.15rem 0.4rem 0; }

.feed-day-label {
  margin: 0 0 0.5rem;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.feed-items { display: grid; gap: 0.7rem; }
.feed-item { display: flex; gap: 0.6rem; align-items: flex-start; }
.feed-body { min-width: 0; }
.feed-top { display: flex; align-items: baseline; gap: 0.5rem; }
.feed-who { font-weight: 700; font-size: 0.84rem; }
.feed-time { font-size: 0.72rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.feed-text { margin: 0.1rem 0 0; color: var(--ink-soft); font-size: 0.85rem; line-height: 1.45; }

.mini-team {
  display: grid;
  gap: 0.85rem;
}
.mini-team-layer { min-width: 0; }
.mini-team-label {
  margin: 0 0 0.4rem;
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.mini-team-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr));
  gap: 0.55rem;
}

.mini-person {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--card-2);
}
.mini-person-text { flex: 1; min-width: 0; display: grid; }
.mini-person-name { font-weight: 700; font-size: 0.88rem; }
.mini-person-role { font-size: 0.72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-person-stat {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
  white-space: nowrap;
}

/* ---------- leads ---------- */

.leads-toolbar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem;
}

.search-wrap { position: relative; flex: 1; min-width: 0; }
.search-wrap > svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.05rem;
  height: 1.05rem;
  color: var(--faint);
  pointer-events: none;
}
.search-wrap input {
  width: 100%;
  min-height: var(--tap);
  border: 1px solid transparent;
  background: var(--card-2);
  border-radius: var(--r-md);
  padding: 0.6rem 1rem 0.6rem 2.5rem;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.search-wrap input:focus { border-color: var(--accent); outline: none; background: var(--card); box-shadow: 0 0 0 3px var(--ring); }

.toolbar-side { display: flex; align-items: center; gap: 0.5rem; }

.seg {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 0.22rem;
  padding: 0.22rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card-2);
}
.seg-opt {
  appearance: none;
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.05rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.seg-opt svg { width: 1rem; height: 1rem; }
.seg-opt.is-on { background: var(--card); color: var(--accent); box-shadow: var(--sh-sm); }

.filters { display: grid; gap: 0.5rem; margin: 0.8rem 0 0.9rem; }
.filters-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }

.filter-sep { width: 1px; height: 1.3rem; background: var(--line); margin: 0 0.3rem; }

.pill {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  min-height: 2.15rem;
  padding: 0.3rem 0.72rem;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-soft);
  box-shadow: var(--sh-sm);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.12s var(--ease);
}
.pill:active { transform: scale(0.96); }
.pill svg { width: 0.9rem; height: 0.9rem; }
.pill:hover { border-color: var(--accent); color: var(--accent); }

.pill-n {
  min-width: 1.25rem;
  height: 1.2rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.pill.is-on { border-color: transparent; color: #fff; }
.pill.is-on .pill-n { background: rgba(255, 255, 255, 0.22); color: #fff; }
.pill.is-on.pri-pill-all { background: var(--ink); }
.pill.is-on.pri-pill-hot { background: var(--hot); }
.pill.is-on.pri-pill-warm { background: var(--warm); }
.pill.is-on.pri-pill-maybe { background: var(--maybe); }
.pill.is-on.st-pill-új { background: var(--st-új); }
.pill.is-on.st-pill-megkeresve { background: var(--st-megkeresve); }
.pill.is-on.st-pill-ajánlat { background: var(--st-ajánlat); }
.pill.is-on.st-pill-nyert { background: var(--st-nyert); }
.pill.is-on.st-pill-vesztett { background: var(--st-vesztett); }
.pill.is-on.st-pill-hold { background: var(--st-hold); }

.select { position: relative; display: inline-flex; }
.select select {
  appearance: none;
  min-height: 2.15rem;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--sh-sm);
  padding: 0.3rem 2rem 0.3rem 0.8rem;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.select select:hover { border-color: var(--accent); }
.select-ico {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.85rem;
  height: 0.85rem;
  color: var(--faint);
  pointer-events: none;
}
.select-ico svg { width: 100%; height: 100%; }

.result-count { margin-left: auto; color: var(--muted); font-size: 0.8rem; font-weight: 550; }

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--sh-sm);
}
.table-wrap.is-hidden { display: none; }

table { width: 100%; border-collapse: collapse; min-width: 54rem; }

th, td { text-align: left; padding: 0.7rem 0.95rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }

th {
  font-size: 0.66rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 700;
  background: var(--card);
  position: sticky;
  top: 0;
  z-index: 1;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.th-sort {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  cursor: pointer;
}
.th-sort:hover { color: var(--ink); }
th.is-sorted .th-sort { color: var(--accent); }
.th-arrow { font-size: 0.72rem; min-width: 0.7rem; }

tbody tr { cursor: pointer; transition: background 0.12s; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--card-2); }

.td-lead { display: flex; align-items: center; gap: 0.65rem; min-width: 0; }
.td-lead-text { min-width: 0; display: grid; }
.td-name { font-weight: 700; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.td-domain { color: var(--faint); font-size: 0.74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.td-nowrap { white-space: nowrap; }
.td-contact { color: var(--ink-soft); font-size: 0.83rem; white-space: nowrap; }
.td-contact.is-empty { color: var(--faint); }
.td-go { width: 2rem; color: var(--faint); }
.td-go svg { width: 0.95rem; height: 0.95rem; margin-left: auto; }
tbody tr:hover .td-go { color: var(--accent); }

.lead-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 0.7rem; }
.lead-cards.is-hidden { display: none; }

.lead-card {
  position: relative;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--sh-sm);
  padding: 0.85rem 0.9rem;
  cursor: pointer;
  transition: transform 0.16s var(--ease), box-shadow 0.2s, border-color 0.15s;
}
.lead-card:hover { transform: translateY(-2px); box-shadow: var(--sh-md); border-color: var(--line); }

.lead-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.55rem; }
.lead-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; margin-top: 0.65rem; }
.lead-card-contact { font-size: 0.76rem; color: var(--muted); }
.lead-card-contact.is-empty { color: var(--faint); }
.lead-card-actions { display: flex; gap: 0.35rem; margin-top: 0.65rem; }
.lead-card-actions .icon-btn { width: 2rem; height: 2rem; }

/* ---------- drawer ---------- */

.drawer-bg {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(18, 18, 12, 0.42);
  backdrop-filter: blur(3px);
  animation: fadeIn 0.2s ease both;
}
.drawer-bg.closing { animation: fadeOut 0.18s ease both; }

.drawer {
  position: fixed;
  z-index: 21;
  left: 50%;
  top: 50%;
  width: min(68rem, calc(100vw - 2rem));
  height: min(46rem, calc(100dvh - 2rem));
  display: grid;
  grid-template-columns: 19.5rem minmax(0, 1fr);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--sh-lg);
  overflow: hidden;
  padding: 0;
  animation: sheetIn 0.28s var(--ease) both;
}
.drawer.closing { animation: sheetOut 0.18s ease both; }

.sheet-left {
  background: var(--card-2);
  border-right: 1px solid var(--line-soft);
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.sheet-left-scroll { padding: 1.05rem 1rem 1.2rem; overflow: auto; flex: 1; }
.drawer-id { display: flex; gap: 0.75rem; min-width: 0; }
.drawer-id-text { min-width: 0; }
.drawer-kicker { margin: 0; font-size: 0.7rem; font-weight: 650; color: var(--faint); }
.drawer h2 {
  margin: 0.12rem 0 0;
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.drawer-sub { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.82rem; }
.drawer-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin: 0.75rem 0 0.85rem; }

.call-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.7rem;
  margin-bottom: 0.95rem;
  border-radius: 12px;
  background: var(--grad);
  color: #fff;
  font-weight: 750;
  text-decoration: none;
}
.call-main svg { width: 1.1rem; height: 1.1rem; }
.call-main:hover { filter: brightness(1.06); }

.contact-list { display: grid; gap: 0.3rem; margin-bottom: 0.95rem; }
.contact-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem;
  align-items: center;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--card);
}
.contact-row a, .contact-row > div { min-width: 0; text-decoration: none; color: inherit; }
.contact-row a:hover { color: var(--accent); }
.contact-l {
  margin: 0;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 700;
}
.contact-v { margin: 0.1rem 0 0; font-size: 0.84rem; font-weight: 600; color: var(--ink-soft); overflow-wrap: anywhere; }
.copy-mini {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--faint);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.35rem;
  border-radius: 6px;
  cursor: pointer;
}
.copy-mini:hover { background: var(--bg-soft); color: var(--accent); }

.status-select {
  width: 100%;
  min-height: 2.4rem;
  margin-bottom: 0.85rem;
  padding: 0 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  font-weight: 650;
  font-size: 0.88rem;
}
.status-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }

.why-box {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--card);
  margin-bottom: 0.4rem;
}
.why-box p { margin: 0; font-size: 0.8rem; color: var(--ink-soft); line-height: 1.45; }

.sheet-right { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.sheet-rtop {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 1rem 1.15rem 0.75rem;
  border-bottom: 1px solid var(--line-soft);
  flex: none;
}
.sheet-title { margin: 0; font-family: var(--display); font-size: 1.2rem; letter-spacing: -0.03em; }
.sheet-meta { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.82rem; }
.sheet-nav { display: flex; gap: 0.3rem; flex: none; }

.sheet-rbody {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0.85rem 1.15rem 0;
}
.next-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.7rem;
  align-items: center;
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.7rem;
  border-radius: 14px;
  background: #f3f8f4;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  flex: none;
}
[data-theme="dark"] .next-card { background: var(--accent-soft); }
.next-card h3 {
  margin: 0 0 0.15rem;
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.next-card p { margin: 0; font-size: 0.86rem; font-weight: 650; }

.lead-chat {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.1rem 0.1rem 0.8rem;
}
.chat-empty { margin: auto; color: var(--faint); font-size: 0.88rem; }
.chat-day {
  align-self: center;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  background: var(--bg-soft);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}
.chat-sys {
  align-self: center;
  max-width: 92%;
  text-align: center;
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
}
.chat-msg { display: flex; gap: 0.45rem; max-width: 82%; align-items: flex-end; }
.chat-msg.them { align-self: flex-start; }
.chat-msg.me { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg .avatar { width: 1.35rem; height: 1.35rem; border-radius: 6px; font-size: 0.52rem; flex: none; }
.chat-bubble { padding: 0.55rem 0.75rem 0.5rem; border-radius: 16px; line-height: 1.45; }
.chat-msg.them .chat-bubble {
  background: var(--card-2);
  border: 1px solid var(--line-soft);
  border-bottom-left-radius: 6px;
}
.chat-msg.me .chat-bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 6px;
}
.chat-kind {
  margin: 0 0 0.18rem;
  font-size: 0.64rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.72;
}
.chat-bubble p { margin: 0; font-size: 0.86rem; }
.chat-meta { margin: 0.28rem 0 0 !important; font-size: 0.68rem !important; opacity: 0.7; font-weight: 600; }

.sheet-composer {
  flex: none;
  border-top: 1px solid var(--line-soft);
  padding: 0.7rem 1.15rem 0.75rem;
}
.kind-row { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.5rem; }
.kind-btn {
  appearance: none;
  min-height: 1.9rem;
  padding: 0 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 650;
  cursor: pointer;
}
.kind-btn.is-on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.compose-row { display: flex; gap: 0.45rem; align-items: flex-end; }
.compose-row textarea {
  flex: 1;
  min-height: 2.6rem;
  max-height: 7rem;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.65rem 0.8rem;
  font-size: 0.9rem;
  line-height: 1.4;
  background: var(--card-2);
}
.compose-row textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--card);
  box-shadow: 0 0 0 3px var(--ring);
}
.send-btn {
  appearance: none;
  width: 2.6rem;
  height: 2.6rem;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
}
.send-btn svg { width: 1.1rem; height: 1.1rem; }
.send-btn:hover { filter: brightness(1.08); }
.attach-btn { width: 2.6rem; height: 2.6rem; flex: none; }
.attach-btn svg { width: 1.15rem; height: 1.15rem; }
.compose-files { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.45rem; }
.compose-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  max-width: 100%;
  padding: 0.2rem 0.35rem 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 650;
}
.compose-chip button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  width: 1.2rem;
  height: 1.2rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.compose-chip svg { width: 0.75rem; height: 0.75rem; }
.compose-hint { flex: 1; margin: 0; color: var(--muted); font-size: 0.86rem; padding: 0.55rem 0; }

.att-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.4rem; }
.att-thumb {
  display: block;
  width: 7.5rem;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-soft);
  color: inherit;
  text-decoration: none;
  border: 1px solid var(--line-soft);
}
.att-thumb img { display: block; width: 100%; height: 4.6rem; object-fit: cover; background: var(--card-2); }
.att-thumb span, .file-card span {
  display: block;
  padding: 0.28rem 0.4rem 0.38rem;
  font-size: 0.68rem;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.att-file, .att-label {
  appearance: none;
  border: 1px solid var(--line-soft);
  background: var(--card-2);
  color: inherit;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 650;
  cursor: pointer;
}
.chat-msg.me .att-file, .chat-msg.me .att-label, .chat-msg.me .att-thumb {
  border-color: rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.files-empty { margin: 0; color: var(--faint); font-size: 0.8rem; }
.files-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.45rem; }
.file-card {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  border: 1px solid var(--line-soft);
  background: var(--card-2);
  color: inherit;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
}
.file-card.is-img img { width: 100%; height: 5.2rem; object-fit: cover; display: block; }
.file-card .file-ico { padding: 0.7rem 0.7rem 0; color: var(--accent); }
.file-card .file-ico svg { width: 1.1rem; height: 1.1rem; }
.files-drop { min-height: 8rem; }

.proj {
  display: block;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.proj:hover { border-color: var(--accent); }

.sheet-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 1.15rem 0.85rem;
  border-top: 1px solid var(--line-soft);
  flex: none;
}

.quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(6.4rem, 1fr)); gap: 0.45rem; margin-bottom: 1.1rem; }
.qa {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.65rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card-2);
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 650;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.12s var(--ease);
}
.qa:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.qa:active { transform: scale(0.96); }
.qa svg { width: 1.1rem; height: 1.1rem; }

.drawer-sec { margin-top: 1rem; }
.drawer-sec-label {
  margin: 0.65rem 0 0.45rem;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.seg-grid { display: grid; gap: 0.35rem; }
.seg-grid.seg-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.seg-cell {
  appearance: none;
  min-height: 2.3rem;
  padding: 0.35rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--card-2);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s var(--ease);
}
.seg-cell:active { transform: scale(0.96); }
.seg-cell:hover { border-color: var(--accent); color: var(--accent); }

.seg-cell.is-on { border-color: transparent; color: #fff; }
.seg-cell.is-on.st-pill-új { background: var(--st-új); }
.seg-cell.is-on.st-pill-megkeresve { background: var(--st-megkeresve); }
.seg-cell.is-on.st-pill-ajánlat { background: var(--st-ajánlat); }
.seg-cell.is-on.st-pill-nyert { background: var(--st-nyert); }
.seg-cell.is-on.st-pill-vesztett { background: var(--st-vesztett); }
.seg-cell.is-on.st-pill-hold { background: var(--st-hold); }
.seg-cell.is-on.pri-pill-hot { background: var(--hot); }
.seg-cell.is-on.pri-pill-warm { background: var(--warm); }
.seg-cell.is-on.pri-pill-maybe { background: var(--maybe); }

.log-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.log-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.15rem;
  padding: 0.35rem 0.7rem;
  border: 1px dashed var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.log-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.log-btn svg { width: 0.9rem; height: 0.9rem; }

.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 1.1rem;
}
.fact {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  background: var(--card-2);
  min-width: 0;
}
.fact-label {
  margin: 0 0 0.14rem;
  font-size: 0.64rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 700;
}
.fact-value { margin: 0; color: var(--ink-soft); font-size: 0.86rem; overflow-wrap: anywhere; }
.fact-value a { color: var(--accent); font-weight: 600; }
.fact-value a:hover { text-decoration: underline; }

.timeline-head {
  margin: 1.3rem 0 0.6rem;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.timeline { margin: 0; padding: 0; list-style: none; position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  left: 0.95rem;
  top: 0.6rem;
  bottom: 0.6rem;
  width: 2px;
  background: var(--line-soft);
}

.tl-item { position: relative; display: flex; gap: 0.7rem; padding-bottom: 0.95rem; }
.tl-item:last-child { padding-bottom: 0.2rem; }

.tl-ico {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 1.95rem;
  height: 1.95rem;
  border-radius: 9px;
  flex: none;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--card);
}
.tl-ico svg { width: 0.92rem; height: 0.92rem; }
.tl-email .tl-ico { background: color-mix(in srgb, var(--info) 12%, transparent); color: var(--info); }
.tl-reply .tl-ico { background: color-mix(in srgb, var(--st-nyert) 13%, transparent); color: var(--st-nyert); }
.tl-design .tl-ico { background: color-mix(in srgb, var(--st-ajánlat) 12%, transparent); color: var(--st-ajánlat); }
.tl-script .tl-ico { background: color-mix(in srgb, var(--warm) 13%, transparent); color: var(--warm); }

.tl-body { min-width: 0; flex: 1; }
.tl-top { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; }
.tl-title { font-weight: 650; color: var(--ink); font-size: 0.88rem; }
.tl-when { font-size: 0.72rem; color: var(--faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tl-meta { margin: 0.18rem 0 0; color: var(--muted); font-size: 0.78rem; line-height: 1.45; overflow-wrap: anywhere; }
.tl-actor { display: inline-flex; align-items: center; gap: 0.35rem; margin-top: 0.35rem; font-size: 0.72rem; font-weight: 650; color: var(--muted); }
.tl-actor .avatar { width: 1.15rem; height: 1.15rem; border-radius: 5px; font-size: 0.5rem; }

.d-notes {
  width: 100%;
  min-height: 6.5rem;
  resize: vertical;
  border: 1px solid var(--line);
  background: var(--card-2);
  border-radius: var(--r-md);
  padding: 0.75rem 0.9rem;
  line-height: 1.55;
  font-size: 0.9rem;
}
.d-notes:focus { border-color: var(--accent); outline: none; background: var(--card); box-shadow: 0 0 0 3px var(--ring); }
#d-stamp { margin-top: 0.4rem; }

.drawer-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 1.3rem;
  border-top: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--card) 86%, transparent);
  backdrop-filter: blur(12px);
}

/* ---------- modal ---------- */

.modal-bg {
  position: fixed;
  inset: 0;
  z-index: 22;
  background: rgba(18, 18, 12, 0.42);
  backdrop-filter: blur(3px);
  animation: fadeIn 0.2s ease both;
}

.modal {
  position: fixed;
  z-index: 23;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(30rem, calc(100% - 2rem));
  max-height: calc(100dvh - 3rem);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--sh-lg);
  animation: modalIn 0.28s var(--ease) both;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.05rem 1.2rem 0.8rem;
  border-bottom: 1px solid var(--line-soft);
}
.modal-head h2 { margin: 0; font-family: var(--display); font-size: 1.2rem; font-weight: 800; letter-spacing: -0.02em; }
.modal-body { display: grid; gap: 0.85rem; padding: 1.05rem 1.2rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  padding: 0.9rem 1.2rem 1.1rem;
  border-top: 1px solid var(--line-soft);
}

/* ---------- palette ---------- */

.palette-bg {
  position: fixed;
  inset: 0;
  z-index: 24;
  background: rgba(18, 18, 12, 0.42);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.18s ease both;
}

.palette {
  position: fixed;
  z-index: 25;
  top: 12dvh;
  left: 50%;
  transform: translateX(-50%);
  width: min(35rem, calc(100% - 2rem));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--sh-lg);
  overflow: hidden;
  animation: paletteIn 0.24s var(--ease) both;
}

.palette-input-wrap { position: relative; display: flex; align-items: center; gap: 0.6rem; padding: 0.9rem 1rem; border-bottom: 1px solid var(--line-soft); }
.palette-input-wrap > svg { width: 1.1rem; height: 1.1rem; color: var(--faint); flex: none; }
.palette-input-wrap input {
  flex: 1;
  border: 0;
  background: none;
  font-size: 1rem;
  min-width: 0;
}
.palette-input-wrap input:focus { outline: none; }

.palette-list { max-height: 21rem; overflow-y: auto; padding: 0.45rem; }

.palette-item {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: inherit;
  padding: 0.55rem 0.6rem;
  cursor: pointer;
}
.palette-item.is-active { background: var(--accent-soft); }
.palette-ico {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--muted);
  flex: none;
}
.palette-ico svg { width: 0.95rem; height: 0.95rem; }
.palette-item.is-active .palette-ico { background: var(--card); color: var(--accent); }
.palette-title { flex: 1; min-width: 0; font-size: 0.9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-hint { font-size: 0.72rem; color: var(--faint); white-space: nowrap; }
.palette-empty { padding: 1.6rem; text-align: center; color: var(--muted); font-size: 0.88rem; }

.palette-foot {
  display: flex;
  gap: 1rem;
  padding: 0.6rem 1rem;
  border-top: 1px solid var(--line-soft);
  color: var(--faint);
  font-size: 0.74rem;
}
.palette-foot span { display: inline-flex; align-items: center; gap: 0.3rem; }

/* ---------- toast ---------- */

#toast-root {
  position: fixed;
  z-index: 30;
  top: 1.1rem;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.95rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--sh-lg);
  animation: toastIn 0.28s var(--ease) both;
}
.toast.out { animation: toastOut 0.3s ease both; }
.toast-ico { width: 1rem; height: 1rem; display: grid; place-items: center; }
.toast-ico svg { width: 100%; height: 100%; }
.toast.ok .toast-ico { color: var(--accent-2); }
.toast.err .toast-ico { color: #ff9a8f; }

/* ---------- projects / team ---------- */

.hero-panel { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.hero-panel h3 { margin: 0 0 0.2rem; font-family: var(--display); letter-spacing: -0.02em; }
.hero-panel p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.hero-panel > div { flex: 1; min-width: 14rem; }
.hero-ico {
  display: grid;
  place-items: center;
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}
.hero-ico svg { width: 1.4rem; height: 1.4rem; }

.section-note { margin: 0 0 0.8rem; color: var(--muted); font-size: 0.86rem; }

.kanban { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; min-height: 16rem; }

.col {
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--sh-sm);
  padding: 0.85rem;
  min-width: 0;
}

.col-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.65rem; }
.col-name { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 700; font-size: 0.9rem; }
.col-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; }
.col-dot.tone-violet { background: var(--st-ajánlat); }
.col-dot.tone-pink { background: #d66ba8; }
.col-dot.tone-blue { background: var(--info); }
.col-dot.tone-green { background: var(--st-nyert); }
.col-n {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--bg-soft);
  min-width: 1.3rem;
  height: 1.25rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  padding: 0 0.3rem;
}

.col-empty {
  border: 1.5px dashed var(--line);
  border-radius: var(--r-md);
  min-height: 6.5rem;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 0.6rem;
  color: var(--faint);
  font-size: 0.78rem;
  line-height: 1.4;
}

.proj { padding: 0.7rem 0.8rem; border-radius: var(--r-md); background: var(--card-2); border: 1px solid var(--line-soft); margin-bottom: 0.5rem; }
.proj-name { font-weight: 700; font-size: 0.9rem; }
.proj-meta { color: var(--muted); font-size: 0.78rem; margin-top: 0.15rem; }

.org {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.org-tier {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.org-label {
  margin: 0 0 0.55rem;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}
.org-row {
  display: grid;
  gap: 0.8rem;
  width: 100%;
}
.org-row-owners {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 44rem;
}
.org-row-lead {
  grid-template-columns: minmax(0, 22rem);
  justify-content: center;
}
.org-row-ops {
  grid-template-columns: repeat(auto-fit, minmax(14.5rem, 1fr));
  max-width: 68rem;
  align-items: start;
}
.org-row-delivery {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  min-width: 18rem;
}
.org-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  grid-column: span 1;
}
.org-unit > .person { width: 100%; }
.org-spine {
  width: 2px;
  height: 1.35rem;
  margin: 0.15rem 0 0.55rem;
  background: var(--line);
  border-radius: 2px;
}
.org-fork {
  position: relative;
  width: min(78%, 46rem);
  height: 1.55rem;
  background: none;
  margin: 0.1rem 0 0.7rem;
}
.org-fork::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 2px;
  height: 52%;
  background: var(--line);
  transform: translateX(-50%);
  border-radius: 2px;
}
.org-fork::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  background: var(--line);
  border-radius: 2px;
}
.org-fork-sm {
  width: 72%;
  height: 1.2rem;
  margin: 0.4rem 0 0.5rem;
}
.org-tier-owners .person { border-color: color-mix(in srgb, var(--warm) 28%, var(--line-soft)); }
.org-tier-lead .person { border-color: color-mix(in srgb, var(--st-ajánlat) 32%, var(--line-soft)); }
.org-unit .person { border-color: color-mix(in srgb, var(--st-ajánlat) 22%, var(--line-soft)); }
.org-row-delivery .person { border-color: color-mix(in srgb, var(--accent) 22%, var(--line-soft)); }

.person {
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--sh-sm);
  padding: 1.05rem 1.1rem;
  transition: transform 0.16s var(--ease), box-shadow 0.2s;
}
.person:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }

.person-head { display: flex; align-items: center; gap: 0.75rem; }
.person-id { flex: 1; min-width: 0; }
.person-role {
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 750;
}
.person.owner .person-role { color: var(--warm); }
.person h3 { margin: 0.15rem 0 0; font-family: var(--display); font-size: 1.2rem; font-weight: 800; letter-spacing: -0.025em; }
.person-note { margin: 0.7rem 0 0; color: var(--muted); font-size: 0.86rem; line-height: 1.5; }
.person-stats { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.75rem; }
.person-stats span {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ink-soft);
  background: var(--bg-soft);
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
}

/* ---------- misc / empty / skeleton ---------- */

.empty {
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  padding: 2.4rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}
.empty .empty-ico { width: 1.6rem; height: 1.6rem; color: var(--faint); }

.empty-hero { text-align: center; padding: 2.4rem 1.4rem; }
.empty-hero h3 { margin: 0.6rem 0 0.3rem; }
.empty-hero p { margin: 0; color: var(--muted); }
.empty-hero .empty-ico { margin: 0 auto; }

.lead-meta { margin-top: 0.75rem; color: var(--muted); font-size: 0.8rem; }

.skel {
  border-radius: var(--r-lg);
  background: linear-gradient(100deg, var(--card) 30%, var(--card-2) 50%, var(--card) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
  border: 1px solid var(--line-soft);
}
.skel-hero { height: 4.4rem; margin-bottom: 0.9rem; }
.skel-card { height: 8.6rem; }
.skel-panel { height: 17rem; }

/* ---------- keyframes ---------- */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes drawerIn {
  from { transform: translateX(2.4rem); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@keyframes drawerOut {
  from { transform: none; opacity: 1; }
  to { transform: translateX(2rem); opacity: 0; }
}
@keyframes sheetIn {
  from { opacity: 0; transform: translate(-50%, -48%) scale(0.98); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes sheetOut {
  from { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  to { opacity: 0; transform: translate(-50%, -48%) scale(0.98); }
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes modalIn {
  from { opacity: 0; transform: translate(-50%, -49%) scale(0.97); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes paletteIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-0.7rem) scale(0.98); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-0.8rem) scale(0.95); }
  to { opacity: 1; transform: none; }
}
@keyframes toastOut {
  from { opacity: 1; }
  to { opacity: 0; transform: translateY(-0.5rem); }
}
@keyframes shake {
  0%, 100% { transform: none; }
  25% { transform: translateX(-0.45rem); }
  50% { transform: translateX(0.4rem); }
  75% { transform: translateX(-0.2rem); }
}
@keyframes shimmer {
  from { background-position: 120% 0; }
  to { background-position: -80% 0; }
}

/* ---------- settings ---------- */

.settings-form { display: grid; gap: 0.55rem; }
.settings-form .bento { margin-top: 0; }

.settings-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}
.settings-toolbar .settings-hint { margin: 0; }
.settings-toolbar-actions { display: inline-flex; gap: 0.4rem; }

.acc { padding: 0; overflow: hidden; }
.acc-head {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.62rem 0.9rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}
.acc-head::-webkit-details-marker { display: none; }
.acc-head:hover { background: var(--bg-soft); }
.acc-head:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
.acc-ico {
  width: 1.15rem;
  height: 1.15rem;
  flex: none;
  color: var(--accent);
}
.acc-ico svg { width: 100%; height: 100%; }
.acc-titles { display: grid; gap: 0.02rem; min-width: 0; }
.acc .panel-title { font-size: 0.92rem; }
.acc-sub { font-size: 0.7rem; font-weight: 600; color: var(--faint); }
.acc-meta { margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 0.4rem; }
.acc-chev { width: 0.95rem; height: 0.95rem; flex: none; color: var(--faint); transition: transform 0.18s ease; }
.acc-chev svg { width: 100%; height: 100%; }
.acc[open] .acc-chev { transform: rotate(180deg); }
.acc[open] .acc-head { border-bottom: 1px solid var(--line-soft); }
.acc[open] .acc-head:hover { background: transparent; }
.acc-body { display: grid; gap: 0.5rem; padding: 0.7rem 0.9rem 0.8rem; }
.acc-body .panel-note { margin-top: 0.1rem; }
.acc-group {
  margin: 0.15rem 0 -0.15rem;
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--faint);
}
.settings-switch-row { padding-bottom: 0.55rem; border-bottom: 1px dashed var(--line-soft); }
.settings-hint code {
  font-size: 0.78em;
  background: var(--bg-soft);
  padding: 0.05rem 0.32rem;
  border-radius: 4px;
}
#mail-custom { display: grid; }
#mail-custom[hidden] { display: none; }
.settings-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
  padding-top: 0.1rem;
}
.settings-foot .settings-hint { flex: 1; font-size: 0.76rem; }
.settings-foot .btn svg {
  width: 0.95rem;
  height: 0.95rem;
}

.s-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem 0.5rem;
}
.s-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.s-span-1 { grid-column: span 1; }
.s-span-2 { grid-column: span 2; }
.s-span-3 { grid-column: span 3; }
.s-span-4 { grid-column: span 4; }
.s-field { display: grid; gap: 0.16rem; min-width: 0; }
.s-field > label,
.s-field-lab {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--faint);
}
.s-in { position: relative; display: block; min-width: 0; }
.s-in-ico {
  position: absolute;
  left: 0.52rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.9rem;
  height: 0.9rem;
  color: var(--faint);
  pointer-events: none;
  display: grid;
  place-items: center;
}
.s-in-ico svg { width: 100%; height: 100%; }
.settings-form .s-in input,
.settings-form .s-in select {
  width: 100%;
  min-height: 2.12rem;
  padding: 0.28rem 0.55rem;
  font-size: 0.84rem;
  border: 1px solid var(--line);
  background: var(--card-2);
  border-radius: 8px;
}
.settings-form .s-in:has(.s-in-ico) input,
.settings-form .s-in:has(.s-in-ico) select {
  padding-left: 1.85rem;
}
.settings-form .s-in input:focus,
.settings-form .s-in select:focus {
  border-color: var(--accent);
  outline: none;
  background: var(--card);
  box-shadow: 0 0 0 3px var(--ring);
}
.s-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.s-inline-tight { justify-content: flex-start; min-height: 2.12rem; }
.s-inline-tight .s-in-ico { position: static; transform: none; }
.s-inline-lab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 650;
}
.s-inline-lab .s-in-ico { position: static; transform: none; }
.settings-probe {
  margin: 0.2rem 0 0;
  padding: 0.55rem 0.7rem;
  border-radius: var(--r-sm);
  font-size: 0.82rem;
  line-height: 1.35;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--ink-soft);
}
.settings-probe.ok {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: var(--accent-soft);
  color: var(--accent);
}
.settings-probe.err {
  border-color: color-mix(in srgb, #ff9a8f 50%, var(--line));
  background: rgba(255, 80, 70, 0.08);
  color: #ff9a8f;
}
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.86rem;
  color: var(--ink-soft);
}
.check-row input { margin-top: 0.2rem; accent-color: var(--accent); }
.field-help { margin: 0; font-size: 0.74rem; color: var(--faint); }
.secret-set {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
}
.pay-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.pay-card {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--card-2);
  padding: 0.55rem 0.65rem 0.65rem;
  display: grid;
  gap: 0.4rem;
}
.pay-card.is-on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.pay-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.pay-card-title {
  margin: 0;
  font-weight: 750;
  font-size: 0.84rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.pay-ico { width: 1rem; height: 1rem; color: var(--accent); display: grid; place-items: center; }
.pay-ico svg { width: 100%; height: 100%; }
.pay-card-sub { margin: 0.15rem 0 0; font-size: 0.74rem; color: var(--faint); }
.pay-card .s-field { gap: 0.12rem; }
.switch {
  position: relative;
  width: 2.55rem;
  height: 1.45rem;
  flex: none;
}
.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.switch-ui {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  transition: background 0.15s, border-color 0.15s;
}
.switch-ui::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 3px;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  background: var(--card);
  box-shadow: var(--sh-sm);
  transition: transform 0.18s var(--ease);
}
.switch input:checked + .switch-ui { background: var(--accent); border-color: transparent; }
.switch input:checked + .switch-ui::after { transform: translateX(1.05rem); }
.switch input:focus-visible + .switch-ui { box-shadow: 0 0 0 3px var(--ring); }
.goal-list { display: grid; gap: 0.7rem; }
.goal-row { display: grid; gap: 0.28rem; }
.goal-top { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.82rem; }
.goal-n { font-weight: 700; color: var(--ink); }
.goal-track {
  height: 0.42rem;
  border-radius: 999px;
  background: var(--bg-soft);
  overflow: hidden;
}
.goal-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--grad);
}
.goal-bar.is-low { background: linear-gradient(90deg, #c9842a, #e0b15a); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    z-index: 16;
    width: min(19rem, 88vw);
    transform: translateX(-112%);
    transition: transform 0.28s var(--ease);
    box-shadow: var(--sh-lg);
  }
  .sidebar.open { transform: none; }
  .burger { display: inline-grid; flex: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-7, .span-5 { grid-column: span 12; }
  .kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .org-row-ops { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .org-row-delivery { min-width: 0; }
  .s-grid, .s-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .s-span-2, .s-span-3, .s-span-4 { grid-column: span 2; }
}

@media (max-width: 760px) {
  .table-wrap { display: none; }
  .lead-cards { display: grid !important; grid-template-columns: 1fr; }
  .top-date { display: none; }
  .top-sub { display: none; }
  .top-title { font-size: 1.25rem; }
  .greet-title { font-size: 1.35rem; }
  .facts { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .s-grid, .s-grid-4 { grid-template-columns: 1fr 1fr; }
  .s-span-2, .s-span-3, .s-span-4 { grid-column: span 2; }
  .pay-grid { grid-template-columns: 1fr; }
  #new-lead span { display: none; }
  #new-lead { width: 2.3rem; padding: 0; min-height: 2.3rem; }
  .mode { padding: 0.3rem 0.5rem; }
  .page { padding-top: 1.1rem; }
  .drawer {
    left: 0;
    top: 0;
    transform: none;
    width: 100%;
    height: 100dvh;
    border-radius: 0;
    border: 0;
    grid-template-columns: 1fr;
    animation: fadeIn 0.2s ease both;
  }
  .drawer.closing { animation: fadeOut 0.18s ease both; }
  .sheet-left { max-height: 42vh; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .chat-msg { max-width: 92%; }
  .next-card { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
  .kpi { padding: 0.8rem 0.85rem 0.95rem; }
  .kpi-n { font-size: 1.55rem; }
  .kanban { grid-template-columns: 1fr; }
  .org-row-owners,
  .org-row-lead,
  .org-row-ops,
  .org-row-delivery { grid-template-columns: 1fr; max-width: none; min-width: 0; }
  .leads-toolbar { flex-wrap: wrap; }
  .search-wrap { flex: 1 1 100%; }
  .theme-fab { top: 0.85rem; right: 0.85rem; }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
}
