/* =====================================================================
   CaseAct — application theme
   Load order (see MasterPage2.master):
     1. Foundation 6 (grid, forms, visibility helpers, reset)
     2. this file
   Everything is namespaced (ca-, rail-, flyout-, dash-) so it can sit
   alongside older page styles while the rest of the site is migrated.
   ===================================================================== */

:root {
    --ca-teal: #47878f;
    --ca-teal-dark: #3b767d;
    --ca-teal-ink: #3f7f87;
    --ca-teal-soft: rgba(255, 255, 255, .14);
    --ca-wordmark-accent: #9cd7d8;

    --ca-flyout-bg: #f1f9f8;
    --ca-flyout-border: #d9ebe9;

    --ca-bg: #f7f9fc;
    --ca-surface: #ffffff;
    --ca-border: #e5e9ef;

    --ca-text: #4f4f50;
    --ca-muted: #6e7c8e;
    --ca-faint: #8a98a9;

    /* Alerts and error text use the site teal (these were red) */
    --ca-alert: #47878f;          /* counts, "Review" icon */
    --ca-alert-ink: #3b767d;      /* small error text: darker teal so it stays readable */
    --ca-alert-soft: #eaf6f6;
    --ca-alert-border: #b9dede;
    --ca-alert-badge: rgba(158, 217, 217, .35);

    /* Dashboard cards only: a card with items uses a muted red (count, icon, border) */
    --ca-dash-alert: #c4514f;
    --ca-dash-alert-soft: #fdf0f0;
    --ca-dash-alert-border: #f1d2d3;

    --ca-info-bg: #f0f4f8;

    --ca-btn-bg: #9ed9d9;
    --ca-btn-bg-hover: #86cccc;
    --ca-btn-ink: #242b2e;
    --ca-info-ink: #8593a6;

    --ca-header-h: 72px;
    --ca-rail-w: 80px;
    --ca-radius: 10px;
    --ca-font: "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Base (overrides Foundation defaults) ---------- */

html {
    background: var(--ca-teal);
}

body.ca-body {
    background: var(--ca-teal);
    font-family: var(--ca-font);
    color: var(--ca-text);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.ca-body h1, .ca-body h2, .ca-body h3, .ca-body h4 {
    font-family: var(--ca-font);
    color: var(--ca-text);
    text-transform: none;
}

.ca-body a {
    color: var(--ca-teal-ink);
}

.ca-body a:hover,
.ca-body a:focus {
    color: var(--ca-teal-dark);
}

.ca-body :focus-visible {
    outline: 2px solid #9cd7d8;
    outline-offset: 2px;
}

/* ---------- Header ---------- */

.ca-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--ca-header-h);
    background: var(--ca-teal);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem 0 1.5rem;
    z-index: 50;
}

/* The logo side takes the room left over and may shrink; the menu button and
   the initials circle never do. Large text / zoom on a phone leaves little
   room, and the logo must then get smaller rather than run off the bar. */
.ca-header-left {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex: 1 1 auto;
    min-width: 0;
}

.ca-header-left > .ca-menu-toggle,
.ca-user {
    flex: none;
}

.ca-brand {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    min-width: 0;
    text-decoration: none;
}

.ca-body .ca-brand,
.ca-body .ca-brand:hover,
.ca-body .ca-brand:focus {
    color: #fff;
    text-decoration: none;
}

/* Header logo: the login page's logo, recoloured for the teal bar
   (images/ca2-header-logo.png) */
.ca-brand-logo {
    display: block;
    height: 50px;
    width: auto;
    max-width: 100%;
    object-fit: contain;          /* shrinks with its proportions kept */
    object-position: left center;
}

.ca-brand-mark {
    width: 36px;
    height: 42px;
    flex: none;
}

.ca-wordmark {
    font-size: 1.6rem;
    font-weight: 500;
    letter-spacing: -.01em;
    line-height: 1;
}

.ca-wordmark em {
    font-style: normal;
    color: var(--ca-wordmark-accent);
}

.ca-wordmark sup {
    font-size: .38em;
    top: -1.5em;
    margin-left: 2px;
    color: #fff;
}

.ca-user {
    display: flex;
    align-items: center;
    gap: .7rem;
    font-size: .85rem;
}

.ca-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    color: var(--ca-teal);
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .02em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
}

.ca-user-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.ca-user-name {
    font-size: .9rem;
    font-weight: 600;
}

.ca-user-role {
    font-size: .74rem;
    color: rgba(255, 255, 255, .72);
}

.ca-user-role:empty {
    display: none;
}

.ca-body .ca-login-link {
    color: #fff;
    font-weight: 600;
    text-decoration: underline;
}

.ca-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
}

.ca-menu-toggle:hover {
    background: var(--ca-teal-soft);
}

.ca-menu-toggle span,
.ca-menu-toggle span::before,
.ca-menu-toggle span::after {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    position: relative;
    transition: transform .2s ease, background-color .2s ease;
}

.ca-menu-toggle span::before,
.ca-menu-toggle span::after {
    content: "";
    position: absolute;
    left: 0;
}

.ca-menu-toggle span::before { top: -6px; }
.ca-menu-toggle span::after  { top: 6px; }

.ca-nav-open .ca-menu-toggle span { background: transparent; }
.ca-nav-open .ca-menu-toggle span::before { transform: translateY(6px) rotate(45deg); }
.ca-nav-open .ca-menu-toggle span::after  { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Left icon rail ---------- */

.ca-rail {
    position: fixed;
    top: var(--ca-header-h);
    bottom: 0;
    left: 0;
    width: var(--ca-rail-w);
    background: var(--ca-teal);
    z-index: 40;
    padding-top: 2.1rem;
}

.rail-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .6rem;
}

/* asp:Panel wrappers (pnlPostCase) must not affect layout */
.rail-item-wrap {
    display: contents;
}

.rail-item {
    position: relative;
    margin: 0;
}

/* When the server hides an item's link (e.g. for marshals, or Logout when
   not signed in) the whole item, flyout included, disappears. */
.rail-item:not(:has(.rail-link)) {
    display: none;
}

.rail-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .15s ease;
}

.ca-body .rail-link,
.ca-body .rail-link:hover,
.ca-body .rail-link:focus {
    color: #fff;
    text-decoration: none;
}

.rail-link::before {
    content: "";
    width: 24px;
    height: 24px;
    background: currentColor;
    -webkit-mask: var(--icon) center / contain no-repeat;
            mask: var(--icon) center / contain no-repeat;
}

/* The server still sets the old nav .gif images on these links (and swaps in
   the red "r.gif" for the current page). The icon now comes from CSS, so the
   image is hidden (no red shows); its file name only marks the active item. */
.rail-link img {
    display: none !important;
}

.rail-item:hover > .rail-link,
.rail-item:focus-within > .rail-link,
.rail-item.is-open > .rail-link,
.rail-link:has(img[src$="r.gif"]),
.rail-link.is-current {
    background: var(--ca-teal-soft);
}

/* ---------- Flyout menus ---------- */

.flyout {
    position: absolute;
    top: 0;
    left: calc(100% + 26px);
    width: 280px;
    background: var(--ca-flyout-bg);
    border: 1px solid var(--ca-flyout-border);
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(28, 64, 68, .14);
    padding: 1rem 1rem 1rem;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-6px);
    transition: opacity .15s ease, transform .15s ease, visibility 0s linear .15s;
    z-index: 60;
}

/* invisible bridge so the pointer can travel from the icon to the flyout */
.flyout::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -28px;
    width: 28px;
}

.rail-item:hover > .flyout,
.rail-item:focus-within > .flyout,
.rail-item.is-open > .flyout {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity .15s ease, transform .15s ease, visibility 0s;
}

/* Only one menu at a time: a menu left open by a click or keyboard focus
   closes as soon as the pointer moves onto another icon. (Phones use the
   drawer, where every menu is listed inline, so this is for mouse screens.) */
@media (hover: hover) and (min-width: 40em) {
    .ca-rail:has(.rail-item:hover) .rail-item:not(:hover) > .flyout {
        opacity: 0;
        visibility: hidden;
        transform: translateX(-6px);
        transition: none;
    }

    .ca-rail:has(.rail-item:hover) .rail-item:not(:hover) > .rail-link:not(.is-current):not(:has(img[src$="r.gif"])) {
        background: transparent;
    }
}

.flyout-title {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin: 0 0 .8rem;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--ca-text);
    line-height: 1.2;
}

.flyout-title::before {
    content: "";
    width: 22px;
    height: 22px;
    flex: none;
    background: currentColor;
    -webkit-mask: var(--icon) center / contain no-repeat;
            mask: var(--icon) center / contain no-repeat;
}

.flyout-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

/* Report items are added by the server with class "bottomLevelMenuItem", and an
   old startup script writes inline hover colours onto them; this cancels those. */
.flyout-links li,
.flyout-links li.bottomLevelMenuItem {
    margin: 0;
    background-color: transparent !important;
}

.flyout-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .65rem 1rem;
    border-radius: 8px;
    font-size: .95rem;
    line-height: 1.3;
    text-decoration: none !important;
    transition: background-color .12s ease, color .12s ease;
}

.ca-body .flyout-links a {
    color: var(--ca-text);
}

.flyout-links a::after {
    content: "";
    width: 14px;
    height: 14px;
    flex: none;
    background: var(--ca-teal-ink);
    -webkit-mask: var(--icon-chevron) center / contain no-repeat;
            mask: var(--icon-chevron) center / contain no-repeat;
}

/* Items turn teal only on hover or keyboard focus; nothing is highlighted at first */
.ca-body .flyout-links a:hover,
.ca-body .flyout-links a:focus-visible {
    background: var(--ca-teal);
    color: #fff;
}

.flyout-links a:hover::after,
.flyout-links a:focus-visible::after {
    background: #fff;
}

.flyout-contact p {
    margin: 0 0 .9rem;
    font-size: .95rem;
    color: var(--ca-text);
}

.flyout-contact p:last-child {
    margin-bottom: .1rem;
}

.ca-body .flyout-contact a {
    color: var(--ca-text);
    text-decoration: none;
}

.ca-body .flyout-contact a:hover {
    color: var(--ca-teal-ink);
    text-decoration: underline;
}

.flyout-empty {
    font-size: .85rem;
    color: var(--ca-muted);
    padding: 0 .2rem;
}

/* hide the "no reports" note once the server has added report items */
.flyout-links:has(li) + .flyout-empty {
    display: none;
}

/* ---------- Main panel ---------- */

.ca-main {
    margin-left: var(--ca-rail-w);
    padding-top: var(--ca-header-h);
    min-height: 100vh;
}

.ca-panel {
    background: var(--ca-bg);
    border-top-left-radius: 22px;
    min-height: calc(100vh - var(--ca-header-h));
    display: flex;
    flex-direction: column;
    padding: 2.1rem 2rem 1.5rem;
}

.ca-content {
    flex: 1 0 auto;
    width: 100%;
}

.ca-backdrop {
    display: none;
}

/* ---------- Footer / disclaimer ---------- */

.ca-footer {
    margin-top: 3.5rem;
    width: 100%;
}

.ca-admin-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    font-size: .82rem;
    margin-bottom: 1rem;
}

.ca-admin-links:not(:has(a)) {
    display: none;
}

.ca-disclaimer {
    font-size: .8rem;
    line-height: 1.75;
    color: var(--ca-faint);
}

.ca-disclaimer hr {
    display: none;
}

.ca-disclaimer b {
    color: var(--ca-text);
}

.ca-body .ca-disclaimer a {
    color: var(--ca-teal-ink);
    text-decoration: underline;
}

