:root {
    color-scheme: light;
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #f9fafc;
    --border: #e7ebf3;
    --text: #0f172a;
    --text-muted: #64748b;
    --primary: #2563eb;
    --primary-strong: #1d4ed8;
    --danger-bg: #fff1f2;
    --danger-text: #be123c;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    font-family: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}

h1 {
    margin: 0 0 1rem;
    font-size: 1.5rem;
    font-weight: 650;
}

p {
    margin: 0;
}

.app-shell {
    min-height: 100vh;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(6px);
}

.brand {
    font-size: 1.05rem;
    font-weight: 700;
    white-space: nowrap;
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    width: 100%;
}

.main-nav .nav-spacer {
    margin-left: auto;
}

.main-nav a,
button,
select,
input {
    font: inherit;
}

.main-nav a,
button {
    border-radius: 0.35rem;
    border: 1px solid transparent;
    padding: 0.42rem 0.7rem;
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.main-nav a:hover,
button:hover {
    background: var(--surface-soft);
}

button {
    border-color: var(--border);
    background: var(--surface);
}

button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

button.ghost {
    border: none;
    color: var(--text-muted);
}

.account-menu {
    position: relative;
}

/* Grouped second-level navigation (UI-2). Mirrors the account menu so the two
   dropdowns in the header behave identically, but opens to the left edge of
   its toggle because it sits at the start of the bar rather than the end. */
.nav-group {
    position: relative;
}.nav-group summary {
    list-style: none;
}

.nav-group summary::-webkit-details-marker {
    display: none;
}

.nav-group-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid transparent;
    border-radius: 0.35rem;
    padding: 0.42rem 0.7rem;
    cursor: pointer;
}

.nav-group-toggle::after {
    content: "▾";
    font-size: 0.7rem;
    line-height: 1;
}

.nav-group-toggle:hover {
    background: var(--surface-soft);
}

.nav-group-list {
    position: absolute;
    left: 0;
    top: calc(100% + 0.35rem);
    z-index: 20;
    min-width: 200px;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 0.35rem;
    display: grid;
    gap: 0.2rem;
}

.account-menu summary {
    list-style: none;
}

.account-menu summary::-webkit-details-marker {
    display: none;
}

.account-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid var(--border);
    border-radius: 0.35rem;
    padding: 0.42rem 0.7rem;
    background: var(--surface);
    cursor: pointer;
}

.account-menu-toggle:hover {
    background: var(--surface-soft);
}

.account-icon {
    font-size: 0.95rem;
    line-height: 1;
}

.account-menu-list {
    position: absolute;
    right: 0;
    top: calc(100% + 0.35rem);
    min-width: 170px;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 0.35rem;
    display: grid;
    gap: 0.2rem;
}

.account-menu-list a,
.account-menu-list button {
    display: block;
    width: 100%;
    text-align: left;
}

.app-content {
    width: min(1440px, 100% - 2rem);
    margin: 1rem auto 2rem;
    padding: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    box-shadow: var(--shadow);
}

.error {
    margin: 0.8rem 0;
    padding: 0.65rem 0.8rem;
    border-radius: 0.4rem;
    border: 1px solid #fecdd3;
    background: var(--danger-bg);
    color: var(--danger-text);
}

input,
select {
    border: 1px solid var(--border);
    border-radius: 0.35rem;
    background: var(--surface);
    color: var(--text);
    padding: 0.42rem 0.58rem;
}

input:focus,
select:focus {
    outline: 2px solid rgba(37, 99, 235, 0.2);
    border-color: var(--primary);
}

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

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

.validation-message {
    color: #dc2626;
}

.table-grid-shell {
    position: relative;
}

.table-grid-toolbar,
.table-grid-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    margin: 0.65rem 0;
}

.table-grid-toolbar .spacer {
    flex: 1;
}

.table-grid-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
}

.table-grid {
    width: 100%;
    table-layout: auto;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface);
}

.table-grid.table-grid-empty thead th {
    min-width: max-content;
}

.table-grid thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    text-align: left;
    font-weight: 600;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}

.table-grid th,
.table-grid td {
    padding: 0.3rem 0.55rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.25;
}

.table-grid tbody tr {
    background: var(--surface);
}

