:root {
  --sidebar-w: 220px;
  --bg:        #0F1117;
  --bg-2:      #181B24;
  --surface:   #1E2130;
  --surface-2: #252A3A;
  --border:    rgba(255,255,255,.07);
  --divider:   rgba(255,255,255,.05);
  --ink:       #EEF0F8;
  --ink-2:     #B8BCCE;
  --muted:     #6B7194;
  --accent:    #6C8FFF;
  --accent-dark: #5070E8;
  --accent-bg: rgba(108,143,255,.12);
  --green:   #34C759;
  --green-bg: rgba(52,199,89,.12);
  --red:     #FF453A;
  --red-bg:  rgba(255,69,58,.12);
  --amber:   #FF9F0A;
  --amber-bg: rgba(255,159,10,.12);
  /* Semantische overlays (per thema overschreven) */
  --hover:         rgba(255,255,255,.05);
  --border-strong: rgba(255,255,255,.16);
  --hatch:         rgba(255,255,255,.06);
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --shadow: 0 8px 32px rgba(0,0,0,.4), 0 2px 8px rgba(0,0,0,.2);
  --ff: "Inter", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(.25,.46,.45,.94);
  color-scheme: dark;
}

/* ===== Light thema ===== */
html[data-theme="light"] {
  color-scheme: light;
  --bg:        #F4F5F9;
  --bg-2:      #FFFFFF;
  --surface:   #FFFFFF;
  --surface-2: #EEF1F8;
  --border:    rgba(20,26,46,.10);
  --divider:   rgba(20,26,46,.07);
  --ink:       #171B27;
  --ink-2:     #424A5C;
  --muted:     #6C7488;
  --accent:    #4F6FF0;
  --accent-dark: #3D5AE0;
  --accent-bg: rgba(79,111,240,.10);
  --green:   #1E9E4A;
  --green-bg: rgba(30,158,74,.12);
  --red:     #E0352B;
  --red-bg:  rgba(224,53,43,.10);
  --amber:   #C77F0A;
  --amber-bg: rgba(199,127,10,.13);
  --hover:         rgba(20,26,46,.04);
  --border-strong: rgba(20,26,46,.20);
  --hatch:         rgba(20,26,46,.07);
  --shadow: 0 8px 24px rgba(20,26,46,.10), 0 2px 6px rgba(20,26,46,.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--ff);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }

/* ===== Shell ===== */
.shell {
  display: flex;
  min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 10;
}
.sidebar-logo {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--divider);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo-mark {
  width: 28px; height: 28px;
  background: var(--accent);
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.sidebar-logo-text {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.3px;
  color: var(--ink);
}
.sidebar-logo-badge {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  background: var(--accent-bg);
  color: var(--accent);
  padding: 2px 5px;
  border-radius: 4px;
  margin-left: auto;
}
.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  color: var(--muted);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  transition: background .15s var(--ease), color .15s var(--ease);
  user-select: none;
}
.nav-item:hover { background: var(--hover); color: var(--ink-2); }
.nav-item.active { background: var(--accent-bg); color: var(--accent); }
.nav-item svg { flex-shrink: 0; opacity: .75; }
.nav-item.active svg { opacity: 1; }
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--divider);
  font-size: 12px;
  color: var(--muted);
}
.sidebar-footer strong { color: var(--ink-2); display: block; margin-bottom: 2px; font-size: 13px; }
.logout-btn {
  margin-top: 8px;
  width: 100%;
  padding: 7px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: background .15s, color .15s;
  font-family: var(--ff);
}
.logout-btn:hover { background: var(--hover); color: var(--ink-2); }

/* ===== Main ===== */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
}
.main-header {
  padding: 28px 32px 0;
}
.main-header h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.4px;
  color: var(--ink);
}
.main-header p {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 3px;
}
.main-content {
  padding: 24px 32px 40px;
}

/* ===== Pane ===== */
.pane { display: none; }
.pane.active { display: block; }

/* ===== Nav badge ===== */
.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 20px;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
  display: none;
}
.nav-badge:not(:empty) { display: inline-block; }

