/*
 * BLLEY PORTAL / APPLICATION FOUNDATION
 * =====================================
 *
 * The design layer for Blley's signed-in application surfaces: authentication,
 * the Blley Account screens and the publisher portal. The admin console shares
 * the same primitives and can adopt this sheet later without a second system.
 *
 * ## Why this sheet exists
 *
 * 'blley-marketplace.css' is a locked package built for a public,
 * editorial, image-led product. It carries a rich form vocabulary (inputs,
 * labels, buttons) but almost no table system, because the marketplace has
 * almost no tables. The publisher portal is the opposite shape: dense,
 * table-first, task-oriented, read by the same operator many times a day.
 *
 * So this is a sibling of the locked package, not a fork of it. It reuses the
 * identity — the cobalt action colour, the navy, the graphite text, the two
 * typefaces — and adds the application vocabulary the marketplace never needed.
 *
 * ## Rules this sheet holds itself to
 *
 * 1. No locked byte is edited. Nothing here overrides 'blley-marketplace.css';
 *    the two are never loaded on the same page.
 * 2. Logical properties throughout ('margin-inline', 'padding-block',
 *    'inset-inline-start', 'border-start-*'). The sheet mirrors under
 *    'dir="rtl"' with no per-page structural hacks and no separate RTL sheet
 *    of its own.
 * 3. Light only. Blley's locked product language is light, so no
 *    'color-scheme: light dark' and no 'prefers-color-scheme' block. This is a
 *    deliberate decision, not an oversight — see the ruling in PR-1.
 * 4. Mobile-first. Base rules target the narrow viewport; 'min-width' queries
 *    add the desktop composition.
 * 5. No build step. Plain CSS, loaded with 'asset()', matching every other
 *    real Blley surface.
 * 6. Status is never colour alone. Every badge carries a text label, and the
 *    dot is decoration on top of the word, not a replacement for it.
 *
 * ## Class prefix
 *
 * Components are prefixed 'b-' so that nothing here can collide with a locked
 * marketplace class name if the two ever meet in a shared partial.
 *
 * Contents
 *   1  Tokens
 *   2  Reset and base
 *   3  App shell (header, container, page header, breadcrumbs, sections)
 *   4  Auth shell
 *   5  Navigation
 *   6  Forms
 *   7  Buttons
 *   8  Cards and panels
 *   9  Tables
 *  10  Badges and status
 *  11  Feedback and empty states
 *  12  Utilities
 */

/* ==========================================================================
   1  TOKENS
   ========================================================================== */

.b-app,
.b-auth {
    /* Identity ---------------------------------------------------------- */
    --b-cobalt: #1447e6;          /* the single action colour */
    --b-cobalt-700: #1039bc;      /* hover / pressed */
    --b-cobalt-050: #eef3fe;      /* tint for selected rows and quiet fills */
    --b-cobalt-100: #d8e3fc;

    --b-navy-900: #071a45;        /* header, headings */
    --b-navy-700: #0b2a6b;
    --b-ink: #0a1a33;             /* body text */
    --b-ink-muted: #55637a;       /* secondary text, help text */
    --b-ink-faint: #7d8798;       /* placeholders, disabled labels */

    --b-amber: #b45309;           /* restrained: pending / warning only */
    --b-amber-050: #fef6ec;

    --b-green: #0f7a4d;           /* active / success */
    --b-green-050: #eaf7f0;

    --b-red: #b00020;             /* destructive / error — matches plain shell */
    --b-red-050: #fdeef0;

    /* Surfaces ---------------------------------------------------------- */
    --b-canvas: #f6f8fc;          /* page background */
    --b-surface: #ffffff;         /* panels, table body */
    --b-surface-sunk: #f9fafd;    /* table head, quiet rows */
    --b-line: #dfe4ee;            /* standard border */
    --b-line-soft: #edf0f6;       /* internal dividers */

    /* Type -------------------------------------------------------------- */
    --b-font-ui: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --b-font-body: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;

    /* Space — a 4px scale; application density, tighter than marketplace */
    --b-s1: 4px;
    --b-s2: 8px;
    --b-s3: 12px;
    --b-s4: 16px;
    --b-s5: 20px;
    --b-s6: 24px;
    --b-s7: 32px;
    --b-s8: 40px;
    --b-s9: 56px;

    /* Radii, elevation, chrome ------------------------------------------ */
    --b-r-sm: 4px;
    --b-r-md: 8px;
    --b-r-lg: 12px;
    --b-r-pill: 999px;

    --b-shadow-sm: 0 1px 2px rgba(7, 26, 69, .06);
    --b-shadow-md: 0 2px 8px rgba(7, 26, 69, .08);

    --b-header-h: 56px;
    --b-sidebar-w: 232px;
    --b-shell: 1280px;            /* max content width, owned here, never inline */

    --b-focus: 0 0 0 3px rgba(20, 71, 230, .35);
}

