/* Wavora Captive Portal */
:root {
  --ink: #121826;
  --ink-soft: #2a3548;
  --muted: #64748b;
  --line: rgba(18, 24, 38, 0.1);
  --surface: rgba(255, 255, 255, 0.88);
  --surface-solid: #ffffff;
  --bg: #e8eef4;
  --bg-deep: #dde5ee;
  --accent: #0f766e;
  --accent-deep: #0b5f59;
  --accent-bright: #14b8a6;
  --accent-soft: rgba(15, 118, 110, 0.11);
  --gold: #a67c52;
  --ok: #059669;
  --danger: #dc2626;
  --warn: #d97706;
  --radius: 16px;
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
  --display: "Plus Jakarta Sans", system-ui, sans-serif;
  --shadow: 0 18px 48px rgba(18, 24, 38, 0.1);
  --blur: blur(22px);
  --nav-bg: #0c1422;
  --nav-bg-2: #121c2e;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background-color: var(--bg);
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  font-weight: 400;
  font-size: 15.5px;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--ink);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  overscroll-behavior-y: none;
}

/* ---------- Portal atmosphere ---------- */
body.portal-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  position: relative;
  overflow-x: hidden;
  background: #dfe8f2;
}

.portal-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(145deg, #edf3fa 0%, #d5e4f2 42%, #c5d8eb 100%);
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(8, 145, 178, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(8, 145, 178, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(50px);
  animation: drift 12s ease-in-out infinite alternate;
}

.orb-a {
  width: 420px;
  height: 420px;
  top: -80px;
  right: -60px;
  background: rgba(8, 145, 178, 0.35);
}

.orb-b {
  width: 360px;
  height: 360px;
  bottom: -100px;
  left: -80px;
  background: rgba(14, 116, 144, 0.28);
  animation-delay: -4s;
}

.signal-ring {
  position: absolute;
  left: 50%;
  top: 42%;
  border: 1px solid rgba(8, 145, 178, 0.22);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: pulse-ring 4.5s ease-out infinite;
}

.signal-ring.r1 { width: 280px; height: 280px; }
.signal-ring.r2 { width: 420px; height: 420px; animation-delay: 0.8s; }
.signal-ring.r3 { width: 580px; height: 580px; animation-delay: 1.6s; }

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-24px, 18px) scale(1.08); }
}

@keyframes pulse-ring {
  0% { opacity: 0.55; transform: translate(-50%, -50%) scale(0.92); }
  70% { opacity: 0; transform: translate(-50%, -50%) scale(1.08); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.08); }
}

.portal-shell {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  max-width: 100%;
  margin: auto;
  background: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow);
  padding: 1.85rem 1.4rem 1.2rem;
  animation: rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
  overflow: hidden;
}

.portal-lang {
  display: flex;
  justify-content: flex-end;
  gap: 0.35rem;
  margin: -0.35rem 0 0.85rem;
}

.lang-btn {
  appearance: none;
  border: 1px solid rgba(11, 18, 32, 0.12);
  background: #fff;
  color: var(--muted, #64748b);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.32rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1;
}

.lang-btn.is-active {
  background: var(--accent-deep, #0f766e);
  border-color: transparent;
  color: #fff;
}

.lang-btn:not(.is-active):hover {
  border-color: color-mix(in srgb, var(--accent-deep, #0f766e) 40%, transparent);
  color: var(--ink, #0b1220);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(22px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* ---------- Brand ---------- */
.logo-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.55rem;
}

.logo-row.centered {
  justify-content: center;
}

.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background:
    linear-gradient(145deg, #22d3ee, var(--accent-deep));
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(8, 145, 178, 0.35);
}

.logo-mark::before,
.logo-mark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.logo-mark::before { width: 10px; height: 10px; }
.logo-mark::after { width: 18px; height: 18px; opacity: 0.55; }

.logo-mark.sm {
  width: 28px;
  height: 28px;
  border-radius: 9px;
}

.brand-mark {
  font-family: var(--display);
  font-size: clamp(1.65rem, 4.5vw, 1.95rem);
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--ink);
}

.brand-mark span {
  color: var(--accent);
}

.portal-brand .lede,
.success-shell .lede {
  font-family: var(--font, inherit);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.45;
  color: var(--muted);
  margin: 0.45rem 0 1.15rem;
}

.admin-main > h1,
.success-shell h1,
.otp-head h2,
.login-box h1 {
  font-family: var(--display);
  font-size: clamp(1.5rem, 2.2vw, 1.85rem);
  margin: 0 0 0.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.lede {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
  font-weight: 500;
}

.otp-head .lede,
.login-box .lede {
  margin: 0.35rem 0 0;
}

.portal-brand {
  margin-bottom: 0.15rem;
}

/* ---------- Device meta ---------- */
.device-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin: 1.15rem 0 1.2rem;
}

.meta-chip {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.55rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.meta-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.meta-chip strong {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---------- Tabs ---------- */
.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-bottom: 1.15rem;
  border-bottom: 1px solid var(--line);
}

.tabs-2 {
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  border-bottom: none;
  padding: 0.3rem;
  background: rgba(11, 18, 32, 0.05);
  border-radius: 14px;
  margin-bottom: 1.25rem;
}

.tabs-3 {
  grid-template-columns: repeat(3, 1fr);
}

.tabs-4 {
  grid-template-columns: repeat(4, 1fr);
}

.tabs-4 .tab {
  font-size: 0.72rem;
  padding: 0.65rem 0.15rem;
}

.tabs-2 .tab {
  border-radius: 11px;
  padding: 0.75rem 0.5rem;
  font-size: 0.88rem;
}

.tabs-2 .tab::after {
  display: none;
}

.tabs-2 .tab.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(11, 18, 32, 0.08);
}

.field-hint {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.4;
}

.tab {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0.7rem 0.25rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}

.tab::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: -1px;
  height: 2.5px;
  border-radius: 2px;
  background: transparent;
  transition: background 0.2s, transform 0.2s;
  transform: scaleX(0.4);
}

.tab.active {
  color: var(--ink);
}

.tab.active::after {
  background: var(--accent);
  transform: scaleX(1);
}

.tab:hover { color: var(--ink-soft); }

.panel[hidden] { display: none !important; }
.panel { animation: panel-in 0.28s ease; }

@keyframes panel-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Forms ---------- */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  width: 100%;
  min-width: 0;
}

#pin-fields,
#voucher-fields {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
}

#pin-fields[hidden],
#voucher-fields[hidden] {
  display: none !important;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 0.48rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
  min-width: 0;
  max-width: 100%;
}

