html,
body {
    margin: 0;
    min-width: 0;
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f7f8fb;
}

* {
    box-sizing: border-box;
}

a {
    color: #4f46d8;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0.3rem;
    color: #101320;
    font-size: clamp(1.45rem, 2vw, 2rem);
    font-weight: 800;
}

h2 {
    margin-bottom: 0.85rem;
    color: #101320;
    font-size: 1.05rem;
    font-weight: 800;
}

h3 {
    margin-bottom: 0.6rem;
    color: #101320;
    font-size: 0.92rem;
}

.muted,
small {
    color: #697084;
}

.screen-grid,
.request-screen,
.attention-screen {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(16rem, 20rem);
    gap: 1.75rem;
}

.attention-screen {
    grid-template-columns: minmax(22rem, 0.85fr) minmax(26rem, 1.15fr);
}

.main-column,
.side-column,
.detail-column {
    min-width: 0;
}

.page-header {
    margin-bottom: 1.25rem;
}

.page-header p {
    margin: 0;
    color: #555d70;
}

.compact {
    margin-bottom: 0.9rem;
}

.search-row {
    display: flex;
    gap: 0.7rem;
    margin-bottom: 1.5rem;
}

.search-row input,
.form-grid input,
.form-grid textarea,
.form-grid select {
    width: 100%;
    border: 1px solid #d9deeb;
    border-radius: 6px;
    background: #fff;
    color: #202637;
}

.search-row input {
    min-height: 2.9rem;
    padding: 0 1rem;
}

.icon-button {
    min-width: 2.75rem;
    height: 2.75rem;
    border: 1px solid #d9deeb;
    border-radius: 6px;
    background: #fff;
    color: #3d4352;
}

.section-block {
    margin-top: 1.8rem;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.section-heading a,
.panel-link {
    color: #4f46d8;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
}

.home-screen {
    gap: 1.5rem;
}

.welcome-greeting {
    font-size: 1.25rem;
    font-weight: 400;
    vertical-align: 0.05em;
}

.home-screen .category-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
    gap: 0.75rem;
}

.home-screen .category-tile {
    min-width: 0;
    min-height: 4.5rem;
    gap: 0.6rem;
    padding: 0.65rem 0.75rem;
    line-height: 1.25;
}

.home-screen .category-tile > span:last-child,
.home-screen .template-card h3,
.home-screen .template-card p {
    min-width: 0;
    overflow-wrap: anywhere;
}

.home-screen .template-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
}

@media (max-width: 1180px) {
    .screen-grid,
    .request-screen {
        grid-template-columns: minmax(0, 1fr);
    }

    .side-column {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 720px) {
    .screen-grid,
    .request-screen,
    .attention-screen,
    .catalogue-layout {
        grid-template-columns: minmax(0, 1fr);
    }

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

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.35rem;
    }

    .search-row {
        margin-bottom: 1rem;
    }
}

.catalogue-layout {
    display: grid;
    grid-template-columns: minmax(11rem, 14rem) minmax(0, 1fr);
    gap: 1.5rem;
}

.catalogue-filter {
    display: grid;
    align-content: start;
    gap: 0.25rem;
}

.catalogue-filter button {
    min-height: 2.4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0 0.65rem;
    border: 0;
    border-radius: 5px;
    color: var(--teams-text-primary);
    background: transparent;
    font-size: 0.875rem;
    text-align: left;
}

.catalogue-filter button:hover,
.catalogue-filter button.active {
    color: var(--teams-brand);
    background: var(--teams-brand-tint);
}

.catalogue-filter button span {
    color: var(--teams-text-secondary);
    font-size: 0.75rem;
}

.catalogue-count {
    margin-bottom: 0.75rem;
}

.catalogue-template-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
}

.category-tile.change,
.template-card-category.change {
    color: #5b5fc7;
}

.category-tile.governance,
.template-card-category.governance {
    color: #2564cf;
}

.category-tile.architecture,
.template-card-category.architecture {
    color: #7a3ed3;
}

.category-tile.procurement,
.template-card-category.procurement {
    color: #107c5a;
}

.category-tile.project,
.template-card-category.project {
    color: #356bd6;
}

.category-tile.other {
    color: var(--teams-text-secondary);
}

.category-tile.other .template-icon {
    color: var(--teams-text-secondary);
    background: #f1f2f5;
}

