* {
    box-sizing: border-box;
}

:root {
    color-scheme: dark;
    --background: #06111e;
    --surface: #0b1827;
    --surface-soft: #0e1d2d;
    --surface-raised: #151e2d;
    --border: #202b3d;
    --border-soft: #192b3d;
    --text: #f3f7fb;
    --text-soft: #9aa9bd;
    --text-muted: #8494a9;
    --cyan: #21c7e8;
    --cyan-soft: rgba(33, 199, 232, 0.12);
    --violet: #9c7cff;
    --amber: #f5ad45;
    --green: #35d39a;
    --danger: #f06a7a;
    --sidebar-width: 276px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid var(--cyan);
    outline-offset: 3px;
}

.mobile-menu-toggle {
    display: none;
}

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

body {
    margin: 0;
    background:
        radial-gradient(circle at 72% -12%, rgba(22, 164, 209, 0.09), transparent 42rem),
        var(--background);
    color: var(--text);
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

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

.ui-icon {
    display: block;
    flex: 0 0 auto;
}

/* ---------- login ---------- */

.login-page {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 430px;
    padding: 34px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: rgba(13, 19, 31, 0.96);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.42);
}

.brand {
    color: var(--cyan);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.24em;
}

.login-card h1 {
    margin: 14px 0 0;
    font-size: 30px;
}

.subtitle {
    margin: 8px 0 28px;
    color: var(--text-soft);
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 600;
}

.remember {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0 20px;
    color: var(--text-soft);
    font-size: 14px;
}

.primary-button {
    width: 100%;
    padding: 13px 18px;
    border: 0;
    border-radius: 12px;
    background: var(--cyan);
    color: #062933;
    font-weight: 800;
}

.primary-button:hover {
    filter: brightness(1.08);
}

html[data-theme="light"] .login-card {
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 30px 90px rgba(48, 67, 88, 0.15);
}

/* ---------- Application shell ---------- */

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

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    display: flex;
    width: var(--sidebar-width);
    flex-direction: column;
    border-right: 1px solid var(--border-soft);
    overflow-y: auto;
    background: rgba(5, 16, 28, 0.98);
}

.sidebar-brand {
    display: flex;
    min-height: 70px;
    align-items: center;
    gap: 12px;
    padding: 0 22px;
    border-bottom: 1px solid var(--border-soft);
}

.brand-mark {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border: 1px solid rgba(33, 199, 232, 0.38);
    border-radius: 11px;
    background: linear-gradient(145deg, rgba(33, 199, 232, 0.18), rgba(33, 199, 232, 0.04));
    color: var(--cyan);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.brand-name {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.brand-description {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 10px;
}

.sidebar-section-label {
    padding: 15px 24px 6px;
    color: #526176;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.17em;
    text-transform: uppercase;
}

.sidebar-section-label:first-of-type {
    padding-top: 16px;
}

.sidebar-nav {
    display: grid;
    gap: 2px;
    padding: 0 12px;
}

.sidebar-link {
    position: relative;
    display: flex;
    min-height: 36px;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border-radius: 9px;
    color: #8797ab;
    font-size: 12.5px;
    font-weight: 600;
    transition: 160ms ease;
}

.sidebar-nav-icon {
    flex: 0 0 auto;
    opacity: 1;
}

.sidebar-link:hover:not(.is-disabled) {
    background: var(--surface-soft);
    color: var(--text);
}

.sidebar-link.is-disabled {
    color: #4c5a6e;
    cursor: default;
}

.sidebar-badge-soon {
    padding: 2px 6px;
    margin-left: auto;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--text-muted);
    font-size: 8.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.sidebar-link.is-active {
    background: linear-gradient(90deg, rgba(33, 199, 232, 0.15), rgba(33, 199, 232, 0.05));
    color: var(--cyan);
}

.sidebar-link.is-active::before {
    position: absolute;
    left: -12px;
    width: 3px;
    height: 24px;
    border-radius: 0 4px 4px 0;
    background: var(--cyan);
    content: "";
}

.sidebar-link-icon {
    display: grid;
    width: 23px;
    place-items: center;
}

.sidebar-footer {
    margin-top: auto;
    padding: 18px;
}

.environment-status {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: var(--surface);
}

.environment-status .status-dot {
    margin-top: 5px;
}

.environment-status strong,
.environment-status span {
    display: block;
}

.environment-status strong {
    font-size: 11px;
}

.environment-status span {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 9px;
}

.sidebar-version {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 8px;
    padding: 0 2px;
    color: var(--text-muted);
    font-size: 9px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.sidebar-version-badge {
    padding: 2px 6px;
    border-radius: 20px;
    background: rgba(53, 211, 154, 0.1);
    color: var(--green);
    font-family: inherit;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 4px rgba(53, 211, 154, 0.1);
}

.status-dot.is-warning {
    background: var(--amber);
    box-shadow: 0 0 0 4px rgba(245, 173, 69, 0.1);
}

.app-content {
    min-width: 0;
    margin-left: var(--sidebar-width);
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 15;
    display: flex;
    min-height: 70px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 0 30px;
    border-bottom: 1px solid var(--border-soft);
    background: rgba(6, 17, 30, 0.9);
    backdrop-filter: blur(18px);
}

.topbar-actions {
    display: flex;
    align-items: center;
    margin-left: auto;
    gap: 16px;
}

.topbar-icon-button {
    position: relative;
    display: grid;
    width: 39px;
    height: 39px;
    place-items: center;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text-soft);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    display: grid;
    width: 37px;
    height: 37px;
    place-items: center;
    border: 1px solid rgba(33, 199, 232, 0.35);
    border-radius: 10px;
    background: var(--cyan-soft);
    color: var(--cyan);
    font-size: 13px;
    font-weight: 800;
}

.user-details {
    min-width: 112px;
}

.user-details strong,
.user-details span {
    display: block;
}

.user-details strong {
    font-size: 12px;
}

.user-details span {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 9px;
}

.account-menu {
    position: relative;
}

.account-menu-toggle {
    padding: 3px 5px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    text-align: left;
    list-style: none;
}

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

.account-menu-toggle:hover,
.account-menu[open] .account-menu-toggle {
    border-color: var(--border-soft);
    background: var(--surface);
}

.account-menu-chevron {
    margin-left: 2px;
    color: var(--text-muted);
    font-size: 10px;
    transition: transform 150ms ease;
}

.account-menu[open] .account-menu-chevron {
    transform: rotate(180deg);
}

.account-menu-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 80;
    width: 230px;
    padding: 8px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}

.account-menu-header {
    padding: 9px 10px 11px;
    border-bottom: 1px solid var(--border-soft);
}

.account-menu-header strong,
.account-menu-header span {
    display: block;
}

.account-menu-header strong {
    font-size: 12px;
}

.account-menu-header span {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 9px;
}

.account-menu-item {
    display: flex;
    width: 100%;
    min-height: 36px;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    text-align: left;
    text-decoration: none;
}

.account-menu-item:hover {
    background: var(--surface-soft);
    color: var(--text);
}

.account-menu-divider {
    height: 1px;
    margin: 6px 4px;
    background: var(--border-soft);
}

.account-menu-logout {
    color: var(--danger);
}

.actions-menu {
    position: relative;
    display: inline-flex;
}

.actions-menu-toggle {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

.actions-menu-toggle:hover,
.actions-menu-toggle[aria-expanded="true"] {
    border-color: var(--border-soft);
    background: var(--surface-soft);
    color: var(--text);
}

.actions-menu-dropdown {
    position: fixed;
    z-index: 90;
    width: 190px;
    padding: 6px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}

.actions-menu-dropdown[hidden] {
    display: none;
}

.actions-menu-item {
    display: flex;
    width: 100%;
    min-height: 34px;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
    font: inherit;
    font-size: 11.5px;
    text-align: left;
    text-decoration: none;
}

.actions-menu-item:hover {
    background: var(--surface-soft);
    color: var(--text);
}

.actions-menu-item-danger {
    color: var(--danger);
}

.actions-menu-item-danger:hover {
    background: rgba(240, 106, 122, 0.12);
    color: var(--danger);
}

.actions-menu-divider {
    height: 1px;
    margin: 5px 4px;
    background: var(--border-soft);
}

.user-avatar-large {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    font-size: 17px;
}

.user-avatar.has-symbol {
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.18), transparent 42%),
        var(--cyan-soft);
}

