:root {
    --bg: #f6f1e8;
    --bg-accent: radial-gradient(circle at top left, rgba(255, 132, 92, 0.28), transparent 32%), radial-gradient(circle at right, rgba(38, 169, 155, 0.18), transparent 28%), #f6f1e8;
    --surface: rgba(255, 251, 246, 0.8);
    --surface-strong: #fffdf9;
    --line: rgba(74, 55, 40, 0.12);
    --text: #2f241d;
    --muted: #6f6259;
    --primary: #b64522;
    --primary-strong: #8f3014;
    --secondary: #116b61;
    --secondary-soft: #dff2ef;
    --shadow: 0 24px 60px rgba(89, 58, 35, 0.14);
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --topbar-height: 92px;
    --sidebar-width: 288px;
    --sidebar-collapsed-width: 92px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg-accent);
}

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

.member-name-inline {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.member-heat-indicator {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    border-radius: 4px;
    background: var(--member-heat-color, #ffffff);
    border: 1px solid rgba(47, 36, 29, 0.12);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

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

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: auto minmax(280px, 1fr) auto;
    gap: 18px;
    align-items: center;
    min-height: var(--topbar-height);
    padding: 18px 24px;
    background: rgba(246, 241, 232, 0.88);
    backdrop-filter: blur(22px);
    border-bottom: 1px solid var(--line);
}

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

.topbar-brand-mark,
.topbar-user-avatar {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(182, 69, 34, 0.12);
    color: var(--primary);
    font-weight: 800;
}

.topbar-brand-copy {
    display: grid;
    gap: 2px;
}

.topbar-brand-copy strong {
    font-size: 1rem;
}

.topbar-brand-copy small,
.topbar-user-name {
    color: var(--muted);
}

.topbar-search {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.topbar-search-field {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 720px;
    min-width: 420px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.92);
    background: rgba(255, 255, 255, 0.82);
    min-height: 60px;
}

.topbar-search-field input {
    border: 0;
    background: transparent;
    padding: 10px 0;
    width: 100%;
    min-width: 0;
    outline: 0;
}

.topbar-search-field:focus-within {
    border-color: rgba(255, 255, 255, 1);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.28);
}

.topbar-business-filter {
    display: flex;
    align-items: center;
    flex: 0 1 260px;
    min-width: 190px;
    min-height: 52px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid rgba(74, 55, 40, 0.1);
    background: rgba(255, 255, 255, 0.72);
}

.topbar-business-filter select {
    min-width: 0;
    width: 100%;
    border: 0;
    background: transparent;
    padding: 0;
}

.topbar-search-icon {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(17, 107, 97, 0.1);
    color: var(--secondary);
    font-size: 0.8rem;
    font-weight: 800;
}

.topbar-search-button {
    white-space: nowrap;
}

.topbar-icon-button {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.74);
    box-shadow: 0 8px 22px rgba(89, 58, 35, 0.08);
}

.topbar-icon-gear {
    font-size: 1.15rem;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 4px 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 8px 22px rgba(89, 58, 35, 0.08);
}

.topbar-logout-form {
    margin: 0;
}

.topbar-logout-button {
    padding: 12px 18px;
}

.batch-review-form {
    display: grid;
    gap: 16px;
}

.batch-review-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.6);
}

.batch-review-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.batch-review-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    color: var(--muted);
    font-size: 0.95rem;
    padding-top: 2px;
}

.batch-review-checkbox input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.batch-review-content {
    min-width: 0;
    display: grid;
    gap: 6px;
}

.settings-danger-panel {
    border: 1px solid rgba(182, 69, 34, 0.22);
    background: linear-gradient(180deg, rgba(182, 69, 34, 0.08), rgba(255, 251, 246, 0.9));
}

.settings-danger-copy {
    color: var(--muted);
    margin: 0 0 12px;
}

.settings-danger-stats {
    margin: 16px 0 20px;
}

