/* =====================================================================
   ViewPoint – belső felületek (belépés, regisztráció, ügyfélkapu, admin)
   ===================================================================== */

:root {
  --bg: #0b0c0c;
  --panel: #111313;
  --panel-2: #161919;
  --hover: #1b1f1f;
  --line: rgba(236, 231, 223, 0.08);
  --line-strong: rgba(236, 231, 223, 0.16);
  --text: #ece7df;
  --muted: #9b9891;
  --faint: #6a6863;
  --accent: #3cb6c2;
  --danger: #f2705f;
  --warn: #e8b04b;
  --ok: #5cc98b;

  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, Consolas, monospace;
  --radius: 10px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -0.02em; }
p { margin: 0; }
em { font-style: normal; color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent); color: var(--bg); }
svg.i { width: 16px; height: 16px; flex: none; }
[hidden] { display: none !important; }

/* ---------- Gombok, mezők ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 14px; border-radius: 8px;
  font: 500 14px/1 var(--font); text-decoration: none; white-space: nowrap;
  border: 1px solid var(--line-strong); background: transparent; color: var(--text);
  cursor: pointer; transition: background-color .15s, border-color .15s, color .15s, opacity .15s;
}
.btn:hover { background: var(--hover); border-color: rgba(236,231,223,.28); }
.btn-primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-primary:hover { background: #fff; border-color: #fff; }
.btn-danger { color: var(--danger); border-color: rgba(242,112,95,.35); }
.btn-danger:hover { background: rgba(242,112,95,.1); border-color: var(--danger); }
.btn-ghost { border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--hover); border-color: transparent; }
.btn-lg { height: 48px; padding: 0 20px; font-size: 15px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-icon { width: 34px; height: 34px; padding: 0; }
.btn[disabled] { opacity: .55; cursor: progress; }

.field { display: grid; gap: 6px; }
.field > label, .field-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 8px;
  font: 14px/1.4 var(--font);
  transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; }
.select { appearance: none; -webkit-appearance: none; padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%239b9891' stroke-width='1.5'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 14px; }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(60,182,194,.15); }
.input-lg { height: 48px; font-size: 15px; padding: 0 14px; border-radius: 10px; }
input[type="file"].input { padding: 8px 10px; height: auto; }
input[type="file"]::file-selector-button {
  margin-right: 10px; height: 26px; padding: 0 10px; border-radius: 6px;
  border: 1px solid var(--line-strong); background: var(--panel-2); color: var(--text); font: 500 13px var(--font); cursor: pointer;
}

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; font-size: 14px; border: 1px solid; }
.alert svg { margin-top: 2px; }
.alert-error { background: rgba(242,112,95,.08); border-color: rgba(242,112,95,.3); color: #f6a093; }
.alert-ok { background: rgba(92,201,139,.08); border-color: rgba(92,201,139,.3); color: #8fdcb0; }
.alert-info { background: rgba(60,182,194,.08); border-color: rgba(60,182,194,.3); color: #8fd3da; }

/* ---------- Középre igazított kártyás oldalak (belépés, regisztráció) ---------- */
.auth {
  min-height: 100svh; display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(60,182,194,.07), transparent 70%),
    var(--bg);
}
.auth-card { width: 100%; max-width: 400px; }
.auth-brand { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 32px; font-weight: 600; font-size: 16px; letter-spacing: -0.02em; text-decoration: none; }
.auth-brand svg { width: 28px; height: 28px; }
.auth-box { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 32px; }
.auth-box h1 { font-size: 26px; letter-spacing: -0.03em; }
.auth-box .sub { margin-top: 8px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.auth-box .sub strong { color: var(--text); font-weight: 500; }
.auth-form { display: grid; gap: 14px; margin-top: 24px; }
.auth-foot { margin-top: 20px; display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.auth-foot .btn-ghost { padding: 0 8px; height: 32px; font-size: 13px; }
.auth-note { text-align: center; margin-top: 20px; color: var(--faint); font-size: 13px; }
.auth-note a { color: var(--muted); }
.code-input {
  height: 64px; text-align: center; font: 600 30px/1 var(--mono);
  letter-spacing: .5em; text-indent: .5em; text-transform: uppercase;
}
@media (max-width: 420px) { .auth-box { padding: 24px 20px; } .code-input { font-size: 24px; letter-spacing: .4em; text-indent: .4em; } }

/* ---------- Alkalmazás váz (admin, ügyfélkapu) ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(11,12,12,.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar .brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -0.02em; }
.topbar .brand svg { width: 24px; height: 24px; }
.tag { font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 6px; padding: 4px 6px; }
.who { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line-strong); display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--text); text-transform: uppercase; }

.main { max-width: 1200px; margin: 0 auto; padding: 32px 20px 80px; }
.page-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-title h1 { font-size: 28px; letter-spacing: -0.03em; }
.page-title p { color: var(--muted); margin-top: 4px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.kpi span { display: block; font-size: 12px; color: var(--muted); }
.kpi strong { display: block; margin-top: 8px; font: 500 28px/1 var(--font); letter-spacing: -0.03em; }
@media (max-width: 760px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px;
  color: var(--muted); text-decoration: none; font-weight: 500; white-space: nowrap; background: none; border: 0; cursor: pointer; font: 500 14px var(--font);
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); }
.tab[aria-selected="true"]::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px; background: var(--text); border-radius: 2px; }
.count { font: 500 11px/1 var(--mono); padding: 3px 6px; border-radius: 999px; background: var(--panel-2); color: var(--muted); }
.panel[hidden] { display: none; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h2 { font-size: 15px; letter-spacing: -0.01em; }
.card-head p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.card-body { padding: 18px; }

.toolbar { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-filter {
  height: 30px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: transparent; color: var(--muted); font: 500 12px var(--font); cursor: pointer;
}
.chip-filter:hover { color: var(--text); }
.chip-filter[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

/* Táblázat */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font: 500 12px var(--font); color: var(--faint); padding: 10px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background-color .12s; }
.table tbody tr:hover { background: rgba(236,231,223,.025); }
.table .muted { color: var(--muted); }
.table .nowrap { white-space: nowrap; }
.table .actions { display: flex; gap: 4px; justify-content: flex-end; }
.person-cell strong { display: block; font-weight: 500; }
.person-cell span { display: block; color: var(--muted); font-size: 13px; }
.msg-preview { color: var(--muted); max-width: 46ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.empty { padding: 48px 18px; text-align: center; color: var(--faint); }

/* Státusz jelvények */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.s0 { color: #f2705f; } .badge.s1 { color: #e8b04b; } .badge.s3 { color: #d9cf6a; }
.badge.s4 { color: #5aa9e6; } .badge.s5 { color: #9b8cf0; } .badge.s6 { color: #5cc98b; }
.badge.neutral { color: var(--faint); }
.badge.ok { color: var(--ok); } .badge.warn { color: var(--warn); }
.badge span { color: var(--text); }

/* Modális ablak (oldalsó panel) */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 50; opacity: 0; pointer-events: none; transition: opacity .2s; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100%); z-index: 51;
  background: var(--panel); border-left: 1px solid var(--line);
  transform: translateX(100%); transition: transform .28s var(--ease);
  display: flex; flex-direction: column;
}
.drawer.open { transform: none; }
.drawer.open + .drawer-backdrop, .drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 16px; }
.drawer-body { padding: 20px; overflow-y: auto; display: grid; gap: 24px; }
.drawer-section { display: grid; gap: 12px; }
.drawer-section + .drawer-section { padding-top: 24px; border-top: 1px solid var(--line); }
.section-title { font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .04em; color: var(--faint); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .grid-2 { grid-template-columns: 1fr; } }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

.switch { position: relative; display: inline-block; width: 36px; height: 20px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--panel-2); border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer; transition: background-color .2s; }
.switch span::before { content: ''; position: absolute; width: 14px; height: 14px; left: 2px; top: 2px; border-radius: 50%; background: var(--muted); transition: transform .2s var(--ease), background-color .2s; }
.switch input:checked + span { background: var(--accent); border-color: var(--accent); }
.switch input:checked + span::before { transform: translateX(16px); background: #fff; }

.token-box { display: flex; gap: 8px; align-items: center; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 8px 8px 12px; }
.token-box code { flex: 1; font: 13px var(--mono); color: var(--accent); word-break: break-all; }

.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form .input, .inline-form .select { flex: 1; min-width: 160px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 60;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-weight: 500;
  opacity: 0; transition: opacity .2s, transform .2s var(--ease); pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Ügyfélkapu ---------- */
.client-hero { padding: 24px 0 28px; }
.client-hero .hello { color: var(--muted); }
.client-hero h1 { font-size: clamp(28px, 4vw, 40px); letter-spacing: -0.035em; margin-top: 6px; }
.doc-list { list-style: none; margin: 0; padding: 0; }
.doc { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); text-decoration: none; transition: background-color .12s; }
.doc:hover { background: rgba(236,231,223,.025); }
.doc-list li:last-child .doc { border-bottom: 0; }
.doc-icon { width: 36px; height: 36px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--accent); flex: none; }
.doc-text { flex: 1; min-width: 0; }
.doc-text strong { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-text span { display: block; color: var(--faint); font-size: 12px; }
.doc .go { color: var(--faint); }
.doc:hover .go { color: var(--text); }

@media (max-width: 760px) {
  .hide-sm { display: none !important; }
  .main { padding-top: 24px; }
  .table th, .table td { padding: 12px 14px; }
}
