/* עיצוב חדש: סרגל צד ימני + מצב כהה. נטען אחרון ופועל רק כש-<html data-ui="new">.
   בעיצוב הקודם (data-ui="classic") הסרגל מוסתר והכול נראה כמו קודם.
   מסכי ההצעות (body.keep-light) נשארים בעיצוב הבהיר הקיים גם כשהמצב כהה. ה-PDF אינם נוגעים בקובץ הזה. */

/* ---------- ברירת מחדל (עיצוב קודם): בלי סרגל ובלי סרגל נייד ---------- */
.sidebar, .sb-backdrop, .mobile-bar { display: none; }

/* ---------- משתני הסרגל: לפי העיצוב שנבחר, בלי קשר למסך ההצעות ---------- */
html[data-ui="new"] { --sb-bg: #ffffff; --sb-border: #e7dfce; --sb-text: #4a4438; --sb-muted: #8a8272; --sb-hover: #f6eedf; --sb-active-bg: #f6eedf; --sb-active: #7a5a2a; --sb-accent: #a67c3d; }
html[data-ui="new"][data-theme="dark"] { --sb-bg: #0b0e1a; --sb-border: #1c2238; --sb-text: #cdd2e6; --sb-muted: #7d85a3; --sb-hover: #151a2e; --sb-active-bg: #1d2347; --sb-active: #ffffff; --sb-accent: #8b7cf6; }

/* ---------- מבנה ---------- */
html[data-ui="new"] body.has-shell .topbar,
html[data-ui="new"] body.has-shell .subnav { display: none; }
html[data-ui="new"] .app-shell { display: flex; min-height: 100vh; align-items: flex-start; }
html[data-ui="new"] .app-main-wrap { flex: 1 1 auto; min-width: 0; min-height: 100vh; }
html[data-ui="new"] .sidebar {
  display: flex; flex-direction: column; order: -1; flex: 0 0 252px; width: 252px;
  position: sticky; top: 0; height: 100vh; overflow: hidden;
  background: var(--sb-bg); border-inline-start: 1px solid var(--sb-border); color: var(--sb-text); z-index: 60;
}
html[data-ui="new"] .sb-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 10px; }
html[data-ui="new"] .sb-brand { display: flex; align-items: center; color: var(--sb-active); font-weight: 800; font-size: 18px; }
html[data-ui="new"] .sb-brand img { max-height: 44px; max-width: 170px; width: auto; display: block; }
/* הלוגו (גם עם רקע לבן וגם שקוף) משתלב ברקע הכהה: היפוך צבעים עם שמירת הגוון, והשחור נעלם מול הרקע */
html[data-ui="new"][data-theme="dark"] .sb-brand img, html[data-ui="new"][data-theme="dark"] .mb-brand img { filter: invert(1) hue-rotate(180deg) brightness(1.1); mix-blend-mode: screen; }
html[data-ui="new"] .sb-close { display: none; background: none; border: 0; color: var(--sb-text); cursor: pointer; padding: 4px; }
html[data-ui="new"] .sb-nav { flex: 1 1 auto; overflow-y: auto; padding: 4px 10px 12px; scrollbar-width: thin; scrollbar-color: var(--sb-border) transparent; }
html[data-ui="new"] .sb-group { margin: 16px 10px 5px; font-size: 11.5px; font-weight: 800; letter-spacing: .04em; color: var(--sb-muted); }
html[data-ui="new"] .sb-item {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; margin: 1px 0; border-radius: 9px;
  color: var(--sb-text); font-size: 13.5px; position: relative; text-decoration: none;
}
html[data-ui="new"] .sb-item:hover { background: var(--sb-hover); text-decoration: none; color: var(--sb-active); }
html[data-ui="new"] .sb-item.active { background: var(--sb-active-bg); color: var(--sb-active); font-weight: 700; }
html[data-ui="new"] .sb-item.active::before { content: ""; position: absolute; inset-inline-start: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--sb-accent); }
html[data-ui="new"] .sb-item .ico { width: 18px; height: 18px; flex: 0 0 18px; opacity: .85; }
html[data-ui="new"] .sb-item.active .ico { opacity: 1; color: var(--sb-accent); }
html[data-ui="new"] .sb-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html[data-ui="new"] .sb-item .nav-count { margin: 0; }
html[data-ui="new"] .sb-foot { flex: 0 0 auto; padding: 12px 14px 14px; border-top: 1px solid var(--sb-border); }
html[data-ui="new"] .sb-user { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
html[data-ui="new"] .sb-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--sb-active-bg); color: var(--sb-accent); font-weight: 800; display: grid; place-items: center; }
html[data-ui="new"] .sb-user-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
html[data-ui="new"] .sb-user-text strong { color: var(--sb-active); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html[data-ui="new"] .sb-user-text small { color: var(--sb-muted); font-size: 12px; }
html[data-ui="new"] .sb-tools { display: flex; gap: 4px; margin-bottom: 8px; }
html[data-ui="new"] .sb-tools a, html[data-ui="new"] .sb-tools button {
  flex: 1 1 0; display: grid; place-items: center; height: 34px; border-radius: 9px; border: 0; background: transparent; color: var(--sb-muted); cursor: pointer;
}
html[data-ui="new"] .sb-tools a:hover, html[data-ui="new"] .sb-tools button:hover { background: var(--sb-hover); color: var(--sb-active); text-decoration: none; }
html[data-ui="new"] .sb-tools .ico { width: 18px; height: 18px; }
html[data-ui="new"] .when-light { display: none; }
html[data-ui="new"][data-theme="light"] .when-light { display: inline-flex; }
html[data-ui="new"][data-theme="light"] .when-dark { display: none; }
html[data-ui="new"] .sb-classic { width: 100%; background: none; border: 1px dashed var(--sb-border); color: var(--sb-muted); border-radius: 9px; padding: 6px; font-size: 12px; cursor: pointer; font-family: inherit; }
html[data-ui="new"] .sb-classic:hover { color: var(--sb-active); border-color: var(--sb-muted); }
html[data-ui="new"] .ico { display: inline-block; vertical-align: middle; }

/* ---------- אזור התוכן ---------- */
html[data-ui="new"] .container { margin-top: 28px; }
html[data-ui="new"] .flash-list { top: 18px; }
html[data-ui="new"] .page-header h1 { font-size: 24px; font-weight: 800; letter-spacing: -.01em; }
html[data-ui="new"] .card { border-radius: 14px; }
html[data-ui="new"] .btn { border-radius: 10px; }
html[data-ui="new"] input, html[data-ui="new"] select, html[data-ui="new"] textarea { border-radius: 10px; }
html[data-ui="new"] th { text-transform: none; letter-spacing: 0; }

/* ---------- קטגוריות הניתנות לכיווץ ושינוי סדר השורות ---------- */
html[data-ui="new"] .sb-group { display: flex; align-items: center; justify-content: space-between; width: calc(100% - 20px); background: none; border: 0; cursor: pointer; font-family: inherit; text-align: start; padding: 0; }
html[data-ui="new"] .sb-group:hover { color: var(--sb-active); }
html[data-ui="new"] .sb-group .ico { width: 14px; height: 14px; transform: rotate(90deg); transition: transform .15s; }
html[data-ui="new"] .sb-sec.collapsed .sb-group .ico { transform: rotate(180deg); }
html[data-ui="new"] .sb-sec.collapsed .sb-items { display: none; }
html[data-ui="new"] .sb-mv, html[data-ui="new"] .sb-editbar { display: none; }
html[data-ui="new"] body.sb-edit .sb-mv { display: flex; gap: 2px; margin-inline-start: 4px; }
html[data-ui="new"] .sb-mv button { width: 22px; height: 22px; border: 0; border-radius: 6px; background: var(--sb-hover); color: var(--sb-muted); font-size: 9px; line-height: 1; cursor: pointer; padding: 0; }
html[data-ui="new"] .sb-mv button:hover { background: var(--sb-accent); color: #fff; }
html[data-ui="new"] body.sb-edit .sb-item { cursor: grab; outline: 1px dashed var(--sb-border); outline-offset: -1px; }
html[data-ui="new"] .sb-item.dragging { opacity: .35; }
html[data-ui="new"] body.sb-edit .sb-editbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 8px; font-size: 11.5px; color: var(--sb-muted); }
html[data-ui="new"] .sb-editbar button { background: none; border: 1px solid var(--sb-border); color: var(--sb-text); border-radius: 8px; padding: 3px 8px; font-size: 11.5px; cursor: pointer; font-family: inherit; white-space: nowrap; }
html[data-ui="new"] #sbEditBtn[aria-pressed="true"] { background: var(--sb-active-bg); color: var(--sb-accent); }

/* ---------- כיווץ הסרגל (מחשב): נשארת עמודת אייקונים. נשמר בדפדפן (sm_sb) ---------- */
html[data-ui="new"] .sb-collapse { display: grid; place-items: center; width: 30px; height: 30px; background: none; border: 0; border-radius: 8px; color: var(--sb-muted); cursor: pointer; }
html[data-ui="new"] .sb-collapse:hover { background: var(--sb-hover); color: var(--sb-active); }
html[data-ui="new"] .sb-collapse .ico { width: 18px; height: 18px; transition: transform .2s; }
@media (min-width: 961px) {
  html[data-ui="new"][data-sb="min"] .sidebar { flex-basis: 68px; width: 68px; }
  html[data-ui="new"][data-sb="min"] .sb-head { flex-direction: column; gap: 8px; padding: 14px 0 6px; }
  html[data-ui="new"][data-sb="min"] .sb-brand { display: none; }
  html[data-ui="new"][data-sb="min"] .sb-collapse .ico { transform: rotate(180deg); }
  html[data-ui="new"][data-sb="min"] .sb-nav { padding: 4px 8px 12px; }
  html[data-ui="new"][data-sb="min"] .sb-label, html[data-ui="new"][data-sb="min"] .sb-user-text, html[data-ui="new"][data-sb="min"] .sb-classic { display: none; }
  html[data-ui="new"][data-sb="min"] .sb-group { height: 1px; margin: 10px 12px; padding: 0; font-size: 0; background: var(--sb-border); overflow: hidden; }
  html[data-ui="new"][data-sb="min"] .sb-item { justify-content: center; padding: 10px 0; }
  html[data-ui="new"][data-sb="min"] .sb-item .ico { width: 20px; height: 20px; flex-basis: 20px; }
  html[data-ui="new"][data-sb="min"] .sb-item .nav-count { position: absolute; top: 3px; inset-inline-start: 6px; min-width: 16px; height: 16px; line-height: 16px; font-size: 10px; padding: 0 4px; }
  html[data-ui="new"][data-sb="min"] .sb-item.active::before { inset-inline-start: -8px; }
  html[data-ui="new"][data-sb="min"] .sb-foot { padding: 10px 6px; }
  html[data-ui="new"][data-sb="min"] .sb-user { justify-content: center; }
  html[data-ui="new"][data-sb="min"] .sb-tools { flex-direction: column; }
  html[data-ui="new"][data-sb="min"] .sb-sec.collapsed .sb-items { display: block; }   /* בעמודת האייקונים כל השורות גלויות */
  html[data-ui="new"][data-sb="min"] .sb-group .ico, html[data-ui="new"][data-sb="min"] #sbEditBtn, html[data-ui="new"][data-sb="min"] body.sb-edit .sb-mv, html[data-ui="new"][data-sb="min"] body.sb-edit .sb-editbar { display: none; }
}

/* ---------- טלפון וטאבלט: הסרגל נפתח מהצד ---------- */
@media (max-width: 960px) {
  html[data-ui="new"] body.has-shell { overflow-x: clip; }          /* תפריט הצד הסגור (מחוץ למסך) לא מרחיב את הדף ולא יוצר גלילה הצידה */
  html[data-ui="new"] .app-shell { display: block; }
  html[data-ui="new"] .mobile-bar {
    display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 55; height: 54px; padding: 0 12px;
    background: var(--sb-bg); border-bottom: 1px solid var(--sb-border);
  }
  html[data-ui="new"] .mobile-bar button { background: none; border: 0; color: var(--sb-text); padding: 6px; cursor: pointer; display: grid; place-items: center; }
  html[data-ui="new"] .mobile-bar .ico { width: 24px; height: 24px; }
  html[data-ui="new"] .mb-brand { display: flex; align-items: center; color: var(--sb-active); font-weight: 800; }
  html[data-ui="new"] .mb-brand img { max-height: 34px; width: auto; }
  html[data-ui="new"] .sidebar { position: fixed; top: 0; bottom: 0; right: 0; height: 100%; width: min(84vw, 300px); transform: translateX(105%); transition: transform .2s ease; box-shadow: -8px 0 30px rgba(0,0,0,.35); }
  html[data-ui="new"] body.sb-open .sidebar { transform: none; }
  html[data-ui="new"] .sb-close { display: block; }
  html[data-ui="new"] .sb-collapse { display: none; }
  html[data-ui="new"] .sb-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 58; }
  html[data-ui="new"] body.sb-open .sb-backdrop { display: block; }
  html[data-ui="new"] .flash-list { top: 64px; }
}

