﻿/* ---------------------------------------------------------------------------
   IBM Plex Sans + IBM Plex Sans Arabic, self-hosted (SIL Open Font License 1.1,
   see wwwroot/fonts/OFL.txt). The app runs on a laptop that may be offline, so
   nothing here may point at a CDN.
   --------------------------------------------------------------------------- */

@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/ibm-plex-sans-latin-ext-400-normal.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('fonts/ibm-plex-sans-latin-500-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('fonts/ibm-plex-sans-latin-ext-500-normal.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('fonts/ibm-plex-sans-latin-ext-600-normal.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('fonts/ibm-plex-sans-latin-700-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('fonts/ibm-plex-sans-latin-ext-700-normal.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'IBM Plex Sans Arabic';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFF;
}

@font-face {
    font-family: 'IBM Plex Sans Arabic';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/ibm-plex-sans-arabic-latin-400-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'IBM Plex Sans Arabic';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFF;
}

@font-face {
    font-family: 'IBM Plex Sans Arabic';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('fonts/ibm-plex-sans-arabic-latin-500-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'IBM Plex Sans Arabic';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFF;
}

@font-face {
    font-family: 'IBM Plex Sans Arabic';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('fonts/ibm-plex-sans-arabic-latin-600-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------------------------------------------------------------------------
   Design tokens, taken from the mockups in design/ (see docs/design-system.md).
   --------------------------------------------------------------------------- */

:root {
    /* Typography */
    --sb-font: 'IBM Plex Sans', 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --sb-font-ar: 'IBM Plex Sans Arabic', 'IBM Plex Sans', system-ui, sans-serif;

    /* Sidebar navy */
    --sb-navy: #0F1E3D;
    --sb-navy-active: #1E3462;
    --sb-navy-border: #22355E;
    --sb-navy-avatar: #2A4478;
    --sb-navy-outline: #3A5285;
    --sb-nav-text: #C5CEE0;
    --sb-nav-muted: #A9B4CC;
    --sb-nav-section: #8A97B4;

    /* Accent + primary action */
    --sb-accent: #5CC3F0;
    --sb-primary: #1E4D8C;
    --sb-primary-hover: #163A6B;
    --sb-primary-soft: #EEF3FA;
    --sb-primary-soft-border: #E6ECF5;

    /* Surfaces */
    --sb-page-bg: #F4F6FA;
    --sb-surface: #FFFFFF;
    --sb-surface-muted: #F8FAFC;
    --sb-surface-sunken: #F9FAFB;

    /* Text */
    --sb-text: #101828;
    --sb-text-strong: #1D2939;
    --sb-text-body: #344054;
    --sb-muted: #475467;
    --sb-muted-light: #667085;
    --sb-placeholder: #98A2B3;

    /* Borders */
    --sb-border: #E4E8EF;
    --sb-border-light: #EAECF0;
    --sb-border-input: #D0D5DD;
    --sb-border-subtle: #F2F4F7;

    /* Status */
    --sb-danger: #B42318;
    --sb-danger-strong: #912018;
    --sb-danger-border: #F4C7C3;
    --sb-danger-bg: #FEF3F2;
    --sb-success: #067647;
    --sb-success-bg: #ECFDF3;
    --sb-warning: #B54708;
    --sb-warning-bg: #FFFAEB;
    --sb-info: #0A6F96;
    --sb-info-bg: #E3F2F9;

    /* Radii */
    --sb-radius-sm: 6px;
    --sb-radius: 8px;
    --sb-radius-lg: 12px;
    --sb-radius-xl: 14px;
    --sb-radius-pill: 999px;

    /* Shadows */
    --sb-shadow-card: 0 1px 2px rgba(16, 24, 40, 0.06), 0 8px 24px rgba(16, 24, 40, 0.06);
    --sb-shadow-pop: 0 1px 2px rgba(16, 24, 40, 0.06), 0 12px 32px rgba(16, 24, 40, 0.07);
    --sb-shadow-bar: 0 -6px 20px rgba(15, 30, 61, 0.08);
    --sb-focus-ring: 0 0 0 3px rgba(30, 77, 140, 0.18);

    /* Metrics */
    --sb-control-h: 44px;
    --sb-control-h-sm: 36px;
    --sb-sidebar-w: 248px;
    --sb-topbar-h: 56px;
    --sb-content-max: 1600px;
    --sb-content-pad-x: 40px;
    --sb-content-pad-y: 28px;
    --sb-content-pad-b: 56px;
    --sb-card-pad-x: 22px;
}

/* The content padding shrinks on small screens. It lives in tokens because the
   sticky action bar cancels it with negative margins to span the full column. */
@media (max-width: 900px) {
    :root {
        --sb-content-pad-x: 16px;
        --sb-content-pad-y: 20px;
        --sb-content-pad-b: 48px;
        --sb-card-pad-x: 16px;
    }
}

/* Bootstrap is still loaded for the Identity pages that have not been
   redesigned (see docs/design-system.md). These two keep its primary button
   and its headings on brand; the cyan pair went with the pages that used it. */
:root {
    --brand-navy: #1C3668;
    --brand-navy-dark: #14284D;
}

body {
    font-family: var(--sb-font);
    color: var(--sb-text);
}

h1, h3, h5 {
    color: var(--brand-navy);
    font-weight: 600;
}

.btn-primary {
    background-color: var(--brand-navy);
    border-color: var(--brand-navy);
}

    .btn-primary:hover {
        background-color: var(--brand-navy-dark);
        border-color: var(--brand-navy-dark);
    }


html, body {
    font-family: var(--sb-font);
    background: var(--sb-page-bg);
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ===========================================================================
   sb-* design system. Prefixed so it never clashes with Bootstrap, which is
   still loaded for the pages that have not been redesigned yet.
   Documented in docs/design-system.md.
   =========================================================================== */

/* --- Shell / layout ------------------------------------------------------ */

/* The shell fills the viewport and never scrolls itself: the sidebar is fixed
   and .sb-main is the one scroll container. That keeps the sidebar still on a
   long page and keeps a wide table (Catalog, quote view) inside .sb-main's own
   horizontal scrollbar instead of dragging the whole page sideways. */
.sb-shell {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    box-sizing: border-box;
    background: var(--sb-page-bg);
    color: var(--sb-text);
}

/* Off-canvas switch for the mobile sidebar. Visually hidden, but still in the
   tab order: the hamburger label next to it shows where the focus is. */
.sb-nav-toggle {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
}

.sb-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sb-sidebar-w);
    height: 100vh;
    height: 100dvh;
    z-index: 30;
    box-sizing: border-box;
    background: var(--sb-navy);
    display: flex;
    flex-direction: column;
    gap: 26px;
    padding: 24px 14px 18px;
}

/* Brand above and user card below stay put; only this band scrolls when the
   nav outgrows a short screen. */
.sb-sidebar__nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 26px;
}

.sb-sidebar__brand {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 10px 4px;
    text-decoration: none;
}

    .sb-sidebar__brand img {
        height: 34px;
        width: auto;
        align-self: flex-start;
    }

.sb-sidebar__tag {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--sb-accent);
}

.sb-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sb-nav__section {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sb-nav-section);
    padding: 0 12px 8px;
}

.sb-nav__link {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 42px;
    padding: 0 12px;
    border-radius: var(--sb-radius);
    color: var(--sb-nav-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

    .sb-nav__link:hover {
        background: rgba(255, 255, 255, 0.06);
        color: #FFFFFF;
    }

    .sb-nav__link.active {
        background: var(--sb-navy-active);
        color: #FFFFFF;
    }

        .sb-nav__link.active svg {
            stroke: var(--sb-accent);
        }

.sb-sidebar__user {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 10px;
    border-top: 1px solid var(--sb-navy-border);
}

.sb-sidebar__userlink {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
    text-decoration: none;
    border-radius: var(--sb-radius);
    min-height: 44px;
}

.sb-sidebar__who {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sb-sidebar__name {
    font-size: 13px;
    font-weight: 600;
    color: #FFFFFF;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sb-sidebar__email {
    font-size: 12px;
    color: var(--sb-nav-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sb-logout {
    flex: 0 0 40px;
    height: 40px;
    border: 0;
    border-radius: var(--sb-radius);
    background: transparent;
    color: var(--sb-nav-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

    .sb-logout:hover {
        background: rgba(255, 255, 255, 0.08);
        color: #FFFFFF;
    }

.sb-main {
    height: 100%;
    margin-left: var(--sb-sidebar-w);
    overflow: auto;
    display: flex;
    flex-direction: column;
}

.sb-content {
    flex: 1 0 auto;
    min-width: 0;
    width: 100%;
    max-width: var(--sb-content-max);
    box-sizing: border-box;
    padding: var(--sb-content-pad-y) var(--sb-content-pad-x) var(--sb-content-pad-b);
    display: flex;
    flex-direction: column;
}

/* Mobile top bar + scrim. Hidden on desktop. */
.sb-topbar,
.sb-scrim {
    display: none;
}

@media (max-width: 900px) {
    .sb-shell {
        padding-top: var(--sb-topbar-h);
    }

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

    .sb-topbar {
        display: flex;
        align-items: center;
        gap: 12px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: var(--sb-topbar-h);
        padding: 0 12px;
        background: var(--sb-navy);
        z-index: 40;
    }

        .sb-topbar img {
            height: 24px;
            width: auto;
        }

    .sb-topbar__menu {
        width: 40px;
        height: 40px;
        border: 0;
        border-radius: var(--sb-radius);
        background: transparent;
        color: var(--sb-nav-text);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

    .sb-scrim {
        position: fixed;
        inset: 0;
        background: rgba(15, 30, 61, 0.45);
        z-index: 45;
    }

    .sb-sidebar {
        width: 272px;
        z-index: 50;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }

    .sb-nav-toggle:focus-visible ~ .sb-topbar .sb-topbar__menu {
        box-shadow: 0 0 0 2px var(--sb-accent);
    }

    .sb-nav-toggle:checked ~ .sb-sidebar {
        transform: translateX(0);
    }

    .sb-nav-toggle:checked ~ .sb-scrim {
        display: block;
    }

}

@media (prefers-reduced-motion: reduce) {
    .sb-sidebar {
        transition: none;
    }
}

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

.sb-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.sb-page-header__text {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.sb-page-header__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.sb-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: 13px;
    color: var(--sb-muted-light);
}

    .sb-breadcrumb a {
        color: inherit;
        text-decoration: none;
    }

        .sb-breadcrumb a:hover {
            text-decoration: underline;
        }

    .sb-breadcrumb .sb-breadcrumb__current {
        color: var(--sb-text);
        font-weight: 500;
    }

.sb-page-title {
    margin: 0;
    font-size: 28px;
    line-height: 1.25;
    font-weight: 600;
    color: var(--sb-navy);
}

.sb-page-sub {
    margin: 0;
    font-size: 15px;
    color: var(--sb-muted);
}

/* The vertical rhythm between the big blocks of a page, as in the mockups. */
.sb-stack {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
    padding-bottom: 24px;
}

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

.sb-card {
    background: var(--sb-surface);
    border: 1px solid var(--sb-border);
    border-radius: var(--sb-radius-lg);
    overflow: hidden;
}

.sb-card--pad {
    padding: 20px var(--sb-card-pad-x);
}

.sb-card__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px var(--sb-card-pad-x);
    border-bottom: 1px solid var(--sb-border-light);
}

.sb-card__title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--sb-navy);
}

    /* The "view all" style link that sits opposite a card title. */
    .sb-card__header a {
        font-size: 14px;
        font-weight: 500;
        text-decoration: none;
    }

        .sb-card__header a:hover {
            text-decoration: underline;
        }

.sb-card__body {
    padding: 22px var(--sb-card-pad-x) 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.sb-card__footer {
    padding: 14px var(--sb-card-pad-x);
    border-top: 1px solid var(--sb-border-light);
    background: var(--sb-surface-muted);
}

/* A footer whose whole job is the buttons that end a form. */
.sb-card__footer--actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

/* --- Buttons ------------------------------------------------------------- */

.sb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: var(--sb-control-h);
    padding: 0 18px;
    box-sizing: border-box;
    border: 1px solid transparent;
    border-radius: var(--sb-radius);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

    .sb-btn:disabled,
    .sb-btn.disabled {
        opacity: 0.55;
        cursor: not-allowed;
    }

    .sb-btn:focus-visible {
        outline: none;
        box-shadow: var(--sb-focus-ring);
    }

.sb-btn--sm {
    height: var(--sb-control-h-sm);
    padding: 0 12px;
    font-size: 13px;
    font-weight: 500;
}

.sb-btn--primary {
    background: var(--sb-primary);
    border-color: var(--sb-primary);
    color: #FFFFFF;
}

    .sb-btn--primary:hover {
        background: var(--sb-primary-hover);
        border-color: var(--sb-primary-hover);
        color: #FFFFFF;
    }

.sb-btn--secondary {
    background: var(--sb-surface);
    border-color: var(--sb-border-input);
    color: var(--sb-text-strong);
    font-weight: 500;
}

    .sb-btn--secondary:hover {
        background: var(--sb-surface-muted);
        color: var(--sb-text-strong);
    }

.sb-btn--danger-outline {
    background: var(--sb-surface);
    border-color: var(--sb-danger-border);
    color: var(--sb-danger);
    font-weight: 500;
}

    .sb-btn--danger-outline:hover {
        background: var(--sb-danger-bg);
        color: var(--sb-danger-strong);
    }

.sb-btn--danger {
    background: var(--sb-danger);
    border-color: var(--sb-danger);
    color: #FFFFFF;
}

    .sb-btn--danger:hover {
        background: var(--sb-danger-strong);
        border-color: var(--sb-danger-strong);
        color: #FFFFFF;
    }

.sb-btn--ghost {
    background: transparent;
    border-color: transparent;
    color: var(--sb-primary);
    font-weight: 500;
}

    .sb-btn--ghost:hover {
        background: var(--sb-primary-soft);
        color: var(--sb-primary-hover);
    }

.sb-icon-btn {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    border: 0;
    border-radius: var(--sb-radius);
    background: transparent;
    color: var(--sb-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

    .sb-icon-btn:hover {
        background: var(--sb-border-subtle);
        color: var(--sb-text);
    }

    .sb-icon-btn:focus-visible {
        outline: none;
        box-shadow: var(--sb-focus-ring);
    }

.sb-icon-btn--sm {
    width: 34px;
    height: 34px;
}

.sb-icon-btn--danger {
    color: var(--sb-danger);
}

    .sb-icon-btn--danger:hover {
        background: var(--sb-danger-bg);
        color: var(--sb-danger-strong);
    }

/* --- Form controls ------------------------------------------------------- */

.sb-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.sb-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--sb-text-body);
}

.sb-input,
.sb-select,
.sb-textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--sb-border-input);
    border-radius: var(--sb-radius);
    background: var(--sb-surface);
    font: inherit;
    font-size: 14px;
    color: var(--sb-text);
}

.sb-input,
.sb-select {
    height: var(--sb-control-h);
    padding: 0 12px;
}

.sb-textarea {
    min-height: var(--sb-control-h);
    padding: 10px 12px;
    line-height: 1.5;
    resize: vertical;
    /* Grows with what is typed, as in the mockups. Chromium only for now, so
       every textarea also carries a `rows` value as the fallback height. */
    field-sizing: content;
}

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

    .sb-input::placeholder,
    .sb-textarea::placeholder {
        color: var(--sb-placeholder);
    }

    .sb-input:disabled,
    .sb-select:disabled,
    .sb-textarea:disabled {
        background: var(--sb-surface-sunken);
        color: var(--sb-muted);
    }

/* Arabic fields keep the Arabic face and a roomier line height. */
.sb-input--ar,
.sb-textarea--ar {
    font-family: var(--sb-font-ar);
    line-height: 1.6;
}

.sb-hint {
    font-size: 12px;
    color: var(--sb-muted);
}

/* An advisory, never a blocker: the form still saves. */
.sb-hint--warn {
    color: var(--sb-warning);
}

.sb-error {
    font-size: 13px;
    color: var(--sb-danger);
}

/* Search box: an input with a leading magnifier. */
.sb-search {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
}

    .sb-search > svg {
        position: absolute;
        left: 12px;
        color: var(--sb-muted-light);
        pointer-events: none;
    }

    .sb-search .sb-input {
        padding-left: 40px;
    }

.sb-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

/* --- Badges / pills ------------------------------------------------------ */

.sb-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: var(--sb-radius-pill);
    background: var(--sb-border-subtle);
    color: var(--sb-muted);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.sb-badge--sm {
    padding: 2px 8px;
    font-size: 11px;
}

.sb-badge--info {
    background: var(--sb-info-bg);
    color: var(--sb-info);
}

.sb-badge--success {
    background: var(--sb-success-bg);
    color: var(--sb-success);
}

.sb-badge--warning {
    background: var(--sb-warning-bg);
    color: var(--sb-warning);
}

.sb-badge--danger {
    background: var(--sb-danger-bg);
    color: var(--sb-danger);
}

.sb-badge--navy {
    background: var(--sb-navy);
    color: #FFFFFF;
}

.sb-badge--outline {
    background: var(--sb-surface);
    border: 1px solid var(--sb-border);
    color: var(--sb-muted);
}

/* --- Data table ---------------------------------------------------------- */

.sb-table-wrap {
    overflow-x: auto;
}

.sb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

    .sb-table thead tr {
        background: var(--sb-surface-muted);
    }

    .sb-table th {
        text-align: left;
        padding: 12px 16px;
        font-size: 12px;
        font-weight: 600;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: var(--sb-muted);
        white-space: nowrap;
    }

    .sb-table th.sb-num {
        text-align: right;
    }

    .sb-table td {
        padding: 12px 16px;
        color: var(--sb-text-body);
        vertical-align: middle;
    }

    .sb-table tbody tr {
        border-top: 1px solid var(--sb-border-light);
    }

        .sb-table tbody tr:hover {
            background: var(--sb-surface-muted);
        }

    .sb-table th:first-child,
    .sb-table td:first-child {
        padding-left: var(--sb-card-pad-x);
    }

    .sb-table th:last-child,
    .sb-table td:last-child {
        padding-right: var(--sb-card-pad-x);
    }

    .sb-table a {
        font-weight: 600;
        text-decoration: none;
    }

    /* The revision pill that sits beside a quote number. */
    .sb-table a + .sb-badge {
        margin-left: 8px;
    }

/* Right-aligned money / count cells, with figures that line up. */
.sb-num {
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.sb-table__actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.sb-table__empty {
    padding: 28px var(--sb-card-pad-x);
    text-align: center;
    color: var(--sb-muted);
    font-size: 14px;
}

/* --- Sticky bottom action bar -------------------------------------------- */

/* The bar lines up with the cards above it: same width as the content column,
   and only the page's bottom padding is cancelled so it sits flush against the
   bottom of the screen while stuck. */
.sb-actionbar {
    position: sticky;
    bottom: 0;
    z-index: 10;
    /* auto on top: on a page too short to scroll, the bar still sits at the
       bottom rather than floating halfway up. */
    margin: auto 0 calc(-1 * var(--sb-content-pad-b));
    background: var(--sb-surface);
    border: 1px solid var(--sb-border);
    border-bottom: 0;
    border-radius: var(--sb-radius-lg) var(--sb-radius-lg) 0 0;
    box-shadow: var(--sb-shadow-bar);
}

.sb-actionbar__inner {
    box-sizing: border-box;
    padding: 14px var(--sb-card-pad-x);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.sb-actionbar__facts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 28px;
}

.sb-actionbar__fact {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

    .sb-actionbar__fact > span:first-child {
        font-size: 12px;
        color: var(--sb-muted);
    }

    .sb-actionbar__fact > span:last-child {
        font-size: 15px;
        font-weight: 500;
        font-variant-numeric: tabular-nums;
        color: var(--sb-text);
    }

.sb-actionbar__divider {
    width: 1px;
    height: 36px;
    background: var(--sb-border);
}

.sb-actionbar__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}



/* --- Avatar -------------------------------------------------------------- */

.sb-avatar {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--sb-primary-soft-border);
    color: var(--sb-primary);
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}

.sb-avatar--sm {
    flex-basis: 28px;
    width: 28px;
    height: 28px;
    font-size: 11px;
}

.sb-avatar--nav {
    background: var(--sb-navy-avatar);
    color: #FFFFFF;
}

/* --- Icons --------------------------------------------------------------- */

.sb-icon {
    flex: 0 0 auto;
    display: inline-block;
    vertical-align: middle;
}

/* --- Home: greeting line ------------------------------------------------- */

.sb-dateline {
    font-size: 13px;
    font-weight: 500;
    color: var(--sb-muted-light);
}

.sb-page-title--xl {
    font-size: 30px;
    line-height: 1.2;
}

/* --- Navy banner --------------------------------------------------------- */

.sb-banner {
    position: relative;
    overflow: hidden;
    background: var(--sb-navy);
    border-radius: var(--sb-radius-xl);
    padding: 32px 36px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.sb-banner__mark {
    position: absolute;
    right: -40px;
    top: -60px;
    height: 280px;
    width: auto;
    opacity: 0.07;
    pointer-events: none;
}

.sb-banner__text {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 600px;
}

.sb-banner__eyebrow {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--sb-accent);
}

.sb-banner__title {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: #FFFFFF;
}

.sb-banner__body {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--sb-nav-text);
}

.sb-banner__actions {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* Two button variants that only make sense on the navy banner. */
.sb-btn--on-navy {
    background: transparent;
    border-color: var(--sb-navy-outline);
    color: #FFFFFF;
    font-weight: 500;
}

    .sb-btn--on-navy:hover {
        background: rgba(255, 255, 255, 0.08);
        color: #FFFFFF;
    }

.sb-btn--white {
    background: #FFFFFF;
    border-color: #FFFFFF;
    color: var(--sb-navy);
}

    .sb-btn--white:hover {
        background: var(--sb-primary-soft);
        color: var(--sb-navy);
    }

/* --- Stat cards ---------------------------------------------------------- */

.sb-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.sb-stat {
    background: var(--sb-surface);
    border: 1px solid var(--sb-border);
    border-radius: var(--sb-radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-decoration: none;
    min-width: 0;
}

a.sb-stat:hover {
    border-color: var(--sb-primary-soft-border);
    box-shadow: var(--sb-shadow-card);
}

.sb-stat__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sb-stat__label {
    font-size: 13px;
    font-weight: 500;
    color: var(--sb-muted);
}

.sb-stat__icon {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: var(--sb-radius);
    background: var(--sb-primary-soft);
    color: var(--sb-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sb-stat__value {
    font-size: 28px;
    font-weight: 600;
    color: var(--sb-navy);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.sb-stat__unit {
    font-size: 14px;
    font-weight: 500;
    color: var(--sb-muted);
}

.sb-stat__note {
    font-size: 13px;
    color: var(--sb-muted);
}

/* --- Table extras used by the Home table --------------------------------- */

/* Columns are sized by their width rules, never by their content, so the
   table can never be wider than the card it sits in. */
.sb-table--fixed {
    table-layout: fixed;
}

/* The one cell that gives way: it takes the leftover width and ellipsises. */
.sb-cell-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

    .sb-cell-ellipsis > * {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.sb-row-link {
    cursor: pointer;
}

.sb-empty-name {
    color: var(--sb-muted-light);
    font-style: italic;
}

/* --- Empty state --------------------------------------------------------- */

.sb-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 44px 20px 48px;
    text-align: center;
}

.sb-empty__text {
    margin: 0;
    font-size: 14px;
    color: var(--sb-muted);
}

/* --- Stacked table on small screens -------------------------------------- */

@media (max-width: 900px) {
    .sb-banner {
        padding: 24px 20px;
    }

    .sb-banner__mark {
        right: -70px;
        top: -70px;
        height: 220px;
    }

    .sb-banner__actions {
        width: 100%;
    }

        .sb-banner__actions .sb-btn {
            flex: 1 1 auto;
        }

    .sb-stats {
        grid-template-columns: 1fr;
    }

    .sb-page-title--xl {
        font-size: 24px;
    }

    /* Rows become cards: the header goes away and each cell carries its own
       label from data-label. */
    .sb-table--stack {
        display: block;
        table-layout: auto;
    }

        .sb-table--stack thead {
            display: none;
        }

        .sb-table--stack tbody,
        .sb-table--stack tr,
        .sb-table--stack td {
            display: block;
            width: auto;
        }

        .sb-table--stack tbody tr {
            border-top: 1px solid var(--sb-border-light);
            padding: 12px 16px;
        }

            .sb-table--stack tbody tr:hover {
                background: var(--sb-surface-muted);
            }

        .sb-table--stack td {
            padding: 3px 0;
            max-width: none;
        }

            .sb-table--stack td::before {
                content: attr(data-label);
                display: block;
                font-size: 11px;
                font-weight: 600;
                letter-spacing: 0.04em;
                text-transform: uppercase;
                color: var(--sb-muted);
            }

            .sb-table--stack td:first-child,
            .sb-table--stack td:last-child {
                padding-left: 0;
                padding-right: 0;
            }

            /* The amount sits with the rest of the card, not off to the right. */
            .sb-table--stack td.sb-num {
                text-align: left;
            }

            /* Row buttons line up with the labelled fields above them. */
            .sb-table--stack td .sb-table__actions {
                justify-content: flex-start;
                margin-top: 4px;
            }

            .sb-table--stack td[data-label="Actions"]::before {
                content: none;
            }

            /* A card has room to wrap, so nothing needs truncating here. */
            .sb-table--stack td.sb-cell-ellipsis,
            .sb-table--stack td.sb-cell-ellipsis > * {
                overflow: visible;
                text-overflow: clip;
                white-space: normal;
            }
}

/* --- Numbered card (the quote form's "1 Quotation & client") ------------- */

.sb-step {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--sb-navy);
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* A card header whose left side is the step badge, title and sub-line. */
.sb-card__heading {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.sb-card__headings {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.sb-card__sub {
    margin: 0;
    font-size: 13px;
    color: var(--sb-muted);
}

/* A small labelled control parked on the right of a card header. */
.sb-cardtool {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

    .sb-cardtool .sb-input {
        width: 130px;
        height: 40px;
    }

    .sb-cardtool .sb-btn {
        height: 40px;
    }

/* --- Form rows ----------------------------------------------------------- */

/* Fields that share a row and wrap as a group, as in the mockup. */
.sb-formrow {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 20px;
}

.sb-formrow--even > .sb-field {
    flex: 1 1 220px;
}

/* The three widths the mockups use for a field sharing a row. */
.sb-field--sm {
    flex: 0 1 300px;
}

.sb-field--md {
    flex: 1 1 260px;
}

.sb-field--lg {
    flex: 2 1 360px;
}

/* A field that is only as wide as what is in it, e.g. a button in a form row. */
.sb-field--auto {
    flex: 0 0 auto;
}

/* Prefix + input welded into one control, for "QUT NIT 026." + number. */
.sb-inputgroup {
    display: flex;
    height: var(--sb-control-h);
    border: 1px solid var(--sb-border-input);
    border-radius: var(--sb-radius);
    overflow: hidden;
    background: var(--sb-surface);
}

    .sb-inputgroup:focus-within {
        border-color: var(--sb-primary);
        box-shadow: var(--sb-focus-ring);
    }

.sb-inputgroup__prefix {
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: var(--sb-border-subtle);
    border-right: 1px solid var(--sb-border-input);
    font-size: 14px;
    color: var(--sb-muted);
    white-space: nowrap;
}

.sb-inputgroup .sb-input {
    flex: 1 1 auto;
    min-width: 0;
    height: auto;
    border: 0;
    border-radius: 0;
}

    .sb-inputgroup .sb-input:focus {
        box-shadow: none;
    }

/* A value shown where a field would be, e.g. the reference in Edit mode. */
.sb-readonly {
    display: flex;
    align-items: center;
    height: var(--sb-control-h);
    padding: 0 12px;
    border-radius: var(--sb-radius);
    background: var(--sb-surface-muted);
    border: 1px solid var(--sb-border-light);
    font-size: 14px;
    font-weight: 600;
    color: var(--sb-text);
}

/* --- Typeahead dropdown --------------------------------------------------- */

.sb-typeahead {
    position: relative;
    min-width: 0;
}

.sb-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 20;
    max-height: 17rem;
    overflow-y: auto;
    background: var(--sb-surface);
    border: 1px solid var(--sb-border);
    border-radius: var(--sb-radius);
    box-shadow: var(--sb-shadow-pop);
    padding: 4px;
}

.sb-menu__item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    border-radius: var(--sb-radius-sm);
    cursor: pointer;
    font-size: 14px;
    color: var(--sb-text);
}

    .sb-menu__item:hover {
        background: var(--sb-primary-soft);
    }

.sb-menu__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--sb-muted);
}

/* --- Line items ----------------------------------------------------------- */

/* Each line is its own bordered sub-card, so two lines never read as one. */
.sb-lines {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px var(--sb-card-pad-x);
}

.sb-line {
    border: 1px solid var(--sb-border);
    border-radius: var(--sb-radius-lg);
    overflow: hidden;
    background: var(--sb-surface);
}

/* Row 1 sits on a tinted strip: number | the two descriptions | remove. */
.sb-line__head {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 40px;
    gap: 14px;
    align-items: start;
    padding: 14px 16px;
    background: var(--sb-surface-muted);
    border-bottom: 1px solid var(--sb-border-light);
}

.sb-line__no {
    width: 28px;
    height: 28px;
    margin-top: 26px;              /* clears the field label above the textarea */
    border-radius: 50%;
    background: var(--sb-navy);
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sb-line__desc {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
}

/* Row 2: cost, margin, unit price, qty, line total. */
.sb-line__numbers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    padding: 14px 16px;
}

.sb-line__remove {
    margin-top: 24px;
}

/* The English description carries the line, so it is set a shade heavier. */
.sb-textarea--strong {
    font-weight: 600;
}

/* The small label above a line field, lighter than .sb-label. */
.sb-label--sm {
    font-size: 12px;
}

/* Money inputs line their digits up and sit to the right. */
.sb-input--money {
    height: 40px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.sb-input--num {
    height: 40px;
    text-align: right;
}

/* A manually set unit price: amber so it reads as "not recalculating". */
.sb-input--overridden {
    border-color: var(--sb-warning);
    background: var(--sb-warning-bg);
}

/* The read-only line total box. */
.sb-linetotal {
    height: 40px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 12px;
    border-radius: var(--sb-radius);
    background: var(--sb-page-bg);
    font-size: 15px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--sb-navy);
}

.sb-label--right {
    text-align: right;
}

/* A dashed "add another" button, and the tinted strip it sits in. */
.sb-card__foot {
    padding: 16px var(--sb-card-pad-x);
    border-top: 1px solid var(--sb-border-light);
    background: #FCFCFD;
}

.sb-btn--dashed {
    height: 40px;
    padding: 0 14px;
    border: 1px dashed var(--sb-placeholder);
    background: var(--sb-surface);
    color: var(--sb-primary);
    font-weight: 500;
}

    .sb-btn--dashed:hover {
        background: var(--sb-primary-soft);
        border-color: var(--sb-primary);
    }

/* --- Collapsible card ----------------------------------------------------- */

.sb-collapse {
    background: var(--sb-surface);
    border: 1px solid var(--sb-border);
    border-radius: var(--sb-radius-lg);
    overflow: hidden;
}

.sb-collapse > summary,
.sb-collapse__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 18px var(--sb-card-pad-x);
    cursor: pointer;
    list-style: none;
}

    .sb-collapse > summary::-webkit-details-marker {
        display: none;
    }

    .sb-collapse__head:hover {
        background: var(--sb-surface-muted);
    }

.sb-collapse[open] > summary,
.sb-collapse.is-open > .sb-collapse__head {
    border-bottom: 1px solid var(--sb-border-light);
}

/* The body is hidden, not removed, so a part-typed term is never lost. */
.sb-collapse [hidden] {
    display: none;
}

.sb-collapse__titles {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.sb-collapse__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--sb-navy);
}

.sb-collapse__sub {
    font-size: 13px;
    color: var(--sb-muted);
}

.sb-collapse__count {
    font-size: 13px;
    color: var(--sb-muted);
    white-space: nowrap;
}

.sb-collapse__chevron {
    color: var(--sb-muted);
    transition: transform 0.15s ease;
}

.sb-collapse[open] .sb-collapse__chevron {
    transform: rotate(180deg);
}

@media (prefers-reduced-motion: reduce) {
    .sb-collapse__chevron {
        transition: none;
    }
}

/* --- Sub-section inside a card (Terms / Payment terms / Closing) ---------- */

.sb-subhead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 18px var(--sb-card-pad-x) 10px;
}

.sb-subhead__title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--sb-navy);
}

/* --- Term rows ------------------------------------------------------------ */

.sb-termhead,
.sb-term {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) minmax(0, 1fr) 112px;
    gap: 14px;
}

    /* The Arabic column is right-to-left, so its heading sits on the right. */
    .sb-termhead > :nth-child(3) {
        text-align: right;
    }

.sb-termhead {
    padding: 8px var(--sb-card-pad-x);
    background: var(--sb-surface-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--sb-muted);
}

.sb-term {
    align-items: start;
    padding: 12px var(--sb-card-pad-x);
    border-top: 1px solid var(--sb-border-light);
}

.sb-term__no {
    width: 26px;
    height: 26px;
    margin-top: 9px;
    border-radius: 50%;
    background: var(--sb-primary-soft);
    color: var(--sb-primary);
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sb-term__tools {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

/* A small square button with a border, for move up / move down. */
.sb-icon-btn--bordered {
    width: 34px;
    height: 34px;
    border: 1px solid var(--sb-border-input);
    background: var(--sb-surface);
    color: var(--sb-text-body);
}

    .sb-icon-btn--bordered:disabled {
        border-color: var(--sb-border-light);
        color: var(--sb-border-input);
        cursor: not-allowed;
        background: var(--sb-surface);
    }

.sb-empty-row {
    padding: 16px var(--sb-card-pad-x);
    font-size: 13px;
    color: var(--sb-muted);
    border-top: 1px solid var(--sb-border-light);
}

/* --- Card footer with a prompt on the left and one action on the right ---- */

.sb-card__prompt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px var(--sb-card-pad-x);
    border-top: 1px solid var(--sb-border-light);
    background: #FCFCFD;
    font-size: 13px;
    color: var(--sb-muted);
}

/* --- Action bar extras ---------------------------------------------------- */

.sb-actionbar__total > span:last-child {
    font-size: 22px;
    font-weight: 700;
    color: var(--sb-navy);
}

.sb-actionbar__total > span:first-child {
    font-weight: 600;
    color: var(--sb-navy);
}

.sb-actionbar__unit {
    font-size: 13px;
    font-weight: 500;
    color: var(--sb-muted);
}

/* The "cannot save yet" line, shown where the user is actually clicking. */
.sb-actionbar__error {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--sb-danger);
}

/* --- Small screens -------------------------------------------------------- */

@media (max-width: 900px) {
    .sb-lines {
        padding: 12px var(--sb-card-pad-x);
    }

    .sb-line__head {
        gap: 10px;
        padding: 12px;
    }

    .sb-line__numbers {
        padding: 12px;
    }

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

    /* Two fields per row rather than five squeezed across. */
    .sb-line__numbers {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sb-termhead {
        display: none;
    }

    .sb-term {
        grid-template-columns: 26px minmax(0, 1fr);
        grid-template-areas:
            "no en"
            "no ar"
            "no tools";
    }

        .sb-term > .sb-term__no {
            grid-area: no;
        }

        .sb-term > :nth-child(2) {
            grid-area: en;
        }

        .sb-term > :nth-child(3) {
            grid-area: ar;
        }

        .sb-term > .sb-term__tools {
            grid-area: tools;
        }

    .sb-collapse__sub {
        display: none;
    }

    /* Only the total and the save button need to stay in view. */
    .sb-actionbar__facts > .sb-actionbar__fact:not(.sb-actionbar__total),
    .sb-actionbar__divider {
        display: none;
    }

    .sb-actionbar__buttons .sb-btn--secondary {
        padding: 0 12px;
    }
}

/* --- Filter bar at the top of a list card -------------------------------- */

.sb-filterbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px var(--sb-card-pad-x);
    border-bottom: 1px solid var(--sb-border-light);
}

    .sb-filterbar .sb-search {
        flex: 1 1 320px;
        max-width: 460px;
    }

    .sb-filterbar .sb-select {
        flex: 0 0 auto;
        width: auto;
        min-width: 190px;
    }

/* A count or note sitting opposite the search box. */
.sb-filterbar__note {
    margin-left: auto;
    align-self: center;
    font-size: 13px;
    color: var(--sb-muted);
    white-space: nowrap;
}

/* --- A row that has been soft-deleted ------------------------------------ */

.sb-row-deleted {
    opacity: 0.6;
}

/* Avatar and name sitting together in a table cell. */
.sb-who {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    max-width: 100%;
}

    .sb-who > span:last-child {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

/* --- Tabs ----------------------------------------------------------------- */

.sb-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    border-bottom: 1px solid var(--sb-border);
}

.sb-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 14px;
    box-sizing: border-box;
    border: 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    background: transparent;
    color: var(--sb-muted);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}

    .sb-tab:hover {
        color: var(--sb-text);
    }

    .sb-tab.active {
        border-bottom-color: var(--sb-primary);
        color: var(--sb-navy);
        font-weight: 600;
    }

/* --- Inline danger panel (the delete confirmation) ----------------------- */

.sb-danger-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--sb-danger-border);
    border-radius: var(--sb-radius-lg);
    background: var(--sb-danger-bg);
}