.user-avatar-symbol {
    font-size: 1.45em;
    line-height: 1;
}

.avatar-picker {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.avatar-option {
    position: relative;
    display: flex;
    min-width: 0;
    align-items: center;
    flex-direction: column;
    gap: 7px;
    padding: 12px 8px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: var(--surface-soft);
    cursor: pointer;
    text-align: center;
    transition:
        transform 150ms ease,
        border-color 150ms ease,
        background 150ms ease;
}

.avatar-option:hover {
    transform: translateY(-2px);
    border-color: rgba(33, 199, 232, 0.38);
}

.avatar-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.avatar-option:has(input:checked) {
    border-color: var(--cyan);
    background: var(--cyan-soft);
    box-shadow: 0 0 0 2px rgba(33, 199, 232, 0.12);
}

.avatar-option-label {
    overflow: hidden;
    width: 100%;
    color: var(--text-soft);
    font-size: 9px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avatar-option:has(input:checked) .avatar-option-label {
    color: var(--cyan);
}

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

.profile-sidebar {
    display: grid;
    align-self: start;
    gap: 18px;
}

.profile-summary-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    align-self: start;
}

.profile-summary-card h2 {
    margin: 3px 0 5px;
    font-size: 18px;
}

.profile-summary-card > div {
    min-width: 0;
}

.profile-account-card {
    min-width: 0;
}

.profile-account-value {
    overflow: hidden;
    max-width: 100%;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html[data-theme="light"] .avatar-option {
    background: #f7fafc;
}

html[data-theme="light"] .avatar-option:has(input:checked) {
    background: rgba(19, 185, 214, 0.1);
}

@media (max-width: 1100px) {
    .avatar-picker {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .profile-layout {
        grid-template-columns: 1fr;
    }

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

.theme-switch {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    width: 48px;
    height: 24px;
    align-items: center;
    padding: 0 6px;
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    transition:
        color 150ms ease,
        border-color 150ms ease;
}

.theme-switch:hover {
    border-color: var(--cyan);
}

.theme-switch-icon {
    flex: 0 0 auto;
}

.theme-switch.is-dashboard-theme-switch {
    width: 58px;
    height: 30px;
    justify-content: space-between;
    padding: 0 8px;
    color: var(--text-muted);
}

.theme-switch.is-dashboard-theme-switch .theme-switch-icon {
    width: 13px;
    height: 13px;
}

.theme-switch.is-dashboard-theme-switch .theme-switch-thumb {
    width: 24px;
    height: 24px;
}

html[data-theme="light"] .theme-switch.is-dashboard-theme-switch .theme-switch-thumb {
    transform: translateX(28px);
}

.theme-switch.is-dashboard-theme-switch .theme-switch-sun {
    color: var(--amber);
}

.theme-switch.is-dashboard-theme-switch .theme-switch-moon {
    color: #8ba4c2;
}

.theme-switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: var(--text-muted);
    transition: transform 200ms ease, background 200ms ease;
}

html[data-theme="light"] .theme-switch-thumb {
    background: var(--cyan);
    transform: translateX(24px);
}

/* ---------- page content / heading ---------- */

.page-content {
    width: min(1500px, 100%);
    margin: 0 auto;
    padding: 30px;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 26px;
}

/* Cabecalho da Dashboard: mantem eyebrow/h1/subtitulo, so reduz o espaco
   antes dos cards pra aproveitar melhor telas 1366x768. */
.page-heading-dashboard {
    margin-bottom: 18px;
}

.page-eyebrow {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--cyan);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.page-heading h1 {
    margin: 9px 0 7px;
    font-size: clamp(25px, 3vw, 34px);
    letter-spacing: -0.035em;
}

.page-heading p {
    max-width: 720px;
    margin: 0;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.6;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

/* Cabecalho compacto: telas CRUD de listagem (Empresas, Fontes, Licencas,
   Usuarios, Endpoints RPZ). O dashboard mantem o .page-heading grande. */
.page-heading-compact {
    align-items: center;
    margin-bottom: 16px;
}

.page-heading-compact h1 {
    margin: 0 0 2px;
    font-size: 20px;
    letter-spacing: -0.02em;
}

.page-heading-compact p {
    margin: 0;
    color: var(--text-muted);
    font-size: 11.5px;
}

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

.metric-card {
    min-width: 0;
    min-height: 176px;
    padding: 20px 22px;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.012), transparent),
        var(--surface);
}

.metric-card-header,
.metric-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.metric-card-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

.metric-icon {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 10px;
}

.metric-icon.cyan {
    background: rgba(33, 199, 232, 0.12);
    color: var(--cyan);
}

.metric-icon.violet {
    background: rgba(156, 124, 255, 0.12);
    color: var(--violet);
}

.metric-icon.amber {
    background: rgba(245, 173, 69, 0.12);
    color: var(--amber);
}

.metric-icon.green {
    background: rgba(53, 211, 154, 0.12);
    color: var(--green);
}

.metric-state {
    padding: 4px 7px;
    border: 1px solid rgba(53, 211, 154, 0.18);
    border-radius: 20px;
    background: rgba(53, 211, 154, 0.06);
    color: var(--green);
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
}

.metric-value {
    margin-top: 17px;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.metric-label {
    color: #b7c9dd;
    font-size: 12px;
    font-weight: 600;
}

.metric-value-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
}

.metric-footer {
    gap: 8px;
    margin-top: 11px;
    padding-top: 0;
    border-top: 0;
    color: var(--text-muted);
    font-size: 9px;
}

.metric-card-primary {
    border-color: rgba(33, 199, 232, 0.9);
    background:
        linear-gradient(145deg, rgba(33, 199, 232, 0.06), transparent),
        var(--surface);
    box-shadow: 0 0 18px rgba(33, 199, 232, 0.12), inset 0 0 22px rgba(33, 199, 232, 0.025);
}

.metric-card-primary .metric-value {
    font-size: 32px;
}

.metric-value-suffix {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
}

.metric-progress {
    height: 4px;
    margin-top: 12px;
    border-radius: 999px;
    background: var(--border-soft);
    overflow: hidden;
}

.metric-progress-bar {
    height: 100%;
    border-radius: 999px;
}

.metric-progress-bar.amber { background: var(--amber); }
.metric-progress-bar.violet { background: var(--violet); }
.metric-progress-bar.cyan { background: var(--cyan); }
.metric-progress-bar.green { background: var(--green); }

.dashboard-table-footer {
    margin: 10px 2px 0;
    color: var(--text-muted);
    font-size: 10px;
}

.admin-dashboard .dashboard-sources-table {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
}

.admin-dashboard .dashboard-sources-table .source-name-column { width: 37%; }
.admin-dashboard .dashboard-sources-table .source-type-column { width: 11%; }
.admin-dashboard .dashboard-sources-table .source-scope-column { width: 9%; }
.admin-dashboard .dashboard-sources-table .source-count-column { width: 9%; }
.admin-dashboard .dashboard-sources-table .source-updated-column { width: 20%; }
.admin-dashboard .dashboard-sources-table .source-status-column { width: 14%; }

.admin-dashboard .dashboard-sources-table th,
.admin-dashboard .dashboard-sources-table td {
    padding-right: 6px;
    padding-left: 6px;
}

.admin-dashboard .dashboard-sources-table th {
    font-size: 7.5px;
    letter-spacing: 0.07em;
}

.admin-dashboard .dashboard-sources-table td {
    font-size: 10.5px;
}

.admin-dashboard .dashboard-sources-table .status-pill {
    gap: 3px;
    padding-right: 6px;
    padding-left: 6px;
}

.admin-dashboard .dashboard-sources-table .source-name-cell {
    min-width: 0;
}

.admin-dashboard .dashboard-sources-table .source-name-cell .table-primary-link {
    display: -webkit-box;
    overflow: hidden;
    line-height: 1.3;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.endpoint-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-soft);
    color: var(--text-muted);
    font-size: 10px;
}

.endpoint-summary span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.endpoint-summary strong {
    color: var(--text-soft);
}

.summary-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
}

