/* ============================================================
   SEO Center — מערכת עיצוב
   ------------------------------------------------------------
   סגול בהיר על רקע בהיר, כרטיסים לבנים, Arial, מימין לשמאל.
   כל צבע, מרווח ורדיוס מוגדר כמשתנה אחד ומשמש בכל המערכת.
   ============================================================ */

/* ---------------------------------------------- 1. משתנים */

:root {
    --violet-50:  #f8f6fd;
    --violet-100: #f0ebfb;
    --violet-150: #e7dffa;
    --violet-200: #ddd2f6;
    --violet-300: #c3b0ee;
    --violet-400: #a084e4;
    --violet-500: #7c4dff;
    --violet-600: #6a3ae0;
    --violet-700: #542eb4;
    --violet-900: #34206e;

    --ink:       #241f31;
    --ink-soft:  #463d5c;
    --ink-muted: #7a7190;
    --line:      #ece7f6;
    --line-soft: #f4f1fa;
    --surface:   #ffffff;
    --canvas:    #f7f5fb;

    /* צבעי סטטוס. לעולם לא לבד: תמיד עם טקסט או אייקון לצידם. */
    --ok:      #1e8a5a;  --ok-bg:   #eff9f4;  --ok-line:   #c6e7d6;
    --warn:    #a86a04;  --warn-bg: #fdf7eb;  --warn-line: #f0dcb4;
    --bad:     #b3283c;  --bad-bg:  #fdf1f3;  --bad-line:  #f2c8d0;
    --none:    #8b8398;  --none-bg: #f5f4f8;  --none-line: #e6e3ed;

    --radius:    14px;
    --radius-sm: 9px;
    --radius-xs: 6px;

    --shadow:    0 1px 3px rgba(60, 40, 110, .07), 0 6px 18px rgba(60, 40, 110, .05);
    --shadow-lg: 0 8px 28px rgba(52, 32, 110, .16);

    --sidebar-w: 248px;
    --topbar-h:  62px;

    --ease: .16s ease;
}

/* ------------------------------------------------ 2. בסיס */

* { box-sizing: border-box; }

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

body {
    margin: 0;
    font-family: Arial, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.65;
    color: var(--ink);
    background: var(--canvas);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: bold; letter-spacing: -.2px; }

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

p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }

.muted { color: var(--ink-muted); }
.small { font-size: 13px; }
.tiny  { font-size: 12px; }
.mt    { margin-top: 18px; }
.mt-sm { margin-top: 10px; }
.nowrap { white-space: nowrap; }

hr { border: none; border-top: 1px solid var(--line); margin: 18px 0; }

/* טקסט שאינו עברית: קוד, כתובות, מזהים.
   isolate מונע מסימני פיסוק וסוגריים להתהפך בתוך משפט עברי. */
code, pre, .ltr {
    direction: ltr;
    unicode-bidi: isolate;
    text-align: left;
}

code {
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    background: var(--violet-50);
    border: 1px solid var(--line);
    border-radius: var(--radius-xs);
    padding: 1px 7px;
    display: inline-block;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.icon { flex: 0 0 auto; vertical-align: -.16em; }

/* ------------------------------------- 3. פריסת האפליקציה */

.app { display: flex; min-height: 100vh; }

/* בעברית הסרגל יושב מימין. flex מסדר לפי כיוון הכתיבה, ולכן
   האלמנט הראשון ב-HTML הוא זה שמופיע בצד ימין. */
.sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background: var(--violet-50);
    /* הסרגל יושב מימין, ולכן הקו המפריד הוא בקצה הפנימי שלו, לכיוון התוכן */
    border-inline-end: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    transition: width var(--ease), flex-basis var(--ease);
}

.sidebar-head {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 15px 18px;
    min-height: var(--topbar-h);
    border-bottom: 1px solid var(--line);
}

.brand-mark {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 11px;
    background: linear-gradient(140deg, var(--violet-500), var(--violet-700));
    color: #fff;
    font-weight: bold;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: .5px;
    direction: ltr;
    text-decoration: none;
}

