* {
    box-sizing: border-box;
}

:root {
    color-scheme: dark;
    --background: #070b14;
    --surface: #0d131f;
    --surface-soft: #111926;
    --surface-raised: #151e2d;
    --border: #202b3d;
    --border-soft: #182233;
    --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: 258px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.visually-hidden-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.skip-link {
    position: fixed;
    z-index: 10000;
    top: 12px;
    left: 12px;
    padding: 10px 14px;
    transform: translateY(-160%);
    border-radius: 8px;
    background: var(--cyan);
    color: #052a34;
    font-weight: 800;
}

.skip-link:focus {
    transform: translateY(0);
}

: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 78% -10%, rgba(33, 199, 232, 0.08), transparent 34rem),
        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;
}

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

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

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

/* 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);
    background: rgba(9, 14, 24, 0.98);
}

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

#sidebar-navigation {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

#sidebar-navigation::-webkit-scrollbar {
    width: 8px;
}

#sidebar-navigation::-webkit-scrollbar-thumb {
    border-radius: 8px;
    background: var(--border);
}

#sidebar-navigation::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.brand-mark {
    display: grid;
    width: 40px;
    height: 40px;
    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-logo {
    display: block;
    width: auto;
    height: 34px;
    object-fit: contain;
}

html[data-theme="light"] .brand-logo {
    padding: 5px;
    border-radius: 9px;
    background: #0b1220;
}

.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: 24px 24px 9px;
    color: #526176;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.17em;
    text-transform: uppercase;
}

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

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

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

.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.is-disabled {
    cursor: default;
    opacity: 0.63;
}

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

.nav-badge {
    margin-left: auto;
    padding: 3px 6px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

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

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

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

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

.topbar-search {
    position: relative;
    display: flex;
    width: min(420px, 45vw);
    height: 42px;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text-muted);
}

.global-search-suggestions {
    position: absolute;
    z-index: 50;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    max-height: min(420px, 65vh);
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-raised);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
}

.global-search-suggestion {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-soft);
    color: inherit;
    text-decoration: none;
}

.global-search-suggestion:last-child {
    border-bottom: 0;
}

.global-search-suggestion:hover,
.global-search-suggestion.is-active {
    background: var(--surface-soft);
}

.global-search-suggestion > span:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.global-search-suggestion strong {
    overflow: hidden;
    color: var(--text);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.global-search-suggestion small {
    color: var(--cyan);
    font-size: 10px;
    text-transform: uppercase;
}

.global-search-suggestion > span:last-child {
    overflow: hidden;
    color: var(--text-muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-search:focus-within {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(55, 125, 255, 0.14);
}

.topbar-search input {
    min-width: 0;
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-soft);
}

.topbar-search input::placeholder {
    color: #56657a;
}

.search-shortcut {
    padding: 3px 6px;
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text-muted);
    font-size: 9px;
}

.search-result-summary {
    margin: -8px 0 18px;
    color: var(--text-muted);
}

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

.search-result-panel {
    padding: 0;
    overflow: hidden;
}

.search-result-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-soft);
}

.search-result-header h2 {
    flex: 1;
    margin: 0;
    font-size: 15px;
}

.search-result-header > span:last-child {
    color: var(--text-muted);
    font-size: 12px;
}

.search-result-list {
    display: grid;
}

.search-result-item {
    display: grid;
    gap: 5px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-soft);
    color: inherit;
    text-decoration: none;
}

.search-result-item:last-child {
    border-bottom: 0;
}

.search-result-item:hover,
.search-result-item:focus-visible {
    background: var(--surface-soft);
}

.search-result-item strong {
    color: var(--text);
    font-size: 14px;
}

.search-result-item span {
    color: var(--text-muted);
    font-size: 12px;
}

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

.topbar-actions,
.user-menu {
    display: flex;
    align-items: center;
}

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

.notification-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--cyan);
}

.user-menu {
    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;
}

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

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

.tab-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 22px;
    padding: 5px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: var(--surface);
}

.tab-nav a {
    padding: 9px 14px;
    border-radius: 8px;
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.tab-nav a.is-active {
    background: var(--cyan-soft);
    color: var(--cyan);
}

.logout-button {
    display: flex;
    min-height: 36px;
    align-items: center;
    gap: 7px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 11px;
}

.logout-button:hover {
    border-color: var(--border);
    background: var(--surface);
    color: var(--text);
}

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

.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-heading-status {
    text-align: right;
}

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

.page-heading-status span {
    color: var(--text-muted);
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.page-heading-status strong {
    margin-top: 5px;
    font-size: 11px;
}

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

.metric-card {
    min-width: 0;
    padding: 18px;
    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-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: 19px;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.metric-label {
    margin-top: 2px;
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 600;
}

.metric-footer {
    gap: 8px;
    margin-top: 17px;
    padding-top: 13px;
    border-top: 1px solid var(--border-soft);
    color: var(--text-muted);
    font-size: 9px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.85fr);
    gap: 14px;
    margin-top: 14px;
}

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

.split-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(260px, 0.85fr);
    gap: 14px;
    align-items: start;
}

.split-layout-main {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 14px;
}

.tip-card {
    display: flex;
    gap: 12px;
    padding: 18px;
    border: 1px solid rgba(33, 199, 232, 0.22);
    border-radius: 14px;
    background: var(--cyan-soft);
}

.tip-card-icon {
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 9px;
    background: rgba(33, 199, 232, 0.16);
    color: var(--cyan);
}

.tip-card h3 {
    margin: 0 0 6px;
    font-size: 11px;
}

.tip-card p {
    margin: 0;
    color: var(--text-soft);
    font-size: 10px;
    line-height: 1.7;
}

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

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

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

.panel-status {
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text-muted);
    font-size: 8px;
    text-transform: uppercase;
}

.resource-overview {
    display: grid;
    grid-template-columns: minmax(190px, 0.75fr) minmax(0, 1.25fr);
    align-items: center;
    gap: 28px;
    padding-top: 26px;
}

.resource-chart {
    display: grid;
    place-items: center;
}

.resource-chart-ring {
    display: grid;
    width: 158px;
    height: 158px;
    place-items: center;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, var(--surface) 56%, transparent 57%),
        conic-gradient(
            var(--cyan) 0 25%,
            var(--violet) 25% 50%,
            var(--amber) 50% 75%,
            var(--green) 75% 100%
        );
    box-shadow: inset 0 0 0 7px var(--surface);
}

.resource-chart-ring div {
    text-align: center;
}

.resource-chart-ring strong,
.resource-chart-ring span {
    display: block;
}

.resource-chart-ring strong {
    font-size: 27px;
}

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

.resource-legend {
    display: grid;
}

.legend-item {
    display: grid;
    grid-template-columns: 9px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border-soft);
}

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

.legend-color {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.legend-color.clients {
    background: var(--cyan);
}

.legend-color.asns {
    background: var(--violet);
}

.legend-color.ipv4 {
    background: var(--amber);
}

.legend-color.ipv6 {
    background: var(--green);
}

.legend-item strong,
.legend-item span {
    display: block;
}

.legend-item strong {
    font-size: 11px;
}

.legend-item span {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 8px;
}

.legend-item b {
    font-size: 12px;
}

.health-list {
    display: grid;
    padding-top: 12px;
}

.health-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-soft);
}

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

.health-icon {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 9px;
    background: var(--surface-raised);
    color: var(--cyan);
}

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

.health-details strong {
    font-size: 10px;
}

.health-details span {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 8px;
}

.health-status {
    padding: 4px 7px;
    border-radius: 20px;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
}

.health-status.is-ok {
    background: rgba(53, 211, 154, 0.08);
    color: var(--green);
}

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

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

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

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

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

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

@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;
    }

    .topbar-search,
    .topbar-icon-button,
    .user-details {
        display: none;
    }

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

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

    .page-heading-status {
        text-align: left;
    }

    .resource-overview {
        grid-template-columns: 1fr;
    }
}

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

    .logout-button span {
        display: none;
    }

    .login-card {
        padding: 26px 22px;
    }
}

/* Clients */

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

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

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