.summary-dot.is-normal { background: var(--green); }
.summary-dot.is-warning { background: var(--amber); }
.summary-dot.is-muted { background: var(--text-muted); }

.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.activity-feed-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 10px 4px;
    border-bottom: 1px solid var(--border-soft);
}

.activity-feed-item:last-child {
    border-bottom: 0;
}

.activity-feed-icon {
    display: grid;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 8px;
}

.activity-feed-icon.cyan { background: rgba(33, 199, 232, 0.12); color: var(--cyan); }
.activity-feed-icon.violet { background: rgba(156, 124, 255, 0.12); color: var(--violet); }
.activity-feed-icon.amber { background: rgba(245, 173, 69, 0.12); color: var(--amber); }
.activity-feed-icon.green { background: rgba(53, 211, 154, 0.12); color: var(--green); }
.activity-feed-icon.danger { background: rgba(240, 106, 122, 0.12); color: var(--danger); }
.activity-feed-icon.warning { background: rgba(245, 173, 69, 0.12); color: var(--amber); }
.activity-feed-icon.muted { background: var(--surface-soft); color: var(--text-muted); }

.activity-feed-body {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.activity-feed-body strong {
    font-size: 11.5px;
}

.activity-feed-body span {
    display: -webkit-box;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 11px;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.activity-feed-time {
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 10px;
    white-space: nowrap;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(380px, 1fr);
    gap: 14px;
    margin-top: 14px;
}

.panel-wide {
    grid-column: 1 / -1;
}

/* ---------- panel ---------- */

.panel {
    min-width: 0;
    padding: 20px;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background: var(--surface);
}

.panel + .panel {
    margin-top: 14px;
}

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

.panel-header h2 {
    margin: 4px 0 0;
    font-size: 14px;
}

.panel-eyebrow {
    color: var(--text-muted);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* ---------- buttons ---------- */

.button {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 15px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 750;
    transition: 150ms ease;
}

.button-primary {
    background: var(--cyan);
    color: #052a34;
}

.button-primary:hover {
    filter: brightness(1.08);
}

.button-secondary {
    border-color: var(--border);
    background: var(--surface-raised);
    color: var(--text-soft);
}

.button-secondary:hover,
.button-ghost:hover {
    color: var(--text);
}

.is-settings-tab.is-active {
    border-color: rgba(33, 199, 232, 0.4);
    background: rgba(33, 199, 232, 0.1);
    color: var(--cyan);
}

.button-ghost {
    background: transparent;
    color: var(--text-muted);
}

.alert-success {
    margin-bottom: 16px;
    padding: 13px 15px;
    border: 1px solid rgba(53, 211, 154, 0.24);
    border-radius: 10px;
    background: rgba(53, 211, 154, 0.08);
    color: #8cf0cb;
    font-size: 11px;
}

.alert-error {
    margin-bottom: 20px;
    padding: 13px 14px;
    border: 1px solid rgba(240, 106, 122, 0.35);
    border-radius: 12px;
    background: rgba(240, 106, 122, 0.1);
    color: #fecaca;
    font-size: 14px;
}

/* ---------- table ---------- */

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.data-table th {
    padding: 14px 12px;
    color: var(--text-muted);
    font-size: 8px;
    letter-spacing: 0.09em;
    text-align: left;
    text-transform: uppercase;
}

.data-table td {
    padding: 14px 12px;
    border-top: 1px solid var(--border-soft);
    color: var(--text-soft);
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.012);
}

.table-primary-link {
    color: var(--text);
    font-weight: 700;
}

.table-primary-link:hover,
.table-action-link:hover,
.inline-link:hover {
    color: var(--cyan);
}

.table-secondary-text {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 9px;
}

.table-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.table-actions-column {
    text-align: right !important;
}

.table-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.table-action-link,
.inline-link {
    color: var(--text-soft);
    font-size: 10px;
    font-weight: 700;
}

/* ---------- status pill ---------- */

.status-pill {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 20px;
    font-size: 8px;
    font-weight: 800;
}

.status-pill-dot {
    align-items: center;
    gap: 5px;
}

.status-pill-dot::after {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: currentColor;
}

.status-pill.is-active {
    background: rgba(53, 211, 154, 0.09);
    color: var(--green);
}

.status-pill.is-inactive {
    background: rgba(240, 106, 122, 0.09);
    color: var(--danger);
}

.status-pill.is-warning {
    background: rgba(245, 173, 69, 0.12);
    color: var(--amber);
}

.status-pill.is-info {
    background: var(--cyan-soft);
    color: var(--cyan);
}

.status-pill.is-muted {
    background: var(--surface-soft);
    color: var(--text-muted);
}

.status-pill.is-violet {
    background: rgba(156, 124, 255, 0.12);
    color: var(--violet);
}

/* Historico: .status-pill ja nao forca uppercase (removido abaixo), entao
   esta classe virou no-op. Mantida so pra nao gerar diff nos templates que
   ja a usam -- pode ser removida dos dois lugares numa limpeza futura. */
.status-pill-normal-case {
    text-transform: none;
}

/* Mini contadores compactos (ex: tela de Dominios) -- deliberadamente nao
   sao cards grandes, so uma linha de chips acima da tabela/filtros. */
.domain-counters {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.domain-counters span {
    padding: 6px 12px;
    border: 1px solid var(--border-soft);
    border-radius: 20px;
    background: var(--surface);
    color: var(--text-muted);
    font-size: 11px;
}

.domain-counters strong {
    color: var(--text);
    font-weight: 800;
}

.pagination-simple {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    padding-top: 18px;
    border-top: 1px solid var(--border-soft);
    color: var(--text-muted);
    font-size: 10px;
}

.pagination-simple a {
    color: var(--cyan);
}

.pagination-disabled {
    opacity: 0.45;
}

/* ---------- Endpoints RPZ / acabamento administrativo ---------- */

.admin-endpoints-table .endpoint-status-stack {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
}

.admin-endpoints-table th {
    padding-top: 11px;
    padding-bottom: 11px;
}

.admin-endpoints-table td {
    padding-top: 10px;
    padding-bottom: 10px;
}

.admin-endpoints-table .endpoint-status-stack small {
    color: var(--text-muted);
    font-size: 8.5px;
    white-space: nowrap;
}

.admin-endpoint-form .endpoint-static-field,
.endpoint-code-field {
    display: flex;
    width: 100%;
    min-height: 42px;
    align-items: center;
    padding: 0 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-soft);
    color: var(--text-soft);
}

.admin-endpoint-form .endpoint-static-field {
    font-size: 12px;
    font-weight: 700;
}

.endpoint-code-field {
    min-width: 0;
    overflow: hidden;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

input.endpoint-code-field {
    outline: none;
}

input.endpoint-code-field:focus {
    border-color: rgba(33, 199, 232, 0.55);
}

.endpoint-secret-row {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
}

.endpoint-secret-row .endpoint-code-field {
    flex: 1;
}

.endpoint-token-field {
    width: auto;
}

.endpoint-form-note {
    margin: 8px 0 0;
    color: var(--text-muted);
    font-size: 10px;
}

.endpoint-sources-heading {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    color: var(--text-muted);
    font-size: 10px;
}

.endpoint-sources-heading #fontes-selecionadas-count {
    padding-left: 14px;
    border-left: 1px solid var(--border-soft);
    white-space: nowrap;
}

.endpoint-selection-action {
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.endpoint-detail-statuses {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.endpoint-detail-statuses > div {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
}

.endpoint-detail-statuses > div > span {
    color: var(--text-muted);
    font-size: 9px;
}

.endpoint-config-snippet {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow-x: auto;
    background: var(--surface-soft);
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    white-space: pre;
}

@media (max-width: 640px) {
    .endpoint-secret-row {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .endpoint-secret-row .endpoint-code-field {
        flex-basis: 100%;
    }

    .endpoint-sources-heading {
        width: 100%;
        align-items: flex-start;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .endpoint-sources-heading #fontes-selecionadas-count {
        width: 100%;
        padding-left: 0;
        border-left: 0;
    }
}

.admin-domains-pagination .pagination-simple {
    gap: 8px;
    justify-content: center;
    margin-top: 14px;
    padding-top: 14px;
}

.admin-domains-pagination .pagination-button,
.admin-domains-pagination .pagination-current {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    justify-content: center;
    padding: 0 11px;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-soft);
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.admin-domains-pagination a.pagination-button:hover {
    border-color: rgba(33, 199, 232, 0.45);
    background: var(--cyan-soft);
    color: var(--cyan);
}

.admin-domains-pagination .pagination-current {
    border-color: transparent;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
}

.admin-domains-pagination .pagination-disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

@media (max-width: 520px) {
    .admin-domains-pagination .pagination-simple {
        gap: 6px;
    }

    .admin-domains-pagination .pagination-button,
    .admin-domains-pagination .pagination-current {
        min-height: 30px;
        padding: 0 9px;
        font-size: 9.5px;
    }
}

/* ---------- forms ---------- */

.form-control {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #334155;
    border-radius: 12px;
    outline: none;
    background: #080d17;
    color: var(--text);
}

.form-control:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(33, 199, 232, 0.12);
}

.form-panel {
    max-width: 980px;
}

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

.field-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-soft);
    font-size: 10px;
    font-weight: 700;
}

.field-group > label:not(.checkbox-label) > span {
    color: var(--danger);
}

.field-group textarea {
    resize: vertical;
}

.field-span-2 {
    grid-column: 1 / -1;
}

.field-error {
    margin-top: 6px;
    color: #ff94a1;
    font-size: 9px;
}

.checkbox-label {
    display: flex !important;
    width: 100%;
    min-height: 48px;
    align-items: center;
    gap: 10px;
    margin: 0 !important;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #090f19;
}

.checkbox-label input {
    width: 15px;
    height: 15px;
}

.checkbox-label strong,
.checkbox-label small {
    display: block;
}

.checkbox-label strong {
    font-size: 10px;
}

.checkbox-label small {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 8px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border-soft);
}

/* ---------- details list (show pages) ---------- */

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

.details-card-wide {
    grid-column: 1 / -1;
}

.details-list {
    margin: 0;
}

.details-list > div {
    display: grid;
    grid-template-columns: minmax(120px, 0.5fr) minmax(0, 1.5fr);
    gap: 16px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border-soft);
}

