/* ISPCLight — Modern hosting control panel */

:root {
  /* Light mode tokens (default) */
  --bg-canvas: #f6f7f9;
  --bg-surface: #ffffff;
  --bg-elevated: #ffffff;
  --bg-subtle: #f1f3f6;
  --bg-hover: #f6f7f9;

  --border: #e6e8ec;
  --border-strong: #d3d7de;

  --text-primary: #0b1220;
  --text-secondary: #525866;
  --text-tertiary: #8b94a3;
  --text-inverse: #ffffff;

  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff4ff;
  --accent-soft-strong: #dbeafe;
  --accent-fg: #ffffff;

  --success: #10b981;
  --success-soft: #ecfdf5;
  --warning: #f59e0b;
  --warning-soft: #fff7ed;
  --danger: #ef4444;
  --danger-soft: #fef2f2;
  --info: #6366f1;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  --sidebar-width: 248px;
  --topbar-height: 56px;
  --density-row: 52px;
  --density-pad: 16px;
}

[data-theme="dark"] {
  --bg-canvas: #0a0f1c;
  --bg-surface: #0f1626;
  --bg-elevated: #131b2c;
  --bg-subtle: #131b2c;
  --bg-hover: #1a2236;

  --border: #1d263a;
  --border-strong: #2a3551;

  --text-primary: #e7ebf3;
  --text-secondary: #99a3b8;
  --text-tertiary: #6b748a;
  --text-inverse: #0a0f1c;

  --accent-soft: #15224a;
  --accent-soft-strong: #1c2e6b;

  --success-soft: #0f2a23;
  --warning-soft: #2b1d0a;
  --danger-soft: #2b1216;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
}

[data-density="compact"] {
  --density-row: 40px;
  --density-pad: 12px;
}
[data-density="cozy"] {
  --density-row: 64px;
  --density-pad: 20px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-feature-settings: "cv11", "ss01";
  background: var(--bg-canvas);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 14px;
  line-height: 1.45;
}

button { font-family: inherit; }
code, kbd, .mono { font-family: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace; }

::selection { background: var(--accent-soft-strong); color: var(--text-primary); }

/* ---------- App layout ---------- */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

/* ── Sidebar close button (mobile drawer header) ── */
.sidebar-close {
  margin-left: auto;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 4px;
  display: none;             /* shown only when drawer is open, on mobile */
  border-radius: 6px;
}
.sidebar-close:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ── Sidebar backdrop (mobile) ── */
.sidebar-backdrop {
  display: none;
}

/* ── Topbar hamburger (mobile only) ── */
.topbar-burger {
  display: none;
}

/* ---------- Sidebar ---------- */

.sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border);
}
.brand-mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), color-mix(in oklab, var(--accent) 60%, #7c3aed));
  display: grid; place-items: center;
  color: white; font-weight: 700; font-size: 13px;
  box-shadow: 0 4px 10px color-mix(in oklab, var(--accent) 30%, transparent);
}
.brand-name {
  font-weight: 600; font-size: 15px; letter-spacing: -0.01em;
  color: var(--text-primary);
}
.brand-plan {
  margin-left: auto;
  font-size: 10px; font-weight: 600; letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 7px; border-radius: 999px;
  text-transform: uppercase;
}

.account-card {
  margin: 12px;
  padding: 10px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: border-color .15s;
}
.account-card:hover { border-color: var(--border); }
.avatar {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, #fb923c, #ec4899);
  display: grid; place-items: center;
  color: white; font-weight: 600; font-size: 12px;
  flex-shrink: 0;
}
.account-meta { flex: 1; min-width: 0; }
.account-name {
  font-weight: 600; font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.account-email {
  font-size: 11px; color: var(--text-tertiary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.nav {
  flex: 1;
  padding: 8px 8px 16px;
  overflow-y: auto;
}
.nav-section {
  font-size: 10px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding: 14px 12px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  position: relative;
  font-weight: 500;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
}
.nav-item.active .nav-icon { color: var(--accent); }
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; color: var(--text-tertiary); }
.nav-item:hover .nav-icon, .nav-item.active .nav-icon { color: inherit; }
.nav-badge {
  margin-left: auto;
  font-size: 10px; font-weight: 600;
  padding: 2px 6px; border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-tertiary);
  border: 1px solid var(--border);
}
.nav-item.active .nav-badge {
  background: white; color: var(--accent);
  border-color: color-mix(in oklab, var(--accent) 30%, transparent);
}

.sidebar-foot {
  border-top: 1px solid var(--border);
  padding: 10px;
  display: flex; flex-direction: column; gap: 4px;
}

/* ---------- Topbar ---------- */

.topbar {
  height: var(--topbar-height);
  background: color-mix(in oklab, var(--bg-canvas) 80%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.breadcrumbs {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}
.breadcrumb-sep { color: var(--text-tertiary); }
.breadcrumb-current { color: var(--text-primary); font-weight: 600; }
.breadcrumb-link { cursor: pointer; transition: color .12s; }
.breadcrumb-link:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.topbar-search {
  margin-left: auto;
  position: relative;
}
.topbar-search input {
  width: 260px;
  height: 34px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 10px 0 32px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.topbar-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.topbar-search input::placeholder { color: var(--text-tertiary); }
.search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: var(--text-tertiary);
}
.search-kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-size: 10px; font-weight: 600; color: var(--text-tertiary);
  background: var(--bg-subtle); padding: 2px 5px; border-radius: 4px;
  border: 1px solid var(--border);
}
.topbar-search-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px;
  display: grid; place-items: center;
  border: 0; background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: 4px;
  font-size: 16px;
  line-height: 1;
}
.topbar-search-clear:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ── Topbar "+ Új" dropdown ── */
.topbar-new-wrap { position: relative; }
.topbar-new.active,
.topbar-new:active {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.topbar-new.active:hover { background: var(--accent-hover); }
.topbar-new-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 260px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.topbar-new-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius-sm);
  text-align: left;
  font-family: inherit;
  color: var(--text-primary);
}
.topbar-new-menu-item:hover { background: var(--bg-hover); }
.topbar-new-menu-icon {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 8px;
  flex-shrink: 0;
}
.topbar-new-menu-text {
  display: flex; flex-direction: column;
  min-width: 0;
}
.topbar-new-menu-label { font-size: 13px; font-weight: 500; }
.topbar-new-menu-desc  { font-size: 11.5px; color: var(--text-tertiary); }

/* ── Mobile search trigger button (hamburger sibling) ── */
.mobile-search-trigger { display: none; }

/* ── Mobile fullscreen search sheet ── */
.mobile-search-sheet {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg-canvas);
  display: flex;
  flex-direction: column;
  animation: mobile-search-in .18s ease-out;
}
@keyframes mobile-search-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0);   }
}
.mobile-search-header {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.mobile-search-input {
  position: relative;
  flex: 1;
  height: 38px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
}
.mobile-search-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.mobile-search-input .search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}
.mobile-search-input input {
  flex: 1;
  height: 100%;
  background: transparent;
  border: 0;
  outline: 0;
  padding: 0 32px 0 32px;
  font-size: 14px;
  color: var(--text-primary);
  font-family: inherit;
  min-width: 0;
}
.mobile-search-input input::placeholder { color: var(--text-tertiary); }
.mobile-search-body {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}

