/* ============================================================
   style.css — תקן מול איוש  |  RTL sidebar layout
   ============================================================ */

/* ── משתנים ── */
:root {
  --blue-dark:   #1B3A6B;
  --blue-mid:    #2A5298;
  --blue-light:  #EAF1FB;
  --gold:        #C9A84C;
  --gold-dark:   #A07C2A;
  --white:       #FFFFFF;
  --gray-bg:     #F0F2F7;
  --gray-light:  #F4F6FA;
  --gray-mid:    #DDE3EE;
  --gray-text:   #555E72;
  --green:       #27AE60;
  --green-light: #d4edda;
  --red:         #C0392B;
  --orange:      #E67E22;
  --sidebar-w:   240px;
  --font:        'Segoe UI', 'Arial Hebrew', Arial, sans-serif;
  --radius:      10px;
  --radius-sm:   6px;
  --shadow:      0 2px 12px rgba(27,58,107,.10);
  --shadow-md:   0 4px 24px rgba(27,58,107,.16);
}

/* ── כפתור המבורגר ── */
.hamburger-btn {
  position: fixed;
  top: 8px;
  right: 8px;
  z-index: 500;
  width: 38px;
  height: 38px;
  background: transparent;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 0;
  box-shadow: none;
  transition: background .15s;
}
.hamburger-btn:hover { background: rgba(255,255,255,.12); }
.hamburger-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

/* ── ריסט ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; height: 100%; }
body {
  font-family: var(--font);
  background: var(--gray-bg);
  color: #222;
  min-height: 100vh;
  direction: rtl;
}
a { color: inherit; }

/* ══════════════════════════════════════════
   APP SHELL — sidebar + main
   ══════════════════════════════════════════ */
.app-shell {
  display: flex;
  min-height: 100vh;
  flex-direction: row-reverse;
}

/* ── סרגל צד ── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--blue-dark);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; right: 0;
  height: 100vh;
  z-index: 200;
  box-shadow: -3px 0 18px rgba(0,0,0,.18);
  transition: transform 0.25s ease;
}
.main-area {
  transition: margin-right 0.25s ease, max-width 0.25s ease;
}
.sidebar-collapsed .sidebar {
  transform: translateX(100%);
}
.sidebar-collapsed .main-area {
  margin-right: 0 !important;
  max-width: 100vw !important;
}


.sidebar-logo {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 16px 54px 14px 12px;
  border-bottom: 1px solid rgba(255,255,255,.10);
  text-decoration: none;
}
.sidebar-brand-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding-right: 4px;
}
.sidebar-logo-icon {
  font-size: 28px;
  color: var(--gold);
}
.sidebar-logo-img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex-shrink: 0;
}
.sidebar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
  white-space: nowrap;
  align-self: flex-end;
  padding-bottom: 8px;
}
.sidebar-sub {
  font-size: 12px;
  color: #8aafd8;
  margin-top: 2px;
  white-space: nowrap;
  text-align: right;
  padding-right: 4px;
}

/* ── שם רשות בסרגל הצד ── */
.sidebar-authority-badge {
  margin: 10px 14px 8px;
  border-right: 3px solid var(--gold);
  padding: 5px 10px;
}
.sidebar-authority-name {
  font-size: 13px;
  font-weight: 700;
  color: #d4e4f7;
  line-height: 1.3;
}

/* ── ניווט ── */
.sidebar-nav {
  flex: 1;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: #c8d8f0;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background .14s, color .14s;
}
.nav-item:hover {
  background: rgba(255,255,255,.10);
  color: var(--white);
}
.nav-item.active {
  background: var(--gold);
  color: var(--blue-dark);
  font-weight: 700;
}
.nav-icon {
  font-size: 17px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

/* ── קטגוריות ניווט מתקפלות ── */
.nav-category {
  margin-bottom: 2px;
}
.nav-cat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  user-select: none;
  cursor: pointer;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  transition: background .14s;
}
.nav-cat-header:hover {
  background: rgba(255,255,255,.10);
  color: var(--gold);
}
.nav-cat-header.nav-cat-active {
  background: rgba(201,168,76,.15);
}
.nav-cat-icon {
  font-size: 15px;
  flex-shrink: 0;
}
.nav-cat-label {
  flex: 1;
}
.nav-cat-arrow {
  font-size: 13px;
  color: #8aafd8;
}
.nav-cat-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 4px;
}
.nav-item-sub {
  padding-right: 28px;
  font-size: 13.5px;
}
.nav-item-placeholder {
  padding: 8px 28px;
  font-size: 12.5px;
  color: #6a8aac;
  font-style: italic;
}
.nav-divider {
  height: 1px;
  background: rgba(255,255,255,.10);
  margin: 6px 10px 8px;
}