.brand-mark:hover { text-decoration: none; }

.brand-name { font-size: 15.5px; font-weight: bold; color: var(--violet-900); }
.brand-sub  { font-size: 11.5px; color: var(--ink-muted); margin-top: -3px; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 10px 20px; }

.nav-group { margin-bottom: 16px; }

.nav-group-title {
    font-size: 11.5px;
    font-weight: bold;
    color: var(--ink-muted);
    letter-spacing: .3px;
    padding: 0 10px 5px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--ink-soft);
    font-size: 14px;
    margin-bottom: 1px;
    transition: background var(--ease), color var(--ease);
}

.nav-item:hover { background: var(--violet-100); text-decoration: none; color: var(--violet-900); }

.nav-item.is-active {
    background: var(--violet-500);
    color: #fff;
    font-weight: bold;
}

.nav-item.is-active:hover { background: var(--violet-600); color: #fff; }

/* פריט שעוד לא נבנה: מוצג כדי שמבנה המערכת יהיה גלוי, אך אינו קישור */
.nav-item.is-soon { color: var(--ink-muted); opacity: .62; cursor: default; }
.nav-item.is-soon:hover { background: transparent; color: var(--ink-muted); }

.nav-soon-tag {
    margin-inline-start: auto;
    font-size: 10.5px;
    background: var(--violet-150);
    color: var(--violet-700);
    border-radius: 999px;
    padding: 1px 8px;
    font-weight: normal;
}

.sidebar-foot {
    padding: 12px 16px;
    border-top: 1px solid var(--line);
    font-size: 12px;
    color: var(--ink-muted);
}

/* סרגל מקופל: אייקונים בלבד */
.app.is-collapsed .sidebar { width: 64px; flex-basis: 64px; }
.app.is-collapsed .brand-name,
.app.is-collapsed .brand-sub,
.app.is-collapsed .nav-group-title,
.app.is-collapsed .nav-item span,
.app.is-collapsed .nav-soon-tag,
.app.is-collapsed .sidebar-foot { display: none; }
.app.is-collapsed .nav-item { justify-content: center; padding: 10px; }
.app.is-collapsed .sidebar-head { justify-content: center; padding: 12px; }

/* ---- אזור התוכן ---- */

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 40;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: transparent;
    color: var(--ink-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--ease);
}

.icon-btn:hover { background: var(--violet-100); color: var(--violet-700); }

.topbar-title { font-size: 16px; font-weight: bold; }
.topbar-spacer { flex: 1; }

.client-picker {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--violet-50);
    border: 1px solid var(--violet-200);
    border-radius: var(--radius-sm);
    padding: 5px 12px;
    font-size: 13.5px;
    color: var(--violet-900);
}

.content { padding: 22px; max-width: 1280px; width: 100%; }

.page-head { margin-bottom: 18px; }
.page-head h1 { font-size: 22px; }
.page-head .lead { color: var(--ink-muted); font-size: 14px; margin-top: 3px; }

/* פתיח מקופל שמסביר מה רואים במסך (אפיון 6.29) */
.screen-intro {
    background: var(--violet-100);
    border: 1px solid var(--violet-200);
    border-radius: var(--radius);
    padding: 13px 17px;
    margin-bottom: 18px;
    font-size: 14px;
    color: var(--violet-900);
}

.screen-intro summary {
    cursor: pointer;
    font-weight: bold;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.screen-intro summary::-webkit-details-marker { display: none; }
.screen-intro[open] summary { margin-bottom: 8px; }
.screen-intro p { color: var(--violet-900); opacity: .92; }

/* ------------------------------------------- 4. כרטיסים */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-pad { padding: 20px 22px; }

.card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--line);
}

.card-head h2 { font-size: 15.5px; color: var(--violet-900); }
.card-head .spacer { flex: 1; }

