:root {
    --bs-body-bg: #f8fafd;
    --bs-body-color: #202124;
    --gs-bg: #f8fafd;
    --gs-surface: #ffffff;
    --gs-surface-alt: #f1f3f4;
    --gs-border: #dadce0;
    --gs-border-soft: #e8eaed;
    --gs-text: #202124;
    --gs-muted: #5f6368;
    --gs-subtle: #80868b;
    --gs-blue: #1a73e8;
    --gs-blue-hover: #185abc;
    --gs-blue-soft: #e8f0fe;
    --gs-green: #188038;
    --gs-green-soft: #e6f4ea;
    --gs-red: #d93025;
    --gs-red-soft: #fce8e6;
    --gs-yellow: #f9ab00;
    --gs-yellow-soft: #fef7e0;
    --gs-radius: 8px;
    --gs-radius-sm: 4px;
    --gs-shadow: 0 1px 2px rgba(60, 64, 67, 0.12);
    --surface: var(--gs-surface);
    --surface-soft: var(--gs-surface-alt);
    --ink: var(--gs-text);
    --muted: var(--gs-muted);
    --line: var(--gs-border);
    --brand: var(--gs-blue);
    --brand-dark: var(--gs-blue-hover);
    --success: var(--gs-green);
    --warning: #b06000;
    --danger: var(--gs-red);
}

html,
body {
    min-height: 100%;
}

body.admin-body,
body {
    background: var(--gs-bg);
    color: var(--bs-body-color);
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
    font-size: 14px;
    letter-spacing: 0;
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

.admin-shell {
    display: flex;
    min-height: 100vh;
    padding: 10px 10px 12px 0;
    background: var(--gs-bg);
}

.admin-sidebar {
    background: var(--gs-surface);
    border-right: 1px solid var(--gs-border);
    border-radius: var(--gs-radius);
    bottom: 12px;
    box-shadow: var(--gs-shadow);
    color: var(--gs-text);
    flex-direction: column;
    left: 0;
    overflow: hidden;
    position: fixed;
    top: 10px;
    left: 10px;
    width: 280px;
    z-index: 1040;
}

.sidebar-header {
    align-items: center;
    border-bottom: 1px solid var(--gs-border-soft);
    display: flex;
    justify-content: space-between;
    min-height: 64px;
    padding: 12px 16px;
}

.brand-lockup {
    align-items: center;
    color: var(--gs-text);
    display: inline-flex;
    min-width: 0;
    text-decoration: none;
}

.brand-mark {
    background: var(--gs-blue);
    border-radius: 50%;
    color: #fff;
    display: inline-grid;
    height: 36px;
    margin-right: 12px;
    place-items: center;
    width: 36px;
}

.brand-name,
.brand-subtitle {
    display: block;
    line-height: 1.2;
}

.brand-name {
    color: var(--gs-text);
    font-size: 1rem;
    font-weight: 500;
}

.brand-subtitle {
    color: var(--gs-muted);
    font-size: 0.78rem;
}

.sidebar-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 0 28px;
}

.admin-nav {
    padding: 0 8px;
}

.admin-nav .nav-section {
    color: var(--gs-muted);
    font-size: 0.72rem;
    font-weight: 700;
    margin: 18px 16px 6px;
    text-transform: uppercase;
}

.admin-nav .nav-section.active-section {
    color: var(--gs-blue);
}

.admin-nav .nav-link {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 0 20px 20px 0;
    color: var(--gs-text);
    display: flex;
    gap: 14px;
    min-height: 40px;
    margin: 0;
    padding: 0 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 120ms ease, color 120ms ease;
}

.admin-nav .nav-link span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-nav .nav-link i {
    color: var(--gs-muted);
    text-align: center;
    width: 20px;
}

.admin-nav .nav-link:hover {
    background: var(--gs-surface-alt);
    color: var(--gs-text);
}

.admin-nav .nav-link.active {
    background: var(--gs-blue-soft);
    color: #174ea6;
}

.admin-nav .nav-link.active i {
    color: var(--gs-blue);
}

.admin-main {
    flex: 1;
    margin-left: 300px;
    min-width: 0;
    padding-right: 10px;
    width: auto;
}

.admin-topbar {
    align-items: center;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--gs-border);
    border-radius: var(--gs-radius);
    box-shadow: var(--gs-shadow);
    display: flex;
    justify-content: space-between;
    min-height: 64px;
    padding: 10px 24px;
    position: sticky;
    top: 10px;
    z-index: 1020;
}