/* ── תחתית סרגל ── */
.sidebar-footer {
  padding: 16px 18px;
  border-top: 1px solid rgba(255,255,255,.10);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sidebar-user { min-width: 0; flex: 1; }
.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-org {
  font-size: 11px;
  color: #8aafd8;
  margin-top: 2px;
}
.sidebar-logout {
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  background: rgba(201,168,76,.18);
  color: var(--gold);
  border: 1px solid rgba(201,168,76,.35);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  transition: background .14s;
}
.sidebar-logout:hover { background: rgba(201,168,76,.35); }

/* ── אזור ראשי ── */
.main-area {
  flex: 1;
  margin-right: var(--sidebar-w);
  min-height: 100vh;
  padding: 32px 36px 48px;
  max-width: calc(100vw - var(--sidebar-w));
  overflow-x: hidden;
}

/* ══════════════════════════════════════════
   התראות
   ══════════════════════════════════════════ */
.alerts-wrap {
  margin-bottom: 20px;
}
.pub-alerts {
  position: fixed;
  top: 16px; left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  width: min(500px, 94vw);
}
.alert {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 8px;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #b8dcca; }
.alert-danger  { background: #f8d7da; color: #721c24; border: 1px solid #f1b8bc; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffdE70; }
.alert-info    { background: #d1ecf1; color: #0c5460; border: 1px solid #b8dfe7; }

/* ══════════════════════════════════════════
   כותרת עמוד
   ══════════════════════════════════════════ */
.page-header {
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--gold);
}
.page-title    { font-size: 22px; font-weight: 700; color: var(--blue-dark); }
.page-subtitle { font-size: 13px; color: var(--gray-text); margin-top: 5px; }
.inline-link   { color: var(--blue-mid); text-decoration: underline; font-size: inherit; }

/* ══════════════════════════════════════════
   כפתורים
   ══════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 22px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .14s, transform .1s, box-shadow .14s;
  gap: 6px;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0,0,0,.12); }
.btn:active { transform: translateY(0); }
.btn-primary   { background: var(--blue-dark); color: var(--white); }
.btn-primary:hover  { background: var(--blue-mid); }
.btn-secondary { background: var(--gray-mid);  color: var(--blue-dark); }
.btn-secondary:hover { background: #c6cfe0; }
.btn-success   { background: var(--green);  color: var(--white); }
.btn-success:hover  { background: #219150; }
.btn-danger    { background: var(--red);    color: var(--white); }
.btn-danger:hover   { background: #a02520; }
.btn-lg  { padding: 11px 30px; font-size: 15px; }
.btn-sm  { padding: 6px 14px;  font-size: 12px; }
.btn-full { width: 100%; }

/* ══════════════════════════════════════════
   כרטיס
   ══════════════════════════════════════════ */
.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-mid);
  box-shadow: var(--shadow);
  padding: 26px;
}

/* ══════════════════════════════════════════
   טפסים
   ══════════════════════════════════════════ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue-dark);
}
.form-input {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-mid);
  font-family: var(--font);
  font-size: 14px;
  background: var(--white);
  color: #222;
  transition: border-color .15s, box-shadow .15s;
  text-align: right;
  width: 100%;
}
.form-input:focus {
  outline: none;
  border-color: var(--blue-mid);
  box-shadow: 0 0 0 3px rgba(42,82,152,.15);
}
.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.password-wrapper .form-input {
  padding-left: 40px;
}
.password-eye {
  position: absolute;
  left: 10px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: #888;
  display: flex;
  align-items: center;
  transition: color .15s;
}
.password-eye:hover { color: var(--blue-dark); }
.eye-icon { width: 20px; height: 20px; }
.form-row        { display: flex; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.two-col .form-group   { flex: 1; min-width: 180px; }
.three-col .form-group { flex: 1; min-width: 150px; }
.checkbox-label  {
  display: flex; align-items: center; gap: 9px;
  font-size: 14px; cursor: pointer; font-weight: 500; color: var(--blue-dark);
}
.checkbox-label input { width: 16px; height: 16px; cursor: pointer; }
.form-actions    { display: flex; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.action-row      { display: flex; gap: 12px; flex-wrap: wrap; }

/* ══════════════════════════════════════════
   AUTH — עמוד כניסה (split screen)
   ══════════════════════════════════════════ */
.auth-split {
  min-height: 100vh;
  display: flex;
  direction: rtl;
}
.auth-brand {
  flex: 1;
  background: linear-gradient(145deg, var(--blue-dark) 0%, #2A5298 60%, #1a6b8a 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  color: var(--white);
  text-align: center;
}
.auth-brand-icon  { font-size: 64px; color: var(--gold); margin-bottom: 20px; }
.auth-brand-title { font-size: 28px; font-weight: 700; margin-bottom: 10px; }
.auth-brand-sub   { font-size: 14px; color: #adc4e8; margin-bottom: 40px; line-height: 1.6; }
.auth-features    { list-style: none; text-align: right; width: 100%; max-width: 320px; }
.auth-features li {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.10);
  font-size: 14px;
  color: #c8d8f0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.auth-features li:last-child { border-bottom: none; }
.feat-icon { font-size: 18px; }

.auth-form-panel {
  width: 440px;
  flex-shrink: 0;
  background: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
}
.auth-form-inner { width: 100%; }
.auth-form-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--blue-dark);
  margin-bottom: 6px;
}
.auth-form-sub {
  font-size: 13px;
  color: var(--gray-text);
  margin-bottom: 28px;
}
.auth-form-group { margin-bottom: 18px; }
.auth-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue-dark);
  margin-bottom: 6px;
}
.auth-forgot-row {
  text-align: left;
  margin-top: 12px;
}
.auth-forgot-link {
  font-size: 12px;
  color: var(--blue-mid);
  text-decoration: underline;
}