.ca-credit {
    margin-top: 1rem;
    font-size: .72rem;
    color: #a3adb9;
    display: flex;
    align-items: center;
    gap: .45rem;
}

.ca-credit img {
    height: 16px;
    opacity: .55;
}

.ca-body .ca-credit a {
    color: #a3adb9;
    text-decoration: none;
}

/* =====================================================================
   Dashboard (Menu2.aspx)
   ===================================================================== */

.dash-header {
    margin-bottom: 1.9rem;
}

.dash-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 .3rem;
    line-height: 1.2;
    letter-spacing: -.005em;
}

.dash-subtitle {
    margin: 0;
    color: var(--ca-muted);
    font-size: 1.05rem;
}

.dash-section {
    margin-bottom: 2rem;
}

.dash-section-title {
    font-size: 1.35rem;
    font-weight: 600;
    margin: 0 0 1rem;
    line-height: 1.3;
}

/* Foundation's XY block grid sets the column widths (small-up-2 / large-up-4);
   these rules only add an even gutter around the cards. */
.dash-grid {
    margin: -.5rem;
}

.dash-grid > .cell {
    display: flex;
    padding: .5rem;
}

.dash-card {
    flex: 1;
    background: var(--ca-surface);
    border: 1px solid var(--ca-border);
    border-radius: var(--ca-radius);
    padding: 1rem 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    transition: box-shadow .15s ease;
}

.dash-card:hover {
    box-shadow: 0 6px 18px rgba(16, 24, 40, .06);
}

/* icon sits top-right */
.dash-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
}

.dash-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--ca-info-bg);
    color: var(--ca-info-ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dash-icon svg {
    width: 18px;
    height: 18px;
}

.dash-count {
    margin-top: 1rem;
    font-size: 1.65rem;
    font-weight: 500;
    line-height: 1.1;
}

/* The server writes the count as span.number (has items) or span.zero */
.dash-count .zero   { color: var(--ca-text); }
.dash-count .number { color: var(--ca-dash-alert); }

.dash-label {
    margin: .3rem 0 0;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.35;
}

.dash-note {
    margin: .3rem 0 0;
    font-size: .78rem;
    color: var(--ca-muted);
    font-style: italic;
}

.dash-note:empty {
    display: none;
}

.dash-note br {
    display: none;
}

.dash-card-foot {
    margin-top: auto;
    padding-top: .85rem;
}

.dash-details {
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
}

.ca-body .dash-details { color: var(--ca-teal-ink); text-decoration: none; }
.ca-body .dash-details:hover { color: var(--ca-teal-dark); text-decoration: underline; }

/* The server-driven report link stays inside each card so the page code keeps
   working; it is hidden because the design uses the "Details" link instead. */
.dash-report-link {
    display: none !important;
}

/* muted red whenever the server reports a non-zero count */
.dash-card:has(.dash-count .number) {
    border-color: var(--ca-dash-alert-border);
}

.dash-card:has(.dash-count .number) .dash-icon {
    background: var(--ca-dash-alert-soft);
    color: var(--ca-dash-alert);
}

/* ---------- Buttons (shared across pages) ----------
   Soft aqua with dark uppercase label, as on the My Cases design.
   Use on any asp:Button / input / a / button:  CssClass="ca-btn" */

.ca-btn,
.ca-body input.ca-btn,
.ca-body .ca-filter input[type="submit"],
.ca-body .dash-search input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 2.6rem;
    padding: .6rem 1.4rem;
    margin: 0;
    border: 1px solid transparent;
    border-radius: 9px;
    background: var(--ca-btn-bg);
    color: var(--ca-btn-ink);
    font-family: var(--ca-font);
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .07em;
    line-height: 1.2;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(36, 43, 46, .06), inset 0 1px 0 rgba(255, 255, 255, .35);
    transition: background-color .15s ease, box-shadow .15s ease, transform .08s ease;
    -webkit-appearance: none;
            appearance: none;
}

.ca-body .ca-btn,
.ca-body .ca-btn:hover,
.ca-body .ca-btn:focus {
    text-decoration: none;
}

.ca-body .ca-btn:hover,
.ca-body .ca-btn:focus,
.ca-body .ca-filter input[type="submit"]:hover,
.ca-body .dash-search input[type="submit"]:hover {
    background: var(--ca-btn-bg-hover);
    color: var(--ca-btn-ink);
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(71, 135, 143, .22), inset 0 1px 0 rgba(255, 255, 255, .35);
}

.ca-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(158, 217, 217, .55);
}

.ca-btn:active {
    transform: translateY(1px);
    box-shadow: none;
}

.ca-btn[disabled],
.ca-btn.is-disabled {
    opacity: .5;
    cursor: not-allowed;
    box-shadow: none;
}

/* ---------- Dashboard header with search (top right) ---------- */

.dash-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem 2rem;
}

.dash-heading {
    flex: 1 1 320px;
    min-width: 0;
}

.dash-search {
    flex: 0 1 auto;
    background: var(--ca-surface);
    border: 1px solid var(--ca-border);
    border-radius: 12px;
    padding: .85rem 1rem 1rem;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .03);
}

.dash-search-title {
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ca-muted);
    margin-bottom: .55rem;
}

.dash-search-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: .6rem;
}