.alert-success {
    position: fixed;
    top: 100px;
    right: 22px;
    z-index: 9000;
    max-width: min(360px, calc(100vw - 44px));
    padding: 13px 15px;
    border: 1px solid rgba(53, 211, 154, 0.28);
    border-radius: 10px;
    background: var(--surface-raised);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
    color: #8cf0cb;
    font-size: 11px;
}

html[data-theme="light"] .alert-success {
    background: #ffffff;
    box-shadow: 0 18px 40px rgba(49, 69, 91, 0.16);
    color: #0d9668;
}

@media (max-width: 520px) {
    .alert-success {
        top: 90px;
        right: 12px;
        left: 12px;
        max-width: none;
    }
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-soft);
}

.filter-search {
    display: flex;
    min-width: 260px;
    flex: 1;
    height: 40px;
    align-items: center;
    gap: 9px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #090f19;
    color: var(--text-muted);
}

.filter-search input {
    min-width: 0;
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
}

.filter-select {
    height: 40px;
    padding: 0 34px 0 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface-raised);
    color: var(--text-soft);
}

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

.data-table tr.is-failed-row td {
    border-top-color: rgba(240, 106, 122, 0.22);
    background: rgba(240, 106, 122, 0.05);
    color: var(--danger);
}

.backup-retention-form {
    flex-wrap: wrap;
    margin: 20px 0;
    padding: 16px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: var(--surface-soft);
}

.backup-retention-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 600;
}

.backup-retention-form input.form-control {
    width: 110px;
    padding: 9px 12px;
}

.backup-retention-form .button {
    align-self: flex-end;
}

.audit-diff-table td:first-child {
    color: var(--text-muted);
    font-weight: 700;
    white-space: nowrap;
}

.audit-diff-table tr.is-changed td {
    border-top-color: rgba(33, 199, 232, 0.22);
    background: rgba(33, 199, 232, 0.05);
}

.audit-diff-table tr.is-changed td:nth-child(3) {
    color: var(--cyan);
    font-weight: 700;
}

.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-identity {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
}

.table-identity-text {
    min-width: 0;
}

.table-identity-text strong {
    display: block;
    overflow: hidden;
    color: var(--text);
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.table-icon-button {
    display: inline-flex;
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-raised);
    color: var(--text-soft);
    transition:
        color 150ms ease,
        border-color 150ms ease,
        background 150ms ease;
}

.table-icon-button:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}

.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 {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 20px;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
}

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

.role-pill {
    display: inline-flex;
    padding: 5px 8px;
    border: 1px solid transparent;
    border-radius: 20px;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
}

.role-pill.is-admin {
    border-color: rgba(33, 199, 232, 0.18);
    background: var(--cyan-soft);
    color: var(--cyan);
}

.role-pill.is-operator {
    border-color: rgba(156, 124, 255, 0.18);
    background: rgba(156, 124, 255, 0.1);
    color: var(--violet);
}

.role-pill.is-viewer {
    border-color: var(--border);
    background: var(--surface-raised);
    color: var(--text-muted);
}

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

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

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

.field-hint {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 9px;
    line-height: 1.6;
}

.field-checkbox-group {
    display: flex;
    align-items: flex-end;
}

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

.notes-content {
    padding-top: 18px;
    color: var(--text-soft);
    font-size: 11px;
    line-height: 1.7;
    white-space: pre-wrap;
}

.form-panel-compact { max-width: 860px; }

.client-contacts-card .panel-header { gap: 16px; }

.client-contacts-empty {
    padding-top: 22px;
    color: var(--text-muted);
    font-size: 10px;
}

.client-contacts-empty p { margin: 0 0 10px; }

.client-contact-list {
    display: grid;
    gap: 10px;
    padding-top: 18px;
}

.client-contact-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: rgba(9, 15, 25, 0.62);
}

.client-contact-main {
    display: grid;
    min-width: 0;
    gap: 5px;
    color: var(--text-soft);
    font-size: 10px;
}

.client-contact-heading,
.client-contact-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.client-contact-heading strong { color: var(--text); font-size: 11px; }
.client-contact-name { font-weight: 700; }
.client-contact-actions { justify-content: flex-end; }

.contact-primary-pill {
    display: inline-flex;
    padding: 5px 8px;
    border: 1px solid rgba(156, 124, 255, 0.22);
    border-radius: 20px;
    background: rgba(156, 124, 255, 0.1);
    color: #b7a3ff;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
}

@media (max-width: 760px) {
    .filter-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .filter-search {
        min-width: 0;
    }

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

    .field-span-2,
    .details-card-wide {
        grid-column: auto;
    }

    .page-actions {
        flex-wrap: wrap;
    }

    .client-contact-item {
        align-items: stretch;
        flex-direction: column;
    }

    .client-contact-actions { justify-content: flex-start; }
}

/* Prefixes */

.field-help {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 8px;
    line-height: 1.5;
}

.allocation-pill {
    display: inline-flex;
    padding: 5px 8px;
    border: 1px solid rgba(156, 124, 255, 0.18);
    border-radius: 20px;
    background: rgba(156, 124, 255, 0.08);
    color: #b7a3ff;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
}

/* Theme switcher */

html {
    color-scheme: dark;
}

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

.theme-icon {
    display: none;
}

html[data-theme="dark"] .theme-icon-sun,
html[data-theme="light"] .theme-icon-moon {
    display: block;
}

.theme-toggle {
    transition:
        color 150ms ease,
        background 150ms ease,
        border-color 150ms ease;
}

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

.metric-card {
    color: inherit;
    transition:
        transform 150ms ease,
        border-color 150ms ease,
        background 150ms ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    border-color: rgba(33, 199, 232, 0.3);
}

.resource-chart-ring {
    background:
        radial-gradient(circle at center, var(--surface) 56%, transparent 57%),
        var(--resource-chart);
}

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"] .login-card {
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 30px 90px rgba(48, 67, 88, 0.15);
}

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

html[data-theme="light"] .filter-search input,
html[data-theme="light"] .topbar-search input {
    color: var(--text);
}

html[data-theme="light"] .metric-card,
html[data-theme="light"] .panel,
html[data-theme="light"] .topbar-search,
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);
}

/* IRR */

.irr-type-pill {
    display: inline-flex;
    padding: 5px 8px;
    border: 1px solid rgba(33, 199, 232, 0.18);
    border-radius: 20px;
    background: rgba(33, 199, 232, 0.08);
    color: var(--cyan);
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
}

.code-textarea {
    min-height: 220px;
    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        monospace;
    line-height: 1.65;
}

.rpsl-dialog {
    width: min(640px, calc(100vw - 32px));
    max-height: min(680px, calc(100vh - 64px));
    padding: 0;
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    background: var(--surface);
    color: var(--text);
}

.rpsl-dialog::backdrop {
    background: rgba(4, 8, 16, 0.55);
}

.rpsl-dialog-inner {
    max-height: min(680px, calc(100vh - 64px));
    overflow-y: auto;
    padding: 22px;
}

.rpsl-dialog-inner p {
    margin: 16px 0 0;
}

.rpsl-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.irr-raw-object {
    overflow: auto;
    margin: 0;
    padding: 18px;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    background: var(--surface-soft);
    color: var(--text-soft);
    font-size: 10px;
    line-height: 1.7;
    white-space: pre-wrap;
}

/* RPKI */

.rpki-summary-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.rpki-summary-card {
    padding: 16px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: var(--surface);
}