/* ══════════════════════════════════════════
   SETUP — עמוד הגדרות ראשוניות
   ══════════════════════════════════════════ */
.setup-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-bg);
  padding: 32px 16px;
}
.setup-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 40px 40px;
  width: 100%;
  max-width: 520px;
}
.setup-header { margin-bottom: 28px; }
.setup-icon   { font-size: 36px; margin-bottom: 8px; }
.setup-title  { font-size: 20px; font-weight: 700; color: var(--blue-dark); }
.setup-sub    { font-size: 13px; color: var(--gray-text); margin-top: 4px; }

/* ══════════════════════════════════════════
   WELCOME — עמוד כניסה
   ══════════════════════════════════════════ */
.welcome-hero {
  text-align: center;
  padding: 44px 0 32px;
}
.welcome-icon {
  font-size: 60px;
  color: var(--gold);
  display: block;
  margin-bottom: 16px;
}
.welcome-logo-img {
  width: 200px;
  height: 200px;
  object-fit: contain;
  display: block;
  margin: 0 auto 16px;
}
.welcome-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--blue-dark);
  margin-bottom: 10px;
}
.welcome-authority {
  font-size: 16px;
  font-weight: 700;
  color: var(--gold-dark);
  margin-bottom: 8px;
}
.welcome-desc {
  font-size: 14px;
  color: var(--gray-text);
  margin: 0 auto;
  max-width: 480px;
  line-height: 1.6;
}
.welcome-modules {
  display: flex;
  gap: 28px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 12px 0 48px;
}
.welcome-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: var(--white);
  border: 2px solid var(--gray-mid);
  border-radius: 18px;
  padding: 40px 48px;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform .18s, border-color .18s, box-shadow .18s;
  min-width: 240px;
  max-width: 300px;
  cursor: pointer;
}
.welcome-card:hover {
  transform: translateY(-5px);
  border-color: var(--gold);
  box-shadow: 0 10px 36px rgba(27,58,107,.16);
}
.wc-icon {
  font-size: 56px;
}
.wc-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--blue-dark);
}
.wc-desc {
  font-size: 13px;
  color: var(--gray-text);
  text-align: center;
  line-height: 1.6;
}
.wc-enter {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 700;
  color: var(--gold-dark);
  letter-spacing: 0.3px;
}
.welcome-card:hover .wc-enter {
  color: var(--gold);
}
.welcome-card-soon {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}
.wc-soon-badge {
  font-size: 11px;
  font-weight: 700;
  background: #fff3cd;
  color: #856404;
  padding: 4px 12px;
  border-radius: 12px;
}
.welcome-empty {
  text-align: center;
  padding: 56px 32px;
  color: var(--gray-text);
  background: var(--white);
  border: 1px solid var(--gray-mid);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ══════════════════════════════════════════
   DASHBOARD
   ══════════════════════════════════════════ */
.dash-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-mid);
  box-shadow: var(--shadow);
  padding: 22px 28px;
  margin-bottom: 28px;
}
.dash-welcome-text h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--blue-dark);
  margin-bottom: 4px;
}
.dash-welcome-text p {
  font-size: 13px;
  color: var(--gray-text);
}

