/* Abena — AI Customer Assistant (RapidLink Microfinance) */

:root {
  --rl-blue: #0b1c2e;
  --rl-blue-deep: #07131f;
  --rl-blue-soft: #e7eef6;
  --rl-orange: #c4923e;
  --rl-orange-soft: #f7efdf;
  --rl-orange-glow: rgba(196, 146, 62, 0.35);
  --rl-blue-glow: rgba(11, 28, 46, 0.18);
  --rl-text: #0b1c2e;
  --rl-muted: #5c6b82;
  --rl-surface: #f4f6f8;
  --rl-card: #ffffff;
  --rl-border: #d7dee8;
  --rl-input-bg: #fbfcfd;
  --rl-login-panel: #ffffff;
  --rl-table-head: linear-gradient(180deg, #eef3f8 0%, #e7eef6 100%);
  --rl-table-hover: rgba(196, 146, 62, 0.08);
  --rl-stat-blue-bg: linear-gradient(135deg, #e7eef6 0%, #f4f7fb 100%);
  --rl-stat-orange-bg: linear-gradient(135deg, #f7efdf 0%, #fff9ef 100%);
  --rl-stat-teal-bg: linear-gradient(135deg, #e6f4f1 0%, #f3fbf9 100%);
  --rl-radius: 12px;
  --rl-radius-lg: 16px;
  --rl-shadow: 0 4px 20px rgba(11, 28, 46, 0.08);
  --rl-sidebar-w: 248px;
  --rl-content-max: 1120px;
  --rl-gap: 1.25rem;
  --rl-gap-lg: 1.75rem;
}

[data-theme="dark"] {
  --rl-blue: #d4af67;
  --rl-blue-deep: #07131f;
  --rl-blue-soft: rgba(212, 175, 103, 0.16);
  --rl-orange: #d4af67;
  --rl-orange-soft: rgba(212, 175, 103, 0.16);
  --rl-orange-glow: rgba(212, 175, 103, 0.25);
  --rl-blue-glow: rgba(212, 175, 103, 0.18);
  --rl-text: #e8edf5;
  --rl-muted: #94a3b8;
  --rl-surface: #0a121c;
  --rl-card: #121c28;
  --rl-border: #243244;
  --rl-input-bg: #172231;
  --rl-login-panel: #121c28;
  --rl-table-head: linear-gradient(180deg, #172231 0%, #121c28 100%);
  --rl-table-hover: rgba(212, 175, 103, 0.1);
  --rl-stat-blue-bg: linear-gradient(135deg, rgba(11, 28, 46, 0.55) 0%, rgba(11, 28, 46, 0.2) 100%);
  --rl-stat-orange-bg: linear-gradient(135deg, rgba(196, 146, 62, 0.22) 0%, rgba(196, 146, 62, 0.08) 100%);
  --rl-stat-teal-bg: linear-gradient(135deg, rgba(13, 148, 136, 0.22) 0%, rgba(13, 148, 136, 0.08) 100%);
  --rl-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

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

html, body { height: 100%; margin: 0; }

body {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--rl-text);
  background: var(--rl-surface);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .rl-display {
  font-family: "Libre Baskerville", Georgia, serif;
  font-weight: 700;
  color: var(--rl-text);
  margin: 0;
  line-height: 1.25;
}

a { color: inherit; }

img { max-width: 100%; height: auto; }

/* ── App shell ───────────────────────────────────────────────── */
.rl-page-bg {
  min-height: 100vh;
  background-color: var(--rl-surface);
  background-image:
    radial-gradient(ellipse 100% 70% at 0% -10%, rgba(11, 28, 46, 0.08), transparent 55%),
    radial-gradient(ellipse 70% 50% at 100% 0%, rgba(196, 146, 62, 0.1), transparent 50%);
}

.rl-app-shell {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}

.rl-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Desktop: nav is viewport-fixed so it never grows/shrinks with page content. */
@media (min-width: 1024px) {
  .rl-app-shell {
    display: block;
    min-height: 100vh;
  }
  .rl-main {
    margin-left: var(--rl-sidebar-w);
    min-height: 100vh;
  }
}

.rl-content {
  flex: 1;
  width: 100%;
  max-width: var(--rl-content-max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
}

@media (min-width: 768px) {
  .rl-content { padding: 2rem 1.75rem 3rem; }
}

/* ── Sidebar ───────────────────────────────────────────────── */
.rl-sidebar {
  width: var(--rl-sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, #07131f 0%, #0b1c2e 55%, #12263a 100%);
  border-right: 1px solid rgba(212, 175, 103, 0.12);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
  align-content: stretch;
  position: relative;
}

.rl-sidebar-brand {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 0;
}

.rl-sidebar-close {
  display: none;
  margin-left: auto;
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 8px;
  line-height: 0;
}
.rl-sidebar-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.rl-nav-backdrop {
  display: none;
}

.rl-brand-name {
  margin: 0;
  color: #fff;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.rl-sidebar-nav {
  min-height: 0;
  padding: 1rem 0.75rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.rl-sidebar-foot {
  padding: 0.65rem 0.65rem calc(0.65rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, #0f2236 0%, #0b1c2e 100%);
  min-height: 0;
  overflow: visible;
  z-index: 2;
}

.rl-sidebar-foot-inner {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.rl-theme-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.15rem;
}

.rl-user-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0 0.15rem;
  min-width: 0;
}

.rl-account-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.rl-account-menu {
  position: relative;
  flex: 1;
  min-width: 0;
}

.rl-user-row-btn {
  width: 100%;
  border: 0;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 0.4rem 0.45rem;
  cursor: pointer;
  text-align: left;
  color: inherit;
  transition: background 0.15s;
}
.rl-user-row-btn:hover,
.rl-account-menu.open .rl-user-row-btn {
  background: rgba(255, 255, 255, 0.1);
}

.rl-user-meta {
  flex: 1;
  min-width: 0;
}

.rl-user-chevron {
  color: rgba(255, 255, 255, 0.55);
  font-size: 1.15rem;
  transition: transform 0.15s;
  flex-shrink: 0;
}
.rl-account-menu.open .rl-user-chevron {
  transform: rotate(180deg);
}

.rl-account-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 0.4rem);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.4rem;
  border-radius: 12px;
  background: #0a1929;
  border: 1px solid rgba(212, 175, 103, 0.22);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  z-index: 80;
}
.rl-account-panel[hidden] {
  display: none !important;
}

.rl-account-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.86);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}
button.rl-account-item {
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.rl-account-logout,
.rl-topbar-logout {
  margin: 0;
  display: contents;
}
.rl-topbar-logout {
  display: inline-flex;
}
.rl-account-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.rl-notif {
  position: relative;
  flex-shrink: 0;
}
.rl-notif-icon-btn,
.rl-notif-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
}
.rl-notif-icon-btn:hover,
.rl-notif.open .rl-notif-icon-btn,
.rl-notif-btn:hover,
.rl-notif.open .rl-notif-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.rl-notif-badge {
  position: absolute;
  top: 0.1rem;
  right: 0.1rem;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.2rem;
  border-radius: 999px;
  background: #d4af67;
  color: #0b1c2e;
  font-size: 0.62rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.rl-notif-badge[hidden] {
  display: none !important;
}
.rl-notif-panel {
  position: fixed;
  left: 0.75rem;
  bottom: 5.5rem;
  width: min(18.5rem, calc(100vw - 1.5rem));
  max-height: min(70vh, 28rem);
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  background: #0a1929;
  border: 1px solid rgba(212, 175, 103, 0.22);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  z-index: 80;
  overflow: hidden;
}
.rl-notif-panel[hidden] {
  display: none !important;
}
.rl-notif-topbar .rl-notif-panel {
  left: auto;
  right: 0.75rem;
  bottom: auto;
  top: 3.75rem;
  width: min(22rem, calc(100vw - 1.5rem));
  max-height: min(70vh, 28rem);
}
.rl-notif-topbar .rl-icon-btn {
  position: relative;
}
.rl-notif-topbar .rl-notif-badge {
  top: 0.15rem;
  right: 0.15rem;
}
.rl-notif-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 0.85rem;
}
.rl-notif-mark-all {
  border: 0;
  background: transparent;
  color: #d4af67;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.rl-notif-mark-all:hover {
  text-decoration: underline;
}
.rl-notif-list {
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  padding: 0.35rem;
}
.rl-notif-empty {
  margin: 0;
  padding: 1rem 0.75rem;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.82rem;
  text-align: center;
}
.rl-notif-item {
  display: block;
  padding: 0.65rem 0.7rem;
  border-radius: 8px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.88);
  border: 1px solid transparent;
}
.rl-notif-item:hover {
  background: rgba(255, 255, 255, 0.08);
}
.rl-notif-item.unread {
  background: rgba(212, 175, 103, 0.1);
  border-color: rgba(212, 175, 103, 0.2);
}
.rl-notif-item-title {
  display: block;
  font-size: 0.82rem;
  font-weight: 650;
  margin-bottom: 0.15rem;
}
.rl-notif-item-body {
  display: block;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.55);
}
.rl-notif-item-time {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.35);
}

.rl-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d4af67, #c4923e);
  color: #0b1c2e;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rl-user-name {
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rl-user-role {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.7rem;
}

/* Mobile top bar */
.rl-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--rl-card);
  border-bottom: 1px solid var(--rl-border);
  box-shadow: var(--rl-shadow);
  position: sticky;
  top: 0;
  z-index: 50;
}