/* ===== Stats row ===== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
.stats-row--6 {
  grid-template-columns: repeat(3, 1fr);
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 22px;
}
.stat-card-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 8px;
}
.stat-card-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.5px;
  color: var(--ink);
}
.stat-card-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}
.stat-card--green  { border-color: rgba(52,199,89,.2); }
.stat-card--green .stat-card-value { color: var(--green); }
.stat-card--amber  { border-color: rgba(255,159,10,.2); }
.stat-card--amber .stat-card-value { color: var(--amber); }
.stat-card--red    { border-color: rgba(255,69,58,.2); }
.stat-card--red .stat-card-value { color: var(--red); }
.stat-card--accent { border-color: rgba(108,143,255,.2); }
.stat-card--accent .stat-card-value { color: var(--accent); }
.stat-card-value--sm { font-size: 22px; }

.stats-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--muted);
  margin-bottom: 10px;
}

.form-field-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.5;
}

/* ===== Section header ===== */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-head h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  font-family: var(--ff);
  transition: background .15s var(--ease), opacity .15s;
  white-space: nowrap;
}
.btn:hover { opacity: .88; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink-2);
}
.btn-ghost:hover { background: var(--surface-2); opacity: 1; }
.btn-danger { background: var(--red-bg); color: var(--red); }
.btn-sm { padding: 5px 11px; font-size: 12px; }

/* ===== Tenant table ===== */
.tenant-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.tenant-table-head {
  display: grid;
  grid-template-columns: 2fr 2fr 1.2fr 1fr 1fr 120px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--divider);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--muted);
}
.tenant-row {
  display: grid;
  grid-template-columns: 2fr 2fr 1.2fr 1fr 1fr 120px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--divider);
  align-items: center;
  transition: background .12s;
}
.tenant-row:last-child { border-bottom: none; }
.tenant-row:hover { background: var(--surface-2); }
.tenant-name {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--ink);
}
.tenant-slug {
  font-size: 12px;
  color: var(--muted);
  font-family: "SF Mono", "Fira Code", monospace;
  margin-top: 2px;
}
.tenant-email {
  font-size: 13px;
  color: var(--ink-2);
}
.tenant-plan {
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
  color: var(--accent);
}
.tenant-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

/* ===== Status badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.badge-trial  { background: var(--amber-bg); color: var(--amber); }
.badge-trial .badge-dot  { background: var(--amber); }
.badge-active { background: var(--green-bg); color: var(--green); }
.badge-active .badge-dot { background: var(--green); }
.badge-inactive { background: var(--surface-2); color: var(--muted); }
.badge-inactive .badge-dot { background: var(--muted); }

/* ===== Empty state ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty-state-icon {
  font-size: 32px;
  margin-bottom: 12px;
  opacity: .4;
}
.empty-state p { font-size: 14px; }

/* ===== Modal ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s var(--ease);
}
.modal-backdrop.open {
  opacity: 1;
  pointer-events: all;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  width: 520px;
  max-width: calc(100vw - 32px);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  transform: translateY(12px) scale(.98);
  transition: transform .25s var(--ease);
}
.modal-backdrop.open .modal {
  transform: translateY(0) scale(1);
}
.modal-header {
  padding: 22px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.3px;
}
.modal-close {
  width: 28px; height: 28px;
  background: var(--surface-2);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 16px;
  transition: background .15s;
  font-family: var(--ff);
}
.modal-close:hover { background: var(--border); color: var(--ink-2); }
.modal-body {
  padding: 20px 24px 24px;
}
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--divider);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ===== Form ===== */
.form-section {
  margin-bottom: 20px;
}
.form-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--divider);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-grid.full { grid-template-columns: 1fr; }
.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.form-field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
}
.form-field input,
.form-field select,
.form-field textarea {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  color: var(--ink);
  font-family: var(--ff);
  font-size: 13.5px;
  outline: none;
  transition: border-color .15s;
}
.form-field textarea {
  resize: vertical;
  line-height: 1.5;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--accent);
}
.form-field input::placeholder,
.form-field textarea::placeholder { color: var(--muted); }
.form-field select option { background: var(--surface); }

/* ===== Edit modal (tenant detail) ===== */
.edit-tab-section {
  display: none;
}
.edit-tab-section.active {
  display: block;
}

/* ===== Login screen ===== */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 36px 40px;
  width: 380px;
  max-width: calc(100vw - 32px);
  box-shadow: var(--shadow);
}
.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
.login-logo-mark {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
}
.login-logo-text {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.4px;
}
.login-logo-sub {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}
.login-card h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.4px;
  margin-bottom: 6px;
}
.login-card p {
  color: var(--muted);
  font-size: 13.5px;
  margin-bottom: 24px;
}
.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.login-field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
}
.login-field input {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  color: var(--ink);
  font-family: var(--ff);
  font-size: 14px;
  outline: none;
  transition: border-color .15s;
  width: 100%;
}
.login-field input:focus { border-color: var(--accent); }
.login-error {
  background: var(--red-bg);
  color: var(--red);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
}
.login-error.visible { display: block; }
.login-submit {
  width: 100%;
  padding: 11px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--ff);
  margin-top: 6px;
  transition: opacity .15s;
}
.login-submit:hover { opacity: .88; }