.dash-field {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dash-field--date  { flex: 1 1 128px; max-width: 150px; }
.dash-field--range { flex: 1 1 140px; max-width: 170px; }
.dash-field--submit { flex: 0 0 auto; }

.dash-search label {
    font-size: .74rem;
    font-weight: 500;
    color: var(--ca-text);
    margin: 0 0 .25rem;
    line-height: 1.2;
}

.dash-search input[type="text"],
.dash-search select {
    height: 2.6rem;
    margin: 0;
    padding-left: .7rem;
    border: 1px solid var(--ca-border);
    border-radius: 8px;
    background-color: var(--ca-bg);
    box-shadow: none;
    font-size: .88rem;
    color: var(--ca-text);
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.dash-search select {
    padding-right: 1.8rem;
    background-position: right -.9rem center;
}

.dash-search input[type="text"]::placeholder {
    color: #a3adb9;
}

.dash-search input[type="text"]:focus,
.dash-search select:focus {
    background-color: #fff;
    border-color: var(--ca-btn-bg-hover);
    box-shadow: 0 0 0 3px rgba(158, 217, 217, .35);
}

.search-errors {
    font-size: .78rem;
    color: var(--ca-alert-ink);
    max-width: 640px;
}

.search-errors span {
    display: block;
    margin-top: .55rem;
}

.dash-lt {
    margin: -.75rem 0 2rem;
    font-size: .88rem;
}

.dash-lt span {
    font-size: inherit !important;
}

/* Narrower screens: search drops under the title and fills the width */
@media screen and (max-width: 79.9375em) {
    .dash-search {
        flex: 1 1 100%;
    }

    .dash-field--date,
    .dash-field--range {
        max-width: none;
    }
}

/* Phones: From / To side by side, then Time Frame, then a full-width button */
@media screen and (max-width: 39.9375em) {
    .dash-header {
        gap: 1rem;
    }

    .dash-search {
        padding: .8rem .8rem .9rem;
    }

    .dash-field--date  { flex: 1 1 calc(50% - .3rem); }
    .dash-field--range { flex: 1 1 100%; }
    .dash-field--submit { flex: 1 1 100%; }

    .dash-field--submit .ca-btn {
        width: 100%;
    }

    .dash-search input[type="text"],
    .dash-search select {
        font-size: 16px; /* stops iOS zooming into the field */
    }
}

/* ---------- Resources (videos / PDF) ---------- */

.dash-resources {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin-top: 1.5rem;
}

.dash-resources .videos a {
    display: inline-block;
    padding: .4rem .85rem;
    border-radius: 999px;
    background: var(--ca-surface);
    border: 1px solid var(--ca-border);
    font-size: .8rem;
    text-decoration: none;
}

/* Old quick-link panels: kept for the page code, replaced by the rail menus */
.dash-legacy {
    display: none !important;
}

/* =====================================================================
   Responsive
   ===================================================================== */

/* Tablets: slightly tighter panel */
@media screen and (max-width: 63.9375em) {
    .ca-panel {
        padding: 1.75rem 1.4rem 1.25rem;
    }
}

/* Phones: the rail becomes a slide-in drawer with every menu listed inline */
@media screen and (max-width: 39.9375em) {

    :root {
        --ca-header-h: 60px;
    }

    .ca-header {
        padding: 0 .9rem 0 .5rem;
    }

    .ca-menu-toggle {
        display: inline-flex;
    }

    .ca-brand-logo {
        height: 40px;
    }

    .ca-brand-mark {
        width: 28px;
        height: 32px;
    }

    .ca-wordmark {
        font-size: 1.35rem;
    }

    .ca-user-text {
        display: none;
    }

    .ca-rail {
        width: min(86vw, 310px);
        padding: 1rem .9rem 2rem;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform .25s ease;
        box-shadow: 8px 0 24px rgba(0, 0, 0, .18);
    }

    .ca-nav-open .ca-rail {
        transform: none;
    }

    .ca-backdrop {
        display: block;
        position: fixed;
        top: var(--ca-header-h);
        right: 0;
        bottom: 0;
        left: 0;
        background: rgba(20, 40, 42, .4);
        opacity: 0;
        visibility: hidden;
        transition: opacity .2s ease, visibility 0s linear .2s;
        z-index: 35;
    }

    .ca-nav-open .ca-backdrop {
        opacity: 1;
        visibility: visible;
        transition: opacity .2s ease;
    }

    body.ca-nav-open {
        overflow: hidden;
    }

    .rail-nav {
        align-items: stretch;
        gap: 0;
    }

    .rail-item {
        display: grid;
        grid-template-columns: 40px 1fr;
        column-gap: .5rem;
        align-items: start;
        padding: .4rem 0;
        border-bottom: 1px solid rgba(255, 255, 255, .12);
    }

    .rail-link {
        width: 40px;
        height: 40px;
    }

    .rail-link::before {
        width: 21px;
        height: 21px;
    }

    .rail-item:hover > .rail-link,
    .rail-item:focus-within > .rail-link,
    .rail-item.is-open > .rail-link {
        background: transparent;
    }

    .rail-link:has(img[src$="r.gif"]),
    .rail-link.is-current {
        background: var(--ca-teal-soft);
    }

    .flyout,
    .rail-item:hover > .flyout,
    .rail-item:focus-within > .flyout,
    .rail-item.is-open > .flyout {
        position: static;
        width: auto;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        padding: .55rem 0 .2rem;
        transition: none;
    }

    .flyout::before,
    .flyout-title::before {
        display: none;
    }

    .ca-body .flyout-title {
        color: #fff;
        font-size: 1rem;
        margin-bottom: .35rem;
    }

    .ca-body .flyout-links a {
        background: transparent;
        color: rgba(255, 255, 255, .9);
        padding: .5rem .6rem;
        font-size: .92rem;
    }

    .ca-body .flyout-links a:hover,
    .ca-body .flyout-links a:focus-visible {
        background: var(--ca-teal-soft);
        color: #fff;
    }

    .flyout-links a::after,
    .flyout-links a:hover::after {
        background: rgba(255, 255, 255, .75);
    }

    .flyout-contact p,
    .ca-body .flyout-contact a {
        color: rgba(255, 255, 255, .9);
        font-size: .9rem;
    }

    .flyout-contact p {
        margin-bottom: .45rem;
    }

    .flyout-empty {
        color: rgba(255, 255, 255, .7);
    }

    .ca-main {
        margin-left: 0;
    }

    .ca-panel {
        border-radius: 16px 16px 0 0;
        padding: 1.4rem 1rem 1.25rem;
    }

    .dash-header {
        margin-bottom: 1.4rem;
    }

    .dash-title {
        font-size: 1.4rem;
    }

    .dash-subtitle {
        font-size: .9rem;
    }

    .dash-section-title {
        font-size: 1.15rem;
    }

    .dash-grid {
        margin: -.35rem;
    }

    .dash-grid > .cell {
        padding: .35rem;
    }

    .dash-card {
        padding: .8rem .8rem .85rem;
    }

    .dash-icon {
        width: 34px;
        height: 34px;
    }

    .dash-icon svg {
        width: 16px;
        height: 16px;
    }

    .dash-count {
        margin-top: .7rem;
        font-size: 1.4rem;
    }

    .dash-label {
        font-size: .86rem;
    }

    .dash-details {
        font-size: .8rem;
    }

    .ca-disclaimer {
        font-size: .74rem;
    }
}

/* Very narrow phones: one card per row */
@media screen and (max-width: 22.5em) {
    .dash-grid.small-up-2 > .cell {
        width: 100%;
    }
}

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

/* ---------- Icons (CSS masks, recoloured with currentColor) ---------- */
:root {
    --icon-dashboard: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='8' rx='1.5'/%3E%3Crect x='14' y='3' width='7' height='5' rx='1.5'/%3E%3Crect x='14' y='12' width='7' height='9' rx='1.5'/%3E%3Crect x='3' y='15' width='7' height='6' rx='1.5'/%3E%3C/svg%3E");
    --icon-buildings: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 21V4.5A1.5 1.5 0 0 1 8.5 3h7A1.5 1.5 0 0 1 17 4.5V21'/%3E%3Cpath d='M7 11H4.5A1.5 1.5 0 0 0 3 12.5V21h18v-9.5A1.5 1.5 0 0 0 19.5 10H17'/%3E%3Cpath d='M10.5 7h3M10.5 11h3M10.5 15h3M11 21v-2h2v2'/%3E%3C/svg%3E");
    --icon-cases: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='7' width='19' height='13.5' rx='2'/%3E%3Cpath d='M16 7V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2'/%3E%3Cpath d='M2.5 13.5h19'/%3E%3Cpath d='M12 12.5v2'/%3E%3C/svg%3E");
    --icon-calendar: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4.5' width='18' height='16.5' rx='2'/%3E%3Cpath d='M8 2.5v4M16 2.5v4M3 10h18'/%3E%3Cpath d='M8 14h.01M12 14h.01M16 14h.01M8 17.5h.01M12 17.5h.01M16 17.5h.01'/%3E%3C/svg%3E");
    --icon-reports: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2.5H6.5A1.5 1.5 0 0 0 5 4v16a1.5 1.5 0 0 0 1.5 1.5h11A1.5 1.5 0 0 0 19 20V7.5z'/%3E%3Cpath d='M14 2.5v5h5'/%3E%3Cpath d='M9 17.5v-2.5M12 17.5v-5M15 17.5v-3.5'/%3E%3C/svg%3E");
    --icon-addcase: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2.5'/%3E%3Cpath d='M12 8v8M8 12h8'/%3E%3C/svg%3E");
    --icon-postcase: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.5 15v4a2 2 0 0 1-2 2h-13a2 2 0 0 1-2-2v-4'/%3E%3Cpath d='M16.5 8 12 3.5 7.5 8'/%3E%3Cpath d='M12 3.5V15'/%3E%3C/svg%3E");
    --icon-contact: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 14h2.5a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2h-.5a2 2 0 0 1-2-2v-7a8.5 8.5 0 0 1 17 0v7a2 2 0 0 1-2 2H18a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h2.5'/%3E%3C/svg%3E");
    --icon-logout: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.5 20.5H5A1.5 1.5 0 0 1 3.5 19V5A1.5 1.5 0 0 1 5 3.5h4.5'/%3E%3Cpath d='M15.5 16.5 20 12l-4.5-4.5'/%3E%3Cpath d='M20 12H9.5'/%3E%3C/svg%3E");
    --icon-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18l6-6-6-6'/%3E%3C/svg%3E");
}
.rail-item--dashboard { --icon: var(--icon-dashboard); }
.rail-item--buildings { --icon: var(--icon-buildings); }
.rail-item--cases { --icon: var(--icon-cases); }
.rail-item--calendar { --icon: var(--icon-calendar); }
.rail-item--reports { --icon: var(--icon-reports); }
.rail-item--addcase { --icon: var(--icon-addcase); }
.rail-item--postcase { --icon: var(--icon-postcase); }
.rail-item--contact { --icon: var(--icon-contact); }
.rail-item--logout { --icon: var(--icon-logout); }

/* Title-only flyouts (Start / Post a Case) — the rail icon itself is the link,
   so the server's restrictions on hypAddCase still apply. */
.flyout--label {
    width: auto;
    white-space: nowrap;
    padding: .8rem 1rem;
}

.flyout--label .flyout-title {
    margin: 0;
    font-size: 1rem;
}

/* Start / Post a Case: the hover label is a link to the same page as the icon.
   (.ca-rail prefix so this outranks the hover / open / phone padding rules.) */
.ca-rail .rail-item > .flyout.flyout--link {
    padding: 0;
}

.flyout-label-link {
    display: block;
    padding: .8rem 1rem;
    border-radius: inherit;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s ease;
}

.flyout-label-link:hover,
.flyout-label-link:focus-visible {
    background: var(--ca-teal-soft);
    text-decoration: none;
}

@media screen and (max-width: 39.9375em) {
    .flyout-label-link {
        padding: .55rem .5rem;
        border-radius: 8px;
    }

    .flyout-label-link:hover {
        background: rgba(255, 255, 255, .12);
    }
}

.flyout-hint {
    display: block;
    margin-top: .35rem;
    font-size: .8rem;
    color: var(--ca-muted);
    white-space: normal;
}

@media screen and (max-width: 39.9375em) {
    .flyout--label,
    .rail-item:hover > .flyout--label {
        padding: .55rem 0;
        align-self: center;
    }

    .flyout-hint {
        color: rgba(255, 255, 255, .7);
    }
}

/* =====================================================================
   Shared page components (Cases2.aspx and later pages)
   ===================================================================== */

:root {
    --icon-download: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.5v11'/%3E%3Cpath d='m7.5 10.5 4.5 4.5 4.5-4.5'/%3E%3Cpath d='M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2'/%3E%3C/svg%3E");
    --icon-calendar-add: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4.5' width='18' height='16.5' rx='2'/%3E%3Cpath d='M8 2.5v4M16 2.5v4M3 10h18M12 13v5.5M9.25 15.75h5.5'/%3E%3C/svg%3E");
    --icon-sort-up: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 15 6-6 6 6'/%3E%3C/svg%3E");
    --icon-sort-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* ---------- Page header ---------- */

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem 2rem;
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
    letter-spacing: -.005em;
}

.page-subtitle {
    display: block;
    margin-top: .3rem;
    color: var(--ca-muted);
    font-size: 1.05rem;
}

.page-subtitle:empty {
    display: none;
}

/* ---------- Cards / labels ---------- */

.ca-card {
    background: var(--ca-surface);
    border: 1px solid var(--ca-border);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .03);
    padding: 1.1rem 1.25rem 1.2rem;
    margin-bottom: 1.5rem;
}

.ca-label,
.ca-body label.ca-label {
    display: block;
    font-size: .74rem;
    font-weight: 500;
    color: var(--ca-text);
    margin: 0 0 .3rem;
    line-height: 1.2;
}

/* ---------- Ghost button variant (secondary actions) ---------- */

.ca-btn--ghost,
.ca-body a.ca-btn--ghost {
    background: transparent;
    border-color: var(--ca-border);
    color: var(--ca-teal-ink);
    box-shadow: none;
}

.ca-body .ca-btn--ghost:hover,
.ca-body .ca-btn--ghost:focus {
    background: var(--ca-flyout-bg);
    border-color: var(--ca-btn-bg);
    color: var(--ca-teal-dark);
    box-shadow: none;
}

.ca-btn--export::before,
.ca-btn--calendar::before {
    content: "";
    width: 16px;
    height: 16px;
    flex: none;
    background: currentColor;
    -webkit-mask: var(--icon-download) center / contain no-repeat;
            mask: var(--icon-download) center / contain no-repeat;
}

.ca-btn--calendar::before {
    -webkit-mask-image: var(--icon-calendar-add);
            mask-image: var(--icon-calendar-add);
}

/* ---------- Filter card (asp:Table laid out as wrapping rows) ---------- */

.filter-title {
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ca-muted);
    margin-bottom: .7rem;
}

.ca-filter table.filter-table {
    display: block;
    width: 100%;
    margin: 0;
    border: 0;
    background: transparent;
}

.ca-filter table.filter-table > tbody {
    display: flex;
    flex-direction: column;
    gap: .9rem;
    border: 0;
    background: transparent;
}

.ca-filter table.filter-table > tbody > tr {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: .75rem;
    background: transparent;
    border: 0;
}

.ca-filter table.filter-table > tbody > tr > td {
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
    min-width: 0;
}

.filter-field--index   { flex: 1 1 120px; max-width: 170px; }
.filter-field--address { flex: 3 1 220px; }
.filter-field--apt     { flex: 1 1 80px;  max-width: 110px; }
.filter-field--boro    { flex: 1 1 120px; max-width: 170px; }
.filter-field--agent   { flex: 1 1 180px; max-width: 240px; }
.filter-field--date    { flex: 1 1 140px; max-width: 180px; }
.filter-field--submit,
.filter-field--export  { flex: 0 0 auto; }
.filter-field--export  { margin-left: auto; }

/* empty agent cell (dropdown hidden) takes no space */
.filter-field--agent:not(:has(select)) {
    display: none !important;
}