.sb-danger-panel__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

    .sb-danger-panel__text strong {
        color: var(--sb-danger-strong);
        font-size: 14px;
    }

    .sb-danger-panel__text span {
        font-size: 13px;
        color: var(--sb-danger-strong);
    }

.sb-danger-panel__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* --- The generated PDF, shown in place ----------------------------------- */

.sb-pdfframe {
    width: 100%;
    height: min(1100px, 85vh);
    border: 1px solid var(--sb-border);
    border-radius: var(--sb-radius);
    background: var(--sb-surface-muted);
}

.sb-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 60px 20px;
    text-align: center;
    font-size: 14px;
    color: var(--sb-muted);
}

/* ===========================================================================
   The on-screen quotation sheet.

   Colours are the ones inside Templates/sabghat-v2.docx (read from a copy):
   #0070C0 headings and rules, #00B0F0 the lighter accent, #C00000 the red the
   template uses for emphasis, #F2F2F2 table header fill, #7F7F7F table rules,
   #595959 secondary text.
   =========================================================================== */

:root {
    --sb-doc-accent: #0070C0;
    --sb-doc-accent-soft: #00B0F0;
    --sb-doc-red: #C00000;
    --sb-doc-head: #F2F2F2;
    --sb-doc-rule: #7F7F7F;
    --sb-doc-muted: #595959;
}

