/* Workspace-style admin console */
:root {
    --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.18), 0 1px 3px rgba(60, 64, 67, 0.12);
}

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

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

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--gs-text);
    font-weight: 500;
    letter-spacing: 0;
}

h1,
.h1 {
    font-size: 1.75rem;
}

h2,
.h2 {
    font-size: 1.45rem;
}

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

.admin-sidebar {
    position: fixed;
    inset: 10px auto 12px 10px;
    z-index: 1040;
    width: 280px;
    flex-direction: column;
    background: var(--gs-surface);
    border-right: 1px solid var(--gs-border);
    border-radius: var(--gs-radius);
    box-shadow: var(--gs-shadow);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

.admin-nav .nav-subitem .nav-link {
    min-height: 34px;
    padding-left: 28px;
    color: var(--gs-muted);
    font-size: 0.83rem;
}

.admin-nav .nav-subitem .nav-link i {
    display: inline-block;
    width: 18px;
    font-size: 0.82rem;
}

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

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

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

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

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

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

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

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

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

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

.container-fluid.mt-4 {
    margin-top: 0 !important;
    padding-right: 0;
    padding-left: 0;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gs-border-soft);
}

.page-header h1,
.page-header h2 {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 500;
}

.page-header p {
    max-width: 760px;
    margin: 5px 0 0;
    color: var(--gs-muted);
}

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

.btn i {
    margin-right: 0 !important;
}

.page-actions .form-select,
.toolbar-actions .form-select,
.page-actions .form-control,
.toolbar-actions .form-control {
    width: auto;
    min-width: 160px;
}

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

.toolbar-card .card-body,
.filter-card .card-body {
    padding: 14px 16px;
}

.data-card .card-body {
    padding: 0;
}

.data-card .card-footer {
    border-top: 1px solid var(--gs-border-soft);
    background: var(--gs-surface);
}

.section-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gs-border-soft);
    color: var(--gs-text);
    font-size: 0.95rem;
    font-weight: 500;
}

.section-label small {
    color: var(--gs-muted);
    font-weight: 400;
}

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

.settings-page .settings-grid > .card {
    margin-bottom: 0 !important;
}

.settings-page .settings-wide {
    grid-column: 1 / -1;
}

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

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

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

.card:hover {
    box-shadow: none;
}

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

.card-header .text-muted,
.card-header small {
    font-size: 0.78rem;
    font-weight: 400;
}

.card-header.bg-white {
    background: var(--gs-surface) !important;
}

.card-body {
    padding: 16px;
}

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

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

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

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

.btn-primary:hover,
.btn-primary:focus {
    border-color: var(--gs-blue-hover);
    background: var(--gs-blue-hover);
    box-shadow: none;
}

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

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

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

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

.btn-outline-secondary {
    border-color: var(--gs-border);
    color: var(--gs-text);
}

.btn-outline-secondary:hover {
    border-color: var(--gs-border);
    background: var(--gs-surface-alt);
    color: var(--gs-text);
}

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

.btn-danger {
    color: #ffffff;
}

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

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

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

.btn-outline-danger:hover {
    color: #ffffff;
}

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

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

.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-text,
.text-muted {
    color: var(--gs-muted) !important;
}

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

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

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

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

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

.table-responsive {
    border-radius: 0 0 var(--gs-radius) var(--gs-radius);
}

.table-sm th,
.table-sm td {
    padding: 0.48rem 0.7rem;
}

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

.row-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.btn-icon {
    display: inline-grid;
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    place-items: center;
}

.list-group {
    border-radius: var(--gs-radius);
}

.list-group-item {
    border-color: var(--gs-border-soft);
}

.list-group-item:first-child {
    border-top-left-radius: var(--gs-radius);
    border-top-right-radius: var(--gs-radius);
}

.list-group-item:last-child {
    border-bottom-right-radius: var(--gs-radius);
    border-bottom-left-radius: var(--gs-radius);
}

