/* Workspace: authenticated admin and partner screens, plus the sign-in pages. */
.password-field {
    position: relative;
    display: block;
    width: 100%;
}
.password-field input {
    width: 100%;
    padding-right: 48px;
}
.password-toggle {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 42px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #526078;
    cursor: pointer;
}
.password-toggle:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -3px;
}
.password-toggle .password-eye-slash {
    display: none;
}
.password-toggle[aria-pressed='true'] .password-eye-slash {
    display: block;
}
:root {
    --sidebar-bg: #132034;
    --sidebar-hover: #1c2c44;
    --sidebar-active: #233651;
    --sidebar-text: #b3bfcf;
    --sidebar-muted: #71819a;
    --accent: #ed9567;

    --brand: #b94d27;
    --brand-hover: #9f401f;
    --brand-soft: #fbefe9;
    --brand-ring: rgba(185, 77, 39, 0.18);

    --ink: #152033;
    --ink-2: #3a4659;
    --muted: #667085;
    --faint: #8a94a6;
    --line: #e2e6ec;
    --line-soft: #edf0f4;
    --field-line: #d2d8e0;
    --bg: #f4f6f9;
    --surface: #fff;
    --surface-2: #f8fafc;

    --slate-fg: #475467;
    --slate-bg: #f0f2f6;
    --blue-fg: #1f5fbf;
    --blue-bg: #e9f1fd;
    --amber-fg: #9a5708;
    --amber-bg: #fdf3e1;
    --violet-fg: #6a45c2;
    --violet-bg: #f2eefc;
    --teal-fg: #0f7361;
    --teal-bg: #e4f5f0;
    --indigo-fg: #3e4ec2;
    --indigo-bg: #eceffd;
    --green-fg: #1d7447;
    --green-bg: #e6f5ec;
    --red-fg: #b3261e;
    --red-bg: #fdecea;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
    --shadow-md: 0 10px 28px rgba(16, 24, 40, 0.1);
    --sidebar-width: 252px;
    --content-width: 1600px;
    --font-body:
        'DM Sans', 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-display: Manrope, 'DM Sans', 'Segoe UI', system-ui, sans-serif;
    --mono: ui-monospace, 'Cascadia Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;

    /* One colour per project status, shared by badges, tab dots, and the pipeline bar. */
    --seg-submitted: #8391a7;
    --seg-scope_review: #3b7ddd;
    --seg-waiting_for_files: #e09a2c;
    --seg-quote_sent: #8a63d2;
    --seg-approved: #1a9b82;
    --seg-in_engineering: #5563d6;
    --seg-delivered: #2f9a61;
    --seg-on_hold: #d9463d;
}

