/* Signal Web: the shared look.
   Signal family colours (signal-kit/design.md): burgundy accent for buttons and links, warm greys.
   Fonts: Figtree for English, IBM Plex Sans Arabic for Arabic (free,
   full glyph sets), close to the site's own Corisande and Arabic face. */

:root {
  --brand: #9b1230;
  --brand-dark: #6b0c22;
  --brand-soft: #fbe9ed;
  --link: #9b1230;
  --ink: #2B2B2B;
  --ink-2: #4A4A4A;
  --muted: #6B6B6B;
  --line: #E7E7E7;
  --line-2: #F0F0F0;
  --wash: #F7F7F7;
  --paper: #FFFFFF;
  --ok: #157A4A;
  --ok-soft: #E7F5EE;
  --warn: #B25E00;
  --warn-soft: #FFF3E3;
  --bad: #B3261E;
  --bad-soft: #FDECEB;
  --info-soft: #EEF3FF;
  --side: #FFFFFF;
  --radius: 14px;
  --radius-s: 10px;
  --shadow: 0 1px 2px rgba(20, 20, 20, .04), 0 4px 14px rgba(20, 20, 20, .04);
  --font: "Figtree", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --font-ar: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
  /* kept for older rules */
  --critical: #B3261E;
  --high: #B25E00;
  --medium: #8A6D00;
  --low: #6B6B6B;
  --accent: var(--link);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--wash);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { margin: 0 0 6px; font-size: 30px; font-weight: 400; letter-spacing: -.01em; }