/* ===== Toast ===== */
#toastContainer {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 11px 18px;
  border-radius: var(--r);
  font-size: 13.5px;
  font-weight: 500;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  animation: toastIn .25s var(--ease) forwards, toastOut .25s var(--ease) 3s forwards;
  pointer-events: none;
}
.toast.success { background: var(--green-bg); border-color: rgba(52,199,89,.25); color: var(--green); }
.toast.error   { background: var(--red-bg);   border-color: rgba(255,69,58,.2);  color: var(--red);   }
@keyframes toastIn  { to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* ===== Confirm dialog ===== */
.confirm-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.confirm-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  width: 340px;
  box-shadow: var(--shadow);
}
.confirm-box h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.confirm-box p  { font-size: 13.5px; color: var(--muted); margin-bottom: 20px; }
.confirm-btns   { display: flex; gap: 10px; justify-content: flex-end; }

/* ===== Plans list ===== */
.plans-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.plan-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 20px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--divider);
  align-items: center;
  transition: background .12s;
}
.plan-row:last-child { border-bottom: none; }
.plan-row:hover { background: var(--surface-2); }
.plan-row-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}
.plan-row-desc {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}
.plan-row-price {
  font-size: 17px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}
.plan-row-price span {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}
.plan-row-status { white-space: nowrap; }
.plan-row-actions {
  display: flex;
  gap: 6px;
}
.modal--sm { width: 420px; }

/* ===== Ticket filters ===== */
.ticket-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}
.ticket-filter-btn {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--ff);
  transition: background .12s, color .12s, border-color .12s;
}
.ticket-filter-btn:hover { background: var(--surface-2); color: var(--ink-2); }
.ticket-filter-btn.is-active {
  background: var(--accent-bg);
  border-color: rgba(108,143,255,.3);
  color: var(--accent);
}

/* ===== Ticket list ===== */
.ticket-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.ticket-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--divider);
  cursor: pointer;
  transition: background .12s;
}
.ticket-row:last-child { border-bottom: none; }
.ticket-row:hover { background: var(--surface-2); }
.ticket-row.ticket-resolved { opacity: .55; }
.ticket-row.ticket-resolved:hover { opacity: .8; }
.ticket-row-main { flex: 1; min-width: 0; }
.ticket-subject {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.ticket-subject.priority-high { color: var(--red); }
.priority-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
}
.ticket-new-badge {
  font-size: 10px;
  font-weight: 600;
  background: var(--accent-bg);
  color: var(--accent);
  border-radius: 20px;
  padding: 2px 7px;
  border: 1px solid rgba(108,143,255,.25);
}
.ticket-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