.settings-danger-button {
    background: linear-gradient(135deg, #a62f16, #cf5833);
}

.dashboard-monitor-panel {
    display: grid;
    gap: 18px;
    margin-bottom: 24px;
}

.dashboard-monitor-grid {
    margin-top: 0;
}

.dashboard-monitor-alert {
    display: grid;
    gap: 6px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(182, 69, 34, 0.18);
    background: linear-gradient(180deg, rgba(182, 69, 34, 0.08), rgba(255, 255, 255, 0.72));
}

.dashboard-monitor-alert strong {
    color: var(--primary-strong);
}

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

.panel-nested {
    padding: 18px;
    background: rgba(255, 255, 255, 0.46);
    border: 1px solid var(--line);
    box-shadow: none;
}

.shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-height: calc(100vh - var(--topbar-height));
    align-items: start;
}

.sidebar {
    position: sticky;
    top: var(--topbar-height);
    height: calc(100vh - var(--topbar-height));
    padding: 20px 18px 24px;
    background: rgba(255, 247, 239, 0.72);
    backdrop-filter: blur(24px);
    border-right: 1px solid var(--line);
    overflow: hidden;
}

.sidebar-body {
    display: flex;
    height: 100%;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 0;
}

.sidebar h1,
.login-hero h1,
.hero-card h2,
.section-header h2 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.6rem);
    line-height: 0.96;
    letter-spacing: -0.05em;
}

.sidebar-copy,
.hero-card p,
.login-hero p {
    color: var(--muted);
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.74rem;
    color: var(--secondary);
    margin-bottom: 10px;
}

.nav {
    display: grid;
    gap: 10px;
    margin: 0;
    align-content: start;
}

.nav a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 18px;
    background: transparent;
    transition: 180ms ease;
}

.nav-icon {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(17, 107, 97, 0.1);
    color: var(--secondary);
    font-size: 0.85rem;
    font-weight: 800;
    flex: 0 0 auto;
}

.nav-label {
    white-space: nowrap;
}

.nav a.active,
.nav a:hover {
    background: var(--surface-strong);
    box-shadow: var(--shadow);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.sidebar-toggle-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.76);
    box-shadow: 0 8px 22px rgba(89, 58, 35, 0.08);
    padding: 0;
    gap: 4px;
    flex-direction: column;
}

.sidebar-toggle-icon span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: var(--text);
}

.sidebar-toggle-closed {
    display: none;
}

.sidebar-logout {
    white-space: nowrap;
}

.content {
    position: relative;
    padding: 28px 32px 32px;
    min-width: 0;
}

.heatmap-legend {
    position: fixed;
    right: 28px;
    bottom: 24px;
    z-index: 20;
    display: grid;
    gap: 10px;
    width: min(280px, calc(100vw - 48px));
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(255, 251, 246, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.62);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.heatmap-legend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.heatmap-legend strong {
    font-size: 0.95rem;
}

.heatmap-legend-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 78px;
    padding: 8px 12px;
    border: 0;
    border-radius: 999px;
    background: rgba(17, 107, 97, 0.1);
    color: var(--secondary);
    cursor: pointer;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
}

.heatmap-legend-toggle-closed {
    display: none;
}

.heatmap-legend-copy {
    margin: 0;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.45;
}

.heatmap-legend-gradient {
    height: 14px;
    border-radius: 999px;
    border: 1px solid rgba(47, 36, 29, 0.12);
    background: linear-gradient(90deg, #ffffff 0%, #cfe8ff 20%, #4d8dff 55%, #d62828 100%);
}

.heatmap-legend-scale-labels,
.heatmap-legend-labels {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    font-size: 0.76rem;
    color: var(--muted);
}

.heatmap-legend-scale-labels span:last-child,
.heatmap-legend-labels span:last-child {
    text-align: right;
}

.heatmap-legend-scale-labels span:nth-child(2),
.heatmap-legend-labels span:nth-child(2) {
    text-align: center;
}

.heatmap-legend-stop-empty {
    background: #ffffff;
}

.heatmap-legend-stop-cold {
    background: #4d8dff;
}

.heatmap-legend-stop-hot {
    background: #d62828;
}

.heatmap-legend-swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 6px;
    border-radius: 3px;
    border: 1px solid rgba(47, 36, 29, 0.12);
    vertical-align: -1px;
}

