/*
 * ReadyAED design system (v2)
 *
 * Loaded after theme/css/style.css on every page, so existing markup inherits it.
 * Brand colours come from the official logo (readyAED-assets/logo/ReadyAED.svg):
 * navy #021C52, red #E6061D, slate #414551.
 *
 * Colour roles:
 *  - Blue  (--ra-blue)  every action: primary buttons, links, focus, selected states.
 *  - Navy  (--ra-navy)  structure and headings: sidebar, titles, numbers.
 *  - Red   (--ra-red)   only for "Not Ready", destructive actions and the logo.
 *  - Green / amber      Ready / Attention.
 */

:root {
  --ra-navy: #021C52;
  --ra-navy-900: #061538;
  --ra-navy-700: #0E2A6B;
  --ra-blue: #1F4FD1;
  --ra-blue-700: #173DA6;
  --ra-blue-600: #2A5BE0;
  --ra-blue-100: #DCE6FB;
  --ra-blue-50: #EEF3FE;
  --ra-red: #E6061D;
  --ra-red-700: #C00418;
  --ra-red-50: #FDEDEF;
  --ra-slate: #414551;
  --ra-text: #0F1B33;
  --ra-muted: #5D677C;
  --ra-subtle: #8A93A6;
  --ra-border: #E3E8F0;
  --ra-border-strong: #CDD5E3;
  --ra-bg: #F4F6FA;
  --ra-surface: #FFFFFF;
  --ra-green: #0F7A55;
  --ra-green-50: #E6F5EE;
  --ra-amber: #9A5A00;
  --ra-amber-50: #FFF3D9;
  --ra-radius: 14px;
  --ra-radius-sm: 10px;
  --ra-shadow-sm: 0 1px 2px rgba(15, 27, 51, .06);
  --ra-shadow: 0 1px 2px rgba(15, 27, 51, .05), 0 2px 8px rgba(15, 27, 51, .05);
  --ra-shadow-lg: 0 12px 32px rgba(15, 27, 51, .12);
  --ra-ring: 0 0 0 3px rgba(31, 79, 209, .22);
  --ra-header-h: 68px;
  --ra-sidebar-w: 260px;
  --ra-bottom-nav-h: 0px;

  --bs-primary: var(--ra-blue);
  --bs-primary-rgb: 31, 79, 209;
  --bs-secondary: var(--ra-navy);
  --bs-secondary-rgb: 2, 28, 82;
  --bs-danger: var(--ra-red);
  --bs-danger-rgb: 230, 6, 29;
  --bs-body-color: var(--ra-text);
  --bs-body-color-rgb: 15, 27, 51;
  --bs-body-bg: var(--ra-bg);
  --bs-body-font-size: .9375rem;
  --bs-border-color: var(--ra-border-strong);
  --bs-border-radius: 10px;
  --bs-border-radius-sm: 8px;
  --bs-border-radius-lg: 14px;
  --bs-link-color: var(--ra-blue);
  --bs-link-color-rgb: 31, 79, 209;
  --bs-link-hover-color: var(--ra-blue-700);
  --bs-link-hover-color-rgb: 23, 61, 166;
  --bs-heading-color: var(--ra-navy);
  --bs-content-padding-x: 2rem;
  --bs-body-font-family: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

html { -webkit-text-size-adjust: 100%; }
body {
  background-color: var(--ra-bg);
  color: var(--ra-text);
  font-family: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5 { color: var(--ra-navy); font-weight: 700; letter-spacing: -.015em; }
a { color: var(--bs-link-color); text-underline-offset: 2px; }
a:hover { color: var(--bs-link-hover-color); }
.text-muted { color: var(--ra-muted) !important; }
.text-danger { color: var(--ra-red-700) !important; }
::selection { background: var(--ra-blue-100); }
:focus-visible { outline: 3px solid rgba(31, 79, 209, .45); outline-offset: 2px; }
.small, small { font-size: .8125rem; }

/* ================================================================ Header */
.header {
  height: var(--ra-header-h);
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--ra-border);
  z-index: 1030;
}
.header .navbar { height: 100%; padding: 0; }
.header .container-fluid { min-height: var(--ra-header-h); padding-left: 1.25rem; padding-right: 1.25rem; gap: .75rem; flex-wrap: nowrap; }
.ra-brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; }
.ra-brand .ra-mark { height: 38px; width: auto; }
.ra-brand .ra-wordmark { height: 21px; width: auto; }
.navbar-brand img { width: auto; }
.navbar-toggler { margin-right: .1rem; width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; }
.navbar-toggler:hover { background: var(--ra-blue-50); }
.navbar-beta-info {
  max-height: 52px; margin: 0 1rem; padding: .4rem .75rem; font-size: .75rem; line-height: 1.35;
  color: var(--ra-navy); background: var(--ra-blue-50); border: 1px solid var(--ra-blue-100); border-radius: 10px;
}
.navbar-beta-info:empty { display: none; }

.nav-user { gap: .5rem; padding: .25rem .6rem .25rem .25rem; border-radius: 999px; font-size: .9rem; font-weight: 600; color: var(--ra-navy); }
.nav-user:hover { background: var(--ra-blue-50); }
.nav-user .sn { width: 36px; height: 36px; margin-right: 0; background: var(--ra-navy); color: #fff; font-size: .8rem; letter-spacing: .02em; border-radius: 50%; }
.nav-user .icon-lock { display: none; }
.nav-user::after { display: inline-block !important; content: ""; width: 7px; height: 7px; border-right: 2px solid var(--ra-subtle); border-bottom: 2px solid var(--ra-subtle); transform: rotate(45deg) translateY(-2px); margin-left: .2rem; border-top: 0; border-left: 0; }
.header .dropdown-menu { border: 1px solid var(--ra-border); border-radius: var(--ra-radius); box-shadow: var(--ra-shadow-lg); padding: .5rem; min-width: 260px; }
.header .dropdown-menu .dropdown-item { border-radius: 8px; padding: .6rem .75rem; font-size: .9rem; }
.header .dropdown-menu .dropdown-header { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ra-subtle); }
.ra-impersonating { font-size: .72rem; font-weight: 700; color: var(--ra-amber); background: var(--ra-amber-50); border-radius: 999px; padding: .2rem .6rem; white-space: nowrap; }
.dropdown-menu {
  --bs-dropdown-link-hover-color: var(--ra-navy);
  --bs-dropdown-link-hover-bg: var(--ra-blue-50);
  --bs-dropdown-link-active-color: var(--ra-navy);
  --bs-dropdown-link-active-bg: var(--ra-blue-100);
}