.rpki-summary-card span,
.rpki-prefix-overview span {
    display: block;
    color: var(--text-muted);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.rpki-summary-card strong {
    display: block;
    margin-top: 8px;
    font-size: 24px;
}

.rpki-summary-card.is-valid {
    border-color: rgba(53, 211, 154, 0.25);
}

.rpki-summary-card.is-invalid,
.rpki-summary-card.is-error {
    border-color: rgba(240, 106, 122, 0.25);
}

.rpki-summary-card.is-not-found {
    border-color: rgba(245, 173, 69, 0.25);
}

.rpki-status-pill {
    display: inline-flex;
    padding: 5px 9px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface-soft);
    color: var(--text-soft);
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
}

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

.rpki-status-pill.is-invalid,
.rpki-status-pill.is-error {
    border-color: rgba(240, 106, 122, 0.26);
    background: rgba(240, 106, 122, 0.09);
    color: var(--danger);
}

.rpki-status-pill.is-not_found {
    border-color: rgba(245, 173, 69, 0.26);
    background: rgba(245, 173, 69, 0.09);
    color: var(--amber);
}

.rpki-status-pill.is-unchecked {
    color: var(--text-muted);
}

.rpki-prefix-overview {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 4px;
}

.rpki-prefix-overview > div {
    padding: 14px;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    background: var(--surface-soft);
}

.rpki-prefix-overview strong {
    display: block;
    margin-top: 7px;
    font-size: 10px;
}

.rpki-actions {
    justify-content: flex-start;
    padding-top: 18px;
}

.rpki-actions form,
.table-actions form {
    margin: 0;
}

.table-action-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--cyan);
    font: inherit;
    cursor: pointer;
}

.text-muted {
    color: var(--text-muted);
}

@media (max-width: 1100px) {
    .rpki-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

@media (max-width: 680px) {
    .rpki-summary-grid,
    .rpki-prefix-overview {
        grid-template-columns: 1fr;
    }
}

/* IRR workflow */

.workflow-progress {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}

.workflow-progress-item {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
    padding: 11px;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    background: var(--surface);
}

.workflow-progress-item > span,
.workflow-step-number {
    display: grid;
    flex: 0 0 auto;
    width: 25px;
    height: 25px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 800;
}

.workflow-progress-item strong {
    overflow: hidden;
    color: var(--text-soft);
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workflow-progress-item.is-ready,
.workflow-step-link.is-ready,
.workflow-step-card.is-ready {
    border-color: rgba(33, 199, 232, 0.3);
}

.workflow-progress-item.is-waiting_confirmation,
.workflow-step-link.is-waiting_confirmation,
.workflow-step-card.is-waiting_confirmation {
    border-color: rgba(245, 173, 69, 0.3);
}

.workflow-progress-item.is-completed,
.workflow-step-link.is-completed,
.workflow-step-card.is-completed {
    border-color: rgba(53, 211, 154, 0.3);
}

.workflow-progress-item.is-completed > span {
    border-color: var(--green);
    color: var(--green);
}

.workflow-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    align-items: start;
    gap: 16px;
}

.workflow-sidebar {
    position: sticky;
    top: 82px;
}

.workflow-step-list {
    display: grid;
    gap: 7px;
}

.workflow-step-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px;
    border: 1px solid var(--border-soft);
    border-radius: 9px;
    color: inherit;
    text-decoration: none;
}

.workflow-step-link > div {
    min-width: 0;
}

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

.workflow-step-link strong {
    color: var(--text-soft);
    font-size: 9px;
}

.workflow-step-link div span {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 8px;
}

.workflow-main {
    display: grid;
    gap: 16px;
}

.workflow-step-card {
    scroll-margin-top: 80px;
}

.workflow-step-card.is-locked {
    opacity: 0.7;
}

.workflow-instructions {
    margin: 0 0 16px;
    color: var(--text-soft);
    font-size: 10px;
    line-height: 1.65;
}

.workflow-locked,
.workflow-completed-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    border: 1px dashed var(--border);
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 10px;
}

.workflow-completed-message {
    border-color: rgba(53, 211, 154, 0.25);
    color: var(--green);
}

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

.workflow-content-grid > section {
    min-width: 0;
}

.workflow-content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 9px;
}

.workflow-content-header strong {
    font-size: 10px;
}

.workflow-email-meta {
    display: grid;
    gap: 7px;
    margin: 0 0 10px;
}

.workflow-email-meta div {
    display: grid;
    grid-template-columns: 55px minmax(0, 1fr);
    gap: 8px;
}

.workflow-email-meta dt {
    color: var(--text-muted);
    font-size: 8px;
}

.workflow-email-meta dd {
    overflow-wrap: anywhere;
    margin: 0;
    color: var(--text-soft);
    font-size: 9px;
}

.workflow-code {
    overflow: auto;
    min-height: 245px;
    max-height: 470px;
    margin: 0;
    padding: 15px;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    background: var(--surface-soft);
    color: var(--text-soft);
    font-size: 9px;
    line-height: 1.65;
    white-space: pre-wrap;
}

.workflow-timeline {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.workflow-timeline div {
    padding: 11px;
    border: 1px solid var(--border-soft);
    border-radius: 9px;
    background: var(--surface-soft);
}

.workflow-timeline span,
.workflow-timeline strong {
    display: block;
}

.workflow-timeline span {
    color: var(--text-muted);
    font-size: 8px;
}

.workflow-timeline strong {
    margin-top: 5px;
    color: var(--text-soft);
    font-size: 9px;
}

.workflow-action-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 12px;
    margin-top: 16px;
}

.workflow-action-form .field-group {
    margin: 0;
}

.workflow-operator-note {
    margin-top: 15px;
    padding: 12px;
    border-left: 3px solid var(--cyan);
    background: var(--surface-soft);
}

.workflow-operator-note strong {
    font-size: 9px;
}

.workflow-operator-note p {
    margin: 5px 0 0;
    color: var(--text-soft);
    font-size: 9px;
    line-height: 1.55;
}

.workflow-status {
    display: inline-flex;
    padding: 5px 9px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface-soft);
    color: var(--text-muted);
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
}

.workflow-status.is-ready,
.workflow-status.is-in_progress {
    border-color: rgba(33, 199, 232, 0.25);
    color: var(--cyan);
}

.workflow-status.is-waiting_confirmation {
    border-color: rgba(245, 173, 69, 0.25);
    color: var(--amber);
}

.workflow-status.is-completed {
    border-color: rgba(53, 211, 154, 0.25);
    color: var(--green);
}

.workflow-status.is-error,
.workflow-status.is-cancelled {
    border-color: rgba(240, 106, 122, 0.25);
    color: var(--danger);
}

@media (max-width: 1150px) {
    .workflow-progress {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .workflow-layout {
        grid-template-columns: 1fr;
    }

    .workflow-sidebar {
        position: static;
    }
}

@media (max-width: 820px) {
    .workflow-content-grid,
    .workflow-timeline {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 620px) {
    .workflow-progress {
        grid-template-columns: 1fr;
    }
}

.workflow-step-collapsed {
    padding: 0;
    overflow: hidden;
}

.workflow-collapsed-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 20px;
    cursor: pointer;
    list-style: none;
}

.workflow-collapsed-summary::-webkit-details-marker {
    display: none;
}

.workflow-collapsed-summary > div:first-child {
    display: grid;
    gap: 5px;
}

.workflow-collapsed-summary strong {
    color: var(--text);
    font-size: 11px;
}

.workflow-collapsed-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 8px;
}

.workflow-collapsed-content {
    padding: 0 20px 20px;
    border-top: 1px solid var(--border-soft);
}

.workflow-step-collapsed[open] .workflow-collapsed-summary {
    background: var(--surface-soft);
}

@media (max-width: 620px) {
    .workflow-collapsed-summary,
    .workflow-collapsed-meta {
        align-items: flex-start;
    }

    .workflow-collapsed-summary {
        flex-direction: column;
    }

    .workflow-collapsed-meta {
        flex-wrap: wrap;
    }
}