h2 { margin: 34px 0 12px; font-size: 19px; font-weight: 600; }
h3 { margin: 22px 0 8px; font-size: 15px; font-weight: 600; }
h4 { margin: 14px 0 4px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.lead { margin: 0 0 22px; color: var(--muted); max-width: 780px; font-size: 16px; }
.muted { color: var(--muted); font-weight: normal; }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.r { text-align: right; }
.ok { color: var(--ok); }
.err { color: var(--bad); }
.note { color: var(--ink-2); background: var(--paper); border: 1px solid var(--line); border-left: 3px solid var(--line);
        border-radius: var(--radius-s); padding: 10px 14px; }
.icon { flex: none; vertical-align: -3px; }

/* Arabic (CLAUDE.md rule 11): dir="rtl" lang="ar" on every Arabic block */
[lang="ar"] { font-family: var(--font-ar); }
.ar { margin-top: 4px; color: var(--muted); }
td[dir="rtl"] { text-align: right; }
th.ar-head { text-align: right; }

/* --- Shell ------------------------------------------------------------------------ */
.shell { display: flex; min-height: 100vh; }
.side { width: 248px; flex: none; background: var(--side); border-right: 1px solid var(--line);
        display: flex; flex-direction: column; padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; color: var(--ink); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: #fff; display: grid;
              place-items: center; font-weight: 700; font-size: 20px; line-height: 1; padding-bottom: 3px; }
.brand-name { font-weight: 600; font-size: 16px; line-height: 1.15; }
.brand-name span { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.nav-section { margin-top: 6px; }
.nav-title { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 10px 12px 4px; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side a[href] { display: flex; align-items: center; gap: 11px; padding: 8px 12px; margin: 1px 0; border-radius: 9px;
                color: var(--ink-2); font-size: 14px; text-decoration: none; }
.side a[href]:hover { background: var(--wash); color: var(--ink); }
.side a[aria-current="page"] { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 14px 8px 2px; border-top: 1px solid var(--line); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--wash); border: 1px solid var(--line);
          display: grid; place-items: center; font-weight: 600; color: var(--ink-2); }
.me-text { flex: 1; min-width: 0; }
.me-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-role { color: var(--muted); font-size: 12px; }
.icon-btn { background: none; border: 0; padding: 6px; border-radius: 8px; color: var(--muted); cursor: pointer; display: grid; }
.icon-btn:hover { background: var(--wash); color: var(--ink); }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.content { flex: 1; padding: 34px 40px 48px; max-width: 1280px; width: 100%; }
.status { display: flex; justify-content: space-between; gap: 16px; padding: 12px 40px; font-size: 12px; color: var(--muted);
          border-top: 1px solid var(--line); background: var(--paper); }

/* --- Sign-in and other single cards ----------------------------------------------------- */
.single { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px;
          background: linear-gradient(160deg, #fff 0%, var(--wash) 60%); }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow); }
.narrow { width: 100%; max-width: 420px; }

/* --- Forms and buttons ------------------------------------------------------------------ */
.stack { display: flex; flex-direction: column; gap: 14px; margin: 12px 0; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
input, select, textarea { font: inherit; font-weight: 400; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px;
                          background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(0, 67, 206, .25); border-color: var(--link); }
button { font: inherit; cursor: pointer; }
.primary, .btn.primary, a.btn.primary { background: var(--brand); color: #fff; border: 1px solid var(--brand); border-radius: 999px;
          padding: 9px 20px; font-weight: 500; }
.primary:hover, .btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); text-decoration: none; }
.link { background: none; border: 0; padding: 0; color: var(--link); }
.link:hover { text-decoration: underline; }
form.inline { display: inline; }
.notice { background: var(--ok-soft); border: 1px solid #BFE3CF; border-radius: var(--radius-s); padding: 12px 16px; margin-bottom: 16px; }
.notice p { margin: 0 0 8px; }
.copy { width: 100%; font-family: Consolas, monospace; font-size: 13px; }

/* --- Number tiles ------------------------------------------------------------------------ */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin: 10px 0 14px; }
.tile { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
        display: flex; flex-direction: column; gap: 2px; color: var(--ink); text-decoration: none; box-shadow: var(--shadow); }
a.tile:hover { border-color: #CFCFCF; text-decoration: none; }
.tile .num { font-size: 26px; font-weight: 600; letter-spacing: -.01em; order: 2; }
.tile span:last-child { color: var(--muted); font-size: 13px; order: 1; }
.tile[aria-current] { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }

/* --- Tables -------------------------------------------------------------------------------- */
.grid { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--paper); border: 1px solid var(--line);
        border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.grid.compact { width: auto; min-width: 320px; }
.grid th, .grid td { text-align: left; padding: 11px 14px; border-top: 1px solid var(--line-2); vertical-align: top; }
.grid thead th { background: #FAFAFA; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase;
                 letter-spacing: .04em; border-top: 0; }
.grid tbody tr:hover td { background: #FCFCFC; }
.grid .r { text-align: right; }
.grid tr.total th, .grid tr.total td { font-weight: 700; }
.grid td.value pre { margin: 0; font-size: 12px; white-space: pre-wrap; }
.history { padding-left: 18px; }
.history li { margin-bottom: 4px; }

/* --- Severity --------------------------------------------------------------------------------- */
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill.sev-critical { background: var(--bad-soft); color: var(--bad); }
.pill.sev-high { background: var(--warn-soft); color: var(--warn); }
.pill.sev-medium { background: #FFF8DB; color: #7A6000; }
.pill.sev-low { background: var(--wash); color: var(--muted); }
.tile.sev-critical .num { color: var(--bad); }
.tile.sev-high .num { color: var(--warn); }

/* --- Phone width ------------------------------------------------------------------------------- */
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .side { width: auto; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px; }
  .nav-section { margin: 0; }
  .nav-title { display: none; }
  .side ul { display: flex; flex-wrap: wrap; }
  .side a[href] { padding: 6px 10px; }
  .side a[href] span { display: none; }
  .brand { padding: 4px 8px; }
  .brand-name { display: none; }
  .me { margin: 0 0 0 auto; border: 0; padding: 0; }
  .me-text { display: none; }
  .content { padding: 22px 16px; }
  .status { padding: 10px 16px; flex-direction: column; }
  .grid { display: block; overflow-x: auto; }
}

.brand-logo { display: block; height: 32px; width: 32px; flex: none; }
.brand-logo.big { height: 56px; width: 56px; margin: 0 auto 10px; }
.brand-title { font-size: 19px; font-weight: 400; color: var(--ink); letter-spacing: -.01em; }
.brand-title b { font-weight: 700; }
.brand-title.big { font-size: 28px; margin: 0 0 6px; }

/* Anything marked hidden stays hidden, whatever its layout says. */
[hidden] { display: none !important; }