.template-card-category {
    min-height: 1.25rem;
    margin-bottom: 0.55rem;
    font-size: 0.8125rem;
}

.home-screen .template-card {
    min-height: 20.5rem;
}

.home-screen .template-card p:not(.muted):not(.template-card-category) {
    margin-bottom: 0.8rem;
    font-size: 0.8125rem;
}

.home-screen .version-pill {
    margin-bottom: 0.75rem;
    border-radius: 4px;
}

.home-screen .panel h2 {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.home-screen .panel h2 svg {
    color: var(--teams-brand);
}

.home-screen .summary-row > span {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
}

.home-screen .summary-row svg {
    color: var(--teams-text-secondary);
}

.home-screen .activity-dot {
    color: var(--teams-brand);
}

.home-screen .activity-dot.success {
    color: var(--teams-success);
    background: #e7f4e4;
}

.home-screen .activity-dot.warning {
    color: var(--teams-warning);
    background: #fff1e7;
}

.home-screen .activity-dot.violet {
    color: var(--teams-brand);
    background: var(--teams-brand-tint);
}

.home-screen .activity-dot.blue {
    color: #2564cf;
    background: #e8f1ff;
}

@media (max-width: 1180px) {
    .home-screen .category-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.attention-screen {
    gap: 1rem;
}

.attention-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.attention-filter-button {
    margin-top: 0.1rem;
    white-space: nowrap;
}

.attention-screen .filter-pills {
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.attention-screen .filter-pills button {
    min-height: 2.25rem;
    padding: 0 0.75rem;
    border-radius: 999px;
}

.attention-screen .filter-pills .active {
    background: var(--teams-brand-tint);
}

.attention-screen .work-list {
    gap: 0.55rem;
}

.attention-screen .work-card {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 0.75rem;
    min-height: 9.5rem;
    padding: 0.9rem;
    box-shadow: none;
    cursor: pointer;
}

.attention-screen .work-card:hover {
    border-color: var(--teams-border-strong);
    background: var(--teams-surface-subtle);
}

.attention-screen .work-card.selected {
    border-color: var(--teams-brand);
    background: #fbfbff;
    box-shadow: inset 3px 0 var(--teams-brand);
}

.attention-screen .work-card h2 {
    margin-bottom: 0.15rem;
    font-size: 0.9375rem;
}

.attention-screen .work-card .muted {
    margin-bottom: 0.25rem;
    font-size: 0.8125rem;
}

.attention-screen .work-card .status-pill {
    color: #0f5ccc;
    background: #e8f1ff;
}

.attention-screen .work-card:nth-child(odd) .status-pill {
    color: #a04b00;
    background: #fff1dc;
}

.attention-screen .work-meta {
    gap: 0.5rem;
    margin-top: 0.6rem;
    font-size: 0.75rem;
}

.attention-screen .work-meta span {
    display: grid;
    gap: 0.1rem;
    color: var(--teams-text-secondary);
}

.attention-screen .work-meta strong {
    color: var(--teams-text);
    font-size: 0.8125rem;
}

.attention-screen .work-card .primary-button {
    min-width: 6.7rem;
    margin: 0;
    white-space: nowrap;
}

.work-card-chevron {
    transform: rotate(-90deg);
    color: var(--teams-text-secondary);
}

.attention-list-count {
    margin: 1.25rem 0 0;
    color: var(--teams-text-secondary);
    font-size: 0.75rem;
}

.attention-screen .request-detail {
    min-height: 100%;
    padding: 1rem;
    box-shadow: none;
}

.attention-screen .request-detail header {
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--teams-border);
}

.attention-screen .request-detail header h2 {
    margin-bottom: 0.25rem;
    font-size: 1.05rem;
}

.attention-detail-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.attention-detail-grid {
    grid-template-columns: 1.1fr 1fr 1fr;
    margin: 0;
    padding: 0.8rem 0;
}

.attention-screen .request-detail h3 {
    margin: 0.85rem 0 0.35rem;
    font-size: 0.8125rem;
}

.attention-screen .request-detail > p {
    margin-bottom: 0.75rem;
    font-size: 0.8125rem;
}

.attention-screen .attachment {
    display: grid;
    gap: 0.1rem;
    padding: 0.6rem;
    font-size: 0.75rem;
}

.attention-action-panel {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.85rem;
    padding: 0.8rem;
}

.attention-action-panel p {
    flex: 1;
    margin: 0;
    font-size: 0.75rem;
}

.attention-action-panel .secondary-button,
.attention-action-panel .primary-button {
    flex: 0 0 auto;
    margin: 0;
    white-space: nowrap;
}

@media (max-width: 1180px) {
    .attention-screen {
        grid-template-columns: 1fr;
    }
}

.admin-screen {
    margin: -0.25rem -0.5rem 0;
}

.admin-screen .admin-header {
    align-items: center;
    padding: 0 0.5rem;
}

.admin-screen .admin-header .primary-button {
    margin: 0;
}

.admin-screen .admin-tabs {
    margin: 1.25rem 0 0;
    padding: 0 0.5rem;
}

.admin-screen .admin-grid {
    grid-template-columns: minmax(30rem, 0.9fr) minmax(34rem, 1.1fr);
    gap: 0;
    margin-top: 0;
    border-top: 1px solid var(--teams-border);
}

.admin-screen .template-table,
.admin-screen .template-admin-detail {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.admin-screen .template-table {
    padding: 1.1rem 0.85rem;
    border-right: 1px solid var(--teams-border);
}

.admin-screen .template-admin-detail {
    padding: 1.1rem 1.25rem;
}

.admin-screen .template-table table {
    width: 100%;
    table-layout: fixed;
}

.admin-screen .template-table th {
    color: var(--teams-text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    text-align: left;
}

.admin-screen .template-table th:first-child {
    width: 29%;
}

.admin-screen .template-table th:last-child {
    width: 2.5rem;
}

.admin-screen .template-table td {
    height: 4.5rem;
    padding: 0.5rem;
    font-size: 0.8125rem;
    vertical-align: middle;
}

.admin-screen .template-table tbody tr {
    cursor: pointer;
}

.admin-screen .template-table td:first-child {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.admin-screen .template-table td:first-child strong {
    line-height: 1.25;
}

.admin-screen .template-table .template-icon {
    width: 2rem;
    height: 2rem;
}

.template-row-menu {
    min-width: 1.75rem;
    height: 1.75rem;
    border-color: transparent;
}

.admin-screen .status-pill.active-status {
    color: var(--teams-success);
    background: #e7f4e4;
}

.admin-screen .status-pill.draft-status {
    color: var(--teams-text-secondary);
    background: #f1f2f4;
}

.admin-screen .template-admin-detail header {
    align-items: center;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--teams-border);
}

.admin-screen .template-admin-detail header h2 {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    font-size: 1.1rem;
}

.admin-screen .template-admin-detail header .template-icon {
    width: 2.35rem;
    height: 2.35rem;
}

.admin-screen .button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.danger-button {
    border-color: #f3b8b8;
    color: #c4314b;
}

.admin-screen .detail-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0;
    padding: 0.8rem 0;
}

.admin-screen .admin-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.admin-screen .admin-cards .panel {
    min-width: 0;
    min-height: 14.5rem;
    padding: 0.9rem;
}

.admin-screen .admin-cards .panel:nth-child(4),
.admin-screen .admin-cards .panel:nth-child(5) {
    min-height: 10.5rem;
}

.admin-screen .admin-cards h3 {
    font-size: 0.8125rem;
}

.admin-screen .admin-cards p {
    margin-bottom: 0.65rem;
    font-size: 0.75rem;
}

.provider-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    padding: 0.65rem;
    border: 1px solid var(--teams-border);
    border-radius: 6px;
    background: var(--teams-surface-subtle);
}

.provider-summary .secondary-button {
    min-height: 1.9rem;
    margin-left: auto;
    padding: 0 0.55rem;
    font-size: 0.75rem;
}

@media (max-width: 1024px) {
    .admin-screen .admin-grid {
        grid-template-columns: 1fr;
    }

    .admin-screen .template-table {
        border-right: 0;
        border-bottom: 1px solid var(--teams-border);
    }
}

@media (max-width: 960px) {
    .admin-screen .template-table {
        overflow-x: auto;
    }

    .admin-screen .template-table table {
        min-width: 42rem;
    }

    .admin-screen .admin-cards {
        grid-template-columns: 1fr;
    }
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(8rem, 1fr));
    gap: 0.8rem;
}

.category-tile,
.template-card,
.panel,
.selected-template,
.form-panel,
.work-card,
.request-detail,
.template-table,
.template-admin-detail {
    border: 1px solid #e0e4ef;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(25, 30, 45, 0.05);
}

.category-tile {
    min-height: 4.5rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.8rem;
    color: #202637;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
}

.material-symbol,
.template-icon,
.activity-dot {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
}

.material-symbol,
.template-icon {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 8px;
    background: #f0efff;
    color: #4f46d8;
    font-weight: 800;
}

.green .material-symbol,
.procurement,
.green {
    color: #15824b;
}

.blue .material-symbol,
.governance,
.blue {
    color: #2465c7;
}

.orange {
    color: #cf6600;
}

.purple .material-symbol,
.architecture,
.purple,
.violet .material-symbol,
.change {
    color: #6a3fd1;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(9rem, 1fr));
    gap: 0.85rem;
}

.template-card {
    min-height: 18.5rem;
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

.template-card h3 {
    margin: 0.9rem 0 0.2rem;
    font-size: 1.02rem;
}

.template-card p:not(.muted) {
    color: #3f4658;
    font-size: 0.86rem;
    line-height: 1.45;
}

.version-pill,
.status-pill,
.filter-pills span {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 1.35rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: #eeedff;
    color: #4f46d8;
    font-size: 0.78rem;
    font-weight: 700;
}

.primary-button,
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.45rem;
    padding: 0 1.05rem;
    border-radius: 6px;
    font-weight: 800;
    text-decoration: none;
}

.primary-button {
    margin-top: auto;
    border: 1px solid #4f46d8;
    color: #fff;
    background: #4f46d8;
}

.secondary-button {
    border: 1px solid #cfd5e4;
    color: #202637;
    background: #fff;
}

.panel {
    padding: 1rem 1.15rem;
}

.panel + .panel {
    margin-top: 0.85rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.55rem 0;
    color: #3d4352;
}

.activity-row {
    display: flex;
    gap: 0.75rem;
    padding: 0.55rem 0;
}

.activity-row p {
    margin-bottom: 0;
    font-size: 0.88rem;
    line-height: 1.35;
}

.activity-dot {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    background: #eeedff;
}

.stepper {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.6rem;
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
}

.stepper li {
    min-height: 3rem;
    display: grid;
    place-items: center;
    border-bottom: 2px solid #d9deeb;
    color: #50586c;
    font-size: 0.85rem;
}

.stepper .done,
.stepper .current {
    border-color: #4f46d8;
    color: #4f46d8;
    font-weight: 800;
}

.selected-template {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 0.7rem;
}

.form-panel {
    padding: 1rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem 1.4rem;
}

.form-grid label {
    display: grid;
    gap: 0.35rem;
    color: #222838;
    font-size: 0.86rem;
    font-weight: 700;
}

.form-grid input,
.form-grid textarea,
.form-grid select {
    min-height: 2.6rem;
    padding: 0.55rem 0.7rem;
}

.form-grid textarea {
    min-height: 4.25rem;
    resize: vertical;
}

.drop-zone {
    min-height: 4.25rem;
    display: grid;
    place-items: center;
    border: 1px dashed #cbd2e2;
    border-radius: 6px;
    color: #6b7280;
    background: #fbfcff;
}

.sticky-actions {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin: 1.5rem -1.75rem -4rem;
    padding: 0.9rem 1.75rem;
    border-top: 1px solid #e4e6ef;
    background: rgba(255, 255, 255, 0.95);
}

.template-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.3rem;
}

