/* ============================================================
   Matrix AI CRM - belso felulet
   A matrixai.hu weboldal design tokenjeibol (sotet tema).
   ============================================================ */

:root {
  --bg: #070b09;
  --bg-2: #0b110e;
  --bg-3: #0e1612;
  --line: #18241d;
  --line-2: #213129;
  --ink: #eaf6f0;
  --muted: #9fb4ab;
  --muted-2: #6f8379;

  --accent: #2ee6a6;
  --accent-soft: rgba(46, 230, 166, 0.14);
  --accent-line: rgba(46, 230, 166, 0.42);
  --accent-ink: #06100c;

  --info: #5ab0ff;
  --warn: #f7c948;
  --bad: #ff6b6b;
  --ok: #2ee6a6;

  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
  --font-display: "Sora", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --radius: 14px;
  --radius-sm: 10px;
  --t: cubic-bezier(0.22, 0.61, 0.36, 1);
  --shadow: 0 10px 40px -18px rgba(0, 0, 0, 0.7);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.5;
  font-size: 14.5px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}

h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }

p { margin: 0 0 1em; }

/* ---------- elrendezes ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 22px 22px 16px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid var(--line);
}
.sidebar-brand .logo {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 16px;
}
.sidebar-brand .name { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.sidebar-brand .name small { display: block; color: var(--muted-2); font-weight: 500; font-size: 10.5px; font-family: var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; }

.nav { padding: 12px 10px; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; margin-bottom: 2px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav a .ico { width: 18px; text-align: center; opacity: 0.85; }
.nav a:hover { background: var(--bg-3); color: var(--ink); }
.nav a.active { background: var(--accent-soft); color: var(--ink); box-shadow: inset 2px 0 0 var(--accent); }
.nav a .count {
  margin-left: auto;
  font-family: var(--font-mono); font-size: 11px;
  background: var(--line-2); color: var(--muted);
  padding: 1px 7px; border-radius: 999px;
}
.nav a.alert .count { background: var(--bad); color: #fff; }
.nav-sep { margin: 12px 12px 6px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted-2); }

.sidebar-foot { padding: 14px; border-top: 1px solid var(--line); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 11, 9, 0.7);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.topbar .crumbs { color: var(--muted); font-size: 13px; font-family: var(--font-mono); }
.topbar .crumbs b { color: var(--ink); font-weight: 600; }
.topbar .spacer { flex: 1; }

.content { padding: 28px; max-width: 1400px; width: 100%; }

.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .titles { flex: 1; min-width: 200px; }
.page-head h1 { margin: 0 0 4px; }
.page-head .sub { color: var(--muted); font-size: 13.5px; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- eyebrow / cimkek ---------- */
.eyebrow {
  font-family: var(--font-mono); font-weight: 500; font-size: 11px;
  letter-spacing: 0.28em; text-transform: uppercase; color: var(--accent);
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--accent-line); }