.ca-filter input[type="text"],
.ca-filter select {
    width: 100% !important;          /* overrides the old Width="80" etc. */
    height: 2.6rem;
    margin: 0;
    padding-left: .7rem;
    border: 1px solid var(--ca-border);
    border-radius: 8px;
    background-color: var(--ca-bg);
    box-shadow: none;
    font-size: .88rem;
    color: var(--ca-text);
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.ca-filter select {
    padding-right: 1.8rem;
    background-position: right -.9rem center;
}

.ca-filter input[type="text"]::placeholder {
    color: #a3adb9;
}

.ca-filter input[type="text"]:focus,
.ca-filter select:focus {
    background-color: #fff;
    border-color: var(--ca-btn-bg-hover);
    box-shadow: 0 0 0 3px rgba(158, 217, 217, .35);
}

.ca-filter .filter-row--divider > td {
    flex: 1 1 100%;
}

.ca-filter hr {
    margin: 0;
    max-width: none;
    border: 0;
    border-bottom: 1px solid var(--ca-border);
}

/* validator rows: only take space when a message shows */
.ca-filter .filter-row--msgs > td {
    flex: 1 1 100%;
    font-size: .78rem;
    color: var(--ca-alert-ink);
}

.ca-filter .filter-row--msgs > td span {
    display: block;
}

/* hide a validator row unless one of its messages is showing */
.ca-filter .filter-row--msgs:not(:has(span:not([style*="none"]))) {
    display: none !important;
}

.filter-extra {
    margin-top: 1rem;
}

.filter-extra:not(:has(a)) {
    display: none;
}

/* ---------- Data table (GridView) ---------- */

.ca-results {
    margin-bottom: 1rem;
}

/* ASP.NET renders the GridView inside its own <div>; the selectors below therefore
   use ".ca-table-wrap table" rather than "> table". */
.ca-table-wrap {
    background: var(--ca-surface);
    border: 1px solid var(--ca-border);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .03);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ca-table-wrap table {
    width: 100%;
    min-width: 1080px;
    margin: 0;
    border: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0;
    background: transparent;
    font-size: .875rem;
}

.ca-table-wrap table > tbody,
.ca-table-wrap table > thead {
    border: 0;
    background: transparent;
}

.ca-table-wrap table > tbody > tr,
.ca-table-wrap table > tbody > tr:nth-child(even) {
    background: transparent;
    border: 0;
}

.ca-table-wrap table > tbody > tr > th {
    position: relative;
    padding: .85rem .8rem .75rem;
    background: var(--ca-bg);
    border-bottom: 1px solid var(--ca-border);
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .07em;
    text-transform: uppercase;
    text-align: left;
    color: var(--ca-muted);
    white-space: nowrap;
    vertical-align: bottom;
}

.ca-table-wrap table > tbody > tr > th:first-child { border-top-left-radius: 12px; }
.ca-table-wrap table > tbody > tr > th:last-child  { border-top-right-radius: 12px; }

.ca-body .ca-table-wrap th a {
    color: var(--ca-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}

.ca-body .ca-table-wrap th a:hover {
    color: var(--ca-teal-ink);
}

.ca-table-wrap th img {
    vertical-align: -2px;
    margin-right: .25rem;
    max-height: 14px;
}

/* Sort direction: the server appends up.gif / down.gif; shown as a chevron instead */
.ca-table-wrap th img[alt="Ascending Order"],
.ca-table-wrap th img[alt="Descending Order"] {
    display: none;
}

.ca-table-wrap th:has(img[alt="Ascending Order"]),
.ca-table-wrap th:has(img[alt="Descending Order"]),
.ca-body .ca-table-wrap th:has(img[alt="Ascending Order"]) a,
.ca-body .ca-table-wrap th:has(img[alt="Descending Order"]) a {
    color: var(--ca-teal-ink);
}

.ca-table-wrap th:has(img[alt="Ascending Order"]) a::after,
.ca-table-wrap th:has(img[alt="Descending Order"]) a::after {
    content: "";
    width: 12px;
    height: 12px;
    background: currentColor;
    -webkit-mask: var(--icon-sort-up) center / contain no-repeat;
            mask: var(--icon-sort-up) center / contain no-repeat;
}

.ca-table-wrap th:has(img[alt="Descending Order"]) a::after {
    -webkit-mask-image: var(--icon-sort-down);
            mask-image: var(--icon-sort-down);
}

.ca-table-wrap table > tbody > tr > td {
    padding: .85rem .8rem;
    border-bottom: 1px solid var(--ca-border);
    vertical-align: top;
    color: var(--ca-text);
    font-weight: 400;
    line-height: 1.4;
    background: var(--ca-surface);
    transition: background-color .12s ease;
}

.ca-table-wrap table > tbody > tr.alternate > td {
    background: #fbfcfd;
}

.ca-table-wrap table > tbody > tr:not(.ca-head):not(.ca-pager):hover > td {
    background: var(--ca-flyout-bg);
}

/* The old ItemStyle widths (20px / 95px) squeeze the text; let the content size the
   columns instead, with sensible minimums keyed off the column name. */
.ca-table-wrap table > tbody > tr > td[style*="width"] {
    width: auto !important;
}

.ca-table-wrap td[data-label^="Attorney"] { min-width: 170px; }
.ca-table-wrap td[data-label^="Address"]  { min-width: 150px; }
.ca-table-wrap td[data-label^="Tenant"]   { min-width: 150px; }
.ca-table-wrap td[data-label^="Status"]   { min-width: 170px; }
.ca-table-wrap td[data-label^="Notes"]    { min-width: 180px; }
.ca-table-wrap td[data-label^="Apt"],
.ca-table-wrap td[data-label^="Boro"],
.ca-table-wrap td[data-label^="Type"]     { white-space: nowrap; }

/* first visible column (Index #) */
.ca-table-wrap table > tbody > tr > td:first-child {
    font-weight: 600;
    white-space: nowrap;
}

.ca-body .ca-table-wrap td a {
    color: var(--ca-teal-ink);
    font-weight: 600;
    text-decoration: none;
}

.ca-body .ca-table-wrap td a:hover {
    text-decoration: underline;
}

.ca-body .ca-table-wrap td a.courtdatelink {
    font-weight: 500;
    text-decoration: underline dotted;
    text-underline-offset: 3px;
}

.ca-table-wrap td img {
    vertical-align: middle;
    max-height: 22px;
}

.ca-table-wrap td a:has(img) {
    display: inline-flex;
    padding: .2rem;
    border-radius: 6px;
}

.ca-table-wrap td a:has(img):hover {
    background: var(--ca-info-bg);
}

.ca-table-wrap table > tbody > tr.ca-empty-row > td {
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--ca-muted);
    font-weight: 400;
}

/* ---------- Pager ---------- */

.ca-table-wrap table > tbody > tr.ca-pager > td {
    padding: .75rem 1rem;
    border-bottom: 0;
    background: var(--ca-surface);
    font-weight: 400;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.ca-pager-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.ca-pager-total,
.ca-pager-next {
    flex: 1 1 0;
    color: var(--ca-muted);
    font-size: .8rem;
}

.ca-pager-next {
    display: flex;
    justify-content: flex-end;
}

.ca-pager-next input[type="image"] {
    height: 2rem;
    width: auto;
    padding: .35rem .6rem;
    border: 1px solid var(--ca-border);
    border-radius: 8px;
    background: var(--ca-surface);
}

.ca-pager-next input[type="image"]:hover {
    background: var(--ca-flyout-bg);
    border-color: var(--ca-btn-bg);
}

.ca-table-wrap .pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .3rem;
    margin: 0;
}

.ca-body .ca-table-wrap .pagination a,
.ca-table-wrap .pagination .is-current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 .55rem;
    border-radius: 8px;
    font-size: .82rem;
    font-weight: 500;
    color: var(--ca-text);
    text-decoration: none;
}

.ca-body .ca-table-wrap .pagination a:hover {
    background: var(--ca-flyout-bg);
    color: var(--ca-teal-ink);
    text-decoration: none;
}

.ca-table-wrap .pagination .is-current {
    background: var(--ca-btn-bg);
    color: var(--ca-btn-ink);
    font-weight: 600;
}

/* ---------- Tablet: filters keep wrapping, table scrolls sideways ---------- */

@media screen and (max-width: 63.9375em) {
    .filter-field--export {
        margin-left: 0;
    }
}

/* ---------- Phones: each table row becomes a labelled card ---------- */

@media screen and (max-width: 39.9375em) {

    .page-title {
        font-size: 1.4rem;
    }

    .page-subtitle {
        font-size: .9rem;
    }

    .ca-card {
        padding: .9rem .85rem 1rem;
    }

    .ca-filter table.filter-table > tbody > tr {
        gap: .6rem;
    }

    .filter-field--index,
    .filter-field--apt,
    .filter-field--boro,
    .filter-field--date {
        flex: 1 1 calc(50% - .3rem);
        max-width: none;
    }

    .filter-field--address,
    .filter-field--agent,
    .filter-field--submit,
    .filter-field--export {
        flex: 1 1 100%;
        max-width: none;
    }

    .filter-field--submit .ca-btn,
    .filter-field--export .ca-btn {
        width: 100%;
    }

    .ca-filter input[type="text"],
    .ca-filter select {
        font-size: 16px;   /* stops iOS zooming into the field */
    }

    .ca-table-wrap {
        background: transparent;
        border: 0;
        box-shadow: none;
        overflow: visible;
    }

    .ca-table-wrap table,
    .ca-table-wrap table > tbody {
        display: block;
        min-width: 0;
    }

    .ca-table-wrap table > tbody > tr.ca-head {
        display: none;
    }

    .ca-table-wrap table > tbody > tr,
    .ca-table-wrap table > tbody > tr:nth-child(even) {
        display: block;
        margin-bottom: .75rem;
        padding: .35rem .9rem;
        background: var(--ca-surface);
        border: 1px solid var(--ca-border);
        border-radius: 12px;
        box-shadow: 0 1px 2px rgba(16, 24, 40, .03);
    }

    .ca-table-wrap table > tbody > tr > td,
    .ca-table-wrap table > tbody > tr.alternate > td,
    .ca-table-wrap table > tbody > tr:not(.ca-head):not(.ca-pager):hover > td {
        display: grid;
        grid-template-columns: 6.5rem minmax(0, 1fr);
        gap: .75rem;
        width: auto !important;          /* overrides ItemStyle widths */
        padding: .55rem 0;
        border: 0;
        border-top: 1px solid var(--ca-border);
        background: transparent;
        font-weight: 400;
        white-space: normal;
    }

    /* no divider above the first visible cell of each card */
    .ca-table-wrap table > tbody > tr > td:first-child,
    .ca-table-wrap table > tbody > tr > td.is-empty:first-child + td {
        border-top: 0;
    }

    .ca-table-wrap table > tbody > tr > td::before {
        content: attr(data-label);
        font-size: .68rem;
        font-weight: 600;
        letter-spacing: .06em;
        text-transform: uppercase;
        color: var(--ca-muted);
        padding-top: .15rem;
    }

    .ca-table-wrap table > tbody > tr > td.is-empty {
        display: none;
    }

    /* Index # leads the card. The desktop rule keeps the first cell on one line;
       in a card it must wrap (long addresses, "Total Arrears" / "NOTE" lines). */
    .ca-table-wrap table > tbody > tr > td:first-child {
        font-size: 1rem;
        font-weight: 600;
        white-space: normal;
    }

    .ca-table-wrap table > tbody > tr.ca-pager,
    .ca-table-wrap table > tbody > tr.ca-empty-row {
        padding: 0;
    }

    .ca-table-wrap table > tbody > tr.ca-pager > td,
    .ca-table-wrap table > tbody > tr.ca-empty-row > td {
        display: block;
        padding: .75rem;
        border: 0;
    }

    .ca-table-wrap table > tbody > tr.ca-pager > td::before,
    .ca-table-wrap table > tbody > tr.ca-empty-row > td::before {
        display: none;
    }

    .ca-pager-bar {
        flex-wrap: wrap;
        justify-content: center;
    }

    .ca-pager-total:empty {
        display: none;
    }
}

/* =====================================================================
   Buildings2.aspx
   ===================================================================== */

/* Filters in the page header, top right */
.page-header:has(.page-filters) {
    align-items: flex-start;
}

.page-filters {
    flex: 0 1 auto;
    margin: 0;
    padding: .85rem 1rem 1rem;
}

.page-filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

.page-filter {
    flex: 1 1 200px;
    min-width: 0;
}

.page-filter select {
    width: 100%;
    min-width: 200px;
    height: 2.6rem;
    margin: 0;
    padding-left: .7rem;
    padding-right: 1.8rem;
    border: 1px solid var(--ca-border);
    border-radius: 8px;
    background-color: var(--ca-bg);
    background-position: right -.9rem center;
    box-shadow: none;
    font-size: .88rem;
    color: var(--ca-text);
    cursor: pointer;
}

.page-filter select:focus {
    background-color: #fff;
    border-color: var(--ca-btn-bg-hover);
    box-shadow: 0 0 0 3px rgba(158, 217, 217, .35);
}

/* "View cases" chip in the last column */
.ca-body .ca-table-wrap td a.ca-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .3rem .7rem .3rem .5rem;
    border: 1px solid var(--ca-border);
    border-radius: 999px;
    background: var(--ca-surface);
    color: var(--ca-teal-ink);
    font-size: .8rem;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    transition: background-color .12s ease, border-color .12s ease;
}

