/* ==========================================================================
   Blazor Components Custom Styles
   ========================================================================== */

/* QuickGrid Component Styles
   ========================================================================== */

/* QuickGrid Container */
.quickgrid {
    width: 100%;
    border-collapse: collapse;
}

/* Remove default button styling from column headers */
.quickgrid thead th button,
.quickgrid th button.col-sort-button {
    all: unset;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 13px;
    color: #333;
    background-color: #f8f8f8;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease-in-out;
    user-select: none;
}

/* Header cell styling */
.quickgrid thead th {
    padding: 0;
    background-color: #f8f8f8;
    border-bottom: 2px solid #ddd;
    position: relative;
}

/* Hover effect on sortable columns */
.quickgrid thead th button:hover {
    background-color: #e8e8e8;
}

/* Active sort column */
.quickgrid thead th[aria-sort="ascending"] button,
.quickgrid thead th[aria-sort="descending"] button {
    background-color: #2196f3;
    color: #fff;
    font-weight: 700;
}

.quickgrid thead th[aria-sort="ascending"] button:hover,
.quickgrid thead th[aria-sort="descending"] button:hover {
    background-color: #0c7cd5;
}

/* Sort direction arrows */
.quickgrid thead th button::after {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 8px;
    opacity: 0.3;
    transition: opacity 0.2s ease-in-out;
}

/* Default arrow (unsorted) - up/down combined indicator */
.quickgrid thead th button::after {
    content: "⇅";
    width: auto;
    height: auto;
    font-size: 14px;
    border: none;
}

/* Ascending arrow */
.quickgrid thead th[aria-sort="ascending"] button::after {
    content: "";
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 6px solid currentColor;
    opacity: 1;
}

/* Descending arrow */
.quickgrid thead th[aria-sort="descending"] button::after {
    content: "";
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid currentColor;
    opacity: 1;
}

/* Show arrow on hover for unsorted columns */
.quickgrid thead th:not([aria-sort]) button:hover::after {
    opacity: 0.6;
}

/* Non-sortable column headers (no button) */
.quickgrid thead th:not(:has(button)) {
    padding: 12px 20px;
    font-weight: 600;
    font-size: 13px;
    color: #333;
    background-color: #f8f8f8;
}

/* Body cells */
.quickgrid tbody td {
    padding: 12px 20px;
    border-top: 1px solid #ddd;
    vertical-align: middle;
}

/* Striped rows */
.quickgrid tbody tr:nth-of-type(odd) {
    background-color: #fcfcfc;
}

/* Hover effect on rows */
.quickgrid tbody tr:hover {
    background-color: #f0f0f0;
}

/* Column Options (Filter inputs) */
.quickgrid .col-options {
    padding: 8px;
    background-color: #fff;
}

.quickgrid .col-options .search-box input {
    width: 100%;
    padding: 6px 11px;
    font-size: 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

/* Responsive table */
@media (max-width: 768px) {
    .quickgrid thead th button,
    .quickgrid thead th:not(:has(button)),
    .quickgrid tbody td {
        padding: 8px 12px;
        font-size: 12px;
    }

    .quickgrid thead th button::after {
        margin-left: 4px;
    }
}

/* Text alignment utilities for QuickGrid */
.quickgrid .text-center {
    text-align: center;
}

.quickgrid .text-right {
    text-align: right;
}

/* PagingGrid footer */
.paging-grid-footer {
    gap: 0.5rem;
}

.paging-grid-page-size {
    width: auto;
}

.paging-grid-controls .btn[disabled] {
    opacity: 0.4;
    cursor: default;
}

@media (max-width: 576px) {
    .paging-grid-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .paging-grid-controls {
        justify-content: center;
        margin-top: 0.5rem;
    }
}

/* ==========================================================================
   Additional Blazor Component Styles
   ========================================================================== */

/* Blazor loading indicator */
.blazor-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

/* Blazor error boundary */
.blazor-error-boundary {
    background-color: #fbe9e7;
    border: 1px solid #f44336;
    border-radius: 3px;
    padding: 20px;
    margin: 20px 0;
}

.blazor-error-boundary h3 {
    color: #d84315;
    margin-top: 0;
}

/* TX Stepper — custom Blazor stepper (Components/Form/Stepper.razor)
   ==========================================================================
   Mirrors vue-form-wizard's circle shape used by the legacy MVC view at
   Views/CompaniesHouseSubmissions/Create.cshtml. */
.tx-stepper-nav {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    position: relative;
    padding: 10px 20px 30px;
}

.tx-stepper-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    z-index: 2;
    cursor: pointer;
}

.tx-stepper-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #ccc;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background 0.3s;
    position: relative;
    z-index: 2;
}

.tx-stepper-step.active .tx-stepper-circle,
.tx-stepper-step.completed .tx-stepper-circle {
    background: #2196f3;
}

.tx-stepper-title {
    margin-top: 10px;
    font-size: 13px;
    color: #666;
    font-weight: 500;
    text-align: center;
}

.tx-stepper-step.active .tx-stepper-title {
    color: #2196f3;
    font-weight: 600;
}

/* Connector line via ::before on each step except the first; fills when this
   step is active or already completed (i.e. the user has reached it). */
.tx-stepper-step::before {
    content: "";
    position: absolute;
    top: 24px;
    left: -50%;
    width: 100%;
    height: 2px;
    background: #ccc;
    z-index: 1;
}

.tx-stepper-step:first-child::before {
    display: none;
}

.tx-stepper-step.active::before,
.tx-stepper-step.completed::before {
    background: #2196f3;
}

.tx-stepper-content {
    padding: 1rem 1.5rem;
}

/* Companies House — Review Document step
   The iframe needs to fill the full width of the card-body, escaping
   MudStep's internal padding so the document is readable. */
.ch-review-step {
    display: flex;
    flex-direction: column;
}

.ch-review-options {
    margin-bottom: 1rem;
}

.ch-review-iframe-wrap {
    position: relative;
}

.ch-review-iframe {
    display: block;
    width: 100%;
    height: 75vh;
    min-height: 600px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #fff;
}

/* Companies House — Verification step
   Each confirmation is one flex row: an enlarged checkbox tight against its
   question, with any action button (e.g. upload) immediately alongside. */
.ch-verify-item {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.25rem;
    padding: .875rem .25rem;
}

.ch-verify-item + .ch-verify-item {
    border-top: 1px solid #eee;
}

.ch-verify-item .form-check {
    display: flex;
    align-items: center;
    gap: .625rem;
    padding-left: 0;
    margin-bottom: 0;
}

.ch-verify-check {
    position: static;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    margin: 0;
    cursor: pointer;
    accent-color: #2196f3;
}