.auth-form input:not([type="checkbox"]):not([type="radio"]),
.auth-form select {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.78rem 0.9rem;
  font: inherit;
  font-size: 0.98rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.password-field {
  position: relative;
  width: 100%;
}

.password-field input {
  padding-right: 2.75rem !important;
}

.password-toggle {
  appearance: none;
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 2.2rem;
  height: 2.2rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.password-toggle svg {
  width: 1.15rem;
  height: 1.15rem;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-toggle:hover,
.password-toggle.is-on {
  color: var(--accent-deep);
  background: rgba(15, 118, 110, 0.08);
}

.login-remember {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.65rem;
  margin: 0.1rem 0 0.15rem !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  color: var(--ink-soft) !important;
  cursor: pointer;
  user-select: none;
  letter-spacing: 0 !important;
}

.ui-check-row input[type="checkbox"],
.login-remember input,
.terms-row input[type="checkbox"] {
  position: absolute !important;
  opacity: 0 !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  pointer-events: none;
}

.ui-check {
  flex-shrink: 0;
  width: 1.15rem;
  height: 1.15rem;
  border: 1.5px solid #94a3b8;
  border-radius: 4px;
  background: #fff;
  box-shadow: none;
  display: grid;
  place-items: center;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.ui-check::after {
  content: "";
  width: 0.32rem;
  height: 0.55rem;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-0.5px, -1px) scale(0);
  transition: transform 0.12s ease;
}

.ui-check-row:hover .ui-check,
.login-remember:hover .ui-check,
.terms-row:hover .ui-check {
  border-color: var(--accent-deep);
}

.ui-check-row input:focus-visible + .ui-check,
.login-remember input:focus-visible + .ui-check,
.terms-row input:focus-visible + .ui-check {
  box-shadow: 0 0 0 3px var(--accent-soft);
  border-color: var(--accent);
}

.ui-check-row input:checked + .ui-check,
.login-remember input:checked + .ui-check,
.terms-row input:checked + .ui-check {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
}

.ui-check-row input:checked + .ui-check::after,
.login-remember input:checked + .ui-check::after,
.terms-row input:checked + .ui-check::after {
  transform: rotate(45deg) translate(-0.5px, -1px) scale(1);
}

.auth-form input:not([type="checkbox"]):not([type="radio"])::placeholder {
  color: #9aa8bc;
  font-weight: 500;
}

.auth-form input:not([type="checkbox"]):not([type="radio"]):focus,
.auth-form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.otp-input {
  letter-spacing: 0.35em;
  font-size: 1.35rem !important;
  font-weight: 700 !important;
  text-align: center;
}

.row-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.65rem;
  width: 100%;
  min-width: 0;
}

.row-2 > label {
  min-width: 0;
}

.hint {
  font-weight: 500;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: lowercase;
}

.mode-toggle {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.5);
}

.mode-toggle legend {
  padding: 0 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
}

.radio {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.4rem !important;
  font-weight: 600 !important;
  font-size: 0.86rem !important;
  cursor: pointer;
  color: var(--ink) !important;
}

.radio input {
  accent-color: var(--accent);
  width: 1rem;
  height: 1rem;
}

.btn-primary,
.btn-ghost,
.btn-danger-sm {
  appearance: none;
  border: none;
  border-radius: 10px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.15s, filter 0.15s, opacity 0.15s, background 0.15s, box-shadow 0.15s;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-deep);
  color: #fff;
  padding: 0.55rem 1rem;
  margin-top: 0.15rem;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.18);
}

.btn-primary:hover {
  filter: brightness(1.07);
  box-shadow: 0 6px 14px rgba(15, 118, 110, 0.22);
}
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.55; cursor: wait; }

.btn-primary.is-loading {
  pointer-events: none;
  opacity: 0.85;
  cursor: wait;
}

.btn-primary .btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.btn-primary .btn-loading::before {
  content: "";
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: btn-spin 0.7s linear infinite;
}

@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

.btn-loading[hidden],
.btn-label[hidden] { display: none !important; }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  padding: 0.5rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-danger-sm {
  background: rgba(220, 38, 38, 0.08);
  color: var(--danger);
}

.alert {
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.9rem;
  background: var(--accent-soft);
  color: var(--accent-deep);
  animation: panel-in 0.25s ease;
}

.alert.error,
.alert-danger {
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger);
}

.alert-success {
  background: rgba(5, 150, 105, 0.1);
  color: var(--ok);
}

.alert-warning {
  background: rgba(217, 119, 6, 0.12);
  color: var(--warn);
}

/* Toast stack — sağ alt */
.toast-stack {
  position: fixed;
  right: 1.15rem;
  bottom: 1.15rem;
  z-index: 1200;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.55rem;
  width: min(360px, calc(100vw - 2rem));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.85rem 0.9rem;
  border-radius: 14px;
  background: #0f172a;
  color: #f8fafc;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast.is-in {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast.is-out {
  opacity: 0;
  transform: translateY(8px) scale(0.98);
}

.toast-ico {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 0.05rem;
}

.toast-ico svg {
  width: 1rem;
  height: 1rem;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toast-msg {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
}

.toast-close {
  appearance: none;
  border: none;
  background: transparent;
  color: rgba(248, 250, 252, 0.55);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.15rem;
}

.toast-close:hover {
  color: #fff;
}

.toast-success .toast-ico {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
}

.toast-danger .toast-ico {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
}

.toast-warning .toast-ico {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
}

.toast-info .toast-ico {
  background: rgba(34, 211, 238, 0.16);
  color: #67e8f9;
}

@media (max-width: 800px) {
  .toast-stack {
    right: 0.75rem;
    left: 0.75rem;
    bottom: 0.75rem;
    width: auto;
  }
}

.portal-foot {
  margin-top: 1.3rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  font-weight: 500;
  line-height: 1.4;
}

.success-shell {
  text-align: center;
  padding: 2.4rem 1.5rem 2rem;
}

.success-shell .btn-primary { margin-top: 1.1rem; width: 100%; }

.success-check {
  width: 56px;
  height: 56px;
  margin: 1.2rem auto 1rem;
  border-radius: 50%;
  background: linear-gradient(145deg, #34d399, var(--ok));
  position: relative;
  animation: rise 0.5s 0.15s both;
  box-shadow: 0 10px 24px rgba(5, 150, 105, 0.3);
}

.success-check::after {
  content: "";
  position: absolute;
  left: 20px;
  top: 16px;
  width: 12px;
  height: 22px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

/* ---------- Admin ---------- */
body.admin-page {
  --admin-topbar-h: 3.55rem;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 55% 40% at 92% -8%, rgba(15, 118, 110, 0.08), transparent 58%),
    linear-gradient(180deg, #f2f5f9 0%, var(--bg) 42%, var(--bg-deep) 100%);
  background-attachment: fixed;
  overscroll-behavior-y: none;
  max-height: 100dvh;
  overflow: hidden;
}

body.admin-page.admin-login {
  display: flex !important;
  align-items: center;
  justify-content: center;
  grid-template-columns: unset;
  grid-template-rows: unset;
  max-height: none;
  overflow: auto;
  padding: 0;
  min-height: 100dvh;
  width: 100%;
  background: linear-gradient(160deg, #f2f5f8 0%, #e4ebea 100%);
}

body.admin-page:not(.admin-login).nav-collapsed {
  grid-template-columns: 1fr;
}

.admin-main-login {
  width: 100%;
  max-width: none !important;
  margin: 0 auto;
  padding: 1.5rem !important;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.login-stage {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: auto;
  padding: 0;
}

.login-box {
  position: relative;
  z-index: 1;
  width: min(400px, 100%);
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--line);
  padding: 2rem 1.6rem 1.6rem;
  border-radius: 20px;
  box-shadow: 0 18px 50px rgba(11, 18, 32, 0.1);
  text-align: center;
}

.login-box-solid {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.login-box .auth-form {
  text-align: left;
  margin-top: 1.15rem;
}

.login-box .brand-mark {
  font-size: 1.7rem;
}

.login-box h1 {
  margin-top: 1rem;
  font-size: 1.25rem;
}

.login-alert {
  text-align: left;
  margin: 1rem 0 0;
}

.login-foot {
  margin: 1.15rem 0 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.login-foot a {
  color: var(--accent-deep);
  text-decoration: none;
  font-weight: 700;
}

.login-foot a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.admin-nav {
  background: linear-gradient(185deg, var(--nav-bg) 0%, var(--nav-bg-2) 58%, #0e1828 100%);
  color: #e8eef5;
  padding: 1.2rem 0.85rem 1.1rem;
  min-height: 0;
  height: auto;
  max-height: none;
  position: relative;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

body.admin-page:not(.admin-login).nav-collapsed .admin-nav {
  display: none;
}

.admin-topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  min-height: var(--admin-topbar-h);
  box-sizing: border-box;
  background: linear-gradient(185deg, var(--nav-bg) 0%, var(--nav-bg-2) 100%);
  color: #e8eef5;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky;
  top: 0;
  z-index: 40;
  grid-column: 1 / -1;
}

.admin-topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.admin-topbar-brand:hover {
  opacity: 0.92;
}

.wawora-logo-top {
  height: 1.85rem;
  width: auto;
  max-width: 8.5rem;
  display: block;
  object-fit: contain;
}

.admin-topbar-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.account-menu {
  position: relative;
}

.account-menu-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #e8eef5;
  border-radius: 12px;
  padding: 0.35rem 0.55rem 0.35rem 0.4rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  max-width: min(16rem, 52vw);
  font: inherit;
}

.account-menu-btn:hover,
.account-menu.is-open .account-menu-btn {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.2);
}

.account-avatar {
  flex-shrink: 0;
}

.account-menu-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  text-align: left;
}

.account-menu-copy strong {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 9rem;
}

.account-menu-copy span {
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(226, 232, 240, 0.62);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 9rem;
}

.account-chevron {
  width: 1rem;
  height: 1rem;
  opacity: 0.7;
  flex-shrink: 0;
  transition: transform 0.15s;
}

.account-menu.is-open .account-chevron {
  transform: rotate(180deg);
}

.account-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  width: min(17.5rem, calc(100vw - 1.5rem));
  background: #fff;
  color: var(--ink);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(11, 18, 32, 0.22);
  border: 1px solid rgba(11, 18, 32, 0.08);
  padding: 0.45rem;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.account-menu-panel[hidden] {
  display: none !important;
}

.account-menu-tenant {
  padding: 0.65rem 0.7rem 0.55rem;
  border-radius: 10px;
  background: rgba(11, 18, 32, 0.04);
  margin-bottom: 0.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.account-menu-tenant-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.tenant-mark.sm {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 7px;
  font-size: 0.72rem;
}

.account-menu-kicker {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.account-menu-tenant strong {
  font-size: 0.9rem;
}

.account-menu-tenant a,
.account-menu-panel > a {
  display: block;
  padding: 0.55rem 0.7rem;
  border-radius: 9px;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 600;
}

.account-menu-tenant a {
  padding: 0.15rem 0 0;
  color: var(--accent-deep);
  font-size: 0.78rem;
}

.account-menu-panel > a:hover {
  background: rgba(11, 18, 32, 0.05);
}

.account-menu-logout {
  color: #b91c1c !important;
  border-top: 1px solid rgba(11, 18, 32, 0.08);
  margin-top: 0.15rem;
}

.nav-tenant-card {
  margin: 0.35rem 0.75rem 0.85rem;
  padding: 0.75rem 0.8rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid var(--workspace-tint, var(--accent));
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nav-tenant-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.nav-tenant-head-copy {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.tenant-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12);
}

.nav-tenant-kicker {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.55);
}

.nav-tenant-card strong {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.25;
}

.nav-tenant-card a {
  margin-top: 0.15rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: color-mix(in srgb, var(--accent) 70%, #fff);
  text-decoration: none;
}

.nav-tenant-slug {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(226, 232, 240, 0.45);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.workspace-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.15rem;
  flex-wrap: wrap;
  margin: 0 0 1.35rem;
  padding: 1rem 1.15rem;
  border-radius: 14px;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--workspace-tint, var(--accent)) 16%, #fff) 0%,
    #fff 58%
  );
  border: 1px solid color-mix(in srgb, var(--workspace-tint, var(--accent)) 32%, transparent);
  border-left: 4px solid var(--workspace-tint, var(--accent));
  box-shadow: 0 8px 22px rgba(11, 18, 32, 0.04);
}

.workspace-bar-main {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
  flex: 1 1 16rem;
}

.workspace-bar-mark {
  margin-top: 0.1rem;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--workspace-tint, var(--accent)) 20%, transparent);
}

.workspace-bar-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  margin-top: 0.35rem;
  flex-shrink: 0;
  background: var(--workspace-tint, var(--accent-deep));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--workspace-tint, var(--accent)) 22%, transparent);
}