.ca-body .ca-table-wrap td a.ca-chip:hover {
    background: var(--ca-flyout-bg);
    border-color: var(--ca-btn-bg);
    text-decoration: none;
}

.ca-table-wrap td a.ca-chip img {
    width: 16px;
    height: 16px;
}

/* Buildings table: fewer columns, so no forced minimum width; Address leads */
.ca-table-wrap--buildings table {
    min-width: 760px;
}

.ca-table-wrap--buildings table > tbody > tr > td:first-child {
    font-weight: 400;
}

.ca-table-wrap--buildings td[data-label="Address"] {
    font-weight: 600;
    color: var(--ca-heading, var(--ca-text));
}

.ca-table-wrap--buildings td[data-label="State"],
.ca-table-wrap--buildings td[data-label="Zip"] {
    white-space: nowrap;
}

@media screen and (max-width: 63.9375em) {
    .page-filters {
        flex: 1 1 100%;
    }
}

@media screen and (max-width: 39.9375em) {
    .page-filters {
        padding: .8rem;
    }

    .page-filter {
        flex: 1 1 100%;
    }

    .page-filter select {
        min-width: 0;
        font-size: 16px;
    }

    /* card: Address first and larger, then the rest */
    .ca-table-wrap--buildings table,
    .ca-table-wrap--buildings table > tbody {
        min-width: 0;
    }

    .ca-table-wrap--buildings table > tbody > tr:not(.ca-head):not(.ca-pager):not(.ca-empty-row) {
        display: flex;
        flex-direction: column;
    }

    .ca-table-wrap--buildings table > tbody > tr > td[data-label="Address"],
    .ca-table-wrap--buildings table > tbody > tr.alternate > td[data-label="Address"] {
        order: -1;
        border-top: 0;
        font-size: 1rem;
        font-weight: 600;
    }

    .ca-table-wrap--buildings table > tbody > tr > td:first-child {
        border-top: 1px solid var(--ca-border);
        font-size: inherit;
    }
}

/* =====================================================================
   Reports (report2.master + /Reports/*2.aspx)
   Opened in their own tab from the dashboard; no side rail.
   ===================================================================== */

html:has(body.ca-report) {
    background: var(--ca-bg);
}

body.ca-report {
    background: var(--ca-bg);
    min-height: 100vh;
}

/* ---------- Brand bar ---------- */

.rpt-brand {
    background: var(--ca-surface);
    border-bottom: 1px solid var(--ca-border);
}

.rpt-brand-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: .7rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.rpt-logo {
    display: block;
    height: 44px;
    width: auto;
}

.rpt-brand-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.ca-body .rpt-brand-actions .ca-btn {
    min-height: 2.1rem;
    padding: .35rem .85rem;
    font-size: .72rem;
}

/* ---------- Page body ---------- */

.rpt-main {
    max-width: 1180px;
    margin: 0 auto;
    padding: 1.75rem 1.5rem 2.5rem;
}

.rpt-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem 2rem;
    margin-bottom: 1.25rem;
}

.rpt-kicker {
    margin: 0 0 .25rem;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ca-teal-ink);
}

.rpt-title {
    margin: 0;
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.005em;
}

.rpt-title a {
    font-size: .9rem;
    font-weight: 600;
    margin-left: .5rem;
}

.rpt-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem 1.25rem;
    margin: .45rem 0 0;
    font-size: .88rem;
    color: var(--ca-muted);
}

.rpt-meta > span:empty {
    display: none;
}

.rpt-meta > span::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: .4rem;
    vertical-align: -2px;
    background: currentColor;
    -webkit-mask: var(--icon) center / contain no-repeat;
            mask: var(--icon) center / contain no-repeat;
}

.rpt-date  { --icon: var(--icon-calendar); }
.rpt-agent { --icon: var(--icon-buildings); }

.rpt-head-actions {
    display: flex;
    gap: .6rem;
}

/* status messages ("Your data has been updated…") — shown by js/caseact2.js when filled */
.rpt-flash {
    display: none;
    margin: 0 0 1.25rem;
    padding: .8rem 1rem .8rem 2.6rem;
    border: 1px solid #cfe8e5;
    border-radius: 10px;
    background: #eef8f6 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233f7f87' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='m8.5 12 2.5 2.5 4.5-5'/%3E%3C/svg%3E") .9rem center / 18px no-repeat;
    font-size: .9rem;
    color: var(--ca-teal-dark);
}

.rpt-flash.is-shown { display: block; }

.rpt-flash.is-warning {
    border-color: #f3dfb0;
    background-color: #fff8e6;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b07d00' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 3.9 2.6 17.5A2 2 0 0 0 4.3 20.5h15.4a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z'/%3E%3Cpath d='M12 9v4.5M12 17h.01'/%3E%3C/svg%3E");
    color: #7a5600;
}

/* the pages colour these messages red inline; the banner does the work instead */
.rpt-flash span[style] { color: inherit !important; }

.rpt-intro {
    margin: 0 0 1.25rem;
    padding: 1rem 1.15rem;
    border: 1px solid var(--ca-border);
    border-radius: 12px;
    background: var(--ca-surface);
    font-size: .9rem;
    line-height: 1.6;
}

.rpt-intro:empty { display: none; }

.rpt-intro p { margin: 0 0 .5rem; }
.rpt-intro p:last-child { margin-bottom: 0; }

.rpt-note {
    margin: 1rem 0 0;
    text-align: center;
    font-size: .9rem;
    font-style: italic;
    color: var(--ca-muted);
}

.rpt-note:empty { display: none; }

.rpt-disclaimer {
    margin-top: 1.5rem;
    font-size: .78rem;
    line-height: 1.7;
    color: var(--ca-faint);
}

.rpt-disclaimer:empty { display: none; }

/* bottom action bar: sits under the table, and sticks to the bottom of the screen on phones */
.rpt-actions {
    display: flex;
    justify-content: flex-end;
    gap: .6rem;
    margin-top: 1.25rem;
}

/* hide an action bar when the server has hidden its buttons
   (the always-present hidden "btnDisableEnter" button does not count) */
.rpt-actions:not(:has(input[type="submit"]:not([style*="none"]), button, a)) { display: none; }

.rpt-actions--top {
    margin: 0 0 1rem;
}

/* ---------- Report tables ---------- */

.rpt-table table {
    min-width: 720px;
}

.rpt-table td input[type="text"],
.rpt-table td input:not([type]) {
    width: 100%;
    min-width: 7rem;
    max-width: 12rem;
    height: 2.3rem;
    margin: 0;
    padding: 0 .6rem;
    border: 1px solid var(--ca-border);
    border-radius: 7px;
    background: var(--ca-bg);
    box-shadow: none;
    font-size: .88rem;
}

.rpt-table td input[type="text"]:focus,
.rpt-table td input:not([type]):focus {
    background: #fff;
    border-color: var(--ca-btn-bg-hover);
    box-shadow: 0 0 0 3px rgba(158, 217, 217, .35);
}

.ca-body .rpt-table input[type="checkbox"],
.ca-body .rpt-table input[type="radio"],
.ca-body .rpt-case input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0 .35rem 0 0;
    vertical-align: -4px;
    accent-color: var(--ca-teal);
    cursor: pointer;
}

/* rows written from page code inside a record (second tenant, Billto, spacers) */
.ca-table-wrap table > tbody > tr.ca-spacer { display: none; }

.ca-table-wrap table > tbody > tr.has-subrow > td {
    border-bottom: 0;
}

.ca-table-wrap table > tbody > tr.ca-subrow > td {
    padding-top: .15rem;
    padding-bottom: .6rem;
    font-size: .82rem;
    color: var(--ca-muted);
    font-weight: 400;
}

.ca-table-wrap table > tbody > tr.ca-subrow > td[style*="lightblue"] {
    background: #eaf6f6 !important;
    color: var(--ca-teal-ink);
    font-weight: 600;
}

/* Payments Due: the "NOTE: ..." line under a case is an instruction, not a hint;
   keep it full-strength so it doesn't read as greyed out (desktop + phone) */
.ca-table-wrap table > tbody > tr.ca-subrow > td.ca-note,
.rpt-table td.ca-note {
    color: var(--ca-text);
    font-weight: 700;
}

/* larger index numbers on the marshal reports */
.rpt-table .larger {
    font-size: 1rem;
    font-weight: 700;
}

/* ---------- Case cards (Expired Rent Demand) ---------- */

.rpt-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.rpt-case {
    background: var(--ca-surface);
    border: 1px solid var(--ca-border);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .03);
    overflow: hidden;
}

.rpt-case-head {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
    gap: .75rem 1.25rem;
    padding: 1rem 1.15rem;
}

.rpt-case-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.3;
}

.rpt-case-sub {
    margin: .2rem 0 0;
    font-size: .85rem;
    color: var(--ca-muted);
}

.rpt-field-label {
    display: block;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ca-muted);
    margin-bottom: .15rem;
}

.rpt-field-value {
    font-size: .9rem;
}

.rpt-case-arrears {
    padding: .65rem 1.15rem;
    background: var(--ca-bg);
    border-top: 1px solid var(--ca-border);
    font-size: .88rem;
}

.rpt-case-arrears i { font-style: normal; }

.rpt-case-choice {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .6rem;
    padding: .85rem 1.15rem;
    border-top: 1px solid var(--ca-border);
}

.rpt-case-arrears-panel {
    padding: 0 1.15rem 1.1rem;
    border-top: 1px solid var(--ca-border);
}

/* the month boxes (RentBox) are added as table cells, four to a row */
.rpt-rentgrid,
.rpt-rentgrid > tbody {
    display: block;
    width: 100%;
    margin: 0;
    border: 0;
    background: transparent;
}

.rpt-rentgrid > tbody > tr {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .6rem;
    margin-top: .75rem;
    background: transparent !important;
    border: 0;
}

.rpt-rentgrid > tbody > tr:empty { display: none; }

.rpt-rentgrid > tbody > tr > td {
    display: block;
    padding: .6rem .7rem;
    border: 1px solid var(--ca-border);
    border-radius: 10px;
    background: var(--ca-bg);
    font-size: .82rem;
}

.rpt-rentgrid > tbody > tr > td[colspan] {
    grid-column: 1 / -1;
    border: 0;
    background: transparent;
    padding: .25rem 0 0;
    font-size: .9rem;
}

.rpt-rentgrid input[type="text"],
.rpt-rentgrid select {
    width: 100%;
    height: 2.2rem;
    margin: .25rem 0 0;
    padding: 0 .55rem;
    border: 1px solid var(--ca-border);
    border-radius: 7px;
    background: #fff;
    box-shadow: none;
    font-size: .88rem;
}

.rpt-rentgrid td[colspan] input[type="text"] {
    display: inline-block;
    width: auto;
    max-width: 10rem;
    font-weight: 700;
    background: var(--ca-flyout-bg);
}

/* ---------- "You must complete this page" step ---------- */

.rpt-confirm {
    max-width: 720px;
    margin: 0 auto;
    padding: 1.5rem;
    background: var(--ca-surface);
    border: 1px solid var(--ca-border);
    border-radius: 14px;
    box-shadow: 0 6px 24px rgba(16, 24, 40, .06);
}

.rpt-confirm-badge {
    display: inline-block;
    margin-bottom: 1rem;
    padding: .35rem .7rem;
    border-radius: 999px;
    background: #fff1e8;
    color: #c24d00;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.ca-body .rpt-preview {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .9rem 1rem;
    margin-bottom: 1.25rem;
    border: 1px dashed var(--ca-btn-bg-hover);
    border-radius: 12px;
    background: var(--ca-flyout-bg);
    color: var(--ca-teal-dark);
    font-weight: 600;
    text-decoration: none;
}

