:root {
    color-scheme: light;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
    --ae-red: #d71920;
    --ae-red-dark: #a80f16;
    --ae-blue: #003a70;
    --ae-blue-dark: #072b50;
    --ae-blue-soft: #eaf2fb;
    --ae-ink: #17212f;
    --ae-muted: #5d6b7c;
    --ae-border: #d7e0ea;
    --ae-surface: #ffffff;
    --ae-page: #f3f6f9;
    --ae-focus: #ffbf2f;
    --ae-success: #12623a;
    --ae-success-soft: #e3f4ea;
    --ae-warning: #775000;
    --ae-warning-soft: #fff2cc;
    --ae-danger: #8d1c22;
    --ae-danger-soft: #fde7e8;
    --ae-shadow: 0 16px 40px rgba(7, 43, 80, 0.08);
    color: var(--ae-ink);
    background: var(--ae-page);
}

body {
    margin: 0;
    background:
        linear-gradient(180deg, rgba(0, 58, 112, 0.06) 0, rgba(0, 58, 112, 0) 220px),
        var(--ae-page);
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 14px 28px;
    color: #ffffff;
    background: var(--ae-blue-dark);
    border-bottom: 4px solid var(--ae-red);
    box-shadow: 0 10px 24px rgba(7, 43, 80, 0.18);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
    text-decoration: none;
}

.brand-logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 186px;
    height: 58px;
    border-radius: 6px;
    padding: 7px 10px;
    background: #ffffff;
    box-sizing: border-box;
}

.brand-logo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-secondary {
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
}

.primary-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.primary-nav a {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: 6px;
    padding: 0 12px;
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
}

.primary-nav a:hover,
.primary-nav a:focus-visible {
    background: rgba(255, 255, 255, 0.13);
}

.primary-nav .nav-active {
    background: rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 -3px 0 var(--ae-focus);
}

.primary-nav form {
    margin: 0;
}

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    box-sizing: border-box;
    border-radius: 999px;
    padding: 0 6px;
    color: #ffffff;
    background: var(--ae-red);
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1;
}

.state-warning-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    color: var(--ae-warning);
    background: var(--ae-warning-soft);
    font-weight: 700;
}

button {
    min-height: 40px;
    border: 0;
    border-radius: 6px;
    padding: 0 16px;
    color: #ffffff;
    background: var(--ae-blue);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.button-primary:hover,
button:hover {
    background: var(--ae-blue-dark);
}

.button-primary {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    padding: 0 16px;
    color: #ffffff;
    background: var(--ae-blue);
    font-weight: 700;
    text-decoration: none;
}

.button-secondary {
    display: inline-flex;
    min-height: 40px;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ae-border);
    border-radius: 6px;
    padding: 0 16px;
    color: var(--ae-blue-dark);
    background: var(--ae-surface);
    font-weight: 700;
    text-decoration: none;
}

.button-secondary:hover {
    border-color: #b7c2ce;
    background: var(--ae-blue-soft);
}

.approve-button {
    background: var(--ae-success);
}

.approve-button:hover {
    background: #0d4d2d;
}

.button-quiet {
    color: var(--ae-blue-dark);
    background: transparent;
}

.button-quiet:hover {
    background: var(--ae-blue-soft);
}

.drag-handle {
    cursor: grab;
    min-width: 4rem;
}

.option-row-dragging {
    opacity: 0.55;
}

.button-on-dark {
    color: #ffffff;
}

.button-on-dark:hover {
    background: rgba(255, 255, 255, 0.13);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--ae-focus);
    outline-offset: 2px;
}

a {
    color: var(--ae-blue);
}

.page-shell {
    width: min(1480px, calc(100% - 32px));
    margin: 36px auto;
}

.page-shell-wide {
    width: calc(100% - 24px);
    margin: 24px auto;
}

.auth-panel,
.message-panel {
    width: min(420px, 100%);
    margin: 0 auto;
    padding: 28px;
    background: var(--ae-surface);
    border: 1px solid var(--ae-border);
    border-radius: 8px;
    box-shadow: var(--ae-shadow);
}

.auth-choice-primary {
    width: 100%;
    box-sizing: border-box;
    margin: 6px 0 20px;
}

.app-login-section {
    border-top: 1px solid var(--ae-border);
    padding-top: 20px;
}