html.heatmap-legend-collapsed .heatmap-legend {
    width: auto;
    min-width: 0;
}

html.heatmap-legend-collapsed .heatmap-legend-body {
    display: none;
}

html.heatmap-legend-collapsed .heatmap-legend-toggle-open {
    display: none;
}

html.heatmap-legend-collapsed .heatmap-legend-toggle-closed {
    display: inline;
}

.hero-card,
.panel,
.stat-card,
.flash {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(24px);
    box-shadow: var(--shadow);
    border-radius: var(--radius-xl);
}

.hero-card,
.panel {
    padding: 28px;
}

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

.hero-actions,
.section-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

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

.section-header {
    margin-bottom: 18px;
}

.stats-grid,
.split-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 24px;
}

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

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

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

.detail-grid {
    display: grid;
    gap: 34px;
    margin-top: 28px;
}

.detail-card {
    display: grid;
    gap: 20px;
}

.detail-card-spaced {
    padding-top: 32px;
    padding-bottom: 32px;
}

.stat-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    min-height: 150px;
    padding: 24px;
    overflow: hidden;
}

.stat-card strong {
    display: block;
    margin-top: 12px;
    font-size: 2rem;
    max-width: 100%;
    line-height: 1;
    word-break: break-word;
}

.stat-card span {
    display: block;
    max-width: 100%;
    font-size: 0.92rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.stat-card span,
.list-item span,
small,
.empty-state,
.empty-cell {
    color: var(--muted);
}

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

.panel-header h3 {
    margin: 0;
}

.panel-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 12px;
    min-width: 0;
}

.blueprint-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(111, 98, 89, 0.12);
    color: #5d544d;
    border: 1px solid rgba(111, 98, 89, 0.18);
}

.blueprint-status-badge-pending,
.blueprint-status-badge-generated,
.blueprint-status-badge-seeded_from_approved_blueprint {
    color: #8a5a12;
    background: rgba(191, 127, 17, 0.12);
    border-color: rgba(191, 127, 17, 0.18);
}

.blueprint-status-badge-approved {
    color: #0d5f56;
    background: rgba(17, 107, 97, 0.12);
    border-color: rgba(17, 107, 97, 0.18);
}

.blueprint-status-badge-rejected,
.blueprint-status-badge-failed {
    color: #a2372b;
    background: rgba(189, 63, 43, 0.12);
    border-color: rgba(189, 63, 43, 0.18);
}

.blueprint-status-badge-not_generated {
    color: #5d544d;
    background: rgba(111, 98, 89, 0.12);
    border-color: rgba(111, 98, 89, 0.18);
}

.panel-header-actions .table-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
}

.detail-card pre,
.list-item pre {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

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

.json-action-card {
    display: grid;
    gap: 10px;
}

.json-modal-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(17, 107, 97, 0.08);
    color: var(--secondary);
}

.json-modal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    min-height: 24px;
    border-radius: 999px;
    background: rgba(17, 107, 97, 0.14);
    font-size: 0.78rem;
    font-weight: 800;
}

.json-modal .member-modal-shell {
    max-height: min(82vh, 920px);
}

.split-grid-staging {
    align-items: start;
}

.list-stack {
    display: grid;
    gap: 14px;
}

.staging-group {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.48);
}

.staging-group + .staging-group {
    margin-top: 8px;
}

.staging-group-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.staging-group-header h4 {
    margin: 0;
}