.ch-verify-item .form-check-label {
    margin-bottom: 0;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

/* Companies House — stepper action bar
   Sits at the bottom of card-body, spans full width so Previous lives on the
   far-left edge and Next on the far-right. */
.ch-stepper-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.5rem -1.25rem -1.25rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #ddd;
    background: #fafafa;
}

.ch-stepper-actions .btn {
    min-width: 120px;
}

/* ==========================================================================
   Capital Assets — General tab. Tokens and layout per Spec/AssetsGeneralTab.md.
   ========================================================================== */

.assets-general {
    --primary: #2196F3;
    --primary-strong: #1976D2;
    --blue-tint: #EAF4FE;
    --teal-800: #006772;
    --teal-tint: #E6F3F4;
    --success: #1E9E6B;
    --success-tint: #E6F6EE;
    --ink-0: #FFFFFF;
    --ink-50: #F6F8FB;
    --ink-100: #EDF1F6;
    --ink-200: #DCE3ED;
    --ink-300: #BFC9D6;
    --ink-400: #8A95A4;
    --ink-500: #5B6675;
    --ink-700: #2E3744;
    --ink-900: #0F1622;
    --danger: #D64545;

    --shadow-sticky: 6px 0 12px -10px rgba(15, 22, 34, .18);
    --shadow-focus: 0 0 0 3px rgba(33, 150, 243, .18);

    --motion: 150ms ease;

    color: var(--ink-900);
    font-variant-numeric: tabular-nums;
}

.assets-general .sub-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 22px;
    background: var(--ink-0);
    border-bottom: 1px solid var(--ink-100);
}

.assets-general .sub-header .left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.assets-general .sub-header .label {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ink-400);
}

.assets-general .sub-header .right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.assets-general .sub-header .right .rule {
    width: 1px;
    height: 18px;
    background: var(--ink-200);
    margin: 0 6px;
}

.assets-general .link-btn {
    background: transparent;
    border: 0;
    padding: 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--primary-strong);
    cursor: pointer;
    transition: background var(--motion), color var(--motion);
}

.assets-general .link-btn:hover { background: var(--blue-tint); }

.assets-general .chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.assets-general .chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px 7px 9px;
    border-radius: 999px;
    background: var(--ink-0);
    border: 1px solid var(--ink-200);
    color: var(--ink-500);
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.005em;
    cursor: pointer;
    transition: background var(--motion), border-color var(--motion), color var(--motion);
}

.assets-general .chip[disabled] { cursor: default; }

.assets-general .chip .swatch {
    width: 9px;
    height: 9px;
    border-radius: 3px;
    background: var(--ink-300);
    transition: background var(--motion);
}

.assets-general .chip:not(.is-on):not([disabled]):hover {
    border-color: var(--primary);
    color: var(--primary-strong);
}

.assets-general .chip .lock {
    margin-left: 4px;
    color: var(--ink-400);
    font-size: 11px;
}

.assets-general .chip.is-on.tone-blue {
    background: var(--blue-tint);
    border-color: rgba(33, 150, 243, .4);
    color: var(--primary-strong);
}
.assets-general .chip.is-on.tone-blue .swatch { background: var(--primary); }

.assets-general .chip.is-on.tone-teal {
    background: var(--teal-tint);
    border-color: rgba(0, 103, 114, .25);
    color: var(--teal-800);
}
.assets-general .chip.is-on.tone-teal .swatch { background: var(--teal-800); }

.assets-general .chip.is-on.tone-mint {
    background: var(--success-tint);
    border-color: rgba(30, 158, 107, .3);
    color: var(--success);
}
.assets-general .chip.is-on.tone-mint .swatch { background: var(--success); }

.assets-general .chip.is-on.tone-grey {
    background: var(--ink-50);
    border-color: var(--ink-200);
    color: var(--ink-700);
}
.assets-general .chip.is-on.tone-grey .swatch { background: var(--ink-500); }

.assets-general .chip.is-on.tone-amber {
    background: #FFF4E5;
    border-color: rgba(221, 154, 46, .4);
    color: #B7791F;
}
.assets-general .chip.is-on.tone-amber .swatch { background: #DD9A2E; }
.assets-general .chip.tone-amber .swatch { background: var(--ink-300); }

.assets-general .matrix-wrap { overflow: auto; }

.assets-general .matrix {
    display: grid;
    grid-template-columns: 220px repeat(var(--cols, 1), minmax(130px, 1fr)) 150px;
    min-width: 100%;
}

.assets-general .matrix .cell {
    display: flex;
    align-items: center;
    background: var(--ink-0);
    border-right: 1px solid var(--ink-100);
    border-bottom: 1px solid var(--ink-100);
}

.assets-general .matrix .cell.last-col {
    border-right: 0;
    border-left: 1px solid var(--ink-200);
}

.assets-general .matrix .cell.right { justify-content: flex-end; }

.assets-general .matrix .cell.label-col {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--ink-0);
    border-right: 1px solid var(--ink-200);
    box-shadow: var(--shadow-sticky);
}

.assets-general .matrix .header-label {
    padding: 14px;
    min-height: 64px;
    align-items: flex-end;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ink-400);
    border-bottom: 1px solid var(--ink-200);
}

.assets-general .matrix .header-pool {
    background: var(--ink-50);
    border-bottom: 1px solid var(--ink-200);
    min-height: 64px;
    padding: 14px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
}

.assets-general .matrix .header-pool .meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-400);
}

.assets-general .matrix .header-pool .meta .swatch-sm {
    width: 7px;
    height: 7px;
    border-radius: 2px;
    background: var(--ink-300);
}

.assets-general .matrix .header-pool.tone-blue .meta .swatch-sm { background: var(--primary); }
.assets-general .matrix .header-pool.tone-teal .meta .swatch-sm { background: var(--teal-800); }
.assets-general .matrix .header-pool.tone-mint .meta .swatch-sm { background: var(--success); }
.assets-general .matrix .header-pool.tone-grey .meta .swatch-sm { background: var(--ink-500); }
.assets-general .matrix .header-pool.tone-amber .meta .swatch-sm { background: #DD9A2E; }

.assets-general .matrix .header-pool .name {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-900);
}

.assets-general .matrix .header-pool .name .info {
    color: var(--teal-800);
    font-size: 13px;
    cursor: help;
}

.assets-general .matrix .header-total {
    background: linear-gradient(180deg, #0F1622, #1A2738);
    color: var(--ink-0);
    min-height: 64px;
    padding: 14px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    border-bottom: 0;
    border-left: 0;
}

.assets-general .matrix .header-total .meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, .55);
}

.assets-general .matrix .header-total .meta .swatch-sm {
    width: 7px;
    height: 7px;
    border-radius: 2px;
    background: #7FD6F2;
}

.assets-general .matrix .header-total .name {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-0);
}