/* Base */
*,
*::before,
*::after {
    box-sizing: border-box;
}
html {
    -webkit-text-size-adjust: 100%;
}
body {
    margin: 0;
    color: var(--ink);
    background: var(--bg);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
p {
    margin: 0;
}
a {
    color: inherit;
}
button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}
img {
    max-width: 100%;
}
.icon {
    flex-shrink: 0;
}
[hidden] {
    display: none !important;
}
:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}
.mono {
    font-family: var(--mono);
    font-size: 0.92em;
}
.muted {
    color: var(--muted);
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.skip-link {
    position: fixed;
    top: -80px;
    left: 16px;
    z-index: 100;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: #fff;
    box-shadow: var(--shadow-md);
    font-weight: 600;
}
.skip-link:focus {
    top: 12px;
}

/* Sidebar and page frame */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    padding: 22px 14px 14px;
    overflow-y: auto;
    background:
        radial-gradient(420px 260px at 0% 0%, rgba(237, 149, 103, 0.08), transparent 70%),
        linear-gradient(180deg, #152540 0%, var(--sidebar-bg) 45%, #0f1a2b 100%);
    color: var(--sidebar-text);
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 2px 10px 24px;
    color: #fff;
    text-decoration: none;
}
.brand-logo {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
}
.brand-logo span {
    color: var(--accent);
}
.brand-text strong,
.brand-text small {
    display: block;
}
.brand-text strong {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.18em;
}
.brand-text small {
    margin-top: 1px;
    color: var(--sidebar-muted);
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.sidebar-nav {
    display: grid;
    gap: 2px;
}
.nav-label {
    padding: 18px 12px 7px;
    overflow: hidden;
    color: var(--sidebar-muted);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}
.nav-label:first-child {
    padding-top: 0;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    transition:
        background 0.15s,
        color 0.15s;
}
.sidebar-nav a:hover {
    background: var(--sidebar-hover);
    color: #fff;
}
.sidebar-nav a[aria-current='page'] {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    box-shadow:
        inset 3px 0 0 var(--accent),
        inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.sidebar-nav a[aria-current='page'] .icon {
    color: var(--accent);
}
.nav-badge {
    min-width: 20px;
    margin-left: auto;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding: 14px 4px 2px 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar-user .avatar {
    background: #2a3e5c;
    color: #fff;
}
.sidebar-user-text {
    flex: 1;
    min-width: 0;
    text-decoration: none;
}
.sidebar-user-text strong,
.sidebar-user-text small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar-user-text strong {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}
.sidebar-user-text small {
    color: var(--sidebar-muted);
    font-size: 11.5px;
}
.sidebar .icon-button {
    color: var(--sidebar-text);
}
.sidebar .icon-button:hover {
    background: var(--sidebar-hover);
    color: #fff;
}
.mobile-bar,
.sidebar-scrim {
    display: none;
}
.main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin-left: var(--sidebar-width);
}
.content {
    flex: 1;
    width: 100%;
    max-width: calc(var(--content-width) + 80px);
    padding: 28px 40px 48px;
}
.content:focus {
    outline: none;
}
.footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    width: calc(100% - 80px);
    max-width: var(--content-width);
    margin: 0 40px;
    padding: 18px 0 24px;
    border-top: 1px solid var(--line);
    color: var(--faint);
    font-size: 12px;
}

/* Top bar */
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 60px;
    padding: 10px 40px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: saturate(1.4) blur(10px);
}
.crumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: var(--muted);
    font-size: 13.5px;
}
.crumbs a {
    color: var(--muted);
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}
.crumbs a:hover {
    color: var(--ink);
}
.crumbs .icon {
    color: #b6bdc8;
}
.crumbs span {
    overflow: hidden;
    color: var(--ink);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.topbar-search {
    position: relative;
    width: min(380px, 100%);
    margin-left: auto;
}
.topbar-search .icon {
    position: absolute;
    top: 50%;
    left: 12px;
    color: var(--faint);
    transform: translateY(-50%);
    pointer-events: none;
}
.topbar-search input {
    padding-right: 38px;
    padding-left: 36px;
    border-color: var(--line);
    background: var(--surface-2);
}
.topbar-search input:focus {
    background: #fff;
}
.topbar-search kbd {
    position: absolute;
    top: 50%;
    right: 10px;
    padding: 0 6px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: #fff;
    color: var(--faint);
    font-family: var(--mono);
    font-size: 11px;
    line-height: 18px;
    transform: translateY(-50%);
}
.topbar-search input:focus ~ kbd {
    display: none;
}

/* Page headings */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}
.eyebrow {
    margin-bottom: 6px;
    color: var(--brand);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.page-head h1 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.025em;
}
.title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
}
.page-description {
    max-width: 640px;
    margin-top: 6px;
    color: var(--muted);
}
.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    margin-bottom: 20px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--line-soft);
    box-shadow: var(--shadow-sm);
}
.summary-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 16px 20px;
    background: var(--surface);
}
.summary-item > div {
    min-width: 0;
}
.summary-item small,
.summary-item strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.summary-item small {
    color: var(--muted);
    font-size: 12.5px;
}
.summary-item strong {
    font-size: 14.5px;
    font-weight: 600;
}
.summary-icon {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--line-soft);
    color: var(--ink-2);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition:
        background 0.15s,
        border-color 0.15s,
        color 0.15s;
}
.btn-primary {
    background: var(--brand);
    color: #fff;
}
.btn-primary:hover {
    background: var(--brand-hover);
}
.btn-secondary {
    border-color: var(--line);
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
    border-color: #cbd2dc;
    background: var(--surface-2);
}
.btn-ghost {
    background: transparent;
    color: var(--ink-2);
}
.btn-ghost:hover {
    background: var(--line-soft);
}
.btn-sm {
    min-height: 30px;
    padding: 0 10px;
    border-radius: 7px;
    font-size: 12.5px;
}
.btn-block {
    width: 100%;
}
.btn.is-copied {
    border-color: #b9dfc9;
    color: var(--green-fg);
}
.icon-button {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}
.icon-button:hover {
    background: var(--line-soft);
    color: var(--ink);
}
.link-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--brand);
    font-weight: 600;
    cursor: pointer;
}

/* Cards */
.card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line-soft);
}
.card-header h2 {
    font-family: var(--font-display);
    font-size: 15.5px;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.card-header p {
    flex-basis: 100%;
    color: var(--muted);
    font-size: 13px;
}
.card-header .push {
    margin-left: auto;
}
.card-body {
    padding: 20px;
}
.card-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
    border-top: 1px solid var(--line-soft);
    color: var(--muted);
    font-size: 13px;
}
.card-accent {
    border-top: 3px solid var(--brand);
}
.count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--line-soft);
    color: var(--ink-2);
    font-size: 12px;
    font-weight: 600;
}
.count-amber {
    background: var(--amber-bg);
    color: var(--amber-fg);
}
.stack {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
}
.stack-lg {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 20px;
}
.divider {
    margin: 18px 0;
    border: 0;
    border-top: 1px solid var(--line-soft);
}