.rl-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.rl-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: var(--rl-muted);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.rl-icon-btn:hover {
  background: var(--rl-blue-soft);
  color: var(--rl-blue);
}

@media (min-width: 1024px) {
  .rl-sidebar {
    display: grid;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--rl-sidebar-w);
    height: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    max-height: 100svh;
    z-index: 40;
    /* Keep overflow visible so notification/account popovers are not clipped. */
    overflow: visible;
  }
  .rl-topbar { display: none; }
  .rl-nav-backdrop { display: none !important; }
}

@media (max-width: 1023px) {
  .rl-sidebar {
    display: grid;
    position: fixed;
    inset: 0 auto 0 0;
    width: min(300px, 86vw);
    height: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    max-height: 100svh;
    z-index: 60;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.35);
    overflow: visible;
  }
  body.rl-nav-open .rl-sidebar {
    transform: translateX(0);
  }
  .rl-sidebar-close { display: inline-flex; }
  .rl-nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(11, 28, 46, 0.55);
    border: 0;
    padding: 0;
    cursor: pointer;
  }
  .rl-nav-backdrop[hidden] { display: none; }
}

/* ── Logo ────────────────────────────────────────────────────── */
.rl-logo-box {
  background: transparent;
  border-radius: var(--rl-radius-lg);
  padding: 0;
  display: block;
  box-shadow: none;
}

.rl-logo-box img,
.rl-logo-lockup img {
  display: block;
  width: min(280px, 100%);
  max-width: 100%;
  height: auto;
}

.rl-logo-sm {
  background: transparent;
  border-radius: 12px;
  padding: 0;
  display: inline-block;
  line-height: 0;
}

.rl-logo-sm img {
  display: block;
  height: 36px;
  width: auto;
  max-width: 160px;
}

.rl-logo-mark {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 14px;
  padding: 0.3rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.rl-logo-mark img {
  height: 40px;
  width: 40px;
  object-fit: contain;
}

.rl-sidebar-label {
  color: rgba(212, 175, 103, 0.85);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0.2rem 0 0;
}

.rl-login-headline {
  color: #fff;
  font-size: 1.75rem;
  margin: 1.25rem 0 0.5rem;
}

/* ── Nav ─────────────────────────────────────────────────────── */
.rl-nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.rl-nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.rl-nav-link.active {
  background: linear-gradient(135deg, #c4923e, #d4af67);
  color: #0b1c2e;
  box-shadow: 0 4px 12px var(--rl-orange-glow);
}

.rl-theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--rl-border);
  background: var(--rl-card);
  color: var(--rl-muted);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.rl-theme-btn:hover {
  color: var(--rl-orange);
  border-color: var(--rl-orange);
  background: var(--rl-orange-soft);
}

.rl-sidebar .rl-theme-btn {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
}

.rl-sidebar .rl-theme-label {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── Login page ──────────────────────────────────────────────── */
.rl-login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 1024px) {
  .rl-login-wrap { grid-template-columns: 1fr 1fr; }
}

.rl-login-hero {
  background: linear-gradient(160deg, #07131f 0%, #0b1c2e 48%, #16314a 100%);
  padding: 2.5rem 2rem;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.rl-login-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 420px;
}

.rl-login-hero::before {
  content: "";
  position: absolute;
  top: -20%;
  right: -10%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, var(--rl-orange-glow), transparent 65%);
  pointer-events: none;
}

.rl-login-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  background: var(--rl-login-panel);
  min-height: 100vh;
}

@media (min-width: 1024px) {
  .rl-login-form-side { min-height: auto; }
}

.rl-login-form-inner {
  width: 100%;
  max-width: 380px;
}

.rl-login-form-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.rl-login-form-header .rl-logo-sm { display: none; }

@media (max-width: 1023px) {
  .rl-login-form-header .rl-logo-sm { display: inline-block; }
}

.rl-hero-features {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2rem;
  margin-top: 2rem;
}

.rl-hero-feature strong {
  display: block;
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 1.35rem;
  color: #d4af67;
}

.rl-hero-feature span {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
}

