/* ═══════════════════════════════════════════════════════════════════
   KEST Buyer Console — Shell Stylesheet
   Reference design: Didit Business Console
   Brand: KEST
   Date: 2026-04-10
   ═══════════════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'CreatoDisplay';
  src: url('../fonts/CreatoDisplay-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'PrometheanBoldCond';
  src: url('../fonts/prometheanboldcond.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'MonospaceTypewriter';
  src: url('../fonts/MonospaceTypewriter.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  /* Primary blue (KEST interactable) */
  --kb-blue: #2563eb;
  --kb-blue-hover: #1d4ed8;
  --kb-blue-strong: #1e40af;
  --kb-blue-strong-hover: #1d3b9a;
  --kb-blue-light: #eff6ff;
  --kb-blue-text: #1d4ed8;
  --kb-blue-border: #bfdbfe;

  /* Orange (CTA) */
  --kb-warm-cta: #b45309;
  --kb-warm-cta-hover: #92400e;

  /* Gold */
  --kb-gold-cta: #f4c95d;
  --kb-gold-cta-hover: #ddb458;

  /* Neutrals */
  --kb-bg: #f9fafb;
  --kb-surface: #ffffff;
  --kb-border: #e5e7eb;
  --kb-border-light: #f3f4f6;
  --kb-text: #111827;
  --kb-text-muted: #6b7280;
  --kb-text-light: #9ca3af;
  --kb-text-xlight: #d1d5db;

  /* Semantic */
  --kb-success: #10b981;
  --kb-success-bg: #ecfdf5;
  --kb-success-text: #065f46;
  --kb-warning: #f59e0b;
  --kb-warning-bg: #fffbeb;
  --kb-warning-text: #92400e;
  --kb-error: #ef4444;
  --kb-error-bg: #fef2f2;
  --kb-error-text: #991b1b;
  --kb-review: #8b5cf6;
  --kb-review-bg: #f5f3ff;
  --kb-review-text: #5b21b6;
  --kb-brand-badge-bg: linear-gradient(180deg, #d9f99d, #a3e635);
  --kb-brand-badge-text: #365314;
  --kb-brand-badge-shadow: 0 8px 18px -14px rgba(132, 204, 22, 0.85);

  /* Layout */
  --kb-sidebar-width: 250px;
  --kb-sidebar-collapsed: 75px;
  --kb-sidebar-spacing: 9px;
  --kb-header-height: 56px;
  --kb-footer-height: 68px;
  --kb-page-max-width: 1200px;
  --kb-radius-control: 12px;
  --kb-radius-card: 16px;

  /* Dark setup guide */
  --kb-dark: #0f172a;
  --kb-dark-accent: #1e3a5f;

  /* Spacing */
  --kb-space-1: 4px;
  --kb-space-2: 8px;
  --kb-space-3: 12px;
  --kb-space-4: 16px;
  --kb-space-5: 20px;
  --kb-space-6: 24px;
  --kb-space-8: 32px;
  --kb-space-10: 40px;
  --kb-space-12: 48px;
  --kb-space-16: 64px;

  /* Radius */
  --kb-radius-sm: 6px;
  --kb-radius-md: 8px;
  --kb-radius-lg: 12px;
  --kb-radius-xl: 16px;
  --kb-radius-full: 9999px;

  /* Shadows */
  --kb-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --kb-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --kb-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --kb-shadow-popup: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Fonts */
  --kb-font: 'CreatoDisplay', sans-serif;
  --kb-font-heading: 'CreatoDisplay', sans-serif;
  --kb-font-mono: 'MonospaceTypewriter', monospace;
}

/* ── Reset ─────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── App Shell ─────────────────────────────────────────────── */
html,
body {
  height: 100%;
  font-family: var(--kb-font);
  font-size: 14px;
  color: var(--kb-text);
  background: var(--kb-bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  overflow: hidden;
}

body {
  min-height: 100vh;
  padding-bottom: 0;
  overflow: hidden;
}

.kb-app {
  display: flex;
  min-height: calc(100vh - calc(var(--kb-sidebar-spacing) * 2));
  overflow: hidden;
  margin: var(--kb-sidebar-spacing) 0;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.kb-sidebar {
  width: calc(var(--kb-sidebar-width) - var(--kb-sidebar-spacing));
  min-width: calc(var(--kb-sidebar-width) - var(--kb-sidebar-spacing));
  background: var(--kb-surface);
  border: 1px solid var(--kb-border);
  border-top-left-radius: var(--kb-radius-xl);
  border-bottom-left-radius: var(--kb-radius-xl);
  border-top-right-radius: var(--kb-radius-xl);
  border-bottom-right-radius: var(--kb-radius-xl);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: var(--kb-sidebar-spacing);
  left: var(--kb-sidebar-spacing);
  bottom: var(--kb-sidebar-spacing);
  z-index: 100;
  transition:
    width 200ms ease,
    min-width 200ms ease;
  overflow: visible;
}

.kb-sidebar:not([data-shell-ready='1']) .kb-sidebar-header,
.kb-sidebar:not([data-shell-ready='1']) .kb-nav,
.kb-sidebar:not([data-shell-ready='1']) .kb-nav-footer,
.kb-sidebar:not([data-shell-ready='1']) .kb-nav-copy {
  opacity: 0;
  visibility: hidden;
}

.kb-sidebar[data-shell-ready='1'] .kb-sidebar-header,
.kb-sidebar[data-shell-ready='1'] .kb-nav,
.kb-sidebar[data-shell-ready='1'] .kb-nav-footer,
.kb-sidebar[data-shell-ready='1'] .kb-nav-copy {
  opacity: 1;
  visibility: visible;
}

.kb-sidebar.collapsed {
  width: calc(var(--kb-sidebar-collapsed) - var(--kb-sidebar-spacing));
  min-width: calc(var(--kb-sidebar-collapsed) - var(--kb-sidebar-spacing));
  border-bottom-left-radius: var(--kb-radius-xl);
  border-top-right-radius: var(--kb-radius-xl);
  border-bottom-right-radius: var(--kb-radius-xl);
}

.kb-sidebar.collapsed .kb-sidebar-header {
  justify-content: center;
  padding: 0;
}

.kb-sidebar.collapsed .kb-logo-text {
  display: none;
}

.kb-sidebar.collapsed .kb-logo-mark {
  width: 24px;
  height: 24px;
  margin: 0 auto;
}

.kb-sidebar.collapsed .kb-sidebar-toggle {
  width: 30px;
  height: 30px;
}

/* Sidebar header (logo + toggle) */
.kb-sidebar-header {
  height: var(--kb-header-height);
  display: flex;
  align-items: center;
  padding: 0 var(--kb-space-3) 0 var(--kb-space-2);
  border-bottom: 1px solid var(--kb-border);
  flex-shrink: 0;
  gap: var(--kb-space-2);
  position: relative;
}

.kb-logo-mark {
  width: 32px;
  height: 32px;
  background: var(--kb-brand-badge-bg);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  color: var(--kb-brand-badge-text);
  flex-shrink: 0;
  letter-spacing: -0.5px;
  box-shadow: var(--kb-brand-badge-shadow);
}

/* ── Shared brand badge style ───────────────────────────────────── */
.kb-brand-badge,
.kb-logo-mark,
.kb-sidebar-app-icon,
.kb-sidebar-dropdown-avatar,
.kb-org-avatar,
.kb-dropdown-org-avatar,
.kb-settings-logo,
.kb-settings-app-icon {
  background: var(--kb-brand-badge-bg);
  color: var(--kb-brand-badge-text);
  box-shadow: var(--kb-brand-badge-shadow);
}

.kb-brand-badge img,
.kb-logo-mark img,
.kb-sidebar-app-icon img,
.kb-sidebar-dropdown-avatar img,
.kb-org-avatar img,
.kb-dropdown-org-avatar img,
.kb-settings-logo img,
.kb-settings-app-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.kb-logo-text {
  font-family: 'PrometheanBoldCond', var(--kb-font);
  font-weight: 600;
  font-size: 15px;
  color: var(--kb-text);
  white-space: nowrap;
  flex: 1;
  overflow: hidden;
}

.kb-sidebar-app-trigger {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  border: none;
  background: transparent;
  color: var(--kb-text);
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.kb-sidebar-app-trigger:hover .kb-sidebar-app-name,
.kb-sidebar-app-trigger:hover .kb-sidebar-app-chevron {
  color: var(--kb-blue-text);
}

.kb-sidebar-app-icon,
.kb-sidebar-dropdown-avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: var(--kb-brand-badge-bg);
  color: var(--kb-brand-badge-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.03em;
  flex-shrink: 0;
  box-shadow: var(--kb-brand-badge-shadow);
}

.kb-sidebar-app-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--kb-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kb-sidebar-app-chevron {
  width: 14px;
  height: 14px;
  color: var(--kb-text-muted);
  flex-shrink: 0;
  transition: transform 150ms ease;
}

.kb-sidebar-app-dropdown {
  position: fixed;
  top: 0;
  left: 0;
  width: 220px;
  padding: 8px 0;
  background: var(--kb-surface);
  border: 1px solid var(--kb-border);
  border-radius: var(--kb-radius-card);
  box-shadow: var(--kb-shadow-popup);
  z-index: 999;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition:
    opacity 150ms ease,
    transform 150ms ease;
}

.kb-sidebar-app-dropdown.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.kb-sidebar-dropdown-current {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 10px;
}

.kb-sidebar-dropdown-copy {
  min-width: 0;
}

.kb-sidebar-dropdown-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--kb-text);
}

.kb-sidebar-dropdown-caption {
  font-size: 11px;
  color: var(--kb-text-light);
}

.kb-sidebar-toggle {
  width: 30px;
  height: 30px;
  border: 1px solid var(--kb-border);
  background: var(--kb-surface);
  color: var(--kb-text-muted);
  cursor: pointer;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition:
    color 150ms ease,
    background 150ms ease,
    transform 200ms ease,
    border-color 150ms ease;
  position: absolute;
  top: var(--kb-header-height);
  right: calc(-1 * (16px + var(--kb-sidebar-spacing) / 2));
  transform: translateY(-50%);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  z-index: 999;
}

.kb-sidebar-toggle:hover {
  background: var(--kb-border-light);
  color: var(--kb-text);
}

.kb-sidebar-toggle svg {
  transition: transform 200ms ease;
}

.kb-sidebar.collapsed .kb-sidebar-toggle svg {
  transform: rotate(180deg);
}

/* Sidebar nav */
.kb-nav {
  position: relative;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--kb-space-3) 0 4rem;
  scrollbar-width: thin;
  scrollbar-color: var(--kb-border) transparent;
}