/* ---------- עיצוב כהה (מסכי ההצעות נשארים בהירים: body.keep-light) ---------- */
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) {
  --primary: #8b7cf6; --primary-dark: #b4a9ff; --bg: #0d1020; --card: #151a2e; --border: #262d47;
  --text: #e9ebf5; --text-muted: #99a0bd; --success: #34d399; --error: #f87171; --warning: #fbbf24;
  background: var(--bg); color: var(--text); color-scheme: dark;
  background-image: radial-gradient(900px 500px at 100% -10%, rgba(139,124,246,.13), transparent 60%), radial-gradient(700px 420px at 0% 0%, rgba(120,40,60,.12), transparent 60%);
  background-attachment: fixed;
}
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) {
  /* ברירות המחדל של הצבעים הקבועים בקבצי ה-CSS הקיימים */
}
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is(.btn.secondary) { background: #1d2340; color: var(--text); border-color: var(--border); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is(.btn.secondary):hover { background: #262e55; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .btn.danger { background: transparent; color: #fca5a5; border-color: #7f1d1d; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .btn.danger:hover { background: #3a1620; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) th { background: #11162a; color: var(--text-muted); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) tr:hover td { background: #1a2040; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is(input, select, textarea) { background: #0f1428; color: var(--text); border-color: var(--border); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is(input, select, textarea)::placeholder { color: #6b7391; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is(input, select, textarea):focus { box-shadow: 0 0 0 3px rgba(139,124,246,.28); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .flash.success { background: #0f2a21; color: #86efac; border-color: #14532d; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .flash.error { background: #31141b; color: #fca5a5; border-color: #7f1d1d; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is(.chip, .item-row.section-row) { background: #1d2347; color: var(--primary-dark); border-color: var(--border); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is(.thumb, .item-row) { background: #0f1428; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) a:not(.sb-item):not(.btn):not(.wk-chip):not(.sp-row) { color: var(--primary-dark); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .btn { color: #fff; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .btn.secondary { color: var(--text); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .page-header h1 { color: #fff; }
/* לוח הבקרה (dashboard.css) מגדיר משתני צבע משלו על .db */
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .db { --gold: #8b7cf6; --gold-d: #b4a9ff; --gold-soft: #1d2347; --ink: #e9ebf5; --muted: #99a0bd; --line: #262d47; --card: #151a2e; --red: #f87171; --green: #34d399; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .db :is(.db-kpi.warn, .db-kpi.local) { background: var(--card); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .db :is(.db-delta, .db-meter, .db-pill, .db-bar) { background: #1d2347; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .db :is(.db-delta.good) { background: #10301f; color: #6ee7a8; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .db :is(.db-delta.bad, .db-pill.hot, .db-stage.s4) { background: #3a1620; color: #fca5a5; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .db :is(.db-stage.s3) { background: #10301f; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .db :is(.db-item, .db-feed li) { border-bottom-color: #262d47; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .db .db-item.sev-high { background: linear-gradient(270deg, rgba(248,113,113,.14), transparent 40%); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .db .db-check { background: var(--card); }
/* כותרת הדשבורד: מהזהב-חום לכחול-סגול של העיצוב החדש */
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .db-hero { background: radial-gradient(circle at 4% 118%, rgba(139,124,246,.38), transparent 240px), linear-gradient(135deg, #131735 0%, #1c2250 55%, #2d2a6e 120%); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .db-date { color: #b4a9ff; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .db-sub { color: #cdd2e6; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .db-sub .db-hot { color: #fca5a5; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .db-qbtn { color: #e9ebf5 !important; border-color: rgba(139,124,246,.55); background: rgba(255,255,255,.05); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .db-qbtn:hover { background: rgba(139,124,246,.22); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .db-qbtn.primary { background: #8b7cf6; color: #fff !important; border-color: #8b7cf6; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .db-jump input { border-color: rgba(139,124,246,.55); background: rgba(8,10,26,.55); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .db-jump input::placeholder { color: #9aa1c4; }
/* רכיבים משותפים עם צבעי רקע קבועים ב-style.css ובקבצי הכספים וההסכמים */
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is(.cal-day, .kpi, .view-tabs a, .file-card, .fin-metric, .autocomplete-list, .note-dd, .dropdown-menu, .finance-menu-panel, .rte-editor, .rte-toolbar button, .fld-x) { background: var(--card); color: var(--text); border-color: var(--border); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is(.cal-item, .rte-toolbar, .agreement-token, .fin-doc-summary article, .fin-graph-node.current) { background: #11162a; color: var(--text); border-color: var(--border); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is(.cal-item:hover, .autocomplete-item:hover, .autocomplete-item.active, .note-dd-item:hover, .rte-toolbar button:hover, .dropdown-menu a:hover, .dropdown-menu button:hover, .finance-menu-panel a:hover) { background: #1d2347; text-decoration: none; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is(.lock-banner, .agreement-notice, .fin-notice, .finance-test-notice, .kpi-warn, .item-row.text-row) { background: #2c2410; color: #f5d98b; border-color: #5b4a1a; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is(.kpi-bad, .agreement-form-error, .fin-badge.overdue, .agreement-status.cancelled, .sla-overdue, .sla-missed) { background: #3a1620; color: #fca5a5; border-color: #7f1d1d; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is(.sla-ok, .sla-met, .agreement-signed) { background: #10301f; color: #86efac; border-color: #14532d; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is(.sla-warn, .badge-manual) { background: #3a2c0c; color: #fcd34d; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is(.sla-paused, .pill-gold) { background: #1d2347; color: var(--primary-dark); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .kpi-bad .kpi-n { color: #fca5a5; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .kpi-warn .kpi-n { color: #fcd34d; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .customer-pencil:hover { background: #1d2347; }
/* מסכים עם סגנון משלהם בתוך התבנית: לוח שבוע, משימות, שיחות, רישיונות, ציוד להזמנה, חייבים, נוכחות, חשבוניות, פרויקטים */
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is(.day, .db-sum .box, .lic-stat, .lic-table, .lic-card, .lic-empty, .lic-table tr, .sp, .sp-list, .sp-info, .sp-m.customer, .wk-day, .wk-box, .wk-chip, .wk-und .wk-card, .wk-agenda .wk-card, .tk-st, .tk-panel .tk-edit, .wk-strip button, .wk-nav a, .wk-flt button, .wk-addday, .wk-act a, .wk-act button, .sp-chips button, .sp-ch select, .sp-ch button, .sp-ch a.b, .btn-st, .lic-btn, .lic-tools input, .lic-tools select, .debtors-chip) { background: var(--card); color: var(--text); border-color: var(--border); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is(.iv-sum > div, .iv-panel, .tk-edit, .tk-panel, .pdf-box, .edit-row td, .sp-ch, .sp-comp, .sp-d, .sp-s, .wk-card, .wk-day.off, .lic-box, .lic-table th, .ol th, .to th, .to tr.add td, .sp-search input, .tk-when, .pj-count) { background: #11162a !important; color: var(--text); border-color: var(--border); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is(.cell:hover, .iv-row:hover, .iv-row:focus-visible, .sp-row:hover, .tk-item .tk-row:hover, .wk-day.can-add:hover, .lic-stat.on, .lic-table tr.pick td, .lic-table tr.pick) { background: #1d2347 !important; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is(.cell.absent, .chip.late, .tk-when.late, .tk-sec.over h2 .n, .pj-exc, .lic-err, .lic-btn.red, .lic-st.blocked) { background: #3a1620 !important; color: #fca5a5; border-color: #7f1d1d; }
/* שורת "באיחור" בלוח השבוע: אותו מראה כמו שורה דחופה ברשימה (גרדיאנט אדום שדוהה וקו אדום בצד), ולא רקע אדום מלא */
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .wk-over { background: linear-gradient(270deg, rgba(248,113,113,.14), transparent 40%) !important; border-right: 4px solid #f87171; border-radius: 8px; color: var(--text); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is(.sp-st.attention, .tk-state.s-postponed, .tk-sec.held h2 .n, .lic-st.warn, .wk-day.drop) { background: #3a2c0c !important; color: #fcd34d; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is(.wk-addday, .ol th, .to th, .wk-nav a, .wk-flt button) { color: var(--text-muted); }
/* כרטיס פירוט המוצר שנבחר (הצעה ופריסט). בכיתה ולא בסגנון בתוך התג: הדפדפן משכתב צבע בתוך התג אחרי שה-JS משנה אותו, וכלל העיצוב הכהה כבר לא תופס */
.product-card { margin-top: 12px; padding: 12px; border: 1px solid var(--border, #e2e8f0); border-radius: 8px; background: #f8fafc; color: #1f2937; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) dialog#wkTaskDlg { background: var(--card); color: var(--text); border-color: var(--border); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) dialog#wkTaskDlg :is(.wk-td-top, .wk-td-meta) { color: var(--text-muted); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) dialog#wkTaskDlg .wk-td-top .st { border-color: var(--border); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) dialog#wkTaskDlg .wk-td-notes { background: #11162a; color: var(--text); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) dialog#wkTaskDlg .wk-td-act button:not(.main) { border-color: var(--border); color: var(--text); background: transparent; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) dialog#wkTaskDlg .wk-td-act button.main { background: var(--primary); border-color: var(--primary); color: #fff; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .wk-edge { background: var(--card); color: var(--text-muted); border-color: var(--border); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .wk-edge:hover { background: #1d2347; color: var(--text); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .wk-edge.over { background: #1d2347; color: var(--text); border-color: var(--primary); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .wk-edge.over::after { background: rgba(139,124,246,.4); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .wk-pop { background: var(--card); color: var(--text); border-color: var(--border); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .wk-pop .t { color: var(--text-muted); border-bottom-color: var(--border); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .wk-pop :is(a, button) { background: transparent; color: var(--text); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .wk-pop :is(a, button):hover { background: rgba(139,124,246,.22); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .product-card { background: #141a33; color: var(--text); border-color: var(--border); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is(.tk-check, .db-check) { background: var(--card); }
/* תגיות סטטוס (כחול / ירוק / אפור / סגול), שורות בטבלאות וכמה באנרים */
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is(.agreement-status.prepared, .agreement-status.sent, .fin-badge.approved, .fin-badge.issued, .iv-st.new, .lic-st.trial) { background: #1b2b4d; color: #93c5fd; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is(.agreement-status.signed, .agreement-success-icon, .fin-badge.completed, .fin-badge.paid, .sp-st.closed, .chip.cleared, .iv-st.handled, .lic-st.licensed) { background: #10301f; color: #86efac; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is(.iv-st.ignored, .lic-st.ended, .lic-tag, .pill-lite, .bar-track, .pj-deleted, .day.rest) { background: #1d2340; color: var(--text-muted); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .lic-st.pending { background: #2a2358; color: #c4b5fd; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) table.to tr.r1 td { background: #141a33 !important; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) table.to tr.r2 td { background: #181e3b !important; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) table.to tr.sep td { background: #1d2347 !important; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .dropdown-menu button.danger-item:hover { background: #3a1620; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .lock-banner.unlocked { background: #10301f; color: #86efac; border-color: #14532d; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .save-banner { background: #2c2410; color: #f5d98b; border-color: #5b4a1a; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is(.note-dd-panel, .reveal-btn:hover) { background: var(--card); color: var(--text); }
/* נוכחות, דוחות, הגדרות הסכמים, כפתורי בחירת קובץ */
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is(.att-help, .att-help strong, .sum, .num) { color: var(--text-muted); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .fin-metric strong, html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .fin-metric b { color: var(--text); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .agreement-validation.valid { color: #6ee7a8; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .agreement-validation:not(.valid) { color: #fca5a5; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .file-btn { background: #1d2340; color: var(--text); border-color: var(--border); }
/* מסך המשימות (tasks/index.html) ולוח השבוע בדשבורד */
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is(.tk-row[aria-expanded="true"], .tk-item .tk-row:hover, .tk-panel, .tk-edit, .tk-panel .tk-edit) { background: #141a33 !important; color: var(--text); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is(.tk-row, .tk-item) { border-color: var(--border); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is(.tk-state.s-working, .tk-badge) { background: #1b2b4d; color: #93c5fd; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .tk-state.s-done { background: #10301f; color: #86efac; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is(.tk-sec h2 .n, .tk-place summary .n) { background: #1d2347; color: var(--primary-dark); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .tk-sec.over h2 { color: #f87171; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .tk-sec.over h2 .n { background: #3a1620; color: #fca5a5; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .tk-sec.done h2 { color: #6ee7a8; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .tk-sec.done h2 .n { background: #10301f; color: #6ee7a8; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .tk-sec.held h2 { color: #fcd34d; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is(.tk-sub, .tk-meta, .tk-chev, .tk-status-label, .tk-rules small, .tk-title.is-done) { color: var(--text-muted); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .tk-act a:hover, html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .tk-act button:hover { background: #1d2347; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .tk-st { background: var(--card); color: var(--text); border-color: var(--border); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .tk-st.on { color: #fff; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .wk-over b { color: #fca5a5; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .wk-chip em { color: #fca5a5; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is(.wk-day .n, .wk-box h2) { color: var(--text-muted); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .db-stage.s3 span { color: #6ee7a8; }
/* מסך השיחות (support/inbox.html) */
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .sp-chat { background: #0d1020; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is(.sp-row.sel, .sp-chips button.on) { background: #1d2347 !important; border-color: var(--primary); color: var(--text); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .sp-m.customer { background: #1d2340; color: var(--text); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .sp-m.bot { background: #1b2b4d; color: var(--text); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .sp-m.owner { background: #14382c; color: var(--text); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is(.sp-name, .sp-lh b, .sp-ch .t b) { color: var(--text); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is(.sp-prev, .sp-time, .sp-lh a, .sp-ch .t span, .sp-empty, .sp-m small, .sp-m .who, .sp-info h3) { color: var(--text-muted); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .sp-comp textarea { background: #0f1428; color: var(--text); border-color: var(--border); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is(.sp-rows, .sp-row) { border-color: var(--border); }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) .sp-av { background: #262d47; color: var(--text); }
/* צבעי רקע וטקסט שנכתבו ישירות בתוך מסכים (style="...") */
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is([style*="background:#fff"], [style*="background: #fff"], [style*="background:white"], [style*="background: white"], [style*="background:#FFF"], [style*="background:#ffffff"], [style*="background: #ffffff"]) { background: var(--card) !important; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is([style*="#F6EEDF" i], [style*="#fbf8f2" i], [style*="#fbf8f1" i], [style*="#faf8f3" i], [style*="#f8fafc" i], [style*="#f1f5f9" i], [style*="#fffbeb" i], [style*="#fdf8ec" i], [style*="#f7f5f1" i], [style*="#fffdf8" i], [style*="#fff7e6" i], [style*="#fff1dc" i]) { background: #141a33 !important; color: var(--text) !important; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is([style*="background:#fdeaea" i], [style*="background: #fdeaea" i], [style*="background:#fde7e3" i], [style*="background: #fde7e3" i]) { background: #3a1620 !important; color: #fca5a5 !important; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is([style*="color:#4a4438"], [style*="color: #4a4438"], [style*="color:#1f1b16"], [style*="color:#333"], [style*="color:#222"], [style*="color:#000"]) { color: var(--text) !important; }
html[data-ui="new"][data-theme="dark"] body.has-shell:not(.keep-light) :is([style*="color:#6b6354"], [style*="color: #6b6354"], [style*="color:#666"], [style*="color:#777"], [style*="color:#888"]) { color: var(--text-muted) !important; }

/* ---------- כל הבאנרים וההתראות: גרדיאנט צבעוני שדוהה וקו בצד (--bn = הצבע של סוג ההודעה) ----------
   שגיאה/איחור = אדום, אזהרה/הודעה = כתום, הצלחה = ירוק. נמצא בסוף הקובץ כדי לגבור על כללים קודמים. */
html[data-ui="new"][data-theme] body.has-shell :is(.flash.error, .agreement-form-error, .lic-err, .wk-over, [style*="background:#fdeaea" i], [style*="background: #fdeaea" i], [style*="background:#fde7e3" i], [style*="background: #fde7e3" i]) { --bn: 248,113,113; }
html[data-ui="new"][data-theme] body.has-shell :is(.lock-banner, .save-banner, .agreement-notice, .fin-notice, .finance-test-notice, [style*="#fff7e6" i], [style*="#fff1dc" i]) { --bn: 251,191,36; }
html[data-ui="new"][data-theme] body.has-shell :is(.flash.success, .lock-banner.unlocked) { --bn: 52,211,153; }
html[data-ui="new"][data-theme] body.has-shell :is(.flash.error, .agreement-form-error, .lic-err, .wk-over, .lock-banner, .save-banner, .agreement-notice, .fin-notice, .finance-test-notice, .flash.success, .lock-banner.unlocked, [style*="background:#fdeaea" i], [style*="background: #fdeaea" i], [style*="background:#fde7e3" i], [style*="background: #fde7e3" i], [style*="#fff7e6" i], [style*="#fff1dc" i]) {
  background: linear-gradient(270deg, rgba(var(--bn), .14), transparent 40%) !important;
  border: 0 !important; border-right: 4px solid rgb(var(--bn)) !important; border-radius: 8px;
  color: var(--text) !important; box-shadow: none;
}
/* הודעות קופצות (flash) צפות מעל התוכן, ולכן צריכות רקע אטום מתחת לגרדיאנט */
html[data-ui="new"][data-theme] body.has-shell :is(.flash.error, .flash.success) { background: linear-gradient(270deg, rgba(var(--bn), .22), transparent 55%), var(--card, #fff) !important; box-shadow: 0 6px 20px rgba(0,0,0,.28); }