.assets-general .matrix .row-section {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px 8px;
    background: var(--ink-0);
    border-bottom: 1px solid var(--ink-100);
    border-right: 0;
}

.assets-general .matrix .row-section .title {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ink-400);
}

.assets-general .matrix .row-section .rule {
    flex: 1;
    height: 1px;
    background: var(--ink-100);
}

.assets-general .matrix .label-col.row-label {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    padding: 14px 18px;
}

.assets-general .matrix .row-label .title-line {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-900);
    line-height: 1.25;
}

.assets-general .matrix .row-label .title-line .info {
    width: 13px;
    height: 13px;
    color: var(--teal-800);
    cursor: help;
    font-size: 13px;
}

.assets-general .matrix .row-label .meta {
    font-size: 12px;
    font-weight: 400;
    line-height: 1.35;
    color: var(--ink-400);
}

.assets-general .pillet {
    padding: 3px 6px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    line-height: 1;
}

.assets-general .pillet.input { background: var(--ink-100); color: var(--ink-500); }
.assets-general .pillet.calc  { background: var(--success-tint); color: var(--success); }
.assets-general .pillet.link  { background: var(--blue-tint); color: var(--primary-strong); }

.assets-general .matrix .cell.input { padding: 10px; }

.assets-general .matrix .cell.input input {
    width: 100%;
    height: 36px;
    padding: 0 12px;
    text-align: right;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-900);
    background: var(--ink-50);
    border: 1px solid transparent;
    border-radius: 8px;
    font-variant-numeric: tabular-nums;
    transition: background var(--motion), border-color var(--motion), box-shadow var(--motion);
}

.assets-general .matrix .cell.input input::placeholder {
    color: var(--ink-300);
    font-weight: 400;
}

.assets-general .matrix .cell.input input:hover {
    background: var(--ink-0);
    border-color: var(--ink-200);
}

.assets-general .matrix .cell.input input:focus,
.assets-general .matrix .cell.input input:focus-visible {
    outline: none;
    background: var(--ink-0);
    border-color: var(--primary);
    box-shadow: var(--shadow-focus);
}

.assets-general .matrix .cell.input input.dirty {
    background: var(--ink-0);
    border-color: var(--ink-200);
}

.assets-general .matrix .cell.computed {
    padding: 14px 22px;
    justify-content: flex-end;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-700);
}

.assets-general .matrix .cell .currency-glyph {
    color: var(--ink-300);
    margin-right: 2px;
}

.assets-general .matrix .cell.is-zero { color: var(--ink-300); }
.assets-general .matrix .cell.is-positive { color: var(--success); }
.assets-general .matrix .cell.is-positive .currency-glyph { color: currentColor; opacity: 0.5; }
.assets-general .matrix .cell.is-negative { color: var(--danger); }
.assets-general .matrix .cell.is-negative .currency-glyph { color: currentColor; opacity: 0.5; }

.assets-general .matrix .cell.total {
    padding: 14px 22px;
    justify-content: flex-end;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-900);
    background: var(--ink-0);
}

.assets-general .matrix .cell.total .currency-glyph {
    color: var(--ink-400);
    font-weight: 500;
    margin-right: 2px;
}

.assets-general .matrix .row-result .cell { background: var(--success-tint); }
.assets-general .matrix .row-result .label-col { background: var(--success-tint); border-right-color: rgba(30, 158, 107, .2); }
.assets-general .matrix .row-result .row-label .title-line { font-weight: 600; }
.assets-general .matrix .row-result .computed { color: var(--ink-900); }
.assets-general .matrix .row-strong .cell { background: var(--ink-50); }
.assets-general .matrix .row-strong .label-col { background: var(--ink-50); }

/* Structures and Buildings Allowance grid — reuses the matrix cell styling but has no
   trailing totals column, so it overrides the column template (wider label, no 150px tail). */
.assets-general .sba-section { margin-top: 22px; }

.assets-general .sba-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px 8px;
}

.assets-general .sba-head .swatch-sm {
    width: 9px;
    height: 9px;
    border-radius: 3px;
    background: #DD9A2E;
}

.assets-general .sba-head h6 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-900);
}

.assets-general .sba-head .muted { color: var(--ink-400); font-weight: 400; }

.assets-general .matrix.sba-grid {
    grid-template-columns: 280px repeat(var(--cols, 1), minmax(180px, 1fr));
}

.assets-general .empty-state {
    padding: 48px 22px;
    background: var(--ink-0);
    border-top: 1px solid var(--ink-100);
    text-align: center;
}

.assets-general .empty-state h6 {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink-900);
    margin: 0 0 6px;
}

.assets-general .empty-state p {
    font-size: 13px;
    color: var(--ink-500);
    line-height: 1.5;
    max-width: 46ch;
    margin: 0 auto 14px;
}

.assets-general .ghost-btn {
    height: 40px;
    padding: 0 16px;
    background: var(--ink-0);
    border: 1px solid var(--ink-200);
    color: var(--ink-500);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color var(--motion), color var(--motion);
}

.assets-general .ghost-btn:hover {
    border-color: var(--primary);
    color: var(--primary-strong);
}

/* ==========================================================================
   Corporation Tax — "General" card (Components/CorpTax/GeneralSection.razor).
   Mirrors the .assets-general token set so the two CT tabs read as siblings.
   ========================================================================== */

.ct-general {
    --primary: #2196F3;
    --primary-strong: #1976D2;
    --blue-tint: #EAF4FE;
    --teal-800: #006772;
    --success: #1E9E6B;
    --success-tint: #E6F6EE;
    --ink-0: #FFFFFF;
    --ink-50: #F6F8FB;
    --ink-100: #EDF1F6;
    --ink-200: #DCE3ED;
    --ink-300: #BFC9D6;
    --ink-400: #8A95A4;
    --ink-500: #5B6675;
    --ink-700: #2E3744;
    --ink-900: #0F1622;
    --amber: #DD9A2E;
    --amber-tint: #FFF4E5;
    --amber-700: #B7791F;
    --motion: 150ms ease;

    color: var(--ink-900);
    font-variant-numeric: tabular-nums;
}

.ct-general .info {
    color: var(--teal-800);
    font-size: 14px;
    cursor: help;
}

.ct-general .card-header .company-stamp {
    font-size: 12.5px;
    font-weight: 500;
    opacity: 0.8;
}

/* ----- Dates sub-card ----- */
.ct-general .dates-card {
    border: 1px solid var(--ink-200);
    border-radius: 12px;
    background: linear-gradient(180deg, var(--blue-tint), var(--ink-0) 130px);
    padding: 18px 20px;
    margin-bottom: 24px;
}

.ct-general .dates-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.ct-general .dates-title {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ink-400);
    margin: 0 0 12px;
}

.ct-general .facts { display: flex; flex-direction: column; gap: 8px; }