/* ===== Ticket detail panel ===== */
.ticket-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s var(--ease);
}
.ticket-detail {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 480px;
  max-width: calc(100vw - var(--sidebar-w) - 20px);
  background: var(--bg-2);
  border-left: 1px solid var(--border);
  z-index: 51;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .25s var(--ease);
  box-shadow: -8px 0 32px rgba(0,0,0,.3);
}
.ticket-detail.open {
  transform: translateX(0);
}
.ticket-detail-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.ticket-detail-header {
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--divider);
  flex-shrink: 0;
}
.ticket-detail-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.ticket-detail-header-top h3 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.3px;
  color: var(--ink);
  line-height: 1.35;
}
.ticket-detail-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ticket-thread {
  flex: 1;
  overflow-y: auto;
  padding: 16px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ticket-msg {
  display: flex;
  gap: 11px;
  align-items: flex-start;
}
.ticket-msg--admin {
  flex-direction: row-reverse;
}
.ticket-msg-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  flex-shrink: 0;
}
.ticket-msg--admin .ticket-msg-avatar {
  background: var(--accent-bg);
  color: var(--accent);
  border-color: rgba(108,143,255,.25);
}
.ticket-msg-body { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.ticket-msg--admin .ticket-msg-body { align-items: flex-end; }
.ticket-msg-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 5px;
}
.ticket-msg--admin .ticket-msg-header { flex-direction: row-reverse; }
.ticket-msg-header strong {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}
.ticket-msg-header span {
  font-size: 11px;
  color: var(--muted);
}
.ticket-msg-text {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 14px;
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  max-width: 90%;
}
.ticket-msg--admin .ticket-msg-text {
  background: var(--accent-bg);
  border-color: rgba(108,143,255,.2);
  color: var(--ink);
}
.ticket-reply-area {
  padding: 14px 22px 18px;
  border-top: 1px solid var(--divider);
  flex-shrink: 0;
}
.ticket-reply-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  color: var(--ink);
  font-family: var(--ff);
  font-size: 13.5px;
  resize: none;
  outline: none;
  transition: border-color .15s;
  margin-bottom: 10px;
}
.ticket-reply-input:focus { border-color: var(--accent); }
.ticket-reply-input::placeholder { color: var(--muted); }
.ticket-reply-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ===== Signup cards ===== */
.signup-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.signup-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 22px;
}
.signup-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.signup-card-info { flex: 1; min-width: 0; }
.signup-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 3px;
}
.signup-card-slug {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 2px;
}
.signup-card-email {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 4px;
}
.signup-card-url {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 480px;
}
.signup-card-url a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.signup-card-url a:hover { color: var(--ink-2); }
.signup-card-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.signup-card-date {
  font-size: 12px;
  color: var(--muted);
}
.signup-card-preview {
  font-size: 13px;
  color: var(--ink-2);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--divider);
  line-height: 1.5;
}
.signup-card-location {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* ===== Deploy modal ===== */
.modal--lg { width: 680px; }
.deploy-modal-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
  flex-wrap: wrap;
}
.deploy-meta-sep { color: var(--border); }
.deploy-meta-link { color: var(--accent); text-decoration: none; }
.deploy-meta-link:hover { text-decoration: underline; }
.form-textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  color: var(--ink);
  font-family: var(--ff);
  font-size: 13.5px;
  resize: vertical;
  outline: none;
  transition: border-color .15s;
  box-sizing: border-box;
}
.form-textarea:focus { border-color: var(--accent); }
.form-textarea::placeholder { color: var(--muted); }

/* ===== Tenant edit pane ===== */
.pane-back-row {
  margin-bottom: 8px;
}
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 4px 0;
  font-family: var(--ff);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: color .12s;
}
.btn-back:hover { color: var(--ink-2); }
.edit-sections {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 760px;
}
.edit-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px 24px;
}
.edit-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 16px;
}
.edit-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 24px;
  max-width: 760px;
}

/* ===== Functie-rechten (per-tenant) ===== */
.feature-hint {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
  margin: -4px 0 16px;
  max-width: 60ch;
}
.feature-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.feature-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s ease;
}
.feature-row:hover { background: var(--accent-bg); }
.feature-name {
  font-size: 14px;
  font-weight: 550;
  color: var(--ink);
}
.feature-toggle {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}
.feature-group {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px 6px 8px;
  margin: 6px 0;
}
.feature-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  padding: 8px 14px 4px;
}
.feature-row.feature-sub { padding-left: 22px; }
.feature-row.feature-sub .feature-name { font-weight: 500; }

/* ===== Signup alert pill ===== */
.signup-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: oklch(97% 0.02 60);
  border: 1px solid oklch(88% 0.08 60);
  border-radius: 10px;
  padding: 11px 16px;
  margin-bottom: 18px;
  font-size: 13.5px;
  color: oklch(40% 0.1 50);
  font-weight: 500;
}
.signup-alert-btn {
  flex-shrink: 0;
  padding: 5px 14px;
  background: oklch(60% 0.14 50);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-family: var(--ff);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s;
}
.signup-alert-btn:hover { background: oklch(52% 0.14 50); }

/* ========================================================================
   Dashboard redesign (bento) — donker thema, blauw accent
   ======================================================================== */