.staging-group-header p {
    margin: 6px 0 0;
    color: var(--secondary);
}

.staging-group-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
}

.staging-group-badge-baseline {
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
}

.staging-group-badge-enriched {
    background: rgba(5, 150, 105, 0.14);
    color: #047857;
}

.staging-group-badge-new {
    background: rgba(182, 69, 34, 0.14);
    color: var(--primary-strong);
}

.coverage-company-list {
    display: grid;
    gap: 14px;
}

.coverage-priority-box {
    display: grid;
    gap: 12px;
    margin-top: 18px;
    padding: 18px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(189, 63, 43, 0.14);
    background: rgba(189, 63, 43, 0.06);
}

.coverage-priority-box h4 {
    margin: 0;
}

.coverage-priority-list {
    display: grid;
    gap: 10px;
}

.coverage-priority-item {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.72);
}

.coverage-priority-item p {
    margin: 0;
    color: var(--secondary);
}

.coverage-company-card {
    display: grid;
    gap: 14px;
    padding: 18px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.58);
}

.coverage-company-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 14px;
}

.coverage-company-header h4 {
    margin: 0;
}

.coverage-company-header p {
    margin: 6px 0 0;
    color: var(--secondary);
    font-size: 0.92rem;
}

.coverage-company-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.coverage-status-badge,
.coverage-tag,
.coverage-priority-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.coverage-status-badge {
    border: 1px solid transparent;
    background: rgba(111, 98, 89, 0.12);
    color: #5d544d;
}

.coverage-status-badge-covered {
    color: #0d5f56;
    background: rgba(17, 107, 97, 0.12);
    border-color: rgba(17, 107, 97, 0.18);
}

.coverage-status-badge-pending_blueprint_approval {
    color: #8a5a12;
    background: rgba(191, 127, 17, 0.12);
    border-color: rgba(191, 127, 17, 0.18);
}

.coverage-status-badge-no_member_coverage,
.coverage-status-badge-not_started {
    color: #a2372b;
    background: rgba(189, 63, 43, 0.12);
    border-color: rgba(189, 63, 43, 0.18);
}

.coverage-tag {
    color: var(--ink);
    background: rgba(111, 98, 89, 0.1);
}

.coverage-priority-badge {
    border: 1px solid transparent;
}

.coverage-priority-badge-critica {
    color: #a2372b;
    background: rgba(189, 63, 43, 0.12);
    border-color: rgba(189, 63, 43, 0.18);
}

.coverage-priority-badge-alta {
    color: #8a5a12;
    background: rgba(191, 127, 17, 0.12);
    border-color: rgba(191, 127, 17, 0.18);
}

.coverage-priority-badge-media {
    color: #1d4ed8;
    background: rgba(37, 99, 235, 0.12);
    border-color: rgba(37, 99, 235, 0.18);
}

.coverage-priority-badge-baixa {
    color: #0d5f56;
    background: rgba(17, 107, 97, 0.12);
    border-color: rgba(17, 107, 97, 0.18);
}

.coverage-company-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.list-item {
    padding: 16px 18px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.65);
}

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

.meta-item {
    display: grid;
    gap: 8px;
    padding: 18px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.68);
}

.meta-item span,
.timeline-meta span {
    color: var(--muted);
    font-size: 0.88rem;
}

.meta-item strong {
    line-height: 1.35;
}

.meta-item-wide {
    grid-column: 1 / -1;
}

.network-card {
    overflow: auto;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(17, 107, 97, 0.08), rgba(255, 255, 255, 0.66));
    border: 1px solid var(--line);
    padding: 16px;
}

.network-svg {
    width: 100%;
    min-width: 980px;
    height: auto;
    display: block;
}

.network-edge {
    stroke: rgba(17, 107, 97, 0.82);
    stroke-width: 1.5;
    stroke-linecap: round;
    opacity: 0.9;
}

