:root {
  --ink: #102331;
  --muted: #647780;
  --teal: #087f6b;
  --dark: #0c292b;
  --mint: #e4f8f1;
  --line: #d9e8e4;
  --white: #fff;
  --warn: #db7c14;
  --bad: #c03535;
  --ok: #0e9f6e;
}
* { box-sizing: border-box }
html { scroll-behavior: smooth }
html[dir="ltr"], html[dir="ltr"] body { direction: ltr; text-align: left }
html[dir="rtl"], html[dir="rtl"] body { direction: rtl; text-align: right }
.layout { direction: inherit }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(160deg, #fff 0%, #f3f8f7 55%, #eef6f3 100%);
  font-family: Arial, "Noto Sans Hebrew", sans-serif;
}
a { color: inherit; text-decoration: none }
.topbar {
  height: 72px;
  padding: 0 clamp(18px, 4vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.94);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { font-size: 24px; font-weight: 900; letter-spacing: -1px }
.brand span { color: var(--teal) }
.topbar-end { display: flex; align-items: center; gap: 14px }
.who { color: var(--muted); font-size: 13px; font-weight: 700 }
.btn {
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  background: var(--teal);
  color: #fff;
}
.btn.secondary { background: #fff; border-color: var(--line); color: var(--ink) }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink) }
.layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  min-height: calc(100vh - 72px);
}
aside {
  padding: 28px 18px;
  border-inline-end: 1px solid var(--line);
  background: #102b2c;
  color: #fff;
}
aside nav { display: grid; gap: 6px; margin-top: 28px }
aside a, aside button.nav-link {
  padding: 11px 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #b8ceca;
  text-align: start;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
aside a.active, aside a:hover, aside button.nav-link.active, aside button.nav-link:hover {
  background: #1a4140;
  color: #fff;
}
aside .hint {
  margin-top: 40px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  color: #9fc0bb;
  font-size: 12px;
  line-height: 1.55;
}
main.app-main { padding: 28px clamp(16px, 3vw, 42px) 48px }
.page { display: none }
.page.active { display: block }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap }
.page-head p { margin: 0; color: var(--muted); font-size: 13px; font-weight: 700 }
.page-head h1 { margin: 4px 0 0; font-size: clamp(28px, 3vw, 36px); letter-spacing: -.03em }
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.stats article {
  padding: 18px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.stats span { display: block; color: var(--muted); font-size: 12px; font-weight: 700 }
.stats b { display: block; margin-top: 12px; font-size: 30px; letter-spacing: -.03em }
.stats b.ok { color: var(--ok) }
.stats b.warn { color: var(--warn) }
.stats b.bad { color: var(--bad) }
.panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
  margin-bottom: 18px;
}
.panel-title {
  padding: 18px 20px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.panel-title h2 { margin: 0; font-size: 18px }
.panel-title p { margin: 0; color: var(--muted); font-size: 12px; font-weight: 700 }
.table-wrap { overflow: auto }
table { width: 100%; border-collapse: collapse; text-align: start }
th, td { padding: 13px 16px; border-top: 1px solid var(--line); vertical-align: top }
th { color: var(--muted); font-size: 12px; font-weight: 800 }
td strong { display: block }
td small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: var(--mint);
  color: var(--teal);
}
.badge.warn { background: #fff4e5; color: var(--warn) }
.badge.bad { background: #fde8e8; color: var(--bad) }
.badge.muted { background: #eef2f1; color: var(--muted) }
.empty {
  padding: 42px 20px;
  text-align: center;
  color: var(--muted);
  line-height: 1.6;
}
.updated { color: var(--muted); font-size: 12px; font-weight: 700 }
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(420px, 100%);
  padding: 32px 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(16,35,49,.08);
}
.login-card h1 { margin: 8px 0 6px; font-size: 30px; letter-spacing: -.03em }
.login-card .lead { margin: 0 0 22px; color: var(--muted); line-height: 1.55 }
.field { display: grid; gap: 7px; margin-bottom: 14px }
.field label { font-size: 13px; font-weight: 800 }
.field input {
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
}
.field input:focus { outline: 2px solid rgba(8,127,107,.25); border-color: var(--teal) }
.error {
  display: none;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fde8e8;
  color: var(--bad);
  font-size: 13px;
  font-weight: 700;
}
.error.show { display: block }
.ok {
  display: none;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #e4f8f1;
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
}
.ok.show { display: block }
.field select {
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  background: #fff;
}
.field select:focus { outline: 2px solid rgba(8,127,107,.25); border-color: var(--teal) }
.login-actions { display: grid; gap: 10px; margin-top: 8px }
.login-actions .btn { width: 100% }
.coming {
  padding: 28px 22px;
  border: 1px dashed #b9d5cd;
  border-radius: 16px;
  background: linear-gradient(135deg, #f7fcfa, #eef8f4);
  color: var(--muted);
  line-height: 1.65;
}
.coming strong { color: var(--ink) }

.lang-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
  order: -1;
}
.lang-dd-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7fbfa;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.lang-dd-toggle:hover {
  border-color: #cfe4de;
  background: #fff;
}
.lang-dropdown.is-open .lang-dd-toggle {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(8,127,107,.12);
  background: #fff;
}
.lang-dd-toggle .flag,
.lang-dd-option .flag {
  width: 18px;
  height: 13px;
  object-fit: cover;
  border-radius: 2px;
  display: block;
  flex: 0 0 auto;
}
.lang-dd-caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--muted);
  margin-inline-start: 2px;
}
.lang-dropdown.is-open .lang-dd-caret {
  transform: rotate(180deg);
}
.lang-dd-menu {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-end: 0;
  z-index: 40;
  min-width: 160px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(16,35,49,.16);
  display: grid;
  gap: 2px;
}
.lang-dd-menu[hidden] {
  display: none !important;
}
.lang-dd-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-align: start;
  cursor: pointer;
}
.lang-dd-option:hover {
  background: #f3f8f6;
}
.lang-dd-option.is-active {
  background: rgba(8,127,107,.1);
  color: var(--teal);
}
@media (max-width: 720px) {
  .lang-dd-current { display: none; }
  .topbar-end { flex-wrap: wrap; justify-content: flex-end; }
}
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.btn-action {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.btn-action:hover:not(:disabled) {
  border-color: var(--teal);
  color: var(--teal);
  background: var(--mint);
}
.btn-action:disabled {
  opacity: .45;
  cursor: not-allowed;
}
tr.user-row {
  cursor: pointer;
}
tr.user-row.is-me {
  background: #f3fbf8;
}
tr.user-row.is-selected {
  background: #e4f8f1 !important;
  outline: 2px solid rgba(8,127,107,.25);
  outline-offset: -2px;
}
tr.user-row:hover {
  background: #f7fcfa;
}
#user-details-panel[hidden] {
  display: none !important;
}
.edit-block {
  border-top: 1px solid var(--line);
  padding-bottom: 18px;
}
.edit-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 8px 20px 0;
}
.details-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  padding: 8px 20px 16px;
}
.details-form .field input,
.details-form .field select {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
}
.details-form .field label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}
tr.class-row {
  cursor: pointer;
}
tr.class-row.is-selected {
  background: #e4f8f1 !important;
}
tr.class-row:hover {
  background: #f7fcfa;
}
tr.customer-row {
  cursor: pointer;
}
tr.customer-row.is-selected {
  background: #e4f8f1 !important;
}
tr.customer-row:hover {
  background: #f7fcfa;
}
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr }
  aside { border-inline-end: 0; border-bottom: 1px solid #1a4140 }
  aside nav { margin-top: 16px; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 6px }
  aside .hint { display: none }
  .stats { grid-template-columns: 1fr 1fr }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr }
  aside nav { grid-template-columns: 1fr 1fr }
}