.draggable-item {
    cursor: grab;
}

.draggable-item:hover {
    background-color: #f8fafd;
}

.draggable-item:active {
    cursor: grabbing;
}

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

.badge.bg-secondary,
.badge.bg-info,
.badge.bg-primary {
    border: 1px solid var(--gs-border-soft);
    background: #f1f3f4 !important;
    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;
}

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

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

.modal-body {
    padding: 18px;
}

.modal-footer {
    gap: 8px;
}

.metric-card .card-body {
    display: flex;
    min-height: 94px;
    flex-direction: column;
    justify-content: center;
}

.metric-card small {
    color: var(--gs-muted);
    font-size: 0.75rem;
    font-weight: 700;
}

.metric-card h3 {
    margin: 6px 0 0;
    font-size: 1.65rem;
    font-weight: 500;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    min-height: 28px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 500;
}

.status-chip i {
    font-size: 0.62rem;
}

.status-chip-success {
    color: var(--gs-green);
    background: var(--gs-green-soft);
}

.report-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px;
    border: 1px solid #d2e3fc;
    border-radius: var(--gs-radius);
    background: var(--gs-blue-soft);
}

.report-hero h2 {
    margin: 3px 0 6px;
    font-size: 1.2rem;
}

.report-hero p {
    max-width: 740px;
    margin: 0;
    color: var(--gs-muted);
}

.report-hero-label {
    color: var(--gs-blue);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.report-hero-actions {
    display: flex;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 8px;
}

.report-card,
.report-choice {
    display: flex;
    height: 100%;
    color: var(--gs-text);
    text-decoration: none;
    background: var(--gs-surface);
    border: 1px solid var(--gs-border);
    border-radius: var(--gs-radius);
}

.report-card {
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
}

.report-card:hover,
.report-choice:hover {
    color: var(--gs-text);
    border-color: #c6dafc;
    background: #fbfcff;
}

.report-card strong,
.report-choice strong {
    display: block;
    margin-bottom: 3px;
    font-weight: 500;
}

.report-card small,
.report-choice small {
    display: block;
    color: var(--gs-muted);
    line-height: 1.35;
}

.report-card-icon {
    display: inline-grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border-radius: 50%;
    color: var(--gs-blue);
    background: var(--gs-blue-soft);
}

.report-card-alert .report-card-icon {
    color: var(--gs-red);
    background: var(--gs-red-soft);
}

.client-download-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    color: var(--gs-text);
    background: var(--gs-surface);
    border: 1px solid var(--gs-border);
    border-radius: var(--gs-radius);
}

.client-download-card strong {
    display: block;
    margin-bottom: 3px;
    font-weight: 500;
}

.client-download-card small {
    display: block;
    color: var(--gs-muted);
    line-height: 1.35;
}

.documentation-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 184px);
    min-height: 0;
    overflow: hidden;
}

.documentation-page .page-header {
    flex: 0 0 auto;
}

.documentation-shell {
    display: grid;
    flex: 1 1 auto;
    gap: 16px;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    align-items: start;
    min-height: 0;
}

.documentation-nav,
.documentation-reader {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    padding-right: 10px;
    padding-left: 10px;
}

.documentation-nav-body,
.documentation-reader-body {
    min-height: 0;
    overflow: auto;
    scrollbar-gutter: stable;
}

.documentation-nav-body::-webkit-scrollbar,
.documentation-reader-body::-webkit-scrollbar {
    width: 10px;
}

.documentation-nav-body::-webkit-scrollbar-thumb,
.documentation-reader-body::-webkit-scrollbar-thumb {
    background: #dadce0;
    border: 3px solid var(--gs-surface);
    border-radius: 999px;
}

.documentation-nav-body {
    padding: 8px;
}

.documentation-reader-body {
    padding: 18px 16px 20px;
}