.table-grid tbody tr:hover {
    background: #f8fbff;
}

.table-grid tbody tr:last-child td {
    border-bottom: 0;
}

.table-grid thead button {
    border: none;
    padding: 0;
    background: transparent;
    font-weight: 600;
    color: var(--text);
}

.table-grid-row-selected {
    background: #eff6ff !important;
}

.table-grid-row-checked {
    background: #eff6ff !important;
}

.table-grid-row-pending-delete {
    background: var(--danger-bg) !important;
    text-decoration: line-through;
    color: var(--text-muted);
}

.table-grid-col-select,
.table-grid-col-expand {
    width: 0;
    min-width: min-content;
    white-space: nowrap;
    text-align: center;
    padding-left: 0.3rem;
    padding-right: 0.3rem;
}

.table-grid-row-index {
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* Activity journal (UI-7.5). Admin bypasses are called out because the whole
   point of the journal is to make privileged action visible; colour alone
   would fail for colour-blind readers, so the row also carries a text badge. */
.activity-bypass {
    background: var(--danger-bg) !important;
}

.activity-bypass-badge {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.05rem 0.35rem;
    border-radius: 0.25rem;
    background: var(--danger-text);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.activity-bypass-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.activity-payload {
    font-family: "Cascadia Mono", Consolas, monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Request card event feed (UI §6.2). */
.event-feed {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 2px solid var(--border, #d0d0d0);
}

.event-feed li {
    position: relative;
    padding: 0.35rem 0 0.35rem 1rem;
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
    flex-wrap: wrap;
}

.event-feed li::before {
    content: "";
    position: absolute;
    left: -5px;
    top: 0.75rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border, #d0d0d0);
}

.event-feed li.event-activity::before {
    background: #3b82f6;
}

.event-feed li.event-notification::before {
    background: #9ca3af;
}

.event-feed li.event-failed::before {
    background: #dc2626;
}

.event-time {
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
    font-size: 0.85rem;
    white-space: nowrap;
}

.event-undelivered {
    font-size: 0.75rem;
    font-weight: 600;
    color: #dc2626;
    border: 1px solid #dc2626;
    border-radius: 999px;
    padding: 0 0.4rem;
}

.table-grid-expand-btn {
    border: none;
    background: transparent;
    padding: 0 0.2rem;
    cursor: pointer;
    color: var(--text-muted);
}

.table-grid-expand-btn:hover {
    color: var(--primary);
    background: transparent;
}

.editable-text-cell {
    display: block;
    width: 100%;
    min-width: 2rem;
    min-height: 1.5rem;
    cursor: text;
}

.editable-text-cell-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 0.15rem 0.3rem;
    font: inherit;
}

.editable-text-cell-value {
    display: block;
    width: 100%;
}

.enum-select-cell,
.lookup-select-cell {
    font: inherit;
    width: 100%;
    box-sizing: border-box;
    display: block;
}

.boolean-cell {
    font: inherit;
}

.chip-collection-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    align-items: center;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
}

.chip:hover {
    background: #eff6ff;
}

.chip-remove,
.chip-add {
    border: none;
    background: transparent;
    padding: 0;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
}

.chip-remove:hover,
.chip-add:hover {
    color: var(--danger-text);
    background: transparent;
}

.table-grid-context {
    position: fixed;
    z-index: 40;
    width: 190px;
    max-width: 190px;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    background: var(--surface);
    padding: 0.3rem;
}

.table-grid-context button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    text-align: left;
    background: transparent;
    padding: 0.4rem 0.5rem;
    border-radius: 0.3rem;
    font-size: 0.85rem;
    line-height: 1.2;
    color: var(--text);
    cursor: pointer;
}

.table-grid-context button:hover:not(:disabled) {
    background: var(--surface-soft);
}

.table-grid-context button:disabled {
    opacity: 0.45;
    cursor: default;
}

.table-grid-context .ctx-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: var(--text-muted);
}

.table-grid-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(15, 23, 42, 0.35);
    display: grid;
    place-items: center;
    padding: 1rem;
}

.table-grid-dialog {
    width: min(760px, 100%);
    max-height: 82vh;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 1rem;
}