.ezipc-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 20px;
}
.ezipc-modal[hidden] { display: none !important; }
.ezipc-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 35, 49, .45);
  backdrop-filter: blur(3px);
}
.ezipc-modal-card {
  position: relative;
  width: min(420px, 100%);
  padding: 28px 24px 22px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(16,35,49,.28);
  text-align: center;
  transform: translateY(10px) scale(.98);
  opacity: 0;
  transition: transform .2s ease, opacity .2s ease;
}
.ezipc-modal.show .ezipc-modal-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.ezipc-modal-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 900;
  color: #fff;
  background: var(--teal);
}
.ezipc-modal[data-type="success"] .ezipc-modal-icon { background: #0e9f6e; }
.ezipc-modal[data-type="error"] .ezipc-modal-icon { background: #c03535; }
.ezipc-modal[data-type="warn"] .ezipc-modal-icon { background: #db7c14; }
.ezipc-modal-card h3 {
  margin: 0 0 8px;
  font-size: 22px;
  letter-spacing: -.02em;
}
.ezipc-modal-card p {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 15px;
  white-space: pre-wrap;
}
.ezipc-modal-ok { min-width: 140px; }

/* Classifications grid */
.classifications-grid th:nth-child(n+2),
.classifications-grid td.col-check {
  text-align: center;
  width: 88px;
}
.class-name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}
.class-name {
  font-weight: 800;
  cursor: help;
}
.classifications-grid tr.is-saving {
  opacity: .55;
  pointer-events: none;
}

/* Active switch: RTL — checked (פעיל) knob to the right side visually = left in LTR terms for "שמאלה פעיל" */
.ezi-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 46px;
  height: 26px;
  flex: 0 0 auto;
  cursor: pointer;
}
.ezi-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.ezi-switch-ui {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #c9d2d8;
  transition: background .18s ease;
  box-shadow: inset 0 0 0 1px rgba(16,35,49,.08);
}
.ezi-switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  inset-inline-end: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(16,35,49,.25);
  transition: inset-inline-start .18s ease, inset-inline-end .18s ease;
}
.ezi-switch input:checked + .ezi-switch-ui {
  background: var(--teal);
}
.ezi-switch input:checked + .ezi-switch-ui::after {
  inset-inline-end: auto;
  inset-inline-start: 3px;
}
.ezi-switch input:focus-visible + .ezi-switch-ui {
  outline: 2px solid rgba(8,127,107,.35);
  outline-offset: 2px;
}
.classifications-grid input.class-scope {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
  cursor: pointer;
}