.sb-doc {
    background: #FFFFFF;
    border: 1px solid var(--sb-border);
    border-radius: var(--sb-radius-lg);
    box-shadow: var(--sb-shadow-card);
    overflow: hidden;
    color: #000000;
    font-size: 13px;
    line-height: 1.5;
}

/* The blue strip the template carries across the top of every page. */
.sb-doc__bar {
    height: 8px;
    background: linear-gradient(90deg, var(--sb-doc-accent) 0%, var(--sb-doc-accent-soft) 100%);
}

.sb-doc__inner {
    padding: 28px 32px 36px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    min-width: 0;
}

.sb-doc__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--sb-doc-accent);
}

.sb-doc__logo {
    height: 46px;
    width: auto;
}

.sb-doc__titles {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    text-align: right;
}

.sb-doc__ar {
    font-family: var(--sb-font-ar);
    font-size: 20px;
    font-weight: 600;
    color: var(--sb-doc-accent);
}

.sb-doc__en {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--sb-doc-muted);
}

.sb-doc__meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 20px;
    font-size: 13px;
    color: var(--sb-doc-muted);
}

    .sb-doc__meta strong {
        color: #000000;
    }

/* A numbered bilingual section title, as the template writes them. */
.sb-doc__section {
    margin: 6px 0 0;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--sb-doc-accent);
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: var(--sb-doc-accent);
}

    .sb-doc__section .sb-doc__section-ar {
        font-family: var(--sb-font-ar);
    }