.ct-general .fact { display: flex; align-items: center; gap: 12px; }

.ct-general .fact .lbl {
    flex: 0 0 140px;
    width: 140px;
    font-size: 12px;
    color: var(--ink-400);
}

.ct-general .fact .val {
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-900);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ct-general .fact .arrow { color: var(--ink-400); }

.ct-general .pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.4;
}
.ct-general .pill.success { background: var(--success-tint); color: var(--success); }
.ct-general .pill.warn { background: var(--amber-tint); color: var(--amber-700); }

.ct-general .stamp { flex: 0 0 auto; text-align: right; }
.ct-general .stamp .num {
    font-size: 34px;
    font-weight: 700;
    line-height: 1;
    color: var(--ink-900);
}
.ct-general .stamp .num .suffix {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-400);
    margin-left: 4px;
}
.ct-general .stamp .fy {
    margin-top: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-400);
}

.ct-general .dashed-divider {
    border: 0;
    border-top: 1px dashed var(--ink-200);
    margin: 16px 0;
}

.ct-general .override-head {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-900);
    margin: 0 0 2px;
}
.ct-general .override-desc {
    font-size: 12px;
    color: var(--ink-400);
    line-height: 1.4;
    margin: 0 0 14px;
}

.ct-general .override-toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.ct-general .override-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
}
.ct-general .override-row .fld { display: flex; flex-direction: column; gap: 4px; }
.ct-general .override-row .fld label {
    margin: 0;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-400);
}
.ct-general .override-row .fld input {
    width: 180px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--ink-200);
    border-radius: 8px;
    background: var(--ink-0);
    font-size: 14px;
    color: var(--ink-900);
}
.ct-general .override-row .fld input:disabled { background: var(--ink-50); color: var(--ink-400); }
.ct-general .override-row .actions { display: flex; gap: 8px; margin-left: auto; }

/* ----- Section heading (uppercase label + hairline rule) ----- */
.ct-general .section-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 26px 0 6px;
}
.ct-general .section-head .title {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ink-400);
    white-space: nowrap;
}
.ct-general .section-head .rule { flex: 1; height: 1px; background: var(--ink-100); }

/* ----- Form field rows ----- */
.ct-general .field-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 10px 12px;
    border-radius: 8px;
    transition: background var(--motion);
}
.ct-general .field-row:hover { background: var(--ink-50); }

.ct-general .field-row .q {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--ink-900);
    line-height: 1.35;
}
.ct-general .field-row .control { justify-self: end; }

/* CT600 box-number chip shown beside a field label. Global (not scoped to .ct-general) so the
   EditableTable captions, R&D form labels and any future section can use it; colors are the
   .ct-general ink tokens inlined, since the vars only exist inside that scope. */
.box-chip {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    padding: 2px 7px;
    border-radius: 6px;
    background: #EDF1F6;
    color: #5B6675;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.4;
    white-space: nowrap;
}

/* Segmented Yes/No toggle */
.ct-general .seg-toggle {
    display: inline-flex;
    border: 1px solid var(--ink-200);
    border-radius: 8px;
    overflow: hidden;
    background: var(--ink-0);
}
.ct-general .seg-toggle button {
    min-width: 56px;
    padding: 6px 18px;
    border: 0;
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-500);
    cursor: pointer;
    transition: background var(--motion), color var(--motion);
}
.ct-general .seg-toggle button + button { border-left: 1px solid var(--ink-200); }
.ct-general .seg-toggle button:hover:not(.is-on) { background: var(--ink-50); }
.ct-general .seg-toggle button.is-on {
    background: var(--blue-tint);
    color: var(--primary-strong);
    font-weight: 600;
}
.ct-general .seg-toggle button.is-on.favourable {
    background: var(--success-tint);
    color: var(--success);
}

/* Reuse the house seg-toggle inside the Notes editor (the modal root is .notes-ui). */
.notes-ui .seg-toggle {
    display: inline-flex;
    border: 1px solid var(--ink-200);
    border-radius: 8px;
    overflow: hidden;
    background: var(--ink-0);
}
.notes-ui .seg-toggle button {
    min-width: 56px;
    padding: 6px 18px;
    border: 0;
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-500);
    cursor: pointer;
    transition: background var(--motion), color var(--motion);
}
.notes-ui .seg-toggle button + button { border-left: 1px solid var(--ink-200); }
.notes-ui .seg-toggle button:hover:not(.is-on) { background: var(--ink-50); }
.notes-ui .seg-toggle button.is-on {
    background: var(--blue-tint);
    color: var(--primary-strong);
    font-weight: 600;
}
.notes-ui .seg-toggle button.is-on.favourable {
    background: var(--success-tint);
    color: var(--success);
}

/* Note on/off row above the editor body */
.note-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 0 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--ink-100, #eceff1);
}
.note-toggle-row .note-toggle-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-700, #455a64);
}
.note-editor-disabled {
    opacity: .5;
    transition: opacity var(--motion);
}

.ct-general .num-input {
    width: 140px;
    height: 38px;
    padding: 0 12px;
    text-align: right;
    border: 1px solid var(--ink-200);
    border-radius: 8px;
    background: var(--ink-0);
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-900);
    font-variant-numeric: tabular-nums;
}
.ct-general .num-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, .18);
}

.ct-general .director-select {
    width: 100%;
    max-width: 340px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--ink-200);
    border-radius: 8px;
    background: var(--ink-0);
    font-size: 14px;
    color: var(--ink-900);
}

/* ----- Related companies sub-card ----- */
.ct-general .related-card {
    border: 1px solid var(--ink-200);
    border-radius: 12px;
    overflow: hidden;
}
.ct-general .related-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    background: var(--ink-50);
    border-bottom: 1px solid var(--ink-100);
}
.ct-general .related-head .t { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink-900); }
.ct-general .related-head .s { margin: 2px 0 0; font-size: 12px; color: var(--ink-400); }

.ct-general .related-table { width: 100%; margin: 0; border-collapse: collapse; }
.ct-general .related-table thead th {
    padding: 10px 18px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-400);
    background: var(--ink-50);
    border-bottom: 1px solid var(--ink-100);
}
.ct-general .related-table tbody td {
    padding: 10px 18px;
    border-bottom: 1px solid var(--ink-100);
    vertical-align: middle;
}
.ct-general .related-table tbody tr:last-child td { border-bottom: 0; }
.ct-general .related-table .name-input {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--ink-200);
    border-radius: 8px;
    font-size: 14px;
    color: var(--ink-900);
}
.ct-general .related-table .act { width: 90px; text-align: right; }
.ct-general .related-table .act .icon-trash { cursor: pointer; font-size: 16px; }