/* Metrics */
.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat {
    display: grid;
    gap: 4px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    transition:
        border-color 0.15s,
        box-shadow 0.15s,
        transform 0.15s;
}
.stat:hover {
    border-color: #cbd2dc;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.stat.is-active {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-ring);
}
.stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.stat-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
}
.stat-label {
    color: var(--muted);
    font-size: 13.5px;
    font-weight: 500;
}
.stat strong {
    display: block;
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}
.stat small {
    display: block;
    color: var(--faint);
    font-size: 12.5px;
}
.stat small.is-up {
    color: var(--green-fg);
    font-weight: 600;
}
.tone-slate {
    background: var(--slate-bg);
    color: var(--slate-fg);
}
.tone-amber {
    background: var(--amber-bg);
    color: var(--amber-fg);
}
.tone-indigo {
    background: var(--indigo-bg);
    color: var(--indigo-fg);
}
.tone-green {
    background: var(--green-bg);
    color: var(--green-fg);
}
.tone-brand {
    background: var(--brand-soft);
    color: var(--brand);
}

/* Toolbars, tabs, and search */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
}
.toolbar h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-size: 15.5px;
    font-weight: 700;
}
.toolbar .push {
    margin-left: auto;
}
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 4px 3px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-2);
    font-size: 12.5px;
    font-weight: 500;
}
.filter-chip a {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    color: var(--muted);
}
.filter-chip a:hover {
    background: var(--line);
    color: var(--ink);
}
.pipeline {
    display: flex;
    gap: 3px;
    height: 8px;
    margin: 0 20px 6px;
    overflow: hidden;
    border-radius: 999px;
}
.pipeline-seg {
    flex-basis: 0;
    min-width: 6px;
    border-radius: 2px;
}
.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}
.seg-submitted {
    background: var(--seg-submitted);
}
.seg-pending_partner_review {
    background: #d99824;
}
.seg-partner_approved {
    background: #2b9672;
}
.seg-scope_review {
    background: var(--seg-scope_review);
}
.seg-waiting_for_files {
    background: var(--seg-waiting_for_files);
}
.seg-quote_sent {
    background: var(--seg-quote_sent);
}
.seg-approved {
    background: var(--seg-approved);
}
.seg-in_engineering {
    background: var(--seg-in_engineering);
}
.seg-delivered {
    background: var(--seg-delivered);
}
.seg-on_hold {
    background: var(--seg-on_hold);
}
.tabs {
    display: flex;
    gap: 0;
    padding: 0 14px;
    overflow-x: auto;
    overflow-y: hidden;
    border-bottom: 1px solid var(--line-soft);
    scrollbar-width: thin;
}
.tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: -1px;
    padding: 11px 6px;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}
.tab:hover {
    color: var(--ink);
}
.tab.is-active {
    border-bottom-color: var(--brand);
    color: var(--ink);
    font-weight: 600;
}
.tab span {
    padding: 0 6px;
    border-radius: 999px;
    background: var(--line-soft);
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 600;
}
.tab.is-active span {
    background: var(--brand-soft);
    color: var(--brand);
}
.search {
    position: relative;
    width: min(320px, 100%);
    margin-left: auto;
}
.search .icon {
    position: absolute;
    top: 50%;
    left: 11px;
    color: var(--faint);
    transform: translateY(-50%);
    pointer-events: none;
}
.search input {
    padding-left: 36px;
}