.kb-nav::-webkit-scrollbar {
  width: 4px;
}
.kb-nav::-webkit-scrollbar-track {
  background: transparent;
}
.kb-nav::-webkit-scrollbar-thumb {
  background: var(--kb-border);
  border-radius: 4px;
}

.kb-nav-group {
  margin-bottom: var(--kb-space-4);
}

.kb-nav-group-advanced {
  margin-top: var(--kb-space-10);
}

.kb-nav-group-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--kb-text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0 var(--kb-space-4);
  margin-bottom: var(--kb-space-1);
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 200ms ease;
}

.kb-sidebar.collapsed .kb-nav-group-label {
  opacity: 0;
}

.kb-nav-item {
  display: flex;
  align-items: center;
  gap: var(--kb-space-3);
  padding: 7px var(--kb-space-4);
  color: var(--kb-text-muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 400;
  border-radius: 0;
  transition:
    color 150ms ease,
    background 150ms ease;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}

.kb-nav-item:hover {
  background: var(--kb-border-light);
  color: var(--kb-text);
}

.kb-nav-item.active {
  background: var(--kb-blue-light);
  color: var(--kb-blue-text);
  font-weight: 500;
}

.kb-nav-item svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

.kb-nav-item.active svg {
  opacity: 1;
}

.kb-nav-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  transition:
    opacity 200ms ease,
    width 200ms ease;
}

.kb-sidebar.collapsed .kb-nav-label {
  display: none;
  opacity: 0;
  width: 0;
}

.kb-sidebar.collapsed .kb-nav-item {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
  width: 100%;
  gap: 0;
  min-width: 0;
}

.kb-sidebar.collapsed .kb-nav-copy {
  visibility: hidden;
}

.kb-sidebar.collapsed .kb-sidebar-app-name,
.kb-sidebar.collapsed .kb-sidebar-app-chevron {
  display: none;
}

.kb-sidebar.collapsed .kb-sidebar-app-trigger {
  justify-content: center;
}

.kb-sidebar.collapsed .kb-sidebar-app-dropdown {
  left: calc(100% + 8px);
  right: auto;
  width: 220px;
}

/* Sidebar footer nav */
.kb-nav-footer {
  padding: var(--kb-space-1) 0;
  background: var(--kb-surface);
  flex-shrink: 0;
  border-top: 1px solid var(--kb-border-light);
}

.kb-nav-copy {
  display: block;
  color: var(--kb-text-light);
  font-size: 12px;
  padding: var(--kb-space-2) var(--kb-space-4);
  margin-top: var(--kb-space-3);
  margin-bottom: var(--kb-space-3);
  line-height: 1.4;
  width: 100%;
  text-align: center;
}

/* App/Org selector at very bottom */
.kb-app-selector {
  display: flex;
  align-items: center;
  gap: var(--kb-space-2);
  padding: var(--kb-space-3) var(--kb-space-3);
  border-top: 1px solid var(--kb-border);
  cursor: pointer;
  transition: background 150ms ease;
  overflow: hidden;
  flex-shrink: 0;
}

.kb-app-selector:hover {
  background: var(--kb-border-light);
}

.kb-app-avatar {
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: -0.3px;
}

.kb-app-info {
  flex: 1;
  overflow: hidden;
  transition: opacity 200ms ease;
}

.kb-app-selector .app-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--kb-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kb-app-selector .app-balance {
  font-size: 11px;
  color: var(--kb-text-muted);
  white-space: nowrap;
}

.kb-sidebar.collapsed .kb-app-info {
  opacity: 0;
  width: 0;
}

.kb-app-chevron {
  flex-shrink: 0;
  color: var(--kb-text-light);
  transition: opacity 200ms ease;
}

.kb-sidebar.collapsed .kb-app-chevron {
  opacity: 0;
}

/* ── Main Area ─────────────────────────────────────────────── */
.kb-main {
  flex: 1;
  margin-left: calc(var(--kb-sidebar-width) + var(--kb-sidebar-spacing));
  margin-right: var(--kb-sidebar-spacing);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: calc(100vh - calc(var(--kb-sidebar-spacing) * 2));
  height: calc(100vh - calc(var(--kb-sidebar-spacing) * 2));
  padding-top: var(--kb-header-height);
  padding-bottom: calc(var(--kb-footer-height) + var(--kb-sidebar-spacing));
  overflow: hidden;
  transition: margin-left 200ms ease;
}

.kb-sidebar.collapsed ~ .kb-main,
.kb-app.sidebar-collapsed .kb-main {
  margin-left: calc(var(--kb-sidebar-collapsed) + var(--kb-sidebar-spacing));
}

/* ── Header ────────────────────────────────────────────────── */
.kb-header {
  height: var(--kb-header-height);
  background: var(--kb-surface);
  border: 1px solid var(--kb-border);
  border-top-left-radius: var(--kb-radius-xl);
  border-top-right-radius: var(--kb-radius-xl);
  display: flex;
  align-items: center;
  padding: 0 var(--kb-space-6);
  padding-right: calc(var(--kb-space-6) + var(--kb-sidebar-spacing));
  gap: var(--kb-space-3);
  position: fixed;
  top: var(--kb-sidebar-spacing);
  left: calc(var(--kb-sidebar-width) + var(--kb-sidebar-spacing));
  right: var(--kb-sidebar-spacing);
  z-index: 50;
  flex-shrink: 0;
}

