/* Jordan admin – dashboard réteg a style.css tetején */

body.admin { background: var(--page); }

.admin-shell {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100dvh;
}

/* oldalsáv */
.side {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 0;
  height: 100dvh;
}
.side .brand { margin-bottom: 22px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border-radius: var(--r-sm);
  font-size: 14.5px;
  font-weight: 560;
  color: var(--ink-500);
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  text-align: left;
  width: 100%;
  transition: background .15s var(--ease), color .15s;
}
.nav-item svg { width: 18px; height: 18px; flex: none; }
.nav-item:hover { background: var(--surface-2); color: var(--ink-900); }
.nav-item.is-active {
  background: var(--grad-soft);
  color: var(--mint-600);
  font-weight: 650;
}
.side-foot { margin-top: auto; font-size: 12px; color: var(--ink-400); }

/* fő tartalom */
.main { padding: 30px 34px 60px; max-width: 1180px; width: 100%; }
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.page-head h1 { margin: 0 0 4px; font-size: 27px; }
.page-head p { margin: 0; color: var(--ink-500); font-size: 14.5px; }

.view { display: none; }
.view.is-active { display: block; animation: rise .35s var(--ease) both; }

/* statisztika kártyák */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.kpi::after {
  content: '';
  position: absolute;
  right: -30px; top: -30px;
  width: 92px; height: 92px;
  border-radius: 50%;
  background: var(--grad-soft);
}
.kpi-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--ink-400);
  font-weight: 620;
}
.kpi-value {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -.03em;
  margin-top: 6px;
  line-height: 1.1;
}
.kpi-sub { font-size: 12.5px; color: var(--ink-500); margin-top: 3px; }

/* panel */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px;
  margin-bottom: 18px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.panel-title { font-size: 16px; font-weight: 680; letter-spacing: -.01em; }
.panel-note { font-size: 13px; color: var(--ink-400); }

/* oszlopdiagram (napi) */
.spark {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 130px;
  padding-top: 8px;
}
.spark-col {
  flex: 1;
  min-width: 4px;
  background: var(--grad);
  border-radius: 5px 5px 3px 3px;
  min-height: 3px;
  opacity: .9;
  transition: opacity .15s;
  position: relative;
}
.spark-col:hover { opacity: 1; }
.spark-axis {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--ink-400);
  margin-top: 8px;
}

/* válaszmegoszlás */
.dist { display: grid; gap: 11px; }
.dist-row { display: grid; gap: 5px; }
.dist-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}
.dist-label { color: var(--ink-700); }
.dist-num { color: var(--ink-400); font-variant-numeric: tabular-nums; font-size: 13px; white-space: nowrap; }
.dist-track {
  height: 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 99px;
  overflow: hidden;
}
.dist-fill {
  height: 100%;
  background: var(--grad);
  border-radius: 99px;
  transition: width .6s var(--ease);
}

.q-stat { padding: 18px 0; border-bottom: 1px solid var(--line); }
.q-stat:last-child { border-bottom: none; padding-bottom: 0; }
.q-stat:first-child { padding-top: 0; }
.q-stat h3 { margin: 0 0 4px; font-size: 15.5px; font-weight: 650; letter-spacing: -.01em; }
.q-stat .meta { font-size: 12.5px; color: var(--ink-400); margin-bottom: 12px; }

/* táblázat */
.table-wrap { overflow-x: auto; margin: 0 -6px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 620px; }
th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-400);
  font-weight: 650;
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }
.cell-strong { font-weight: 620; }
.cell-muted { color: var(--ink-400); font-size: 13px; }

/* jelvények, gombok */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 650;
  padding: 4px 9px;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--ink-500);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.badge.on { background: rgba(18, 161, 80, .12); color: var(--ok); border-color: rgba(18, 161, 80, .25); }
.badge.off { background: rgba(125, 138, 157, .14); color: var(--ink-400); }
.badge.type { background: var(--grad-soft); color: var(--mint-600); border-color: transparent; }