/* ── Dashboard layout ────────────────────────────────────────── */
.rl-page-banner {
  position: relative;
  z-index: 1;
  overflow: visible;
  background: linear-gradient(120deg, #0b1c2e 0%, #16314a 55%, #c4923e 140%);
  border-radius: var(--rl-radius-lg);
  padding: 1.5rem 1.5rem;
  color: #fff;
  margin-bottom: var(--rl-gap-lg);
  box-shadow: 0 8px 28px rgba(11, 28, 46, 0.22);
}
.rl-page-banner .rl-banner-eyebrow a,
.rl-page-banner a.rl-muted {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
}
.rl-page-banner .rl-banner-eyebrow a:hover,
.rl-page-banner a.rl-muted:hover {
  color: #fff;
  text-decoration: underline;
}

.rl-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.rl-banner-actions {
  flex-shrink: 0;
  margin: 0;
}

.rl-banner-actions .rl-search-select {
  min-width: 9rem;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.rl-banner-actions .rl-search-select option {
  color: #0b1c2e;
}

.rl-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.rl-queue-note {
  font-size: 0.8rem;
  margin: 0;
}

.rl-cell-assign {
  font-size: 0.8125rem;
  max-width: 7rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rl-metric-cell {
  width: 40%;
  min-width: 6rem;
}

.rl-banner-text p {
  margin: 0;
}

.rl-banner-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 0.35rem;
}

.rl-banner-title {
  font-size: 1.5rem;
  color: #fff !important;
  margin-bottom: 0.35rem;
}

.rl-banner-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
  max-width: 36rem;
  line-height: 1.5;
}

.rl-banner-logo { flex-shrink: 0; }

@media (max-width: 640px) {
  .rl-banner-logo { display: none; }
  .rl-banner-title { font-size: 1.25rem; }
}

.rl-stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--rl-gap);
  margin-bottom: var(--rl-gap-lg);
}

@media (min-width: 640px) {
  .rl-stats-grid { grid-template-columns: repeat(3, 1fr); }
}

.rl-stat-card {
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--rl-shadow);
}

.rl-stat-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rl-muted);
  margin: 0;
}

.rl-stat-value {
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 2rem;
  font-weight: 700;
  margin: 0.35rem 0 0;
  line-height: 1;
}

.rl-stat-blue { background: var(--rl-stat-blue-bg); }
.rl-stat-orange { background: var(--rl-stat-orange-bg); }
.rl-stat-teal { background: var(--rl-stat-teal-bg); }
.rl-stat-blue .rl-stat-value { color: #0b1c2e; }
.rl-stat-orange .rl-stat-value { color: #c4923e; }
.rl-stat-teal .rl-stat-value { color: #0d9488; }

[data-theme="dark"] .rl-stat-blue .rl-stat-value { color: #d4af67; }
[data-theme="dark"] .rl-stat-orange .rl-stat-value { color: #e2c07a; }
[data-theme="dark"] .rl-stat-teal .rl-stat-value { color: #5eead4; }

/* Card + table section */
.rl-card {
  background: var(--rl-card);
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius-lg);
  box-shadow: var(--rl-shadow);
  overflow: hidden;
}

.rl-card-head {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid var(--rl-border);
  background: var(--rl-input-bg);
}

@media (min-width: 640px) {
  .rl-card-head {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.rl-card-title {
  font-size: 1.05rem;
  margin: 0;
}

.rl-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.rl-empty-state {
  text-align: center;
  padding: 3.5rem 1.5rem;
}

.rl-empty-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.25rem;
  border-radius: 16px;
  background: var(--rl-stat-blue-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rl-blue);
}

.rl-empty-icon .material-symbols-outlined { font-size: 2rem; }

/* ── Table ───────────────────────────────────────────────────── */
.rl-table-wrap { overflow-x: auto; }

.rl-queue-cards {
  display: none;
}

.rl-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.rl-table th {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--rl-muted);
  padding: 0.75rem 1rem;
  text-align: left;
  background: var(--rl-table-head);
  border-bottom: 2px solid var(--rl-border);
  white-space: nowrap;
}

.rl-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--rl-border);
  font-size: 0.875rem;
  vertical-align: middle;
  color: var(--rl-text);
}

.rl-table tbody tr:hover { background: var(--rl-table-hover); }
.rl-table tbody tr:last-child td { border-bottom: none; }

.rl-cell-customer {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.rl-cell-customer strong {
  display: block;
  font-weight: 600;
}

.rl-cell-customer small {
  color: var(--rl-muted);
  font-size: 0.75rem;
}

.rl-cell-truncate {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--rl-muted);
}

.rl-ref-link {
  color: var(--rl-blue);
  font-weight: 700;
  text-decoration: none;
}

.rl-ref-link:hover { color: var(--rl-orange); }

/* ── Ticket detail layout ────────────────────────────────────── */
.rl-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--rl-gap-lg);
  align-items: start;
}

@media (min-width: 1024px) {
  .rl-detail-grid { grid-template-columns: 2fr 1fr; }
}

.rl-detail-main { min-width: 0; }

.rl-detail-side { min-width: 0; }

.rl-side-panel-card {
  position: sticky;
  top: 1rem;
}

.rl-side-tabs {
  display: flex;
  gap: 0.25rem;
  margin: -0.25rem -0.25rem 1rem;
  padding: 0.25rem;
  border-radius: 0.65rem;
  background: color-mix(in srgb, var(--rl-ink) 6%, transparent);
}

.rl-side-tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--rl-muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45rem 0.4rem;
  border-radius: 0.5rem;
  cursor: pointer;
}

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

.rl-side-tab.active {
  background: var(--rl-surface, #fff);
  color: var(--rl-ink);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--rl-ink) 12%, transparent);
}

.rl-side-details {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: var(--rl-muted);
}

.rl-side-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--rl-ink);
}

.rl-ghana-card-box {
  margin: 0.75rem 0 0.25rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.65rem;
  background: color-mix(in srgb, var(--rl-blue) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--rl-blue) 22%, transparent);
}

.rl-ghana-card-value {
  margin: 0.2rem 0 0;
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", monospace;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  word-break: break-all;
}

.rl-dash-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.rl-dash-recent {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
}

.rl-dash-recent li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  align-items: center;
  padding: 0.55rem 0;
  border-top: 1px solid color-mix(in srgb, var(--rl-ink) 8%, transparent);
}

.rl-customer-snapshot {
  margin: 1.25rem 0 0;
  padding: 1rem 1.1rem;
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--rl-ink) 4%, transparent);
  border: 1px solid color-mix(in srgb, var(--rl-ink) 10%, transparent);
}

.rl-chat-side .rl-customer-snapshot {
  margin: 0;
  padding: 0.75rem 0.85rem;
}
.rl-chat-side .rl-section-title {
  font-size: 0.95rem;
  margin-bottom: 0.45rem;
}
.rl-chat-side .rl-snapshot-edits {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  gap: 0.45rem;
}
.rl-chat-side .rl-snapshot-hint {
  display: none;
}

.rl-snapshot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
}

.rl-snapshot-value {
  margin: 0.15rem 0 0;
  font-weight: 600;
  font-size: 0.92rem;
}