.kb-sidebar.collapsed ~ .kb-main .kb-header,
.kb-app.sidebar-collapsed .kb-main .kb-header {
  left: calc(var(--kb-sidebar-collapsed) + var(--kb-sidebar-spacing));
}

.kb-header-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  overflow: hidden;
}

.kb-header-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--kb-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kb-header-title {
  color: var(--color-primary) !important;
}

.kb-header-subtitle {
  font-size: 12px;
  color: var(--kb-text-muted);
  max-width: 100%;
  margin-top: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kb-header-right {
  display: flex;
  align-items: center;
  gap: var(--kb-space-3);
  flex-shrink: 0;
}

/* Icon buttons in header */
.kb-icon-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--kb-border);
  background: #fff;
  color: var(--kb-text-muted);
  cursor: pointer;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 150ms ease,
    color 150ms ease,
    border-color 150ms ease;
  position: relative;
}

.kb-icon-btn:hover,
.kb-icon-btn:focus-visible {
  background: var(--kb-blue);
  border-color: var(--kb-blue);
  color: white;
  outline: none;
}

.kb-scroll-top-btn {
  position: fixed;
  right: 32px;
  bottom: calc(var(--kb-footer-height) + 28px);
  z-index: 70;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(37, 99, 235, 0.9);
  background: var(--kb-surface);
  color: var(--kb-blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 150ms ease,
    visibility 150ms ease,
    transform 150ms ease,
    background 150ms ease,
    color 150ms ease,
    border-color 150ms ease;
}

.kb-scroll-top-btn.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.kb-scroll-top-btn svg {
  width: 18px;
  height: 18px;
}

.kb-scroll-top-btn:hover,
.kb-scroll-top-btn:focus-visible {
  transform: translateY(0) scale(1.05);
  background: rgba(37, 99, 235, 1);
  color: white;
  border-color: rgba(37, 99, 235, 1);
  outline: none;
}

.kb-logout-modal {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.48);
}

.kb-logout-modal[hidden] {
  display: none;
}

.kb-logout-card {
  width: min(100%, 430px);
  padding: 28px;
  border-radius: 28px;
  border: 1px solid #e7edf6;
  background: #fff;
  box-shadow: 0 28px 60px -34px rgba(15, 23, 42, 0.38);
}

.kb-logout-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: #fef2f2;
  color: #b91c1c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.kb-logout-icon svg {
  width: 18px;
  height: 18px;
}

.kb-logout-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.012em;
  color: var(--kb-text);
  margin-bottom: 10px;
}

.kb-logout-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--kb-text-muted);
  margin-bottom: 22px;
}

.kb-logout-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.kb-session-modal {
  position: fixed;
  inset: 0;
  z-index: 325;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.56);
}

.kb-session-modal[hidden] {
  display: none;
}

.kb-session-card {
  width: min(100%, 450px);
  padding: 28px;
  border-radius: 28px;
  border: 1px solid #dbeafe;
  background: #fff;
  box-shadow: 0 28px 60px -34px rgba(15, 23, 42, 0.42);
}

.kb-session-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: #eff6ff;
  color: var(--kb-blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.kb-session-icon svg {
  width: 18px;
  height: 18px;
}

.kb-session-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.012em;
  color: var(--kb-text);
  margin-bottom: 10px;
}

.kb-session-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--kb-text-muted);
  margin-bottom: 18px;
}

.kb-session-timer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--kb-blue-strong);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 22px;
}

.kb-session-timer strong {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.kb-session-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* App footer */
.app-footer {
  position: fixed !important;
  left: calc(var(--kb-sidebar-width) + var(--kb-sidebar-spacing));
  right: var(--kb-sidebar-spacing);
  bottom: var(--kb-sidebar-spacing);
  width: auto;
  background: var(--kb-surface);
  border: 1px solid var(--kb-border);
  border-bottom-left-radius: var(--kb-radius-xl);
  border-bottom-right-radius: var(--kb-radius-xl);
  padding: var(--kb-space-4) var(--kb-space-6);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--kb-space-4);
  flex-shrink: 0;
  box-sizing: border-box;
  z-index: 45;
}

.kb-sidebar.collapsed ~ .kb-main .app-footer,
.kb-app.sidebar-collapsed .kb-main .app-footer {
  left: calc(var(--kb-sidebar-collapsed) + var(--kb-sidebar-spacing));
}

.app-footer .footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: none !important;
  margin: 0 !important;
  gap: var(--kb-space-4);
  flex-wrap: wrap;
}

.app-footer .footer-left,
.app-footer .footer-right {
  display: flex;
  gap: var(--kb-space-4);
}

.app-footer .footer-left {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  min-width: 0;
}

.app-footer .footer-right {
  margin-left: auto;
  justify-content: flex-end;
  align-items: center;
}

.app-footer-action {
  min-height: 42px;
  padding: 0 22px;
  border-radius: var(--kb-radius-control);
  box-shadow: 0 14px 24px -20px rgba(37, 99, 235, 0.42);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.app-footer-action[hidden] {
  display: none;
}

.app-footer-action svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.app-footer .footer-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: calc(var(--kb-space-3) / 1.25);
  margin-bottom: var(--kb-space-3);
}

.app-footer .footer-links a {
  color: var(--kb-text-muted);
  text-decoration: none;
  font-size: 13px;
  transition: color 150ms ease;
  display: inline-block;
  line-height: 1.5;
}

.app-footer .footer-links a:hover {
  color: var(--kb-text);
}

.app-footer .footer-copy {
  color: var(--kb-text-muted);
  font-size: 12px;
  margin: 0;
  padding-top: var(--kb-space-2);
  white-space: nowrap;
}

.app-footer .footer-brand {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-end !important;
  gap: var(--kb-space-2) !important;
  padding: 0 !important;
  margin: 0 !important;
}

.app-footer .footer-logo {
  width: auto;
  height: 34px;
  display: inline-block;
  vertical-align: middle;
}

.app-footer .footer-brand-text {
  font-size: 20px;
  font-weight: 275;
  color: var(--kb-text);
  white-space: nowrap;
  line-height: 1;
  align-self: flex-end !important;
  transform: translateY(-2px);
  margin: 0 !important;
}

.kb-content-inner--narrow {
  max-width: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.kb-content-inner--form {
  max-width: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.kb-icon-btn svg {
  width: 18px;
  height: 18px;
}

/* Notification dot */
.kb-notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  background: var(--kb-error);
  border-radius: 50%;
  border: 2px solid white;
}

/* Org badge (top right) */
.kb-org-badge {
  display: flex;
  align-items: center;
  gap: var(--kb-space-2);
  padding: 4px 10px 4px 5px;
  border-radius: var(--kb-radius-card);
  border: 1px solid var(--kb-border);
  background: #fff;
  cursor: pointer;
  transition:
    background 150ms ease,
    border-color 150ms ease;
  position: relative;
}

.kb-org-badge:hover {
  background: var(--kb-border-light);
  border-color: #d8e0ec;
}

.kb-org-avatar {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: var(--kb-brand-badge-bg);
  color: var(--kb-brand-badge-text);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.3px;
  box-shadow: var(--kb-brand-badge-shadow);
}

.kb-org-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--kb-text);
}

.kb-org-balance {
  display: none;
}

.kb-org-chevron {
  width: 14px;
  height: 14px;
  color: var(--kb-text-muted);
  flex-shrink: 0;
}

/* Org dropdown menu */
.kb-org-dropdown {
  position: fixed;
  top: 0;
  left: 0;
  background: var(--kb-surface);
  border: 1px solid var(--kb-border);
  border-radius: var(--kb-radius-card);
  box-shadow: var(--kb-shadow-popup);
  width: 220px;
  z-index: 999;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition:
    opacity 150ms ease,
    transform 150ms ease;
}

