@import url('https://fonts.googleapis.com/css2?family=Assistant:wght@300;400;500;600;700;800&display=swap');

/* ==========================================================================
   "הבית" , Design System / system.css
   שכבת היסוד: משתנים, reset, טיפוגרפיה, בסיס.
   פילוסופיה: נייר חם, דיו רך, סגול-מגנטה וטורקיז המותג. בית ולא דאשבורד.
   ========================================================================== */

:root {
  /* ---------- נייר ורקעים (warm paper) ---------- */
  --bg:            #FAF6F0;   /* רקע האפליקציה, שמנת חמה */
  --bg-deep:       #F2EBE1;   /* רקע שקוע, מאחורי כרטיסים */
  --surface:       #FFFDFA;   /* משטח ראשי (כרטיס) */
  --surface-2:     #F7F1E9;   /* משטח משני, כותרות טבלה */
  --surface-3:     #EFE7DB;   /* משטח שלישי, hover עדין */
  --overlay:       rgba(43, 34, 28, 0.42);

  /* ---------- דיו (warm ink) ---------- */
  --ink:           #2A231E;   /* טקסט ראשי, 13.9:1 על הרקע */
  --ink-2:         #574B42;   /* טקסט משני, 7.8:1 */
  --ink-3:         #7A6C60;   /* טקסט עמום, 4.7:1 (AA) */
  --ink-4:         #A2948700; /* שמור */
  --ink-soft:      #96877A;   /* לייבלים גדולים בלבד */
  --ink-invert:    #FFFDFA;

  /* ---------- קווים ---------- */
  --line:          #E7DCCC;   /* גבול רגיל */
  --line-2:        #DACDB9;   /* גבול מודגש */
  --line-soft:     #F0E8DC;   /* מפריד פנימי */

  /* ---------- אקסנט ראשי: סגול-מגנטה של המותג (מהלוגו #64235B) ---------- */
  --accent:        #64235B;   /* צבע מותג ישיר, 10.9:1 על לבן */
  --accent-deep:   #451A40;
  --accent-hover:  #7C2E71;   /* 8.1:1 עם טקסט לבן */
  --accent-ink:    #4A1A44;   /* טקסט סגול קריא, 12.8:1 */
  --accent-soft:   #F7EAF1;   /* רקע רך */
  --accent-soft-2: #EFD3E4;
  --accent-line:   #D9A9C4;

  /* ---------- אקסנט משני רשמי: טורקיז המותג (מהלוגו #01AAA7) ----------
     תופס את תפקיד ה"זהב" הישן בקומפוננטות (כפתור/תגית/סטטיסטיקה/עמודת
     קנבן/מד/ציר-זמן "gold"): כפתורים משניים, תגיות, גרפים, הדגשות.
     --gold עצמו נשאר לרכיבים גרפיים בלבד (נקודות, גרדיאנטים) - לא לטקסט. */
  --gold:          #01AAA7;   /* צבע מותג ישיר - לא עומד ב-AA לטקסט קטן! */
  --gold-deep:     #015F5D;   /* טורקיז כהה קריא לטקסט, 7.5:1 על לבן */
  --gold-soft:     #E3F5F4;
  --gold-soft-2:   #CBEBE9;
  --gold-line:     #9AD6D3;

  /* ---------- זהב, תפקיד שלישי עדין: נגיעות בלבד (eyebrow) ---------- */
  --gold-touch:      #B0812F;
  --gold-touch-deep: #7C5819;

  /* ---------- מצבים ---------- */
  --ok:            #376B4B;
  --ok-soft:       #E9F3EC;
  --ok-line:       #BFDCC9;

  --warn:          #8C5C16;
  --warn-soft:     #FCF0DC;
  --warn-line:     #E8CE9F;

  --danger:        #A8443F;
  --danger-deep:   #8B3530;
  --danger-soft:   #FBEBE9;
  --danger-line:   #EFC9C5;

  --info:          #3C6180;
  --info-soft:     #EAF1F6;
  --info-line:     #C4D6E3;

  /* ---------- אפרפר-תכלת עדין: תגית "דיוור בלבד" ותפקידים דומים (עדין ומרוחק, לא סטטוס) ---------- */
  --slate:         #55707E;
  --slate-soft:    #EEF3F4;
  --slate-line:    #CBDBE0;

  /* ---------- טיפוגרפיה ---------- */
  --font:          'Assistant', -apple-system, 'Segoe UI', system-ui, sans-serif;
  --font-display:  'Assistant', -apple-system, 'Segoe UI', system-ui, sans-serif;

  --fs-xs:   0.75rem;    /* 12 */
  --fs-sm:   0.8125rem;  /* 13 */
  --fs-base: 0.9375rem;  /* 15 */
  --fs-md:   1rem;       /* 16 */
  --fs-lg:   1.125rem;   /* 18 */
  --fs-xl:   1.375rem;   /* 22 */
  --fs-2xl:  1.75rem;    /* 28 */
  --fs-3xl:  2.25rem;    /* 36 */

  --lh-tight: 1.25;
  --lh-base:  1.6;
  --lh-loose: 1.75;

  --fw-light: 300;
  --fw-reg:   400;
  --fw-med:   500;
  --fw-semi:  600;
  --fw-bold:  700;

  /* ---------- ריווח (4px base) ---------- */
  --sp-1:  0.25rem;
  --sp-2:  0.5rem;
  --sp-3:  0.75rem;
  --sp-4:  1rem;
  --sp-5:  1.25rem;
  --sp-6:  1.5rem;
  --sp-7:  2rem;
  --sp-8:  2.5rem;
  --sp-9:  3rem;
  --sp-10: 4rem;

  /* ---------- רדיוסים ---------- */
  --r-xs:   6px;
  --r-sm:   10px;
  --r-md:   14px;
  --r-lg:   18px;
  --r-xl:   24px;
  --r-2xl:  32px;
  --r-pill: 999px;

  /* ---------- צללים (חמים, לא אפורים) ---------- */
  --sh-xs: 0 1px 2px rgba(74, 53, 34, 0.05);
  --sh-sm: 0 1px 2px rgba(74, 53, 34, 0.05), 0 2px 6px rgba(74, 53, 34, 0.04);
  --sh-md: 0 2px 4px rgba(74, 53, 34, 0.05), 0 6px 16px rgba(74, 53, 34, 0.06);
  --sh-lg: 0 4px 10px rgba(74, 53, 34, 0.06), 0 16px 36px rgba(74, 53, 34, 0.09);
  --sh-xl: 0 8px 20px rgba(74, 53, 34, 0.08), 0 32px 64px rgba(74, 53, 34, 0.12);
  --sh-inset: inset 0 1px 0 rgba(255, 255, 255, 0.7);

  /* ---------- טבעת פוקוס ---------- */
  --ring: 0 0 0 3px rgba(100, 35, 91, 0.28);
  --ring-danger: 0 0 0 3px rgba(168, 68, 63, 0.26);

  /* ---------- מידות מערכת ---------- */
  --sidebar-w:  248px;
  --topbar-h:   68px;
  --tabbar-h:   66px;
  --tap:        44px;      /* גודל מגע מינימלי */
  --content-max: 1560px;

  /* ---------- זמנים (רק לתגובת אינטראקציה) ---------- */
  --t-fast: 120ms;
  --t-base: 180ms;
  --t-slow: 260ms;
  --ease:   cubic-bezier(0.32, 0.72, 0.35, 1);
}