/* KPI strip */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}
.kpi {
  display: flex;
  align-items: center;
  gap: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 15px 18px;
  transition: border-color .15s var(--ease), background .15s var(--ease), transform .15s var(--ease);
}
.kpi[data-go] { cursor: pointer; }
.kpi[data-go]:hover { border-color: var(--border-strong); background: var(--surface-2); }
.kpi-ic {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center; flex-shrink: 0;
}
.kpi-ic--accent { background: var(--accent-bg); color: var(--accent); }
.kpi-ic--amber  { background: var(--amber-bg);  color: var(--amber); }
.kpi-ic--green  { background: var(--green-bg);  color: var(--green); }
.kpi-ic--red    { background: var(--red-bg);    color: var(--red); }
.kpi-ic--muted  { background: var(--hover); color: var(--muted); }
.kpi-body { min-width: 0; }
.kpi-value { font-size: 26px; font-weight: 700; letter-spacing: -.6px; color: var(--ink); line-height: 1.05; }
.kpi-value--sm { font-size: 21px; }
.kpi-label { font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.kpi-label-extra { color: var(--ink-2); font-weight: 600; }

/* Bento grid: 4 cols, varied card spans */
.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  align-items: stretch;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-title { font-size: 14.5px; font-weight: 700; letter-spacing: -.2px; color: var(--ink); }
.card-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.card-link {
  background: none; border: none; color: var(--accent); font: 600 12px var(--ff);
  cursor: pointer; padding: 0; white-space: nowrap;
}
.card-link:hover { color: var(--ink); }

.card--revenue { grid-column: span 2; }
.card--donut   { grid-column: span 2; }
.card--recent  { grid-column: span 2; }
.card--growth  { grid-column: span 2; }
.card--metric, .card--action { grid-column: span 1; }

/* Period segmented control */
.seg {
  display: inline-flex; flex-wrap: wrap; gap: 2px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r); padding: 3px;
}
.seg-btn {
  border: none; background: transparent; color: var(--muted);
  font: 600 12px var(--ff); padding: 6px 11px; border-radius: 8px;
  cursor: pointer; white-space: nowrap; transition: background .14s var(--ease), color .14s var(--ease);
}
.seg-btn:hover { color: var(--ink-2); }
.seg-btn.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.3); }

.custom-range {
  display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap;
  margin-bottom: 14px; padding: 12px; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: var(--r);
}
.custom-range[hidden] { display: none; }
.custom-range label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--muted); font-weight: 600; }
.custom-range input[type="date"] {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--ink); font: 500 13px var(--ff); padding: 7px 9px;
}

.rev-total-row { display: flex; align-items: baseline; gap: 9px; margin-bottom: 8px; }
.rev-total { font-size: 30px; font-weight: 700; letter-spacing: -1px; color: var(--ink); }
.rev-total-cap { font-size: 12px; color: var(--muted); }

/* Bar chart (pure CSS, scherpe tekst) */
.barchart {
  display: flex; align-items: flex-end; justify-content: center; gap: 10px;
  height: 200px; padding-top: 24px; margin-top: auto;
}
.barchart.is-dense { gap: 5px; }
.bar-group { flex: 1 1 0; min-width: 0; max-width: 64px; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.bar-cols { flex: 1; width: 100%; min-height: 0; display: flex; align-items: flex-end; justify-content: center; }
.bar {
  position: relative; width: 60%; max-width: 30px; min-height: 3px;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, var(--accent), var(--accent-dark));
  transition: filter .14s var(--ease);
}
.bar--zero { background: repeating-linear-gradient(45deg, var(--hatch) 0 4px, transparent 4px 7px); }
.bar-group:hover .bar { filter: brightness(1.12); }
.bar-val {
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  margin-bottom: 6px; font-size: 10px; font-weight: 700; color: var(--ink-2);
  white-space: nowrap; letter-spacing: -.3px;
}
.bar-label { font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; text-transform: capitalize; }