.kb-org-dropdown.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.kb-dropdown-header {
  padding: var(--kb-space-3) var(--kb-space-4);
  border-bottom: 1px solid var(--kb-border-light);
  display: flex;
  align-items: center;
  gap: var(--kb-space-3);
}

.kb-dropdown-org-avatar {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: var(--kb-brand-badge-bg);
  color: var(--kb-brand-badge-text);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kb-dropdown-org-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--kb-text);
}

.kb-dropdown-org-balance {
  display: none;
}

.kb-dropdown-items {
  padding: var(--kb-space-1) 0;
}

.kb-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--kb-space-3);
  padding: var(--kb-space-2) var(--kb-space-4);
  font-size: 13px;
  color: var(--kb-text-muted);
  cursor: pointer;
  transition:
    background 150ms ease,
    color 150ms ease;
  text-decoration: none;
}

.kb-dropdown-item svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.kb-dropdown-item:hover {
  background: var(--kb-border-light);
  color: var(--kb-text);
}

.kb-dropdown-item.danger {
  color: var(--kb-error);
}

.kb-dropdown-item.danger:hover {
  background: var(--kb-error-bg);
}

.kb-dropdown-item.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.kb-dropdown-divider {
  height: 1px;
  background: var(--kb-border-light);
  margin: var(--kb-space-1) 0;
}

.kb-dropdown-email {
  padding: var(--kb-space-2) var(--kb-space-4);
  font-size: 12px;
  color: var(--kb-text-muted);
}

/* ── Content ───────────────────────────────────────────────── */
.kb-content {
  flex: 1;
  min-height: calc(
    100vh - var(--kb-header-height) - var(--kb-footer-height) - calc(var(--kb-sidebar-spacing) * 2)
  );
  padding: var(--kb-space-12);
  padding-bottom: var(--kb-space-12);
  max-width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--kb-surface);
  border-left: 1px solid var(--kb-border);
  border-right: 1px solid var(--kb-border);
}

.kb-content-inner,
.kb-content-inner--narrow,
.kb-content-inner--form {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: var(--kb-space-4) !important;
  box-sizing: border-box !important;
  min-height: 0 !important;
}

body.dashboard-page .kb-content-inner,
body.dashboard-page .kb-content-inner--narrow,
body.dashboard-page .kb-content-inner--form {
  padding: var(--kb-space-12) var(--kb-space-4) var(--kb-space-4) !important;
}

body.new-request-page .kb-content-inner,
body.new-request-page .kb-content-inner--narrow,
body.new-request-page .kb-content-inner--form {
  padding: var(--kb-space-4) !important;
}

body.dashboard-page .kb-content-inner:not(.kb-content-inner--form) {
  max-width: 1600px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

body:not(.dashboard-page):not(.new-request-page) .kb-content-inner:not(.kb-content-inner--form) {
  max-width: 1600px !important;
}

.kb-content-inner:not(.kb-content-inner--form) {
  max-width: var(--kb-page-max-width) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.kb-content > .page-container {
  width: 100% !important;
  max-width: var(--kb-page-max-width) !important;
  margin: 0 auto !important;
  padding: var(--kb-space-12) !important;
  box-sizing: border-box !important;
}

body.dashboard-page .kb-content > .page-container {
  padding: var(--kb-space-12) !important;
}

body:not(.dashboard-page):not(.new-request-page) .kb-content > .page-container {
  max-width: 1600px !important;
}

body.dashboard-page .kb-content > .page-container,
body.new-request-page .kb-content > .page-container {
  padding: var(--kb-space-12) !important;
}

.kb-content .page-container {
  min-width: 0 !important;
}

body {
  padding-bottom: var(--kb-sidebar-spacing) !important;
  overflow: hidden !important;
}

.kb-page-back {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--kb-space-6);
  color: var(--kb-text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.kb-page-back svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.kb-page-back:hover,
.kb-page-back:focus-visible {
  color: var(--kb-text);
  outline: none;
}

/* ── Notifications Panel ───────────────────────────────────── */
.kb-notif-panel {
  position: fixed;
  top: calc(var(--kb-header-height) + 4px);
  right: var(--kb-space-4);
  width: 360px;
  background: var(--kb-surface);
  border: 1px solid var(--kb-border);
  border-radius: var(--kb-radius-xl);
  box-shadow: var(--kb-shadow-popup);
  z-index: 200;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition:
    opacity 150ms ease,
    transform 150ms ease;
}

.kb-notif-panel.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.kb-notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--kb-space-4) var(--kb-space-5);
  border-bottom: 1px solid var(--kb-border-light);
}

.kb-notif-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--kb-text);
}

.kb-notif-close {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--kb-text-light);
  cursor: pointer;
  border-radius: var(--kb-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 150ms ease,
    color 150ms ease;
}

.kb-notif-close:hover {
  background: var(--kb-border-light);
  color: var(--kb-text-muted);
}

.kb-notif-tabs {
  display: flex;
  gap: 0;
  padding: var(--kb-space-3) var(--kb-space-5);
  border-bottom: 1px solid var(--kb-border-light);
  gap: var(--kb-space-2);
}

.kb-notif-tab {
  padding: 5px 12px;
  border-radius: var(--kb-radius-full);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--kb-border);
  background: transparent;
  color: var(--kb-text-muted);
  transition: all 150ms ease;
}

.kb-notif-tab.active {
  background: var(--kb-text);
  border-color: var(--kb-text);
  color: white;
}

.kb-notif-body {
  padding: var(--kb-space-8) var(--kb-space-5);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 200px;
  justify-content: center;
}

.kb-empty-icon {
  width: 40px;
  height: 40px;
  color: var(--kb-text-xlight);
  margin-bottom: var(--kb-space-3);
}

.kb-empty-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--kb-text);
  margin-bottom: var(--kb-space-1);
  text-align: center;
}

.kb-empty-desc {
  font-size: 12.5px;
  color: var(--kb-text-muted);
  text-align: center;
  line-height: 1.5;
  max-width: 220px;
}

/* ── Buttons ───────────────────────────────────────────────── */
.kb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--kb-space-2);
  padding: 7px 14px;
  border-radius: var(--kb-radius-control);
  font-family: var(--kb-font);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 150ms ease;
  white-space: nowrap;
  line-height: 1;
  min-height: 34px;
  text-decoration: none;
}

.kb-btn svg {
  width: 15px;
  height: 15px;
}

.kb-btn-primary {
  background: var(--kb-blue);
  border-color: var(--kb-blue);
  color: white;
}

.kb-btn-primary:hover {
  background: var(--kb-blue-hover);
  border-color: var(--kb-blue-hover);
}

.kb-btn-secondary {
  background: var(--kb-surface);
  border-color: var(--kb-border);
  color: var(--kb-text-muted);
}

.kb-btn-secondary:hover {
  background: var(--kb-border-light);
  color: var(--kb-text);
}

.kb-btn-warm {
  background: var(--kb-warm-cta);
  border-color: var(--kb-warm-cta);
  color: white;
}

.kb-btn-warm:hover {
  background: var(--kb-warm-cta-hover);
  border-color: var(--kb-warm-cta-hover);
}

.kb-shortlist-btn {
  transition:
    background 150ms ease,
    border-color 150ms ease,
    color 150ms ease,
    box-shadow 150ms ease;
}

.kb-shortlist-btn.is-shortlisted {
  background: var(--kb-blue-strong);
  border-color: var(--kb-blue-strong);
  color: white;
  box-shadow: 0 10px 18px -16px rgba(30, 64, 175, 0.8);
}

.kb-shortlist-btn.is-shortlisted::before {
  content: '';
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

.kb-shortlist-btn.is-shortlisted:hover {
  background: var(--kb-blue-strong-hover);
  border-color: var(--kb-blue-strong-hover);
  color: white;
}

.kb-btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--kb-text-muted);
}

