@import url("/assets/css/rp-base.css"); /* UI-VOCAB-01 §1.2: the ONE shared base sheet (tokens + scrollbars) — rules live there, never here */
/* ============================================================
   ResPilot — Resident Portal Theme (scoped)
   File: resident-theme.css
   ------------------------------------------------------------
   Design source: Michael's reference image (AdminLTE-style hotel
   dashboard), palette sampled from the image 2026-07-03.

   LOAD ORDER (resident _layout.php only):
     1. admin/assets/admin.css      (shared shell — unchanged)
     2. portal/assets/portal.css    (existing portal fork)
     3. THIS FILE                   (wins by scope specificity)

   SCOPE RULE:
     Every selector is prefixed with body.rp-resident.
     The agent adds class="rp-resident" to the resident portal's
     <body> tag. Nothing here can leak into the Park / Corp /
     Platform portals, which never carry that class.

   DRAWER SAFETY (commit ca31407):
     This file NEVER touches transform, position, left/right, or
     width on .sidebar/.main/.sb-backdrop. Mobile drawer mechanics
     stay exactly as shipped; we only recolor surfaces.

   PARK BRANDING:
     --brand is injected by the layout when the park has set
     site_brand_color. It overrides the teal default. All four
     status colors (info/success/warning/danger) are fixed.
   ============================================================ */

/* ------------------------------------------------------------
   1. TOKENS
   ------------------------------------------------------------ */
body.rp-resident {
  /* palette sampled from reference */
  --rp-dark:        #161620;  /* sidebar + topbar surface        */
  --rp-dark-2:      #1E1E2A;  /* hover rows / raised dark        */
  --rp-primary:     var(--brand, #006770);  /* brand teal        */
  --rp-primary-hi:  #0A7A84;  /* hover/active of primary         */
  --rp-info:        #01BEE8;
  --rp-success:     #009D56;
  --rp-warning:     #EF970F;
  --rp-danger:      #D64437;
  --rp-action:      #3785B7;  /* edit / secondary row action     */

  --rp-bg:          #F8F8F8;  /* content background              */
  --rp-panel:       #FFFFFF;
  --rp-line:        #E4E7EA;  /* hairline borders                */
  /* ★★ CONTROL BOUNDARY — DELIBERATELY NOT --rp-line (2026-08-15, measured in-browser).
     WCAG requires 3:1 for the boundary of a UI COMPONENT; a decorative hairline has no such
     requirement. --rp-line is #E4E7EA and is used ~119 times across the portal, almost all of it
     card outlines — so raising IT would darken every panel edge in the resident portal to fix a
     control. ★ The control gets its own token instead.
     ★ MEASURED, not chosen by eye: #E4E7EA scored 1.13 against a tinted panel rgb(241,245,251)
     and 1.24 against white — both far under 3.0. #64748B scores 4.35 and 4.76. The instance that
     surfaced it was the autopay consent checkbox, the single control that records a resident's
     agreement to recurring charges: while it was invisible the submit stayed disabled and nothing
     explained why. But the defect was never that modal's — it was this token, on every checkbox
     and radio in the portal. */
  --rp-control-line: #64748B;  /* UI control boundaries (WCAG 3:1)  */
  /* ★★ CONTROL ACCENT — the fill of a CHECKED control. Deliberately NOT var(--rp-primary).
     A park chooses its own brand colour and nothing stopped it choosing a pale one; the checked
     fill carries WCAG's 3:1 obligation and a brand does not. ★ portal/_layout.php overrides this
     with brand_control_accent($brand) — the park's OWN colour whenever it clears 3:1 against
     white, and a hue-preserving darkened version of it when it does not. This value is the
     no-brand default and matches --rp-primary's own fallback, so an unbranded park is unchanged. */
  --rp-control-accent: #006770;
  --rp-text:        #24272B;
  --rp-text-mute:   #6B7075;
  --rp-text-inv:    #E7E9EC;  /* text on dark rail               */

  --rp-radius:      3px;      /* reference uses tight corners    */
  --rp-radius-card: 4px;
  --rp-shadow:      0 1px 2px rgba(22,22,32,.08);

  background: var(--rp-bg);
  color: var(--rp-text);
}

/* ------------------------------------------------------------
   2. SHELL — sidebar, brand block, topbar, breadcrumb
   (colors only; geometry untouched per drawer safety)
   ------------------------------------------------------------ */
body.rp-resident .sidebar {
  background: var(--rp-dark);
  color: var(--rp-text-inv);
  border-right: 0;
}

/* Brand block at the top of the rail — park name on teal */
body.rp-resident .sidebar .brand,
body.rp-resident .sidebar .sidebar-brand,
body.rp-resident .sidebar .sb-brand {
  background: var(--rp-primary);
  color: #fff;
  font-weight: 700;
  letter-spacing: .02em;
}

/* Resident identity row (name + Online dot) */
body.rp-resident .sidebar .user-panel { color: var(--rp-text-inv); }
body.rp-resident .sidebar .user-panel .status-dot {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; background: var(--rp-success);
  margin-right: 6px; vertical-align: baseline;
}

/* Nav items */
body.rp-resident .sidebar a,
body.rp-resident .sidebar .nav-link {
  color: var(--rp-text-inv);
  opacity: .85;
}
body.rp-resident .sidebar a:hover,
body.rp-resident .sidebar .nav-link:hover {
  background: var(--rp-dark-2);
  opacity: 1;
}
body.rp-resident .sidebar .active,
body.rp-resident .sidebar .nav-link.active {
  background: var(--rp-primary);
  color: #fff;
  opacity: 1;
  border-left: 3px solid var(--rp-info);
}
body.rp-resident .sidebar .nav-section-label {
  color: var(--rp-text-mute);
  font-size: .72rem; text-transform: uppercase; letter-spacing: .08em;
}

/* Topbar */
body.rp-resident .topbar {
  background: var(--rp-dark);
  color: var(--rp-text-inv);
  border-bottom: 0;
  box-shadow: var(--rp-shadow);
}
body.rp-resident .topbar a { color: var(--rp-text-inv); }
body.rp-resident .topbar .hamburger,
body.rp-resident .topbar .topbar-hamburger { color: var(--rp-text-inv); }

/* Breadcrumb (right side of page header, per reference) */
body.rp-resident .breadcrumb {
  font-size: .8rem; color: var(--rp-text-mute);
}
body.rp-resident .breadcrumb a { color: var(--rp-primary); text-decoration: none; }
body.rp-resident .breadcrumb .sep { margin: 0 .4em; opacity: .5; }

/* Page header row: "Invoices  List" + breadcrumb right */
body.rp-resident .page-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin: 14px 0 12px;
}
body.rp-resident .page-head h1 {
  font-size: 1.35rem; font-weight: 600; margin: 0;
}
body.rp-resident .page-head h1 .light { font-weight: 300; color: var(--rp-text-mute); margin-left: .35em; }