.rpt-preview img {
    width: 36px;
    height: 36px;
}

.rpt-confirm-check {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    margin: 1.25rem 0;
    font-size: .92rem;
    cursor: pointer;
}

.rpt-confirm-check input {
    width: 20px;
    height: 20px;
    margin: .1rem 0 0;
    flex: none;
    accent-color: var(--ca-teal);
}

.rpt-confirm .rpt-actions {
    justify-content: center;
}

/* ---------- Footer ---------- */

.rpt-foot {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 1.5rem 2rem;
    font-size: .74rem;
    color: #a3adb9;
}

/* ---------- Reports: tablet ---------- */

@media screen and (max-width: 63.9375em) {
    .rpt-case-head {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rpt-case-head > :first-child {
        grid-column: 1 / -1;
    }
}

/* ---------- Reports: phone ---------- */

@media screen and (max-width: 39.9375em) {
    .rpt-brand-inner {
        padding: .55rem 1rem;
    }

    .rpt-logo {
        height: 34px;
    }

    .rpt-print {
        display: none !important;
    }

    .rpt-main {
        padding: 1.25rem 1rem 1.5rem;
    }

    .rpt-title {
        font-size: 1.35rem;
    }

    /* top submit is repeated at the bottom; on phones only the sticky bottom one shows */
    .rpt-head-actions {
        display: none;
    }

    .rpt-actions {
        position: sticky;
        bottom: 0;
        z-index: 20;
        margin: 1rem -1rem 0;
        padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, .94);
        -webkit-backdrop-filter: blur(6px);
                backdrop-filter: blur(6px);
        border-top: 1px solid var(--ca-border);
    }

    .rpt-actions .ca-btn,
    .rpt-actions input[type="submit"] {
        flex: 1;
    }

    .rpt-table table {
        min-width: 0;
    }

    .rpt-table td input[type="text"],
    .rpt-table td input:not([type]) {
        max-width: none;
        font-size: 16px;
    }

    /* cells right-aligned on desktop (Balance) read left-to-right in the card */
    .ca-table-wrap table > tbody > tr > td[align],
    .ca-table-wrap table > tbody > tr > td[style*="text-align"] {
        text-align: left !important;
    }

    /* subrows join the card above */
    .ca-table-wrap table > tbody > tr.has-subrow {
        margin-bottom: 0;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        border-bottom: 0;
    }

    .ca-table-wrap table > tbody > tr.ca-subrow {
        margin-top: 0;
        padding-top: 0;
        border-top: 0;
        border-top-left-radius: 0;
        border-top-right-radius: 0;
    }

    .ca-table-wrap table > tbody > tr.ca-subrow.has-subrow {
        border-radius: 0;
    }

    .ca-table-wrap table > tbody > tr.ca-subrow > td,
    .ca-table-wrap table > tbody > tr.ca-subrow:nth-child(even) > td {
        display: block;
        padding: .45rem 0;
        border-top: 1px dashed var(--ca-border);
        /* note lines ("Total Arrears: ...", "NOTE: ...") are the row's first cell, which the
           desktop Index # rule sets to nowrap; let them wrap inside the card */
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .ca-table-wrap table > tbody > tr.ca-subrow > td::before {
        display: none;
    }

    .ca-table-wrap table > tbody > tr.ca-subrow > td:not(:has(*)):empty,
    .ca-table-wrap table > tbody > tr.ca-subrow > td.is-empty {
        display: none;
    }

    .ca-table-wrap table > tbody > tr.ca-subrow > td[style*="lightblue"] {
        display: block;
        margin: .4rem -.9rem -.35rem;
        padding: .55rem .9rem;
        border-radius: 0 0 12px 12px;
    }

    .rpt-case-head {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: .9rem;
    }

    .rpt-case-arrears,
    .rpt-case-choice,
    .rpt-case-arrears-panel {
        padding-left: .9rem;
        padding-right: .9rem;
    }

    .rpt-case-choice .rpt-pill {
        flex: 1 1 100%;
    }

    .rpt-actions--top {
        display: none !important;
    }

    .rpt-rentgrid > tbody > tr {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rpt-confirm {
        padding: 1.1rem;
    }
}

@media print {
    .rpt-brand-actions,
    .rpt-actions,
    .rpt-head-actions {
        display: none !important;
    }

    body.ca-report,
    .rpt-main {
        background: #fff;
    }
}

/* ---------- Report controls ---------- */

/* choice pills: <label class="rpt-pill"><input type=radio><span>…</span></label>
   and asp:RadioButton with CssClass="rpt-pill" (<span><input><label>…</label></span>) */
.rpt-choice {
    display: inline-flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.rpt-pill {
    display: inline-flex;
    align-items: center;
    gap: .1rem;
    margin: 0;
    padding: .45rem .85rem .45rem .7rem;
    border: 1px solid var(--ca-border);
    border-radius: 999px;
    background: var(--ca-surface);
    font-size: .88rem;
    line-height: 1.2;
    color: var(--ca-text);
    cursor: pointer;
    white-space: nowrap;
    transition: background-color .12s ease, border-color .12s ease;
}

.rpt-pill:hover {
    border-color: var(--ca-btn-bg);
}

.rpt-pill:has(input:checked) {
    background: var(--ca-flyout-bg);
    border-color: var(--ca-btn-bg-hover);
    color: var(--ca-teal-dark);
    font-weight: 600;
}

.rpt-pill label,
.rpt-pill span {
    margin: 0;
    font-size: inherit;
    color: inherit;
    cursor: pointer;
}

.rpt-pill input[type="radio"] {
    margin-right: .4rem !important;
}

.rpt-check {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    margin: 0;
    font-size: .88rem;
    cursor: pointer;
}

/* the word is only needed on phones, where there is no column heading */
.rpt-check span {
    display: none;
}

.rpt-money {
    position: relative;
    display: inline-block;
}

.rpt-money::before {
    content: "$";
    position: absolute;
    left: .6rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: .88rem;
    color: var(--ca-muted);
    pointer-events: none;
}

.rpt-table .rpt-money input[type="text"] {
    padding-left: 1.3rem;
    text-align: right;
}

.rpt-table--wide table {
    min-width: 960px;
}

.rpt-table--wide table > tbody > tr > td,
.rpt-table--wide table > tbody > tr > th {
    padding-left: .6rem;
    padding-right: .6rem;
}

/* Report tables fit the page instead of scrolling sideways: long addresses and
   types wrap. (The case and building lists keep their 1080px table.) The table
   still scrolls on screens too narrow for it, before the phone card layout. */
.rpt-table:not(.rpt-table--wide) table {
    min-width: 0;
}

.ca-table-wrap.rpt-table table > tbody > tr > td:first-child,
.ca-table-wrap.rpt-table td[data-label^="Type"] {
    white-space: normal;
}

.rpt-apt {
    display: inline-block;
    margin-left: .35rem;
    padding: .1rem .45rem;
    border-radius: 5px;
    background: var(--ca-info-bg);
    font-size: .78rem;
    font-weight: 600;
    color: var(--ca-muted);
    vertical-align: 2px;
}

.rpt-empty {
    padding: 2.5rem 1rem;
    border: 1px dashed var(--ca-border);
    border-radius: 12px;
    background: var(--ca-surface);
    text-align: center;
    color: var(--ca-muted);
}

/* "Arrears History" heading row is written after the month boxes; show it first */
.rpt-rentgrid > tbody {
    display: flex;
    flex-direction: column;
}

.rpt-rentgrid > tbody > tr:has(> td[colspan] > b):not(:has(input)) {
    order: -1;
}

@media screen and (max-width: 39.9375em) {
    .rpt-check span {
        display: inline;
    }

    .rpt-table--wide table {
        min-width: 0;
    }

    .rpt-choice {
        display: flex;
        width: 100%;
    }

    .rpt-choice .rpt-pill {
        flex: 1;
        justify-content: center;
    }

    .rpt-money,
    .rpt-table .rpt-money input[type="text"] {
        display: block;
        width: 100%;
        text-align: left;
    }
}

/* Details link on a card with no report for this user */
.ca-body .dash-details.is-disabled,
.ca-body .dash-details.is-disabled:hover {
    color: #b3bcc6;
    text-decoration: none;
    cursor: default;
}

/* ---------- Month boxes from Controls/RentBox.ascx ----------
   Each box is a <td> written by RentBox; js/caseact2.js adds the classes used here. */

.rpt-rentgrid > tbody > tr {
    align-items: start;
}

.rpt-rentgrid td.rb {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    padding: .65rem .7rem .7rem;
    vertical-align: top;
}

.rb-month {
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--ca-muted);
}

.rpt-rentgrid .rpt-money {
    display: block;
    width: 100%;
}

.rpt-rentgrid td.rb input[type="text"] {
    width: 100% !important;            /* RentBox sets 100px / 80px inline */
    margin: 0;
    padding-left: 1.3rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.rpt-rentgrid .rpt-money.is-readonly input {
    background: var(--ca-info-bg);
    color: var(--ca-muted);
}

.ca-body .rpt-rentgrid a.rb-add {
    align-self: flex-start;
    padding: .2rem .55rem;
    border: 1px dashed var(--ca-btn-bg-hover);
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 600;
    color: var(--ca-teal-ink);
    text-decoration: none;
    cursor: pointer;
}

.ca-body .rpt-rentgrid a.rb-add:hover {
    background: var(--ca-flyout-bg);
}

/* "Additional Charges" (hidden until "+ Add charge" is clicked) */
.rpt-rentgrid .rb-charges {
    margin-top: .2rem;
    padding: .55rem;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--ca-border);
    font-size: .76rem;
}

.rpt-rentgrid .rb-charges > b {
    display: block;
    margin-bottom: .3rem;
    font-weight: 600;
    color: var(--ca-text);
}

.rpt-rentgrid .rb-charges > br {
    display: none;
}

.rpt-rentgrid .rb-charges select {
    width: 100%;
    height: 2.1rem;
    margin: 0 0 .35rem;
    padding: 0 1.6rem 0 .5rem;
    border: 1px solid var(--ca-border);
    border-radius: 7px;
    font-size: .82rem;
    background-color: var(--ca-bg);
}

/* validator messages written by RentBox ("Rent must be numeric.") */
.rpt-rentgrid td.rb span[style*="color"],
.rpt-rentgrid td.rb span[style*="color"] span {
    font-size: .74rem;
    color: var(--ca-alert-ink) !important;
}

/* New Arrears total */
.rpt-rentgrid > tbody > tr > td.rb-total {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .6rem;
    padding: .75rem .9rem;
    border: 1px solid var(--ca-btn-bg);
    border-radius: 10px;
    background: var(--ca-flyout-bg);
}

.rpt-rentgrid td.rb-total .rpt-money {
    display: inline-block;
    width: auto;
}

.rpt-rentgrid td.rb-total input[type="text"] {
    width: 9rem !important;
    padding-left: 1.3rem;
    text-align: right;
    font-weight: 700;
    color: var(--ca-text);
    background: #fff;
}

/* =====================================================================
   Forms (AddCase2.aspx and later form pages)
   ===================================================================== */

.ca-form-page {
    max-width: 920px;
}

.form-intro {
    margin: -.5rem 0 1.25rem;
    color: var(--ca-muted);
    font-size: .95rem;
}

/* required-field asterisk, in the site teal */
.req {
    color: var(--ca-teal);
    font-weight: 700;
}

.form-optional {
    margin-left: .35rem;
    padding: .1rem .45rem;
    border-radius: 5px;
    background: var(--ca-info-bg);
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--ca-muted);
    vertical-align: 2px;
}

.form-section {
    padding: 1.25rem 1.35rem 1.4rem;
    margin-bottom: 1.25rem;
}

.form-section-title {
    margin: 0 0 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.form-subtitle {
    margin: 1.25rem 0 .6rem;
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--ca-muted);
}

.form-subsection {
    margin-top: 1.25rem;
    padding-top: .25rem;
    border-top: 1px solid var(--ca-border);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .9rem 1rem;
}

.form-field {
    min-width: 0;
}

.form-field--wide {
    grid-column: 1 / -1;
}

/* small fields sit two-up but at a sensible width */
.form-field--sm input[type="text"] {
    max-width: 14rem;
}

.ca-form input[type="text"],
.ca-form select {
    width: 100%;
    height: 2.7rem;
    margin: 0;
    padding: 0 .75rem;
    border: 1px solid var(--ca-border);
    border-radius: 8px;
    background-color: var(--ca-bg);
    box-shadow: none;
    font-size: .92rem;
    color: var(--ca-text);
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.ca-form select {
    padding-right: 2rem;
    background-position: right -.8rem center;
    cursor: pointer;
}

.ca-form input[type="text"]:focus,
.ca-form select:focus {
    background-color: #fff;
    border-color: var(--ca-btn-bg-hover);
    box-shadow: 0 0 0 3px rgba(158, 217, 217, .35);
}

.ca-form .rpt-money {
    display: block;
}

.ca-form .rpt-money input[type="text"] {
    padding-left: 1.5rem;
}

.ca-form .rpt-money::before {
    left: .75rem;
}

/* validator messages ("Apt # is required") written as red spans; shown in teal */
.ca-form span[style*="color"],
.ca-form span[style*="color"] span {
    display: inline-block;
    margin-top: .3rem;
    font-size: .78rem;
    color: var(--ca-alert-ink) !important;
}

.ca-form span[style*="display:none"],
.ca-form span[style*="display: none"] {
    display: none !important;
}

/* validators start their message with a <br>; the layout already stacks it */
.ca-form span[style*="color"] > br {
    display: none;
}

.form-help {
    margin-top: .85rem;
    font-size: .84rem;
    line-height: 1.6;
    color: var(--ca-muted);
}

.form-help:not(:has(*)):empty {
    display: none;
}

.form-callout {
    margin: 1rem 0 0;
    padding: .7rem .9rem .7rem 2.4rem;
    border-radius: 10px;
    background: #fff8e6 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b07d00' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M12 8v5M12 16h.01'/%3E%3C/svg%3E") .8rem center / 17px no-repeat;
    border: 1px solid #f3dfb0;
    font-size: .88rem;
    font-weight: 600;
    color: #7a5600;
}

/* month boxes on this form come three to a row */
.rpt-rentgrid--3 > tbody > tr {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* ---------- Generate / post ---------- */

.form-submit {
    margin-top: .5rem;
}

.form-notes {
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
    font-size: .84rem;
    line-height: 1.6;
    color: var(--ca-muted);
}

.form-notes li {
    position: relative;
    padding-left: 1.1rem;
    margin-bottom: .4rem;
}

.form-notes li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .62em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ca-btn-bg-hover);
}

.form-disclaimer {
    font-size: .8rem;
    color: var(--ca-faint);
    margin-bottom: 1rem;
}

.form-disclaimer:empty {
    display: none;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .9rem;
    padding: 1.1rem 1.25rem;
    border: 1px solid var(--ca-border);
    border-radius: 12px;
    background: var(--ca-surface);
}

.form-actions:not(:has(input[type="submit"])) {
    display: none;
}

.form-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    flex: 1 1 260px;
}

