/* SafariPilot — portal.css
 *
 * Every style the signed-in portals use, in one file: the company portal (layouts/app, <body class="kk-app">) and
 * the admin portal (layouts/admin, <body class="kk-admin">). Plain CSS, no build step — edit it here.
 *
 * The sign-in screens are here too (section 12): a signed-out visitor is looking at the app's front door, and
 * those screens belong with the app rather than with the marketing site.
 *
 * Each portal's own chrome is scoped with :where(.kk-app) / :where(.kk-admin). :where() adds no specificity, so a
 * page section further down overrides a chrome rule exactly as it did when they were separate files, while the two
 * portals' Bootstrap overrides never leak into each other. Page sections are scoped by their own class names.
 *
 * Contents
 *   1. Company portal chrome          (was layouts/app.css)
 *   2. Admin portal chrome            (was layouts/admin.css)
 *   3. The sidebar — both portals
 *   4. Select2                        (moved to select2.css)
 *   5. Guided tour                    (was portal-tour.css)
 *   6. Dashboards, cards and rows     (was layouts/dashboard.css)
 *   7. Calendar                       (was calendar.css)
 *   8. Subscriptions and plans        (was subscriptions/module.css, subscriptions/plans.css)
 *   9. Quotations, payments, paying an invoice   (was quotes/create.css, payments/index.css, invoices/pay.css)
 *  10. Admin pages                    (was admin/dashboard.css, admin/billing-dashboard.css)
 *  11. The office chrome             (the portals as an administrative system)
 *  12. The sign-in screens           (was layouts/auth.css — moved here from frontend.css)
 */

/* ════════════════════════════════════════════════════════════════════════
   1. COMPANY PORTAL CHROME
   ════════════════════════════════════════════════════════════════════════ */
/* The family, Archivo, is linked by layouts/app and layouts/admin — never @imported here, where it would
   hold the first paint. */

:root {
    /* ── Company portal chrome ── */
    /* Dashboard chrome — mirrors the public design tokens, including the
       logo gold. Gold is a surface colour: label it with --safari-accent-ink
       (7.68:1 on gold), and never put white on it (2.58:1). */
    --safari-dark: #14140F;
    --safari-green: #44443C;
    --safari-light: #6E6E64;
    --safari-gold: #BEFF50;
    --safari-gold-strong: #ADF03C;
    --safari-gold-soft: #EEFFD1;
    --safari-accent-ink: #14140F;
    --safari-accent-text: #14140F;
    --safari-amber: #44443C;
    --safari-sand: #FAFAF5;
    --sidebar-width: var(--kk-sb-w);

    /* ── Admin portal chrome ── */
    /* Admin chrome — mirrors the public design tokens, including the logo
       gold. Label gold surfaces with --admin-accent-ink (7.68:1 on gold);
    white on gold is only 2.58:1 and must not be used. */
    --admin-dark: #14140F;
    --admin-accent: #BEFF50;
    --admin-gold-strong: #ADF03C;
    --admin-accent-ink: #14140F;
    --admin-accent-text: #14140F;
    --sidebar-w: var(--kk-sb-w);

    /* ── The sidebar ── */
    --kk-sb-w: 264px;
    --kk-sb-rail: 76px;
    /* The brand ink: a warm off-black menu is the spine of the workspace. */
    --kk-sb-bg: #14140F;
    --kk-sb-bg-2: #14140F;
    --kk-sb-line: rgba(255, 255, 255, .12);
    --kk-sb-text: rgba(255, 255, 255, .80);
    --kk-sb-text-strong: #FFFFFF;
    --kk-sb-muted: rgba(255, 255, 255, .55);
    --kk-sb-hover: rgba(255, 255, 255, .07);
    --kk-sb-active: rgba(255, 255, 255, .11);
    /* The marker on the page you are on: lime, as an icon colour and never behind white text. */
    --kk-sb-accent: #BEFF50;

    /* ── Dashboards, cards and rows ── */
    /* One family for everything: Archivo, semibold for headings and figures. */
    --kk-display: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --kk-body: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --kk-ink: #14140F;
    --kk-body-ink: #2A2A24;
    --kk-muted: #6E6E64;
    --kk-faint: #919183;
    --kk-line: #E6E6DC;
    --kk-line-strong: #D2D2C8;
    --kk-surface: #ffffff;
    /* Soft and rounded: 16px panels, 12px controls, hairline borders and the faintest warm shadow. */
    --kk-radius: 16px;
    --kk-radius-sm: 12px;
    --kk-radius-pill: 9999px;
    --kk-shadow: 0 1px 2px rgba(20, 20, 15, .04);
    --kk-shadow-hover: 0 18px 34px -24px rgba(20, 20, 15, .42);
    --kk-canvas: #FAFAF5;
    /* The stat tiles' pastel grounds, in the order a row takes them. */
    --kk-tile-1: #BEFF50;
    --kk-tile-2: #DFF4FC;
    --kk-tile-3: #EBDFFF;
    --kk-tile-4: #FFE2D6;
    --kk-tile-5: #EDEDE3;
    --kk-tile-6: #FDE3FD;
    --kk-ring: 0 0 0 4px rgba(190, 255, 80, .6);
}

body:where(.kk-app) {
    font-family: var(--kk-body);
    background: var(--kk-canvas);
    color: var(--kk-body-ink);
}

:where(.kk-app) .form-control {
    box-shadow: inset 0 1px 2px hsla(0, 0%, 60%, .25) !important;
    padding-left: 15px;
    text-align: left;
    font-size: 1rem;
    color: #222;
    box-sizing: border-box;
    height: 2.5rem;
}

:where(.kk-app) h1,
:where(.kk-app) h2,
:where(.kk-app) h3,
:where(.kk-app) h4,
:where(.kk-app) h5,
:where(.kk-app) h6,
:where(.kk-app) .font-heading {
    font-family: var(--kk-display);
    letter-spacing: -.02em;
}

/* Bootstrap ships blue as its primary colour. Remap every brand-facing
   Bootstrap class onto the monochrome chrome; success/danger/warning keep
   their colour because they encode status rather than brand. */

:where(.kk-app) a {
    color: var(--safari-dark);
}

:where(.kk-app) a:hover {
    color: #000;
}

:where(.kk-app) .btn-primary {
    background: var(--safari-gold);
    border-color: var(--safari-gold);
    color: var(--safari-accent-ink);
}

:where(.kk-app) .btn-primary:hover,
:where(.kk-app) .btn-primary:focus,
:where(.kk-app) .btn-primary:active {
    background: var(--safari-gold-strong);
    border-color: var(--safari-gold-strong);
    color: var(--safari-accent-ink);
    box-shadow: none;
}

:where(.kk-app) .btn-outline-primary {
    color: var(--safari-accent-text);
    border-color: var(--safari-gold);
}

:where(.kk-app) .btn-outline-primary:hover {
    background: var(--safari-gold);
    border-color: var(--safari-gold);
    color: var(--safari-accent-ink);
}

:where(.kk-app) .btn-secondary {
    background: var(--safari-green);
    border-color: var(--safari-green);
}

:where(.kk-app) .btn-outline-secondary {
    color: var(--safari-green);
    border-color: #D4D4D4;
}

:where(.kk-app) .btn-outline-secondary:hover {
    background: var(--safari-green);
    border-color: var(--safari-green);
    color: #fff;
}

:where(.kk-app) .btn-info {
    background: var(--safari-light);
    border-color: var(--safari-light);
    color: #fff;
}

:where(.kk-app) .btn-link {
    color: var(--safari-dark);
}

:where(.kk-app) .text-primary,
:where(.kk-app) .text-info {
    color: var(--safari-accent-text) !important;
}

/* Bootstrap's .text-muted is a blue-grey; keep the ramp neutral. */

:where(.kk-app) .text-muted {
    color: #6E6E6E !important;
}

/* Bootstrap paints <code>/<samp> magenta (#e83e8c) — a saturated hue from
   Bootstrap's own sheet that also fails AA on white. */

:where(.kk-app) code,
:where(.kk-app) samp {
    color: var(--safari-dark);
}

/* Status hues encode meaning, but Bootstrap 4's success green only
   reaches 2.9:1 against white text. */

:where(.kk-app) .badge-success,
:where(.kk-app) .btn-success {
    background-color: #1E7E34;
    border-color: #1E7E34;
}

:where(.kk-app) .btn-success:hover,
:where(.kk-app) .btn-success:focus,
:where(.kk-app) .btn-success:active {
    background-color: #16612A;
    border-color: #16612A;
    color: #fff;
}

:where(.kk-app) .text-success {
    color: #1E7E34 !important;
}

/* Bootstrap's .text-warning (#ffc107) and .text-danger (#dc3545) are
   unreadable as text on light surfaces — 1.63:1 and 3.76:1. */

:where(.kk-app) .text-warning {
    color: #8A6100 !important;
}

:where(.kk-app) .text-danger {
    color: #B21F2D !important;
}

:where(.kk-app) .bg-primary {
    background-color: var(--safari-gold) !important;
    color: var(--safari-accent-ink);
}

:where(.kk-app) .badge-primary {
    background-color: var(--safari-gold);
    color: var(--safari-accent-ink);
}

:where(.kk-app) .badge-info {
    background-color: var(--safari-light);
}

:where(.kk-app) .page-link {
    color: var(--safari-dark);
}

:where(.kk-app) .page-item.disabled .page-link {
    color: #9A9A9A;
}

:where(.kk-app) .page-item.active .page-link {
    background-color: var(--safari-gold);
    border-color: var(--safari-gold);
    color: var(--safari-accent-ink);
}

:where(.kk-app) .form-control:focus {
    border-color: var(--safari-gold);
    box-shadow: 0 0 0 .2rem rgba(228, 141, 43, .22);
}

:where(.kk-app) .custom-control-input:checked~.custom-control-label::before {
    background-color: var(--safari-dark);
    border-color: var(--safari-dark);
}

/* Flush cards hold tables edge-to-edge; let those scroll instead of
   widening the page on very narrow viewports. */

:where(.kk-app) .card-body.p-0 {
    overflow-x: auto;
}

/* Top navbar */

:where(.kk-app) .kk-topbar {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: .5rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

:where(.kk-app) .kk-topbar .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--safari-green);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: .85rem;
}

/* The bell in the topbar: what the platform has told this account, and how much is unread. Its own colours
   rather than the dashboard's tokens, because the portal layout does not load that stylesheet (§6.30). */

:where(.kk-app) .kk-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #f3f4f6;
    color: #374151;
    font-size: .95rem;
}

:where(.kk-app) .kk-bell:hover {
    background: #e5e7eb;
    color: #111827;
    text-decoration: none;
}

:where(.kk-app) .kk-bell-count {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background: #dc2626;
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

/* A payment reminder is on the bell (§6.60): a deeper red count, and a dot of its own whether or not it is the
   first thing waiting, so "money is late" is visible without opening anything. */

:where(.kk-app) .kk-bell-count--danger {
    background: #b91c1c;
}

:where(.kk-app) .kk-bell-dot {
    position: absolute;
    top: -2px;
    left: -2px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #dc2626;
    box-shadow: 0 0 0 2px #fff;
}

/* Content area */

:where(.kk-app) .kk-content {
    padding: 1.5rem;
}

/* Card overrides */

:where(.kk-app) .card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 6px 0 rgba(60, 64, 67, 0.16) !important;
}

:where(.kk-app) .card-safari {
    border-left: 4px solid var(--safari-green);
}

/* Stat cards */

:where(.kk-app) .stat-card {
    border-radius: 12px;
    padding: 1.25rem;
    color: #fff;
}

:where(.kk-app) .stat-card.bg-safari {
    background: linear-gradient(135deg, var(--safari-dark), var(--safari-green));
}