/* ------------------------------------------------------------
   3. STAT CARDS — colored icon block left, label + number right
   ------------------------------------------------------------ */
body.rp-resident .stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
body.rp-resident .stat-card {
  display: flex; align-items: stretch;
  background: var(--rp-panel);
  border: 1px solid var(--rp-line);
  border-radius: var(--rp-radius-card);
  box-shadow: var(--rp-shadow);
  overflow: hidden;
  min-height: 76px;
}
body.rp-resident .stat-card .icon {
  flex: 0 0 64px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.5rem;
}
body.rp-resident .stat-card .meta {
  padding: 12px 14px;
  display: flex; flex-direction: column; justify-content: center;
  min-width: 0;
}
body.rp-resident .stat-card .label {
  font-size: .72rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--rp-text-mute);
}
body.rp-resident .stat-card .value {
  font-size: 1.45rem; font-weight: 700; line-height: 1.15;
  color: var(--rp-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* color variants */
body.rp-resident .stat-card.info    .icon { background: var(--rp-info); }
body.rp-resident .stat-card.success .icon { background: var(--rp-success); }
body.rp-resident .stat-card.warning .icon { background: var(--rp-warning); }
body.rp-resident .stat-card.danger  .icon { background: var(--rp-danger); }

/* ------------------------------------------------------------
   4. PANELS / CARDS
   ------------------------------------------------------------ */
body.rp-resident .card,
body.rp-resident .panel {
  background: var(--rp-panel);
  border: 1px solid var(--rp-line);
  border-radius: var(--rp-radius-card);
  box-shadow: var(--rp-shadow);
}
body.rp-resident .card-header,
body.rp-resident .panel-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--rp-line);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-weight: 600;
}
body.rp-resident .card-header .cta { margin-left: auto; }