.ct-general .empty-state { padding: 32px 22px; text-align: center; }
.ct-general .empty-state .icon-box {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    border-radius: 12px;
    background: var(--blue-tint);
    color: var(--primary-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}
.ct-general .empty-state .msg { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--ink-900); }
.ct-general .empty-state .hint {
    max-width: 46ch;
    margin: 0 auto;
    font-size: 12.5px;
    color: var(--ink-500);
    line-height: 1.5;
}

/* ----- Footer save bar (flush to card edges via card-body negative margin) ----- */
.ct-general .footer-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: 24px -1.25rem -1.25rem;
    padding: 14px 1.25rem;
    background: var(--ink-50);
    border-top: 1px solid var(--ink-100);
}
.ct-general .footer-bar .state {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--ink-500);
}
.ct-general .footer-bar .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-300); }
.ct-general .footer-bar .state.dirty .dot { background: var(--amber); }
.ct-general .footer-bar .actions { display: flex; align-items: center; gap: 8px; }

/* ----- Responsive ----- */
@media (max-width: 1023px) {
    .ct-general .override-row .actions { width: 100%; margin-left: 0; }
}
@media (max-width: 768px) {
    .ct-general .dates-top { flex-direction: column; }
    .ct-general .stamp { text-align: left; }
    .ct-general .field-row { grid-template-columns: 1fr; gap: 8px; }
    .ct-general .field-row .control { justify-self: stretch; }
    .ct-general .seg-toggle { display: flex; width: 100%; }
    .ct-general .seg-toggle button { flex: 1; }
    .ct-general .num-input,
    .ct-general .director-select { width: 100%; max-width: none; }
    .ct-general .override-row .fld { width: 100%; }
    .ct-general .override-row .fld input { width: 100%; }
    .ct-general .override-row .actions { flex-direction: column; }
    .ct-general .override-row .actions .btn { width: 100%; }
}

/* ==========================================================================
   Light-touch polish for CorpTax sections that still use raw Bootstrap markup
   (RandD, CreativeIndustries, CT600E, PandL, PandLDB + the simple field-row
   forms). Scoped to .ct-general so these rules lift the existing markup without
   per-element edits, and cannot touch GeneralSection (it has no <table>,
   .form-control number inputs, or <h6>) or the .ct-table line-item components.
   ========================================================================== */

/* Section headings (raw <h6> used by the grid screens) */
.ct-general h6 {
    margin: 26px 0 10px;
    padding-bottom: 6px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ink-400);
    border-bottom: 1px solid var(--ink-100);
}
.ct-general h6 small { text-transform: none; letter-spacing: 0; }

/* Form controls (text / number / date inputs) */
.ct-general .form-control {
    height: 38px;
    border: 1px solid var(--ink-200);
    border-radius: 8px;
    background: var(--ink-0);
    font-size: 14px;
    color: var(--ink-900);
    transition: border-color var(--motion), box-shadow var(--motion);
}
.ct-general .form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, .18);
}
.ct-general input.form-control[type="number"],
.ct-general .form-control.text-right {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Read-only computed value in a field-row control slot */
.ct-general .readout {
    display: inline-block;
    min-width: 140px;
    text-align: right;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-900);
    font-variant-numeric: tabular-nums;
}

/* Plain Bootstrap tables on the grid screens */
.ct-general .table { margin: 0; }
.ct-general .table thead th {
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-400);
    background: var(--ink-50);
    border-top: 0;
    border-bottom: 1px solid var(--ink-200);
    vertical-align: bottom;
}
.ct-general .table tbody td {
    padding: 8px 14px;
    border-top: 1px solid var(--ink-100);
    vertical-align: middle;
    color: var(--ink-700);
}
.ct-general .table tbody tr:hover td { background: var(--ink-50); }
.ct-general .table tbody tr.table-danger:hover td,
.ct-general .table tbody tr.table-success:hover td { background: inherit; }

/* ==========================================================================
   Editable adjustment tables — shared polish for the CorpTax line-item screens
   (Components/Form/EditableTable.razor + the CorpTax hosts). Token block mirrors
   .ct-general so the tables read as siblings of the General / Assets tabs.
   ========================================================================== */

.ct-table {
    --primary: #2196F3;
    --primary-strong: #1976D2;
    --primary-tint: #E8F2FF;
    --teal-800: #006772;
    --success: #1E9E6B;
    --success-tint: #E6F6EE;
    --ink-0: #FFFFFF;
    --ink-50: #F6F8FB;
    --ink-100: #EDF1F6;
    --ink-200: #DCE3ED;
    --ink-300: #BFC9D6;
    --ink-400: #8A95A4;
    --ink-500: #5B6675;
    --ink-700: #2E3744;
    --ink-900: #0F1622;
    --amber: #DD9A2E;
    --danger: #D64545;
    --danger-tint: #FCEBEB;
    --motion: 150ms ease;

    color: var(--ink-700);
    font-variant-numeric: tabular-nums;
}

.ct-table .info {
    color: var(--teal-800);
    font-size: 13px;
    cursor: help;
}

/* ----- Caption row: section title/description + Add button ----- */
.ct-table .caption-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin: 4px 0 12px;
}
.ct-table .caption-title { font-size: 15px; font-weight: 600; color: var(--ink-900); }
.ct-table .caption-desc { margin-top: 2px; font-size: 12.5px; color: var(--ink-400); line-height: 1.4; }
.ct-table .caption-row .btn { white-space: nowrap; }

/* ----- Bordered table container ----- */
.ct-table .table-wrap {
    border: 1px solid var(--ink-200);
    border-radius: 10px;
    overflow: hidden;
}

.ct-table .adj-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    background: var(--ink-0);
}

/* ----- Header rows ----- */
.ct-table .adj-table thead th {
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-400);
    background: var(--ink-50);
    border-bottom: 1px solid var(--ink-200);
    text-align: left;
    white-space: nowrap;
    vertical-align: bottom;
}
.ct-table .adj-table thead .group-row th {
    text-align: center;
    border-bottom: 1px solid var(--ink-100);
    color: var(--ink-500);
}
.ct-table .adj-table thead .group-row th.group-band {
    background: var(--ink-50);
    border-left: 1px solid var(--ink-200);
    border-right: 1px solid var(--ink-200);
}
.ct-table .adj-table th.num-col,
.ct-table .adj-table th.calc-col { text-align: right; }