.documentation-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.documentation-list-item {
    display: flex;
    width: 100%;
    gap: 12px;
    align-items: flex-start;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--gs-text);
    padding: 12px;
    text-align: left;
}

.documentation-list-item:hover,
.documentation-list-item.active {
    background: #f8fafd;
}

.documentation-list-item.active {
    background: #eef4ff;
    box-shadow: inset 3px 0 0 var(--gs-blue);
}

.documentation-list-icon {
    display: inline-grid;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    place-items: center;
    border-radius: 8px;
    background: var(--gs-blue-soft);
    color: var(--gs-blue);
}

.documentation-list-text {
    min-width: 0;
}

.documentation-list-text strong,
.documentation-list-text small {
    display: block;
}

.documentation-list-text strong {
    color: var(--gs-text);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
}

.documentation-list-text small {
    color: var(--gs-muted);
    font-size: 12px;
    margin-top: 3px;
}

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

.documentation-reader-header > div:first-child {
    min-width: 0;
}

.documentation-reader-header span {
    color: var(--gs-text);
    font-weight: 600;
}

.documentation-actions {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
}

.markdown-body {
    color: var(--gs-text);
    font-size: 14px;
    line-height: 1.65;
    max-width: 920px;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
    color: var(--gs-text);
    font-weight: 600;
    line-height: 1.3;
    margin: 1.35rem 0 .65rem;
}

.markdown-body h1 {
    font-size: 24px;
    margin-top: 0;
}

.markdown-body h2 {
    border-top: 1px solid var(--gs-border);
    font-size: 19px;
    padding-top: 18px;
}

.markdown-body h3 {
    font-size: 16px;
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol,
.markdown-body pre,
.markdown-body table {
    margin-bottom: 1rem;
}

.markdown-body code {
    background: #f1f3f4;
    border-radius: 4px;
    color: #3c4043;
    font-size: 13px;
    padding: 2px 5px;
}

.markdown-body pre {
    background: #f8fafd;
    border: 1px solid var(--gs-border);
    border-radius: 8px;
    color: #3c4043;
    overflow-x: auto;
    padding: 14px 16px;
}

.markdown-body pre code {
    background: transparent;
    border-radius: 0;
    padding: 0;
}

.markdown-body table {
    border-collapse: collapse;
    width: 100%;
}

.markdown-body th,
.markdown-body td {
    border: 1px solid var(--gs-border);
    padding: 9px 10px;
    vertical-align: top;
}

.markdown-body th {
    background: #f8fafd;
    font-weight: 600;
}

.markdown-body a {
    color: var(--gs-blue);
    text-decoration: none;
}

.markdown-body a:hover {
    text-decoration: underline;
}

.client-download-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--gs-border-soft);
    color: var(--gs-muted);
    font-size: 0.875rem;
}

.client-download-footer .btn {
    flex: 0 0 auto;
}

.backup-progress-panel {
    padding: 14px 16px;
    border: 1px solid var(--gs-border);
    border-radius: var(--gs-radius);
    background: #fbfcff;
}

.backup-progress {
    height: 10px;
    border-radius: 999px;
    background: var(--gs-surface-alt);
}

.backup-progress .progress-bar {
    background: var(--gs-blue);
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.report-choice {
    flex-direction: column;
    gap: 8px;
    padding: 14px;
}

.report-choice i {
    color: var(--gs-blue);
    font-size: 1.1rem;
}

.timeline-guide {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    margin-bottom: 14px;
    padding: 14px 16px;
    border: 1px solid var(--gs-border);
    border-radius: var(--gs-radius);
    background: #fbfcff;
}

.timeline-guide strong {
    display: block;
    margin-bottom: 3px;
    font-weight: 500;
}

.timeline-guide span {
    color: var(--gs-muted);
}

.timeline-brush-card .card-header {
    min-height: 46px;
}

.timeline-brush-card #heatmapContainer {
    border: 1px solid var(--gs-border-soft);
    border-radius: var(--gs-radius-sm);
    overflow: hidden;
    background: #fafafa;
}