/* Tables inside the sheet keep the template's grey header and hairlines. */
.sb-doc__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

    .sb-doc__table th,
    .sb-doc__table td {
        border: 1px solid var(--sb-doc-rule);
        padding: 7px 9px;
        vertical-align: top;
        text-align: left;
    }

    .sb-doc__table th {
        background: var(--sb-doc-head);
        font-weight: 600;
        color: #000000;
        white-space: nowrap;
    }

        .sb-doc__table th span {
            display: block;
            font-family: var(--sb-font-ar);
            font-weight: 500;
            color: var(--sb-doc-muted);
        }

.sb-doc__table th.sb-doc__num,
.sb-doc__table td.sb-doc__num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.sb-doc__ar-cell {
    font-family: var(--sb-font-ar);
    direction: rtl;
    text-align: right;
}

/* A wide pricing table scrolls inside the sheet, never on the page. */
.sb-doc__scroll {
    overflow-x: auto;
    min-width: 0;
}

.sb-doc__totals td:first-child {
    font-weight: 600;
}

    .sb-doc__totals td:first-child span {
        display: block;
        font-weight: 500;
        color: var(--sb-doc-muted);
    }

.sb-doc__totals tr:last-child td {
    background: var(--sb-doc-head);
    color: var(--sb-doc-accent);
}