.template-meta dt {
    color: #687084;
    font-size: 0.78rem;
}

.template-meta dd {
    margin: 0 0 0.4rem;
    color: #4f46d8;
    font-weight: 700;
}

.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.filter-pills button {
    min-height: 2.2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.8rem;
    border: 1px solid #d9deeb;
    border-radius: 999px;
    background: #fff;
    color: #485064;
}

.filter-pills .active {
    border-color: #4f46d8;
    color: #4f46d8;
}

.work-list {
    display: grid;
    gap: 0.7rem;
}

.work-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.85rem;
    align-items: center;
    padding: 0.9rem;
}

.work-card.selected {
    border-color: #4f46d8;
}

.work-card h2 {
    margin-bottom: 0.15rem;
}

.work-meta,
.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
}

.work-meta {
    margin-top: 0.7rem;
    font-size: 0.82rem;
}

.work-meta strong,
.detail-grid strong {
    display: block;
    color: #101320;
}

.request-detail,
.template-admin-detail,
.template-table {
    padding: 1rem;
}

.request-detail header,
.template-admin-detail header,
.admin-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.detail-grid {
    margin: 1rem 0;
    padding: 0.9rem 0;
    border-top: 1px solid #edf0f6;
    border-bottom: 1px solid #edf0f6;
}