.app-login-section h2 {
    margin-top: 0;
    font-size: 1rem;
}

.dashboard {
    background: var(--ae-surface);
    border: 1px solid var(--ae-border);
    border-radius: 8px;
    padding: 28px;
    box-shadow: var(--ae-shadow);
}

.data-dashboard {
    padding: 20px;
}

h1 {
    margin: 0 0 12px;
    font-size: 2rem;
}

label {
    display: block;
    margin: 16px 0 6px;
    font-weight: 600;
}

input {
    box-sizing: border-box;
    width: 100%;
    min-height: 42px;
    border: 1px solid #b7c2ce;
    border-radius: 6px;
    padding: 8px 10px;
    color: var(--ae-ink);
    font: inherit;
}

textarea {
    box-sizing: border-box;
    width: 100%;
    min-height: 84px;
    border: 1px solid #b7c2ce;
    border-radius: 6px;
    padding: 8px 10px;
    color: var(--ae-ink);
    font: inherit;
    resize: vertical;
}

select {
    box-sizing: border-box;
    width: 100%;
    min-height: 40px;
    border: 1px solid #b7c2ce;
    border-radius: 6px;
    padding: 8px 10px;
    color: var(--ae-ink);
    background: var(--ae-surface);
    font: inherit;
}

input:disabled,
select:disabled,
textarea:disabled {
    color: #52606f;
    background: #eef3f7;
    cursor: not-allowed;
}

fieldset {
    margin: 18px 0 0;
    padding: 16px;
    border: 1px solid var(--ae-border);
    border-radius: 6px;
}

legend {
    padding: 0 6px;
    font-weight: 650;
}

.auth-panel button {
    width: 100%;
    margin-top: 22px;
}

.validation {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 6px;
    color: var(--ae-danger);
    background: var(--ae-danger-soft);
}

.validation ul {
    margin: 0;
    padding-left: 18px;
}

.messages {
    display: grid;
    gap: 10px;
    margin: 18px 0;
}

.message {
    padding: 10px 12px;
    border-radius: 6px;
}

.message-success {
    color: var(--ae-success);
    background: var(--ae-success-soft);
}

.message-error {
    color: var(--ae-danger);
    background: var(--ae-danger-soft);
}

.cycle-banner {
    margin: 14px 0 18px;
    padding: 12px 14px;
    border: 1px solid #bad0e6;
    border-radius: 6px;
    color: var(--ae-blue-dark);
    background: var(--ae-blue-soft);
    font-weight: 700;
}

.cycle-banner-warning {
    border-color: #f1d48a;
    color: var(--ae-warning);
    background: var(--ae-warning-soft);
}

.admin-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-top: 22px;
}

.admin-tile {
    display: grid;
    gap: 6px;
    min-height: 118px;
    box-sizing: border-box;
    padding: 18px;
    border: 1px solid var(--ae-border);
    border-radius: 8px;
    color: var(--ae-ink);
    background: #f7fafd;
    text-decoration: none;
}

.admin-tile:hover,
.admin-tile:focus-visible {
    border-color: #9db6cf;
    background: var(--ae-blue-soft);
}

.admin-tile-title {
    color: var(--ae-blue-dark);
    font-size: 1.05rem;
    font-weight: 800;
}

.admin-tile-copy {
    color: var(--ae-muted);
}

.user-maintenance {
    display: grid;
    gap: 24px;
}

.maintenance-section {
    border-top: 1px solid var(--ae-border);
    padding-top: 22px;
}

.maintenance-section h2 {
    margin: 0 0 12px;
    font-size: 1.25rem;
}

.section-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 18px;
    margin-bottom: 14px;
}

.section-heading-row h2,
.section-heading-row p {
    margin: 0;
}

.section-heading-row p {
    color: var(--ae-muted);
}