.sb-doc__totals td:last-child {
    width: 10rem;
}

.sb-doc__closing {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
}

    .sb-doc__closing > div {
        font-size: 13px;
        line-height: 1.7;
    }

.sb-doc__label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--sb-doc-muted);
}

.sb-doc__terms td:first-child {
    width: 2.5rem;
    text-align: center;
    color: var(--sb-doc-muted);
}

@media (max-width: 900px) {
    .sb-doc__inner {
        padding: 18px 16px 24px;
        gap: 16px;
    }

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

    .sb-doc__titles {
        align-items: flex-start;
        text-align: left;
    }

    .sb-pdfframe {
        height: 70vh;
    }
}

/* --- Category chips ------------------------------------------------------ */

/* Stacked: the search sits above the chips. In a column the base `flex` on the
   search would become a height, so it is reset here. */
.sb-filterbar--column {
    flex-direction: column;
    align-items: stretch;
}

    .sb-filterbar--column .sb-search {
        flex: 0 0 auto;
    }

.sb-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sb-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 12px;
    border: 1px solid var(--sb-border-input);
    border-radius: var(--sb-radius-pill);
    background: var(--sb-surface);
    color: var(--sb-text-body);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}

    .sb-chip:hover {
        background: var(--sb-surface-muted);
    }

    .sb-chip.active {
        background: var(--sb-navy);
        border-color: var(--sb-navy);
        color: #FFFFFF;
    }

    .sb-chip:focus-visible {
        outline: none;
        box-shadow: var(--sb-focus-ring);
    }