/* ----- Body cells ----- */
.ct-table .adj-table tbody td {
    padding: 7px 14px;
    border-bottom: 1px solid var(--ink-100);
    vertical-align: middle;
}
.ct-table .adj-table tbody tr:hover { background: var(--ink-50); }
.ct-table .adj-table tbody tr:last-child td { border-bottom: 0; }
.ct-table .adj-table tbody tr.row-error { background: var(--danger-tint); }
.ct-table .adj-table tbody tr.row-error:hover { background: #f8dede; }

/* Column widths: label flexes, numeric/date columns are fixed & tight. */
.ct-table .adj-table .label-col { min-width: 160px; }
.ct-table .adj-table .num-col,
.ct-table .adj-table .calc-col { width: 118px; }
.ct-table .adj-table .date-col { width: 150px; }
.ct-table .adj-table .check-col { width: 96px; text-align: center; }
.ct-table .adj-table td.check-col { text-align: center; }

/* ----- Inputs ----- */
.ct-table .text-cell,
.ct-table .date-cell,
.ct-table .num-cell {
    width: 100%;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--ink-200);
    border-radius: 8px;
    background: var(--ink-0);
    font-size: 14px;
    color: var(--ink-900);
    transition: border-color var(--motion), box-shadow var(--motion);
}
.ct-table .text-cell { font-weight: 500; }
.ct-table .num-cell {
    text-align: right;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}
.ct-table .num-cell.is-zero { color: var(--ink-300); }
.ct-table .text-cell:focus,
.ct-table .date-cell:focus,
.ct-table .num-cell:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, .18);
}
.ct-table .check-cell { width: 18px; height: 18px; cursor: pointer; accent-color: var(--primary); }

/* ----- Calculated (read-only) cell ----- */
.ct-table .calc-val {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
    width: 100%;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-900);
    font-variant-numeric: tabular-nums;
}
.ct-table .calc-val .calc-lock { font-size: 11px; color: var(--ink-300); }
.ct-table .calc-val.is-zero { color: var(--ink-300); font-weight: 500; }
.ct-table .calc-val.is-zero .calc-lock { color: var(--ink-200); }

/* ----- Actions (trash) column ----- */
.ct-table .adj-table .actions-col { width: 54px; text-align: center; }
.ct-table .trash-btn {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--ink-300);
    cursor: pointer;
    transition: background var(--motion), color var(--motion);
}
.ct-table .trash-btn:hover { background: var(--danger-tint); color: var(--danger); }

/* ----- Totals row ----- */
.ct-table .adj-table tfoot .totals-row td {
    padding: 11px 14px;
    background: var(--ink-50);
    border-top: 1px solid var(--ink-200);
}
.ct-table .adj-table tfoot .totals-label { font-size: 12.5px; font-weight: 500; color: var(--ink-500); }
.ct-table .adj-table tfoot .total-cell {
    text-align: right;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-900);
    font-variant-numeric: tabular-nums;
}

/* ----- Empty state (mirrors .ct-general) ----- */
.ct-table .empty-state { padding: 40px 22px; text-align: center; background: var(--ink-0); }
.ct-table .empty-state .icon-box {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    border-radius: 12px;
    background: var(--primary-tint);
    color: var(--primary-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}
.ct-table .empty-state .msg { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--ink-900); }
.ct-table .empty-state .hint {
    max-width: 46ch;
    margin: 0 auto;
    font-size: 12.5px;
    color: var(--ink-500);
    line-height: 1.5;
}

/* ----- Ghost button (Discard) — mirrors .assets-general .ghost-btn ----- */
.ct-table .ghost-btn {
    height: 38px;
    padding: 0 16px;
    background: var(--ink-0);
    border: 1px solid var(--ink-200);
    color: var(--ink-500);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color var(--motion), color var(--motion);
}
.ct-table .ghost-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary-strong); }
.ct-table .ghost-btn:disabled { opacity: 0.5; cursor: default; }

/* ----- Footer save bar (mirrors .ct-general .footer-bar) ----- */
.ct-table .footer-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: 24px -1.25rem -1.25rem;
    padding: 14px 1.25rem;
    background: var(--ink-50);
    border-top: 1px solid var(--ink-100);
}
.ct-table .footer-bar .state { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-500); }
.ct-table .footer-bar .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-300); }
.ct-table .footer-bar .state.dirty .dot { background: var(--amber); }
.ct-table .footer-bar .actions { display: flex; align-items: center; gap: 8px; }

/* ----- Tab count badge ----- */
.ct-table .tab-count {
    display: inline-block;
    min-width: 18px;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--ink-100);
    color: var(--ink-500);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
}
.ct-table .nav-link.active .tab-count { background: var(--primary-tint); color: var(--primary-strong); }

/* ----- Responsive: let wide (multi-year) tables scroll rather than squash inputs ----- */
@media (max-width: 1023px) {
    .ct-table .table-wrap { overflow-x: auto; }
    .ct-table .adj-table { min-width: 720px; }
}

/* ==========================================================================
   Statutory Accounts — shared polish for the note editors, DocumentPanel and
   editing modals (Components/Accounts/*). Light-touch: scoped to .accounts-ui so
   the existing raw Bootstrap markup (table table-sm / form-group / textarea)
   inherits the house look without per-fragment edits. Token block mirrors
   .ct-general so Accounts reads as a sibling of the CT screens.
   ========================================================================== */

.accounts-ui {
    --primary: #2196F3;
    --primary-strong: #1976D2;
    --primary-tint: #E8F2FF;
    --teal-800: #006772;
    --success: #1E9E6B;
    --success-tint: #E6F6EE;
    --ink-0: #FFFFFF;
    --ink-50: #F6F8FB;
    --ink-100: #EDF1F6;
    --ink-200: #DCE3ED;
    --ink-300: #BFC9D6;
    --ink-400: #8A95A4;
    --ink-500: #5B6675;
    --ink-700: #2E3744;
    --ink-900: #0F1622;
    --danger: #D64545;
    --danger-tint: #FCEBEB;
    --motion: 150ms ease;

    color: var(--ink-700);
}

.accounts-ui .info { color: var(--teal-800); cursor: help; }

/* Section headings */
.accounts-ui h6 {
    margin: 22px 0 10px;
    padding-bottom: 6px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ink-400);
    border-bottom: 1px solid var(--ink-100);
}

/* Labels */
.accounts-ui .col-form-label,
.accounts-ui .form-group > label {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-700);
}

/* Form controls */
.accounts-ui .form-control {
    height: 38px;
    border: 1px solid var(--ink-200);
    border-radius: 8px;
    background: var(--ink-0);
    font-size: 14px;
    color: var(--ink-900);
    transition: border-color var(--motion), box-shadow var(--motion);
}
.accounts-ui .form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, .18);
}
.accounts-ui .form-control:disabled,
.accounts-ui .form-control[readonly] {
    background: var(--ink-50);
    color: var(--ink-700);
}
.accounts-ui input.form-control[type="number"],
.accounts-ui .form-control.text-right {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.accounts-ui textarea.form-control {
    height: auto;
    min-height: 96px;
    padding: 10px 12px;
    line-height: 1.5;
}

/* Tables (note editor numeric grids) */
.accounts-ui .table { margin: 0; }
.accounts-ui .table thead th {
    padding: 9px 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-400);
    background: var(--ink-50);
    border-top: 0;
    border-bottom: 1px solid var(--ink-200);
    vertical-align: bottom;
}
.accounts-ui .table tbody td {
    padding: 6px 12px;
    border-top: 1px solid var(--ink-100);
    vertical-align: middle;
    color: var(--ink-700);
}
.accounts-ui .table tbody tr:hover td { background: var(--ink-50); }
.accounts-ui .table tbody tr.table-success:hover td,
.accounts-ui .table tbody tr.table-danger:hover td { background: inherit; }
/* Keep the numeric columns tight & right-aligned inside the editor tables;
   text / date inputs keep their natural full-cell width. */
