﻿/* ============================================================================
   ct-kit.css  -  what ctplus.css does not cover.

   ctplus.css is carried over from the Wisej portal UNCHANGED and still owns the
   look: tokens, colours, cards, tables, buttons, the sidebar and topbar skins.
   What it never had to describe is PAGE LAYOUT, because Wisej positioned the
   sidebar, topbar and content by docking them in VB. This file supplies that
   layout in CSS, plus the handful of widgets the kit introduces (toasts, modal,
   dropdown placement, form inputs) - all built from the same tokens, so they
   inherit light/dark mode for free.
   ============================================================================ */

/* ----------------------------------------------------------------- shell */

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    font-family: var(--font);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

.ct-root {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.ct-sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    transition: width .18s ease;
}

.ct-main {
    flex: 1;
    min-width: 0;             /* lets wide tables scroll instead of stretching the page */
    display: flex;
    flex-direction: column;
}

.ct-topbar {
    height: var(--topbar-h);
    flex-shrink: 0;
}

.ct-content {
    flex: 1;
    min-height: 0;
}

    .ct-content.ct-loading {
        opacity: .55;
        pointer-events: none;
        transition: opacity .12s;
    }

/* --- collapsed sidebar: icons only, exactly as the old shell's collapsed state --- */

.ct-collapsed .ct-sidebar {
    width: 64px;
}

.ct-collapsed .ct-ni-cap,
.ct-collapsed .ct-nav-grp,
.ct-collapsed .ct-bt,
.ct-collapsed .ct-nav-badge,
.ct-collapsed .ct-live-dot {
    display: none;
}

.ct-collapsed .ct-nav-item {
    justify-content: center;
    padding-left: 12px;
    padding-right: 12px;
}

.ct-collapsed .ct-sb-brand {
    padding-left: 0;
    justify-content: center;
}

/* --- sidebar bits the new markup adds --- */

.ct-sb-logo {
    height: 26px;
    width: auto;
    flex-shrink: 0;
}

.ct-nav-item {
    text-decoration: none;
}

    /* The gold accent bar on the selected row: a real pseudo-element now, where the
       Wisej shell had to emit an inline <span> because ::before did not reach it. */
    .ct-nav-item.on::before {
        content: "";
        position: absolute;
        left: 0;
        top: 8px;
        bottom: 8px;
        width: 3px;
        border-radius: 3px;
        background: var(--gold-500);
    }

    .ct-nav-item.on .ct-ni-ico {
        color: var(--gold-400);
    }

.ct-ni-ico {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.ct-ni-cap {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ct-nav-badge {
    margin-left: auto;
    background: var(--gold-500);
    color: #3A2A06;
    font-size: 10.5px;
    font-weight: 800;
    border-radius: 20px;
    min-width: 19px;
    height: 19px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

.ct-live-dot {
    margin-left: auto;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #3FD68C;
}

.ct-sb-foot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 52px;
    flex-shrink: 0;
    width: 100%;
    background: none;
    border: 0;
    border-top: 1px solid var(--sidebar-line);
    color: var(--sidebar-ink);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
}

    .ct-sb-foot:hover {
        color: #fff;
        background: rgba(255,255,255,.05);
    }

.ct-sb-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px 18px;
}

/* --- topbar bits --- */

.ct-tenant-switch {
    font-family: inherit;
}

    .ct-tenant-switch.ct-locked {
        cursor: default;
    }

        .ct-tenant-switch.ct-locked:hover {
            border-color: var(--line);
        }

.ct-ts-caret {
    color: var(--muted);
    font-size: 12px;
    flex-shrink: 0;
}

.ct-topbar-user {
    background: none;
    border: 0;
    border-left: 1px solid var(--line);
    font-family: inherit;
    cursor: pointer;
    height: 38px;
}

.ct-tu-meta {
    line-height: 1.2;
    text-align: left;
}

    .ct-tu-meta b {
        display: block;
        font-size: 13px;
        color: var(--ink);
        font-weight: 700;
    }

    .ct-tu-meta small {
        display: block;
        font-size: 11px;
        color: var(--muted);
    }

.ct-icon-btn {
    background: none;
    font-size: 16px;
}

.ct-theme-toggle {
    flex-shrink: 0;
}

/* EN | FR - the language of this browser (Lang.vb). The chosen one is filled in. */
.ct-lang-toggle {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    height: 26px;
    padding: 2px;
    border-radius: 20px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    cursor: pointer;
    font: 700 11px/1 inherit;
    letter-spacing: .04em;
    color: var(--ink-3, var(--muted));
}
.ct-lang-toggle span {
    padding: 4px 7px;
    border-radius: 16px;
}
.ct-lang-toggle span.on {
    background: var(--brand-600);
    color: #fff;
}
.ct-lang-toggle:hover {
    border-color: var(--brand-600);
}
.ct-lang-float {
    position: fixed;
    top: 16px;
    right: 18px;
    z-index: 20;
}

/* --------------------------------------------------------------- page head */

.ct-page-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.ct-prompt {
    color: var(--muted);
    text-align: center;
    padding: 36px;
}

.ct-empty {
    color: var(--muted);
    text-align: center;
    padding: 30px;
    font-size: 13.5px;
}

.ct-noaccess {
    max-width: 440px;
    margin: 14vh auto;
    text-align: center;
    font-family: var(--font);
}

    .ct-noaccess h1 {
        font-size: 21px;
        color: var(--ink);
    }

    .ct-noaccess p {
        color: var(--muted);
        font-size: 14px;
        margin-bottom: 20px;
    }

/* ------------------------------------------------------------------ forms */

.ct-input {
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink);
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: .14s;
}

    .ct-input:focus {
        border-color: var(--brand-400);
        box-shadow: 0 0 0 3px var(--brand-50);
    }

    .ct-input::placeholder {
        color: var(--faint);
    }

select.ct-input {
    cursor: pointer;
    padding-right: 6px;
}

textarea.ct-input {
    height: auto;
    padding: 8px 10px;
    line-height: 1.5;
    resize: vertical;
}

/* ============================================================================
   Date / time picker - the Wisej DateTimePicker, rebuilt as our own control.

   Drawn the way Wisej drew it: the value on the left, a calendar button in its
   own strip on the right behind a hairline divider, and a drop-down month grid
   below. Unlike <input type="date"> this is the same control in every browser,
   and it can do time - Wisej had pickers set to DateTimePickerFormat.DateTime
   and the native input simply cannot.
   ============================================================================ */
.ct-dtp {
    position: relative;
    display: inline-flex;
    align-items: stretch;
}

    .ct-dtp .ct-dtp-text {
        min-width: 150px;
        width: 100%;
        padding-right: 36px;
    }

    /* the calendar button, in its strip */
    .ct-dtp .ct-dtp-open {
        position: absolute;
        top: 1px;
        right: 1px;
        bottom: 1px;
        width: 30px;
        padding: 0;
        border: 0;
        border-left: 1px solid var(--line);
        border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
        background: transparent no-repeat center / 18px 18px;
        background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'%3E%3Crect x='1.4' y='3' width='15.2' height='13.6' rx='2' fill='none' stroke='%23647488' stroke-width='1.4'/%3E%3Cpath d='M1.4 7.2h15.2' stroke='%23647488' stroke-width='1.4'/%3E%3Cpath d='M5.6 1.2v3.2M12.4 1.2v3.2' stroke='%23647488' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
        cursor: pointer;
        transition: .14s;
    }

    .ct-dtp .ct-dtp-open:hover,
    .ct-dtp.is-open .ct-dtp-open {
        background-color: var(--brand-50);
        background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'%3E%3Crect x='1.4' y='3' width='15.2' height='13.6' rx='2' fill='none' stroke='%23105090' stroke-width='1.4'/%3E%3Cpath d='M1.4 7.2h15.2' stroke='%23105090' stroke-width='1.4'/%3E%3Cpath d='M5.6 1.2v3.2M12.4 1.2v3.2' stroke='%23105090' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
    }

    /* Empty means "no bound". The placeholder has to read as an empty field rather
       than as data - the same reason the old native input needed greying. */
    .ct-dtp[data-empty] .ct-dtp-text::placeholder {
        color: var(--muted);
        opacity: .7;
    }

    /* ---- the drop-down ---- */
    .ct-dtp .ct-dtp-pop {
        display: none;
        position: absolute;
        z-index: 60;
        top: calc(100% + 4px);
        left: 0;
        min-width: 252px;
        padding: 8px;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: var(--surface);
        box-shadow: 0 10px 28px rgba(16, 32, 56, .16);
    }

    .ct-dtp.is-open .ct-dtp-pop {
        display: block;
    }

    /* opens upwards when the field is low on screen and the kit says so */
    .ct-dtp.is-up .ct-dtp-pop {
        top: auto;
        bottom: calc(100% + 4px);
    }

.ct-dtp-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 2px 8px;
}

.ct-dtp-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--ink);
}

.ct-dtp-nav {
    width: 26px;
    height: 26px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ink-2);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

    .ct-dtp-nav:hover {
        background: var(--brand-50);
        border-color: var(--line);
        color: var(--brand-600);
    }

.ct-dtp-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.ct-dtp-dow {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    padding-bottom: 4px;
}

.ct-dtp-pad {
    height: 30px;
}

.ct-dtp-day {
    height: 30px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ink);
    font-size: 12.5px;
    cursor: pointer;
}

    .ct-dtp-day:hover {
        background: var(--brand-50);
        border-color: var(--brand-300);
    }

    /* today is outlined, the selection is filled - so "today" never looks chosen */
    .ct-dtp-day.is-today {
        border-color: var(--brand-400);
        font-weight: 600;
    }

    .ct-dtp-day.is-sel {
        background: var(--brand-600);
        border-color: var(--brand-600);
        color: #fff;
        font-weight: 600;
    }