.network-edge-label {
    fill: var(--secondary);
    font-size: 10px;
    font-weight: 700;
    text-anchor: middle;
    paint-order: stroke;
    stroke: rgba(255, 253, 249, 0.95);
    stroke-width: 6px;
    stroke-linejoin: round;
}

.network-node {
    fill: var(--network-node-fill, #fff8f2);
    stroke: var(--primary);
    stroke-width: 2;
}

.network-node-center {
    fill: var(--network-node-fill, #eef8f6);
    stroke: var(--secondary);
    stroke-width: 3;
}

.network-node-level-1 {
    fill: var(--network-node-fill, #fff7f0);
}

.network-node-level-2 {
    fill: var(--network-node-fill, #fffbf7);
    stroke-width: 1.75;
}

.network-node-level-3 {
    fill: var(--network-node-fill, #fffdf9);
    stroke-width: 1.5;
}

.network-node-label,
.network-node-subtitle {
    text-anchor: middle;
}

.network-node-label {
    fill: var(--text);
    font-size: 11px;
    font-weight: 700;
    paint-order: stroke;
    stroke: rgba(255, 253, 249, 0.96);
    stroke-width: 6px;
    stroke-linejoin: round;
}

.network-node-subtitle {
    fill: var(--muted);
    font-size: 9px;
    paint-order: stroke;
    stroke: rgba(255, 253, 249, 0.96);
    stroke-width: 5px;
    stroke-linejoin: round;
}

.network-node-label-level-2,
.network-node-label-level-3 {
    font-size: 10px;
}

.network-node-subtitle-level-2,
.network-node-subtitle-level-3 {
    font-size: 8px;
}

.network-workspace {
    display: grid;
    gap: 14px;
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 20% 10%, rgba(17, 107, 97, 0.12), transparent 28%),
        linear-gradient(180deg, rgba(255, 250, 243, 0.92), rgba(246, 241, 232, 0.74));
    border: 1px solid var(--line);
    padding: 14px;
}

.network-toolbar,
.network-toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.network-toolbar span {
    color: var(--muted);
    margin-left: 8px;
}

.network-filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 10px;
}

.network-filters label {
    display: grid;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.68);
    box-shadow: inset 0 0 0 1px rgba(74, 55, 40, 0.08);
}

.network-filters span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.network-filters select {
    width: 100%;
    border: 0;
    background: transparent;
    padding: 0;
    font-weight: 800;
}

.network-interactive-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 14px;
    min-height: 640px;
}

.network-cytoscape {
    position: relative;
    min-height: 640px;
    overflow: hidden;
    border-radius: 24px;
    background:
        linear-gradient(rgba(74, 55, 40, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(74, 55, 40, 0.045) 1px, transparent 1px),
        rgba(255, 255, 255, 0.72);
    background-size: 28px 28px;
    box-shadow: inset 0 0 0 1px rgba(74, 55, 40, 0.08);
}

.network-loading {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--muted);
    font-weight: 700;
}

.network-inspector {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.74);
    box-shadow: inset 0 0 0 1px rgba(74, 55, 40, 0.08);
}

.network-inspector h4 {
    margin: 0;
    font-size: 1.08rem;
}

.network-inspector p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.network-inspector .primary-button {
    margin-top: auto;
    justify-content: center;
}

.network-inspector-list {
    display: grid;
    gap: 10px;
    margin: 0;
}

.network-inspector-list div {
    display: grid;
    gap: 2px;
}

.network-inspector-list dt {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.network-inspector-list dd {
    margin: 0;
    font-weight: 800;
}

.timeline {
    position: relative;
    display: grid;
    gap: 18px;
    padding-left: 24px;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 9px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: rgba(17, 107, 97, 0.25);
}

.timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: 16px;
}

.timeline-marker {
    width: 20px;
    height: 20px;
    margin-top: 8px;
    border-radius: 999px;
    background: var(--primary);
    box-shadow: 0 0 0 5px rgba(182, 69, 34, 0.14);
}