.timeline-brush-card #selectionOverlay {
    border-color: var(--gs-blue) !important;
    background: var(--gs-blue) !important;
}

.report-page .filter-card {
    border-left: 0 !important;
}

.report-page .card-header .fw-bold,
.report-page .card-header.fw-bold,
.report-page .fw-bold.text-dark,
.report-page .fw-bold.text-primary,
.report-page .fw-bold.text-info,
.report-page .fw-bold.text-danger {
    color: var(--gs-text) !important;
    font-weight: 500 !important;
}

.report-page .report-metrics {
    row-gap: 12px;
}

.report-summary {
    display: grid;
    grid-template-columns: minmax(170px, 220px) minmax(0, 1fr) minmax(150px, 210px);
    gap: 12px;
}

.report-score-panel,
.report-summary-main,
.report-attention-panel {
    border: 1px solid var(--gs-border);
    border-radius: var(--gs-radius);
    background: var(--gs-surface);
    padding: 16px;
}

.report-score-panel,
.report-attention-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
}

.report-score-panel small,
.report-attention-panel small,
.report-summary-label {
    color: var(--gs-muted);
    font-size: 0.75rem;
    font-weight: 700;
}

.progress-ring-inner {
    display: flex;
    width: 84px;
    height: 84px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--gs-surface);
}

.progress-ring-inner h2 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 500;
}

.report-score-panel strong {
    margin-top: 8px;
    font-weight: 500;
}

.report-summary-main h2 {
    margin: 4px 0 6px;
    font-size: 1.25rem;
}

.report-summary-main p {
    max-width: 760px;
    margin: 0;
    color: var(--gs-muted);
}

.report-attention-panel strong {
    color: var(--gs-red);
    font-size: 2rem;
    font-weight: 500;
    line-height: 1.1;
}

.report-score-number {
    color: var(--gs-text);
    font-size: 2.4rem;
    font-weight: 500;
    line-height: 1;
}

.report-attention-panel span {
    color: var(--gs-muted);
}

.report-bar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.report-bar-row strong {
    font-weight: 500;
}

.report-page .progress {
    height: 10px !important;
    border-radius: 999px;
    background: var(--gs-surface-alt);
}

.report-page .report-metric-card .card-body {
    min-height: 92px;
}

.report-page .report-metric-card h2,
.report-page .report-metric-card h3 {
    margin: 0 0 5px;
    color: var(--gs-text) !important;
    font-size: 1.45rem;
    font-weight: 500 !important;
}

.report-page .report-metric-card small {
    color: var(--gs-muted);
    font-size: 0.75rem;
    font-weight: 700;
}

.report-page .report-table-card {
    height: 100%;
}

.report-page .report-table-card .card-body {
    padding: 0;
}

.report-page .report-table-card .table td,
.report-page .report-table-card .table th {
    white-space: nowrap;
}

.report-insight-list {
    display: flex;
    flex-direction: column;
}

.report-insight-row {
    display: flex;
    min-height: 64px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--gs-border-soft);
    color: var(--gs-text);
    text-decoration: none;
}

.report-insight-row:last-child {
    border-bottom: 0;
}

.report-insight-row:hover {
    background: #f8fafd;
    color: var(--gs-text);
}

.report-insight-row strong {
    display: block;
    font-size: 0.92rem;
    font-weight: 500;
}

.report-insight-row small {
    display: block;
    margin-top: 2px;
    color: var(--gs-muted);
    font-size: 0.76rem;
}

.report-insight-value {
    display: inline-flex;
    min-width: 36px;
    height: 28px;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border-radius: 14px;
    background: var(--gs-blue-soft);
    color: var(--gs-blue);
    font-size: 0.82rem;
    font-weight: 700;
}

.report-insight-empty {
    padding: 20px;
    color: var(--gs-muted);
    font-size: 0.88rem;
    text-align: center;
}

