/*
 * RAFEEQ dashboard — base. Element defaults and the few helpers every page uses.
 *
 * 🔴 Logical properties only (inline-start / inline-end, never left / right): the same
 * stylesheet draws English left-to-right and Arabic right-to-left. A physical property
 * here is an RTL bug waiting to be found.
 */

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

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

body.ad-body {
  background: var(--bg-page);
  color: var(--fg-default);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

/*
 * Font only, and at zero specificity (:where): anything stronger here would outrank every
 * component's own weight, size and colour.
 */
:where(body.ad-body) :where(button, input, select, textarea) {
  font: inherit;
}

body.ad-body a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

[x-cloak] {
  display: none !important;
}

/* Numbers line up in columns. Digits stay Western in Arabic too, as in the design. */
.ad-num {
  font-variant-numeric: tabular-nums;
}

.ad-mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

/* Visible to screen readers only. */
.ad-sr {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Arrows and chevrons point the reading direction. */
[dir='rtl'] .ad-flip {
  transform: scaleX(-1);
}

.ad-ic {
  flex: none;
}

.ad-muted {
  color: var(--fg-muted);
}

.ad-subtle {
  color: var(--fg-subtle);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}