.details-list > div:last-child {
    border-bottom: 0;
}

.details-list dt {
    color: var(--text-muted);
    font-size: 9px;
}

.details-list dd {
    margin: 0;
    color: var(--text-soft);
    font-size: 10px;
    text-align: right;
    word-break: break-word;
}

/* ---------- fontes (admin) ---------- */

.admin-fontes-table {
    table-layout: fixed;
}

.admin-fontes-table th:nth-child(1) { width: 24%; }
.admin-fontes-table th:nth-child(2) { width: 10%; }
.admin-fontes-table th:nth-child(3) { width: 18%; }
.admin-fontes-table th:nth-child(4) { width: 13%; }
.admin-fontes-table th:nth-child(5) { width: 17%; }
.admin-fontes-table th:nth-child(6) { width: 10%; }
.admin-fontes-table th:nth-child(7) { width: 42px; }

.admin-fontes-table th,
.admin-fontes-table td {
    padding-right: 9px;
    padding-left: 9px;
}

.admin-fontes-name {
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.admin-fontes-description {
    min-height: 76px;
    resize: vertical;
}

.admin-fontes-note,
.admin-fontes-preview-note,
.admin-fontes-section-label small {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 400;
    line-height: 1.5;
    text-transform: none;
    letter-spacing: 0;
}

.admin-fontes-note {
    margin: 7px 0 0;
    padding: 8px 10px;
    border-left: 2px solid var(--cyan);
    border-radius: 0 6px 6px 0;
    background: rgba(33, 199, 232, 0.06);
}

.admin-fontes-section-label,
.admin-fontes-section-label span,
.admin-fontes-section-label small {
    display: block;
}

.admin-fontes-section-label small {
    margin-top: 4px;
}

.admin-fontes-heading-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.admin-fontes-heading-meta > span + span::before {
    content: "·";
    margin-right: 7px;
    color: var(--text-muted);
}

.admin-fontes-summary .details-list > div {
    padding: 9px 0;
}

.admin-fontes-preview-note {
    margin: 12px 0 0;
}

@media (max-width: 860px) {
    .admin-fontes-table {
        min-width: 760px;
    }
}

/* ---------- preview RPZ administrativo ---------- */
.rpz-preview-grid { display:grid;grid-template-columns:minmax(280px,390px) minmax(0,1fr);gap:14px;align-items:start; }
.rpz-preview-grid .panel + .panel { margin-top:0; }
.rpz-preview-kicker { color:var(--orange);font-size:9px;font-weight:800;letter-spacing:.13em;text-transform:uppercase; }
.rpz-preview-metrics > div { padding:8px 0; }
.rpz-preview-checks { display:grid;gap:7px;margin:14px 0;color:var(--text-soft);font-size:10px; }
.rpz-download-button { width:100%; }
.rpz-format-strip { display:flex;gap:7px 16px;flex-wrap:wrap;margin-bottom:12px;color:var(--text-muted);font:600 10px/1.4 ui-monospace,SFMono-Regular,Menlo,monospace; }
.rpz-preview-limit { margin:0 0 10px;color:var(--text-muted);font-size:10px; }
.rpz-code { max-width:100%;height:min(610px,calc(100vh - 285px));min-height:390px;margin:0;padding:18px;overflow:auto;border:1px solid #263244;border-radius:10px;background:#090f19;color:#dce7f3;font:11px/1.65 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;white-space:pre; }
.rpz-domain-search { margin-top:18px;padding-top:16px;border-top:1px solid var(--border-soft); }
.rpz-domain-search label { display:block;margin-bottom:8px;color:var(--text-muted);font-size:9px;font-weight:750;text-transform:uppercase;letter-spacing:.06em; }
.rpz-domain-search > div { display:flex;gap:7px; }
.rpz-domain-search input { min-width:0;width:100%; }
.rpz-search-result { margin-top:10px;padding:11px;border:1px solid var(--border-soft);border-radius:9px;background:var(--surface-soft);font-size:10px;overflow-wrap:anywhere; }
.rpz-search-result p { margin:7px 0 0;line-height:1.55; }
.rpz-search-result code { display:block;margin-top:8px;overflow-x:auto;color:var(--orange);white-space:nowrap; }
@media (max-width:900px) { .rpz-preview-grid { grid-template-columns:1fr; }.rpz-code { height:480px;min-height:320px; } }
@media (max-width:520px) { .rpz-domain-search > div { align-items:stretch;flex-direction:column; }.rpz-code { height:420px;padding:13px; } }

/* ---------- empty state ---------- */

.empty-state {
    display: flex;
    min-height: 116px;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: var(--text-muted);
    text-align: left;
}

.empty-state-large {
    min-height: 270px;
}

.empty-state-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface-soft);
    color: var(--cyan);
}