.rl-snapshot-edits {
  margin-top: 0.75rem;
  padding-top: 0.7rem;
  border-top: 1px solid color-mix(in srgb, var(--rl-ink) 8%, transparent);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.rl-snapshot-edit {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.rl-snapshot-edit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.4rem;
  align-items: center;
}

.rl-snapshot-edit .rl-input,
.rl-snapshot-edit-row .rl-input {
  width: 100%;
  min-width: 0;
  font-size: 0.82rem;
  padding: 0.4rem 0.55rem;
}

.rl-snapshot-hint {
  font-size: 0.72rem;
  margin: 0;
  line-height: 1.35;
}

.rl-snapshot-alert {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--rl-gold, #c9a227) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--rl-gold, #c9a227) 35%, transparent);
}

.rl-snapshot-alert p {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  line-height: 1.4;
}

.rl-snapshot-request {
  margin: 0;
}

.rl-snapshot-edit-row .rl-btn-compact {
  padding: 0.4rem 0.65rem;
  font-size: 0.75rem;
  white-space: nowrap;
}

@media (max-width: 520px) {
  .rl-snapshot-edit-row {
    grid-template-columns: 1fr 1fr;
  }
  .rl-snapshot-edit-row .rl-input {
    grid-column: 1 / -1;
  }
}

.rl-takeover-form {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.28rem;
}

.rl-pill-row .rl-takeover-form {
  align-items: flex-start;
}

.rl-notify-opt {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: var(--rl-muted);
  white-space: nowrap;
}

.rl-card-pad {
  padding: 1.5rem;
}

@media (min-width: 640px) {
  .rl-card-pad { padding: 1.75rem 2rem; }
}

.rl-ticket-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.rl-ticket-ref {
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--rl-blue);
  margin-top: 0.35rem;
}

.rl-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.rl-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 1.15rem;
  background: var(--rl-input-bg);
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius);
}

.rl-meta-grid .rl-meta-full { grid-column: 1 / -1; }

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

.rl-section {
  margin-top: 1.5rem;
}

.rl-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
}

.rl-section-title .material-symbols-outlined { color: var(--rl-orange); }

.rl-section-title.blue .material-symbols-outlined { color: var(--rl-blue); }

.rl-sidebar-card {
  border-top: 4px solid var(--rl-orange);
}

.rl-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--rl-muted);
  text-decoration: none;
  margin-bottom: 1.25rem;
  transition: color 0.15s;
}

.rl-back-link:hover { color: var(--rl-orange); }

/* ── Forms ───────────────────────────────────────────────────── */
.rl-form { display: flex; flex-direction: column; gap: 1rem; }

.rl-field { display: flex; flex-direction: column; }

.rl-label {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.15rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--rl-text);
  margin-bottom: 0.4rem;
}

.rl-input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 2px solid var(--rl-border);
  border-radius: 10px;
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--rl-text);
  background: var(--rl-input-bg);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.rl-input:focus {
  outline: none;
  border-color: var(--rl-blue);
  background: var(--rl-card);
  box-shadow: 0 0 0 3px var(--rl-blue-glow);
}

.rl-btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #c4923e, #a87a2f);
  color: #fff;
  font-weight: 700;
  font-size: 0.9375rem;
  border: none;
  border-radius: 10px;
  padding: 0.8rem 1.25rem;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--rl-orange-glow);
  transition: filter 0.15s, transform 0.15s;
}

.rl-btn-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.rl-muted { color: var(--rl-muted); }

.rl-text-center { text-align: center; }

.rl-mt-2 { margin-top: 2rem; }

/* ── Pills ───────────────────────────────────────────────────── */
.rl-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.rl-pill-new { background: var(--rl-blue-soft); color: var(--rl-blue); }
.rl-pill-contacted { background: var(--rl-orange-soft); color: #8a6420; }
.rl-pill-in_progress { background: #ede9fe; color: #5b21b6; }
.rl-pill-closed { background: #d1fae5; color: #047857; }
.rl-pill-bot, .rl-pill-active { background: #ede9fe; color: #5b21b6; }
.rl-pill-waiting, .rl-pill-waiting_officer { background: #ffedd5; color: #9a3412; }
.rl-pill-officer { background: #dbeafe; color: #1d4ed8; }
.rl-chat-chip {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: var(--rl-blue-soft);
  color: var(--rl-blue);
}
.rl-inline-form { display: inline; margin: 0; }
.rl-pill-archived { background: #e5e7eb; color: #4b5563; }
.rl-pill-HIGH { background: #fee2e2; color: #b91c1c; }
.rl-pill-NORMAL { background: var(--rl-blue-soft); color: var(--rl-muted); }

.rl-board-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--rl-border);
}

.rl-board-tab {
  padding: 0.45rem 0.95rem;
  border-radius: 0.55rem;
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--rl-muted);
  background: transparent;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.rl-board-tab:hover {
  color: var(--rl-text);
  background: var(--rl-surface, #f8fafc);
  border-color: var(--rl-border);
}

.rl-board-tab.active {
  color: #fff;
  background: linear-gradient(135deg, #0b1c2e, #16314a);
  border-color: transparent;
}

.rl-filter-pill {
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--rl-muted);
  background: var(--rl-card);
  border: 1px solid var(--rl-border);
  text-decoration: none;
  transition: all 0.15s;
}

.rl-filter-pill:hover {
  border-color: var(--rl-blue);
  color: var(--rl-text);
}

.rl-filter-pill.active {
  background: linear-gradient(135deg, #0b1c2e, #16314a);
  color: #fff;
  border-color: transparent;
}

.rl-channel-whatsapp { background: #dcfce7; color: #15803d; }
.rl-channel-voice { background: var(--rl-blue-soft); color: var(--rl-blue); }
.rl-channel-test { background: var(--rl-input-bg); color: var(--rl-muted); }

.rl-pre {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--rl-muted);
  background: var(--rl-input-bg);
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius);
  padding: 1.15rem;
  line-height: 1.6;
  margin: 0;
}

.rl-pre-notes {
  background: var(--rl-orange-soft);
  border-color: rgba(245, 130, 32, 0.3);
}

.rl-accent-line {
  height: 3px;
  width: 48px;
  background: linear-gradient(90deg, var(--rl-orange), #ffb347);
  border-radius: 2px;
  margin: 0.6rem 0 1rem;
}

.rl-hero-text {
  color: rgba(255, 255, 255, 0.88);
  font-size: 1rem;
  line-height: 1.65;
  margin: 0;
}

.rl-badge-live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  background: rgba(245, 130, 32, 0.15);
  border: 1px solid rgba(245, 130, 32, 0.35);
  border-radius: 999px;
  color: #ffb347;
  font-size: 0.7rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.rl-badge-live::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--rl-orange);
  border-radius: 50%;
  animation: rl-pulse 2s ease infinite;
}

.rl-alert-error {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #dc2626;
  font-size: 0.875rem;
}

.rl-alert-success {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  border-radius: 10px;
  background: rgba(15, 118, 110, 0.1);
  border: 1px solid rgba(15, 118, 110, 0.22);
  color: #0f766e;
  font-size: 0.875rem;
}
[data-theme="dark"] .rl-alert-success {
  color: #5eead4;
  background: rgba(45, 212, 191, 0.12);
  border-color: rgba(45, 212, 191, 0.28);
}

.rl-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.4rem;
  height: 1.4rem;
  margin-left: 0.3rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--rl-blue-soft);
  color: var(--rl-blue);
  cursor: help;
  vertical-align: middle;
  outline: none;
  line-height: 1;
}
.rl-tip .material-symbols-outlined {
  font-size: 1rem;
}
.rl-tip:hover,
.rl-tip:focus-visible,
.rl-tip[aria-expanded="true"] {
  background: rgba(15, 118, 110, 0.22);
  color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.18);
}
.rl-page-banner .rl-tip {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.rl-page-banner .rl-tip:hover,
.rl-page-banner .rl-tip:focus-visible,
.rl-page-banner .rl-tip[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.3);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.22);
}

/* Floating tip layer (appended to body — never clipped by cards/tables) */
.rl-tip-layer {
  position: fixed;
  z-index: 10050;
  max-width: min(20rem, calc(100vw - 1.5rem));
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  background: #0f172a;
  color: #f8fafc;
  font-family: var(--rl-font, "Plus Jakarta Sans", sans-serif);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.45;
  text-align: left;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.35);
  pointer-events: auto;
  word-wrap: break-word;
}
.rl-tip-layer::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  margin-left: -6px;
  border: 6px solid transparent;
  border-top-color: #0f172a;
}
.rl-tip-layer--below::after {
  top: -6px;
  bottom: auto;
  border-top-color: transparent;
  border-bottom-color: #0f172a;
}
.rl-tip-layer--left::after {
  left: 1.25rem;
  margin-left: 0;
}
.rl-tip-layer--right::after {
  left: auto;
  right: 1.25rem;
  margin-left: 0;
}
[data-theme="dark"] .rl-tip-layer {
  background: #e2e8f0;
  color: #0f172a;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}
[data-theme="dark"] .rl-tip-layer::after {
  border-top-color: #e2e8f0;
}
[data-theme="dark"] .rl-tip-layer--below::after {
  border-top-color: transparent;
  border-bottom-color: #e2e8f0;
}

.rl-secret-key {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-width: 22rem;
}
.rl-menu-item-form {
  padding: 1rem;
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius);
  background: var(--rl-input-bg);
}
.rl-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rl-field-editor {
  padding: 1rem;
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius);
  background: var(--rl-card);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.rl-manual-steps {
  margin: 0;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  line-height: 1.55;
}
.rl-manual-steps li::marker {
  font-weight: 700;
  color: var(--rl-blue);
}