.portfolio-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.portfolio-metrics {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.portfolio-header-actions {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.portfolio-business-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
}

.portfolio-business-tab {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    border: 1px solid var(--ae-border);
    border-radius: 6px;
    padding: 0 12px;
    color: var(--ae-blue-dark);
    background: var(--ae-surface);
    font-weight: 700;
    text-decoration: none;
}

.portfolio-business-tab:hover,
.portfolio-business-tab:focus-visible {
    border-color: #9db6cf;
    background: var(--ae-blue-soft);
}

.portfolio-business-tab-active {
    border-color: var(--ae-blue);
    color: #ffffff;
    background: var(--ae-blue);
}

.readonly-value {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    color: var(--ae-ink);
    font-weight: 700;
}

.metric-pill {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    border-radius: 999px;
    padding: 2px 10px;
    color: var(--ae-success);
    background: var(--ae-success-soft);
    font-weight: 700;
    white-space: nowrap;
}

.metric-pill-past {
    color: var(--ae-danger);
    background: var(--ae-danger-soft);
}

.metric-pill-due {
    color: var(--ae-warning);
    background: var(--ae-warning-soft);
}

.portfolio-filter-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
    align-items: end;
    margin-bottom: 18px;
}

.portfolio-filter-form label {
    margin: 0;
}

.filter-field {
    display: grid;
    gap: 6px;
}

.filter-field input,
.filter-field select {
    min-width: 0;
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
}

.sales-dashboard-summary {
    display: grid;
    gap: 10px;
    margin: 4px 0 18px;
    padding: 14px 16px;
    border: 1px solid var(--ae-border);
    border-radius: 6px;
    background: #f7fafd;
}

.sales-dashboard-summary-text {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 14px;
}

.sales-dashboard-summary-label {
    color: var(--ae-muted);
    font-weight: 700;
}

.sales-dashboard-stage-breakdown {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
}

.sales-dashboard-stage-breakdown div {
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--ae-border);
    border-radius: 6px;
    background: #ffffff;
}

.sales-dashboard-stage-breakdown dt {
    color: var(--ae-muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.sales-dashboard-stage-breakdown dd {
    margin: 2px 0 0;
    font-size: 1.1rem;
    font-weight: 800;
}

.sales-dashboard-progress {
    height: 12px;
    overflow: hidden;
    border: 1px solid #c7d4e2;
    border-radius: 999px;
    background: #e8eef5;
}

.sales-dashboard-progress-fill {
    display: block;
    width: var(--sales-dashboard-progress, 0%);
    height: 100%;
    border-radius: inherit;
    background: var(--ae-blue);
}

.sales-dashboard-table {
    min-width: 980px;
}

.sales-dashboard-table .sort-toggle {
    text-decoration: none;
}

.muted-cell-text {
    color: var(--ae-muted);
}

.user-form {
    display: grid;
    gap: 16px;
}

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

.checkbox-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: 500;
}

.checkbox-label input {
    width: auto;
    min-height: 0;
}

.decision-option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 18px;
}

.decision-option-group {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.decision-option-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.decision-option-heading h3 {
    margin: 0;
    color: var(--ae-blue-dark);
    font-size: 1rem;
}

.decision-option-table {
    min-width: 560px;
}

.decision-option-table input:not([type]) {
    min-width: 260px;
}

.tier-default-table {
    min-width: 860px;
}

.tier-default-table .tier-description-heading,
.tier-default-table .tier-description-cell {
    background: #e9eef4;
}

.tier-description-cell input {
    min-width: 300px;
    background: #f6f8fb;
}

.option-table-scroll {
    max-width: 100%;
}

.button-row,
.table-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.table-actions form {
    margin: 0;
}

.approval-action-form {
    display: grid;
    gap: 8px;
    min-width: 230px;
}

.approval-reset-form {
    display: block;
    min-width: 0;
    margin-top: 8px;
}

.approval-reset-button {
    min-height: 32px;
    border: 1px solid #d99aa0;
    padding: 0 10px;
    color: var(--ae-danger);
    background: #ffffff;
    font-size: 0.92rem;
}

.approval-reset-button:hover,
.approval-reset-button:focus-visible {
    border-color: var(--ae-danger);
    color: #ffffff;
    background: var(--ae-danger);
}

.approval-action-form label {
    margin: 0;
}

.approval-action-form label span {
    color: var(--ae-muted);
    font-weight: 500;
}

.approval-bulk-dialog label span {
    color: var(--ae-muted);
    font-weight: 500;
}

.approval-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.approval-action-buttons button {
    min-height: 34px;
    padding: 0 12px;
}

.approval-comment-panel {
    display: grid;
    gap: 8px;
    min-width: 280px;
}

.approval-comment-panel[hidden] {
    display: none;
}

.approval-decision-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    border: 0;
    margin: 0;
    padding: 0;
}