/* ==========================================================================
   2  RESET AND BASE
   ========================================================================== */

.b-app *,
.b-auth *,
.b-app *::before,
.b-auth *::before,
.b-app *::after,
.b-auth *::after {
    box-sizing: border-box;
}

.b-app,
.b-auth {
    margin: 0;
    background: var(--b-canvas);
    color: var(--b-ink);
    font-family: var(--b-font-body);
    font-size: 14px;
    line-height: 1.55;
    -webkit-text-size-adjust: 100%;
}

.b-app h1, .b-app h2, .b-app h3, .b-app h4,
.b-auth h1, .b-auth h2, .b-auth h3, .b-auth h4 {
    margin: 0;
    font-family: var(--b-font-ui);
    color: var(--b-navy-900);
    font-weight: 600;
    line-height: 1.3;
}

.b-app a,
.b-auth a {
    color: var(--b-cobalt);
    text-decoration: none;
}

.b-app a:hover,
.b-auth a:hover {
    text-decoration: underline;
}

/*
 * One focus treatment for the whole application. ':focus-visible' so a mouse
 * click does not leave a ring behind, but every keyboard traversal does.
 */
.b-app :focus-visible,
.b-auth :focus-visible {
    outline: 2px solid var(--b-cobalt);
    outline-offset: 2px;
    border-radius: var(--b-r-sm);
}

/*
 * The skip link is offset with a transform rather than 'left: -9999px'. The
 * negative-offset technique is what forced the marketplace RTL correction
 * sheet to exist (BLLEY-022 P22A): under 'dir="rtl"' it extends the scrollable
 * width and hands every Arabic page a horizontal scrollbar. A transform moves
 * the paint without touching layout, so it is direction-agnostic.
 */
.b-skip {
    position: absolute;
    z-index: 100;
    inset-block-start: var(--b-s2);
    inset-inline-start: var(--b-s2);
    padding: var(--b-s2) var(--b-s4);
    background: var(--b-surface);
    border: 1px solid var(--b-cobalt);
    border-radius: var(--b-r-md);
    font-weight: 600;
    transform: translateY(-200%);
}

.b-skip:focus {
    transform: translateY(0);
}

/* ==========================================================================
   3  APP SHELL
   ========================================================================== */

.b-header {
    position: sticky;
    inset-block-start: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: var(--b-s4);
    min-height: var(--b-header-h);
    padding-inline: var(--b-s4);
    background: var(--b-navy-900);
    color: #fff;
}

.b-header a {
    color: #fff;
}

.b-header__brand {
    display: inline-flex;
    align-items: center;
    gap: var(--b-s2);
    font-family: var(--b-font-ui);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: -.01em;
}

.b-header__brand:hover {
    text-decoration: none;
}

/* Names the surface next to the wordmark: "Blley · Property". */
.b-header__context {
    font-family: var(--b-font-ui);
    font-weight: 500;
    font-size: 13px;
    color: rgba(255, 255, 255, .72);
    padding-inline-start: var(--b-s3);
    border-inline-start: 1px solid rgba(255, 255, 255, .22);
}

.b-header__spacer {
    flex: 1 1 auto;
}

.b-header__account {
    display: inline-flex;
    align-items: center;
    gap: var(--b-s2);
    font-size: 13px;
    color: rgba(255, 255, 255, .88);
}