.workspace-bar-copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.workspace-bar-kicker {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--workspace-tint, var(--accent-deep));
}

.workspace-bar-copy strong {
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.workspace-bar-hint {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
  max-width: 40rem;
}

.workspace-bar-actions {
  display: flex;
  align-items: flex-end;
  gap: 0.55rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.workspace-quick {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 11rem;
}

.workspace-quick-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.workspace-quick select {
  margin: 0;
  min-height: 2.4rem;
  padding: 0.45rem 0.7rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--workspace-tint, var(--accent)) 28%, rgba(11, 18, 32, 0.14));
  background: #fff;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink, #0b1220);
}

.workspace-bar-switch {
  flex-shrink: 0;
  margin-top: 0 !important;
  width: auto !important;
  padding: 0.55rem 0.9rem !important;
}

.tenant-avatar.tenant-mark {
  color: #fff;
  border: none;
}

.platform-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.platform-step {
  padding: 1.05rem 1.1rem;
  border-radius: 14px;
  background: rgba(11, 18, 32, 0.03);
  border: 1px solid rgba(11, 18, 32, 0.08);
}

.platform-step strong {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

.platform-step p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.45;
}

.platform-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.platform-actions .btn-secondary {
  margin-top: 0 !important;
  width: auto !important;
}

.workspace-bar.is-platform {
  border-left-width: 5px;
}

.check-inline {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0.35rem 0 0.85rem;
  font-size: 0.88rem;
  line-height: 1.4;
}

.check-inline input {
  margin-top: 0.2rem;
  width: auto;
}

@media (max-width: 800px) {
  .platform-steps {
    grid-template-columns: 1fr;
  }
}

.context-callout {
  margin: 0 0 1.25rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: rgba(11, 18, 32, 0.03);
  border: 1px dashed rgba(11, 18, 32, 0.14);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.context-callout strong {
  font-size: 0.95rem;
}

.context-callout-meta {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.context-callout p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.45;
}

.context-callout a {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--accent-deep);
  width: fit-content;
}

@media (max-width: 720px) {
  .workspace-bar {
    padding: 0.75rem 0.85rem;
  }
  .workspace-bar-hint {
    font-size: 0.76rem;
  }
  .workspace-quick {
    width: 100%;
    min-width: 0;
  }
  .workspace-bar-actions {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .account-menu-copy { display: none; }
  .account-menu-btn {
    padding: 0.3rem;
    max-width: none;
  }
  .account-chevron { display: none; }
  .wawora-logo-top {
    height: 1.55rem;
    max-width: 6.5rem;
  }
}

.topbar-user-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.05rem;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  padding: 0.2rem 0.35rem;
  border-radius: 8px;
}

.topbar-user-meta:hover {
  background: rgba(255, 255, 255, 0.06);
}

.topbar-user-meta strong {
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 12rem;
}

.topbar-user-meta span {
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(226, 232, 240, 0.62);
}

.topbar-logout {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #e8eef5;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
}

.topbar-logout .nav-ico {
  width: 1.05rem;
  height: 1.05rem;
}

.topbar-logout:hover {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fecaca;
}

@media (max-width: 640px) {
  .topbar-user-meta span { display: none; }
  .topbar-logout span { display: none; }
  .topbar-logout { padding: 0.5rem; }
  .topbar-user-meta strong { max-width: 7rem; }
}

.admin-topbar .brand-mark {
  margin: 0;
  color: #fff;
  font-size: 1.05rem;
  line-height: 1.1;
}

.admin-topbar .hotel-chip {
  margin: 0.1rem 0 0;
  font-size: 0.68rem;
}