/* IRR workflow prefix policies */

.workflow-prefix-policy {
    margin-bottom: 16px;
}

.workflow-prefix-policy .panel-header p {
    max-width: 760px;
    margin: 5px 0 0;
    color: var(--text-muted);
    font-size: 9px;
    line-height: 1.55;
}

.workflow-prefix-list {
    display: grid;
    gap: 9px;
}

.workflow-prefix-row {
    display: grid;
    grid-template-columns:
        minmax(220px, 1.4fr)
        minmax(180px, 1fr)
        minmax(130px, 0.55fr)
        minmax(120px, 0.65fr)
        auto;
    align-items: end;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    background: var(--surface-soft);
}

.workflow-prefix-row .field-group {
    margin: 0;
}

.workflow-prefix-identity {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.workflow-prefix-identity strong {
    overflow-wrap: anywhere;
    font-size: 10px;
}

.workflow-prefix-family {
    width: fit-content;
    padding: 3px 6px;
    border-radius: 12px;
    background: var(--surface);
    color: var(--cyan);
    font-size: 7px;
    font-weight: 800;
}

.workflow-prefix-preview {
    overflow-wrap: anywhere;
    color: var(--green);
    font-size: 8px;
}

.workflow-prefix-checkbox {
    display: flex;
    min-height: 36px;
    align-items: center;
    gap: 7px;
    color: var(--text-soft);
    font-size: 9px;
    cursor: pointer;
}

.workflow-prefix-checkbox input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--cyan);
}

@media (max-width: 1180px) {
    .workflow-prefix-row {
        grid-template-columns:
            minmax(220px, 1.3fr)
            minmax(180px, 1fr)
            minmax(130px, 0.7fr);
    }

    .workflow-prefix-checkbox,
    .workflow-prefix-row > .button {
        align-self: center;
    }
}

@media (max-width: 760px) {
    .workflow-prefix-row {
        grid-template-columns: 1fr;
    }

    .workflow-prefix-row > .button {
        width: 100%;
    }
}

/* Audit */