.ct-dtp-time {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
}

    .ct-dtp-time label {
        font-size: 11px;
        font-weight: 600;
        color: var(--muted);
        margin-right: auto;
    }

    .ct-dtp-time input {
        width: 52px;
        height: 28px;
        padding: 0 6px;
        border: 1px solid var(--line);
        border-radius: var(--radius-sm);
        background: var(--surface);
        color: var(--ink);
        font-family: var(--mono);
        font-size: 12.5px;
        text-align: center;
    }

.ct-dtp-foot {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
}

/* ---- the retired native control -------------------------------------------
   .ct-date was <input type="date"> dressed with a background image. Kept only
   so a screen that still emits it is not left unstyled; new work uses .ct-dtp. */
.ct-date {
    min-width: 150px;
    position: relative;
    padding-right: 34px;
    background-repeat: no-repeat;
    background-position: right 0 center;
    background-size: 30px 100%;
    /* the divider and the calendar glyph, drawn in the field's own colours */
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='32' viewBox='0 0 30 32'%3E%3Cpath d='M0.5 3 V29' stroke='%23E5EAF0' stroke-width='1'/%3E%3Crect x='9' y='9.5' width='13' height='12.5' rx='2' fill='none' stroke='%23647488' stroke-width='1.4'/%3E%3Cpath d='M9 13.5h13' stroke='%23647488' stroke-width='1.4'/%3E%3Cpath d='M12.6 7.5v3M18.4 7.5v3' stroke='%23647488' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
}

    .ct-date:hover {
        background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='32' viewBox='0 0 30 32'%3E%3Cpath d='M0.5 3 V29' stroke='%23E5EAF0' stroke-width='1'/%3E%3Crect x='9' y='9.5' width='13' height='12.5' rx='2' fill='none' stroke='%23105090' stroke-width='1.4'/%3E%3Cpath d='M9 13.5h13' stroke='%23105090' stroke-width='1.4'/%3E%3Cpath d='M12.6 7.5v3M18.4 7.5v3' stroke='%23105090' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
    }

    /* invisible, but still the thing that opens the picker */
    .ct-date::-webkit-calendar-picker-indicator {
        position: absolute;
        top: 0;
        right: 0;
        width: 30px;
        height: 100%;
        margin: 0;
        padding: 0;
        opacity: 0;
        cursor: pointer;
    }

    /* Chrome draws its own spin/clear affordances inside the value; Wisej had neither */
    .ct-date::-webkit-inner-spin-button,
    .ct-date::-webkit-clear-button {
        display: none;
    }

    /* An empty date means "no bound", so the mm/dd/yyyy the browser draws should read as
       a placeholder, not as a value. ct-kit.js sets data-empty on a field with no value. */
    .ct-date[data-empty]:not(:focus)::-webkit-datetime-edit {
        color: var(--faint);
    }

[data-theme=dark] .ct-date {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='32' viewBox='0 0 30 32'%3E%3Cpath d='M0.5 3 V29' stroke='%2328333F' stroke-width='1'/%3E%3Crect x='9' y='9.5' width='13' height='12.5' rx='2' fill='none' stroke='%238295A8' stroke-width='1.4'/%3E%3Cpath d='M9 13.5h13' stroke='%238295A8' stroke-width='1.4'/%3E%3Cpath d='M12.6 7.5v3M18.4 7.5v3' stroke='%238295A8' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
}

    [data-theme=dark] .ct-date:hover {
        background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='32' viewBox='0 0 30 32'%3E%3Cpath d='M0.5 3 V29' stroke='%2328333F' stroke-width='1'/%3E%3Crect x='9' y='9.5' width='13' height='12.5' rx='2' fill='none' stroke='%233C84C7' stroke-width='1.4'/%3E%3Cpath d='M9 13.5h13' stroke='%233C84C7' stroke-width='1.4'/%3E%3Cpath d='M12.6 7.5v3M18.4 7.5v3' stroke='%233C84C7' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
    }

    /* the dark theme leaves the native value text black otherwise */
    [data-theme=dark] .ct-date::-webkit-datetime-edit {
        color: var(--ink);
    }

.ct-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .ct-field > label {
        font-size: 11px;
        font-weight: 700;
        letter-spacing: .4px;
        color: var(--muted);
        text-transform: uppercase;
    }

/* The search panel is a raised card, as it is in Wisej, not a flat strip with a hairline under it.
   Wisej's CardStyle() verbatim: surface, 1px line, 12px radius, and the same two-layer shadow. */
.ct-toolbar {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(16, 40, 72, .08), 0 1px 3px rgba(16, 40, 72, .06);
    margin-bottom: 14px;
}

/* A toolbar that is already inside a card must not draw a second one. */
.ct-card .ct-toolbar,
.ct-tn-form .ct-toolbar {
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0;
}

.ct-busy {
    opacity: .6;
    pointer-events: none;
}

/* The button that was pressed, until its answer comes back. */
.ct-working {
    pointer-events: none;
}

.ct-btn.ct-working::before {
    content: "";
    flex: none;
    width: 13px;
    height: 13px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: ct-spin .7s linear infinite;
}

/* The bar across the top. It waits a moment, so quick answers do not make the page flicker. */
html.ct-working-on::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10001;
    width: 35%;
    height: 3px;
    background: var(--brand-600);
    transform: translateX(-100%);
    animation: ct-working-bar 1.1s ease-in-out .2s infinite;
    pointer-events: none;
}

@keyframes ct-spin {
    to { transform: rotate(360deg); }
}

@keyframes ct-working-bar {
    from { transform: translateX(-100%); }
    to { transform: translateX(300%); }
}

@media (prefers-reduced-motion: reduce) {
    .ct-btn.ct-working::before {
        animation-duration: 2.5s;
    }

    html.ct-working-on::before {
        width: 100%;
        transform: none;
        animation: none;
    }
}

/* -------------------------------------------------------------- dropdowns */

/* ctplus.css styles the dropdown; the kit only has to place it, since it is
   appended to <body> so it can never be clipped by a scrolling pane. */
.ct-dd {
    position: absolute;
    z-index: 2000;
    min-width: 230px;
    max-width: 380px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 5px;
}

.ct-dd-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: none;
    font-family: inherit;
    font-size: 13px;
    color: var(--ink);
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

    .ct-dd-item:hover {
        background: var(--surface-2);
    }

    .ct-dd-item small {
        display: block;
        font-size: 10.5px;
        color: var(--muted);
        font-weight: 500;
    }

    .ct-dd-item.ct-dd-danger {
        color: var(--danger);
    }

.ct-dd-head {
    padding: 9px 11px 7px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--muted);
}

    .ct-dd-head small {
        display: block;
        text-transform: none;
        letter-spacing: 0;
        font-weight: 500;
        color: var(--faint);
    }

.ct-dd-divider {
    height: 1px;
    background: var(--line);
    margin: 5px 0;
}

.ct-dd-empty {
    padding: 16px 12px;
    color: var(--muted);
    font-size: 12.5px;
    text-align: center;
}

/* alert severities in the bell menu */
.ct-alert-danger {
    border-left: 3px solid var(--danger);
}

.ct-alert-warn {
    border-left: 3px solid var(--warn);
}

.ct-alert-info {
    border-left: 3px solid var(--info);
}

/* ----------------------------------------------------------------- modal */

.ct-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(11,32,58,.42);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

    .ct-modal[hidden] {
        display: none;
    }

.ct-modal-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 640px;
    width: 100%;
    max-height: 86vh;
    overflow-y: auto;
}

/* ------------------------------------------------------------- confirm

   The portal's own "are you sure", in place of window.confirm. It layers ABOVE .ct-modal (3000)
   and the drawer (2600), because most of these questions are asked from inside one of those and
   the thing being confirmed has to stay visible behind the question. */

.ct-confirm {
    position: fixed;
    inset: 0;
    z-index: 3500;
    background: rgba(11,32,58,.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

    .ct-confirm[hidden] {
        display: none;
    }

body.ct-confirm-on {
    overflow: hidden;
}

.ct-confirm-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 440px;
}

.ct-confirm-head {
    padding: 20px 22px 0;
}

    .ct-confirm-head h2 {
        margin: 0;
        font-size: 16px;
        font-weight: 700;
        color: var(--ink);
    }

.ct-confirm-body {
    padding: 8px 22px 4px;
}

    .ct-confirm-body p {
        margin: 0;
        font-size: 13.5px;
        line-height: 1.55;
        color: var(--muted);
    }

.ct-confirm-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 18px 22px 20px;
}

.ct-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px 14px;
    border-bottom: 1px solid var(--line);
}

    .ct-modal-head h2 {
        margin: 0;
        font-size: 16px;
        font-weight: 700;
        color: var(--ink);
    }

.ct-modal-body {
    padding: 20px 22px;
}

.ct-modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 22px 20px;
}

.ct-x {
    background: none;
    border: 0;
    font-size: 20px;
    line-height: 1;
    color: var(--muted);
    cursor: pointer;
}

    .ct-x:hover {
        color: var(--ink);
    }

/* ---------------------------------------------------------------- toasts */

.ct-toasts {
    position: fixed;
    right: 20px;
    top: 20px;
    z-index: 10000;             /* above everything: dialogs, questions and the cheque viewer too */
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 9px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    pointer-events: none;
}

.ct-toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: none;
    box-sizing: border-box;
    min-width: 230px;
    max-width: min(400px, calc(100vw - 40px));
    overflow-wrap: anywhere;
    pointer-events: auto;
    padding: 12px 15px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 4px solid var(--ok);
    box-shadow: var(--shadow), 0 6px 24px rgba(14, 31, 54, .18);
    font-size: 13px;
    color: var(--ink);
    opacity: 0;
    transform: translateY(-8px);
    transition: .22s ease;
}

    .ct-toast.in {
        opacity: 1;
        transform: none;
    }

    .ct-toast > span {
        flex: 1;
    }

.ct-toast-x {
    flex: none;
    margin: -3px -5px 0 0;
    padding: 0 4px;
    border: 0;
    background: none;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.3;
    cursor: pointer;
}

    .ct-toast-x:hover {
        color: var(--ink);
    }