@media (max-width: 900px) {
  .mobile-search-trigger { display: grid; place-items: center; }
}

/* ── Global search dropdown ─────────────────────────────────────── */
.global-search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: min(420px, 90vw);
  max-height: min(70vh, 600px);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
  z-index: 50;
  padding: 6px 0;
}
.global-search-state {
  padding: 16px;
  font-size: 13px;
  color: var(--text-tertiary);
  text-align: center;
}
.global-search-group {
  padding: 4px 0 6px;
}
.global-search-group + .global-search-group {
  border-top: 1px solid var(--border);
  margin-top: 2px;
}
.global-search-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.global-search-group-count {
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 500;
  background: var(--bg-subtle);
  padding: 1px 6px;
  border-radius: 999px;
}
.global-search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
}
.global-search-item.focused,
.global-search-item:hover { background: var(--bg-hover); }
.global-search-item-icon {
  width: 26px; height: 26px;
  flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--bg-subtle);
  border-radius: 6px;
  color: var(--text-secondary);
}
.global-search-item-text {
  display: flex; flex-direction: column;
  min-width: 0; flex: 1;
}
.global-search-item-label {
  font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.global-search-item-desc {
  font-size: 11.5px;
  color: var(--text-tertiary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.icon-btn .dot {
  position: absolute; top: 6px; right: 6px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-surface);
  box-sizing: content-box;
}

/* ---------- Main content ---------- */

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.content {
  padding: 28px 32px 64px;
  max-width: 1280px;
  width: 100%;
}
[data-density="compact"] .content { padding: 20px 24px 48px; }

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
  color: var(--text-primary);
}
.page-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}
.page-actions { display: flex; gap: 8px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--bg-hover); }
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--accent); color: var(--accent-fg);
  border-color: var(--accent);
  box-shadow: 0 1px 2px rgba(37, 99, 235, .25), inset 0 1px 0 rgba(255, 255, 255, .15);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-danger {
  background: var(--danger); color: white; border-color: var(--danger);
}
.btn-danger:hover { background: color-mix(in oklab, var(--danger) 85%, black); }
.btn-sm { height: 28px; padding: 0 9px; font-size: 12px; }
.btn-lg { height: 40px; padding: 0 16px; font-size: 14px; }
.btn:disabled,
.btn[disabled] {
  cursor: not-allowed;
  opacity: 0.5;
  pointer-events: auto;
}
.btn:disabled:hover { background: var(--bg); }
.btn-primary:disabled:hover { background: var(--accent); border-color: var(--accent); }
.btn-ghost:disabled:hover { background: transparent; color: var(--text-secondary); }

/* ---------- Cards ---------- */

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}
.card-sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.card-body { padding: 20px; }
.card-tight .card-body { padding: 0; }

/* ---------- Stats grid ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
@media (max-width: 1000px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
.stat {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  position: relative;
  overflow: hidden;
}
.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 10px;
  font-weight: 500;
}
.stat-icon {
  width: 22px; height: 22px;
  border-radius: 6px;
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
}
.stat-value {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat-value .stat-unit { font-size: 14px; color: var(--text-tertiary); font-weight: 500; margin-left: 2px; }
.stat-meta {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px;
  font-size: 11px;
}
.stat-delta-up { color: var(--success); display: flex; align-items: center; gap: 2px; font-weight: 600; }
.stat-delta-down { color: var(--danger); display: flex; align-items: center; gap: 2px; font-weight: 600; }
.stat-delta-flat { color: var(--text-tertiary); display: flex; align-items: center; gap: 2px; font-weight: 600; }

/* progress bar inside stat */
.bar {
  height: 6px; border-radius: 999px;
  background: var(--bg-subtle);
  overflow: hidden;
  margin-top: 12px;
}
.bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .4s ease;
}
.bar-fill.warn { background: var(--warning); }
.bar-fill.crit { background: var(--danger); }

/* ---------- Lists / tables ---------- */

.list { width: 100%; }
.list-row {
  display: grid;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
  cursor: pointer;
  min-height: var(--density-row);
}
.list-row > * { min-width: 0; }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--bg-hover); }

/* useDeleteWithSync — optimistic deletion. The row stays in the list
   muted/grayed while the sticky yellow toast waits for the worker
   watermark to catch the DELETE event. Once state='ok' the row is
   removed from pending and dropped on the next list refresh. */
.list-row.row--pending-delete,
.row--pending-delete {
  opacity: 0.52;
  filter: grayscale(40%);
  pointer-events: none;
  transition: opacity 0.25s ease, filter 0.25s ease;
}
.list-row.row--pending-delete:hover,
.row--pending-delete:hover {
  background: transparent;
  cursor: default;
}
.list-head {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: var(--text-tertiary);
  padding: 10px 20px;
  display: grid;
  align-items: center;
  gap: 16px;
  cursor: default;
}
.list-head:hover { background: var(--bg-subtle); }

.row-primary { font-weight: 500; color: var(--text-primary); display: flex; align-items: center; gap: 10px; min-width: 0; }
.row-primary > div { min-width: 0; }
.row-secondary { color: var(--text-secondary); font-size: 12px; }
.row-mono { font-family: "Geist Mono", monospace; font-size: 12px; color: var(--text-secondary); }