/* ------------------------------------------------------------
   5. LIST-TABLE TOOLBAR — Show N entries · Search
   ------------------------------------------------------------ */
body.rp-resident .table-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 14px;
}
body.rp-resident .table-toolbar .show-entries { font-size: .85rem; color: var(--rp-text-mute); }
body.rp-resident .table-toolbar .show-entries select { margin: 0 .35em; }
body.rp-resident .table-toolbar .search { margin-left: auto; }
body.rp-resident .table-toolbar .search input {
  padding: 6px 10px; border: 1px solid var(--rp-line);
  border-radius: var(--rp-radius); min-width: 180px;
}

/* ------------------------------------------------------------
   6. TABLES — sortable headers, hover rows, footer count
   ------------------------------------------------------------ */
body.rp-resident .table { width: 100%; border-collapse: collapse; font-size: .9rem; }
body.rp-resident .table th {
  text-align: left; font-weight: 600; color: var(--rp-text);
  padding: 9px 12px; border-bottom: 2px solid var(--rp-line);
  white-space: nowrap;
}
body.rp-resident .table th.sortable { cursor: pointer; }
body.rp-resident .table th.sortable::after {
  content: "⇅"; margin-left: .35em; font-size: .75em; opacity: .35;
}
body.rp-resident .table th.sorted-asc::after  { content: "▲"; opacity: .8; }
body.rp-resident .table th.sorted-desc::after { content: "▼"; opacity: .8; }
body.rp-resident .table td {
  padding: 9px 12px; border-bottom: 1px solid var(--rp-line);
  vertical-align: middle;
}
body.rp-resident .table tbody tr:hover { background: #F1F6F7; }
body.rp-resident .table-footnote {
  padding: 10px 14px; font-size: .8rem; color: var(--rp-text-mute);
}

/* Wide-table scroll region (pairs with ca31407 behavior) */
body.rp-resident .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ------------------------------------------------------------
   7. BUTTONS
   ------------------------------------------------------------ */
body.rp-resident .btn {
  display: inline-flex; align-items: center; gap: .4em;
  border: 0; border-radius: var(--rp-radius);
  padding: 8px 14px; font-size: .88rem; font-weight: 600;
  color: #fff; background: var(--rp-primary);
  cursor: pointer; text-decoration: none;
  transition: filter .12s ease;
}
body.rp-resident .btn:hover  { filter: brightness(1.08); }
body.rp-resident .btn:active { filter: brightness(.94); }

body.rp-resident .btn.primary,
body.rp-resident .btn.btn-primary { background: var(--rp-primary); }
body.rp-resident .btn.info    { background: var(--rp-info); }
body.rp-resident .btn.success { background: var(--rp-success); }
body.rp-resident .btn.warning { background: var(--rp-warning); color: #1d1d1d; }
body.rp-resident .btn.danger,
body.rp-resident .btn.btn-danger { background: var(--rp-danger); }
body.rp-resident .btn.action  { background: var(--rp-action); }

body.rp-resident .btn.btn-outline,
body.rp-resident .btn.ghost {
  background: transparent; color: var(--rp-primary);
  border: 1.5px solid var(--rp-primary);
}
body.rp-resident .btn.ghost:hover { background: rgba(0,103,112,.08); filter: none; }

/* Small per-row action buttons (reference: Housekeeping/Edit/Delete) */
body.rp-resident .btn.btn-sm,
body.rp-resident .btn.sm {
  padding: 4px 10px; font-size: .78rem; font-weight: 600; gap: .3em;
}
body.rp-resident td .btn.sm + .btn.sm { margin-left: 6px; }

/* Green top-right panel CTA (reference: + Add) */
body.rp-resident .btn.add { background: var(--rp-success); }

/* Disabled */
body.rp-resident .btn[disabled],
body.rp-resident .btn.disabled { opacity: .55; cursor: not-allowed; filter: none; }

/* ------------------------------------------------------------
   8. BADGES / STATUS PILLS
   ------------------------------------------------------------ */
/* UI-06 §1.4 (2026-09-03): the resident theme's .badge pills are GONE — status labels are .rp-badge + a tone from rp-base (one class, site-wide);
   the print rule lives there too. */

/* ------------------------------------------------------------
   9. FORMS
   ------------------------------------------------------------ */
body.rp-resident .form-control,
body.rp-resident input[type="text"],
body.rp-resident input[type="email"],
body.rp-resident input[type="tel"],
body.rp-resident input[type="password"],
body.rp-resident input[type="number"],
body.rp-resident input[type="date"],
body.rp-resident select,
body.rp-resident textarea {
  border: 1px solid var(--rp-line);
  border-radius: var(--rp-radius);
  padding: 8px 10px; font-size: .9rem;
  background: #fff; color: var(--rp-text);
  accent-color: var(--rp-primary);
}
body.rp-resident .form-control:focus,
body.rp-resident input:focus,
body.rp-resident select:focus,
body.rp-resident textarea:focus {
  outline: none;
  border-color: var(--rp-primary);
  box-shadow: 0 0 0 3px rgba(0,103,112,.18);
}
body.rp-resident input[type="checkbox"],
body.rp-resident input[type="radio"] { accent-color: var(--rp-primary); }
body.rp-resident label { font-size: .85rem; font-weight: 600; }
body.rp-resident .field-help { font-size: .78rem; color: var(--rp-text-mute); }
body.rp-resident .field-error { font-size: .8rem; color: var(--rp-danger); font-weight: 600; }

/* ------------------------------------------------------------
   10. ALERTS / EMPTY STATES
   ------------------------------------------------------------ */
body.rp-resident .alert {
  border-radius: var(--rp-radius-card);
  padding: 10px 14px; font-size: .88rem;
  border: 1px solid transparent;
}
body.rp-resident .alert.info    { background: #E6F8FD; border-color: var(--rp-info);    color: #045a70; }
body.rp-resident .alert.success { background: #E8F6EF; border-color: var(--rp-success); color: #075a35; }
body.rp-resident .alert.warning { background: #FDF3E1; border-color: var(--rp-warning); color: #7a4d06; }
body.rp-resident .alert.danger  { background: #FBEAE8; border-color: var(--rp-danger);  color: #7c2018; }
body.rp-resident .empty-state {
  text-align: center; padding: 34px 16px; color: var(--rp-text-mute);
}
body.rp-resident .empty-state .hint { font-size: .85rem; }

/* ------------------------------------------------------------
   11. CO-PILOT HARMONIZATION (wave 1 panel — teal accent)
   ------------------------------------------------------------ */
body.rp-resident .copilot-launch { background: var(--rp-primary); color: #fff; }
body.rp-resident .copilot-panel .panel-header { background: var(--rp-primary); color: #fff; }
body.rp-resident .copilot-panel .send-btn { background: var(--rp-primary); }

/* ------------------------------------------------------------
   12. RESPONSIVE — content patterns only (drawer untouched)
   ------------------------------------------------------------ */
@media (max-width: 820px) {
  body.rp-resident .stat-row { grid-template-columns: repeat(2, minmax(0,1fr)); }
  body.rp-resident .page-head { flex-wrap: wrap; }
  body.rp-resident .table-toolbar { flex-wrap: wrap; }
  body.rp-resident .table-toolbar .search { margin-left: 0; width: 100%; }
  body.rp-resident .table-toolbar .search input { width: 100%; }
}
@media (max-width: 480px) {
  body.rp-resident td .btn.sm { display: flex; width: 100%; justify-content: center; }
  body.rp-resident td .btn.sm + .btn.sm { margin: 6px 0 0 0; }
}
@media (max-width: 340px) {
  body.rp-resident .stat-row { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------
   13. ACCESSIBILITY & MOTION
   ------------------------------------------------------------ */
body.rp-resident :focus-visible {
  outline: 2px solid var(--rp-primary);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  body.rp-resident * { transition: none !important; animation: none !important; }
}

/* ------------------------------------------------------------
   14. PRINT — invoices & receipts (clean, park-branded)
   ------------------------------------------------------------ */
/* Print-only brand header: hidden on screen, revealed by @media print (wave2 P4). */
body.rp-resident .print-brand-header { display: none; }

@media print {
  body.rp-resident { background: #fff; }
  body.rp-resident .sidebar,
  body.rp-resident .topbar,
  body.rp-resident .sb-backdrop,
  body.rp-resident .breadcrumb,
  body.rp-resident .table-toolbar,
  body.rp-resident .btn,
  body.rp-resident .copilot-launch,
  body.rp-resident .copilot-panel { display: none !important; }
  body.rp-resident .main { margin: 0 !important; width: 100% !important; }
  body.rp-resident .card,
  body.rp-resident .panel { border: 0; box-shadow: none; }
  body.rp-resident .print-brand-header {
    display: flex; align-items: center; gap: 10px;
    border-bottom: 2px solid var(--rp-primary);
    padding-bottom: 8px; margin-bottom: 14px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ADDENDUM — FINISH LAYER (modern controls, motion, dark mode). Appended per the
   redesign addendum. Scope rule unchanged (body.rp-resident only). Drawer-safe.
   ═══════════════════════════════════════════════════════════════════════════ */

/* A.1 — Custom checkboxes & radios (teal accent, smooth check, focus ring) */
body.rp-resident input[type="checkbox"],
body.rp-resident input[type="radio"] {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px; margin: 0 6px 0 0; vertical-align: -3px;
  border: 1.5px solid var(--rp-control-line); background: var(--rp-panel);
  border-radius: 4px; cursor: pointer; position: relative;
  transition: background .12s ease, border-color .12s ease;
}
body.rp-resident input[type="radio"] { border-radius: 50%; }
/* ★ The CHECKED fill uses the GUARDED accent, never --rp-primary directly: a park's brand is its
   identity and stays untouched everywhere else, but this one use has a contrast floor. */
body.rp-resident input[type="checkbox"]:checked,
body.rp-resident input[type="radio"]:checked { background: var(--rp-control-accent); border-color: var(--rp-control-accent); }
body.rp-resident input[type="checkbox"]:checked::after {
  content: ""; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
body.rp-resident input[type="radio"]:checked::after {
  content: ""; position: absolute; left: 4px; top: 4px; width: 6px; height: 6px; border-radius: 50%; background: #fff;
}
body.rp-resident input[type="checkbox"]:focus-visible,
body.rp-resident input[type="radio"]:focus-visible { outline: 2px solid var(--rp-primary); outline-offset: 2px; }

/* A.2 — iOS-style slider switch (.rp-switch) for instant-apply on/off settings */
body.rp-resident .rp-switch { position: relative; display: inline-block; width: 42px; height: 24px; vertical-align: middle; }
body.rp-resident .rp-switch input { opacity: 0; width: 0; height: 0; }
body.rp-resident .rp-switch .slider {
  position: absolute; inset: 0; cursor: pointer; background: #c7ccd1; border-radius: 24px; transition: background .18s ease;
}
body.rp-resident .rp-switch .slider::before {
  content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: #fff;
  border-radius: 50%; transition: transform .18s ease; box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
body.rp-resident .rp-switch input:checked + .slider { background: var(--rp-primary); }
body.rp-resident .rp-switch input:checked + .slider::before { transform: translateX(18px); }
body.rp-resident .rp-switch input:focus-visible + .slider { outline: 2px solid var(--rp-primary); outline-offset: 2px; }

/* A.3 — select chevron, resident scope accent (gray). UI-SELECT-01 §2: THE select rule lives in
   rp-base.css (@imported first); a scope sheet overrides ONLY the chevron image color — never a
   second appearance/padding/glyph rule (this block used to be one, and its right-10px/28px slot
   fought the base rule's 34px). */
body.rp-resident select:not([multiple]):not([size]) {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236B7075' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

/* A.4 — Text fields: consistent height/padding + inline validation states */
body.rp-resident .form-control { min-height: 40px; transition: border-color .12s ease, box-shadow .12s ease; }
body.rp-resident .form-control.is-valid  { border-color: var(--rp-success); }
body.rp-resident .form-control.is-invalid { border-color: var(--rp-danger); }
body.rp-resident .field-error { color: var(--rp-danger); font-size: .8rem; margin-top: 3px; }

/* A.5 — Focus-visible + touch targets */
body.rp-resident a:focus-visible,
body.rp-resident button:focus-visible,
body.rp-resident .form-control:focus-visible { outline: 2px solid var(--rp-primary); outline-offset: 2px; }
@media (max-width: 820px) {
  body.rp-resident .btn, body.rp-resident .form-control,
  body.rp-resident .rp-switch { min-height: 44px; }
}

/* B.1 — Collapsible sections (.rp-collapse) */
body.rp-resident .rp-collapse > .rp-collapse-head {
  display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 10px 0; font-weight: 600; user-select: none;
}
body.rp-resident .rp-collapse > .rp-collapse-head::before {
  content: "▸"; color: var(--rp-primary); transition: transform .18s ease; font-size: 12px;
}
body.rp-resident .rp-collapse.open > .rp-collapse-head::before { transform: rotate(90deg); }
body.rp-resident .rp-collapse > .rp-collapse-body { display: none; }
body.rp-resident .rp-collapse.open > .rp-collapse-body { display: block; }

/* B.2 — Soft section divider */
body.rp-resident .rp-divider { height: 1px; background: var(--rp-line); margin: 18px 0; box-shadow: 0 1px 0 rgba(22,22,32,.02); border: 0; }

/* C.1 — Greeting fade/slide-in (once per load) */
@keyframes rpGreet { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
body.rp-resident .rp-greet { animation: rpGreet .4s ease-out both; }

/* C.2 — Interactive card hover lift (only on .stat-card links + .rp-hover) */
body.rp-resident a.stat-card, body.rp-resident .rp-hover { transition: transform .15s ease, box-shadow .15s ease; }
body.rp-resident a.stat-card:hover, body.rp-resident .rp-hover:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(22,22,32,.12); }

/* C.3 — Progress bars animate width on first paint */
@keyframes rpBar { from { width: 0; } }
body.rp-resident .rp-bar > span { display: block; height: 100%; background: var(--rp-primary); border-radius: 999px; animation: rpBar .3s ease-out; }
body.rp-resident .rp-bar { height: 8px; background: var(--rp-line); border-radius: 999px; overflow: hidden; }

/* C.4 — Skeleton shimmer (for async panels only) */
@keyframes rpShimmer { 0% { background-position: -200px 0; } 100% { background-position: 200px 0; } }
body.rp-resident .rp-skeleton { background: linear-gradient(90deg, #eee 25%, #f5f5f5 37%, #eee 63%); background-size: 400px 100%; animation: rpShimmer 1.2s infinite; border-radius: 4px; }

/* C.8 — DARK MODE (warm near-black). Default follows prefers-color-scheme until the resident
   chooses; an explicit body.rp-dark-mode / body.rp-light-mode class then wins. */
@media (prefers-color-scheme: dark) {
  body.rp-resident:not(.rp-light-mode) {
    --rp-bg: #17171D; --rp-panel: #1F1F27; --rp-line: #2E2E38;
    --rp-text: #ECE9E4; --rp-text-mute: #A69F97; --rp-dark: #101014; --rp-dark-2: #17171D;
    --rp-primary: var(--brand, #128A93); --rp-warning: #F0A93C; --rp-info: #38CDEF; --rp-success: #17B267;
  }
}
body.rp-resident.rp-dark-mode {
  --rp-bg: #17171D; --rp-panel: #1F1F27; --rp-line: #2E2E38;
  --rp-text: #ECE9E4; --rp-text-mute: #A69F97; --rp-dark: #101014; --rp-dark-2: #17171D;
  --rp-primary: var(--brand, #128A93); --rp-warning: #F0A93C; --rp-info: #38CDEF; --rp-success: #17B267;
}
body.rp-resident.rp-dark-mode .card, body.rp-resident.rp-dark-mode .panel { box-shadow: none; }
body.rp-resident.rp-dark-mode .table tbody tr:hover { background: #24242E; }

/* E.1 — prefers-reduced-motion: disable ALL addendum + base motion */
@media (prefers-reduced-motion: reduce) {
  body.rp-resident *, body.rp-resident *::before, body.rp-resident *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important;
  }
}

/* B.4 — Styled dialog (replaces native alert/confirm) */
body.rp-resident .rp-modal-ov, .rp-modal-ov {
  position: fixed; inset: 0; z-index: 10000; background: rgba(15,23,42,.5);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.rp-modal { background: var(--rp-panel,#fff); color: var(--rp-text,#24272B); border-radius: var(--rp-radius-card,4px);
  max-width: 420px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.rp-modal-hd { padding: 15px 18px; font-weight: 700; border-bottom: 1px solid var(--rp-line,#e2e8f0); }
.rp-modal-bd { padding: 16px 18px; font-size: 14px; line-height: 1.5; }
.rp-modal-ft { padding: 12px 18px; border-top: 1px solid var(--rp-line,#e2e8f0); display: flex; gap: 8px; justify-content: flex-end; }