/* Tinted, so an alert stands out on a white page. Over the surface colour: in the dark theme the
   tints are see-through. */
.ct-toast-ok {
    background: linear-gradient(var(--ok-bg), var(--ok-bg)), var(--surface);
}

.ct-toast-err {
    border-left-color: var(--danger);
    background: linear-gradient(var(--danger-bg), var(--danger-bg)), var(--surface);
}

.ct-toast-warn {
    border-left-color: var(--warn);
    background: linear-gradient(var(--warn-bg), var(--warn-bg)), var(--surface);
}

.ct-toast-info {
    border-left-color: var(--info);
    background: linear-gradient(var(--brand-50), var(--brand-50)), var(--surface);
}

/* ----------------------------------------------------------------- login */

.ct-login {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #0C2E52 url('/Images/splash-bg.svg') center center / cover no-repeat;
    padding: 24px;
}

.ct-login-card {
    width: 100%;
    max-width: 390px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 34px 32px 30px;
}

.ct-login-brand {
    text-align: center;
    margin-bottom: 24px;
}

    /* Wisej measurements: a 66px gold-ringed circle, the lock at 30px, then the Benok logo at 24px.
       This block sits ON the navy splash, not inside the white card, so its text is white and gold. */
    .ct-login-brand .lock {
        width: 66px;
        height: 66px;
        margin: 0 auto 16px;
        border-radius: 50%;
        border: 3px solid #F0A92B;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 30px;
        color: #F6BD52;
        line-height: 1;
    }

    .ct-login-brand .blogo {
        height: 24px;
        width: auto;
        display: block;
        margin: 0 auto;
    }

    .ct-login-brand .nm {
        font: 800 27px var(--font);
        letter-spacing: 1px;
        color: #fff;
        margin-top: 10px;
    }

    .ct-login-brand .sb {
        font: 700 11.5px var(--font);
        letter-spacing: 5px;
        color: #F6BD52;
        margin-top: 5px;
    }

/* Wisej opens its card with this pair. */
.ct-login-head {
    margin-bottom: 14px;
}

    .ct-login-head h1 {
        font: 800 20px var(--font);
        letter-spacing: -0.3px;
        color: var(--ink);
        margin: 0;
    }

    .ct-login-head p {
        font-size: 13px;
        color: var(--muted);
        margin: 2px 0 0;
    }

.ct-login .ct-field {
    margin-bottom: 14px;
}

.ct-login .ct-input {
    height: 40px;
    width: 100%;
}

.ct-login .ct-btn {
    width: 100%;
    height: 42px;
    margin-top: 6px;
}

.ct-login-err {
    background: var(--danger-bg);
    color: var(--danger);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 12.5px;
    margin-bottom: 14px;
}

.ct-login-foot {
    text-align: center;
    margin-top: 18px;
    font-size: 11px;
    color: var(--faint);
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 900px) {
    .ct-sidebar {
        width: 64px;
    }

        .ct-sidebar .ct-ni-cap,
        .ct-sidebar .ct-nav-grp,
        .ct-sidebar .ct-bt {
            display: none;
        }

    .ct-tenant-switch {
        min-width: 0;
    }

    .ct-ts-meta {
        display: none;
    }

    .ct-tu-meta {
        display: none;
    }

    .ct-content {
        padding: 18px 14px 32px;
    }
}

/* ------------------------------------------------------------- data grids */

/* The list-screen table. The Wisej screens emitted these rules inline on every
   render; they are identical, so they live here once. */

.ct-grid-pane {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 420px;
}

.ct-tbl-wrap {
    overflow: auto;
    background: var(--surface);
    flex: 1;
}