/* Form controls (zero specificity so component rules can override) */
:where(input:not([type='checkbox']):not([type='radio']):not([type='color']):not([type='file'])),
:where(select, textarea) {
    width: 100%;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid var(--field-line);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--ink);
    font-size: 14px;
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
}
:where(textarea) {
    min-height: 84px;
    line-height: 1.5;
    resize: vertical;
}
:where(select) {
    padding-right: 34px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-position: right 10px center;
    background-repeat: no-repeat;
    background-size: 16px;
    appearance: none;
}
input:focus,
select:focus,
textarea:focus {
    border-color: var(--brand);
    outline: none;
    box-shadow: 0 0 0 3px var(--brand-ring);
}
input::placeholder,
textarea::placeholder {
    color: #9aa3b2;
}
input[type='file'] {
    width: 100%;
    padding: 6px;
    border: 1px dashed #c3cad5;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--muted);
    font-size: 13px;
}
input[type='file']::file-selector-button {
    margin-right: 10px;
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    font-weight: 600;
    cursor: pointer;
}
.field {
    display: grid;
    align-content: start;
    gap: 6px;
}
.field-label,
.field > span:first-child {
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 600;
}
.hint,
.field small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
}
.field-error {
    color: var(--red-fg);
    font-size: 12.5px;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 18px;
}
.span-2 {
    grid-column: 1 / -1;
}
.input-group {
    display: flex;
    align-items: stretch;
    overflow: hidden;
    border: 1px solid var(--field-line);
    border-radius: var(--radius-sm);
    background: #fff;
}
.input-group:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-ring);
}
.input-group > span {
    display: flex;
    align-items: center;
    max-width: 60%;
    padding: 0 10px;
    overflow: hidden;
    border-right: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--muted);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.input-group input:not([type='checkbox']) {
    min-width: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    cursor: pointer;
}
.checkbox input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--brand);
}
.switch {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
}
.switch input {
    position: relative;
    flex-shrink: 0;
    width: 38px;
    height: 22px;
    margin: 1px 0 0;
    border-radius: 999px;
    background: #cdd3dc;
    cursor: pointer;
    transition: background 0.15s;
    appearance: none;
}
.switch input::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: transform 0.15s;
}
.switch input:checked {
    background: var(--brand);
}
.switch input:checked::after {
    transform: translateX(16px);
}
.switch strong,
.switch small {
    display: block;
}
.switch strong {
    font-size: 13.5px;
    font-weight: 600;
}
.switch small {
    color: var(--muted);
    font-size: 12.5px;
}
.choice-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.choice-card {
    display: flex;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
}
.choice-card:has(input:checked) {
    border-color: var(--brand);
    background: #fffaf7;
    box-shadow: 0 0 0 3px var(--brand-ring);
}
.choice-card input {
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    accent-color: var(--brand);
}
.choice-card strong,
.choice-card small {
    display: block;
}
.choice-card strong {
    font-size: 13.5px;
}
.choice-card small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12.5px;
}
.segmented {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    border-radius: var(--radius-sm);
    background: var(--line-soft);
}
.segmented label {
    position: relative;
    cursor: pointer;
}
.segmented input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.segmented span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 6px;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 600;
}
.segmented input:checked + span {
    background: #fff;
    color: var(--ink);
    box-shadow: var(--shadow-sm);
}
.segmented input[value='internal']:checked + span {
    color: var(--amber-fg);
}
.segmented input:focus-visible + span {
    outline: 2px solid var(--brand);
    outline-offset: 1px;
}
.form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    align-items: start;
    gap: 20px;
}
.form-aside {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 20px;
}
.readonly-value {
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 12px;
    overflow: hidden;
    border: 1px dashed var(--field-line);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--ink-2);
    text-overflow: ellipsis;
    white-space: nowrap;
}
.member-list {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.member-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}
.member-text {
    flex: 1;
    min-width: 0;
    text-decoration: none;
}
.member-text strong,
.member-text small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.member-text strong {
    font-size: 13.5px;
    font-weight: 600;
}
.member-text small {
    color: var(--muted);
    font-size: 12.5px;
}
.member-text:hover strong {
    color: var(--brand);
}
.checklist {
    display: grid;
    gap: 2px;
    margin: 0;
    padding: 12px 20px 16px;
    list-style: none;
}
.checklist li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
    color: var(--muted);
    font-size: 13.5px;
}
.checklist li.is-done {
    color: var(--ink);
}
.check-dot {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 18px;
    height: 18px;
    border: 2px solid var(--field-line);
    border-radius: 50%;
}
.checklist li.is-done .check-dot {
    border-color: var(--green-fg);
    background: var(--green-fg);
    color: #fff;
}
.request-upload {
    display: grid;
    gap: 8px;
}
.request-item .link-button {
    font-size: 12.5px;
}
.request-item form + form {
    margin-top: 6px;
}
.alert .push {
    margin-left: auto;
}
.segmented-links {
    display: inline-flex;
}
.segmented-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 6px;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.segmented-links a[aria-current='true'] {
    background: #fff;
    color: var(--ink);
    box-shadow: var(--shadow-sm);
}
.segmented-links span {
    padding: 0 6px;
    border-radius: 999px;
    background: var(--line);
    font-size: 11.5px;
}
.tab-muted {
    margin-left: auto;
}
.row-count {
    position: relative;
    z-index: 1;
    color: var(--ink);
    font-weight: 600;
    text-decoration-color: #c9ced6;
    text-underline-offset: 3px;
}
.row-count:hover {
    color: var(--brand);
}
a.chip {
    text-decoration: none;
}
.form-narrow {
    max-width: 860px;
}
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.color-field {
    display: flex;
    align-items: center;
    gap: 10px;
}
.color-field input[type='color'] {
    width: 46px;
    height: 38px;
    padding: 3px;
    border: 1px solid var(--field-line);
    border-radius: var(--radius-sm);
    background: #fff;
    cursor: pointer;
}
.logo-field {
    display: flex;
    align-items: center;
    gap: 14px;
}
.logo-preview {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 64px;
    height: 64px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--faint);
}
.logo-preview img {
    max-height: 100%;
    object-fit: contain;
}

