/* ROVA Profile CRM – stílus */
:root {
  --accent: #c0202a;
  --accent-dark: #9c1a22;
  --sidebar: #1e2530;
  --sidebar-hover: #2b3444;
  --ink: #1f2733;
  --ink-soft: #5b6675;
  --line: #e3e7ec;
  --bg: #f4f6f9;
  --card: #ffffff;
  --ok: #1a7f45;
  --ok-bg: #e5f4ea;
  --warn: #9a6b00;
  --warn-bg: #fbf0d8;
  --danger: #b3261e;
  --danger-bg: #fbe6e5;
  --info: #1f5fa8;
  --info-bg: #e6eefb;
  --muted: #6b7482;
  --muted-bg: #edeff2;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20,30,45,.06), 0 4px 16px rgba(20,30,45,.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex-shrink: 0; background: var(--sidebar); color: #c8d0dc;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand {
  display: flex; align-items: center; gap: .6rem; padding: 1.1rem 1.2rem;
  color: #fff; font-weight: 700; font-size: 1.05rem; letter-spacing: .02em;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar .brand .logo {
  width: 28px; height: 28px; background: var(--accent); border-radius: 7px;
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: .8rem;
}
.sidebar nav { padding: .6rem; overflow-y: auto; flex: 1; }
.sidebar nav a {
  display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem;
  color: #c8d0dc; border-radius: 8px; font-weight: 500; margin-bottom: 2px;
}
.sidebar nav a:hover { background: var(--sidebar-hover); color: #fff; text-decoration: none; }
.sidebar nav a.active { background: var(--accent); color: #fff; }
.sidebar nav a .ico { width: 18px; text-align: center; opacity: .9; }
.sidebar nav .group { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em;
  color: #6b7688; padding: 1rem .7rem .35rem; }
.sidebar .side-foot { padding: .8rem 1rem; border-top: 1px solid rgba(255,255,255,.07); font-size: .78rem; color: #8a94a3; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: var(--card); border-bottom: 1px solid var(--line);
  padding: .7rem 1.5rem; display: flex; align-items: center; gap: 1rem;
  position: sticky; top: 0; z-index: 20;
}
.topbar .search { flex: 1; max-width: 420px; }
.topbar .search input {
  width: 100%; padding: .5rem .8rem; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); font-size: .9rem;
}
.topbar .user { display: flex; align-items: center; gap: .6rem; margin-left: auto; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: .78rem; flex-shrink: 0;
}
.avatar.sm { width: 26px; height: 26px; font-size: .68rem; }
.avatar.lg { width: 44px; height: 44px; font-size: .95rem; }
.content { padding: 1.5rem; flex: 1; }

.page-head { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-head .title { flex: 1; min-width: 200px; }
.page-head .title .sub { color: var(--ink-soft); font-size: .9rem; }
.page-head .actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------- Cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 1.25rem;
}
.card > .card-head {
  padding: .85rem 1.1rem; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: .6rem; font-weight: 600;
}
.card > .card-head .card-actions { margin-left: auto; display: flex; gap: .4rem; font-weight: 400; }
.card > .card-body { padding: 1.1rem; }
.card > .card-body.tight { padding: .4rem; }

.grid { display: grid; gap: 1.25rem; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.side { grid-template-columns: 2fr 1fr; align-items: start; }
@media (max-width: 1100px) { .grid.cols-4 { grid-template-columns: repeat(2,1fr); } .grid.side { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .sidebar { position: fixed; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .content { padding: 1rem; }
}

/* ---------- Stat tiles ---------- */
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.1rem; box-shadow: var(--shadow);
}
.stat .label { color: var(--ink-soft); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 1.6rem; font-weight: 700; margin-top: .25rem; }
.stat .meta { font-size: .82rem; color: var(--ink-soft); margin-top: .15rem; }
.stat .value.accent { color: var(--accent); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { padding: .6rem .8rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); background: #fafbfc; position: sticky; top: 0; }
table.data tbody tr:hover { background: #fafbfc; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .row-link { color: var(--ink); font-weight: 600; }
table.data tr.done td { color: var(--muted); text-decoration: line-through; }
.empty { padding: 2.5rem 1rem; text-align: center; color: var(--ink-soft); }
.empty .big { font-size: 2rem; display: block; margin-bottom: .4rem; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .55rem;
  border-radius: 999px; font-size: .76rem; font-weight: 600; white-space: nowrap;
  background: var(--muted-bg); color: var(--muted);
}
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.muted { background: var(--muted-bg); color: var(--muted); }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.pill-row { display: flex; flex-wrap: wrap; gap: .35rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .9rem;
  border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font-size: .88rem; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1;
}
.btn:hover { background: #f7f8fa; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.danger { color: var(--danger); border-color: var(--danger-bg); }
.btn.danger:hover { background: var(--danger-bg); }
.btn.sm { padding: .35rem .6rem; font-size: .8rem; }
.btn.block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Forms ---------- */
.form-row { margin-bottom: 1rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
label.field { display: block; }
label.field > span { display: block; font-weight: 600; font-size: .82rem; margin-bottom: .3rem; color: var(--ink); }
label.field > span .req { color: var(--accent); }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=url], input[type=tel], select, textarea {
  width: 100%; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; background: var(--card); color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--info-bg); border-color: var(--info); }
textarea { min-height: 90px; resize: vertical; }
.field .hint { font-size: .78rem; color: var(--ink-soft); margin-top: .25rem; }
.field .err { font-size: .78rem; color: var(--danger); margin-top: .25rem; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
.form-actions { display: flex; gap: .6rem; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin: 0 0 1.25rem; }
fieldset legend { font-weight: 700; padding: 0 .4rem; font-size: .9rem; }
.inline-check { display: flex; align-items: center; gap: .5rem; }
.inline-check input { width: auto; }

/* ---------- Flash ---------- */
.flashes { position: fixed; top: 1rem; right: 1rem; z-index: 100; display: flex; flex-direction: column; gap: .5rem; max-width: 360px; }
.flash {
  padding: .7rem .9rem; border-radius: 8px; box-shadow: var(--shadow); font-size: .88rem;
  background: var(--card); border-left: 4px solid var(--info); display: flex; gap: .5rem;
}
.flash.success { border-left-color: var(--ok); }
.flash.error { border-left-color: var(--danger); }
.flash.info { border-left-color: var(--info); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; flex-wrap: wrap; }
.tabs a {
  padding: .55rem .9rem; color: var(--ink-soft); font-weight: 600; border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Filters ---------- */
.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1rem; }
.filters .field { min-width: 150px; }
.filters label.field > span { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: .3rem; align-items: center; margin-top: 1rem; flex-wrap: wrap; }
.pagination a, .pagination span {
  padding: .35rem .65rem; border: 1px solid var(--line); border-radius: 7px; font-size: .85rem; color: var(--ink);
}
.pagination .current { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination .disabled { opacity: .4; }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 1.5rem; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.timeline .tl-item { position: relative; padding-bottom: 1.1rem; }
.timeline .tl-item::before {
  content: ""; position: absolute; left: -1.5rem; top: 3px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--card); border: 2px solid var(--accent);
}
.timeline .tl-item.type-email::before { border-color: var(--info); }
.timeline .tl-item.type-megbeszeles::before { border-color: var(--warn); }
.timeline .tl-item.type-helyszini_felmeres::before { border-color: var(--ok); }
.timeline .tl-head { display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; }
.timeline .tl-head .who { font-weight: 600; }
.timeline .tl-head .when { color: var(--ink-soft); font-size: .8rem; }
.timeline .tl-body { color: var(--ink-soft); font-size: .9rem; margin-top: .15rem; }

/* ---------- Kanban ---------- */
.kanban { display: flex; gap: .9rem; overflow-x: auto; padding-bottom: 1rem; align-items: flex-start; }
.kanban .col {
  flex: 0 0 265px; background: #eef1f5; border-radius: var(--radius); padding: .6rem;
  max-height: calc(100vh - 220px); display: flex; flex-direction: column;
}
.kanban .col > .col-head { display: flex; align-items: center; gap: .4rem; font-weight: 700; font-size: .85rem; padding: .3rem .4rem .55rem; }
.kanban .col > .col-head .count { margin-left: auto; background: var(--card); border-radius: 999px; padding: .05rem .5rem; font-size: .75rem; color: var(--ink-soft); }
.kanban .col > .col-head .sum { flex-basis: 100%; font-weight: 500; font-size: .76rem; color: var(--ink-soft); }
.kanban .col .col-body { overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: .5rem; min-height: 30px; }
.kanban .col.drop-hover .col-body { outline: 2px dashed var(--accent); outline-offset: 2px; border-radius: 6px; }
.deal-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .6rem .7rem;
  box-shadow: 0 1px 2px rgba(20,30,45,.05); cursor: grab;
}
.deal-card:active { cursor: grabbing; }
.deal-card.dragging { opacity: .45; }
.deal-card .dc-title { font-weight: 600; font-size: .86rem; display: block; margin-bottom: .3rem; color: var(--ink); }
.deal-card .dc-meta { font-size: .78rem; color: var(--ink-soft); display: flex; justify-content: space-between; gap: .4rem; }
.deal-card .dc-value { font-weight: 700; color: var(--ink); }

/* ---------- Misc ---------- */
.kv { display: grid; grid-template-columns: 150px 1fr; gap: .4rem .8rem; font-size: .9rem; }
.kv dt { color: var(--ink-soft); }
.kv dd { margin: 0; }
.muted-text { color: var(--ink-soft); }
.mono { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hr { height: 1px; background: var(--line); margin: 1rem 0; border: 0; }
.tag-link { color: var(--ink-soft); }
.bar { height: 8px; border-radius: 999px; background: var(--muted-bg); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); }
.chip { display: inline-block; padding: .1rem .5rem; background: var(--muted-bg); border-radius: 6px; font-size: .78rem; color: var(--ink-soft); }

/* értesítések – harang + panel */
.notif { position: relative; }
.notif-bell {
  position: relative; background: transparent; border: 1px solid var(--line); border-radius: 8px;
  width: 38px; height: 38px; font-size: 1.05rem; cursor: pointer; line-height: 1;
}
.notif-bell:hover { background: var(--bg); }
.notif-count {
  position: absolute; top: -6px; right: -6px; background: var(--accent); color: #fff;
  border-radius: 999px; font-size: .68rem; font-weight: 700; min-width: 17px; height: 17px;
  display: grid; place-items: center; padding: 0 3px; border: 2px solid var(--card);
}
.notif-panel {
  position: absolute; right: 0; top: calc(100% + 8px); width: 360px; max-width: 92vw;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(20,30,45,.18); z-index: 60; overflow: hidden;
}
.notif-panel[hidden] { display: none; }
.notif-panel-head { display: flex; align-items: center; justify-content: space-between; padding: .7rem .9rem; border-bottom: 1px solid var(--line); }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-empty { padding: 1.5rem; text-align: center; color: var(--ink-soft); }
.notif-item { display: flex; gap: .6rem; padding: .7rem .9rem; border-bottom: 1px solid var(--line); color: var(--ink); }
.notif-item:hover { background: var(--bg); text-decoration: none; }
.notif-item.read { opacity: .55; }
.notif-item .notif-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; background: var(--info); }
.notif-item.sev-urgent .notif-dot { background: var(--danger); }
.notif-item.sev-warn .notif-dot { background: var(--warn); }
.notif-text { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.notif-title { font-weight: 600; font-size: .88rem; }
.notif-body { font-size: .82rem; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-due { font-size: .76rem; color: var(--ink-soft); }
.notif-all { display: block; text-align: center; padding: .7rem; font-size: .85rem; font-weight: 600; border-top: 1px solid var(--line); }
table.data tr.is-read td { opacity: .6; }

/* stepper (megrendelés folyamat) */
.stepper { display: flex; gap: 0; flex-wrap: wrap; }
.stepper .step { flex: 1; min-width: 110px; text-align: center; position: relative; padding: .25rem .3rem; }
.stepper .step::before {
  content: ""; position: absolute; top: 15px; left: -50%; width: 100%; height: 2px; background: var(--line); z-index: 0;
}
.stepper .step:first-child::before { display: none; }
.stepper .step .dot {
  position: relative; z-index: 1; display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%; background: var(--card);
  border: 2px solid var(--line); color: var(--ink-soft); font-weight: 700; font-size: .8rem;
}
.stepper .step .lbl { display: block; font-size: .74rem; margin-top: .35rem; color: var(--ink-soft); }
.stepper .step.done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.stepper .step.done::before { background: var(--ok); }
.stepper .step.current .dot { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 3px var(--danger-bg); }
.stepper .step.current .lbl { color: var(--ink); font-weight: 700; }

/* funnel */
.funnel { display: flex; flex-direction: column; gap: .5rem; }
.funnel .fr { display: grid; grid-template-columns: 160px 1fr 130px; gap: .6rem; align-items: center; font-size: .86rem; }
.funnel .fr .track { background: var(--muted-bg); border-radius: 6px; height: 26px; position: relative; overflow: hidden; }
.funnel .fr .track > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-dark)); }
.funnel .fr .amt { text-align: right; font-weight: 600; }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--sidebar); padding: 1rem; }
.login-card { background: var(--card); border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.3); width: 100%; max-width: 380px; padding: 2rem; }
.login-card .brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.2rem; margin-bottom: .3rem; }
.login-card .brand .logo { width: 34px; height: 34px; background: var(--accent); border-radius: 8px; display: grid; place-items: center; color: #fff; }
.login-card .demo-hint { margin-top: 1rem; font-size: .8rem; color: var(--ink-soft); background: var(--bg); border-radius: 8px; padding: .7rem .8rem; }

/* print */
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .app, .main, .content { display: block; padding: 0; background: #fff; }
  .card { box-shadow: none; border: none; }
}