/* ---------- הכנה ל-dark mode עתידי (לא מופעל כברירת מחדל) ----------
   כדי להפעיל בעתיד: הוסף data-theme="dark" ל-<html>. */
[data-theme="dark"] {
  --bg:        #1B1714;
  --bg-deep:   #14110F;
  --surface:   #241F1B;
  --surface-2: #2C2621;
  --surface-3: #352E27;
  --ink:       #F4EDE4;
  --ink-2:     #CBBFB2;
  --ink-3:     #A2948A;
  --ink-soft:  #8A7C71;
  --ink-invert:#1B1714;
  --line:      #3A322B;
  --line-2:    #4A4039;
  --line-soft: #302923;
  --accent:      #D98FC4;
  --accent-ink:  #E0AED0;
  --accent-soft: #35222E;
  --accent-soft-2:#452C3C;
  --accent-line: #5A3A4E;
  --gold-soft:   #16302E;
  --ok-soft:     #1E2B23;
  --danger-soft: #33201E;
  --info-soft:   #1C2731;
  --slate-soft:  #1E282B;
  --overlay:     rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   Reset
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd,
ul, ol, fieldset, legend, pre {
  margin: 0;
  padding: 0;
}

ul[class], ol[class] { list-style: none; }

body {
  direction: rtl;
  font-family: var(--font);
  font-size: var(--fs-base);
  font-weight: var(--fw-reg);
  line-height: var(--lh-base);
  color: var(--ink);
  background-color: var(--bg);
  /* רקע סטטי לחלוטין: שכבת "נייר" עדינה, בלי שום תנועה */
  background-image:
    radial-gradient(1200px 620px at 100% -8%, rgba(100, 35, 91, 0.055), transparent 62%),
    radial-gradient(900px 520px at -10% 8%, rgba(1, 170, 167, 0.05), transparent 60%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
  direction: rtl;
}

button { background: none; border: 0; cursor: pointer; }

table { border-collapse: collapse; border-spacing: 0; width: 100%; }

hr {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: var(--sp-6) 0;
}

::selection { background: var(--accent-soft-2); color: var(--accent-deep); }

/* ==========================================================================
   טיפוגרפיה
   ========================================================================== */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: var(--lh-tight);
  color: var(--ink);
  letter-spacing: -0.01em;
}

h4, h5, h6 {
  font-family: var(--font);
  font-weight: var(--fw-semi);
  line-height: 1.35;
  color: var(--ink);
}

h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
h5 { font-size: var(--fs-md); }
h6 { font-size: var(--fs-base); }

@media (max-width: 640px) {
  h1 { font-size: var(--fs-2xl); }
  h2 { font-size: var(--fs-xl); }
  h3 { font-size: var(--fs-lg); }
}

p { line-height: var(--lh-loose); }
p + p { margin-top: var(--sp-3); }

small, .text-sm { font-size: var(--fs-sm); }
.text-xs  { font-size: var(--fs-xs); }
.text-lg  { font-size: var(--fs-lg); }
.text-muted  { color: var(--ink-3); }
.text-soft   { color: var(--ink-2); }
.text-accent { color: var(--accent-ink); }
.text-ok     { color: var(--ok); }
.text-danger { color: var(--danger); }
.text-center { text-align: center; }
.text-start  { text-align: start; }
.text-end    { text-align: end; }
.nums { font-variant-numeric: tabular-nums lining-nums; }

/* כותרת-על קטנה (eyebrow) */
.eyebrow {
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: 0.09em;
  color: var(--gold-touch-deep);
  text-transform: none;
}

.display {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
}

a {
  color: var(--accent-ink);
  text-decoration: none;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color var(--t-fast) var(--ease);
}
a:hover { color: var(--accent-hover); text-decoration: underline; }

strong, b { font-weight: var(--fw-semi); }

code, kbd, pre {
  font-family: 'SFMono-Regular', ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.875em;
  direction: ltr;
  unicode-bidi: isolate;
}
code {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  padding: 0.1em 0.4em;
  color: var(--accent-deep);
}

/* ==========================================================================
   פוקוס נגיש , נראה תמיד, גם במקלדת בלבד
   ========================================================================== */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}