.b-shell {
    display: block;
    max-width: var(--b-shell);
    margin-inline: auto;
    padding-inline: var(--b-s4);
    padding-block: var(--b-s5) var(--b-s9);
}

/* The two-column composition only exists once there is room for it. */
@media (min-width: 900px) {
    .b-shell--nav {
        display: grid;
        grid-template-columns: var(--b-sidebar-w) minmax(0, 1fr);
        gap: var(--b-s7);
        align-items: start;
    }
}

.b-page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--b-s3);
    margin-block-end: var(--b-s5);
}

.b-page-head__text {
    flex: 1 1 260px;
    min-width: 0;
}

.b-page-head h1 {
    font-size: 22px;
    letter-spacing: -.01em;
}

.b-page-head__sub {
    margin: var(--b-s1) 0 0;
    color: var(--b-ink-muted);
    font-size: 13px;
}

.b-page-head__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--b-s2);
}

.b-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--b-s2);
    margin-block-end: var(--b-s3);
    padding: 0;
    list-style: none;
    font-size: 12px;
    color: var(--b-ink-muted);
}

.b-crumbs li {
    display: inline-flex;
    align-items: center;
    gap: var(--b-s2);
}

/*
 * The separator is a logical-aware glyph: it flips with direction because it
 * is content of a pseudo-element inside an already-mirrored flex row.
 */
.b-crumbs li + li::before {
    content: '/';
    color: var(--b-ink-faint);
}

.b-crumbs [aria-current='page'] {
    color: var(--b-ink);
    font-weight: 500;
}

.b-section {
    margin-block-end: var(--b-s7);
}

.b-section__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--b-s2);
    margin-block-end: var(--b-s3);
}

.b-section__head h2 {
    font-size: 15px;
    font-weight: 600;
}

.b-section__note {
    color: var(--b-ink-muted);
    font-size: 12px;
}

/* ==========================================================================
   4  AUTH SHELL
   ========================================================================== */

.b-auth {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

.b-auth__main {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--b-s6) var(--b-s4);
}

.b-auth__inner {
    width: 100%;
    max-width: 400px;
}

.b-auth__brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--b-s2);
    margin-block-end: var(--b-s5);
    font-family: var(--b-font-ui);
    font-weight: 700;
    font-size: 20px;
    color: var(--b-navy-900);
}

.b-auth__brand:hover {
    text-decoration: none;
}

.b-auth__card {
    padding: var(--b-s6);
    background: var(--b-surface);
    border: 1px solid var(--b-line);
    border-radius: var(--b-r-lg);
    box-shadow: var(--b-shadow-md);
}

.b-auth__title {
    font-size: 18px;
    margin-block-end: var(--b-s2);
}

.b-auth__lede {
    margin: 0 0 var(--b-s5);
    color: var(--b-ink-muted);
    font-size: 13px;
}

/* Sits under the card: "Already have an account? Sign in". */
.b-auth__alt {
    margin-block-start: var(--b-s5);
    text-align: center;
    font-size: 13px;
    color: var(--b-ink-muted);
}

.b-foot {
    padding: var(--b-s5) var(--b-s4);
    text-align: center;
    font-size: 12px;
    color: var(--b-ink-muted);
}

.b-foot__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--b-s4);
    margin-block-end: var(--b-s2);
}

/* ==========================================================================
   5  NAVIGATION
   ========================================================================== */

.b-nav {
    margin-block-end: var(--b-s5);
}

.b-nav__label {
    margin: 0 0 var(--b-s2);
    padding-inline: var(--b-s3);
    font-family: var(--b-font-ui);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--b-ink-faint);
}

.b-nav__list {
    margin: 0 0 var(--b-s5);
    padding: 0;
    list-style: none;
}

.b-nav__link {
    display: flex;
    align-items: center;
    gap: var(--b-s2);
    padding: var(--b-s2) var(--b-s3);
    border-radius: var(--b-r-md);
    color: var(--b-ink);
    font-size: 13px;
    font-weight: 500;
    /*
     * The active marker is an inline-start border so it lands on the left in
     * English and the right in Arabic without a second rule.
     */
    border-inline-start: 3px solid transparent;
}