.topbar-kicker {
    color: var(--gs-muted);
    font-size: 0.78rem;
}

.topbar-title {
    color: var(--gs-text);
    font-size: 1rem;
    font-weight: 500;
}

.topbar-actions {
    align-items: center;
    display: flex;
    gap: 10px;
}

.content-frame {
    max-width: none;
    padding: 22px 12px 64px;
    width: 100%;
}

.mobile-appbar {
    align-items: center;
    background: var(--gs-surface);
    border-bottom: 1px solid var(--gs-border);
    display: flex;
    gap: 12px;
    left: 0;
    min-height: 56px;
    padding: 8px 12px;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 1030;
}

.mobile-brand {
    font-size: 1rem;
    font-weight: 500;
}

.icon-button {
    background: transparent;
    border: 0;
    border-radius: 50%;
    color: var(--gs-muted);
    display: inline-grid;
    height: 36px;
    place-items: center;
    text-decoration: none;
    width: 36px;
}

.icon-button:hover {
    background: var(--gs-surface-alt);
    color: var(--gs-text);
}

.workspace-shell {
    max-width: none;
}

.container-fluid {
    padding-left: 0;
    padding-right: 0;
}

.container-fluid > .d-flex.justify-content-between.align-items-center.mb-4,
.page-title-row {
    align-items: flex-start !important;
    border-bottom: 1px solid var(--gs-border-soft);
    gap: 16px;
    margin-bottom: 18px !important;
    padding-bottom: 16px;
}

.container-fluid > .d-flex.justify-content-between.align-items-center.mb-4 h2,
.container-fluid > .d-flex.justify-content-between.align-items-center.mb-4 h4,
.page-title-row h1,
.page-title-row h2 {
    color: var(--gs-text) !important;
    font-size: 1.55rem;
    font-weight: 500 !important;
    margin: 0;
}

.container-fluid > .alert {
    margin-bottom: 16px;
}

code {
    color: var(--gs-blue);
}

.font-monospace {
    font-family: "Cascadia Mono", Consolas, "Liberation Mono", monospace !important;
}

.fw-bold,
.fw-semibold {
    font-weight: 500 !important;
}

.text-dark {
    color: var(--gs-text) !important;
}

.page-header,
.section-heading,
.table-footer,
.attention-band,
.pipeline-step,
.review-row {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.page-header {
    gap: 24px;
    margin-bottom: 18px;
}

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

.page-header h1 {
    color: var(--ink);
    font-size: 1.65rem;
    font-weight: 500;
    line-height: 1.15;
    margin: 0;
}

.page-subtitle {
    color: var(--muted);
    margin: 6px 0 0;
    max-width: 720px;
}

.eyebrow {
    color: var(--brand);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    margin: 0 0 6px;
    text-transform: uppercase;
}

.summary-grid,
.readiness-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: 1.25fr repeat(3, 1fr);
    margin-bottom: 16px;
}

.summary-card,
.metric-panel,
.workspace-section {
    background: var(--gs-surface);
    border: 1px solid var(--line);
    border-radius: var(--gs-radius);
    box-shadow: none;
}

.card {
    background: var(--gs-surface);
    border: 1px solid var(--gs-border);
    border-radius: var(--gs-radius);
    box-shadow: none;
}

.card.border-0 {
    border: 1px solid var(--gs-border) !important;
}

.card-header {
    background: var(--gs-surface) !important;
    border-bottom: 1px solid var(--gs-border-soft);
    color: var(--gs-text);
    font-size: 0.95rem;
    font-weight: 500 !important;
    min-height: 48px;
    padding: 13px 16px;
}

.card-body {
    padding: 16px;
}

.shadow,
.shadow-sm,
.shadow-lg {
    box-shadow: none !important;
}

.summary-card,
.metric-panel {
    min-height: 118px;
    padding: 16px;
}

.metric-panel.primary {
    background: var(--gs-surface);
}

.summary-label,
.summary-note,
.metric-label,
.metric-note,
.pipeline-step span,
.review-main span {
    color: var(--muted);
    display: block;
    font-size: 0.85rem;
}

.summary-card strong,
.metric-panel strong {
    color: var(--ink);
    display: block;
    font-size: 1.45rem;
    line-height: 1;
    margin-top: 10px;
}

.summary-note,
.metric-note {
    margin-top: 10px;
}