/* favicon-style icons */
.fav {
  width: 28px; height: 28px;
  border-radius: 7px;
  display: grid; place-items: center;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-weight: 700; font-size: 12px;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.fav-wp { background: #21759b; color: white; }
.fav-purple { background: linear-gradient(135deg, #a855f7, #6366f1); color: white; }
.fav-emerald { background: linear-gradient(135deg, #10b981, #059669); color: white; }
.fav-amber { background: linear-gradient(135deg, #fbbf24, #f97316); color: white; }
.fav-rose { background: linear-gradient(135deg, #fb7185, #e11d48); color: white; }
.fav-blue { background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: white; }
.fav-php { background: linear-gradient(135deg, #8892bf, #4f5b93); color: white; }

/* ---------- Badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-secondary);
}
.badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-tertiary);
}
.badge.no-dot::before { display: none; }
.badge-success {
  background: var(--success-soft);
  color: color-mix(in oklab, var(--success) 80%, black);
  border-color: color-mix(in oklab, var(--success) 30%, transparent);
}
.badge-success::before { background: var(--success); }
.badge-warning {
  background: var(--warning-soft);
  color: color-mix(in oklab, var(--warning) 70%, black);
  border-color: color-mix(in oklab, var(--warning) 30%, transparent);
}
.badge-warning::before { background: var(--warning); }
.badge-danger {
  background: var(--danger-soft);
  color: color-mix(in oklab, var(--danger) 75%, black);
  border-color: color-mix(in oklab, var(--danger) 30%, transparent);
}
.badge-danger::before { background: var(--danger); }
.badge-info {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: color-mix(in oklab, var(--accent) 30%, transparent);
}
.badge-info::before { background: var(--accent); }

[data-theme="dark"] .badge-success { color: #6ee7b7; }
[data-theme="dark"] .badge-warning { color: #fcd34d; }
[data-theme="dark"] .badge-danger { color: #fca5a5; }

/* Mini spinner inside a badge — used by SyncStatusBadge inline-pill
   (compact + hideOk on list rows / dashboard cells) to mark a pending
   mutation. 8px ring, color inherits the badge tone for a clean fit. */
.badge-spinner {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  border-top-color: transparent;
  opacity: 0.85;
  animation: badge-spinner-rotate 800ms linear infinite;
  flex-shrink: 0;
}
@keyframes badge-spinner-rotate {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .badge-spinner { animation: none; border-top-color: currentColor; opacity: 0.6; }
}

/* ---------- Tabs ---------- */

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.tab {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: flex; align-items: center; gap: 6px;
  user-select: none;
}
.tab:hover { color: var(--text-primary); }
.tab.active {
  color: var(--accent);
  font-weight: 600;
  border-bottom-color: var(--accent);
  border-bottom-width: 2px;
}
.tab-badge {
  font-size: 10px; font-weight: 600;
  padding: 1px 6px; border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-tertiary);
}
.tab.active .tab-badge { background: var(--accent-soft); color: var(--accent); }
.tab-badge.tab-badge-reached,
.tab.active .tab-badge.tab-badge-reached {
  background: var(--warning-soft);
  color: color-mix(in oklab, var(--warning) 70%, black);
}
[data-theme="dark"] .tab-badge.tab-badge-reached { color: #fcd34d; }

/* ---------- Forms ---------- */

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field-label { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.field-hint { font-size: 11px; color: var(--text-tertiary); }
.input, .select, .textarea {
  width: 100%;
  height: 36px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
}
.textarea { height: auto; padding: 10px; resize: vertical; min-height: 80px; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
/* Muted disabled state — transparent grey-out so the user sees a field
   exists but it's not editable right now (e.g. autoresponder fields
   when the master toggle is off). */
.input:disabled, .select:disabled, .textarea:disabled {
  background: var(--bg-subtle);
  color: var(--text-tertiary);
  border-color: var(--border);
  opacity: 0.65;
  cursor: not-allowed;
}
.input:disabled::placeholder, .textarea:disabled::placeholder {
  color: var(--text-tertiary);
  opacity: 0.7;
}
.input-group {
  display: flex;
  align-items: stretch;
}
.input-group .input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .input-addon {
  display: grid; place-items: center;
  padding: 0 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-left: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 12px;
  color: var(--text-secondary);
  font-family: "Geist Mono", monospace;
}

/* ---------- Empty state ---------- */

.empty {
  padding: 60px 24px;
  text-align: center;
  color: var(--text-secondary);
}
.empty-icon {
  width: 56px; height: 56px;
  margin: 0 auto 16px;
  border-radius: 14px;
  background: var(--bg-subtle);
  display: grid; place-items: center;
  color: var(--text-tertiary);
}
.empty-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.empty-desc { font-size: 13px; margin-bottom: 16px; max-width: 360px; margin-left: auto; margin-right: auto; }

/* ---------- SettingRow ---------- */
/* Label + value + optional action row a detail-cardokban.            */
/* Card body-n belül egymás alá pakolva, utolsó row borderless.       */

.setting-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  min-height: 48px;
}
.setting-row:last-child {
  border-bottom: none;
}
.setting-row-label {
  flex: 0 0 180px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: none;
}
.setting-row-value {
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
  min-width: 0;          /* truncate-safe inside flex */
  word-break: break-word;
}
.setting-row-action {
  flex: 0 0 auto;
  margin-left: auto;
}
/* Mobil-on a label fölé csúszik, mert 600px alatt nincs hely 180+content+action-re */
@media (max-width: 600px) {
  .setting-row {
    flex-wrap: wrap;
    align-items: flex-start;
    padding: 12px 16px;
  }
  .setting-row-label {
    flex: 0 0 100%;
    margin-bottom: 4px;
  }
  .setting-row-value {
    flex: 1;
  }
}

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(8, 11, 20, 0.5);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: grid; place-items: center;
  animation: fade-in .15s ease-out;
}
.modal {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  max-width: 540px;
  width: calc(100% - 32px);
  max-height: calc(100vh - 64px);
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: scale-in .18s ease-out;
  overflow: hidden;
}
.modal-lg { max-width: 720px; }
.modal-sm { max-width: 400px; }
.modal-header {
  padding: 20px 24px 0;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.modal-title { font-size: 16px; font-weight: 600; margin: 0 0 4px; }
.modal-sub { font-size: 13px; color: var(--text-secondary); margin: 0; }
.modal-body { padding: 20px 24px; overflow-y: auto; }
.modal-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px;
  background: var(--bg-subtle);
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes scale-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }

/* ---------- Tooltip / popover ---------- */

.kbd {
  font-family: "Geist Mono", monospace;
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

/* ---------- Misc ---------- */

.divider { height: 1px; background: var(--border); margin: 12px 0; }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.row-gap-1 { gap: 4px; } .row-gap-2 { gap: 8px; } .row-gap-3 { gap: 12px; } .row-gap-4 { gap: 16px; }
.spacer { flex: 1; }

.spark {
  display: block;
  width: 100%;
  height: 36px;
}

/* ---------- Chart ---------- */

.chart {
  width: 100%;
  height: 200px;
  display: block;
}
.chart-grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2 4; opacity: .6; }
.chart-axis { fill: var(--text-tertiary); font-size: 10px; font-family: "Geist Mono", monospace; }
.chart-area { fill: url(#chart-gradient); }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 1.5; }

/* ---------- Row action menu (list-row 3-dot dropdown) ---------- */
/* Position relative wrapper; popup absolute, jobbra igazítva hogy ne   */
/* fusson ki a list-row jobb szélén.                                    */

.row-menu {
  position: relative;
  display: inline-block;
}
.row-menu-trigger {
  width: 28px; height: 28px;
  border: 0; background: transparent;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-tertiary);
  display: grid; place-items: center;
}
.row-menu-trigger:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.row-menu.is-open .row-menu-trigger {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.row-menu-popup {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 10;
  min-width: 180px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 4px;
  animation: scale-in 0.12s ease-out;
}
.row-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  color: var(--text-primary);
}
.row-menu-item:hover {
  background: var(--bg-hover);
}
.row-menu-item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.row-menu-item.is-danger {
  color: var(--danger);
}
.row-menu-item.is-danger:hover {
  background: var(--danger-soft);
}
.row-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* ---------- Top clients leaderboard (Admin Dashboard) ---------- */
/* 8-col leaderboard table-szerű layout: rank | név | site | 5 metrika.  */
/* Az aktív metrika oszlopa kiemelve (is-active).                        */

.top-clients-table {
  display: flex; flex-direction: column;
  margin: 0 -20px -20px; /* compensate Card body padding */
}
.top-clients-head, .top-clients-row {
  display: grid;
  grid-template-columns: 32px minmax(160px, 1fr) 60px 130px 130px 110px 70px 130px;
  gap: 12px;
  padding: 10px 20px;
  align-items: center;
}
.top-clients-head {
  font-size: 11px; font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase; letter-spacing: 0.05em;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.top-clients-row {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 13px;
}
.top-clients-row:last-child { border-bottom: 0; }
.top-clients-row:hover { background: var(--bg-hover); }
.top-clients-row .rank {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text-tertiary);
  font-weight: 600;
}
.top-clients-row .who {
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.top-clients-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.top-clients-table .num.is-active {
  font-weight: 600;
  color: var(--text-primary);
}
.top-clients-row .num .row-secondary {
  font-size: 11px;
}

/* 900px-en a két szélső metrika (DNS, DB) szűkül; 600px alatt csak az
   aktív metrika + név + rank látszik — mobilon a pill-választás úgyis
   irányítja amit a user lát. */
@media (max-width: 1100px) {
  .top-clients-head, .top-clients-row {
    grid-template-columns: 32px minmax(140px, 1fr) 50px 110px 110px 90px 60px 110px;
    gap: 8px;
  }
}
@media (max-width: 760px) {
  .top-clients-head, .top-clients-row {
    grid-template-columns: 28px 1fr auto;
    gap: 8px;
  }
  /* hide all numeric cols except the active one */
  .top-clients-table .num:not(.is-active) { display: none; }
}

/* ---------- Warn list (Dashboard Figyelem card) ---------- */
/* Compact warning rows a Dashboard Figyelem card-ban. Csak akkor */
/* renderelődik a card, ha tényleg van warning — különben hidden.  */

.warn-list { display: flex; flex-direction: column; }
.warn-row {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
}
.warn-row:last-child { border-bottom: 0; }
.warn-row:hover .warn-text { color: var(--accent); }
.warn-icon {
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.warn-icon[data-tone="danger"]  { background: var(--danger-soft);  color: var(--danger); }
.warn-icon[data-tone="warning"] { background: var(--warning-soft); color: var(--warning); }
.warn-icon[data-tone="info"]    { background: var(--accent-soft);  color: var(--accent); }
.warn-content { flex: 1; min-width: 0; }
.warn-text { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.warn-sub  { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }

/* ---------- Quick actions (Dashboard Gyors műveletek card) ---------- */
/* Navigation tiles a 4 leggyakoribb create-flow-hoz. Activity feed-et   */
/* váltja le, ami 100% mock volt.                                        */

.quick-actions { display: flex; flex-direction: column; }
.quick-action {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 4px;
  border: 0; background: transparent;
  border-bottom: 1px solid var(--border);
  text-align: left;
  cursor: pointer;
  color: inherit;
  width: 100%;
}
.quick-action:last-child { border-bottom: 0; }
.quick-action:hover .quick-action-title { color: var(--accent); }
.quick-action-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.quick-action-icon[data-tone="accent"]  { background: var(--accent-soft);  color: var(--accent); }
.quick-action-icon[data-tone="info"]    { background: var(--accent-soft);  color: var(--accent); }
.quick-action-icon[data-tone="success"] { background: var(--success-soft); color: var(--success); }
.quick-action-icon[data-tone="muted"]   { background: var(--bg-subtle);    color: var(--text-secondary); }
.quick-action-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.quick-action-title { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.quick-action-sub   { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }

/* ---------- WordPress installer steps ---------- */

.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 24px 16px;
}
.step {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 500;
}
.step-circle {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg-subtle);
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
}
.step.done .step-circle, .step.active .step-circle {
  background: var(--accent); color: white; border-color: var(--accent);
}
.step.active { color: var(--text-primary); }
.step.done { color: var(--text-secondary); }
.step-line {
  flex: 1; height: 1px; background: var(--border);
  margin: 0 2px;
}
.step.done + .step-line { background: var(--accent); }

/* ---------- Toggle ---------- */

.toggle {
  width: 36px; height: 20px;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  position: relative;
  cursor: pointer;
  transition: background .15s;
  flex-shrink: 0;
}
.toggle.on { background: var(--accent); border-color: var(--accent); }
.toggle::after {
  content: "";
  position: absolute;
  top: 1px; left: 1px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
  transition: transform .15s;
}
.toggle.on::after { transform: translateX(16px); }

/* ---------- Skeleton ---------- */

.skel {
  background: linear-gradient(90deg, var(--bg-subtle) 0%, var(--bg-hover) 50%, var(--bg-subtle) 100%);
  background-size: 200% 100%;
  animation: shine 1.6s infinite;
  border-radius: 6px;
}
@keyframes shine { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ---------- Tag (input-style) ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 6px;
  font-size: 11px; font-weight: 500;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* ---------- Resource bar (dashboard) ---------- */
.res-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.res-row:last-child { border-bottom: 0; }
.res-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px;
  grid-column: span 2;
}
.res-name { font-weight: 500; color: var(--text-primary); display: flex; align-items: center; gap: 6px; }
.res-val { font-variant-numeric: tabular-nums; color: var(--text-secondary); font-size: 11px; font-family: "Geist Mono", monospace; }

/* density-driven helpers */
.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }

/* DNS records grid */
.dns-grid { grid-template-columns: 80px 1.5fr 80px 2fr 80px 32px; }
@media (max-width: 900px) { .dns-grid { grid-template-columns: 80px 1.5fr 2fr 32px; } .dns-hide { display: none !important; } }
@media (max-width: 600px) {
  .list-row.dns-grid,
  .list-head.dns-grid {
    grid-template-columns: 56px 1fr 28px;
    gap: 8px;
    padding: 12px 12px;
  }
  /* hide the value cell (was 4th, but with .dns-hide already gone for cols 3+5,
     remaining indices are: 1=type, 2=name, 3=value, 4=trash) — instead of hiding
     value (essential), hide the trash on the row and let the row tap open detail */
  .list-row.dns-grid > :nth-child(3) { display: none; }   /* value: tap row to see */
  .list-head.dns-grid > :nth-child(3) { display: none; }
}

/* mock-data marker — small ◌ dot next to any value that's still synthetic.
   Hidden when the page has data-mock-markers="off" (toggled from Tweaks). */
.mock-mark {
  display: inline-block;
  margin-left: 5px;
  color: var(--warning);
  font-size: 0.95em;
  font-weight: 600;
  vertical-align: baseline;
  cursor: help;
  user-select: none;
}
.mock-mark:hover { color: var(--danger); }
[data-mock-markers="off"] .mock-mark { display: none; }

/* websites grid */
.sites-grid { grid-template-columns: 2fr 1fr 1fr 110px 100px 32px; }
@media (max-width: 900px) { .sites-grid { grid-template-columns: 2fr 1fr 110px 100px 32px; } .sites-hide { display: none !important; } }
@media (max-width: 600px) {
  .list-row.sites-grid,
  .list-head.sites-grid {
    grid-template-columns: 1fr auto 28px;
    gap: 8px;
    padding: 12px 14px;
  }
  /* hide: status badge (2), traffic (3 — already hidden), PHP version (5) */
  .list-row.sites-grid > :nth-child(2),
  .list-row.sites-grid > :nth-child(5),
  .list-head.sites-grid > :nth-child(2),
  .list-head.sites-grid > :nth-child(5) { display: none; }
  .list-head.sites-grid { display: none; }
}

/* Owner column variant — adds a "Tulajdonos" cell between domain and status.
 * Applied via `.with-owner` on the parent .list so plain users keep the
 * normal grid. Below 900px the owner column narrows; below 600px it hides
 * entirely (mobile uses the compact 3-col layout above). */
.sites-grid.with-owner { grid-template-columns: 2fr 130px 1fr 1fr 110px 100px 32px; }
@media (max-width: 900px) { .sites-grid.with-owner { grid-template-columns: 2fr 100px 1fr 110px 100px 32px; } }
@media (max-width: 600px) {
  .list-row.sites-grid.with-owner > :nth-child(2),
  .list-head.sites-grid.with-owner > :nth-child(2) { display: none; }
}

/* Owner cell — chip-like badge with the client display name. */
.owner-cell {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--bg-subtle, #f3f4f6);
  color: var(--text-secondary, #4b5563);
  font-size: 12px;
  line-height: 1.4;
}
.owner-cell.muted { background: transparent; color: var(--text-tertiary, #9ca3af); padding-left: 0; }

/* Owner filter combobox — fits inline in the ListToolbar's rightActions slot. */
.owner-filter { position: relative; display: inline-flex; }
.owner-filter-button {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 8px 0 10px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-surface); color: var(--text-primary);
  font-size: 12px; font-weight: 500; cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.owner-filter-button:hover { background: var(--bg-subtle); }
.owner-filter.is-open .owner-filter-button { border-color: var(--accent); }
.owner-filter-icon { opacity: 0.5; flex-shrink: 0; }
.owner-filter-label { color: var(--text-tertiary); font-weight: 400; }
.owner-filter-value { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.owner-filter-caret { opacity: 0.55; font-size: 10px; margin-left: 2px; }

/* Active (filter applied) — accent-tinted chip with inline clear */
.owner-filter.is-active .owner-filter-button {
  background: color-mix(in oklab, var(--accent) 10%, var(--bg-surface));
  border-color: color-mix(in oklab, var(--accent) 50%, var(--border));
  color: color-mix(in oklab, var(--accent) 80%, var(--text-primary));
}
.owner-filter.is-active .owner-filter-icon { opacity: 0.9; color: var(--accent); }
.owner-filter.is-active .owner-filter-label {
  color: color-mix(in oklab, var(--accent) 65%, var(--text-secondary));
}
.owner-filter.is-active .owner-filter-value { font-weight: 600; }
.owner-filter.is-active .owner-filter-button:hover {
  background: color-mix(in oklab, var(--accent) 16%, var(--bg-surface));
}
.owner-filter-clear {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  border-radius: 4px;
  color: var(--accent); opacity: 0.7;
  cursor: pointer;
  margin-left: 2px;
  transition: background 0.15s, opacity 0.15s;
}
.owner-filter-clear:hover {
  background: color-mix(in oklab, var(--accent) 22%, transparent);
  opacity: 1;
}
.owner-filter-clear:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}

.owner-filter-popup {
  position: absolute; top: calc(100% + 4px); right: 0;
  width: 300px; max-width: 92vw;
  background: var(--bg-surface);
  border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.12);
  z-index: 200;
  padding: 8px;
  display: flex; flex-direction: column; gap: 6px;
}
.owner-filter-search {
  width: 100%; height: 34px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 7px;
  background: var(--bg-input, var(--bg-subtle));
  color: var(--text-primary); font-size: 13px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.owner-filter-search:focus {
  border-color: var(--accent);
  background: var(--bg-surface);
}
.owner-filter-list { max-height: 280px; overflow-y: auto; padding: 2px 0; }
.owner-filter-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 6px;
  cursor: pointer; font-size: 13px;
  color: var(--text-primary);
}
.owner-filter-item-icon { opacity: 0.45; flex-shrink: 0; color: var(--text-secondary); }
.owner-filter-item.is-highlight { background: var(--bg-subtle); }
.owner-filter-item.is-highlight .owner-filter-item-icon { opacity: 0.7; }
.owner-filter-item.is-selected { color: var(--accent); font-weight: 500; }
.owner-filter-item.is-selected .owner-filter-item-icon { color: var(--accent); opacity: 1; }
.owner-filter-item-all {
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px; padding-bottom: 10px;
  border-radius: 6px 6px 0 0;
}
.owner-filter-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.owner-filter-item-hint {
  color: var(--text-tertiary); font-size: 11px; font-weight: 400;
  margin-left: 4px;
}
.owner-filter-item-sub { color: var(--text-tertiary); font-size: 11px; }
.owner-filter-item-tag {
  font-size: 10px; font-weight: 500; padding: 2px 6px; border-radius: 4px;
  background: var(--accent-subtle, color-mix(in oklab, var(--accent) 14%, transparent));
  color: var(--accent);
}
.owner-filter-empty {
  padding: 24px 16px; text-align: center;
  color: var(--text-tertiary); font-size: 12px;
  display: flex; flex-direction: column; align-items: center;
}

/* child site row — alias / subdomain / addon under its primary vhost */
.list-row.is-child {
  background: var(--bg-subtle);
  position: relative;
}
.list-row.is-child::before {
  content: "";
  position: absolute;
  left: 28px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent-soft-strong, var(--border-strong));
}
.list-row.is-child > :first-child { padding-left: 32px; }
.list-row.is-child:last-of-type::before { bottom: 50%; }
.list-row.is-parent-of-children { border-bottom-color: transparent; }
.list-row.orphan-header {
  background: var(--bg-subtle);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-tertiary);
  padding: 8px 20px;
  cursor: default;
}
.list-row.orphan-header:hover { background: var(--bg-subtle); }

/* email grid */
.email-grid { grid-template-columns: 2fr 1fr 100px 32px; }
@media (max-width: 600px) {
  .list-row.email-grid,
  .list-head.email-grid {
    grid-template-columns: 1fr auto 28px;
    gap: 8px;
    padding: 12px 14px;
  }
  .list-row.email-grid > :nth-child(2),     /* quota meta */
  .list-head.email-grid > :nth-child(2) { display: none; }
  .list-head.email-grid { display: none; }
}

/* Clients screen — reseller/admin Ügyfelek list. */
.clients-grid { grid-template-columns: minmax(220px, 1.6fr) 160px 1fr 110px 110px; }
@media (max-width: 900px) {
  .clients-grid { grid-template-columns: minmax(220px, 1.6fr) 160px 1fr 110px; }
  .clients-hide { display: none !important; }
}
@media (max-width: 600px) {
  .list-row.clients-grid,
  .list-head.clients-grid {
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 12px 14px;
  }
  .list-row.clients-grid > :nth-child(2),
  .list-row.clients-grid > :nth-child(3),
  .list-head.clients-grid > :nth-child(2),
  .list-head.clients-grid > :nth-child(3),
  .list-head.clients-grid > :nth-child(4) { display: none; }
  .list-head.clients-grid { display: none; }
}

/* Inline quick-action button cluster — used on clients-grid (and any other
 * list that wants per-row jump shortcuts). */
.clients-quick-actions { display: flex; gap: 4px; justify-content: flex-end; }
.quick-action-btn {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--text-secondary);
  cursor: pointer;
}
.quick-action-btn:hover {
  background: var(--bg-subtle);
  color: var(--accent);
  border-color: var(--border);
}

/* DNS zone list (Domainek screen) — 2026-05-26: dead more-button column
   removed. Grid now 5 cols (non-owner) / 6 cols (with owner). */
.zones-grid { grid-template-columns: minmax(220px, 1.6fr) 90px 180px 170px 80px; }
.zones-grid.with-owner { grid-template-columns: minmax(220px, 1.6fr) 130px 90px 180px 170px 80px; }
@media (max-width: 900px) {
  .zones-grid { grid-template-columns: minmax(200px, 1.4fr) 80px 160px 150px; }
  .zones-grid.with-owner { grid-template-columns: minmax(200px, 1.4fr) 100px 80px 160px 150px; }
  .zones-grid > :nth-child(5),
  .list-head.zones-grid > :nth-child(5) { display: none; }   /* drop DNSSEC */
  .zones-grid.with-owner > :nth-child(6),
  .list-head.zones-grid.with-owner > :nth-child(6) { display: none; }
}
@media (max-width: 600px) {
  .list-row.zones-grid,
  .list-head.zones-grid {
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 12px 14px;
  }
  .list-row.zones-grid > :nth-child(2),
  .list-row.zones-grid > :nth-child(3),
  .list-head.zones-grid > :nth-child(2),
  .list-head.zones-grid > :nth-child(3) { display: none; }
  .list-row.zones-grid.with-owner > :nth-child(2),
  .list-head.zones-grid.with-owner > :nth-child(2) { display: none; }
  .list-head.zones-grid { display: none; }
}

/* email-accounts (mailbox list) */
.mailbox-grid { grid-template-columns: minmax(280px, 1.8fr) 240px 130px 32px; }
.mailbox-grid.with-owner { grid-template-columns: minmax(280px, 1.8fr) 130px 240px 130px 32px; }
@media (max-width: 900px) {
  .mailbox-grid.with-owner { grid-template-columns: minmax(260px, 1.6fr) 100px 200px 130px 32px; }
}
@media (max-width: 600px) {
  .list-row.mailbox-grid,
  .list-head.mailbox-grid {
    grid-template-columns: 1fr auto 28px;
    gap: 8px;
    padding: 12px 14px;
  }
  .list-row.mailbox-grid > :nth-child(2),
  .list-row.mailbox-grid > :nth-child(3),
  .list-head.mailbox-grid > :nth-child(2),
  .list-head.mailbox-grid > :nth-child(3) { display: none; }
  .list-row.mailbox-grid.with-owner > :nth-child(2),
  .list-head.mailbox-grid.with-owner > :nth-child(2) { display: none; }
  .list-head.mailbox-grid { display: none; }
}

/* email-domains (Email > Domain tab) */
.maildomains-grid { grid-template-columns: minmax(240px, 1.6fr) 200px 240px 110px 32px; }
.maildomains-grid.no-catchall { grid-template-columns: minmax(240px, 1.6fr) 200px 240px 32px; }
.maildomains-grid.with-owner { grid-template-columns: minmax(240px, 1.6fr) 130px 200px 240px 110px 32px; }
.maildomains-grid.with-owner.no-catchall { grid-template-columns: minmax(240px, 1.6fr) 130px 200px 240px 32px; }
@media (max-width: 900px) {
  .maildomains-grid { grid-template-columns: minmax(220px, 1.4fr) 180px 220px 32px; }
  .maildomains-grid:not(.no-catchall) > :nth-child(4),
  .list-head.maildomains-grid:not(.no-catchall) > :nth-child(4) { display: none; }
  .maildomains-grid.no-catchall { grid-template-columns: minmax(220px, 1.4fr) 180px 220px 32px; }
  .maildomains-grid.with-owner { grid-template-columns: minmax(220px, 1.4fr) 100px 180px 220px 32px; }
}
@media (max-width: 600px) {
  .list-row.maildomains-grid,
  .list-head.maildomains-grid {
    grid-template-columns: 1fr auto 28px;
    gap: 8px;
    padding: 12px 14px;
  }
  .list-row.maildomains-grid > :nth-child(2),
  .list-row.maildomains-grid > :nth-child(3),
  .list-head.maildomains-grid > :nth-child(2),
  .list-head.maildomains-grid > :nth-child(3) { display: none; }
  .list-row.maildomains-grid.with-owner > :nth-child(2),
  .list-head.maildomains-grid.with-owner > :nth-child(2) { display: none; }
  .list-head.maildomains-grid { display: none; }
}

/* Forwarders (Email > Átirányítások tab) */
.forwarders-grid { grid-template-columns: minmax(260px, 1.4fr) 24px minmax(220px, 1fr) 90px 90px 32px; }
@media (max-width: 900px) {
  .forwarders-grid { grid-template-columns: minmax(200px, 1.3fr) 24px minmax(180px, 1fr) 90px 32px; }
  .forwarders-grid > :nth-child(4),
  .list-head.forwarders-grid > :nth-child(4) { display: none; }    /* drop "Másolat" */
}
@media (max-width: 600px) {
  .list-row.forwarders-grid,
  .list-head.forwarders-grid {
    grid-template-columns: 1fr 18px 1fr 28px;
    gap: 6px;
    padding: 12px 12px;
    font-size: 12px;
  }
  .list-row.forwarders-grid > :nth-child(4),
  .list-row.forwarders-grid > :nth-child(5),
  .list-head.forwarders-grid > :nth-child(4),
  .list-head.forwarders-grid > :nth-child(5) { display: none; }
  .list-head.forwarders-grid { display: none; }
}

/* Aliasok (Email > Aliasok tab) */
.aliases-grid { grid-template-columns: minmax(220px, 1.3fr) 24px minmax(220px, 1fr) 100px 90px 32px; }
@media (max-width: 900px) {
  .aliases-grid { grid-template-columns: minmax(200px, 1.3fr) 24px minmax(180px, 1fr) 100px 32px; }
  .aliases-grid > :nth-child(5),
  .list-head.aliases-grid > :nth-child(5) { display: none; }
}
@media (max-width: 600px) {
  .list-row.aliases-grid,
  .list-head.aliases-grid {
    grid-template-columns: 1fr 18px 1fr 28px;
    gap: 6px;
    padding: 12px 12px;
    font-size: 12px;
  }
  .list-row.aliases-grid > :nth-child(4),
  .list-row.aliases-grid > :nth-child(5),
  .list-head.aliases-grid > :nth-child(4),
  .list-head.aliases-grid > :nth-child(5) { display: none; }
  .list-head.aliases-grid { display: none; }
}

/* radio cards */
.radio-cards {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  margin-bottom: 16px;
}
.radio-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  background: var(--bg-surface);
  transition: border-color .15s, background .15s;
  position: relative;
}
.radio-card:hover { border-color: var(--border-strong); }
.radio-card.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.radio-card.selected::after {
  content: "";
  position: absolute;
  top: 10px; right: 10px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M4 8l3 3 5-6' stroke='white' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-size: 12px;
  background-position: center;
  background-repeat: no-repeat;
}
.radio-card-title { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.radio-card-desc { font-size: 12px; color: var(--text-secondary); }

/* ─────────────────────────────────────────────
 * Login screen + loading state (frontend phase A)
 * ───────────────────────────────────────────── */
.page-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  color: var(--text-secondary);
  font-size: 14px;
}

/* Pre-React boot screen — visible while react+babel+jsx download/parse.
   Replaced by React.createRoot().render(...) the moment the app mounts. */
.boot-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--bg-canvas);
  color: var(--text-secondary);
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 13px;
}
.boot-spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: boot-spin .7s linear infinite;
}
@keyframes boot-spin { to { transform: rotate(360deg); } }

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 0%, var(--accent-soft, #eff4ff), transparent 50%),
    radial-gradient(circle at 80% 100%, var(--accent-soft, #eff4ff), transparent 50%),
    var(--bg-canvas);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 8px 32px rgba(0,0,0,0.06);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.login-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.login-sub {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.login-notice {
  background: var(--accent-soft, var(--bg-subtle));
  color: var(--text-primary);
  border: 1px solid var(--accent);
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.login-field > span {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}
.login-field input {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: border-color .1s, box-shadow .1s;
}
.login-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft, rgba(37, 99, 235, 0.15));
}
.login-field input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login-error {
  background: rgba(204, 0, 0, 0.06);
  border: 1px solid rgba(204, 0, 0, 0.3);
  color: #cc0000;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
}

.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.login-remember input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--accent);
}

.login-remember input[type="checkbox"]:disabled {
  cursor: not-allowed;
}

.login-remember small {
  color: var(--text-tertiary);
  font-size: 11px;
}

.login-submit {
  width: 100%;
  justify-content: center;
  margin-top: 4px;
}

.login-foot {
  margin-top: 8px;
  text-align: center;
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.5;
}

/* ── Toasts ─────────────────────────────────────────────────────────── */

.toast-viewport {
  position: fixed;
  top: 64px;                       /* below the topbar */
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(380px, calc(100vw - 40px));
  pointer-events: none;            /* let clicks through the gap */
}

@keyframes toast-slide-in {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
@keyframes toast-slide-out {
  /* Slide fully off-screen to the right (110% of the toast's own
     width). max-height + margin collapse keeps stacked toasts smoothly
     repacking once the slid toast vacates its slot. */
  from { transform: translateX(0); opacity: 1; max-height: 200px; margin-bottom: 0; }
  to   { transform: translateX(110%); opacity: 0; max-height: 0; margin-bottom: -10px; padding-top: 0; padding-bottom: 0; }
}

.toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: start;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.10), 0 2px 6px rgba(15, 23, 42, 0.06);
  padding: 12px 12px 12px 14px;
  animation: toast-slide-in 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  position: relative;
  /* Phase 2 — smooth pending → success/error transition. The icon background
     and border-left colour both ride this transition when updateByTag morphs
     the toast in-place. */
  transition: border-left-color 300ms ease, background-color 300ms ease;
}
.toast .toast-icon {
  transition: background-color 300ms ease, color 300ms ease;
}
.toast.leaving { animation: toast-slide-out 0.42s cubic-bezier(0.7, 0, 0.84, 0) forwards; }

.toast-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  flex-shrink: 0;
  margin-top: 1px;
}
.toast-body { min-width: 0; }
.toast-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
}
.toast-message {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  margin-top: 2px;
}
.toast-title + .toast-message { margin-top: 4px; }
.toast-close {
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--text-tertiary);
  padding: 4px;
  margin: -2px -4px 0 0;
  display: grid;
  place-items: center;
  border-radius: 4px;
}
.toast-close:hover { background: var(--bg-hover); color: var(--text-primary); }

.toast.success { border-left: 3px solid var(--success); }
.toast.success .toast-icon { background: var(--success-soft); color: var(--success); }
.toast.error   { border-left: 3px solid var(--danger);  }
.toast.error   .toast-icon { background: var(--danger-soft);  color: var(--danger);  }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.warning .toast-icon { background: var(--warning-soft); color: var(--warning); }
.toast.info    { border-left: 3px solid var(--info);    }
.toast.info    .toast-icon { background: color-mix(in oklab, var(--info) 12%, transparent); color: var(--info); }
/* Phase 2 pending — warning-toned (sárga) while the worker is still
   applying the change. Spinner + indeterminate progress bar communicate
   "in progress"; updateByTag flips kind → 'success' once the
   sync_status watcher fires, and the transitions above smooth-cross-fade
   the colours. */
.toast.pending { border-left: 3px solid var(--warning); }
.toast.pending .toast-icon { background: var(--warning-soft); color: var(--warning); }

/* Spinning ring inside the icon slot — replaces the static check/info
   glyph on pending toasts. 14px to match the other toast icons. */
.toast-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid color-mix(in oklab, var(--warning) 30%, transparent);
  border-top-color: var(--warning);
  animation: toast-spinner-rotate 800ms linear infinite;
}
@keyframes toast-spinner-rotate {
  to { transform: rotate(360deg); }
}

/* Bottom-edge 2px progress bar on pending toasts.
   Two modes via data-mode:
     - determinate: a bar fills 0→100% over --progress-ms (the caller's
       ETA — SettingsTab computes time-until-next-server.sh-tick + buffer)
     - indeterminate: a chip slides back and forth (used as default and
       as fallback after the determinate animation ends — graceful
       degradation when the worker takes longer than the ETA window)
   ToastItem mounts the element conditionally on the pending kind. */
.toast-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: color-mix(in oklab, var(--warning) 15%, transparent);
  overflow: hidden;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
}
.toast-progress::before {
  content: "";
  display: block;
  height: 100%;
  background: var(--warning);
}
.toast-progress[data-mode="indeterminate"]::before {
  width: 40%;
  animation: toast-progress-indeterminate 1.6s ease-in-out infinite;
}
.toast-progress[data-mode="determinate"]::before {
  width: 0%;
  animation: toast-progress-determinate var(--progress-ms, 60000ms) linear forwards;
}
@keyframes toast-progress-indeterminate {
  0%   { transform: translateX(-110%); }
  50%  { transform: translateX(180%);  }
  100% { transform: translateX(260%);  }
}
@keyframes toast-progress-determinate {
  from { width: 0%; }
  to   { width: 100%; }
}

/* One-shot pulse on the state-change moment. updateByTag patches
   flash: true → CSS keyframe plays once → updateByTag patches
   flash: false 220ms later so the next state-change can replay. */
.toast.flash {
  animation: toast-state-flash 220ms ease-out;
}
@keyframes toast-state-flash {
  0%   { box-shadow: 0 0 0 4px var(--success-soft), 0 6px 20px rgba(15, 23, 42, 0.10), 0 2px 6px rgba(15, 23, 42, 0.06); }
  100% { box-shadow: 0 6px 20px rgba(15, 23, 42, 0.10), 0 2px 6px rgba(15, 23, 42, 0.06); }
}

/* Respect the user's motion-sensitivity preference. Strip the
   spinner spin, the progress-bar slide, the flash pulse, and the
   slide-in/out — replace with a static "in progress" cue (a dimmed
   filled bar instead of the sliding chip). */
@media (prefers-reduced-motion: reduce) {
  .toast { animation: none; transition: none; }
  .toast.leaving { animation: none; opacity: 0; }
  .toast.flash { animation: none; }
  .toast-spinner { animation: none; border-color: var(--warning); border-top-color: var(--warning); opacity: 0.7; }
  .toast-progress[data-mode="indeterminate"]::before,
  .toast-progress[data-mode="determinate"]::before {
    animation: none;
    width: 100%;
    opacity: 0.5;
    transform: none;
  }
}

/* ──────────────────────────────────────────────────────────────────
 * Mobile shell (sidebar drawer + topbar collapse + content padding)
 * ────────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;          /* sidebar overlays, doesn't reserve */
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;                   /* top:0 right:auto bottom:0 left:0 */
    width: 280px;
    max-width: 85vw;
    z-index: 95;
    transform: translateX(-100%);
    transition: transform .22s ease-out;
    box-shadow: var(--shadow-lg);
  }
  .app.sidebar-open .sidebar {
    transform: translateX(0);
  }
  .sidebar-close {
    display: grid; place-items: center;
  }
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(8, 11, 20, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 90;
    animation: fade-in .15s ease-out;
  }
  .topbar-burger {
    display: grid; place-items: center;
    margin-right: -4px;
  }
  .topbar {
    padding: 0 12px;
    gap: 8px;
  }
  .topbar-search {
    display: none;                       /* hide full search; surface later as icon-trigger if needed */
  }
  .breadcrumbs {
    font-size: 12px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    flex: 1 1 0;
    min-width: 0;
  }
  /* keep only the current crumb on phones — the rest is path noise */
  .breadcrumbs > :not(.breadcrumb-current):not(:last-of-type),
  .breadcrumbs > .breadcrumb-sep {
    display: none;
  }
  .content {
    padding: 16px 14px 48px;
  }
  [data-density="compact"] .content { padding: 12px 12px 40px; }
}

/* mobile-only — page-header stack, card padding, etc. */
@media (max-width: 600px) {
  .page-header {
    align-items: stretch;
    gap: 12px;
    margin-bottom: 16px;
  }
  .page-title { font-size: 20px; line-height: 1.25; }
  .page-sub   { font-size: 12.5px; }
  .page-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .page-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
  /* badges + meta lines under the page-title should wrap rather than
     break inside individual spans (e.g. "PHP tárhely" splitting onto two
     lines). Nowrap each pill, allow the badge row itself to wrap.
     Outer SiteFav+content row stays nowrap so the favicon stays adjacent
     to the title; the inner <div> shrinks via min-width:0. */
  .page-header .row.row-gap-2 { flex-wrap: wrap; row-gap: 6px; }
  .page-header .row.row-gap-3 > div:not(.fav) { min-width: 0; flex: 1 1 0; }
  .page-header .row > span,
  .page-header .row > .badge,
  .page-header .row > button { white-space: nowrap; }
  .page-header .page-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .card-header { padding: 14px 16px; }
  .card-body   { padding: 16px; }
  .stat        { padding: 14px; }
  .stat-value  { font-size: 22px; }
  /* let the dashboard "resource" rows breathe a bit less */
  .res-row     { padding: 12px 14px; }
  /* sidebar nav-item taller on touch */
  .nav-item    { padding: 10px 12px; font-size: 14px; }
  /* tabs: subtle right-edge gradient hint that there's more to scroll */
  .tabs { mask-image: linear-gradient(to right, black calc(100% - 14px), transparent 100%); }
}

/* small phones — tighten further and let "Új" button collapse to plus only */
@media (max-width: 480px) {
  .content { padding: 14px 12px 40px; }
  .topbar-new-label, .topbar-new-caret { display: none; }
  .topbar-new { padding-left: 6px !important; padding-right: 6px; }
  .stat-grid { grid-template-columns: 1fr; gap: 10px; }
}

/* modal — fill more of the small viewport, stack footer buttons */
@media (max-width: 600px) {
  .modal {
    width: calc(100% - 16px);
    max-height: calc(100vh - 32px);
    border-radius: var(--radius-md);
  }
  .modal-header { padding: 16px 18px 0; }
  .modal-title  { font-size: 15px; }
  .modal-body   { padding: 16px 18px; }
  .modal-foot   { padding: 14px 18px; flex-wrap: wrap; }
  .modal-foot .btn { flex: 1 1 calc(50% - 4px); justify-content: center; }
  .stepper { padding: 0 18px 14px; }
}

/* tabs — horizontal scroll on overflow */
@media (max-width: 600px) {
  .tabs {
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }
  .tabs::-webkit-scrollbar { height: 4px; }
  .tab { padding: 10px 12px; flex-shrink: 0; }
}

/* toast viewport — narrower and pushed away from edges */
@media (max-width: 600px) {
  .toast-viewport {
    top: 60px;
    right: 8px;
    left: 8px;
    width: auto;
  }
}

/* form inputs — bump touch target on mobile */
@media (max-width: 600px) {
  .input, .select { height: 40px; font-size: 14px; }
  .input-group .input-addon { font-size: 13px; }
  .field-label { font-size: 13px; }
}

/* ── ListToolbar (search + pills + counter card above every list) ──
   The .topbar-search class used by the topbar is hidden on mobile —
   reuse forbidden, so the toolbar gets its own .list-search shape. */
.list-search {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  flex: 1 1 280px;
  max-width: 360px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 8px;
  color: var(--text-tertiary);
}
.list-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.list-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  color: var(--text-primary);
  height: 100%;
  padding: 0;
}
.list-search input::placeholder { color: var(--text-tertiary); }

.list-toolbar-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.list-toolbar-pills { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* searchActions — szorosan a kereső input mellé (NEM margin-left:auto),
   a Tulajdonos szűrő-szerű scope-state-eket ide tegyük; az actions
   slot (margin-left:auto-val) maradjon a counter és page-akciók helye */
.list-toolbar-search-actions { display: flex; align-items: center; gap: 8px; }
.list-toolbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.list-toolbar-counter {
  font-size: 12px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  /* 2026-05-26: jobbra-igazítás kötelező — egységes a counter helye
     minden ListToolbar instance-ön (pills-only, search-only, vagy
     pills+search+actions). Ha vannak actions a counter előtt, az
     actions már margin-left:auto-val jobbra pushol, akkor a counter
     természetesen melléje kerül (rule alul, margin-left 0). */
  margin-left: auto;
}
.list-toolbar-actions + .list-toolbar-counter { margin-left: 0; }
/* Counter still needs margin-left:auto when only searchActions are present
   (no rightActions) so it pushes to the right edge. searchActions alone
   doesn't take up the left-pushing role. */

@media (max-width: 600px) {
  .list-toolbar { padding: 10px !important; }
  .list-toolbar-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .list-search {
    max-width: none;
    flex: 1 1 auto;
    height: 36px;
  }
  .list-toolbar-actions { margin-left: 0; }
  .list-toolbar-actions .btn { flex: 1 1 auto; justify-content: center; }
  .list-toolbar-counter {
    text-align: right;
    font-size: 11px;
  }
}

/* trash buttons pulled flush to the card right edge on mobile */
@media (max-width: 600px) {
  .list-row { padding-left: 14px; padding-right: 8px; }
  /* list-row last-child (trash button cell) snaps to its end on mobile */
  .list-row > :last-child { justify-self: end; }
}

/* list-row secondary line — clip overflowing paths instead of letting
   full /var/www/clients/clientN/webM strings push the row wide.
   The list-row already has min-width:0 on its children, so the
   white-space:nowrap + ellipsis just needs to be opted into. */
@media (max-width: 600px) {
  .list-row .row-secondary {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }
  /* mono address strings in cells should ellipsis at the cell edge —
     otherwise mobile rows wrap a long email onto a second line and
     push the badges below. */
  .list-row .row-primary > div > .mono {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
  }
  .list-row .badge .mono {
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    vertical-align: middle;
  }
}

/* long mono strings inside Row-style settings panels — let them wrap
   onto multiple lines rather than clip the right edge */
@media (max-width: 600px) {
  .card-body .mono { overflow-wrap: anywhere; word-break: break-word; }
}

/* grid-2 already collapses at 1100px; further tighten dashboard 2fr/1fr on phone */
@media (max-width: 600px) {
  .grid-2 { gap: 14px; }
}