.h-sub { font-size: 16px; margin: 0 0 8px; color: var(--violet-900); }

.grid { display: grid; gap: 16px; }
.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)); }

/* ------------------------------------------- 5. כפתורים */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: var(--violet-500);
    color: #fff;
    border: 1px solid var(--violet-600);
    border-radius: var(--radius-sm);
    padding: 9px 18px;
    font-family: inherit;
    font-size: 14.5px;
    line-height: 1.3;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--ease), box-shadow var(--ease);
}

.btn:hover  { background: var(--violet-600); text-decoration: none; color: #fff; }
.btn:active { background: var(--violet-700); }
.btn:focus-visible { outline: 3px solid var(--violet-200); outline-offset: 1px; }

.btn[disabled], .btn.is-disabled {
    background: var(--none-bg);
    color: var(--ink-muted);
    border-color: var(--none-line);
    cursor: not-allowed;
}

.btn-ghost {
    background: var(--surface);
    color: var(--violet-700);
    border-color: var(--violet-200);
}
.btn-ghost:hover { background: var(--violet-50); color: var(--violet-700); }

.btn-quiet {
    background: transparent;
    color: var(--ink-soft);
    border-color: transparent;
}
.btn-quiet:hover { background: var(--violet-100); color: var(--violet-700); }

.btn-danger { background: var(--bad); border-color: #9c2234; }
.btn-danger:hover { background: #9c2234; }

.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-block { width: 100%; }

.btn-row { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }

/* שורת פעולות מהירות בראש לוח הבקרה */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 18px;
}

/* ---------------------------------------------- 6. טפסים */

.field { margin-bottom: 15px; }

.field label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    font-weight: bold;
    color: var(--ink-soft);
    margin-bottom: 5px;
}

.field .hint { font-size: 12.5px; color: var(--ink-muted); margin-top: 4px; font-weight: normal; }

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="url"], input[type="search"],
input[type="date"], select, textarea {
    width: 100%;
    font-family: inherit;
    font-size: 14.5px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--violet-200);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    transition: border-color var(--ease), box-shadow var(--ease);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--violet-400);
    box-shadow: 0 0 0 3px var(--violet-100);
}

input::placeholder, textarea::placeholder { color: #a9a2b8; }

textarea { min-height: 110px; resize: vertical; line-height: 1.6; }

/* שדה שמכיל כתובת או קוד: משמאל לימין גם בטופס עברי */
input.ltr, textarea.ltr { direction: ltr; text-align: left; }

.field.has-error input, .field.has-error textarea, .field.has-error select {
    border-color: var(--bad-line);
    background: var(--bad-bg);
}

.field-error { color: var(--bad); font-size: 12.5px; margin-top: 4px; }

.check-row {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 9px;
    font-size: 14px;
}

.check-row input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--violet-500); }

/* מתג הפעלה/כיבוי */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }

.switch .track {
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: var(--none-line);
    position: relative;
    transition: background var(--ease);
    flex: 0 0 42px;
}

.switch .track::after {
    content: "";
    position: absolute;
    inset-inline-start: 3px;   /* בעברית: נח בצד ימין, ונע שמאלה כשמדליקים */
    top: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
    transition: transform var(--ease);
}

.switch input:checked + .track { background: var(--violet-500); }
.switch input:checked + .track::after { transform: translateX(-18px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--violet-200); }

/* --------------------------------------------- 7. טבלאות */

/* עטיפה שמאפשרת לטבלה רחבה להיגלל בתוך עצמה בלי לשבור את הדף */
.table-wrap { width: 100%; overflow-x: auto; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }

.table th {
    text-align: start;
    font-size: 12.5px;
    color: var(--ink-muted);
    font-weight: bold;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--violet-50);
    white-space: nowrap;
}

.table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--violet-50); }

.table .num { text-align: start; font-variant-numeric: tabular-nums; }