.empty-state strong,
.empty-state span {
    display: block;
}

.empty-state strong {
    color: var(--text-soft);
    font-size: 11px;
}

.empty-state span {
    max-width: 520px;
    margin-top: 5px;
    font-size: 9px;
    line-height: 1.6;
}

/* ---------- light theme ---------- */

html[data-theme="light"] {
    color-scheme: light;

    --background: #eef3f8;
    --surface: #ffffff;
    --surface-soft: #f4f7fa;
    --surface-raised: #eaf0f6;
    --border: #cbd6e2;
    --border-soft: #dce4ec;
    --text: #172235;
    --text-soft: #52647a;
    --text-muted: #52647a;
    --cyan: #0786a3;
    --cyan-soft: rgba(7, 134, 163, 0.11);
    --violet: #7256d9;
    --amber: #b97413;
    --green: #16845f;
    --danger: #c43f52;
}


html[data-theme="light"] body {
    background:
        radial-gradient(
            circle at 78% -10%,
            rgba(7, 134, 163, 0.09),
            transparent 34rem
        ),
        var(--background);
}

html[data-theme="light"] .sidebar {
    background: rgba(246, 249, 252, 0.98);
}

html[data-theme="light"] .app-topbar {
    background: rgba(238, 243, 248, 0.91);
}

