/* Security — Amazon deletion notices (.adr-*)
 *
 * The SECOND 30-day DPP clock: Amazon sends a deletion notice, we have 30 days from RECEIPT,
 * and we may have to certify the deletion in writing afterwards.
 *
 * Visual language: the polished teal-blue family (Evri Claims / Message Templates .mt-*),
 * deliberately NOT the Amazon-clone family.
 *
 * TWO REPO RULES OBSERVED HERE, BOTH THE HARD WAY:
 *   1. style.css line 1 carries a bare `button{...color:white...}` that bleeds into every
 *      module button. EVERY button rule below therefore sets color, background, border,
 *      padding, margin, radius, font-weight and box-shadow explicitly.
 *   2. The screen-collapsing @media block must be the LAST @media block in the file or a later
 *      block silently wins. It is the ONLY @media block in this file, and it is at the bottom.
 *      Nothing above it is mobile-conditional, so desktop rendering is defined in one place.
 */

:root {
  --adr-primary: #0588b6;
  --adr-primary-d: #03658e;
  --adr-grad: linear-gradient(135deg, #03658e, #0588b6);
  --adr-ink: #0f2740;
  --adr-sub: #5b7183;
  --adr-line: #e6edf5;
  --adr-line-s: #cfdcea;
  --adr-shadow: 0 10px 30px rgba(15, 23, 42, .06);
  --adr-danger: #b23a32;
  --adr-danger-bg: #fdeceb;
  --adr-warn: #a86a12;
  --adr-warn-bg: #fdf4e3;
  --adr-ok: #14795a;
  --adr-ok-bg: #e9f7f1;
}

/* ---------------- Page shell ---------------- */
.adr-page { background: transparent; }
.adr-wrap { max-width: 1180px; margin: 0 auto; padding: 6px 4px 40px; }

.adr-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 18px; flex-wrap: wrap; margin: 4px 0 16px;
}
.adr-eyebrow {
  font-size: 12px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
  color: var(--adr-primary);
}
.adr-title { font-size: 25px; font-weight: 800; color: var(--adr-ink); margin: 4px 0 4px; line-height: 1.15; }
.adr-sub { font-size: 13.5px; color: var(--adr-sub); margin: 0; max-width: 680px; line-height: 1.5; }
.adr-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------------- Buttons (see rule 1 in the header) ---------------- */
.adr-btn {
  appearance: none; border: 1.5px solid var(--adr-line-s); background: #fff; color: #21506f;
  font-size: 13px; font-weight: 700; padding: 9px 15px; border-radius: 11px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; transition: .15s; margin: 0;
  box-shadow: none; line-height: 1.2; text-align: center; width: auto;
}
.adr-btn:hover { border-color: var(--adr-primary); color: var(--adr-primary); background: #f5fbfe; }
.adr-btn.primary {
  border: 1.5px solid transparent; color: #fff; background: var(--adr-grad);
  box-shadow: 0 8px 18px rgba(5, 136, 182, .28);
}
.adr-btn.primary:hover { filter: brightness(1.05); color: #fff; background: var(--adr-grad); }
.adr-btn.danger { border-color: #edc4c0; color: var(--adr-danger); background: #fff; }
.adr-btn.danger:hover { border-color: var(--adr-danger); color: var(--adr-danger); background: var(--adr-danger-bg); }
.adr-btn.sm { padding: 6px 11px; font-size: 12.5px; border-radius: 9px; }
.adr-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------------- Arming banner ---------------- */
.adr-banner {
  display: flex; align-items: flex-start; gap: 11px; border-radius: 14px; padding: 12px 15px;
  font-size: 13px; line-height: 1.5; margin-bottom: 14px; border: 1.5px solid var(--adr-line);
  background: #fff; color: var(--adr-ink); box-shadow: var(--adr-shadow);
}
.adr-banner .adr-banner-ico { font-size: 16px; line-height: 1.3; }
.adr-banner.warn { background: var(--adr-warn-bg); border-color: #f0dcb4; color: #6b4708; }
.adr-banner.bad { background: var(--adr-danger-bg); border-color: #f0c6c2; color: #7d2721; }
.adr-banner b { font-weight: 800; }

/* ---------------- Deadline strip ---------------- */
.adr-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.adr-stat {
  background: #fff; border: 1.5px solid var(--adr-line); border-radius: 14px; padding: 13px 15px;
  box-shadow: var(--adr-shadow);
}
.adr-stat-n { font-size: 24px; font-weight: 800; color: var(--adr-ink); line-height: 1.1; }
.adr-stat-l { font-size: 11.5px; font-weight: 700; color: var(--adr-sub); text-transform: uppercase; letter-spacing: .06em; margin-top: 5px; }
.adr-stat.bad .adr-stat-n { color: var(--adr-danger); }
.adr-stat.warn .adr-stat-n { color: var(--adr-warn); }

/* ---------------- Request list ---------------- */
.adr-list { display: flex; flex-direction: column; gap: 12px; }
.adr-card {
  background: #fff; border: 1.5px solid var(--adr-line); border-radius: 16px; padding: 14px 16px;
  box-shadow: var(--adr-shadow); transition: border-color .15s, box-shadow .15s;
}
.adr-card:hover { border-color: #d4e4f2; box-shadow: 0 16px 34px rgba(15, 23, 42, .10); }
.adr-card.overdue { border-color: #f0c6c2; }
.adr-card.at-risk { border-color: #f0dcb4; }
.adr-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.adr-card-scope { font-size: 15px; font-weight: 800; color: var(--adr-ink); line-height: 1.3; }
.adr-card-ref { font-size: 12px; color: var(--adr-sub); margin-top: 3px; }
.adr-card-meta { display: flex; gap: 16px; flex-wrap: wrap; margin: 11px 0 0; }
.adr-meta-item { font-size: 12px; color: var(--adr-sub); }
.adr-meta-item b { display: block; font-size: 12.5px; color: var(--adr-ink); font-weight: 700; margin-top: 2px; }
.adr-card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  border-top: 1px solid var(--adr-line); padding-top: 11px; margin-top: 12px;
}
.adr-card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.adr-notes { font-size: 12.5px; color: #566d84; line-height: 1.5; margin: 9px 0 0; white-space: pre-wrap; }

/* ---------------- Pills ---------------- */
.adr-pill {
  font-size: 11.5px; font-weight: 800; padding: 4px 10px; border-radius: 999px;
  border: 1px solid #dcecf6; background: #eef5fb; color: #2d6b8f; display: inline-flex;
  align-items: center; gap: 5px; white-space: nowrap;
}
.adr-pill.overdue { background: var(--adr-danger-bg); border-color: #f0c6c2; color: var(--adr-danger); }
.adr-pill.at-risk { background: var(--adr-warn-bg); border-color: #f0dcb4; color: var(--adr-warn); }
.adr-pill.done { background: var(--adr-ok-bg); border-color: #cbe9dd; color: var(--adr-ok); }
.adr-pill.failed { background: var(--adr-danger-bg); border-color: #f0c6c2; color: var(--adr-danger); }
.adr-pill.muted { background: #f1f4f8; border-color: #e2e8f0; color: #6b7f92; }

/* ---------------- States: loading / empty / error ---------------- */
.adr-skeleton { display: flex; flex-direction: column; gap: 12px; }
.adr-sk-card {
  height: 132px; border-radius: 16px; background: var(--rms-skel-fill, #eef2f7);
  background-size: 400% 100%; animation: rms-shimmer var(--t-shimmer, 1.4s) var(--e-in-out, ease-in-out) infinite;
}
.adr-empty {
  text-align: center; padding: 52px 20px; background: #fff; border: 1.5px dashed var(--adr-line-s);
  border-radius: 18px; color: var(--adr-sub);
}
.adr-empty .adr-empty-ico { font-size: 38px; }
.adr-empty h3 { margin: 12px 0 4px; color: var(--adr-ink); font-size: 17px; }
.adr-empty p { margin: 0 auto 16px; font-size: 13.5px; max-width: 460px; line-height: 1.55; }
.adr-error {
  background: var(--adr-danger-bg); border: 1.5px solid #f0c6c2; border-radius: 18px;
  padding: 34px 20px; text-align: center; color: #7d2721;
}
.adr-error h3 { margin: 8px 0 6px; font-size: 17px; color: #7d2721; }
.adr-error p { margin: 0 auto 16px; font-size: 13.5px; max-width: 480px; line-height: 1.55; }

/* ---------------- Modal (log a notice / view the evidence) ---------------- */
.adr-modal { position: fixed; inset: 0; z-index: 100050; display: flex; align-items: center; justify-content: center; padding: 20px; }
.adr-modal-bg { position: absolute; inset: 0; background: rgba(13, 32, 51, .48); backdrop-filter: blur(2px); }
.adr-modal-shell {
  position: relative; background: #fff; border-radius: 18px; width: min(860px, 100%);
  max-height: 92vh; overflow: hidden; box-shadow: 0 30px 70px rgba(9, 26, 43, .35);
  display: flex; flex-direction: column;
}
.adr-modal-head { padding: 16px 20px; border-bottom: 1px solid var(--adr-line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.adr-modal-head h3 { margin: 0; font-size: 17px; color: var(--adr-ink); font-weight: 800; }
.adr-x {
  border: none; background: transparent; font-size: 20px; cursor: pointer; color: #8aa0b4;
  line-height: 1; padding: 4px 7px; border-radius: 8px; margin: 0; box-shadow: none;
  font-weight: 700; width: auto;
}
.adr-x:hover { background: #eef2f6; color: #33506a; }
.adr-modal-body { padding: 18px 20px; overflow-y: auto; }
.adr-modal-foot {
  padding: 14px 20px; border-top: 1px solid var(--adr-line); display: flex; align-items: center;
  justify-content: flex-end; gap: 10px; background: #fbfdff; flex-wrap: wrap;
}
.adr-modal-foot .adr-foot-left { margin-right: auto; font-size: 12px; color: var(--adr-sub); }

/* ---------------- Form ---------------- */
.adr-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px 18px; }
.adr-field.full { grid-column: 1 / -1; }
.adr-field label { display: block; font-size: 12px; font-weight: 800; color: #45607a; margin: 0 0 6px; }
.adr-field input, .adr-field select, .adr-field textarea {
  width: 100%; border: 1.5px solid var(--adr-line-s); border-radius: 10px; padding: 10px 12px;
  font-size: 13.5px; font-family: inherit; color: var(--adr-ink); background: #fbfdff;
}
.adr-field textarea { min-height: 88px; resize: vertical; line-height: 1.5; }
.adr-field input:focus, .adr-field select:focus, .adr-field textarea:focus {
  outline: none; border-color: var(--adr-primary); box-shadow: 0 0 0 3px rgba(5, 136, 182, .13);
}
.adr-hint { font-size: 11.5px; color: #90a3b6; margin: 6px 0 0; line-height: 1.45; }
.adr-form-err { font-size: 12.5px; color: var(--adr-danger); margin: 0 0 12px; font-weight: 700; }

/* ---------------- Evidence ---------------- */
.adr-section-h {
  font-size: 12px; font-weight: 800; color: #7c90a4; text-transform: uppercase;
  letter-spacing: .07em; margin: 20px 0 9px;
}
.adr-section-h:first-child { margin-top: 0; }
.adr-kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 16px; }
.adr-kv div { font-size: 12.5px; color: var(--adr-sub); }
.adr-kv div b { display: block; color: var(--adr-ink); font-weight: 700; font-size: 13px; margin-top: 2px; word-break: break-word; }
.adr-table-wrap { overflow-x: auto; border: 1.5px solid var(--adr-line); border-radius: 12px; }
.adr-table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 620px; }
.adr-table th {
  text-align: left; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  color: #7c90a4; padding: 9px 12px; background: #f7fafd; border-bottom: 1px solid var(--adr-line);
  white-space: nowrap;
}
.adr-table td { padding: 9px 12px; border-bottom: 1px solid #f1f5fa; color: var(--adr-ink); vertical-align: top; }
.adr-table tr:last-child td { border-bottom: none; }
.adr-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.adr-table td.reason { color: var(--adr-sub); font-size: 11.8px; line-height: 1.45; min-width: 260px; }
.adr-run-row { background: #fbfdff; }

/* ---------------- Confirm box ---------------- */
.adr-confirm {
  border: 1.5px solid #f0c6c2; background: var(--adr-danger-bg); border-radius: 14px;
  padding: 14px 16px; margin-top: 14px;
}
.adr-confirm h4 { margin: 0 0 6px; font-size: 14px; color: #7d2721; font-weight: 800; }
.adr-confirm p { margin: 0 0 10px; font-size: 12.5px; color: #7d2721; line-height: 1.5; }
.adr-confirm input {
  width: 190px; border: 1.5px solid #e3b3ad; border-radius: 10px; padding: 9px 12px;
  font-size: 13.5px; font-family: inherit; background: #fff; color: var(--adr-ink);
  letter-spacing: .08em; font-weight: 700;
}

/* ---------------- Dark theme ---------------- */
html[data-theme="dark"] .adr-title,
html[data-theme="dark"] .adr-card-scope,
html[data-theme="dark"] .adr-modal-head h3,
html[data-theme="dark"] .adr-stat-n,
html[data-theme="dark"] .adr-empty h3 { color: #e6edf6; }
html[data-theme="dark"] .adr-sub,
html[data-theme="dark"] .adr-hint,
html[data-theme="dark"] .adr-card-ref,
html[data-theme="dark"] .adr-meta-item,
html[data-theme="dark"] .adr-notes { color: #9fb0c4; }
html[data-theme="dark"] .adr-card,
html[data-theme="dark"] .adr-stat,
html[data-theme="dark"] .adr-banner,
html[data-theme="dark"] .adr-modal-shell,
html[data-theme="dark"] .adr-table-wrap {
  background: #162133; border-color: #2a3650; color: #e6edf6;
}
html[data-theme="dark"] .adr-meta-item b,
html[data-theme="dark"] .adr-kv div b,
html[data-theme="dark"] .adr-table td { color: #e6edf6; }
html[data-theme="dark"] .adr-card-foot,
html[data-theme="dark"] .adr-modal-head,
html[data-theme="dark"] .adr-modal-foot { border-color: #243049; }
html[data-theme="dark"] .adr-modal-foot { background: #14203300; }
html[data-theme="dark"] .adr-table th { background: #1b2739; color: #9fb0c4; border-color: #243049; }
html[data-theme="dark"] .adr-table td { border-color: #202b40; }
html[data-theme="dark"] .adr-run-row { background: #1b2739; }
html[data-theme="dark"] .adr-field input,
html[data-theme="dark"] .adr-field select,
html[data-theme="dark"] .adr-field textarea { background: #111a2b; color: #e6edf6; border-color: #243049; }
html[data-theme="dark"] .adr-btn { background: #1d2941; border-color: #2a3650; color: #cdd9e8; }
html[data-theme="dark"] .adr-btn:hover { background: #24324c; color: #7fd0ee; }
html[data-theme="dark"] .adr-btn.primary { color: #fff; background: var(--adr-grad); }
html[data-theme="dark"] .adr-empty { background: #162133; border-color: #2a3650; }
html[data-theme="dark"] .adr-x:hover { background: #24324c; }

/* =========================================================================
 * MOBILE — the ONLY @media block in this file, and deliberately the LAST
 * thing in it. A screen-collapsing block that is not last loses silently to
 * whatever @media follows it; this file has no rule below this point.
 * Nothing above is mobile-conditional, so desktop is defined exactly once.
 * ========================================================================= */
@media (max-width: 1180px) {
  .adr-wrap { padding: 4px 2px 32px; }
  .adr-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .adr-head-actions { width: 100%; }
  .adr-head-actions .adr-btn { flex: 1 1 auto; justify-content: center; }
  .adr-title { font-size: 21px; }

  /* 4 across is unreadable on a phone; 2x2 keeps every figure legible. */
  .adr-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .adr-stat { padding: 11px 13px; }
  .adr-stat-n { font-size: 20px; }

  .adr-card { padding: 13px 14px; border-radius: 14px; }
  .adr-card-top { flex-direction: column; gap: 8px; }
  .adr-card-meta { gap: 10px 18px; }
  .adr-card-foot { flex-direction: column; align-items: stretch; }
  .adr-card-actions { width: 100%; }
  .adr-card-actions .adr-btn { flex: 1 1 auto; justify-content: center; }

  /* Full-height sheet rather than a floating dialog — a form in a 92vh box on a
     phone leaves the footer buttons unreachable behind the keyboard. */
  .adr-modal { padding: 0; align-items: flex-end; }
  .adr-modal-shell { width: 100%; max-height: 100%; height: 100%; border-radius: 0; }
  .adr-modal-body { padding: 15px 16px; }
  .adr-modal-head, .adr-modal-foot { padding: 13px 16px; }
  .adr-modal-foot { flex-direction: column-reverse; align-items: stretch; }
  .adr-modal-foot .adr-btn { width: 100%; justify-content: center; }
  .adr-modal-foot .adr-foot-left { margin-right: 0; text-align: center; }

  /* One column: two 50% columns of date inputs are unusable at phone width. */
  .adr-form-grid { grid-template-columns: 1fr; gap: 13px; }
  .adr-kv { grid-template-columns: 1fr 1fr; }

  /* The evidence table keeps its real width and scrolls INSIDE its own box, so
     the page body never scrolls sideways. */
  .adr-table-wrap { -webkit-overflow-scrolling: touch; }
  .adr-confirm input { width: 100%; }
}