.b-nav__link:hover {
    background: var(--b-cobalt-050);
    text-decoration: none;
}

.b-nav__link[aria-current='page'] {
    background: var(--b-cobalt-050);
    border-inline-start-color: var(--b-cobalt);
    color: var(--b-cobalt-700);
    font-weight: 600;
}

/*
 * Below the two-column breakpoint the sidebar becomes a horizontally
 * scrollable strip. Mobile navigation that wraps to four lines pushes the
 * actual page content off the first screen, which is worse than a scroller
 * the user can flick.
 */
@media (max-width: 899px) {
    .b-nav__list {
        display: flex;
        gap: var(--b-s1);
        overflow-x: auto;
        scrollbar-width: thin;
        padding-block-end: var(--b-s2);
    }

    .b-nav__label {
        display: none;
    }

    .b-nav__link {
        flex: 0 0 auto;
        border-inline-start: 0;
        border-block-end: 3px solid transparent;
        border-radius: var(--b-r-sm);
    }

    .b-nav__link[aria-current='page'] {
        border-block-end-color: var(--b-cobalt);
    }
}

/* ==========================================================================
   6  FORMS
   ========================================================================== */

.b-field {
    margin-block-end: var(--b-s4);
}

.b-label {
    display: block;
    margin-block-end: var(--b-s1);
    font-family: var(--b-font-ui);
    font-size: 13px;
    font-weight: 600;
    color: var(--b-navy-900);
}

.b-label__optional {
    margin-inline-start: var(--b-s1);
    font-weight: 400;
    color: var(--b-ink-faint);
}

.b-input,
.b-select,
.b-textarea {
    display: block;
    width: 100%;
    /*
     * 16px on the control itself: any smaller and iOS Safari zooms the whole
     * page when the field takes focus. The label carries the smaller size.
     */
    font-family: inherit;
    font-size: 16px;
    line-height: 1.4;
    color: var(--b-ink);
    background: var(--b-surface);
    border: 1px solid var(--b-line);
    border-radius: var(--b-r-md);
    padding: 9px var(--b-s3);
    transition: border-color .12s, box-shadow .12s;
}

@media (min-width: 700px) {
    .b-input,
    .b-select,
    .b-textarea {
        font-size: 14px;
        padding: 7px var(--b-s3);
    }
}

.b-textarea {
    min-height: 96px;
    resize: vertical;
}

.b-select {
    /* Room for the native chevron on whichever side the direction puts it. */
    padding-inline-end: var(--b-s7);
}

.b-input:focus,
.b-select:focus,
.b-textarea:focus {
    outline: none;
    border-color: var(--b-cobalt);
    box-shadow: var(--b-focus);
}

.b-input::placeholder,
.b-textarea::placeholder {
    color: var(--b-ink-faint);
}

.b-input:disabled,
.b-select:disabled,
.b-textarea:disabled,
.b-input[readonly],
.b-textarea[readonly] {
    background: var(--b-surface-sunk);
    color: var(--b-ink-muted);
    cursor: not-allowed;
}

/* Invalid state is border + message, never border colour alone. */
.b-input[aria-invalid='true'],
.b-select[aria-invalid='true'],
.b-textarea[aria-invalid='true'] {
    border-color: var(--b-red);
}

.b-input[aria-invalid='true']:focus,
.b-select[aria-invalid='true']:focus,
.b-textarea[aria-invalid='true']:focus {
    box-shadow: 0 0 0 3px rgba(176, 0, 32, .25);
}

.b-help {
    margin-block-start: var(--b-s1);
    font-size: 12px;
    color: var(--b-ink-muted);
}

.b-error {
    display: flex;
    align-items: flex-start;
    gap: var(--b-s1);
    margin-block-start: var(--b-s1);
    font-size: 12px;
    font-weight: 500;
    color: var(--b-red);
}

/* Checkboxes and radios ---------------------------------------------------- */

.b-check {
    display: flex;
    align-items: flex-start;
    gap: var(--b-s2);
    margin-block-end: var(--b-s2);
    font-size: 13px;
    line-height: 1.5;
}