:where(.kk-app) .stat-card.bg-gold {
    background: linear-gradient(135deg, #a1a1a1, #a6a6a6);
}

:where(.kk-app) .stat-card.bg-info-safari {
    background: linear-gradient(135deg, #767676, #939393);
}

:where(.kk-app) .stat-card.bg-danger-safari {
    background: linear-gradient(135deg, #4d4d4d, #686868);
}

/* Buttons */

:where(.kk-app) .btn-safari {
    background: var(--safari-green);
    border-color: var(--safari-green);
    color: #fff;
}

:where(.kk-app) .btn-safari:hover {
    background: var(--safari-dark);
    border-color: var(--safari-dark);
    color: #fff;
}

:where(.kk-app) .btn-gold {
    background: var(--safari-gold);
    border-color: var(--safari-gold);
    color: var(--safari-accent-ink);
}

:where(.kk-app) .btn-gold:hover {
    background: var(--safari-gold-strong);
    border-color: var(--safari-gold-strong);
    color: var(--safari-accent-ink);
}

:where(.kk-app) .btn-outline-safari {
    color: var(--safari-green);
    border-color: var(--safari-green);
}

:where(.kk-app) .btn-outline-safari:hover {
    background: var(--safari-green);
    color: #fff;
}

/* Badge */

:where(.kk-app) .badge-safari {
    background: var(--safari-green);
    color: #fff;
}

:where(.kk-app) .badge-gold {
    background: var(--safari-gold);
    color: var(--safari-accent-ink);
}

/* ── Small caps label ───────────────────────────────────────── */

/* The little grey heading that sits above a figure or a block of detail on a card ("Payee", "Amount",
   "Waiting for an active plan"). It was being written inline in every view that wanted one, which is
   how the same three declarations drifted into eight different sizes. */

:where(.kk-app) .kk-eyebrow {
    display: block;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #8a8a8a;
    margin-bottom: .25rem;
}

/* ════════════════════════════════════════════════════════════════════════
   2. ADMIN PORTAL CHROME
   ════════════════════════════════════════════════════════════════════════ */

body:where(.kk-admin) {
    font-family: var(--kk-body);
    background: var(--kk-canvas);
    color: var(--kk-body-ink);
}

:where(.kk-admin) h1,
:where(.kk-admin) h2,
:where(.kk-admin) h3,
:where(.kk-admin) h4,
:where(.kk-admin) h5,
:where(.kk-admin) h6,
:where(.kk-admin) .font-heading {
    font-family: var(--kk-display);
    letter-spacing: -.02em;
}

/* Bootstrap ships blue as its primary colour. Remap the brand-facing classes
   onto the monochrome chrome; success/danger/warning stay coloured because
   they encode status rather than brand. */

:where(.kk-admin) a {
    color: var(--admin-dark);
}

:where(.kk-admin) a:hover {
    color: #000;
}

:where(.kk-admin) .btn-primary {
    background: var(--admin-accent);
    border-color: var(--admin-accent);
    color: var(--admin-accent-ink);
}

:where(.kk-admin) .btn-primary:hover,
:where(.kk-admin) .btn-primary:focus,
:where(.kk-admin) .btn-primary:active {
    background: var(--admin-gold-strong);
    border-color: var(--admin-gold-strong);
    color: var(--admin-accent-ink);
    box-shadow: none;
}

:where(.kk-admin) .btn-outline-primary {
    color: var(--admin-accent-text);
    border-color: var(--admin-accent);
}

:where(.kk-admin) .btn-outline-primary:hover {
    background: var(--admin-accent);
    border-color: var(--admin-accent);
    color: var(--admin-accent-ink);
}

:where(.kk-admin) .btn-secondary {
    background: var(--safari-green);
    border-color: var(--safari-green);
}

:where(.kk-admin) .btn-outline-secondary {
    color: var(--safari-green);
    border-color: #D4D4D4;
}

:where(.kk-admin) .btn-outline-secondary:hover {
    background: var(--safari-green);
    border-color: var(--safari-green);
    color: #fff;
}

:where(.kk-admin) .btn-info {
    background: var(--safari-green);
    border-color: var(--safari-green);
    color: #fff;
}

:where(.kk-admin) .btn-outline-info {
    color: var(--safari-green);
    border-color: #D4D4D4;
}

:where(.kk-admin) .btn-outline-info:hover {
    background: var(--safari-green);
    border-color: var(--safari-green);
    color: #fff;
}

:where(.kk-admin) .btn-link {
    color: var(--admin-dark);
}

:where(.kk-admin) .text-primary,
:where(.kk-admin) .text-info {
    color: var(--admin-accent-text) !important;
}

/* Bootstrap's .text-muted is a blue-grey; keep the ramp neutral. */

:where(.kk-admin) .text-muted {
    color: #6E6E6E !important;
}

/* Bootstrap paints <code>/<samp> magenta (#e83e8c) — a saturated hue from
   Bootstrap's own sheet that also fails AA on white. */

:where(.kk-admin) code,
:where(.kk-admin) samp {
    color: var(--admin-dark);
}

/* Status hues encode meaning, but Bootstrap 4's success green only
   reaches 2.9:1 against white text. */

:where(.kk-admin) .badge-success,
:where(.kk-admin) .btn-success {
    background-color: #1E7E34;
    border-color: #1E7E34;
}

:where(.kk-admin) .btn-success:hover,
:where(.kk-admin) .btn-success:focus,
:where(.kk-admin) .btn-success:active {
    background-color: #16612A;
    border-color: #16612A;
    color: #fff;
}

:where(.kk-admin) .text-success {
    color: #1E7E34 !important;
}

/* Bootstrap's .text-warning (#ffc107) and .text-danger (#dc3545) are
   unreadable as text on light surfaces — 1.63:1 and 3.76:1. */

:where(.kk-admin) .text-warning {
    color: #8A6100 !important;
}

:where(.kk-admin) .text-danger {
    color: #B21F2D !important;
}

:where(.kk-admin) .bg-primary {
    background-color: var(--admin-accent) !important;
    color: var(--admin-accent-ink);
}

:where(.kk-admin) .badge-primary {
    background-color: var(--admin-accent);
    color: var(--admin-accent-ink);
}

:where(.kk-admin) .badge-info {
    background-color: var(--safari-green);
}

:where(.kk-admin) .page-link {
    color: var(--admin-dark);
}

:where(.kk-admin) .page-item.disabled .page-link {
    color: #9A9A9A;
}

:where(.kk-admin) .page-item.active .page-link {
    background-color: var(--admin-accent);
    border-color: var(--admin-accent);
    color: var(--admin-accent-ink);
}

:where(.kk-admin) .form-control:focus {
    border-color: var(--admin-accent);
    box-shadow: 0 0 0 .2rem rgba(228, 141, 43, .22);
}

:where(.kk-admin) .custom-control-input:checked~.custom-control-label::before {
    background-color: var(--admin-dark);
    border-color: var(--admin-dark);
}

/* ── A section heading that opens: same type as .nav-section, plus an arrow. Bootstrap's collapse does the
   opening, so the header carries data-toggle/data-target and the children live in .nav-group-body. ── */

/* Signing out, the admin portal's way out — matched to the links' width through the same 8px side margins. */

:where(.kk-admin) .admin-topbar {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: .5rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

:where(.kk-admin) .admin-content {
    padding: 1.5rem;
}

:where(.kk-admin) .card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

/* ════════════════════════════════════════════════════════════════════════
   3. THE SIDEBAR — both portals
   One component, .kk-sidebar, for the company portal and the admin portal:
     head (logo) · organisation card · "Jump to" filter · navigation · user card.
   A dark, quiet surface; the logo's gold marks only where you are.
   ════════════════════════════════════════════════════════════════════════ */

.kk-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    width: var(--kk-sb-w);
    height: 100vh;
    background: linear-gradient(180deg, var(--kk-sb-bg) 0%, var(--kk-sb-bg-2) 100%);
    border-right: 1px solid var(--kk-sb-line);
    color: var(--kk-sb-text);
    font-family: var(--kk-body);
    transition: transform .25s ease, width .2s ease, box-shadow .2s ease;
}

/* ── Head ── */
.kk-sb-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    padding: 0 1.1rem;
    flex: none;
}

/* The wordmark, set in text: white on the ink, with the lime full stop (the layouts use <x-brand>). */
.kk-sb-brand,
.kk-sb-brand:hover {
    text-decoration: none;
}

.kk-sb-brand .kk-sb-brand-logo {
    display: block;
    font-family: var(--kk-display);
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: -.045em;
    line-height: 1;
    color: #fff;
}

.kk-sb-brand .mk-brand-dot {
    color: var(--kk-sb-accent);
}

/* The small mark stands in for the wordmark on the collapsed rail: a lime tile with the initial. */
.kk-sb-brand .kk-sb-brand-mark {
    display: none;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--kk-sb-accent);
    color: #14140F;
    font-family: var(--kk-display);
    font-size: 1rem;
    font-weight: 800;
    line-height: 32px;
    text-align: center;
}

/* Collapse to a rail and back: a desktop control only. */
.kk-sb-collapse {
    display: none;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--kk-sb-line);
    border-radius: 8px;
    background: transparent;
    color: var(--kk-sb-muted);
    font-size: .8rem;
    cursor: pointer;
    transition: background .15s, color .15s, transform .2s ease;
}

.kk-sb-collapse:hover,
.kk-sb-collapse:focus-visible {
    background: var(--kk-sb-hover);
    color: #fff;
    outline: none;
}

.kk-sb-close {
    background: none;
    border: 0;
    color: var(--kk-sb-muted);
    font-size: 1.1rem;
    padding: .25rem;
}

.kk-sb-close:hover {
    color: #fff;
}

/* ── Organisation card: which company (or the platform) you are working in ── */
.kk-sb-org {
    display: flex;
    align-items: center;
    gap: .7rem;
    margin: 0 .85rem .75rem;
    padding: .6rem .7rem;
    border: 1px solid var(--kk-sb-line);
    border-radius: 12px;
    background: rgba(255, 255, 255, .03);
    color: var(--kk-sb-text-strong);
    text-decoration: none;
    flex: none;
}

a.kk-sb-org:hover {
    background: var(--kk-sb-hover);
    color: #fff;
    text-decoration: none;
}

.kk-sb-org-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--kk-sb-accent);
    color: #14140F;
    font-weight: 800;
    font-size: .9rem;
    flex: none;
}

.kk-sb-org-text {
    min-width: 0;
    line-height: 1.2;
}

.kk-sb-org-name {
    font-weight: 600;
    font-size: .86rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kk-sb-org-meta {
    font-size: .72rem;
    color: var(--kk-sb-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── "Jump to" filter ── */
.kk-sb-search {
    position: relative;
    margin: 0 .85rem .5rem;
    flex: none;
}

.kk-sb-search i {
    position: absolute;
    left: .75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: .75rem;
    color: var(--kk-sb-muted);
    pointer-events: none;
}

.kk-sb-search input {
    width: 100%;
    height: 34px;
    padding: 0 2rem 0 2rem;
    border: 1px solid var(--kk-sb-line);
    border-radius: 9px;
    background: rgba(255, 255, 255, .04);
    color: #fff;
    font-size: .8rem;
    outline: none;
    transition: border-color .15s, background .15s;
}

.kk-sb-search input::placeholder {
    color: var(--kk-sb-muted);
}

.kk-sb-search input:focus {
    border-color: rgba(190, 255, 80, .7);
    background: rgba(255, 255, 255, .07);
}

.kk-sb-search kbd {
    position: absolute;
    right: .55rem;
    top: 50%;
    transform: translateY(-50%);
    padding: .05rem .35rem;
    border: 1px solid var(--kk-sb-line);
    border-radius: 4px;
    background: transparent;
    color: var(--kk-sb-muted);
    font-size: .65rem;
    box-shadow: none;
}

.kk-sb-empty {
    padding: .75rem 1.2rem;
    font-size: .8rem;
    color: var(--kk-sb-muted);
}

/* ── Navigation ── */
.kk-sb-nav {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: .25rem 0 1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .15) transparent;
}

.kk-sb-nav::-webkit-scrollbar {
    width: 6px;
}

.kk-sb-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .14);
    border-radius: 6px;
}

/* A section label: plain, never a control. */
.kk-sb-section {
    padding: 1rem 1.25rem .35rem;
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--kk-sb-muted);
}

.kk-sidebar .nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: .7rem;
    margin: 1px .6rem;
    padding: .48rem .65rem;
    border-radius: 8px;
    color: var(--kk-sb-text);
    font-size: .84rem;
    font-weight: 500;
    line-height: 1.25;
    text-decoration: none;
    transition: background .15s, color .15s;
}

.kk-sidebar .nav-link>i:first-child {
    width: 18px;
    flex: none;
    text-align: center;
    font-size: .86rem;
    color: var(--kk-sb-muted);
    transition: color .15s;
}

.kk-sidebar .nav-link:hover {
    background: var(--kk-sb-hover);
    color: var(--kk-sb-text-strong);
    text-decoration: none;
}

.kk-sidebar .nav-link:hover>i:first-child {
    color: rgba(255, 255, 255, .8);
}

/* Where you are: a soft gold wash, white text, a gold mark on the left edge and a gold icon. */
.kk-sidebar .nav-link.active {
    background: var(--kk-sb-active);
    color: var(--kk-sb-text-strong);
    font-weight: 600;
}

.kk-sidebar .nav-link.active::before {
    content: '';
    position: absolute;
    left: -.6rem;
    top: 20%;
    bottom: 20%;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--kk-sb-accent);
}

.kk-sidebar .nav-link.active>i:first-child {
    color: var(--kk-sb-accent);
}

.kk-sidebar .nav-link:focus-visible,
.kk-sidebar .nav-group-header:focus-visible {
    outline: 2px solid var(--kk-sb-accent);
    outline-offset: -2px;
}

.kk-sidebar .nav-link .badge {
    margin-left: auto;
    font-size: .66rem;
    font-weight: 700;
    padding: .25em .5em;
    border-radius: 9999px;
}

/* A group that opens: the same row as a link, with a chevron, and its children on a guide line. */
.kk-sidebar .nav-group-header {
    display: flex;
    align-items: center;
    gap: .7rem;
    margin: 1px .6rem;
    padding: .48rem .65rem;
    border-radius: 8px;
    color: var(--kk-sb-text);
    font-size: .84rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    transition: background .15s, color .15s;
}

.kk-sidebar .nav-group-header .group-icon {
    width: 18px;
    flex: none;
    text-align: center;
    font-size: .86rem;
    color: var(--kk-sb-muted);
}

.kk-sidebar .nav-group-header .nav-arrow {
    margin-left: auto;
    font-size: .62rem;
    color: var(--kk-sb-muted);
    transition: transform .2s ease;
}

.kk-sidebar .nav-group-header.collapsed .nav-arrow {
    transform: rotate(-90deg);
}

.kk-sidebar .nav-group-header:hover {
    background: var(--kk-sb-hover);
    color: var(--kk-sb-text-strong);
}

.kk-sidebar .nav-group-header:not(.collapsed) {
    color: var(--kk-sb-text-strong);
}

/* The group you are in says so even when it is closed. */
.kk-sidebar .nav-group-header.has-active .group-icon {
    color: var(--kk-sb-accent);
}

.kk-sidebar .nav-group-body {
    position: relative;
    margin: 0 0 .25rem;
}

.kk-sidebar .nav-group-body::before {
    content: '';
    position: absolute;
    left: calc(.6rem + .65rem + 8px);
    top: 2px;
    bottom: 2px;
    width: 1px;
    background: var(--kk-sb-line);
}

.kk-sidebar .nav-group-body .nav-link {
    margin-left: calc(.6rem + 22px);
    padding-left: .75rem;
    font-size: .82rem;
}

.kk-sidebar .nav-group-body .nav-link>i:first-child {
    display: none;
}

.kk-sidebar .nav-group-body .nav-link.active::before {
    left: -.55rem;
    top: 25%;
    bottom: 25%;
    width: 2px;
    border-radius: 2px;
}

/* ── User card, pinned to the foot ── */
.kk-sb-foot {
    flex: none;
    border-top: 1px solid var(--kk-sb-line);
    padding: .65rem .85rem .8rem;
}

.kk-sb-foot .nav-link {
    margin: 0 0 .35rem;
    font-size: .78rem;
    color: var(--kk-sb-muted);
}

.kk-sb-foot .nav-link:hover {
    color: #fff;
}

.kk-sb-user {
    display: flex;
    align-items: center;
    gap: .65rem;
}

.kk-sb-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #2A2D35;
    color: #fff;
    font-size: .82rem;
    font-weight: 700;
    flex: none;
}

.kk-sb-user-text {
    min-width: 0;
    flex: 1;
    line-height: 1.2;
}

