/* Verbinde: warm editorial surfaces and terracotta accents for people and connections. */
:root {
    color-scheme: light;
    --bg: #fbf8f3;
    --bg-accent: #fbf8f3;
    --surface: #ffffff;
    --surface-strong: #ffffff;
    --line: #e5d9cf;
    --text: #352923;
    --ink: #352923;
    --muted: #74665c;
    --primary: #b64522;
    --primary-strong: #8f3014;
    --secondary: #b64522;
    --secondary-soft: #f5e8df;
    --accent: #b64522;
    --soft: #f5e8df;
    --shadow: none;
    --radius-xl: 8px;
    --radius-lg: 6px;
    --radius-md: 5px;
    --topbar-height: 78px;
    --sidebar-width: 236px;
    --sidebar-collapsed-width: 76px;
}
body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; line-height: 1.18; letter-spacing: -.025em; }
h3, h4 { line-height: 1.35; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
:is(a, button, summary, input, select, textarea):focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.ui-icon { display: inline-block; flex: 0 0 auto; vertical-align: middle; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; padding: 12px 18px; color: #fff; background: var(--text); border-radius: 4px; transform: translateY(-180%); }
.skip-link:focus { transform: translateY(0); }
.brand-period { color: var(--primary); }

/* Application frame */
.topbar {
    position: sticky;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) auto;
    min-height: 78px;
    align-items: center;
    gap: 24px;
    padding: 12px 28px 12px 18px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    backdrop-filter: none;
}
.topbar-left, .topbar-actions { gap: 12px; min-width: 0; width: auto; }
.topbar-brand { gap: 0; }
.topbar-brand-copy { gap: 0; }
.topbar-brand-copy strong { font: 700 29px/1.1 Georgia, "Times New Roman", serif; letter-spacing: -.06em; }
.topbar-brand-copy small { margin-top: 3px; font-size: 10px; letter-spacing: .06em; }
.topbar-search { flex-wrap: nowrap; gap: 8px; width: 100%; max-width: 850px; }
.topbar-search-field { flex: 1 1 260px; min-width: 0; min-height: 44px; padding: 0 12px; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 5px; }
.topbar-search-field input { min-height: 42px; padding: 8px 0; font-size: 13px; border-radius: 0; }
.topbar-search-field input:focus-visible { outline: none; box-shadow: none; }
.topbar-search-field:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px #b6452216; }
.topbar-search-icon { width: 20px; height: 20px; background: none; color: var(--muted); }
.topbar-search-icon .ui-icon { width: 18px; height: 18px; }
.topbar-business-filter { flex: 0 1 190px; min-width: 138px; min-height: 44px; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.topbar-business-filter select { min-height: 42px; font-size: 12px; }
.topbar-search-button { min-height: 44px; padding: 8px 14px; font-size: 13px; }
.topbar-icon-button, .sidebar-toggle-icon { width: 40px; height: 40px; border: 1px solid transparent; border-radius: 5px; background: transparent; box-shadow: none; color: var(--text); cursor: pointer; flex: 0 0 auto; }
.topbar-icon-button:hover, .sidebar-toggle-icon:hover { background: var(--secondary-soft); border-color: var(--line); }
.topbar-user { gap: 8px; padding: 0; background: transparent; box-shadow: none; border-radius: 0; }
.topbar-user-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--secondary-soft); color: var(--primary-strong); font-size: 12px; font-weight: 600; border: 1px solid #e7cfc0; }
.topbar-user-name { max-width: 130px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-search-toggle, .sidebar-mobile-heading, .sidebar-backdrop { display: none; }
.shell { grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: calc(100vh - var(--topbar-height)); }
.sidebar { position: sticky; top: var(--topbar-height); height: calc(100vh - var(--topbar-height)); padding: 24px 14px 18px; background: var(--bg); border-right: 1px solid var(--line); backdrop-filter: none; overflow-y: auto; scrollbar-width: thin; }
.sidebar-body { height: auto; min-height: 100%; }
.nav { gap: 24px; }
.nav-group { display: grid; gap: 3px; }
.nav-section-label { display: block; margin: 0 12px 6px; font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #827367; }
.nav a { gap: 11px; min-height: 39px; padding: 8px 12px; border: 1px solid transparent; border-radius: 5px; font-size: 13px; color: #725c4f; transition: background-color 120ms ease, color 120ms ease; }
.nav-icon { width: 20px; height: 20px; background: transparent; color: currentColor; border-radius: 0; }
.nav-icon .ui-icon { width: 18px; height: 18px; }
.nav a:hover { background: #f6eee7; color: var(--text); box-shadow: none; }
.nav a.active { background: var(--secondary-soft); border-color: #e7cfc0; color: var(--primary-strong); font-weight: 600; box-shadow: none; }
.sidebar-footer { margin-top: 28px; padding-top: 14px; }
.sidebar-footer form { margin: 0; }
.sidebar-logout { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 40px; padding: 8px 12px; text-align: left; font-size: 13px; color: var(--muted); }
.sidebar-logout .ui-icon { width: 18px; height: 18px; }
.content { padding: 32px; min-width: 0; }
.content:focus { outline: none; }
html.sidebar-collapsed .sidebar { padding-left: 12px; padding-right: 12px; }
html.sidebar-collapsed .nav-section-label { height: 1px; width: 24px; margin: 4px auto 10px; background: var(--line); overflow: hidden; font-size: 0; }
html.sidebar-collapsed .nav { gap: 16px; }
html.sidebar-collapsed .nav a { padding: 9px; }
html.sidebar-collapsed .sidebar-logout { justify-content: center; }

/* Existing CRM views retain their structure with quieter surfaces and controls. */
.hero-card, .panel, .stat-card, .flash { background: #fff; border-color: var(--line); border-radius: 6px; box-shadow: none; backdrop-filter: none; }
.hero-card, .panel { padding: 26px; }
.hero-card { align-items: center; }
.hero-card h2, .section-header h2 { font: 400 clamp(28px, 2.6vw, 38px)/1.16 Georgia, "Times New Roman", serif; letter-spacing: -.025em; }
.hero-card p { max-width: 760px; margin-bottom: 0; line-height: 1.6; }
.eyebrow { font-size: 10px; font-weight: 600; letter-spacing: .14em; color: var(--primary); }
.panel-header h3 { font-size: 17px; font-weight: 600; }
.stat-card { min-height: 124px; padding: 22px; }
.stat-card strong { font: 400 34px/1.1 Georgia, "Times New Roman", serif; letter-spacing: -.03em; }
.stat-card span { font-size: 12px; }
.panel-nested, .list-item, .timeline-content, .form-section, .contact-box, .repeatable-row, .json-preview, .json-action-card, .coverage-company-card, .network-inspector, .batch-review-toolbar { background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: none; }
.meta-item, .network-filters label { background: var(--soft); border-radius: 5px; box-shadow: none; }
.network-workspace, .network-card { background: var(--soft); border-color: var(--line); border-radius: 6px; }
.network-cytoscape { border-radius: 5px; }
.timeline-marker { box-shadow: 0 0 0 4px var(--secondary-soft); }
.heatmap-legend { background: #fff; border-color: var(--line); border-radius: 6px; backdrop-filter: none; box-shadow: 0 3px 14px #35292309; }
.heatmap-legend-toggle { border-radius: 4px; background: var(--secondary-soft); }
input, select, textarea { min-width: 0; border-color: #d9c8bb; border-radius: 5px; background: #fff; padding: 11px 12px; }
input::placeholder, textarea::placeholder { color: #8b7d72; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); }
label { gap: 7px; }
label span { font-size: 12px; font-weight: 600; }
.primary-button, .secondary-button, .ghost-button { min-height: 42px; padding: 10px 16px; border: 1px solid transparent; border-radius: 5px; font-size: 13px; font-weight: 500; transition: background-color 120ms ease, border-color 120ms ease; box-shadow: none; }
.primary-button { background: var(--primary); border-color: var(--primary); color: #fff; }
.primary-button:hover { background: var(--primary-strong); border-color: var(--primary-strong); }
.secondary-button { color: var(--text); background: #fff; border-color: #d9c8bb; }
.secondary-button:hover { background: var(--secondary-soft); border-color: #c8a693; }
.ghost-button { color: var(--primary); background: transparent; }
.ghost-button:hover { background: var(--secondary-soft); }
.primary-button:hover, .secondary-button:hover, .ghost-button:hover { transform: none; }
.danger-button { color: #9b4034; }
button:disabled { opacity: .55; cursor: not-allowed; }
.table-wrap { max-width: 100%; }
th { color: var(--muted); background: #faf5ef; font-size: 11px; font-weight: 600; letter-spacing: .035em; }
th, td { border-color: var(--line); padding: 14px 12px; }
td { font-size: 13px; }
tbody tr:hover { background: #fdf9f5; }
.table-actions { gap: 8px; }
.table-actions a:not(.primary-button):not(.secondary-button):not(.ghost-button) { color: var(--primary); text-underline-offset: 4px; }
.table-actions a:hover { text-decoration: underline; }
.flash { background: #eaf2ed; color: #195f52; }
.error-box { border: 1px solid #e4c4ba; border-radius: 5px; color: #8f382c; background: #fbefea; }
.member-modal { border: 1px solid var(--line); border-radius: 8px; }
.member-modal::backdrop { background: #3529234d; backdrop-filter: none; }
.member-modal-shell { border-radius: 8px; }
.pagination-nav { border-color: var(--line); }
.pagination-link, .pagination-ellipsis { border-radius: 4px; border-color: var(--line); background: #fff; }
.pagination-link:hover { color: var(--primary); border-color: var(--primary); }
.pagination-link-active { background: var(--secondary-soft); border-color: #dfbaa7; color: var(--primary-strong); }
.pagination-link-disabled, .pagination-ellipsis { color: var(--muted); background: var(--soft); }

/* Login */
.login-body { min-height: 100vh; min-height: 100svh; padding: 32px; background: var(--bg); }
.login-shell { width: min(1120px, 100%); grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 0; align-items: stretch; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.login-header { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px 36px; border-bottom: 1px solid var(--line); background: var(--bg); }
.login-hero { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 36px; border-radius: 0; background: #f5e8df; color: var(--text); box-shadow: none; }
.login-brand { font: 700 36px/1 Georgia, "Times New Roman", serif; letter-spacing: -.06em; }
.login-home-link { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; color: var(--muted); font-size: 12px; }
.login-home-link:hover { color: var(--primary); }
.login-home-link span { font-size: 20px; }
.login-introduction { margin: 0 0 28px; }
.login-hero h2 { margin: 0; font: 400 clamp(34px, 3.2vw, 44px)/1.12 Georgia, "Times New Roman", serif; letter-spacing: -.035em; }
.login-hero h2 em { color: var(--primary); font-weight: 400; }
.login-hero .eyebrow { color: var(--primary); font-size: 10px; margin: 0 0 16px; }
.login-photo { margin: 0; }
.login-photo img { display: block; width: 100%; height: auto; aspect-ratio: 1.5; border-radius: 5px; }
.login-photo figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin-top: 14px; color: var(--muted); font-size: 10px; }
.login-photo figcaption small { font-size: 9px; }
.login-shell .login-panel { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 48px; border: 0; border-left: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.login-panel > .eyebrow { margin: 0 0 12px; }
.login-panel h1 { margin: 0 0 12px; font-size: 32px; }
.login-description { margin: 0 0 32px; font-size: 13px; color: var(--muted); }
.login-form { grid-template-columns: 1fr; gap: 20px; }
.login-form input { min-height: 48px; font-size: 16px; }
.login-form .primary-button { gap: 16px; justify-content: space-between; min-height: 48px; margin-top: 8px; }
.login-access-note { margin: 28px 0 0; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.7; }
.login-form .login-error { color: #9b4034; }
.login-form [aria-invalid="true"] { border-color: #b56659; }

@media (max-width: 1250px) {
    .topbar { gap: 16px; grid-template-columns: 206px minmax(0, 1fr) auto; padding-right: 20px; }
    .topbar-user-name { display: none; }
    .topbar-business-filter { flex-basis: 156px; }
    .content { padding: 24px; }
}
@media (max-width: 1100px) {
    .topbar { grid-template-columns: 1fr auto; }
    .header-search-toggle { display: inline-flex; }
    .topbar-search { display: none; grid-column: 1 / -1; grid-row: 2; max-width: none; }
    html.header-search-open .topbar-search { display: flex; }
    .topbar-actions { justify-content: flex-end; }
}
@media (min-width: 901px) and (max-width: 960px) {
    .shell { grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
    .topbar { position: sticky; align-items: center; }
}
@media (max-width: 900px) {
    .topbar { position: sticky; min-height: 72px; padding: 12px 16px; align-items: center; gap: 12px; }
    .topbar-brand-copy strong { font-size: 27px; }
    .topbar-left, .topbar-actions { width: auto; gap: 8px; }
    .topbar-settings { display: none; }
    .topbar-brand-copy small { font-size: 9px; }
    .shell, html.sidebar-collapsed .shell { display: block; }
    .sidebar, html.sidebar-collapsed .sidebar { display: none; position: fixed; z-index: 40; top: var(--topbar-height); left: 0; bottom: 0; width: min(300px, calc(100vw - 32px)); height: calc(100dvh - var(--topbar-height)); padding: 12px 16px 24px; background: var(--bg); }
    html.sidebar-mobile-open .sidebar { display: block; }
    html.sidebar-mobile-open { overflow: hidden; }
    .sidebar-backdrop:not([hidden]) { display: block; position: fixed; z-index: 35; inset: var(--topbar-height) 0 0; width: 100%; border: 0; border-radius: 0; background: #35292359; cursor: pointer; }
    .sidebar-mobile-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 12px; margin-bottom: 10px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
    html.sidebar-collapsed .nav-label { display: inline; }
    html.sidebar-collapsed .nav-section-label { width: auto; height: auto; margin: 0 12px 6px; background: none; font-size: 10px; }
    .nav, html.sidebar-collapsed .nav { gap: 24px; }
    .nav a, html.sidebar-collapsed .nav a { min-height: 44px; padding: 10px 12px; justify-content: flex-start; }
    html.sidebar-collapsed .sidebar-logout { padding: 10px 12px; justify-content: flex-start; }
    .content { padding: 24px 20px; }
    .hero-card, .panel { padding: 22px; }
    .hero-card h2, .section-header h2 { font-size: 30px; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
    .login-body { padding: 28px; }
    .login-shell { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .login-header { padding: 20px 30px; }
    .login-hero, .login-shell .login-panel { padding: 30px; }
    .login-panel h1 { font-size: 30px; }
}
@media (max-width: 640px) {
    .topbar { padding: 10px 12px; gap: 8px; }
    .topbar-left, .topbar-actions { gap: 4px; }
    .topbar-brand-copy strong { font-size: 25px; }
    .topbar-search { flex-wrap: wrap; gap: 8px; padding-bottom: 2px; }
    .topbar-search-field { flex: 1 1 calc(100% - 90px); }
    .topbar-business-filter { order: 3; flex: 1 1 100%; min-width: 0; }
    .topbar-search-button { min-height: 44px; }
    .topbar-user-avatar { width: 30px; height: 30px; }
    .content { padding: 22px 14px; }
    .hero-card, .panel { padding: 20px 16px; }
    .hero-card { margin-bottom: 18px; gap: 18px; }
    .hero-card h2, .section-header h2 { font-size: 29px; overflow-wrap: anywhere; }
    .hero-actions { width: 100%; gap: 10px; align-items: stretch; }
    .stat-card { min-height: 118px; padding: 16px; }
    .stat-card strong { font-size: 30px; }
    .panel-header { flex-wrap: wrap; }
    .section-header { gap: 12px; }
    .repeatable-row-business { grid-template-columns: 1fr; }
    .network-toolbar, .network-toolbar-actions { flex-wrap: wrap; }
    .member-modal { width: calc(100vw - 24px); }
    .member-modal-shell { padding: 20px 16px; }
    .login-body { padding: 0; display: block; }
    .login-shell { grid-template-columns: 1fr; width: 100%; border: 0; border-radius: 0; }
    .login-header { order: 0; padding: 16px 24px; gap: 14px; }
    .login-hero { order: 2; padding: 32px 24px; border-top: 1px solid var(--line); }
    .login-brand { font-size: 31px; }
    .login-home-link { gap: 8px; font-size: 11px; }
    .login-introduction { margin-bottom: 24px; }
    .login-hero h2 { font-size: 35px; }
    .login-hero .eyebrow { margin-bottom: 14px; font-size: 9px; }
    .login-shell .login-panel { order: 1; padding: 32px 24px; border-left: 0; }
    .login-panel h1 { font-size: 30px; }
    .login-description { margin-bottom: 24px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