.timeline-content {
    padding: 18px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.7);
}

.timeline-content p {
    margin: 10px 0 14px;
}

.timeline-header,
.timeline-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.table-wrap {
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 10px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

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

.table-actions form {
    margin: 0;
}

.table-actions .primary-button,
.table-actions .secondary-button,
.table-actions .ghost-button,
.table-actions .settings-danger-button {
    text-decoration: none;
}

.table-actions a.active-filter {
    color: var(--primary-strong);
    font-weight: 800;
}

.inline-form {
    display: grid;
    gap: 14px;
    margin-bottom: 20px;
}

.json-preview {
    max-height: 420px;
    overflow: auto;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--text);
    white-space: pre-wrap;
}

.inline-form-grid {
    display: grid;
    gap: 14px;
}

.news-snippet {
    min-width: 280px;
    max-width: 480px;
    white-space: normal;
    line-height: 1.5;
}

.news-item {
    gap: 12px;
}

.news-item-header,
.news-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.news-item-content {
    margin: 0;
    line-height: 1.65;
    white-space: pre-wrap;
}

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

.form-section {
    display: grid;
    gap: 16px;
    margin-top: 28px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.52);
}

.contact-boxes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.contact-boxes-wide {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.contact-box {
    display: grid;
    gap: 14px;
    padding: 20px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.55);
}

.contact-box-label {
    color: var(--secondary);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.contact-box-list {
    display: grid;
    gap: 6px;
    min-height: 72px;
    color: var(--text);
    font-size: 0.92rem;
    line-height: 1.45;
}

.form-hint {
    margin: -4px 0 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.repeatable-group {
    display: grid;
    gap: 12px;
}

.repeatable-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px auto;
    gap: 14px;
    align-items: end;
    padding: 16px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.72);
}

.repeatable-row-social {
    grid-template-columns: minmax(180px, 220px) minmax(0, 1fr) auto;
}

.repeatable-row-business {
    grid-template-columns: minmax(220px, 320px) minmax(0, 1fr) auto;
}

.repeatable-field,
.repeatable-choice {
    display: grid;
    gap: 8px;
}

.repeatable-field-wide {
    min-width: 0;
}

.repeatable-choice {
    justify-items: center;
    align-items: center;
}

.repeatable-choice input {
    width: auto;
    margin: 0;
}

.member-modal {
    width: min(920px, calc(100vw - 48px));
    padding: 0;
    border: 0;
    border-radius: var(--radius-xl);
    background: transparent;
    box-shadow: var(--shadow);
}

.member-modal::backdrop {
    background: rgba(47, 36, 29, 0.35);
    backdrop-filter: blur(4px);
}

.member-modal-shell {
    display: grid;
    gap: 18px;
    padding: 28px;
    background: var(--surface-strong);
    border-radius: var(--radius-xl);
}

.member-modal-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

label {
    display: grid;
    gap: 10px;
}

label span {
    font-size: 0.92rem;
    font-weight: 600;
}

label small {
    color: var(--muted);
}

input,
select,
textarea,
button {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.84);
    padding: 14px 16px;
    color: var(--text);
}

textarea {
    resize: vertical;
}

.full-span {
    grid-column: 1 / -1;
}

.primary-button,
.secondary-button,
.ghost-button {
    border: 0;
    border-radius: 999px;
    padding: 14px 20px;
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    box-shadow: 0 18px 40px rgba(182, 69, 34, 0.28);
}

.secondary-button {
    background: var(--secondary-soft);
    color: var(--secondary);
}

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

.danger-button {
    padding: 0;
    color: var(--primary-strong);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
    transform: translateY(-1px);
}

.flash,
.error-box {
    margin-bottom: 20px;
    padding: 16px 18px;
}

.flash {
    background: rgba(17, 107, 97, 0.12);
    color: var(--secondary);
}