.js-focus-ring:focus-visible { outline: none; box-shadow: var(--ring); }

/* דילוג לתוכן */
.skip-link {
  position: absolute;
  inset-inline-start: var(--sp-4);
  top: -100px;
  z-index: 999;
  background: var(--accent);
  color: var(--ink-invert);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-sm);
  box-shadow: var(--sh-lg);
}
.skip-link:focus { top: var(--sp-4); }

/* ==========================================================================
   עזרי פריסה בסיסיים
   ========================================================================== */

.stack   { display: flex; flex-direction: column; gap: var(--sp-4); }
.stack-2 { display: flex; flex-direction: column; gap: var(--sp-2); }
.stack-6 { display: flex; flex-direction: column; gap: var(--sp-6); }
.row     { display: flex; align-items: center; gap: var(--sp-3); }
.row-wrap{ display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.spread  { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); }
.grow    { flex: 1 1 auto; min-width: 0; }
.center  { display: flex; align-items: center; justify-content: center; }

.grid { display: grid; gap: var(--sp-4); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.hide      { display: none !important; }
.only-mobile  { display: none; }
@media (max-width: 860px) {
  .only-desktop { display: none !important; }
  .only-mobile  { display: revert; }
}

.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;
}

/* טקסט LTR בתוך הקשר RTL (מיילים, טלפונים, שעות) - למנוע היפוך בידי */
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* פס גלילה עדין וחם */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: var(--r-pill);
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--ink-soft); background-clip: content-box; }

/* כיבוד העדפת הפחתת תנועה */
@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;
  }
}