.b-check input[type='checkbox'],
.b-check input[type='radio'] {
    /* 18px keeps the hit target usable on a touch screen. */
    inline-size: 18px;
    block-size: 18px;
    margin: 1px 0 0;
    flex: 0 0 auto;
    accent-color: var(--b-cobalt);
}

.b-check__text {
    min-width: 0;
}

.b-check--disabled,
.b-check input:disabled + .b-check__text {
    color: var(--b-ink-faint);
}

.b-fieldset {
    margin: 0 0 var(--b-s5);
    padding: 0;
    border: 0;
}

.b-fieldset > legend {
    padding: 0;
    margin-block-end: var(--b-s2);
    font-family: var(--b-font-ui);
    font-size: 13px;
    font-weight: 600;
    color: var(--b-navy-900);
}

/* Two fields side by side once there is room — price min/max, first/last. */
.b-field-row {
    display: grid;
    gap: var(--b-s4);
}

@media (min-width: 640px) {
    .b-field-row {
        grid-template-columns: 1fr 1fr;
    }
}

.b-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--b-s2);
    margin-block-start: var(--b-s5);
    padding-block-start: var(--b-s4);
    border-block-start: 1px solid var(--b-line-soft);
}

.b-actions--tight {
    margin-block-start: var(--b-s4);
    padding-block-start: 0;
    border-block-start: 0;
}

.b-actions__spacer {
    flex: 1 1 auto;
}

/* ==========================================================================
   7  BUTTONS
   ========================================================================== */

.b-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--b-s2);
    /* 40px tall: comfortably above the 24px minimum touch target. */
    min-height: 40px;
    padding: 0 var(--b-s5);
    border: 1px solid transparent;
    border-radius: var(--b-r-md);
    font-family: var(--b-font-ui);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .12s, border-color .12s, color .12s;
}

.b-btn:hover {
    text-decoration: none;
}

.b-btn:focus-visible {
    outline: 2px solid var(--b-cobalt);
    outline-offset: 2px;
}

.b-btn--primary {
    background: var(--b-cobalt);
    border-color: var(--b-cobalt);
    color: #fff;
}

.b-btn--primary:hover {
    background: var(--b-cobalt-700);
    border-color: var(--b-cobalt-700);
    color: #fff;
}

.b-btn--secondary {
    background: var(--b-surface);
    border-color: var(--b-line);
    color: var(--b-navy-900);
}

.b-btn--secondary:hover {
    border-color: var(--b-cobalt);
    color: var(--b-cobalt-700);
}

.b-btn--quiet {
    background: transparent;
    border-color: transparent;
    color: var(--b-cobalt);
    padding-inline: var(--b-s3);
}

.b-btn--quiet:hover {
    background: var(--b-cobalt-050);
}

.b-btn--danger {
    background: var(--b-surface);
    border-color: var(--b-red);
    color: var(--b-red);
}

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

/*
 * Disabled is expressed on the element, not by a look-alike class, so the
 * control is genuinely inert for pointer, keyboard and assistive technology.
 * 'aria-disabled' covers anchors, which cannot carry 'disabled'.
 */
.b-btn:disabled,
.b-btn[aria-disabled='true'] {
    background: var(--b-surface-sunk);
    border-color: var(--b-line);
    color: var(--b-ink-faint);
    cursor: not-allowed;
    pointer-events: none;
}

.b-btn--block {
    width: 100%;
}

/* Table row actions and other inline controls. */
.b-btn--sm {
    min-height: 30px;
    padding: 0 var(--b-s3);
    font-size: 13px;
    border-radius: var(--b-r-sm);
}

/* ==========================================================================
   8  CARDS AND PANELS
   ========================================================================== */

.b-panel {
    background: var(--b-surface);
    border: 1px solid var(--b-line);
    border-radius: var(--b-r-lg);
    box-shadow: var(--b-shadow-sm);
    margin-block-end: var(--b-s5);
}

.b-panel__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--b-s2);
    padding: var(--b-s4) var(--b-s5);
    border-block-end: 1px solid var(--b-line-soft);
}