.form-action .ca-btn,
.form-actions--post .ca-btn {
    width: 100%;
    white-space: normal;
}

.form-actions--post {
    margin-top: 1rem;
}

.ca-body .form-more {
    font-size: .78rem;
    font-weight: 600;
    color: var(--ca-teal-ink);
}

.form-next {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
}

/* ---------- Confirm step ---------- */

.form-confirm {
    margin: 0 0 1.5rem;
}

.form-accept {
    padding: .85rem 1rem;
    border: 1px solid var(--ca-border);
    border-radius: 10px;
    background: var(--ca-bg);
}

.form-accept input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: .1rem .6rem 0 0;
    flex: none;
    accent-color: var(--ca-teal);
}

.form-accept label {
    margin: 0;
    font-size: .92rem;
    line-height: 1.45;
    color: var(--ca-text);
    cursor: pointer;
}

.form-back {
    margin: 1rem 0 0;
    text-align: center;
    font-size: .85rem;
    color: var(--ca-muted);
}

/* ---------- Forms: phone ---------- */

@media screen and (max-width: 39.9375em) {
    .form-section {
        padding: 1rem;
    }

    .form-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .form-field--sm input[type="text"] {
        max-width: none;
    }

    .ca-form input[type="text"],
    .ca-form select {
        font-size: 16px;
    }

    .rpt-rentgrid--3 > tbody > tr {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-actions {
        padding: .9rem;
    }
}

@media screen and (max-width: 39.9375em) {
    /* long labels ("Generate 5-Day Rent Demand and Send") must fit: input buttons cannot wrap */
    .form-action {
        flex: 1 1 100%;
        min-width: 0;
    }

    .ca-body .form-action input.ca-btn,
    .ca-body .form-actions--post input.ca-btn {
        padding-left: .5rem;
        padding-right: .5rem;
        font-size: .7rem;
        letter-spacing: .01em;
    }
}

.ca-form .ca-label,
.ca-body .ca-form label.ca-label {
    font-size: .82rem;
    margin-bottom: .35rem;
}

/* =====================================================================
   Reports: warrant / marshal additions
   (OrderWarrant2, HoldWarrant2, RemailServe2, SetEviction2, VerifyEviction2…)
   ===================================================================== */

/* ---------- Callouts and document previews (Order Warrant confirm step) ---------- */

.rpt-callout {
    margin: 0 0 1.25rem;
    padding: .85rem 1rem;
    border-left: 4px solid #e8a33d;
    border-radius: 0 10px 10px 0;
    background: #fff8e6;
    font-size: .9rem;
    line-height: 1.55;
    color: #5c4300;
}

.rpt-callout--plain:empty,
.rpt-callout--plain:not(:has(*)):not(:has(> b)) {
    display: none;
}

.rpt-previews {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: .75rem;
    margin-bottom: 1.25rem;
}

.rpt-previews .rpt-preview,
.rpt-preview-item .rpt-preview {
    margin-bottom: 0;
    height: 100%;
}

.rpt-preview-item {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.rpt-preview-note {
    padding-left: .25rem;
    font-size: .76rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: #b45a00;
}

.ca-body .rpt-preview--alert {
    border-color: #f0c48a;
    background: #fff8ee;
    color: #8a4b00;
}

.ca-body .rpt-preview:hover {
    border-style: solid;
    text-decoration: none;
}

/* ---------- Radio choices written straight into grid cells (YES / DISCONTINUE / Hold) ---------- */

.rpt-table td:has(> .ca-cell > input[type="radio"]),
.rpt-table td:has(> input[type="radio"]) {
    line-height: 2;
    white-space: nowrap;
}

.rpt-table td input[type="radio"] + input[type="text"],
.rpt-table td .ca-cell > input[type="text"] {
    display: inline-block;
    width: 9rem;
    vertical-align: middle;
}

/* ---------- Highlight banner rows (specialty / "Monday eviction") ---------- */

.ca-table-wrap td.rpt-flag,
.ca-table-wrap table > tbody > tr > td.rpt-flag {
    padding: .45rem .8rem;
    background: #fff4d1 !important;
    color: #6b4e00 !important;
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    border-bottom: 1px solid #f3e1a6;
}

/* ---------- Input blocks nested inside the grid rows ---------- */

.ca-table-wrap table.ca-nested {
    width: auto;
    min-width: 0;
    margin: 0;
    border: 0 !important;
    border-collapse: collapse !important;
    background: transparent;
    font-size: .84rem;
}

.ca-table-wrap table.ca-nested-top {
    padding: .35rem .25rem;
}

.ca-table-wrap table.ca-nested > tbody > tr,
.ca-table-wrap table.ca-nested > tbody > tr:nth-child(even) {
    background: transparent !important;
}

.ca-table-wrap table.ca-nested > tbody > tr > td {
    display: table-cell;
    padding: .25rem .6rem .25rem 0 !important;
    border: 0 !important;
    background: transparent !important;
    vertical-align: middle;
    white-space: nowrap;
    font-weight: 400;
    color: var(--ca-text);
}

.ca-table-wrap table.ca-nested > tbody > tr > td::before {
    display: none !important;
}

.ca-table-wrap table.ca-nested i {
    font-style: normal;
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--ca-muted);
}

/* the cell around an input block reads as a soft panel */
.ca-table-wrap table > tbody > tr > td:has(> table.ca-nested-top),
.ca-table-wrap table > tbody > tr > td:has(> .ca-cell > table.ca-nested-top) {
    background: #f7fafb;
}

.ca-table-wrap tr:not(.ca-head):hover > td:has(> table.ca-nested-top) {
    background: #f1f7f8;
}

.ca-table-wrap table.ca-nested select {
    width: auto;
    height: 2.3rem;
    margin: 0;
    padding: 0 2rem 0 .6rem;
    border: 1px solid var(--ca-border);
    border-radius: 7px;
    background-color: var(--ca-bg);
    font-size: .85rem;
}

.ca-table-wrap table.ca-nested td input[type="text"],
.ca-table-wrap table.ca-nested td input:not([type]) {
    width: 9rem;
    min-width: 0;
}

.ca-table-wrap table.ca-nested td input[size="30"] {
    width: 18rem;
    max-width: 100%;
}

/* subrows that hold inputs keep normal text colour */
.ca-table-wrap table > tbody > tr.ca-subrow:has(input, select) > td {
    color: var(--ca-text);
    font-size: .85rem;
}

/* ---------- Phones ---------- */

@media screen and (max-width: 39.9375em) {

    .ca-table-wrap table.ca-nested,
    .ca-table-wrap table.ca-nested > tbody {
        display: block;
        width: 100%;
    }

    .ca-table-wrap table.ca-nested > tbody > tr,
    .ca-table-wrap table.ca-nested > tbody > tr:nth-child(even) {
        display: flex !important;
        flex-wrap: wrap;
        align-items: center;
        gap: .35rem .6rem;
        margin: 0 !important;
        padding: .2rem 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    .ca-table-wrap table.ca-nested > tbody > tr > td {
        display: block !important;
        padding: 0 !important;
        white-space: normal;
    }

    /* label + input pairs: label takes a fixed column, input the rest */
    .ca-table-wrap table.ca-nested > tbody > tr > td:has(> i),
    .ca-table-wrap table.ca-nested > tbody > tr > td:not(:has(input, select, table)) {
        flex: 0 0 8.5rem;
    }

    .ca-table-wrap table.ca-nested > tbody > tr > td:has(input, select) {
        flex: 1 1 calc(100% - 9.5rem);
        min-width: 0;
    }

    .ca-table-wrap table.ca-nested-top > tbody > tr > td:has(> table.ca-nested) {
        flex: 1 1 100%;
    }

    .ca-table-wrap table.ca-nested td input[type="text"],
    .ca-table-wrap table.ca-nested td input:not([type]),
    .ca-table-wrap table.ca-nested td input[size="30"],
    .ca-table-wrap table.ca-nested select {
        width: 100%;
        max-width: none;
        font-size: 16px;
    }

    .ca-table-wrap table > tbody > tr > td:has(> table.ca-nested-top),
    .ca-table-wrap table > tbody > tr > td:has(> .ca-cell > table.ca-nested-top) {
        background: transparent;
    }

    .ca-table-wrap table > tbody > tr > td.rpt-flag {
        display: block;
        margin: 0 -.9rem;
        padding: .5rem .9rem !important;
        border-top: 0 !important;
    }

    .ca-table-wrap table > tbody > tr > td.rpt-flag::before {
        display: none;
    }

    .rpt-table td:has(> .ca-cell > input[type="radio"]),
    .rpt-table td:has(> input[type="radio"]) {
        white-space: normal;
    }

    .rpt-previews {
        grid-template-columns: 1fr;
    }
}

@media print {
    .ca-table-wrap td.rpt-flag {
        background: #fff4d1 !important;
        -webkit-print-color-adjust: exact;
                print-color-adjust: exact;
    }
}

/* "Unable to Process:<br><br>" — the breaks only padded the old layout */
.ca-table-wrap table.ca-nested td > i + br,
.ca-table-wrap table.ca-nested td > i + br + br {
    display: none;
}

.rpt-table td input[type="radio"] ~ input[type="radio"] {
    margin-left: .9rem;
}

/* =====================================================================
   Login2.aspx — frosted sign-in card over the building photo (Login 11.17 design)
   Swap /images/ca2-login-bg.jpg for another photo (same name) at any time.
   ===================================================================== */

html:has(body.ca-login) {
    background: #8fa9bd;
}

body.ca-login {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    /* a soft white haze on the left, so the card reads against the sky */
    background:
        linear-gradient(90deg, rgba(240, 244, 248, .45) 0%, rgba(240, 244, 248, .2) 30%, rgba(240, 244, 248, 0) 52%),
        #8fa9bd url("../images/ca2-login-bg.jpg") 60% 100% / cover no-repeat;
}

.login-scene {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 3rem 1.5rem 5.5rem 9.4vw;   /* sits a little above centre, as in the design */
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

/* ---------- Card ---------- */

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 2rem 1.9rem 1.9rem;
    background: rgba(236, 239, 243, .9);
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 20px;
    box-shadow: 0 18px 50px rgba(20, 32, 44, .22), 0 1px 3px rgba(20, 32, 44, .08);
    text-align: center;
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .login-card {
        background: rgba(236, 239, 243, .62);
        -webkit-backdrop-filter: blur(18px) saturate(1.1);
                backdrop-filter: blur(18px) saturate(1.1);
    }
}

.login-logo {
    display: block;
    width: auto;
    height: 92px;
    margin: 0 auto 1.1rem;
}

.ca-body .login-title {
    margin: 0;
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -.015em;
    line-height: 1.2;
    color: var(--ca-text);
}

.login-sub {
    margin: .55rem 0 1.4rem;
    font-size: .92rem;
    color: var(--ca-text);
}

/* the Login control still wraps its template in a table: make it a plain block */
.login-control,
.login-control > tbody,
.login-control > tbody > tr,
.login-control > tbody > tr > td {
    display: block;
    width: 100% !important;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent !important;
}

.login-control {
    text-align: left;
}

.login-error {
    margin: 0 0 1rem;
    padding: .7rem .9rem;
    border: 1px solid var(--ca-alert-border);
    border-left: 4px solid var(--ca-alert);
    border-radius: 8px;
    background: rgba(255, 255, 255, .85);
    color: var(--ca-alert-ink);
    font-size: .86rem;
    line-height: 1.45;
}

.login-error:empty { display: none; }

.login-field {
    margin-bottom: 1rem;
}

.ca-body .login-field label {
    display: block;
    margin: 0 0 .45rem;
    font-size: .88rem;
    font-weight: 500;
    color: var(--ca-text);
}

.ca-body .login-input input[type="text"],
.ca-body .login-input input[type="password"] {
    width: 100%;
    height: 2.9rem;
    margin: 0;
    padding: 0 1rem;
    border: 1px solid #d9dee5;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
    font-family: var(--ca-font);
    font-size: 1rem;
    color: var(--ca-text);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.ca-body .login-input input::placeholder {
    color: #9aa5b1;
    opacity: 1;
}

.ca-body .login-input input:focus {
    border-color: var(--ca-btn-bg-hover);
    box-shadow: 0 0 0 4px rgba(158, 217, 217, .4);
    outline: none;
}

.ca-body .login-req {
    display: block;
    margin-top: .35rem;
    font-size: .78rem;
    font-weight: 500;
}

.login-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem 1rem;
    margin: 1.6rem 0 1.5rem;
    font-size: .86rem;
}

.ca-body .login-remember {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin: 0;
    font-size: .86rem;
    font-weight: 500;
    color: var(--ca-text);
    cursor: pointer;
}

.login-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--ca-btn-bg-hover);
    cursor: pointer;
}

