/* Deskhund — base stylesheet
 * Inspired by neodat shell: dark teal+green accent, light content surface.
 */
:root {
  --rb-bg-dark: #050b14;
  --rb-bg-teal: #015451;
  --rb-bg-deep: #0a1c1b;
  --rb-bar: #0a1628;
  --rb-bar-hover: rgba(0, 182, 134, 0.15);
  --rb-green: #00b686;
  --rb-green-dim: #009972;
  --rb-text: #0f172a;
  --rb-text-soft: #475569;
  --rb-muted: #64748b;
  --rb-border: #e2e8f0;
  --rb-bg: #eef2f6;
  --rb-card: #ffffff;
  --rb-card-shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .04);
  --rb-radius: 12px;
  --rb-radius-sm: 8px;
  --rb-sidebar-w: 220px;
  --rb-sidebar-collapsed: 64px;
  --rb-header-h: 56px;
  --rb-font: "Readex Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: var(--rb-font); color: var(--rb-text); }
body { min-height: 100vh; background: var(--rb-bg); }

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
hr.rb-hr { border: 0; border-top: 1px solid var(--rb-border); margin: 16px 0; }

/* =======================  AUTH (login) screen ============================ */
.rb-auth-bg {
  background: radial-gradient(circle at 20% 10%, #0a1c1b 0%, var(--rb-bg-teal) 40%, var(--rb-bg-dark) 100%);
  color: white;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rb-auth-wrap { width: 100%; max-width: 440px; padding: 24px; }
.rb-auth-card {
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(0, 182, 134, .25);
  border-radius: 18px;
  padding: 32px;
  backdrop-filter: blur(6px);
}
.rb-auth-logo { font-size: 24px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.rb-auth-dot { color: var(--rb-green); font-size: 16px; }
.rb-auth-tagline { color: rgba(255,255,255,.6); margin: 4px 0 24px; font-size: 14px; }
.rb-auth-form { display: flex; flex-direction: column; gap: 16px; }
.rb-auth-label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: rgba(255,255,255,.8); }
.rb-auth-label input {
  width: 100%; padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #fff; color: #0f172a;
  font-size: 15px; font-family: inherit;
}
.rb-auth-label input:focus {
  outline: none;
  border-color: var(--rb-green);
  box-shadow: 0 0 0 3px rgba(0, 182, 134, .28);
}
.rb-auth-error { background: rgba(244,63,94,.18); border: 1px solid #f43f5e; padding: 10px 12px; border-radius: 10px; font-size: 13px; }
.rb-auth-error-inline { color: #fca5a5; font-size: 12px; margin-top: 4px; }
.rb-auth-hint { font-size: 12px; color: rgba(255,255,255,.55); margin-top: 16px; text-align: center; }
.rb-auth-foot { text-align: center; color: rgba(255,255,255,.4); font-size: 12px; margin-top: 16px; }
.rb-auth-title { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; margin: 16px 0 6px; color: white; }
.rb-auth-actions {
  margin-top: 22px; padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 13px; color: rgba(255,255,255,.55);
}
.rb-auth-actions form { display: inline; }
.rb-auth-sep { opacity: .5; }
.rb-link-btn {
  background: none; border: 0; padding: 0;
  color: rgba(0,182,134,.95); cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 500;
}
.rb-link-btn:hover { color: #00d09a; text-decoration: underline; }

/* OTP digit row */
.rb-otp-row {
  display: flex; gap: 12px; justify-content: center;
  margin: 8px 0 20px;
}
.rb-otp-digit {
  width: 58px; height: 68px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: white;
  font-size: 28px;
  font-weight: 700;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  text-align: center;
  outline: none;
  transition: border-color .12s, background .12s, box-shadow .12s, transform .1s;
  caret-color: var(--rb-green);
}
.rb-otp-digit:focus {
  border-color: var(--rb-green);
  background: rgba(255,255,255,0.10);
  box-shadow: 0 0 0 3px rgba(0, 182, 134, 0.28);
}
.rb-otp-digit:not(:placeholder-shown), .rb-otp-digit:valid {
  border-color: rgba(0,182,134,.5);
}
@media (max-width: 420px) {
  .rb-otp-row { gap: 8px; }
  .rb-otp-digit { width: 52px; height: 62px; font-size: 24px; }
}

/* =======================  SHELL layout =================================== */
.rb-shell {
  display: grid;
  grid-template-columns: var(--rb-sidebar-w) 1fr;
  grid-template-rows: var(--rb-header-h) 1fr;
  grid-template-areas:
    "header header"
    "sidebar main";
  min-height: 100vh;
  background: var(--rb-bg);
}
.rb-shell--collapsed { grid-template-columns: var(--rb-sidebar-collapsed) 1fr; }
.rb-shell--collapsed .rb-nav-text,
.rb-shell--collapsed .rb-nav-chev,
.rb-shell--collapsed .rb-sidebar-foot-line { display: none; }
.rb-shell--collapsed .rb-nav-item { justify-content: center; padding: 10px 0; }

/* Header */
.rb-header {
  grid-area: header;
  background: var(--rb-bar);
  color: rgba(255,255,255,.9);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  position: sticky; top: 0; z-index: 50;
}
.rb-header-left, .rb-header-right { display: flex; align-items: center; gap: 10px; }
.rb-header-search { flex: 1; max-width: 520px; margin: 0 16px; }
.rb-search-input {
  width: 100%; padding: 8px 14px; border-radius: 10px;
  background: rgba(255,255,255,.06); color: white;
  border: 1px solid rgba(255,255,255,.08); font-family: inherit; font-size: 13.5px;
}
.rb-search-input::placeholder { color: rgba(255,255,255,.45); }
.rb-search-input:focus { outline: none; background: rgba(255,255,255,.1); border-color: var(--rb-green); }

.rb-logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; color: white; }
.rb-logo-dot { color: var(--rb-green); font-size: 12px; }
.rb-logo:hover { text-decoration: none; }
.rb-sidebar-toggle, .rb-iconbtn {
  background: transparent; border: none; padding: 8px; border-radius: 8px;
  color: rgba(255,255,255,.7); cursor: pointer;
}
.rb-sidebar-toggle:hover, .rb-iconbtn:hover { background: var(--rb-bar-hover); color: white; }
.rb-iconbtn svg { width: 20px; height: 20px; }

/* Bell */
.rb-bell { position: relative; }
.rb-bell-btn { position: relative; }
.rb-bell-badge {
  position: absolute; top: 2px; right: 2px;
  background: #f43f5e; color: white;
  font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 4px;
}
.rb-bell-panel {
  position: absolute; top: calc(100% + 6px); right: 0;
  width: 340px; max-width: 90vw;
  background: white; color: var(--rb-text);
  border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.25);
  border: 1px solid var(--rb-border);
  overflow: hidden; z-index: 100;
}
.rb-bell-panel-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--rb-border); }
.rb-bell-panel-body { max-height: 360px; overflow-y: auto; }
.rb-bell-item { display: block; padding: 12px 16px; border-bottom: 1px solid var(--rb-border); }
.rb-bell-item:hover { background: #f8fafc; text-decoration: none; }
.rb-bell-item--unread { background: #f0fdf4; }
.rb-bell-item-title { display: block; font-weight: 600; font-size: 13.5px; }
.rb-bell-item-body { display: block; color: var(--rb-muted); font-size: 12.5px; margin: 2px 0; }
.rb-bell-item-time { display: block; color: var(--rb-muted); font-size: 11.5px; }
.rb-bell-empty { padding: 24px; text-align: center; color: var(--rb-muted); font-size: 13px; }
.rb-bell-panel-foot { display: block; text-align: center; padding: 10px; background: #f8fafc; color: var(--rb-green); font-weight: 600; font-size: 13px; }
.rb-link-btn { background: none; border: 0; color: var(--rb-green); cursor: pointer; font-size: 12px; }

/* User menu */
.rb-usermenu { position: relative; }
.rb-user-btn { display: flex; align-items: center; gap: 10px; background: transparent; border: 0; color: white; cursor: pointer; padding: 4px 8px; border-radius: 10px; }
.rb-user-btn:hover { background: var(--rb-bar-hover); }
.rb-user-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--rb-green);
  color: white; font-size: 12.5px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.rb-user-avatar--lg { width: 48px; height: 48px; font-size: 18px; }
.rb-user-avatar--xl { width: 72px; height: 72px; font-size: 26px; }
.rb-user-meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.rb-user-name { font-size: 13px; font-weight: 600; color: white; }
.rb-user-email { font-size: 11px; color: rgba(255,255,255,.55); }
.rb-user-panel {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 260px;
  background: white; color: var(--rb-text); border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,.25); border: 1px solid var(--rb-border);
  overflow: hidden; z-index: 100;
}
.rb-user-panel-head { display: flex; gap: 12px; align-items: center; padding: 16px; background: #f8fafc; }
.rb-user-panel-item { display: block; width: 100%; padding: 10px 16px; text-align: left; background: white; border: 0; cursor: pointer; font-size: 13.5px; font-family: inherit; }
.rb-user-panel-item:hover { background: #f1f5f9; text-decoration: none; }
.rb-user-panel-item--danger { color: #b91c1c; }

/* Sidebar */
.rb-sidebar {
  grid-area: sidebar;
  background: white;
  border-right: 1px solid var(--rb-border);
  padding: 16px 0;
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.rb-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 8px; }
.rb-nav-item, .rb-nav-group-head {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  color: var(--rb-text-soft); font-size: 13.5px; font-weight: 500;
  background: transparent; border: 0; width: 100%; text-align: left; cursor: pointer;
  font-family: inherit;
}
.rb-nav-item:hover, .rb-nav-group-head:hover { background: #f1f5f9; text-decoration: none; color: var(--rb-text); }
.rb-nav-item--active { background: #ecfdf5; color: #047857; font-weight: 600; }
.rb-nav-item--active .rb-nav-icon { color: var(--rb-green); }
.rb-nav-icon { width: 18px; height: 18px; flex: 0 0 18px; display: inline-flex; align-items: center; justify-content: center; }
.rb-nav-icon svg { width: 18px; height: 18px; }
.rb-nav-text { flex: 1; }
.rb-nav-badge { background: var(--rb-green); color: white; font-size: 11px; padding: 1px 8px; border-radius: 999px; }
.rb-nav-group { margin-top: 8px; }
.rb-nav-group-head { color: var(--rb-muted); text-transform: uppercase; font-size: 11px; letter-spacing: .05em; font-weight: 700; }
.rb-nav-chev { transition: transform .2s; }
.rb-nav-group--open .rb-nav-chev { transform: rotate(180deg); }
.rb-nav-group-items { display: none; flex-direction: column; gap: 2px; }
.rb-nav-group--open .rb-nav-group-items { display: flex; }
.rb-nav-item--sub { padding-left: 28px; }
.rb-sidebar-foot { margin-top: auto; padding: 16px; font-size: 11px; color: var(--rb-muted); }

/* Main */
.rb-main { grid-area: main; overflow-y: auto; }
.rb-main-inner { padding: 28px 28px 64px; max-width: 1400px; margin: 0 auto; }
.rb-page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.rb-page-title { font-size: 24px; font-weight: 700; margin: 0; }
.rb-page-actions { display: flex; gap: 8px; }

/* Cards */
.rb-card { background: var(--rb-card); border-radius: var(--rb-radius); padding: 20px; box-shadow: var(--rb-card-shadow); border: 1px solid var(--rb-border); }
.rb-card--link { display: block; transition: transform .15s, box-shadow .15s; }
.rb-card--link:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15,23,42,.1); text-decoration: none; }
.rb-h2 { font-size: 20px; font-weight: 700; margin: 0; }
.rb-h3 { font-size: 16px; font-weight: 700; margin: 0 0 12px; }
.rb-h4 { font-size: 14px; font-weight: 600; margin: 12px 0 6px; }
.rb-muted { color: var(--rb-muted); }
.rb-empty { padding: 32px; text-align: center; color: var(--rb-muted); }

/* Grid */
.rb-grid { display: grid; gap: 16px; }
.rb-grid--2 { grid-template-columns: 1fr 1fr; }
.rb-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rb-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rb-grid--sidebar { grid-template-columns: 280px 1fr; }
@media (max-width: 900px) {
  .rb-grid--2, .rb-grid--3, .rb-grid--4, .rb-grid--sidebar { grid-template-columns: 1fr; }
}
.rb-row { display: flex; gap: 16px; align-items: center; }
.rb-mt-2 { margin-top: 8px; } .rb-mt-3 { margin-top: 12px; } .rb-mt-6 { margin-top: 24px; }

/* Stats */
.rb-stat { background: white; border: 1px solid var(--rb-border); border-radius: 12px; padding: 18px; display: flex; gap: 14px; align-items: center; box-shadow: var(--rb-card-shadow); }
.rb-stat-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.rb-stat-icon svg { width: 22px; height: 22px; }
.rb-stat--teal .rb-stat-icon { background: #ccfbf1; color: #0f766e; }
.rb-stat--green .rb-stat-icon { background: #d1fae5; color: #047857; }
.rb-stat--amber .rb-stat-icon { background: #fef3c7; color: #b45309; }
.rb-stat--blue .rb-stat-icon { background: #dbeafe; color: #1d4ed8; }
.rb-stat-value { font-size: 24px; font-weight: 700; }
.rb-stat-label { font-size: 12.5px; color: var(--rb-muted); }

/* Buttons */
.rb-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 10px; border: 1px solid transparent; font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; background: white; color: var(--rb-text); }
.rb-btn:hover { text-decoration: none; }
.rb-btn--primary { background: var(--rb-green); color: white; }
.rb-btn--primary:hover { background: var(--rb-green-dim); }
.rb-btn--ghost { background: white; border-color: var(--rb-border); color: var(--rb-text); }
.rb-btn--ghost:hover { background: #f8fafc; }
.rb-btn--block { width: 100%; justify-content: center; }
.rb-btn--sm { padding: 5px 10px; font-size: 12.5px; }

/* Tables */
.rb-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.rb-table th, .rb-table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--rb-border); vertical-align: middle; }
.rb-table th { color: var(--rb-muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
.rb-table--hoverable tbody tr:hover { background: #f8fafc; }

/* Pills */
.rb-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: #e2e8f0; color: var(--rb-text-soft); }
.rb-pill--queued { background: #fef3c7; color: #92400e; }
.rb-pill--running { background: #bfdbfe; color: #1d4ed8; }
.rb-pill--ready { background: #dcfce7; color: #166534; }
.rb-pill--sent { background: #d1fae5; color: #047857; }
.rb-pill--error { background: #fecaca; color: #991b1b; }
.rb-pill--none { background: #e2e8f0; color: var(--rb-muted); }
.rb-pill--ok { background: #dcfce7; color: #166534; }
.rb-pill--reply { background: #d1fae5; color: #047857; }
.rb-pill--no_reply { background: #e2e8f0; color: var(--rb-text-soft); }
.rb-pill--needs_review { background: #fef3c7; color: #92400e; }
.rb-pill--pending { background: #e2e8f0; color: var(--rb-muted); }
.rb-pill--fetching { background: #bfdbfe; color: #1d4ed8; }
.rb-pill--classifying { background: #c7d2fe; color: #4338ca; }
.rb-pill--pairing { background: #ddd6fe; color: #6d28d9; }
.rb-pill--training { background: #fbcfe8; color: #9d174d; }
.rb-pill--drafting { background: #fed7aa; color: #9a3412; }
.rb-mb-6 { margin-bottom: 24px; }
.rb-mb-0 { margin-bottom: 0; }
.rb-row--space { justify-content: space-between; }

/* ---- Tickets list ---- */
.rb-tickets { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.rb-ticket {
  display: grid;
  grid-template-columns: 180px 1fr 80px;
  gap: 16px; padding: 14px 16px;
  border: 1px solid var(--rb-border); border-radius: 10px;
  background: white; transition: border-color .15s, transform .1s;
}
.rb-ticket:hover { text-decoration: none; border-color: var(--rb-green); box-shadow: 0 2px 8px rgba(0,182,134,.08); }
.rb-ticket-status { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.rb-ticket-main { min-width: 0; }
.rb-ticket-subject { font-weight: 600; font-size: 14px; color: var(--rb-text); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; }
.rb-ticket-meta { font-size: 12.5px; color: var(--rb-text-soft); display: flex; gap: 6px; flex-wrap: wrap; }
.rb-ticket-from { color: var(--rb-text); }
.rb-ticket-reason { font-size: 12px; color: var(--rb-muted); margin-top: 6px; font-style: italic; }
.rb-ticket-time { font-size: 12.5px; text-align: right; }
.rb-ticket--open { border-left: 4px solid var(--rb-green); }
.rb-ticket--review { border-left: 4px solid #f59e0b; }
.rb-ticket--unclassified { border-left: 4px solid #94a3b8; }
.rb-ticket--no_action { border-left: 4px solid #cbd5e1; opacity: 0.75; }
.rb-ticket--replied { border-left: 4px solid #10b981; opacity: 0.85; }

.rb-status-filter li a { display: block; padding: 6px 10px; border-radius: 6px; font-size: 13px; }
.rb-status-filter li a:hover { background: #f1f5f9; text-decoration: none; }
.rb-status-filter li a.rb-active { background: #ecfdf5; color: #047857; font-weight: 600; }

/* ---- Ticket detail (conversation) ---- */
.rb-grid--ticket { grid-template-columns: minmax(0, 1fr) 460px; gap: 16px; }
@media (max-width: 1280px) { .rb-grid--ticket { grid-template-columns: minmax(0, 1fr) 400px; } }
@media (max-width: 1050px) { .rb-grid--ticket { grid-template-columns: 1fr; } }

.rb-meta-strip {
  display: flex; flex-wrap: wrap; gap: 16px 24px;
  font-size: 12.5px;
}
.rb-meta-strip > div { min-width: 0; }
.rb-meta-strip strong { word-break: break-word; }
.rb-meta-label {
  display: block; color: var(--rb-muted); text-transform: uppercase;
  font-size: 10.5px; font-weight: 600; letter-spacing: .04em; margin-bottom: 2px;
}

.rb-conversation { padding: 16px 18px; }
.rb-conversation .rb-h3 { font-size: 14px; margin-bottom: 10px; }
.rb-timeline { display: flex; flex-direction: column; gap: 10px; }
.rb-msg {
  border-radius: 10px; padding: 10px 14px;
  border: 1px solid var(--rb-border); background: white;
}
.rb-msg--in { background: #f8fafc; border-color: #cbd5e1; }
.rb-msg--out { background: #ecfdf5; border-color: #a7f3d0; margin-left: 24px; }
.rb-msg--highlight { box-shadow: 0 0 0 2px rgba(0,182,134,.35); border-color: var(--rb-green); }

.rb-msg-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 6px; }
.rb-msg-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex: 0 0 28px;
}
.rb-msg-avatar--in { background: #e0f2fe; }
.rb-msg-avatar--out { background: #d1fae5; }
.rb-msg-meta { flex: 1; min-width: 0; }
.rb-msg-from { font-size: 12.5px; color: var(--rb-text); word-break: break-word; }
.rb-msg-out-label { color: #047857; }
.rb-msg-time { font-size: 11px; color: var(--rb-muted); margin-top: 2px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.rb-msg-subject { font-size: 11.5px; color: var(--rb-muted); margin-top: 2px; }
.rb-msg-body { font-size: 13px; }
.rb-msg-text {
  white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere;
  background: transparent; padding: 0; margin: 0;
  font-family: inherit; font-size: 13px; line-height: 1.45;
}
.rb-msg-html { font-size: 13px; word-wrap: break-word; overflow-wrap: anywhere; }

/* ---- AI panel ---- */
.rb-ai-panel { position: sticky; top: 72px; align-self: flex-start; padding: 16px 18px; }
.rb-ai-panel .rb-h3 { font-size: 14px; margin-bottom: 8px; }
.rb-ai-verdict { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; margin-bottom: 8px; }
.rb-ai-reason {
  margin: 8px 0 10px; padding: 8px 10px; background: #f8fafc;
  border-radius: 6px; font-size: 12px; color: var(--rb-text-soft);
  border-left: 3px solid var(--rb-green); line-height: 1.4;
}
.rb-ai-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.rb-ai-panel .rb-textarea { font-size: 13px; line-height: 1.45; }

/* Badges */
.rb-badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; background: #e2e8f0; color: var(--rb-text-soft); margin-right: 4px; }
.rb-badge--admin { background: #dcfce7; color: #047857; }
.rb-badge--super { background: #fde68a; color: #92400e; }

/* Forms */
.rb-form { display: flex; flex-direction: column; gap: 12px; }
.rb-form--wide { gap: 16px; }
.rb-form--inline { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
.rb-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.rb-form label > span { color: var(--rb-text-soft); font-weight: 500; }
.rb-form input[type=text], .rb-form input[type=email], .rb-form input[type=password], .rb-form input[type=number], .rb-form input[type=search], .rb-form select, .rb-form textarea, .rb-form-row input, .rb-textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--rb-border); border-radius: 8px;
  background: white; color: var(--rb-text); font-family: inherit; font-size: 13.5px;
}
.rb-form input:focus, .rb-form select:focus, .rb-form textarea:focus, .rb-textarea:focus {
  outline: none; border-color: var(--rb-green); box-shadow: 0 0 0 3px rgba(0,182,134,.2);
}
.rb-form fieldset { border: 1px solid var(--rb-border); border-radius: 12px; padding: 16px; }
.rb-form legend { font-weight: 700; color: var(--rb-text-soft); padding: 0 8px; }
.rb-form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.rb-form-actions { display: flex; gap: 8px; justify-content: flex-end; }
.rb-check { flex-direction: row !important; align-items: center; gap: 8px; }
.rb-check input { width: auto !important; }
.rb-textarea { min-height: 120px; resize: vertical; }

/* DLs */
.rb-dl { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 13.5px; margin: 0; }
.rb-dl dt { color: var(--rb-muted); }
.rb-dl dd { margin: 0; }

/* List */
.rb-list { padding: 0; margin: 0; list-style: none; }
.rb-list--clean li { padding: 6px 0; }
.rb-list--divided li { padding: 8px 0; border-bottom: 1px solid var(--rb-border); }
.rb-list--divided li:last-child { border-bottom: 0; }
.rb-active { color: var(--rb-green); font-weight: 600; }
.rb-list-item--unread { font-weight: 600; }
.rb-pre { background: #f1f5f9; padding: 12px; border-radius: 8px; overflow-x: auto; white-space: pre-wrap; font-size: 12.5px; }
.rb-html-body { background: white; padding: 12px; border: 1px solid var(--rb-border); border-radius: 8px; }
.rb-alert { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-top: 8px; }
.rb-alert--error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.rb-alert--success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }

/* Toasts */
.rb-toast-stack { position: fixed; top: 80px; right: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 999; }
.rb-toast { background: white; padding: 12px 36px 12px 14px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.15); font-size: 13.5px; position: relative; border-left: 4px solid var(--rb-green); min-width: 260px; }
.rb-toast--error { border-left-color: #f43f5e; }
.rb-toast--warning { border-left-color: #f59e0b; }
.rb-toast-close { position: absolute; right: 6px; top: 4px; background: none; border: 0; cursor: pointer; font-size: 18px; color: var(--rb-muted); }

/* Mobile */
.rb-mob-only { display: none; }
.rb-mob-overlay { display: none; }
@media (max-width: 800px) {
  .rb-shell { grid-template-columns: 1fr; grid-template-areas: "header" "main"; }
  .rb-sidebar { position: fixed; top: var(--rb-header-h); left: 0; bottom: 0; width: 260px; transform: translateX(-100%); transition: transform .25s; z-index: 80; }
  .rb-shell--mob-open .rb-sidebar { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .rb-shell--mob-open .rb-mob-overlay { display: block; position: fixed; inset: var(--rb-header-h) 0 0 0; background: rgba(0,0,0,.4); z-index: 70; }
  .rb-mob-only { display: inline-flex; }
  .rb-desk-only { display: none !important; }
  .rb-header-search { display: none; }
  .rb-main-inner { padding: 16px; }
}