@keyframes rl-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.material-symbols-outlined {
  font-size: 1.125rem;
  vertical-align: middle;
  line-height: 1;
}

/* ── Admin / metrics / transcripts ─────────────────────────── */
.rl-nav-section {
  margin: 1rem 0.75rem 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.rl-stats-grid-4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 900px) {
  .rl-stats-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.rl-stats-grid-6 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 720px) {
  .rl-stats-grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .rl-stats-grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
.rl-stat-link {
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.rl-stat-link:hover {
  transform: translateY(-1px);
}
.rl-stat-hint {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: var(--rl-muted, #5c6b82);
  line-height: 1.3;
}

.rl-admin-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .rl-admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .rl-admin-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.rl-admin-tile {
  display: block;
  padding: 1.25rem 1.35rem;
  border-radius: var(--rl-radius);
  background: var(--rl-card);
  border: 1px solid var(--rl-border);
  box-shadow: var(--rl-shadow);
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.rl-admin-tile:hover {
  transform: translateY(-2px);
  border-color: var(--rl-blue);
}
.rl-admin-tile .material-symbols-outlined {
  color: var(--rl-blue);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}
.rl-admin-tile strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}
.rl-admin-tile p {
  margin: 0;
  color: var(--rl-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

.rl-admin-split {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 960px) {
  .rl-admin-split { grid-template-columns: minmax(280px, 360px) 1fr; }
}

.rl-field-row {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr 1fr;
}

.rl-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  background: var(--rl-blue-soft);
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
}

.rl-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--rl-muted);
}

.rl-checkgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.4rem 0.9rem;
}

.rl-inline-ok,
.rl-inline-error {
  font-size: 0.82rem;
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  margin: 0 0 0.75rem;
}

.rl-inline-ok {
  background: rgba(22, 163, 74, 0.1);
  color: #15803d;
}

.rl-inline-error {
  background: rgba(220, 38, 38, 0.1);
  color: #b91c1c;
}

.rl-suggest {
  display: inline-block;
  width: auto;
  text-align: center;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  margin: 0.15rem 0.15rem 0 0;
}

.rl-bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--rl-border);
  border-radius: 10px;
  background: var(--rl-blue-soft);
}

.rl-bulk-bar[hidden] {
  display: none;
}

.rl-bulk-bar .rl-btn-ghost {
  width: auto;
  text-align: center;
  white-space: nowrap;
}

.rl-bulk-count {
  font-size: 0.82rem;
  font-weight: 600;
  margin-right: auto;
}

.rl-bulk-input {
  width: auto;
  min-width: 9rem;
  padding: 0.3rem 0.5rem;
  font-size: 0.8rem;
}

.rl-col-check {
  width: 2.25rem;
  text-align: center;
}

.rl-queue-card {
  border: 1px solid var(--rl-border);
  border-radius: 16px;
  padding: 0.95rem;
  background: var(--rl-card);
  box-shadow: var(--rl-shadow);
}

.rl-queue-card-overdue {
  border-color: rgba(220, 38, 38, 0.28);
}

.rl-queue-card-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
}

.rl-queue-card-badges {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.rl-queue-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 0.75rem;
  margin-top: 0.9rem;
}

.rl-queue-card-label {
  margin: 0 0 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--rl-muted);
}

.rl-queue-card-title {
  margin: 0.9rem 0 0;
  font-weight: 600;
}

.rl-queue-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.9rem;
}

.rl-doc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rl-doc-item {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rl-border);
  font-size: 0.86rem;
}

.rl-doc-item:last-child {
  border-bottom: 0;
}

.rl-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.rl-config-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.75rem;
  margin: 0;
}

.rl-config-form .rl-field {
  margin: 0;
}

.rl-config-form .rl-btn-primary {
  width: auto;
  min-width: 4.75rem;
}

.rl-checkgrid .rl-check {
  text-transform: capitalize;
}

.rl-pill-soft {
  background: var(--rl-blue-soft);
  color: var(--rl-text);
  margin: 0 0.2rem 0.2rem 0;
  text-transform: capitalize;
}