.accounts-ui .table td input.form-control[type="number"],
.accounts-ui .table td .form-control.text-right {
    max-width: 180px;
    margin-left: auto;
}

/* Directors modal — compact reorder buttons, reset link, empty state */
.accounts-ui .dir-move {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--ink-400);
    cursor: pointer;
    transition: background var(--motion), color var(--motion);
}
.accounts-ui .dir-move:hover:not(:disabled) {
    background: var(--primary-tint);
    color: var(--primary-strong);
}
.accounts-ui .dir-move:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, .18);
}
.accounts-ui .dir-move:disabled { color: var(--ink-200); cursor: default; }

.accounts-ui .link-btn {
    background: transparent;
    border: 0;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--primary-strong);
    cursor: pointer;
    transition: background var(--motion), color var(--motion);
}
.accounts-ui .link-btn:hover { background: var(--primary-tint); }
.accounts-ui .link-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, .18);
}

.accounts-ui .empty-state { padding: 32px 22px; text-align: center; }
.accounts-ui .empty-state .icon-box {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    border-radius: 12px;
    background: var(--primary-tint);
    color: var(--primary-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}
.accounts-ui .empty-state .msg { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--ink-900); }
.accounts-ui .empty-state .hint {
    max-width: 46ch;
    margin: 0 auto;
    font-size: 12.5px;
    color: var(--ink-500);
    line-height: 1.5;
}

.accounts-ui .table tbody tr.is-removed td { opacity: .55; }

/* ==========================================================================
   SA800 partnership-return step (Components/LLP/_LLPCalcMain.razor)
   Scoped money-box grid: grouped, £-prefixed, right-aligned money inputs, a
   tidied stepper (CSS-only overrides of the shared .tx-stepper) and a status
   footer. Tokens copied from Spec/Design/01-foundations.md — no new hexes.
   ========================================================================== */
.sa800-step {
    --primary: #2196F3;  --primary-strong: #1976D2;  --primary-deep: #0B5BAA;
    --primary-tint: #E8F2FF;  --primary-soft: #CFE3FB;
    --success: #1E9E6B;  --success-tint: #E6F6EE;  --success-ink: #0E6B48;
    --warning: #E6A23C;  --warning-tint: #FFF7E6;  --warning-ink: #92400E;
    --danger: #D64545;   --danger-tint: #FCEBEB;
    --teal-800: #006772; --teal-tint: #E6F3F4; /* group tint only */
    --ink-0:#FFFFFF; --ink-50:#F6F8FB; --ink-100:#EDF1F6; --ink-200:#DCE3ED; --ink-300:#BFC9D6;
    --ink-400:#8A95A4; --ink-500:#5B6675; --ink-700:#2E3744; --ink-900:#0F1622;
    --r-sm:6px; --r-md:10px; --r-lg:14px; --r-xl:20px;
    --shadow-sm:0 1px 2px rgba(15,22,34,.06),0 1px 0 rgba(15,22,34,.04);

    color: var(--ink-700);
    font-variant-numeric: tabular-nums;
}

.sa800-step > .card {
    border: 1px solid var(--ink-200);
    /* Radius inherits the app-wide .card default (0.25rem) — do not restyle it per-screen. */
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.sa800-step .sa800-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--primary);
    border-bottom: 1px solid var(--primary-strong);
    padding: 14px 20px;
}
.sa800-step .sa800-headleft { display: flex; align-items: center; gap: 12px; }
.sa800-step .sa800-tile {
    width: 40px; height: 40px; flex: 0 0 auto;
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, 0.18); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 18px;
}
.sa800-step .sa800-headtitle {
    margin: 0; font-size: 16px; font-weight: 700; line-height: 1.2; color: #fff;
}
.sa800-step .sa800-headsub { margin-top: 2px; font-size: 12px; color: rgba(255, 255, 255, 0.75); }
.sa800-step .sa800-headactions { display: flex; align-items: center; gap: 8px; }

/* ── Stepper polish (overrides of the shared .tx-stepper) ───────────────── */
.sa800-step .tx-stepper-nav {
    background: var(--primary-tint);
    border: 1px solid var(--primary-soft);
    border-radius: var(--r-lg);
    margin-bottom: 8px;
    padding: 14px 20px 26px;
}
.sa800-step .tx-stepper-circle {
    width: 46px; height: 46px; font-size: 17px;
    background: var(--ink-50);
    border: 2px solid var(--ink-200);
    color: var(--ink-400);
    transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}
.sa800-step .tx-stepper-step.active .tx-stepper-circle {
    background: var(--ink-0);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 0 4px rgba(33,150,243,.18);
}
.sa800-step .tx-stepper-step.completed .tx-stepper-circle {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--ink-0);
}
.sa800-step .tx-stepper-title { color: var(--ink-400); }
.sa800-step .tx-stepper-step.active .tx-stepper-title { color: var(--primary); font-weight: 600; }
.sa800-step .tx-stepper-step.completed .tx-stepper-title { color: var(--ink-700); }
.sa800-step .tx-stepper-step::before { top: 23px; background: var(--ink-200); }
.sa800-step .tx-stepper-step.active::before,
.sa800-step .tx-stepper-step.completed::before { background: var(--primary); }

/* ── Group header ──────────────────────────────────────────────────────── */
.sa800-step .sa800-grouphead {
    display: flex; align-items: center; gap: 10px;
    margin: 24px 0 14px;
}
.sa800-step .sa800-grouphead:first-child { margin-top: 4px; }
.sa800-step .sa800-grouptile {
    width: 24px; height: 24px; flex: 0 0 auto;
    border-radius: var(--r-sm);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px;
}
.sa800-step .sa800-grouplabel {
    font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
    color: var(--ink-400); white-space: nowrap;
}
.sa800-step .sa800-grouprule { flex: 1 1 auto; height: 1px; background: var(--ink-200); }
.sa800-step .sa800-grouphead.tone-income  .sa800-grouptile { background: var(--success-tint); color: var(--success-ink); }
.sa800-step .sa800-grouphead.tone-expense .sa800-grouptile { background: var(--teal-tint);    color: var(--teal-800); }
.sa800-step .sa800-grouphead.tone-result  .sa800-grouptile { background: var(--primary-tint); color: var(--primary-deep); }