/* =============================================================== Sidebar */
.sidebar {
  top: var(--ra-header-h);
  width: var(--ra-sidebar-w);
  background: var(--ra-navy);
  border-right: 0;
  z-index: 1020;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.18) transparent;
}
.sidebar .navbar-nav {
  --bs-nav-link-font-size: .9rem;
  --bs-nav-link-color: rgba(255, 255, 255, .78);
  --bs-nav-link-hover-color: #fff;
  padding: 1rem .75rem 2.5rem;
  width: 100%;
}
.sidebar .navbar-nav .nav-item { margin: 1px 0; }
.sidebar .navbar-nav .nav-link {
  position: relative; padding: .58rem .8rem; border-radius: 10px; font-weight: 500; color: var(--bs-nav-link-color); gap: .75rem;
  transition: background-color .15s ease, color .15s ease;
}
.sidebar .navbar-nav .nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; font-weight: 500; }
.sidebar .navbar-nav .nav-link.active { background: rgba(255, 255, 255, .13); color: #fff; font-weight: 600; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.sidebar .navbar-nav .nav-link.active::before { content: ""; position: absolute; left: -.75rem; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--ra-red); }
.sidebar .navbar-nav .nav-link .icon-size { font-size: 1.1rem; width: 1.1rem; height: 1.1rem; margin-right: 0; color: rgba(255, 255, 255, .55); flex: 0 0 auto; }
.sidebar .navbar-nav .nav-link:hover .icon-size, .sidebar .navbar-nav .nav-link.active .icon-size { color: #fff; }
.sidebar .ra-nav-section {
  padding: 1.15rem .8rem .35rem; font-size: .66rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .42);
  list-style: none;
}
.sidebar .ra-nav-section:first-child { padding-top: .25rem; }
.sidebar .ra-nav-count { margin-left: auto; font-size: .68rem; font-weight: 700; background: rgba(255,255,255,.12); color: #fff; border-radius: 999px; padding: .1rem .5rem; }
.sidebar .ra-nav-count.is-alert { background: var(--ra-red); }
.sidebar .navbar-nav .dropdown .dropdown-menu {
  --bs-dropdown-bg: transparent;
  --bs-dropdown-link-color: rgba(255,255,255,.72);
  --bs-dropdown-link-hover-color: #fff;
  --bs-dropdown-link-active-color: #fff;
  --bs-dropdown-item-padding-y: .5rem;
  padding-left: 2.6rem; background: transparent;
}
.sidebar .navbar-nav .dropdown .dropdown-menu .dropdown-item { border-radius: 8px; padding-left: .75rem; }
.sidebar .navbar-nav .dropdown .dropdown-menu .dropdown-item:hover { background: rgba(255,255,255,.07); font-weight: 500; }
.sidebar .navbar-nav .dropdown .dropdown-menu .dropdown-item.active { background: rgba(255,255,255,.12); font-weight: 600; }
.sidebar .navbar-nav .dropdown-toggle::after { margin-left: auto; opacity: .55; }

@media (min-width: 1200px) {
  .sidebar { transform: none; }
  .header .navbar-toggler { display: none; }
  body > .main-content { padding-left: var(--ra-sidebar-w); }
  .sidebar.active + .main-content { pointer-events: auto; }
}
@media (max-width: 1199.98px) {
  .sidebar { box-shadow: var(--ra-shadow-lg); }
  body.overflow::after { content: ""; position: fixed; inset: var(--ra-header-h) 0 0 0; background: rgba(6, 21, 56, .4); z-index: 1010; }
}
body > .main-content { padding-top: var(--ra-header-h); padding-bottom: calc(var(--ra-bottom-nav-h) + env(safe-area-inset-bottom, 0px)); min-height: 100vh; }
.main-content .main-content { padding-top: 0 !important; padding-left: 0 !important; min-height: 0; }

/* ================================================== Page header and body */
.section-content .item-header { padding: 1.5rem var(--bs-content-padding-x) 1rem; background: transparent; border-bottom: 0; }
.section-content .item-header h1, .section-content .item-header .h1 { font-size: 1.6rem; line-height: 1.25; margin-bottom: .25rem; }
.section-content .item-body { padding: .5rem var(--bs-content-padding-x) 2rem; }
.section-content .item-body > h1 { font-size: 1.6rem; }
.link-go-back { color: var(--ra-blue); font-weight: 600; }
.ra-page-heading { padding: 1.6rem var(--bs-content-padding-x) .25rem; }
.ra-page-heading h1 { font-size: 1.6rem; margin-bottom: .2rem; }
.ra-page-heading p { color: var(--ra-muted); margin: 0; max-width: 70ch; }
.ra-page-heading + section .item-header:empty { display: none; }

/* ============================================================ KPI tiles */
.section-boxes { padding: 1.25rem var(--bs-content-padding-x) .25rem; background: transparent; border-bottom: 0; }
.items-box {
  background: var(--ra-surface) !important; background-image: none !important; color: var(--ra-text) !important;
  border: 1px solid var(--ra-border); border-radius: var(--ra-radius); box-shadow: var(--ra-shadow); filter: none !important;
  padding: 1.15rem 1.25rem 1.05rem; position: relative; overflow: hidden; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.items-box:hover { transform: translateY(-2px); box-shadow: var(--ra-shadow-lg); border-color: var(--ra-blue-100); background-size: auto; }
.items-box .item-icon { width: 40px; height: 40px; min-height: 0; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem !important; margin-bottom: .8rem; background: var(--ra-blue-50); color: var(--ra-blue) !important; }
.items-box.purple .item-icon { background: var(--ra-green-50); color: var(--ra-green) !important; }
.items-box.red .item-icon { background: var(--ra-red-50); color: var(--ra-red) !important; }
.items-box.light .item-icon { background: #EEF0F4; color: var(--ra-slate) !important; }
.items-box .item-number { font-size: 2.35rem; font-weight: 700; color: var(--ra-navy); letter-spacing: -.03em; line-height: 1; }
.items-box .item-number small { font-size: 1.1rem; color: var(--ra-subtle); font-weight: 600; letter-spacing: 0; }
.items-box .item-text { font-size: .9rem; line-height: 1.3; font-weight: 600; color: var(--ra-muted); margin-top: .35rem; }
.ra-meter { height: 6px; border-radius: 999px; background: #EDF0F5; overflow: hidden; margin-top: .7rem; }
.ra-meter > span { display: block; height: 100%; border-radius: 999px; background: var(--ra-blue); }
.ra-meter.is-good > span { background: var(--ra-green); }

/* ============================================================== Buttons */
.btn { --bs-btn-padding-x: 1.1rem; --bs-btn-padding-y: .62rem; --bs-btn-font-weight: 600; --bs-btn-border-radius: 10px; --bs-btn-font-size: .9375rem; --bs-btn-line-height: 1.25; transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .05s ease; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  --bs-btn-color: #fff; --bs-btn-bg: var(--ra-blue); --bs-btn-border-color: var(--ra-blue);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--ra-blue-700); --bs-btn-hover-border-color: var(--ra-blue-700);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--ra-blue-700); --bs-btn-active-border-color: var(--ra-blue-700);
  --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: var(--ra-blue); --bs-btn-disabled-border-color: var(--ra-blue);
  --bs-btn-focus-shadow-rgb: 31, 79, 209;
  box-shadow: 0 1px 2px rgba(23, 61, 166, .25);
}
.btn-secondary, .btn-dark {
  --bs-btn-color: #fff; --bs-btn-bg: var(--ra-navy); --bs-btn-border-color: var(--ra-navy);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--ra-navy-700); --bs-btn-hover-border-color: var(--ra-navy-700);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--ra-navy-700); --bs-btn-active-border-color: var(--ra-navy-700);
  --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: var(--ra-navy); --bs-btn-disabled-border-color: var(--ra-navy);
}
.btn-danger {
  --bs-btn-color: #fff; --bs-btn-bg: var(--ra-red); --bs-btn-border-color: var(--ra-red);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--ra-red-700); --bs-btn-hover-border-color: var(--ra-red-700);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--ra-red-700); --bs-btn-active-border-color: var(--ra-red-700);
  --bs-btn-focus-shadow-rgb: 230, 6, 29;
}
.btn-gray, .btn-light {
  --bs-btn-color: var(--ra-navy); --bs-btn-bg: #fff; --bs-btn-border-color: var(--ra-border-strong);
  --bs-btn-hover-color: var(--ra-navy); --bs-btn-hover-bg: var(--ra-blue-50); --bs-btn-hover-border-color: #B9C5DA;
  --bs-btn-active-color: var(--ra-navy); --bs-btn-active-bg: var(--ra-blue-100); --bs-btn-active-border-color: #B9C5DA;
  --bs-btn-disabled-color: var(--ra-subtle); --bs-btn-disabled-bg: #fff; --bs-btn-disabled-border-color: var(--ra-border);
  box-shadow: var(--ra-shadow-sm);
}
.btn-outline-dark, .btn-outline-primary {
  --bs-btn-color: var(--ra-blue); --bs-btn-border-color: var(--ra-blue-100); --bs-btn-bg: #fff;
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--ra-blue); --bs-btn-hover-border-color: var(--ra-blue);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--ra-blue-700); --bs-btn-active-border-color: var(--ra-blue-700);
}
.btn-success {
  --bs-btn-color: #fff; --bs-btn-bg: var(--ra-green); --bs-btn-border-color: var(--ra-green);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #0B6345; --bs-btn-hover-border-color: #0B6345;
  --bs-btn-active-color: #fff; --bs-btn-active-bg: #0B6345; --bs-btn-active-border-color: #0B6345;
}
.btn-lg { --bs-btn-padding-y: .85rem; --bs-btn-padding-x: 1.4rem; --bs-btn-font-size: 1.02rem; --bs-btn-border-radius: 12px; }
.btn-sm { --bs-btn-padding-x: .75rem; --bs-btn-padding-y: .38rem; --bs-btn-font-size: .8125rem; --bs-btn-border-radius: 8px; }
.btn-link { color: var(--ra-blue); }
.link-danger { color: var(--ra-red-700) !important; }
.w-180 { width: auto; min-width: 160px; }

/* ================================================================ Forms */
.form-group label, .form-label { font-size: .85rem; font-weight: 600; color: var(--ra-navy); margin-bottom: .4rem; }
.form-control, .form-select {
  min-height: 46px; padding: .62rem .9rem; font-size: 1rem; line-height: 1.4; border-radius: 10px;
  border-color: var(--ra-border-strong); background-color: #fff; color: var(--ra-text);
}
@media (min-width: 768px) { .form-control, .form-select { font-size: .9375rem; min-height: 44px; } }
textarea.form-control { min-height: 92px; }
.form-control:focus, .form-select:focus { border-color: var(--ra-blue); box-shadow: var(--ra-ring); }
.form-control::placeholder { color: #9AA3B5; }
.form-control:disabled, .form-control[readonly] { background-color: #F2F4F8; color: var(--ra-muted); }
.form-check-input { border-color: #AEB9CC; width: 1.15em; height: 1.15em; }
.form-check-input:checked, .form-check-input[type=checkbox]:indeterminate { background-color: var(--ra-blue); border-color: var(--ra-blue); }
.form-check-input:focus { border-color: var(--ra-blue); box-shadow: var(--ra-ring); }
.form-check .form-check-label { font-size: .9rem; line-height: 1.4; }
.invalid-feedback { font-size: .8125rem; }
.input-icon-end .icon-end { top: .65rem; }

.select2-container .select2-selection--single { height: 46px; border-color: var(--ra-border-strong); border-radius: 10px; }
.select2-container .select2-selection--single .select2-selection__rendered { padding: .75rem 2.5rem .75rem .9rem; font-size: .9375rem; color: var(--ra-text); }
.select2-container.select2-container--focus .select2-selection--single,
.select2-container.select2-container--focus .select2-selection--multiple { border-color: var(--ra-blue); box-shadow: var(--ra-ring); }
.select2-container .select2-selection--multiple { min-height: 46px; border-color: var(--ra-border-strong); border-radius: 10px; }
.select2-container .select2-selection--multiple .select2-selection__choice { background: var(--ra-blue-50); border-color: var(--ra-blue-100); color: var(--ra-navy); border-radius: 6px; }
.select2-dropdown { border-color: var(--ra-border); border-radius: 10px; box-shadow: var(--ra-shadow-lg); overflow: hidden; }
.select2-results__option { font-size: .9rem; }
.select2-container .select2-results__option--highlighted[aria-selected] { background-color: var(--ra-blue); }
.select2-container .select2-results__option[aria-selected="true"] { background-color: var(--ra-blue-50); color: var(--ra-navy); }

/* =============================================================== Tables */
.table {
  --bs-table-color: var(--ra-text); --bs-table-bg: #fff; --bs-table-border-color: var(--ra-border);
  --bs-table-hover-bg: #F6F8FD; --bs-table-striped-bg: #FAFBFD;
  margin-bottom: 0;
}
.table > :not(caption) > * > * { padding: .85rem .75rem; }
.table > :not(caption) > * > *:first-child { padding-left: 1.1rem; }
.table > :not(caption) > * > *:last-child { padding-right: 1.1rem; }
.table > tbody > tr > td { font-size: .875rem; line-height: 1.4; vertical-align: middle; }
.table > tbody > tr:hover > * { background-color: #F6F8FD; }
.table > tbody > tr > *:first-child, .table > tbody > tr > *:last-child { border-left: 0; border-right: 0; }
.table-dark, .table thead.table-dark, .table > thead { --bs-table-color: var(--ra-muted); --bs-table-bg: #F7F9FC; --bs-table-border-color: var(--ra-border); }
.table > thead > tr > th, .table-dark > tr > th {
  font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ra-muted);
  background-color: #F7F9FC !important; border-bottom: 1px solid var(--ra-border); white-space: nowrap;
}
.table > thead:not(caption) > * > *:first-child { border-top-left-radius: var(--ra-radius); }
.table > thead:not(caption) > * > *:last-child { border-top-right-radius: var(--ra-radius); }
.table-responsive, .card-table, div.dt-container .dt-layout-table { background: #fff; border: 1px solid var(--ra-border); border-radius: var(--ra-radius); box-shadow: var(--ra-shadow); }
.table-responsive > .table, div.dt-container .dt-layout-table .table { border-radius: var(--ra-radius); overflow: hidden; }
div.dt-container .dt-layout-table { margin: .75rem 0; overflow-x: auto; }
.table-responsive div.dt-container .dt-layout-table, .card-table div.dt-container .dt-layout-table { border: 0; box-shadow: none; }
.table td a:not(.btn) { font-weight: 600; }
div.dt-container div.dt-search input {
  min-width: 260px; min-height: 44px; padding: .55rem .9rem .55rem 2.3rem; font-size: .9375rem; font-weight: 400;
  background: #fff url(../images/icon-search.svg) .8rem center / 16px no-repeat; border: 1px solid var(--ra-border-strong); border-radius: 10px;
}
div.dt-container div.dt-search input::placeholder { color: #9AA3B5; }
div.dt-container div.dt-search input:focus { outline: none; border-color: var(--ra-blue); box-shadow: var(--ra-ring); }
div.dt-container div.dt-info { font-size: .8125rem; color: var(--ra-muted); padding-top: .5rem; }
.table-filter-wrap .items-filter label { font-size: .85rem; color: var(--ra-muted); font-weight: 600; }
.table-filter-wrap .items-filter select,
.table-filter-wrap .items-filter .select2-container .select2-selection--single .select2-selection__rendered { font-size: .9rem; color: var(--ra-navy); font-weight: 600; }
.pagination {
  --bs-pagination-padding-x: .7rem; --bs-pagination-padding-y: .42rem; --bs-pagination-font-size: .8125rem;
  --bs-pagination-color: var(--ra-navy); --bs-pagination-bg: #fff;
  --bs-pagination-hover-bg: var(--ra-blue-50); --bs-pagination-hover-color: var(--ra-navy);
  --bs-pagination-active-bg: var(--ra-blue); --bs-pagination-active-border-color: var(--ra-blue);
  gap: .25rem;
}
.pagination .page-link { border-radius: 8px !important; min-width: 36px; text-align: center; }
.table td .icon-edit, .table td .icon-delete { width: 34px; height: 34px; border-radius: 8px; background-size: 18px; }
.table td .icon-edit:hover, .table td .icon-delete:hover { background-color: var(--ra-blue-50); }

/* =========================================================== Tabs/pills */
.nav-pills {
  --bs-nav-link-color: var(--ra-muted); --bs-nav-link-hover-color: var(--ra-navy);
  --bs-nav-pills-link-active-bg: var(--ra-navy); --bs-nav-link-font-size: .9rem; --bs-nav-link-padding-y: .55rem; --bs-nav-link-padding-x: 1.05rem;
  background: #fff; border: 1px solid var(--ra-border); border-radius: 999px; padding: 4px; margin-top: 0; display: inline-flex; flex-wrap: wrap; gap: 2px; box-shadow: var(--ra-shadow-sm);
}
.nav-pills .nav-item { margin-top: 0; }
.nav-pills .nav-link { min-width: 0; border-radius: 999px; white-space: nowrap; }
.nav-pills .nav-link:not(.active):hover { background: var(--ra-blue-50); }

/* ====================================================== Cards & modals */
.card { --bs-card-border-color: var(--ra-border); --bs-card-border-radius: var(--ra-radius); box-shadow: var(--ra-shadow); }
.modal-content { border: 0; border-radius: 18px; box-shadow: 0 24px 60px rgba(6, 21, 56, .28); }
.modal-header { border-bottom: 1px solid var(--ra-border); padding: 1.1rem 1.5rem; }
.modal-header .modal-title { color: var(--ra-navy); font-weight: 700; font-size: 1.15rem; }
.modal-body { padding: 1.25rem 1.5rem; }
.modal-footer { border-top: 1px solid var(--ra-border); padding: .9rem 1.5rem; gap: .5rem; }
.modal-backdrop.show { opacity: .45; background: var(--ra-navy-900); }
@media (max-width: 575.98px) {
  .modal-dialog { margin: auto .5rem .5rem; display: flex; align-items: flex-end; min-height: calc(100% - .5rem); }
  .modal-content { border-radius: 18px 18px 14px 14px; }
}

/* =============================================================== Alerts */
.alert { border-radius: var(--ra-radius); border-width: 1px; font-size: .9375rem; }
.alert-success { background: var(--ra-green-50); border-color: #BCE3D1; color: #0A573D; }
.alert-warning { background: var(--ra-amber-50); border-color: #F2D9A2; color: #6A3E00; }
.alert-danger { background: var(--ra-red-50); border-color: #F6C2C8; color: #8E0313; }
.alert-info { background: var(--ra-blue-50); border-color: var(--ra-blue-100); color: var(--ra-navy); }
.badge { border-radius: 999px; font-weight: 600; }
.info-popover { background-color: var(--ra-blue); }

/* Status pills (readiness, inspections) */
.rs-badge { display: inline-flex; align-items: center; gap: .35rem; border-radius: 999px; padding: .26rem .65rem; font-size: .76rem; font-weight: 700; white-space: nowrap; }
.rs-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.rs-ready, .res-pass { background: var(--ra-green-50) !important; color: var(--ra-green) !important; }
.rs-attention, .res-attention { background: var(--ra-amber-50) !important; color: var(--ra-amber) !important; }
.rs-not_ready, .res-fail { background: var(--ra-red-50) !important; color: var(--ra-red-700) !important; }
.rs-score { background: var(--ra-blue-50) !important; color: var(--ra-navy) !important; }
.readiness-tile { border: 1px solid transparent; box-shadow: var(--ra-shadow); transition: transform .15s ease, box-shadow .15s ease; }
.readiness-tile:hover { transform: translateY(-2px); box-shadow: var(--ra-shadow-lg); }
.readiness-tile.active { border-color: currentColor; border-width: 2px; }

/* ===================================================== Dashboard bits */
.ra-welcome { padding: 1.6rem var(--bs-content-padding-x) .25rem; }
.ra-welcome h1 { font-size: 1.6rem; margin-bottom: .2rem; }
.ra-welcome p { color: var(--ra-muted); margin-bottom: 0; }
.ra-callout {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  margin: 1rem var(--bs-content-padding-x) 0; padding: 1rem 1.15rem; border-radius: var(--ra-radius);
  background: #fff; border: 1px solid var(--ra-border); box-shadow: var(--ra-shadow);
}
.ra-callout .ra-callout-icon { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; font-size: 1.3rem; }
.ra-callout.is-bad { border-color: #F6CDD2; }
.ra-callout.is-bad .ra-callout-icon { background: var(--ra-red-50); color: var(--ra-red); }
.ra-callout.is-warn .ra-callout-icon { background: var(--ra-amber-50); color: var(--ra-amber); }
.ra-callout.is-good .ra-callout-icon { background: var(--ra-green-50); color: var(--ra-green); }
.ra-callout.is-info .ra-callout-icon { background: var(--ra-blue-50); color: var(--ra-blue); }
.ra-callout .ra-callout-text { flex: 1 1 240px; }
.ra-callout .ra-callout-text strong { display: block; color: var(--ra-navy); font-size: 1.02rem; }
.ra-callout .ra-callout-text span { color: var(--ra-muted); font-size: .9rem; }
.ra-callout .ra-callout-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ============================================= Inspections hub (checks) */
.ra-wrap { padding: 1.25rem var(--bs-content-padding-x) 2.5rem; max-width: 1100px; }
.ra-hero {
  border-radius: 18px; padding: 1.4rem 1.5rem; color: #fff; position: relative; overflow: hidden;
  background: var(--ra-navy);
  box-shadow: var(--ra-shadow);
}
.ra-hero h1, .ra-hero h2 { color: #fff; }
.ra-hero h1 { font-size: 1.55rem; margin: 0 0 .2rem; }
.ra-hero p { color: rgba(255,255,255,.78); margin: 0; }
.ra-hero .ra-progress { height: 10px; border-radius: 999px; background: rgba(255,255,255,.16); overflow: hidden; margin-top: 1rem; }
.ra-hero .ra-progress > span { display: block; height: 100%; border-radius: 999px; background: #4CC38A; transition: width .6s ease; }
.ra-hero .ra-hero-stats { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-top: .9rem; font-size: .9rem; color: rgba(255,255,255,.85); }
.ra-hero .ra-hero-stats strong { color: #fff; font-size: 1.15rem; margin-right: .25rem; }
.ra-toolbar { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin: 1.25rem 0 1rem; }
.ra-search { position: relative; flex: 1 1 260px; }
.ra-search input { padding-left: 2.4rem; }
.ra-search::before { content: ""; position: absolute; left: .85rem; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); background: url(../images/icon-search.svg) center / contain no-repeat; opacity: .6; }
.ra-seg { display: inline-flex; background: #fff; border: 1px solid var(--ra-border); border-radius: 12px; padding: 4px; gap: 2px; box-shadow: var(--ra-shadow-sm); }
.ra-seg a, .ra-seg button { border: 0; background: transparent; padding: .5rem .9rem; border-radius: 9px; font-weight: 600; font-size: .875rem; color: var(--ra-muted); text-decoration: none; white-space: nowrap; }
.ra-seg a.active, .ra-seg button.active { background: var(--ra-navy); color: #fff; }
.ra-seg .count { opacity: .75; margin-left: .25rem; font-weight: 700; }
.ra-site { margin-bottom: 1.25rem; }
.ra-site-head { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; margin: 0 .25rem .5rem; }
.ra-site-head h2 { font-size: 1rem; margin: 0; }
.ra-site-head span { font-size: .8125rem; color: var(--ra-muted); white-space: nowrap; }
.ra-list { background: #fff; border: 1px solid var(--ra-border); border-radius: var(--ra-radius); box-shadow: var(--ra-shadow); overflow: hidden; }
.ra-item { display: flex; align-items: center; gap: 1rem; padding: .9rem 1.1rem; border-top: 1px solid var(--ra-border); }
.ra-item:first-child { border-top: 0; }
.ra-item .ra-item-main { flex: 1 1 auto; min-width: 0; }
.ra-item .ra-item-title { font-weight: 600; color: var(--ra-navy); display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.ra-item .ra-item-sub { font-size: .85rem; color: var(--ra-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ra-item .ra-item-meta { font-size: .8rem; color: var(--ra-subtle); margin-top: .1rem; }
.ra-item .ra-item-action { flex: 0 0 auto; }
.ra-tick { font-size: .72rem; font-weight: 700; color: var(--ra-green); background: var(--ra-green-50); border-radius: 999px; padding: .15rem .55rem; }
.ra-empty { text-align: center; padding: 3rem 1rem; color: var(--ra-muted); }
.ra-empty strong { display: block; color: var(--ra-navy); font-size: 1.1rem; margin-bottom: .25rem; }
.ra-success {
  display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; padding: 1rem 1.15rem; margin-bottom: 1rem;
  border-radius: var(--ra-radius); background: var(--ra-green-50); border: 1px solid #BCE3D1; color: #0A573D;
}
.ra-success.is-warn { background: var(--ra-amber-50); border-color: #F2D9A2; color: #6A3E00; }
.ra-success.is-bad { background: var(--ra-red-50); border-color: #F6C2C8; color: #8E0313; }
.ra-success .ra-success-text { flex: 1 1 240px; }
.ra-success .ra-success-text strong { display: block; font-size: 1.02rem; }

/* ========================================================== Inspection form */
.inspect-wrap { max-width: 720px; }
.ra-quick {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.1rem; margin-bottom: 1rem; border-radius: var(--ra-radius);
  background: var(--ra-blue-50); border: 1px dashed #A9BEF1;
}
.ra-quick .ra-quick-text { flex: 1 1 220px; font-size: .9rem; color: var(--ra-navy); }
.ra-quick .ra-quick-text strong { display: block; font-size: 1rem; }
.ra-submit-bar { position: sticky; bottom: calc(var(--ra-bottom-nav-h) + env(safe-area-inset-bottom, 0px)); z-index: 5; margin-top: 1rem; padding: .85rem 0 1rem; background: linear-gradient(180deg, rgba(244,246,250,0) 0%, var(--ra-bg) 30%); }
.ra-signer { font-size: .875rem; color: var(--ra-muted); }
.ra-signer button { border: 0; background: none; color: var(--ra-blue); font-weight: 600; padding: 0; }
.check-item { border-color: var(--ra-border) !important; border-radius: var(--ra-radius) !important; box-shadow: var(--ra-shadow-sm); }
.answer-group label { min-height: 48px; display: flex !important; align-items: center; justify-content: center; border-radius: 12px !important; border-color: var(--ra-border-strong) !important; color: var(--ra-navy); transition: background-color .12s ease, border-color .12s ease; }
.answer-group label:hover { background: var(--ra-blue-50); }
.answer-group input:checked + label.ans-yes { background: var(--ra-green) !important; border-color: var(--ra-green) !important; color: #fff; }
.answer-group input:checked + label.ans-no { background: var(--ra-red) !important; border-color: var(--ra-red) !important; color: #fff; }
.answer-group input:checked + label.ans-na { background: var(--ra-slate) !important; border-color: var(--ra-slate) !important; color: #fff; }

/* =========================================================== Bottom nav */
.ra-bottom-nav { display: none; }
@media (max-width: 991.98px) {
  :root { --ra-bottom-nav-h: 64px; }
  .ra-bottom-nav {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 1025;
    height: calc(var(--ra-bottom-nav-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255,255,255,.96); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border-top: 1px solid var(--ra-border); box-shadow: 0 -4px 16px rgba(15, 27, 51, .06);
  }
  .ra-bottom-nav a, .ra-bottom-nav button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border: 0; background: none; color: var(--ra-subtle); text-decoration: none; font-size: .7rem; font-weight: 600; position: relative;
  }
  .ra-bottom-nav .icon-size { width: 22px; height: 22px; font-size: 22px; }
  .ra-bottom-nav .active { color: var(--ra-blue); }
  .ra-bottom-nav .active::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--ra-blue); }
  .ra-bottom-nav .ra-dot { position: absolute; top: 8px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--ra-red); color: #fff; font-size: .62rem; line-height: 17px; text-align: center; }
  .Userback-button, #userback_button_container { bottom: calc(var(--ra-bottom-nav-h) + 12px) !important; }
}

/* ============================================================ Auth pages */
.ra-auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: #fff; }
.ra-auth-brand {
  position: relative; overflow: hidden; color: #fff; padding: 3rem clamp(2rem, 5vw, 4.5rem);
  background: var(--ra-navy);
  border-top: 6px solid var(--ra-red);
  display: flex; flex-direction: column; justify-content: space-between;
}
.ra-auth-brand .ra-auth-logo { background: #fff; border-radius: 20px; padding: 18px 28px; display: inline-flex; width: max-content; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.ra-auth-brand .ra-auth-logo img { height: 120px; width: auto; }
.ra-auth-brand h2 { color: #fff; font-size: clamp(1.75rem, 3vw, 2.5rem); line-height: 1.15; margin: 2.5rem 0 1rem; max-width: 520px; }
.ra-auth-brand p.lead { color: rgba(255,255,255,.78); font-size: 1.05rem; max-width: 500px; }
.ra-auth-points { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: .9rem; max-width: 500px; position: relative; z-index: 1; }
.ra-auth-points li { display: flex; gap: .75rem; align-items: flex-start; color: rgba(255,255,255,.9); }
.ra-auth-points .tick { width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.12); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; color: #fff; font-size: .8rem; font-weight: 700; }
.ra-auth-foot { color: rgba(255,255,255,.5); font-size: .8rem; position: relative; z-index: 1; }
.ra-auth-form { display: flex; align-items: center; justify-content: center; padding: 3rem 1.25rem; background: var(--ra-bg); }
.ra-auth-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--ra-border); border-radius: 20px; box-shadow: var(--ra-shadow-lg); padding: 2.25rem 2rem; }
.ra-auth-card h1 { font-size: 1.6rem; margin-bottom: .35rem; }
.ra-auth-card .ra-sub { color: var(--ra-muted); margin-bottom: 1.75rem; }
.ra-auth-card .btn-primary { min-height: 50px; font-size: 1rem; }
.ra-auth-help { text-align: center; font-size: .875rem; color: var(--ra-muted); margin-top: 1.25rem; }
.ra-auth-help a { font-weight: 600; }
.ra-auth-mobile-logo { display: none; }
@media (max-width: 991.98px) {
  .ra-auth { grid-template-columns: 1fr; }
  .ra-auth-brand { display: none; }
  .ra-auth-mobile-logo { display: block; text-align: center; margin-bottom: 1.5rem; }
  .ra-auth-mobile-logo img { height: 96px; width: auto; }
  .ra-auth-card { padding: 1.75rem 1.35rem; }
}
body.ra-auth-layout .header { position: static; }
body.ra-auth-layout > .main-content { padding-top: 0; padding-bottom: 0; }
body.ra-auth-layout .section-login { min-height: calc(100vh - var(--ra-header-h)); }
.card-login { --bs-card-border-width: 1px; border-radius: 20px; box-shadow: var(--ra-shadow-lg); width: 420px; }

/* ============================================================= Responsive */
@media (max-width: 991.98px) {
  :root { --bs-content-padding-x: 1rem; --ra-header-h: 60px; }
  .header .container-fluid { min-height: var(--ra-header-h); padding-left: .6rem; padding-right: .75rem; }
  .ra-brand .ra-mark { height: 32px; }
  .ra-brand .ra-wordmark { height: 17px; }
  .sidebar { top: var(--ra-header-h); }
  .items-box .item-number { font-size: 1.9rem; }
  .ra-wrap { padding-top: 1rem; }
  .ra-hero { border-radius: 16px; padding: 1.15rem 1.15rem 1.2rem; }
  .ra-hero h1 { font-size: 1.3rem; }
}
@media (max-width: 767.98px) {
  .nav-user .nm, .nav-user::after { display: none !important; }
  .ra-impersonating { display: none; }
  div.dt-container div.dt-search input { min-width: 0; width: 100%; }
  .section-content .item-header h1, .ra-page-heading h1, .ra-welcome h1 { font-size: 1.35rem; }
  .nav-pills { border-radius: 14px; }
  .section-boxes .row { --bs-gutter-x: .75rem; --bs-gutter-y: .75rem; }
  .section-boxes .row-cols-1 > * { flex: 0 0 auto; width: 50%; }
  .items-box { padding: .9rem; }
  .items-box .item-icon { width: 34px; height: 34px; margin-bottom: .5rem; }
  .items-box .item-number { font-size: 1.6rem; }
  .items-box .item-text { font-size: .8rem; }
  .ra-item { padding: .85rem .9rem; gap: .75rem; }
  .ra-item .ra-item-action .btn { min-width: 84px; }
  .ra-callout { padding: .9rem; }
  .ra-callout .ra-callout-actions, .ra-callout .ra-callout-actions .btn { width: 100%; }
  .readiness-table tbody tr { background: #fff; padding: .9rem 1rem !important; border-bottom: 1px solid var(--ra-border); }
  .readiness-table tbody td { padding: .15rem 0 !important; font-size: .9rem; }
  .readiness-table tbody td:last-child { padding-top: .6rem !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .header, .sidebar, .ra-bottom-nav { display: none !important; }
  body > .main-content { padding: 0 !important; }
}

/* ======================================================================
 * v3 refinements
 *  - A heart-rhythm trace (the shape an AED reads) is the one decorative
 *    motif: faint on the sidebar and the status hero, nowhere else.
 *  - Buttons get a soft top light and a crisp edge so they read as pressable.
 *  - Serial and tag numbers use a mono face, like the label on the device.
 * ==================================================================== */
:root {
  --ra-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --ra-surface-2: #F8FAFD;
  --ra-ink: #0B1630;
  --ra-line: #E6EAF2;
  --ra-amber-500: #D98E04;
  --ra-green-500: #16A06C;
  --ra-red-500: #E11D35;
  --ra-trace: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='560' height='120' viewBox='0 0 560 120'%3E%3Cpath d='M0 70h120l12-10 10 10h28l10 18 16-78 16 92 12-32h32l14-12 14 12h126l12-10 10 10h28l10 18 16-78 16 92 12-32h32l14-12 14 12h16' fill='none' stroke='%23fff' stroke-width='2' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E");
}

body {
  background:
    radial-gradient(1100px 420px at 85% -12%, rgba(31, 79, 209, .07), transparent 62%),
    radial-gradient(900px 380px at -10% 0%, rgba(2, 28, 82, .05), transparent 60%),
    var(--ra-bg);
  background-attachment: fixed;
}

/* Sidebar: deeper navy with a faint rhythm trace at the foot */
.sidebar {
  background: linear-gradient(180deg, #06275F 0%, var(--ra-navy) 38%, #01143D 100%);
}
.sidebar::after { content: ""; position: absolute; inset: auto 0 0 0; height: 140px; pointer-events: none;
  background: var(--ra-trace) no-repeat -40px calc(100% - 28px) / 420px auto; opacity: .07; }
.sidebar .navbar-nav .nav-link.active { background: linear-gradient(90deg, rgba(255,255,255,.16), rgba(255,255,255,.08)); }

/* Buttons */
.btn-primary {
  background-image: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,0));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 1px 2px rgba(23, 61, 166, .3), 0 4px 12px -4px rgba(31, 79, 209, .45);
}
.btn-primary:hover { box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 1px 2px rgba(23, 61, 166, .3), 0 8px 18px -6px rgba(31, 79, 209, .55); }
.btn-secondary, .btn-dark, .btn-danger, .btn-success {
  background-image: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,0));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 1px 2px rgba(6, 21, 56, .25);
}
.btn-gray, .btn-light { background-image: linear-gradient(180deg, #fff, #F7F9FC); }
.btn-gray:hover, .btn-light:hover { background-image: none; }
.btn:focus-visible { box-shadow: var(--ra-ring) !important; outline: 0; }
.btn .ra-ico { width: 1.05em; height: 1.05em; flex: 0 0 auto; }
.btn.has-ico { display: inline-flex; align-items: center; gap: .5rem; }

.ra-serial { font-family: var(--ra-mono); font-weight: 500; letter-spacing: .01em; font-feature-settings: "zero" 1; }

/* ------------------------------------------------------------ layout bits */
.ra-wrap.ra-narrow { max-width: 860px; }
.ra-wrap.ra-wide { max-width: 1320px; }
.ra-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.ra-head h1 { font-size: 1.65rem; margin: 0 0 .2rem; text-wrap: balance; }
.ra-head p { color: var(--ra-muted); margin: 0; max-width: 68ch; }
.ra-head .ra-head-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.ra-eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ra-subtle); margin-bottom: .35rem; display: block; }
.ra-crumb { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; font-size: .9rem; text-decoration: none; margin-bottom: .75rem; }
.ra-crumb::before { content: ""; width: 7px; height: 7px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-right: .15rem; }
.ra-stack { display: grid; gap: 1.25rem; }
.ra-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.25rem; }
.ra-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.ra-cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.ra-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.ra-hint { font-size: .82rem; color: var(--ra-muted); margin: .4rem 0 0; }
.ra-linkbtn { border: 0; background: none; padding: 0; color: var(--ra-blue); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* --------------------------------------------------------------- panels */
.ra-panel { background: var(--ra-surface); border: 1px solid var(--ra-line); border-radius: 16px; box-shadow: 0 1px 2px rgba(15,27,51,.04), 0 6px 20px -12px rgba(15,27,51,.12); min-width: 0; }
.ra-panel-head { padding: 1.05rem 1.25rem .85rem; display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; flex-wrap: wrap; border-bottom: 1px solid var(--ra-line); }
.ra-panel-head h2 { font-size: 1.02rem; margin: 0; }
.ra-panel-head p { flex-basis: 100%; margin: .2rem 0 0; color: var(--ra-muted); font-size: .875rem; }
.ra-panel-head a { font-size: .85rem; font-weight: 600; text-decoration: none; }
.ra-panel-body { padding: 1.1rem 1.25rem 1.25rem; }
.ra-panel-body.flush { padding: 0; }
.ra-panel-foot { padding: .8rem 1.25rem; border-top: 1px solid var(--ra-line); font-size: .85rem; color: var(--ra-muted); }

/* ---------------------------------------------------------- status hero */
.ra-pulse {
  position: relative; overflow: hidden; color: #fff; border-radius: 20px; padding: 1.5rem 1.6rem;
  background:
    radial-gradient(600px 260px at 100% 0%, rgba(42, 91, 224, .45), transparent 70%),
    linear-gradient(135deg, #062A6B 0%, var(--ra-navy) 55%, #01133A 100%);
  box-shadow: 0 18px 40px -22px rgba(2, 28, 82, .65);
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1.5rem; align-items: center;
}
.ra-pulse::after { content: ""; position: absolute; inset: 0; background: var(--ra-trace) no-repeat 38% 70% / 720px auto; opacity: .07; pointer-events: none; }
.ra-pulse > * { position: relative; z-index: 1; }
.ra-pulse h1 { color: #fff; font-size: 1.55rem; margin: 0 0 .25rem; text-wrap: balance; }
.ra-pulse p { color: rgba(255,255,255,.78); margin: 0; }
.ra-pulse .ra-pulse-legend { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.ra-pulse .ra-pulse-legend a {
  display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .75rem; border-radius: 999px; text-decoration: none;
  background: rgba(255,255,255,.08); color: #fff; font-size: .85rem; font-weight: 600; border: 1px solid rgba(255,255,255,.12);
  transition: background-color .15s ease;
}
.ra-pulse .ra-pulse-legend a:hover { background: rgba(255,255,255,.16); }
.ra-pulse .ra-pulse-legend b { font-size: 1rem; }
.ra-pulse .ra-pulse-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.ra-pulse .ra-pulse-cta { display: flex; flex-direction: column; gap: .5rem; align-items: stretch; }
.ra-pulse .btn-light { --bs-btn-bg: #fff; color: var(--ra-navy); border-color: #fff; }
.ra-pulse .btn-ghost { color: #fff; border: 1px solid rgba(255,255,255,.3); background: transparent; }
.ra-pulse .btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
.dot-ready { background: #3DD598; }
.dot-attention { background: #F5B82E; }
.dot-not_ready { background: #FF5A6E; }

/* Readiness ring */
.ra-ring { position: relative; width: 132px; height: 132px; flex: 0 0 auto; }
.ra-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ra-ring circle { fill: none; stroke-width: 12; }
.ra-ring .track { stroke: rgba(255,255,255,.12); }
.ra-ring .seg { stroke-linecap: butt; transition: stroke-dasharray .8s ease; }
.ra-ring .ra-ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ra-ring .ra-ring-label strong { font-size: 2rem; line-height: 1; font-weight: 800; letter-spacing: -.03em; }
.ra-ring .ra-ring-label span { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; opacity: .75; margin-top: .3rem; }
.ra-ring.on-light .track { stroke: #EDF0F5; }
.ra-ring.on-light .ra-ring-label strong { color: var(--ra-navy); }
.ra-ring.on-light .ra-ring-label span { color: var(--ra-muted); opacity: 1; }

/* Small stat row */
.ra-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.ra-stat { display: block; text-decoration: none; color: inherit; background: var(--ra-surface); border: 1px solid var(--ra-line); border-radius: 14px; padding: 1rem 1.1rem; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
a.ra-stat:hover { border-color: var(--ra-blue-100); box-shadow: var(--ra-shadow); transform: translateY(-1px); color: inherit; }
.ra-stat .k { font-size: .78rem; font-weight: 600; color: var(--ra-muted); display: flex; align-items: center; gap: .4rem; }
.ra-stat .v { font-size: 1.75rem; font-weight: 800; color: var(--ra-navy); letter-spacing: -.02em; line-height: 1.15; margin-top: .3rem; }
.ra-stat .v small { font-size: .95rem; font-weight: 600; color: var(--ra-subtle); letter-spacing: 0; }
.ra-stat .s { font-size: .8rem; color: var(--ra-muted); margin-top: .15rem; }
.ra-bar { height: 6px; border-radius: 999px; background: #EDF0F5; overflow: hidden; margin-top: .65rem; display: flex; }
.ra-bar > span { display: block; height: 100%; }
.ra-bar .b-ready { background: var(--ra-green-500); }
.ra-bar .b-attention { background: var(--ra-amber-500); }
.ra-bar .b-not_ready { background: var(--ra-red-500); }
.ra-bar .b-blue { background: var(--ra-blue); }

/* Action list: one row per AED with a status stripe and one button */
.ra-todo { list-style: none; margin: 0; padding: 0; }
.ra-todo li { position: relative; display: flex; align-items: center; gap: 1rem; padding: .9rem 1.25rem .9rem 1.4rem; border-top: 1px solid var(--ra-line); }
.ra-todo li:first-child { border-top: 0; }
.ra-todo li::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--ra-amber-500); }
.ra-todo li.is-not_ready::before { background: var(--ra-red-500); }
.ra-todo .main { flex: 1 1 auto; min-width: 0; }
.ra-todo .title { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-weight: 600; color: var(--ra-navy); }
.ra-todo .title a { color: inherit; text-decoration: none; }
.ra-todo .title a:hover { color: var(--ra-blue); }
.ra-todo .where { font-size: .85rem; color: var(--ra-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ra-todo .why { font-size: .85rem; color: var(--ra-text); margin-top: .1rem; }
.ra-todo .is-not_ready .why, .ra-todo li.is-not_ready .why { color: var(--ra-red-700); }
.ra-todo .act { flex: 0 0 auto; }
.ra-allclear { display: flex; gap: .9rem; align-items: center; padding: 1.4rem 1.25rem; }
.ra-allclear .ok { width: 44px; height: 44px; border-radius: 12px; background: var(--ra-green-50); color: var(--ra-green); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.ra-allclear strong { display: block; color: var(--ra-navy); }
.ra-allclear span { color: var(--ra-muted); font-size: .9rem; }

/* Expiry list */
.ra-expiry { list-style: none; margin: 0; padding: 0; }
.ra-expiry li { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: .85rem; align-items: center; padding: .7rem 1.25rem; border-top: 1px solid var(--ra-line); }
.ra-expiry li:first-child { border-top: 0; }
.ra-cal { border-radius: 10px; border: 1px solid var(--ra-line); text-align: center; overflow: hidden; background: #fff; line-height: 1.05; }
.ra-cal .m { display: block; font-size: .62rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #fff; background: var(--ra-navy); padding: .2rem 0; }
.ra-cal .d { display: block; font-size: 1.15rem; font-weight: 800; color: var(--ra-navy); padding: .25rem 0 .3rem; }
.ra-cal.is-past .m { background: var(--ra-red); }
.ra-cal.is-soon .m { background: var(--ra-amber-500); }
.ra-expiry .what { font-weight: 600; color: var(--ra-navy); font-size: .9rem; }
.ra-expiry .where { font-size: .82rem; color: var(--ra-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ra-when { font-size: .75rem; font-weight: 700; border-radius: 999px; padding: .22rem .6rem; white-space: nowrap; background: var(--ra-blue-50); color: var(--ra-navy); }
.ra-when.is-past { background: var(--ra-red-50); color: var(--ra-red-700); }
.ra-when.is-soon { background: var(--ra-amber-50); color: var(--ra-amber); }

/* Site and organization health table */
.ra-health { width: 100%; border-collapse: collapse; }
.ra-health th { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ra-muted); padding: .7rem 1.25rem; text-align: left; background: var(--ra-surface-2); border-bottom: 1px solid var(--ra-line); white-space: nowrap; }
.ra-health td { padding: .8rem 1.25rem; border-bottom: 1px solid var(--ra-line); font-size: .9rem; vertical-align: middle; }
.ra-health tr:last-child td { border-bottom: 0; }
.ra-health tbody tr { transition: background-color .12s ease; }
.ra-health tbody tr:hover { background: #F7F9FD; }
.ra-health .name { font-weight: 600; color: var(--ra-navy); }
.ra-health .name a { color: inherit; text-decoration: none; }
.ra-health .name a:hover { color: var(--ra-blue); }
.ra-health .sub { font-size: .8rem; color: var(--ra-muted); }
.ra-health .score { font-weight: 800; color: var(--ra-navy); font-variant-numeric: tabular-nums; }
.ra-health .ra-bar { margin-top: .35rem; min-width: 120px; }
.ra-health .num { text-align: right; font-variant-numeric: tabular-nums; }
.ra-health .num.bad { color: var(--ra-red-700); font-weight: 700; }
.ra-health .num.warn { color: var(--ra-amber); font-weight: 700; }

/* --------------------------------------------------------- AED profile */
.ra-device { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.5rem; align-items: start; }
.ra-device h1 { font-size: 1.7rem; margin: .15rem 0 .35rem; display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; }
.ra-device .meta { display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; color: var(--ra-muted); font-size: .9rem; }
.ra-device .meta b { color: var(--ra-navy); font-weight: 600; }
.ra-status-big { display: inline-flex; align-items: center; gap: .45rem; font-size: .9rem; font-weight: 700; padding: .38rem .85rem; border-radius: 999px; }
.ra-status-big::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 18%, transparent); }
.ra-reasons { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.ra-reasons li { display: flex; gap: .65rem; align-items: flex-start; padding: .7rem .85rem; border-radius: 12px; background: var(--ra-amber-50); color: #6A3E00; font-size: .9rem; font-weight: 500; }
.ra-reasons li.lvl-not_ready { background: var(--ra-red-50); color: #8E0313; }
.ra-reasons li.lvl-not_ready::before { background: var(--ra-red-500); }
.ra-reasons li::before { content: "!"; flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; background: var(--ra-amber-500); color: #fff; font-size: .75rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; }
.ra-reasons li span { color: inherit; }
.ra-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .55rem 1.25rem; margin: 0; font-size: .9rem; }
.ra-kv dt { color: var(--ra-muted); font-weight: 500; }
.ra-kv dd { margin: 0; color: var(--ra-text); font-weight: 500; overflow-wrap: anywhere; }
.ra-part { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .25rem 1rem; padding: .85rem 1.25rem; border-top: 1px solid var(--ra-line); align-items: center; }
.ra-part:first-child { border-top: 0; }
.ra-part .n { font-weight: 600; color: var(--ra-navy); }
.ra-part .m { font-size: .82rem; color: var(--ra-muted); }
.ra-part .life { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: #EDF0F5; overflow: hidden; }
.ra-part .life span { display: block; height: 100%; border-radius: 999px; background: var(--ra-green-500); }
.ra-part .life.is-soon span { background: var(--ra-amber-500); }
.ra-part .life.is-past span { background: var(--ra-red-500); width: 100% !important; }
.ra-qr { text-align: center; }
.ra-qr .code { display: inline-block; padding: 12px; border-radius: 14px; border: 1px solid var(--ra-line); background: #fff; }
.ra-qr .code svg { width: 150px; height: 150px; display: block; }
.ra-qr p { font-size: .8rem; color: var(--ra-muted); margin: .6rem auto 0; max-width: 220px; }
.ra-feed { list-style: none; margin: 0; padding: 0; }
.ra-feed li { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: .85rem; padding: .75rem 1.25rem; border-top: 1px solid var(--ra-line); }
.ra-feed li:first-child { border-top: 0; }
.ra-feed .pip { width: 10px; height: 10px; border-radius: 50%; margin-top: .4rem; background: var(--ra-border-strong); }
.ra-feed .pip.pass { background: var(--ra-green-500); }
.ra-feed .pip.attention { background: var(--ra-amber-500); }
.ra-feed .pip.fail { background: var(--ra-red-500); }
.ra-feed .t { font-weight: 600; color: var(--ra-navy); font-size: .9rem; }
.ra-feed .d { font-size: .82rem; color: var(--ra-muted); }
.ra-tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--ra-line); padding: 0 .75rem; overflow-x: auto; scrollbar-width: none; }
.ra-tabs button { border: 0; background: none; padding: .85rem .6rem .75rem; font-weight: 600; font-size: .9rem; color: var(--ra-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.ra-tabs button[aria-selected="true"] { color: var(--ra-navy); border-bottom-color: var(--ra-blue); }
.ra-tabpanel[hidden] { display: none; }

/* ------------------------------------------------- command palette (Ctrl K) */
.ra-search-trigger {
  display: inline-flex; align-items: center; gap: .55rem; min-width: 280px; height: 40px; padding: 0 .75rem; margin: 0 1rem 0 1.25rem;
  border: 1px solid var(--ra-border-strong); border-radius: 10px; background: #fff; color: var(--ra-subtle); font-size: .9rem; cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ra-search-trigger:hover { border-color: #B9C5DA; box-shadow: var(--ra-shadow-sm); }
.ra-search-trigger svg { width: 16px; height: 16px; color: var(--ra-muted); }
.ra-search-trigger kbd { margin-left: auto; font-family: var(--ra-mono); font-size: .7rem; color: var(--ra-muted); background: var(--ra-surface-2); border: 1px solid var(--ra-line); border-radius: 6px; padding: .1rem .4rem; }
.ra-palette[hidden] { display: none; }
.ra-palette { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: flex-start; justify-content: center; padding: 10vh 1rem 1rem; background: rgba(6, 21, 56, .45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.ra-palette-box { width: 100%; max-width: 620px; background: #fff; border-radius: 16px; box-shadow: 0 30px 70px rgba(6, 21, 56, .35); overflow: hidden; }
.ra-palette-input { display: flex; align-items: center; gap: .65rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--ra-line); }
.ra-palette-input svg { width: 18px; height: 18px; color: var(--ra-muted); flex: 0 0 auto; }
.ra-palette-input input { flex: 1 1 auto; border: 0; outline: 0; font-size: 1.05rem; color: var(--ra-text); background: transparent; min-width: 0; }
.ra-palette-input kbd { font-family: var(--ra-mono); font-size: .7rem; color: var(--ra-muted); border: 1px solid var(--ra-line); border-radius: 6px; padding: .1rem .4rem; }
.ra-palette-results { max-height: min(60vh, 460px); overflow-y: auto; padding: .4rem; }
.ra-palette-group { font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ra-subtle); padding: .7rem .75rem .3rem; }
.ra-palette-item { display: flex; align-items: center; gap: .75rem; padding: .6rem .75rem; border-radius: 10px; text-decoration: none; color: var(--ra-text); }
.ra-palette-item .t { font-weight: 600; color: var(--ra-navy); }
.ra-palette-item .s { font-size: .82rem; color: var(--ra-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ra-palette-item .tx { min-width: 0; flex: 1 1 auto; }
.ra-palette-item[aria-selected="true"], .ra-palette-item:hover { background: var(--ra-blue-50); }
.ra-palette-empty { padding: 1.5rem; text-align: center; color: var(--ra-muted); font-size: .9rem; }
.ra-palette-foot { display: flex; gap: 1rem; padding: .6rem 1.1rem; border-top: 1px solid var(--ra-line); font-size: .75rem; color: var(--ra-subtle); background: var(--ra-surface-2); }

/* ------------------------------------------- tables become cards on phones */
@media (max-width: 767.98px) {
  table.ra-cardify thead { display: none; }
  table.ra-cardify, table.ra-cardify tbody { display: block; width: 100% !important; }
  table.ra-cardify tbody tr { display: block; position: relative; padding: .85rem 1rem; border-bottom: 1px solid var(--ra-line); background: #fff; }
  table.ra-cardify tbody tr:hover > * { background: transparent !important; }
  table.ra-cardify tbody td { display: grid; grid-template-columns: minmax(96px, 38%) minmax(0, 1fr); gap: .75rem; padding: .22rem 0 !important; border: 0 !important; font-size: .9rem; text-align: left !important; white-space: normal !important; }
  table.ra-cardify tbody td::before { content: attr(data-label); font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ra-subtle); padding-top: .15rem; }
  table.ra-cardify tbody td[data-label=""]::before, table.ra-cardify tbody td:not([data-label])::before { display: none; }
  table.ra-cardify tbody td[data-label=""], table.ra-cardify tbody td:not([data-label]) { grid-template-columns: minmax(0, 1fr); }
  table.ra-cardify tbody td:first-child { font-size: 1rem; font-weight: 600; }
  table.ra-cardify tbody td.dt-empty, table.ra-cardify tbody td.dataTables_empty { display: block; text-align: center !important; }
  table.ra-cardify tbody td.dt-empty::before { display: none; }
  .table-responsive:has(> table.ra-cardify), div.dt-container .dt-layout-table:has(table.ra-cardify) { overflow: visible; }
}

/* ------------------------------------------------------------ toasts */
.ra-toast { position: fixed; right: 1.25rem; bottom: calc(1.25rem + var(--ra-bottom-nav-h) + env(safe-area-inset-bottom, 0px)); z-index: 2100; display: flex; align-items: center; gap: .65rem; max-width: min(420px, calc(100vw - 2rem));
  padding: .85rem 1rem; border-radius: 12px; background: var(--ra-ink); color: #fff; box-shadow: 0 16px 40px rgba(6, 21, 56, .35); font-size: .9rem; font-weight: 500;
  animation: ra-toast-in .25s ease both; }
.ra-toast .ok { width: 22px; height: 22px; border-radius: 50%; background: var(--ra-green-500); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.ra-toast.is-error .ok { background: var(--ra-red-500); }
.ra-toast button { margin-left: .25rem; border: 0; background: none; color: rgba(255,255,255,.6); font-size: 1.1rem; line-height: 1; padding: 0 .1rem; }
@keyframes ra-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1199.98px) {
  .ra-search-trigger { min-width: 0; width: 40px; padding: 0; justify-content: center; margin: 0 .25rem 0 auto; }
  .ra-search-trigger span, .ra-search-trigger kbd { display: none; }
  .ra-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 991.98px) {
  .ra-pulse { grid-template-columns: auto minmax(0, 1fr); padding: 1.25rem; border-radius: 18px; }
  .ra-pulse .ra-pulse-cta { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .ra-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ra-grid-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767.98px) {
  .ra-head h1, .ra-device h1 { font-size: 1.4rem; }
  .ra-pulse { grid-template-columns: minmax(0, 1fr); text-align: left; gap: 1rem; padding: 1.15rem; }
  .ra-pulse .ra-ring { width: 108px; height: 108px; }
  .ra-pulse .ra-ring .ra-ring-label strong { font-size: 1.6rem; }
  .ra-pulse h1 { font-size: 1.3rem; }
  .ra-pulse .ra-pulse-cta .btn { flex: 1 1 auto; }
  .ra-grid-2 { grid-template-columns: minmax(0, 1fr); }
  .ra-stats { gap: .75rem; }
  .ra-stat { padding: .85rem .9rem; }
  .ra-stat .v { font-size: 1.45rem; }
  .ra-todo li { padding: .85rem 1rem .85rem 1.15rem; flex-wrap: wrap; gap: .5rem .75rem; }
  .ra-todo .act { width: 100%; }
  .ra-todo .act .btn { width: 100%; }
  .ra-expiry li { padding: .7rem 1rem; grid-template-columns: 50px minmax(0, 1fr); }
  .ra-expiry li .ra-when { grid-column: 2; justify-self: start; }
  .ra-health th:nth-child(n+3), .ra-health td:nth-child(n+3) { display: none; }
  .ra-health th, .ra-health td { padding-left: 1rem; padding-right: 1rem; }
  .ra-device { grid-template-columns: minmax(0, 1fr); }
  .ra-device .ra-head-actions { width: 100%; }
  .ra-kv { grid-template-columns: minmax(0, 1fr); gap: .1rem; }
  .ra-kv dd { margin-bottom: .55rem; }
  .ra-toast { right: 1rem; left: 1rem; max-width: none; }
}
@media print {
  .ra-pulse { background: #fff !important; color: #000; box-shadow: none; }
  .ra-search-trigger, .ra-palette, .ra-toast { display: none !important; }
}

/* Readiness page */
.readiness-tile { border-radius: 14px; padding: 1.1rem 1.2rem; display: block; text-decoration: none; height: 100%; background: var(--ra-surface); border: 1px solid var(--ra-line); }
.readiness-tile .num { font-size: 2.2rem; font-weight: 800; line-height: 1.05; letter-spacing: -.02em; }
.readiness-tile .lbl { font-weight: 600; font-size: .9rem; margin-top: .2rem; }
.readiness-tile.active { border-width: 2px; border-color: currentColor; }
.rs-reasons { margin: 0; padding-left: 1rem; }
.rs-reasons li { margin: .1rem 0; }
.rs-reasons li.lvl-not_ready { color: var(--ra-red-700); font-weight: 600; }

.ra-xscroll { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ra-diff { margin-top: .4rem; }
.ra-diff summary { cursor: pointer; font-size: .82rem; font-weight: 600; color: var(--ra-blue); width: max-content; }
.ra-diff table { margin-top: .5rem; width: 100%; max-width: 760px; border-collapse: collapse; font-size: .82rem; }
.ra-diff th { text-align: left; font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ra-subtle); padding: .3rem .6rem; border-bottom: 1px solid var(--ra-line); }
.ra-diff td { padding: .35rem .6rem; border-bottom: 1px solid var(--ra-line); vertical-align: top; overflow-wrap: anywhere; }
.ra-diff td:first-child { color: var(--ra-muted); white-space: nowrap; }
.ra-sitecell { min-width: 190px; }
.ra-sitecell a { display: block; }
.ra-sitecell span { display: block; font-size: .8rem; color: var(--ra-muted); margin-top: .1rem; }
#table_aeds td, #tableAedList td { min-width: 110px; }
#table_aeds td:nth-child(2), #tableAedList td:nth-child(2) { min-width: 0; white-space: nowrap; }
@media (max-width: 767.98px) { #table_aeds td, #tableAedList td { min-width: 0; } .ra-sitecell { min-width: 0; } }

#readinessTable td:nth-child(2) { min-width: 260px; }
#readinessTable td:nth-child(4) { min-width: 180px; }
#readinessTable td:nth-child(5), #readinessTable td:nth-child(6), #readinessTable td:nth-child(7) { white-space: nowrap; }
@media (max-width: 767.98px) { #readinessTable td { min-width: 0 !important; white-space: normal !important; } }
@media (min-width: 768px) and (max-width: 1499.98px) {
  #readinessTable th:nth-child(5), #readinessTable td:nth-child(5), #readinessTable th:nth-child(6), #readinessTable td:nth-child(6) { display: none; }
}
.select2-container .select2-selection--single .select2-selection__clear { position: absolute; right: 2.1rem; top: 50%; transform: translateY(-50%); margin: 0; font-size: 1.1rem; color: var(--ra-subtle); }
.ra-quick #raAllGood { min-height: 50px; padding-inline: 1.4rem; font-size: 1.02rem; border-radius: 12px; box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 6px 16px -8px rgba(15, 122, 85, .7); }
@media (max-width: 767.98px) { .ra-quick #raAllGood { width: 100%; } }
.ra-auth-brand { background: radial-gradient(700px 360px at 110% -10%, rgba(42, 91, 224, .45), transparent 65%), linear-gradient(160deg, #06275F 0%, var(--ra-navy) 45%, #01133A 100%); }
.ra-auth-brand::after { content: ""; position: absolute; left: -40px; right: 0; bottom: 12%; height: 160px; background: var(--ra-trace) no-repeat left center / 900px auto; opacity: .08; pointer-events: none; }

/* ======================================================================
 * v4 refinements: one type scale, one radius, calmer legacy screens.
 *   Page title 26px / section 17px / body 15px / meta 13px / label 11px caps
 * ==================================================================== */
:root {
  --ra-fs-title: 1.625rem;
  --ra-fs-section: 1.0625rem;
  --ra-fs-body: .9375rem;
  --ra-fs-meta: .8125rem;
  --ra-fs-label: .6875rem;
  --ra-radius: 16px;
  --ra-card: 0 1px 2px rgba(15,27,51,.04), 0 6px 20px -12px rgba(15,27,51,.12);
}
body { font-size: var(--ra-fs-body); line-height: 1.55; text-rendering: optimizeLegibility; font-feature-settings: "ss01" 1, "tnum" 1; }

/* Page titles: one size everywhere */
.ra-head h1, .ra-page-heading h1, .ra-device h1,
.section-content .item-header h1, .section-content .item-header .h1, .section-content .item-header h2,
.section-content .item-body > h1, .section-content .item-body > h2:first-child,
.section-content .item-body > .row:first-child h2, .section-content .item-body .item-header h2 {
  font-size: var(--ra-fs-title); line-height: 1.2; font-weight: 700; letter-spacing: -.02em; color: var(--ra-navy); text-wrap: balance;
}
.ra-pulse h1 { letter-spacing: -.02em; }
.ra-head p, .ra-page-heading p, .section-content .item-header p.text-muted { font-size: var(--ra-fs-body); color: var(--ra-muted); }

/* Section headings inside long forms read as quiet dividers */
.section-content .item-body h4, .section-content .item-body .h4,
.section-content .item-body h5:not(.modal-title), .section-content .item-body .h5 {
  font-size: var(--ra-fs-section); font-weight: 700; letter-spacing: -.01em; color: var(--ra-navy);
  margin: 1.75rem 0 .9rem; padding-top: 1.25rem; border-top: 1px solid var(--ra-line);
}
.section-content .item-body > h4:first-child, .section-content .item-body .row > div > h4:first-child,
.section-content .item-body form > h4:first-child, .section-content .item-body .col-12 > h4:first-child,
.section-content .item-body [class*="col-"] > h4:first-child { border-top: 0; padding-top: 0; margin-top: .25rem; }

/* Legacy page headers: keep the title first and actions to the right */
.section-content .item-header .row > [class*="col"]:has(h1, h2, .h1) { order: -1; }
.section-content .item-header .row { align-items: center; }

/* Forms */
.form-group label, .form-label, label.form-label { font-size: var(--ra-fs-meta); font-weight: 600; letter-spacing: .005em; }
.form-group, .section-content .item-body .mb-3 { margin-bottom: 1.15rem !important; }
.form-text, small.text-muted, .form-group small { font-size: .78rem; color: var(--ra-subtle) !important; }
label .text-danger, .form-label .text-danger, .required-star { color: var(--ra-red-700) !important; font-weight: 600; }
.form-check { padding-top: .15rem; padding-bottom: .15rem; }
.form-check .form-check-label { color: var(--ra-text); }
.form-control:hover:not(:focus):not([disabled]):not([readonly]), .form-select:hover:not(:focus):not([disabled]) { border-color: #B9C5DA; }
.invalid-feedback, .text-danger.small { font-weight: 500; }

/* Cards share one radius and shadow */
.items-box, .ra-stat, .ra-list, .card, .table-responsive, .card-table, div.dt-container .dt-layout-table, .ra-callout { border-radius: var(--ra-radius); }
.ra-stat { box-shadow: var(--ra-card); border-color: var(--ra-line); }
.ra-stat .k { font-size: var(--ra-fs-meta); }

/* Readiness ring label */
.ra-ring .ra-ring-label span { font-size: .6rem; letter-spacing: .14em; }

/* List toolbars (DataTables): aligned, labelled, quiet */
div.dt-container div.dt-length { width: auto; overflow: visible; position: static; display: inline-flex; align-items: center; gap: .5rem; text-align: left; }
div.dt-container div.dt-length select { position: static; width: auto; min-height: 38px; padding: .35rem 2rem .35rem .75rem; border: 1px solid var(--ra-border-strong); border-radius: 10px; background-color: #fff; background-position: right .7rem center; font-size: .875rem; }
div.dt-container div.dt-length label { width: auto; margin: 0; font-size: var(--ra-fs-meta); color: var(--ra-muted); overflow: visible; }
.table-filter-wrap .items-filter { position: static; right: auto; top: auto; flex-wrap: wrap; gap: .25rem .5rem; margin-bottom: .75rem; }
.table-filter-wrap .items-filter label { font-size: var(--ra-fs-meta) !important; font-weight: 600 !important; color: var(--ra-muted) !important; padding: 0 !important; }
.table-filter-wrap .items-filter .label-show { display: none; }
.table-filter-wrap .items-filter label:not(:first-child) { margin-left: .75rem; }
.table-filter-wrap .items-filter .select2-container .select2-selection--single .select2-selection__rendered,
.table-filter-wrap .items-filter select { font-size: .9rem !important; }
div.dt-container .dt-layout-row:first-child, .dt-container > .row:first-child { align-items: center; }

/* Tables: steadier rhythm */
.table > thead > tr > th, .table-dark > tr > th { font-size: var(--ra-fs-label); letter-spacing: .08em; padding-top: .8rem; padding-bottom: .8rem; }
.table > tbody > tr > td { font-size: .875rem; }
.table td .badge, .table td .rs-badge { vertical-align: middle; }
.badge.bg-success, .badge.text-bg-success { background: var(--ra-green-50) !important; color: var(--ra-green) !important; font-weight: 700; }
.badge.bg-danger, .badge.text-bg-danger { background: var(--ra-red-50) !important; color: var(--ra-red-700) !important; font-weight: 700; }
.badge.bg-warning, .badge.text-bg-warning { background: var(--ra-amber-50) !important; color: var(--ra-amber) !important; font-weight: 700; }
.badge.bg-secondary, .badge.bg-dark, .badge.text-bg-secondary { background: #EEF1F6 !important; color: var(--ra-slate) !important; font-weight: 700; }
.badge.bg-primary, .badge.bg-info { background: var(--ra-blue-50) !important; color: var(--ra-blue-700) !important; font-weight: 700; }

/* Empty states */
.ra-empty-state { display: grid; gap: .25rem; place-items: center; text-align: center; padding: 3rem 1rem; border: 1px dashed var(--ra-border-strong); border-radius: var(--ra-radius); background: rgba(255,255,255,.6); color: var(--ra-muted); }
.ra-empty-state strong { color: var(--ra-navy); font-size: 1.02rem; }

/* Modals */
.modal-header .modal-title { font-size: var(--ra-fs-section); letter-spacing: -.01em; }

/* Sidebar type */
.sidebar .navbar-nav .nav-link { font-size: .875rem; }
.sidebar .ra-nav-section { font-size: .625rem; letter-spacing: .14em; }

/* Section label above the dashboard AED list */
.ra-section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 0 0 .25rem; }
.ra-section-title h2 { font-size: var(--ra-fs-section); margin: 0; }
.ra-section-title p { margin: 0; color: var(--ra-muted); font-size: var(--ra-fs-meta); }

@media (max-width: 767.98px) {
  :root { --ra-fs-title: 1.375rem; }
  .table-filter-wrap .items-filter label:not(:first-child) { margin-left: 0; }
  div.dt-container div.dt-length { margin-left: 0; }
}
.section-content .item-header .ra-section-title h2 { font-size: var(--ra-fs-section); letter-spacing: -.01em; }

/* ---------------------------------------------------------- help tips */
.ra-tip {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
  width: 16px; height: 16px; margin-left: .35rem; padding: 0; border-radius: 50%;
  border: 1px solid var(--ra-border-strong); background: transparent; color: var(--ra-subtle);
  font: 700 10px/1 var(--bs-body-font-family); cursor: help; transition: color .15s ease, border-color .15s ease, background-color .15s ease;
  position: relative; top: -1px;
}
.ra-tip::after { content: ""; position: absolute; inset: -8px; }
.ra-tip:hover, .ra-tip:focus-visible, .ra-tip[data-ra-tip-open] { color: var(--ra-blue); border-color: var(--ra-blue); background: var(--ra-blue-50); }
.ra-pulse .ra-tip, .ra-hero .ra-tip { border-color: rgba(255,255,255,.35); color: rgba(255,255,255,.75); }
.ra-pulse .ra-tip:hover, .ra-pulse .ra-tip[data-ra-tip-open] { background: rgba(255,255,255,.12); color: #fff; border-color: #fff; }
.ra-tipbox {
  position: absolute; z-index: 2200; max-width: 280px; padding: .6rem .75rem; border-radius: 10px;
  background: var(--ra-ink); color: rgba(255,255,255,.92); font-size: .8125rem; line-height: 1.45; font-weight: 500; letter-spacing: .005em;
  box-shadow: 0 14px 34px -10px rgba(6, 21, 56, .55), 0 0 0 1px rgba(255,255,255,.04) inset;
  pointer-events: none; opacity: 0; transform: translateY(3px); transition: opacity .14s ease, transform .14s ease;
  text-wrap: pretty;
}
.ra-tipbox.is-in { opacity: 1; transform: none; }
.ra-tipbox::before { content: ""; position: absolute; width: 10px; height: 10px; background: var(--ra-ink); transform: rotate(45deg); border-radius: 2px; }
.ra-tipbox[data-side="top"]::before { bottom: -4px; left: calc(var(--ra-arrow, 50%) - 5px); }
.ra-tipbox[data-side="bottom"]::before { top: -4px; left: calc(var(--ra-arrow, 50%) - 5px); }
.ra-tipbox[data-side="right"]::before { left: -4px; top: calc(var(--ra-arrow, 50%) - 5px); }
.ra-tipbox[data-side="right"] { transform: translateX(-3px); }
.ra-tipbox[data-side="right"].is-in { transform: none; }
[data-ra-tip].rs-badge, [data-ra-tip].ra-status-big { cursor: help; }
@media (prefers-reduced-motion: reduce) { .ra-tipbox { transition: none; transform: none; } }
@media print { .ra-tip, .ra-tipbox { display: none !important; } }

/* Accessibility: text contrast at least 4.5:1 */
:root { --ra-subtle: #687185; }
.ra-cal.is-soon .m { background: var(--ra-amber); }
.ra-search-trigger { color: var(--ra-muted); }

.ra-seg .count { opacity: 1; }
.ra-seg a:not(.active) .count { color: var(--ra-subtle); }
.select2-container .select2-selection__placeholder { color: var(--ra-subtle) !important; }
a.ra-tip { text-decoration: none; }
@media (max-width: 991.98px) {
  .ra-device { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .ra-device .ra-head-actions { justify-content: flex-start; }
}
/* One content width on every page; centered on very wide screens */
.ra-wrap, .ra-wrap.ra-wide { max-width: 1600px; margin-inline: auto; }
.ra-wrap.ra-narrow { max-width: 860px; margin-inline: 0; }
body > .main-content > .section-content, body > .main-content > .ra-page-heading, body > .main-content > .section-boxes { max-width: 1600px; margin-inline: auto; }
.inspect-wrap { margin-inline: 0; }
.ra-row-actions { display: inline-flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; align-items: center; }
.ra-row-actions form { margin: 0; }
.ra-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; padding-left: 0 !important; padding-right: 0 !important; }
.ra-icon-btn:hover { color: var(--ra-red-700); border-color: #F2B8BF; background: var(--ra-red-50); }
#table_aeds td:nth-child(3), #tableAedList td:nth-child(3) { min-width: 190px; }
#table_aeds td:nth-child(4), #tableAedList td:nth-child(4) { min-width: 200px; }
.ra-submit-bar:not(.is-active) { position: static; background: none; }
.ra-ring .ra-ring-label span { letter-spacing: .06em; font-size: .58rem; }

/* ---------------------------------------------- v5: row actions and button family */
/* Any table cell with several buttons keeps them on one line, small and evenly spaced. */
.table td:has(> .btn + .btn), .table td:has(> .btn + form), .table td:has(> a.btn ~ a.btn) { white-space: nowrap; }
.table td > .btn + .btn, .table td > .btn + form, .table td > form + .btn { margin-left: .35rem; }
.table td .btn:not(.btn-lg) { --bs-btn-padding-x: .75rem; --bs-btn-padding-y: .34rem; --bs-btn-font-size: .8125rem; --bs-btn-border-radius: 8px; }
.ra-row-actions { flex-wrap: nowrap; }
.table td.text-end .ra-row-actions { justify-content: flex-end; }
/* Bootstrap's cyan and yellow buttons follow the brand's quiet secondary style */
.btn-info, .btn-warning, .btn-outline-secondary, .btn-outline-info, .btn-outline-warning {
  --bs-btn-color: var(--ra-navy); --bs-btn-bg: #fff; --bs-btn-border-color: var(--ra-border-strong);
  --bs-btn-hover-color: var(--ra-navy); --bs-btn-hover-bg: var(--ra-blue-50); --bs-btn-hover-border-color: #B9C5DA;
  --bs-btn-active-color: var(--ra-navy); --bs-btn-active-bg: var(--ra-blue-100); --bs-btn-active-border-color: #B9C5DA;
  background-image: linear-gradient(180deg, #fff, #F7F9FC); box-shadow: var(--ra-shadow-sm);
}
.btn-outline-danger { --bs-btn-color: var(--ra-red-700); --bs-btn-border-color: #F2B8BF; --bs-btn-hover-bg: var(--ra-red-50); --bs-btn-hover-color: var(--ra-red-700); --bs-btn-hover-border-color: #F2B8BF; }
/* Button labels are never shouted */
.btn { text-transform: none; letter-spacing: 0; }
/* Header action groups stay on one line where there is room */
.section-content .item-header .row > [class*="col"]:has(> .btn + .btn), .section-content .item-header .d-flex:has(> .btn + .btn) { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: flex-end; }
.section-content .item-header .row > [class*="col"]:has(> .btn + .btn) > .btn { margin: 0 !important; }
@media (max-width: 767.98px) {
  .table td:has(> .btn + .btn), .table td:has(> a.btn ~ a.btn) { white-space: normal; }
  .ra-row-actions { flex-wrap: wrap; justify-content: flex-start !important; }
  .section-content .item-header .row > [class*="col"]:has(> .btn + .btn) { justify-content: flex-start; }
}
.ra-mgr-stats { padding: .25rem var(--bs-content-padding-x) 0; }
/* One main action per page: row buttons inside tables stay quiet */
.table td .btn-primary:not(.ra-keep-primary), .table td .btn-success:not(.ra-keep-primary) {
  --bs-btn-color: var(--ra-navy); --bs-btn-bg: #fff; --bs-btn-border-color: var(--ra-border-strong);
  --bs-btn-hover-color: var(--ra-navy); --bs-btn-hover-bg: var(--ra-blue-50); --bs-btn-hover-border-color: #B9C5DA;
  background-image: linear-gradient(180deg, #fff, #F7F9FC); box-shadow: var(--ra-shadow-sm);
}
.section-content .item-header .btn-success { --bs-btn-color: var(--ra-navy); --bs-btn-bg: #fff; --bs-btn-border-color: var(--ra-border-strong); --bs-btn-hover-color: var(--ra-navy); --bs-btn-hover-bg: var(--ra-blue-50); --bs-btn-hover-border-color: #B9C5DA; background-image: linear-gradient(180deg, #fff, #F7F9FC); box-shadow: var(--ra-shadow-sm); }
#contactuslist td:last-child, #contactuslist td:nth-last-child(2) { min-width: 260px; }
.section-content .item-body form h2, .section-content .item-body form .h2,
.section-content .item-body .row:first-child form h2 { font-size: var(--ra-fs-section) !important; letter-spacing: -.01em; margin-bottom: 1rem; }
/* Header action groups never break a button onto its own line on desktop */
@media (min-width: 992px) {
  .section-content .item-header .btn, .ra-head .btn, .ra-head-actions .btn { white-space: nowrap; }
  .section-content .item-header [class*="col"]:has(> .btn + .btn), .section-content .item-header .d-flex:has(> .btn + .btn) { flex-wrap: nowrap; }
}
/* Form buttons sit side by side at their natural width on anything wider than a phone */
@media (min-width: 576px) {
  .section-content .item-body form .btn.w-100 { width: auto !important; min-width: 8.5rem; }
}
.table td .btn, .ra-row-actions .btn, .ra-actions .btn { white-space: nowrap; }
@media (min-width: 768px) { .main-content .table-responsive { overflow-x: auto; } }
.section-content .item-body h1:not(.modal-title) { font-size: var(--ra-fs-title); line-height: 1.2; font-weight: 700; letter-spacing: -.02em; color: var(--ra-navy); }
.section-content .item-header .row > [class*="col"]:has(> .btn + .btn), .section-content .item-header .d-flex:has(> .btn + .btn) { justify-content: flex-start; }