.nav-burger {
  appearance: none;
  width: 2.45rem;
  height: 2.45rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.nav-burger-lines,
.nav-burger-lines::before,
.nav-burger-lines::after {
  display: block;
  width: 1.1rem;
  height: 1.5px;
  background: #e8eef5;
  border-radius: 2px;
  position: relative;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-burger-lines::before,
.nav-burger-lines::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-burger-lines::before { top: -5px; }
.nav-burger-lines::after { top: 5px; }

body:not(.nav-collapsed) .nav-burger-lines {
  background: transparent;
}

body:not(.nav-collapsed) .nav-burger-lines::before {
  top: 0;
  transform: rotate(45deg);
}

body:not(.nav-collapsed) .nav-burger-lines::after {
  top: 0;
  transform: rotate(-45deg);
}

.admin-nav-head {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  padding: 0 0.15rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.admin-nav-title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.55);
}

.admin-nav-head .logo-row {
  margin-bottom: 0;
}

.nav-close {
  appearance: none;
  display: none;
  width: 2.2rem;
  height: 2.2rem;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  place-items: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.nav-close svg {
  width: 1.1rem;
  height: 1.1rem;
}

.nav-backdrop {
  display: none;
}

.admin-nav .brand-mark {
  color: #fff;
  font-size: 1.35rem;
}

.admin-nav .brand-mark span { color: #22d3ee; }

.admin-nav .logo-row { margin-bottom: 1.5rem; padding: 0 0.35rem; }
.admin-nav-head .logo-row { margin-bottom: 0; }

.admin-nav .nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.admin-nav a {
  color: inherit;
  text-decoration: none;
  padding: 0.68rem 0.8rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0.58;
  transition: background 0.18s, opacity 0.18s, color 0.18s, box-shadow 0.18s;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.admin-nav .nav-ico {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.8;
}

.admin-nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  opacity: 0.92;
}

.admin-nav a.active {
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.2), rgba(34, 211, 238, 0.08));
  opacity: 1;
  box-shadow: inset 3px 0 0 #22d3ee;
  color: #fff;
}

.admin-nav a.active .nav-ico {
  opacity: 1;
  color: #67e8f9;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.nav-group-toggle {
  list-style: none;
  cursor: pointer;
  color: inherit;
  padding: 0.68rem 0.8rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0.58;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  transition: background 0.18s, opacity 0.18s;
  user-select: none;
}

.nav-group-toggle::-webkit-details-marker {
  display: none;
}

.nav-group-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
  opacity: 0.92;
}

.nav-group.is-active > .nav-group-toggle,
.nav-group[open] > .nav-group-toggle {
  opacity: 1;
  background: rgba(34, 211, 238, 0.08);
}

.nav-group.is-active > .nav-group-toggle .nav-ico {
  color: #67e8f9;
  opacity: 1;
}

.nav-chevron {
  width: 0.95rem;
  height: 0.95rem;
  margin-left: auto;
  opacity: 0.55;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.nav-group[open] > .nav-group-toggle .nav-chevron {
  transform: rotate(180deg);
}

.nav-sub {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.1rem 0 0.25rem 0.55rem;
  margin-left: 0.55rem;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.nav-sub a {
  font-size: 0.84rem;
  padding: 0.5rem 0.7rem;
  opacity: 0.55;
}

.nav-foot {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex-shrink: 0;
}

.nav-user {
  padding: 0.2rem 0.55rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.nav-user strong {
  font-size: 0.82rem;
}

.nav-user span {
  font-size: 0.68rem;
  opacity: 0.6;
  font-weight: 600;
}

.admin-nav a.nav-out {
  opacity: 0.58;
  color: inherit;
}

.admin-nav a.nav-out:hover {
  background: rgba(255, 255, 255, 0.06);
  opacity: 0.92;
  color: inherit;
}

.admin-main {
  --admin-gap: 1.35rem;
  --panel-radius: 20px;
  --panel-pad: 1.45rem 1.5rem;
  --panel-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
  --panel-border: 1px solid rgba(11, 18, 32, 0.08);
  padding: 1.75rem 1.75rem 2.75rem;
  max-width: none;
  width: 100%;
  box-sizing: border-box;
  grid-row: 2;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
}

@media (min-width: 1400px) {
  .admin-main {
    padding: 2rem 2.25rem 3rem;
  }
}

.admin-main.admin-main-login {
  max-width: none !important;
  width: 100%;
  min-height: 100dvh;
  margin: 0;
  padding: 1.5rem !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: calc(var(--admin-gap, 1.35rem) + 0.15rem);
  flex-wrap: wrap;
}

.page-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.page-head h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.55rem, 2.2vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.page-head .lede {
  margin: 0.55rem 0 0;
  max-width: 44rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.page-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.log-purge-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem 1rem;
  padding: 0.95rem 1.25rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.log-purge-bar > .muted {
  margin: 0;
  flex: 1 1 220px;
  font-size: 0.82rem;
}

.log-purge-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.log-toolbar {
  margin-bottom: 0;
}

.page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink-soft);
}

.meta-pill.ok {
  background: rgba(5, 150, 105, 0.1);
  border-color: rgba(5, 150, 105, 0.22);
  color: #047857;
}

.page-stack {
  display: flex;
  flex-direction: column;
  gap: var(--admin-gap, 1.15rem);
}
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--admin-gap, 1.15rem);
  margin: 0;
}

.stat-row-4 {
  grid-template-columns: repeat(4, 1fr);
}

.chart-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--admin-gap, 1.15rem);
}

.chart-card h2 {
  margin: 0 0 0.85rem;
}

.report-filter .btn-primary {
  margin-top: 0;
}

.report-csv {
  align-self: flex-end;
  margin: 0;
  height: 2.35rem;
  display: inline-flex;
  align-items: center;
  padding: 0 0.15rem;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--accent-deep);
  text-decoration: none;
}

.report-csv:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.stat-n {
  display: block;
  font-family: var(--display);
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--accent-deep);
  letter-spacing: -0.03em;
}

.stat-l {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}

.admin-section {
  margin-bottom: 0;
}

.page-stack > .admin-section,
.page-stack > .stat-row,
.page-stack > .voucher-grid,
.page-stack > .profile-grid,
.page-stack > .chart-grid,
.page-stack > .export-bar,
.page-stack > .panel-card,
.page-stack > .table-wrap,
.page-stack > .pager {
  margin-bottom: 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem 1.25rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.section-head h2,
.admin-section h2,
.gen-form h2,
.panel-card-head h2,
.chart-card h2 {
  font-family: var(--display);
  font-size: 1.08rem;
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.gen-form h2 {
  margin: 0 0 0.95rem;
}

.section-head a {
  color: var(--accent-deep);
  font-size: 0.86rem;
  text-decoration: none;
  font-weight: 700;
}

.panel-card,
.gen-form,
.chart-card,
.stat,
.export-bar,
.table-wrap:not(.dt-table-wrap) {
  background: #fff;
  border: var(--panel-border, 1px solid rgba(11, 18, 32, 0.08));
  border-radius: var(--panel-radius, 20px);
  box-shadow: var(--panel-shadow, 0 8px 22px rgba(15, 23, 42, 0.04));
}

.panel-card,
.gen-form,
.chart-card,
.export-bar {
  padding: var(--panel-pad, 1.35rem 1.4rem);
}

.stat {
  padding: 1.2rem 1.1rem;
}

.table-wrap {
  overflow-x: auto;
}

.table-wrap:not(.dt-table-wrap) {
  /* panel surface already applied */
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th, td {
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: rgba(15, 118, 110, 0.04);
  font-weight: 700;
  padding-top: 1rem;
  padding-bottom: 0.8rem;
}

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8rem; }
.truncate { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.muted { color: var(--muted); font-size: 0.78rem; }

.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
}

.badge.ok { background: rgba(5, 150, 105, 0.12); color: var(--ok); }
.badge.warn { background: rgba(217, 119, 6, 0.12); color: var(--warn); }
.badge.off { background: rgba(107, 122, 144, 0.15); color: var(--muted); }

.voucher-grid,
.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--admin-gap, 1.15rem);
  margin: 0;
  width: 100%;
}

.export-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.75rem;
  align-items: flex-end;
}

.export-bar label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.export-bar input[type="date"] {
  border: 1px solid var(--line);
  border-radius: 10px;
  height: 2.35rem;
  padding: 0 0.7rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  background: #fff;
  color: var(--ink);
  box-sizing: border-box;
  min-width: 10.5rem;
}

.export-bar .btn-primary,
.report-filter .btn-primary {
  height: 2.35rem;
  padding: 0 0.95rem;
  margin: 0;
  align-self: flex-end;
  width: auto;
  min-width: 0;
  font-size: 0.86rem;
  box-sizing: border-box;
}