.kb-btn-ghost:hover {
  background: var(--kb-border-light);
  color: var(--kb-text);
}

.kb-btn-danger {
  background: var(--kb-error-bg);
  border-color: var(--kb-error);
  color: var(--kb-error-text);
}

.kb-btn-danger:hover {
  background: var(--kb-error);
  color: white;
}

.kb-btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  min-height: 28px;
}

.kb-btn-lg {
  padding: 10px 20px;
  font-size: 14px;
  min-height: 40px;
}

.kb-btn-full {
  width: 100%;
}

.kb-toast-stack {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3200;
  width: min(460px, calc(100vw - 24px));
  display: grid;
  gap: 12px;
  pointer-events: none;
}

.kb-toast {
  pointer-events: auto;
  display: grid;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 26px 48px -34px rgba(15, 23, 42, 0.48);
  opacity: 0;
  transform: translateY(-10px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.kb-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.kb-toast--success {
  border-color: rgba(16, 185, 129, 0.18);
}

.kb-toast--error {
  border-color: rgba(239, 68, 68, 0.22);
}

.kb-toast--error .kb-toast-title,
.kb-toast--error .kb-toast-message {
  color: var(--kb-error-text);
}

.kb-toast--info {
  border-color: rgba(59, 130, 246, 0.18);
}

.kb-toast-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.kb-toast-copy {
  flex: 1;
  display: grid;
  gap: 4px;
}

.kb-toast-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--kb-text);
}

.kb-toast-message {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--kb-text-muted);
}

.kb-toast-actions {
  display: flex;
  justify-content: flex-start;
}

.kb-toast-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 12px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
}

.kb-toast-action--success {
  border-color: rgba(16, 185, 129, 0.18);
  background: #ecfdf5;
  color: #047857;
}

.kb-toast-action:hover {
  background: #dbeafe;
}

.kb-toast-action--success:hover {
  background: #dcfce7;
}

.kb-toast-close {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--kb-text-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.kb-toast-close:hover {
  background: var(--kb-border-light);
  color: var(--kb-text);
}

.kb-toast-close svg {
  width: 14px;
  height: 14px;
}

/* ── Badges / Chips ─────────────────────────────────────────── */
.kb-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}

.kb-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.kb-badge-success {
  background: var(--kb-success-bg);
  color: var(--kb-success-text);
}
.kb-badge-success::before {
  background: var(--kb-success);
}
.kb-badge-warning {
  background: var(--kb-warning-bg);
  color: var(--kb-warning-text);
}
.kb-badge-warning::before {
  background: var(--kb-warning);
}
.kb-badge-error {
  background: var(--kb-error-bg);
  color: var(--kb-error-text);
}
.kb-badge-error::before {
  background: var(--kb-error);
}
.kb-badge-review {
  background: var(--kb-review-bg);
  color: var(--kb-review-text);
}
.kb-badge-review::before {
  background: var(--kb-review);
}
.kb-badge-neutral {
  background: var(--kb-border-light);
  color: var(--kb-text-muted);
}
.kb-badge-neutral::before {
  background: var(--kb-text-light);
}
.kb-badge-blue {
  background: var(--kb-blue-light);
  color: var(--kb-blue-text);
}
.kb-badge-blue::before {
  background: var(--kb-blue);
}

.kb-persona-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  display: block;
}

.kb-persona-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  color: var(--kb-text-muted);
  font-size: 13px;
  font-weight: 600;
}

.kb-trust-stack {
  display: grid;
  gap: 8px;
}

.kb-trust-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 30px;
  align-content: flex-start;
}

.kb-wheel-scroll-x {
  overscroll-behavior-x: contain;
}

.kb-trust-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
}

.kb-trust-chip--positive {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #047857;
}

.kb-trust-chip--negative {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.kb-trust-chip--neutral {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #475569;
}

.kb-tag-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  color: #334155;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
}

/* App tag badge (KEST tag on team member rows) */
.kb-app-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid var(--kb-border);
  font-size: 11px;
  font-weight: 500;
  color: var(--kb-text-muted);
  background: var(--kb-surface);
}

/* ── Cards ──────────────────────────────────────────────────── */
.kb-card {
  background: var(--kb-surface);
  border: 1px solid var(--kb-border);
  border-radius: var(--kb-radius-lg);
  box-shadow: var(--kb-shadow-lg);
  overflow: hidden;
}

.kb-card-header {
  padding: var(--kb-space-4) var(--kb-space-5);
  border-bottom: 1px solid var(--kb-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--kb-space-3);
}

.kb-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--kb-text);
  display: flex;
  align-items: center;
  gap: var(--kb-space-2);
}

.kb-card-body {
  padding: var(--kb-space-5);
}

/* ── Tables ─────────────────────────────────────────────────── */
.kb-table-wrapper {
  overflow-x: auto;
  border-radius: var(--kb-radius-lg);
  border: 1px solid var(--kb-border);
  background: var(--kb-surface);
}

.kb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.kb-table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--kb-text-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: var(--kb-space-3) var(--kb-space-4);
  border-bottom: 1px solid var(--kb-border);
  background: var(--kb-surface);
  white-space: nowrap;
}

.kb-table td {
  padding: var(--kb-space-3) var(--kb-space-4);
  border-bottom: 1px solid var(--kb-border-light);
  color: var(--kb-text-muted);
  vertical-align: middle;
}

.kb-table tr:last-child td {
  border-bottom: none;
}

.kb-table tr:hover td {
  background: var(--kb-bg);
}

/* Table user info */
.kb-user-cell {
  display: flex;
  align-items: center;
  gap: var(--kb-space-3);
}

.kb-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--kb-radius-control);
  background: var(--kb-blue-light);
  color: var(--kb-blue-text);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.kb-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kb-user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--kb-text);
  white-space: nowrap;
}

.kb-user-email {
  font-size: 11.5px;
  color: var(--kb-text-muted);
}

/* ── Forms ──────────────────────────────────────────────────── */
.kb-form-group {
  margin-bottom: var(--kb-space-5);
}

.kb-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--kb-space-4);
}

.kb-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--kb-text);
  margin-bottom: var(--kb-space-2);
}

.kb-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--kb-border);
  border-radius: var(--kb-radius-md);
  font-family: var(--kb-font);
  font-size: 13.5px;
  color: var(--kb-text);
  background: var(--kb-surface);
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
  outline: none;
  min-height: 36px;
}

.kb-input::placeholder {
  color: var(--kb-text-light);
}

.kb-input:focus {
  border-color: var(--kb-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.kb-input-wrapper {
  position: relative;
}

.kb-input-icon-right {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--kb-text-light);
  cursor: pointer;
  width: 16px;
  height: 16px;
}

.kb-select {
  appearance: none;
  background-image: 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='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

/* ── Switch / Toggle ─────────────────────────────────────────── */
.kb-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.kb-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.kb-switch-track {
  position: absolute;
  inset: 0;
  background: var(--kb-border);
  border-radius: var(--kb-radius-full);
  transition: background 150ms ease;
  cursor: pointer;
}

.kb-switch-track::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 150ms ease;
  box-shadow: var(--kb-shadow-sm);
}

.kb-switch input:checked + .kb-switch-track {
  background: var(--kb-blue);
}

.kb-switch input:checked + .kb-switch-track::after {
  transform: translateX(18px);
}

/* ── Tabs ───────────────────────────────────────────────────── */
.kb-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 1px solid #e6ebf4;
  border-radius: var(--kb-radius-card);
  background: linear-gradient(180deg, #fbfcff, #f3f6fb);
  margin-bottom: var(--kb-space-6);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 10px 18px -18px rgba(15, 23, 42, 0.3);
}

.kb-tabs.kb-tabs--compact {
  width: fit-content;
  justify-self: start;
}

.kb-tab {
  display: flex;
  align-items: center;
  gap: var(--kb-space-2);
  min-height: 38px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  cursor: pointer;
  border: none;
  border-radius: var(--kb-radius-control);
  background: transparent;
  transition:
    color 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
}

.kb-tab + .kb-tab::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 9px;
  bottom: 9px;
  width: 1px;
  background: #d9e2ef;
  opacity: 0.9;
}