.detail-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-grid span {
    color: #687084;
    font-size: 0.78rem;
}

.attachment-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.attachment {
    padding: 0.75rem;
    border: 1px solid #e2e6f0;
    border-radius: 6px;
}

.attachment small {
    display: block;
}

.timeline {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
}

.timeline li {
    padding-top: 0.55rem;
    border-top: 3px solid #d7dce8;
    font-size: 0.82rem;
}

.timeline .completed {
    border-color: #1f9d55;
}

.timeline .current {
    border-color: #4f46d8;
    color: #4f46d8;
}

.timeline span {
    display: block;
    color: #697084;
}

.action-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.9rem;
    border: 1px solid #d9d7ff;
    border-radius: 8px;
    background: #fbfaff;
}

.action-panel p {
    margin-bottom: 0;
}

.admin-header {
    margin-bottom: 1rem;
}

.admin-header p {
    margin: 0;
    color: #555d70;
}

.admin-tabs {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e4e6ef;
}

.admin-tabs a {
    padding: 0.75rem 0;
    color: #4b5366;
    text-decoration: none;
}

.admin-tabs .active {
    color: #4f46d8;
    border-bottom: 3px solid #4f46d8;
    font-weight: 800;
}

.admin-grid {
    display: grid;
    grid-template-columns: minmax(26rem, 0.9fr) minmax(28rem, 1.1fr);
    gap: 1rem;
}

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