.approval-decision-options legend {
    width: 100%;
    margin-bottom: 2px;
    color: var(--ae-blue-dark);
    font-weight: 700;
}

.approval-decision-options label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-weight: 600;
}

.approval-decision-options input {
    width: auto;
    min-height: 0;
}

.approval-toolbar-actions {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.approval-bulk-actions {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.bulk-selection-count {
    min-width: 76px;
    color: var(--ae-muted);
    font-weight: 700;
    text-align: right;
}

.approval-bulk-dialog {
    width: min(460px, calc(100% - 32px));
    border: 1px solid var(--ae-border);
    border-radius: 8px;
    padding: 18px;
    color: var(--ae-ink);
    background: var(--ae-surface);
    box-shadow: 0 24px 70px rgba(7, 43, 80, 0.24);
}

.approval-bulk-dialog::backdrop {
    background: rgba(23, 33, 47, 0.42);
}

.approval-bulk-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.approval-bulk-dialog h2 {
    margin: 0;
    font-size: 1.2rem;
}

.approval-bulk-dialog label {
    margin-top: 0;
}

.approval-bulk-dialog textarea {
    min-height: 120px;
}

.approval-bulk-dialog-actions {
    justify-content: flex-end;
    margin-top: 12px;
}

.dialog-close-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 34px;
    min-height: 34px;
    padding: 0;
    color: var(--ae-muted);
    background: transparent;
    font-size: 1.35rem;
    line-height: 1;
}

.dialog-close-button:hover {
    color: var(--ae-blue-dark);
    background: var(--ae-blue-soft);
}

.approval-select-cell {
    width: 52px;
    min-width: 52px;
    text-align: center;
}

.approval-select-cell input,
.sticky-col-select input {
    width: 18px;
    min-height: 18px;
}

.approval-account-cell {
    min-width: 220px;
}

.approval-account-heading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.approval-account-name {
    color: var(--ae-blue);
    font-weight: 700;
}

.approval-am-note {
    position: relative;
    flex: 0 0 auto;
}

.approval-am-note summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    min-height: 28px;
    border: 1px solid var(--ae-blue);
    border-radius: 999px;
    color: var(--ae-blue-dark);
    background: var(--ae-blue-soft);
    cursor: pointer;
}

.approval-am-note summary::-webkit-details-marker {
    display: none;
}

.approval-am-note-panel {
    position: absolute;
    z-index: 10;
    top: 34px;
    left: 0;
    width: min(320px, 80vw);
    padding: 10px 12px;
    border: 1px solid var(--ae-border);
    border-radius: 6px;
    color: var(--ae-ink);
    background: var(--ae-surface);
    box-shadow: var(--ae-shadow);
}

.expand-toggle.approval-detail-toggle {
    width: 28px;
    min-width: 28px;
    min-height: 28px;
}

.approval-effective-date-cell {
    min-width: 150px;
}

.approval-effective-date-cell .muted-value,
.approval-effective-date-cell .status {
    display: block;
    width: fit-content;
    margin-top: 4px;
}

.approval-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin: 20px 0;
}

.approval-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
}

.approval-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    border: 1px solid var(--ae-border);
    border-radius: 6px;
    padding: 0 12px;
    color: var(--ae-blue-dark);
    background: var(--ae-surface);
    font-weight: 700;
    text-decoration: none;
}

.approval-tab span {
    min-width: 24px;
    border-radius: 999px;
    padding: 1px 7px;
    color: var(--ae-blue-dark);
    background: var(--ae-blue-soft);
    text-align: center;
}

.approval-tab-active {
    border-color: var(--ae-blue);
    color: #ffffff;
    background: var(--ae-blue);
}

.approval-tab-active span {
    color: var(--ae-blue-dark);
    background: #ffffff;
}

.export-action {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--ae-blue);
    border-radius: 6px;
    padding: 0 12px;
    color: var(--ae-blue-dark);
    background: var(--ae-blue-soft);
    font-weight: 700;
    text-decoration: none;
}

.export-action:hover,
.export-action:focus-visible {
    background: #d7e8f9;
}

.approval-detail-row {
    scroll-margin-top: 24px;
}