/* טבלת בדיקות ומצב, בשימוש במסכי המערכת */
.check-table { width: 100%; border-collapse: collapse; }
.check-table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    font-size: 14px;
}
.check-table tr:last-child td { border-bottom: none; }
.st-dot   { width: 34px; padding-inline-start: 18px !important; }
.st-label { width: 34%; color: var(--ink-soft); }
.st-value { color: var(--ink); }
.st-ok   td { background: var(--ok-bg); }
.st-warn td { background: var(--warn-bg); }
.st-bad  td { background: var(--bad-bg); }

.note { color: var(--ink-muted); font-size: 12.5px; margin-top: 5px; line-height: 1.55; }

.card-pad > .check-table { margin: 14px -22px -20px; width: calc(100% + 44px); }

/* --------------------------------- 8. תגיות וסטטוסים */

.dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--none);
    flex: 0 0 9px;
}

.st-ok   .dot, .status-dot.st-ok   .dot { background: var(--ok); }
.st-warn .dot, .status-dot.st-warn .dot { background: var(--warn); }
.st-bad  .dot, .status-dot.st-bad  .dot { background: var(--bad); }
.st-none .dot { background: var(--none); }

.check-table .dot { margin-top: 7px; }

.status-dot { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 12.5px;
    border: 1px solid transparent;
    white-space: nowrap;
}