.progress {
    background: var(--gs-blue-soft);
    border-radius: 999px;
    height: 8px;
}

.progress-bar {
    background: var(--brand);
}

.attention-band {
    background: var(--gs-yellow-soft);
    border: 1px solid #fdd663;
    border-radius: var(--gs-radius);
    color: #5f4300;
    gap: 16px;
    margin-bottom: 18px;
    padding: 14px 16px;
}

.attention-band span {
    display: block;
}

.workspace-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

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

.workspace-section {
    padding: 16px;
}

.section-heading {
    gap: 16px;
    margin-bottom: 16px;
}

.section-heading h2 {
    color: var(--ink);
    font-size: 1.05rem;
    font-weight: 500;
    margin: 0;
}

.section-heading p {
    color: var(--gs-muted);
    margin: 4px 0 0;
}

.pipeline-list,
.review-list {
    display: grid;
    gap: 10px;
}

.pipeline-step {
    border: 1px solid var(--line);
    border-radius: var(--gs-radius);
    color: var(--ink);
    gap: 14px;
    padding: 12px;
    text-decoration: none;
}

.pipeline-step:hover {
    border-color: #9bbcff;
    box-shadow: none;
}

.pipeline-step i {
    align-items: center;
    background: #eff6ff;
    border-radius: var(--gs-radius-sm);
    color: var(--brand);
    display: inline-flex;
    flex: 0 0 38px;
    height: 38px;
    justify-content: center;
}

.pipeline-step div {
    flex: 1;
}

.pipeline-step b {
    color: var(--brand-dark);
    font-size: 1.15rem;
}

.log-window {
    background: #202124;
    border-radius: var(--gs-radius);
    color: #e8eaed;
    font-family: "Cascadia Mono", Consolas, monospace;
    font-size: 0.82rem;
    height: 340px;
    overflow: auto;
    padding: 14px;
}

.review-panel {
    margin-bottom: 18px;
}

.review-row {
    border: 1px solid var(--line);
    border-radius: var(--gs-radius);
    gap: 14px;
    padding: 14px;
}

.review-main {
    flex: 1;
    min-width: 220px;
}

.review-main strong {
    color: var(--ink);
    display: block;
    font-family: "Cascadia Mono", Consolas, monospace;
    font-size: 0.95rem;
}

.review-actions {
    align-items: center;
    display: flex;
    flex: 0 0 min(560px, 55%);
    gap: 10px;
}

.source-chip,
.status-pill {
    align-items: center;
    background: #eef2ff;
    border: 1px solid #dbe3ff;
    border-radius: 999px;
    color: var(--gs-blue);
    display: inline-flex;
    font-size: 0.8rem;
    font-weight: 700;
    justify-content: center;
    min-width: 70px;
    padding: 5px 10px;
}

.source-chip.compact {
    min-width: 0;
}

.status-pill {
    background: var(--gs-green-soft);
    border-color: #c6e7cc;
    color: var(--gs-green);
}

.status-pill.muted {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #64748b;
}

.status-pill.warning {
    background: var(--gs-yellow-soft);
    border-color: #feefc3;
    color: #8a5a00;
}

.row-meta {
    color: var(--gs-muted);
    font-size: 0.78rem;
    margin-top: 4px;
}

.vote-stack {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 5px;
}

.vote-stack span {
    background: var(--gs-surface-alt);
    border: 1px solid var(--gs-border-soft);
    border-radius: var(--gs-radius-sm);
    color: var(--gs-muted);
    font-size: 0.75rem;
    padding: 2px 6px;
}

.heuristic-table tr.needs-review td {
    background: #fffdf7;
}

.heuristic-upload-form {
    max-width: 720px;
}

.heuristic-upload-field {
    min-width: 0;
}

.heuristic-upload-row {
    align-items: center;
    display: flex;
    gap: 10px;
}

.heuristic-upload-row .form-control {
    max-width: 520px;
}

.heuristic-upload-row .btn {
    flex: 0 0 auto;
}

.inline-decision-form {
    margin: 0;
}

.ignore-toggle {
    align-items: center;
    color: var(--muted);
    display: inline-flex;
    gap: 6px;
    white-space: nowrap;
}

.table-wrap {
    border: 1px solid var(--line);
    border-radius: var(--gs-radius);
    overflow: hidden;
}

.table {
    color: var(--ink);
    font-size: 0.88rem;
    margin-bottom: 0;
    --bs-table-bg: var(--gs-surface);
    --bs-table-hover-bg: #f8fafd;
    --bs-table-striped-bg: #fbfcff;
}