.audit-values-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.audit-values-grid .code-preview {
    min-height: 260px;
    max-height: 520px;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

@media (max-width: 900px) {
    .audit-values-grid {
        grid-template-columns: 1fr;
    }
}

/* Mandatory password change */

.password-change-card {
    width: min(100%, 480px);
}

.password-requirements {
    margin: -2px 0 18px;
    color: var(--text-muted);
    font-size: 9px;
    line-height: 1.55;
}

.password-change-logout {
    margin-top: 10px;
}

.password-change-logout .button {
    width: 100%;
}

/* Operational dashboard */

.panel-status.is-warning {
    border-color: color-mix(in srgb, var(--amber) 35%, transparent);
    color: var(--amber);
}

.panel-status.is-ok {
    border-color: color-mix(in srgb, var(--green) 35%, transparent);
    color: var(--green);
}

.panel-link {
    color: var(--cyan);
    font-size: 9px;
    font-weight: 700;
    text-decoration: none;
}

.operation-issue-list,
.dashboard-activity-list {
    display: grid;
}

.operation-issue-item,
.dashboard-activity-item {
    display: grid;
    align-items: center;
    gap: 11px;
    border-bottom: 1px solid var(--border-soft);
    color: inherit;
    text-decoration: none;
    transition:
        background-color 160ms ease,
        border-color 160ms ease;
}

.operation-issue-item {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    padding: 11px 0;
}

.operation-issue-item:last-child,
.dashboard-activity-item:last-child {
    border-bottom: 0;
}

.operation-issue-item:hover,
.dashboard-activity-item:hover {
    background: var(--surface-soft);
}

.operation-issue-item .metric-icon {
    width: 34px;
    height: 34px;
}

.operation-issue-details,
.dashboard-activity-content {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.operation-issue-details strong,
.dashboard-activity-content strong {
    overflow: hidden;
    color: var(--text);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.operation-issue-details span,
.dashboard-activity-content span {
    overflow: hidden;
    color: var(--text-muted);
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.operation-issue-item > b {
    color: var(--text);
    font-size: 15px;
}

.dashboard-activity-item {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    padding: 12px 4px;
}

.dashboard-activity-marker {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 1px solid var(--border-soft);
    border-radius: 9px;
    background: var(--surface-soft);
    color: var(--cyan);
}

.dashboard-activity-item time {
    color: var(--text-muted);
    font-size: 8px;
    white-space: nowrap;
}

.dashboard-empty-compact {
    min-height: 150px;
}

@media (max-width: 700px) {
    .dashboard-activity-item {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .dashboard-activity-item time {
        display: none;
    }

    .operation-issue-details span,
    .dashboard-activity-content span {
        white-space: normal;
    }
}

/* Light theme button contrast */

html[data-theme="light"] .button-primary,
html[data-theme="light"] .primary-button {
    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,
html[data-theme="light"] .primary-button:hover {
    border-color: #0da7c2;
    background: #0da7c2;
    color: #031f27;
    filter: none;
}

html[data-theme="light"] .button-primary:focus-visible,
html[data-theme="light"] .primary-button: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;
}

/* User avatars and profile */

.user-profile-link {
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 10px;
    color: inherit;
    text-decoration: none;
}

.user-profile-link:hover .user-details strong {
    color: var(--cyan);
}

.user-avatar {
    flex: 0 0 auto;
    overflow: hidden;
}

.user-avatar-small {
    width: 30px;
    height: 30px;
    border-radius: 8px;
}

.user-avatar-medium {
    width: 37px;
    height: 37px;
}

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

.user-avatar-xlarge {
    width: 76px;
    height: 76px;
    border-radius: 20px;
    font-size: 23px;
}

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

.user-avatar-initials {
    line-height: 1;
}

.user-avatar-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-picker {
    display: grid;
    grid-template-columns: repeat(7, 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);
}

/* Meu Perfil - container unico */

.profile-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 28px;
}

.profile-identity {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--border-soft);
}

.profile-photo-wrap {
    position: relative;
    flex: 0 0 auto;
}

.profile-camera-button {
    position: absolute;
    right: -4px;
    bottom: -4px;
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border: 2px solid var(--surface);
    border-radius: 50%;
    background: var(--cyan);
    color: #052a34;
    cursor: pointer;
}

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

.profile-identity-text {
    min-width: 0;
}

.profile-identity-text h1 {
    margin: 0 0 3px;
    font-size: 19px;
}

.profile-identity-text p {
    margin: 0 0 8px;
    overflow-wrap: anywhere;
    color: var(--text-muted);
    font-size: 11px;
}

.profile-section {
    padding: 22px 0;
    border-bottom: 1px solid var(--border-soft);
}

.profile-section:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.profile-section-title {
    margin: 0 0 16px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.profile-security-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.segmented-control {
    display: inline-flex;
    padding: 4px;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    background: var(--surface-raised);
}

.segmented-control button {
    padding: 8px 16px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.segmented-control button.is-active {
    background: var(--cyan);
    color: #052a34;
}

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

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

.avatar-dialog {
    width: min(520px, calc(100vw - 32px));
    max-height: min(680px, calc(100vh - 64px));
    padding: 0;
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    background: var(--surface);
    color: var(--text);
}

.avatar-dialog::backdrop {
    background: rgba(4, 8, 16, 0.55);
}

.avatar-dialog-inner {
    max-height: min(680px, calc(100vh - 64px));
    overflow-y: auto;
    padding: 22px;
}

.avatar-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.avatar-dialog-header h2 {
    margin: 0;
    font-size: 15px;
}

.avatar-dialog-close {
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: var(--surface-raised);
    color: var(--text-soft);
    cursor: pointer;
}

.avatar-dialog-close:hover {
    color: var(--text);
}

.avatar-dialog-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.avatar-photo-section {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border-soft);
}

.avatar-photo-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

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

@media (max-width: 760px) {
    .profile-container {
        padding: 20px;
    }

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

/* Account dropdown and profile refinement */

.account-menu {
    position: relative;
}

.account-menu-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 5px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.account-menu-toggle:hover,
.account-menu-toggle[aria-expanded="true"] {
    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-toggle[aria-expanded="true"]
.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-dropdown[hidden] {
    display: none;
}

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

.profile-password-panel {
    max-width: 820px;
}

.alert-success {
    transition:
        opacity 300ms ease,
        transform 300ms ease,
        margin 300ms ease,
        padding 300ms ease;
}

.alert-success.is-hiding {
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    transform: translateY(-6px);
}

html[data-theme="light"] .account-menu-dropdown {
    box-shadow: 0 20px 50px rgba(37, 56, 77, 0.16);
}

@media (max-width: 760px) {
    .account-menu-dropdown {
        position: fixed;
        top: 70px;
        right: 12px;
    }

    .account-menu-chevron {
        display: none;
    }
}

/* Premium authentication */

.auth-body {
    min-width: 320px;
    overflow-x: hidden;
}

.auth-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(0, 1.1fr) minmax(460px, 1fr);
    background: var(--background);
}

.auth-hero {
    position: relative;
    display: flex;
    min-width: 0;
    overflow: hidden;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(32px, 4vw, 56px);
    border-right: 1px solid var(--border-soft);
}

.auth-network-visual {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    color: var(--cyan);
    opacity: 0.5;
    pointer-events: none;
}

.auth-brand {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 14px;
}

.auth-brand > .brand-mark {
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    place-items: center;
    border: 1px solid rgba(33, 199, 232, 0.35);
    border-radius: 12px;
    background:
        linear-gradient(
            145deg,
            rgba(33, 199, 232, 0.18),
            rgba(33, 199, 232, 0.03)
        );
    color: var(--cyan);
    font-size: 15px;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.auth-brand strong,
.auth-brand span {
    display: block;
}

.auth-brand strong {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--text);
}

.auth-brand span {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 12px;
}

.auth-hero-tagline {
    position: relative;
    z-index: 2;
    max-width: 420px;
}

.auth-hero-tagline-rule {
    display: block;
    width: 40px;
    height: 2px;
    margin-bottom: 18px;
    border-radius: 2px;
    background: var(--cyan);
    opacity: 0.55;
}

.auth-hero-tagline-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.auth-hero-tagline-row svg {
    flex: 0 0 auto;
    margin-top: 2px;
    color: var(--cyan);
    opacity: 0.85;
}

.auth-hero-tagline-row p {
    margin: 0;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.6;
}

.auth-hero-tagline-row p span {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 12px;
}

.auth-login-panel {
    position: relative;
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    padding: clamp(24px, 4vw, 48px);
}

.auth-theme-toggle {
    position: absolute;
    top: 24px;
    right: 26px;
    z-index: 3;
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text-soft);
}

.auth-theme-toggle:hover {
    border-color: rgba(33, 199, 232, 0.32);
    color: var(--cyan);
}

.auth-login-card {
    width: min(100%, 480px);
    padding: clamp(28px, 3vw, 40px);
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
}

.auth-login-header {
    margin-bottom: 26px;
}

.auth-login-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
    color: var(--cyan);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.auth-login-header h2 {
    margin: 0 0 8px;
    color: var(--text);
    font-size: clamp(24px, 2.6vw, 30px);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.auth-login-header p {
    margin: 0;
    color: var(--text-soft);
    font-size: 13px;
}

.auth-field {
    margin-bottom: 18px;
}

.auth-field label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 600;
}

.auth-input-wrapper {
    position: relative;
}

.auth-input {
    width: 100%;
    min-height: 48px;
    padding: 0 44px;
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: 0;
    background: rgba(7, 11, 20, 0.04);
    color: var(--text);
    font-size: 14px;
    transition:
        border-color 150ms ease,
        box-shadow 150ms ease,
        background 150ms ease;
}

html[data-theme="dark"] .auth-input {
    background: rgba(7, 11, 20, 0.5);
}

.auth-input::placeholder {
    color: var(--text-muted);
}

.auth-input:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px var(--cyan-soft);
}

.auth-input-icon,
.auth-password-toggle {
    position: absolute;
    top: 50%;
    display: grid;
    place-items: center;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.auth-input-icon {
    left: 14px;
    pointer-events: none;
}

.auth-password-toggle {
    right: 6px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
}

.auth-password-toggle:hover {
    background: var(--surface-soft);
    color: var(--cyan);
}

.auth-password-toggle span[hidden] {
    display: none;
}

.auth-field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 24px;
}

.auth-remember {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--text-soft);
    font-size: 12.5px;
    cursor: pointer;
}

.auth-remember input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    display: inline-grid;
    width: 18px;
    height: 18px;
    margin: 0;
    border: 1.5px solid var(--border);
    border-radius: 5px;
    background: rgba(7, 11, 20, 0.04);
    place-content: center;
    cursor: pointer;
    transition:
        border-color 150ms ease,
        background 150ms ease;
}

.auth-remember input[type="checkbox"]:hover {
    border-color: rgba(33, 199, 232, 0.5);
}

.auth-remember input[type="checkbox"]:checked {
    border-color: var(--cyan);
    background: var(--cyan);
}

.auth-remember input[type="checkbox"]:checked::before {
    width: 9px;
    height: 9px;
    background: #052a34;
    clip-path: polygon(14% 44%, 0 65%, 45% 100%, 100% 16%, 82% 2%, 42% 68%);
    content: "";
}

.auth-remember input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 2px;
}

.auth-forgot-hint {
    color: var(--cyan);
    font-size: 12.5px;
    font-weight: 600;
    opacity: 0.85;
    cursor: help;
}

.auth-forgot-hint:hover {
    opacity: 1;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-submit {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(90deg, #29d3f5, #1fb6da);
    box-shadow: 0 14px 32px rgba(33, 199, 232, 0.18);
}

.auth-submit svg {
    transition: transform 150ms ease;
}

.auth-submit:hover svg {
    transform: translateX(2px);
}

.auth-login-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--border-soft);
    color: var(--text-muted);
    font-size: 11px;
}

.auth-login-footer span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.auth-login-footer span:not(:last-child)::after {
    margin-left: 6px;
    color: var(--border);
    content: "\00b7";
}

.auth-page-footer {
    position: absolute;
    right: 0;
    bottom: 22px;
    left: 0;
    margin: 0;
    color: var(--text-muted);
    font-size: 11px;
    text-align: center;
}

@media (max-width: 1180px) {
    .auth-shell {
        grid-template-columns: minmax(0, 1fr) 430px;
    }

    .auth-hero {
        padding: 44px 36px;
    }
}

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

    .auth-hero {
        min-height: auto;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 28px 28px;
        border-right: 0;
        border-bottom: 1px solid var(--border-soft);
    }

    .auth-network-visual {
        opacity: 0.22;
    }

    .auth-hero-tagline {
        display: none;
    }

    .auth-login-panel {
        min-height: 620px;
        padding: 48px 24px;
    }
}