.badge-ok      { background: var(--ok-bg);   border-color: var(--ok-line);   color: #146045; }
.badge-warn    { background: var(--warn-bg); border-color: var(--warn-line); color: #8a5a05; }
.badge-bad     { background: var(--bad-bg);  border-color: var(--bad-line);  color: #8c1e2e; }
.badge-neutral { background: var(--none-bg); border-color: var(--none-line); color: #5d5769; }
.badge-info    { background: var(--violet-100); border-color: var(--violet-200); color: var(--violet-900); }

.banner {
    border-radius: var(--radius);
    padding: 13px 18px;
    margin-bottom: 18px;
    font-size: 14.5px;
    border: 1px solid transparent;
}

.banner-ok   { background: var(--ok-bg);   border-color: var(--ok-line);   color: #14613f; }
.banner-warn { background: var(--warn-bg); border-color: var(--warn-line); color: #8a5a05; }
.banner-bad  { background: var(--bad-bg);  border-color: var(--bad-line);  color: #8c1e2e; }
.banner-info { background: var(--violet-100); border-color: var(--violet-200); color: var(--violet-900); }

.pill { display: inline-block; border-radius: 999px; padding: 5px 14px; font-size: 13.5px; border: 1px solid transparent; }
.pill-ok { background: var(--ok-bg); border-color: var(--ok-line); color: #14613f; }

/* ------------------------------------------- 9. הסברים */

.explain {
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--violet-400);
    cursor: pointer;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: -.2em;
    transition: color var(--ease), background var(--ease);
}

.explain:hover { color: var(--violet-700); background: var(--violet-100); }

.explain-pop {
    position: absolute;
    z-index: 120;
    max-width: 330px;
    background: var(--surface);
    border: 1px solid var(--violet-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 14px 16px;
    font-size: 13.5px;
    line-height: 1.6;
}

.explain-pop h4 { font-size: 14px; color: var(--violet-900); margin-bottom: 5px; }
.explain-pop .more { margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--line); color: var(--ink-soft); }
.explain-pop .toggle-more {
    background: none; border: none; padding: 0; margin-top: 7px;
    color: var(--violet-600); font-family: inherit; font-size: 13px; cursor: pointer; text-decoration: underline;
}

/* -------------------------------- 10. בלוק להעתקה */

.copy-block {
    position: relative;
    background: var(--violet-50);
    border: 1px solid var(--violet-200);
    border-radius: var(--radius-sm);
    margin: 10px 0;
}

.copy-label {
    font-size: 12px;
    color: var(--ink-muted);
    padding: 7px 12px 0;
}

.copy-block pre {
    margin: 0;
    padding: 12px 14px 14px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 340px;
    overflow: auto;
}

.copy-block.ltr-content pre { direction: ltr; text-align: left; }

.copy-btn {
    position: absolute;
    top: 7px;
    inset-inline-start: 7px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--surface);
    border: 1px solid var(--violet-200);
    color: var(--violet-700);
    border-radius: var(--radius-xs);
    padding: 4px 10px;
    font-family: inherit;
    font-size: 12.5px;
    cursor: pointer;
    transition: background var(--ease);
}

.copy-btn:hover { background: var(--violet-100); }
.copy-btn.is-copied { background: var(--ok-bg); border-color: var(--ok-line); color: #146045; }

/* ---------------------------------------------- 11. מודאל */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(40, 26, 80, .42);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 200;
}

.modal {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 520px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
}

.modal-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
}

.modal-head h3 { font-size: 16px; color: var(--violet-900); flex: 1; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 9px; justify-content: flex-start; }

/* ---------------------------------------------- 12. טוסט */

.toast-stack {
    position: fixed;
    bottom: 18px;
    inset-inline-start: 18px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.toast {
    background: var(--surface);
    border: 1px solid var(--line);
    border-inline-start: 4px solid var(--violet-500);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    padding: 11px 16px;
    font-size: 14px;
    max-width: 380px;
    animation: toast-in .22s ease;
}

.toast-ok   { border-inline-start-color: var(--ok); }
.toast-warn { border-inline-start-color: var(--warn); }
.toast-bad  { border-inline-start-color: var(--bad); }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

/* ----------------------------------------- 13. התקדמות */

.progress {
    height: 8px;
    background: var(--violet-100);
    border-radius: 999px;
    overflow: hidden;
}

.progress span {
    display: block;
    height: 100%;
    background: var(--violet-500);
    border-radius: 999px;
    transition: width .3s ease;
}

/* התקדמות לפי שלבים, לפעולות ארוכות כמו איסוף נתונים */
.steps-progress { display: flex; flex-direction: column; gap: 9px; }

.step-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

.step-row .step-name { flex: 1; }
.step-row.is-running { border-color: var(--violet-200); background: var(--violet-50); }
.step-row.is-done    { border-color: var(--ok-line); background: var(--ok-bg); }
.step-row.is-failed  { border-color: var(--bad-line); background: var(--bad-bg); }

.spinner {
    width: 15px; height: 15px; flex: 0 0 15px;
    border: 2px solid var(--violet-200);
    border-top-color: var(--violet-500);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* שלד טעינה */
.skeleton {
    background: linear-gradient(90deg, var(--line-soft) 25%, var(--violet-100) 50%, var(--line-soft) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.3s infinite;
    border-radius: var(--radius-xs);
    height: 14px;
}

@keyframes shimmer { to { background-position: -200% 0; } }

/* --------------------------------------- 14. כרטיסי מדדים */

.kpi {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 15px 17px;
}

.kpi-label { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--ink-muted); }
.kpi-value { font-size: 26px; font-weight: bold; margin-top: 2px; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.kpi-foot  { display: flex; align-items: center; gap: 7px; margin-top: 5px; font-size: 12.5px; }

.trend { display: inline-flex; align-items: center; gap: 3px; font-weight: bold; }
.trend-up   { color: var(--ok); }
.trend-down { color: var(--bad); }
.trend-flat { color: var(--ink-muted); }

/* ------------------------------------- 15. מצבים ריקים */

.empty-state { text-align: center; padding: 34px 22px; color: var(--ink-muted); }
.empty-state h3 { font-size: 15.5px; color: var(--ink-soft); margin: 10px 0 5px; }
.empty-state p  { font-size: 14px; max-width: 460px; margin: 0 auto 14px; }
.empty-icon { color: var(--violet-300); }
.empty { color: var(--ink-muted); font-size: 14px; padding: 6px 0; }

.steps { margin: 6px 0 16px; padding-inline-start: 22px; font-size: 14px; color: var(--ink-soft); }
.steps li { margin: 4px 0; }

/* -------------------------------------------- 16. לשוניות */

.tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }

.tab {
    padding: 9px 15px;
    font-size: 14px;
    color: var(--ink-soft);
    border: none;
    background: none;
    font-family: inherit;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.tab:hover { color: var(--violet-700); }
.tab.is-active { color: var(--violet-700); border-bottom-color: var(--violet-500); font-weight: bold; }
.tab-panel[hidden] { display: none; }

/* -------------------------------- 17. מסכי כניסה */

.page-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 28px 18px;
    background: linear-gradient(160deg, var(--violet-100), var(--canvas) 45%);
}

.auth-wrap { width: 100%; max-width: 430px; }

.auth-brand { text-align: center; margin-bottom: 20px; }
.auth-brand .brand-mark { width: 52px; height: 52px; flex-basis: 52px; border-radius: 15px; font-size: 18px; margin: 0 auto 10px; }
.auth-brand-name { font-size: 19px; font-weight: bold; color: var(--violet-900); }

.auth-card { padding: 26px 26px 24px; }
.auth-title { font-size: 19px; margin-bottom: 16px; color: var(--violet-900); }

.logout-form { display: flex; }

/* --------------------------- 18. מסכים עצמאיים */

.page-plain { padding: 40px 20px; }
.plain-wrap { max-width: 760px; margin: 0 auto; }
.plain-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.plain-head h1 { font-size: 22px; }
.plain-head p  { margin: 2px 0 0; font-size: 13.5px; }
.plain-head .brand-mark { width: 46px; height: 46px; flex-basis: 46px; border-radius: 13px; font-size: 17px; }
.foot { text-align: center; font-size: 12.5px; margin-top: 18px; }

.error-card { text-align: center; padding: 34px 26px; }
.error-code { font-size: 46px; font-weight: bold; color: var(--violet-200); line-height: 1; margin-bottom: 10px; direction: ltr; }
.error-card .steps { text-align: start; display: inline-block; }

/* ------------------------------------------------ 18. נייד */

.sidebar-backdrop { display: none; }

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

@media (max-width: 760px) {
    /* הסרגל הופך לתפריט נשלף מימין. מיקום פיזי בכוונה: הממשק עברי בלבד. */
    .sidebar {
        position: fixed;
        top: 0;
        right: 0;
        z-index: 210;
        transform: translateX(100%);
        transition: transform .22s ease;
        box-shadow: var(--shadow-lg);
        background: var(--surface);
    }

    .app.is-menu-open .sidebar { transform: none; }

    .app.is-menu-open .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(40, 26, 80, .35);
        z-index: 205;
    }

    .app.is-collapsed .sidebar { width: var(--sidebar-w); flex-basis: var(--sidebar-w); }
    .app.is-collapsed .brand-name,
    .app.is-collapsed .nav-group-title,
    .app.is-collapsed .nav-item span,
    .app.is-collapsed .sidebar-foot { display: block; }
    .app.is-collapsed .nav-item { justify-content: flex-start; padding: 8px 10px; }

    .content { padding: 16px 14px; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .page-head h1 { font-size: 19px; }
    .topbar { padding: 0 12px; gap: 8px; }
    .client-picker { font-size: 12.5px; padding: 4px 9px; }
    .card-pad { padding: 16px; }
    .card-pad > .check-table { margin: 12px -16px -16px; width: calc(100% + 32px); }
    .page-plain { padding: 22px 14px; }
    .check-table td { padding: 10px; font-size: 13.5px; }
    .st-label { width: 42%; }
    .st-dot { width: 24px; padding-inline-start: 10px !important; }
    .kpi-value { font-size: 22px; }
    .toast-stack { inset-inline: 12px; bottom: 12px; }
    .toast { max-width: none; }
}

@media print {
    .sidebar, .topbar, .btn, .explain, .copy-btn { display: none !important; }
    body { background: #fff; }
    .card { box-shadow: none; border-color: #ddd; }
}