.kb-tab:hover {
  background: rgba(255, 255, 255, 0.92);
}

.kb-tab.active {
  color: var(--kb-blue-text);
  background: linear-gradient(180deg, #ffffff, #edf3ff);
  box-shadow:
    0 10px 18px -18px rgba(15, 23, 42, 0.18),
    inset 0 0 0 1px rgba(59, 130, 246, 0.16);
  font-weight: 600;
}

.kb-tab svg {
  width: 15px;
  height: 15px;
}

/* ── Setup Guide Banner ─────────────────────────────────────── */
.kb-setup-banner {
  background:
    linear-gradient(180deg, rgba(20, 30, 58, 0.98), rgba(14, 24, 47, 0.98)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02), transparent 38%);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: var(--kb-radius-card);
  padding: 24px 28px 20px;
  display: flex;
  gap: 30px;
  margin-bottom: var(--kb-space-6);
  position: relative;
  overflow: hidden;
  min-height: 264px;
  box-shadow: 0 26px 40px -30px rgba(15, 23, 42, 0.62);
}

.kb-setup-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 78% 14%, rgba(71, 125, 255, 0.18), transparent 22%),
    radial-gradient(circle at 30% 110%, rgba(35, 91, 214, 0.26), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, transparent 55%),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.018) 0,
      rgba(255, 255, 255, 0.018) 1px,
      transparent 1px,
      transparent 3px
    );
  opacity: 0.9;
}

.kb-setup-banner::after {
  content: '';
  position: absolute;
  inset: auto 56px -28px;
  height: 34px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.35);
  filter: blur(28px);
  pointer-events: none;
}

.kb-setup-left {
  flex: 1;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  --kb-setup-track-width: 228px;
}

.kb-setup-guide-label {
  display: inline-flex;
  align-items: center;
  gap: var(--kb-space-2);
  padding: 6px 14px;
  border-radius: var(--kb-radius-control);
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.18);
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.86);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 18px;
  width: var(--kb-setup-track-width);
  max-width: 100%;
}

.kb-setup-guide-label::before {
  content: '';
  width: 8px;
  height: 8px;
  background: #34d399;
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

.kb-setup-title {
  font-size: 19px;
  font-weight: 700;
  color: white;
  margin-bottom: 12px;
  line-height: 1.25;
  letter-spacing: 0.012em;
  max-width: 420px;
}

.kb-setup-subtitle {
  font-size: 13px;
  color: rgba(226, 232, 240, 0.92);
  margin-bottom: 18px;
  max-width: 440px;
  line-height: 1.55;
}

.kb-setup-progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  max-width: none;
  margin-bottom: 18px;
}

.kb-setup-progress-bar {
  flex: 0 0 var(--kb-setup-track-width);
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--kb-radius-full);
  overflow: hidden;
}

.kb-setup-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #34d399);
  border-radius: var(--kb-radius-full);
  transition: width 300ms ease;
}

.kb-setup-progress-counter {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.82);
  white-space: nowrap;
  flex-shrink: 0;
}

.kb-setup-actions {
  display: flex;
  gap: var(--kb-space-3);
  align-items: center;
}

.kb-setup-btn-primary {
  min-height: 42px;
  padding: 0 20px;
  background: white;
  color: var(--kb-dark);
  border: none;
  border-radius: var(--kb-radius-control);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 150ms ease;
  box-shadow: 0 10px 20px -16px rgba(15, 23, 42, 0.65);
}

.kb-setup-btn-primary:hover {
  opacity: 0.9;
}

.kb-setup-btn-secondary {
  min-height: 42px;
  padding: 0 20px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--kb-radius-control);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 150ms ease;
}

.kb-setup-btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.5);
  color: white;
}

.kb-setup-dismiss {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms ease;
  z-index: 2;
}

.kb-setup-dismiss:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Setup checklist (right side) */
.kb-setup-checklist {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  z-index: 1;
  min-width: 328px;
  align-items: center;
  padding-right: 48px;
}

@media (max-width: 900px) {
  .kb-setup-checklist {
    display: none;
  }
}

.kb-setup-step {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 34px;
  padding: 8px 24px 8px 14px;
  border-radius: 14px;
  cursor: pointer;
  transition: background 150ms ease;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.12);
  color: white;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  width: calc(var(--kb-setup-step-width, 100%) + 60px);
  min-width: 300px;
  align-self: flex-end;
  text-decoration: none;
}

.kb-step-name {
  white-space: nowrap;
}

.kb-setup-step:hover {
  background: rgba(255, 255, 255, 0.08);
}

.kb-setup-step.active {
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(96, 165, 250, 0.32);
}

.kb-setup-step.done {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(148, 163, 184, 0.07);
  color: rgba(255, 255, 255, 0.75);
}

.kb-step-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.4);
}

.kb-step-icon.done {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.22);
  color: #34d399;
}

.kb-step-icon.active {
  background: rgba(59, 130, 246, 0.24);
  border-color: rgba(59, 130, 246, 0.28);
  color: #93c5fd;
}

.kb-step-info {
  flex: 1;
}

.kb-step-name {
  font-size: 12.5px;
  font-weight: 600;
  color: white;
}

.kb-step-time,
.kb-step-meta {
  font-size: 12px;
  color: rgba(226, 232, 240, 0.76);
}

.kb-step-meta.done {
  color: #9ae6b4;
  font-weight: 600;
}

.kb-step-arrow {
  color: rgba(255, 255, 255, 0.58);
  flex-shrink: 0;
}

/* ── Chart / Volume Card ─────────────────────────────────────── */
.kb-chart-card {
  background: var(--kb-surface);
  border: 1px solid var(--kb-border);
  border-radius: var(--kb-radius-lg);
  box-shadow: var(--kb-shadow-lg);
  margin-bottom: var(--kb-space-4);
}

.kb-chart-header {
  padding: var(--kb-space-4) var(--kb-space-5);
  border-bottom: 1px solid var(--kb-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kb-chart-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--kb-text);
  display: flex;
  align-items: center;
  gap: var(--kb-space-2);
}

.kb-info-icon {
  width: 14px;
  height: 14px;
  color: var(--kb-text-xlight);
  cursor: help;
}

.kb-chart-meta {
  font-size: 12px;
  color: var(--kb-text-muted);
}

.kb-chart-body {
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--kb-space-3);
}

/* ── Metrics Grid ────────────────────────────────────────────── */
.kb-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--kb-space-4);
  margin-top: var(--kb-space-4);
}

.kb-metric-card {
  background: var(--kb-surface);
  border: 1px solid var(--kb-border);
  border-radius: var(--kb-radius-lg);
  box-shadow: var(--kb-shadow-lg);
  padding: var(--kb-space-4) var(--kb-space-5);
  min-height: 120px;
  display: flex;
  flex-direction: column;
}

.kb-metric-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--kb-space-4);
}

.kb-metric-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--kb-text);
  display: flex;
  align-items: center;
  gap: var(--kb-space-1);
}

.kb-metric-value {
  font-size: 12px;
  color: var(--kb-text-muted);
}

.kb-metric-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--kb-space-2);
}

.kb-metric-placeholder {
  font-size: 13px;
  color: var(--kb-text-muted);
  font-weight: 500;
  text-align: center;
}

.kb-metric-placeholder-desc {
  font-size: 12px;
  color: var(--kb-text-light);
  text-align: center;
  max-width: 180px;
}