.ct-tbl {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 12.5px;
}

    .ct-tbl th {
        position: sticky;
        top: 0;
        z-index: 1;
        background: var(--brand-100);
        color: var(--muted);
        text-align: left;
        padding: 0 14px;
        height: 40px;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: .4px;
        font-weight: 700;
        white-space: nowrap;
        /* already position:sticky above, which is what the grip below anchors to */
    }

    /* Column resizing. The grip is a wide invisible strip on the heading's trailing edge - wider than
       the line it draws, because a 1px target is a nuisance to hit. It only shows its line on hover
       or while dragging, so the header looks unchanged at rest. */
    .ct-col-grip {
        position: absolute;
        top: 0;
        right: -4px;
        width: 9px;
        height: 100%;
        cursor: col-resize;
        z-index: 2;
        user-select: none;
    }

        .ct-col-grip::after {
            content: "";
            position: absolute;
            top: 8px;
            bottom: 8px;
            left: 4px;
            width: 2px;
            border-radius: 1px;
            background: transparent;
        }

        .ct-col-grip:hover::after,
        .ct-tbl.ct-resizing .ct-col-grip.ct-grip-on::after {
            background: var(--brand-400, #5b8fc7);
        }

    /* While dragging, the pointer is often off the grip: keep the resize cursor everywhere and stop
       the drag selecting the header text. */
    .ct-tbl.ct-resizing,
    .ct-tbl.ct-resizing th {
        cursor: col-resize;
        user-select: none;
    }

    .ct-tbl td {
        padding: 0 14px;
        height: 50px;
        border-bottom: 1px solid var(--line);
        color: var(--ink);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .ct-tbl tbody tr:hover td {
        background: var(--brand-50);
    }

    .ct-tbl tr.ct-tbl-click {
        cursor: pointer;
    }

.ct-cell-sub {
    color: var(--muted);
    font-size: 11px;
}

.ct-count {
    padding: 10px 14px;
    border-top: 1px solid var(--line);
    font-size: 12.5px;
    color: var(--muted);
    background: var(--surface);
    flex-shrink: 0;
}

    .ct-count b {
        color: var(--ink);
    }

.ct-count-err {
    color: var(--danger);
}

/* Not a fault - a state. "Nothing here yet" in the muted colour the rest of the line uses,
   because painting it red is what makes an operator raise a ticket about working software. */
.ct-count-info {
    color: var(--muted);
}

.ct-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

/* ------------------------------------------------------------- dashboard */

.ct-dash-sub {
    margin: -10px 0 18px;
}

.ct-kpis {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

/* Wisej's StatCard, measurement for measurement: 14px/16px padding, the content centred rather than
   pushed apart, and no minimum height. The port had grown these to 18px padding over a 118px floor
   with the value at 26px, which is why the cards read as oversized next to the Wisej screens. */
.ct-kpi {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
}

.ct-kpi-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.ct-kpi-label {
    font-size: 11.5px;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.ct-kpi-ico {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ct-kpi-val {
    font-size: 20px;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.4px;
    margin-top: 5px;
}

.ct-dash-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 14px;
    margin-bottom: 16px;
}

.ct-dash-row2 {
    grid-template-columns: 1fr 1fr;
}

.ct-card-sub {
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 2px;
}

.ct-dash-scroll {
    max-height: 340px;
    overflow-y: auto;
}

.ct-pane-err {
    padding: 24px;
    color: var(--danger);
    text-align: center;
    font-size: 12.5px;
}

/* segmented controls (period, Volume/Count) */
.ct-seg {
    display: inline-flex;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 3px;
    gap: 2px;
}

.ct-seg-btn {
    border: 0;
    background: none;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--muted);
    padding: 5px 12px;
    border-radius: 7px;
    cursor: pointer;
    transition: .14s;
}

    .ct-seg-btn.on {
        background: var(--surface);
        color: var(--brand-700);
        font-weight: 700;
        box-shadow: 0 1px 2px rgba(16,40,72,.12);
    }

.ct-seg-sm .ct-seg-btn {
    font-size: 11.5px;
    padding: 4px 9px;
}

/* bar chart */
.ct-chart-legend {
    display: flex;
    gap: 16px;
    justify-content: flex-end;
    padding: 4px 14px 0;
    font-size: 11.5px;
    color: var(--muted);
}

    .ct-chart-legend span {
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

    .ct-chart-legend i {
        width: 10px;
        height: 10px;
        border-radius: 2px;
    }

.ct-chart {
    padding: 4px 6px 10px;
}

    .ct-chart svg {
        width: 100%;
        height: 240px;
        font-family: var(--font);
    }

/* donuts */
.ct-donut {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 10px 14px;
}

.ct-donut-ring {
    position: relative;
    width: 150px;
    height: 150px;
}

    .ct-donut-ring svg {
        width: 150px;
        height: 150px;
        transform: rotate(-90deg);
    }

.ct-donut-centre {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 800;
    color: var(--ink);
}

.ct-donut-legend {
    width: 100%;
    padding: 10px 8px 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

    .ct-donut-legend div {
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size: 11.5px;
    }

    .ct-donut-legend span {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        color: var(--muted);
    }

    .ct-donut-legend i {
        width: 9px;
        height: 9px;
        border-radius: 2px;
    }

    .ct-donut-legend b {
        color: var(--ink);
        font-weight: 600;
    }

/* recent transactions */
.ct-recent-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-top: 1px solid var(--line-2);
}

.ct-recent-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}

.ct-recent-main {
    flex: 1;
    min-width: 0;
}

.ct-recent-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ct-recent-meta {
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ct-recent-amt {
    text-align: right;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
}

.ct-recent-st {
    font-size: 10.5px;
    font-weight: 600;
}

/* busiest terminals */
.ct-busy-row {
    padding: 9px 16px;
    border-top: 1px solid var(--line-2);
}

.ct-busy-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.ct-busy-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

.ct-busy-sub {
    font-size: 10.5px;
    color: var(--muted);
    margin-top: 1px;
    font-weight: 500;
}

.ct-busy-cnt {
    font-size: 12px;
    font-weight: 700;
    color: var(--ink);
}

.ct-busy-bar {
    height: 6px;
    background: var(--line-2);
    border-radius: 4px;
    overflow: hidden;
}

    .ct-busy-bar > div {
        height: 100%;
        background: var(--brand-600);
        border-radius: 4px;
    }

@media (max-width: 1400px) {
    .ct-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ct-dash-row {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 900px) {
    .ct-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ct-dash-row, .ct-dash-row2 {
        grid-template-columns: 1fr;
    }
}

/* ctplus.css gives .ct-sb-brand height:100% - correct when Wisej docked it into a fixed
   62px panel, but in this flex column it would eat the whole sidebar and push the nav
   off the bottom. Pin it to the topbar height instead. */
.ct-sidebar .ct-sb-brand {
    height: var(--topbar-h);
    flex-shrink: 0;
    border-bottom: 1px solid var(--sidebar-line);
}

/* --------------------------------------------------- tabs / sub-headings */

.ct-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 16px;
}

.ct-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    padding: 10px 16px;
    cursor: pointer;
    margin-bottom: -1px;
}

/* A fixed 16px box, so a tab with an icon and one without still line their labels up, and the
   underline does not jump as the set of tabs changes. */
.ct-tab-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex: none;
}

.ct-tab-ico:empty {
    display: none;
}

    .ct-tab.on {
        color: var(--brand-700);
        border-bottom-color: var(--brand-600);
    }

.ct-sub-head {
    display: flex;
    align-items: center;
    height: 42px;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
    background: var(--brand-50);
    border-bottom: 1px solid var(--line);
    border-radius: var(--radius) var(--radius) 0 0;
}

.ct-note {
    margin-top: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    border-left: 3px solid var(--ok);
    background: var(--ok-bg);
    color: var(--ok);
}

.ct-note-err {
    border-left-color: var(--danger);
    background: var(--danger-bg);
    color: var(--danger);
}

/* A long free-text field shown in full inside a drawer - a CCV description, a reject reason. Neutral,
   not a status note: .ct-note is the green "it worked" box and would read as a verdict. Wraps, keeps
   the line breaks the field was written with, and breaks very long unbroken strings so a pasted token
   cannot push the drawer wider than the screen. */
.ct-longtext {
    margin-top: 8px;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--brand-50);
    color: var(--ink);
    font-size: 13px;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    max-height: 320px;
    overflow-y: auto;
}

.ct-muted {
    color: var(--muted);
    font-size: 11.5px;
}

/* ------------------------------------------------ terminal config screen */

.ct-gw-bar {
    display: flex;
    align-items: flex-end;
    /* WRAP. Without it every child competes for one row: the inherited-address note added to
       this bar became a flex sibling, and the caption - which has flex-basis 0 and so shrinks
       below its content - collapsed to a column one word wide. */
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 14px;
    background: var(--brand-50);
    margin-bottom: 14px;
}

.ct-gw-cap {
    /* NOT flex:1. That is flex-basis 0 with unlimited shrink, so the caption gave up all its
       width to the fields beside it and wrapped one word per line. A real basis with a floor
       keeps the sentence readable and lets the fields take what is left. */
    flex: 1 1 260px;
    min-width: 220px;
}

    .ct-gw-cap b {
        display: block;
        font-size: 13px;
        color: var(--ink);
    }

    .ct-gw-cap small {
        display: block;
        font-size: 11.5px;
        color: var(--muted);
        line-height: 1.45;
    }

/* The "this tenant is using the platform default" line. Its own full-width row UNDER the
   fields - as a sibling in the same row it stole the width the caption needed. */
.ct-gw-note {
    flex: 1 0 100%;
    margin-top: 2px;
    padding: 8px 10px;
    border-left: 3px solid var(--warn);
    border-radius: 4px;
    background: var(--warn-bg);
    font-size: 12px;
    line-height: 1.5;
    color: var(--ink-2);
}

.ct-cfg-bar {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.ct-cfg-grid {
    display: grid;
    grid-template-columns: 1fr 460px;
    gap: 16px;
    align-items: start;
}

textarea.ct-json {
    width: 100%;
    height: 460px;
    border: 0;
    border-radius: 0 0 var(--radius) var(--radius);
    font-family: var(--mono);
    font-size: 12.5px;
    line-height: 1.5;
    padding: 12px;
    white-space: pre;
    overflow: auto;
    resize: vertical;
}

    textarea.ct-json:focus {
        box-shadow: none;
    }

.ct-term-tools {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
}

    .ct-term-tools .ct-input {
        flex: 1;
    }

.ct-term-list {
    max-height: 418px;
    overflow-y: auto;
    padding: 6px 0;
}

.ct-term-row {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 14px;
    font-size: 12.5px;
    color: var(--ink);
    cursor: pointer;
}

    .ct-term-row:hover {
        background: var(--surface-2);
    }

    .ct-term-row small {
        color: var(--muted);
        margin-left: auto;
    }

/* push monitor */
.ct-mon-grid {
    display: grid;
    grid-template-columns: 430px 1fr;
    gap: 16px;
    align-items: start;
}

.ct-push-list {
    padding: 12px;
    max-height: 520px;
    overflow-y: auto;
}

.ct-push-card {
    display: block;
    width: 100%;
    text-align: left;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 10px;
    font-family: inherit;
    cursor: pointer;
}

    .ct-push-card.on {
        background: var(--surface-2);
        box-shadow: inset 3px 0 0 var(--brand-600);
    }

.ct-push-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.ct-push-name {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ct-push-pct {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
}

.ct-push-sub {
    font-size: 11.5px;
    color: var(--muted);
    margin: 3px 0 9px;
}

.ct-push-bar {
    height: 8px;
    border-radius: 5px;
    background: #E9EDF2;
    overflow: hidden;
}

    .ct-push-bar > div {
        height: 100%;
        border-radius: 5px;
    }

.ct-rollout-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
}

    .ct-rollout-actions span {
        flex: 1;
    }

.ct-mon-foot {
    padding-top: 10px;
    font-size: 11.5px;
    color: var(--muted);
}

.ct-dd-row {
    display: flex;
    align-items: center;
}

    .ct-dd-row .ct-dd-item {
        flex: 1;
    }

.ct-dd-x {
    background: none;
    border: 0;
    color: var(--muted);
    font-size: 17px;
    line-height: 1;
    padding: 4px 9px;
    cursor: pointer;
    border-radius: 6px;
}

    .ct-dd-x:hover {
        background: var(--danger-bg);
        color: var(--danger);
    }

.ct-warn-card {
    margin-top: 12px;
    padding: 16px 18px;
    border: 1px solid var(--warn);
    border-left-width: 3px;
    border-radius: var(--radius);
    background: var(--warn-bg);
}

.ct-warn-head {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--warn);
    margin-bottom: 6px;
}

.ct-warn-card p {
    font-size: 12.5px;
    color: var(--ink-2);
    margin: 0 0 8px;
}

.ct-warn-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

.ct-btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

@media (max-width: 1300px) {
    .ct-cfg-grid, .ct-mon-grid {
        grid-template-columns: 1fr;
    }
}

/* A grid child defaults to min-width:auto, so the no-wrap JSON textarea and the wide
   tables would otherwise size the column to their content instead of the track. */
.ct-cfg-grid > *, .ct-mon-grid > *, .ct-dash-row > *, .ct-kpis > * {
    min-width: 0;
}

/* ------------------------------------------------- monitoring / chips / pager */

.ct-mon-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    margin-bottom: 14px;
}

.ct-mon-sum {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 13px;
}

.ct-faint {
    color: var(--faint);
}

.ct-chip {
    display: inline-block;
    margin: 0 5px 2px 0;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}

.ct-mon-tbl td {
    height: 52px;
}

/* type chips (All / Cash / Cheque) */
.ct-chips {
    display: flex;
    gap: 6px;
    align-items: center;
}

.ct-chip-radio {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: .14s;
}

    .ct-chip-radio input {
        display: none;
    }

    .ct-chip-radio:hover {
        border-color: var(--brand-300);
    }

    .ct-chip-radio.on {
        background: var(--brand-600);
        border-color: var(--brand-600);
        color: #fff;
    }

/* transaction type marker in the table */
.ct-type {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

    .ct-type i {
        width: 8px;
        height: 8px;
        border-radius: 2px;
    }

    .ct-type small {
        color: var(--muted);
        font-size: 11px;
    }

/* pager */
.ct-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.ct-pager-btns {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ct-pager-at {
    font-size: 12px;
    color: var(--muted);
}

.ct-kpis-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

    .ct-kpis-4 .ct-kpi {
        min-height: 92px;
    }

@media (max-width: 1100px) {
    .ct-kpis-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* =========================================================== admin screens */

.ct-list-bar {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

    .ct-list-bar > span.ct-muted {
        flex: 1;
        padding-bottom: 6px;
    }

.ct-row-acts {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.ct-danger-link {
    color: var(--danger);
}

    .ct-danger-link:hover {
        background: var(--danger-bg);
    }

.ct-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--ink);
    cursor: pointer;
    margin: 6px 0 12px;
}

.ct-row2, .ct-row3 {
    display: grid;
    gap: 12px;
}

.ct-row2 {
    grid-template-columns: 1fr 1fr;
}

.ct-row3 {
    grid-template-columns: 1fr 1fr 1fr;
}

    .ct-row2 > *, .ct-row3 > * {
        min-width: 0;
    }

.ct-rep-mode .ct-check { display: flex; width: fit-content; margin-bottom: 6px; }
.ct-rep-one { padding-left: 30px; }

.ct-member-list {
    max-height: 260px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.ct-perm-grp {
    padding: 8px 14px 4px;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--muted);
    background: var(--surface-2);
    position: sticky;
    top: 0;
}

.ct-perm-row small {
    margin-left: auto;
    color: var(--faint);
    font-size: 10.5px;
}

/* groups list */
.ct-grp-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line-2);
}

.ct-grp-main {
    flex: 1;
    min-width: 0;
}

.ct-grp-name {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ink);
}

.ct-grp-count {
    font-size: 12.5px;
    color: var(--muted);
    width: 130px;
    text-align: right;
}

.ct-grp-acts {
    display: flex;
    gap: 6px;
}

/* ==================================================== notification templates */

.ct-tpl-grid {
    display: grid;
    grid-template-columns: 330px 1fr;
    gap: 16px;
    align-items: start;
}

    .ct-tpl-grid > * {
        min-width: 0;
    }

