:root {
  color-scheme: light;
  --navy: #002f43; --navy-deep: #012635; --navy-light: #184658;
  --teal: #007f76; --teal-bright: #32d4bd; --teal-soft: #e8f5f1;
  --gold: #bc9548; --bg: #f5f7f8; --surface: #fff; --text: #172d38;
  --muted: #617480; --line: #e5ebee; --red: #b03738; --red-soft: #fceeee;
  --radius: 14px; --shadow: 0 3px 14px rgb(15 47 64 / 3%);
  font: 100%/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-optical-sizing: auto;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a, select, summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button, a { cursor: pointer; }
button { color: inherit; }
button:disabled { opacity: .5; cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea, a { outline-offset: 4px; }
:focus-visible { outline: 3px solid var(--teal); }
input, select, textarea { width: 100%; border: 1px solid #cbd7dd; border-radius: 9px; background: var(--surface); padding: .7rem .8rem; min-height: 44px; color: var(--text); }
input:focus, textarea:focus, select:focus { border-color: var(--teal); }
textarea { resize: vertical; }
input[aria-invalid=true], select[aria-invalid=true] { border-color: var(--red); }
input[type=checkbox] { width: 22px; min-height: 22px; accent-color: var(--teal); }
label { display: block; font-size: 0.875rem; font-weight: 550; margin-bottom: .4rem; }
label span { color: var(--teal); }
svg { width: 20px; height: 20px; flex-shrink: 0; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.9rem,3vw,2.4rem); line-height: 1.15; font-weight: 650; letter-spacing: -.045em; }
h2 { font-size: 1.03rem; font-weight: 620; letter-spacing: -.02em; }
h3 { font-size: 0.95rem; font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
[hidden] { display: none !important; }
.skip-link { position: fixed; top: -100px; left: 1rem; z-index: 1000; padding: .75rem 1rem; background: var(--surface); border-radius: 8px; }
.skip-link:focus { top: .75rem; }
.button { border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-height: 44px; padding: .65rem 1.05rem; border-radius: 9px; font-size: 0.875rem; font-weight: 570; white-space: nowrap; transition: background-color 150ms, box-shadow 150ms, transform 100ms; }
.button:active, .icon-button:active { transform: scale(.97); }
.primary { background: var(--teal); color: white; box-shadow: 0 3px 6px rgb(0 127 118 / 9%); }
.primary:hover { background: #006b63; }
.secondary { background: var(--surface); border-color: #d6e0e5; color: #3b5360; }
.secondary:hover { background: #eff4f5; }
.danger { background: var(--red); color: white; }
.icon-button { border: 0; background: transparent; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; transition: background-color 150ms,transform 100ms; }
.icon-button:hover { background: rgb(102 136 150 / 12%); }
.text-button { background: none; border: 0; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; color: var(--teal); font-size: 0.82rem; font-weight: 600; min-height: 44px; padding: .4rem; }
.text-button:hover { text-decoration: underline; }
.text-button svg { width: 15px; height: 15px; }
.eyebrow { font-size: 0.75rem; font-weight: 650; letter-spacing: .15em; margin-bottom: .7rem; color: var(--teal); }
.brand { display: flex; align-items: center; gap: .7rem; }
.logo-mark { display: grid; place-items: center; width: 44px; height: 44px; background: rgb(59 192 180 / 12%); border: 1px solid rgb(83 214 202 / 20%); border-radius: 13px; color: var(--teal-bright); }
.logo-mark svg { width: 38px; height: 38px; }
.wordmark { color: white; font-size: 1.6rem; font-weight: 720; letter-spacing: -.065em; line-height: 1; }
.wordmark > span { color: var(--teal-bright); }
.wordmark small { display: block; margin-top: .4rem; font-size: 0.75rem; font-weight: 500; color: #a1b8c2; letter-spacing: .18em; }
.initial-loading { min-height: 100vh; display: grid; place-items: center; color: var(--muted); }
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: white; }
.login-story { background: var(--navy); color: white; padding: 3rem 4.5rem 2rem; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.login-story::after { content: ''; position: absolute; width: 38rem; height: 38rem; border: 1px solid rgb(255 255 255 / 6%); border-radius: 50%; right: -27rem; top: 8rem; box-shadow: 0 0 0 5rem rgb(255 255 255 / 2%),0 0 0 10rem rgb(255 255 255 / 2%); pointer-events: none; }
.login-copy { margin: auto 0; padding: 5rem 0; position: relative; z-index: 1; }
.login-copy .eyebrow { color: #81c7bf; }
.login-copy h1 { font-size: clamp(2.9rem,4.2vw,4.8rem); letter-spacing: -.055em; font-weight: 570; line-height: 1.1; }
.login-copy h1 em { color: #70dec9; font-style: normal; }
.login-copy > p:not(.eyebrow) { color: #c0d4dd; margin-top: 1.8rem; font-size: 1.03rem; line-height: 1.8; }
.login-line { height: 1px; background: #345463; max-width: 20rem; margin: 2rem 0 1rem; }
.login-copy > span { font-size: 0.8rem; color: #a4beca; }
.login-story > footer { font-size: 0.75rem; color: #b4c8d1; display: flex; justify-content: space-between; gap: 1rem; }
.login-story > footer span { color: #9bb5c1; }
.login-form { display: grid; place-items: center; padding: 3rem; }
.login-card { max-width: 370px; width: 100%; }
.mini-label { color: var(--teal); font-size: 0.75rem; letter-spacing: .13em; font-weight: 650; }
.login-card h2 { font-size: 1.9rem; letter-spacing: -.04em; margin-top: .75rem; font-weight: 620; }
.login-card > p { margin-top: .4rem; color: var(--muted); font-size: 0.93rem; }
.login-card form { margin-top: 2rem; }
.login-card input { background: #fafcfc; margin-bottom: 1.2rem; min-height: 48px; }
.login-card .button { width: 100%; min-height: 48px; justify-content: space-between; padding: .65rem 1rem; }
.login-card .login-footer { margin-top: 1.6rem; font-size: 0.78rem; line-height: 1.7; }
.form-error { color: var(--red); font-size: 0.82rem; margin: .75rem 0; }
.form-error:empty { margin: 0; }
.workspace { min-height: 100vh; }
.sidebar { width: 246px; background: var(--navy); color: #bfd0d8; position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 30; }
.sidebar > .brand { padding: 2rem 1.6rem 1.3rem; }
.workspace-tag { font-size: 0.75rem; color: #abc3cf; padding: .6rem .75rem; margin: .2rem 1.2rem 1rem; background: rgb(255 255 255 / 5%); border: 1px solid rgb(255 255 255 / 7%); border-radius: 7px; display: flex; align-items: center; gap: .55rem; }
.status-dot { width: 6px; height: 6px; background: var(--teal-bright); border-radius: 50%; }
.sidebar nav { overflow-y: auto; flex: 1; padding: 0 .75rem 1rem; }
.nav-label { font-size: 0.75rem; color: #9bb7c4; font-weight: 600; letter-spacing: .14em; margin: 1.25rem .85rem .5rem; }
.nav-link { display: flex; align-items: center; gap: .85rem; min-height: 44px; padding: .6rem .85rem; margin: .15rem 0; border-radius: 8px; font-size: 0.82rem; color: #c2d4dd; transition: background-color 150ms,color 150ms; }
.nav-link svg { width: 18px; height: 18px; opacity: .85; }
.nav-link:hover { background: rgb(255 255 255 / 5%); color: white; }
.nav-link.selected { background: #155267; color: #c5fff0; }
.nav-link.selected svg { color: #6ae2ca; opacity: 1; }
.sidebar-footer { border-top: 1px solid #294d5e; display: flex; align-items: center; padding: 1.1rem .75rem 1.1rem 1.15rem; gap: .6rem; }
.avatar { width: 33px; height: 33px; display: grid; place-items: center; border-radius: 50%; font-size: 0.75rem; background: #d7efe7; color: #256353; font-weight: 700; }
.sidebar-footer > div { flex: 1; min-width: 0; }
.sidebar-footer strong { display: block; font-size: 0.75rem; color: #eef5f7; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; font-weight: 550; }
.sidebar-footer small { display: block; font-size: 0.75rem; color: #abc4d0; }
.sidebar-footer .icon-button { color: #abc4d0; }
.content-shell { margin-left: 246px; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { position: sticky; top: 0; height: 72px; background: rgb(250 252 253 / 90%); backdrop-filter: blur(18px); display: flex; align-items: center; justify-content: space-between; padding: 0 2.2rem; z-index: 10; gap: 1rem; box-shadow: 0 1px 0 rgb(229 235 238 / 70%); }
.breadcrumbs, .topbar-right { display: flex; align-items: center; gap: .9rem; font-size: 0.75rem; }
.breadcrumbs > span { color: var(--muted); }
.breadcrumbs strong { font-weight: 530; }
.crumb-divider { color: #c1cdd3 !important; }
.topbar-right .text-button { color: #435e6c; border-left: 1px solid var(--line); padding-left: 1rem; }
.date-chip { font-size: 0.75rem; color: var(--muted); }
.menu-button { display: none; }
#main { padding: 2rem 2.2rem 3rem; width: 100%; max-width: 1600px; margin: 0 auto; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 1.3rem; margin: .2rem 0 1.8rem; }
.page-heading h1 { margin-bottom: .5rem; }
.heading-dot { color: var(--teal); }
.page-heading > div > p:not(.eyebrow) { font-size: 0.84rem; color: var(--muted); }
.heading-actions { display: flex; gap: .6rem; }
.metrics-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.metric { border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); padding: 1.15rem 1.2rem 1.25rem; box-shadow: var(--shadow); }
.metric-top { display: flex; justify-content: space-between; align-items: center; gap: .2rem; font-size: 0.75rem; color: #516874; font-weight: 530; }
.metric-icon { display: grid; place-items: center; color: #83959e; }
.metric-icon svg { width: 17px; height: 17px; }
.metric > strong { display: block; font-weight: 620; font-size: clamp(1.2rem,1.9vw,1.9rem); letter-spacing: -.045em; margin: 1rem 0 .4rem; font-variant-numeric: tabular-nums; }
.metric small { font-size: 0.75rem; color: var(--muted); }
.metric.featured { background: var(--navy); border-color: var(--navy); color: white; }
.metric.featured .metric-top { color: #c4d8e0; }
.metric.featured .metric-icon { color: #70ddc9; }
.metric.featured small { color: #b5cfda; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.85fr) minmax(260px,1fr); gap: 1.4rem; margin-bottom: 1.4rem; }
.dashboard-grid.lower { grid-template-columns: minmax(0,1.5fr) minmax(260px,1fr); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.3rem 1.4rem 1.1rem; }
.panel-heading p { color: var(--muted); font-size: 0.75rem; margin-top: .3rem; }
.panel-heading > svg { color: #829a9d; width: 20px; }
.subtle-label { font-size: 0.75rem; color: #57727f; background: #f2f6f7; padding: .4rem .6rem; border-radius: 6px; white-space: nowrap; }
.chart-legend { display: flex; justify-content: flex-end; gap: 1rem; padding: 0 1.5rem; color: var(--muted); font-size: 0.75rem; }
.chart-legend span { display: flex; align-items: center; gap: .35rem; }
.chart-legend i { width: 7px; height: 7px; border-radius: 2px; }
.legend-income { background: #138f83; }
.legend-expense { background: #b4ced0; }
.bar-chart { display: flex; justify-content: space-around; gap: 1rem; margin: 1rem 1.5rem .4rem; height: 184px; background: repeating-linear-gradient(to top,transparent 0,transparent 39px,#f0f3f5 39px,#f0f3f5 40px); }
.bar-group { display: flex; flex-direction: column; align-items: center; flex: 1; min-width: 0; }
.bar-group > span { font-size: 0.75rem; color: var(--muted); padding: .6rem 0; background: white; width: 100%; text-align: center; }
.bars { width: 100%; flex: 1; min-height: 0; display: flex; justify-content: center; align-items: flex-end; gap: 5px; }
.bar { width: 24%; min-width: 6px; max-width: 27px; border-radius: 4px 4px 0 0; min-height: 1px; }
.bar.income { background: #138f83; }
.bar.expense { background: #b4ced0; }
.chart-data { font-size: 0.75rem; color: var(--muted); padding: .6rem 1.5rem; }
.chart-data summary { min-height: 32px; }
.panel-bottom { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: 1rem 1.4rem; border-top: 1px solid var(--line); font-size: 0.75rem; color: var(--muted); }
.panel-bottom a { display: flex; align-items: center; gap: .4rem; color: var(--teal); font-weight: 600; min-height: 32px; }
.panel-bottom svg { width: 13px; height: 13px; }
.relationship-panel { background: #f0f6f4; border-color: #dfeae5; display: flex; flex-direction: column; }
.relationship-number { display: flex; align-items: baseline; gap: .65rem; padding: .2rem 1.4rem 1rem; }
.relationship-number strong { font-size: 3.5rem; letter-spacing: -.06em; font-weight: 550; line-height: 1.2; color: #245c4d; }
.relationship-number span { font-size: 0.76rem; color: #527267; }
.relationship-stats { padding: 0 1.4rem; }
.relationship-stats a { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 0; border-top: 1px solid #dce8e1; font-size: 0.75rem; color: #476659; }
.relationship-stats strong { display: flex; align-items: center; gap: .5rem; font-size: 0.83rem; color: #244f41; font-weight: 580; }
.relationship-stats svg { width: 13px; height: 13px; }
.relationship-note { padding: 1rem 1.4rem; font-size: 0.75rem; color: #5a7468; margin-top: auto; }
.activity-list { padding: 0 1.4rem .5rem; }
.activity-item { display: flex; align-items: center; gap: .8rem; padding: .9rem 0; border-top: 1px solid var(--line); }
.activity-icon { background: #f2f5f6; border: 1px solid var(--line); border-radius: 9px; width: 36px; height: 36px; display: grid; place-items: center; color: #5e7d89; }
.activity-icon svg { width: 17px; height: 17px; }
.activity-item > div { flex: 1; }
.activity-item strong { display: block; font-size: 0.76rem; font-weight: 550; }
.activity-item small { display: block; color: var(--muted); font-size: 0.75rem; margin-top: .2rem; }
.goals-list { padding: 0 1.4rem 1.2rem; }
.goal { padding: 1rem 0; border-top: 1px solid var(--line); }
.goal > strong { font-size: 0.8rem; font-weight: 560; }
.goal-values { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: 0.75rem; color: var(--muted); margin: .6rem 0; }
.goal-values b { color: var(--teal); }
progress { height: 7px; border: 0; width: 100%; border-radius: 8px; overflow: hidden; accent-color: var(--teal); }
progress::-webkit-progress-bar { background: #edf3f1; }
progress::-webkit-progress-value { background: var(--teal); }
.pipeline-summary { padding: .2rem 1.4rem 1.4rem; }
.pipeline-summary a { display: flex; align-items: center; gap: .7rem; padding: .8rem 0; border-top: 1px solid var(--line); font-size: 0.78rem; }
.pipeline-summary a span { flex: 1; }
.pipeline-summary small { color: var(--muted); width: 95px; text-align: right; }
.table-toolbar { padding: 1rem 1.2rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); }
.table-toolbar form { min-width: 0; width: 330px; }
.search-input { display: flex; align-items: center; border: 1px solid #d4dfe4; border-radius: 8px; padding-left: .7rem; }
.search-input > svg { width: 17px; height: 17px; color: #7d929d; }
.search-input input { background: transparent; border: 0; font-size: 0.78rem; padding: .5rem .6rem; }
.search-submit { border: 0; border-left: 1px solid var(--line); background: transparent; color: var(--teal); padding: .4rem .7rem; font-size: 0.75rem; min-height: 44px; }
.table-tools { display: flex; align-items: center; gap: .75rem; }
.table-tools select { width: auto; font-size: 0.76rem; padding: .55rem .7rem; }
.table-scroll, .table-wrap { position: relative; overflow-x: auto; max-width: 100%; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: 0.78rem; }
th { color: #6c7f8a; font-size: 0.75rem; letter-spacing: .025em; background: #f8fafb; font-weight: 550; padding: .85rem 1.15rem; white-space: nowrap; }
td { border-top: 1px solid #edf1f3; padding: .85rem 1.15rem; color: #4d6572; white-space: nowrap; }
tbody tr:hover { background: #fafcfc; }
.table-link, .table-primary { color: #284451; font-weight: 560; background: none; border: 0; padding: 0; text-align: left; font-size: 0.78rem; }
.table-link { min-height: 44px; }
.table-link:hover { color: var(--teal); }
.table-link small, .table-primary small { display: block; font-weight: 400; color: var(--muted); font-size: 0.75rem; margin-top: .2rem; }
.numeric { font-variant-numeric: tabular-nums; color: #2d4b57; font-weight: 550; }
.badge { display: inline-flex; align-items: center; padding: .25rem .55rem; border-radius: 6px; background: #eef2f5; font-size: 0.75rem; color: #536d7c; font-weight: 550; white-space: nowrap; }
.badge.positive { background: #e8f5ee; color: #287246; }
.badge.negative { background: #f9eeee; color: #a54b4d; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: .35rem; }
.row-button { border: 0; background: transparent; min-height: 44px; color: var(--teal); font-size: 0.75rem; padding: .4rem; }
.row-button:hover { text-decoration: underline; }
.pagination { border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1.2rem; color: var(--muted); font-size: 0.75rem; }
.pagination > div { display: flex; align-items: center; gap: .75rem; }
.pagination .button { padding: .4rem .8rem; font-size: 0.75rem; }
.view-toggle { display: flex; border: 1px solid var(--line); padding: 3px; border-radius: 8px; background: var(--bg); }
.view-toggle button { min-height: 38px; font-size: 0.75rem; border: 0; background: transparent; padding: .4rem .75rem; border-radius: 5px; color: var(--muted); }
.view-toggle button.on { background: white; color: var(--navy); box-shadow: 0 1px 4px rgb(0 0 0 / 6%); }
.kanban { position: relative; display: grid; grid-template-columns: repeat(5,minmax(210px,1fr)); overflow-x: auto; gap: 1rem; padding: 1.1rem; background: #f8fafb; }
.kanban-column { min-width: 0; }
.kanban-heading { display: flex; align-items: center; justify-content: space-between; padding: .3rem .1rem; }
.kanban-heading h2 { font-size: 0.8rem; }
.kanban-heading span { font-size: 0.75rem; background: #e7eef1; border-radius: 5px; padding: .1rem .4rem; }
.kanban-total { color: var(--muted); font-size: 0.75rem; margin: .35rem 0 1rem; }
.deal-card { border: 1px solid var(--line); border-radius: 10px; background: white; padding: .85rem; margin-bottom: .75rem; box-shadow: var(--shadow); }
.deal-card > button { display: block; white-space: normal; }
.deal-card > strong { display: block; font-size: 1.05rem; margin: .55rem 0; font-weight: 600; letter-spacing: -.03em; }
.deal-card > small { font-size: 0.75rem; color: var(--muted); }
.deal-card-footer { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding-top: .35rem; margin-top: .8rem; }
.deal-card-footer > span { font-size: 0.75rem; color: var(--muted); }
.deal-card-footer .text-button { font-size: 0.75rem; }
.kanban-empty { border: 1px dashed #d5e0e5; text-align: center; border-radius: 10px; padding: 2rem .6rem; font-size: 0.75rem; color: var(--muted); }
.empty-state { padding: 4rem 2rem; text-align: center; }
.empty-state h2 { font-size: 1.2rem; margin: 1rem 0 .5rem; }
.empty-state p { font-size: 0.86rem; color: var(--muted); max-width: 420px; margin: 0 auto 1rem; }
.empty-icon { display: inline-grid; place-items: center; width: 60px; height: 60px; border-radius: 18px; background: var(--teal-soft); color: var(--teal); }
.empty-icon svg { width: 26px; height: 26px; }
.compact-empty { min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); font-size: 0.8rem; padding: 1rem; text-align: center; }
.helper-note { font-size: 0.75rem; color: var(--muted); margin: 1rem 0 0; line-height: 1.6; }
.content-footer { padding: 0 2.2rem 1.2rem; font-size: 0.75rem; color: #597480; display: flex; align-items: center; gap: .6rem; margin-top: auto; }
.content-footer span { color: #6d818d; border-left: 1px solid #d7e1e6; padding-left: .6rem; }
.loading-state { min-height: 400px; display: flex; gap: .75rem; align-items: center; justify-content: center; color: var(--muted); font-size: 0.85rem; }
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid #cbdcd8; border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
dialog { border: 1px solid rgb(255 255 255 / 80%); border-radius: 20px; padding: 0; width: min(720px,calc(100vw - 2rem)); max-height: calc(100dvh - 3rem); background: var(--surface); color: var(--text); box-shadow: 0 24px 100px rgb(0 33 47 / 20%); }
dialog::backdrop { background: rgb(9 30 43 / 34%); backdrop-filter: blur(4px); }
.modal-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1.4rem 1.5rem 1rem; border-bottom: 1px solid var(--line); }
.modal-heading h2 { font-size: 1.3rem; letter-spacing: -.035em; }
.modal-heading p { font-size: 0.78rem; color: var(--muted); margin-top: .3rem; max-width: 540px; }
.modal-body { padding: 1.4rem 1.5rem; }
.modal-body > label:not(:first-child) { margin-top: 1rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.05rem 1rem; }
.field { min-width: 0; }
.field small { display: block; font-size: 0.75rem; color: var(--muted); margin-top: .3rem; }
.field .field-error { color: var(--red); }
.field-error:empty { display: none; }
.full-width { grid-column: 1 / -1; }
.checkbox-field { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.checkbox-field label { margin: 0; }
.checkbox-field small { flex-basis: 100%; }
.lookup-search { min-height: 35px; font-size: 0.75rem; margin-bottom: .3rem; padding: .4rem .6rem; background: #f8fafb; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: .6rem; padding: 1rem 1.5rem; background: #fafcfc; border-top: 1px solid var(--line); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 0; }
.detail-grid dt { font-size: 0.75rem; color: var(--muted); margin-bottom: .25rem; }
.detail-grid dd { margin: 0; font-size: 0.9rem; }
.note-content { white-space: pre-wrap; font-size: 0.83rem; margin-top: 1.5rem; color: #4d6572; }
.detail-section { margin-top: 1.7rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.detail-section h3 { margin-bottom: 1rem; }
.contact-item { padding: .75rem 0; display: flex; flex-direction: column; align-items: flex-start; font-size: 0.8rem; }
.contact-item span, .contact-item small { color: var(--muted); }
.muted { color: var(--muted); font-size: 0.82rem; }
#note-form .button { margin-top: .5rem; }
.notes-list article { border-top: 1px solid var(--line); padding: 1rem 0; }
.notes-list article > div { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.notes-list strong { font-size: 0.75rem; font-weight: 550; }
.notes-list small { font-size: 0.75rem; color: var(--muted); }
.notes-list p { font-size: 0.83rem; white-space: pre-wrap; margin-top: .5rem; }
@media (min-width: 1700px) { #main { padding-top: 2.7rem; } }
@media (max-width: 1200px) {
  .sidebar { width: 216px; } .content-shell { margin-left: 216px; }
  .sidebar > .brand { padding-left: 1.25rem; }
  .topbar { padding: 0 1.5rem; } #main { padding: 1.75rem 1.5rem 2.5rem; }
  .metrics-grid { gap: .7rem; } .metric { padding: 1rem; }
  .metric > strong { font-size: 1.45rem; }
  .dashboard-grid { gap: 1rem; grid-template-columns: minmax(0,1.5fr) minmax(240px,1fr); }
  .panel-heading { padding: 1.1rem; } .panel-heading .subtle-label { display: none; }
}
@media (max-width: 960px) {
  .metrics-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metric > strong { font-size: 1.8rem; }
  .dashboard-grid, .dashboard-grid.lower { grid-template-columns: 1fr; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .table-toolbar { flex-wrap: wrap; } .table-toolbar form { flex: 1; min-width: 200px; }
  .login-story { padding: 2.5rem; }
  .login-story > footer { flex-direction: column; gap: .2rem; }
  .date-chip { display: none; }
}
@media (max-width: 720px) {
  .sidebar { transform: translateX(-100%); width: 246px; box-shadow: 15px 0 50px rgb(0 25 40 / 15%); }
  .sidebar.open { transform: translateX(0); }
  .content-shell { margin-left: 0; }
  .menu-button { display: inline-flex; }
  .topbar { height: 64px; padding: 0 .75rem; gap: .5rem; }
  .breadcrumbs { gap: .5rem; } .breadcrumbs > span:first-of-type, .crumb-divider { display: none; }
  .topbar-right .text-button { border: 0; padding-left: .4rem; font-size: 0.75rem; }
  #main { padding: 1.4rem 1rem 2.5rem; } .content-footer { padding: 0 1rem 1rem; }
  .page-heading { margin-bottom: 1.4rem; gap: 1rem; }
  .page-heading h1 { font-size: 2rem; }
  .page-heading > div > p:not(.eyebrow) { font-size: 0.8rem; }
  .heading-actions { flex-wrap: wrap; }
  .metrics-grid { gap: .65rem; }
  .metric { padding: .9rem; } .metric > strong { font-size: 1.45rem; margin: .9rem 0 .35rem; }
  .metric-top { font-size: 0.75rem; } .metric small { font-size: 0.75rem; }
  .metric-icon { display: none; }
  .panel-heading { gap: .6rem; } .panel-heading h2 { font-size: 0.95rem; }
  .panel-bottom { padding: .8rem 1rem; } .panel-bottom > span { max-width: 60%; }
  .chart-legend { font-size: 0.75rem; padding: 0 1rem; gap: .75rem; }
  .bar-chart { margin: 1rem .75rem .4rem; }
  .bar-group > span { font-size: 0.75rem; }
  .table-toolbar { padding: .8rem; } .table-toolbar form { width: 100%; flex-basis: 100%; }
  .table-tools { flex-wrap: wrap; width: 100%; justify-content: space-between; }
  .pagination { flex-direction: column; align-items: flex-start; padding: .8rem; gap: .6rem; }
  .pagination > div { width: 100%; justify-content: space-between; }
  .login { display: flex; flex-direction: column; }
  .login-story { padding: 1.5rem; min-height: auto; }
  .login-copy { padding: 2rem 0; } .login-copy h1 { font-size: 2.9rem; }
  .login-copy h1 br { display: none; } .login-copy h1 br::after { content: ' '; }
  .login-copy h1 { max-width: 360px; } .login-copy > p:not(.eyebrow), .login-copy > span, .login-line, .login-story > footer { display: none; }
  .login-form { padding: 2rem 1.5rem 3rem; }
  .login-card { max-width: 420px; }
  dialog { width: calc(100vw - 1rem); max-height: calc(100dvh - 1.5rem); border-radius: 16px; }
  .modal-heading, .modal-body { padding: 1.1rem; }
  .modal-footer { padding: .85rem 1.1rem; flex-wrap: wrap; }
  .form-grid { grid-template-columns: 1fr; }
  .detail-grid { gap: .8rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .topbar { background: #fafcfd; backdrop-filter: none; } dialog::backdrop { backdrop-filter: none; background: rgb(9 30 43 / 55%); }
}
@media (prefers-contrast: more) {
  :root { --muted: #334e5b; --line: #9cafba; }
  .topbar { background: white; backdrop-filter: none; border-bottom: 1px solid #4a6574; }
  .nav-link, .sidebar-footer small, .nav-label { color: #e0ecf2; }
}

/* Team profiles, calendar and mobile workspace */
.brand-logo { width: 46px; height: 46px; display: block; border-radius: 12px; object-fit: contain; flex-shrink: 0; }
.login#main { padding: 0; max-width: none; margin: 0; min-height: 100dvh; }
.profile-avatar { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: #dfefe9; color: #245b4b; font-size: 1rem; font-weight: 650; overflow: hidden; flex-shrink: 0; }
.profile-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.profile-avatar.large { width: 112px; height: 112px; font-size: 2rem; }
.profile-avatar.sidebar-avatar { width: 34px; height: 34px; font-size: .75rem; }
.team-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.team-summary article { background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; }
.team-summary span { display: block; color: var(--muted); font-size: .8rem; }
.team-summary strong { font-size: 1.9rem; font-weight: 600; letter-spacing: -.04em; }
.team-cards { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1rem; padding: 1.2rem; }
.team-card { border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem; min-width: 0; }
.team-card-heading { display: flex; align-items: center; justify-content: space-between; gap: .7rem; margin-bottom: .9rem; }
.team-card h2 { overflow-wrap: anywhere; }
.team-job { font-size: .8rem; color: var(--muted); margin: .3rem 0 .65rem; min-height: 1.2rem; }
.team-contacts { display: flex; flex-direction: column; gap: .35rem; margin: 1rem 0; font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }
.team-contacts a { padding: .2rem 0; }
.team-contacts a:hover { color: var(--teal); text-decoration: underline; }
.team-card > .button { width: 100%; justify-content: space-between; }
.profile-layout { display: grid; grid-template-columns: 245px minmax(0,1fr); gap: 1.4rem; align-items: start; }
.profile-aside { position: sticky; top: 90px; min-width: 0; }
.profile-identity { padding: 1.5rem 1rem; display: flex; align-items: center; text-align: center; flex-direction: column; gap: .55rem; }
.profile-identity h2 { margin-top: .4rem; overflow-wrap: anywhere; }
.profile-identity > p { font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; max-width: 100%; }
.profile-identity small { color: var(--muted); font-size: .75rem; }
.photo-picker { margin: .6rem 0 0; position: relative; cursor: pointer; font-size: .8rem; }
.photo-picker:focus-within { outline: 3px solid var(--teal); outline-offset: 3px; }
.profile-section-nav { display: flex; flex-direction: column; margin-top: 1rem; padding: .6rem; }
.profile-section-nav button { text-align: left; background: none; border: 0; border-radius: 7px; padding: .7rem; min-height: 44px; font-size: .8rem; color: #435e6c; }
.profile-section-nav button:hover { background: var(--teal-soft); color: var(--teal); }
.profile-meta { font-size: .75rem; color: var(--muted); margin-top: .8rem; }
.profile-sections { min-width: 0; display: flex; flex-direction: column; gap: 1.2rem; }
.profile-section { padding: 1.4rem; scroll-margin-top: 90px; }
.profile-section > header { margin-bottom: 1.3rem; }
.profile-section h2 { font-size: 1.1rem; }
.profile-section header p { font-size: .8rem; color: var(--muted); margin-top: .35rem; line-height: 1.7; }
.profile-section input:disabled { background: #f4f6f7; color: #5b6f7a; }
.profile-savebar { position: sticky; bottom: max(1rem,env(safe-area-inset-bottom)); z-index: 5; border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1.2rem; background: rgb(255 255 255 / 97%); box-shadow: 0 4px 28px rgb(0 35 50 / 9%); }
.profile-savebar > div { display: flex; justify-content: flex-end; gap: .6rem; }
.profile-savebar .form-error:not(:empty) { margin-top: 0; }
.calendar-toolbar { padding: 1rem 1.2rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); }
.calendar-navigation { display: flex; align-items: center; gap: .3rem; min-width: 0; }
.calendar-navigation h2 { font-size: 1.05rem; text-transform: capitalize; margin-left: .5rem; }
.calendar-navigation .icon-button { font-size: 1.8rem; font-weight: 400; }
.calendar-filters { display: flex; align-items: end; gap: 1rem; padding: .8rem 1.2rem; border-bottom: 1px solid var(--line); background: #fbfcfd; }
.calendar-filters > div { min-width: 160px; }
.calendar-filters label { font-size: .75rem; margin-bottom: .25rem; }
.calendar-filters select { font-size: .8rem; padding: .5rem .7rem; }
.calendar-filters > span { margin: 0 0 .6rem auto; font-size: .75rem; color: var(--muted); }
.calendar-notice { padding: .7rem 1.2rem; font-size: .8rem; background: #fff7df; color: #705a22; }
.month-weekdays { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); text-align: center; border-bottom: 1px solid var(--line); }
.month-weekdays span { padding: .7rem 0; font-size: .75rem; color: var(--muted); }
.month-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); }
.month-day { min-width: 0; min-height: 130px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: .35rem; }
.month-day:nth-child(7n) { border-right: 0; }
.month-day.other-month { background: #f8fafb; color: #788d99; }
.month-day.is-today { background: #f1faf6; }
.month-day-heading { display: flex; align-items: center; justify-content: space-between; gap: .15rem; }
.day-number { display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; min-height: 34px; min-width: 34px; padding: .2rem; font-size: .8rem; }
.is-today .day-number { background: var(--teal); color: white; }
.month-add { background: none; border: 0; min-width: 30px; min-height: 34px; color: #66818d; font-size: 1.2rem; }
.month-events { display: flex; flex-direction: column; gap: .25rem; }
.month-event { background: #e8f1fa; border: 0; border-radius: 5px; color: #244e7c; text-align: left; padding: .25rem .35rem; font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 27px; }
.month-event.call, .time-event.call { background: #e6f5ed; color: #206c4c; border-color: #359467; }
.month-event.meeting, .time-event.meeting { background: #efebfc; color: #5c3e8b; border-color: #7a59b5; }
.month-event.whatsapp, .time-event.whatsapp { background: #e4f5ee; color: #206c4c; border-color: #359467; }
.month-event.done, .time-event.done { opacity: .65; }
.month-event.cancelled, .time-event.cancelled { text-decoration: line-through; opacity: .5; }
.month-more { border: 0; background: none; text-align: left; color: var(--muted); min-height: 30px; padding: .2rem; font-size: .75rem; }
.calendar-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; padding: .9rem 1.2rem; font-size: .75rem; color: var(--muted); }
.calendar-legend > span:last-child { margin-left: auto; }
.event-legend { display: flex; align-items: center; gap: .4rem; }
.event-legend::before { content: ''; width: 8px; height: 8px; background: #397eaf; border-radius: 50%; }
.event-legend.meeting::before { background: #7a59b5; }
.event-legend.call::before { background: #359467; }
.calendar-time-scroll { max-height: min(72vh,850px); overflow: auto; overscroll-behavior: contain; }
.calendar-time-header, .calendar-time-body { display: grid; grid-template-columns: 64px repeat(7,minmax(110px,1fr)); min-width: 834px; }
.calendar-time-header { position: sticky; top: 0; background: white; z-index: 3; border-bottom: 1px solid var(--line); }
.calendar-time-scroll.single-day .calendar-time-header, .calendar-time-scroll.single-day .calendar-time-body { grid-template-columns: 64px minmax(0,1fr); min-width: 0; }
.time-zone { align-self: end; font-size: .75rem; color: var(--muted); padding: 0 .3rem .5rem; }
.time-day-header { background: none; border: 0; border-right: 1px solid var(--line); padding: .65rem .3rem; display: flex; flex-direction: column; align-items: center; gap: .2rem; }
.time-day-header > span { font-size: .75rem; text-transform: uppercase; color: var(--muted); }
.time-day-header > strong { display: grid; place-items: center; width: 38px; height: 38px; font-size: 1.4rem; font-weight: 500; border-radius: 50%; }
.time-day-header.is-today > strong { color: white; background: var(--teal); }
.time-axis { height: 1536px; }
.time-axis > span { display: block; height: 64px; text-align: right; padding: .2rem .6rem 0 0; font-size: .75rem; color: var(--muted); }
.time-day { height: 1536px; position: relative; min-width: 0; border-right: 1px solid var(--line); overflow: hidden; }
.time-slots { height: 100%; display: grid; grid-template-rows: repeat(24,64px); }
.time-slots button { background: none; border: 0; border-bottom: 1px solid var(--line); width: 100%; padding: 0; }
.time-slots button:enabled:hover { background: #f1f9f7; }
.time-slots button:disabled { opacity: 1; }
.time-event { position: absolute; background: #e8f1fa; color: #244e7c; border: 0; border-left: 3px solid #397eaf; border-radius: 5px; padding: .3rem .4rem; text-align: left; overflow: hidden; font-size: .75rem; min-height: 18px; z-index: 1; }
.time-event:hover { box-shadow: 0 2px 6px rgb(0 30 50 / 12%); z-index: 2; }
.time-event > strong, .time-event > span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.time-event > strong { font-weight: 600; }
.time-event > span { margin-top: .15rem; }
.kanban { align-items: start; grid-template-columns: repeat(5,minmax(250px,1fr)); scroll-snap-type: x proximity; }
.kanban-column { border-radius: 10px; padding: .4rem; transition: background-color 120ms; scroll-snap-align: start; }
.kanban-column.drop-active { background: #dfefe9; box-shadow: inset 0 0 0 2px var(--teal); }
.kanban-heading h2 { display: flex; align-items: center; gap: .4rem; }
.stage-dot { display: inline-block; width: 8px; height: 8px; background: #7395b6; border-radius: 50%; }
.stage-dot.proposal { background: #c59b4b; }.stage-dot.negotiation { background: #8d6dc2; }.stage-dot.won { background: #409a6c; }.stage-dot.lost { background: #bc6c6e; }
.deal-card-top { display: flex; align-items: center; justify-content: space-between; gap: .3rem; color: var(--muted); font-size: .75rem; }
.deal-card-top > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drag-handle { background: none; border: 0; color: #6a808d; min-width: 44px; min-height: 44px; cursor: grab; font-size: 1.5rem; touch-action: none; user-select: none; }
.drag-handle:active { cursor: grabbing; }
.deal-card.dragging { opacity: .35; }
.drag-ghost { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 100; box-shadow: 0 15px 45px rgb(0 35 50 / 20%); margin: 0; opacity: .96; }
.deal-related { color: var(--muted); font-size: .75rem; margin-top: .3rem; }
.kanban-move { width: 100%; padding: .5rem; font-size: .75rem; margin-top: .3rem; min-height: 44px; border-color: var(--line); }
.kanban-help { font-size: .75rem; color: var(--muted); padding: .8rem 1.2rem; border-top: 1px solid var(--line); }
.notify-region { position: fixed; top: max(1rem,env(safe-area-inset-top)); right: max(1rem,env(safe-area-inset-right)); width: min(390px,calc(100vw - 2rem)); display: flex; flex-direction: column; gap: .7rem; pointer-events: none; z-index: 150; }
.notification { display: flex; align-items: start; gap: .7rem; padding: .8rem .6rem .8rem .9rem; background: white; color: var(--text); border: 1px solid #d7e6df; border-left: 4px solid var(--teal); border-radius: 12px; box-shadow: 0 8px 35px rgb(0 30 50 / 15%); pointer-events: auto; }
.notification-icon { display: grid; place-items: center; width: 28px; height: 28px; background: var(--teal-soft); color: var(--teal); border-radius: 50%; flex-shrink: 0; }
.notification-icon svg { width: 16px; height: 16px; }
.notification-content { flex: 1; min-width: 0; }
.notification-content > strong { font-size: .85rem; }
.notification-content > p { font-size: .8rem; color: var(--muted); margin-top: .2rem; overflow-wrap: anywhere; }
.notification > .icon-button { min-width: 40px; min-height: 40px; margin-top: -.3rem; }
.notification-error { border-left-color: var(--red); }
.notification-error .notification-icon { color: var(--red); background: var(--red-soft); }
.notification-warning { border-left-color: #a27c21; }
.notification-info { border-left-color: #397eaf; }
.offline-banner { padding: .7rem 1.5rem; background: #fff6d9; color: #71561a; font-size: .8rem; }
.offline-page { max-width: 530px; min-height: 100dvh; padding: 2rem; margin: auto; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 1.2rem; text-align: center; }
.offline-page img { border-radius: 22px; }
.offline-page h1 { font-size: 2rem; }
.offline-page p { color: var(--muted); font-size: .95rem; }
.sidebar-scrim { display: none; }
.content-shell, #page-content { min-width: 0; }
@media (max-width: 1200px) {
  .team-cards { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .profile-layout { grid-template-columns: 200px minmax(0,1fr); gap: 1rem; }
  .calendar-toolbar { flex-wrap: wrap; }
}
@media (max-width: 960px) {
  .profile-layout { grid-template-columns: 1fr; }
  .profile-aside { position: static; }
  .profile-identity { display: grid; grid-template-columns: 100px minmax(0,1fr); text-align: left; column-gap: 1rem; padding: 1rem; }
  .profile-identity > #profile-photo-preview { grid-row: 1 / span 4; }
  .profile-identity .profile-avatar.large { width: 90px; height: 90px; }
  .profile-identity .badge { justify-self: start; }
  .profile-identity small { grid-column: 1 / -1; }
  .profile-section-nav { display: none; }
  .profile-section .form-grid { grid-template-columns: 1fr 1fr; }
  .calendar-filters { flex-wrap: wrap; align-items: start; }
  .calendar-filters > span { flex-basis: 100%; margin: 0; }
  .team-summary { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .7rem; }
}
@media (max-width: 720px) {
  body.nav-open { overflow: hidden; }
  .sidebar-scrim:not([hidden]) { display: block; position: fixed; inset: 0; background: rgb(0 25 40 / 35%); border: 0; z-index: 25; }
  .sidebar { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); overscroll-behavior: contain; }
  .topbar { height: calc(64px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); }
  #main { padding-bottom: calc(2.5rem + env(safe-area-inset-bottom)); }
  input, select, textarea, .field input, .field select, .field textarea { font-size: 16px; }
  .team-cards { grid-template-columns: 1fr; padding: .8rem; gap: .8rem; }
  .team-summary article { padding: .9rem; }
  .team-summary span { font-size: .75rem; }
  .profile-section { padding: 1rem; }
  .profile-section .form-grid { grid-template-columns: 1fr; }
  .profile-identity { grid-template-columns: 86px minmax(0,1fr); }
  .profile-identity .profile-avatar.large { width: 78px; height: 78px; }
  .profile-identity h2 { font-size: 1rem; }
  .profile-savebar { padding: .8rem; bottom: max(.5rem,env(safe-area-inset-bottom)); }
  .profile-savebar > div { justify-content: space-between; }
  .calendar-toolbar { padding: .8rem; gap: .8rem; }
  .calendar-navigation { flex-wrap: wrap; width: 100%; }
  .calendar-navigation h2 { font-size: .95rem; margin-left: .2rem; }
  .calendar-filters { gap: .7rem; padding: .8rem; }
  .calendar-filters > div { flex: 1; min-width: 120px; }
  .calendar-filters select { width: 100%; }
  .calendar-filters > span { font-size: .75rem; }
  .month-day { min-height: 110px; padding: .15rem; }
  .month-day-heading { justify-content: center; }
  .month-add { display: none; }
  .month-event { padding: .2rem; }
  .month-weekdays span { font-size: .75rem; }
  .calendar-legend { padding: .8rem; gap: .8rem; }
  .calendar-legend > span:last-child { flex-basis: 100%; margin-left: 0; }
  .calendar-time-scroll { max-height: 65dvh; }
  .kanban { grid-template-columns: repeat(5,280px); padding: .7rem; gap: .6rem; }
  .kanban-move { font-size: 16px; }
  .notification > .icon-button { min-width: 44px; min-height: 44px; }
  .notify-region { top: auto; bottom: max(1rem,env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-transparency: reduce) { .profile-savebar { background: white; } }
/* Settings, provider connections and statement review */
.settings-layout { display: grid; grid-template-columns: 210px minmax(0,1fr); gap: 24px; align-items: start; }
.settings-nav { display: grid; gap: 4px; position: sticky; top: 96px; }
.settings-nav a { display: flex; align-items: center; min-height: 44px; padding: 10px 14px; border-radius: 9px; font-size: .875rem; color: var(--muted); }
.settings-nav a:hover { background: var(--line); }
.settings-nav a[aria-current=page] { background: var(--teal-soft); color: var(--teal); font-weight: 600; }
.settings-body { min-width: 0; }
.settings-section { padding: 24px; margin-bottom: 24px; }
.settings-section > p, .settings-section form > p, .connection-card p { color: var(--muted); margin: 8px 0 20px; font-size: .9rem; }
.settings-section h2 { font-size: 1.12rem; }
.settings-section .panel-heading { padding: 0 0 16px; }
.settings-section .form-grid { margin: 20px 0; }
.settings-section .form-error { color: var(--red); }
.settings-actions, .connection-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.settings-actions .helper-note { margin: 0; }
.connection-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,240px),1fr)); gap: 18px; margin-bottom: 24px; }
.connection-card { display: flex; align-items: flex-start; flex-direction: column; gap: 14px; padding: 24px; }
.connection-card h2 { font-size: 1.12rem; }
.connection-card p { margin: 0; flex: 1; }
.connection-card .text-button { margin-top: 4px; }
.connection-state { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-bottom: 16px; }
.connection-state small { display: block; color: var(--muted); flex-basis: 100%; }
.connection-controls { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 24px; }
.settings-subform { border-top: 1px solid var(--line); padding-top: 24px; margin-top: 24px; }
.settings-subform .field { max-width: 440px; margin: 16px 0; }
.settings-subform p, .credential-removal p, .integration-contract p { color: var(--muted); font-size: .875rem; }
.credential-removal, .integration-contract { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.integration-contract pre { background: var(--bg); padding: 16px; overflow: auto; border-radius: 9px; font-size: .8rem; }
.connection-list { display: grid; }
.connection-list > a { display: flex; justify-content: space-between; gap: 12px; padding: 18px 0; border-top: 1px solid var(--line); }
.connection-list small { display: block; color: var(--muted); }
.connection-list > a > span { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: end; }
.setup-steps { color: var(--muted); padding-left: 24px; }
.setup-steps li { padding: 6px 0; }
.import-summary { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 14px; margin-bottom: 24px; }
.import-summary article { padding: 18px; }
.import-summary span { color: var(--muted); font-size: .8rem; display: block; }
.import-summary strong { display: block; font-size: 1.3rem; margin-top: 8px; font-variant-numeric: tabular-nums; }
.discrepancy-note { padding: 20px; margin-bottom: 24px; border-color: var(--gold); }
.import-reason { display: block; white-space: normal; min-width: 180px; max-width: 320px; color: var(--muted); margin-top: 8px; }
.table-secondary { display: block; color: var(--muted); }
.import-row-actions { display: grid; gap: 8px; }
.raw-record { display: grid; grid-template-columns: max-content 1fr; gap: 8px; max-width: 400px; white-space: normal; }
.raw-record dt { color: var(--muted); }
.raw-record dd { margin: 0; overflow-wrap: anywhere; }
.inline-check { display: flex; gap: 10px; align-items: center; margin: 18px 0; }
.inline-check input { width: 22px; min-height: 22px; flex-shrink: 0; }
.settings-section fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.mail-item { padding: 18px 0; border-bottom: 1px solid var(--line); }
.mail-item summary { display: grid; gap: 6px; cursor: pointer; }
.mail-item summary small { color: var(--muted); }
.mail-item .badge { justify-self: start; }
.mail-text { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: .875rem; background: var(--bg); border-radius: 9px; padding: 16px; max-height: 450px; overflow: auto; }
@media (max-width: 1000px) {
  .settings-layout { grid-template-columns: 1fr; gap: 16px; }
  .settings-nav { position: static; display: flex; overflow: auto; padding-bottom: 8px; }
  .settings-nav a { flex-shrink: 0; }
  .import-summary { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 600px) {
  .settings-section, .connection-card { padding: 18px; }
  .settings-actions, .connection-controls { align-items: stretch; flex-direction: column; }
  .settings-actions .button, .connection-controls .button { width: 100%; white-space: normal; }
  .connection-list > a { flex-direction: column; }
  .connection-list > a > span { justify-content: start; }
  .import-summary { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .import-summary article { padding: 14px; }
  .import-summary strong { font-size: 1.1rem; overflow-wrap: anywhere; }
  .settings-section input, .settings-section select { font-size: 16px; }
}