.kk-sb-user-name {
    color: #fff;
    font-size: .82rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kk-sb-user-role {
    color: var(--kk-sb-muted);
    font-size: .7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kk-sb-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--kk-sb-muted);
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.kk-sb-icon-btn:hover {
    background: var(--kk-sb-hover);
    color: #fff;
    text-decoration: none;
}

.kk-sb-icon-btn.nav-signout:hover {
    color: #F87171;
}

/* ── Main column beside it ── */
.kk-main,
.admin-main {
    margin-left: var(--kk-sb-w);
    min-height: 100vh;
    transition: margin-left .25s ease;
}

/* ── Collapsed: an icon rail on the desktop (§6.48) ──
   <html class="kk-sb-collapsed"> narrows the menu to its icons, each with its name as a tooltip, and gives the page
   the room. Pointing at the rail (or tabbing into it) opens it in full over the page without moving anything, so a
   page in a closed group is still a hover away; the button, or "[", opens it for good. */
@media (min-width: 992px) {
    .kk-sb-collapse {
        display: inline-flex;
    }

    .kk-sb-collapsed .kk-main,
    .kk-sb-collapsed .admin-main {
        margin-left: var(--kk-sb-rail);
    }

    .kk-sb-collapsed .kk-sidebar {
        width: var(--kk-sb-rail);
    }

    .kk-sb-collapsed .kk-sidebar:hover,
    .kk-sb-collapsed .kk-sidebar:focus-within {
        width: var(--kk-sb-w);
        box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
    }

    .kk-sb-collapsed .kk-sb-collapse i {
        transform: rotate(180deg);
    }

    .kk-sb-collapsed .kk-sidebar:not(:hover):not(:focus-within) .kk-sb-head {
        flex-direction: column;
        justify-content: center;
        gap: .4rem;
        height: auto;
        padding: .9rem 0 .6rem;
    }

    .kk-sb-collapsed .kk-sidebar:not(:hover):not(:focus-within) .kk-sb-brand-logo,
    .kk-sb-collapsed .kk-sidebar:not(:hover):not(:focus-within) .kk-sb-org-text,
    .kk-sb-collapsed .kk-sidebar:not(:hover):not(:focus-within) .kk-sb-search,
    .kk-sb-collapsed .kk-sidebar:not(:hover):not(:focus-within) .nav-group-header span,
    .kk-sb-collapsed .kk-sidebar:not(:hover):not(:focus-within) .nav-group-header .nav-arrow,
    .kk-sb-collapsed .kk-sidebar:not(:hover):not(:focus-within) .nav-group-body,
    .kk-sb-collapsed .kk-sidebar:not(:hover):not(:focus-within) .kk-sb-user-text {
        display: none !important;
    }

    .kk-sb-collapsed .kk-sidebar:not(:hover):not(:focus-within) .kk-sb-brand-mark {
        display: block;
    }

    .kk-sb-collapsed .kk-sidebar:not(:hover):not(:focus-within) .kk-sb-org {
        justify-content: center;
        margin: 0 .7rem .6rem;
        padding: .45rem;
    }

    /* A section label becomes a hairline between groups of icons. */
    .kk-sb-collapsed .kk-sidebar:not(:hover):not(:focus-within) .kk-sb-section {
        height: 1px;
        margin: .7rem 1.1rem;
        padding: 0;
        overflow: hidden;
        font-size: 0;
        background: var(--kk-sb-line);
    }

    /* A link keeps its icon and loses its words (they stay in the title tooltip). */
    .kk-sb-collapsed .kk-sidebar:not(:hover):not(:focus-within) .nav-link,
    .kk-sb-collapsed .kk-sidebar:not(:hover):not(:focus-within) .nav-group-header {
        justify-content: center;
        gap: 0;
        margin: 2px .7rem;
        padding: .6rem 0;
        font-size: 0;
    }

    .kk-sb-collapsed .kk-sidebar:not(:hover):not(:focus-within) .nav-link>i:first-child,
    .kk-sb-collapsed .kk-sidebar:not(:hover):not(:focus-within) .nav-group-header .group-icon {
        width: auto;
        font-size: 1rem;
    }

    .kk-sb-collapsed .kk-sidebar:not(:hover):not(:focus-within) .nav-link .badge {
        position: absolute;
        top: 3px;
        right: 6px;
        min-width: 8px;
        height: 8px;
        padding: 0;
        font-size: 0;
    }

    .kk-sb-collapsed .kk-sidebar:not(:hover):not(:focus-within) .kk-sb-foot {
        padding: .6rem 0 .75rem;
    }

    .kk-sb-collapsed .kk-sidebar:not(:hover):not(:focus-within) .kk-sb-user {
        flex-direction: column;
        gap: .35rem;
    }
}

/* ── Phones and tablets: off-canvas, over a dimmed page ── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1035;
    background: rgba(10, 10, 12, .5);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

@media (max-width: 991.98px) {
    .kk-sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }

    .kk-sidebar.show {
        transform: translateX(0);
        box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
    }

    .sidebar-overlay.show {
        display: block;
    }

    .kk-main,
    .admin-main {
        margin-left: 0;
    }
}

@media (prefers-reduced-motion: reduce) {

    .kk-sidebar,
    .kk-sidebar .nav-link,
    .kk-sidebar .nav-group-header .nav-arrow {
        transition: none;
    }
}

/* ════════════════════════════════════════════════════════════════════════
   4. SELECT2 — moved to select2.css, which every layout links (it was here and in the other stylesheet, word
   for word).
   ════════════════════════════════════════════════════════════════════════ */

/* ════════════════════════════════════════════════════════════════════════
   5. GUIDED TOUR
   ════════════════════════════════════════════════════════════════════════ */

.safaripilot-tour {
    --tour-surface: #fff;
    --tour-line: #e5e7eb;
    --tour-ink: #111827;
    --tour-body: #374151;
    --tour-muted: #6b7280;
    padding: 0;
    min-width: 260px;
    max-width: 340px;
    border-radius: 14px;
    background-color: var(--tour-surface);
    box-shadow: 0 20px 45px rgba(17, 24, 39, .22), 0 2px 8px rgba(17, 24, 39, .08);
}

/* intro.js sets a font stack on every element it manages, which would
   otherwise leave the tour in Helvetica next to a page set in Inter. */

.safaripilot-tour,
.safaripilot-tour * {
    font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

.safaripilot-tour .introjs-tooltip-header {
    padding: 14px 16px 0;
}

.safaripilot-tour .introjs-tooltip-title {
    font-family: 'Coolvetica', system-ui, sans-serif;
    font-size: .95rem;
    font-weight: 800;
    color: var(--tour-ink);
    letter-spacing: -.01em;
}

.safaripilot-tour .introjs-tooltiptext {
    padding: 8px 16px 14px;
    font-size: .875rem;
    line-height: 1.6;
    color: var(--tour-body);
}

.safaripilot-tour .introjs-tooltiptext strong {
    color: var(--tour-ink);
}

/* The way out, top-right: quiet until it is pointed at. */

.safaripilot-tour .introjs-skipbutton {
    top: 6px;
    right: 8px;
    width: 28px;
    height: 28px;
    line-height: 28px;
    font-size: 1.1rem;
    color: var(--tour-muted);
    border-radius: 8px;
}

.safaripilot-tour .introjs-skipbutton:hover,
.safaripilot-tour .introjs-skipbutton:focus {
    color: var(--tour-ink);
    background-color: #f3f4f6;
}

.safaripilot-tour .introjs-tooltipbuttons {
    padding: 10px 14px;
    border-top: 1px solid var(--tour-line);
    background-color: #fcfcfd;
    border-radius: 0 0 14px 14px;
}

/* The buttons wear the same clothes as `.kk-btn`, so the tour looks
   like part of the portal rather than an advert dropped on top of it. */

.safaripilot-tour .introjs-button {
    padding: .4rem .85rem;
    font-size: .8rem;
    font-weight: 600;
    color: var(--tour-ink);
    background-color: var(--tour-surface);
    border: 1px solid var(--tour-line);
    border-radius: 10px;
    text-shadow: none;
}

.safaripilot-tour .introjs-button:hover {
    color: var(--tour-ink);
    background-color: #f9fafb;
    border-color: #d1d5db;
}

.safaripilot-tour .introjs-button:focus {
    color: var(--tour-ink);
    background-color: #f9fafb;
    border-color: #d1d5db;
    box-shadow: 0 0 0 .2rem rgba(17, 24, 39, .12);
}

/* Moving on is the one button that should look like an action. */

.safaripilot-tour .introjs-nextbutton,
.safaripilot-tour .introjs-donebutton {
    color: #fff;
    background-color: var(--tour-ink);
    border-color: var(--tour-ink);
}

.safaripilot-tour .introjs-nextbutton:hover,
.safaripilot-tour .introjs-nextbutton:focus,
.safaripilot-tour .introjs-donebutton:hover,
.safaripilot-tour .introjs-donebutton:focus {
    color: #fff;
    background-color: #1f2937;
    border-color: #1f2937;
}

.safaripilot-tour .introjs-disabled,
.safaripilot-tour .introjs-disabled:hover,
.safaripilot-tour .introjs-disabled:focus {
    color: var(--tour-muted);
    background-color: #f9fafb;
    border-color: var(--tour-line);
    opacity: .7;
}

/* How far through the walk you are. */

.safaripilot-tour .introjs-progress {
    height: 4px;
    margin: 10px 16px 0;
    border-radius: 30px;
    background-color: #f3f4f6;
}

.safaripilot-tour .introjs-progressbar {
    background-color: var(--tour-ink);
    border-radius: 30px;
}

.safaripilot-tour .introjs-bullets ul li a {
    background: #d1d5db;
}

.safaripilot-tour .introjs-bullets ul li a.active,
.safaripilot-tour .introjs-bullets ul li a:hover {
    background: var(--tour-ink);
}

/* The arrows are cut out of the tooltip's own surface, so they follow
   `--tour-surface` rather than being set to white by hand. */

.safaripilot-tour .introjs-arrow.top,
.safaripilot-tour .introjs-arrow.top-right,
.safaripilot-tour .introjs-arrow.top-middle {
    border-bottom-color: var(--tour-surface);
}

.safaripilot-tour .introjs-arrow.right,
.safaripilot-tour .introjs-arrow.right-bottom {
    border-left-color: var(--tour-surface);
}

.safaripilot-tour .introjs-arrow.bottom,
.safaripilot-tour .introjs-arrow.bottom-right,
.safaripilot-tour .introjs-arrow.bottom-middle {
    border-top-color: var(--tour-surface);
}

.safaripilot-tour .introjs-arrow.left,
.safaripilot-tour .introjs-arrow.left-bottom {
    border-right-color: var(--tour-surface);
}

/* ── The page behind the tooltip ───────────────────────────────── */

/* The scrim. intro.js sets its opacity in JavaScript (from the tour's
   own `overlayOpacity`); the tint is here so the dimmed portal keeps
   the app's ink rather than going flat black. */

.introjs-overlay {
    background-color: #0f172a;
}

/* The spotlight: the app's own radius, and a light ring so the
   highlighted thing reads as chosen rather than merely visible. */

.introjs-helperLayer {
    border-radius: 12px;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, .35);
}

/* ── Small screens ─────────────────────────────────────────────── */

@media (max-width: 575.98px) {
    .safaripilot-tour {
        min-width: 0;
        max-width: 280px;
    }

    .safaripilot-tour .introjs-tooltiptext {
        font-size: .825rem;
    }
}

/* ════════════════════════════════════════════════════════════════════════
   6. DASHBOARDS, CARDS AND ROWS
   ════════════════════════════════════════════════════════════════════════ */

/* ── Page head ─────────────────────────────────────────────── */

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

.kk-page-title {
    font-family: var(--kk-display);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.25;
    color: var(--kk-ink);
    margin: 0 0 .25rem;
}

.kk-page-meta {
    font-family: var(--kk-body);
    font-size: .85rem;
    color: var(--kk-muted);
    margin: 0;
}

.kk-page-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

/* ── Quiet buttons, the way the head uses them ─────────────── */

.kk-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: var(--kk-surface);
    border: 1px solid var(--kk-line-strong);
    color: var(--kk-body-ink);
    font-family: var(--kk-body);
    font-size: .8rem;
    font-weight: 600;
    border-radius: var(--kk-radius-pill);
    padding: .45rem 1.1rem;
    transition: border-color .18s, color .18s;
}

.kk-btn:hover {
    border-color: var(--kk-muted);
    color: var(--kk-ink);
    text-decoration: none;
}

/* The one the reader is on — the date preset the report is already showing (§6.12). */

.kk-btn--on {
    background: var(--kk-ink);
    border-color: var(--kk-ink);
    color: #fff;
}

.kk-btn--on:hover {
    background: var(--kk-ink);
    border-color: var(--kk-ink);
    color: #fff;
}

/* ── Stat cards ────────────────────────────────────────────── */

.kk-stat-link {
    display: block;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.kk-stat-link:hover {
    color: inherit;
    text-decoration: none;
}

.kk-stat {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--kk-surface);
    border: 0;
    border-radius: var(--kk-radius);
    box-shadow: var(--kk-shadow);
    padding: 1.15rem 1.25rem;
    transition: box-shadow .2s, transform .2s;
}

.kk-stat-link:hover .kk-stat {
    box-shadow: var(--kk-shadow-hover);
    transform: translateY(-1px);
}

.kk-stat-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .85rem;
}

.kk-stat-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--kk-line);
    color: var(--kk-muted);
    font-size: 1rem;
    flex: none;
}

/* A figure that wants attention rather than describing something. */

.kk-stat-chip--warn {
    background: #fef3c7;
    color: #b45309;
}

.kk-stat-label,
.kk-strip-label,
.kk-micro {
    font-family: var(--kk-body);
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--kk-muted);
    margin-bottom: .25rem;
}

.kk-stat-value {
    font-family: var(--kk-display);
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.2;
    color: var(--kk-ink);
    margin-bottom: .25rem;
}

.kk-stat-caption {
    font-family: var(--kk-body);
    font-size: .75rem;
    color: var(--kk-muted);
    margin-bottom: 0;
}

/* A stat that is a link to somewhere else gets a footer of actions. */

/* ── Deltas and tones ──────────────────────────────────────── */

.kk-tag {
    font-family: var(--kk-body);
    font-size: .7rem;
    font-weight: 600;
    border-radius: var(--kk-radius-pill);
    padding: .2rem .65rem;
    white-space: nowrap;
}

.kk-tone-ok {
    background: #E6F7EE;
    color: #0F5132;
}

.kk-tone-warn {
    background: #FFF4C2;
    color: #634800;
}

.kk-tone-info {
    background: #DFF4FC;
    color: #14140F;
}

.kk-tone-danger {
    background: #FEF2F2;
    color: #9B1C1C;
}

.kk-tone-muted {
    background: #EDEDE3;
    color: #44443C;
}

/* Profit and what is still owed, on the financial dashboard (§6.55): the slate tile, so it reads apart from info. */
.kk-tone-plum {
    background: #EDEDE3;
    color: #14140F;
}

/* A tone applied to a figure rather than a badge. */

.kk-value-ok {
    color: #0F5132;
}

.kk-value-info {
    color: #14140F;
}

.kk-value-warn {
    color: #8A5A00;
}

.kk-value-danger {
    color: #9B1C1C;
}

/* ── Figure tiles: a small figure on a tinted ground (§6.55) ─────
   A row of them in a panel; the tone class (kk-tone-*) gives the tint and the ink. A tile may be a link. */

.kk-figs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: .85rem;
}