html[data-theme="light"] .form-control,
html[data-theme="light"] .checkbox-label {
    background: #ffffff;
    color: var(--text);
}

html[data-theme="light"] .panel,
html[data-theme="light"] .topbar-icon-button,
html[data-theme="light"] .environment-status {
    box-shadow: 0 8px 24px rgba(49, 69, 91, 0.045);
}

html[data-theme="light"] .sidebar-link.is-active {
    background: linear-gradient(
        90deg,
        rgba(7, 134, 163, 0.14),
        rgba(7, 134, 163, 0.045)
    );
}

html[data-theme="light"] .data-table tbody tr:hover {
    background: rgba(22, 45, 70, 0.025);
}

html[data-theme="light"] .button-primary {
    border-color: #13b9d6;
    background: #13b9d6;
    color: #052a34;
    box-shadow: 0 6px 16px rgba(7, 134, 163, 0.16);
}

html[data-theme="light"] .button-primary:hover {
    border-color: #0da7c2;
    background: #0da7c2;
    color: #031f27;
    filter: none;
}

html[data-theme="light"] .button-primary:focus-visible {
    outline: 3px solid rgba(19, 185, 214, 0.22);
    outline-offset: 2px;
}

html[data-theme="light"] .button-secondary {
    border-color: #bfd0df;
    background: #eef4f8;
    color: #334a62;
}