/* כרטיסי סטטוס */
.dash-status-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
.dash-status-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-mid);
  box-shadow: var(--shadow);
  padding: 20px 18px;
  transition: transform .14s;
}
.dash-status-card:hover { transform: translateY(-2px); }

.ds-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}
.ds-icon { font-size: 26px; }
.ds-opt-tag {
  font-size: 10px;
  font-weight: 600;
  background: #f0f0f0;
  color: var(--gray-text);
  border-radius: 10px;
  padding: 2px 7px;
}
.ds-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--blue-dark);
  margin-bottom: 4px;
}
.ds-hint { font-size: 11.5px; color: var(--gray-text); margin-bottom: 14px; }
.ds-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.ds-badge.ok   { background: #d4edda; color: #155724; }
.ds-badge.miss { background: #fff3cd; color: #856404; }
.ds-status { margin-top: auto; }

.ds-ok   { border-color: #b8dcca; }
.ds-miss { border-color: var(--gray-mid); }

/* רצועת קבצים שהועלו */
.uploaded-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--white);
  border: 1px solid #b8dcca;
  border-radius: var(--radius);
  padding: 12px 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.ustrip-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-text);
  flex-shrink: 0;
}
.ustrip-file {
  background: #d4edda;
  color: #155724;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
}
.ustrip-missing {
  background: #fff3cd;
  color: #856404;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
}
.ustrip-link {
  margin-right: auto;
  font-size: 12.5px;
  color: var(--blue-mid);
  text-decoration: underline;
}

/* פעולות מהירות */
.dash-quick { margin-bottom: 28px; }
.dash-section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--blue-dark);
  margin-bottom: 16px;
}
.quick-grid {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.quick-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1px solid var(--gray-mid);
  border-radius: var(--radius);
  padding: 22px 28px;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform .14s, border-color .14s, box-shadow .14s;
  min-width: 120px;
}
.quick-card:hover {
  transform: translateY(-3px);
  border-color: var(--blue-mid);
  box-shadow: var(--shadow-md);
}
.quick-icon  { font-size: 28px; }
.quick-label { font-size: 13px; font-weight: 600; color: var(--blue-dark); white-space: nowrap; }

/* מדריך שימוש */
.dash-guide { }
.dash-guide h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--blue-dark);
  margin-bottom: 20px;
}
.guide-steps {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
}
.guide-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex: 1;
  min-width: 160px;
  padding: 0 20px 0 20px;
  border-left: 1px solid var(--gray-mid);
}
.guide-step:first-child { padding-right: 0; }
.guide-step:last-child  { border-left: none; }

.gs-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue-dark);
  color: var(--white);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.gs-text strong {
  display: block;
  font-size: 14px;
  color: var(--blue-dark);
  margin-bottom: 3px;
}
.gs-text span { font-size: 12px; color: var(--gray-text); }

/* ══════════════════════════════════════════
   UPLOAD
   ══════════════════════════════════════════ */