.rl-btn-ghost {
  border: 1px solid var(--rl-border);
  background: transparent;
  color: var(--rl-text);
  border-radius: 8px;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  cursor: pointer;
}
.rl-btn-ghost:hover { border-color: var(--rl-blue); color: var(--rl-blue); }

.rl-login-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0;
  color: var(--rl-muted);
  font-size: 0.8rem;
}
.rl-login-divider::before,
.rl-login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rl-border);
}

.rl-btn-ms {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--rl-border);
  background: var(--rl-input-bg);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}
.rl-btn-ms:hover { border-color: var(--rl-blue); }

.rl-metric-bars { padding: 1rem 1.25rem 1.25rem; }
.rl-metric-row {
  display: grid;
  grid-template-columns: 7rem 1fr 2.5rem;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
}
.rl-metric-track {
  height: 8px;
  border-radius: 999px;
  background: var(--rl-border);
  overflow: hidden;
}
.rl-metric-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--rl-blue), #4d8bff);
}
.rl-metric-fill-orange {
  background: linear-gradient(90deg, var(--rl-orange), #ffb347);
}

.rl-transcript { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1rem; }
.rl-transcript-msg {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: var(--rl-input-bg);
  border: 1px solid var(--rl-border);
  max-width: min(720px, 100%);
}
.rl-transcript-assistant {
  border-left: 3px solid var(--rl-blue);
  align-self: flex-start;
  background: color-mix(in srgb, var(--rl-blue) 8%, var(--rl-input-bg));
}
.rl-transcript-user {
  border-left: 3px solid var(--rl-orange);
  align-self: flex-end;
  background: color-mix(in srgb, var(--rl-orange) 8%, var(--rl-input-bg));
}
.rl-transcript-role {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--rl-muted);
  margin-bottom: 0.25rem;
}
.rl-transcript-msg p { margin: 0; white-space: pre-wrap; }
.rl-summary-card {
  margin-top: 0.5rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--rl-border);
  background: color-mix(in srgb, var(--rl-blue) 6%, var(--rl-card, var(--rl-input-bg)));
  font-size: 0.95rem;
  line-height: 1.45;
  white-space: pre-wrap;
}
.rl-conv-summary {
  max-width: 28rem;
  font-size: 0.88rem;
  color: var(--rl-muted);
  line-height: 1.35;
}
.rl-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 7.5rem;
  align-items: center;
}
.rl-inline-form { display: inline; margin: 0; }
.rl-inline-form button {
  cursor: pointer;
}
.rl-qa-btn {
  appearance: none;
  border: 1px solid var(--rl-border);
  background: var(--rl-card);
  color: var(--rl-text);
  border-radius: 6px;
  padding: 0.28rem 0.55rem;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.rl-qa-btn:hover {
  border-color: var(--rl-blue);
  color: var(--rl-blue);
  background: var(--rl-blue-soft);
}
.rl-chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 148px;
  overflow-x: auto;
  padding: 1rem 1.25rem 1.35rem;
}
.rl-chart-col {
  flex: 1 1 0;
  min-width: 6px;
  max-width: 28px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}
.rl-chart-bar {
  width: 100%;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, var(--rl-blue), #4d8bff);
}
.rl-chart-label {
  font-size: 0.6rem;
  color: var(--rl-muted);
  margin-top: 0.25rem;
  white-space: nowrap;
}

/* ── Search / filters / ticket extras ─────────────────────────── */
.rl-card-head-stack {
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
}
.rl-card-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.rl-search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  width: 100%;
  align-items: center;
}
.rl-search-bar .rl-btn-primary {
  flex: 0 0 auto;
  width: auto;
  min-width: 5.5rem;
}
.rl-search-bar .rl-btn-ghost.rl-btn-compact {
  width: auto;
  text-align: center;
  text-decoration: none;
  padding: 0.55rem 0.9rem;
}
.rl-search-input {
  flex: 1 1 12rem;
  min-width: 10rem;
}
.rl-search-select {
  flex: 0 1 8.5rem;
  min-width: 7.5rem;
}
.rl-btn-compact {
  width: auto;
  padding: 0.55rem 1rem;
  white-space: nowrap;
}
.rl-form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.rl-form-inline .rl-btn-primary {
  width: auto;
}
.rl-form-inline .rl-input {
  width: auto;
  min-width: 10rem;
  flex: 1 1 10rem;
}
.rl-age {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--rl-muted);
}
.rl-age-warm { color: #b45309; }
.rl-age-hot {
  color: #b91c1c;
  background: rgba(185, 28, 28, 0.08);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
}
.rl-payload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.85rem 1rem;
  margin: 0;
}
.rl-payload-grid dt {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--rl-muted);
  margin: 0 0 0.2rem;
}
.rl-payload-grid dd {
  margin: 0;
  font-weight: 600;
  font-size: 0.92rem;
  word-break: break-word;
}
.rl-contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
}
.rl-chip-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--rl-border);
  background: var(--rl-input-bg);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
}
.rl-chip-link .material-symbols-outlined { font-size: 14px; }
.rl-chip-link:hover { border-color: var(--rl-orange); }
.rl-related-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.rl-sidebar-card .rl-quick-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.rl-sidebar-card .rl-quick-actions form {
  width: 100%;
}
.rl-btn-ghost {
  width: 100%;
  text-align: left;
  background: var(--rl-input-bg);
  border: 1px solid var(--rl-border);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--rl-text);
  cursor: pointer;
}
.rl-btn-ghost:hover {
  border-color: var(--rl-blue);
  background: var(--rl-blue-soft);
}
.rl-cell-truncate small {
  display: block;
  font-size: 0.75rem;
  margin-top: 0.15rem;
}

.rl-activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.rl-activity-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.rl-activity-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 0.35rem;
  background: var(--rl-orange);
  flex-shrink: 0;
}
.rl-activity-title {
  margin: 0;
  font-weight: 600;
  font-size: 0.9rem;
}
.rl-activity-meta {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: var(--rl-muted);
}

.rl-row-overdue td {
  background: rgba(185, 28, 28, 0.04);
}
.rl-btn-ghost.rl-btn-compact {
  padding: 0.55rem 0.85rem;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .rl-search-bar { flex-direction: column; align-items: stretch; }
  .rl-search-select, .rl-search-input {
    flex: none;
    width: 100%;
    min-width: 0;
  }
  .rl-search-bar .rl-btn-primary { width: 100%; }
  .rl-field-row { grid-template-columns: 1fr; }
  .rl-queue-cards {
    display: grid;
    gap: 0.9rem;
    margin-top: 0.9rem;
  }
  .rl-table-wrap { display: none; }

  .rl-bulk-bar {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .rl-bulk-bar:not([hidden]) {
    display: grid;
    position: sticky;
    top: 84px;
    z-index: 15;
  }
  .rl-bulk-count {
    grid-column: 1 / -1;
  }
  .rl-bulk-input {
    width: 100%;
    min-width: 0;
  }

  .rl-config-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Brand asset admin previews ─────────────────────────────── */
.rl-brand-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}
.rl-brand-preview-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 96px;
  padding: 0.75rem;
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius-md);
  background: var(--rl-surface-2);
}
.rl-brand-preview-wide {
  grid-column: span 2;
  min-height: 120px;
}
.rl-brand-preview-wide img {
  max-height: 100px;
}
.rl-brand-preview-box img {
  max-height: 72px;
  width: auto;
}