/* ── Filter Toolbar ──────────────────────────────────────────── */
.kb-toolbar {
  display: flex;
  align-items: center;
  gap: var(--kb-space-2);
  padding: var(--kb-space-3) var(--kb-space-4);
  border-bottom: 1px solid var(--kb-border);
  background: var(--kb-surface);
  border-radius: var(--kb-radius-lg) var(--kb-radius-lg) 0 0;
}

.kb-toolbar-right {
  margin-left: auto;
}

.kb-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--kb-space-2);
  padding: 4px 12px;
  border-radius: var(--kb-radius-full);
  font-size: 12.5px;
  font-weight: 500;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #92400e;
  cursor: pointer;
}

.kb-filter-chip svg {
  width: 8px;
  height: 8px;
}

/* ── Avatar initials ─────────────────────────────────────────── */
.kb-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Section header ─────────────────────────────────────────── */
.kb-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--kb-space-5);
}

.kb-section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--kb-text);
  margin-bottom: var(--kb-space-1);
}

.kb-section-subtitle {
  font-size: 13.5px;
  color: var(--kb-text-muted);
}

/* ── Empty states ────────────────────────────────────────────── */
.kb-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--kb-space-12) var(--kb-space-8);
  text-align: center;
}

/* ── Overlay (for dropdowns/panels) ─────────────────────────── */
.kb-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: none;
}

.kb-overlay.active {
  display: block;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .kb-sidebar {
    transform: translateX(-100%);
    transition: transform 200ms ease;
  }
  .kb-sidebar.mobile-open {
    transform: translateX(0);
  }
  .kb-main {
    margin-left: 0;
  }
  .kb-metrics-grid {
    grid-template-columns: 1fr;
  }
  .kb-form-row {
    grid-template-columns: 1fr;
  }
}

/* ─── Settings sections ──────────────────────────── */
.kb-settings-section {
  background: var(--kb-surface);
  border: 1px solid var(--kb-border);
  border-radius: var(--kb-radius-lg);
  margin-bottom: var(--kb-space-4);
  overflow: hidden;
}
.kb-settings-section-header {
  padding: var(--kb-space-4) var(--kb-space-5);
  border-bottom: 1px solid var(--kb-border);
}
.kb-settings-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--kb-text);
}
.kb-settings-section-desc {
  font-size: 12px;
  color: var(--kb-text-light);
  margin-top: 2px;
}
.kb-settings-section-body {
  padding: var(--kb-space-5);
}
.kb-settings-form .kb-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--kb-space-4);
}
@media (max-width: 640px) {
  .kb-settings-form .kb-form-row {
    grid-template-columns: 1fr;
  }
}

.kb-settings-page {
  width: 100%;
  display: grid;
  gap: var(--kb-space-6);
}

.kb-settings-panel {
  display: flex;
  flex-direction: column;
  gap: var(--kb-space-4);
  padding: 24px 26px;
  border: 1px solid var(--kb-border);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 10px 28px -24px rgba(15, 23, 42, 0.2);
}

.kb-settings-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--kb-space-4);
}

.kb-settings-panel-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--kb-text);
  letter-spacing: 0.012em;
}

.kb-settings-panel-subtitle {
  font-size: 13px;
  color: var(--kb-text-light);
  margin-top: 6px;
}

.kb-settings-card {
  background: var(--kb-surface);
  border: 1px solid var(--kb-border);
  border-radius: 20px;
  padding: 24px 28px;
}

.kb-settings-block + .kb-settings-block {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--kb-border-light);
}

.kb-settings-block-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--kb-text);
}

.kb-settings-block-desc {
  font-size: 12px;
  color: var(--kb-text-light);
  margin-top: 4px;
}

.kb-logo-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 16px;
}

.kb-settings-logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--kb-brand-badge-bg);
  color: var(--kb-brand-badge-text);
  box-shadow: var(--kb-brand-badge-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.04em;
  flex-shrink: 0;
}

.kb-logo-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kb-logo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kb-btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: var(--kb-radius-control);
  border: 1px solid var(--kb-border);
  background: var(--kb-surface);
  color: var(--kb-text-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.kb-btn-pill:hover {
  color: var(--kb-text);
  background: var(--kb-border-light);
}

.kb-btn-pill-danger {
  border-color: #fecaca;
  color: #dc2626;
}

.kb-btn-pill-danger:hover {
  background: #fef2f2;
  color: #b91c1c;
}

.kb-logo-hint {
  font-size: 12px;
  color: var(--kb-text-light);
}

.kb-form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--kb-text);
  margin-bottom: 7px;
}

.kb-settings-form .kb-form-group {
  margin-bottom: 16px;
}

.kb-settings-form .kb-input,
.kb-settings-form .kb-select {
  min-height: 42px;
  border-radius: 12px;
  background: #fff;
  border-color: #edf1f7;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.kb-security-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 2px 0;
}

.kb-security-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--kb-text);
}

.kb-security-desc {
  font-size: 12px;
  color: var(--kb-text-light);
  margin-top: 4px;
  max-width: 720px;
}

.kb-settings-app {
  display: flex;
  align-items: center;
  gap: 12px;
}

.kb-settings-app-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--kb-brand-badge-bg);
  color: var(--kb-brand-badge-text);
  box-shadow: var(--kb-brand-badge-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: -0.04em;
}

.kb-settings-app-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--kb-text);
}

.kb-settings-app-desc {
  font-size: 12px;
  color: var(--kb-text-light);
  margin-top: 3px;
}

.kb-settings-actions-global {
  display: flex;
  justify-content: flex-start;
  padding-top: 8px;
}

