* { box-sizing: border-box; }

/* ----- לוגו המשרד (קובץ אמיתי logo.png) ----- */
.logo-img { display: block; height: 46px; width: auto; background: #fff; border-radius: 6px; padding: 4px 10px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.header-logo-img { height: 40px; }
.login-logo-img { height: 56px; margin: 0 auto 16px; }
.report-logo-img { height: 50px; margin: 0 auto 12px; }

/* ----- לוגו המשרד (שחזור; גיבוי) ----- */
.firm-logo { display: inline-flex; align-items: center; gap: 12px; background: #14305c; border-radius: 8px; padding: 8px 16px; }
.firm-logo .fl-mark {
  width: 44px; height: 44px; border: 2px solid #c9a24a; color: #c9a24a;
  font: 800 28px Georgia, 'Times New Roman', serif;
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.firm-logo .fl-text { text-align: right; line-height: 1.15; }
.firm-logo .fl-name { color: #fff; font-weight: 700; font-size: 18px; white-space: nowrap; }
.firm-logo .fl-sub { color: #c9a24a; font-size: 13px; letter-spacing: 2px; }
.firm-logo, .firm-logo * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.header-logo { padding: 6px 12px; }
.header-logo .fl-mark { width: 36px; height: 36px; font-size: 24px; }
.header-logo .fl-name { font-size: 15px; }
.header-logo .fl-sub { font-size: 11px; }
.report-logo { display: flex; width: max-content; margin: 0 auto 14px; }
body {
  margin: 0;
  font-family: 'Segoe UI', 'Arial Hebrew', Arial, sans-serif;
  background: #f4f6f9;
  color: #1f2937;
  direction: rtl;
}
header {
  background: #1e3a5f;
  color: #fff;
  padding: 16px 24px;
  display: flex;
  align-items: baseline;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
}
.header-logo-link { display: inline-flex; align-items: center; cursor: pointer; transition: opacity .15s; align-self: center; }
.header-logo-link:hover { opacity: .85; }
header h1 { margin: 0; font-size: 22px; }
.subtitle { color: #cdd9e8; font-size: 14px; }
/* ----- אזור הפעולות בסרגל העליון ----- */
.header-actions { margin-right: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn { background: rgba(255,255,255,.12); color: #fff; border: none; border-radius: 8px; font-size: 15px; padding: 6px 10px; cursor: pointer; line-height: 1; position: relative; }
.icon-btn:hover { background: rgba(255,255,255,.25); }
#notif-bell .notif-count { display: inline-block; min-width: 15px; margin-right: 3px; font-weight: 700; font-size: 12px; }
#notif-bell.has-notif { background: #c9a24a; color: #1e3a5f; }
#notif-bell.has-notif:hover { background: #d9b25e; }
.accent-btn { background: #c9a24a; color: #1e3a5f; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; padding: 7px 14px; cursor: pointer; white-space: nowrap; }
.accent-btn:hover { background: #d9b25e; }

/* תפריט משתמש */
.user-menu { position: relative; }
.user-chip { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.12); border: none; border-radius: 999px; padding: 4px 12px 4px 5px; cursor: pointer; color: #fff; font-size: 13px; }
.user-chip:hover { background: rgba(255,255,255,.22); }
.user-avatar { width: 26px; height: 26px; border-radius: 50%; background: #c9a24a; color: #1e3a5f; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; flex: 0 0 auto; }
.user-chip .user-name { white-space: nowrap; }
.user-chip .chev { font-size: 11px; color: #cdd9e8; }
.user-dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 190px; background: #fff;
  border: 1px solid #e6ebf1; border-radius: 12px; box-shadow: 0 10px 30px rgba(16,40,80,.18);
  padding: 6px; z-index: 100; display: flex; flex-direction: column; gap: 2px;
}
.user-dropdown button {
  background: none; border: none; text-align: right; padding: 9px 12px; border-radius: 8px;
  font-size: 13.5px; color: #1e293b; cursor: pointer; width: 100%;
}
.user-dropdown button:hover { background: #f3f7fc; }
.user-dropdown .danger-item { color: #b91c1c; }
.user-dropdown .danger-item:hover { background: #fef2f2; }
.menu-sep { height: 1px; background: #eef2f7; margin: 4px 2px; }
.lang-tag { background: #eef2f7; color: #1e3a5f; border: 1px solid #dbe3ec; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; margin-right: 6px; vertical-align: middle; }

/* כפתור החלפת שפה בטופס הלקוח */
.lang-btn {
  margin-right: auto; background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.35);
  font-size: 13px; padding: 6px 14px; border-radius: 8px; cursor: pointer; white-space: nowrap;
}
.lang-btn:hover { background: rgba(255,255,255,.28); }
html[dir="ltr"] .lang-btn { margin-right: 0; margin-left: auto; }
html[dir="ltr"] .client-main, html[dir="ltr"] .panel { text-align: left; }

#syslog-table tr.log-warn td { background: #fffbeb; }
#syslog-table tr.log-bad td { background: #fef2f2; color: #991b1b; }
#syslog-table tr.log-ok td:nth-child(3) { color: #15803d; font-weight: 600; }
.crossrate-note { margin-top: 12px; font-size: 12px; color: #6b7280; padding: 8px 10px; background: #f8fafc; border-right: 3px solid #c9a24a; border-radius: 0 6px 6px 0; line-height: 1.6; }
.crossrate-tag { color: #c9a24a; font-weight: 700; margin: 0 3px; cursor: help; }
/* כפתור וואטסאפ */
.wa-btn { background: #25d366; color: #fff; border: none; border-radius: 8px; padding: 6px 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.wa-btn:hover { background: #1eb855; }
.wa-btn:disabled { background: #9ee3b8; cursor: default; }
#wa-result { margin-top: 6px; }
#wa-result a { color: #1e3a5f; font-weight: 600; }

/* ----- מסך התחברות (מפוצל וממותג) ----- */
.login-body { min-height: 100vh; background: #eef2f7; display: flex; }
.login-split { display: flex; width: 100%; min-height: 100vh; }
.login-brand {
  flex: 1; background: linear-gradient(140deg, #1e3a5f, #142a47);
  color: #fff; padding: 48px 44px; display: flex; flex-direction: column; justify-content: center; gap: 14px;
}
.login-brand .brand-logo { height: 60px; width: auto; background: #fff; border-radius: 10px; padding: 8px 14px; align-self: flex-start; }
.login-brand h1 { font-size: 2rem; font-weight: 800; margin-top: 8px; }
.login-brand .brand-tag { color: #cdd9e8; font-size: 1.05rem; }
.brand-feats { list-style: none; margin-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.brand-feats li { display: flex; align-items: center; gap: 12px; font-size: 1rem; color: #e8eef7; }
.brand-feats li span { font-size: 1.4rem; background: rgba(201,162,74,.18); width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.login-form-wrap { flex: 0 0 440px; display: flex; align-items: center; justify-content: center; padding: 30px; }
.login-card { background: #fff; padding: 36px; border-radius: 16px; width: 360px; max-width: 100%; box-shadow: 0 10px 40px rgba(16,40,80,.12); }
.login-card h2 { margin: 0; font-size: 24px; color: #1e3a5f; }
.login-sub { color: #6b7280; font-size: 14px; margin: 4px 0 20px; }
@media (max-width: 820px) {
  .login-split { flex-direction: column; min-height: auto; }
  .login-brand { padding: 32px 24px; }
  .login-brand h1 { font-size: 1.5rem; }
  .brand-feats li { font-size: .92rem; }
  .login-form-wrap { flex: 1 1 auto; padding: 24px; }
}
#login-form { display: flex; flex-direction: column; gap: 14px; }
#login-form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: #4b5563; }
#login-form button { padding: 11px; font-size: 15px; }
.login-error { color: #b91c1c; font-size: 13px; text-align: center; min-height: 16px; }

/* ----- רשימת לקוחות + חיפוש ----- */
.clients-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.clients-head h2 { margin: 0; }
.count-badge { display: inline-block; background: #eef2f7; color: #1e3a5f; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; vertical-align: middle; }
.search-row { position: relative; margin-bottom: 12px; }
.search-row .search-ico { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 14px; opacity: .6; pointer-events: none; }
#client-search { width: 100%; box-sizing: border-box; padding: 10px 36px 10px 12px; border: 1px solid #d6dde6; border-radius: 10px; font-size: 14px; background: #fff; }
#client-search:focus { outline: none; border-color: #1e3a5f; box-shadow: 0 0 0 3px rgba(30,58,95,.12); }

.client-cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 62vh; overflow-y: auto; }
.client-cards li.client-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #fff; border: 1px solid #e6ebf1; border-radius: 12px; cursor: pointer; transition: all .12s; margin-bottom: 0; }
.client-cards li.client-card:hover { border-color: #c9a24a; background: #fff; box-shadow: 0 3px 12px rgba(16,40,80,.08); transform: translateY(-1px); }
.client-cards li.client-card.active { border-color: #1e3a5f; background: #f3f7fc; box-shadow: inset 3px 0 0 #c9a24a; }
.client-card .avatar { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, #1e3a5f, #2d5a8f); color: #fff; font-weight: 700; font-size: 17px; display: flex; align-items: center; justify-content: center; }
.client-card .client-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.client-card .client-info strong { font-size: 15px; color: #1e293b; }
.client-card .client-sub { color: #475569; font-size: 12.5px; }
.client-card .client-meta { color: #64748b; font-size: 12px; }
.client-card .client-meta .dot { margin: 0 6px; opacity: .5; }
.client-card .client-go { color: #c9a24a; font-size: 22px; font-weight: 700; line-height: 1; opacity: 0; transition: opacity .12s; }
.client-card:hover .client-go, .client-card.active .client-go { opacity: 1; }
.client-card .del-client-btn { flex: 0 0 auto; padding: 4px 9px; font-size: 12px; }

/* ----- טאבים ראשיים ----- */
.main-tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 2px solid #e6ebf1; }
.main-tabs .tab-btn {
  background: none; border: none; border-bottom: 3px solid transparent; margin-bottom: -2px;
  padding: 10px 18px; font-size: 15px; font-weight: 600; color: #64748b; cursor: pointer; border-radius: 0;
}
.main-tabs .tab-btn:hover { color: #1e3a5f; background: #f3f7fc; }
.main-tabs .tab-btn.active { color: #1e3a5f; border-bottom-color: #c9a24a; }

/* ----- כרטיסי סטטיסטיקה (טבלת בקשות) ----- */
.req-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 16px; }
.stat-card {
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  padding: 11px 13px; border-radius: 12px; border: 1px solid transparent; background: #f1f5f9;
  cursor: pointer; transition: all .12s; text-align: right;
}
.stat-card:hover { background: #e8eef6; }
.stat-card.sel { border-color: #1e3a5f; background: #fff; box-shadow: 0 0 0 2px rgba(30,58,95,.15); }
.stat-card .sc-top { display: flex; align-items: center; gap: 6px; }
.stat-card .sc-ic { font-size: 13px; line-height: 1; }
.stat-card .sc-label { font-size: 12px; color: #64748b; font-weight: 600; white-space: nowrap; }
.stat-card .sc-num { font-size: 22px; font-weight: 700; line-height: 1; color: #1e293b; }
/* הכרטיס שדורש טיפול — בולט */
.stat-card.needs-action { background: #fef3c7; box-shadow: inset 0 0 0 1.5px #f59e0b; }
.stat-card.needs-action:hover { background: #fde9a9; }
.stat-card.needs-action .sc-label { color: #92400e; }
.stat-card.needs-action .sc-num { color: #78350f; }

/* ----- כרטיס טבלה ----- */
.table-card { background: #fff; border: 1px solid #e6ebf1; border-radius: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06); overflow: hidden; }
.table-toolbar { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid #eef2f7; }
.search-row.grow { flex: 1; margin: 0; }
.search-row.grow #req-search,
.table-toolbar input[type="search"] { width: 100%; box-sizing: border-box; padding: 10px 36px 10px 12px; border: 1px solid #d6dde6; border-radius: 10px; font-size: 14px; }
.table-toolbar input[type="search"]:focus { outline: none; border-color: #1e3a5f; box-shadow: 0 0 0 3px rgba(30,58,95,.12); }
.status-filter { padding: 10px 12px; border: 1px solid #d6dde6; border-radius: 10px; font-size: 14px; background: #fff; min-width: 160px; }
.table-scroll { overflow-x: auto; }

/* ----- טבלת בקשות ----- */
.req-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.req-table thead th {
  text-align: right; padding: 12px 14px; font-size: 12.5px; font-weight: 700; color: #64748b;
  background: #f8fafc; border-bottom: 1px solid #e6ebf1; white-space: nowrap; position: sticky; top: 0;
}
.req-table thead th[data-sort] { cursor: pointer; user-select: none; }
.req-table thead th[data-sort]:hover { background: #eef2f7; color: #1e3a5f; }
.req-table thead th.sort-asc::after { content: ' ▲'; font-size: 9px; color: #c9a24a; }
.req-table thead th.sort-desc::after { content: ' ▼'; font-size: 9px; color: #c9a24a; }
.req-table tbody td { padding: 8px 14px; border-bottom: 1px solid #f1f5f9; color: #334155; vertical-align: middle; }

/* תאים דו-שורתיים, ריקים רכים, ונקודת סטטוס */
.cell-stack { display: flex; flex-direction: column; line-height: 1.35; }
.cell-sub { font-size: 12.5px; color: #475569; font-weight: 500; margin-right: 6px; }
.cell-stack .cell-sub { margin-right: 0; }
.cell-empty { color: #cbd5e1; font-size: 12px; }
/* תאריכים — בולטים וקריאים */
.req-table .td-date { font-size: 13.5px; color: #1e293b; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.req-table .td-date .cell-empty { font-weight: 400; }

/* סטטוס — נקודה + טקסט באותו צבע */
.status-text { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.status-text .status-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.status-text.badge-gray   { color: #475569; }
.status-text.badge-gray   .status-dot { background: #94a3b8; }
.status-text.badge-blue   { color: #185fa5; }
.status-text.badge-blue   .status-dot { background: #378add; }
.status-text.badge-orange { color: #92400e; }
.status-text.badge-orange .status-dot { background: #f59e0b; }
.status-text.badge-green  { color: #15803d; }
.status-text.badge-green  .status-dot { background: #16a34a; }
.req-table tbody tr { cursor: pointer; transition: background .1s; }
.req-table tbody tr:nth-child(even) { background: #fbfcfe; }
.req-table tbody tr:hover { background: #f3f7fc; }
.req-table tbody tr:last-child td { border-bottom: none; }
.td-client { display: flex; align-items: center; gap: 9px; font-weight: 600; color: #1e293b; white-space: nowrap; }
.mini-avatar { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; background: linear-gradient(135deg, #1e3a5f, #2d5a8f); color: #fff; font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.td-contact { color: #64748b; font-size: 13px; direction: ltr; text-align: right; }
.td-center { text-align: center; }
.pend-dot { color: #f59e0b; font-size: 11px; }
.view-btn { background: #eef2f7; color: #1e3a5f; border: 1px solid #dbe3ec; padding: 6px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.view-btn:hover { background: #1e3a5f; color: #fff; }

/* ----- טבלת לקוחות / נסיעות (רמות 1-2) ----- */
.toolbar-title { margin: 0; font-size: 17px; color: #1e3a5f; white-space: nowrap; }
.primary-btn { background: #1e3a5f; color: #fff; border: none; border-radius: 10px; padding: 9px 16px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.primary-btn:hover { background: #16304f; }
.toolbar-form { padding: 0 16px 14px; }
.req-table .td-soft { color: #64748b; }
.req-table .td-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-start; white-space: nowrap; }
.icon-del { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; border-radius: 8px; padding: 6px 9px; font-size: 12px; cursor: pointer; line-height: 1; }
.icon-del:hover { background: #dc2626; color: #fff; }
.count-pill { display: inline-block; background: #eef2f7; color: #1e3a5f; font-weight: 700; font-size: 12px; padding: 2px 11px; border-radius: 999px; }
.req-table tr.row-active { background: #f3f7fc !important; box-shadow: inset 3px 0 0 #c9a24a; }
.table-scroll .empty { padding: 28px 16px; text-align: center; color: #94a3b8; font-size: 14px; }

/* ----- עמוד לקוח (רמה 2) ----- */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #64748b; margin-bottom: 14px; }
.breadcrumb .bc-sep { opacity: .5; }
.breadcrumb #bc-client-name { color: #1e3a5f; font-weight: 600; }
.linkish { background: none; border: none; color: #1e3a5f; font-size: 13px; font-weight: 600; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.linkish:hover { background: #eef2f7; }
.client-header-card { display: flex; align-items: center; gap: 16px; background: #fff; border: 1px solid #e6ebf1; border-radius: 16px; padding: 18px 20px; box-shadow: 0 1px 3px rgba(0,0,0,.06); margin-bottom: 16px; flex-wrap: wrap; }
.ch-avatar { width: 56px; height: 56px; flex: 0 0 56px; border-radius: 50%; background: linear-gradient(135deg, #1e3a5f, #2d5a8f); color: #fff; font-weight: 700; font-size: 24px; display: flex; align-items: center; justify-content: center; }
.ch-main { flex: 1; min-width: 140px; }
.ch-name { font-size: 20px; font-weight: 700; color: #1e293b; }
.ch-sub { font-size: 14px; color: #64748b; margin-top: 2px; }
.ch-meta { display: flex; gap: 24px; text-align: center; }
.ch-meta-v { font-size: 14px; color: #1e293b; font-weight: 600; }
.ch-meta-l { font-size: 11px; color: #94a3b8; margin-top: 2px; }
.trips-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 4px 10px; }
.trips-head h3 { margin: 0; font-size: 16px; color: #1e3a5f; }
#edit-client-form { background: #f8fafc; border: 1px solid #e6ebf1; border-radius: 12px; padding: 14px; margin-bottom: 16px; }
@media (max-width: 720px) {
  .table-toolbar .toolbar-title { width: 100%; }
  .client-header-card { gap: 12px; }
  .ch-meta { gap: 14px; width: 100%; justify-content: flex-start; }
}

/* ----- תגיות סטטוס (בטבלת הבקשות) ----- */
.req-table .badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; margin: 0; }
.req-table .badge-gray   { background: #f1f5f9; color: #475569; }
.req-table .badge-blue   { background: #dbeafe; color: #1d4ed8; }
.req-table .badge-orange { background: #fef3c7; color: #b45309; }
.req-table .badge-green  { background: #dcfce7; color: #15803d; }

@media (max-width: 720px) {
  .req-stats { grid-template-columns: repeat(2, 1fr); }
  .table-toolbar { flex-direction: column; align-items: stretch; }
  .status-filter { min-width: 0; }
}

main { padding: 16px; }
.clients-grid {
  display: grid;
  grid-template-columns: 260px 280px 1fr;
  gap: 16px;
  align-items: start;
}
.panel {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.panel.wide { grid-column: 3; }
.panel h2 { margin: 0 0 12px; font-size: 17px; color: #1e3a5f; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.panel-head h2 { margin: 0; }
.panel h3 { margin: 20px 0 8px; font-size: 15px; color: #374151; }
.hidden { display: none; }
.req { color: #dc2626; font-weight: 700; }

.inline-form { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.inline-form input, .inline-form select { flex: 1; min-width: 90px; }

.grid-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}
.grid-form label, .inline-form { font-size: 13px; color: #4b5563; }
.grid-form label { display: flex; flex-direction: column; gap: 4px; }
.checkbox-label { flex-direction: row !important; align-items: center; gap: 8px; }
.dest-block { border: 1px dashed #d1d5db; border-radius: 8px; padding: 10px; }
.dest-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: #4b5563; margin-bottom: 8px; }
.dest-row { display: flex; gap: 6px; margin-bottom: 6px; }
.dest-row .dest-city { flex: 1; min-width: 0; }
.dest-row .dest-country { flex: 1; min-width: 0; }
.dest-row .dest-remove { flex: 0 0 auto; padding: 4px 10px; }
.edu-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.edu-fields.hidden { display: none; }
.grid-form button { grid-column: 1 / -1; }
.grid-form .span-2 { grid-column: 1 / -1; }
.grid-form h3.span-2 { margin: 8px 0 0; border-top: 1px solid #eef0f3; padding-top: 12px; color: #1e3a5f; }
textarea { font-family: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 6px; resize: vertical; }
textarea:focus { outline: 2px solid #2563eb33; border-color: #2563eb; }

input, select, button {
  font-family: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
}
input:focus, select:focus { outline: 2px solid #2563eb33; border-color: #2563eb; }

button {
  background: #1e3a5f;
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: 600;
}
button:hover { background: #16304f; }
button.secondary { background: #e5e7eb; color: #1f2937; }
button.secondary:hover { background: #d1d5db; }
button.danger { background: transparent; color: #dc2626; padding: 2px 6px; }

.list { list-style: none; margin: 0; padding: 0; }
.list li {
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  border: 1px solid transparent;
}
.list li:hover { background: #f3f4f6; }
.list li.active { background: #e0ecff; border-color: #93c5fd; }
.list li small { color: #6b7280; display: block; }

.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td { padding: 8px 10px; text-align: right; border-bottom: 1px solid #eef0f3; }
.data-table th { background: #f8fafc; color: #475569; font-weight: 600; }

#report-content { margin-top: 8px; }
.report-actions { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.report-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.report-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 8px; }
.report-table th, .report-table td { padding: 8px 10px; border: 1px solid #e5e7eb; text-align: right; }
.report-table th { background: #1e3a5f; color: #fff; }
.report-table tr.total-row td { font-weight: 700; background: #f1f5f9; }
.report-table .note { color: #6b7280; font-size: 12px; }
.badge {
  display: inline-block; background: #fef3c7; color: #92400e;
  padding: 2px 8px; border-radius: 12px; font-size: 12px; margin-right: 8px;
}
.disclaimer {
  margin-top: 14px; padding: 12px; background: #fffbeb;
  border: 1px solid #fde68a; border-radius: 8px; font-size: 12.5px; color: #78350f;
}
.totals-summary { display: flex; gap: 24px; margin-top: 12px; flex-wrap: wrap; }
.totals-summary .box {
  background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 8px;
  padding: 10px 16px; text-align: center;
}
.totals-summary .box .val { font-size: 20px; font-weight: 700; color: #1e3a5f; }
.totals-summary .box .lbl { font-size: 12px; color: #6b7280; }
.empty { color: #9ca3af; font-size: 13px; padding: 8px 0; }

/* ----- דוח בפורמט טופס ----- */
.form-doc { border: 1px solid #d1d5db; border-radius: 8px; padding: 22px; background: #fff; }
.form-head { text-align: center; border-bottom: 2px solid #1e3a5f; padding-bottom: 12px; margin-bottom: 16px; }
.form-head h2 { margin: 0; color: #1e3a5f; font-size: 20px; }
.form-sub { font-size: 12.5px; color: #6b7280; margin-top: 4px; }
.form-block { margin-bottom: 16px; }
.form-block-title { font-weight: 700; color: #1e3a5f; font-size: 14px; border-right: 3px solid #1e3a5f; padding-right: 8px; margin-bottom: 8px; }
.form-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 24px; }
.ff { font-size: 13.5px; padding: 3px 0; }
.ff-l { color: #6b7280; }
.ff-v { font-weight: 600; color: #1f2937; }
.declaration { margin-top: 16px; padding: 12px; background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 6px; font-size: 13px; line-height: 1.6; }
.signatures { display: flex; gap: 40px; margin-top: 28px; }
.signatures .sig { flex: 1; text-align: center; font-size: 12.5px; color: #4b5563; }
.sig-line { border-top: 1px solid #1f2937; margin-bottom: 6px; height: 28px; }

.rate-row { display: flex; gap: 6px; }
.rate-row input { flex: 1; }
button.small { padding: 6px 10px; font-size: 12px; white-space: nowrap; }
.rate-status { font-size: 12px; color: #6b7280; min-height: 14px; }
.rate-status.ok { color: #15803d; }
.rate-status.err { color: #b91c1c; }

/* ----- דף הלקוח ----- */
.client-main { max-width: 720px; margin: 0 auto; padding: 16px; display: block; }
.client-main .panel { margin-bottom: 14px; }
.center { text-align: center; }
.greeting { font-size: 16px; font-weight: 700; color: #1e3a5f; margin: 0 0 6px; }
.hint { font-size: 13px; color: #6b7280; margin: 4px 0; }
.expense-add .row { display: flex; gap: 8px; margin-bottom: 8px; }
.expense-add .row > * { flex: 1; min-width: 0; }
.file-label {
  display: block; padding: 12px; border: 1px dashed #93c5fd; border-radius: 8px;
  background: #f0f7ff; cursor: pointer; font-size: 14px; color: #1e3a5f; margin-bottom: 8px;
}
.file-label input { display: block; margin-top: 6px; }
button.big { font-size: 16px; padding: 12px 28px; }
.ocr-status { font-size: 13px; margin: 4px 0 10px; min-height: 16px; }
.ocr-status.working { color: #92400e; }
.ocr-status.ok { color: #15803d; font-weight: 600; }
.ocr-status.err { color: #b91c1c; }
#ocr-hint { color: #15803d; font-size: 12px; }
.saved-msg { color: #15803d; font-size: 13px; font-weight: 600; align-self: center; }
#error-box { color: #b91c1c; font-weight: 600; }

/* ----- אזור שיתוף ומעקב (צד רו"ח) ----- */
.share-box { background: #f0f7ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 12px; margin: 12px 0; }
.share-box .link-row { display: flex; gap: 6px; margin-top: 8px; }
.share-box input { flex: 1; font-size: 12px; direction: ltr; text-align: left; }
.btn-link {
  display: inline-flex; align-items: center; background: #1e3a5f; color: #fff;
  text-decoration: none; border-radius: 6px; padding: 6px 12px; font-size: 12px;
  font-weight: 600; white-space: nowrap;
}
.btn-link:hover { background: #16304f; }
.status-badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.status-draft { background: #e5e7eb; color: #374151; }
.status-sent { background: #fef3c7; color: #92400e; }
.status-submitted { background: #dcfce7; color: #166534; }
/* אזור אישור הוצאות מהלקוח */
.review-box { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 12px; margin: 14px 0; }
.review-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.review-actions { white-space: nowrap; }
button.approve { background: #16a34a; padding: 4px 10px; font-size: 12px; }
button.approve:hover { background: #15803d; }
.review-actions .danger { background: #fee2e2; color: #b91c1c; border-radius: 6px; padding: 4px 10px; font-size: 12px; }

.receipt-link { color: #2563eb; text-decoration: none; font-size: 13px; }
.receipt-link:hover { text-decoration: underline; }
.src-client { color: #2563eb; font-size: 11px; }

/* ----- חלון ניהול משתמשים ----- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal.hidden { display: none; }
.modal-box { background: #fff; border-radius: 10px; padding: 20px; width: 100%; max-width: 560px; max-height: 85vh; overflow-y: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-head h2 { margin: 0; color: #1e3a5f; font-size: 18px; }
.invite-link { background: #f0f7ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; font-size: 13px; }
.invite-link.hidden { display: none; }
.invite-link input { width: 100%; direction: ltr; text-align: left; font-size: 12px; margin-top: 6px; }
.role-badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: #e0ecff; color: #1e3a5f; }
.role-admin { background: #fef3c7; color: #92400e; }

/* ----- דשבורד ----- */
.dash-stats { margin-bottom: 16px; }
/* כרטיס-על */
.dash-hero { display: flex; justify-content: space-between; align-items: center; background: linear-gradient(135deg, #1e3a5f, #142a47); color: #fff; border-radius: 14px; padding: 18px 22px; margin-bottom: 14px; }
.dash-hero-num { font-size: 30px; font-weight: 800; }
.dash-hero-lbl { font-size: 13px; color: #cdd9e8; margin-top: 2px; }
.dash-hero-side { font-size: 20px; font-weight: 700; color: #c9a24a; text-align: center; }
.dash-hero-side small { display: block; font-size: 11px; color: #cdd9e8; font-weight: 400; }
/* כרטיסי סטטיסטיקה */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.stat { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid #e8edf3; border-right: 4px solid #c9a24a; border-radius: 10px; padding: 12px 14px; box-shadow: 0 1px 4px rgba(16,40,80,.05); }
.stat-ic { font-size: 22px; line-height: 1; }
.stat-num { font-size: 22px; font-weight: 800; color: #1e3a5f; }
.stat-lbl { font-size: 12px; color: #6b7280; }
.stat-alert { border-right-color: #d97706; background: #fffbeb; }
.stat-alert .stat-num { color: #b45309; }
.stat-warn { border-right-color: #2563eb; background: #eff6ff; }
.stat-warn .stat-num { color: #1d4ed8; }
/* רשימות דורש-טיפול */
.act-list { list-style: none; margin: 0; }
.act-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #e8edf3; border-radius: 8px; margin-bottom: 6px; cursor: pointer; transition: .15s; }
.act-list li:hover { background: #f4f7fb; border-color: #c9a24a; }
.act-badge { background: #fef3c7; color: #92400e; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 12px; white-space: nowrap; }
.act-since { color: #6b7280; font-size: 12px; white-space: nowrap; }
/* פילוח סטטוס — בר */
.dash-block { margin-bottom: 16px; }
.dash-block h4 { color: #1e3a5f; font-size: 14px; margin-bottom: 8px; }
.statusbar { display: flex; height: 22px; border-radius: 6px; overflow: hidden; background: #eef2f7; }
.statusbar .seg { height: 100%; }
.sg-draft { background: #94a3b8; } .sg-sent { background: #d97706; } .sg-sub { background: #16a34a; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; font-size: 12px; color: #4b5563; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-left: 5px; vertical-align: middle; }
/* לקוחות מובילים */
.topcli { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-size: 13px; }
.tc-name { width: 38%; color: #1f2937; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-bar { flex: 1; background: #eef2f7; border-radius: 5px; height: 12px; overflow: hidden; }
.tc-bar div { height: 100%; background: linear-gradient(90deg, #c9a24a, #1e3a5f); }
.tc-val { width: 24%; text-align: left; color: #1e3a5f; font-weight: 600; direction: ltr; }
@media (max-width: 640px) { .stat-grid { grid-template-columns: 1fr 1fr; } .dash-hero { flex-direction: column; gap: 8px; text-align: center; } }

/* ----- רספונסיביות למובייל ----- */
html, body { max-width: 100%; overflow-x: hidden; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }

@media (max-width: 820px) {
  main { grid-template-columns: 1fr; gap: 12px; padding: 12px; }
  .panel.wide { grid-column: auto; }
  header { flex-wrap: wrap; gap: 8px 12px; padding: 12px 16px; }
  header h1 { font-size: 18px; }
  .subtitle { width: 100%; order: 3; }
  .logout-btn { margin-right: auto; }
  .grid-form, .form-fields { grid-template-columns: 1fr; }
  .share-box .link-row { flex-wrap: wrap; }
  .share-box input { min-width: 0; width: 100%; }
  .data-table, .report-table { font-size: 13px; min-width: 480px; }
  .expense-add .row { flex-direction: column; gap: 8px; }
  .inline-form input, .inline-form select { min-width: 0; flex: 1 1 100%; }
  .totals-summary { gap: 12px; }
  .totals-summary .box { flex: 1; min-width: 120px; }
}

@media print {
  /* מדפיסים אך ורק את הדוח עצמו (#report-content), בלי כלום מסביב */
  body { background: #fff; }
  body * { visibility: hidden; }
  #report-content, #report-content * { visibility: visible; }
  #report-content {
    position: absolute; top: 0; right: 0; left: 0; width: 100%;
  }
  /* הטופס מוגש למס הכנסה — בלי לוגו המשרד */
  .logo-img, .report-logo, .report-logo-img { display: none !important; }
  .form-doc { border: none; padding: 0; }
  .report-table { font-size: 12px; }
  .report-table th, .total-row td, .badge, .disclaimer {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
}