.parent-account-row,
.child-account-table tr {
    scroll-margin-top: 24px;
}

.approval-detail-row td {
    background: #f7fafc;
}

.approval-detail-panel {
    display: grid;
    gap: 18px;
    padding: 16px;
    border: 1px solid var(--ae-border);
    border-radius: 8px;
    background: var(--ae-surface);
}

.approval-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.approval-detail-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.approval-detail-header h2 {
    margin: 0;
    font-size: 1.15rem;
}

.approval-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin: 0;
}

.approval-detail-grid div {
    display: grid;
    gap: 4px;
}

.approval-detail-grid dt,
.decision-history h3 {
    color: var(--ae-muted);
    font-weight: 650;
}

.approval-detail-grid dd {
    margin: 0;
}

.decision-history h3 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.decision-history ol,
.decision-history p {
    margin: 0;
}

.secondary-action {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    border-radius: 6px;
    color: var(--ae-blue);
    font-weight: 650;
    text-decoration: none;
}

.danger-button {
    background: var(--ae-danger);
}

.danger-button:hover {
    background: #6f151a;
}

button:disabled,
button:disabled:hover {
    color: #6f7b89;
    background: #d8dee6;
    cursor: not-allowed;
}

.table-scroll {
    max-height: calc(100vh - 290px);
    overflow: auto;
    border: 1px solid var(--ae-border);
    border-radius: 6px;
}

.portfolio-table-scroll {
    max-height: max(320px, calc(100vh - 290px));
    overflow: auto;
    overscroll-behavior: contain;
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
}

.pagination-bar p {
    margin: 0;
    color: var(--ae-muted);
    font-weight: 650;
}

.pagination-bar p span {
    display: inline-block;
    margin-left: 8px;
}

.pagination-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-link {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    text-decoration: none;
}

.pagination-link-disabled {
    color: #6f7b89;
    background: #edf1f5;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th,
td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--ae-border);
    text-align: left;
    vertical-align: top;
}

td span {
    display: block;
    color: var(--ae-muted);
}

.cycle-row-active {
    background: #f8fcff;
}

.cycle-row-inactive {
    color: #596777;
    background: #fafbfc;
}

.cycle-row-inactive strong {
    color: #425163;
}

.settings-cycle-table {
    min-width: 920px;
}

.settings-edit-block {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--ae-border);
}

.settings-edit-block h3 {
    margin: 0 0 10px;
    color: var(--ae-blue-dark);
    font-size: 1.05rem;
}

thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    color: var(--ae-blue-dark);
    background: #f1f6fb;
}

.portfolio-table {
    min-width: 1720px;
}

.approvals-table {
    min-width: 1440px;
}

.portfolio-table th {
    white-space: nowrap;
}

.portfolio-table td {
    min-width: 110px;
}

.numeric-cell {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.group-start {
    border-left: 1px solid #c5d2df;
}

.sticky-col {
    position: sticky;
    z-index: 3;
    background: var(--ae-surface);
}

thead .sticky-col {
    z-index: 5;
    background: #f1f6fb;
}

.sticky-col-details {
    left: 0;
    width: 76px;
    min-width: 76px;
}

.sticky-col-identity {
    left: 76px;
    width: 230px;
    min-width: 230px;
    box-shadow: 8px 0 12px rgba(7, 43, 80, 0.06);
}

.sticky-col-child,
.sticky-col-approval {
    left: 0;
    min-width: 220px;
    box-shadow: 8px 0 12px rgba(7, 43, 80, 0.06);
}

.sticky-col-select {
    left: 0;
    width: 52px;
    min-width: 52px;
    text-align: center;
}

.sticky-col-approval-with-select {
    left: 52px;
    min-width: 220px;
    box-shadow: 8px 0 12px rgba(7, 43, 80, 0.06);
}

.sort-toggle {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    color: var(--ae-blue-dark);
    background: transparent;
    font-weight: 650;
    text-align: left;
    white-space: nowrap;
}

.sort-indicator {
    color: var(--ae-red);
    font-size: 0.85rem;
}

.tier-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    padding: 2px 9px;
    font-weight: 700;
}

.tier-tier-1 {
    color: var(--ae-blue-dark);
    background: var(--ae-blue-soft);
}