.upload-sections {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.upload-block {
  background: var(--white);
  border: 1px solid var(--gray-mid);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  transition: border-color .14s;
}
.upload-block.ublock-ok   { border-color: #b8dcca; background: #f8fffe; }
.upload-block.drag-over   { border-color: var(--blue-mid); background: var(--blue-light); }

.ublock-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}
.ublock-meta   { flex: 1; }
.ublock-title  {
  font-size: 15px;
  font-weight: 700;
  color: var(--blue-dark);
  display: block;
  margin-bottom: 3px;
}
.ublock-hint {
  font-size: 12.5px;
  color: var(--gray-text);
}
.ublock-hint-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--gray-text);
}
.optional-tag {
  font-size: 10.5px;
  font-weight: 600;
  background: #f0f0f0;
  color: var(--gray-text);
  border-radius: 10px;
  padding: 2px 8px;
}

.ubadge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.ubadge.ok      { background: #d4edda; color: #155724; }
.ubadge.miss    { background: #fff3cd; color: #856404; }
.ubadge.neutral { background: var(--gray-light); color: var(--gray-text); }

.upload-btn-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  background: var(--blue-dark);
  color: var(--white);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .14s, transform .1s;
}
.upload-btn-label:hover { background: var(--blue-mid); transform: translateY(-1px); }
.upload-btn-label.secondary {
  background: var(--gray-mid);
  color: var(--blue-dark);
}
.upload-btn-label.secondary:hover { background: #c6cfe0; }

/* מסתיר input קובץ בצורה שהדפדפן עדיין מזהה — לא display:none */
.file-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;
  opacity: 0;
}

.upload-drop-hint {
  display: inline-block;
  margin-right: 12px;
  font-size: 12px;
  color: var(--gray-text);
}

.upload-prog {
  margin-top: 10px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.upload-prog.uploading { background: #e8f4fd; color: var(--blue-dark); }
.upload-prog.done      { background: #d4edda; color: #155724; }
.upload-prog.error     { background: #f8d7da; color: #721c24; }

/* ══════════════════════════════════════════
   CALCULATE — סטטוס קבצים
   ══════════════════════════════════════════ */
.file-status-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  align-items: center;
}
.fstatus {
  padding: 5px 13px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
}
.fstatus.ok      { background: #d4edda; color: #155724; }
.fstatus.warn    { background: #fff3cd; color: #856404; }
.fstatus.neutral { background: var(--gray-light); color: var(--gray-text); border: 1px solid var(--gray-mid); }
.fstatus-link {
  font-size: 12.5px;
  color: var(--blue-mid);
  text-decoration: underline;
  margin-right: 6px;
}

.calc-form { max-width: 680px; }

/* ══════════════════════════════════════════
   SETTINGS
   ══════════════════════════════════════════ */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 22px;
  align-items: start;
}
.settings-card { } /* inherits .card padding */
.settings-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--blue-dark);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-mid);
}

/* ══════════════════════════════════════════
   RESULTS
   ══════════════════════════════════════════ */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}
.results-actions { display: flex; gap: 10px; }
.results-section { margin-bottom: 32px; }
.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--blue-dark);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gray-mid);
  cursor: pointer;
  user-select: none;
}
.toggle-arrow    { margin-right: 8px; color: var(--blue-mid); }
.toggle-header   { cursor: pointer; user-select: none; }
.collapsible-body { }
.total-row td    { font-weight: 700; }