.kk-figs-title {
    font-family: var(--kk-body);
    font-size: .8rem;
    font-weight: 600;
    color: var(--kk-body-ink);
    margin-bottom: .6rem;
}

.kk-fig {
    display: block;
    border-radius: 12px;
    padding: .9rem 1rem;
    text-decoration: none;
    transition: box-shadow .2s, transform .2s;
}

a.kk-fig:hover {
    color: inherit;
    text-decoration: none;
    box-shadow: var(--kk-shadow-hover);
    transform: translateY(-1px);
}

.kk-fig-label {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-family: var(--kk-body);
    font-size: .74rem;
    font-weight: 600;
    opacity: .85;
}

.kk-fig-value {
    font-family: var(--kk-display);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -.01em;
    margin: .35rem 0 .15rem;
}

.kk-fig-note {
    font-family: var(--kk-body);
    font-size: .72rem;
    opacity: .8;
    line-height: 1.4;
}

/* A filter in a page head: label, control and actions on one line. */
.kk-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .6rem;
}

.kk-filter .kk-micro {
    margin-bottom: 0;
}

/* `w-auto` on the select keeps this width through Select2 (select2-init.js). */
.kk-filter-select {
    min-width: 14rem;
}

@media (prefers-reduced-motion: reduce) {

    .kk-fig,
    a.kk-fig:hover {
        transition: none;
        transform: none;
    }
}

/* ── Panels: charts, lists, anything that is a card of content ─ */

.kk-panel {
    background: var(--kk-surface);
    border: 0;
    border-radius: var(--kk-radius);
    box-shadow: var(--kk-shadow);
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.kk-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    padding: 1.15rem 1.25rem .75rem;
}

/* A panel of rows butts its header against the first of them. */

.kk-panel-head--line {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--kk-line);
}

/* A quiet mark on the right of a head, where a badge would be too loud. */

.kk-panel-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--kk-line);
    color: var(--kk-muted);
    font-size: .8rem;
    flex: none;
}

.kk-panel-title {
    font-family: var(--kk-display);
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--kk-ink);
    margin: 0 0 .15rem;
}

.kk-panel-sub {
    font-family: var(--kk-body);
    font-size: .78rem;
    color: var(--kk-muted);
    margin: 0;
}

.kk-panel-body {
    padding: 0 1.25rem 1.25rem;
}

/* A small, quiet sentence that explains a figure rather than describing the page. */

.kk-note {
    font-family: var(--kk-body);
    font-size: .78rem;
    color: var(--kk-muted);
    margin: 0;
}

.kk-panel-link {
    font-family: var(--kk-body);
    font-size: .78rem;
    font-weight: 600;
    color: var(--kk-muted);
    white-space: nowrap;
}

.kk-panel-link:hover {
    color: var(--kk-ink);
    text-decoration: none;
}

/* Two things on the right of a head — a figure and the way into the page behind it. */

.kk-panel-aside {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex: none;
}

/* ── The strip: a line of small figures in one card ────────── */

.kk-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: var(--kk-surface);
    border-radius: var(--kk-radius);
    box-shadow: var(--kk-shadow);
    padding: .85rem 1.25rem;
}

.kk-strip-item {
    padding: .45rem .75rem;
    text-align: center;
    border-right: 1px solid var(--kk-line);
}

.kk-strip-item:last-child {
    border-right: 0;
}

.kk-strip-value {
    font-family: var(--kk-display);
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.3;
    color: var(--kk-ink);
}

.kk-strip-unit {
    font-size: .75rem;
    font-weight: 400;
    color: var(--kk-muted);
}

.kk-strip-link {
    display: block;
    font-family: var(--kk-body);
    font-size: .75rem;
    color: var(--kk-muted);
    text-decoration: none;
}

a.kk-strip-link:hover {
    color: var(--kk-ink);
    text-decoration: none;
}

@media (max-width: 767.98px) {
    .kk-strip {
        grid-template-columns: repeat(2, 1fr);
        padding: .7rem .75rem;
    }

    .kk-strip-item {
        padding: .5rem .4rem;
    }

    /* No divider hanging off the right edge of a row. */

    .kk-strip-item:nth-child(2n) {
        border-right: 0;
    }
}

/* ── A bar: one figure against the largest of its set ──────────
   Used where a chart would be too much and a number alone says too little — a
   ready-made pipeline, for instance, where the shape of the stages is the point.
   The width is set on the fill by the view, as a percentage of the biggest. */

.kk-bar {
    height: 6px;
    border-radius: var(--kk-radius-pill);
    background: var(--kk-line);
    overflow: hidden;
}

.kk-bar-fill {
    display: block;
    height: 100%;
    border-radius: var(--kk-radius-pill);
    background: var(--kk-ink);
}

/* ── Rows: the lists a panel holds ─────────────────────────── */

.kk-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .8rem 1.25rem;
    border-bottom: 1px solid var(--kk-line);
    transition: background .12s;
}

.kk-row:last-child {
    border-bottom: 0;
}

.kk-row:hover {
    background: #fafbfc;
}

.kk-row-lead {
    display: flex;
    align-items: center;
    min-width: 0;
}

.kk-row-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    margin-right: .75rem;
    border-radius: 10px;
    background: var(--kk-line);
    color: var(--kk-faint);
    font-size: .8rem;
}

/* When the avatar carries a person's initial, the shade belongs to them and the letter is white. */

.kk-row-avatar--initial {
    color: #fff;
    font-weight: 700;
    font-size: .82rem;
}

/* A row nobody has read yet: the mark is dark and the title carries the weight (§6.30). */

.kk-row-avatar--unread {
    background: var(--kk-ink);
    color: #fff;
}

.kk-row--unread .kk-row-title {
    font-weight: 800;
}

/* A payment reminder (§6.60): red on the left, a red avatar and a red title, so money invoiced and not received is
   never read as an ordinary message. */

.kk-row--danger {
    border-left: 3px solid #b91c1c;
    background: #fffbfb;
}

.kk-row--danger:hover {
    background: #fef2f2;
}

.kk-row--danger .kk-row-title,
.kk-row--danger .kk-row-title a {
    color: #991b1b;
}

.kk-row-avatar--danger,
.kk-row--danger .kk-row-avatar {
    background: #fef2f2;
    color: #b91c1c;
    box-shadow: inset 0 0 0 1px #fecaca;
}

.kk-row-text {
    min-width: 0;
}

.kk-row-title {
    font-family: var(--kk-body);
    font-size: .85rem;
    font-weight: 700;
    color: var(--kk-ink);
}

.kk-row-meta {
    font-size: .75rem;
    color: var(--kk-muted);
    overflow-wrap: anywhere;
}

.kk-row-mono {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: .75rem;
    color: var(--kk-muted);
    overflow-wrap: anywhere;
}

.kk-row-side {
    margin-left: .5rem;
    text-align: right;
}

.kk-row-value {
    font-family: var(--kk-display);
    font-size: .88rem;
    font-weight: 700;
}

.kk-row-faint {
    margin-top: .25rem;
    font-size: .72rem;
    color: var(--kk-muted);
}

/* ── Quick actions ─────────────────────────────────────────── */

.kk-quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: .6rem;
}

.kk-quick {
    display: flex;
    align-items: center;
    gap: .65rem;
    background: var(--kk-surface);
    border: 1px solid var(--kk-line-strong);
    border-radius: var(--kk-radius-sm);
    padding: .7rem .9rem;
    font-family: var(--kk-body);
    font-size: .82rem;
    font-weight: 600;
    color: var(--kk-body-ink);
    transition: border-color .18s, color .18s, background .18s;
}

.kk-quick i {
    color: var(--kk-faint);
    font-size: .85rem;
    width: 16px;
    text-align: center;
}

.kk-quick:hover {
    border-color: var(--kk-muted);
    color: var(--kk-ink);
    background: #fcfcfd;
    text-decoration: none;
}

.kk-quick:hover i {
    color: var(--kk-ink);
}

/* ── Narrow screens ────────────────────────────────────────── */

@media (max-width: 575.98px) {
    .kk-stat-value {
        font-size: 1.4rem;
    }

    .kk-stat {
        padding: 1rem;
    }

    .kk-stat-chip {
        width: 36px;
        height: 36px;
        font-size: .85rem;
    }

    .kk-page-title {
        font-size: 1.15rem;
    }
}

/* ════════════════════════════════════════════════════════════════════════
   7. CALENDAR
   ════════════════════════════════════════════════════════════════════════ */

.cal-page {
    padding-bottom: 32px;
}

/* ── Head ───────────────────────────────────────────────────── */

.cal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.cal-head h4 {
    font-weight: 800;
    color: #14140F;
    margin: 0 0 4px;
}

.cal-head p {
    color: #6E6E64;
    font-size: .86rem;
    margin: 0;
    max-width: 640px;
    line-height: 1.55;
}

.cal-nav {
    display: flex;
    gap: 6px;
}

.btn-cal-outline {
    background: #fff;
    color: #14140F;
    border: 1.5px solid #d5d8d7;
    border-radius: 10px;
    font-weight: 700;
    font-size: .85rem;
    padding: .4rem .85rem;
}

.btn-cal-outline:hover {
    border-color: #14140F;
    color: #14140F;
}

/* ── Legend ─────────────────────────────────────────────────── */

.cal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-bottom: 14px;
}

.cal-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: .78rem;
    color: #6E6E64;
}

.cal-legend-item i {
    font-size: .7rem;
}

.cal-legend-item strong {
    color: #14140F;
    font-weight: 800;
}

/* ── The grid ───────────────────────────────────────────────── */

.cal-card {
    border-radius: 16px;
    border: 1px solid #e6e8e7;
    background: #fff;
    box-shadow: 0 3px 14px rgba(57, 57, 57, .05);
    overflow: hidden;
    margin-bottom: 20px;
}

.cal-weekdays,
.cal-week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.cal-weekdays {
    border-bottom: 1px solid #f1f3f2;
    background: #fbfcfb;
}

.cal-weekdays span {
    padding: 10px 12px;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .7px;
    text-transform: uppercase;
    color: #919183;
}

.cal-day {
    min-height: 108px;
    padding: 7px 8px 9px;
    border-top: 1px solid #f1f3f2;
    border-right: 1px solid #f1f3f2;
}

.cal-week .cal-day:last-child {
    border-right: none;
}

.cal-day.is-weekend {
    background: #fcfcfb;
}

.cal-day.is-out {
    background: #fafafa;
}

.cal-day.is-out .cal-day-num {
    color: #c9c9c9;
}

.cal-day.is-today {
    background: #f6f8f6;
    box-shadow: inset 0 0 0 1.5px #b9c9be;
}

.cal-day-head {
    display: flex;
    align-items: baseline;
    gap: 5px;
    margin-bottom: 5px;
}

.cal-day-num {
    font-size: .8rem;
    font-weight: 800;
    color: #4a4a4a;
}

.cal-day-month {
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: #919183;
}

/* ── Chips ──────────────────────────────────────────────────── */

.cal-chip {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 6px;
    margin-bottom: 3px;
    border-radius: 6px;
    font-size: .72rem;
    line-height: 1.35;
    text-decoration: none;
    overflow: hidden;
    white-space: nowrap;
    border-left: 2.5px solid transparent;
    transition: filter .15s;
}

.cal-chip:hover {
    text-decoration: none;
    filter: brightness(.96);
}

.cal-chip i {
    font-size: .62rem;
    opacity: .75;
    flex: none;
}

.cal-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.cal-chip.is-follow_up {
    background: #eef5f0;
    color: #3f6b4f;
    border-left-color: #5b8a70;
}

.cal-chip.is-travel {
    background: #eef2f7;
    color: #3f5a7a;
    border-left-color: #5d7ea3;
}

.cal-chip.is-departure {
    background: #f5f0ec;
    color: #7d5a45;
    border-left-color: #a5806a;
}

.cal-chip.is-invoice {
    background: #f7f3e8;
    color: #7d6a45;
    border-left-color: #c79a4b;
}

.cal-chip.is-renewal {
    background: #eff0f2;
    color: #4f5560;
    border-left-color: #7c8496;
}

.cal-more {
    font-size: .68rem;
    color: #919183;
    padding-left: 2px;
}

/* ── Next 30 days ───────────────────────────────────────────── */

.cal-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f3f2;
}

.cal-card-head h6 {
    font-weight: 800;
    color: #14140F;
    margin: 0;
}

.cal-card-head small {
    color: #919183;
}

.cal-card-body {
    padding: 14px 20px 18px;
}

.cal-list-day+.cal-list-day {
    margin-top: 14px;
}

.cal-list-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .7px;
    text-transform: uppercase;
    color: #919183;
    margin-bottom: 6px;
}

.cal-list-today {
    background: #14140F;
    color: #fff;
    border-radius: 20px;
    padding: 1px 8px;
    font-size: .6rem;
    letter-spacing: .5px;
}

.cal-list-item {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 7px 8px;
    border-radius: 9px;
    text-decoration: none;
    color: inherit;
    transition: background .15s;
}

.cal-list-item:hover {
    background: #fbfcfb;
    text-decoration: none;
    color: inherit;
}

.cal-list-mark {
    width: 3px;
    align-self: stretch;
    border-radius: 3px;
    flex: none;
    background: #d5d8d7;
}

.cal-list-item.is-follow_up .cal-list-mark {
    background: #5b8a70;
}

.cal-list-item.is-travel .cal-list-mark {
    background: #5d7ea3;
}

.cal-list-item.is-departure .cal-list-mark {
    background: #a5806a;
}

.cal-list-item.is-invoice .cal-list-mark {
    background: #c79a4b;
}

.cal-list-item.is-renewal .cal-list-mark {
    background: #7c8496;
}

.cal-list-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.cal-list-title {
    font-size: .86rem;
    font-weight: 700;
    color: #14140F;
}

.cal-list-detail {
    font-size: .75rem;
    color: #6E6E64;
}

.cal-empty {
    text-align: center;
    color: #919183;
    font-size: .82rem;
    line-height: 1.6;
    padding: 22px 8px;
}

.cal-empty i {
    display: block;
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: #d5d8d7;
}

/* ── Narrow screens: the grid stays a grid, the chips shrink ── */

@media (max-width: 991.98px) {
    .cal-day {
        min-height: 84px;
        padding: 6px;
    }

    .cal-chip span {
        display: none;
    }

    .cal-chip {
        justify-content: center;
    }
}

/* ════════════════════════════════════════════════════════════════════════
   8a. SUBSCRIPTION PAGES
   ════════════════════════════════════════════════════════════════════════ */

/* ── Page ── */

.subs-page {
    background: #f8faf9;
    min-height: 100vh;
    padding-bottom: 32px;
}