.ct-tpl-list {
    max-height: 520px;
    overflow-y: auto;
    padding: 6px;
}

.ct-tpl-row {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    border-radius: 8px;
    padding: 9px 11px;
    font-family: inherit;
    cursor: pointer;
}

    .ct-tpl-row:hover {
        background: var(--surface-2);
    }

    .ct-tpl-row.on {
        background: var(--brand-50);
        box-shadow: inset 3px 0 0 var(--brand-600);
    }

.ct-tpl-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
}

.ct-tpl-meta {
    display: block;
    font-size: 11px;
    color: var(--muted);
}

.ct-tpl-form {
    padding: 16px;
}

textarea.ct-tpl-body {
    width: 100%;
    height: 180px;
    font-family: var(--mono);
    font-size: 12.5px;
    line-height: 1.55;
}

.ct-tpl-actions {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.ct-test-to {
    margin-right: auto;
}

.ct-hint {
    background: var(--brand-50);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    margin: 4px 0 12px;
}

.ct-hint-head {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--muted);
}

.ct-hint-keys {
    font-size: 11.5px;
    color: var(--ink-2);
    margin-top: 4px;
    line-height: 1.7;
    font-family: var(--mono);
}

.ct-hint-note {
    font-size: 11px;
    color: var(--muted);
    margin-top: 5px;
    line-height: 1.5;
}

/* ================================================================= reports */

.ct-rep-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 16px;
    align-items: start;
}

    .ct-rep-grid > * {
        min-width: 0;
    }

.ct-rep-row, .ct-file-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--line-2);
}

.ct-rep-ico {
    width: 30px;
    height: 30px;
    flex: none;
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ct-rep-main {
    flex: 1;
    min-width: 0;
}

.ct-rep-name {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ct-rep-recent {
    max-height: 560px;
    overflow-y: auto;
    padding-bottom: 8px;
}

.ct-rep-note {
    padding: 10px 16px 4px;
    font-size: 11.5px;
}

.ct-rep-sep {
    height: 1px;
    background: var(--line-2);
    margin: 12px 16px;
}

.ct-rep-subhead {
    padding: 0 16px 8px;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--muted);
    font-weight: 700;
}

.ct-cat-bar {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
}

.ct-kpi-accent {
    border-left: 3px solid var(--brand-600);
    padding-left: 9px;
}

/* ================================================================= tenants */

/* Inside the modal card now, so it has no margin of its own. */
.ct-tn-editor {
    margin-top: 0;
}

.ct-tn-form {
    padding: 16px 18px 20px;
}

.ct-tn-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
}

.ct-tabs-inner {
    margin: 0 18px;
}

.ct-tab-off {
    opacity: .45;
    cursor: not-allowed;
}

textarea.ct-lic-box {
    width: 100%;
    height: 120px;
    font-family: var(--mono);
    font-size: 11.5px;
}

.ct-lic-status {
    margin-top: 16px;
    padding: 14px 16px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    font-size: 13px;
    line-height: 1.9;
}

/* ------------------------------------------------- Platform License (Wisej parity) */

.ct-lic-mid {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    margin: 14px 0 18px;
}

    .ct-lic-mid > div:first-child {
        flex: 1 1 auto;
        min-width: 0;
    }

.ct-lic-mid-lbl {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
}

    .ct-lic-mid-lbl span {
        font-weight: 400;
    }

.ct-lic-mid-val {
    margin-top: 3px;
    font-family: var(--mono);
    font-size: 14.5px;
    font-weight: 700;
    color: var(--ink);
}

/* The dark button is the one Wisej used for the two "do this now" actions on this page. */
.ct-btn-dark {
    background: var(--sidebar, #0e1f36);
    border-color: var(--sidebar, #0e1f36);
    color: #fff;
}

    .ct-btn-dark:hover {
        filter: brightness(1.14);
    }

.ct-lic-sec {
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-2, var(--ink));
    margin-bottom: 6px;
}

.ct-lic-sec-lg {
    font-size: 13px;
    font-weight: 800;
    color: var(--ink);
}

.ct-lic-help {
    margin: 3px 0 10px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.55;
    max-width: 920px;
}

    .ct-lic-help code {
        font-family: var(--mono);
        font-size: 11.5px;
    }

.ct-lic-warn {
    color: var(--warn);
    font-weight: 700;
}

.ct-lic-ok {
    color: var(--ok);
    font-weight: 700;
}

.ct-lic-fp {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
}

.ct-lic-rule {
    height: 1px;
    background: var(--line);
    margin: 18px 0 14px;
}

/* ---- the one-click upload: a real file input, hidden behind its own label */

.ct-lic-up {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

/* The upload is its own one-field form, so it has to lay out as a row of controls rather than as a
   block that pushes the buttons beside it onto the next line. */
.ct-up-form {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.ct-up-name:empty {
    display: none;
}

/* ------------------------------------------------------------- plugin cards */

.ct-plug-card {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 14px 14px 14px 16px;
    margin-bottom: 12px;
}

.ct-plug-ico {
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: 10px;
    background: var(--brand-50);
    color: var(--brand-600);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ct-plug-meta {
    flex: 1;
    min-width: 0;
}

.ct-plug-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.ct-plug-id {
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
}

.ct-plug-ver {
    font-size: 10.5px;
    color: var(--faint, var(--muted));
}

.ct-plug-sub {
    font-size: 12px;
    color: var(--muted);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ct-plug-acts {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

    /* Disable / Update / Delete are one row of equal-weight buttons, so the Update upload has to
       match their height rather than keep the tall licence-page proportions. */
    .ct-plug-acts .ct-btn {
        white-space: nowrap;
    }

.ct-chip-warn {
    font-size: 10.5px;
    font-weight: 700;
    border-radius: 20px;
    padding: 2px 8px;
    white-space: nowrap;
    color: var(--warn);
    background: var(--warn-bg);
}

.ct-file-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.ct-up-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 230px;
    justify-content: center;
    cursor: pointer;
}

/* Keyboard users get the same focus ring the button would have, since the input itself is hidden. */
.ct-file-hidden:focus-visible + .ct-up-btn {
    outline: 2px solid var(--brand-600);
    outline-offset: 2px;
}

.ct-up-ico {
    font-size: 15px;
    line-height: 1;
}

.ct-up-name {
    font-size: 12px;
    color: var(--muted);
}

/* ---- the licence itself */

.ct-lic-card {
    margin-top: 18px;
    padding: 0;
    overflow: hidden;
}

.ct-lic-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    background: var(--brand-50);
}

.ct-lic-av {
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: 9px;
    background: var(--brand-600);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.ct-lic-who {
    flex: 1;
    min-width: 0;
}

.ct-lic-name {
    font-size: 15px;
    font-weight: 800;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ct-lic-kind {
    font-size: 11px;
    color: var(--muted);
}

.ct-lic-body {
    padding: 8px 20px 16px;
}

.ct-lic-kv {
    display: flex;
    gap: 14px;
    padding: 7px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--line-2, var(--line));
}

    .ct-lic-kv:last-child {
        border-bottom: 0;
    }

    .ct-lic-kv > span {
        flex: 0 0 200px;
        font-size: 12px;
        color: var(--muted);
    }

    .ct-lic-kv > div {
        flex: 1;
        min-width: 0;
        color: var(--ink);
    }

.ct-lic-plugins {
    align-items: flex-start;
    padding-top: 10px;
}

.ct-lic-chip {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: var(--brand-700);
    background: var(--brand-50);
    border-radius: 7px;
    padding: 3px 9px;
    margin: 0 6px 6px 0;
}

    .ct-lic-chip i {
        font-style: normal;
        font-weight: 400;
        color: var(--muted);
    }

.ct-lic-exp-ok {
    font-weight: 700;
    color: var(--ok);
}

.ct-lic-exp-soon {
    font-weight: 700;
    color: var(--warn);
}

.ct-lic-exp-bad {
    font-weight: 700;
    color: var(--danger);
}

.ct-lic-none {
    padding: 22px 20px;
}

.ct-lic-none-t {
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
}

.ct-lic-none-s {
    font-size: 12.5px;
    color: var(--muted);
    margin-top: 6px;
}

.ct-file {
    font-size: 12px;
    margin-right: auto;
}

.ct-prov-log {
    margin-top: 14px;
    padding: 14px;
    background: var(--sidebar);
    color: #D6E4F2;
    border-radius: var(--radius-sm);
    font-family: var(--mono);
    font-size: 11.5px;
    line-height: 1.6;
    max-height: 340px;
    overflow: auto;
    white-space: pre-wrap;
}

/* ================================================= deposit detail drawer */

.ct-drawer-scrim {
    position: fixed;
    inset: 0;
    background: rgba(11,32,58,.45);
    z-index: 2500;
}

.ct-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(860px, 94vw);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    z-index: 2600;
    display: flex;
    flex-direction: column;
}

    .ct-drawer .ct-modal-body {
        flex: 1;
        overflow-y: auto;
    }

/* A cheque deposit is two panels side by side, which does not fit an 860px drawer glued to the right
   edge. It gets Wisej's centred sheet instead: wide, inset from the viewport, rounded. */
.ct-drawer-wide {
    top: 3vh;
    bottom: 3vh;
    right: 50%;
    transform: translateX(50%);
    width: min(1340px, 95vw);
    border-radius: 14px;
    overflow: hidden;
}

@media (max-width: 1100px) {
    .ct-chq-split {
        grid-template-columns: minmax(0, 1fr);
    }

    .ct-chq-viewer {
        position: static;
    }
}

.ct-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--brand-50);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px 18px;
    margin: 0 0 14px;
}

    .ct-hero span {
        font-size: 10.5px;
        text-transform: uppercase;
        letter-spacing: .4px;
        color: var(--muted);
        font-weight: 600;
    }

.ct-hero-amt {
    font-size: 22px;
    font-weight: 800;
    color: var(--ink);
    line-height: 1.1;
    margin-top: 2px;
}

.ct-det-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top: 14px;
}

    .ct-det-cols > * {
        min-width: 0;
    }

.ct-sec-head {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--muted);
    font-weight: 700;
    margin: 18px 0 2px;
}