.error-box {
    border-radius: 18px;
    background: rgba(182, 69, 34, 0.1);
    color: var(--primary-strong);
}

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

.checkbox input {
    width: auto;
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-shell {
    width: min(1120px, 100%);
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 24px;
}

.login-hero,
.login-shell .panel {
    padding: 34px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
}

.login-hero {
    background: linear-gradient(135deg, rgba(182, 69, 34, 0.92), rgba(255, 158, 124, 0.8));
    color: white;
}

.login-hero p,
.login-hero .eyebrow {
    color: rgba(255, 255, 255, 0.82);
}

.login-tip {
    display: inline-grid;
    gap: 6px;
    margin-top: 28px;
    padding: 18px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.16);
}

@media (max-width: 960px) {
    .topbar,
    .shell,
    .login-shell,
    .split-grid,
    .json-action-grid,
    .split-grid-monitor,
    .stats-grid,
    .contact-boxes,
    .form-grid,
    .meta-grid,
    .repeatable-row,
    .repeatable-row-social {
        grid-template-columns: 1fr;
    }

    .topbar {
        position: static;
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .topbar-search,
    .topbar-actions,
    .topbar-left {
        width: 100%;
    }

    .topbar-search {
        flex-wrap: wrap;
    }

    .topbar-search-field,
    .topbar-business-filter {
        flex-basis: 100%;
        min-width: 0;
    }

    .network-interactive-shell {
        grid-template-columns: 1fr;
    }

    .network-filters {
        grid-template-columns: 1fr;
    }

    .network-cytoscape {
        min-height: 520px;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .hero-card,
    .section-header,
    .hero-actions {
        flex-direction: column;
        align-items: start;
    }

    .topbar-user-name {
        display: none;
    }

    .heatmap-legend {
        position: static;
        width: 100%;
        margin-top: 24px;
    }
}

html.sidebar-collapsed .shell {
    grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr);
}

html.sidebar-collapsed .sidebar {
    padding-left: 16px;
    padding-right: 16px;
}

html.sidebar-collapsed .nav-label,
html.sidebar-collapsed .sidebar-toggle-open {
    display: none;
}

html.sidebar-collapsed .nav a {
    justify-content: center;
    padding-left: 10px;
    padding-right: 10px;
}

html.sidebar-collapsed .sidebar-logout {
    padding-left: 0;
    padding-right: 0;
}

.pagination-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px solid rgba(31, 31, 28, 0.1);
}

.pagination-summary {
    color: var(--muted);
    font-size: 0.92rem;
}

.pagination-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.pagination-link,
.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(31, 31, 28, 0.12);
    background: rgba(255, 255, 255, 0.88);
    color: var(--ink);
    font-size: 0.92rem;
    line-height: 1;
    text-decoration: none;
}

.pagination-link:hover {
    border-color: rgba(182, 69, 34, 0.3);
    color: var(--accent);
}

.pagination-link-active {
    border-color: rgba(182, 69, 34, 0.24);
    background: rgba(182, 69, 34, 0.12);
    color: var(--accent);
    font-weight: 700;
}

.pagination-link-disabled,
.pagination-ellipsis {
    color: rgba(31, 31, 28, 0.45);
    background: rgba(246, 243, 238, 0.85);
}

.agent-source-row {
    margin-top: 8px;
}

.agent-source-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.agent-source-badge-external {
    color: #0d5f56;
    background: rgba(17, 107, 97, 0.12);
    border-color: rgba(17, 107, 97, 0.18);
}

.agent-source-badge-fallback {
    color: #9a3f16;
    background: rgba(182, 69, 34, 0.12);
    border-color: rgba(182, 69, 34, 0.18);
}

.agent-source-badge-internal {
    color: #5d544d;
    background: rgba(111, 98, 89, 0.12);
    border-color: rgba(111, 98, 89, 0.16);
}