.subs-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.subs-head h4 {
    font-weight: 800;
    color: #14140F;
    margin: 0 0 4px;
}

.subs-head p {
    color: #6E6E64;
    font-size: .86rem;
    margin: 0;
    max-width: 640px;
    line-height: 1.55;
}

/* ── Current plan, as the page's anchor ── */

.subs-hero {
    border-radius: 18px;
    border: 1px solid #e6e8e7;
    background: #fff;
    box-shadow: 0 4px 20px rgba(57, 57, 57, .06);
    padding: 24px;
    margin-bottom: 20px;
}

/* The free trial (§6.8): stated above the period, because it is the one thing an account on a trial needs to
   know — when billing starts, and how much it will be. */
.subs-trial {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    padding: 18px 20px;
    margin-bottom: 18px;
    border: 1px solid #f0dcb4;
    border-left: 4px solid #e0a13a;
    border-radius: 12px;
    background: #fdf6e7;
}

.subs-trial strong {
    display: block;
    margin-bottom: 4px;
    color: #7a4f10;
    font-size: .95rem;
}

.subs-trial p {
    margin: 0;
    font-size: .85rem;
    line-height: 1.6;
    color: #6b5330;
}

.subs-hero-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.subs-plan-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: #14140F;
    line-height: 1.2;
    margin: 0 0 6px;
}

.subs-plan-price {
    color: #5d5d5d;
    font-size: .9rem;
}

.subs-plan-price strong {
    color: #14140F;
}

.subs-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .4px;
    text-transform: uppercase;
    white-space: nowrap;
}

.subs-status.is-active {
    background: #eef5f0;
    color: #3f6b4f;
}

.subs-status.is-cancelled {
    background: #f5f2ec;
    color: #7d6a45;
}

.subs-status.is-expired {
    background: #f7eeee;
    color: #8a4a4a;
}

/* ── Period bar: how far through the paid-for period the account is ── */

.subs-period {
    margin: 22px 0 4px;
}

.subs-period-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    font-size: .78rem;
    color: #6E6E64;
    margin-bottom: 8px;
}

.subs-period-bar {
    height: 8px;
    border-radius: 8px;
    background: #eef0ef;
    overflow: hidden;
}

.subs-period-fill {
    height: 100%;
    border-radius: 8px;
    background: #6E6E64;
    transition: width .3s;
}

/* ── Metric tiles ── */

.subs-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 22px;
}

.subs-metric {
    border-radius: 14px;
    background: #fbfcfb;
    border: 1px solid #eef0ef;
    padding: 14px 16px;
}

.subs-metric-label {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .7px;
    text-transform: uppercase;
    color: #919183;
    margin-bottom: 6px;
}

.subs-metric-value {
    font-size: 1.15rem;
    font-weight: 800;
    color: #14140F;
    line-height: 1.25;
}

.subs-metric-note {
    font-size: .75rem;
    color: #6E6E64;
    margin-top: 3px;
}

.subs-metric-note.is-good {
    color: #3f6b4f;
}

/* ── Actions ── */

.subs-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.subs-actions .btn {
    border-radius: 10px;
    font-weight: 700;
    font-size: .85rem;
    padding: .5rem 1rem;
}

.btn-subs-primary {
    background: #14140F;
    color: #fff;
    border: none;
}

.btn-subs-primary:hover {
    background: #2b2b2b;
    color: #fff;
}

.btn-subs-outline {
    background: #fff;
    color: #14140F;
    border: 1.5px solid #d5d8d7;
}

.btn-subs-outline:hover {
    border-color: #14140F;
    color: #14140F;
}

.btn-subs-danger {
    background: #fff;
    color: #8a4a4a;
    border: 1.5px solid #e7d7d7;
}

.btn-subs-danger:hover {
    border-color: #8a4a4a;
    color: #8a4a4a;
}

/* ── Cards and sections ── */

.subs-card {
    border-radius: 16px;
    border: 1px solid #e6e8e7;
    background: #fff;
    box-shadow: 0 3px 14px rgba(57, 57, 57, .05);
    margin-bottom: 20px;
}

.subs-card-head {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f3f2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.subs-card-head h6 {
    font-weight: 800;
    color: #14140F;
    margin: 0;
}

.subs-card-head small {
    color: #919183;
}

.subs-card-body {
    padding: 20px;
}

/* ── A quote: the lines that make up a charge ── */

.subs-quote-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: .87rem;
    padding: 7px 0;
}

.subs-quote-row .label {
    color: #6E6E64;
}

.subs-quote-row .value {
    font-weight: 600;
    color: #14140F;
    white-space: nowrap;
}

.subs-quote-row .value.is-credit {
    color: #3f6b4f;
}

.subs-quote-divider {
    height: 1px;
    background: #f1f3f2;
    margin: 10px 0;
}

.subs-quote-total {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: 1.05rem;
    font-weight: 800;
    color: #14140F;
}

.subs-quote-total .value {
    white-space: nowrap;
}

.subs-quote-note {
    font-size: .78rem;
    color: #6E6E64;
    line-height: 1.55;
    margin: 10px 0 0;
}

/* ── Selectable options (plans and cycles on the change screen) ── */

/* ── Empty state ── */

.subs-empty {
    border-radius: 16px;
    border: 1px dashed #d5d8d7;
    background: #fff;
    padding: 40px 24px;
    text-align: center;
}

.subs-empty i {
    font-size: 1.8rem;
    color: #d5d8d7;
    display: block;
    margin-bottom: 12px;
}

.subs-empty h6 {
    font-weight: 800;
    color: #14140F;
    margin-bottom: 6px;
}

.subs-empty p {
    color: #6E6E64;
    font-size: .86rem;
    margin-bottom: 18px;
}

/* ── Tables inside the module ── */

.subs-page .table thead th {
    border-top: none;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: #919183;
}

.subs-page .table td {
    vertical-align: middle;
    font-size: .86rem;
}

/* ── Usage meters ───────────────────────────────────────── */

.subs-meter+.subs-meter {
    margin-top: 20px;
}

.subs-meter-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 8px;
}

.subs-meter-name {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: .86rem;
    font-weight: 700;
    color: #14140F;
}

.subs-meter-name i {
    width: 15px;
    text-align: center;
    font-size: .8rem;
    color: #919183;
}

.subs-meter-count {
    font-size: .78rem;
    color: #6E6E64;
    white-space: nowrap;
}

.subs-meter-count strong {
    color: #14140F;
    font-weight: 800;
}

.subs-meter-bar {
    height: 8px;
    border-radius: 8px;
    background: #eef0ef;
    overflow: hidden;
}

.subs-meter-fill {
    height: 100%;
    border-radius: 8px;
    transition: width .3s;
}

.subs-meter-fill.is-ok {
    background: #5b8a70;
}

.subs-meter-fill.is-warn {
    background: #c79a4b;
}

.subs-meter-fill.is-full {
    background: #a55959;
}

.subs-meter-note {
    font-size: .75rem;
    color: #919183;
    margin-top: 6px;
    line-height: 1.5;
}

@media (max-width: 575.98px) {
    .subs-hero {
        padding: 18px;
    }

    .subs-plan-name {
        font-size: 1.25rem;
    }

    .subs-actions .btn {
        flex: 1 1 100%;
        text-align: center;
    }
}

/* ════════════════════════════════════════════════════════════════════════
   8b. PLANS
   ════════════════════════════════════════════════════════════════════════ */

/* ── Page ── */

.plans-page {
    background: #f8fdf9;
    min-height: 100vh;
}

/* ── Toggle ── */

.billing-toggle {
    display: inline-flex;
    align-items: center;
    background: #fff;
    border: 1.5px solid #dee2e6;
    border-radius: 30px;
    padding: 4px;
    gap: 4px;
}

.billing-toggle button {
    border: none;
    background: transparent;
    border-radius: 24px;
    padding: 6px 20px;
    font-size: .85rem;
    font-weight: 600;
    color: #6E6E64;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
}

.billing-toggle button.active {
    background: #14140F;
    color: #fff;
}

.save-badge {
    background: #a1a1a1;
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    letter-spacing: .3px;
    vertical-align: middle;
}

/* ── Plan cards ── */

.plan-card {
    border-radius: 18px;
    border: 2px solid #e9ecef;
    background: #fff;
    overflow: hidden;
    transition: box-shadow .22s, transform .22s, border-color .22s;
    position: relative;
    display: flex;
    flex-direction: column;
}

.plan-card:hover {
    box-shadow: 0 12px 36px rgba(57, 57, 57, .12);
    transform: translateY(-4px);
}

.plan-card.recommended {
    border-color: #14140F;
    box-shadow: 0 8px 32px rgba(57, 57, 57, .18);
    transform: translateY(-6px);
}

.plan-card.recommended:hover {
    transform: translateY(-10px);
}

.plan-card.is-current {
    border-color: #6E6E64;
}

.popular-badge {
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    background: #14140F;
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    padding: 4px 18px;
    border-radius: 0 0 12px 12px;
    letter-spacing: .5px;
    text-transform: uppercase;
    white-space: nowrap;
}

.plan-header {
    padding: 28px 24px 20px;
}

.plan-name {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6E6E64;
    margin-bottom: 6px;
}

.plan-price {
    font-size: 2.6rem;
    font-weight: 800;
    color: #14140F;
    line-height: 1;
}

.plan-price sup {
    font-size: 1.1rem;
    font-weight: 700;
    vertical-align: top;
    margin-top: .55rem;
    display: inline-block;
}

.plan-price-note {
    font-size: .78rem;
    color: #919183;
    margin-top: 4px;
}

.plan-desc {
    font-size: .85rem;
    color: #6E6E64;
    line-height: 1.6;
    margin-top: 10px;
}

.plan-limits {
    padding: 0 24px 16px;
    border-bottom: 1px solid #f3f4f6;
}

.limit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 0;
    font-size: .83rem;
    border-bottom: 1px solid #f9fafb;
}

.limit-row:last-child {
    border-bottom: none;
}

.limit-label {
    color: #6E6E64;
    display: flex;
    align-items: center;
    gap: 7px;
}

.limit-label i {
    width: 14px;
    text-align: center;
    color: #919183;
    font-size: .75rem;
}

.limit-value {
    font-weight: 700;
    color: #14140F;
}

.limit-value.unlimited {
    color: #6E6E64;
}

.plan-features {
    padding: 16px 24px;
    flex-grow: 1;
}

.feature-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: .82rem;
    color: #545454;
}

.feature-check {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .6rem;
    flex-shrink: 0;
}

.feature-check.yes {
    background: #f9f9f9;
    color: #6E6E64;
}

.feature-check.no {
    background: #F3F4F6;
    color: #d1d5db;
}

.plan-cta {
    padding: 16px 24px 24px;
}

.btn-plan {
    width: 100%;
    padding: .75rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: .9rem;
    border: none;
    cursor: pointer;
    transition: all .2s;
}

.btn-plan-primary {
    background: #14140F;
    color: #fff;
}

.btn-plan-primary:hover {
    background: #313131;
    box-shadow: 0 4px 14px rgba(57, 57, 57, .35);
}

.btn-plan-current {
    background: #f9f9f9;
    color: #4a4a4a;
    border: 2px solid #cacaca;
    cursor: default;
}

.btn-plan-outline {
    background: #fff;
    color: #14140F;
    border: 2px solid #14140F;
}

.btn-plan-outline:hover {
    background: #14140F;
    color: #fff;
}

/* ── Current plan banner ── */

.current-banner {
    border-radius: 12px;
    background: linear-gradient(135deg, #E9F5EE, #f0f0f0);
    border: 1px solid #cacaca;
    padding: 14px 20px;
    margin-bottom: 28px;
}

/* ── All-plans features strip ── */

.included-strip {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #e9ecef;
    padding: 20px 24px;
    margin-top: 32px;
}

.included-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .83rem;
    color: #545454;
}

.included-item i {
    color: #6E6E64;
    font-size: .75rem;
}

/* ════════════════════════════════════════════════════════════════════════
   9a. QUOTATION BUILDER
   ════════════════════════════════════════════════════════════════════════ */

.section-card {
    border-radius: 12px;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .07);
    margin-bottom: 1.25rem;
}

.section-card .card-header {
    background: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, .07);
    border-radius: 12px 12px 0 0;
    padding: .85rem 1.25rem;
}

.line-item-row td {
    padding: .4rem .5rem;
    vertical-align: middle;
}

.day-card {
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: .75rem;
    background: #fdfdfd;
}

.day-card .day-handle {
    cursor: grab;
    color: #ccc;
}

/* ════════════════════════════════════════════════════════════════════════
   9b. PAYMENTS
   ════════════════════════════════════════════════════════════════════════ */

.kpi-card {
    border-radius: 14px;
    border: none;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .07);
    overflow: hidden;
}

.ledger-row:hover {
    background: #f8fdf9;
}

.type-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: .7rem;
    font-weight: 600;
}

.type-trip {
    background: #E9F5EE;
    color: #4e4e4e;
}

.type-subscription {
    background: #f5f5f5;
    color: #4e4e4e;
}

.gateway-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .78rem;
    color: #555;
}

.outstanding-row {
    border-radius: 10px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .07);
    margin-bottom: 8px;
    transition: box-shadow .18s;
}

.outstanding-row:hover {
    box-shadow: 0 3px 12px rgba(0, 0, 0, .08);
}

.filter-form select,
.filter-form input[type=date],
.filter-form input[type=text] {
    border-radius: 8px;
    font-size: .85rem;
    border: 1px solid #dee2e6;
    height: 36px;
}

/* ════════════════════════════════════════════════════════════════════════
   9c. PAYING AN INVOICE
   ════════════════════════════════════════════════════════════════════════ */

/* ── The grid the page is set in ────────────────────────────────── */

/* The right column stacks two of the dashboard's panels, and a panel is built for a grid of equal-height
   cards: `height: 100%` inside a column that the row stretches, with `overflow: hidden`. Stacked, both would
   try to fill the same column — the first would clip its own content and the second would spill out of it.
   On this page the columns are only as tall as what is in them. */

.pay-grid {
    row-gap: 1.25rem;
    align-items: flex-start;
}

.pay-grid .kk-panel {
    height: auto;
}

/* ── The card that takes the money ─────────────────────────────── */

.pay-panel {
    background: var(--kk-surface);
    border: 1px solid var(--kk-line-strong);
    border-radius: var(--kk-radius);
    box-shadow: var(--kk-shadow);
    padding: 1.75rem;
}

.pay-panel-head {
    margin-bottom: 1.5rem;
}

.pay-panel-title {
    font-family: var(--kk-display);
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--kk-ink);
    margin: 0 0 .35rem;
}