.report-trend-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.report-trend-grid > div {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--gs-border-soft);
    border-radius: var(--gs-radius);
    background: #fbfcff;
}

.report-trend-grid small,
.report-trend-grid span {
    display: block;
    color: var(--gs-muted);
    font-size: 0.74rem;
}

.report-trend-grid strong {
    display: block;
    margin: 4px 0;
    color: var(--gs-text);
    font-size: 1.35rem;
    font-weight: 500;
}

.report-preset-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-manage-panel {
    height: 100%;
    min-height: 420px;
    padding: 16px;
    border: 1px solid var(--gs-border-soft);
    border-radius: var(--gs-radius);
    background: #fbfcff;
}

.category-domain-table {
    max-height: 460px;
    overflow: auto;
    border: 1px solid var(--gs-border-soft);
    border-radius: var(--gs-radius);
    background: var(--gs-surface);
}

.category-domain-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--gs-surface);
}

.domain-filter-input {
    width: min(100%, 280px);
}

.policy-profile-desc {
    min-height: 20px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--gs-border-soft);
}

.policy-bulk-actions .btn {
    min-width: 0;
    flex: 1 1 0;
}

.report-page .timeline-brush-card .card-header span,
.report-page .data-card .card-header span {
    color: var(--gs-text);
    font-weight: 500;
}

.report-page #emptyState h3 {
    color: var(--gs-text) !important;
    font-size: 1.1rem;
    font-weight: 500;
}

.report-page #emptyState .fa-4x {
    font-size: 2.6rem;
}

.service-card {
    border-left: 4px solid var(--gs-green);
}

.service-card-passthrough {
    border-left-color: var(--gs-blue);
}

.operating-mode-toggle {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 4px;
    border: 1px solid var(--gs-border);
    border-radius: var(--gs-radius);
    background: #f8fafd;
}

.operating-mode-option {
    display: inline-flex;
    min-width: 0;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 8px;
    border: 1px solid transparent;
    border-radius: var(--gs-radius-sm);
    background: transparent;
    color: var(--gs-muted);
    font-size: 0.82rem;
    font-weight: 500;
}

.operating-mode-option:hover {
    background: var(--gs-surface);
    color: var(--gs-text);
}

.operating-mode-option.active {
    border-color: #d2e3fc;
    background: var(--gs-surface);
    color: var(--gs-blue);
    box-shadow: var(--gs-shadow);
}

.operating-mode-option:disabled {
    cursor: wait;
    opacity: 0.72;
}

.traffic-summary-card .card-header {
    gap: 12px;
}

.traffic-summary-body {
    display: flex;
    min-height: 230px;
}

.traffic-summary {
    display: flex;
    width: 100%;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
}

.traffic-summary-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 16px;
    border: 1px solid #d2e3fc;
    border-radius: var(--gs-radius);
    background: #f8fbff;
}

.traffic-summary-hero span,
.traffic-summary-tile span {
    display: block;
    color: var(--gs-muted);
    font-size: 0.75rem;
    font-weight: 700;
}

.traffic-summary-hero strong {
    display: block;
    margin-top: 4px;
    color: var(--gs-text);
    font-size: 2.1rem;
    font-weight: 500;
    line-height: 1;
}

.traffic-summary-rate {
    display: inline-flex;
    min-width: 64px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    background: var(--gs-green-soft);
    color: var(--gs-green);
    font-size: 1rem;
    font-weight: 700;
}

.traffic-summary-rate-active {
    background: var(--gs-red-soft);
    color: var(--gs-red);
}

.traffic-summary-progress {
    display: flex;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--gs-surface-alt);
}

.traffic-summary-progress-allow {
    min-width: 0;
    background: var(--gs-green);
}

.traffic-summary-progress-block {
    min-width: 0;
    background: var(--gs-red);
}