/* Alerts */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    padding: 12px 14px;
    border: 1px solid;
    border-radius: 10px;
    font-size: 13.5px;
}
.alert .icon {
    margin-top: 1px;
}
.alert ul {
    margin: 6px 0 0;
    padding-left: 18px;
}
.alert p {
    margin-top: 2px;
}
.alert-success {
    border-color: #bfe3cd;
    background: #ecf8f1;
    color: #17603b;
}
.alert-error {
    border-color: #f3c6c2;
    background: #fdf0ef;
    color: #9b2119;
}
.alert-warning {
    border-color: #f1dcac;
    background: #fdf7e8;
    color: #7f4b08;
}

/* Tables */
.table-wrap {
    overflow-x: auto;
}
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
.table th {
    padding: 10px 16px;
    border-bottom: 1px solid var(--line-soft);
    background: var(--surface-2);
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}
.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: middle;
}
.table th:first-child,
.table td:first-child {
    padding-left: 20px;
}
.table th:last-child,
.table td:last-child {
    padding-right: 20px;
}
.table tbody tr:last-child td {
    border-bottom: 0;
}
.table tbody tr {
    transition: background 0.1s;
}
.table tbody tr:hover {
    background: #fafbfc;
}
.table td small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 12.5px;
}
.table .num,
.table .mono {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.table .actions-cell {
    text-align: right;
    white-space: nowrap;
}
.row-link {
    position: relative;
}
.row-title {
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
}
.row-link .row-title::after {
    content: '';
    position: absolute;
    inset: 0;
}
.row-link:hover .row-title {
    color: var(--brand);
}
.identity {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
}
.identity strong {
    display: block;
    font-weight: 600;
}
.person {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.avatar {
    display: inline-grid;
    flex-shrink: 0;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #e7ebf2;
    color: #3b4a63;
    font-size: 13px;
    font-weight: 600;
}
.avatar-sm {
    width: 28px;
    height: 28px;
    font-size: 12px;
}
.avatar-xs {
    width: 22px;
    height: 22px;
    font-size: 10.5px;
}
.avatar-lg {
    width: 64px;
    height: 64px;
    font-size: 24px;
}
.avatar-brand {
    background: var(--brand-soft);
    color: var(--brand);
}
.company-tile {
    display: inline-grid;
    flex-shrink: 0;
    place-items: center;
    width: 38px;
    height: 38px;
    overflow: hidden;
    border-radius: 9px;
    background: var(--swatch, #64748b);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}
.company-tile.has-logo {
    padding: 4px;
    border: 1px solid var(--line);
    background: #fff;
}
.company-tile img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.inline-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.company-tile-sm {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    font-size: 9.5px;
}
.chevron-cell {
    width: 36px;
    color: #c3c9d2;
    text-align: right;
}
.row-link:hover .chevron-cell {
    color: var(--brand);
}

/* Dashboard */
.dashboard {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    align-items: start;
    gap: 20px;
}
.rail {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
}
.rail-list,
.feed {
    margin: 0;
    padding: 8px;
    list-style: none;
}
.rail-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
}
a.rail-item:hover {
    background: var(--surface-2);
}
.rail-icon {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
}
.rail-text {
    min-width: 0;
}
.rail-text strong,
.rail-text small {
    display: block;
}
.rail-text strong {
    overflow: hidden;
    font-size: 13.5px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rail-text small {
    color: var(--muted);
    font-size: 12.5px;
}
.feed {
    padding: 14px 20px 18px;
}
.feed li {
    position: relative;
    display: flex;
    gap: 12px;
    padding-bottom: 14px;
}
.feed li:last-child {
    padding-bottom: 0;
}
.feed li::before {
    content: '';
    position: absolute;
    top: 14px;
    bottom: -2px;
    left: 4px;
    width: 1px;
    background: var(--line);
}
.feed li:last-child::before {
    display: none;
}
.feed-dot {
    position: relative;
    flex-shrink: 0;
    width: 9px;
    height: 9px;
    margin-top: 6px;
    border: 2px solid var(--brand);
    border-radius: 50%;
    background: #fff;
}
.feed strong {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
}
.feed small {
    display: block;
    color: var(--faint);
    font-size: 12.5px;
}
.feed small a {
    color: var(--ink-2);
    font-weight: 500;
    text-decoration: none;
}
.feed small a:hover {
    color: var(--brand);
    text-decoration: underline;
}

/* Status badges and chips */
.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px 3px 8px;
    border-radius: 999px;
    background: var(--slate-bg);
    color: var(--slate-fg);
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
}
.status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}
.status-lg {
    padding: 5px 12px 5px 10px;
    font-size: 13.5px;
}
.status-scope_review {
    background: var(--blue-bg);
    color: var(--blue-fg);
}
.status-waiting_for_files {
    background: var(--amber-bg);
    color: var(--amber-fg);
}
.status-quote_sent {
    background: var(--violet-bg);
    color: var(--violet-fg);
}
.status-approved {
    background: var(--teal-bg);
    color: var(--teal-fg);
}
.status-in_engineering {
    background: var(--indigo-bg);
    color: var(--indigo-fg);
}
.status-delivered,
.state-active {
    background: var(--green-bg);
    color: var(--green-fg);
}
.status-on_hold {
    background: var(--red-bg);
    color: var(--red-fg);
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--slate-bg);
    color: var(--slate-fg);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.chip-amber {
    background: var(--amber-bg);
    color: var(--amber-fg);
}
.chip-green {
    background: var(--green-bg);
    color: var(--green-fg);
}
.chip-brand {
    background: var(--brand-soft);
    color: var(--brand);
}
.chip-navy {
    background: #e5eaf2;
    color: #22324a;
}

/* Project progress */
.progress-scroll {
    margin-bottom: 20px;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.progress-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(125px, 1fr);
    min-width: 620px;
    margin: 0;
    padding: 24px 16px;
    list-style: none;
}
.progress-track li {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--faint);
    font-size: 12.5px;
    text-align: center;
}
.progress-track li > span:last-child {
    max-width: 145px;
    padding-inline: 6px;
    line-height: 1.5;
}
.progress-track li::before {
    content: '';
    position: absolute;
    top: 13px;
    right: calc(50% + 18px);
    left: calc(-50% + 18px);
    height: 2px;
    border-radius: 2px;
    background: var(--line);
}
.progress-track li:first-child::before {
    display: none;
}
.progress-dot {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 2px solid var(--line);
    border-radius: 50%;
    background: #fff;
    color: var(--faint);
    font-size: 12px;
    font-weight: 700;
}
.progress-track li.is-done,
.progress-track li.is-current {
    color: var(--ink-2);
}
.progress-track li.is-done::before,
.progress-track li.is-current::before {
    background: var(--brand);
}
.progress-track li.is-done .progress-dot {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}
.progress-track li.is-current {
    color: var(--ink);
    font-weight: 600;
}
.progress-track li.is-current .progress-dot {
    border-color: var(--brand);
    color: var(--brand);
    box-shadow: 0 0 0 4px var(--brand-ring);
}
.progress-track.is-paused li.is-current .progress-dot {
    border-color: var(--amber-fg);
    color: var(--amber-fg);
    box-shadow: 0 0 0 4px rgba(154, 87, 8, 0.15);
}

/* Project detail */
.project-review-notice {
    margin-bottom: 20px;
    border-left: 4px solid var(--brand);
    background: #fffaf6;
}
.project-review-notice h2 {
    font-size: 18px;
    line-height: 1.4;
}
.project-review-notice .eyebrow {
    margin: 0;
}
.project-review-notice p:not(.eyebrow) {
    color: var(--muted);
    line-height: 1.6;
}
.project-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: start;
    gap: 20px;
}
.detail-sections {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 32px;
}
.section-title {
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.detail-list {
    display: grid;
    gap: 8px;
    margin: 0;
}
.detail-list div {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 12px;
}
.detail-list dt {
    color: var(--muted);
    font-size: 13px;
}
.detail-list dd {
    margin: 0;
    font-weight: 500;
    overflow-wrap: anywhere;
}
.detail-list a {
    text-decoration-color: #c9ced6;
    text-underline-offset: 2px;
}
.detail-list a:hover {
    color: var(--brand);
}
.notes {
    margin-top: 22px;
    padding: 14px 16px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: var(--surface-2);
}
.notes p {
    color: var(--ink-2);
    white-space: pre-line;
    overflow-wrap: anywhere;
}
.thread {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
.bubble {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}
.bubble.is-mine {
    background: var(--surface-2);
}
.bubble.is-internal {
    border-color: #f0ddb4;
    background: #fffaf0;
}
.bubble header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 13px;
}
.bubble time {
    margin-left: auto;
    color: var(--faint);
    font-size: 12px;
}
.bubble p {
    color: var(--ink-2);
    white-space: pre-line;
    overflow-wrap: anywhere;
}
.composer {
    border: 1px solid var(--field-line);
    border-radius: 10px;
    background: #fff;
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
}
.composer:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-ring);
}
.composer textarea,
.composer textarea:focus {
    border: 0;
    border-radius: 10px 10px 0 0;
    box-shadow: none;
}
.composer-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-top: 1px solid var(--line-soft);
    border-radius: 0 0 10px 10px;
    background: var(--surface-2);
}
.composer-actions .btn {
    margin-left: auto;
}
.timeline {
    margin: 0;
    padding: 0;
    list-style: none;
}
.timeline li {
    position: relative;
    display: flex;
    gap: 14px;
    padding-bottom: 18px;
}
.timeline li:last-child {
    padding-bottom: 0;
}
.timeline li::before {
    content: '';
    position: absolute;
    top: 18px;
    bottom: 0;
    left: 5px;
    width: 2px;
    background: var(--line-soft);
}
.timeline li:last-child::before {
    display: none;
}
.timeline-dot {
    position: relative;
    flex-shrink: 0;
    width: 12px;
    height: 12px;
    margin-top: 4px;
    border: 3px solid var(--brand);
    border-radius: 50%;
    background: #fff;
}
.timeline strong {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
}
.timeline p {
    margin-top: 2px;
    color: var(--ink-2);
    font-size: 13px;
    overflow-wrap: anywhere;
}
.timeline small {
    display: block;
    margin-top: 2px;
    color: var(--faint);
    font-size: 12px;
}
.file-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.file {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    text-decoration: none;
    transition:
        border-color 0.15s,
        background 0.15s;
}
.file:hover {
    border-color: #cbd2dc;
    background: var(--surface-2);
}
.file-icon {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 36px;
    height: 42px;
    border-radius: 6px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.file-text {
    flex: 1;
    min-width: 0;
}
.file-text strong,
.file-text small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-text strong {
    font-size: 13.5px;
    font-weight: 600;
}
.file-text small {
    color: var(--muted);
    font-size: 12px;
}
.file-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}
.file > .icon {
    color: var(--faint);
}
.file:hover > .icon {
    color: var(--brand);
}
.request-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
}
.request-item {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
}
.request-item.is-open {
    border-color: #f0ddb4;
    background: #fffcf4;
}
.request-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.request-top strong {
    font-size: 13.5px;
}
.request-item p {
    margin-top: 4px;
    color: var(--ink-2);
    font-size: 13px;
    overflow-wrap: anywhere;
}
.request-item small {
    display: block;
    margin-top: 6px;
    color: var(--faint);
    font-size: 12px;
}
.request-item form {
    margin-top: 10px;
}
.disclosure {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line-soft);
}
.disclosure summary {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--brand);
    font-size: 13.5px;
    font-weight: 600;
    list-style: none;
    cursor: pointer;
}
.disclosure summary::-webkit-details-marker {
    display: none;
}
.disclosure summary .icon {
    transition: transform 0.15s;
}
.disclosure[open] summary {
    margin-bottom: 14px;
}
.disclosure[open] summary .icon {
    transform: rotate(45deg);
}