.pay-panel-sub {
    font-family: var(--kk-body);
    font-size: .875rem;
    line-height: 1.55;
    color: var(--kk-muted);
    margin: 0;
    max-width: 46ch;
}

/* ── Fields ────────────────────────────────────────────────────── */

.pay-field {
    margin-bottom: 1.25rem;
}

.pay-label {
    display: block;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--kk-muted);
    margin-bottom: .5rem;
}

.pay-hint {
    font-size: .8rem;
    line-height: 1.5;
    color: var(--kk-muted);
    margin: .5rem 0 0;
}

/* The amount reads as money: the code sits in its own block and the figure is tabular and right-aligned, so
   the digits stay in place as it is typed. */

.pay-amount-input {
    display: flex;
    align-items: stretch;
}

.pay-currency {
    display: flex;
    align-items: center;
    padding: 0 .9rem;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--kk-muted);
    background: var(--kk-line);
    border: 1px solid var(--kk-line-strong);
    border-right: 0;
    border-radius: var(--kk-radius-sm) 0 0 var(--kk-radius-sm);
}

.pay-input {
    /* `width` matters as well as `flex`: the amount field is a flex item that shares its row with the currency
       block, but the phone field stands on its own — and an `<input>` left at `width: auto` is only as wide as
       the browser's default box, not the form. */
    width: 100%;
    flex: 1;
    min-width: 0;
    height: 50px;
    padding: 0 .9rem;
    font-family: var(--kk-body);
    font-size: 1rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--kk-ink);
    background: var(--kk-surface);
    border: 1px solid var(--kk-line-strong);
    border-radius: var(--kk-radius-sm);
    transition: border-color .15s, box-shadow .15s;
}

.pay-amount-input .pay-input {
    border-radius: 0 var(--kk-radius-sm) var(--kk-radius-sm) 0;
    text-align: right;
}

.pay-input::placeholder {
    color: var(--kk-faint);
    font-weight: 400;
}

.pay-input:focus {
    outline: none;
    border-color: var(--kk-ink);
    box-shadow: 0 0 0 3px rgba(17, 24, 39, .08);
}

/* ── The method, shown rather than asked ───────────────────────── */

.pay-method {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .9rem 1rem;
    background: var(--kk-line);
    border: 1px solid var(--kk-line-strong);
    border-radius: var(--kk-radius-sm);
}

.pay-method-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    color: var(--kk-ink);
    background: var(--kk-surface);
    border: 1px solid var(--kk-line-strong);
    border-radius: 12px;
}

.pay-method-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pay-method-text strong {
    font-family: var(--kk-display);
    font-size: .95rem;
    font-weight: 700;
    color: var(--kk-ink);
}

.pay-method-text small {
    font-size: .8rem;
    color: var(--kk-muted);
}

.pay-method-check {
    margin-left: auto;
    color: #16a34a;
    font-size: 1.05rem;
}

/* ── What the request is doing ─────────────────────────────────── */

.pay-status {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .9rem 1rem;
    margin-bottom: 1.25rem;
    font-size: .875rem;
    line-height: 1.55;
    color: #1e3a8a;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--kk-radius-sm);
}

/* An author `display` beats the user agent's `[hidden] { display: none }`, so the panel above would sit empty
   on the page until the flow had something to say. It has to say so itself. */

.pay-status[hidden] {
    display: none;
}

.pay-status-icon {
    flex: 0 0 auto;
    margin-top: .1rem;
}

.pay-status-text {
    display: block;
    min-width: 0;
}

.pay-status-text strong {
    font-family: var(--kk-display);
    font-weight: 700;
}

/* The flow publishes its state on the form, so the message, the steps and the button cannot disagree about
   where the request is (§6.27). */

#zengapayForm[data-state="approved"] .pay-status,
#zengapayForm[data-state="completed"] .pay-status {
    color: #166534;
    background: #f0fdf4;
    border-color: #bbf7d0;
}

#zengapayForm[data-state="failed"] .pay-status {
    color: #991b1b;
    background: #fef2f2;
    border-color: #fecaca;
}

/* ── The three steps ───────────────────────────────────────────── */

.pay-steps {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
}

.pay-step {
    position: relative;
    display: flex;
    gap: .85rem;
    padding: .6rem 0;
}

/* The line down the middle of the list, drawn behind the dots. */

.pay-step:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 15px;
    top: 2.3rem;
    bottom: -.1rem;
    width: 2px;
    background: var(--kk-line-strong);
}

.pay-step-dot {
    position: relative;
    z-index: 1;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    color: var(--kk-faint);
    background: var(--kk-surface);
    border: 1px solid var(--kk-line-strong);
    border-radius: 50%;
    transition: background .2s, border-color .2s, color .2s, box-shadow .2s;
}

.pay-step-text {
    display: flex;
    flex-direction: column;
    padding-top: .15rem;
}

.pay-step-text strong {
    font-size: .875rem;
    font-weight: 600;
    color: var(--kk-body-ink);
}

.pay-step-text small {
    font-size: .78rem;
    line-height: 1.45;
    color: var(--kk-muted);
}

/* Where the request is in the three steps. */

#zengapayForm[data-state="pending"] .pay-step:nth-child(1) .pay-step-dot,
#zengapayForm[data-state="approved"] .pay-step:nth-child(2) .pay-step-dot {
    color: #fff;
    background: var(--kk-ink);
    border-color: var(--kk-ink);
    animation: pay-pulse 2s ease-out infinite;
}

#zengapayForm[data-state="approved"] .pay-step:nth-child(1) .pay-step-dot,
#zengapayForm[data-state="completed"] .pay-step .pay-step-dot {
    color: #fff;
    background: #16a34a;
    border-color: #16a34a;
}

#zengapayForm[data-state="completed"] .pay-step-text strong {
    color: #166534;
}

#zengapayForm[data-state="failed"] .pay-step:nth-child(1) .pay-step-dot {
    color: #fff;
    background: #dc2626;
    border-color: #dc2626;
}

@keyframes pay-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(17, 24, 39, .28);
    }

    50% {
        box-shadow: 0 0 0 7px rgba(17, 24, 39, 0);
    }
}

/* ── The one thing to press ────────────────────────────────────── */

.pay-submit {
    width: 100%;
    height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    padding: 0 1.25rem;
    font-family: var(--kk-display);
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background: var(--kk-ink);
    border: 0;
    border-radius: var(--kk-radius-sm);
    cursor: pointer;
    transition: transform .12s, box-shadow .2s, opacity .2s;
}

.pay-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(17, 24, 39, .18);
}

.pay-submit:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.pay-submit:focus-visible {
    outline: 3px solid rgba(17, 24, 39, .25);
    outline-offset: 2px;
}

.pay-trust {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    margin: 1rem 0 0;
    font-size: .78rem;
    line-height: 1.5;
    color: var(--kk-muted);
}

.pay-trust i {
    margin-top: .15rem;
}

/* ── The invoice, beside the form ──────────────────────────────── */

.pay-lines {
    margin-bottom: 1rem;
}

.pay-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: .4rem 0;
    font-size: .85rem;
}

.pay-line+.pay-line {
    border-top: 1px solid var(--kk-line);
}

.pay-line-label {
    color: var(--kk-muted);
}

.pay-line-value {
    font-weight: 600;
    text-align: right;
    color: var(--kk-ink);
}

.pay-ref {
    font-variant-numeric: tabular-nums;
    letter-spacing: .01em;
}

.pay-note {
    margin: 0 0 1rem;
    padding: .6rem .75rem;
    font-size: .82rem;
    line-height: 1.5;
    color: var(--kk-body-ink);
    background: var(--kk-line);
    border-radius: var(--kk-radius-sm);
}

.pay-totals {
    border-top: 1px solid var(--kk-line-strong);
    padding-top: .5rem;
}

.pay-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: .35rem 0;
    font-size: .875rem;
    color: var(--kk-body-ink);
}

.pay-total span:last-child {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.pay-total--due {
    margin-top: .35rem;
    padding-top: .75rem;
    font-weight: 700;
    color: var(--kk-ink);
    border-top: 1px dashed var(--kk-line-strong);
}

.pay-total--due span:last-child {
    font-family: var(--kk-display);
    font-size: 1.15rem;
    font-weight: 800;
}

/* ── Nothing left to pay ───────────────────────────────────────── */

.pay-settled {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding: 1.1rem 1.25rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--kk-radius-sm);
}

.pay-settled-icon {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #fff;
    background: #16a34a;
    border-radius: 50%;
}

.pay-settled strong {
    font-family: var(--kk-display);
    color: #166534;
}

.pay-settled .pay-hint {
    display: block;
    margin-top: .15rem;
    color: #166534;
    opacity: .85;
}

.pay-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

@media (prefers-reduced-motion: reduce) {

    .pay-submit,
    .pay-step-dot {
        transition: none;
    }

    #zengapayForm[data-state="pending"] .pay-step:nth-child(1) .pay-step-dot,
    #zengapayForm[data-state="approved"] .pay-step:nth-child(2) .pay-step-dot {
        animation: none;
    }
}

/* ── Narrow screens ────────────────────────────────────────────── */

@media (max-width: 575.98px) {
    /* The card's own inset plus the layout's leaves too little room for the fields. */

    .pay-panel {
        padding: 1.25rem;
    }

    .pay-panel-head {
        margin-bottom: 1.25rem;
    }

    .pay-submit {
        height: 50px;
    }
}

/* ════════════════════════════════════════════════════════════════════════
   10a. ADMIN DASHBOARD
   ════════════════════════════════════════════════════════════════════════ */

.font-weight-600 {
    font-weight: 600 !important;
}

/* ─── Dashboard: the day's work (§6.52) ───────────────────────────────────── */

.kk-ops-count {
    flex-shrink: 0;
    min-width: 2.1rem;
    padding: .15rem .6rem;
    border-radius: var(--kk-radius-pill);
    background: var(--kk-line);
    color: var(--kk-ink);
    font-family: var(--kk-display);
    font-size: .95rem;
    font-weight: 700;
    text-align: center;
}

a.kk-ops-count:hover {
    background: var(--kk-line-strong);
    color: var(--kk-ink);
    text-decoration: none;
}

.kk-ops-empty {
    padding: 1.4rem 1.25rem;
    color: var(--kk-muted);
    font-size: .84rem;
}

.kk-ops-empty .fa-check-circle {
    color: #16a34a;
}

.kk-ops-foot {
    display: block;
    padding: .7rem 1.25rem;
    border-top: 1px solid var(--kk-line);
    color: var(--kk-muted);
    font-size: .78rem;
    font-weight: 600;
}

.kk-ops-foot:hover {
    color: var(--kk-ink);
    text-decoration: none;
    background: #fafafa;
}

.kk-ops-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    padding: .6rem 1.25rem;
    border-bottom: 1px solid var(--kk-line);
    color: var(--kk-body-ink);
    font-size: .84rem;
}

.kk-ops-row:last-child {
    border-bottom: 0;
}

a.kk-ops-row:hover {
    background: #fafafa;
    color: var(--kk-ink);
    text-decoration: none;
}

.kk-ops-row-main {
    min-width: 0;
}

.kk-ops-row-title {
    color: var(--kk-ink);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kk-ops-row-meta {
    color: var(--kk-muted);
    font-size: .74rem;
}

.kk-ops-row-side {
    flex-shrink: 0;
    text-align: right;
    font-size: .78rem;
    white-space: nowrap;
}

.kk-ops-late {
    color: #b91c1c;
    font-weight: 700;
}

.kk-section-title {
    margin: 1.75rem 0 .75rem;
    color: var(--kk-muted);
    font-family: var(--kk-body);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.kk-table-money td,
.kk-table-money th {
    font-size: .82rem;
    vertical-align: middle;
}

.kk-table-money td.num,
.kk-table-money th.num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}


/* ════════════════════════════════════════════════════════════════════════
   11. THE PRODUCT THEME — the portal in the brand's clothes
   ════════════════════════════════════════════════════════════════════════

   The workspace reads like the site that sells it: Archivo throughout, a warm off-black menu with lime marking
   where you are, a cream canvas, white panels with 16px corners and one hairline, headline figures on soft accent
   tiles, and lime for the one thing to do. Most of it is the token block at the top of the file; what is here is
   what the tokens cannot say.

   Contrast, measured:
     • ink #14140F on white ................ 18.4:1     • body ink #2A2A24 on white ......... 14.6:1
     • muted #6E6E64 on canvas #FAFAF5 ...... 5.0:1     • white on ink ...................... 18.4:1
     • ink on lime #BEFF50 ................. 15.5:1     • ink on cyan #82DCFA ............... 12.2:1
   White on lime (1.2:1) is never used. */

body.kk-app,
body.kk-admin {
    background: var(--kk-canvas);
    font-family: var(--kk-body);
    color: var(--kk-body-ink);
    -webkit-font-smoothing: antialiased;
}

:is(.kk-app, .kk-admin) ::selection {
    background: #BEFF50;
    color: #14140F;
}

:is(.kk-app, .kk-admin) :is(h1, h2, h3, h4, h5, h6) {
    color: var(--kk-ink);
}

/* ── The topbar: white, one hairline, the company and the date beside the page's name ── */

:is(.kk-app, .kk-admin) :is(.kk-topbar, .admin-topbar) {
    min-height: 64px;
    padding: .6rem 1.75rem;
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid var(--kk-line);
    box-shadow: none;
    -webkit-backdrop-filter: saturate(1.4) blur(8px);
    backdrop-filter: saturate(1.4) blur(8px);
}

:is(.kk-app, .kk-admin) :is(.kk-topbar, .admin-topbar) .text-dark {
    color: var(--kk-ink) !important;
}

.kk-crumb-icon {
    color: var(--kk-muted);
}

.kk-mast-meta {
    align-items: center;
    gap: .65rem;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid var(--kk-line);
    font-family: var(--kk-body);
    font-size: .8125rem;
    font-weight: 600;
    color: var(--kk-muted);
    white-space: nowrap;
}

.kk-plan-pill {
    display: inline-flex;
    align-items: center;
    padding: .2rem .65rem;
    border-radius: 999px;
    background: #BEFF50;
    color: #14140F;
    font-size: .72rem;
    font-weight: 700;
}

.kk-mast-date i {
    margin-right: .4rem;
}

:is(.kk-app, .kk-admin) .user-avatar {
    border-radius: 50%;
    background: var(--kk-ink);
    color: #fff;
    font-family: var(--kk-body);
    font-weight: 700;
}

/* ── The head of a page: a large extrabold title and one quiet line under it ── */

.kk-page-head {
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0;
    border-bottom: 0;
}

.kk-page-title {
    margin: 0 0 .3rem;
    font-family: var(--kk-display);
    font-size: clamp(1.6rem, 2.4vw, 2.2rem);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -.035em;
    color: var(--kk-ink);
}

.kk-page-meta {
    max-width: 78ch;
    font-size: .875rem;
    color: var(--kk-muted);
}

.kk-eyebrow,
.kk-micro {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--kk-muted);
}