.pager {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 1rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.pager a { color: var(--accent-deep); }

@media (max-width: 960px) {
  body.admin-page:not(.admin-login) {
    display: flex;
    flex-direction: column;
    grid-template-columns: unset;
    grid-template-rows: unset;
    max-height: none;
    overflow: auto;
  }

  body.admin-page:not(.admin-login).nav-collapsed {
    grid-template-columns: unset;
  }

  .nav-close {
    display: grid;
  }

  .admin-nav-head {
    display: flex;
  }

  .admin-main {
    flex: 1;
    min-width: 0;
    width: 100%;
    grid-row: auto;
    overflow-y: visible;
  }

  .admin-nav {
    display: flex !important;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(300px, 88vw);
    height: 100dvh;
    max-height: 100dvh;
    z-index: 80;
    grid-row: auto;
    transform: translateX(-105%);
    box-shadow: none;
    overflow: hidden;
    padding: 1.1rem 0.85rem 1rem;
  }

  body.admin-page:not(.admin-login):not(.nav-collapsed) .admin-nav {
    transform: translateX(0);
    box-shadow: 18px 0 40px rgba(8, 15, 28, 0.35);
  }

  .admin-nav .nav-links {
    flex-direction: column;
    flex-wrap: nowrap;
    flex: 1;
    overflow-y: auto;
  }

  .admin-nav a.active { box-shadow: none; }

  .nav-foot {
    margin-top: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
  }

  .admin-nav a.nav-out { width: 100%; }

  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(8, 15, 28, 0.48);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  body.admin-page:not(.admin-login):not(.nav-collapsed) .nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  body.admin-page:not(.admin-login):not(.nav-collapsed) {
    overflow: hidden;
  }

  .stat-row,
  .stat-row-4,
  .voucher-grid,
  .chart-grid,
  .row-2,
  .user-card-actions { grid-template-columns: 1fr; }
  .tabs:not(.tabs-2) { grid-template-columns: 1fr; }
  .signal-ring { display: none; }
}

@media (max-width: 800px) {
  .stat-row,
  .stat-row-4,
  .voucher-grid,
  .chart-grid,
  .row-2,
  .user-card-actions { grid-template-columns: 1fr; }
  .tabs:not(.tabs-2) { grid-template-columns: 1fr; }
  .signal-ring { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ===== Product polish layer ===== */
.hotel-chip {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.hotel-chip.light {
  color: rgba(255, 255, 255, 0.55);
}

.terms-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start;
  gap: 0.65rem !important;
  font-size: 0.8rem !important;
  font-weight: 500 !important;
  color: var(--ink-soft) !important;
  line-height: 1.4;
  cursor: pointer;
  position: relative;
}

.terms-row .ui-check {
  margin-top: 0.12rem;
}

.terms-copy {
  flex: 1;
  min-width: 0;
}

.terms-link {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: none;
  font: inherit;
  font-weight: 700;
  color: var(--accent-deep, #0f766e);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.terms-link:hover {
  color: var(--ink, #0b1220);
}

.terms-modal-card {
  width: min(440px, 100%);
  max-height: min(86vh, 640px);
}

.terms-modal-lede {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.terms-modal-body {
  margin: 0.15rem 0 0;
  padding: 0.85rem 0.95rem;
  max-height: min(42vh, 280px);
  overflow: auto;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid rgba(11, 18, 32, 0.08);
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--ink-soft, #334155);
  -webkit-overflow-scrolling: touch;
}

.terms-modal-body h3 {
  margin: 0.85rem 0 0.35rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink, #0b1220);
}

.terms-modal-body h3:first-child {
  margin-top: 0;
}

.terms-modal-body p {
  margin: 0 0 0.45rem;
}

.terms-modal-body ul {
  margin: 0 0 0.45rem;
  padding-left: 1.15rem;
}

.terms-modal-body li {
  margin: 0.2rem 0;
}

.ssid-hint {
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.btn-loading[hidden],
.btn-label[hidden] { display: none !important; }

.page-head .btn-primary,
.page-head .btn-secondary {
  margin-top: 0;
  width: auto;
  padding: 0.5rem 0.9rem;
  font-size: 0.86rem;
}

.admin-page .gen-form .btn-primary,
.admin-page .panel-card .btn-primary {
  align-self: flex-start;
  width: auto;
  min-width: 7.5rem;
}

.admin-page .export-bar .btn-primary {
  align-self: flex-end;
  width: auto;
  min-width: 0;
}

.login-box .btn-primary,
.admin-main-login .btn-primary {
  width: 100%;
  padding: 0.7rem 1rem;
  font-size: 0.92rem;
}

.table-search {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  font: inherit;
  font-size: 0.88rem;
  min-width: min(240px, 100%);
  background: #fff;
}

.row-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
}

.btn-ghost-sm,
.btn-danger-sm,
.row-actions .btn-secondary,
.role-chip-footer .btn-secondary,
.role-chip-delete .btn-secondary {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 2.1rem;
  min-height: 2.1rem;
  padding: 0 0.75rem;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
}

.btn-secondary {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 2.35rem;
  min-height: 2.35rem;
  padding: 0 0.9rem;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  text-decoration: none;
}

.btn-danger-sm {
  background: rgba(220, 38, 38, 0.08);
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 22%, var(--line));
}

.admin-page .btn-primary {
  box-sizing: border-box;
  height: 2.35rem;
  min-height: 2.35rem;
  padding: 0 1rem;
  font-size: 0.86rem;
}

.admin-page .gen-form .btn-primary,
.admin-page .panel-card .btn-primary,
.admin-page .role-create-form .btn-primary {
  margin-top: 0;
  width: auto;
  min-width: 7.5rem;
}

.role-chip-footer .btn-secondary,
.role-chip-delete .btn-secondary {
  height: 2.1rem;
  min-height: 2.1rem;
  font-size: 0.8rem;
  padding: 0 0.75rem;
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1.25rem;
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.empty-state.compact {
  padding: 1.25rem;
}

.empty-state h3 {
  font-family: var(--display);
  margin: 0.5rem 0 0.35rem;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto;
  border-radius: 14px;
  background: linear-gradient(145deg, #5eead4, var(--accent));
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.25);
  position: relative;
}

.empty-icon::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 2px solid #fff;
  border-radius: 50%;
  opacity: 0.85;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.setting-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.setting-item span {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: var(--admin-gap, 1.15rem);
  align-items: start;
}

.settings-main {
  display: flex;
  flex-direction: column;
  gap: var(--admin-gap, 1.15rem);
  min-width: 0;
}

/* Kartlar form içinde — gap forma da lazım (yoksa panel’ler yapışır) */
.settings-main > form,
form.page-stack,
.admin-page form:has(> .panel-card) {
  display: flex;
  flex-direction: column;
  gap: var(--admin-gap, 1.35rem);
  min-width: 0;
}

.panel-card-head {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.35rem;
  flex-wrap: wrap;
  margin: 0 0 1.35rem;
}

.panel-card-head > div {
  flex: 1 1 16rem;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.panel-card-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.panel-card-head .btn-primary,
.panel-card-head .btn-secondary,
.panel-card-head > button,
.panel-card-head > a.btn-primary,
.panel-card-head > a.btn-secondary {
  margin: 0 !important;
  flex: 0 0 auto;
  align-self: flex-start;
  width: auto !important;
  min-width: 8.5rem;
}

/* form.panel-card: çocuklar arasında nefes (gap:0 yapışık formlara yol açıyordu) */
form.panel-card {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

form.panel-card.form-stack {
  gap: 0;
}

.panel-card > .table-wrap,
.panel-card > .dt-table-wrap,
.panel-card > .role-create-form,
.panel-card > .role-chips,
.panel-card > .form-grid,
.panel-card > .auth-form {
  margin-top: 0;
}

.mikrotik-card .panel-card-head {
  /* inherits global .panel-card-head */
}

.venue-pick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--admin-gap, 1.15rem);
}

.venue-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding: 1.15rem 1rem 1.1rem;
  border: 1.5px solid rgba(11, 18, 32, 0.1);
  border-radius: 16px;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.18s, box-shadow 0.18s, color 0.18s;
  min-height: 168px;
}

.venue-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.venue-icon {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid rgba(11, 18, 32, 0.08);
  color: var(--ink-soft);
  margin-bottom: 0.45rem;
}

.venue-icon svg {
  width: 1.2rem;
  height: 1.2rem;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.venue-check {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1.5px solid rgba(11, 18, 32, 0.15);
  color: transparent;
  transition: all 0.18s;
}

.venue-check svg {
  width: 0.85rem;
  height: 0.85rem;
}

.venue-card strong {
  font-family: var(--display);
  font-size: 1.12rem;
  letter-spacing: -0.02em;
  font-style: normal;
}

.venue-card em {
  font-style: normal;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.venue-card small {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 0.15rem;
}

.venue-card:hover {
  border-color: rgba(13, 148, 136, 0.35);
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.venue-card.is-selected,
.venue-card:has(input:checked) {
  background: linear-gradient(160deg, #0f766e 0%, #0d9488 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 14px 32px rgba(15, 118, 110, 0.28);
  transform: none;
}

.venue-card.is-selected .venue-icon,
.venue-card:has(input:checked) .venue-icon {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.venue-card.is-selected em,
.venue-card.is-selected small,
.venue-card:has(input:checked) em,
.venue-card:has(input:checked) small {
  color: rgba(255, 255, 255, 0.82);
}

.venue-card.is-selected .venue-check,
.venue-card:has(input:checked) .venue-check {
  background: #fff;
  border-color: #fff;
  color: #0f766e;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem 1.15rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.field-span,
.field.full { grid-column: 1 / -1; }

.field input,
.field textarea,
.field select {
  appearance: none;
  border: 1px solid rgba(11, 18, 32, 0.12);
  border-radius: 12px;
  padding: 0.72rem 0.85rem;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field textarea {
  resize: vertical;
  min-height: 72px;
  line-height: 1.45;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent-deep);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.field input:disabled {
  background: #f1f5f9;
  color: var(--muted);
}

.field .hint {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}

.color-row {
  display: flex;
  gap: 0.55rem;
  align-items: center;
}

.color-row input[type="color"] {
  width: 3rem;
  height: 2.6rem;
  padding: 0.2rem;
  border-radius: 10px;
  cursor: pointer;
}

.color-row input[type="text"] {
  flex: 1;
}

.switch-stack {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1.15rem;
}

.switch-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  border: 1px solid rgba(11, 18, 32, 0.08);
  background: #f8fafc;
  cursor: pointer;
}

.switch-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-ui {
  width: 2.5rem;
  height: 1.4rem;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
  flex-shrink: 0;
  margin-top: 0.15rem;
  transition: background 0.18s;
}

.switch-ui::after {
  content: "";
  position: absolute;
  top: 0.15rem;
  left: 0.15rem;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: transform 0.18s;
}

.switch-row input:checked + .switch-ui {
  background: var(--accent-deep);
}

.switch-row input:checked + .switch-ui::after {
  transform: translateX(1.05rem);
}

.switch-copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.switch-copy strong {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
}

.switch-copy small {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.35;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1rem;
  margin-top: 1.25rem;
  padding-top: 1.05rem;
  border-top: 1px solid rgba(11, 18, 32, 0.08);
}

.settings-actions .btn-primary {
  margin: 0;
  width: auto;
  min-width: 0;
  height: 2.35rem;
  padding: 0 1rem;
  font-size: 0.86rem;
  box-sizing: border-box;
}

.settings-actions .field-hint {
  margin: 0;
  max-width: 28rem;
  line-height: 1.4;
  font-size: 0.8rem;
}

/* Form içindeki Kaydet vb. butonlar — üstteki alana yapışmasın */
.admin-page .panel-card:not(.dt-toolbar) > .btn-primary,
.admin-page .panel-card:not(.dt-toolbar) > .btn-secondary,
.admin-page .gen-form > .btn-primary,
.admin-page .gen-form > .btn-secondary,
.admin-page .auth-form > .btn-primary,
.admin-page .auth-form > .btn-secondary {
  margin-top: 1.1rem;
}

.admin-page .panel-card > .form-grid + .btn-primary,
.admin-page .panel-card > .switch-stack + .btn-primary,
.admin-page .panel-card > .switch-row + .btn-primary,
.admin-page .gen-form > .form-grid + .btn-primary,
.admin-page .gen-form > .switch-stack + .btn-primary {
  margin-top: 1.25rem;
}

.panel-card > .form-grid + .switch-stack,
.gen-form > .form-grid + .switch-stack {
  margin-top: 1.15rem;
}

.panel-card > .form-grid + .switch-row,
.gen-form > .form-grid + .switch-row {
  margin-top: 1rem;
}

.btn-lg {
  /* kept for compatibility — same compact size as default primary */
  width: auto !important;
  height: 2.35rem !important;
  padding: 0 1rem !important;
  font-size: 0.86rem !important;
  box-sizing: border-box;
}

.settings-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: sticky;
  top: 1.25rem;
}

.mikrotik-card .panel-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.35rem;
}

.mikrotik-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.mikrotik-stat {
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
}

a.mikrotik-stat.install-stat {
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
a.mikrotik-stat.install-stat:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}
a.mikrotik-stat.install-stat small {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted, #64748b);
  font-size: 0.78rem;
}
.install-steps {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.55rem;
  color: var(--ink-soft, #334155);
  line-height: 1.45;
}

.mikrotik-stat-label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.mikrotik-stat strong {
  font-size: 0.88rem;
  word-break: break-all;
}

.mikrotik-hint {
  margin: 0 0 1rem;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.45;
}

.mikrotik-test-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin: 0;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

@media (max-width: 900px) {
  .mikrotik-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.preview-card,
.info-card {
  background: #fff;
  border: 1px solid rgba(11, 18, 32, 0.08);
  border-radius: 20px;
  padding: 1.1rem;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

.preview-label {
  margin: 0 0 0.75rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.preview-shell {
  border-radius: 16px;
  padding: 1.1rem;
  background:
    radial-gradient(ellipse 80% 60% at 100% 0%, color-mix(in srgb, var(--preview-accent) 22%, transparent), transparent),
    linear-gradient(160deg, #0b1220 0%, #152338 100%);
  color: #e8eef5;
}

.preview-brand {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.preview-dot {
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  background: linear-gradient(145deg, #2dd4bf, var(--preview-accent));
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.2);
}

.preview-brand strong {
  display: block;
  font-family: var(--display);
  font-size: 1rem;
}

.preview-brand em {
  display: block;
  font-style: normal;
  font-size: 0.72rem;
  opacity: 0.65;
  font-weight: 600;
}

.preview-tag {
  margin: 0 0 0.9rem;
  font-size: 0.8rem;
  line-height: 1.45;
  opacity: 0.78;
}

.preview-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.preview-tabs span {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.45rem 0.3rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  opacity: 0.55;
}

.preview-tabs .is-on {
  background: color-mix(in srgb, var(--preview-accent) 35%, transparent);
  opacity: 1;
  box-shadow: inset 0 -2px 0 var(--preview-accent);
}

.preview-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.preview-fields div {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 0.5rem 0.55rem;
}

.preview-fields small {
  display: block;
  font-size: 0.62rem;
  opacity: 0.55;
  margin-bottom: 0.15rem;
}

.preview-fields b {
  font-size: 0.82rem;
  font-weight: 700;
}

.preview-cta {
  text-align: center;
  background: linear-gradient(135deg, #2dd4bf, var(--preview-accent));
  color: #fff;
  font-weight: 800;
  font-size: 0.84rem;
  padding: 0.65rem;
  border-radius: 10px;
}

.preview-ssid {
  margin: 0.7rem 0 0;
  font-size: 0.72rem;
  opacity: 0.55;
  text-align: center;
}

.info-card h3 {
  margin: 0 0 0.65rem;
  font-family: var(--display);
  font-size: 0.98rem;
}

.info-card ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.pin-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.pin-action-btns {
  display: flex;
  gap: 0.55rem;
}

.print-card {
  max-width: 480px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow);
}

.print-card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.print-product {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.25rem;
  margin: 0;
  color: var(--accent);
}

.print-hotel {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.print-title {
  font-family: var(--display);
  font-size: 1.5rem;
  margin: 0 0 0.35rem;
}

.print-ssid {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.print-grid {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.print-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.print-value {
  font-size: 1.05rem;
}

.print-value.pin-code {
  font-size: 1.75rem;
  letter-spacing: 0.12em;
  color: var(--accent-deep);
}

.print-steps {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.55;
}

.print-foot {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 0.85rem;
}

.admin-nav .brand-mark {
  font-size: 1.2rem;
}

.logo-mark {
  background: linear-gradient(145deg, #2dd4bf, var(--accent-deep));
}

body.portal-page {
  background: #e7eef2;
}

.portal-bg {
  background:
    radial-gradient(ellipse 70% 50% at 85% 10%, rgba(184, 149, 108, 0.18), transparent 50%),
    linear-gradient(155deg, #f4f7f8 0%, #dde8e6 48%, #cfe0dc 100%);
}

.orb-a { background: rgba(15, 118, 110, 0.32); }
.orb-b { background: rgba(184, 149, 108, 0.22); }

.grid-overlay {
  background-image:
    linear-gradient(rgba(15, 118, 110, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 118, 110, 0.05) 1px, transparent 1px);
}

.signal-ring { border-color: rgba(15, 118, 110, 0.2); }

@media (max-width: 1100px) {
  .settings-layout {
    grid-template-columns: 1fr;
  }
  .settings-side {
    position: static;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1rem;
  }
}

@media (max-width: 900px) {
  .venue-pick { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .settings-side { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .stat-row-4 { grid-template-columns: 1fr 1fr; }
  .admin-main { padding: 1.35rem 1.1rem 2.5rem; }
}

@media print {
  body.admin-page {
    display: block !important;
    background: #fff !important;
  }
  .admin-nav,
  .admin-topbar,
  .nav-backdrop,
  .screen-only,
  .pin-actions,
  .alert {
    display: none !important;
  }
  .admin-main {
    padding: 0 !important;
    max-width: none !important;
  }
  .print-card {
    box-shadow: none;
    border: 1px solid #ccc;
    max-width: 100%;
  }
}

.inline-meta {
  margin-bottom: 0;
}

.perm-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.55;
}

.role-help h2 {
  margin-bottom: 0.75rem;
}

.inline-form {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.inline-form select,
.reset-form input {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.35rem 0.45rem;
  font: inherit;
  font-size: 0.8rem;
  background: #fff;
  max-width: 140px;
}

.user-cards {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.user-card {
  background: #fff;
  border: 1px solid rgba(11, 18, 32, 0.08);
  border-radius: 20px;
  padding: 1.2rem 1.25rem;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.user-card.is-self {
  border-color: rgba(15, 118, 110, 0.35);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.08);
}

.user-card.is-inactive {
  opacity: 0.72;
}

.user-card-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.9rem;
  align-items: center;
}

.user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(145deg, #2dd4bf, var(--accent-deep));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.user-avatar.sm {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 0.92rem;
}

/* Data table panel */
.dt-panel {
  padding: 0;
  overflow: hidden;
}

.sessions-toolbar.panel-card {
  padding: 0.85rem 1rem;
  margin: 0;
  border-bottom: none;
}

.dt-toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.4rem;
  border-bottom: 1px solid rgba(11, 18, 32, 0.08);
}

.dt-toolbar .btn-primary,
.dt-toolbar .btn-secondary {
  margin-top: 0 !important;
  flex: 0 0 auto;
  width: auto;
  white-space: nowrap;
}

.dt-search {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

@media (max-width: 640px) {
  .dt-toolbar {
    flex-wrap: wrap;
  }
  .dt-search {
    flex: 1 1 100%;
  }
}

.dt-search svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  color: var(--muted);
  pointer-events: none;
}

.dt-search input {
  width: 100%;
  border: 1px solid rgba(11, 18, 32, 0.12);
  border-radius: 12px;
  padding: 0.65rem 0.85rem 0.65rem 2.2rem;
  font: inherit;
  font-size: 0.9rem;
  background: #f8fafc;
}

.dt-search input:focus {
  outline: none;
  border-color: var(--accent-deep);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}

.dt-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dt-filters select,
.dt-inline-form select {
  appearance: none;
  border: 1px solid rgba(11, 18, 32, 0.12);
  border-radius: 10px;
  padding: 0.55rem 2rem 0.55rem 0.75rem;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7a90' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.65rem center;
  cursor: pointer;
}

.dt-count {
  margin: 0 0 0 0.25rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.dt-table-wrap {
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.dt-table th {
  background: #f8fafc;
}

.dt-table td {
  vertical-align: middle;
}

.dt-table tr.is-inactive {
  opacity: 0.7;
}

.dt-table tr.is-self {
  background: rgba(15, 118, 110, 0.04);
}

.th-actions {
  text-align: right;
}

.dt-user {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.dt-user strong {
  display: block;
  font-size: 0.92rem;
}

.dt-user span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

.dt-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-wrap: wrap;
  align-items: center;
}

.dt-actions form {
  margin: 0;
}

.btn-sm {
  padding: 0.42rem 0.75rem !important;
  font-size: 0.78rem !important;
  border-radius: 10px !important;
  min-height: 0 !important;
  width: auto !important;
  margin-top: 0 !important;
}

.dt-table tr.is-current-tenant {
  background: color-mix(in srgb, var(--accent) 6%, #fff);
}

.tenant-code {
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(11, 18, 32, 0.05);
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
}

.tenant-avatar {
  background: color-mix(in srgb, var(--accent) 18%, #fff) !important;
  color: var(--accent-deep) !important;
}

.field-optional {
  font-weight: 500;
  color: var(--muted);
  font-size: 0.8em;
}

.tenant-modal-form {
  width: min(420px, 100%);
  gap: 0.75rem;
}

.tenant-modal-form .lede {
  margin: 0;
  font-size: 0.88rem;
}

.dt-empty {
  margin: 0;
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
}

.icon-btn {
  appearance: none;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 10px;
  border: 1px solid rgba(11, 18, 32, 0.1);
  background: #fff;
  color: var(--ink-soft);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.12s;
}

.icon-btn svg {
  width: 1.05rem;
  height: 1.05rem;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn:hover {
  background: #f1f5f9;
  border-color: rgba(11, 18, 32, 0.16);
}

.icon-btn:active {
  transform: scale(0.96);
}

.icon-btn.ok {
  color: #047857;
  border-color: rgba(5, 150, 105, 0.25);
  background: rgba(5, 150, 105, 0.08);
}

.icon-btn.ok:hover {
  background: rgba(5, 150, 105, 0.16);
}

.icon-btn.warn {
  color: #b45309;
  border-color: rgba(217, 119, 6, 0.25);
  background: rgba(217, 119, 6, 0.08);
}

.icon-btn.warn:hover {
  background: rgba(217, 119, 6, 0.16);
}

.icon-btn.danger {
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.22);
  background: rgba(220, 38, 38, 0.06);
}

.icon-btn.danger:hover {
  background: rgba(220, 38, 38, 0.14);
}

.btn-danger {
  appearance: none;
  border: none;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  padding: 0.7rem 1.1rem;
  box-shadow: 0 8px 18px rgba(220, 38, 38, 0.25);
}

.btn-danger:hover {
  filter: brightness(1.05);
}

/* Modal */
.tenant-switch-modal .tenant-switch-card {
  width: min(420px, 100%);
  gap: 0.85rem;
}

.tenant-switch-hero {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.tenant-switch-mark {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 14px;
  font-size: 1.05rem;
}

.tenant-switch-kicker {
  margin: 0 0 0.15rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.tenant-switch-card h2 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.tenant-switch-card > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.tenant-switch-card .ui-modal-actions {
  margin-top: 0.35rem;
}

.tenant-switch-card .btn-primary {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ui-modal::backdrop {
  background: rgba(11, 18, 32, 0.48);
  backdrop-filter: blur(4px);
}

.ui-modal-card {
  width: min(400px, 100%);
  margin: auto;
  background: #fff;
  border-radius: 20px;
  padding: 1.5rem 1.4rem 1.25rem;
  box-shadow: 0 24px 60px rgba(11, 18, 32, 0.22);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.ui-modal-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(13, 148, 136, 0.12);
  color: var(--accent-deep);
}

.ui-modal-icon.danger {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}

.ui-modal-icon svg {
  width: 1.35rem;
  height: 1.35rem;
}

.ui-modal-card h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.ui-modal-card > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.ui-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-top: 0.55rem;
}

.ui-modal-actions .btn-secondary,
.ui-modal-actions .btn-primary,
.ui-modal-actions .btn-danger {
  margin: 0;
  width: auto;
}

.user-meta h3 {
  margin: 0;
  font-size: 1rem;
  font-family: var(--display);
  letter-spacing: -0.02em;
}

.user-meta p {
  margin: 0.2rem 0 0.45rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.user-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.user-last {
  text-align: right;
}

.user-last .meta-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.user-last strong {
  font-size: 0.88rem;
  font-weight: 600;
}

.user-card-actions {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  align-items: end;
}

.user-action label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.user-action select,
.user-reset-row input {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  background: #fff;
  width: 100%;
}

.user-reset-row {
  display: flex;
  gap: 0.45rem;
}

.user-reset-row .btn-secondary {
  flex-shrink: 0;
  white-space: nowrap;
}

.user-toggle-btn {
  width: 100%;
  min-width: 110px;
  padding: 0.6rem 0.75rem;
  font-size: 0.82rem;
}

.ghost-label {
  color: transparent !important;
}

@media (max-width: 900px) {
  .user-card-top {
    grid-template-columns: auto 1fr;
  }
  .user-last {
    grid-column: 2;
    text-align: left;
  }
  .user-card-actions {
    grid-template-columns: 1fr;
  }
}

.auth-form select {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.78rem 0.9rem;
  font: inherit;
  font-size: 0.98rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  width: 100%;
}

@media (max-width: 900px) {
  .profile-grid { grid-template-columns: 1fr; }
}

a.icon-btn {
  text-decoration: none;
  color: inherit;
  box-sizing: border-box;
}

.error-stage {
  max-width: 28rem;
  margin: 3rem auto;
  text-align: center;
  padding: 1rem;
}

.error-stage h1 {
  font-family: var(--display);
  font-size: clamp(2.8rem, 8vw, 4rem);
  margin: 0.2rem 0 0.4rem;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.error-stage .lede {
  margin: 0 0 1.25rem;
}

.error-stage .btn-primary {
  width: auto;
  min-width: 8rem;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  margin-top: 0.25rem;
}

.error-actions .btn-secondary {
  width: auto;
  min-width: 8rem;
  margin-top: 0;
}

.page-stack.full-width,
.form-wide {
  width: 100%;
  max-width: none;
}

.admin-page .gen-form.form-wide {
  width: 100%;
  max-width: none;
}

.role-create-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1rem;
  align-items: flex-end;
  padding: 0;
}

.role-create-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1 1 11rem;
  min-width: 10rem;
  max-width: 18rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.role-create-form input,
.role-create-form select {
  border: 1px solid var(--line);
  border-radius: 10px;
  height: 2.35rem;
  padding: 0 0.7rem;
  font: inherit;
  background: #fff;
  width: 100%;
}

.role-create-submit {
  flex: 0 0 auto;
}

.role-create-form .btn-primary {
  margin: 0;
  height: 2.35rem;
  width: auto;
  min-width: 7rem;
  padding-inline: 1.1rem;
}

.role-chips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.95rem;
  padding: 0;
}

.role-chip {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
}

.role-chip.is-locked {
  background: #fff;
}

.role-chip-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.role-chip-body strong,
.role-chip-edit input[name="label"] {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}

.role-chip-blurb {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

.role-chip-edit {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
}

.role-chip-fields {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.role-chip-fields input {
  border: 1px solid var(--line);
  border-radius: 9px;
  height: 2.15rem;
  padding: 0 0.65rem;
  font: inherit;
  background: #fff;
  width: 100%;
}

.role-chip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.role-chip-delete {
  margin: 0;
}

.role-chip-actions .btn-secondary,
.role-chip-delete .btn-secondary {
  height: 2rem;
  padding: 0 0.75rem;
  font-size: 0.8rem;
}

.role-chip-delete .danger-text {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 28%, var(--line));
}

.role-chip-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.roles-matrix-group td {
  background: rgba(11, 18, 32, 0.035);
  padding: 1.1rem 0.9rem 0.7rem !important;
  border-bottom: 1px solid rgba(11, 18, 32, 0.08);
}

.roles-matrix-group strong {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink, #0b1220);
}

.roles-matrix-group .muted {
  font-size: 0.78rem;
  line-height: 1.4;
}

.roles-matrix .role-check input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--accent-deep);
  cursor: pointer;
}

.roles-matrix .role-check input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.85;
}

.roles-matrix th {
  padding: 1rem 0.9rem 0.85rem;
}

.roles-matrix td {
  padding: 0.95rem 0.9rem;
  vertical-align: middle;
}

.roles-matrix td strong {
  display: block;
  margin-bottom: 0.15rem;
}

.roles-matrix td .muted {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.8rem;
  line-height: 1.4;
}

.role-check {
  text-align: center !important;
  vertical-align: middle !important;
}

/* Brand logo */
.brand-logo-img {
  display: block;
  object-fit: contain;
  border-radius: 10px;
}

.wawora-logo-portal {
  height: 2.75rem;
  width: auto;
  max-width: 9rem;
  display: block;
  object-fit: contain;
}

.brand-logo-img.portal-logo {
  width: 3rem;
  height: 3rem;
  flex-shrink: 0;
}

.wawora-logo-login {
  height: 2.4rem;
  width: auto;
  max-width: 10rem;
  display: block;
  margin: 0 auto 0.35rem;
  object-fit: contain;
}

.login-brand {
  flex-direction: column;
  gap: 0.35rem;
}

.brand-logo-img.admin-logo-sm {
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
}

.logo-upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: flex-start;
  padding: 0.25rem 0 0.5rem;
}

.logo-upload-preview {
  width: 7.5rem;
  min-height: 7.5rem;
  border-radius: 16px;
  border: 1px dashed rgba(11, 18, 32, 0.18);
  background: rgba(11, 18, 32, 0.03);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.75rem;
}

.logo-upload-preview .brand-logo-img {
  width: 100%;
  max-height: 5.5rem;
}

.logo-upload-actions {
  flex: 1 1 220px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.logo-upload-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  align-items: flex-start;
}

.otp-modal .ui-modal-card {
  width: min(420px, 100%);
}

@media (max-width: 720px) {
  .tabs-4 {
    grid-template-columns: 1fr 1fr;
  }
}

.topbar-tenant {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.05rem;
  margin-right: 0.35rem;
  max-width: 11rem;
}
.topbar-tenant-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.7;
}
.topbar-tenant strong {
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.topbar-tenant-switch {
  font-size: 0.72rem;
  color: inherit;
  opacity: 0.85;
  text-decoration: underline;
}

@media (max-width: 720px) {
  .role-create-form label {
    max-width: none;
    flex: 1 1 100%;
  }

  .role-create-submit,
  .role-create-form .btn-primary {
    width: 100%;
  }
}
