/* base.css - Reset, fonts, typography, RTL foundations
   Owner: SHELL agent. Do not edit shared/other-owned files.
   Foundations only. Styled components live in components.css, chrome in shell.css. */

/* ---------- Rubik (local woff2, variable weight 300-700, hebrew + latin) ---------- */
@font-face {
  font-family: "Rubik";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/rubik-hebrew.woff2") format("woff2");
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
@font-face {
  font-family: "Rubik";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/rubik-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Rubik";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/rubik-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html, body { height: 100%; }

html {
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern" 1;
  text-rendering: optimizeLegibility;
  overflow: hidden; /* app shell manages its own scroll regions */
}

img, svg, video, canvas { display: block; max-width: 100%; }
svg { fill: none; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}
button { background: none; border: none; cursor: pointer; }
button:disabled { cursor: default; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

ul, ol { list-style: none; padding: 0; }

/* Remove native number spinners for cleaner amount fields */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

/* ---------- Typography scale ---------- */
h1, .t-h1 { font-size: 24px; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
h2, .t-section { font-size: 17px; font-weight: 600; line-height: 1.3; }
h3 { font-size: 15px; font-weight: 600; line-height: 1.35; }
.t-body { font-size: 14.5px; font-weight: 400; line-height: 1.6; }
.t-secondary { font-size: 13px; font-weight: 400; color: var(--ink-2); line-height: 1.55; }
.t-muted { color: var(--muted); }
small, .t-small { font-size: 12.5px; }

/* Dashboard metric numbers */
.t-num {
  font-size: 30px;
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* Numeric alignment for tables, amounts, counters */
.tnum, .table td.tnum, .table th.tnum { font-variant-numeric: tabular-nums; }

strong, b { font-weight: 600; }

/* ---------- RTL foundations ---------- */
:root { direction: rtl; }
[dir="ltr"] { direction: ltr; }

/* Isolate numbers, phones, amounts and dates embedded in Hebrew text */
.ltr, .num-ltr {
  unicode-bidi: isolate;
  direction: ltr;
  display: inline-block;
}

/* ---------- Focus visibility ---------- */
:focus { outline: none; }
:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--r-sm);
}

/* ---------- Selection ---------- */
::selection { background: var(--accent-soft); color: var(--ink); }

/* ---------- Scrollbars (subtle) ---------- */
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--r-full);
  border: 3px solid var(--bg);
}
*::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--muted) 50%, var(--border)); }

/* ---------- Utilities ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[hidden] { display: none !important; }

.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.spacer { flex: 1 1 auto; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