.traffic-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.traffic-summary-tile {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--gs-border-soft);
    border-radius: var(--gs-radius);
    background: #fbfcff;
}

.traffic-summary-tile strong {
    display: block;
    margin-top: 6px;
    color: var(--gs-text);
    font-size: 1.35rem;
    font-weight: 500;
    line-height: 1.1;
}

.traffic-summary-tile-allow strong {
    color: var(--gs-green);
}

.traffic-summary-tile-block strong {
    color: var(--gs-red);
}

.bg-primary,
.text-bg-primary {
    background-color: var(--gs-blue) !important;
}

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

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

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

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

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

.bg-secondary {
    background-color: var(--gs-muted) !important;
}

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

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

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

.modal-subtitle {
    margin-top: 3px;
    color: var(--gs-muted);
    font-size: 0.875rem;
}

.directory-connection-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.directory-form-section {
    padding: 16px;
    border: 1px solid var(--gs-border);
    border-radius: var(--gs-radius);
    background: var(--gs-surface);
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gs-border-soft);
}

.section-heading span {
    color: var(--gs-text);
    font-weight: 600;
}

.section-heading small {
    max-width: 560px;
    color: var(--gs-muted);
    line-height: 1.4;
    text-align: right;
}

.directory-provider-grid,
.directory-security-grid {
    display: grid;
    gap: 12px;
}

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

.directory-security-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.directory-provider-card,
.directory-security-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    height: 100%;
    padding: 14px;
    border: 1px solid var(--gs-border);
    border-radius: var(--gs-radius);
    background: #fff;
    color: var(--gs-text);
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

.directory-provider-card:hover,
.directory-security-card:hover {
    border-color: #c6dafc;
    background: #fbfcff;
}

.btn-check:checked + .directory-provider-card,
.btn-check:checked + .directory-security-card {
    border-color: var(--gs-blue);
    background: #f4f8ff;
    box-shadow: inset 3px 0 0 var(--gs-blue);
}

.directory-provider-card i,
.directory-security-card i {
    display: inline-grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border-radius: 8px;
    background: var(--gs-blue-soft);
    color: var(--gs-blue);
}

.directory-provider-card strong,
.directory-security-card strong,
.directory-provider-card small,
.directory-security-card small {
    display: block;
}

.directory-provider-card strong,
.directory-security-card strong {
    margin-bottom: 3px;
    font-weight: 600;
}

.directory-provider-card small,
.directory-security-card small {
    color: var(--gs-muted);
    line-height: 1.35;
}

.directory-enable-switch {
    padding: 10px 12px 10px 44px;
    border: 1px solid var(--gs-border-soft);
    border-radius: 8px;
    background: #f8fafd;
}

.directory-inline-note {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 14px;
    padding: 10px 12px;
    border: 1px solid #d2e3fc;
    border-radius: 8px;
    background: var(--gs-blue-soft);
    color: var(--gs-text);
    font-size: 0.875rem;
}

.directory-inline-note i {
    color: var(--gs-blue);
    margin-top: 2px;
}

.directory-filter-field,
.directory-cert-field {
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.875rem;
}

.directory-test-result {
    margin-top: 14px;
    padding: 14px 16px;
    border: 1px solid var(--gs-border);
    border-radius: var(--gs-radius);
    background: #f8fafd;
}

.directory-test-result-success {
    border-color: #ceead6;
    background: #f7fcf8;
}

.directory-test-result-error {
    border-color: #f4c7c3;
    background: #fff8f7;
}

.directory-test-heading {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
    color: var(--gs-text);
    font-weight: 600;
}

.directory-test-result-success .directory-test-heading i {
    color: var(--gs-green);
}

.directory-test-result-error .directory-test-heading i {
    color: var(--gs-red);
}

.directory-test-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.directory-test-step {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 12px;
    border: 1px solid var(--gs-border-soft);
    border-radius: 8px;
    background: #fff;
}