/* ── Ticket hero + KYC panel ───────────────────────────────── */
.rl-ticket-hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin: 0 0 1.25rem;
  padding: 1.25rem 1.35rem;
  border-radius: var(--rl-radius-lg);
  background: linear-gradient(135deg, var(--rl-surface) 0%, var(--rl-surface-2) 100%);
  border: 1px solid var(--rl-border);
}
.rl-ticket-hero-title { margin: 0.15rem 0; font-size: 1.45rem; }
.rl-ticket-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.rl-kyc-panel {
  padding: 0.75rem 0.8rem;
  border-radius: var(--rl-radius-md);
  background: var(--rl-surface-2);
  border: 1px solid var(--rl-border);
}
.rl-chat-side .rl-section {
  margin-top: 0.75rem;
}
.rl-kyc-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
.rl-kyc-result {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  color: var(--rl-text-muted);
}
.rl-kyc-link-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
  margin: 0.45rem 0 0;
  word-break: break-all;
}
.rl-activity-detail {
  display: inline-block;
  margin-top: 0.2rem;
  color: var(--rl-text-muted);
}

/* ── Conversations inbox ───────────────────────────────────── */
.rl-inbox-list { display: flex; flex-direction: column; }
.rl-inbox-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.7rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--rl-border);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}
.rl-inbox-item:hover { background: var(--rl-surface-2); }
.rl-inbox-item-wait {
  background: color-mix(in srgb, #c2410c 7%, var(--rl-surface));
  box-shadow: inset 3px 0 0 #c2410c;
}
.rl-inbox-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--rl-blue);
  color: #fff;
  font-weight: 700;
}
.rl-inbox-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.rl-inbox-preview { margin: 0.2rem 0 0; font-size: 0.8rem; }
.rl-inbox-summary { margin: 0.35rem 0 0; font-size: 0.9rem; }
.rl-inbox-meta { font-size: 0.75rem; color: var(--rl-text-muted); white-space: nowrap; }

.rl-account-layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  max-width: 52rem;
}
@media (min-width: 900px) {
  .rl-account-layout {
    grid-template-columns: minmax(0, 1.4fr) minmax(16rem, 0.9fr);
    align-items: start;
  }
}

.rl-account-settings {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  max-width: 40rem;
}
.rl-account-section-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--rl-font-display);
  font-size: 1.15rem;
  margin: 0 0 0.35rem;
}
.rl-account-section-title .material-symbols-outlined {
  font-size: 1.25rem;
  color: var(--rl-orange, #c47a2c);
}
.rl-account-section-lead {
  margin: 0 0 1rem;
  font-size: 0.875rem;
}
.rl-account-meta {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.rl-account-meta-row {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 0.75rem 1rem;
  align-items: baseline;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rl-border, rgba(15, 23, 42, 0.08));
}
.rl-account-meta-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.rl-account-meta-row dt {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--rl-text-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.rl-account-meta-row dd {
  margin: 0;
  font-size: 0.95rem;
  word-break: break-word;
}
@media (max-width: 520px) {
  .rl-account-meta-row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
}

.rl-dash-charts {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  margin: 0 0 1.25rem;
}
@media (min-width: 900px) {
  .rl-dash-charts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .rl-dash-chart-wide {
    grid-column: 1 / -1;
  }
}
.rl-dash-chart-card {
  min-width: 0;
}
.rl-dash-chart-head {
  margin-bottom: 0.5rem;
}
.rl-dash-chart-head .rl-card-title {
  margin: 0 0 0.2rem;
  font-size: 1.1rem;
}
.rl-dash-chart-head .rl-muted {
  margin: 0;
  font-size: 0.85rem;
}
.rl-amchart {
  width: 100%;
  height: 300px;
}
.rl-amchart-tall {
  height: 340px;
}
.rl-amchart-pie {
  height: 320px;
}
.rl-dash-chart-empty {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
}
.rl-dash-focus {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  margin: 0 0 1.25rem;
}
@media (min-width: 900px) {
  .rl-dash-focus {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    align-items: start;
  }
}
.rl-dash-attention {
  list-style: none;
  margin: 0;
  padding: 0;
}
.rl-dash-attention li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rl-border, #d7dee8);
}
.rl-dash-attention li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.rl-dash-attention-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.rl-dash-attention-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}
.rl-dash-bottom {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .rl-dash-bottom {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    align-items: start;
  }
}