.kk-stat-label,
.kk-fig-label,
.kk-strip-label,
.subs-metric-label,
.subs-card-head {
    font-size: .8125rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--kk-muted);
}

.kk-section-title,
.kk-ops-row-title,
.kk-row-title {
    font-family: var(--kk-display);
}

/* ── Panels: white, 16px corners, one hairline ── */

:is(.kk-app, .kk-admin) .kk-panel {
    background: var(--kk-surface);
    border: 1px solid var(--kk-line);
    border-radius: var(--kk-radius);
    box-shadow: var(--kk-shadow);
}

:is(.kk-app, .kk-admin) .kk-panel-head {
    align-items: center;
    padding: 1.1rem 1.35rem;
    border-bottom: 1px solid var(--kk-line);
}

:is(.kk-app, .kk-admin) .kk-panel-head--line {
    padding-bottom: 1.1rem;
}

:is(.kk-app, .kk-admin) .kk-panel-title {
    font-family: var(--kk-display);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--kk-ink);
}

:is(.kk-app, .kk-admin) .kk-panel-sub {
    font-size: .8rem;
    color: var(--kk-muted);
}

:is(.kk-app, .kk-admin) .kk-panel-body {
    padding: 1.15rem 1.35rem 1.35rem;
}

:is(.kk-app, .kk-admin) .kk-panel-icon {
    border: 0;
    border-radius: 12px;
    background: #DFF4FC;
    color: var(--kk-ink);
}

:is(.kk-app, .kk-admin) .kk-note {
    font-size: .8rem;
    color: var(--kk-muted);
}

/* ── Buttons: sentence case, 10px corners, a small lift ── */

.kk-btn {
    border: 1px solid var(--kk-line-strong);
    border-radius: 10px;
    background: var(--kk-surface);
    color: var(--kk-ink);
    font-size: .8125rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    padding: .5rem .95rem;
    transition: transform .2s cubic-bezier(.22, 1, .36, 1), border-color .15s, background .15s, color .15s;
}

.kk-btn:hover {
    border-color: var(--kk-ink);
    background: var(--kk-surface);
    color: var(--kk-ink);
    transform: translateY(-1px);
}

.kk-btn--on,
.kk-btn--on:hover {
    background: var(--kk-ink);
    border-color: var(--kk-ink);
    color: #fff;
}

:is(.kk-app, .kk-admin) .btn {
    border-radius: 10px;
    font-family: var(--kk-body);
    font-weight: 700;
    transition: transform .2s cubic-bezier(.22, 1, .36, 1), background-color .15s, border-color .15s, color .15s;
}

:is(.kk-app, .kk-admin) .btn:not(.btn-link):not(.dropdown-toggle):hover {
    transform: translateY(-1px);
}

:is(.kk-app, .kk-admin) .btn-sm {
    border-radius: 9px;
    font-size: .8rem;
}

:is(.kk-app, .kk-admin) .btn-primary:hover,
:is(.kk-app, .kk-admin) .btn-primary:focus {
    background: #ADF03C;
    border-color: #ADF03C;
    color: #14140F;
}

:is(.kk-app, .kk-admin) .btn:focus,
:is(.kk-app, .kk-admin) .btn.focus {
    box-shadow: var(--kk-ring);
}

/* The mark at the head of a record row: a pastel tile, as on the site's cards. A person's initial keeps the shade
   the view gives it. */
:is(.kk-app, .kk-admin) .kk-row-avatar {
    border-radius: 12px;
    background: #DFF4FC;
    color: var(--kk-ink);
}

:is(.kk-app, .kk-admin) .kk-row:hover {
    background: #F7F7EF;
}

:is(.kk-app, .kk-admin) .kk-quick {
    border-color: var(--kk-line);
    border-radius: 12px;
    color: var(--kk-ink);
}

:is(.kk-app, .kk-admin) .kk-quick i {
    color: var(--kk-ink);
}

:is(.kk-app, .kk-admin) .kk-quick:hover {
    border-color: var(--kk-ink);
    background: #fff;
}

/* The module screens' main action (New quote, Save, Filter) is the lime button, as on the site. */
:is(.kk-app, .kk-admin) .btn-safari,
:is(.kk-app, .kk-admin) .btn-safari:focus {
    background: #BEFF50;
    border-color: #BEFF50;
    color: #14140F;
}

:is(.kk-app, .kk-admin) .btn-safari:hover,
:is(.kk-app, .kk-admin) .btn-safari:not(:disabled):not(.disabled):active {
    background: #ADF03C;
    border-color: #ADF03C;
    color: #14140F;
}

/* ── Headline figures: pastel tiles, the way the site shows its own figures ──
   Each stat in a row takes the next tile colour, so a row reads lime, cyan, purple, orange, stone, pink. The
   figure is ink on every tile; only a loss keeps its red. */

:is(.kk-app, .kk-admin) .kk-stat {
    border: 0;
    border-radius: var(--kk-radius);
    background: var(--kk-tile-1);
    box-shadow: none;
    padding: 1.15rem 1.25rem 1.2rem;
}

:is(.kk-app, .kk-admin) .row > :nth-child(6n+2) .kk-stat { background: var(--kk-tile-2); }
:is(.kk-app, .kk-admin) .row > :nth-child(6n+3) .kk-stat { background: var(--kk-tile-3); }
:is(.kk-app, .kk-admin) .row > :nth-child(6n+4) .kk-stat { background: var(--kk-tile-4); }
:is(.kk-app, .kk-admin) .row > :nth-child(6n+5) .kk-stat { background: var(--kk-tile-5); }
:is(.kk-app, .kk-admin) .row > :nth-child(6n+6) .kk-stat { background: var(--kk-tile-6); }

:is(.kk-app, .kk-admin) .kk-stat .kk-stat-label {
    color: rgba(20, 20, 15, .78);
}

:is(.kk-app, .kk-admin) .kk-stat .kk-stat-value {
    font-family: var(--kk-display);
    font-weight: 700;
    letter-spacing: -.035em;
    font-variant-numeric: tabular-nums;
    color: var(--kk-ink);
}

:is(.kk-app, .kk-admin) .kk-stat .kk-value-danger {
    color: #9B1C1C;
}

:is(.kk-app, .kk-admin) .kk-stat .kk-stat-caption {
    color: rgba(20, 20, 15, .72);
}

:is(.kk-app, .kk-admin) .kk-stat .kk-stat-chip {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .6);
    color: var(--kk-ink);
    font-size: .85rem;
}

.kk-stat-link:hover .kk-stat {
    transform: translateY(-2px);
    box-shadow: var(--kk-shadow-hover);
}

:is(.kk-app, .kk-admin) .stat-card,
:is(.kk-app, .kk-admin) .kk-fig {
    border: 1px solid var(--kk-line);
    border-radius: 14px;
    box-shadow: none;
}

:is(.kk-app, .kk-admin) .kk-fig-value,
:is(.kk-app, .kk-admin) .kk-stat-value {
    font-variant-numeric: tabular-nums;
}

:is(.kk-app, .kk-admin) .kk-tag,
:is(.kk-app, .kk-admin) .badge {
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    padding: .3em .65em;
}

/* A card of the day's work with nothing in it takes no room: its column goes, and the row closes up. */
:is(.kk-app, .kk-admin) .row > [class*="col"]:has(> .kk-ops-card--empty) {
    display: none;
}

/* On the day's desk, one line that says how much is waiting on the trips dashboard. */
.kk-trip-callout {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .95rem 1.2rem;
    color: var(--kk-ink);
    text-decoration: none;
    transition: border-color .15s ease, transform .2s ease;
}

.kk-trip-callout:hover {
    border-color: var(--kk-ink);
    color: var(--kk-ink);
    text-decoration: none;
    transform: translateY(-1px);
}

.kk-trip-callout .kk-row-avatar {
    margin-right: 0;
    background: #BEFF50;
}

.kk-trip-callout-text {
    flex: 1;
    min-width: 0;
}

.kk-trip-callout-text strong {
    display: block;
    font-size: .95rem;
}

.kk-trip-callout-text span {
    display: block;
    font-size: .8rem;
    color: var(--kk-muted);
}

.kk-trip-callout-go {
    flex: none;
    font-size: .85rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ── A panel that opens: the detail behind a headline figure, closed until it is asked for ── */

.kk-disclosure > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    list-style: none;
    cursor: pointer;
}

.kk-disclosure > summary::-webkit-details-marker {
    display: none;
}

.kk-disclosure:not([open]) > summary {
    border-bottom: 0;
}

.kk-disclosure > summary:focus-visible {
    outline: 2px solid var(--kk-ink);
    outline-offset: -2px;
    border-radius: var(--kk-radius);
}

.kk-disclosure-toggle {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: .4rem;
    padding: .4rem .9rem;
    border: 1px solid var(--kk-line-strong);
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--kk-ink);
    white-space: nowrap;
}

.kk-disclosure-toggle i {
    font-size: .65rem;
    transition: transform .2s ease;
}

.kk-disclosure[open] .kk-disclosure-toggle i {
    transform: rotate(180deg);
}

/* ── Tables: a soft header row, hairlines between records ── */

:is(.kk-app, .kk-admin) .table {
    margin-bottom: 0;
    color: var(--kk-body-ink);
}

:is(.kk-app, .kk-admin) .table thead th {
    background: #FAFAF5;
    border-top: 0;
    border-bottom: 1px solid var(--kk-line);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    color: var(--kk-muted);
    vertical-align: middle;
    white-space: nowrap;
}

:is(.kk-app, .kk-admin) .table td {
    border-color: var(--kk-line);
    font-variant-numeric: tabular-nums;
    vertical-align: middle;
}

:is(.kk-app, .kk-admin) .table-hover tbody tr:hover {
    background: #F7F7EF;
}

/* The last column is where a row's actions live. */
:is(.kk-app, .kk-admin) .table td:last-child,
:is(.kk-app, .kk-admin) .table th:last-child {
    text-align: right;
}

:is(.kk-app, .kk-admin) .kk-datatable th,
:is(.kk-app, .kk-admin) .kk-datatable td {
    padding: .65rem .85rem;
}

/* ── Forms: sentence-case labels, 10px fields, a sky focus ring ── */

:is(.kk-app, .kk-admin) label,
:is(.kk-app, .kk-admin) .col-form-label,
:is(.kk-app, .kk-admin) .sf-label {
    margin-bottom: .35rem;
    font-size: .8125rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--kk-ink);
}

:is(.kk-app, .kk-admin) .form-control,
:is(.kk-app, .kk-admin) .custom-select {
    border: 1px solid var(--kk-line-strong);
    border-radius: 10px;
    background-color: var(--kk-surface);
    color: var(--kk-ink);
    font-family: var(--kk-body);
    font-size: .9rem;
    box-shadow: none !important;
    transition: border-color .15s, box-shadow .15s;
}

:is(.kk-app, .kk-admin) .form-control:focus,
:is(.kk-app, .kk-admin) .custom-select:focus {
    border-color: var(--kk-ink);
    box-shadow: var(--kk-ring) !important;
    outline: none;
}

:is(.kk-app, .kk-admin) .form-control::placeholder {
    color: var(--kk-faint);
}

:is(.kk-app, .kk-admin) .form-text,
:is(.kk-app, .kk-admin) .invalid-feedback {
    font-size: .78rem;
}

:is(.kk-app, .kk-admin) .input-group-text {
    border-color: var(--kk-line-strong);
    background: #FAFAF5;
    color: var(--kk-muted);
}

:is(.kk-app, .kk-admin) .custom-control-input:checked ~ .custom-control-label::before {
    background-color: var(--kk-ink);
    border-color: var(--kk-ink);
}

/* ── Alerts: a soft tint and a matching hairline ── */

:is(.kk-app, .kk-admin) .alert {
    border: 1px solid transparent;
    border-radius: 12px;
    box-shadow: none;
    font-size: .875rem;
}

:is(.kk-app, .kk-admin) .alert-success {
    background: #ECFDF3;
    border-color: #C6EFD6;
    color: #0F5132;
}

:is(.kk-app, .kk-admin) .alert-danger {
    background: #FEF2F2;
    border-color: #F8CFCF;
    color: #8A1C1C;
}

:is(.kk-app, .kk-admin) .alert-warning {
    background: #FFF8DB;
    border-color: #F5E19C;
    color: #634800;
}

:is(.kk-app, .kk-admin) .alert-info {
    background: #F0F0E6;
    border-color: #DEDED3;
    color: #14140F;
}

/* ── The menu: ink, a lighter row where you are, lime on its icon ── */

.kk-sidebar {
    background: var(--kk-sb-bg);
    border-right: 0;
}

.kk-sidebar .kk-sb-section {
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .5);
}

.kk-sidebar .nav-link,
.kk-sidebar .nav-group-header {
    border-radius: 10px;
    font-size: .86rem;
    font-weight: 600;
    color: var(--kk-sb-text);
}

.kk-sidebar .nav-link.active {
    background: var(--kk-sb-active);
    color: #fff;
    box-shadow: none;
}

.kk-sidebar .nav-link.active::before {
    display: none;
}

.kk-sidebar .kk-sb-org {
    border-radius: 14px;
    background: rgba(255, 255, 255, .04);
}

.kk-sidebar .kk-sb-org-mark {
    border-radius: 50%;
    background: #BEFF50;
    color: #14140F;
}

.kk-sidebar .kk-sb-search input {
    border-radius: 10px;
}

/* ── The page: a pale canvas, a little more air ── */

body.kk-app .kk-content,
body.kk-admin .admin-content {
    padding: 1.75rem 1.75rem 2.5rem;
}

:is(.kk-app, .kk-admin) footer,
.kk-foot {
    margin-top: 1rem;
    padding: 1rem 1.75rem;
    background: transparent;
    border-top: 1px solid var(--kk-line) !important;
    font-size: .8rem;
    color: var(--kk-muted);
}

@media (max-width: 991.98px) {
    :is(.kk-app, .kk-admin) :is(.kk-topbar, .admin-topbar) {
        padding: .6rem 1rem;
    }

    body.kk-app .kk-content,
    body.kk-admin .admin-content {
        padding: 1.25rem 1rem 2rem;
    }
}

/* ── Bootstrap cards: the module screens still build panels from .card ──
   Same dress as a panel: white, 16px corners, a hairline, and a header in the panel's own type. */

:is(.kk-app, .kk-admin) .card {
    border: 1px solid var(--kk-line);
    border-radius: var(--kk-radius);
    box-shadow: var(--kk-shadow);
    background: var(--kk-surface);
}