@media (max-width: 620px) {
    .auth-hero {
        justify-content: center;
        padding: 22px 20px 18px;
    }

    .auth-network-visual {
        display: none;
    }

    .auth-theme-toggle {
        top: 18px;
        right: 16px;
    }

    .auth-login-panel {
        min-height: auto;
        padding: 74px 16px 56px;
    }

    .auth-login-card {
        padding: 26px 20px;
        border-radius: 16px;
    }

    .auth-field-row {
        flex-wrap: wrap;
        gap: 10px;
    }

    .auth-login-footer {
        justify-content: flex-start;
        row-gap: 8px;
    }

    .auth-login-footer span:not(:last-child)::after {
        content: none;
    }

    .auth-page-footer {
        bottom: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-submit svg {
        transition: none;
    }
}



/* Notifications */

.notification-menu {
    position: relative;
}

.notification-indicator {
    top: -5px;
    right: -6px;
    display: grid;
    width: auto;
    min-width: 18px;
    height: 18px;
    place-items: center;
    padding: 0 4px;
    border: 2px solid var(--surface);
    border-radius: 20px;
    background: var(--cyan);
    color: #052a34;
    font-size: 8px;
    font-weight: 900;
    line-height: 1;
}

.notification-menu-dropdown {
    position: absolute;
    z-index: 90;
    top: calc(100% + 12px);
    right: 0;
    width: min(420px, calc(100vw - 30px));
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-raised);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.notification-menu-header,
.notification-menu-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 17px;
}

.notification-menu-header {
    border-bottom: 1px solid var(--border-soft);
}

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

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

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

.notification-menu-header a,
.notification-menu-footer a {
    color: var(--cyan);
    font-size: 9px;
    font-weight: 800;
}

.notification-menu-list {
    max-height: 390px;
    overflow-y: auto;
}

.notification-menu-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 11px;
    padding: 14px 17px;
    border-bottom: 1px solid var(--border-soft);
    color: var(--text-soft);
    transition: 150ms ease;
}

.notification-menu-item:hover {
    background: var(--surface-soft);
}

.notification-menu-item.is-unread {
    background: rgba(33, 199, 232, 0.045);
}

.notification-menu-content {
    min-width: 0;
}

.notification-menu-content strong,
.notification-menu-content span {
    display: block;
}

.notification-menu-content strong {
    overflow: hidden;
    color: var(--text);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-menu-content span {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 9px;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.notification-menu-item time {
    color: var(--text-muted);
    font-size: 8px;
    white-space: nowrap;
}

.notification-priority-dot {
    width: 8px;
    height: 8px;
    margin-top: 4px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 12px rgba(33, 199, 232, 0.35);
}

.notification-priority-dot.is-warning {
    background: var(--amber);
    box-shadow: 0 0 12px rgba(245, 170, 64, 0.35);
}

.notification-priority-dot.is-critical {
    background: var(--red);
    box-shadow: 0 0 12px rgba(244, 90, 99, 0.35);
}

.notification-menu-empty {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 18px;
    color: var(--text-muted);
}

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

.notification-menu-empty strong {
    color: var(--text);
    font-size: 10px;
}

.notification-menu-empty span {
    margin-top: 3px;
    font-size: 9px;
}

.notification-menu-footer {
    justify-content: center;
    background: var(--surface-soft);
}

.notification-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.notification-summary-card {
    display: flex;
    min-width: 155px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 13px 16px;
    border: 1px solid var(--border-soft);
    border-radius: 11px;
    background: var(--surface);
}

.notification-summary-card span {
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 750;
    text-transform: uppercase;
}

.notification-summary-card strong {
    color: var(--cyan);
    font-size: 20px;
}

.notification-filters {
    display: flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    background: var(--surface);
}

.notification-filters a {
    padding: 8px 12px;
    border-radius: 7px;
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 750;
}

.notification-filters a.is-active {
    background: var(--cyan-soft);
    color: var(--cyan);
}

.notification-page-list {
    padding: 4px 18px;
}

.notification-page-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    padding: 20px 2px;
    border-bottom: 1px solid var(--border-soft);
}

.notification-page-item:last-child {
    border-bottom: 0;
}

.notification-page-item.is-unread {
    position: relative;
}

.notification-page-item.is-unread::before {
    position: absolute;
    top: 18px;
    bottom: 18px;
    left: -18px;
    width: 3px;
    border-radius: 4px;
    background: var(--cyan);
    content: "";
}

.notification-page-content {
    min-width: 0;
}

.notification-page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.notification-page-heading h2 {
    margin: 7px 0 0;
    font-size: 14px;
}

.notification-page-heading time {
    color: var(--text-muted);
    font-size: 9px;
    white-space: nowrap;
}

.notification-page-content > p {
    margin: 8px 0 0;
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.65;
}

.notification-priority-label {
    display: inline-flex;
    padding: 4px 7px;
    border-radius: 20px;
    background: var(--cyan-soft);
    color: var(--cyan);
    font-size: 7px;
    font-weight: 850;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.notification-priority-label.is-warning {
    background: rgba(245, 170, 64, 0.1);
    color: var(--amber);
}

.notification-priority-label.is-critical {
    background: rgba(244, 90, 99, 0.1);
    color: var(--red);
}

.notification-page-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}

.notification-read-state {
    color: var(--green);
    font-size: 9px;
    font-weight: 800;
}

html[data-theme="light"] .notification-menu-dropdown {
    background: #ffffff;
    box-shadow: 0 24px 60px rgba(48, 67, 88, 0.18);
}

html[data-theme="light"] .notification-indicator {
    border-color: #ffffff;
}

@media (max-width: 960px) {
    .notification-menu .topbar-icon-button {
        display: grid;
    }
}

@media (max-width: 620px) {
    .notification-menu-dropdown {
        position: fixed;
        top: 70px;
        right: 12px;
        left: 12px;
        width: auto;
    }

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

    .notification-summary-card {
        width: 100%;
    }

    .notification-page-heading {
        gap: 8px;
    }

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

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

/* Routing incidents */

.incident-filter-bar {
    flex-wrap: wrap;
}

.incident-filter-bar .filter-search {
    min-width: 300px;
    flex: 1 1 340px;
}

.incident-filter-bar .filter-select {
    min-width: 150px;
}

.incident-table td {
    vertical-align: middle;
}

.incident-severity-pill,
.incident-status-pill {
    display: inline-flex;
    min-height: 22px;
    align-items: center;
    padding: 0 8px;
    border-radius: 20px;
    font-size: 8px;
    font-weight: 850;
    white-space: nowrap;
}

.incident-severity-pill.is-low {
    background: rgba(53, 211, 154, 0.1);
    color: var(--green);
}

.incident-severity-pill.is-medium {
    background: rgba(245, 170, 64, 0.11);
    color: var(--amber);
}

.incident-severity-pill.is-high {
    background: rgba(245, 122, 64, 0.12);
    color: #f58a48;
}

.incident-severity-pill.is-critical {
    background: rgba(244, 90, 99, 0.12);
    color: var(--red);
}

.incident-status-pill {
    border: 1px solid var(--border-soft);
    background: var(--surface-soft);
    color: var(--text-muted);
}

.incident-status-pill.is-open,
.incident-status-pill.is-investigating {
    border-color: rgba(244, 90, 99, 0.16);
    color: var(--red);
}

.incident-status-pill.is-mitigating {
    border-color: rgba(245, 170, 64, 0.2);
    color: var(--amber);
}

.incident-status-pill.is-monitoring {
    border-color: rgba(33, 199, 232, 0.2);
    color: var(--cyan);
}

.incident-status-pill.is-resolved,
.incident-status-pill.is-closed {
    border-color: rgba(53, 211, 154, 0.18);
    color: var(--green);
}

.incident-textarea {
    min-height: 130px;
    resize: vertical;
    line-height: 1.6;
}

.incident-show-heading {
    align-items: flex-start;
}

.incident-severity-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
}

.incident-severity-dot.is-medium {
    background: var(--amber);
}

.incident-severity-dot.is-high {
    background: #f58a48;
}

.incident-severity-dot.is-critical {
    background: var(--red);
    box-shadow: 0 0 12px rgba(244, 90, 99, 0.45);
}

.incident-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.incident-summary-card {
    padding: 17px;
}

.incident-summary-card span,
.incident-summary-card strong {
    display: block;
}

.incident-summary-card span {
    color: var(--text-muted);
    font-size: 8px;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.incident-summary-card strong {
    margin-top: 8px;
    color: var(--text);
    font-size: 13px;
}

.incident-severity-text.is-low {
    color: var(--green);
}

.incident-severity-text.is-medium {
    color: var(--amber);
}

.incident-severity-text.is-high {
    color: #f58a48;
}

.incident-severity-text.is-critical {
    color: var(--red);
}

.incident-details-grid {
    margin-bottom: 18px;
}

.incident-timeline-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.55fr);
    gap: 18px;
}