.tier-tier-2 {
    color: #654100;
    background: #fff0bf;
}

.tier-tier-3 {
    color: var(--ae-success);
    background: var(--ae-success-soft);
}

.tier-unclassified {
    color: var(--ae-muted);
    background: #edf1f5;
}

.expand-toggle {
    display: inline-grid;
    place-items: center;
    width: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 0;
    color: var(--ae-blue-dark);
    background: var(--ae-blue-soft);
}

.expand-toggle:hover {
    background: #d7e8f9;
}

.expand-toggle::before {
    content: "";
    width: 0;
    height: 0;
    border-top: 6px solid currentColor;
    border-right: 5px solid transparent;
    border-left: 5px solid transparent;
    transition: transform 0.16s ease;
}

.expand-toggle[aria-expanded="true"]::before {
    transform: rotate(180deg);
}

.account-detail-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.child-count-pill {
    display: inline-block;
    color: var(--ae-muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.child-detail-link {
    min-height: 28px;
    padding: 0;
    color: var(--ae-blue);
    background: transparent;
    font-weight: 700;
    text-align: left;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.child-detail-link:hover {
    color: var(--ae-blue-dark);
}

.child-account-name {
    margin-top: 3px;
    color: var(--ae-muted);
    font-size: 0.9rem;
}

.portfolio-row-form button {
    min-height: 34px;
    padding: 0 12px;
}

.decision-control {
    display: grid;
    gap: 6px;
}

.decision-select {
    min-width: 0;
    width: 100%;
}

.readonly-decision-select {
    color: #52606f;
    background: #eef3f7;
    font-weight: 700;
}

.mixed-decision,
.submitted-indicator {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 24px;
    border-radius: 999px;
    padding: 2px 9px;
    font-size: 0.9rem;
    font-weight: 700;
}

.mixed-decision {
    color: var(--ae-blue-dark);
    background: var(--ae-blue-soft);
}

.submitted-indicator {
    color: var(--ae-warning);
    background: var(--ae-warning-soft);
}

.portfolio-row-form {
    min-width: 72px;
}

.portfolio-table input[type="date"],
.child-account-table input[type="date"] {
    min-width: 130px;
}

.date-display {
    margin-bottom: 6px;
}

.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;
}

.child-account-row td {
    background: #dcecf8;
    padding: 0;
}

.child-account-panel {
    padding: 18px;
    border-top: 2px solid #8fb6d9;
    border-bottom: 2px solid #8fb6d9;
    background: #dcecf8;
}

.child-account-panel h3 {
    margin: 0 0 12px;
    color: var(--ae-blue-dark);
    font-size: 1rem;
}

.child-account-table {
    min-width: 1500px;
    background: var(--ae-surface);
}

.child-account-table th,
.child-account-table td {
    padding: 7px 9px;
}

.child-detail-dialog {
    width: min(880px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    border: 1px solid var(--ae-border);
    border-radius: 8px;
    padding: 0;
    color: var(--ae-text);
    background: var(--ae-surface);
    box-shadow: 0 24px 60px rgba(7, 43, 80, 0.22);
}

.child-detail-dialog::backdrop {
    background: rgba(7, 43, 80, 0.45);
}

.portfolio-comment-dialog {
    width: min(520px, calc(100% - 32px));
    border: 1px solid var(--ae-border);
    border-radius: 8px;
    padding: 18px;
    color: var(--ae-ink);
    background: var(--ae-surface);
    box-shadow: 0 24px 70px rgba(7, 43, 80, 0.24);
}

.portfolio-comment-dialog::backdrop {
    background: rgba(23, 33, 47, 0.42);
}

.portfolio-comment-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.portfolio-comment-dialog h2,
.portfolio-comment-dialog p {
    margin: 0;
}

.portfolio-comment-dialog p {
    color: var(--ae-muted);
}

.portfolio-comment-dialog label {
    margin-top: 14px;
}

.portfolio-comment-dialog label span {
    color: var(--ae-muted);
    font-weight: 500;
}

.portfolio-comment-dialog textarea {
    min-height: 130px;
}

.portfolio-comment-actions {
    justify-content: flex-end;
    margin-top: 14px;
}

.child-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--ae-border);
    background: #f7fafc;
}

.child-detail-header h2 {
    margin: 2px 0 0;
    font-size: 1.25rem;
}

.dialog-close {
    position: relative;
    width: 34px;
    min-width: 34px;
    min-height: 34px;
    padding: 0;
    background: transparent;
}

.dialog-close::before,
.dialog-close::after {
    position: absolute;
    top: 16px;
    left: 8px;
    width: 18px;
    height: 2px;
    background: currentColor;
    content: "";
}

.dialog-close::before {
    transform: rotate(45deg);
}

.dialog-close::after {
    transform: rotate(-45deg);
}

.child-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    margin: 0;
    padding: 10px 20px 18px;
}