/* The little square that carries a category's colour. */
.sb-dot {
    flex: 0 0 10px;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    display: inline-block;
}

.sb-dot--new {
    background: transparent;
    border: 2px dashed var(--sb-placeholder);
    box-sizing: border-box;
}

.sb-dot--warn {
    background: var(--sb-warning);
    border-radius: 50%;
}

/* --- A table whose cells are form fields --------------------------------- */

.sb-table--form td {
    padding: 8px 16px;
}

    .sb-table--form td:first-child {
        padding-left: var(--sb-card-pad-x);
    }

    .sb-table--form td:last-child {
        padding-right: var(--sb-card-pad-x);
    }

.sb-table--form .sb-input {
    height: 40px;
}

/* An Arabic name that has not been filled in yet. */
.sb-input--missing {
    border-style: dashed;
    border-color: var(--sb-warning);
    background: #FFFCF5;
}

/* Category input with its colour square sitting inside. */
.sb-catfield {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
}

    .sb-catfield .sb-dot {
        position: absolute;
        left: 12px;
        pointer-events: none;
    }

    .sb-catfield .sb-input {
        padding-left: 30px;
    }

/* --- Group header rows ---------------------------------------------------- */

.sb-group-row td {
    background: var(--sb-surface-muted);
    padding: 6px var(--sb-card-pad-x);
    font-size: 13px;
    font-weight: 600;
    color: var(--sb-navy);
}