body.rl-chat-page {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
body.rl-chat-page .rl-app-shell {
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
}
body.rl-chat-page .rl-main {
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
}
body.rl-chat-page .rl-content {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.85rem 0.75rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}
body.rl-chat-page .rl-back-link {
  flex-shrink: 0;
  margin-bottom: 0.4rem;
}
body.rl-chat-page .rl-inline-ok,
body.rl-chat-page .rl-inline-error {
  flex: 0 0 auto;
  margin: 0.35rem 1rem;
}
.rl-chat-workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  align-items: stretch;
}
@media (min-width: 1024px) {
  .rl-chat-workspace { grid-template-columns: minmax(0, 1fr) 320px; }
}
.rl-chat-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  background: var(--rl-surface);
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius-lg);
  overflow: hidden;
}
.rl-chat-title {
  font-size: 1.1rem;
  margin: 0;
  line-height: 1.25;
}
.rl-chat-header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.95rem;
  border-bottom: 1px solid var(--rl-border);
  flex: 0 0 auto;
}
.rl-ticket-switcher {
  flex: 0 0 auto;
  padding: 0.4rem 0.95rem 0.5rem;
  border-bottom: 1px solid var(--rl-border);
  background: var(--rl-surface-2);
}
.rl-ticket-switcher .rl-meta-label {
  margin: 0 0 0.3rem;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.rl-ticket-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.rl-ticket-chip-group {
  display: inline-flex;
  align-items: stretch;
  border-radius: 999px;
  border: 1px solid var(--rl-border);
  background: var(--rl-surface);
  overflow: hidden;
}
.rl-ticket-chip-group.active {
  border-color: var(--rl-blue);
  box-shadow: 0 0 0 1px var(--rl-blue);
}
.rl-ticket-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.6rem;
  border: 0;
  text-decoration: none;
  color: inherit;
  font-size: 0.78rem;
  background: transparent;
}
.rl-ticket-chip.active {
  font-weight: 600;
}
.rl-ticket-origin-btn {
  border: 0;
  border-left: 1px solid var(--rl-border);
  background: color-mix(in srgb, var(--rl-blue) 8%, var(--rl-surface));
  color: var(--rl-blue);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0 0.55rem;
  cursor: pointer;
}
.rl-ticket-origin-btn:hover,
.rl-ticket-origin-btn:focus-visible {
  background: color-mix(in srgb, var(--rl-blue) 16%, var(--rl-surface));
}
.rl-chat-scroll {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.75rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  background: var(--rl-surface);
  scroll-behavior: smooth;
}
.rl-chat-origin {
  align-self: center;
  max-width: 94%;
  margin: 0.15rem 0;
  padding: 0.22rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--rl-border);
  background: var(--rl-surface-2);
  color: var(--rl-text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  scroll-margin-top: 0.75rem;
}
.rl-chat-origin.active {
  border-color: var(--rl-blue);
  color: var(--rl-blue);
  background: color-mix(in srgb, var(--rl-blue) 10%, var(--rl-surface));
}
.rl-chat-origin--flash {
  animation: rl-ticket-flash 1.2s ease;
}
@keyframes rl-ticket-flash {
  0%, 100% { box-shadow: none; }
  30% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--rl-blue) 45%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
  .rl-chat-origin--flash { animation: none; }
  .rl-chat-scroll { scroll-behavior: auto; }
}
.rl-chat-bubble {
  max-width: min(76%, 34rem);
  padding: 0.5rem 0.75rem;
  border-radius: 0.9rem;
  border: 1px solid var(--rl-border);
  background: var(--rl-surface-2);
  scroll-margin-top: 0.75rem;
}
.rl-chat-user {
  align-self: flex-end;
  background: color-mix(in srgb, var(--rl-blue) 12%, var(--rl-surface));
  border-bottom-right-radius: 0.25rem;
}
.rl-chat-assistant {
  align-self: flex-start;
  border-bottom-left-radius: 0.25rem;
}
.rl-chat-officer {
  background: color-mix(in srgb, var(--rl-orange) 14%, var(--rl-surface));
}
.rl-chat-system {
  align-self: center;
  max-width: 90%;
  background: transparent;
  border-style: dashed;
  font-size: 0.9rem;
}
.rl-chat-dim { opacity: 0.55; }
.rl-chat-meta {
  font-size: 0.72rem;
  color: var(--rl-text-muted);
  margin-bottom: 0.25rem;
}
.rl-chat-text { white-space: pre-wrap; margin: 0; }
.rl-chat-compose {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: end;
  padding: 0.65rem 0.95rem;
  border-top: 1px solid var(--rl-border);
  background: var(--rl-surface);
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
}
.rl-chat-compose-fields {
  min-width: 0;
}
.rl-chat-compose textarea {
  resize: none;
  min-height: 2.6rem;
  max-height: 10rem;
}
.rl-chat-compose-hint {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  color: var(--rl-text-muted, var(--rl-muted));
}
.rl-chat-banner {
  margin: 0;
  padding: 0.32rem 0.95rem;
  font-size: 0.75rem;
  color: var(--rl-text-muted);
  background: var(--rl-surface-2);
  border-bottom: 1px solid var(--rl-border);
  flex: 0 0 auto;
}
.rl-chat-banner-officer {
  background: color-mix(in srgb, var(--rl-orange) 14%, var(--rl-surface));
  color: inherit;
}
.rl-chat-banner-wait {
  background: color-mix(in srgb, #c2410c 12%, var(--rl-surface));
  color: inherit;
  font-weight: 600;
}
.rl-copy-btn {
  margin-left: 0.25rem;
  padding: 0 0.35rem;
  border: 0;
  background: transparent;
  color: var(--rl-blue);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}
.rl-chat-side {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  min-height: 0;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 0.25rem;
}
.rl-chat-side .rl-card-pad {
  padding: 0.85rem 0.9rem;
}
.rl-ticket-context-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  margin: 0.55rem 0 0;
}
.rl-ticket-context-meta p {
  margin: 0;
  font-size: 0.78rem;
}
.rl-chat-side .rl-sidebar-card,
.rl-chat-side .rl-customer-snapshot {
  flex-shrink: 0;
}
.rl-chat-side .rl-kyc-panel {
  overflow: visible;
}
@media (max-width: 1023px) {
  body.rl-chat-page {
    height: auto;
    overflow: auto;
  }
  body.rl-chat-page .rl-app-shell,
  body.rl-chat-page .rl-main {
    height: auto;
    max-height: none;
    overflow: visible;
  }
  body.rl-chat-page .rl-content {
    overflow: visible;
    height: auto;
  }
  .rl-ticket-hero-actions {
    width: 100%;
  }
  .rl-ticket-hero-actions .rl-btn-primary,
  .rl-ticket-hero-actions .rl-btn-ghost {
    flex: 1;
    justify-content: center;
  }
  .rl-chat-workspace {
    height: auto;
    min-height: 70vh;
    overflow: visible;
    flex: none;
  }
  .rl-chat-main {
    min-height: 65vh;
    max-height: min(78vh, 720px);
    height: min(78vh, 720px);
  }
  .rl-chat-scroll {
    max-height: none;
  }
}
.rl-chat-compose-locked {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.15rem;
  border-top: 1px solid var(--rl-border);
  flex-shrink: 0;
}

.rl-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: var(--rl-blue-soft, rgba(15, 76, 129, 0.12));
  color: var(--rl-blue);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.rl-avatar-sm {
  width: 1.75rem;
  height: 1.75rem;
  font-size: 0.65rem;
}
.rl-type-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--rl-ink) 6%, transparent);
  color: var(--rl-text-muted, var(--rl-muted));
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.01em;
}
.rl-queue-customer {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}
.rl-ticket-hero {
  align-items: center;
}
.rl-face {
  display: block;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--rl-border);
  background: var(--rl-surface-2);
}
.rl-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.rl-face-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--rl-blue);
  background: var(--rl-blue-soft, rgba(15, 76, 129, 0.12));
}
.rl-toast-host {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  width: min(22rem, calc(100vw - 2rem));
  pointer-events: none;
}
.rl-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.8rem 0.9rem;
  border-radius: 12px;
  background: var(--rl-card, #fff);
  border: 1px solid var(--rl-border);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
  color: var(--rl-text);
  font-size: 0.85rem;
  line-height: 1.4;
}
.rl-toast-ok {
  border-color: rgba(15, 118, 110, 0.28);
}
.rl-toast-error {
  border-color: rgba(220, 38, 38, 0.28);
}
.rl-toast .material-symbols-outlined {
  font-size: 1.15rem;
  line-height: 1;
  color: #0f766e;
}
.rl-toast-error .material-symbols-outlined {
  color: #dc2626;
}
.rl-toast-close {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--rl-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
[data-theme="dark"] .rl-toast {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}