.child-detail-grid div {
    padding: 10px 0;
    border-bottom: 1px solid var(--ae-border);
}

.child-detail-grid dt,
.child-detail-edit-form label span {
    color: var(--ae-muted);
    font-weight: 650;
}

.child-detail-grid dd {
    margin: 4px 0 0;
}

.child-detail-edit-form {
    padding: 18px 20px 20px;
    border-top: 1px solid var(--ae-border);
}

.child-detail-edit-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.child-detail-edit-form label {
    display: grid;
    gap: 6px;
}

.child-detail-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

.no-results-message {
    margin: 16px 0 0;
    color: var(--ae-muted);
}

.detail-list {
    display: grid;
    gap: 14px;
    margin: 24px 0;
}

.detail-list div {
    display: grid;
    gap: 4px;
}

.detail-list dt {
    color: var(--ae-muted);
    font-weight: 650;
}

.detail-list dd {
    margin: 0;
}

.status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 650;
}

.status-active {
    color: var(--ae-success);
    background: var(--ae-success-soft);
}

.status-inactive {
    color: var(--ae-muted);
    background: #edf1f5;
}

.status-pending {
    color: var(--ae-warning);
    background: var(--ae-warning-soft);
}

.status-pending-approval {
    color: var(--ae-warning);
    background: var(--ae-warning-soft);
}

.status-submitted {
    color: var(--ae-blue-dark);
    background: var(--ae-blue-soft);
}

.status-approved {
    color: var(--ae-success);
    background: var(--ae-success-soft);
}

.status-auto-approved {
    color: var(--ae-success);
    background: var(--ae-success-soft);
}

.status-rejected {
    color: var(--ae-danger);
    background: var(--ae-danger-soft);
}

.status-mixed {
    color: var(--ae-warning);
    background: var(--ae-warning-soft);
}

.approval-pending-detail {
    display: block;
    margin-top: 4px;
    color: var(--ae-muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.rejection-note {
    position: relative;
    display: inline-block;
    margin-top: 6px;
}

.rejection-note summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    min-height: 28px;
    border: 1px solid var(--ae-danger);
    border-radius: 999px;
    color: var(--ae-danger);
    background: var(--ae-danger-soft);
    cursor: pointer;
}

.rejection-note summary::-webkit-details-marker {
    display: none;
}

.note-icon {
    color: inherit;
    font-weight: 800;
    line-height: 1;
}

.rejection-note-panel {
    position: absolute;
    z-index: 10;
    top: 34px;
    right: 0;
    width: min(320px, 80vw);
    padding: 10px 12px;
    border: 1px solid var(--ae-border);
    border-radius: 6px;
    color: var(--ae-ink);
    background: var(--ae-surface);
    box-shadow: var(--ae-shadow);
}

.approval-difference {
    border-left: 4px solid var(--ae-red);
    color: #583900;
    background: #fff7df;
    font-weight: 700;
}

.muted-value {
    color: var(--ae-muted);
}

@media (max-width: 620px) {
    .app-header,
    .primary-nav {
        align-items: flex-start;
        flex-direction: column;
    }

    .primary-nav {
        width: 100%;
    }

    .brand {
        gap: 10px;
    }

    .brand-logo-wrap {
        width: 168px;
        height: 54px;
    }

    .portfolio-section-header {
        flex-direction: column;
    }

    .portfolio-metrics {
        justify-content: flex-start;
    }

    .portfolio-filter-form {
        grid-template-columns: 1fr;
    }

    .sales-dashboard-stage-breakdown {
        grid-template-columns: 1fr;
    }

    .child-detail-grid,
    .child-detail-edit-grid {
        grid-template-columns: 1fr;
    }
}