th,
td {
    padding: 0.8rem 0.65rem;
    border-bottom: 1px solid #edf0f6;
    text-align: left;
}

tr.selected {
    background: #f4f3ff;
    box-shadow: inset 3px 0 #4f46d8;
}

.button-row {
    display: flex;
    gap: 0.65rem;
}

.admin-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}

.admin-cards .panel:nth-last-child(-n + 2) {
    grid-column: span 1;
}

.blazor-error-boundary {
    padding: 1rem;
    color: #fff;
    background: #b32121;
}

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

@media (max-width: 1180px) {
    .screen-grid,
    .request-screen,
    .attention-screen,
    .admin-grid {
        grid-template-columns: 1fr;
    }

    .side-column,
    .detail-column {
        max-width: none;
    }

    .category-grid {
        grid-template-columns: repeat(3, minmax(8rem, 1fr));
    }

    .template-grid,
    .admin-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .catalogue-layout {
        grid-template-columns: 1fr;
    }

    .catalogue-filter {
        grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    }
}

@media (max-width: 720px) {
    .category-grid,
    .template-grid,
    .form-grid,
    .work-meta,
    .detail-grid,
    .detail-grid.two,
    .attachment-grid,
    .timeline,
    .admin-cards,
    .stepper {
        grid-template-columns: 1fr;
    }

    .content {
        padding: 1rem 1rem 4rem;
    }

    .work-card,
    .action-panel {
        grid-template-columns: 1fr;
    }

    .sticky-actions {
        margin-left: -1rem;
        margin-right: -1rem;
        padding: 0.9rem 1rem;
    }
}

/* Teams/Fluent visual layer. Keep these overrides late in the cascade. */
:root {
    --teams-brand: #5b5fc7;
    --teams-brand-hover: #4f52b2;
    --teams-brand-tint: #f0f0ff;
    --teams-canvas: #f5f5f5;
    --teams-surface: #ffffff;
    --teams-surface-subtle: #fafafa;
    --teams-border: #e0e0e0;
    --teams-border-strong: #d1d1d1;
    --teams-text: #242424;
    --teams-text-secondary: #616161;
    --teams-success: #107c10;
    --teams-warning: #f7630c;
    --teams-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

html,
body {
    font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--teams-canvas);
    color: var(--teams-text);
}

a,
.section-heading a,
.panel-link {
    color: var(--teams-brand);
}

h1 {
    color: var(--teams-text);
    font-size: clamp(1.25rem, 1.6vw, 1.65rem);
    font-weight: 700;
}

h2,
h3 {
    color: var(--teams-text);
    font-weight: 650;
}

.muted,
small,
.page-header p,
.admin-header p {
    color: var(--teams-text-secondary);
}

.fluent-icon,
.teams-logo svg,
.brand-mark svg,
.nav-link svg,
.teams-item svg {
    fill: currentColor;
}

