/* MLF Legal OS — "الملف القضائي"
   Palette is taken from the logo only: navy and silver on paper. Colour beyond that is reserved for status.
   Amiri (classical Naskh, the face of statutes and judgments) carries titles; IBM Plex Sans Arabic carries data.
   Hierarchy comes from rules and type, not shadows or cards. Every record opens with a ruled docket caption. */

@font-face { font-family: "Amiri"; font-weight: 400; font-display: swap; src: url("../fonts/amiri-arabic-400-normal.b640f7cc5918.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Amiri"; font-weight: 700; font-display: swap; src: url("../fonts/amiri-arabic-700-normal.bb99562a6788.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Amiri"; font-weight: 400; font-display: swap; src: url("../fonts/amiri-latin-400-normal.034ef8ba89c4.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Amiri"; font-weight: 700; font-display: swap; src: url("../fonts/amiri-latin-700-normal.3c577e3e4448.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Plex Arabic"; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-sans-arabic-arabic-400-normal.b88ccd3247d2.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Plex Arabic"; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-sans-arabic-arabic-500-normal.48674700322e.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Plex Arabic"; font-weight: 600; font-display: swap; src: url("../fonts/ibm-plex-sans-arabic-arabic-600-normal.597b7873fee3.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Plex Arabic"; font-weight: 700; font-display: swap; src: url("../fonts/ibm-plex-sans-arabic-arabic-700-normal.c057ba3c2827.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Plex Arabic"; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-sans-arabic-latin-400-normal.d431f94c0b9f.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Plex Arabic"; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-sans-arabic-latin-500-normal.abc7a447358f.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Plex Arabic"; font-weight: 600; font-display: swap; src: url("../fonts/ibm-plex-sans-arabic-latin-600-normal.58d827ef695d.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Plex Arabic"; font-weight: 700; font-display: swap; src: url("../fonts/ibm-plex-sans-arabic-latin-700-normal.a5fc85cc7d80.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }

:root {
  --navy-deep: #101b33;   /* chambers: sidebar, caption band */
  --navy: #254775;        /* brand navy, exact value from the vector logo */
  --navy-soft: #dfe5f0;   /* selected rows, focus wash */
  --silver: #939598;      /* brand gray, exact value from the vector logo */
  --silver-line: #cfd2d8; /* hairlines */
  --stone: #eceef2;       /* canvas */
  --paper: #ffffff;       /* sheets */
  --ink: #18202f;
  --ink-2: #505a6c;
  --ink-3: #7a8293;
  --ok: #2e6a4f;   --ok-wash: #e4efe8;
  --warn: #85601a; --warn-wash: #f6eedc;
  --bad: #8c2e2e;  --bad-wash: #f5e3e1;

  --serif: "Amiri", "Times New Roman", serif;
  --sans: "Plex Arabic", "Geeza Pro", Tahoma, system-ui, sans-serif;
  --step-0: .8125rem;  /* 13px: tables, meta */
  --step-1: .875rem;   /* 14px: body */
  --step-2: 1.0625rem; /* 17px: section titles */
  --step-3: 1.375rem;  /* 22px */
  --step-4: 1.875rem;  /* 30px: record title */
  --row: 2.25rem;
  --r: 3px;
  --side: 248px;

  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--stone);
  font-variant-numeric: tabular-nums lining-nums;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--stone); }
a { color: var(--navy); text-decoration-color: color-mix(in srgb, var(--navy) 35%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; color: var(--navy-deep); margin: 0; line-height: 1.35; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); font-family: var(--sans); font-weight: 600; color: var(--ink-2); }
p { margin: 0 0 .75rem; }
code, .code { font-family: var(--sans); font-weight: 500; letter-spacing: .02em; direction: ltr; unicode-bidi: isolate; white-space: nowrap; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pre { white-space: pre-wrap; }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Chambers: the sidebar ---------- */
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.scrim, .nav-close { display: none; }
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.chambers { background: var(--navy-deep); color: #c9d0dd; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.letterhead { display: block; background: var(--paper); padding: 1.2rem 1.4rem 1rem; text-align: center; border-bottom: 3px solid var(--silver); text-decoration: none; }
.letterhead img { width: 140px; height: auto; display: block; margin: 0 auto; }
.chambers nav { padding: 1rem 0; flex: 1; }
.nav-group { margin-bottom: 1.1rem; }
.nav-group h2 { font-family: var(--sans); font-size: var(--step-0); font-weight: 500; color: var(--silver); padding: 0 1.4rem .35rem; }
.chambers nav a { display: flex; align-items: center; min-height: 40px; padding: 0 1.4rem; color: #dde2ea; text-decoration: none; font-size: var(--step-1); border-inline-start: 3px solid transparent; }
.chambers nav a:hover { background: #ffffff0d; color: #fff; }
.chambers nav a[aria-current=page] { background: #ffffff14; color: #fff; font-weight: 600; border-inline-start-color: var(--silver); }
.chambers nav a .count { margin-inline-start: auto; font-size: var(--step-0); color: var(--silver); }
.officer { border-top: 1px solid #ffffff1f; padding: .9rem 1.4rem 1.1rem; font-size: var(--step-0); }
.officer strong { display: block; color: #fff; font-size: var(--step-1); font-weight: 600; }
.officer .role { color: var(--silver); }
.officer .links { display: flex; gap: 1rem; margin-top: .55rem; align-items: center; }
.officer a, .officer button { color: #c9d0dd; font: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #ffffff40; min-height: 0; }
.officer form { margin: 0; }

/* ---------- Local preview bar (development only) ---------- */
.preview-bar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .4rem clamp(1rem, 2.5vw, 2rem); background: var(--warn-wash); color: var(--warn); font-size: var(--step-0); border-bottom: 1px solid #e6d3a8; }
.preview-bar form { margin: 0; }
.preview-bar button { min-height: 28px; padding: 0 .7rem; font-size: var(--step-0); border-color: #e6d3a8; color: var(--warn); background: transparent; }
.preview-bar button[aria-pressed=true] { background: var(--warn); border-color: var(--warn); color: #fff; }

/* ---------- Bench: the top bar ---------- */
.bench { display: flex; align-items: center; gap: 1rem; min-height: 56px; padding: .5rem clamp(1rem, 2.5vw, 2rem); background: var(--paper); border-bottom: 1px solid var(--silver-line); position: sticky; top: 0; z-index: 5; }
.crumbs { display: flex; gap: .45rem; align-items: center; font-size: var(--step-0); color: var(--ink-3); flex-wrap: wrap; min-width: 0; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--navy); }
.crumbs .sep { color: var(--silver-line); }
.crumbs [aria-current] { color: var(--ink); font-weight: 500; }
.today { font-size: var(--step-0); color: var(--ink-3); white-space: nowrap; }
.docket-search { display: flex; margin-inline-start: auto; border: 1px solid var(--silver-line); border-radius: var(--r); background: var(--stone); flex: 0 1 340px; }
.docket-search:focus-within { border-color: var(--navy); background: var(--paper); }
.docket-search input { border: 0; background: transparent; min-height: 38px; padding: 0 .75rem; flex: 1; min-width: 0; font-size: var(--step-1); }
.docket-search input:focus-visible { outline: 0; }
.docket-search button { min-height: 38px; border: 0; border-inline-start: 1px solid var(--silver-line); border-radius: 0; background: transparent; color: var(--navy); font-weight: 600; padding: 0 1rem; }
.nav-button { display: none; cursor: pointer; width: 40px; height: 40px; place-items: center; border: 1px solid var(--silver-line); border-radius: var(--r); color: var(--navy); }
.nav-button svg { width: 20px; height: 20px; }

/* ---------- Desk: content area ---------- */
.desk { min-width: 0; }
.desk main { padding: clamp(1rem, 2.5vw, 1.75rem) clamp(1rem, 2.5vw, 2rem) 3rem; max-width: 1360px; }

/* ---------- Docket caption: the signature element ---------- */
.caption { background: var(--paper); border: 1px solid var(--silver-line); border-top: 4px solid var(--navy); border-radius: var(--r); margin-bottom: 1.25rem; }
.caption-head { display: flex; justify-content: space-between; gap: 1rem 2rem; align-items: flex-end; flex-wrap: wrap; padding: 1.1rem 1.4rem 1rem; }
.caption-head .parent { font-size: var(--step-0); color: var(--ink-2); margin-bottom: .2rem; }
.caption-head h1 { margin: 0; }
.caption-head .subtitle { color: var(--ink-2); margin: .2rem 0 0; }
/* Ruled grids: each cell draws its end and bottom rule; the grid is pulled 1px past the clipped edge so outer rules vanish. */
.ruled { overflow: hidden; border-top: 1px solid var(--silver-line); }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin: 0 0 -1px; margin-inline-end: -1px; }
.fields > div { padding: .6rem 1.4rem .7rem; min-width: 0; border-inline-end: 1px solid var(--silver-line); border-bottom: 1px solid var(--silver-line); }
.fields dt { font-size: var(--step-0); color: var(--ink-3); }
.fields dd { margin: .1rem 0 0; font-weight: 600; font-size: var(--step-1); overflow-wrap: anywhere; }

/* ---------- Sheets: panels of a record ---------- */
.columns { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 1.25rem; align-items: start; }
.sheet { background: var(--paper); border: 1px solid var(--silver-line); border-radius: var(--r); margin-bottom: 1.25rem; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem 1.2rem; border-bottom: 1px solid var(--silver-line); flex-wrap: wrap; }
.sheet-head .meta { font-size: var(--step-0); color: var(--ink-3); }
.sheet-body { padding: 1rem 1.2rem; }
.sheet-body > :last-child { margin-bottom: 0; }
.sheet.alert { border-inline-start: 4px solid var(--warn); }
.empty { padding: 1.4rem 1.2rem; color: var(--ink-2); }
.empty strong { display: block; color: var(--ink); font-weight: 600; margin-bottom: .15rem; }

/* key/value list inside a sheet */
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); margin: 0; }
.facts dt, .facts dd { padding: .5rem 0; border-bottom: 1px solid var(--stone); margin: 0; font-size: var(--step-1); }
.facts dt { color: var(--ink-3); padding-inline-end: 1.4rem; }
.facts dt:last-of-type, .facts dd:last-of-type { border-bottom: 0; }

/* ---------- Register: the ledger strip of figures ---------- */
.register { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 0 0 -1px; margin-inline-end: -1px; }
.register a, .register div { padding: .85rem 1.3rem; text-decoration: none; color: var(--ink-2); font-size: var(--step-0); line-height: 1.45;
  border-inline-end: 1px solid var(--silver-line); border-bottom: 1px solid var(--silver-line); }
.register a:hover { background: #f6f7f9; }
.register b { display: block; font-family: var(--serif); font-size: 2rem; line-height: 1.2; font-weight: 700; color: var(--navy); }

/* ---------- Tables: dense, ruled ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: var(--step-0); }
th { text-align: start; font-weight: 600; color: var(--ink-2); background: #f6f7f9; padding: .5rem .9rem; border-bottom: 1px solid var(--silver-line); white-space: nowrap; position: sticky; top: 0; }
td { padding: 0 .9rem; height: var(--row); border-bottom: 1px solid var(--stone); vertical-align: middle; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #f8f9fb; }
td.num, th.num { text-align: end; }
td.wrap { white-space: normal; padding-block: .45rem; }
td.details { max-width: 380px; overflow-wrap: anywhere; direction: ltr; text-align: left; color: var(--ink-2); padding-block: .4rem; }
td a { font-weight: 500; }
td .sub { display: block; color: var(--ink-3); font-size: .75rem; line-height: 1.3; }
.status { display: inline-flex; align-items: center; gap: .4rem; font-size: var(--step-0); white-space: nowrap; color: var(--ink-2); }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--silver); }
.status.ok { color: var(--ok); } .status.ok::before { background: var(--ok); }
.status.warn { color: var(--warn); } .status.warn::before { background: var(--warn); }
.status.bad { color: var(--bad); } .status.bad::before { background: var(--bad); }

/* ---------- Toolbars, filters, pager ---------- */
.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.toolbar form { margin: 0; }
.filter { display: flex; gap: .5rem; padding: .7rem 1.2rem; border-bottom: 1px solid var(--silver-line); background: #fbfbfc; flex-wrap: wrap; align-items: center; }
.filter input { flex: 1 1 260px; max-width: 460px; min-height: 36px; }
.filter button { min-height: 36px; }
.pager { display: flex; gap: 1.2rem; justify-content: space-between; align-items: center; padding: .6rem 1.2rem; border-top: 1px solid var(--silver-line); font-size: var(--step-0); color: var(--ink-2); }

/* ---------- Forms ---------- */
input, select, textarea { font: inherit; font-size: var(--step-1); color: var(--ink); width: 100%; min-height: 40px; padding: .45rem .7rem; border: 1px solid #bcc2cc; border-radius: var(--r); background: var(--paper); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 0; border-color: var(--navy); box-shadow: 0 0 0 3px var(--navy-soft); }
textarea { min-height: 84px; resize: vertical; }
input[type=checkbox] { width: auto; min-height: 0; }
label { display: block; font-size: var(--step-0); font-weight: 600; color: var(--ink-2); margin-bottom: .3rem; }
.helptext { display: block; font-size: .75rem; color: var(--ink-3); margin-top: .3rem; }
.errorlist { list-style: none; margin: .3rem 0 0; padding: 0; color: var(--bad); font-size: var(--step-0); }
.errorlist.nonfield { background: var(--bad-wash); padding: .6rem .8rem; border-radius: var(--r); margin: 0 0 .5rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 1rem 1.25rem; align-items: start; }
.form-grid > .errorlist, .form-grid > div:has(textarea) { grid-column: 1 / -1; }
.form-stack { display: grid; gap: 1rem; }
.form-actions { display: flex; gap: .75rem; align-items: center; padding: .9rem 1.2rem; border-top: 1px solid var(--silver-line); background: #fbfbfc; flex-wrap: wrap; }

button, .button { font: inherit; font-size: var(--step-1); font-weight: 500; min-height: 40px; padding: 0 1.1rem; border-radius: var(--r); border: 1px solid #bcc2cc;
  background: var(--paper); color: var(--navy); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; white-space: nowrap; }
button:hover, .button:hover { border-color: var(--navy); }
.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.primary:hover { background: var(--navy-deep); border-color: var(--navy-deep); }
.danger { color: var(--bad); }
.danger:hover { border-color: var(--bad); }
.small { min-height: 30px; padding: 0 .7rem; font-size: var(--step-0); }
.textlink { color: var(--ink-2); font-size: var(--step-1); }

/* ---------- Notices ---------- */
.notice { padding: .75rem 1rem; border-radius: var(--r); background: var(--navy-soft); color: var(--navy-deep); margin: 0 0 1rem; font-size: var(--step-1); border-inline-start: 3px solid var(--navy); }
.notice-success { background: var(--ok-wash); color: var(--ok); border-color: var(--ok); }
.notice-warning { background: var(--warn-wash); color: var(--warn); border-color: var(--warn); }
.notice-error { background: var(--bad-wash); color: var(--bad); border-color: var(--bad); }

/* ---------- Sign-in: the antechamber ----------
   A firm's door, not a software screen: the logo in its own navy and silver on a pale ground, one silver rule,
   one quiet line. The oversized, barely visible seal behind it is the single decorative gesture. */
body.antechamber { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(340px, 5fr) minmax(0, 6fr);
  background: var(--paper); }
.antechamber .seal-side { position: relative; overflow: hidden; isolation: isolate; background: #f3f4f7;
  color: var(--ink-2); border-top: 4px solid var(--navy); display: flex; flex-direction: column; justify-content: center; gap: 2.2rem;
  padding: clamp(2rem, 6vw, 5rem); }
.antechamber .seal-side::after { content: ""; position: absolute; inset-block: 0; inset-inline-end: 0; width: 1px;
  background: linear-gradient(to bottom, transparent, var(--silver) 30%, var(--silver) 70%, transparent); opacity: .5; }
.antechamber .seal-watermark { position: absolute; z-index: -1; width: 135%; max-width: none; inset-inline-start: -38%;
  inset-block-end: -22%; opacity: .045; pointer-events: none; user-select: none; }
.antechamber .seal-mark img { display: block; width: min(100%, 280px); height: auto; }
.antechamber .seal-rule { display: block; width: 72px; height: 2px; background: var(--silver); margin-bottom: 1.1rem; }
.antechamber .seal-line { font-family: var(--serif); font-size: clamp(1.25rem, 2vw, 1.6rem); line-height: 1.7;
  color: var(--navy-deep);
  margin: 0; }
.antechamber .colophon { position: absolute; inset-block-end: clamp(1.2rem, 3vw, 2.2rem); inset-inline: clamp(2rem, 6vw, 5rem);
  margin: 0; font-size: var(--step-0); color: var(--ink-3); }
.antechamber .form-side { display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: clamp(1.5rem, 6vw, 5rem) clamp(1.25rem, 6vw, 5rem); min-width: 0; }
.antechamber .form-panel { width: 100%; max-width: 400px; }
.antechamber .form-firm { font-size: var(--step-0); font-weight: 600; color: var(--ink-3); margin: 0 0 .6rem; }
.antechamber .form-side h1 { font-size: clamp(1.8rem, 3vw, 2.25rem); margin-bottom: .5rem; }
.antechamber .form-side .lede { color: var(--ink-2); margin-bottom: 2rem; font-size: var(--step-1); }
.antechamber .form-stack { gap: 1.15rem; }
.antechamber .form-side input:not([type=checkbox]) { min-height: 48px; font-size: 1rem; padding-inline: .9rem;
  border-color: #c3c8d1; background: #fbfbfc; }
.antechamber .form-side input:focus-visible { background: var(--paper); }
.antechamber .form-side .primary { width: 100%; min-height: 50px; font-size: 1rem; margin-top: .4rem; }
.antechamber .form-side .helptext, .antechamber .form-side .errorlist { font-size: var(--step-0); }
.antechamber .form-foot { margin: 2.5rem 0 0; font-size: var(--step-0); color: var(--ink-3); text-align: center; }
.antechamber .back { margin-top: 1.2rem; font-size: var(--step-0); }
.enroll { display: grid; grid-template-columns: 180px 1fr; gap: 1.2rem; align-items: start; margin-bottom: 1.4rem; }
.enroll img { width: 180px; height: 180px; border: 1px solid var(--silver-line); }
.enroll ol { margin: 0; padding-inline-start: 1.1rem; color: var(--ink-2); font-size: var(--step-1); }
.enroll ol li { margin-bottom: .35rem; }
.secret-key { display: block; margin-top: .6rem; padding: .5rem .7rem; background: var(--stone); border-radius: var(--r); font-size: var(--step-0); overflow-wrap: anywhere; white-space: normal; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; list-style: none; padding: 0; margin: 1rem 0 1.4rem; border: 1px solid var(--silver-line); border-radius: var(--r); }
.codes li { padding: .55rem; text-align: center; border-bottom: 1px solid var(--stone); font-weight: 500; letter-spacing: .06em; }
.codes li:nth-child(odd) { border-inline-end: 1px solid var(--stone); }
.credential { display: grid; grid-template-columns: max-content 1fr; border: 1px solid var(--silver-line); border-radius: var(--r); margin: 1rem 0; }
.credential dt, .credential dd { margin: 0; padding: .7rem 1rem; border-bottom: 1px solid var(--stone); }
.credential dt { color: var(--ink-3); font-size: var(--step-0); background: #fbfbfc; }
.credential dd { font-weight: 600; font-size: 1rem; }
.credential :nth-last-child(-n+2) { border-bottom: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .columns { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .chambers { position: fixed; inset-block: 0; inset-inline-start: 0; width: min(84vw, 300px); z-index: 20; transform: translateX(100%); transition: transform .2s ease; }
  .nav-toggle:checked ~ .shell .chambers { transform: none; }
  .nav-toggle:checked ~ .shell .scrim { display: block; position: fixed; inset: 0; background: #101b3373; z-index: 15; cursor: pointer; }
  .nav-close { display: flex; align-items: center; min-height: 44px; padding: 0 1.4rem; background: var(--navy-deep); color: #c9d0dd; font-size: var(--step-0); cursor: pointer; border-bottom: 1px solid #ffffff1f; }
  .nav-toggle:focus-visible ~ .shell .nav-button { outline: 2px solid var(--navy); outline-offset: 2px; }
  .nav-button { display: grid; }
  .today { display: none; }
  .bench { flex-wrap: wrap; }
  .docket-search { order: 3; flex: 1 1 100%; }
  .caption-head { padding: 1rem; }
  .fields > div { padding: .55rem 1rem; }
  body.antechamber { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .antechamber .seal-side { flex-direction: row; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 1.1rem 1.25rem; padding-top: max(1.1rem, env(safe-area-inset-top)); }
  .antechamber .seal-side::after { inset-block: auto 0; inset-inline: 0; width: auto; height: 1px;
    background: linear-gradient(to left, transparent, var(--silver), transparent); }
  .antechamber .seal-mark img { width: 118px; }
  .antechamber .seal-rule { display: none; }
  .antechamber .seal-line { font-size: 1rem; text-align: end; max-width: 16ch; }
  .antechamber .seal-watermark { width: 70%; inset-inline-start: -12%; inset-block-end: -60%; }
  .antechamber .colophon { display: none; }
  .antechamber .form-side { justify-content: flex-start; padding-top: 2.2rem; }
}
@media (max-width: 560px) {
  :root { --step-4: 1.5rem; }
  .fields, .register { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .facts dt { border-bottom: 0; padding-bottom: 0; }
  .enroll { grid-template-columns: minmax(0, 1fr); }
  .enroll img { margin: 0 auto; }
  .register b { font-size: 1.6rem; }
}
@media print {
  .chambers, .bench, .toolbar, .form-actions, form { display: none !important; }
  .shell { display: block; }
  body, .sheet, .caption { background: #fff; }
}

/* ---------- Registers ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 0; margin: 0 0 -1px; border-bottom: 1px solid var(--silver-line); }
.tabs a { padding: .45rem .9rem; font-size: var(--step-0); color: var(--ink-2); text-decoration: none; border: 1px solid transparent; border-bottom: 0; font-variant-numeric: tabular-nums; }
.tabs a:hover { color: var(--navy); }
.tabs a[aria-current=page] { background: var(--paper); color: var(--navy); font-weight: 600; border-color: var(--silver-line); border-top: 2px solid var(--navy); }
.filter select { width: auto; min-height: 36px; max-width: 220px; font-size: var(--step-0); }
.filter .check { display: inline-flex; gap: .35rem; align-items: center; margin: 0; font-weight: 500; }
tfoot td { font-weight: 600; background: #f4f5f8; border-top: 2px solid var(--silver-line); }
.sheet-note { padding: .6rem 1.2rem; margin: 0; font-size: var(--step-0); color: var(--ink-2); border-top: 1px solid var(--silver-line); }
.columns.even { grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); }
table.lines td { padding: .3rem .4rem; vertical-align: top; }
table.lines input, table.lines select, table.lines textarea { min-height: 34px; font-size: var(--step-0); }
table.lines textarea { min-height: 34px; height: 34px; }
table.lines td:has(textarea) { min-width: 260px; }
table.lines input[type=checkbox] { margin-top: .6rem; }
.daygrid th, .daygrid td { padding: .2rem .35rem; }
.daygrid select { min-height: 30px; padding: .1rem .3rem; font-size: .75rem; min-width: 112px; }
.daygrid select.suggested { border-style: dashed; color: var(--ink-3); }
.daygrid tr.rest td { background: #f6f7f9; }
form.inline { display: inline-flex; gap: .4rem; align-items: center; margin: 0; }
form.inline select { width: auto; min-height: 36px; }
.approval-bar { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; padding: .6rem 1.2rem; border-top: 1px solid var(--silver-line); font-size: var(--step-0); color: var(--ink-2); }
.approval-bar.state-pending { background: var(--warn-wash); }
.approval-bar.state-rejected { background: var(--bad-wash); }
.approval-bar .toolbar { margin-inline-start: auto; }
.approval-bar form.inline input { width: 220px; min-height: 36px; }
.daygrid select.pending { border-color: var(--warn); background: var(--warn-wash); }

/* ---------- App: notifications bell, unread rows, offline page ---------- */
.bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; color: var(--navy); border-radius: var(--r); }
.bell:hover { background: var(--navy-soft); }
.bell svg { width: 22px; height: 22px; }
.bell b { position: absolute; top: 2px; inset-inline-start: 2px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--bad); color: #fff; font-size: .7rem; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
tr.unread td { background: var(--navy-soft); font-weight: 600; }
.offline { max-width: 420px; margin: 12vh auto; padding: 2rem 16px; text-align: center; display: grid; gap: 1rem; justify-items: center; }
.offline h1 { font-family: var(--serif); color: var(--navy); margin: 0; }
@media (display-mode: standalone) { .bench { padding-top: env(safe-area-inset-top); } }

/* مصروف العهدة: عمودي «صرفه المحامي» و«على الموكل» */
.charge-table td input { width: 100%; }
body.office-borne .charge-col { opacity: .35; }
.explain { margin-top: 1rem; padding: .75rem 1rem; border-inline-start: 3px solid var(--silver-line); background: var(--paper); }
.explain ul { margin: .25rem 0 .5rem; padding-inline-start: 1.25rem; }

/* خانات بقائمة اقتراحات: سهم واضح يبين إن فيه قائمة، والكتابة متاحة */
input.picklist { background-image: url("../img/chevron.9839f1c8e597.svg"); background-repeat: no-repeat;
  background-position: left .7rem center; padding-inline-end: 2rem; }
input.picklist::-webkit-calendar-picker-indicator { opacity: 0; }
table.bulk td { min-width: 7rem; vertical-align: top; }
table.bulk td:first-child { min-width: 2rem; }
table.bulk textarea { min-width: 12rem; }

/* أزرار الإضافة السريعة في صفحة الملف الفرعي */
.quick-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .9rem; }
.quick-actions .muted { margin-inline-end: .25rem; }

/* طلبات التعديل وسجل التعديلات */
.change-request { margin: .9rem 0; padding: .75rem 1rem; border: 1px solid var(--warn); background: var(--warn-wash); border-radius: var(--r); }
.change-table { width: 100%; border-collapse: collapse; margin: .5rem 0; }
.change-table th, .change-table td { padding: .3rem .5rem; border-bottom: 1px solid var(--silver-line); text-align: start; }
.change-table td.was { color: var(--ink-3); text-decoration: line-through; }
.change-table td.now { font-weight: 600; }
.change-table.compact { font-size: .85rem; margin: 0; }
details.history > summary { cursor: pointer; list-style: none; }
.section-title { margin: 1.5rem 0 .25rem; }
.tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin: .75rem 0; }
.tabs a { padding: .35rem .8rem; border: 1px solid var(--silver-line); border-radius: var(--r); text-decoration: none; }
.notice { padding: .5rem .75rem; background: var(--warn-wash); border-radius: var(--r); }
.hub-tabs { margin: 0 0 .75rem; }
.hub-tabs a[aria-current="page"] { background: var(--navy); color: var(--paper); border-color: var(--navy); }
details.grants > summary { cursor: pointer; list-style: none; }

/* تقويم الجلسات */
.cal-filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .9rem; }
.segmented { display: inline-flex; gap: .25rem; }
.calendar { display: grid; gap: 1px; background: var(--silver-line); }
.cal-head, .cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; }
.cal-head div { background: var(--paper); padding: .35rem; font-size: .8rem; color: var(--ink-3); text-align: center; }
.cal-day { background: #fff; min-height: 6.5rem; padding: .35rem; display: flex; flex-direction: column; gap: .25rem; }
.cal-week .cal-day { min-width: 0; }
.cal-month .cal-day { min-height: 5.5rem; }
.cal-day.outside { background: var(--paper); color: var(--ink-3); }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--navy); }
.cal-date { font-size: .8rem; color: var(--ink-2); }
.cal-wd { display: none; }
.cal-item { display: block; font-size: .78rem; line-height: 1.35; padding: .2rem .3rem; border-radius: var(--r);
  background: var(--warn-wash); color: inherit; text-decoration: none; overflow-wrap: anywhere; }
.cal-item .sub { display: block; color: var(--ink-3); }
@media (max-width: 720px) {
  .cal-head { display: none; }
  .cal-week { grid-template-columns: 1fr; }
  .cal-day { min-height: 0; }
  .cal-day.empty-day { display: none; }
  .cal-wd { display: inline; font-weight: 600; }
  .cal-month .cal-day.outside { display: none; }
}
.results { list-style: none; margin: 0; padding: 0; }
.results li { padding: .55rem 1rem; border-bottom: 1px solid var(--silver-line); }
.results li .sub { display: block; color: var(--ink-3); font-size: .85rem; }