/* ---------- kartyak ---------- */
.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.card.pad-sm { padding: 16px; }
.card-title { font-family: var(--font-display); font-weight: 600; font-size: 1rem; margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
.card-title .ico { color: var(--accent); }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* statisztika kartya */
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat .label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.stat .value { font-family: var(--font-display); font-weight: 700; font-size: 1.7rem; line-height: 1.1; }
.stat .value.accent { color: var(--accent); }
.stat .hint { font-size: 12px; color: var(--muted-2); }

/* ---------- gombok ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 600; font-size: 13.5px;
  border-radius: var(--radius-sm); padding: 10px 18px;
  cursor: pointer; border: 1px solid transparent;
  transition: transform 0.12s, background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 24px -12px var(--accent); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--accent-line); }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-line { background: transparent; color: var(--muted); border-color: var(--line-2); }
.btn-line:hover { color: var(--ink); border-color: var(--muted-2); }
.btn-danger { background: transparent; color: var(--bad); border-color: rgba(255,107,107,0.4); }
.btn-danger:hover { background: rgba(255,107,107,0.12); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- badge-ek ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 500;
  padding: 3px 11px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--bg-3); color: var(--muted);
  white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: currentColor; opacity: 0.9; }
.badge-accent { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.badge-ok { color: var(--ok); border-color: var(--accent-line); background: var(--accent-soft); }
.badge-info { color: var(--info); border-color: rgba(90,176,255,0.35); background: rgba(90,176,255,0.1); }
.badge-warn { color: var(--warn); border-color: rgba(247,201,72,0.35); background: rgba(247,201,72,0.1); }
.badge-bad { color: var(--bad); border-color: rgba(255,107,107,0.35); background: rgba(255,107,107,0.1); }
.badge-muted { color: var(--muted); }

/* ---------- tablazatok ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th {
  text-align: left; font-family: var(--font-mono); font-weight: 500;
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--bg-2);
}
table.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tbody tr { transition: background 0.12s; }
table.tbl tbody tr:hover { background: var(--bg-2); }
table.tbl a.row-link { color: var(--ink); font-weight: 600; }
table.tbl a.row-link:hover { color: var(--accent); }
.tbl .num { text-align: right; font-family: var(--font-mono); }
.tbl .muted { color: var(--muted); }

/* ---------- urlapok ---------- */
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, 1fr); }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 760px) { .form-grid { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.field .help { font-size: 11.5px; color: var(--muted-2); }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=datetime-local], input[type=url], select, textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  padding: 10px 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { resize: vertical; min-height: 80px; font-family: var(--font-sans); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239fb4ab' d='M6 8L2 4h8z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.form-actions { display: flex; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }

.checkbox-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.checkbox-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.checkbox-row label { font-family: var(--font-sans); font-size: 14px; text-transform: none; letter-spacing: 0; color: var(--ink); }

/* ---------- flash ---------- */
.flash { margin-bottom: 18px; padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid; font-size: 13.5px; display: flex; align-items: center; gap: 10px; }
.flash-success { border-color: var(--accent-line); background: var(--accent-soft); color: var(--ink); }
.flash-error { border-color: rgba(255,107,107,0.4); background: rgba(255,107,107,0.1); color: var(--ink); }
.flash-info { border-color: rgba(90,176,255,0.4); background: rgba(90,176,255,0.1); color: var(--ink); }

/* ---------- kanban ---------- */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; }
.kanban-col { flex: 0 0 250px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 220px); }
.kanban-col h3 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding: 14px 14px 8px; margin: 0; display: flex; justify-content: space-between; }
.kanban-col h3 .n { color: var(--accent); }
.kanban-col .cards { padding: 8px 10px 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.kanban-card { background: var(--bg-3); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 12px; cursor: grab; transition: border-color 0.15s, transform 0.1s; }
.kanban-card:hover { border-color: var(--accent-line); }
.kanban-card.dragging { opacity: 0.5; }
.kanban-card .t { font-weight: 600; font-size: 13.5px; margin-bottom: 4px; }
.kanban-card .m { font-size: 11.5px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.kanban-col.drop-target { outline: 2px dashed var(--accent-line); outline-offset: -4px; }

/* ---------- belepes ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.login-card .brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.login-card .brand .logo { width: 38px; height: 38px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 20px; }

/* ---------- egyeb ---------- */
.muted { color: var(--muted); }
.text-sm { font-size: 12.5px; }
.mono { font-family: var(--font-mono); }
.accent { color: var(--accent); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }
.right { text-align: right; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-wrap { flex-wrap: wrap; }
.gap-sm { gap: 6px; }
.between { justify-content: space-between; }
.mt { margin-top: 18px; }
.mt-sm { margin-top: 10px; }
.mb { margin-bottom: 18px; }
.hr { height: 1px; background: var(--line); border: none; margin: 18px 0; }
.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty .ico { font-size: 36px; opacity: 0.4; margin-bottom: 12px; }
.pill-list { display: flex; gap: 6px; flex-wrap: wrap; }

.dl { display: grid; grid-template-columns: 160px 1fr; gap: 0; }
.dl dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding: 9px 0; border-bottom: 1px solid var(--line); }
.dl dd { margin: 0; padding: 9px 0; border-bottom: 1px solid var(--line); }
.dl dt:last-of-type, .dl dd:last-of-type { border-bottom: none; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 16px; color: var(--muted); font-weight: 600; font-size: 13.5px; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }

.progress { height: 7px; background: var(--bg-3); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.3s; }

/* Ego Haz Matrix */
.matrix { display: grid; grid-template-columns: 28px 1fr; grid-template-rows: 1fr 28px; gap: 6px; aspect-ratio: 1.3; max-width: 460px; }
.matrix .yaxis { writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); display: grid; place-items: center; }
.matrix .xaxis { grid-column: 2; text-align: center; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); display: grid; place-items: center; }
.matrix .quadrants { grid-column: 2; grid-row: 1; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 4px; position: relative; }
.matrix .q { border: 1px solid var(--line); border-radius: 8px; padding: 10px; font-size: 11px; color: var(--muted-2); display: flex; flex-direction: column; justify-content: flex-end; }
.matrix .q b { color: var(--muted); font-family: var(--font-display); font-size: 12.5px; }
.matrix .q.burning { background: rgba(255,107,107,0.06); border-color: rgba(255,107,107,0.3); }
.matrix .q.critical { background: rgba(247,201,72,0.06); border-color: rgba(247,201,72,0.3); }
.matrix .dot { position: absolute; width: 16px; height: 16px; border-radius: 999px; background: var(--accent); border: 3px solid var(--bg); box-shadow: 0 0 0 2px var(--accent); transform: translate(-50%, 50%); z-index: 2; }

@media (max-width: 920px) {
  .sidebar { position: fixed; left: -260px; z-index: 100; transition: left 0.2s; }
  .sidebar.open { left: 0; }
  .menu-toggle { display: inline-flex !important; }
}
.menu-toggle { display: none; }

/* ---------- Globalis kereso (Ctrl+K) ---------- */
.gsearch { position: relative; margin-right: 10px; }
.gsearch input[type="search"] {
  width: 220px; max-width: 40vw;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--ink);
  border-radius: 8px; padding: 7px 12px; font-size: 0.85rem; font-family: inherit;
}
.gsearch input[type="search"]:focus { outline: none; border-color: var(--accent); width: 300px; transition: width .15s; }
.gsearch-results {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 60;
  width: 380px; max-width: 90vw; max-height: 420px; overflow-y: auto;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 14px 40px rgba(0,0,0,.45);
}
.gsearch-results a {
  display: grid; grid-template-columns: 110px 1fr; gap: 2px 10px; align-items: baseline;
  padding: 9px 12px; text-decoration: none; border-bottom: 1px solid var(--line);
}
.gsearch-results a:last-child { border-bottom: none; }
.gsearch-results a:hover, .gsearch-results a.aktiv { background: rgba(46,230,166,0.08); }
.gs-tipus { font-size: 0.68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); font-family: var(--font-mono); }
.gs-cim { color: var(--ink); font-weight: 600; font-size: 0.88rem; }
.gs-al { grid-column: 2; color: var(--muted); font-size: 0.78rem; }
.gsearch-empty { padding: 14px; color: var(--muted); font-size: 0.85rem; }
@media (max-width: 760px) { .gsearch input[type="search"] { width: 130px; } .gsearch input[type="search"]:focus { width: 180px; } }