.table thead th {
    background: var(--gs-surface);
    border-bottom: 1px solid var(--line);
    color: var(--gs-muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
}

.table td {
    border-bottom: 1px solid var(--gs-border-soft);
    color: var(--gs-text);
    vertical-align: middle;
}

.mapping-workbench-table td,
.mapping-workbench-table th {
    padding-bottom: 0.55rem;
    padding-top: 0.55rem;
}

.mapping-workbench-table .form-select-sm {
    min-height: 32px;
}

.toolbar-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.toolbar-actions .form-control {
    min-width: 220px;
    width: auto;
}

.automation-form {
    align-items: end;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(260px, 1fr) minmax(420px, auto);
}

.automation-state {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.automation-state>div {
    border: 1px solid var(--gs-border-soft);
    border-radius: var(--gs-radius);
    min-height: 62px;
    padding: 10px 12px;
}

.automation-controls {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: auto 170px auto;
}

.automation-state strong {
    color: var(--gs-text);
    display: block;
    font-size: 0.95rem;
    font-weight: 500;
    margin-top: 2px;
}

.automation-controls .form-select {
    min-width: 0;
}

.automation-pipeline {
    display: grid;
    gap: 10px;
}

.automation-step {
    align-items: center;
    border: 1px solid var(--gs-border-soft);
    border-radius: var(--gs-radius);
    display: flex;
    gap: 12px;
    padding: 12px;
}

.automation-step i {
    align-items: center;
    background: var(--gs-blue-soft);
    border-radius: var(--gs-radius-sm);
    color: var(--gs-blue);
    display: inline-flex;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.automation-step strong,
.automation-step span {
    display: block;
}

.automation-step span {
    color: var(--gs-muted);
    font-size: 0.86rem;
    margin-top: 2px;
}

.automation-actions {
    align-items: center;
    border-top: 1px solid var(--gs-border-soft);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 16px;
    padding-top: 14px;
}

.automation-actions form {
    margin: 0;
}

.meta-label {
    color: var(--gs-muted);
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
}

.source-url {
    color: var(--gs-muted);
    font-size: 0.82rem;
    max-width: 420px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.publish-settings-grid {
    align-items: start;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1fr) 260px;
}

.publish-settings-main {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.publish-token-field {
    grid-column: 1 / -1;
}

.publish-settings-side {
    display: grid;
    gap: 12px;
}

.publish-actions {
    align-items: center;
    border-top: 1px solid var(--gs-border-soft);
    display: flex;
    gap: 12px;
    margin-top: 16px;
    padding-top: 14px;
}

.safety-gates-form {
    align-items: end;
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(180px, 1fr)) repeat(2, minmax(160px, 0.8fr)) auto;
}

.safety-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.protected-domain-form {
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
}

.import-export-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.import-export-actions {
    align-items: center;
    display: flex;
    gap: 12px;
}

.import-export-actions .form-control {
    max-width: 420px;
}

.backup-content-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.backup-content-list span {
    background: var(--gs-surface-alt);
    border: 1px solid var(--gs-border-soft);
    border-radius: var(--gs-radius-sm);
    color: var(--gs-text);
    font-size: 0.82rem;
    padding: 5px 8px;
}

.app-pattern-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 760px;
}

.app-pattern-list span {
    background: var(--gs-surface-alt);
    border: 1px solid var(--gs-border-soft);
    border-radius: var(--gs-radius-sm);
    color: var(--gs-muted);
    font-family: "Cascadia Mono", Consolas, "Liberation Mono", monospace;
    font-size: 0.78rem;
    padding: 4px 7px;
}

.app-pattern-editor {
    font-family: "Cascadia Mono", Consolas, "Liberation Mono", monospace;
    font-size: 0.86rem;
}

.table th,
.table td {
    padding: 0.72rem 0.85rem;
}

.table-hover tbody tr:hover {
    --bs-table-accent-bg: #f8fafd;
}

.empty-row {
    color: var(--gs-muted) !important;
    padding: 32px 16px !important;
    text-align: center;
}

.muted-row {
    color: #8a96a8;
}

.icon-btn {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--gs-radius-sm);
    color: var(--muted);
    display: inline-flex;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.icon-btn.danger:hover {
    border-color: #fecaca;
    color: var(--danger);
}

.table-footer,
.workspace-pagination {
    align-items: center;
    background: #fff;
    border-top: 1px solid var(--gs-border-soft);
    color: var(--gs-muted);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    min-height: 52px;
}

.page-status {
    color: var(--gs-muted);
    font-size: 0.82rem;
}

.pagination-controls {
    align-items: center;
    display: inline-flex;
    gap: 6px;
}

.pagination-btn {
    align-items: center;
    background: #fff;
    border: 1px solid var(--gs-border);
    border-radius: var(--gs-radius-sm);
    color: var(--gs-text);
    display: inline-flex;
    font-size: 0.84rem;
    font-weight: 500;
    gap: 6px;
    min-height: 32px;
    padding: 0 10px;
    text-decoration: none;
}

.pagination-btn:hover {
    background: var(--gs-surface-alt);
    border-color: #c4c7c5;
    color: var(--gs-blue);
}

.pagination-btn.disabled {
    color: var(--gs-subtle);
    opacity: 0.62;
    pointer-events: none;
}

.pagination-btn i {
    font-size: 0.78rem;
}

.empty-state {
    align-items: center;
    color: var(--muted);
    display: grid;
    gap: 8px;
    justify-items: center;
    padding: 44px;
    text-align: center;
}

.empty-state i {
    color: var(--success);
    font-size: 2.5rem;
}

.empty-state strong {
    color: var(--ink);
}

.btn {
    align-items: center;
    border-radius: var(--gs-radius-sm);
    display: inline-flex;
    gap: 6px;
    justify-content: center;
    font-weight: 500;
    letter-spacing: 0;
    line-height: 1.2;
    min-height: 36px;
}

.btn-sm {
    min-height: 32px;
    padding-left: 10px;
    padding-right: 10px;
}

.btn-primary {
    background: var(--brand);
    border-color: var(--brand);
}

.btn-primary:hover {
    background: var(--gs-blue-hover);
    border-color: var(--gs-blue-hover);
}

.btn-outline-primary {
    border-color: var(--gs-border);
    color: var(--gs-blue);
}

.btn-outline-primary:hover {
    background: var(--gs-blue-soft);
    border-color: var(--gs-blue);
    color: var(--gs-blue-hover);
}

.btn-secondary,
.btn-info,
.btn-success,
.btn-warning,
.btn-dark,
.btn-light,
.btn-outline-secondary,
.btn-outline-info,
.btn-outline-success,
.btn-outline-warning,
.btn-outline-dark,
.btn-outline-light {
    background: var(--gs-surface) !important;
    border-color: var(--gs-border) !important;
    box-shadow: none !important;
    color: var(--gs-text) !important;
}

.btn-secondary:hover,
.btn-info:hover,
.btn-success:hover,
.btn-warning:hover,
.btn-dark:hover,
.btn-light:hover,
.btn-outline-secondary:hover,
.btn-outline-info:hover,
.btn-outline-success:hover,
.btn-outline-warning:hover,
.btn-outline-dark:hover,
.btn-outline-light:hover {
    background: var(--gs-surface-alt) !important;
    border-color: var(--gs-border) !important;
    color: var(--gs-text) !important;
}

.btn-danger,
.btn-outline-danger:hover {
    background: var(--gs-red) !important;
    border-color: var(--gs-red) !important;
    color: #fff !important;
}

.btn-outline-danger {
    border-color: var(--gs-border);
    color: var(--gs-red);
}

.form-control,
.form-select {
    background-color: var(--gs-surface) !important;
    border: 1px solid var(--line);
    border-radius: var(--gs-radius-sm);
    box-shadow: none !important;
    color: var(--gs-text);
    min-height: 40px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--gs-blue);
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.18) !important;
}