.search-row input,
.form-grid input,
.form-grid textarea,
.form-grid select,
.settings-form input,
.settings-form textarea,
.settings-form select,
.icon-button,
.secondary-button,
.filter-pills button {
    border-color: var(--teams-border-strong);
    background: var(--teams-surface);
    color: var(--teams-text);
}

.category-tile,
.template-card,
.panel,
.selected-template,
.form-panel,
.work-card,
.request-detail,
.template-table,
.template-admin-detail {
    border-color: var(--teams-border);
    background: var(--teams-surface);
    box-shadow: var(--teams-shadow);
}

.material-symbol,
.template-icon,
.activity-dot {
    background: var(--teams-brand-tint);
    color: var(--teams-brand);
    fill: currentColor;
    font-weight: 700;
}

.primary-button {
    border-color: var(--teams-brand);
    background: var(--teams-brand);
    font-weight: 650;
}

.primary-button:hover {
    background: var(--teams-brand-hover);
}

.secondary-button {
    color: var(--teams-text);
}

.version-pill,
.status-pill,
.filter-pills span {
    background: var(--teams-brand-tint);
    color: var(--teams-brand);
    font-weight: 650;
}

.stepper .done,
.stepper .current,
.filter-pills .active,
.timeline .current {
    border-color: var(--teams-brand);
    color: var(--teams-brand);
}

.green .material-symbol,
.procurement,
.green,
.timeline .completed {
    color: var(--teams-success);
}

.orange {
    color: var(--teams-warning);
}

.action-panel {
    border-color: #c5c7f1;
    background: var(--teams-brand-tint);
}

.admin-status {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    margin: 0 0 1rem;
    padding: 0.35rem 0.65rem;
    border: 1px solid var(--teams-border);
    border-radius: 6px;
    color: var(--teams-text);
    background: var(--teams-brand-tint);
    font-size: 0.86rem;
}

.admin-tabs {
    flex-wrap: wrap;
    border-bottom-color: var(--teams-border);
}

.admin-tabs a {
    color: var(--teams-text-secondary);
}

.admin-tabs .active {
    color: var(--teams-brand);
    border-bottom: 2px solid var(--teams-brand);
    font-weight: 650;
}

tr.selected {
    background: var(--teams-brand-tint);
    box-shadow: inset 3px 0 var(--teams-brand);
}

.settings-form {
    display: grid;
    gap: 0.85rem;
}

.settings-form label {
    display: grid;
    gap: 0.35rem;
    color: var(--teams-text);
    font-size: 0.86rem;
    font-weight: 600;
}

.settings-form input,
.settings-form textarea,
.settings-form select {
    width: 100%;
    min-height: 2.45rem;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--teams-border-strong);
    border-radius: 6px;
}

.settings-form textarea {
    min-height: 5.25rem;
    resize: vertical;
}

.template-create-panel {
    margin: 0 0.5rem 1rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--teams-border);
    border-radius: 6px;
    background: var(--teams-surface);
    box-shadow: var(--teams-shadow);
}

.settings-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1rem;
}

.settings-form-span {
    grid-column: 1 / -1;
}

.inline-admin-form {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    align-items: end;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--teams-border);
}

.working-version-context {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 0.4rem 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    border: 1px solid var(--teams-border);
    border-radius: 6px;
    background: var(--teams-surface-subtle);
}

.working-version-context label {
    display: grid;
    gap: 0.35rem;
    color: var(--teams-text);
    font-size: 0.86rem;
    font-weight: 600;
}

.working-version-context input {
    min-height: 2.45rem;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--teams-border-strong);
    border-radius: 6px;
    background: var(--teams-surface);
    color: var(--teams-text);
}

.working-version-context small {
    padding-bottom: 0.1rem;
    font-size: 0.75rem;
}

.admin-subheading {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--teams-border);
}

.form-hint,
.routing-hint {
    margin: -0.25rem 0 0;
    color: var(--teams-text-secondary);
    font-size: 0.75rem;
}

.validation-success {
    color: var(--teams-success);
}

.validation-error {
    color: #c4314b;
}

@media (max-width: 760px) {
    .settings-form-grid,
    .inline-admin-form {
        grid-template-columns: 1fr;
    }

    .working-version-context {
        grid-template-columns: 1fr;
    }
}

.check-row {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center;
    gap: 0.6rem !important;
}