/* Empty states and pagination */
.empty {
    padding: 48px 24px;
    text-align: center;
}
.empty-icon {
    display: inline-grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    border-radius: 12px;
    background: var(--line-soft);
    color: var(--muted);
}
.empty h3 {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 650;
}
.empty p {
    max-width: 380px;
    margin: 4px auto 16px;
    color: var(--muted);
}
.empty-inline {
    padding: 4px 0;
    color: var(--muted);
    font-size: 13.5px;
}
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.pagination li > * {
    display: grid;
    place-items: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}
.pagination a:hover {
    background: var(--surface-2);
}
.pagination .active span {
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
}
.pagination .disabled span {
    color: #c0c6cf;
}

/* Partner portal preview and embed code */
.portal-preview {
    --preview-brand: #315efb;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 10px;
}
.portal-preview-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line-soft);
    background: #fff;
    font-size: 13px;
    font-weight: 700;
}
.portal-preview-bar img {
    width: auto;
    max-width: 120px;
    height: 24px;
    object-fit: contain;
}
.portal-preview-hero {
    padding: 18px 16px 20px;
    background: linear-gradient(130deg, #070d19 0%, #0c1730 55%, #121f42 100%);
    color: #fff;
}
.portal-preview-hero small {
    display: block;
    margin-bottom: 6px;
    color: #9fb0c8;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.portal-preview-hero strong {
    display: block;
    font-size: 15px;
    line-height: 1.3;
}
.portal-preview-hero p {
    display: -webkit-box;
    margin-top: 6px;
    overflow: hidden;
    color: #c7d2e0;
    font-size: 12px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}
.portal-preview-button {
    display: inline-block;
    margin-top: 12px;
    padding: 6px 12px;
    border-radius: 6px;
    background: var(--preview-brand);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}
.code-block {
    display: block;
    margin: 6px 0 8px;
    padding: 10px 12px;
    overflow-x: auto;
    border-radius: var(--radius-sm);
    background: #0f1a2b;
    color: #d7e0ee;
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Account */
.account-grid {
    display: grid;
    grid-template-columns: 320px minmax(0, 560px);
    align-items: start;
    gap: 20px;
}
.profile-card {
    padding: 28px 20px 20px;
    text-align: center;
}
.profile-card h2 {
    font-family: var(--font-display);
    margin-top: 12px;
    font-size: 17px;
}
.profile-card > p {
    color: var(--muted);
}
.profile-card .detail-list {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line-soft);
    text-align: left;
}
.profile-card .detail-list div {
    grid-template-columns: 80px minmax(0, 1fr);
}

/* Sign-in pages */
.auth {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 32px 16px;
    background:
        radial-gradient(900px 520px at 85% -10%, rgba(237, 149, 103, 0.16), transparent 60%),
        radial-gradient(900px 600px at 0% 110%, #1e3456 0%, transparent 60%), var(--sidebar-bg);
}
.auth-shell {
    width: min(420px, 100%);
}
.auth-card {
    padding: 36px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(4, 10, 20, 0.35);
}
.auth-card .sidebar-brand {
    padding: 0 0 28px;
    color: var(--ink);
}
.auth-card .brand-text small {
    color: var(--muted);
}
.auth-card h1 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.auth-card .lead {
    margin: 6px 0 22px;
    color: var(--muted);
}
.auth-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.auth-row a {
    color: var(--brand);
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
}
.auth-row a:hover {
    text-decoration: underline;
}
.auth-footer {
    margin-top: 18px;
    color: #8394ad;
    font-size: 12px;
    text-align: center;
}

/* Responsive */
@media (max-width: 1560px) {
    .dashboard {
        grid-template-columns: minmax(0, 1fr);
    }
    .rail {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }
}
@media (max-width: 1280px) {
    .col-lg {
        display: none;
    }
}
@media (max-width: 1180px) {
    .project-layout,
    .form-layout {
        grid-template-columns: minmax(0, 1fr);
    }
    .summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .col-md {
        display: none;
    }
}
@media (max-width: 1100px) {
    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 960px) {
    .mobile-bar {
        position: sticky;
        top: 0;
        z-index: 30;
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 58px;
        padding: 0 10px 0 16px;
        background: var(--sidebar-bg);
        color: #fff;
    }
    .mobile-bar .sidebar-brand {
        padding: 0;
    }
    .mobile-bar .brand-logo {
        font-size: 26px;
    }
    .mobile-bar .icon-button {
        width: 40px;
        height: 40px;
        color: #fff;
    }
    .mobile-bar .icon-button:hover {
        background: var(--sidebar-hover);
    }
    .sidebar {
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }
    .nav-open .sidebar {
        transform: none;
        box-shadow: var(--shadow-md);
    }
    .nav-open .sidebar-scrim {
        position: fixed;
        inset: 0;
        z-index: 35;
        display: block;
        background: rgba(8, 14, 24, 0.45);
    }
    .main {
        margin-left: 0;
    }
    .topbar {
        position: static;
        padding: 10px 16px;
    }
    .crumbs {
        display: none;
    }
    .topbar-search {
        width: auto;
        flex: 1;
    }
    .topbar-search kbd {
        display: none;
    }
    .content {
        padding: 24px 16px 36px;
    }
    .footer {
        width: calc(100% - 32px);
        margin: 0 16px;
    }
    .account-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}
@media (max-width: 640px) {
    .page-head {
        flex-direction: column;
        align-items: stretch;
    }
    .page-head h1 {
        font-size: 23px;
    }
    .stats {
        gap: 10px;
    }
    .stat {
        padding: 14px;
    }
    .stat-icon {
        width: 30px;
        height: 30px;
    }
    .stat strong {
        font-size: 26px;
    }
    .stat small {
        display: none;
    }
    .rail,
    .summary {
        grid-template-columns: minmax(0, 1fr);
    }
    .search {
        width: 100%;
    }
    .form-grid,
    .choice-cards,
    .detail-sections {
        grid-template-columns: minmax(0, 1fr);
    }
    .detail-list div {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }
    .col-sm {
        display: none;
    }
    .card-header,
    .card-body,
    .toolbar {
        padding-inline: 16px;
    }
    .table th:first-child,
    .table td:first-child {
        padding-left: 16px;
    }
    .table th:last-child,
    .table td:last-child {
        padding-right: 16px;
    }
    .form-actions .btn {
        flex: 1;
    }
    .footer {
        flex-direction: column;
        gap: 4px;
    }
    .auth-card {
        padding: 26px 22px;
    }
}
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
    }
}