.table-grid-detail-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.65rem;
    margin: 1rem 0;
}

.table-grid-field {
    border: 1px solid var(--border);
    border-radius: 0.4rem;
    padding: 0.6rem;
    background: var(--surface-soft);
}

.table-grid-field label {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 0.3rem;
}

.table-grid-field-value {
    font-size: 0.92rem;
    word-break: break-word;
}

.table-grid-field .editable-text-cell,
.table-grid-field .enum-select-cell,
.table-grid-field .boolean-cell {
    width: 100%;
}

.table-grid-field .editable-text-cell-input,
.table-grid-field select.enum-select-cell {
    width: 100%;
    box-sizing: border-box;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

.login-page {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 4rem 1rem;
    min-height: calc(100vh - 4rem);
}

.login-card {
    width: 100%;
    max-width: 24rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    padding: 2rem 2rem 1.75rem;
}

.login-title {
    margin: 0 0 1.5rem;
    text-align: center;
    outline: none;
    user-select: none;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.login-form .field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.login-form .field label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.login-form .field input[type="text"],
.login-form .field input[type="password"] {
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 0.45rem;
    background: var(--surface-soft);
    color: var(--text);
    width: 100%;
}

    .login-form .field input[type="text"]:focus,
    .login-form .field input[type="password"]:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    }

.login-form .field-inline {
    flex-direction: row;
    align-items: center;
}

    .login-form .field-inline label {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        font-weight: 500;
        color: var(--text);
    }

.login-submit {
    margin-top: 0.25rem;
    padding: 0.6rem 0.7rem;
    border-radius: 0.45rem;
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
}

    .login-submit:hover:not(:disabled) {
        background: var(--primary-strong);
        border-color: var(--primary-strong);
    }

    .login-submit:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

.login-card .error {
    margin-top: 1rem;
    padding: 0.6rem 0.75rem;
    border-radius: 0.45rem;
    background: var(--danger-bg);
    color: var(--danger-text);
    font-size: 0.9rem;
}

.request-list-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.request-list-header h1 {
    margin: 0;
}

.new-request-button {
    border-radius: 0.45rem;
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #ffffff;
    font-weight: 600;
    padding: 0.55rem 0.9rem;
    cursor: pointer;
}

    .new-request-button:hover {
        background: var(--primary-strong);
        border-color: var(--primary-strong);
    }

.new-request-page {
    width: min(640px, 100%);
    margin: 0 auto;
}

.new-request-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.new-request-form .field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.new-request-form .field label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.new-request-form input,
.new-request-form textarea,
.new-request-form select {
    padding: 0.6rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 0.45rem;
    background: var(--surface-soft);
    color: var(--text);
    width: 100%;
    font-size: 1rem;
}

    .new-request-form input:focus,
    .new-request-form textarea:focus,
    .new-request-form select:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    }

.new-request-item-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    background: var(--surface-soft);
    padding: 0.9rem;
}

.new-request-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
}

.new-request-item-header button {
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
}

.new-request-item-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.new-request-add-item {
    align-self: flex-start;
    border: 1px dashed var(--primary);
    background: transparent;
    color: var(--primary);
    border-radius: 0.45rem;
    padding: 0.6rem 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

    .new-request-add-item:hover {
        background: rgba(37, 99, 235, 0.06);
    }

.new-request-submit-bar {
    position: sticky;
    bottom: 0;
    padding: 0.75rem 0;
    background: linear-gradient(to top, var(--bg) 60%, transparent);
}

.new-request-submit {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
}

    .new-request-submit:hover:not(:disabled) {
        background: var(--primary-strong);
        border-color: var(--primary-strong);
    }

    .new-request-submit:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

.request-list table.request-list {
    width: 100%;
}

@media (max-width: 640px) {
    .app-content {
        width: 100%;
        margin: 0;
        padding: 0.85rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .new-request-item-row {
        grid-template-columns: 1fr;
    }

    table.request-list,
    table.request-list thead,
    table.request-list tbody,
    table.request-list th,
    table.request-list td,
    table.request-list tr {
        display: block;
    }

    table.request-list thead {
        display: none;
    }

    table.request-list tr.request-row {
        border: 1px solid var(--border);
        border-radius: 0.5rem;
        margin-bottom: 0.65rem;
        padding: 0.5rem 0.75rem;
        background: var(--surface);
    }

    table.request-list td {
        border: none;
        padding: 0.25rem 0;
        white-space: normal;
    }

    table.request-list td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--text-muted);
    }
}


