:root {
  --navy: #10294a; --navy2: #1b3d6b; --teal: #087a6c; --teal-d: #066055; --bg: #f3f5f9; --card: #fff;
  --text: #1c2733; --muted: #56647a; --line: #dde3ec; --red: #c0392b; --amber: #b7791f; --green: #1e8e4e;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: "Segoe UI", "Heebo", "Arial Hebrew", Arial, sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.55; }
a { color: var(--navy2); }
h1 { font-size: 24px; margin: 0 0 4px; } h2 { font-size: 17px; margin: 26px 0 10px; color: var(--navy); } h3 { font-size: 15px; margin: 0 0 8px; }
.muted { color: var(--muted); font-size: 13px; }
.mono { font-family: Consolas, "Courier New", monospace; font-size: 12px; direction: ltr; unicode-bidi: embed; word-break: break-all; }
.ltr { direction: ltr; text-align: left; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.ok { color: var(--green); } .bad { color: var(--red); }

/* layout */
.topbar { background: var(--navy); color: #fff; display: flex; align-items: center; gap: 22px; padding: 0 22px; height: 58px; position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; font-size: 19px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.logo { background: var(--teal); color: #fff; width: 28px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: #c9d6e8; text-decoration: none; padding: 8px 12px; border-radius: 8px; white-space: nowrap; }
.nav a:hover, .nav a.active { background: rgba(255, 255, 255, .12); color: #fff; }
.who { font-size: 13px; color: #c9d6e8; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 24px 18px 60px; }
.narrow { max-width: 660px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 16px 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat b { display: block; font-size: 26px; color: var(--navy); }

/* forms */
label { display: block; font-weight: 600; font-size: 13px; margin: 12px 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], textarea, select {
  width: 100%; padding: 9px 11px; border: 1px solid #c5cedb; border-radius: 8px; font: inherit; background: #fff; color: var(--text); }
input:focus, textarea:focus, select:focus { outline: 2px solid rgba(11, 154, 136, .35); border-color: var(--teal); }
textarea { min-height: 80px; resize: vertical; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; font-size: 14px; margin: 10px 0; }
.check input { margin-top: 4px; width: 17px; height: 17px; flex: none; }
.btn { background: var(--teal); color: #fff; border: 0; border-radius: 8px; padding: 9px 18px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; }
.btn:hover { background: var(--teal-d); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--navy); border: 1px solid #c5cedb; }
.btn.ghost:hover { background: #f1f4f8; }
.btn.danger { background: #fff; color: var(--red); border: 1px solid #e3b5af; }
.btn.small { padding: 4px 10px; font-size: 13px; font-weight: 500; }
.btn.big { padding: 13px 26px; font-size: 16px; width: 100%; }
.linkbtn { background: none; border: 0; color: #c9d6e8; cursor: pointer; font: inherit; text-decoration: underline; padding: 0; }
.alert { padding: 10px 14px; border-radius: 8px; margin: 12px 0; font-size: 14px; }
.alert.err { background: #fdecea; color: #8e2a20; border: 1px solid #f3c2bc; }
.alert.info { background: #e8f4fd; color: #17466e; border: 1px solid #bcdcf5; }
.alert.good { background: #e6f6ec; color: #17603a; border: 1px solid #b4e0c5; }
.alert.warn { background: #fff6e0; color: #7a5310; border: 1px solid #f0d9a0; }

/* focus, summaries, simulated rows */
a:focus-visible, button:focus-visible, .btn:focus-visible, input:focus-visible, textarea:focus-visible, tr.click:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
.lead { font-size: 17px; margin: 10px 0; }
.findings { margin: 6px 0 14px; padding-inline-start: 22px; } .findings li { margin-bottom: 6px; }
.review { border: 2px solid var(--navy); margin-top: 16px; }
.orient p { margin: 0 0 8px; } .orient p:last-child { margin-bottom: 0; }
h2.done { font-size: 24px; margin: 0 0 4px; color: var(--text); }
tr.sim td { background: #fff6e0; }
.rhead ~ .wrap .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.rhead ~ .wrap .check input { width: 24px; height: 24px; margin-top: 2px; }

/* tables */
table { border-collapse: collapse; width: 100%; }
.grid th, .grid td { border-bottom: 1px solid var(--line); padding: 9px 10px; text-align: right; vertical-align: top; }
.grid th { font-size: 12px; color: var(--muted); font-weight: 600; background: #f8fafc; }
.grid.small td, .grid.small th { font-size: 12px; padding: 6px 7px; }
.grid.small .mono { word-break: normal; white-space: nowrap; font-size: 11px; }
.grid.small td.ltr { word-break: break-word; }
.grid tr.click { cursor: pointer; } .grid tr.click:hover td { background: #f6f9fc; }
.kv th { text-align: right; width: 190px; color: var(--muted); font-weight: 600; padding: 6px 0 6px 12px; vertical-align: top; font-size: 13px; }
.kv td { padding: 6px 0; }
.tablewrap { overflow-x: auto; }
.chip { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: #e9edf3; color: #47566b; white-space: nowrap; }
.chip.sent { background: #e8f0fd; color: #1f4f9c; } .chip.opened, .chip.verified, .chip.viewed { background: #fff3d6; color: #8a5b00; }
.chip.confirmed { background: #dff5e7; color: #17603a; } .chip.cancelled, .chip.expired, .chip.failed { background: #fde5e2; color: #8e2a20; }
.steps { display: flex; gap: 4px; align-items: center; }
.steps i { width: 26px; height: 6px; border-radius: 3px; background: #dfe5ee; display: block; }
.steps i.on { background: var(--teal); }

/* new delivery */
.drop { border: 2px dashed #b9c5d6; border-radius: 12px; padding: 26px; text-align: center; color: var(--muted); cursor: pointer; background: #fafbfd; }
.drop.over { border-color: var(--teal); background: #eefaf8; }
.filelist { list-style: none; padding: 0; margin: 12px 0 0; }
.filelist li { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; background: #fff; }
.filelist .num { background: var(--navy); color: #fff; border-radius: 6px; min-width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.recips td { padding: 4px; } .recips th { font-size: 12px; color: var(--muted); text-align: right; padding: 4px; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 720px) { .cols2 { grid-template-columns: 1fr; } .kv th { width: 120px; } .topbar { gap: 10px; padding: 0 10px; } .who span { display: none; } }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { border-right: 2px solid var(--line); padding: 0 16px 14px 0; position: relative; }
.timeline li::before { content: ""; position: absolute; right: -6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--teal); }
.timeline li.rcpt::before { background: var(--amber); } .timeline li.key::before { background: var(--green); width: 14px; height: 14px; right: -8px; }
.timeline .t { font-size: 12px; color: var(--muted); }
.msg { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; background: #fff; }
.msg pre { white-space: pre-wrap; font: inherit; margin: 6px 0 0; word-break: break-word; }

/* auth + recipient */
.center { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; }
.authcard { width: 100%; max-width: 420px; }
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.tabs button { flex: 1; background: none; border: 0; padding: 10px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; }
.tabs button.active { color: var(--navy); border-bottom-color: var(--teal); }
.rhead { background: var(--navy); color: #fff; padding: 16px 20px; }
.rhead .brand { font-size: 17px; }
.stepper { display: flex; gap: 6px; margin: 18px 0; }
.stepper div { flex: 1; text-align: center; font-size: 12px; color: var(--muted); border-top: 4px solid #dfe5ee; padding-top: 6px; }
.stepper div.on { border-color: var(--teal); color: var(--navy); font-weight: 700; }
.otp { font-size: 26px !important; letter-spacing: 10px; text-align: center; direction: ltr; }
.docitem { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.docitem.viewed { border-color: #b4e0c5; background: #f5fcf8; }
.viewer { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 10px; margin-top: 10px; background: #fff; }
.viewer-img { max-width: 100%; border: 1px solid var(--line); border-radius: 10px; margin-top: 10px; }
.bigcheck { width: 64px; height: 64px; border-radius: 50%; background: var(--green); color: #fff; font-size: 36px; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.tc { text-align: center; }
.wrap-any { word-break: break-all; }

/* printable documents */
body.doc { background: #e9edf2; }
.paper { background: #fff; max-width: 980px; margin: 20px auto; padding: 34px 38px; border-radius: 6px; box-shadow: 0 2px 12px rgba(0, 0, 0, .08); }
.doc-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; border-bottom: 3px solid var(--navy); padding-bottom: 14px; flex-direction: row-reverse; }
.doc-head .brand { color: var(--navy); }
.doc-actions { margin-bottom: 18px; display: flex; gap: 10px; flex-wrap: wrap; }
.mono.wrap { display: block; max-width: 640px; }
@media print {
  body.doc { background: #fff; } .paper { box-shadow: none; margin: 0; padding: 0; max-width: none; } .noprint { display: none !important; }
  .grid.small td, .grid.small th { font-size: 9px; padding: 3px; }
}
