:root {
    --anthracite: #22262A;
    --sage: #6E7F73;
    --light-gray: #E7E8E4;
    --off-white: #F6F5F2;
    --soft-gold: #D8C8A3;
    --white: #FFFFFF;
    --border: rgba(34, 38, 42, 0.10);
    --border-soft: rgba(34, 38, 42, 0.06);
    --text-soft: rgba(34, 38, 42, 0.68);
    --text-muted: rgba(34, 38, 42, 0.54);
    --shadow: 0 18px 44px rgba(34, 38, 42, 0.06);
    --shadow-soft: 0 10px 24px rgba(34, 38, 42, 0.04);
    --radius-xl: 26px;
    --radius-lg: 20px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --sidebar-width: 286px;
    --serif: Georgia, "Times New Roman", serif;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    min-width: 320px;
    font-family: var(--sans);
    color: var(--anthracite);
    background:
        radial-gradient(circle at top left, rgba(216, 200, 163, 0.14), transparent 24%),
        linear-gradient(180deg, #FBFAF7 0%, var(--off-white) 100%);
}

img {
    display: block;
    max-width: 100%;
}

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

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

button {
    appearance: none;
}

.app-shell {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
}

.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    padding: 34px 22px 24px;
    background: rgba(255, 255, 255, 0.72);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 28px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    display: inline-flex;
    align-items: center;
    width: fit-content;
}

.brand-logo {
    display: block;
    width: auto;
    height: 42px;
    max-width: 198px;
    max-height: 42px;
    opacity: 0.96;
    transition: opacity 0.18s ease;
}

.brand:hover .brand-logo {
    opacity: 1;
}

.nav {
    display: grid;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 48px;
    padding: 12px 15px;
    border-radius: 15px;
    color: rgba(34, 38, 42, 0.82);
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.nav-link:hover {
    background: rgba(110, 127, 115, 0.08);
    transform: translateX(2px);
}

.nav-link.is-active {
    background: rgba(110, 127, 115, 0.12);
    color: var(--anthracite);
    font-weight: 600;
}

.nav-link.is-placeholder {
    color: rgba(34, 38, 42, 0.56);
}

.nav-link small {
    color: rgba(34, 38, 42, 0.44);
    font-size: 0.76rem;
}

.sidebar-note {
    margin-top: auto;
    padding: 18px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(216, 200, 163, 0.34);
    background: linear-gradient(180deg, rgba(216, 200, 163, 0.14), rgba(255, 255, 255, 0.92));
}

.sidebar-note p {
    margin: 0;
}

.content-shell {
    flex: 1;
    min-width: 0;
    padding: 34px;
}

.topbar {
    margin-bottom: 24px;
}

.page-content {
    display: grid;
    gap: 24px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--sage);
    font-size: 0.77rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

h1,
h2,
h3 {
    margin: 0;
    color: var(--anthracite);
    font-family: var(--serif);
    font-weight: 400;
    line-height: 1.15;
}

h1 {
    font-size: clamp(2rem, 3.2vw, 2.7rem);
}

h2 {
    font-size: 1.48rem;
}

h3 {
    font-size: 1.16rem;
}

p {
    margin: 0 0 14px;
    line-height: 1.6;
}

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

.card,
.panel {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
}

.panel {
    padding: 24px;
}

.hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding: 30px;
}

.hero p:last-child {
    margin-bottom: 0;
    color: var(--text-soft);
}

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

.button,
.button-secondary,
.button-link,
button.button,
button.button-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    padding: 11px 18px;
    cursor: pointer;
    transition: transform 0.18s ease, opacity 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.button,
button.button {
    background: var(--anthracite);
    color: var(--white);
    box-shadow: 0 12px 24px rgba(34, 38, 42, 0.14);
}

.button-secondary,
button.button-secondary {
    background: rgba(110, 127, 115, 0.10);
    color: var(--anthracite);
}

.button-link {
    padding: 0;
    background: transparent;
    color: var(--sage);
    border-radius: 0;
}

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

.stats-grid,
.dashboard-grid,
.list-grid,
.form-grid {
    display: grid;
    gap: 18px;
}

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