.kb-settings-panel-account {
  display: flex;
  flex-direction: column;
  gap: var(--kb-space-4);
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.kb-settings-card-section {
  padding: 24px 26px 24px;
  border: 1px solid #e7edf6;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 18px 24px -28px rgba(15, 23, 42, 0.2);
}

.kb-settings-card-section .kb-settings-section-heading {
  margin-bottom: 18px;
}

.kb-settings-card-section .kb-settings-form {
  padding: 0;
  border: none;
  margin-top: 18px;
}

.kb-settings-card-section .kb-settings-flat-section {
  border: none;
  padding: 0;
}

.kb-team-card {
  background: var(--kb-surface);
  border: 1px solid var(--kb-border);
  border-radius: 20px;
  overflow: hidden;
}

.kb-team-card-header {
  padding: 20px 24px 0;
}

.kb-team-table-wrap {
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.kb-team-table th {
  padding-top: 14px;
  padding-bottom: 14px;
}

.kb-team-table td {
  padding-top: 14px;
  padding-bottom: 14px;
}

.kb-member-email {
  font-size: 11px;
  color: var(--kb-text-light);
  margin-top: 2px;
}

.kb-member-role {
  font-size: 13px;
  font-weight: 500;
  color: var(--kb-blue);
}

.kb-member-role-muted {
  color: var(--kb-text-light);
  font-size: 11px;
  font-weight: 400;
}

.kb-gear-btn {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 9999px;
  background: transparent;
  color: var(--kb-text-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.kb-gear-btn:hover {
  color: var(--kb-text);
  background: #eef2f7;
}

.kb-team-footer {
  padding: 18px 24px 24px;
  display: flex;
  justify-content: flex-start;
}

/* Flat team table (no card wrapper) */
.kb-team-table-flat {
  border: 1px solid #e7edf6;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 18px 24px -28px rgba(15, 23, 42, 0.18);
}

.kb-team-table-flat th {
  background: #f9fbff;
  border-bottom: 1px solid #e7edf6;
  padding: 14px 18px;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.kb-team-table-flat td {
  padding: 18px 18px;
  border-bottom: 1px solid #eef2f8;
}

.kb-team-table-flat tbody tr:nth-child(even) td {
  background: #fbfcff;
}

.kb-team-table-flat tbody tr:hover td {
  background: #f4f7ff;
}

.kb-team-table-flat tr:last-child td {
  border-bottom: none;
}

.kb-team-table-flat .kb-app-tag {
  border-color: #d1d5db;
  color: #6b7280;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  background: #fff;
}

/* Flat settings sections (no card wrappers) */
.kb-settings-flat-section {
  padding: 20px 0;
  border-bottom: 1px solid #edf1f7;
}

.kb-settings-flat-section:last-of-type {
  border-bottom: none;
}

.kb-settings-flat-section .kb-settings-form,
form.kb-settings-form.kb-settings-flat-section {
  padding: var(--kb-space-6) 0;
  border-bottom: 1px solid var(--kb-border-light);
}

.kb-settings-section-heading {
  font-size: 16px;
  font-weight: 600;
  color: var(--kb-text);
  margin-bottom: var(--kb-space-4);
}

.kb-country-combo {
  position: relative;
}

.kb-country-combo-trigger {
  width: 100%;
  min-height: 46px;
  border: 1px solid #e7edf6;
  border-radius: 16px;
  background: var(--kb-surface);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px 0 14px;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.kb-country-combo.open .kb-country-combo-trigger,
.kb-country-combo-trigger:focus-visible {
  border-color: var(--kb-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  outline: none;
}

.kb-country-combo-flag {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kb-country-combo-flag img {
  width: 18px;
  height: 18px;
  display: block;
  border-radius: 999px;
}

.kb-country-combo-label {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  color: var(--kb-text);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kb-country-combo-arrow {
  width: 14px;
  height: 14px;
  margin-right: 2px;
  color: var(--kb-text-muted);
  flex-shrink: 0;
}

.kb-country-combo-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  background: var(--kb-surface);
  border: 1px solid #e7edf6;
  border-radius: 24px;
  box-shadow: 0 24px 40px -32px rgba(15, 23, 42, 0.35);
  padding: 12px;
  z-index: 120;
  max-height: min(500px, 78vh);
  overflow: hidden;
  display: grid;
  gap: 12px;
}

.kb-country-combo-menu[hidden] {
  display: none !important;
}

.kb-country-combo-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.kb-country-combo-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #eef2f8;
  border-radius: 16px;
  background: #fff;
  margin-bottom: 0;
  flex: 1 1 auto;
}

.kb-country-combo-search svg {
  width: 16px;
  height: 16px;
  color: var(--kb-text-light);
  flex-shrink: 0;
}

.kb-country-combo-search-input {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  min-height: 40px;
  font-family: var(--kb-font);
  font-size: 14px;
  color: var(--kb-text);
}

.kb-country-combo-search-input::placeholder {
  color: var(--kb-text-light);
}

.kb-country-combo-clear {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid #d8e2ef;
  background: #fff;
  color: var(--kb-text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 150ms ease,
    border-color 150ms ease,
    color 150ms ease;
}

.kb-country-combo-clear:hover,
.kb-country-combo-clear:focus-visible {
  background: #f8fafc;
  border-color: #c9d5e3;
  outline: none;
}

.kb-country-combo-options {
  max-height: min(420px, 60vh);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.kb-country-combo-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-height: 54px;
  padding: 8px 0;
  border-top: 1px solid #eef2f8;
}

.kb-country-combo-cancel,
.kb-country-combo-done {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 150ms ease,
    border-color 150ms ease,
    color 150ms ease;
}

.kb-country-combo-cancel {
  margin-left: auto;
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #b91c1c;
}

.kb-country-combo-cancel:hover,
.kb-country-combo-cancel:focus-visible {
  background: #ffe4e6;
  border-color: #fda4af;
  outline: none;
}

.kb-country-combo-done {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.kb-country-combo-done:hover,
.kb-country-combo-done:focus-visible {
  background: #dbeafe;
  border-color: #93c5fd;
  outline: none;
}

.kb-country-option {
  width: 100%;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  cursor: pointer;
}

.kb-country-option:hover,
.kb-country-option.is-selected {
  background: #f8fafc;
}

.kb-country-option-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.kb-country-option-copy {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.kb-country-option-name,
.kb-country-option-dial {
  font-size: 14px;
  color: var(--kb-text);
}

.kb-country-option-dial {
  color: var(--kb-text-muted);
}

.kb-country-option-check {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--kb-blue);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kb-country-option-empty {
  padding: 12px 14px;
  color: var(--kb-text-light);
  font-size: 13px;
}

.kb-country-combo-placeholder-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--kb-text-light);
}

.kb-country-combo-placeholder-icon svg {
  width: 18px;
  height: 18px;
}

.kb-country-native-select {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.kb-phone-combo {
  display: flex;
  align-items: stretch;
  min-height: 46px;
  border: 1px solid #e7edf6;
  border-radius: 16px;
  background: var(--kb-surface);
  position: relative;
  overflow: visible;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.kb-phone-combo:focus-within {
  border-color: var(--kb-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.kb-country-combo--phone {
  position: static;
  flex: 0 0 auto;
}

.kb-country-combo--phone .kb-country-combo-trigger {
  min-width: 120px;
  height: 100%;
  border: none;
  border-right: 1px solid #eef2f8;
  border-radius: 16px 0 0 16px;
  padding: 0 12px 0 14px;
}

.kb-country-combo--phone .kb-country-combo-menu {
  left: 0;
  right: 0;
}

.kb-phone-combo-input {
  border: none !important;
  min-height: 44px;
  box-shadow: none !important;
  border-radius: 0 16px 16px 0 !important;
  padding-left: 14px;
}

.kb-phone-combo-input:focus {
  border: none;
  box-shadow: none;
}

/* Input with flag prefix */
.kb-input-with-flag {
  display: flex;
  align-items: center;
  border: 1px solid #e7edf6;
  border-radius: 14px;
  background: var(--kb-surface);
  min-height: 46px;
  overflow: hidden;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.kb-input-with-flag:focus-within {
  border-color: var(--kb-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.kb-settings-panel-team {
  padding: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

@media (max-width: 960px) {
  .kb-tabs {
    display: flex;
    width: 100%;
    overflow-x: auto;
  }

  .kb-setup-banner {
    flex-direction: column;
  }

  .kb-setup-checklist {
    width: 100%;
    padding-right: 0;
  }
}

@media (max-width: 720px) {
  .kb-scroll-top-btn {
    right: 16px;
    bottom: 20px;
  }

  .kb-logout-card,
  .kb-session-card {
    padding: 24px;
    border-radius: 24px;
  }

  .kb-logout-actions,
  .kb-session-actions {
    flex-direction: column-reverse;
  }

  .kb-logout-actions .kb-btn,
  .kb-session-actions .kb-btn {
    width: 100%;
  }
}

.kb-flag-prefix {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px 0 12px;
  font-size: 16px;
  flex-shrink: 0;
  border-right: 1px solid var(--kb-border-light);
  background: linear-gradient(180deg, #fbfcff, #f5f8fd);
}

.kb-phone-code {
  font-size: 13.5px;
  color: var(--kb-text);
  padding: 0 6px 0 10px;
  flex-shrink: 0;
  font-weight: 600;
}

.kb-phone-separator {
  width: 1px;
  height: 18px;
  background: var(--kb-border);
  flex-shrink: 0;
  margin: 0 4px;
}

.kb-input-with-flag .kb-input,
.kb-input-with-flag .kb-input-phone {
  border: none;
  outline: none;
  box-shadow: none;
  min-height: 36px;
  flex: 1;
}

.kb-input-with-flag .kb-input:focus,
.kb-input-with-flag .kb-input-phone:focus {
  border: none;
  box-shadow: none;
}

.kb-input-with-flag .kb-select-flag {
  border: none;
  outline: none;
  box-shadow: none;
  min-height: 42px;
  flex: 1;
  background-image: 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='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
  padding-left: 12px;
}

.kb-input-with-flag .kb-input-phone {
  padding-left: 6px;
}

/* Save button pill style */
.kb-btn-save {
  border-radius: var(--kb-radius-full);
  padding: 8px 20px;
  font-size: 13.5px;
  font-weight: 600;
  min-height: 36px;
}

.kb-settings-actions-global {
  display: none;
}