.form-label {
    color: var(--gs-text);
    font-size: 0.82rem;
    font-weight: 500;
    margin-bottom: 6px;
}

.form-text,
.text-muted {
    color: var(--gs-muted) !important;
}

.input-group-text {
    background: var(--gs-surface-alt) !important;
    border-color: var(--gs-border);
    color: var(--gs-muted);
}

.badge {
    border-radius: 999px;
    font-weight: 500;
    padding: 0.35em 0.65em;
}

.badge.bg-secondary,
.badge.bg-info,
.badge.bg-primary {
    background: #f1f3f4 !important;
    border: 1px solid var(--gs-border-soft);
    color: var(--gs-text) !important;
}

.badge.bg-success {
    background: var(--gs-green-soft) !important;
    color: var(--gs-green) !important;
}

.badge.bg-danger {
    background: var(--gs-red-soft) !important;
    color: var(--gs-red) !important;
}

.badge.bg-warning {
    background: var(--gs-yellow-soft) !important;
    color: #8a5a00 !important;
}

.alert {
    border-radius: var(--gs-radius);
    border: 1px solid transparent;
}

.alert-info {
    background: var(--gs-blue-soft);
    border-color: #d2e3fc;
    color: var(--gs-text);
}

.alert-warning {
    background: var(--gs-yellow-soft);
    border-color: #feefc3;
    color: var(--gs-text);
}