.dashboard-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 1fr);
}

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

.stat-card {
    padding: 22px;
}

.value {
    display: block;
    margin-top: 14px;
    font-family: var(--serif);
    font-size: 2rem;
    line-height: 1;
}

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

.mini-list {
    display: grid;
    gap: 0;
}

.mini-item,
.opportunity-item {
    padding: 16px 0;
    border-top: 1px solid rgba(34, 38, 42, 0.08);
}

.mini-item:first-child,
.opportunity-item:first-child {
    padding-top: 8px;
    border-top: 0;
}

.inline-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 0.94rem;
}

.notice,
.flash {
    padding: 16px 18px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(216, 200, 163, 0.42);
    background: rgba(216, 200, 163, 0.16);
}

.flash {
    margin-bottom: 20px;
}

.flash-success {
    border-color: rgba(110, 127, 115, 0.26);
    background: rgba(110, 127, 115, 0.11);
}

.flash-error {
    border-color: rgba(154, 99, 99, 0.24);
    background: rgba(154, 99, 99, 0.09);
}

.filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 20px;
}

.field-group {
    display: grid;
    gap: 8px;
    min-width: 180px;
}

.field-group.full {
    grid-column: 1 / -1;
}

.field-group label {
    color: rgba(34, 38, 42, 0.76);
    font-size: 0.94rem;
}

input[type="text"],
input[type="number"],
textarea,
select {
    width: 100%;
    border: 1px solid rgba(34, 38, 42, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    padding: 12px 14px;
    color: var(--anthracite);
    outline: none;
}

input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    border-color: rgba(110, 127, 115, 0.44);
    box-shadow: 0 0 0 3px rgba(110, 127, 115, 0.10);
}

textarea {
    min-height: 124px;
    resize: vertical;
}

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

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

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

th,
td {
    padding: 14px 12px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid rgba(34, 38, 42, 0.08);
}

th {
    color: rgba(34, 38, 42, 0.56);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

tr:last-child td {
    border-bottom: 0;
}

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

.empty-state {
    padding: 28px 10px 10px;
    color: var(--text-soft);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 11px;
    border-radius: 999px;
    background: rgba(110, 127, 115, 0.09);
    color: var(--anthracite);
    font-size: 0.82rem;
    white-space: nowrap;
}

.badge::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--sage);
    flex: 0 0 auto;
}

.badge-soft-green {
    background: rgba(110, 127, 115, 0.12);
}

.badge-soft-gold {
    background: rgba(216, 200, 163, 0.24);
}

.badge-soft-gray {
    background: rgba(34, 38, 42, 0.08);
}

.score-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(34, 38, 42, 0.05);
}

.connection-map {
    position: relative;
    overflow: hidden;
    min-height: 290px;
    display: grid;
    place-items: center;
    border-radius: 22px;
    background:
        radial-gradient(circle at center, rgba(110, 127, 115, 0.08), transparent 44%),
        rgba(255, 255, 255, 0.62);
}

.map-line {
    position: absolute;
    height: 1px;
    background: rgba(110, 127, 115, 0.22);
    transform-origin: left center;
}

.map-node {
    position: absolute;
    display: grid;
    place-items: center;
    min-width: 112px;
    min-height: 112px;
    padding: 14px;
    border-radius: 50%;
    border: 1px solid rgba(110, 127, 115, 0.20);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-soft);
    text-align: center;
    font-family: var(--serif);
}

.map-node.main {
    min-width: 138px;
    min-height: 138px;
    background: rgba(110, 127, 115, 0.12);
}

.map-node.dot-gold::after {
    content: "";
    position: absolute;
    top: 14px;
    right: 14px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--soft-gold);
}

.helper-text {
    color: var(--text-muted);
    font-size: 0.92rem;
}

.footer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-top: 10px;
}

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

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

@media (max-width: 920px) {
    .app-shell {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-width: 0;
        height: auto;
        position: static;
        padding-bottom: 18px;
    }

    .content-shell {
        padding: 22px;
    }

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

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