/* מרכז הניהול של LawCRM — אותה פלטה של המערכת: נייר חם, דיו רך, ירוק בית-משפט. */
@font-face { font-family: 'Heebo'; src: url('/fonts/Heebo.ttf') format('truetype'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Frank Ruhl Libre'; src: url('/fonts/FrankRuhlLibre.ttf') format('truetype'); font-weight: 300 900; font-display: swap; }

:root {
  --canvas: #EFEFEB; --surface: #FAFAF7; --surface-2: #F4F4F0; --ink: #23282D; --ink-soft: #5F6870;
  --line: #E1E1DA; --brand: #1F5C4D; --brand-deep: #16463A; --brand-soft: #E6EEEA;
  --danger: #9E4433; --danger-soft: #F5E6E2; --warn: #7E6538; --warn-soft: #F6EEDF;
  --info: #2F5580; --info-soft: #E9EFF6; --muted-soft: #E9E9E3; --muted: #767068;
  --radius: 10px; --ring: 0 0 0 3px rgba(31,92,77,.22);
  --shadow: 0 1px 2px rgba(35,40,45,.045), 0 4px 12px rgba(35,40,45,.045);
  --font: 'Heebo', system-ui, sans-serif; --display: 'Frank Ruhl Libre', Georgia, serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { height: 100%; }
body { margin: 0; min-height: 100%; background: var(--canvas); color: var(--ink); font-family: var(--font);
  font-size: 15px; line-height: 1.65; -webkit-font-smoothing: antialiased; display: flex; flex-direction: column; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--display); margin: 0 0 8px; font-weight: 600; }
h1 { font-size: 25px; line-height: 1.3; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0 0 10px; }
code, .mono { font-family: var(--mono); font-size: 13px; direction: ltr; unicode-bidi: isolate; }
code { display: inline-block; max-width: 100%; overflow-wrap: anywhere; vertical-align: bottom; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.muted { color: var(--ink-soft); }
.small { font-size: 13px; }
[hidden] { display: none !important; }

/* ── מסגרת ── */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1120px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 22px;
  flex-wrap: wrap; min-height: 58px; }
.brand { font-family: var(--display); font-size: 19px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.brand span { color: var(--brand); }
.nav { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
.nav a { padding: 8px 12px; border-radius: 8px; color: var(--ink-soft); font-weight: 500; }
.nav a:hover { background: var(--brand-soft); text-decoration: none; color: var(--brand-deep); }
.nav a.on { background: var(--brand-soft); color: var(--brand-deep); }
.who { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); font-size: 13px; }
main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 26px 20px 40px; }
.foot { border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 12.5px; }
.foot-in { max-width: 1120px; margin: 0 auto; padding: 12px 20px; display: flex; gap: 14px; flex-wrap: wrap;
  justify-content: space-between; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: 18px; }
.head p { margin: 0; color: var(--ink-soft); }

/* ── כרטיסים ── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 18px; }
.card > h2:first-child { margin-bottom: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.grid2 > .card { margin-bottom: 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.kv dt { color: var(--ink-soft); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.stats { display: flex; gap: 26px; flex-wrap: wrap; color: var(--ink-soft); font-size: 13.5px; margin-top: 4px; }
.stats b { color: var(--ink); font-weight: 600; }

/* ── כפתורים ושדות ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 500;
  padding: 8px 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  cursor: pointer; text-decoration: none; min-height: 38px; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: none; box-shadow: var(--ring); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-deep); }
.btn.danger { color: var(--danger); border-color: #E3C7BF; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.small { padding: 4px 10px; min-height: 30px; font-size: 13px; }
.btn[disabled] { opacity: .55; cursor: default; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 500; margin-bottom: 4px; }
.field .hint { color: var(--ink-soft); font-size: 13px; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=file], select {
  width: 100%; font: inherit; padding: 9px 12px; border: 1px solid #CFCFC6; border-radius: 8px; background: #fff;
  color: var(--ink); min-height: 40px; }
input.ltr-in { direction: ltr; text-align: left; font-family: var(--mono); }
.joined { display: flex; direction: ltr; }
.joined input { border-radius: 8px 0 0 8px; }
.joined span { display: flex; align-items: center; padding: 0 12px; background: var(--surface-2);
  border: 1px solid #CFCFC6; border-left: 0; border-radius: 0 8px 8px 0; font-family: var(--mono); font-size: 13px;
  color: var(--ink-soft); white-space: nowrap; }
.check { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; }
.check input { margin-top: 5px; width: 16px; height: 16px; }

/* ── הודעות ── */
.note { border-radius: 8px; padding: 10px 14px; margin: 0 0 14px; border: 1px solid var(--line);
  background: var(--surface-2); white-space: pre-line; overflow-wrap: anywhere; }
.note.ok { background: var(--brand-soft); border-color: #C9DCD5; color: var(--brand-deep); }
.note.warn { background: var(--warn-soft); border-color: #E6D8B8; color: #5E4A22; }
.note.bad { background: var(--danger-soft); border-color: #E3C7BF; color: #7A3122; }
.note.info { background: var(--info-soft); border-color: #C3D2E4; color: #24456B; }
.msg:empty { display: none; }

/* ── תגיות מצב ── */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 500; background: var(--muted-soft); color: var(--muted); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--brand-soft); color: var(--brand-deep); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--danger-soft); color: var(--danger); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.wrap { white-space: normal; border-radius: 12px; }

/* ── טבלאות ── */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: right; font-weight: 500; color: var(--ink-soft); font-size: 13px; padding: 8px 10px;
  border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td .sub { color: var(--ink-soft); font-size: 12.5px; }
td.num { white-space: nowrap; }
.empty { text-align: center; color: var(--ink-soft); padding: 34px 10px; }

/* ── שלבי פעולה ── */
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.steps li:last-child { border-bottom: 0; }
.steps .dot { width: 20px; height: 20px; border-radius: 50%; margin-top: 2px; background: var(--muted-soft);
  display: flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; }
.steps .done .dot { background: var(--brand); }
.steps .failed .dot { background: var(--danger); }
.steps .warn .dot { background: #B58A2B; }
.steps .running .dot { background: var(--info); animation: pulse 1.1s ease-in-out infinite; }
.steps .detail { color: var(--ink-soft); font-size: 13.5px; white-space: pre-line; overflow-wrap: anywhere; }
@keyframes pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .steps .running .dot { animation: none; } }
.secret { font-family: var(--mono); font-size: 17px; direction: ltr; unicode-bidi: isolate; background: #fff;
  border: 1px dashed #B9B9AE; border-radius: 8px; padding: 8px 14px; display: inline-block; user-select: all; }
.codes { display: grid; grid-template-columns: repeat(2, max-content); gap: 6px 26px; direction: ltr;
  justify-content: center; font-family: var(--mono); font-size: 15px; margin: 10px 0 14px; }
.qr { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: inline-block; line-height: 0; }

/* ── כניסה ── */
body.auth { align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card .brand { display: block; text-align: center; font-size: 24px; margin-bottom: 16px; }
.auth-foot { text-align: center; color: var(--ink-soft); font-size: 12.5px; margin-top: 4px; }

@media (max-width: 720px) {
  main { padding: 18px 14px 32px; }
  .top-in { padding: 10px 14px 8px; gap: 4px 8px; }
  .brand { width: 100%; }
  .nav { width: 100%; flex: none; gap: 0; margin: 0 -8px; }
  .nav a { padding: 6px 9px; }
  .who { width: 100%; justify-content: space-between; }
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
  table.stack tr:last-child { border-bottom: 0; }
  table.stack td { border: 0; padding: 3px 0; }
  table.stack td[data-l]::before { content: attr(data-l) ": "; color: var(--ink-soft); font-size: 13px; }
  .kv { grid-template-columns: 1fr; gap: 0; }
  .kv dt { margin-top: 8px; font-size: 13px; }
}

.between { justify-content: space-between; }
.mt8 { margin-top: 8px; }
.mb0 { margin-bottom: 0; }
.mb8 { margin-bottom: 8px; }
.center { text-align: center; }
.plain { margin: 6px 0 0; padding: 0 18px 0 0; }
.plain li { margin: 2px 0; }
.note.block { white-space: normal; }
.note > :last-child { margin-bottom: 0; }
.section { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 14px; }
.section h3 { margin-bottom: 8px; }
.section .field:last-of-type { margin-bottom: 10px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.pickrow { display: flex; justify-content: space-between; align-items: center; gap: 4px 12px; padding: 7px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pickrow:last-of-type { border-bottom: 0; }