.alert-danger {
    background: var(--gs-red-soft);
    border-color: #fad2cf;
    color: var(--gs-red);
}

.modal-content {
    border: 1px solid var(--gs-border);
    border-radius: var(--gs-radius);
    box-shadow: var(--gs-shadow);
}

.modal-header,
.modal-footer {
    border-color: var(--gs-border-soft);
}

.modal-title {
    font-size: 1rem;
    font-weight: 500;
}

.login-body,
.login-container {
    align-items: center;
    background: var(--gs-bg);
    display: flex;
    min-height: 100vh;
    justify-content: center;
    padding: 24px;
}

.login-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--gs-radius);
    box-shadow: var(--gs-shadow);
    max-width: 448px;
    padding: 40px;
    width: 100%;
}

.login-brand {
    align-items: center;
    color: var(--gs-text);
    display: flex;
    gap: 12px;
    margin-bottom: 34px;
    text-decoration: none;
}

.login-brand-mark {
    background: var(--gs-blue);
    border-radius: 50%;
    color: #fff;
    display: inline-grid;
    height: 40px;
    place-items: center;
    width: 40px;
}

.login-card h1 {
    font-size: 1.5rem;
    font-weight: 400;
    margin: 0 0 6px;
}

.login-subtitle {
    color: var(--gs-muted);
    font-size: 0.95rem;
    margin-bottom: 28px;
}

.login-footer {
    color: var(--gs-muted);
    display: flex;
    font-size: 0.8rem;
    gap: 16px;
    justify-content: space-between;
    margin-top: 28px;
}

@media (max-width: 1180px) {
    .summary-grid,
    .readiness-grid,
    .workspace-grid {
        grid-template-columns: 1fr 1fr;
    }

    .summary-card:first-child,
    .metric-panel.primary {
        grid-column: 1 / -1;
    }
}

@media (max-width: 820px) {
    .admin-shell {
        padding: 0;
    }

    .admin-sidebar {
        border-radius: 0;
        bottom: 0;
        height: calc(100vh - 56px);
        left: 0;
        top: 56px;
        width: min(88vw, 320px);
    }

    .admin-sidebar:not(.show) {
        display: none !important;
    }

    .admin-main {
        margin-left: 0;
        padding-right: 0;
        padding-top: 56px;
    }

    .admin-topbar {
        border-left: 0;
        border-radius: 0;
        border-right: 0;
        box-shadow: none;
        min-height: auto;
        padding: 18px 16px;
        position: static;
    }

    .topbar-actions {
        display: none;
    }

    .content-frame {
        padding: 18px 16px 56px;
    }

    .page-header,
    .attention-band,
    .review-row,
    .review-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .page-actions {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .page-actions .btn,
    .page-actions form {
        width: 100%;
    }

    .automation-form,
    .automation-state,
    .automation-controls {
        grid-template-columns: 1fr;
    }

    .automation-controls {
        align-items: stretch;
    }

    .toolbar-actions {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .heuristic-upload-row {
        align-items: stretch;
        flex-direction: column;
    }

    .heuristic-upload-row .form-control {
        max-width: none;
    }

    .publish-settings-grid,
    .publish-settings-main {
        grid-template-columns: 1fr;
    }

    .safety-gates-form,
    .safety-grid,
    .protected-domain-form,
    .import-export-grid {
        grid-template-columns: 1fr;
    }

    .import-export-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .import-export-actions .form-control {
        max-width: none;
    }

    .publish-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .automation-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .workspace-pagination {
        align-items: stretch;
        flex-direction: column;
    }

    .pagination-controls {
        justify-content: space-between;
        width: 100%;
    }

    .pagination-btn {
        flex: 1;
    }

    .summary-grid,
    .readiness-grid,
    .workspace-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-workspace-grid {
        grid-template-columns: 1fr;
    }

    .review-actions {
        flex-basis: auto;
    }
}