.table-wrapper { overflow-x: auto; }
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  direction: rtl;
}
.results-table th {
  background: var(--blue-dark);
  color: var(--white);
  padding: 10px 14px;
  text-align: center;
  font-weight: 600;
  white-space: nowrap;
}
.results-table td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--gray-mid);
  text-align: center;
  vertical-align: middle;
  transition: background .12s ease;
}
.results-table tbody tr:nth-child(even) { background: transparent; }
.results-table tbody tr:hover { background: #d6e8f8; }
.results-table tfoot tr { background: var(--blue-dark); color: var(--white); font-weight: 700; }
.results-table tfoot td { padding: 10px 14px; }
.role-name { text-align: right; font-weight: 500; }
.num   { font-variant-numeric: tabular-nums; font-family: 'Courier New', monospace; }
.money { color: #1a5c2e; font-weight: 600; }
.empty-msg { color: var(--gray-text); font-size: 14px; padding: 20px 0; text-align: center; }

/* ══════════════════════════════════════════
   AUTH body + brand panel inner
   ══════════════════════════════════════════ */
.auth-body {
  background: linear-gradient(145deg, var(--blue-dark) 0%, #2A5298 60%, #1a6b8a 100%);
  min-height: 100vh;
}

/* brand panel — inner elements */
.brand-inner  { text-align: center; max-width: 340px; }
.brand-icon   { font-size: 60px; color: var(--gold); margin-bottom: 18px; }
.brand-logo-img { width: 180px; height: 180px; object-fit: contain; margin-bottom: 18px; }
.brand-name   { font-size: 26px; font-weight: 700; color: var(--white); margin-bottom: 10px; }
.brand-desc   { font-size: 20px; color: #adc4e8; margin-bottom: 30px; line-height: 1.7; }
.brand-features { text-align: right; }
.brand-feat   {
  padding: 9px 0;
  border-bottom: 1px solid rgba(255,255,255,.10);
  font-size: 14px;
  color: #c8d8f0;
}
.brand-feat:last-child { border-bottom: none; }

/* form panel — title + links */
.auth-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--blue-dark);
  margin-bottom: 22px;
}
.auth-form .form-group { margin-bottom: 16px; }
.auth-links {
  margin-top: 16px;
  text-align: center;
}
.auth-link {
  font-size: 13px;
  color: var(--blue-mid);
  text-decoration: underline;
}
.auth-footer {
  margin-top: 28px;
  text-align: center;
  font-size: 11.5px;
  color: var(--gray-text);
}

/* ── כרטיס ציבורי קטן (forgot / reset) ── */
.auth-center-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-small-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(0,0,0,.28);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
}
.auth-card-header {
  text-align: center;
  margin-bottom: 24px;
}
.auth-card-icon { font-size: 38px; margin-bottom: 10px; }
.auth-card-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--blue-dark);
}
.auth-small-card .form-group { margin-bottom: 16px; }

/* ══════════════════════════════════════════
   MISC
   ══════════════════════════════════════════ */
.info-box {
  background: var(--blue-light);
  border-radius: var(--radius);
  border: 1px solid #b8cfe0;
  padding: 20px 24px;
  margin-top: 24px;
}
.info-box h3 { color: var(--blue-dark); font-size: 15px; margin-bottom: 12px; }
.info-box li { margin-bottom: 8px; font-size: 14px; line-height: 1.6; }
.hidden { display: none !important; }

/* ══════════════════════════════════════════
   ביטול צביעת שורות חלופיות — hover בלבד
   ══════════════════════════════════════════ */