.classifications-grid th:nth-child(n+2) { text-align: center; }
.classifications-grid .col-scope { min-width: 140px; }
.class-scope-select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 6px;
  color: var(--ink);
}
.users-search {
  display: block;
  min-width: min(100%, 320px);
}
.users-search input[type="search"] {
  width: 100%;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
}
.users-search input[type="search"]:focus {
  outline: 2px solid rgba(8,127,107,.25);
  border-color: var(--teal);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.field-hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.field-hint.ok { color: var(--ok); }
.field-hint.warn { color: var(--bad); }
.field input[readonly] {
  background: #f3f8f6;
  color: var(--ink);
}

.user-menu { position: relative; }
.user-menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 10px 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7fbfa;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.user-menu-toggle:hover,
.user-menu.is-open .user-menu-toggle {
  background: #fff;
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(8,127,107,.12);
}
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--teal);
  color: #fff;
  flex: 0 0 auto;
}
.user-menu-label {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-menu-caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--muted);
}
.user-menu.is-open .user-menu-caret { transform: rotate(180deg); }
.user-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  z-index: 50;
  min-width: 200px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(16,35,49,.16);
  display: grid;
  gap: 2px;
}
.user-menu-panel[hidden] { display: none !important; }
.user-menu-item {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-align: start;
  cursor: pointer;
}
.user-menu-item:hover { background: #f3f8f6; }
.user-menu-item.danger { color: var(--bad); }
.profile-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(16,35,49,.45);
  display: grid;
  place-items: center;
  padding: 20px;
}
.profile-modal-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 28px 70px rgba(16,35,49,.28);
}
.profile-modal-card h3 {
  margin: 0 0 14px;
  font-size: 20px;
}
.profile-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}
@media (max-width: 720px) {
  .user-menu-label { display: none; }
}


/* User details — classifications toggle grid */
.edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 8px 20px 12px;
}
.edit-actions .btn.is-active {
  border-color: var(--teal);
  color: var(--teal);
  box-shadow: 0 0 0 2px rgba(8,127,107,.12);
}
.entity-class-panel {
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-bottom: 8px;
  animation: classPanelIn .18s ease;
}
@keyframes classPanelIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.class-toggle-host {
  padding: 0 16px 12px;
}
.class-toggle-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
}
.class-toggle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  border-inline-end: 1px solid var(--line);
  cursor: pointer;
  background: #fff;
  user-select: none;
}
.class-toggle-item:hover {
  background: #f7fbfa;
}
.class-toggle-item.is-selected {
  background: rgba(8,127,107,.06);
}
.class-toggle-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
  text-align: start;
}
@media (max-width: 1100px) {
  .class-toggle-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 780px) {
  .class-toggle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .class-toggle-grid { grid-template-columns: 1fr; }
  .class-toggle-item { border-inline-end: 0; }
}