.btn-sm { padding: 9px 14px; font-size: 13.5px; border-radius: var(--r-sm); }
.btn-line {
  background: var(--surface);
  border: 1.5px solid var(--line);
  color: var(--ink-700);
}
.btn-line:hover { border-color: var(--mint-500); color: var(--mint-600); }
.btn-danger { background: rgba(229, 72, 77, .1); color: var(--danger); border: 1.5px solid rgba(229, 72, 77, .25); }
.btn-danger:hover { background: rgba(229, 72, 77, .18); }
.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  color: var(--ink-500);
  transition: all .15s var(--ease);
  padding: 0;
}
.icon-btn:hover { border-color: var(--mint-500); color: var(--mint-600); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn[disabled] { opacity: .35; cursor: not-allowed; }
.row-actions { display: flex; gap: 7px; align-items: center; justify-content: flex-end; }

/* kérdéslista */
.qlist { display: grid; gap: 11px; }
.qcard {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: 15px 16px;
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.qcard:hover { border-color: rgba(20, 184, 166, .45); box-shadow: var(--shadow-sm); }
.qcard.inactive { opacity: .62; }
.qnum {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--grad-soft);
  color: var(--mint-600);
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 13.5px;
  flex: none;
}
.qcard-body { flex: 1; min-width: 0; }
.qcard-title { font-weight: 620; font-size: 15px; margin-bottom: 3px; }
.qcard-desc { font-size: 13px; color: var(--ink-400); margin-bottom: 8px; }
.qcard-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.qcard-side { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(8, 17, 31, .55);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}
.modal.is-open { display: flex; animation: fade .2s var(--ease); }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.modal-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 620px;
  max-height: 88dvh;
  overflow-y: auto;
  padding: 26px;
  animation: rise .28s var(--ease) both;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}
.modal-head h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }

.opt-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.opt-row .input { flex: 1; padding: 11px 13px; font-size: 14.5px; }

.switch { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.switch input { display: none; }
.switch .track {
  width: 44px; height: 26px;
  border-radius: 99px;
  background: var(--line);
  position: relative;
  transition: background .18s var(--ease);
  flex: none;
}
.switch .track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform .18s var(--ease);
}
.switch input:checked + .track { background: var(--mint-500); }
.switch input:checked + .track::after { transform: translateX(18px); }

/* belépő képernyő */
.login-wrap {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: 34px 30px;
  text-align: center;
}
.login-card .brand { justify-content: center; margin-bottom: 20px; }
.login-card h1 { font-size: 22px; margin-bottom: 6px; }

.empty {
  text-align: center;
  padding: 46px 20px;
  color: var(--ink-400);
  font-size: 14.5px;
}
.empty svg { width: 40px; height: 40px; opacity: .35; margin-bottom: 12px; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.search {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.search .input { padding-left: 40px; font-size: 14.5px; }
.search svg {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%);
  width: 17px; height: 17px;
  color: var(--ink-400);
  pointer-events: none;
}

.answer-list { display: grid; gap: 14px; }
.answer-item { border-left: 3px solid var(--mint-500); padding-left: 14px; }
.answer-q { font-size: 13px; color: var(--ink-400); margin-bottom: 3px; }
.answer-v { font-size: 15px; font-weight: 560; }

.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink-900);
  color: var(--page);
  padding: 12px 20px;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 560;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: all .25s var(--ease);
  z-index: 80;
}
.toast.is-visible { opacity: 1; transform: translateX(-50%); }
.toast.err { background: var(--danger); color: #fff; }

/* mobil */
.mobile-bar { display: none; }
@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .side {
    position: sticky;
    top: 0;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    padding: 12px;
    border-right: none;
    border-bottom: 1px solid var(--line);
    z-index: 20;
  }
  .side .brand { display: none; }
  .side-foot { display: none; }
  .nav-item { width: auto; white-space: nowrap; padding: 10px 14px; }
  .main { padding: 20px 14px 50px; }
  .page-head h1 { font-size: 22px; }
  .kpi-value { font-size: 26px; }
  .panel { padding: 16px; border-radius: var(--r-md); }
  .modal-card { padding: 20px; }
}