/* Metric cards (LTV, totaal) — inhoud verticaal gecentreerd zodat hoge cellen niet leeg ogen */
.card--metric { gap: 0; justify-content: center; }
.card--action { gap: 0; }
.metric-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 14px; }
.metric-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.metric-value { font-size: 30px; font-weight: 700; letter-spacing: -1px; color: var(--ink); line-height: 1.1; margin-bottom: 3px; }
.metric-sub { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.card--metric .metric-value { margin-top: 8px; }
.card--action .metric-value { margin-top: auto; }

.card--action { cursor: pointer; transition: border-color .15s var(--ease), background .15s var(--ease); }
.card--action:hover { border-color: var(--border-strong); background: var(--surface-2); }
.action-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.action-arrow { color: var(--muted); font-size: 17px; transition: transform .15s var(--ease), color .15s var(--ease); }
.card--action:hover .action-arrow { color: var(--ink); transform: translateX(3px); }

/* Donut */
.card--donut { align-items: stretch; }
.donut-wrap { position: relative; display: flex; align-items: center; justify-content: center; flex: 1; min-height: 150px; }
.donut { width: 150px; height: 150px; display: block; }
.donut-track { fill: none; stroke: var(--bg-2); stroke-width: 12; }
.donut-seg { fill: none; stroke-width: 12; stroke-linecap: round; transition: stroke-dashoffset .6s var(--ease); }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.donut-center-num { font-size: 30px; font-weight: 700; letter-spacing: -1px; color: var(--ink); line-height: 1; }
.donut-center-cap { font-size: 11px; color: var(--muted); margin-top: 4px; }
.donut-legend { display: flex; flex-direction: column; gap: 9px; justify-content: center; min-width: 120px; }
.donut-legend-row { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.donut-legend-dot { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.donut-legend-k { color: var(--ink-2); }
.donut-legend-v { margin-left: auto; color: var(--ink); font-weight: 700; }
.card--donut .card-title { margin-bottom: 0; }
.card--donut .donut-body { display: flex; gap: 18px; align-items: center; flex: 1; }

/* Recent customers list */
.recent-list { display: flex; flex-direction: column; gap: 2px; }
.recent-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--divider); }
.recent-row:last-child { border-bottom: none; }
.recent-av {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0; object-fit: cover;
  background: var(--surface-2); display: grid; place-items: center;
  color: var(--accent); font-weight: 700; font-size: 13px;
}
.recent-info { min-width: 0; flex: 1; }
.recent-name { font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-meta { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.recent-when { font-size: 11px; color: var(--muted); }
.badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  padding: 2px 7px; border-radius: 999px;
}
.badge--active { background: var(--green-bg); color: var(--green); }
.badge--trial  { background: var(--amber-bg); color: var(--amber); }
.badge--inactive { background: var(--hatch); color: var(--muted); }

/* Growth card */
.card--growth .card-title { margin-bottom: 14px; }
.growth-rows { display: flex; flex-direction: column; gap: 0; flex: 1; }
.growth-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--divider); }
.growth-row:last-child { border-bottom: none; }
.growth-k { font-size: 13px; color: var(--ink-2); }
.growth-v { font-size: 16px; font-weight: 700; color: var(--ink); letter-spacing: -.3px; }
.growth-row--accent .growth-v { color: var(--accent); }

/* Goal tracker — twee aparte kaarten */
.card--goal { grid-column: span 2; }
.goal-pace { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.goal-pace--up { color: var(--green); background: var(--green-bg); }
.goal-pace--down { color: var(--red); background: var(--red-bg); }
.goal-pace--neutral { color: var(--muted); background: var(--hover); }
.goal-body { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.goal-nums { display: flex; align-items: baseline; gap: 7px; }
.goal-current { font-size: 30px; font-weight: 700; letter-spacing: -.8px; color: var(--ink); line-height: 1; }
.goal-target { font-size: 13px; color: var(--muted); font-weight: 500; }
.goal-bar { height: 9px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.goal-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-dark)); transition: width .6s var(--ease); }
.goal-bar-fill.is-done { background: var(--green); }
.goal-foot { display: flex; align-items: center; justify-content: space-between; font-size: 12px; margin-top: 4px; }
.goal-foot--center { justify-content: center; gap: 14px; }
.goal-pctnum { font-weight: 700; color: var(--ink-2); }
.goal-deadline { color: var(--muted); }
.goal-donut { flex: 1; min-height: 150px; margin-top: 4px; }
.goal-empty { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.goal-none { font-size: 13px; color: var(--muted); }

/* ===== Globale topbanner (open tickets) ===== */
.topbanner {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 32px;
  background: var(--red-bg);
  border-bottom: 1px solid color-mix(in srgb, var(--red) 22%, transparent);
  font-size: 13.5px; font-weight: 500; color: var(--ink);
}
.topbanner[hidden] { display: none; }
.topbanner-ic {
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: 28px; height: 28px; border-radius: 8px;
  background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--red);
}
.topbanner-btn {
  margin-left: auto; flex-shrink: 0;
  padding: 6px 15px; border: none; border-radius: var(--r-sm);
  background: var(--red); color: #fff;
  font: 600 12.5px var(--ff); cursor: pointer;
  transition: filter .14s var(--ease);
}
.topbanner-btn:hover { filter: brightness(1.08); }

/* ===== Merklogo (vervangt de 'C') ===== */
.brand-logo { display: inline-flex; align-items: center; flex-shrink: 0; }
.brand-logo img { height: 22px; width: auto; }
.brand-logo--lg img { height: 34px; }
/* Specifiek genoeg om .brand-logo img te verslaan, anders blijven beide staan */
.brand-logo img.logo-light { display: none; }
.brand-logo img.logo-dark  { display: block; }
html[data-theme="light"] .brand-logo img.logo-light { display: block; }
html[data-theme="light"] .brand-logo img.logo-dark  { display: none; }

