/* Admin portal. Bootstrap 5.3 first; this file only adds what Bootstrap doesn't have. */

:root {
    --tbs-page-bg: #f4f6f8;
}

body {
    background: var(--tbs-page-bg);
}

.skip-link {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 2000;
    padding: 0.5rem 1rem;
    background: #fff;
}

.icon {
    flex-shrink: 0;
    vertical-align: -0.15em;
}

.region-badge {
    background: #e7f1ff;
    color: #052c65;
    font-weight: 600;
}

.auth-card {
    margin-top: 2rem;
}
.code-input {
    letter-spacing: 0.3em;
    font-variant-numeric: tabular-nums;
}
.secret-key {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    font-family: var(--bs-font-monospace);
    font-size: 1.1rem;
    letter-spacing: 0.08em;
    background: var(--bs-tertiary-bg);
    border-radius: var(--bs-border-radius);
    word-break: break-all;
    user-select: all;
}

/* Status badges: icon plus words, never colour alone */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}
.status-operational { background-color: #d1e7dd; color: #0a3622; }
.status-degraded { background-color: #fff3cd; color: #664d03; }
.status-partial_outage { background-color: #ffe5d0; color: #653208; }
.status-major_outage { background-color: #f8d7da; color: #58151c; }
.status-maintenance { background-color: #cfe2ff; color: #052c65; }

/* Tables inside cards: line the first and last columns up with the card's own padding */
.card .table > :not(caption) > * > :first-child {
    padding-left: var(--bs-card-spacer-x);
}
.card .table > :not(caption) > * > :last-child {
    padding-right: var(--bs-card-spacer-x);
}
.card .table {
    --bs-table-bg: transparent;
}
.card .table-sm > :not(caption) > * > * {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

/* Status selects carry the status colour as well as its name, and stay a sensible width */
.status-select {
    display: inline-block;
    width: auto;
    min-width: 10.5rem;
    font-weight: 600;
}
.status-table .status-col {
    width: 12rem;
}
.status-grid .office-col {
    min-width: 10.5rem;
    vertical-align: bottom;
}
.status-table .group-row th {
    background: var(--bs-tertiary-bg);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bs-secondary-color);
}
.status-cell.is-unpublished {
    background: #fff8e1;
    box-shadow: inset 4px 0 0 #ffc107;
}
.status-cell.is-dirty {
    box-shadow: inset 4px 0 0 #198754;
}
.unpublished-note {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.75rem;
    color: #664d03;
}

.save-bar {
    position: sticky;
    bottom: 0;
    z-index: 10;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius-lg);
    box-shadow: 0 -0.25rem 0.75rem rgba(0, 0, 0, 0.05);
}

.row-actions form {
    display: inline;
}

.audit-json {
    max-height: 16rem;
    margin: 0;
    padding: 0.5rem;
    font-size: 0.75rem;
    background: var(--bs-tertiary-bg);
    border-radius: var(--bs-border-radius);
    white-space: pre-wrap;
    word-break: break-word;
}