/* ── Field grid ────────────────────────────────────────────────────────── */
.sa800-step .sa800-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px 18px;
}
.sa800-step .sa800-field { display: flex; flex-direction: column; }
.sa800-step .sa800-label {
    display: flex; align-items: flex-start; gap: 8px;
    min-height: 42px; margin-bottom: 6px;
}
.sa800-step .sa800-chip {
    flex: 0 0 auto; margin-top: 1px;
    display: inline-flex; align-items: center;
    height: 20px; padding: 0 8px;
    border-radius: var(--r-sm);
    background: var(--ink-100); color: var(--ink-500);
    font-size: 11px; font-weight: 600; letter-spacing: .02em;
}
.sa800-step .sa800-labeltext { font-size: 13.5px; line-height: 1.3; color: var(--ink-700); }

/* ── Money input ───────────────────────────────────────────────────────── */
.sa800-step .sa800-money {
    display: flex; align-items: center;
    height: 44px;
    border: 1px solid var(--ink-200); border-radius: 8px;
    background: var(--ink-0);
    transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}
.sa800-step .sa800-money:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(33,150,243,.18);
}
.sa800-step .sa800-money.is-filled { background: var(--primary-tint); }
.sa800-step .sa800-currency { flex: 0 0 auto; padding: 0 4px 0 12px; color: var(--ink-300); font-size: 14px; }
.sa800-step .sa800-input {
    flex: 1 1 auto; min-width: 0; height: 100%;
    border: 0; background: transparent; outline: none;
    padding: 0 12px 0 4px; text-align: right;
    font-size: 14px; color: var(--ink-900);
    font-variant-numeric: tabular-nums;
}
.sa800-step .sa800-input::placeholder { color: var(--ink-300); }
.sa800-step .sa800-money.emphasis { height: 48px; }
.sa800-step .sa800-money.emphasis .sa800-input { font-size: 15px; font-weight: 600; }
.sa800-step .sa800-calc { background: var(--ink-50); }
.sa800-step .sa800-calcval {
    flex: 1 1 auto; padding: 0 12px 0 4px; text-align: right;
    font-size: 14px; font-weight: 600; color: var(--ink-700);
    font-variant-numeric: tabular-nums;
}
.sa800-step .sa800-hint { margin-top: 6px; font-size: 12px; line-height: 1.35; color: var(--ink-400); }

/* ── Partner detail row & validation ───────────────────────────────────── */
.sa800-step .sa800-partnerdetail > td {
    background: var(--ink-50);
    padding: 10px 14px 6px;
}
.sa800-step .form-control.is-invalid {
    border-color: var(--danger);
    background-image: none; /* suppress Bootstrap's icon — too noisy in small table cells */
}
.sa800-step .form-control.is-invalid:focus {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(214,69,69,.18);
}
.sa800-step .invalid-feedback { font-size: 12px; }

/* ── Footer status / nav ───────────────────────────────────────────────── */
.sa800-step .sa800-footer {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 20px;
    background: var(--ink-50); border-top: 1px solid var(--ink-200);
}
.sa800-step .sa800-status { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-500); }
.sa800-step .sa800-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 999px; background: var(--success); }
.sa800-step .sa800-dot.dirty { background: var(--warning); }
.sa800-step .sa800-stepcount { padding-left: 10px; border-left: 1px solid var(--ink-200); color: var(--ink-400); }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 999px) {
    .sa800-step .sa800-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sa800-step .tx-stepper-title { font-size: 11px; }
}
@media (max-width: 639px) {
    .sa800-step .sa800-grid { grid-template-columns: 1fr; }
    .sa800-step .tx-stepper-nav { overflow-x: auto; }
    .sa800-step .sa800-footer { flex-wrap: wrap; }
    .sa800-step .sa800-status { order: 3; width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
    .sa800-step .sa800-money,
    .sa800-step .tx-stepper-circle { transition: none; }
}

/* ==========================================================================
   Simple Entry (Components/SimpleEntry/SimpleEntryMain.razor)
   Extends the .sa800-step visual language (chips, money cells, group heads)
   with a three-column label / current year / prior year row grid.
   ========================================================================== */
.simple-entry .se-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px 180px;
    gap: 14px 16px;
    align-items: start;
    margin-bottom: 8px;
}
.simple-entry .se-colhead {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--ink-400);
    align-self: end;
}
.simple-entry .se-lab { min-width: 0; }
.simple-entry .se-chip-py {
    background: transparent;
    border: 1px dashed var(--ink-200);
    color: var(--ink-400);
}
.simple-entry .se-detail { margin-left: 6px; color: var(--primary); font-size: 13px; cursor: help; }
.simple-entry .sa800-input[disabled] { background: transparent; color: var(--ink-500); cursor: not-allowed; }

/* Corporation tax step — label + one "current period" money column. */
.simple-entry .se-grid-ct { grid-template-columns: minmax(0, 1fr) 180px; }
.simple-entry .se-linkbtn { font-size: 12px; line-height: 1.35; vertical-align: baseline; border: 0; }

/* Balance check bar — AC68 must equal AC490. */
.simple-entry .se-balance {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 12px 16px;
    border: 1px solid var(--ink-200);
    border-radius: var(--r-sm);
    font-size: 13px;
}
.simple-entry .se-balance.ok { background: var(--success-tint); border-color: var(--success); color: var(--success-ink); }
.simple-entry .se-balance.bad { background: var(--danger-tint); border-color: var(--danger); color: var(--danger); }

@media (max-width: 767px) {
    .simple-entry .se-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
    .simple-entry .se-grid-ct { grid-template-columns: 1fr; }
    .simple-entry .se-lab { grid-column: 1 / -1; margin-top: 6px; }
    .simple-entry .se-colhead:first-child { display: none; }
    .simple-entry .se-colhead { align-self: auto; }
}

/* ==========================================================================
   Blazor Server reconnect overlay (Views/Shared/Blazor/_ReconnectModal.cshtml)
   Blazor toggles the components-reconnect-* classes on the modal element;
   only the child matching the current state is shown.
   ========================================================================== */
.my-reconnect-modal > div {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    overflow: hidden;
    background-color: #fff;
    opacity: 0.8;
    text-align: center;
    font-weight: bold;
}
.components-reconnect-hide > div { display: none; }
.components-reconnect-show > div { display: none; }
.components-reconnect-show > .show { display: block; }
.components-reconnect-failed > div { display: none; }
.components-reconnect-failed > .failed { display: block; }
.components-reconnect-rejected > div { display: none; }
.components-reconnect-rejected > .rejected { display: block; }
