/* ============================================================
   RTL + Hebrew overlay — ADDITIVE, loaded AFTER brand.css.
   Keeps brand.css portable (no edits to its internals).
   Scope: html[dir="rtl"]. Flips the kit's physical L/R props.
   ============================================================ */

html[dir="rtl"] body {
  font-family: "Heebo", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Sidebar sits on the right in RTL */
html[dir="rtl"] .sidebar {
  border-right: none;
  border-left: 1px solid var(--line);
}

/* Collapse toggle mirrors to the right edge of the sidebar */
html[dir="rtl"] .sidebar-toggle {
  left: auto;
  right: 224px;
}
html[dir="rtl"].sidebar-collapsed .sidebar-toggle {
  left: auto;
  right: 40px;
}
html[dir="rtl"] .sidebar-toggle svg { transform: rotate(180deg); }
html[dir="rtl"].sidebar-collapsed .sidebar-toggle svg { transform: rotate(0deg); }

/* Collapsed active indicator on the inline-end edge */
html[dir="rtl"].sidebar-collapsed .sidebar .nav-item.active {
  box-shadow: inset -3px 0 0 var(--brand-primary);
}

/* Collapsed hover tooltip flips to the left of the rail */
html[dir="rtl"].sidebar-collapsed .sidebar .nav-item[data-tip]::after {
  left: auto;
  right: calc(100% + 8px);
}

/* nav-item count badge */
html[dir="rtl"] .sidebar .nav-item .count {
  margin-left: 0;
  margin-right: auto;
}

/* Header brand partner divider */
html[dir="rtl"] .app-header .brand .partner {
  border-left: none;
  border-right: 1px solid var(--line);
  padding-left: 0;
  padding-right: 12px;
  margin-left: 0;
  margin-right: 4px;
}
html[dir="rtl"] .wordmark .ai { margin-left: 0; margin-right: 2px; }

/* Forms */
html[dir="rtl"] label.field-label .req { margin-left: 0; margin-right: 2px; }

/* Topbar search kbd hint + user chip padding mirror */
html[dir="rtl"] .search-trigger .kbd { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .user-chip { padding: 4px 4px 4px 12px; }

/* Data tables read right-aligned in RTL */
html[dir="rtl"] table th,
html[dir="rtl"] table td { text-align: right; }