.incident-timeline {
    padding: 4px 18px 18px;
}

.incident-timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 13px;
    padding: 18px 0;
    border-bottom: 1px solid var(--border-soft);
}

.incident-timeline-item:last-child {
    border-bottom: 0;
}

.incident-timeline-marker {
    width: 9px;
    height: 9px;
    margin-top: 4px;
    border: 2px solid var(--surface);
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 0 3px rgba(33, 199, 232, 0.12);
}

.incident-timeline-marker.is-created {
    background: var(--green);
    box-shadow: 0 0 0 3px rgba(53, 211, 154, 0.12);
}

.incident-timeline-marker.is-status_change {
    background: var(--amber);
    box-shadow: 0 0 0 3px rgba(245, 170, 64, 0.12);
}

.incident-timeline-item header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.incident-timeline-item header strong {
    font-size: 10px;
}

.incident-timeline-item time,
.incident-timeline-item > div > span {
    color: var(--text-muted);
    font-size: 8px;
}

.incident-timeline-item p {
    margin: 7px 0;
    color: var(--text-soft);
    font-size: 10px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.incident-update-panel {
    align-self: start;
}

.incident-update-panel form {
    padding: 0 18px 18px;
}

.incident-update-textarea {
    min-height: 190px;
    resize: vertical;
    line-height: 1.6;
}

html[data-theme="light"] .incident-status-pill {
    background: #f8fafc;
}

@media (max-width: 1120px) {
    .incident-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .incident-timeline-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .incident-overview-grid {
        grid-template-columns: 1fr;
    }

    .incident-filter-bar .filter-search,
    .incident-filter-bar .filter-select,
    .incident-filter-bar .button {
        width: 100%;
        min-width: 0;
    }

    .incident-timeline-item header {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }
}

/* Reports */

.report-summary-grid,
.report-incident-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.report-summary-card {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 17px;
}

.report-summary-card > .report-summary-icon,
.report-export-card > .report-export-icon {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border: 1px solid rgba(33, 199, 232, 0.18);
    border-radius: 10px;
    background: rgba(33, 199, 232, 0.08);
    color: var(--cyan);
    line-height: 0;
}

.report-summary-card > .report-summary-icon .ui-icon,
.report-export-card > .report-export-icon .ui-icon {
    display: block;
    margin: auto;
}

.report-summary-card span,
.report-summary-card strong,
.report-incident-card span,
.report-incident-card strong {
    display: block;
}

.report-summary-card > div > span,
.report-incident-card span {
    color: var(--text-muted);
    font-size: 8px;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.report-summary-card strong,
.report-incident-card strong {
    margin-top: 5px;
    color: var(--text);
    font-size: 21px;
}

.report-filter-panel,
.report-export-panel {
    margin-bottom: 18px;
}

.report-filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    padding: 0 18px 18px;
}

.report-filter-actions {
    display: flex;
    grid-column: 1 / -1;
    gap: 9px;
    justify-content: flex-end;
}

.report-incident-card {
    padding: 17px;
}

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

.report-export-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 13px;
    align-items: center;
    padding: 15px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: var(--surface-soft);
}

.report-export-card strong {
    display: block;
    color: var(--text);
    font-size: 10px;
}

.report-export-card p {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 9px;
    line-height: 1.45;
}

html[data-theme="light"] .report-export-card {
    background: #f8fafc;
}