.ct-det-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid var(--line-2);
}

    .ct-det-row span {
        font-size: 12px;
        color: var(--muted);
        flex-shrink: 0;
    }

    .ct-det-row b {
        font-size: 12.5px;
        color: var(--ink);
        font-weight: 600;
        text-align: right;
        word-break: break-word;
    }

.ct-det-none {
    padding: 12px 0;
    font-size: 13px;
}

.ct-minitbl {
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 4px;
}

.ct-minitbl-head {
    display: flex;
    background: var(--brand-100);
    padding: 8px 14px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--muted);
    font-weight: 700;
}

.ct-minitbl-row {
    display: flex;
    align-items: center;
    padding: 7px 14px;
    font-size: 12.5px;
    border-top: 1px solid var(--line-2);
}

    .ct-minitbl-row:nth-child(even) {
        background: var(--surface-2);
    }

.ct-minitbl-total {
    display: flex;
    align-items: center;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 800;
    color: var(--ink);
    border-top: 2px solid var(--line);
    background: var(--brand-50);
}

.ct-recon-warn {
    margin-top: 8px;
    font-size: 11.5px;
    color: var(--danger);
}

/* ============================================ cheque detail: the export to the bank

   Whether the clearing files were generated for this deposit, which ones, and the remise's data
   line. The file list is a plain three-column grid - what it is, its name, its size - because the
   name is the one thing an operator compares against what the bank says it received. */

.ct-exp {
    margin-bottom: 14px;
}

.ct-exp-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 12.5px;
    margin: 2px 0 8px;
}

.ct-exp-files {
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 8px;
}

.ct-exp-file {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) 64px;
    gap: 10px;
    align-items: baseline;
    padding: 6px 12px;
    font-size: 12px;
    border-top: 1px solid var(--line-2);
}

    .ct-exp-file:first-child {
        border-top: 0;
    }

    .ct-exp-file:nth-child(even) {
        background: var(--surface-2);
    }

.ct-exp-role {
    color: var(--muted);
}

.ct-exp-name {
    word-break: break-all;
    font-size: 11.5px;
}

.ct-exp-size {
    text-align: right;
    color: var(--muted);
}

.ct-exp-lbl {
    margin-top: 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--muted);
}

.ct-exp-data {
    margin-top: 4px;
    padding: 8px 12px;
    background: var(--surface-2);
    border: 1px solid var(--line-2);
    border-radius: 8px;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 12px;
    word-break: break-all;
}

.ct-exp-note {
    margin-top: 6px;
    font-size: 11.5px;
}

.ct-chq-item-remise .ct-chq-micr {
    font-family: inherit;
    font-weight: 600;
}

/* ============================================ the ATM journal (EJ) in the deposit detail

   The terminal's own journal for one transaction - Advance NDC's records and the agent's entries
   together, as captured. It is the longest thing in the drawer, so it is boxed and scrolls on its
   own rather than pushing everything else off the screen; on PAPER it runs to full length, because
   the printed drawer is what gets attached to a dispute. */

.ct-ej {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 14px 12px;
    margin-top: 4px;
}

.ct-ej-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 11.5px;
    margin-bottom: 2px;
}

.ct-ej-ord {
    font-weight: 800;
    color: var(--ink);
}

.ct-ej-lines {
    font-weight: 700;
    color: var(--ink);
}

.ct-ej-text {
    margin: 10px 0 0;
    padding: 10px 12px;
    max-height: 340px;
    overflow: auto;
    background: var(--surface-2);
    border: 1px solid var(--line-2);
    border-radius: 8px;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 11.5px;
    line-height: 1.45;
    color: var(--ink);
    white-space: pre-wrap;
    word-break: break-word;
    tab-size: 4;
}

.ct-ej-none {
    padding: 10px 14px;
    margin-top: 4px;
    border: 1px dashed var(--line);
    border-radius: 10px;
    font-size: 12.5px;
    color: var(--ink);
}

.ct-ej-sub {
    margin-top: 6px;
    font-size: 11.5px;
    line-height: 1.5;
}

/* ============================================ cheque detail: fields | images

   Wisej's cheque detail is two panels, not one column: everything the operator reads on the left,
   the cheque itself on the right. The images are the point of the screen, so they get a fixed share
   of the width and their own scroll. */

.ct-chq-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 18px;
    align-items: start;
}

.ct-chq-info {
    min-width: 0;
}

.ct-chq-sum {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-2);
    margin-bottom: 16px;
}

.ct-chq-sum-lbl {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--muted);
}

.ct-chq-sum-amt {
    margin-top: 3px;
    font-size: 26px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -.01em;
}

/* ---- the cheque list */

.ct-chq-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
}

.ct-chq-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 13px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--surface-2);
    font-family: inherit;
    font-size: 13px;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
    transition: .14s;
}

    .ct-chq-item:hover {
        border-color: var(--line);
    }

    .ct-chq-item.on {
        border-color: var(--brand-300, var(--line));
        background: var(--surface);
        box-shadow: var(--shadow-sm);
    }

.ct-chq-caret {
    color: var(--muted);
    font-size: 11px;
    transition: transform .14s;
}

.ct-chq-item.on .ct-chq-caret {
    transform: rotate(90deg);
    color: var(--brand-700);
}

.ct-chq-seq {
    flex: 0 0 auto;
    min-width: 16px;
    font-weight: 700;
    color: var(--muted);
}

/* The codeline is the one string an operator reads character by character, so it is monospaced and
   allowed to wrap rather than being cut off with an ellipsis. */
.ct-chq-micr {
    flex: 1 1 auto;
    min-width: 0;
    font-family: var(--mono, ui-monospace, "Cascadia Mono", Consolas, monospace);
    font-size: 12px;
    word-break: break-all;
}

.ct-chq-amt {
    flex: 0 0 auto;
    font-weight: 700;
}

/* ---- the image panel */

.ct-chq-viewer {
    min-width: 0;
    border-radius: 14px;
    background: #0e1f36;
    color: #eaf1f9;
    padding: 16px 18px 18px;
    position: sticky;
    top: 0;
}

.ct-chq-vhead {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
}

    .ct-chq-vhead b {
        font-weight: 700;
    }

.ct-chq-vbody {
    max-height: 62vh;
    overflow-y: auto;
}

.ct-chq-vnone {
    font-size: 13px;
    opacity: .75;
    padding: 24px 2px;
}

.ct-chq-pane {
    display: none;
}

    .ct-chq-pane.on {
        display: block;
    }

.ct-chq-pane-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 13px;
    font-weight: 700;
    padding-bottom: 10px;
}

.ct-chq-side + .ct-chq-side {
    margin-top: 14px;
}

.ct-chq-side-lbl {
    display: flex;
    align-items: baseline;
    gap: 9px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    margin-bottom: 7px;
}

    .ct-chq-side-lbl small {
        font-weight: 500;
        letter-spacing: 0;
        opacity: .65;
    }

/* The image controls, above the image, as Wisej had them. One row: which side is on
   screen, then zoom / rotate / reset, then the side switch pushed to the right. */
.ct-chq-tools {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

    .ct-chq-tools .ct-chq-side-lbl {
        margin-bottom: 0;
    }

    .ct-chq-tools-sp {
        flex: 1 1 auto;
    }

    /* On the dark viewer panel the ghost buttons need their own colours - the page
       default is ink on white and would be unreadable here. */
    .ct-chq-tools .ct-btn-ghost {
        border-color: rgba(255,255,255,.28);
        background: rgba(255,255,255,.06);
        color: #eaf0f8;
    }

        .ct-chq-tools .ct-btn-ghost:hover:not(:disabled) {
            background: rgba(255,255,255,.16);
            border-color: rgba(255,255,255,.45);
        }

        .ct-chq-tools .ct-btn-ghost.on {
            background: var(--brand-600);
            border-color: var(--brand-600);
            color: #fff;
        }

        /* A side with no image on disk. Disabled AND dimmed, because a greyed button that
           still looks clickable is how somebody concludes the back simply failed to load. */
        .ct-chq-tools .ct-btn-ghost:disabled {
            opacity: .38;
            cursor: not-allowed;
        }

/* Clips the image while it is zoomed, so a magnified cheque does not spill over the
   panel and push the form sideways. */
.ct-chq-stage {
    overflow: auto;
    border-radius: 8px;
    background: #fff;
}

.ct-chq-img {
    display: block;
    width: 100%;
    border-radius: 8px;
    background: #fff;
    cursor: zoom-in;
    transform-origin: center center;
    transition: transform .12s ease-out;
    -webkit-user-drag: none;
    user-select: none;
    touch-action: none;
}

    /* grab only once there is something off screen to drag to */
    .ct-chq-img.is-pannable {
        cursor: grab;
    }

    .ct-chq-img.is-panning {
        cursor: grabbing;
        transition: none;
    }

/* A missing side stops the deposit being exported, so it is said plainly rather than
   left to the operator to notice a disabled button. */
.ct-chq-missing {
    margin-top: 8px;
    padding: 6px 9px;
    border-radius: 6px;
    background: rgba(198,40,40,.16);
    border: 1px solid rgba(198,40,40,.5);
    color: #ffd9d9;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .04em;
}

.ct-chq-noimg {
    font-size: 12px;
    opacity: .7;
    padding: 18px;
    border: 1px dashed rgba(255,255,255,.22);
    border-radius: 8px;
}

/* ================================================ the enlarge view (lightbox)

   Front/back, zoom, rotate, reset - Wisej's picture controls, because a cheque arrives in whatever
   orientation the scanner gave it and the codeline has to be readable. */

.ct-chqlb {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: #0e1f36;
    display: flex;
    flex-direction: column;
}

    .ct-chqlb[hidden] {
        display: none;
    }

body.ct-chqlb-on {
    overflow: hidden;
}

.ct-chqlb-bar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
}