.b-panel__head h2,
.b-panel__head h3 {
    font-size: 14px;
    font-weight: 600;
}

.b-panel__body {
    padding: var(--b-s5);
}

.b-panel__body--flush {
    padding: 0;
}

.b-panel__foot {
    padding: var(--b-s3) var(--b-s5);
    background: var(--b-surface-sunk);
    border-block-start: 1px solid var(--b-line-soft);
    border-end-start-radius: var(--b-r-lg);
    border-end-end-radius: var(--b-r-lg);
    font-size: 12px;
    color: var(--b-ink-muted);
}

.b-panel--compact .b-panel__head {
    padding: var(--b-s3) var(--b-s4);
}

.b-panel--compact .b-panel__body {
    padding: var(--b-s4);
}

/* Stat / summary treatment ------------------------------------------------- */

.b-stats {
    display: grid;
    gap: var(--b-s4);
    margin-block-end: var(--b-s5);
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.b-stat {
    padding: var(--b-s4);
    background: var(--b-surface);
    border: 1px solid var(--b-line);
    border-radius: var(--b-r-md);
}

.b-stat__label {
    font-size: 12px;
    color: var(--b-ink-muted);
}

.b-stat__value {
    margin-block-start: var(--b-s1);
    font-family: var(--b-font-ui);
    font-size: 24px;
    font-weight: 700;
    color: var(--b-navy-900);
    /* Tabular figures so a column of counts lines up. */
    font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   9  TABLES
   ========================================================================== */

/*
 * The application table system the marketplace sheet does not provide.
 *
 * ## The scroll rule
 *
 * The previous plain shell set 'display: block; overflow-x: auto' on every
 * '<table>' unconditionally. The reasoning was sound for a 390px screen — a
 * workspace table has more columns than fit, and a page that scrolls sideways
 * as a whole is worse than a table that scrolls inside its own box. But
 * applying it at every width gives a desktop table its own scrollbar for no
 * reason, and 'display: block' discards the table's own column sizing.
 *
 * So the scroller lives on a wrapper and is bounded by a media query: it
 * engages on narrow viewports and gets out of the way on wide ones, and the
 * table keeps 'display: table' at every size.
 */

.b-table-wrap {
    /* No scroller at desktop width. */
    overflow-x: visible;
}

@media (max-width: 899px) {
    .b-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        /* Tells the browser this box is the scroll container, not the page. */
        overscroll-behavior-x: contain;
    }

    .b-table {
        /* Below this the columns collapse into unreadable slivers. */
        min-width: 640px;
    }
}

.b-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.b-table th,
.b-table td {
    padding: var(--b-s3) var(--b-s4);
    /* Logical: the column rag follows the reading direction. */
    text-align: start;
    vertical-align: top;
    border-block-end: 1px solid var(--b-line-soft);
}

.b-table thead th {
    position: sticky;
    inset-block-start: 0;
    background: var(--b-surface-sunk);
    border-block-end: 1px solid var(--b-line);
    font-family: var(--b-font-ui);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--b-ink-muted);
    white-space: nowrap;
}

.b-table tbody tr:hover {
    background: var(--b-cobalt-050);
}

.b-table tbody tr:last-child td {
    border-block-end: 0;
}

.b-table--compact th,
.b-table--compact td {
    padding: var(--b-s2) var(--b-s3);
}

/* Numeric columns: end-aligned and tabular so digits stack. */
.b-table .b-num {
    text-align: end;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* The action column sits at the trailing edge and never wraps. */
.b-table .b-actions-cell {
    text-align: end;
    white-space: nowrap;
    width: 1%;
}

/* A reference or code cell — public references, slugs, IDs. */
.b-table .b-mono {
    font-family: ui-monospace, 'SFMono-Regular', 'Cascadia Mono', Menlo, Consolas, monospace;
    font-size: 12px;
    color: var(--b-ink-muted);
    white-space: nowrap;
}

.b-table caption {
    caption-side: bottom;
    padding-block-start: var(--b-s3);
    font-size: 12px;
    color: var(--b-ink-muted);
    text-align: start;
}

/* ==========================================================================
   10  BADGES AND STATUS
   ========================================================================== */

/*
 * Semantic classes, not per-page inline colour. The word is the status; the
 * dot is redundant decoration, so nothing is communicated by colour alone.
 */

.b-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--b-s1);
    padding: 2px var(--b-s2);
    border: 1px solid transparent;
    border-radius: var(--b-r-pill);
    font-family: var(--b-font-ui);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}