@media (max-width: 1040px) {
    .report-summary-grid,
    .report-incident-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

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

@media (max-width: 620px) {
    .report-summary-grid,
    .report-incident-grid,
    .report-filter-grid {
        grid-template-columns: 1fr;
    }

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

    .report-export-card {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .report-export-card .button {
        grid-column: 1 / -1;
        width: 100%;
    }
}

/* External integrations */

.integration-endpoint,
.integration-heading-endpoint,
.integration-detail-endpoint {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.integration-endpoint {
    display: block;
    max-width: 310px;
    overflow: hidden;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.integration-heading-endpoint {
    max-width: 760px;
    font-family: var(--font-mono);
}

.integration-status-pill {
    display: inline-flex;
    min-height: 22px;
    align-items: center;
    padding: 0 8px;
    border: 1px solid var(--border-soft);
    border-radius: 20px;
    background: var(--surface-soft);
    color: var(--text-muted);
    font-size: 8px;
    font-weight: 850;
    white-space: nowrap;
}

.integration-status-pill.is-success {
    border-color: rgba(53, 211, 154, 0.2);
    background: rgba(53, 211, 154, 0.08);
    color: var(--green);
}

.integration-status-pill.is-failed,
.integration-status-pill.is-blocked {
    border-color: rgba(244, 90, 99, 0.2);
    background: rgba(244, 90, 99, 0.08);
    color: var(--red);
}

.integration-status-pill.is-running,
.integration-status-pill.is-pending {
    border-color: rgba(245, 170, 64, 0.2);
    background: rgba(245, 170, 64, 0.08);
    color: var(--amber);
}

.integration-security-notice {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin: 18px 0 0;
    padding: 14px;
    border: 1px solid rgba(33, 199, 232, 0.18);
    border-radius: 12px;
    background: rgba(33, 199, 232, 0.06);
    color: var(--cyan);
}

.integration-security-notice > div {
    min-width: 0;
}

.integration-security-notice strong,
.integration-security-notice span {
    display: block;
}

.integration-security-notice strong {
    color: var(--text);
    font-size: 10px;
}

.integration-security-notice span {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 9px;
    line-height: 1.55;
}

.integration-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.integration-summary-card {
    padding: 17px;
}

.integration-summary-card span,
.integration-summary-card strong {
    display: block;
}

.integration-summary-card span {
    color: var(--text-muted);
    font-size: 8px;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.integration-summary-card strong {
    margin-top: 7px;
    color: var(--text);
    font-size: 13px;
}

.integration-run-error {
    max-width: 280px;
    overflow-wrap: anywhere;
    color: var(--text-muted);
    font-size: 9px;
}

html[data-theme="light"] .integration-status-pill {
    background: #f8fafc;
}

@media (max-width: 1000px) {
    .integration-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .integration-overview-grid {
        grid-template-columns: 1fr;
    }

    .integration-endpoint {
        max-width: 190px;
    }
}

/* Production diagnostics and errors */

.diagnostic-check-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.diagnostic-check-card {
    padding: 17px;
}

.diagnostic-check-card span,
.diagnostic-check-card strong,
.diagnostic-check-card small {
    display: block;
}

.diagnostic-check-card span {
    color: var(--text-muted);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.diagnostic-check-card strong {
    margin-top: 6px;
    color: var(--text);
    font-size: 14px;
}

.diagnostic-check-card small {
    margin-top: 9px;
    color: var(--text-muted);
    font-size: 9px;
}

.diagnostic-check-card.is-healthy {
    border-color: rgba(53, 211, 154, 0.22);
}

.diagnostic-check-card.is-failed {
    border-color: rgba(244, 90, 99, 0.3);
}

.error-page {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(
            circle at 50% 10%,
            rgba(33, 199, 232, 0.08),
            transparent 34%
        ),
        #050d17;
    color: #eef7ff;
    font-family: var(--font-sans);
}

.error-page-shell {
    width: min(620px, calc(100% - 32px));
    margin: 0 auto;
    padding: 70px 0;
}

.error-page-brand {
    display: flex;
    gap: 11px;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    letter-spacing: 0.1em;
}

.error-page-brand .brand-mark {
    display: inline-flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(33, 199, 232, 0.35);
    border-radius: 12px;
    background: rgba(33, 199, 232, 0.1);
    color: #20d4ef;
    font-size: 12px;
    font-weight: 900;
}

.error-page-card {
    padding: 42px;
    border: 1px solid #17283a;
    border-radius: 18px;
    background: #091523;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.error-page-code {
    color: #20d4ef;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.18em;
}

.error-page-card h1 {
    margin: 13px 0 0;
    font-size: clamp(25px, 5vw, 38px);
}

.error-page-card p {
    max-width: 470px;
    margin: 16px auto 0;
    color: #87a2ba;
    font-size: 12px;
    line-height: 1.7;
}

.error-page-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 28px;
}

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

    .error-page-card {
        padding: 30px 20px;
    }

    .error-page-actions {
        flex-direction: column;
    }
}

/* =========================================================
   Financeiro
   ========================================================= */

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

.finance-safety-panel {
    padding: 18px 20px;
}

.finance-safety-state {
    min-height: 0;
    padding: 0;
    justify-content: flex-start;
    text-align: left;
}

.finance-safety-state > div {
    width: 100%;
}

.finance-safety-state strong {
    display: block;
    margin-bottom: 4px;
}

.finance-list-empty {
    min-height: 150px;
    padding-top: 30px;
    padding-bottom: 30px;
}

@media (max-width: 760px) {
    .page-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .finance-safety-panel {
        padding: 16px;
    }

    .finance-list-empty {
        min-height: 120px;
    }
}

/* Financeiro - compactacao final dos estados vazios */

.panel.finance-safety-panel {
    min-height: 0 !important;
    padding: 16px 20px !important;
}

.panel.finance-safety-panel
.empty-state.finance-safety-state {
    min-height: 0 !important;
    height: auto !important;
    padding: 0 !important;
    display: block !important;
    text-align: left !important;
}

.panel.finance-safety-panel
.empty-state.finance-safety-state > div {
    min-height: 0 !important;
    padding: 0 !important;
    text-align: left !important;
}

.panel
.empty-state.empty-state-large.finance-list-empty,
.panel
.empty-state.finance-list-empty {
    min-height: 110px !important;
    height: auto !important;
    padding: 24px 12px !important;
}

@media (max-width: 760px) {
    .panel.finance-safety-panel {
        padding: 14px 16px !important;
    }

    .panel
    .empty-state.empty-state-large.finance-list-empty,
    .panel
    .empty-state.finance-list-empty {
        min-height: 90px !important;
        padding: 20px 10px !important;
    }
}

/* =========================================================
   Financeiro - Efí homologação
   ========================================================= */

.finance-homologation-banner,
.finance-uncertain-banner,
.finance-charge-existing-banner {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 12px;
}

.finance-homologation-banner {
    border: 1px solid rgba(245, 158, 11, .55);
    background: rgba(245, 158, 11, .10);
}

.finance-uncertain-banner {
    border: 1px solid rgba(239, 68, 68, .45);
    background: rgba(239, 68, 68, .08);
}

.finance-charge-existing-banner {
    border: 1px solid rgba(59, 130, 246, .35);
    background: rgba(59, 130, 246, .07);
}

.finance-homologation-banner strong,
.finance-uncertain-banner strong,
.finance-charge-existing-banner strong {
    font-weight: 800;
}

.finance-homologation-banner span,
.finance-uncertain-banner span,
.finance-charge-existing-banner span {
    line-height: 1.5;
}
/* Operação financeira */
.finance-nav{display:flex;gap:.5rem;overflow-x:auto;margin:0 0 1.25rem;padding:.35rem;background:#111827;border:1px solid #273244;border-radius:.75rem}.finance-nav a{white-space:nowrap;padding:.65rem .9rem;border-radius:.55rem;color:#cbd5e1;text-decoration:none}.finance-nav a.is-active{background:#2563eb;color:#fff}.finance-create-box{margin-bottom:1.25rem}.finance-create-box>summary{display:inline-flex;list-style:none;cursor:pointer}.finance-inline-form,.finance-compact-form{margin-top:1rem}.finance-compact-form{display:grid;gap:.5rem;min-width:18rem}.finance-steps{display:flex;gap:.65rem;flex-wrap:wrap;margin-bottom:1.25rem}.finance-steps span{padding:.45rem .7rem;border-radius:999px;background:rgba(59,130,246,.12);color:#93c5fd}.finance-review-note{display:flex;flex-direction:column;gap:.2rem;margin-top:1rem;padding:1rem;border-left:3px solid #3b82f6;background:rgba(59,130,246,.08)}.finance-filter-grid{flex-wrap:wrap}.filter-date{display:flex;align-items:center;gap:.4rem;font-size:.78rem}.action-menu{position:relative}.action-menu summary{cursor:pointer;list-style:none;font-size:1.2rem}.action-menu-content{position:absolute;right:0;z-index:5;min-width:13rem;display:grid;padding:.4rem;background:#111827;border:1px solid #334155;border-radius:.6rem;box-shadow:0 12px 30px rgba(0,0,0,.35)}.action-menu-content a,.action-menu-content button{padding:.65rem;text-align:left;color:inherit;background:none;border:0;text-decoration:none;cursor:pointer}.finance-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1rem;margin:1rem 0}.finance-metrics>div{display:flex;flex-direction:column;gap:.35rem;padding:1rem;background:rgba(148,163,184,.06);border-radius:.65rem}.finance-metrics span{color:#94a3b8;font-size:.8rem}.finance-metrics strong{font-size:1.15rem}@media(max-width:760px){.finance-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.finance-filter-grid>*{width:100%}.action-menu-content{position:fixed;right:1rem;left:1rem;bottom:1rem}}
html[data-theme="light"] .finance-nav{background:#fff;border-color:#cbd6e2}html[data-theme="light"] .finance-nav a{color:#52647a}html[data-theme="light"] .finance-nav a.is-active{color:#fff}
.finance-overview-cards{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:1rem;margin:1rem 0 1.5rem}.finance-overview-cards article{display:flex;min-height:7rem;flex-direction:column;justify-content:space-between;padding:1.1rem;border:1px solid #273244;border-radius:.8rem;background:linear-gradient(145deg,rgba(30,41,59,.85),rgba(15,23,42,.85))}.finance-overview-cards span,.finance-recurring-grid span{color:#94a3b8;font-size:.75rem;text-transform:uppercase;letter-spacing:.05em}.finance-overview-cards strong{font-size:1.45rem}.finance-overview-cards .requires-attention{border-color:#b45309}.finance-recurring-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1rem}.finance-recurring-grid>div{display:flex;flex-direction:column;gap:.35rem;padding:.85rem;border-radius:.65rem;background:rgba(148,163,184,.06)}.finance-history>summary,.finance-technical>summary{cursor:pointer;font-weight:700;list-style-position:inside}.finance-history[open]>summary,.finance-technical[open]>summary{margin-bottom:1rem}.finance-technical-grid{display:flex;flex-wrap:wrap;gap:1rem;color:#94a3b8;font-size:.85rem}@media(max-width:980px){.finance-overview-cards{grid-template-columns:repeat(3,minmax(0,1fr))}.finance-recurring-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:600px){.finance-overview-cards,.finance-recurring-grid{grid-template-columns:1fr}}
html[data-theme="light"] .finance-overview-cards article{background:#fff;border-color:#cbd6e2;box-shadow:0 8px 24px rgba(49,69,91,.045)}html[data-theme="light"] .finance-overview-cards span{color:#52647a}html[data-theme="light"] .finance-overview-cards .requires-attention{border-color:#b97413}