html[data-theme="light"] .button-secondary:hover {
    border-color: #9eb5c8;
    background: #e3edf4;
    color: #172235;
}

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
    :root {
        --sidebar-width: 224px;
    }

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

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

    .panel-wide {
        grid-column: auto;
    }
}

@media (max-width: 1440px) and (min-width: 1081px) {
    .admin-dashboard .dashboard-grid {
        grid-template-columns: minmax(0, 1.35fr) minmax(360px, 1fr);
    }

    .admin-dashboard .dashboard-sources-table-wrap {
        overflow-x: hidden;
    }
}

@media (max-width: 800px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        position: static;
        width: 100%;
        min-height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--border-soft);
    }

    .sidebar-brand {
        min-height: 70px;
    }

    #sidebar-navigation {
        display: none;
    }

    #sidebar-navigation.is-open {
        display: block;
        padding-bottom: 16px;
    }

    .mobile-menu-toggle {
        display: inline-flex;
        width: 42px;
        height: 42px;
        margin-left: auto;
        align-items: center;
        justify-content: center;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--surface-raised);
        color: var(--text);
        font-size: 20px;
    }

    .app-content {
        margin-left: 0;
    }

    .app-topbar {
        min-height: auto;
        padding: 12px 18px;
    }

    .page-content {
        padding: 22px 18px;
    }

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

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

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

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

    .logout-button span {
        display: none;
    }
}

