/*
    dpd-ui.css - shared "Registry Ledger" screen stylesheet for Tenant pages (UI refresh, wave 0).

    It promotes the look of the file-entry page (dpd-filecase-create.css, scoped to body.fc-create) into one sheet that
    every list / form / report page can use: warm paper page ground, cream cards with an accent bar, Fraunces page
    title, warm form controls, brass / white / ghost / red button hierarchy, soft status pills, avatars, KPI tiles,
    a filter bar, dense money tables, a tinted warning note, the empty-grid state and a phone card list.

    HOW IT IS SCOPED - read before editing
      * OPT-IN. Every rule starts with  body.dpd-ui  (the tokens are declared on it too), so the sheet changes NOTHING
        on a page until that page puts class="dpd-ui" on its <body> (keep any other body class, e.g. "fc-create").
        It is linked once for all pages from Tenant\Shared\TenantSidebar.ascx, after dpd-theme / dpd-experience /
        dpd-productivity; the higher selector specificity, not !important, is what beats them.
      * SCREEN ONLY. Everything sits in @media screen, so printed output, PDF capture and print previews cannot change.
      * NOT used on: Tenant\Cases\Workspace.aspx (Easy-drafter chat and its 7-stage view), FileCase\Create.aspx
        (body.fc-create keeps its own sheet) and the print / receipt pages. Do not add class dpd-ui to those bodies.
      * Never define or restyle Tabler's .card-status-start on a .card itself (it collapses the card to 2px): the
        accent bar here is the ::before of .card.ui-accent*.
      * An ASP.NET GridView renders <tr><th> with no <thead>, so table headers are styled as th directly.
      * dpd-portal.js swaps only the form's innerHTML after a postback: keep state in classes on server-rendered
        markup, never in nodes a script added (dpd-ui.js re-runs on the "dpd:ajax-loaded" event).
    Test/contract: DelhiPropertyDesk.Tests\Web\DpdUiSheetTests.cs parses this file and fails on any rule that is not
    scoped as described above.
*/