.sb-group-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--sb-navy);
    cursor: pointer;
}

    .sb-group-toggle:focus-visible {
        outline: none;
        box-shadow: var(--sb-focus-ring);
    }

.sb-more-row td {
    padding: 10px var(--sb-card-pad-x) 14px;
}

/* --- Save state in an action bar ----------------------------------------- */

.sb-savestate {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    min-width: 0;
    font-size: 13px;
    color: var(--sb-muted);
}

    .sb-savestate strong {
        color: var(--sb-text);
    }

    .sb-savestate.is-dirty strong {
        color: var(--sb-warning);
    }

/* --- Clients: the letter square ------------------------------------------ */

.sb-square {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: var(--sb-radius-sm);
    background: var(--sb-navy);
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}

.sb-square--muted {
    background: var(--sb-placeholder);
}

/* A field with something in front of it, inside a table cell. */
.sb-withicon {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

/* --- Pill tabs that jump to a section ------------------------------------ */

.sb-pilltabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sb-pilltab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--sb-border-input);
    border-radius: var(--sb-radius-pill);
    background: var(--sb-surface);
    color: var(--sb-text-body);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

    .sb-pilltab:hover {
        background: var(--sb-primary-soft);
        border-color: var(--sb-primary-soft-border);
        color: var(--sb-primary);
    }

/* --- Employees ------------------------------------------------------------ */

