:root {
  --bg: #f3f4f7; --surface: #fff; --ink: #17212f; --muted: #68758a; --line: #e4e8ee;
  --brand: #14263f; --brand-2: #1d3557; --accent: #b38a3e; --accent-soft: #f6efe0;
  --ok: #17754a; --warn: #a8650a; --bad: #b3261e; --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 38, 63, .05), 0 6px 20px rgba(20, 38, 63, .06);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Plex Arabic", "Segoe UI", Tahoma, Arial, sans-serif; font-size: 15px; line-height: 1.6; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }
[hidden] { display: none !important; }

.top { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }
.top-in { display: flex; align-items: center; gap: 12px; padding-top: 16px; padding-bottom: 16px; }
.mark { width: 42px; height: 42px; border-radius: 11px; background: linear-gradient(135deg, #c9a154, var(--accent)); display: grid; place-items: center; flex: none; }
.mark svg { width: 24px; height: 24px; }
.top-text { flex: 1; min-width: 0; }
.office { font-weight: 700; font-size: 17px; }
.office-sub { font-size: 12.5px; color: #a9b9cf; }

main.wrap { padding-top: 26px; padding-bottom: 60px; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0; }
h3 { font-size: 13px; color: var(--muted); font-weight: 600; margin: 20px 0 8px; }
.muted { color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.login { max-width: 420px; margin: 5vh auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 24px; box-shadow: var(--shadow); }
label { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin: 16px 0 5px; }
input { width: 100%; font: inherit; font-size: 17px; letter-spacing: 1px; padding: 11px 13px; border: 1px solid #d3d9e2; border-radius: 10px; text-align: center; }
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(179, 138, 62, .18); }
.btn { font: inherit; font-weight: 600; border-radius: 10px; padding: 11px 18px; cursor: pointer; border: 1px solid transparent; }
.btn.primary { width: 100%; margin-top: 22px; background: var(--brand-2); color: #fff; }
.btn.primary:hover { background: var(--brand); }
.btn.ghost { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .25); color: #fff; padding: 7px 14px; font-weight: 500; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.error { color: var(--bad); background: #fbe4e2; border-radius: 8px; padding: 9px 12px; margin: 16px 0 0; font-size: 14px; }

.welcome { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.welcome h1 { flex: 1; }
.chip { font-size: 12.5px; color: var(--muted); background: #e9edf2; border-radius: 999px; padding: 3px 12px; white-space: nowrap; }
.chip b { color: var(--ink); direction: ltr; unicode-bidi: isolate; }

.next { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border: 0; }
.next .label { font-size: 12.5px; color: #a9b9cf; }
.next .when { font-size: 22px; font-weight: 700; margin: 2px 0; }
.next .what { color: #dbe4f0; }

.case-head { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.case-head h2 { flex: 1; min-width: 200px; }
.badge { display: inline-block; padding: 2px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 500; background: #edf0f4; color: #47546a; white-space: nowrap; }
.badge.ok { background: #e1f3ea; color: var(--ok); }
.badge.warn { background: #fcefd8; color: var(--warn); }
.badge.bad { background: #fbe4e2; color: var(--bad); }
.badge.info { background: #e4ecf7; color: var(--brand-2); }
.badge.new { background: var(--accent); color: #fff; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 18px; margin: 16px 0 0; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; }

.update { background: var(--accent-soft); border-inline-start: 3px solid var(--accent); border-radius: 8px; padding: 12px 14px; white-space: pre-wrap; overflow-wrap: anywhere; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 22px 16px 0; border-inline-start: 0; }
.timeline li::before { content: ""; position: absolute; right: 4px; top: 8px; bottom: -8px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; right: 0; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: #c3cbd7; }
.timeline li.upcoming::after { background: var(--accent); box-shadow: 0 0 0 4px rgba(179, 138, 62, .2); }
.timeline .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.timeline .date { font-weight: 600; font-variant-numeric: tabular-nums; }
.timeline .place { color: var(--muted); font-size: 13.5px; }
.timeline .result { margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }

.money { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.money > div { background: #f7f8fa; border-radius: 10px; padding: 12px; text-align: center; }
.money .label { font-size: 12px; color: var(--muted); }
.money .value { font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
table { width: 100%; border-collapse: collapse; margin-top: 6px; }
td, th { text-align: start; padding: 8px 4px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { color: var(--muted); font-size: 12px; font-weight: 600; }
tr:last-child td { border-bottom: 0; }
.foot { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 24px; }

@media (max-width: 520px) {
  .money { grid-template-columns: 1fr; }
  .card { padding: 16px; }
}