@media screen {

    /* ===== 1. tokens ===== */
    body.dpd-ui {
        --ui-paper: #f6f2e8;
        --ui-card: #fdfbf5;
        --ui-ink: #221d14;
        --ui-muted: #6b5f4a;
        --ui-faint: #7d705a;
        --ui-line: rgba(34, 29, 20, .12);
        --ui-line-strong: rgba(34, 29, 20, .22);

        --ui-brass: #96700f;
        --ui-brass-ink: #7a5a0a;
        --ui-brass-soft: #f3ead1;
        --ui-brass-line: rgba(150, 112, 15, .30);
        --ui-seal: #2e5c44;
        --ui-seal-soft: #e6efe9;
        --ui-seal-line: rgba(46, 92, 68, .38);
        --ui-wax: #95382a;
        --ui-wax-soft: #f7e6e2;
        --ui-wax-line: rgba(149, 56, 42, .32);
        --ui-rust: #b8562f;
        --ui-rust-ink: #8c3f1f;
        --ui-rust-soft: #fbe9e1;
        --ui-rust-line: rgba(184, 86, 47, .38);
        --ui-azure: #3b5b7a;
        --ui-azure-soft: #e5ecf3;
        --ui-azure-line: rgba(59, 91, 122, .32);
        --ui-neutral-soft: #efe9da;

        --ui-display: "Fraunces", Georgia, "Times New Roman", serif;
        --ui-mono: "IBM Plex Mono", ui-monospace, monospace;
        --ui-r-card: 10px;
        --ui-r-ctl: 8px;
        --ui-r-pill: 999px;
        --ui-shadow: 0 1px 2px rgba(15, 17, 26, .04), 0 1px 3px rgba(15, 17, 26, .05);

        /* Tabler's stock semantic colours re-mapped onto the ledger palette, so the badges, alerts and
           text-danger / text-success helpers of an opted-in page follow it with no markup edit. */
        --tblr-red: #95382a;       --tblr-red-rgb: 149, 56, 42;
        --tblr-danger: #95382a;    --tblr-danger-rgb: 149, 56, 42;
        --tblr-success: #2e5c44;   --tblr-success-rgb: 46, 92, 68;
        --tblr-warning: #b8562f;   --tblr-warning-rgb: 184, 86, 47;
        --tblr-orange: #b8562f;    --tblr-orange-rgb: 184, 86, 47;
        --tblr-blue: #3b5b7a;      --tblr-blue-rgb: 59, 91, 122;
        --tblr-info: #3b5b7a;      --tblr-info-rgb: 59, 91, 122;
        --tblr-indigo: #3b5b7a;    --tblr-indigo-rgb: 59, 91, 122;
        --tblr-secondary: #6b5f4a; --tblr-secondary-rgb: 107, 95, 74;
        --tblr-body-color: var(--ui-ink);
        --tblr-border-color: var(--ui-line);
        --tblr-border-color-translucent: var(--ui-line);
    }
    /* ===== 2. page ground and header ===== */
    body.dpd-ui {
        background: var(--ui-paper);
        color: var(--ui-ink);
    }
    body.dpd-ui .page-wrapper { color: var(--ui-ink); }
    body.dpd-ui .page-header .page-title,
    body.dpd-ui .page-header .ui-title {
        font-family: var(--ui-display);
        font-weight: 600;
        letter-spacing: -.01em;
        font-size: clamp(1.45rem, 2.4vw, 1.9rem);
        line-height: 1.2;
        color: var(--ui-ink);
    }
    body.dpd-ui .page-header .page-pretitle,
    body.dpd-ui .page-header .page-pretitle a {
        color: var(--ui-brass-ink);
        font-size: .7rem;
        font-weight: 700;
        letter-spacing: .09em;
        margin-bottom: .35rem;
        text-decoration: none;
    }
    body.dpd-ui .ui-intro { color: var(--ui-muted); margin: .4rem 0 0; font-size: .9rem; max-width: 46rem; }
    body.dpd-ui .page-header { margin-bottom: .25rem; }
    /* the thin "firm name / signed in as" bar some pages carry above the page header */
    body.dpd-ui .page-wrapper > header.navbar { background: transparent; border-bottom: 1px solid var(--ui-line); box-shadow: none; min-height: 3rem; }
    body.dpd-ui .page-wrapper > header.navbar .text-secondary { color: var(--ui-muted) !important; }
    /* ===== 3. cards ===== */
    body.dpd-ui .page-wrapper .card {
        background: var(--ui-card);
        border: 1px solid var(--ui-line);
        border-radius: var(--ui-r-card);
        box-shadow: var(--ui-shadow);
    }
    body.dpd-ui .page-wrapper .card-header {
        background: transparent;
        border-bottom: 1px solid var(--ui-line);
        padding: 1rem 1.5rem;
        min-height: 0;
    }
    body.dpd-ui .page-wrapper .card-body { padding: 1.25rem 1.5rem 1.5rem; }
    body.dpd-ui .page-wrapper .card-footer {
        background: rgba(34, 29, 20, .025);
        border-top: 1px solid var(--ui-line);
        padding: 1rem 1.5rem;
        border-radius: 0 0 var(--ui-r-card) var(--ui-r-card);
    }
    body.dpd-ui .page-wrapper .card-title { font-size: 1rem; font-weight: 650; color: var(--ui-ink); margin: 0; }
    body.dpd-ui .page-wrapper .card-header .ui-sub,
    body.dpd-ui .page-wrapper .card-header p.text-secondary { font-size: .8rem; font-weight: 400; color: var(--ui-muted); margin: .2rem 0 0; }
    /* Accent bar down the left edge of a card. A pseudo-element on purpose: Tabler's own .card-status-start is
       position:absolute;width:2px, and defining it on the .card itself collapses the card to 2px. Never do that. */
    body.dpd-ui .card.ui-accent::before,
    body.dpd-ui .card.ui-accent--seal::before,
    body.dpd-ui .card.ui-accent--rust::before,
    body.dpd-ui .card.ui-accent--azure::before,
    body.dpd-ui .card.ui-accent--wax::before {
        content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
        background: var(--ui-brass); border-radius: var(--ui-r-card) 0 0 var(--ui-r-card);
    }
    body.dpd-ui .card.ui-accent--seal::before { background: var(--ui-seal); }
    body.dpd-ui .card.ui-accent--rust::before { background: var(--ui-rust); }
    body.dpd-ui .card.ui-accent--azure::before { background: var(--ui-azure); }
    body.dpd-ui .card.ui-accent--wax::before { background: var(--ui-wax); }
    /* card header with a title on the left and a status chip on the right; numbered step marker */
    body.dpd-ui .ui-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; width: 100%; }
    body.dpd-ui .ui-step-no {
        width: 26px; height: 26px; border-radius: 50%;
        background: var(--ui-brass-soft); color: var(--ui-brass-ink);
        font-size: .75rem; font-weight: 700;
        display: inline-flex; align-items: center; justify-content: center; flex: none;
        margin-right: .65rem; vertical-align: middle;
    }
    body.dpd-ui .ui-chip-status {
        font-size: .72rem; font-weight: 700; padding: .25rem .7rem; border-radius: var(--ui-r-pill);
        background: var(--ui-brass-soft); color: var(--ui-brass-ink); letter-spacing: .02em; white-space: nowrap;
    }
    body.dpd-ui .ui-chip-status.is-seal { background: var(--ui-seal-soft); color: var(--ui-seal); }
    body.dpd-ui .ui-chip-status.is-rust { background: var(--ui-rust-soft); color: var(--ui-rust-ink); }
    /* ===== 4. KPI tile ===== */
    body.dpd-ui .ui-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
    body.dpd-ui .ui-kpi {
        position: relative; background: var(--ui-card); border: 1px solid var(--ui-line);
        border-radius: var(--ui-r-card); box-shadow: var(--ui-shadow); padding: 1rem 1.25rem 1rem 1.4rem; overflow: hidden;
    }
    body.dpd-ui .ui-kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--ui-brass); }
    body.dpd-ui .ui-kpi.is-seal::before { background: var(--ui-seal); }
    body.dpd-ui .ui-kpi.is-wax::before { background: var(--ui-wax); }
    body.dpd-ui .ui-kpi.is-azure::before { background: var(--ui-azure); }
    body.dpd-ui .ui-kpi-l { font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ui-faint); }
    body.dpd-ui .ui-kpi-v { font-size: 1.65rem; font-weight: 700; line-height: 1.2; margin-top: .25rem; font-variant-numeric: tabular-nums; color: var(--ui-ink); }
    body.dpd-ui .ui-kpi.is-wax .ui-kpi-v { color: var(--ui-wax); }
    body.dpd-ui .ui-kpi.is-seal .ui-kpi-v { color: var(--ui-seal); }
    body.dpd-ui .ui-kpi-s { font-size: .8rem; color: var(--ui-muted); margin-top: .15rem; }
    /* ===== 5. forms ===== */
    body.dpd-ui .form-label,
    body.dpd-ui .ui-label { font-size: .78rem; font-weight: 600; color: var(--ui-muted); margin-bottom: .35rem; display: block; }
    body.dpd-ui .ui-req { font-weight: 600; color: var(--ui-wax); margin-left: .35rem; font-size: .72rem; }
    body.dpd-ui .form-control,
    body.dpd-ui .form-select {
        background-color: #fff;
        border: 1px solid var(--ui-line-strong);
        border-radius: var(--ui-r-ctl);
        min-height: 42px;
        color: var(--ui-ink);
        box-shadow: none;
        transition: border-color .3s ease, box-shadow .3s ease;
    }
    body.dpd-ui textarea.form-control { min-height: 0; }
    body.dpd-ui .form-control::placeholder { color: #9a8e78; }
    body.dpd-ui .form-control:focus,
    body.dpd-ui .form-select:focus { border-color: var(--ui-brass); box-shadow: 0 0 0 3px rgba(150, 112, 15, .18); }
    body.dpd-ui .form-control:disabled,
    body.dpd-ui .form-select:disabled { background-color: var(--ui-neutral-soft); }
    body.dpd-ui .form-hint,
    body.dpd-ui .ui-hint { color: var(--ui-muted); font-size: .78rem; margin-top: .3rem; }
    body.dpd-ui .form-control.is-invalid,
    body.dpd-ui .form-select.is-invalid,
    body.dpd-ui [aria-invalid="true"] { border-color: var(--ui-wax); box-shadow: 0 0 0 3px rgba(149, 56, 42, .12); outline: 0; }
    body.dpd-ui .invalid-feedback,
    body.dpd-ui .ui-error { color: var(--ui-wax); font-size: .78rem; font-weight: 600; margin-top: .3rem; }
    body.dpd-ui .form-control.mono { font-variant-numeric: tabular-nums; }
    body.dpd-ui input[type="radio"],
    body.dpd-ui input[type="checkbox"] { accent-color: var(--ui-brass); }
    /* "Rs." prefix on an amount input */
    body.dpd-ui .input-group-text { background: var(--ui-paper); border-color: var(--ui-line-strong); color: var(--ui-muted); font-weight: 600; }
    /* filter / search bar: one white bar above the list, not a titled card */
    body.dpd-ui .ui-filterbar {
        background: #fff; border: 1px solid var(--ui-line); border-radius: var(--ui-r-card);
        box-shadow: var(--ui-shadow); padding: 1rem 1.25rem;
        display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end;
    }
    body.dpd-ui .ui-filterbar > .ui-fgrow { flex: 1 1 16rem; min-width: 0; }
    body.dpd-ui .ui-filterbar > .ui-fcell { flex: 0 1 12rem; min-width: 9rem; }
    body.dpd-ui .ui-filterbar > .ui-fbtns { display: flex; gap: .5rem; align-items: center; }
    body.dpd-ui .ui-filterbar .ui-fnote { flex: 1 1 100%; font-size: .78rem; color: var(--ui-muted); margin: 0; }
    body.dpd-ui .ui-fcheck,
    body.dpd-ui .ui-fcheck > span { display: flex; align-items: center; gap: .5rem; min-height: 42px; font-size: .9rem; }
    body.dpd-ui .ui-fcheck input[type="checkbox"] { width: 1.1rem; height: 1.1rem; margin: 0; accent-color: var(--ui-brass); flex: none; }
    body.dpd-ui .ui-fcheck label { margin: 0; cursor: pointer; }
    body.dpd-ui .ui-search { position: relative; }
    body.dpd-ui .ui-search svg { position: absolute; left: .8rem; top: 21px; transform: translateY(-50%); width: 16px; height: 16px; color: var(--ui-faint); pointer-events: none; }
    body.dpd-ui .ui-search .form-control { padding-left: 2.3rem; }
    /* ===== 6. buttons: primary solid brass, secondary white, ghost = tertiary, danger outline (solid only on confirm) ===== */
    body.dpd-ui .btn { border-radius: var(--ui-r-ctl); font-weight: 600; min-height: 38px; gap: .4rem; }
    body.dpd-ui .btn-primary { background: var(--ui-brass); border-color: var(--ui-brass); color: #fff; }
    body.dpd-ui .btn-primary:hover,
    body.dpd-ui .btn-primary:focus { background: #85620c; border-color: #85620c; color: #fff; }
    body.dpd-ui .btn-outline-primary { color: var(--ui-brass-ink); border-color: var(--ui-brass-line); background: #fff; }
    body.dpd-ui .btn-outline-primary:hover { background: var(--ui-brass-soft); border-color: var(--ui-brass); color: var(--ui-brass-ink); }
    /* a plain .btn / .btn-white (no variant class) reads as the secondary button */
    body.dpd-ui .btn-outline-secondary,
    body.dpd-ui .btn-white,
    body.dpd-ui .btn:where(:not([class*="btn-primary"]):not([class*="btn-outline"]):not([class*="btn-danger"]):not([class*="btn-success"]):not([class*="btn-warning"]):not([class*="btn-ghost"]):not([class*="btn-link"]):not([class*="btn-azure"]):not([class*="btn-teal"]):not([class*="btn-indigo"]):not(.btn-icon)) {
        color: var(--ui-ink); border-color: var(--ui-line-strong); background: #fff;
    }
    body.dpd-ui .btn-outline-secondary:hover,
    body.dpd-ui .btn-white:hover,
    body.dpd-ui .btn:where(:not([class*="btn-primary"]):not([class*="btn-outline"]):not([class*="btn-danger"]):not([class*="btn-success"]):not([class*="btn-warning"]):not([class*="btn-ghost"]):not([class*="btn-link"]):not([class*="btn-azure"]):not([class*="btn-teal"]):not([class*="btn-indigo"]):not(.btn-icon)):hover {
        background: var(--ui-brass-soft); border-color: var(--ui-brass-line); color: var(--ui-ink);
    }
    body.dpd-ui .btn-outline-danger { color: var(--ui-wax); border-color: var(--ui-wax-line); background: #fff; }
    body.dpd-ui .btn-outline-danger:hover { background: var(--ui-wax-soft); border-color: var(--ui-wax); color: var(--ui-wax); }
    body.dpd-ui .btn-danger { background: var(--ui-wax); border-color: var(--ui-wax); color: #fff; }
    body.dpd-ui .btn-danger:hover { background: #7e2e22; border-color: #7e2e22; color: #fff; }
    /* ghost = tertiary action. A Delete button inside a table row stays quiet until hovered. */
    body.dpd-ui .btn-ghost,
    body.dpd-ui .table .btn-outline-danger,
    body.dpd-ui .table-wrap .btn-outline-danger { background: transparent; border-color: transparent; box-shadow: none; }
    body.dpd-ui .btn-ghost { color: var(--ui-brass-ink); }
    body.dpd-ui .btn-ghost:hover { background: var(--ui-brass-soft); color: var(--ui-brass-ink); }
    body.dpd-ui .table .btn-outline-danger:hover,
    body.dpd-ui .table-wrap .btn-outline-danger:hover { background: var(--ui-wax-soft); border-color: var(--ui-wax-line); }
    body.dpd-ui .table .btn-sm,
    body.dpd-ui .table-wrap .btn-sm { min-height: 32px; padding: .2rem .75rem; }
    /* ===== 7. badges, avatars, code pills ===== */
    body.dpd-ui .badge { border-radius: var(--ui-r-pill); padding: .32em .8em; font-weight: 650; font-size: .72rem; letter-spacing: .02em; text-transform: none; }
    body.dpd-ui .badge.bg-green-lt,
    body.dpd-ui .badge.bg-success-lt,
    body.dpd-ui .badge.bg-teal-lt { background-color: var(--ui-seal-soft) !important; color: var(--ui-seal) !important; border-color: var(--ui-seal-line) !important; }
    body.dpd-ui .badge.bg-yellow-lt,
    body.dpd-ui .badge.bg-orange-lt,
    body.dpd-ui .badge.bg-warning-lt { background-color: var(--ui-rust-soft) !important; color: var(--ui-rust-ink) !important; border-color: var(--ui-rust-line) !important; }
    body.dpd-ui .badge.bg-red-lt,
    body.dpd-ui .badge.bg-danger-lt,
    body.dpd-ui .badge.bg-pink-lt { background-color: var(--ui-wax-soft) !important; color: var(--ui-wax) !important; border-color: var(--ui-wax-line) !important; }
    body.dpd-ui .badge.bg-blue-lt,
    body.dpd-ui .badge.bg-azure-lt,
    body.dpd-ui .badge.bg-info-lt,
    body.dpd-ui .badge.bg-indigo-lt,
    body.dpd-ui .badge.bg-cyan-lt,
    body.dpd-ui .badge.bg-purple-lt { background-color: var(--ui-azure-soft) !important; color: var(--ui-azure) !important; border-color: var(--ui-azure-line) !important; }
    body.dpd-ui .badge.bg-secondary-lt,
    body.dpd-ui .badge.bg-gray-lt { background-color: var(--ui-neutral-soft) !important; color: var(--ui-muted) !important; border-color: var(--ui-line) !important; }
    body.dpd-ui .badge.bg-primary-lt { background-color: var(--ui-brass-soft) !important; color: var(--ui-brass-ink) !important; border-color: var(--ui-brass-line) !important; }
    body.dpd-ui .badge.ui-dot::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; flex: none; }
    body.dpd-ui .ui-avatar {
        width: 36px; height: 36px; border-radius: 50%; background: var(--ui-brass); color: #fff;
        font-size: .78rem; font-weight: 700; letter-spacing: .02em;
        display: inline-flex; align-items: center; justify-content: center; flex: none;
    }
    /* initials come from data-initials (drawn by CSS, so they are not in the page text: nothing to copy, search or print), or from plain text such as a step number */
    body.dpd-ui .ui-avatar[data-initials]::before { content: attr(data-initials); }
    body.dpd-ui .ui-avatar.is-sm { width: 26px; height: 26px; font-size: .62rem; }
    body.dpd-ui .ui-avatar.is-azure { background: var(--ui-azure); }
    body.dpd-ui .ui-avatar.is-seal { background: var(--ui-seal); }
    body.dpd-ui .ui-avatar.is-muted { background: var(--ui-faint); }
    body.dpd-ui .ui-code {
        display: inline-block; white-space: nowrap; font-family: var(--ui-mono); font-size: .78rem; font-weight: 600; letter-spacing: .01em;
        padding: .18rem .5rem; border-radius: 6px; background: var(--ui-brass-soft); color: var(--ui-brass-ink);
    }
    /* an id or reference number in plain mono type (no pill): never breaks across lines */
    body.dpd-ui .ui-mono { font-family: var(--ui-mono); font-size: .8125rem; white-space: nowrap; }
    /* ===== 8. tables (an ASP.NET GridView renders <tr><th> with NO <thead>, so th is styled directly) ===== */
    body.dpd-ui .table-wrap,
    body.dpd-ui .table-responsive { max-width: 100%; overflow-x: auto; scrollbar-width: thin; }
    body.dpd-ui .table-wrap table,
    body.dpd-ui table.table { width: 100%; margin-bottom: 0; border-collapse: collapse; }
    body.dpd-ui .table-wrap th,
    body.dpd-ui .table th {
        background: rgba(34, 29, 20, .035);
        color: var(--ui-muted);
        font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
        padding: .75rem 1rem; white-space: nowrap; text-align: left;
        border-bottom: 1px solid var(--ui-line-strong);
    }
    body.dpd-ui .table-wrap td,
    body.dpd-ui .table td {
        padding: .8rem 1rem; font-size: .875rem; vertical-align: middle; position: relative;
        border-bottom: 1px solid var(--ui-line); color: var(--ui-ink); background: transparent;
    }
    body.dpd-ui .table-wrap th:first-child,
    body.dpd-ui .table th:first-child,
    body.dpd-ui .table-wrap td:first-child,
    body.dpd-ui .table td:first-child { padding-left: 1.5rem; }
    body.dpd-ui .table-wrap th:last-child,
    body.dpd-ui .table th:last-child,
    body.dpd-ui .table-wrap td:last-child,
    body.dpd-ui .table td:last-child { padding-right: 1.25rem; }
    body.dpd-ui .table-wrap tr:last-child td,
    body.dpd-ui .table tr:last-child td { border-bottom: 0; }
    body.dpd-ui .table-wrap tr:hover td,
    body.dpd-ui .table-hover tr:hover td { background: rgba(150, 112, 15, .06); }
    body.dpd-ui .table-wrap tr:hover td:first-child { box-shadow: inset 3px 0 var(--ui-brass); }
    body.dpd-ui .table-wrap tbody tr:hover { box-shadow: none; background: transparent; }
    /* row tint by next appointment (FileCase\Index.aspx; the class names and the rule that picks them live in dpd-theme.css / FileCaseRowColorLogic): upcoming green, today gold, past wax */
    body.dpd-ui .table-wrap tbody tr.row-appointment-upcoming,
    body.dpd-ui .table-wrap tr.row-appointment-upcoming { background-color: var(--ui-seal-soft); }
    body.dpd-ui .table-wrap tbody tr.row-appointment-today,
    body.dpd-ui .table-wrap tr.row-appointment-today { background-color: var(--ui-brass-soft); }
    body.dpd-ui .table-wrap tbody tr.row-appointment-overdue,
    body.dpd-ui .table-wrap tr.row-appointment-overdue { background-color: var(--ui-wax-soft); }
    /* dense zebra tables for money reports; lists stay un-striped */
    body.dpd-ui .ui-zebra tr:nth-child(odd) td { background: rgba(34, 29, 20, .022); }
    body.dpd-ui .ui-zebra tr:nth-child(odd):hover td { background: rgba(150, 112, 15, .06); }
    body.dpd-ui .ui-dense th,
    body.dpd-ui .ui-dense td { padding: .6rem .4rem; font-size: .8125rem; }
    body.dpd-ui .ui-dense th { white-space: normal; line-height: 1.25; vertical-align: bottom; }
    body.dpd-ui .ui-dense th:first-child,
    body.dpd-ui .ui-dense td:first-child { padding-left: 1.5rem; }
    body.dpd-ui .ui-dense th:last-child,
    body.dpd-ui .ui-dense td:last-child { padding-right: 1.25rem; }
    /* money: right-aligned tabular figures. dpd-ui.js adds .ui-num to a column whose header says Rs./Amount/Balance/... */
    body.dpd-ui .ui-num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
    /* a class on the cell itself (td.) needs the extra selector: ".table td" sets the cell colour with the same weight */
    body.dpd-ui .ui-due,
    body.dpd-ui td.ui-due { color: var(--ui-wax); font-weight: 700; }
    body.dpd-ui .ui-credit,
    body.dpd-ui td.ui-credit { color: var(--ui-seal); font-weight: 700; }
    body.dpd-ui .ui-zero,
    body.dpd-ui td.ui-zero { color: #a89b82; }
    /* first column as "avatar + name + muted sub-line" */
    body.dpd-ui .ui-cell { display: flex; align-items: center; gap: .75rem; min-width: 12rem; }
    body.dpd-ui .ui-cell-main { display: flex; flex-direction: column; min-width: 0; }
    body.dpd-ui .ui-cell-name { font-weight: 650; overflow-wrap: anywhere; }
    body.dpd-ui .ui-cell-sub { font-size: .75rem; color: var(--ui-muted); }
    body.dpd-ui .ui-dense .ui-cell { min-width: 0; }
    body.dpd-ui .ui-dense .ui-link { white-space: normal; }
    /* the grid's "nothing here" row becomes an empty state with no markup change */
    body.dpd-ui .table-wrap td[colspan]:only-child,
    body.dpd-ui .table td[colspan]:only-child {
        padding: 2.6rem 1rem 2.2rem; text-align: center; color: var(--ui-muted); font-size: .9rem;
    }
    body.dpd-ui .table-wrap td[colspan]:only-child::before,
    body.dpd-ui .table td[colspan]:only-child::before {
        content: ""; display: block; width: 44px; height: 44px; margin: 0 auto .75rem; border-radius: 50%;
        background: var(--ui-brass-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a5a0a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-14a2 2 0 0 1-2-2v-11a2 2 0 0 1 2-2'/%3E%3C/svg%3E") center / 22px no-repeat;
    }
    /* the toolbar dpd-productivity.js injects above every table (columns, rows per page, reset) */
    body.dpd-ui .dpd-table-tools { background: rgba(34, 29, 20, .03); border-bottom: 1px solid var(--ui-line); padding: .6rem 1.5rem; gap: .5rem; color: var(--ui-muted); font-size: .78rem; }
    body.dpd-ui .dpd-table-tools button,
    body.dpd-ui .dpd-table-tools select,
    body.dpd-ui .dpd-table-tools summary { border: 1px solid var(--ui-line-strong); border-radius: 7px; background: #fff; color: var(--ui-ink); padding: .3rem .65rem; font-size: .78rem; font-weight: 600; }
    body.dpd-ui .dpd-table-tools button:hover,
    body.dpd-ui .dpd-table-tools summary:hover { background: var(--ui-brass-soft); border-color: var(--ui-brass-line); }
    /* the "Copy" helper dpd-productivity.js appends: under a form field it sits right-aligned and always visible (touch has no hover);
       in a table cell it floats over the cell on row hover instead of making mobile-number rows two lines tall */
    body.dpd-ui .dpd-copy { color: var(--ui-brass-ink); font-weight: 600; font-size: .75rem; }
    body.dpd-ui .dpd-copy:hover { background: var(--ui-brass-soft); color: var(--ui-brass-ink); }
    body.dpd-ui .form-control + .dpd-copy,
    body.dpd-ui .input-group + .dpd-copy,
    body.dpd-ui .form-select + .dpd-copy { display: block; margin: .25rem 0 0 auto; }
    body.dpd-ui .table-wrap td .dpd-copy,
    body.dpd-ui .table td .dpd-copy { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); opacity: 0; background: #fff; border: 1px solid var(--ui-line-strong); border-radius: 6px; padding: .15rem .5rem; transition: opacity .15s; }
    body.dpd-ui tr:hover .dpd-copy,
    body.dpd-ui .table-wrap td .dpd-copy:focus-visible { opacity: 1; }
    body.dpd-ui .dpd-empty-help { color: var(--ui-muted); }
    body.dpd-ui .dpd-empty-help button { background: var(--ui-brass-soft); color: var(--ui-brass-ink); }
    /* ===== 9. alerts and notes ===== */
    body.dpd-ui .alert { border-radius: 10px; font-size: .9rem; padding: .8rem 1rem; align-items: flex-start; gap: .7rem; }
    /* Tabler's .row-deck makes each column a flex row, so an alert placed in a col-12 would shrink to a small box */
    body.dpd-ui .row-deck > [class*="col-"] > .alert { flex: 1 1 auto; }
    body.dpd-ui .alert-success { background: var(--ui-seal-soft); border: 1px solid var(--ui-seal-line); color: #1f4331; }
    body.dpd-ui .alert-danger { background: var(--ui-wax-soft); border: 1px solid var(--ui-wax-line); color: #6a2519; }
    body.dpd-ui .alert-warning { background: var(--ui-rust-soft); border: 1px solid var(--ui-rust-line); color: #6e3620; }
    body.dpd-ui .alert-info { background: var(--ui-azure-soft); border: 1px solid var(--ui-azure-line); color: #29445e; }
    body.dpd-ui .alert-success::before,
    body.dpd-ui .alert-danger::before,
    body.dpd-ui .alert-warning::before,
    body.dpd-ui .alert-info::before {
        content: ""; flex: none; width: 20px; height: 20px; border-radius: 50%; margin-top: .05rem;
        background: var(--ui-seal) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 6.5l2.2 2.2 4.8-5'/%3E%3C/svg%3E") center / 12px no-repeat;
    }
    body.dpd-ui .alert-danger::before { background: var(--ui-wax) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 2.5v4M6 9v.01'/%3E%3C/svg%3E") center / 12px no-repeat; }
    body.dpd-ui .alert-warning::before { background: var(--ui-rust) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 2.5v4M6 9v.01'/%3E%3C/svg%3E") center / 12px no-repeat; }
    body.dpd-ui .alert-info::before { background: var(--ui-azure) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 5.5v3.5M6 3v.01'/%3E%3C/svg%3E") center / 12px no-repeat; }
    /* an alert that already draws its own icon (or is a block panel) gets no second one */
    body.dpd-ui .alert-block::before,
    body.dpd-ui .alert:has(.alert-icon)::before { display: none !important; }
    body.dpd-ui .dpd-toast-note { background: var(--ui-ink); border-left: 3px solid var(--ui-brass); border-radius: 8px; }
    body.dpd-ui .ui-note { font-size: .8rem; color: var(--ui-muted); }
    body.dpd-ui .ui-note-warn {
        display: flex; gap: .5rem; align-items: flex-start; margin-top: .6rem; padding: .55rem .75rem;
        border: 1px solid var(--ui-rust-line); background: var(--ui-rust-soft); color: #6e3620; border-radius: 8px; font-size: .8rem;
    }
    body.dpd-ui .ui-note-warn a { color: var(--ui-rust-ink); font-weight: 700; }
    /* ===== 10. "On this page" jump bar (injected by dpd-experience.js), sub-sections, links ===== */
    body.dpd-ui .dpd-section-jump { display: flex; flex-wrap: nowrap; align-items: center; gap: .5rem; margin: 0 1rem 1.25rem; padding: .25rem 0; overflow-x: auto; list-style: none; }
    body.dpd-ui .dpd-section-jump a {
        display: inline-flex; align-items: center; gap: .5rem; padding: .4rem .9rem; border: 1px solid var(--ui-line);
        border-radius: var(--ui-r-pill); background: var(--ui-card); color: var(--ui-ink); text-decoration: none;
        font-size: .82rem; font-weight: 600; min-height: 36px; white-space: nowrap; transition: border-color .25s, background-color .25s;
    }
    body.dpd-ui .dpd-section-jump a:hover { border-color: var(--ui-brass-line); background: #fff; color: var(--ui-ink); }
    body.dpd-ui .dpd-section-jump span { color: var(--ui-faint); font-size: .68rem; }
    body.dpd-ui .ui-subhead { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ui-faint); margin: 1.2rem 0 .6rem; padding-top: 1rem; border-top: 1px solid var(--ui-line); }
    body.dpd-ui .ui-subcard { border: 1px dashed var(--ui-line-strong); border-radius: 10px; padding: .85rem 1rem; background: #fff; margin-top: .75rem; }
    body.dpd-ui .ui-subcard.is-first { margin-top: 0; }
    body.dpd-ui .ui-subcard-head .ui-cell { min-width: 0; gap: .5rem; }
    body.dpd-ui .ui-subcard-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; font-size: .78rem; font-weight: 700; color: var(--ui-muted); }
    body.dpd-ui .ui-link { white-space: nowrap; color: var(--ui-brass-ink); font-weight: 600; font-size: .82rem; text-decoration: none; }
    body.dpd-ui .ui-link:hover { text-decoration: underline; }
    body.dpd-ui .ui-link--danger { color: var(--ui-wax); }
    /* ===== 10b. choice rows (a RadioButtonList shown as readable rows), pill buttons, segmented switch ===== */
    /* The native radio stays in the page (keyboard + label click still work) but is visually replaced by a ring drawn on the label. */
    body.dpd-ui .ui-choices { position: relative; display: flex; flex-direction: column; gap: .5rem; width: 100%; }
    body.dpd-ui table.ui-choices,
    body.dpd-ui table.ui-choices tbody,
    body.dpd-ui table.ui-choices tr,
    body.dpd-ui table.ui-choices td { display: block; width: 100%; padding: 0; border: 0; position: relative; }
    body.dpd-ui table.ui-choices tr { margin-bottom: .5rem; }
    body.dpd-ui .ui-choices br { display: none; }
    body.dpd-ui .ui-choices input[type="radio"] { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
    body.dpd-ui .ui-choices label {
        display: flex; align-items: flex-start; gap: .75rem; margin: 0; padding: .8rem 1rem; cursor: pointer;
        border: 1.5px solid var(--ui-line-strong); border-radius: var(--ui-r-ctl); background: #fff;
        font-size: .9rem; line-height: 1.5; color: var(--ui-ink); transition: border-color .2s ease, background-color .2s ease;
    }
    body.dpd-ui .ui-choices label::before { content: ""; flex: none; width: 18px; height: 18px; margin-top: .15rem; border-radius: 50%; border: 2px solid var(--ui-line-strong); background: #fff; }
    body.dpd-ui .ui-choices label:hover { border-color: var(--ui-brass-line); }
    body.dpd-ui .ui-choices input:checked + label { border-color: var(--ui-brass); background: var(--ui-brass-soft); }
    body.dpd-ui .ui-choices input:checked + label::before { border-color: var(--ui-brass); background: radial-gradient(circle, var(--ui-brass) 0 38%, #fff 42%); }
    body.dpd-ui .ui-choices input:focus-visible + label { outline: 3px solid #b38a3c; outline-offset: 2px; }
    /* pill buttons that filter a list (aria-pressed marks the one that is on) */
    body.dpd-ui .ui-pills { display: flex; gap: .5rem; flex-wrap: wrap; }
    body.dpd-ui .ui-pill {
        border: 1px solid var(--ui-line-strong); background: #fff; color: var(--ui-ink); border-radius: var(--ui-r-pill);
        padding: .45rem .95rem; min-height: 40px; font: 600 .82rem/1.2 Inter, system-ui, sans-serif; cursor: pointer;
    }
    body.dpd-ui .ui-pill:hover { background: var(--ui-brass-soft); border-color: var(--ui-brass-line); }
    body.dpd-ui .ui-pill[aria-pressed="true"] { background: var(--ui-brass); border-color: var(--ui-brass); color: #fff; }
    body.dpd-ui .ui-pill:focus-visible { outline: 3px solid #b38a3c; outline-offset: 2px; }
    /* segmented switch: two or three buttons in one track (a page script toggles .active) */
    body.dpd-ui .ui-seg { display: flex; gap: 3px; padding: 3px; border-radius: var(--ui-r-ctl); background: rgba(34, 29, 20, .07); }
    body.dpd-ui .ui-seg button { flex: 1; border: 0; border-radius: 6px; background: transparent; color: var(--ui-muted); padding: .5rem .6rem; min-height: 38px; font: 600 .82rem/1.2 Inter, system-ui, sans-serif; cursor: pointer; }
    body.dpd-ui .ui-seg button.active { background: #fff; color: var(--ui-ink); box-shadow: 0 1px 3px rgba(34, 29, 20, .18); }
    body.dpd-ui .ui-seg button:focus-visible { outline: 3px solid #b38a3c; outline-offset: 1px; }
    /* ===== 10c. standalone pages: the shared auth card (tenant sign-in family + client portal sign-in) and the client portal ===== */
    /* These pages carry no sidebar and the client portal never loads Tabler (536 KB on a phone), so the few Tabler-named classes they use
       (.btn .form-control .form-label .alert .badge .card) are restated here, scoped to .ui-solo - the wrapper element of such a page. */
    body.dpd-ui .ui-solo,
    body.dpd-ui .ui-solo *,
    body.dpd-ui .ui-solo *::before,
    body.dpd-ui .ui-solo *::after { box-sizing: border-box; }
    body.dpd-ui .ui-solo { font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.55; color: var(--ui-ink); -webkit-font-smoothing: antialiased; }
    body.dpd-ui .ui-solo :where(h1, h2, h3, p) { margin: 0; }
    body.dpd-ui .ui-solo a:where(:not(.btn)) { color: var(--ui-brass-ink); }
    body.dpd-ui :where(.ui-solo) .form-control,
    body.dpd-ui :where(.ui-solo) .form-select { display: block; width: 100%; padding: .5rem .8rem; font-family: inherit; font-size: .95rem; line-height: 1.5; }
    body.dpd-ui .ui-solo textarea.form-control { resize: vertical; }
    body.dpd-ui .ui-solo .btn {
        display: inline-flex; align-items: center; justify-content: center; padding: .5rem 1.1rem; border-width: 1px; border-style: solid;
        font-family: inherit; font-size: .9rem; line-height: 1.4; text-align: center; text-decoration: none; cursor: pointer;
        transition: background-color .16s ease, border-color .16s ease, box-shadow .18s ease, transform .12s ease-out;
    }
    body.dpd-ui .ui-solo .btn-primary { box-shadow: 0 1px 2px rgba(34, 29, 20, .16), 0 1px 3px rgba(150, 112, 15, .25); }
    body.dpd-ui .ui-solo .btn:active { transform: scale(.98); }
    body.dpd-ui .ui-solo .btn-seal { background: var(--ui-seal); border-color: var(--ui-seal); color: #fff; }
    body.dpd-ui .ui-solo .btn-seal:hover { background: #244a37; border-color: #244a37; color: #fff; }
    body.dpd-ui .ui-solo .btn-link { background: transparent; border-color: transparent; color: var(--ui-brass-ink); text-decoration: underline; }
    body.dpd-ui .ui-solo .btn-link:hover { background: var(--ui-brass-soft); }
    body.dpd-ui .ui-solo .ui-btn-block { width: 100%; }
    /* an alert here is a plain block: the icon is drawn in the left gutter so inline content (bold, links, literals) flows naturally */
    body.dpd-ui .ui-solo .alert { position: relative; display: block; margin: 0 0 1rem; padding: .75rem 1rem .75rem 2.75rem; }
    body.dpd-ui .ui-solo .alert::before { position: absolute; left: .9rem; top: .8rem; }
    body.dpd-ui .ui-solo .badge { display: inline-flex; align-items: center; gap: .35rem; line-height: 1.2; }
    body.dpd-ui .ui-solo .card { position: relative; background: var(--ui-card); border: 1px solid var(--ui-line); border-radius: var(--ui-r-card); box-shadow: var(--ui-shadow); padding: 1.25rem 1.4rem; min-width: 0; }
    /* the auth card */
    body.dpd-ui .ui-auth-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; background: var(--ui-paper); border-top: 4px solid var(--ui-brass); }
    body.dpd-ui .ui-auth-card {
        position: relative; width: 100%; max-width: 410px; padding: 1.75rem 1.75rem 1.6rem 2rem; overflow: hidden;
        background: var(--ui-card); border: 1px solid var(--ui-line); border-radius: 12px;
        box-shadow: 0 14px 34px -16px rgba(34, 29, 20, .32), var(--ui-shadow);
    }
    body.dpd-ui .ui-auth-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--ui-brass); }
    body.dpd-ui .ui-auth-card--wide { max-width: 450px; }
    body.dpd-ui .ui-auth-brand { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.35rem; }
    body.dpd-ui .ui-auth-mark { width: 40px; height: 40px; flex: none; border-radius: 10px; background: var(--ui-brass); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1rem; letter-spacing: .01em; }
    body.dpd-ui .ui-auth-name { font-weight: 700; font-size: .95rem; line-height: 1.2; }
    body.dpd-ui .ui-auth-tag { font-size: .68rem; letter-spacing: .09em; text-transform: uppercase; color: var(--ui-faint); font-weight: 600; }
    body.dpd-ui .ui-auth-title { font-family: var(--ui-display); font-weight: 600; font-size: 1.6rem; line-height: 1.2; letter-spacing: -.01em; color: var(--ui-ink); margin: 0 0 .4rem; }
    body.dpd-ui .ui-auth-sub { color: var(--ui-muted); font-size: .85rem; line-height: 1.55; margin: 0 0 1.35rem; }
    body.dpd-ui .ui-auth-field { margin-bottom: 1rem; }
    body.dpd-ui .ui-auth-actions { margin-top: 1.25rem; }
    body.dpd-ui .ui-auth-links { text-align: center; color: var(--ui-muted); font-size: .82rem; margin-top: 1rem; }
    body.dpd-ui .ui-auth-links + .ui-auth-links { margin-top: .5rem; }
    body.dpd-ui .ui-auth-note { color: var(--ui-muted); font-size: .78rem; line-height: 1.5; margin-top: 1rem; }
    body.dpd-ui .ui-auth-card .alert { margin-bottom: 1rem; }
    body.dpd-ui .ui-auth-title + .alert { margin-top: 1rem; }
    /* a single centred column page of the client portal (edit my details, verify my details) */
    body.dpd-ui .ui-solo-page { max-width: 760px; margin: 0 auto; padding: 1.75rem 1.25rem 3rem; }
    body.dpd-ui .ui-solo-page--md { max-width: 900px; }
    body.dpd-ui .ui-backlink { display: inline-block; margin-bottom: .9rem; font-size: .85rem; font-weight: 600; text-decoration: none; }
    body.dpd-ui .ui-backlink:hover { text-decoration: underline; }
    body.dpd-ui .ui-solo-title { font-family: var(--ui-display); font-weight: 600; font-size: clamp(1.6rem, 3vw, 2rem); line-height: 1.2; letter-spacing: -.01em; margin: 0 0 .4rem; }
    body.dpd-ui .ui-solo-intro { color: var(--ui-muted); font-size: .9rem; margin: 0 0 1.25rem; }
    body.dpd-ui .ui-solo-h2 { font-family: var(--ui-display); font-weight: 600; font-size: 1.3rem; margin: 2rem 0 .85rem; }
    /* a neutral status line (saved / could not save) - empty means nothing is drawn */
    body.dpd-ui .ui-status { margin: 0 0 1rem; padding: .65rem .9rem; border: 1px solid var(--ui-brass-line); border-radius: var(--ui-r-ctl); background: var(--ui-brass-soft); color: var(--ui-brass-ink); font-size: .9rem; font-weight: 600; }
    body.dpd-ui .ui-status:empty { display: none; }
    body.dpd-ui .ui-solo .ui-hint { margin: 0 0 .5rem; }
    /* a form laid out as two columns (one on a phone); a .ui-fld-wide field takes the whole row */
    body.dpd-ui .ui-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem 1.25rem; margin-top: 1.25rem; }
    body.dpd-ui .ui-fld { min-width: 0; }
    body.dpd-ui .ui-fld-wide { grid-column: 1 / -1; }
    /* ===== 10d. facts row (a small label above each value: invoice / amount / status) and link-style pills ===== */
    body.dpd-ui .ui-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: .85rem 1.5rem; margin: 0; padding: .9rem 1.1rem; background: var(--ui-paper); border: 1px solid var(--ui-line); border-radius: var(--ui-r-ctl); }
    body.dpd-ui .ui-facts dt { font-size: .68rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ui-faint); margin: 0 0 .2rem; }
    body.dpd-ui .ui-facts dd { margin: 0; font-size: .95rem; color: var(--ui-ink); overflow-wrap: anywhere; }
    body.dpd-ui a.ui-pill { display: inline-flex; align-items: center; text-decoration: none; }
    body.dpd-ui a.ui-pill:hover { color: var(--ui-ink); }
    /* ===== 10e. detail screens: label / value pairs, the "find a file" result (record header + tiles), underline tab strip, green / amber buttons ===== */
    body.dpd-ui .ui-field-l { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ui-faint); margin-bottom: .15rem; }
    body.dpd-ui .ui-field-v { font-size: .9rem; color: var(--ui-ink); overflow-wrap: anywhere; }
    body.dpd-ui .ui-lookup-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; padding-bottom: .9rem; border-bottom: 1px solid var(--ui-line); }
    body.dpd-ui .ui-lookup-file { display: inline-block; font-family: var(--ui-mono); font-size: .72rem; font-weight: 600; letter-spacing: .04em; padding: .2rem .55rem; border-radius: 6px; background: var(--ui-brass-soft); color: var(--ui-brass-ink); margin-bottom: .4rem; }
    body.dpd-ui .ui-lookup-name { font-size: 1.125rem; font-weight: 650; line-height: 1.2; }
    body.dpd-ui .ui-lookup-sub { font-size: .8125rem; color: var(--ui-muted); margin-top: .15rem; }
    body.dpd-ui .ui-lookup-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .65rem; margin-top: .9rem; }
    body.dpd-ui .ui-lookup-tile { background: #fff; border: 1px solid var(--ui-line); border-radius: 10px; padding: .65rem .8rem; display: flex; gap: .65rem; align-items: flex-start; }
    body.dpd-ui .ui-lookup-tile.wide { grid-column: 1 / -1; }
    body.dpd-ui .ui-lookup-ic { width: 28px; height: 28px; border-radius: 7px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--ui-brass-soft); color: var(--ui-brass-ink); }
    body.dpd-ui .ui-lookup-label { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ui-faint); }
    body.dpd-ui .ui-lookup-value { font-size: .875rem; font-weight: 550; margin-top: .1rem; overflow-wrap: anywhere; }
    body.dpd-ui .nav-tabs { display: flex; flex-wrap: nowrap; gap: .25rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--ui-line); overflow-x: auto; scrollbar-width: thin; }
    body.dpd-ui .nav-tabs .nav-link { flex: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; margin-bottom: -1px; padding: .7rem 1rem; background: transparent; color: var(--ui-muted); font-size: .875rem; font-weight: 600; white-space: nowrap; }
    body.dpd-ui .nav-tabs .nav-link:hover { color: var(--ui-ink); border-bottom-color: var(--ui-line-strong); background: transparent; }
    body.dpd-ui .nav-tabs .nav-link.active { color: var(--ui-brass-ink); border-bottom-color: var(--ui-brass); background: transparent; }
    body.dpd-ui .nav-tabs .nav-link:focus-visible { outline: 3px solid #b38a3c; outline-offset: -3px; }
    body.dpd-ui .btn-outline-success { color: var(--ui-seal); border-color: var(--ui-seal-line); background: #fff; }
    body.dpd-ui .btn-outline-success:hover { background: var(--ui-seal-soft); border-color: var(--ui-seal); color: var(--ui-seal); }
    body.dpd-ui .btn-success { background: var(--ui-seal); border-color: var(--ui-seal); color: #fff; }
    body.dpd-ui .btn-success:hover { background: #254a37; border-color: #254a37; color: #fff; }
    body.dpd-ui .btn-warning { background: var(--ui-rust); border-color: var(--ui-rust); color: #fff; }
    body.dpd-ui .btn-warning:hover { background: #9a4626; border-color: #9a4626; color: #fff; }
    /* ===== 10f. Platform console (master-admin pages): a Tabler page with NO sidebar, so it cannot load dpd-theme.css ===== */
    /* The wrapper element of such a page is  <div class="page ui-platform">. These pages used to repeat a hand-copied button-polish block;
       the same hover / press feel now lives here, scoped to the console so no tenant page changes. */
    body.dpd-ui .ui-platform > .page-wrapper > header.navbar { background: #fff; border-bottom: 1px solid var(--ui-line); box-shadow: none; min-height: 3.4rem; }
    body.dpd-ui .ui-platform .platform-mark {
        width: 34px; height: 34px; border-radius: 8px; background: var(--ui-brass); color: #fff; flex: none;
        display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem;
    }
    body.dpd-ui .ui-platform .navbar-brand { color: var(--ui-ink); }
    body.dpd-ui .ui-platform .btn { transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .18s ease, transform .12s ease-out; }
    body.dpd-ui .ui-platform .btn:active:not(.disabled):not(:disabled):not(.btn-link) { transform: scale(.97); }
    body.dpd-ui .ui-platform .btn-primary { box-shadow: 0 1px 2px rgba(34, 29, 20, .16), 0 1px 3px rgba(150, 112, 15, .25); }
    body.dpd-ui .ui-platform .btn-primary:hover { box-shadow: 0 4px 10px -2px rgba(34, 29, 20, .2), 0 2px 6px rgba(150, 112, 15, .3); transform: translateY(-1px); }
    body.dpd-ui .ui-platform .btn-primary:active:not(.disabled):not(:disabled) { box-shadow: 0 1px 2px rgba(34, 29, 20, .14); transform: scale(.97); }
    /* a tab strip that sits inside a card header (Manage tenant): flush with the header, no second rule under it */
    body.dpd-ui .nav-tabs.card-header-tabs { margin: -1rem -1.5rem -1px; padding: 0 1.5rem; border-bottom: 0; background: transparent; border-radius: 0; }
    /* the tinted "add a new row" band under a rate grid, and the tab pane body of the console */
    body.dpd-ui .ui-addrow { background: rgba(34, 29, 20, .03); border-top: 1px solid var(--ui-line); border-radius: 0 0 var(--ui-r-card) var(--ui-r-card); }
    body.dpd-ui .ui-addrow .ui-addrow-title { font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ui-faint); margin-bottom: .5rem; }
    /* ===== 11. keyboard focus ===== */
    body.dpd-ui .btn:focus-visible,
    body.dpd-ui .dpd-section-jump a:focus-visible { outline: 3px solid #b38a3c; outline-offset: 2px; }
    /* ===== 12. phone: single column, 16px gutters, 44px touch targets; a .ui-stack table becomes a list of cards ===== */

}

@media screen and (max-width: 767.98px) {
    body.dpd-ui .page-wrapper .card-header { padding: .9rem 1rem; }
    body.dpd-ui .page-wrapper .card-body { padding: 1rem; }
    body.dpd-ui .page-wrapper .card-footer { padding: .9rem 1rem; }
    body.dpd-ui .dpd-table-tools { padding: .6rem 1rem; }
    body.dpd-ui .btn { min-height: 44px; }
    body.dpd-ui .btn-sm { min-height: 38px; }
    body.dpd-ui .page-wrapper .card-footer .btn { flex: 1 1 100%; justify-content: center; }
    body.dpd-ui .form-control,
    body.dpd-ui .form-select { min-height: 44px; font-size: 16px; }
    body.dpd-ui .page-header .btn-list,
    body.dpd-ui .page-header .col-auto { width: 100%; }
    body.dpd-ui .page-header .col-auto.ms-auto { margin-left: 0 !important; }
    body.dpd-ui .page-header .col-auto .btn { flex: 1 1 auto; justify-content: center; }
    body.dpd-ui .ui-head { flex-wrap: wrap; }
    body.dpd-ui .ui-lookup-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    body.dpd-ui .page-wrapper .card-header { flex-wrap: wrap; row-gap: .6rem; }
    body.dpd-ui .page-wrapper .card-header .card-actions { margin-left: 0; width: 100%; flex-wrap: wrap; }
    body.dpd-ui .ui-filterbar { padding: .9rem 1rem; }
    body.dpd-ui .ui-filterbar > * { flex: 1 1 100% !important; }
    body.dpd-ui .ui-filterbar > .ui-fbtns .btn { flex: 1 1 auto; }
    body.dpd-ui .ui-kpis { grid-template-columns: 1fr; gap: .75rem; }
    body.dpd-ui .ui-kpi-v { font-size: 1.3rem; }
    body.dpd-ui .table-wrap th:first-child,
    body.dpd-ui .table th:first-child,
    body.dpd-ui .table-wrap td:first-child,
    body.dpd-ui .table td:first-child { padding-left: 1rem; }
    body.dpd-ui .dpd-section-jump { margin-bottom: 1rem; }
    body.dpd-ui .ui-platform > .page-wrapper > header.navbar .navbar-nav { flex-wrap: wrap; justify-content: flex-end; row-gap: .4rem; }
    body.dpd-ui .nav-tabs.card-header-tabs { margin: -.9rem -1rem -1px; padding: 0 1rem; }
    body.dpd-ui .ui-stack table,
    body.dpd-ui .ui-stack tbody { display: block; width: 100%; }
    body.dpd-ui .ui-stack tr.ui-hrow { display: none; }
    body.dpd-ui .ui-stack tr { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem 1rem; padding: .9rem 1rem; border-bottom: 1px solid var(--ui-line); }
    body.dpd-ui .ui-stack tr:last-child { border-bottom: 0; }
    body.dpd-ui .ui-stack td { display: block; padding: 0 !important; border: 0; min-width: 0; overflow-wrap: anywhere; background: transparent !important; box-shadow: none !important; }
    body.dpd-ui .ui-stack td[data-label]::before { content: attr(data-label); display: block; font-size: .64rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ui-faint); margin-bottom: .1rem; }
    body.dpd-ui .ui-stack td:first-child { grid-column: 1 / -1; }
    body.dpd-ui .ui-stack td:first-child::before,
    body.dpd-ui .ui-stack td.ui-actions::before { display: none; }
    body.dpd-ui .ui-stack td.ui-wide { grid-column: 1 / -1; }
    body.dpd-ui .ui-stack td.ui-first-action { grid-column: 1; }
    body.dpd-ui .ui-stack td.ui-actions { display: flex; gap: .5rem; flex-wrap: wrap; padding-top: .35rem !important; align-items: center; }
    body.dpd-ui .ui-stack td.ui-actions .btn { flex: 1 1 auto; min-height: 40px; }
    body.dpd-ui .ui-stack td[colspan] { grid-column: 1 / -1; }
    body.dpd-ui .ui-stack .ui-cell { min-width: 0; }
    body.dpd-ui .ui-stack td.ui-num { text-align: left !important; white-space: normal; }
    body.dpd-ui .ui-stack .dpd-table-tools details,
    body.dpd-ui .ui-stack .dpd-table-tools button:last-of-type { display: none; }
    /* touch has no hover: the Copy helper sits inline next to the value */
    body.dpd-ui .table-wrap td .dpd-copy,
    body.dpd-ui .table td .dpd-copy { opacity: 1; position: static; transform: none; margin-left: .4rem; }
}

@media screen and (max-width: 575.98px) {
    body.dpd-ui .page-wrapper > header.navbar { min-height: 0; padding: .25rem 0; }
    /* the auth card sits near the top on a phone (the keyboard opens below it) and gives its width back to the fields */
    body.dpd-ui .ui-auth-shell { align-items: flex-start; padding: 1.75rem .75rem 1.5rem; }
    body.dpd-ui .ui-auth-card { padding: 1.4rem 1.15rem 1.3rem 1.4rem; }
    body.dpd-ui .ui-auth-title { font-size: 1.45rem; }
    body.dpd-ui .ui-solo-page { padding: 1.25rem 1rem 2.5rem; }
    body.dpd-ui .ui-solo .card { padding: 1rem 1.1rem; }
    body.dpd-ui .ui-fields { grid-template-columns: 1fr; }
}

@media screen and (prefers-reduced-motion: reduce) {
    body.dpd-ui .ui-platform .btn { transition: none; }
    body.dpd-ui .ui-platform .btn:active:not(.disabled):not(:disabled):not(.btn-link),
    body.dpd-ui .ui-platform .btn-primary:hover { transform: none; }
}