.check-row input {
    width: auto;
    min-height: auto;
}

.rule-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--teams-text-secondary);
}

.routing-preview {
    display: grid;
    gap: 0.75rem;
}

.route-step {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.1rem 0.75rem;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid var(--teams-border);
    border-radius: 8px;
}

.route-step span {
    grid-row: span 2;
    display: grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    color: #fff;
    background: var(--teams-brand);
    font-size: 0.8rem;
    font-weight: 700;
}

.route-step small {
    grid-column: 2;
}

.provider-card {
    padding: 0.9rem;
    border: 1px solid var(--teams-border);
    border-radius: 8px;
    background: var(--teams-surface-subtle);
}

.provider-card + .provider-card {
    margin-top: 0.75rem;
}

.provider-card p {
    margin: 0.65rem 0 0;
    color: var(--teams-text-secondary);
}

.two-up {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.required-marker {
    color: #c4314b;
}

/* Teams density correction: closer to native tab content than a standalone dashboard. */
html,
body {
    font-size: 14px;
    line-height: 1.4286;
}

h1 {
    margin-bottom: 0.25rem;
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.25;
}

h2 {
    margin-bottom: 0.65rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
}

h3,
.template-card h3 {
    margin-bottom: 0.5rem;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.35;
}

p,
td,
th,
input,
textarea,
select,
button {
    font-weight: 400;
}

strong,
th,
.template-meta dd,
.work-meta strong,
.detail-grid strong {
    font-weight: 600;
}

.page-header {
    margin-bottom: 1rem;
}

.page-header p,
.admin-header p,
.template-card p:not(.muted),
.activity-row p,
.provider-card p,
.rule-row,
.summary-row,
.detail-grid span,
.template-meta dt,
small {
    font-size: 0.875rem;
}

.section-heading a,
.panel-link {
    font-size: 0.875rem;
    font-weight: 400;
}

.category-tile {
    min-height: 4rem;
    padding: 0.7rem;
    font-size: 0.875rem;
    font-weight: 400;
}

.template-card {
    min-height: 17rem;
    padding: 0.85rem;
}

.template-card h3 {
    margin-top: 0.75rem;
}

.template-icon,
.material-symbol {
    width: 2rem;
    height: 2rem;
    border-radius: 6px;
    font-weight: 400;
}

.fluent-icon,
.template-icon svg,
.icon-button svg,
.primary-button svg,
.secondary-button svg,
.rule-row svg {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
}

.primary-button,
.secondary-button {
    gap: 0.45rem;
    min-height: 2.25rem;
    padding: 0 0.85rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.icon-button {
    min-width: 2.25rem;
    height: 2.25rem;
    display: inline-grid;
    place-items: center;
}

.search-row {
    gap: 0.5rem;
    margin-bottom: 1.1rem;
}

.search-row input {
    min-height: 2.25rem;
    padding: 0 0.75rem;
}

.form-grid label,
.settings-form label {
    font-size: 0.875rem;
    font-weight: 600;
}

.form-grid input,
.form-grid textarea,
.form-grid select,
.settings-form input,
.settings-form textarea,
.settings-form select {
    min-height: 2.25rem;
    padding: 0.45rem 0.6rem;
    font-size: 0.875rem;
}

.version-pill,
.status-pill,
.filter-pills span {
    min-height: 1.25rem;
    padding: 0.1rem 0.45rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.filter-pills button {
    min-height: 2rem;
    padding: 0 0.7rem;
    font-size: 0.875rem;
}

.stepper li,
table {
    font-size: 0.875rem;
}

th,
td {
    padding: 0.65rem 0.55rem;
}

.admin-tabs {
    gap: 1.1rem;
}

.admin-tabs a {
    padding: 0.6rem 0;
    font-size: 0.875rem;
    font-weight: 400;
}

.admin-tabs .active {
    font-weight: 600;
}

.request-detail,
.template-admin-detail,
.template-table,
.form-panel,
.panel {
    padding: 0.85rem;
}

.route-step span {
    font-weight: 600;
}

.request-entry-screen {
    grid-template-columns: minmax(34rem, 1fr) minmax(18rem, 20rem);
    gap: 1.6rem;
}

.request-entry-header {
    margin-bottom: 1rem;
}

.request-stepper {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    margin: 0 0 1.35rem;
    padding: 0;
    list-style: none;
}

.request-stepper li {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 0.45rem;
    color: var(--teams-text);
    font-size: 0.8125rem;
}

.request-stepper li::before {
    content: "";
    position: absolute;
    top: 0.82rem;
    left: 0;
    width: calc(50% - 1.25rem);
    border-top: 1px solid var(--teams-border-strong);
}

.request-stepper li::after {
    content: "";
    position: absolute;
    top: 0.82rem;
    right: 0;
    width: calc(50% - 1.25rem);
    border-top: 1px solid var(--teams-border-strong);
}

.request-stepper li:first-child::before,
.request-stepper li:last-child::after {
    display: none;
}

.request-stepper span {
    z-index: 1;
    display: grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    border: 1px solid var(--teams-brand);
    border-radius: 999px;
    color: var(--teams-brand);
    background: var(--teams-surface);
    font-weight: 600;
}

.request-stepper .done span,
.request-stepper .current span {
    color: #fff;
    background: var(--teams-brand);
}

.request-stepper strong {
    font-weight: 400;
}

.request-stepper .current strong {
    color: var(--teams-brand);
    font-weight: 600;
}

.request-template-summary,
.request-details-panel,
.request-side-card {
    border: 1px solid var(--teams-border);
    border-radius: 8px;
    background: var(--teams-surface);
    box-shadow: var(--teams-shadow);
}

.request-template-summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.65rem;
    padding: 0.9rem 1rem;
}

.request-template-summary h2 {
    margin-bottom: 0.35rem;
}

.request-template-summary p {
    margin-bottom: 0.35rem;
}

.request-template-summary p:last-child {
    margin-bottom: 0;
}

.request-details-panel {
    padding: 1rem;
}

.request-details-panel h2 {
    margin-bottom: 0.9rem;
}

.request-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem 1.25rem;
}

.request-form-grid label {
    display: grid;
    gap: 0.35rem;
    color: var(--teams-text);
    font-size: 0.875rem;
    font-weight: 600;
}

.request-form-grid label.full,
.request-attachments {
    grid-column: 1 / -1;
}

.request-form-grid input,
.request-form-grid textarea,
.request-form-grid select {
    width: 100%;
    min-height: 2.3rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--teams-border-strong);
    border-radius: 5px;
    color: var(--teams-text);
    background: var(--teams-surface);
    font-size: 0.875rem;
}