/* Name over email in one cell. */
.sb-person {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.sb-person__lines {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sb-person__name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    color: var(--sb-text);
}

.sb-person__email {
    font-size: 12px;
    color: var(--sb-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* A status light: a coloured dot and a word. */
.sb-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

    .sb-status .sb-dot {
        border-radius: 50%;
    }

.sb-dot--on {
    background: var(--sb-success);
}

.sb-dot--off {
    background: var(--sb-placeholder);
}

/* --- The numbering preview ------------------------------------------------ */

.sb-preview {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0 16px;
    border-radius: var(--sb-radius);
    background: var(--sb-navy);
    color: #FFFFFF;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* --- Small screens -------------------------------------------------------- */

@media (max-width: 900px) {
    .sb-table--form td {
        padding: 4px 0;
    }

        .sb-table--form td:first-child,
        .sb-table--form td:last-child {
            padding-left: 0;
            padding-right: 0;
        }

    /* A group header is one full-width bar, not a labelled card. */
    .sb-table--stack .sb-group-row,
    .sb-table--stack .sb-more-row {
        border-top: 0;
        padding: 0;
        background: transparent;
    }

        .sb-table--stack .sb-group-row td,
        .sb-table--stack .sb-more-row td {
            padding: 8px 12px;
            border-radius: var(--sb-radius-sm);
        }

            .sb-table--stack .sb-group-row td::before,
            .sb-table--stack .sb-more-row td::before {
                content: none;
            }

    .sb-filterbar .sb-search,
    .sb-filterbar .sb-select {
        flex: 1 1 100%;
        max-width: none;
        width: 100%;
    }

    .sb-savestate {
        flex: 1 1 100%;
    }
}

/* --- Two-column page (form on the left, a preview beside it) ------------- */

.sb-split {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

/* --- A card header that carries a person -------------------------------- */

.sb-idcard {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.sb-idcard__lines {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.sb-idcard__name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--sb-navy);
}

.sb-idcard__role {
    font-size: 13px;
    color: var(--sb-muted);
}

.sb-avatar--lg {
    flex-basis: 48px;
    width: 48px;
    height: 48px;
    font-size: 16px;
}

/* --- Preview card -------------------------------------------------------- */

.sb-preview-card {
    background: var(--sb-surface);
    border: 1px solid var(--sb-border);
    border-radius: var(--sb-radius-lg);
    overflow: hidden;
    position: sticky;
    top: var(--sb-content-pad-y);
}

.sb-preview-card__head {
    padding: 12px var(--sb-card-pad-x);
    border-bottom: 1px solid var(--sb-border-light);
    background: var(--sb-surface-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--sb-muted);
}

.sb-preview-card__body {
    padding: 18px var(--sb-card-pad-x) 20px;
}

/* The From block exactly as the document prints it. */
.sb-fromblock {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 13px;
    line-height: 1.6;
    color: #000000;
}

    .sb-fromblock strong {
        color: var(--sb-doc-accent);
        font-size: 14px;
    }

.sb-fromblock__muted {
    color: var(--sb-doc-muted);
}

.sb-fromblock__gap {
    height: 6px;
}

/* --- Password rules ------------------------------------------------------ */

.sb-rules {
    margin: 0;
    padding: 14px 16px;
    list-style: none;
    border: 1px solid var(--sb-border-light);
    border-radius: var(--sb-radius);
    background: var(--sb-surface-muted);
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: var(--sb-muted);
}

.sb-rules__title {
    font-weight: 600;
    color: var(--sb-text);
}

.sb-rules li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

/* A field with a button parked inside its right edge (show/hide a password). */
.sb-inputwrap {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
}

    .sb-inputwrap .sb-input {
        padding-right: 44px;
    }

.sb-reveal {
    position: absolute;
    right: 4px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: var(--sb-radius-sm);
    background: transparent;
    color: var(--sb-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

    .sb-reveal:hover {
        background: var(--sb-border-subtle);
        color: var(--sb-text);
    }

    .sb-reveal:focus-visible {
        outline: none;
        box-shadow: var(--sb-focus-ring);
    }

    /* Only one of the two icons shows at a time. */
    .sb-reveal .sb-reveal__on {
        display: none;
    }

    .sb-reveal[aria-pressed="true"] .sb-reveal__on {
        display: inline-block;
    }

    .sb-reveal[aria-pressed="true"] .sb-reveal__off {
        display: none;
    }

/* --- Upload area --------------------------------------------------------- */

.sb-drop {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 32px 20px;
    border: 1px dashed var(--sb-border-input);
    border-radius: var(--sb-radius-lg);
    background: var(--sb-surface-muted);
    text-align: center;
}

    .sb-drop:hover,
    .sb-drop:focus-within {
        border-color: var(--sb-primary);
        background: var(--sb-primary-soft);
    }

.sb-drop__icon {
    width: 44px;
    height: 44px;
    border-radius: var(--sb-radius-lg);
    background: var(--sb-navy);
    color: var(--sb-accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sb-drop__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--sb-navy);
}

.sb-drop__note {
    font-size: 13px;
    color: var(--sb-muted);
}

/* The real <InputFile> covers the area so the whole block is the control. */
.sb-drop input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* --- Counts shown as coloured pills -------------------------------------- */

.sb-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* --- Old value becoming a new one ---------------------------------------- */

.sb-changes {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
    min-width: 0;
}

.sb-change {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.sb-change__old {
    color: var(--sb-muted);
    text-decoration: line-through;
}

.sb-change__arrow {
    color: var(--sb-placeholder);
}

/* --- Centred message pages (access denied, lockout, error, not found) ---- */

.sb-note-card {
    width: 100%;
    max-width: 460px;
    box-sizing: border-box;
    background: var(--sb-surface);
    border-radius: var(--sb-radius-xl);
    box-shadow: var(--sb-shadow-pop);
    padding: 36px 36px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
}

.sb-note-card__icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--sb-primary-soft);
    color: var(--sb-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sb-note-card__icon--danger {
    background: var(--sb-danger-bg);
    color: var(--sb-danger);
}

.sb-note-card__icon--warn {
    background: var(--sb-warning-bg);
    color: var(--sb-warning);
}

.sb-note-card__title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--sb-navy);
}

.sb-note-card__text {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--sb-muted);
}

/* The same card used in the middle of a normal page, not on the navy field. */
.sb-note-card--inline {
    margin: 40px auto;
    border: 1px solid var(--sb-border);
    box-shadow: var(--sb-shadow-card);
}

.sb-code {
    padding: 2px 6px;
    border-radius: var(--sb-radius-sm);
    background: var(--sb-border-subtle);
    font-size: 12px;
    color: var(--sb-text-body);
    word-break: break-all;
}

/* --- Small screens -------------------------------------------------------- */

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

    .sb-preview-card {
        position: static;
    }

    .sb-note-card {
        padding: 28px 22px 24px;
    }
}

/* --- Auth (login) -------------------------------------------------------- */

.sb-auth {
    min-height: 100vh;
    background: var(--sb-navy);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

.sb-auth__watermark {
    position: absolute;
    right: -80px;
    bottom: -100px;
    height: 460px;
    width: auto;
    opacity: 0.06;
    pointer-events: none;
}

.sb-auth__card {
    position: relative;
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
    background: var(--sb-surface);
    border-radius: var(--sb-radius-xl);
    box-shadow: var(--sb-shadow-pop);
    padding: 36px 36px 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sb-auth__brand {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
}

    .sb-auth__brand img {
        height: 38px;
        width: auto;
    }

.sb-auth__title {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: var(--sb-navy);
}

.sb-auth__sub {
    margin: 0;
    font-size: 14px;
    color: var(--sb-muted);
}

.sb-auth__form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sb-auth__row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--sb-text-body);
}

.sb-checkbox {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--sb-primary);
    cursor: pointer;
}

.sb-auth__foot {
    margin: 0;
    font-size: 13px;
    color: var(--sb-muted-light);
    text-align: center;
}

.sb-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--sb-radius);
    font-size: 14px;
}

.sb-alert--danger {
    background: var(--sb-danger-bg);
    border: 1px solid var(--sb-danger-border);
    color: var(--sb-danger-strong);
}

.sb-alert--success {
    background: var(--sb-success-bg);
    border: 1px solid #ABEFC6;
    color: var(--sb-success);
}

.sb-alert--warning {
    background: var(--sb-warning-bg);
    border: 1px solid #FEDF89;
    color: var(--sb-warning);
}

.sb-alert--info {
    background: var(--sb-info-bg);
    border: 1px solid #B9E2F2;
    color: var(--sb-info);
}

.sb-alert ul {
    margin: 6px 0 0;
    padding-left: 18px;
}

/* StatusMessage still emits Bootstrap alert markup; give it the sb- look on
   the pages that have been redesigned, without touching the component. */
.sb-statusmessage .alert {
    margin: 0;
    padding: 12px 14px;
    border-radius: var(--sb-radius);
    font-size: 14px;
}

.sb-statusmessage .alert-danger {
    background: var(--sb-danger-bg);
    border: 1px solid var(--sb-danger-border);
    color: var(--sb-danger-strong);
}

.sb-statusmessage .alert-success {
    background: var(--sb-success-bg);
    border: 1px solid #ABEFC6;
    color: var(--sb-success);
}

@media (max-width: 480px) {
    .sb-auth__card {
        padding: 28px 22px 24px;
    }
}

/* The sign-in card borrows StatusMessage and ValidationSummary, which still
   emit Bootstrap markup; give them the sb- look without touching those files. */
.sb-auth__card .alert {
    margin: 0;
    padding: 12px 14px;
    border-radius: var(--sb-radius);
    font-size: 14px;
}

.sb-auth__card .alert-danger {
    background: var(--sb-danger-bg);
    border: 1px solid var(--sb-danger-border);
    color: var(--sb-danger-strong);
}

.sb-auth__card .alert-success {
    background: var(--sb-success-bg);
    border: 1px solid #ABEFC6;
    color: var(--sb-success);
}

.sb-error,
ul.sb-error {
    margin: 0;
    padding: 0;
    list-style: none;
}

    ul.sb-error:empty {
        display: none;
    }

/* The global .valid.modified outline is meant for the Bootstrap pages; inside
   the sign-in card the focus ring already says enough. */
.sb-auth__card .valid.modified:not([type=checkbox]) {
    outline: none;
}

.sb-auth__card .invalid {
    outline: none;
    border-color: var(--sb-danger);
}