.b-badge::before {
    content: '';
    inline-size: 6px;
    block-size: 6px;
    border-radius: 50%;
    background: currentColor;
    flex: 0 0 auto;
}

.b-badge--active,
.b-badge--approved,
.b-badge--published {
    background: var(--b-green-050);
    border-color: rgba(15, 122, 77, .25);
    color: var(--b-green);
}

.b-badge--pending {
    background: var(--b-amber-050);
    border-color: rgba(180, 83, 9, .25);
    color: var(--b-amber);
}

.b-badge--rejected {
    background: var(--b-red-050);
    border-color: rgba(176, 0, 32, .25);
    color: var(--b-red);
}

.b-badge--draft,
.b-badge--inactive {
    background: var(--b-surface-sunk);
    border-color: var(--b-line);
    color: var(--b-ink-muted);
}

.b-badge--info {
    background: var(--b-cobalt-050);
    border-color: var(--b-cobalt-100);
    color: var(--b-cobalt-700);
}

/* ==========================================================================
   11  FEEDBACK AND EMPTY STATES
   ========================================================================== */

.b-note {
    display: flex;
    gap: var(--b-s3);
    padding: var(--b-s3) var(--b-s4);
    margin-block-end: var(--b-s4);
    border: 1px solid var(--b-line);
    /* Leading accent edge — mirrors with direction. */
    border-inline-start-width: 3px;
    border-radius: var(--b-r-md);
    background: var(--b-surface);
    font-size: 13px;
}

.b-note__title {
    display: block;
    font-family: var(--b-font-ui);
    font-weight: 600;
    margin-block-end: 2px;
}

.b-note__body {
    min-width: 0;
}

.b-note__body :last-child {
    margin-block-end: 0;
}

.b-note--success {
    background: var(--b-green-050);
    border-color: rgba(15, 122, 77, .3);
    border-inline-start-color: var(--b-green);
    color: #0b3d28;
}

.b-note--warning {
    background: var(--b-amber-050);
    border-color: rgba(180, 83, 9, .3);
    border-inline-start-color: var(--b-amber);
    color: #6b3208;
}

.b-note--error {
    background: var(--b-red-050);
    border-color: rgba(176, 0, 32, .3);
    border-inline-start-color: var(--b-red);
    color: #6d0014;
}

.b-note--info {
    background: var(--b-cobalt-050);
    border-color: var(--b-cobalt-100);
    border-inline-start-color: var(--b-cobalt);
    color: var(--b-navy-700);
}

/* The validation summary at the top of a form. */
.b-note ul {
    margin: 0;
    padding-inline-start: var(--b-s5);
}

.b-empty {
    padding: var(--b-s8) var(--b-s5);
    text-align: center;
    color: var(--b-ink-muted);
}

.b-empty__title {
    font-family: var(--b-font-ui);
    font-size: 15px;
    font-weight: 600;
    color: var(--b-navy-900);
    margin-block-end: var(--b-s1);
}

.b-empty__body {
    margin: 0 auto;
    max-width: 46ch;
    font-size: 13px;
}

.b-empty__actions {
    margin-block-start: var(--b-s5);
}

/* ==========================================================================
   12  UTILITIES
   ========================================================================== */

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

.b-nowrap {
    white-space: nowrap;
}

.b-stack > * + * {
    margin-block-start: var(--b-s4);
}

/* Available to assistive technology, absent from the visual composition. */
.b-sr-only {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/*
 * Respect a reduced-motion preference. The transitions here are small, but
 * they are still motion somebody asked not to see.
 */
@media (prefers-reduced-motion: reduce) {
    .b-app *,
    .b-auth * {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}