.results-table tbody tr:nth-child(even),
.emp-table tbody tr.main-row:nth-child(4n+1),
.emp-table tbody tr.main-row:nth-child(4n+3),
.clients-table tbody tr:nth-child(even) {
  background: transparent !important;
}
.results-table tbody tr:nth-child(even) td,
.results-table tbody tr:nth-child(odd) td,
.clients-table tbody tr:nth-child(even) td {
  background: transparent !important;
}
/* emp-table — שורות רגילות: transparent כדי שה-tr יראה */
.emp-table tbody tr.main-row:not(.row-has-errors):not(.row-has-warnings):not(.row-has-info) td {
  background: transparent !important;
}
/* hover — כל השורות, בכל טבלאות האפליקציה */
.results-table tr:hover td,
.clients-table tbody tr:hover td,
.audit-table tbody tr:hover td,
.roles-table tbody tr:hover td,
.rv-table tbody tr:hover td {
  background: #cce0ff !important;
}
.emp-table tr.main-row:hover td { background: #cce0ff !important; }
/* שורות שגויות — רקע + hover (כל העובדים בלבד) — כולן בצבע כתום אחיד */
.emp-table tbody:not(.errors-tab-active) tr.row-has-errors td,
.emp-table tbody:not(.errors-tab-active) tr.row-has-warnings td,
.emp-table tbody:not(.errors-tab-active) tr.row-has-info     td { background: #feecc0 !important; }
.emp-table tbody:not(.errors-tab-active) tr.row-has-errors:hover td,
.emp-table tbody:not(.errors-tab-active) tr.row-has-warnings:hover td,
.emp-table tbody:not(.errors-tab-active) tr.row-has-info:hover   td { background: #fde0a0 !important; }
/* שגויים tab — ללא רקע לשורות שגויות */
.emp-table tbody.errors-tab-active tr.row-has-errors   td,
.emp-table tbody.errors-tab-active tr.row-has-warnings td,
.emp-table tbody.errors-tab-active tr.row-has-info     td { background: transparent !important; }
/* גבול שמאלי — כולן כתום אחיד */
.emp-table tbody tr.row-has-errors   td:last-child,
.emp-table tbody tr.row-has-warnings td:last-child,
.emp-table tbody tr.row-has-info     td:last-child { border-left: 4px solid #f57c00 !important; }
/* גבולות עליונים/תחתונים — כולן כתום אחיד */
.emp-table tbody:not(.errors-tab-active) tr.row-has-errors   td,
.emp-table tbody:not(.errors-tab-active) tr.row-has-warnings td,
.emp-table tbody:not(.errors-tab-active) tr.row-has-info     td { border-top:1.5px solid #e8cc88 !important; border-bottom:1.5px solid #e8cc88 !important; }
.total-row td, .total-row:hover td { background: #1B3A6B !important; color: #fff !important; }

/* ══════════════════════════════════════════
   כפתור חזור
   ══════════════════════════════════════════ */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border: 1.5px solid #c0d0ee;
  border-radius: 8px;
  background: #f0f6ff;
  color: #1B3A6B;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  margin-bottom: 16px;
  transition: background .14s, border-color .14s;
  font-family: inherit;
}
.btn-back:hover { background: #dde8ff; border-color: #1B3A6B; }

/* ══════════════════════════════════════════
   כפתורי ייצוא / הדפסה
   ══════════════════════════════════════════ */
.btn-print {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border: 1.5px solid #c0d0ee;
  border-radius: 6px;
  background: #f0f6ff;
  color: #1B3A6B;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .14s;
  font-family: inherit;
}
.btn-print:hover { background: #dde8ff; }

/* ── כפתור ייצוא לאקסל — עיצוב אחיד בכל הדפים ── */
.btn-excel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border: 1.5px solid #1a7040;
  border-radius: 6px;
  background: #27ae60;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .14s;
  font-family: inherit;
  white-space: nowrap;
}
.btn-excel:hover { background: #219150; border-color: #155e34; }

/* ══════════════════════════════════════════
   password-strength
   ══════════════════════════════════════════ */
.pwd-req { font-size: 12px; line-height: 1.8; margin-top: 8px; }
.pwd-req li { list-style: none; }
.pwd-req li.ok  { color: #27ae60; }
.pwd-req li.bad { color: #c0392b; }
.pwd-req li::before { content: '● '; font-size: 10px; margin-left: 4px; }

/* ══════════════════════════════════════════
   רספונסיב
   ══════════════════════════════════════════ */
@media (max-width: 900px) {
  :root { --sidebar-w: 200px; }
  .main-area { padding: 20px 18px 40px; }
  .dash-status-row { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
  .guide-steps { flex-direction: column; gap: 16px; }
  .guide-step { border-left: none; border-bottom: 1px solid var(--gray-mid); padding: 0 0 16px 0; }
  .guide-step:last-child { border-bottom: none; }
}

@media (max-width: 640px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .sidebar-logo { border-bottom: none; padding: 14px 16px; }
  .sidebar-nav  { flex-direction: row; padding: 8px 10px; flex: none; width: 100%; order: 3; }
  .sidebar-footer { order: 2; border-top: none; border-right: 1px solid rgba(255,255,255,.1); }
  .main-area { margin-right: 0; max-width: 100vw; padding: 16px; }
  .auth-split { flex-direction: column; }
  .auth-brand { display: none; }
  .auth-form-panel { width: 100%; padding: 32px 22px; }
  .dash-status-row { grid-template-columns: 1fr 1fr; }
  .quick-card { min-width: 90px; padding: 16px 14px; }
}
