/* DMA client app. Light on purpose: the reports themselves are designed on a
   light ground, and a dark shell around a light report reads as two apps. */
:root {
  color-scheme: light;
  --ink: #17202e;
  --navy: #14335c;
  --blue: #1d6fe0;
  --ground: #f4f6f9;
  --card: #ffffff;
  --muted: #5a6676;
  --line: #e3e8ef;
  --red: #be3226;
  --indigo: #5b4bc4;
  --radius: 14px;
  --font: "SF Arabic", "Segoe UI", "Noto Sans Arabic", "Noto Sans", Tahoma, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); }
[hidden] { display: none !important; }
button, input { font: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 55%, transparent); outline-offset: 2px; }

/* ---- sign-in and password: one card on the ground ---- */
.gate { min-height: 100vh; display: grid; place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom)); }
.gate-card { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 28px 22px 22px; box-shadow: 0 10px 30px rgba(20, 51, 92, .07);
  display: grid; gap: 14px; text-align: center; }
.gate-logo { width: 200px; max-width: 70%; height: auto; margin: 0 auto 4px; }
.gate-card h1 { font-size: 1.25rem; margin: 0; color: var(--navy); text-wrap: balance; }
.gate-card h1 span { font-weight: 500; color: var(--muted); font-size: .95rem; }
.gate-foot { color: var(--muted); font-size: .78rem; margin: 6px 0 0; }
.lead { color: var(--muted); margin: 0; font-size: .95rem; }
.alert { background: #fdf0ee; color: #8f2318; border: 1px solid #f3c9c2; border-radius: 10px;
  padding: 10px 12px; margin: 0; font-size: .92rem; text-align: start; }
.stack { display: grid; gap: 14px; text-align: start; }
.stack label { display: grid; gap: 6px; font-weight: 600; font-size: .92rem; }
.stack label i { font-style: normal; font-weight: 400; color: var(--muted); font-size: .82rem; }
.stack small { color: var(--muted); font-weight: 400; }
input[type=text], input[type=password], input:not([type]) {
  width: 100%; height: 48px; border: 1px solid #cdd5df; border-radius: 10px; padding: 0 14px;
  background: #fff; color: var(--ink); font-size: 1rem; }
input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(29, 111, 224, .18); }
.primary { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 0 18px; border: 0; border-radius: 12px; background: var(--navy);
  color: #fff; font-weight: 700; text-decoration: none; cursor: pointer; width: 100%; }
.primary:active { transform: translateY(1px); }

/* ---- the bar ---- */
.bar { position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: auto 1fr auto;
  align-items: center; gap: 12px; background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px; }
.bar-mark img { display: block; width: 34px; height: 34px; }
.bar-back { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  text-decoration: none; color: var(--navy); font-size: 1.35rem; background: var(--ground); }
.bar-title { display: grid; min-width: 0; line-height: 1.25; }
.bar-title strong { color: var(--navy); font-size: 1.05rem; }
.bar-title span { color: var(--muted); font-size: .84rem; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.menu { position: relative; }
.menu summary { list-style: none; width: 40px; height: 40px; border-radius: 10px; display: grid;
  place-content: center; gap: 4px; cursor: pointer; background: var(--ground); }
.menu summary::-webkit-details-marker { display: none; }
.menu summary span { display: block; width: 4px; height: 4px; border-radius: 50%; background: var(--navy); }
.menu-sheet { position: absolute; inset-inline-end: 0; top: 46px; min-width: 200px; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; padding: 6px;
  box-shadow: 0 14px 34px rgba(20, 51, 92, .14); display: grid; gap: 2px; }
.menu-sheet button { width: 100%; text-align: start; background: none; border: 0; padding: 12px;
  border-radius: 8px; color: var(--ink); cursor: pointer; }
.menu-sheet button:hover { background: var(--ground); }
.menu-who { margin: 4px 12px 6px; color: var(--muted); font-size: .82rem; }

/* ---- the inbox ---- */
.page { max-width: 720px; margin: 0 auto; padding: 16px 14px calc(28px + env(safe-area-inset-bottom));
  display: grid; gap: 14px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; display: grid; gap: 10px; }
.panel h2 { margin: 0; font-size: 1rem; color: var(--navy); }
.install { justify-self: start; border: 1px solid var(--line); background: #fff; color: var(--navy);
  border-radius: 999px; padding: 10px 16px; font-weight: 700; cursor: pointer; }
.empty { color: var(--muted); text-align: center; padding: 48px 12px; }
.docs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.doc { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "kind new" "date files";
  gap: 2px 10px; align-items: center; min-height: 68px; padding: 12px 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--ink); border-inline-start: 5px solid var(--blue); }
.doc:active { background: #fafbfd; }
.kind-evening { border-inline-start-color: var(--indigo); }
.kind-weekly-read { border-inline-start-color: var(--navy); }
.kind-crisis { border-inline-start-color: var(--red); }
.doc-kind { grid-area: kind; font-weight: 700; color: var(--navy); }
.kind-crisis .doc-kind { color: var(--red); }
.doc-date { grid-area: date; color: var(--muted); font-size: .9rem; justify-self: start;
  font-variant-numeric: tabular-nums; }
.doc-new { grid-area: new; justify-self: end; background: var(--blue); color: #fff; border-radius: 999px;
  font-size: .72rem; font-weight: 700; padding: 2px 9px; }
.doc-files { grid-area: files; justify-self: end; color: var(--muted); font-size: .82rem; }
.more { text-align: center; padding: 12px; font-weight: 700; text-decoration: none; }

/* ---- one report ---- */
.files { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 14px; background: #fff;
  border-bottom: 1px solid var(--line); }
.file { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 999px;
  background: var(--navy); color: #fff; text-decoration: none; font-size: .88rem; font-weight: 700; }
.report { overflow-x: hidden; }
.report img { max-width: 100%; height: auto; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