.directory-test-step i {
    margin-top: 2px;
}

.directory-test-step-success i {
    color: var(--gs-green);
}

.directory-test-step-warning i {
    color: var(--gs-yellow);
}

.directory-test-step-error i {
    color: var(--gs-red);
}

.directory-test-step strong,
.directory-test-step small {
    display: block;
}

.directory-test-step strong {
    color: var(--gs-text);
    font-weight: 600;
}

.directory-test-step small {
    color: var(--gs-muted);
    line-height: 1.35;
}

.directory-test-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.directory-test-counts span {
    display: inline-flex;
    gap: 5px;
    align-items: baseline;
    padding: 7px 10px;
    border: 1px solid var(--gs-border-soft);
    border-radius: 999px;
    background: #fff;
    color: var(--gs-muted);
}

.directory-test-counts strong {
    color: var(--gs-text);
}

.directory-test-samples {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 14px;
}

.directory-test-samples > div {
    padding: 12px;
    border: 1px solid var(--gs-border-soft);
    border-radius: 8px;
    background: #fff;
}

.directory-test-samples > div > strong {
    display: block;
    margin-bottom: 8px;
    color: var(--gs-text);
}

.directory-test-sample-row {
    padding: 8px 0;
    border-top: 1px solid var(--gs-border-soft);
}

.directory-test-sample-row span,
.directory-test-sample-row small {
    display: block;
}

.directory-test-sample-row span {
    color: var(--gs-text);
    font-weight: 500;
}

.directory-test-sample-row small {
    color: var(--gs-muted);
    overflow-wrap: anywhere;
}

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

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

    .admin-sidebar {
        inset: 56px auto 0 0;
        width: min(88vw, 320px);
        height: calc(100vh - 56px);
        border-radius: 0;
        box-shadow: var(--gs-shadow);
    }

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

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

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

    .topbar-actions {
        display: none;
    }

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

    .container-fluid > .d-flex.justify-content-between.align-items-center.mb-4 {
        align-items: flex-start !important;
        flex-direction: column;
    }

    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .page-actions {
        width: 100%;
        justify-content: flex-start;
    }

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

    .settings-page .settings-grid {
        grid-template-columns: 1fr;
    }

    .report-hero,
    .timeline-guide {
        align-items: flex-start;
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .report-summary {
        grid-template-columns: 1fr;
    }

    .report-grid {
        grid-template-columns: 1fr;
    }

    .report-trend-grid {
        grid-template-columns: 1fr;
    }

    .traffic-summary-grid {
        grid-template-columns: 1fr;
    }

    .traffic-summary-hero {
        flex-direction: column;
    }

    .report-hero-actions,
    .report-hero-actions .btn {
        width: 100%;
    }

    .documentation-page {
        display: block;
        height: auto;
        overflow: visible;
    }

    .documentation-shell {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 0;
    }

    .documentation-nav,
    .documentation-reader {
        height: auto;
    }

    .documentation-nav-body,
    .documentation-reader-body {
        max-height: none;
        overflow: visible;
    }

    .documentation-reader-body {
        padding: 18px;
    }

    .documentation-reader-header {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .section-heading {
        flex-direction: column;
        gap: 4px;
    }

    .section-heading small {
        max-width: none;
        text-align: left;
    }

    .directory-provider-grid,
    .directory-security-grid {
        grid-template-columns: 1fr;
    }

    .directory-test-grid,
    .directory-test-samples {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    .report-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media print {
    .admin-sidebar,
    .admin-topbar,
    .filter-card,
    .page-actions,
    #emptyState {
        display: none !important;
    }

    .admin-main {
        margin-left: 0 !important;
        padding-top: 0 !important;
    }

    .content-frame,
    .container-fluid {
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .card,
    .report-summary {
        border-color: #dadce0 !important;
        box-shadow: none !important;
        break-inside: avoid;
    }

    body {
        background: #fff !important;
    }
}