.request-form-grid textarea {
    min-height: 3.5rem;
    resize: vertical;
}

.request-attachments {
    display: grid;
    place-items: center;
    gap: 0.25rem;
    min-height: 4.1rem;
    padding: 0.75rem;
    border: 1px dashed var(--teams-border-strong);
    border-radius: 6px;
    color: var(--teams-text-secondary);
    background: var(--teams-surface-subtle);
    text-align: center;
}

.request-attachments .text-button {
    padding: 0;
    border: 0;
    background: transparent;
    font: inherit;
    color: var(--teams-brand);
    font-weight: 600;
    text-decoration: none;
}

.request-side-card {
    padding: 1rem;
}

.request-side-card + .request-side-card {
    margin-top: 0.85rem;
}

.request-side-card h2 {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.success-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--teams-success);
}

.request-next-step {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.7rem;
    margin-bottom: 0.9rem;
}

.request-next-step > span {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 6px;
    color: var(--teams-brand);
    background: var(--teams-brand-tint);
}

.request-next-step p {
    margin: 0;
    color: var(--teams-text-secondary);
    font-size: 0.875rem;
}

.request-next-step strong {
    color: var(--teams-text);
}

.request-sticky-actions {
    position: sticky;
    bottom: 0;
    z-index: 15;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin: 1rem -1.75rem -1.5rem;
    padding: 0.7rem 1.75rem;
    border-top: 1px solid var(--teams-border);
    background: rgba(255, 255, 255, 0.96);
}

.request-draft-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-right: auto;
    color: var(--teams-success);
    font-size: 0.8125rem;
}

@media (max-width: 1180px) {
    .request-entry-screen {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .request-stepper,
    .request-form-grid {
        grid-template-columns: 1fr;
    }

    .request-stepper li {
        grid-template-columns: auto minmax(0, 1fr);
        justify-items: start;
        align-items: center;
    }

    .request-stepper li::before,
    .request-stepper li::after {
        display: none;
    }

    .request-sticky-actions {
        align-items: stretch;
        flex-direction: column;
        margin: 1rem -1rem -4rem;
        padding: 0.7rem 1rem;
    }
}