.ca-body a.login-lost {
    font-weight: 500;
    color: var(--ca-text);
    text-decoration: none;
}

.ca-body a.login-lost:hover {
    color: var(--ca-teal-ink);
    text-decoration: underline;
}

.ca-body input.ca-btn.login-submit {
    width: 100%;
    min-height: 2.9rem;
    border-radius: 10px;
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

/* ---------- Tablets and phones: card centred ---------- */

@media screen and (max-width: 63.9375em) {
    .login-scene {
        justify-content: center;
        padding: 2.5rem 1.25rem;
    }

    body.ca-login {
        background:
            linear-gradient(180deg, rgba(240, 244, 248, .25) 0%, rgba(240, 244, 248, 0) 60%),
            #8fa9bd url("../images/ca2-login-bg.jpg") 62% 100% / cover no-repeat;
    }
}

@media screen and (max-width: 39.9375em) {
    .login-scene {
        align-items: flex-start;
        padding: 2rem 1rem 1.5rem;
    }

    .login-card {
        padding: 1.6rem 1.25rem 1.4rem;
        border-radius: 18px;
    }

    .login-logo {
        height: 68px;
        margin-bottom: .9rem;
    }

    .ca-body .login-title {
        font-size: 1.45rem;
    }

    .login-row {
        flex-wrap: wrap;
        margin-top: 1.2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ca-body .login-input input { transition: none; }
}

/* =====================================================================
   Phones with enlarged text (v15)
   Android font size and Chrome's Text scaling can double the text size.
   The card layout then had no room for values beside their labels, so
   values ran off the card and the page scrolled sideways. These rules
   let every phone layout adapt to the text size instead.
   ===================================================================== */

@media screen and (max-width: 39.9375em) {

    /* nothing on a report or list page may push the page wider than the screen */
    .ca-report,
    .rpt-main,
    .ca-table-wrap {
        max-width: 100%;
    }

    /* each record card measures its own width, so the rules below can respond to it */
    .ca-table-wrap table > tbody > tr {
        container-type: inline-size;
    }

    /* long values (dates, index numbers, names) wrap inside the card instead of spilling out */
    .ca-table-wrap table > tbody > tr > td[data-label] {
        min-width: 0 !important;
    }

    .ca-table-wrap td[data-label] > .ca-cell {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .ca-table-wrap table > tbody > tr > td[data-label]::before {
        overflow-wrap: anywhere;
    }

    .ca-table-wrap .rpt-check {
        flex-wrap: wrap;
    }

    /* the marshal reports' date and court boxes may wrap rather than stretch the card */
    .ca-table-wrap table.ca-nested > tbody > tr > td {
        white-space: normal;
    }

    .ca-table-wrap table.ca-nested input,
    .ca-table-wrap table.ca-nested select {
        max-width: 100%;
    }

    /* every value in a card may wrap: the desktop one-line rules (Index #, Apt,
       Boro, Type) are more specific than the card rule, so restate it here */
    .ca-table-wrap table > tbody > tr > td[data-label] {
        white-space: normal;
    }

    /* choice pills ("Generate Petition", "Discontinue", Yes / No) and buttons wrap
       their label inside the card instead of running off the screen */
    .rpt-pill {
        white-space: normal;
        min-width: 0;
        max-width: 100%;
        border-radius: 1.4rem;
    }

    .rpt-pill label,
    .rpt-pill span {
        min-width: 0;
        overflow-wrap: break-word;
    }

    .rpt-main .ca-btn,
    .ca-body .rpt-main input.ca-btn {
        white-space: normal;
        max-width: 100%;
        height: auto;
        padding-left: .75rem;
        padding-right: .75rem;
        letter-spacing: .02em;
        overflow-wrap: break-word;
    }

    /* two-across grids drop to one column when the text is too large for two */
    .rpt-case-head,
    .rpt-rentgrid > tbody > tr,
    .rpt-rentgrid--3 > tbody > tr {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr));
    }
}

/* When a card is too narrow for label and value side by side (large text),
   the label goes on its own line above the value. At normal text sizes the
   card is wide enough and keeps the side-by-side layout. */
@container (max-width: 17rem) {
    .ca-table-wrap table > tbody > tr > td[data-label],
    .ca-table-wrap table > tbody > tr.alternate > td[data-label],
    .ca-table-wrap table > tbody > tr:not(.ca-head):not(.ca-pager):hover > td[data-label] {
        grid-template-columns: minmax(0, 1fr);
        gap: .15rem;
    }

    .ca-table-wrap table > tbody > tr > td[data-label]::before {
        padding-top: 0;
    }
}

/* =====================================================================
   No red anywhere on the "2" pages (v15)
   Older page code and validators still write red inline, e.g.
   ForeColor="Red" -> style="color:Red;", or <font color="red">.
   These rules turn all of it into the site teal. Validator and error
   messages also get a small warning icon so they still read as errors.
   ===================================================================== */

:root {
    --ca-alert-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M12 7.5v5.5M12 16.5h.01'/%3E%3C/svg%3E");
    --ca-alert-icon-teal: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233b767d' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M12 7.5v5.5M12 16.5h.01'/%3E%3C/svg%3E");
}

[style*="color:red" i],
[style*="color: red" i],
[style*="color:#f00" i],
[style*="color: #f00" i],
[style*="color:#ff0000" i],
[style*="color: #ff0000" i],
[style*="color:#c00" i],
[style*="color: #c00" i],
[style*="color:#cc0000" i],
[style*="color: #cc0000" i],
font[color="red" i],
font[color="#ff0000" i],
font[color="#f00" i] {
    color: var(--ca-alert-ink) !important;
}

/* the rpt-flash banners keep their own green / amber text */
.rpt-flash span[style] { color: inherit !important; }

/* warning icon in front of validator and error messages */
.ca-form span[style*="color"]::before,
.ca-filter .filter-row--msgs > td span::before,
.rpt-rentgrid td.rb span[style*="color"]::before,
.search-errors span::before {
    content: "";
    display: inline-block;
    width: .95em;
    height: .95em;
    margin-right: .35em;
    vertical-align: -.12em;
    background: currentColor;
    -webkit-mask: var(--ca-alert-icon) center / contain no-repeat;
            mask: var(--ca-alert-icon) center / contain no-repeat;
}

/* nested spans inside a message don't get a second icon */
.ca-form span[style*="color"] span::before,
.ca-filter .filter-row--msgs > td span span::before,
.rpt-rentgrid td.rb span[style*="color"] span::before,
.search-errors span span::before {
    content: none;
}

/* the validator filter rows set colour on the cell; the spans need it too */
.ca-filter .filter-row--msgs > td span {
    color: var(--ca-alert-ink) !important;
}

.login-error {
    padding-left: 2.4rem;
    background: var(--ca-alert-soft) var(--ca-alert-icon-teal) .85rem .8rem / 17px no-repeat;
}