.block-reason {
    margin: 0.4rem 0 0;
    font-size: 0.88rem;
    color: var(--text-muted);
}

/* ---------- Dashboard (UI spec §5) ---------- */

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.dashboard-header h1 {
    margin: 0;
}

/* Counter tiles (§5.1). Buttons rather than divs, because they navigate and
   must be reachable from the keyboard (§10). */
.dashboard-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.dashboard-tile {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem;
    text-align: left;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    cursor: pointer;
}

.dashboard-tile:hover {
    border-color: var(--primary);
}

.tile-value {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text);
}

.tile-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Two columns for the manager view; collapses at the §10 breakpoint. */
.dashboard-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 1100px) {
    .dashboard-columns {
        grid-template-columns: 1fr;
    }
}

.dashboard-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dashboard-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.9rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    cursor: pointer;
}

.dashboard-item:hover {
    border-color: var(--primary);
}

.item-number {
    font-weight: 600;
    white-space: nowrap;
}

.item-client {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-age,
.item-eta {
    font-size: 0.82rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.claim-button {
    padding: 0.35rem 0.7rem;
    font-size: 0.85rem;
    color: #fff;
    background: var(--primary);
    border: none;
    border-radius: 0.45rem;
    cursor: pointer;
}

.claim-button:hover:not(:disabled) {
    background: var(--primary-strong);
}

.claim-button:disabled {
    opacity: 0.6;
    cursor: default;
}

.empty-hint {
    margin: 0;
    padding: 0.9rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    background: var(--surface-soft);
    border: 1px dashed var(--border);
    border-radius: 0.6rem;
}

.link-button {
    padding: 0;
    margin-left: 0.35rem;
    font: inherit;
    color: var(--primary);
    background: none;
    border: none;
    text-decoration: underline;
    cursor: pointer;
}

/* Row skeletons rather than a full-screen spinner (§9). */
.dashboard-skeleton {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.skeleton-row {
    height: 3rem;
    border-radius: 0.6rem;
    background: linear-gradient(90deg, var(--surface-soft) 25%, var(--border) 37%, var(--surface-soft) 63%);
    background-size: 400% 100%;
    animation: skeleton-shimmer 1.4s ease infinite;
}

@keyframes skeleton-shimmer {
    from { background-position: 100% 50%; }
    to { background-position: 0 50%; }
}

@media (prefers-reduced-motion: reduce) {
    .skeleton-row {
        animation: none;
    }
}

.alert-danger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    color: var(--danger-text);
    background: var(--danger-bg);
    border: 1px solid currentColor;
    border-radius: 0.6rem;
}

.alert-danger button {
    padding: 0.35rem 0.75rem;
    color: var(--danger-text);
    background: transparent;
    border: 1px solid currentColor;
    border-radius: 0.45rem;
    cursor: pointer;
}

/* ---------- Registry tabs (UI spec §6.1) ---------- */

.registry-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.registry-tab {
    padding: 0.45rem 0.9rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
}

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

.registry-tab.is-active {
    color: var(--primary-strong);
    font-weight: 600;
    border-bottom-color: var(--primary-strong);
}

/* ---------- Status chips (UI spec §4.1) ---------- */

.status-chip {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 999px;
}

.status-new { color: #334155; background: #e2e8f0; }
.status-in-progress { color: #1d4ed8; background: #dbeafe; }
.status-ready { color: #6d28d9; background: #ede9fe; }
.status-sent { color: #0369a1; background: #e0f2fe; }
.status-revision { color: #b45309; background: #fef3c7; }
.status-confirmed { color: #047857; background: #d1fae5; }
.status-declined { color: #be123c; background: #ffe4e6; }
.status-ordered { color: #0f766e; background: #ccfbf1; }
.status-arrived { color: #4338ca; background: #e0e7ff; }
.status-completed { color: #166534; background: #dcfce7; }
.status-cancelled { color: #475569; background: #f1f5f9; }