:is(.kk-app, .kk-admin) .card-header,
:is(.kk-app, .kk-admin) .card-footer {
    border-color: var(--kk-line);
    background: var(--kk-surface);
}

:is(.kk-app, .kk-admin) .card-header {
    padding: .95rem 1.25rem;
    border-bottom: 1px solid var(--kk-line);
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: -.01em;
    text-transform: none;
    color: var(--kk-ink);
}

:is(.kk-app, .kk-admin) .card-header:first-child {
    border-radius: calc(var(--kk-radius) - 1px) calc(var(--kk-radius) - 1px) 0 0;
}

:is(.kk-app, .kk-admin) .card-footer {
    background: #FAFBFC;
}

:is(.kk-app, .kk-admin) .card-footer:last-child {
    border-radius: 0 0 calc(var(--kk-radius) - 1px) calc(var(--kk-radius) - 1px);
}

:is(.kk-app, .kk-admin) .card-body {
    padding: 1.15rem 1.25rem;
}

:is(.kk-app, .kk-admin) .shadow-sm {
    box-shadow: var(--kk-shadow) !important;
}

:is(.kk-app, .kk-admin) .shadow,
:is(.kk-app, .kk-admin) .shadow-lg {
    box-shadow: 0 18px 40px -24px rgba(20, 20, 15, .35) !important;
}

:is(.kk-app, .kk-admin) .modal-content {
    border: 0;
    border-radius: 18px;
    box-shadow: 0 40px 80px -30px rgba(20, 20, 15, .5);
}

:is(.kk-app, .kk-admin) .modal-header,
:is(.kk-app, .kk-admin) .modal-footer {
    border-color: var(--kk-line);
}

:is(.kk-app, .kk-admin) .dropdown-menu {
    padding: .4rem;
    border: 1px solid var(--kk-line);
    border-radius: 12px;
    box-shadow: 0 18px 40px -20px rgba(20, 20, 15, .35);
}

:is(.kk-app, .kk-admin) .dropdown-item {
    border-radius: 8px;
    padding: .5rem .75rem;
    font-size: .875rem;
}

:is(.kk-app, .kk-admin) .dropdown-item:hover,
:is(.kk-app, .kk-admin) .dropdown-item:focus {
    background: #F0F0E6;
    color: var(--kk-ink);
}

:is(.kk-app, .kk-admin) .page-link {
    margin: 0 2px;
    border-color: var(--kk-line);
    border-radius: 8px !important;
    color: var(--kk-ink);
}

:is(.kk-app, .kk-admin) .page-item.active .page-link {
    background: var(--kk-ink);
    border-color: var(--kk-ink);
    color: #fff;
}

/* ── The filter row on a narrow screen ───────────────────────────────────
   A page's action row and its filter run off the right edge by a few pixels at 375px: let them wrap
   onto their own lines instead. */

@media (max-width: 575.98px) {

    :is(.kk-app, .kk-admin) .kk-page-head {
        align-items: flex-start;
    }

    :is(.kk-app, .kk-admin) :is(.kk-page-actions, .kk-filter) {
        flex-wrap: wrap;
        width: 100%;
    }

    :is(.kk-app, .kk-admin) :is(.kk-page-actions, .kk-filter)>* {
        max-width: 100%;
    }

    :is(.kk-app, .kk-admin) .kk-filter .select2-container,
    :is(.kk-app, .kk-admin) .kk-filter .form-control,
    :is(.kk-app, .kk-admin) .kk-filter .custom-select {
        max-width: 100%;
        width: 100% !important;
    }
}

/* A label does not wrap inside a button — "Email\nsuppliers" reads as a mistake. */
:is(.kk-app, .kk-admin) :is(.kk-page-actions, .kk-filter) .btn {
    white-space: nowrap;
}

/* Outline buttons are actions, not statuses: in the portal they take the chrome's ink. Status colour stays
   where it carries meaning — badges, alerts, the tone classes that mark a figure good or bad. */
:is(.kk-app, .kk-admin) :is(.btn-outline-success, .btn-outline-primary, .btn-outline-info) {
    color: var(--kk-ink);
    border-color: var(--kk-line-strong);
    background: #fff;
}

:is(.kk-app, .kk-admin) :is(.btn-outline-success, .btn-outline-primary, .btn-outline-info):hover {
    color: var(--kk-ink);
    border-color: var(--kk-ink);
    background: #fff;
}

/* The day's actions (§6.52): a bar of buttons under the page head, so adding a lead, a quotation, an invoice, a
   payment, a booking or a message does not mean hunting for the module that owns it. */
.kk-action-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1.25rem;
    padding: .7rem .85rem;
    border: 1px solid var(--kk-line);
    border-radius: var(--kk-radius);
    background: var(--kk-surface);
}

.kk-action-bar-label {
    margin-right: .35rem;
    font-size: .8125rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    color: var(--kk-ink);
}

.kk-action-bar-label i {
    margin-right: .3rem;
    color: var(--kk-muted);
}

@media (max-width: 575.98px) {
    .kk-action-bar>.kk-btn {
        flex: 1 1 auto;
    }
}

/* ════════════════════════════════════════════════════════════════════════
   12. THE SIGN-IN SCREENS  — moved here from frontend.css, so every screen a signed-out person sees
   belongs to the app they are signing in to. layouts/auth links portal.css (this section) *and*
   frontend.css, because the design tokens and the base primitives (.sf-btn, .sf-card, .sf-alert,
   .sf-field) that these rules build on live in frontend.css section 1.
   ════════════════════════════════════════════════════════════════════════ */

.sf-auth {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--sf-surface);
}


.sf-auth-shell {
    flex: 1 0 auto;
    display: flex;
    min-height: 100vh;
}

/* ── The picture half ─────────────────────────────────────────── */

.sf-auth-visual {
    flex: 1 1 46%;
    max-width: 46%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    padding: 44px 52px;
    color: #fff;
    /* The brand ink, with a faint lime light from the top right. */
    background:
        radial-gradient(circle at 92% 4%, rgba(190, 255, 80, .16) 0, rgba(190, 255, 80, 0) 40%),
        #14140F;
}

/* Four faint rules, as on the site's hero. */
.sf-auth-visual::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(255, 255, 255, .05), rgba(255, 255, 255, .05)) 12% 0 / 1px 100% no-repeat,
        linear-gradient(rgba(255, 255, 255, .035), rgba(255, 255, 255, .035)) 50% 0 / 1px 100% no-repeat,
        linear-gradient(rgba(255, 255, 255, .05), rgba(255, 255, 255, .05)) 88% 0 / 1px 100% no-repeat;
}

.sf-auth-visual > * {
    position: relative;
}

.sf-auth-visual .mk-brand,
.sf-auth-visual .mk-brand:hover {
    font-size: 1.75rem;
    color: #fff;
    text-decoration: none;
}

.sf-auth .mk-brand:hover {
    text-decoration: none;
}

.sf-auth-visual-copy {
    margin: auto 0;
    max-width: 30rem;
}

.sf-auth-visual-title {
    font-family: var(--sf-font-display);
    font-size: clamp(2.1rem, 3.2vw, 2.9rem);
    font-weight: 500;
    line-height: 1.04;
    letter-spacing: -.04em;
    color: #fff;
    margin: 0 0 18px;
}

.sf-auth-visual-lead {
    font-size: 1.0625rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, .74);
    margin: 0 0 28px;
}

.sf-auth-visual-list {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: .9375rem;
    font-weight: 600;
    color: #fff;
}

.sf-auth-visual-list li {
    display: flex;
    align-items: center;
}

.sf-auth-visual-list i {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-right: 12px;
    border-radius: 50%;
    background: var(--sf-accent);
    color: #14140F;
    font-size: .7rem;
}

.sf-auth-visual-foot {
    margin: 0;
    font-size: .8125rem;
    color: rgba(255, 255, 255, .6);
}

/* ── The form half ────────────────────────────────────────────── */

.sf-auth-panel {
    flex: 1 1 54%;
    max-width: 54%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 48px 32px;
    background: var(--sf-surface);
}

.sf-auth-panel-inner {
    width: 100%;
    max-width: 580px;
}

/* The panel is the card now: the chrome that made sense on a grey page would only draw a box inside a
   box. */

.sf-auth-panel .sf-card {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    padding: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}

.sf-auth-panel .sf-auth-card-wide {
    max-width: 580px;
}

/* On a phone the picture is gone, so the brand comes back here. */

.sf-auth-panel-brand {
    display: none;
    margin-bottom: 26px;
}

.sf-auth-panel-brand {
    font-size: 1.75rem;
}

.sf-auth-foot {
    flex: none;
    width: 100%;
    padding: 34px 20px 6px;
    text-align: center;
    font-size: .8125rem;
    color: var(--sf-muted);
}

@media (max-width: 991.98px) {
    .sf-auth-visual {
        display: none;
    }

    .sf-auth-panel {
        flex: 1 1 100%;
        max-width: 100%;
        padding: 40px 22px 24px;
    }

    .sf-auth-panel-brand {
        display: block;
    }
}

body.sf .sf-auth-foot a {
    color: var(--sf-muted-2);
    text-decoration: none;
}

body.sf .sf-auth-foot a:hover {
    color: var(--sf-ink);
}

/* Header block shared by every auth screen. */

.sf-auth-title {
    font-size: 2.25rem;
    font-weight: 500;
    line-height: 1.08;
    letter-spacing: -.04em;
    color: var(--sf-ink);
    margin: 0 0 8px;
}

.sf-auth-sub {
    font-size: .9375rem;
    color: var(--sf-muted-2);
    margin: 0 0 26px;
}

.sf-auth-head {
    text-align: left;
    margin-bottom: 24px;
}

.sf-auth-head .sf-auth-sub {
    margin-bottom: 0;
}

.sf-auth-alt {
    text-align: center;
    margin: 22px 0 0;
    font-size: .875rem;
    color: var(--sf-muted-2);
}

.sf-btn+.sf-auth-alt a {
    font-weight: 400;
}

/* Selectable role cards on the registration screen */

.sf-role {
    display: block;
    position: relative;
    margin-bottom: 10px;
    cursor: pointer;
}

.sf-role input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.sf-role-body {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 13px 15px;
    border: 1px solid var(--sf-line-2);
    border-radius: var(--sf-radius-sm);
    background: #fff;
    font-size: .9375rem;
    color: var(--sf-ink-soft);
    transition: border-color .12s ease, background .12s ease, box-shadow .12s ease;
}

.sf-role-body i {
    color: var(--sf-muted);
    width: 18px;
    text-align: center;
}

.sf-role:hover .sf-role-body {
    border-color: var(--sf-ink);
}

.sf-role input:checked+.sf-role-body {
    border-color: var(--sf-ink);
    background: var(--sf-sky-soft);
    color: var(--sf-ink);
    box-shadow: var(--sf-ring);
}

.sf-role input:checked+.sf-role-body i {
    color: var(--sf-ink);
}

.sf-role input:focus-visible+.sf-role-body {
    box-shadow: var(--sf-ring);
}

/* 6-digit OTP entry */

.sf-otp-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 14px;
}

.sf-otp-box {
    width: 46px;
    height: 56px;
    padding: 0;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--sf-ink);
    border: 1px solid var(--sf-line-2);
    border-radius: var(--sf-radius-sm);
    background: #fff;
}

.sf-otp-box:focus {
    border-color: var(--sf-ink);
    box-shadow: var(--sf-ring);
}

.sf-otp-box:disabled {
    background: #F3F4F6;
    color: var(--sf-muted);
}

@media (max-width: 400px) {
    .sf-otp-box {
        width: 40px;
        height: 50px;
        font-size: 1.25rem;
    }
}

/* ── The pieces the views used to set inline ─────────────────────
   Each of these replaces a `style="…"` attribute that was repeated
   on every auth screen. The markup now says what a thing *is*. */

/* A field with an icon in it: the icon is absolutely placed, so the
   input has to make room for it. */

.sf-field {
    position: relative;
}

.sf-field .sf-input-icon~.form-control {
    padding-left: 40px;
}

/* …and room on the right when something else sits inside it. */

.sf-field .sf-input--pw {
    padding-right: 40px;
}

/* Show/hide a password, from inside the field. */

.sf-pw-toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    padding: 0;
    border: 0;
    background: transparent;
    line-height: 1;
}

.sf-pw-toggle i {
    font-size: .85rem;
    color: var(--sf-muted);
}

.sf-pw-toggle:hover i {
    color: var(--sf-ink);
}

/* Alerts raised by the screen itself, rather than only by validation. */

.sf-alert--status {
    background: var(--sf-sky-soft);
    border-color: #DEDED3;
    color: var(--sf-ink);
}

.sf-alert--error {
    background: #FEF2F2;
    border-color: #F8CFCF;
    color: #8A1C1C;
}

.sf-alert--error i {
    color: #B42318;
}

/* A link that has to read as a link inside a sentence. */

.sf-auth-link {
    color: var(--sf-ink);
    font-weight: 600;
    text-decoration: none;
}

.sf-auth-link:hover {
    color: var(--sf-accent-text);
    text-decoration: underline;
}

.sf-auth-link--quiet {
    color: var(--sf-ink);
    font-weight: 600;
    font-size: .875rem;
}

.sf-auth-link--quiet:hover {
    color: var(--sf-ink);
}

/* A quiet line of explanation under a field. */

.sf-hint {
    display: block;
    margin-top: 6px;
    font-size: .8125rem;
    color: var(--sf-muted);
}

/* The label beside a checkbox. */

.sf-check {
    font-size: .875rem;
    color: var(--sf-muted-2);
}

.sf-check--sm {
    font-size: .8125rem;
}

/* The icon tile above an auth heading. */

.sf-auth-tile {
    width: 52px;
    height: 52px;
    font-size: 1.2rem;
}

/* A rule with something centred under it, as the OTP screen's resend block is. */

.sf-auth-divider {
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid var(--sf-line);
    text-align: center;
}

.sf-auth-divider p {
    margin-bottom: 6px;
    font-size: .8125rem;
}

.sf-auth-resend {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--sf-ink);
    font-size: .875rem;
    font-weight: 600;
}

.sf-auth-resend:hover {
    color: var(--sf-accent-text);
    text-decoration: underline;
}

/* ── The screens themselves: one typeface, one primary button ───────────────────────────────────────────────

   Plus Jakarta Sans, as on the site and in the portal (loaded by layouts.partials.sf-tokens), and the site's gold
   button for the one thing to do. Labels read the way they do in the portal: sentence case, semibold. */

body.sf-auth {
    color: var(--sf-ink);
}

body.sf-auth .sf-btn-primary {
    min-height: 52px;
}