.ct-chqlb-tools {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-left: auto;
}

    .ct-chqlb-sides .ct-seg-btn[disabled] {
        opacity: .4;
        cursor: not-allowed;
    }

.ct-chqlb-stage {
    flex: 1 1 auto;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
}

    .ct-chqlb-stage img {
        max-width: 100%;
        border-radius: 6px;
        background: #fff;
        transform-origin: center center;
        transition: transform .12s;
        /* the browser's own image drag would start instead of ours */
        -webkit-user-drag: none;
        user-select: none;
        touch-action: none;
    }

        /* Only offer the grab hand when there is something off screen to reach: at fit
           size the cursor would promise a pan that does nothing. */
        .ct-chqlb-stage img.is-pannable {
            cursor: grab;
        }

        .ct-chqlb-stage img.is-panning {
            cursor: grabbing;
            /* no easing while dragging, or the image lags behind the pointer */
            transition: none;
        }

/* =================================================================== print

   data-print copies the element into .ct-print-host, a direct child of <body>, and puts
   ct-printing on the body. Every other child of <body> is hidden, so only the copy reaches the
   paper. On screen the host is never shown: it exists only while the print dialog is open.

   The copy is the drawer as it is on screen - fixed, centred, a scroll box with its own height -
   so each of those is undone here, or the paper would show one screenful and cut the rest off. */

.ct-print-host {
    display: none;
}

@media print {
    body.ct-printing > *:not(.ct-print-host) {
        display: none !important;
    }

    body.ct-printing .ct-print-host {
        display: block !important;
        background: #fff !important;
        color: #000 !important;
    }

    body.ct-printing .ct-print-host .ct-drawer,
    body.ct-printing .ct-print-host .ct-drawer-wide {
        display: block !important;
        position: static !important;
        inset: auto !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        transform: none !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        background: #fff !important;
        color: #000 !important;
    }

    body.ct-printing .ct-print-host .ct-modal-body {
        overflow: visible !important;
        flex: none !important;
        padding: 0 !important;
    }

    body.ct-printing .ct-print-host .ct-modal-head {
        padding: 0 0 10px !important;
    }

    body.ct-printing .ct-drawer-scrim,
    body.ct-printing .ct-modal-foot,
    body.ct-printing .ct-x {
        display: none !important;
    }

    /* On paper the two panels stack: a cheque image squeezed into half an A4 column is not
       legible, and there is no scrolling to recover it. */
    body.ct-printing .ct-chq-split {
        display: block !important;
    }

    body.ct-printing .ct-chq-viewer {
        margin-top: 14px;
        background: #fff !important;
        color: #000 !important;
        position: static !important;
        padding: 0 !important;
    }

    /* EVERY cheque of the deposit is printed, and the remise, not only the one picked on screen:
       the printout is what is attached to a dispute, and "the other cheques were not selected" is
       not an answer. Each pane carries its own number and amount, so the screen's "Cheque 1 of 4"
       heading is left off. */
    body.ct-printing .ct-chq-vhead {
        display: none !important;
    }

    body.ct-printing .ct-chq-pane {
        display: block !important;
        break-inside: avoid;
        page-break-inside: avoid;
        margin-bottom: 16px;
    }

    body.ct-printing .ct-chq-tools {
        display: none !important;
    }

    body.ct-printing .ct-chq-img {
        transform: none !important;
        max-width: 100% !important;
    }

    /* The journal is evidence: on paper it prints in full, not as a scrolling box with 40 of
       5,000 lines showing. */
    body.ct-printing .ct-ej-text {
        max-height: none !important;
        overflow: visible !important;
        background: #fff !important;
        color: #000 !important;
    }

    body.ct-printing .ct-chq-vbody {
        max-height: none !important;
        overflow: visible !important;
    }

    body.ct-printing .ct-chq-side-lbl small {
        display: none !important;
    }
}

.ct-foot-gap {
    flex: 1 1 auto;
}

.ct-det-sub {
    margin: 3px 0 0;
    font-size: 12.5px;
    color: var(--muted);
}

.ct-det-printbtn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.ct-tab-badge {
    margin-left: 6px;
}

/* ================================================================ settings */

.ct-set-grid {
    display: grid;
    grid-template-columns: 244px 1fr;
    gap: 16px;
    align-items: start;
}

    .ct-set-grid > * {
        min-width: 0;
    }

.ct-set-rail {
    padding: 10px;
    position: sticky;
    top: 0;
}

.ct-rail-item {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    text-align: left;
    background: none;
    border: 1px solid transparent;
    border-radius: 9px;
    padding: 9px 13px;
    margin-bottom: 2px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    transition: .14s;
}

    .ct-rail-item:hover {
        background: var(--surface);
        color: var(--ink);
    }

    .ct-rail-item.on {
        background: var(--surface);
        border-color: var(--line);
        box-shadow: var(--shadow-sm);
        color: var(--brand-700);
        font-weight: 600;
    }

/* The icon keeps its 18px box whatever the label does, so the labels of the long sections
   ("Transaction Notification Templates") wrap against a straight left edge instead of tucking
   back under the icon. */
.ct-rail-ico {
    flex: 0 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 18px;
    opacity: .7;
}

.ct-rail-item.on .ct-rail-ico {
    opacity: 1;
}

.ct-rail-txt {
    flex: 1 1 auto;
    min-width: 0;
}

.ct-set-body {
    min-height: 300px;
}

.ct-set-head h2 {
    margin: 0 0 2px;
    font-size: 17px;
    font-weight: 700;
    color: var(--ink);
}

.ct-set-head p {
    margin: 0 0 16px;
    font-size: 12.5px;
    color: var(--muted);
}

/* With an action, the heading and its button sit on one line, as Wisej had "Save changes" and
   "+ New template" level with the title rather than stranded under the content. */
.ct-set-head-act {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

    .ct-set-head-act > div:first-child {
        flex: 1;
        min-width: 0;
    }

.ct-set-head-btn {
    flex: 0 0 auto;
    padding-top: 2px;
}

/* ---------------------------------------------------- Reports: scheduler + templates */

.ct-inline-field {
    display: flex;
    align-items: center;
    gap: 9px;
}

    .ct-inline-field > label {
        font-size: 12px;
        font-weight: 600;
        color: var(--muted);
        white-space: nowrap;
    }

.ct-sched-card {
    padding: 13px 16px 14px;
    margin-bottom: 14px;
}

.ct-sched-title {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 10px;
}

    .ct-sched-title b {
        font-size: 14.5px;
        color: var(--ink);
    }

.ct-sched-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px 22px;
    margin-top: 8px;
}

/* ---- one template in the list */

.ct-rep-tmpl {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 14px 14px 14px 16px;
    margin-bottom: 10px;
}

.ct-rep-meta {
    flex: 1;
    min-width: 0;
}

.ct-rep-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.ct-rep-desc {
    font-size: 12px;
    color: var(--muted);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ct-rep-acts {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ct-rep-lock {
    width: 62px;
    text-align: center;
    font-size: 14px;
    opacity: .6;
}

.ct-chip-cat,
.ct-chip-kind,
.ct-chip-custom,
.ct-chip-on,
.ct-chip-off {
    font-size: 10.5px;
    font-weight: 700;
    border-radius: 20px;
    padding: 2px 8px;
    white-space: nowrap;
}

.ct-chip-cat,
.ct-chip-kind {
    color: var(--ink-2, var(--muted));
    background: var(--surface-2);
    border: 1px solid var(--line);
}

.ct-chip-custom {
    color: var(--brand-700);
    background: var(--brand-50);
}

.ct-chip-on {
    color: var(--ok);
    background: var(--ok-bg);
}

.ct-chip-off {
    color: var(--faint, var(--muted));
    background: var(--surface-2);
    border: 1px solid var(--line);
}

/* ---- the template editor */

.ct-rep-ed {
    padding: 18px 20px 20px;
}

.ct-rep-ed-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 22px;
    margin-bottom: 14px;
}

.ct-rep-ed-en {
    margin-left: 4px;
}

textarea.ct-rep-sql {
    width: 100%;
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.5;
}

.ct-rep-preview {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    font-size: 12.5px;
}

.ct-rep-prev-head {
    font-size: 12px;
    color: var(--muted);
    margin: 2px 0 8px;
}

/* The preview is a sample, not the report: it scrolls in place rather than pushing Save off screen. */
.ct-rep-prev-tbl {
    max-height: 260px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
}

    .ct-rep-prev-tbl table {
        font-size: 11.5px;
    }

    .ct-rep-prev-tbl thead th {
        position: sticky;
        top: 0;
        background: var(--surface-2);
        white-space: nowrap;
    }

.ct-set-form {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 18px 20px 20px;
    margin-bottom: 16px;
}

    .ct-set-form .ct-field {
        margin-bottom: 12px;
    }

.ct-tmpl-block .ct-sec-head {
    margin-top: 0;
}

.ct-test-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding-top: 6px;
    border-top: 1px solid var(--line-2);
    margin-top: 14px;
}

.ct-lim-tbl td {
    height: auto;
    padding: 8px 14px;
}

    .ct-lim-tbl td .ct-input {
        width: 100%;
    }

@media (max-width: 1200px) {
    .ct-set-grid, .ct-rep-grid, .ct-tpl-grid {
        grid-template-columns: 1fr;
    }

    .ct-set-rail {
        position: static;
    }

    .ct-det-cols, .ct-row2, .ct-row3 {
        grid-template-columns: 1fr;
    }
}

/* ------------------------------------------------- terminal analysis (deposits) */

.ct-an-charts {
    display: flex;
    gap: 16px;
    margin-top: 14px;
}

    .ct-an-charts .ct-an-trend {
        flex: 1.5;
        min-width: 0;
        padding: 0;
    }

    .ct-an-charts .ct-an-dist {
        flex: 1;
        min-width: 0;
        padding: 0;
    }