/* RBL dashboard */
.rbl-dashboard { min-width: 0; max-width: 100%; }
.rbl-dashboard .metrics-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); margin: 14px 0; }
.rbl-dashboard .metric-card { min-height: 128px; padding: 18px; }
.rbl-dashboard .metric-label { color: var(--text-soft); }
.rbl-last-run { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 14px; color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.rbl-last-run time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.rbl-dashboard .status-pill { font-size: 11px; }
.rbl-dashboard .table-responsive { max-width: 100%; overflow-x: auto; }
.rbl-dashboard .data-table { min-width: 760px; }
.rbl-dashboard .data-table td { max-width: 320px; overflow-wrap: break-word; }
.rbl-dashboard .button { cursor: pointer; white-space: nowrap; }
.rbl-dashboard .rbl-button-positive { border-color: var(--green); background: rgba(53, 211, 154, 0.08); color: var(--green); }
.rbl-dashboard .rbl-button-positive:hover { background: rgba(53, 211, 154, 0.18); }
.rbl-history-link { display: inline-block; margin-top: 10px; color: var(--cyan); }
.rbl-dashboard .rbl-list-description { margin: 6px 0 0; color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.rbl-list-registration { margin-top: 14px; }
.rbl-list-registration summary { padding: 8px 0; color: var(--text); font-size: 14px; font-weight: 700; cursor: pointer; }
.rbl-list-registration summary:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
.rbl-list-registration form > .button { margin-top: 18px; }
.rbl-dashboard .field-group, .rbl-dashboard .page-heading > div { min-width: 0; }
.rbl-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.rbl-actions form { margin: 0; }
.rbl-status-explanation { padding-left: 12px; border-left: 3px solid var(--amber); color: var(--text-soft); }
.rbl-scan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 18px 0; }
.rbl-scan-grid > div { min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-soft); }
.rbl-scan-grid span, .rbl-scan-grid strong { display: block; }
.rbl-scan-grid span { margin-bottom: 6px; color: var(--text-muted); font-size: 12px; }
.rbl-scan-grid strong { overflow-wrap: anywhere; font-size: 15px; }
.rbl-progress-label { display: flex; justify-content: space-between; gap: 12px; margin: 12px 0 7px; font-size: 13px; }
.rbl-progress { width: 100%; height: 12px; overflow: hidden; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-raised); }
.rbl-progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--green)); transition: width .2s ease; }
.rbl-next-batch { margin-top: 18px; padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-soft); }
.rbl-next-batch h3 { margin-top: 0; }
.rbl-next-batch p:last-child { margin-bottom: 0; }
.rbl-ip-preview { color: var(--text-muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; overflow-wrap: anywhere; }
.rbl-compact-progress { font-size: 12px; line-height: 1.45; white-space: nowrap; }
.rbl-compact-note { display: block; margin-top: 3px; color: var(--text-muted); white-space: nowrap; }
@media (max-width: 520px) { .rbl-dashboard .panel { padding: 14px; } }

/* RBL dashboard: progressive disclosure keeps operations ahead of configuration. */
.rbl-navigation { display:flex; flex-wrap:wrap; gap:8px; padding:10px; }
.rbl-summary-grid { grid-template-columns:repeat(4,minmax(135px,1fr)); }
.rbl-dashboard .rbl-summary-grid .metric-card { min-height:96px; padding:15px 16px; }
.rbl-summary-grid .metric-value { margin-top:8px; font-size:28px; }
.rbl-run-card { grid-column:span 2; }
.rbl-run-card .rbl-last-run { margin-top:8px; gap:5px; }
.rbl-run-card .rbl-last-run > div { display:flex; align-items:center; flex-wrap:wrap; gap:9px; }
.rbl-featured-group { border-color:rgba(34,211,238,.38); background:linear-gradient(135deg,rgba(34,211,238,.07),var(--surface) 55%); }
.rbl-featured-stats { display:grid; grid-template-columns:repeat(3,minmax(100px,1fr)) minmax(280px,2.3fr); gap:12px; align-items:stretch; }
.rbl-featured-stats > div { padding:11px 12px; border:1px solid var(--border); border-radius:8px; background:var(--surface-soft); }
.rbl-featured-stats span,.rbl-featured-stats strong { display:block; }
.rbl-featured-stats > div > span { color:var(--text-muted); font-size:12px; }
.rbl-featured-stats > div > strong { margin-top:4px; font-size:21px; }
.rbl-featured-progress .rbl-progress-label { margin:0 0 7px; }
.rbl-featured-progress .rbl-progress-label span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rbl-featured-progress small { display:block; margin-top:7px; color:var(--text-muted); }
.rbl-section-link { color:var(--cyan); font-size:13px; font-weight:700; white-space:nowrap; }
.rbl-featured-group > .rbl-section-link { display:inline-block; margin-top:13px; }
.rbl-compact-panel .data-table td,.rbl-events-preview td { padding-top:10px; padding-bottom:10px; }
.rbl-compact-panel { padding-top:16px; padding-bottom:16px; }
.rbl-compact-panel .panel-header { margin-bottom:10px; }
.rbl-error-message { max-width:280px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rbl-empty-row td { padding:16px !important; color:var(--text-muted); text-align:center; }
.rbl-collapsible-panel > summary { display:flex; align-items:center; gap:10px; cursor:pointer; font-size:16px; font-weight:700; }
.rbl-collapsible-panel[open] > summary { margin-bottom:16px; }
.rbl-filter-form { display:flex; align-items:end; flex-wrap:wrap; gap:10px; margin-bottom:8px; }
.rbl-filter-form .field-group { margin:0; }
.rbl-section-note { margin:8px 0 14px; color:var(--text-muted); font-size:12px; }
.rbl-type-label { display:inline-block; margin-right:7px; color:var(--text-muted); font-size:10px; font-weight:700; }
.rbl-target-value { white-space:nowrap; font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:12px; }
.rbl-targets-table { min-width:960px !important; }
.rbl-targets-table th,.rbl-targets-table td { padding-left:10px; padding-right:10px; }
.rbl-targets-table th:nth-child(4),.rbl-targets-table th:nth-child(6),.rbl-targets-table th:nth-child(7),.rbl-targets-table td:nth-child(4),.rbl-date-cell,.rbl-targets-table td:nth-child(7) { white-space:nowrap; overflow-wrap:normal; word-break:normal; }
.rbl-table-actions { display:flex; align-items:center; gap:6px; white-space:nowrap; }
.rbl-table-actions form { margin:0; }
.rbl-table-actions .button { padding:7px 9px; font-size:11px; }
.rbl-unchecked { margin-top:14px; color:var(--text-muted); font-size:12px; }
.rbl-unchecked summary { cursor:pointer; }
.rbl-unchecked a { display:inline-block; margin:8px 12px 0 0; }
.rbl-settings { margin-top:18px; padding:14px 16px; background:var(--surface-soft); }
.rbl-settings-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; cursor:pointer; list-style-position:inside; }
.rbl-settings-heading h2 { margin:2px 0 0; }
.rbl-settings-heading > span { color:var(--text-muted); font-size:12px; }
.rbl-settings[open] > .rbl-settings-heading { margin-bottom:12px; }
.rbl-settings .panel { background:var(--surface-soft); }
@media (max-width:1100px) { .rbl-summary-grid { grid-template-columns:repeat(2,minmax(180px,1fr)); } .rbl-featured-stats { grid-template-columns:repeat(3,1fr); } .rbl-featured-progress { grid-column:1/-1; } }
@media (max-width:620px) { .rbl-summary-grid { grid-template-columns:1fr 1fr; } .rbl-run-card { grid-column:1/-1; } .rbl-featured-stats { grid-template-columns:1fr 1fr; } .rbl-featured-progress { grid-column:1/-1; } .rbl-navigation .button { flex:1 1 auto; text-align:center; } }