/* ===== Vernieuwen-knop (spin) ===== */
@keyframes spin-once { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.is-spinning { animation: spin-once .55s cubic-bezier(.25,.46,.45,.94) forwards; }

/* ===== Theme toggle ===== */
.theme-toggle {
  display: flex; align-items: center; gap: 9px; width: 100%;
  margin-bottom: 12px; padding: 8px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--ink-2); font: 600 12.5px var(--ff); cursor: pointer;
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.theme-toggle:hover { background: var(--surface-2); border-color: var(--border-strong); }
.theme-toggle-ic { display: inline-grid; place-items: center; width: 18px; height: 18px; color: var(--accent); }
/* Toon maan in dark, zon in light */
.ic-sun { display: none; }
.ic-moon { display: block; }
html[data-theme="light"] .ic-sun { display: block; }
html[data-theme="light"] .ic-moon { display: none; }

.icon-btn {
  width: 38px; height: 38px; border-radius: var(--r-sm); flex-shrink: 0;
  background: var(--surface); border: 1px solid var(--border); color: var(--ink);
  display: grid; place-items: center; cursor: pointer;
  transition: background .15s var(--ease);
}
.icon-btn:hover { background: var(--surface-2); }
.topbar-theme { margin-left: auto; }

/* ===== Mobiele onderbalk (alleen mobiel) ===== */
.bottom-nav { display: none; }

/* ===== Mobile topbar + sidebar drawer (verborgen op desktop) ===== */
.mobile-topbar { display: none; }
.sidebar-overlay { display: none; }

/* ========================================================================
   Responsive
   ======================================================================== */
@media (max-width: 1100px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .card--revenue { grid-column: span 2; grid-row: auto; }
  .card--donut, .card--recent, .card--growth { grid-column: span 2; }
  .card--metric, .card--action, .card--goal { grid-column: span 1; }
}

@media (max-width: 860px) {
  /* Topbar boven, content eronder (sidebar is fixed/overlay) */
  .shell { flex-direction: column; }
  /* Off-canvas sidebar */
  .main { margin-left: 0; width: 100%; }
  /* Ticket-paneel full-width (sidebar telt op mobiel niet mee in de breedte) */
  .ticket-detail { width: 100%; max-width: 100vw; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform .26s var(--ease);
    width: 248px;
    box-shadow: 0 0 40px rgba(0,0,0,.5);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  .sidebar-overlay {
    display: block; position: fixed; inset: 0; z-index: 9;
    background: rgba(0,0,0,.5); opacity: 0; pointer-events: none;
    transition: opacity .26s var(--ease);
  }
  body.nav-open .sidebar-overlay { opacity: 1; pointer-events: auto; }

  /* Mobile topbar */
  .mobile-topbar {
    display: flex; align-items: center; gap: 12px;
    position: sticky; top: 0; z-index: 8;
    height: 56px; padding: 0 16px;
    background: var(--bg-2); border-bottom: 1px solid var(--border);
  }
  .mobile-menu-btn {
    width: 38px; height: 38px; border-radius: var(--r-sm);
    background: var(--surface); border: 1px solid var(--border);
    color: var(--ink); display: grid; place-items: center; cursor: pointer; flex-shrink: 0;
  }
  .mobile-menu-btn:hover { background: var(--surface-2); }
  .mobile-topbar-logo { display: flex; align-items: center; gap: 10px; }

  .main-header { padding: 18px 18px 0; }
  .main-header h1 { font-size: 20px; }
  /* ruimte onderaan zodat de onderbalk niets bedekt */
  .main-content { padding: 16px 18px calc(74px + env(safe-area-inset-bottom)); }

  /* iOS zoomt in op velden met <16px tekst; voorkom dat op mobiel */
  input, select, textarea, .ticket-reply-input { font-size: 16px; }

  /* Onderbalk tonen */
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--bg-2); border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav-item {
    flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px;
    background: none; border: none; cursor: pointer; padding: 6px 2px;
    color: var(--muted); font: 600 10px var(--ff); letter-spacing: -.01em;
    transition: color .14s var(--ease);
  }
  .bottom-nav-item span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bottom-nav-item svg { width: 22px; height: 22px; }
  .bottom-nav-item.is-active { color: var(--accent); }
  .bn-ic { position: relative; display: inline-flex; }
  .bottom-nav-badge {
    position: absolute; top: -5px; left: 100%; margin-left: -10px;
    background: var(--red); color: #fff; font-size: 9px; font-weight: 700;
    min-width: 15px; height: 15px; border-radius: 999px; padding: 0 4px;
    display: none; align-items: center; justify-content: center;
  }
  .bottom-nav-badge:not(:empty) { display: inline-flex; }
}

@media (max-width: 720px) {
  .kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .bento { grid-template-columns: 1fr; }
  .card, .card--revenue, .card--donut, .card--recent, .card--growth,
  .card--metric, .card--action { grid-column: auto; grid-row: auto; }
  .card--donut .donut-body { flex-direction: column; }
  .rev-total { font-size: 26px; }
}

/* Overige panes mobiel: tabel → kaarten, formulieren 1-koloms, acties full-width */
@media (max-width: 640px) {
  .section-head { flex-wrap: wrap; gap: 10px; }
  .section-head .btn { width: 100%; justify-content: center; }

  /* Klanten-tabel wordt een lijst van kaarten */
  .tenant-table { background: transparent; border: none; border-radius: 0; overflow: visible; }
  .tenant-table-head { display: none; }
  /* De rijen zitten in #tenantList, dus dáár de flex-gap zetten (niet op .tenant-table) */
  #tenantList { display: flex; flex-direction: column; gap: 16px; }
  .tenant-row {
    display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
    padding: 16px 18px; background: var(--surface); border: 1px solid var(--border-strong);
    border-radius: var(--r-lg);
  }
  .tenant-row > div { width: 100%; }
  .tenant-plan { text-transform: capitalize; color: var(--ink-2); font-size: 13px; }
  .tenant-plan::before { content: "Plan: "; color: var(--muted); }
  .tenant-actions { display: flex; gap: 8px; margin-top: 10px; }
  .tenant-actions .btn { flex: 1; justify-content: center; }

  /* Abonnementen-tabel wordt ook een lijst van kaarten */
  .plans-list { background: transparent; border: none; border-radius: 0; overflow: visible; display: flex; flex-direction: column; gap: 18px; }
  .plan-row {
    display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
    padding: 16px 18px; background: var(--surface); border: 1px solid var(--border-strong);
    border-radius: var(--r-lg);
  }
  .plan-row > * { width: 100%; }
  .plan-row-price { font-size: 20px; }
  .plan-row-actions { display: flex; gap: 8px; margin-top: 6px; }
  .plan-row-actions .btn { flex: 1; justify-content: center; }

  /* Aanmelding-kaart: header stapelen, knoppen full-width (anders lopen ze buiten beeld) */
  .signup-card-header { flex-direction: column; gap: 12px; }
  .signup-card-aside { align-items: flex-start; width: 100%; }
  .signup-card-aside > div:last-child { width: 100%; }
  .signup-card-aside .btn { flex: 1; justify-content: center; }

  /* Formulieren 1-koloms */
  .form-grid { grid-template-columns: 1fr; }

  /* Edit-footer: knoppen full-width, plakt onderaan lekker */
  .edit-footer { flex-direction: column-reverse; gap: 10px; max-width: none; }
  .edit-footer .btn { width: 100%; justify-content: center; }

  /* Modals */
  .modal-footer { flex-direction: column-reverse; gap: 8px; }
  .modal-footer .btn { width: 100%; justify-content: center; }

  /* Ticket-rijen mogen wrappen */
  .ticket-row { flex-wrap: wrap; }
  .ticket-filters { flex-wrap: wrap; }

  /* Pane-back-rij + titels */
  .pane-back-row { margin-bottom: 6px; }
}

@media (max-width: 420px) {
  .kpi-strip { grid-template-columns: 1fr; }
  .kpi-value { font-size: 23px; }
}

/* ========================================================================
   Polish: toetsenbord-focus, input-ringen, hover, reduced-motion
   ======================================================================== */

/* Zichtbare focus enkel bij toetsenbordnavigatie (muisklik = geen ring) */
.btn:focus-visible,
.nav-item:focus-visible,
.ticket-filter-btn:focus-visible,
.seg-btn:focus-visible,
.theme-toggle:focus-visible,
.icon-btn:focus-visible,
.mobile-menu-btn:focus-visible,
.logout-btn:focus-visible,
.card--action:focus-visible,
.kpi[data-go]:focus-visible,
.ticket-row:focus-visible,
.tenant-row:focus-visible,
.modal-close:focus-visible,
.card-link:focus-visible,
.signup-alert-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Inputs: rand + zachte accent-ring, werkt in beide thema's */
.form-field input:focus,
.form-field select:focus,
.form-textarea:focus,
.login-field input:focus,
.ticket-reply-input:focus,
.custom-range input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

/* Primaire knop: echte hover-kleur i.p.v. alles dimmen */
.btn-primary:hover { background: var(--accent-dark); opacity: 1; }

/* Bewegingsvoorkeur respecteren */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