.ct-an-head {
    padding: 14px 18px;
    border-bottom: 1px solid var(--line-2);
}

    .ct-an-head h3 {
        font: 700 14px var(--font);
        color: var(--ink);
        margin: 0;
    }

    .ct-an-head p {
        font-size: 11.5px;
        color: var(--muted);
        margin: 2px 0 0;
    }

.ct-an-plot {
    padding: 10px 14px;
}

.ct-an-svg {
    width: 100%;
    height: 180px;
    font-family: var(--font);
}

.ct-an-nodata {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--faint);
    font-size: 13px;
}

.ct-an-rank {
    margin-top: 14px;
    padding: 0;
}

.ct-an-cols {
    display: flex;
}

.ct-an-split {
    width: 1px;
    background: var(--line-2);
}

.ct-an-col {
    flex: 1;
    min-width: 0;
    padding: 14px 18px;
}

.ct-an-col-head {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .4px;
    font-weight: 700;
    margin-bottom: 10px;
}

    .ct-an-col-head .dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
    }

.ct-an-none {
    color: var(--faint);
    font-size: 12.5px;
    padding: 8px 0;
}

.ct-an-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}

    .ct-an-row .rk {
        width: 20px;
        text-align: right;
        font-size: 12px;
        font-weight: 700;
        color: var(--muted);
    }

    .ct-an-row .bd {
        flex: 1;
        min-width: 0;
    }

    .ct-an-row .ln {
        display: flex;
        justify-content: space-between;
        gap: 8px;
    }

    .ct-an-row .nm {
        font-size: 12.5px;
        font-weight: 600;
        color: var(--ink);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .ct-an-row .vl {
        font-size: 12.5px;
        font-weight: 700;
        color: var(--ink);
        white-space: nowrap;
    }

    .ct-an-row .br {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-top: 3px;
    }

    .ct-an-row .track {
        flex: 1;
        height: 6px;
        border-radius: 3px;
        background: var(--surface-2);
        overflow: hidden;
    }

    .ct-an-row .fill {
        height: 100%;
    }

    .ct-an-row .sx {
        font-size: 10.5px;
        color: var(--muted);
        white-space: nowrap;
    }

.ct-kpi-sub {
    font-size: 11px;
    color: var(--faint);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 1100px) {
    .ct-an-charts {
        flex-direction: column;
    }

    .ct-an-cols {
        flex-direction: column;
    }

    .ct-an-split {
        width: auto;
        height: 1px;
    }
}

/* Measure sits at the RIGHT of the Terminal Analysis bar, next to Apply, where Wisej docked it.
   margin-left:auto claims the gap after the dates; the actions then stop claiming it again, so the
   two end up together instead of drifting apart with the space split between them. */
.ct-meas-field {
    margin-left: auto;
}

.ct-meas-field + .ct-toolbar-actions {
    margin-left: 0;
}

/* The tenant editor is a tabbed workspace, not a single form: Wisej gave it most of the window. */
.ct-modal-card.wide {
    max-width: 1040px;
}

.ct-tn-editor .ct-tabs-inner {
    padding: 0 22px;
}

/* The editor is a sheet with a fixed header, tabs and footer, and only the body scrolls - so the
   Save and Delete stay put as the operator moves between six tabs of different heights. */
.ct-tn-editor {
    display: flex;
    flex-direction: column;
    max-height: 86vh;
}

    .ct-tn-editor > .ct-modal-body {
        flex: 1 1 auto;
        overflow-y: auto;
        min-height: 360px;
    }

.ct-tn-foot {
    flex: 0 0 auto;
    border-top: 1px solid var(--line);
    background: var(--surface-2);
}

/* Delete tenant is destructive but not the primary action, so it reads as an outline rather than a
   filled red button sitting next to Save. */
.ct-btn-danger-soft {
    background: var(--danger-bg);
    border-color: var(--danger);
    color: var(--danger);
}

    .ct-btn-danger-soft:hover {
        background: var(--danger);
        color: #fff;
    }

.ct-tn-pane {
    padding-top: 2px;
}

.ct-tn-hint {
    margin: 8px 0 14px;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--muted);
    max-width: 980px;
}

/* Server takes the width; the port is usually blank. */
.ct-row-db {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr);
    gap: 14px;
}

.ct-tn-status {
    height: 38px;
    display: inline-flex;
    align-items: center;
}

.ct-tn-termbar,
.ct-tn-provbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.ct-tn-lic {
    margin-top: 14px;
}

.ct-pick-count {
    font-weight: 600;
    font-size: 11px;
    color: var(--muted);
    margin-left: 8px;
    text-transform: none;
    letter-spacing: 0;
}

.ct-rep-recent-sub {
    padding: 0 18px 10px;
}

/* ------------------------------------------------- advanced filter popover */

.ct-advwrap {
    position: relative;
    display: flex;
    align-items: flex-end;
}

.ct-adv-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

    .ct-adv-btn.on {
        border-color: var(--brand-600);
        color: var(--brand-700);
    }

.ct-adv-count {
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 9px;
    background: var(--brand-600);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
}

.ct-advdd {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 60;
    width: 300px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.ct-advwrap.open .ct-advdd {
    display: block;
}

.ct-advdd-head {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--muted);
    margin-bottom: 10px;
}

.ct-advdd .ct-field {
    margin-bottom: 10px;
}

    .ct-advdd .ct-field input {
        width: 100%;
    }

.ct-advdd-foot {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 4px;
}

/* ------------------------------------------------- server-side file picker */

.ct-fp-where {
    font-size: 11.5px;
    color: var(--muted);
    margin: 2px 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 440px;
}

.ct-fp-list {
    max-height: 56vh;
    overflow-y: auto;
    margin: -4px -6px 0;
}

.ct-fp-row {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    height: 30px;
    padding: 0 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    font: 500 12.5px var(--font);
    color: var(--ink);
    cursor: pointer;
    text-align: left;
}

    .ct-fp-row:hover {
        background: var(--brand-50);
    }

    .ct-fp-row .ic {
        font-size: 13px;
        flex-shrink: 0;
    }

    .ct-fp-row .nm {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.ct-fp-note {
    font-size: 11.5px;
    color: var(--faint);
    padding: 6px 10px;
}

.ct-fp-err {
    font-size: 12px;
    color: var(--danger);
    padding: 6px 10px;
}

/* ============================================================================
   TRANSACTION TRACE - the hop-by-hop timeline in the trace drawer.

   One <li> per hop of the conversation, in the order it happened. The left rule is
   the timeline; its colour is the hop's outcome, so a failure is findable by eye in a
   long exchange without reading any of it.
   ============================================================================ */
.ct-trace {
    list-style: none;
    margin: 4px 0 0;
    padding: 0 0 0 18px;
    border-left: 2px solid var(--line);
}

.ct-hop {
    position: relative;
    margin: 0 0 14px;
    padding: 10px 12px;
    background: var(--surface-2, #f7f9fc);
    border: 1px solid var(--line);
    border-left: 3px solid var(--line);
    border-radius: 8px;
}

    /* The dot on the timeline, aligned with the hop's own first line. */
    .ct-hop::before {
        content: "";
        position: absolute;
        left: -25px;
        top: 16px;
        width: 9px;
        height: 9px;
        border-radius: 50%;
        background: var(--line);
        box-shadow: 0 0 0 3px var(--surface);
    }

.ct-hop-ok { border-left-color: #1f9d55; }
.ct-hop-ok::before { background: #1f9d55; }

.ct-hop-bad { border-left-color: #c92a2a; }
.ct-hop-bad::before { background: #c92a2a; }

.ct-hop-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
    font-size: 12px;
}

.ct-hop-leg {
    font-weight: 600;
    letter-spacing: .02em;
}

.ct-hop-peer {
    padding: 1px 7px;
    border-radius: 10px;
    background: var(--chip-bg, #e8eef6);
    font-size: 11px;
}

.ct-hop-status,
.ct-hop-ms {
    font-family: var(--mono, ui-monospace, Consolas, monospace);
    font-size: 11px;
    color: var(--muted);
}

/* Pushed to the far right so the eye can run down the times. */
.ct-hop-when {
    margin-left: auto;
    font-size: 11px;
    color: var(--muted);
}

.ct-hop-sum {
    margin-top: 5px;
    font-size: 13px;
}

.ct-hop-url {
    margin-top: 4px;
    font-family: var(--mono, ui-monospace, Consolas, monospace);
    font-size: 11px;
    color: var(--muted);
    word-break: break-all;
}

.ct-hop-body {
    margin-top: 8px;
}

.ct-hop-body-lbl {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    margin-bottom: 3px;
}

/* A payload is JSON or a pipe-delimited frame: keep its own line breaks, wrap the long
   lines rather than forcing a sideways scroll, and cap the height so one big cheque
   deposit cannot push the rest of the exchange off the screen. */
.ct-pre {
    margin: 0;
    padding: 8px 10px;
    max-height: 320px;
    overflow: auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
    font-family: var(--mono, ui-monospace, Consolas, monospace);
    font-size: 11.5px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Settings > Language (SettingsLanguage.vb) */
.ct-lang-stats { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 14px 0 6px; font-size: 13px; color: var(--ink-2, inherit); }
.ct-lang-stat b { font-size: 15px; color: var(--ink, inherit); }
.ct-lang-tools { display: flex; gap: 8px; margin: 0 0 10px; }
.ct-lang-tbl td { vertical-align: top; white-space: normal; overflow: visible; text-overflow: clip; height: auto; padding-top: 8px; padding-bottom: 8px; }
.ct-lang-en { white-space: normal; word-break: break-word; font-size: 13px; }
.ct-lang-fr { width: 100%; min-height: 34px; resize: vertical; font: inherit; font-size: 13px; }
.ct-lang-was { margin-top: 4px; font-size: 12px; color: var(--muted, #6b7785); }
.ct-lang-was::before { content: "\21BA  "; }
.ct-lang-act .ct-badge { display: inline-block; margin-bottom: 6px; }
.ct-lang-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.ct-lang-add { margin-top: 18px; }
.ct-lang-add h3 { margin: 0 0 4px; font-size: 15px; }
