:root {
  --ink: #142d3d;
  --muted: #486475;
  --line: #d7e4ec;
  --surface: #f4f8fb;
  --white: #fff;
  --brand: #0f4d6d;
  --brand-dark: #143f5b;
  --brand-sky: #a8d8e8;
  --brand-soft: #e0f4fb;
  --brand-wash: #f2fbff;
  --night: #0b2f43;
  --night-text: #c5deea;
  --control-line: #b4c8d4;
  --success: #196040;
  --success-soft: #e6f4ec;
  --focus: #267da4;
  --orange: #8a4725;
  --orange-soft: #fff0e3;
  --red: #a4262c;
  --red-soft: #fcebed;
  --radius: 13px;
  color-scheme: light;
  font: 15px/1.55 Inter, 'Segoe UI', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--surface); color: var(--ink); }
[hidden] { display: none !important; }
a { color: var(--brand); text-underline-offset: .19em; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline-offset: 1px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.18; }
h1 { margin-bottom: 9px; font-size: clamp(2rem, 4vw, 2.8rem); letter-spacing: -.045em; }
h2 { margin-bottom: 12px; font-size: 1.25rem; letter-spacing: -.027em; }
h3 { margin-bottom: 7px; font-size: 1rem; letter-spacing: -.012em; }
p { margin-bottom: 10px; }
.muted { color: var(--muted); }
.mono { font: .83rem/1.4 'IBM Plex Mono', Consolas, monospace; }
.small { font-size: .85rem; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; }
.skip { position: fixed; top: 10px; left: 10px; z-index: 20; transform: translateY(-160%); padding: 10px 15px; border-radius: 5px; background: var(--white); }
.skip:focus { transform: none; }
.workspace { display: grid; min-height: 100vh; grid-template-columns: 216px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: linear-gradient(168deg, var(--night), var(--brand-dark)); color: var(--white); padding: 26px 17px 20px; overflow-y: auto; }
.brand { display: inline-flex; align-items: center; width: fit-content; max-width: 100%; margin: 0 0 34px 5px; text-decoration: none; }
.sidebar .brand { max-width: calc(100% - 5px); background: var(--white); padding: 3px 5px; border-radius: 9px; box-shadow: 0 3px 12px #071f2e38; }
.brand-logo { display: block; width: 154px; max-width: 100%; height: auto; flex: none; }
.brand-dark { margin: 0 0 25px; }
.brand-dark .brand-logo { width: 188px; }
.navigation { display: grid; gap: 4px; }
.navigation a { display: flex; align-items: center; gap: 11px; min-height: 43px; padding: 10px 12px; border-radius: 8px; color: var(--night-text); text-decoration: none; font-size: .93rem; }
.navigation a:hover { background: #ffffff16; color: var(--white); }
.navigation a[aria-current="page"] { color: var(--brand-dark); font-weight: 700; background: var(--brand-soft); }
.sidebar :focus-visible { outline-color: var(--brand-sky); }
.icon { display: inline-block; width: 15px; height: 15px; position: relative; flex: none; border: 1.5px solid currentColor; border-radius: 4px; }
.i-overview::after { content: ''; position: absolute; inset: 3px; border-top: 1.5px solid currentColor; border-left: 1.5px solid currentColor; transform: translate(2px, 2px); }
.i-today::after { content: ''; position: absolute; inset: 4px 2px auto; border-top: 1.5px solid currentColor; }
.i-accounts { border-radius: 3px; }
.i-accounts::after { content: ''; position: absolute; inset: 3px 3px; border: 1.5px solid currentColor; border-top: 0; border-bottom: 0; }
.i-tracker::after { content: ''; position: absolute; inset: 3px 2px; border-block: 1.5px solid currentColor; }
.i-plan::after { content: ''; position: absolute; inset: 2px 3px 4px 4px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(42deg); }
.i-inbox::after { content: ''; position: absolute; inset: 1px 2px auto; height: 6px; border-bottom: 1.5px solid currentColor; border-radius: 50%; }
.i-email { height: 12px; border-radius: 3px; }
.i-email::after { content: ''; position: absolute; left: 3px; top: 0; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; rotate: 45deg; }
.i-materials { border-radius: 2px; width: 12px; margin-inline: 1.5px; }
.i-materials::after { content: ''; position: absolute; inset: 4px 2px auto; height: 4px; border-block: 1px solid currentColor; }
.i-settings { border-radius: 50%; }
.i-settings::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; border: 1px solid currentColor; }
.sidebar-footer { margin-top: auto; display: grid; gap: 10px; border-top: 1px solid #a8d8e84a; padding: 17px 9px 0; font-size: .82rem; color: var(--night-text); }
.session-label { display: flex; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.session-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-sky); flex: none; }
.plain-button { padding: 0; border: 0; text-align: left; color: inherit; background: transparent; }
.plain-button:hover { text-decoration: underline; }
.surface { min-width: 0; }
.topbar { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 11px clamp(17px, 4vw, 56px); border-bottom: 1px solid var(--line); background: var(--white); }
.topbar p { margin: 0; font-weight: 650; }
.topbar span { font-size: .86rem; }
.menu-toggle { display: none !important; }
#main { width: min(100%, 1330px); margin-inline: auto; padding: clamp(24px, 4vw, 55px); padding-bottom: 80px; }
#main:focus { outline: none; }
.heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 24px; }
.heading p { color: var(--muted); max-width: 60ch; margin: 0; }
.heading-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.back-link { display: inline-block; margin: 0 0 17px; font-size: .88rem; }
.section { margin-top: 26px; }
.section-head { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; }
.section-head h2 { margin: 0; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 6px; min-height: 37px; padding: 7px 13px; border: 1px solid var(--control-line); border-radius: 8px; background: var(--white); color: var(--ink); font-size: .9rem; font-weight: 650; white-space: nowrap; text-decoration: none; }
.button:hover { background: var(--brand-wash); border-color: #8fb1c4; }
.button.primary { color: var(--white); background: var(--brand); border-color: var(--brand); }
.button.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.button.danger { color: var(--red); }
.button.icon-button { padding: 0 9px; min-height: 32px; font-size: 1.25rem; line-height: 1; }
.button.link-button { border-color: transparent; background: transparent; color: var(--brand); }
.button.link-button:hover { text-decoration: underline; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.card, .panel, .metric, .table-wrap { border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.card, .panel { padding: 19px; min-width: 0; }
.card p:last-child, .panel p:last-child { margin-bottom: 0; }
.card-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 245px), 1fr)); }
.settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.metric { padding: 16px 17px; }
.metric p { margin: 0; }
.metric strong { display: block; font-size: 1.97rem; line-height: 1.25; letter-spacing: -.05em; }
.metric-label { font-size: .9rem; color: var(--muted); }

.overview-hero {
  margin-bottom: 18px;
  padding: clamp(19px, 3.2vw, 30px);
  border: 1px solid #c5e3ef;
  border-radius: var(--radius);
  background: linear-gradient(115deg, var(--brand-soft), var(--brand-wash) 65%, var(--white));
}
.overview-hero .heading { margin: 0; }
.overview-hero h1 { color: var(--brand-dark); }
.overview-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.overview-metric {
  display: grid;
  align-content: start;
  gap: 3px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
  border-top: 3px solid var(--brand-sky);
}
.overview-metric:hover, .overview-metric:focus-visible { border-color: #8fb1c4; background: var(--brand-wash); }
.overview-metric strong { color: var(--brand-dark); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.overview-metric .metric-label { font-weight: 650; }
.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-top: 18px;
}
.overview-column { display: grid; gap: 16px; align-content: start; min-width: 0; }
.overview-panel .section-head { gap: 7px 14px; margin-bottom: 8px; }
.overview-panel .section-head > a { font-weight: 600; }
.overview-placeholder { margin: 13px 0 0; padding: 12px; border-radius: 7px; background: var(--surface); }
.overview-subhead { margin: 18px 0 0; font-size: .93rem; }
.overview-row-list, .overview-pipeline { list-style: none; margin: 0; padding: 0; }
.overview-row-list > li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  gap: 7px 14px;
  align-items: start;
  padding-block: 10px;
}
.overview-row-list > li + li { border-top: 1px solid var(--line); }
.overview-row-list > li:last-child { padding-bottom: 0; }
.overview-row-main, .overview-row-aside { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.overview-row-main > a { font-size: .85rem; }
.overview-row-aside { justify-items: end; text-align: right; }
.overview-row-aside time { font-variant-numeric: tabular-nums; }
.overview-pipeline { display: grid; gap: 8px; padding-top: 3px; }
.overview-pipeline li > div { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; font-size: .87rem; }
.overview-pipeline strong { font-variant-numeric: tabular-nums; }
.overview-pipeline progress { display: block; width: 100%; height: 6px; margin-top: 3px; appearance: none; border: 0; border-radius: 999px; background: #e7f0f5; accent-color: var(--brand); }
.overview-pipeline progress::-webkit-progress-bar { border-radius: inherit; background: #e7f0f5; }
.overview-pipeline progress::-webkit-progress-value { border-radius: inherit; background: var(--brand); }
.overview-pipeline progress::-moz-progress-bar { border-radius: inherit; background: var(--brand); }

.badge { display: inline-block; max-width: 100%; padding: 2px 8px; border-radius: 50px; font-size: .78rem; font-weight: 650; line-height: 1.5; background: #eaf1f6; color: var(--brand-dark); overflow-wrap: anywhere; }
.badge.good { color: var(--success); background: var(--success-soft); }
.badge.warn { color: var(--orange); background: var(--orange-soft); }
.badge.bad { color: var(--red); background: var(--red-soft); }
.meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 9px; margin: 0 0 8px; }
.empty { padding: 29px 20px; border: 1px dashed var(--control-line); border-radius: var(--radius); color: var(--muted); background: #f7fbfe; }
.empty h3 { color: var(--ink); }
.empty p:last-child { margin: 0; }
.callout { padding: 13px 15px; border: 1px solid #c8ecf8; border-radius: 8px; color: var(--brand-dark); background: var(--brand-soft); }
.callout.danger { background: var(--red-soft); color: var(--red); border-color: #eed0d2; }
.callout.warning { background: var(--orange-soft); color: var(--orange); border-color: #f2dcca; }
.callout p { margin: 0; }
.table-wrap { overflow: auto; }
table { width: 100%; border-spacing: 0; text-align: left; font-size: .91rem; }
th, td { padding: 12px 15px; vertical-align: top; overflow-wrap: anywhere; }
th { font-size: .81rem; color: var(--muted); background: #f7fbfe; font-weight: 700; }
tbody tr + tr td { border-top: 1px solid var(--line); }
td strong { display: block; }
.table-action { white-space: nowrap; }
.filters { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; margin-bottom: 13px; }
.filters > label:first-child { min-width: min(260px,100%); }
.tracker-filters { align-items: end; }
.tracker-filters p { margin: 0 0 3px auto; }
.tracker-list, .tracker-actions { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.tracker-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .7fr) minmax(0, 1.3fr); gap: 14px 18px; }
.tracker-person, .tracker-state { display: grid; align-content: start; justify-items: start; gap: 5px; }
.tracker-person h2 { font-size: 1rem; margin: 0; }
.tracker-person div span { display: block; }
.tracker-row > div { min-width: 0; overflow-wrap: anywhere; }
.tracker-next p { margin: 0 0 8px; }
.tracker-actions { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 12px; }
.tracker-actions li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .7fr) minmax(0, 1.3fr); gap: 6px 18px; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .tracker-row, .tracker-actions li { grid-template-columns: 1fr; }
  .tracker-actions li + li { border-top: 1px solid var(--line); padding-top: 10px; }
  .tracker-filters p { margin-left: 0; }
}
.timeline { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.timeline li { position: relative; padding: 13px 0 13px 21px; border-left: 2px solid var(--line); margin-left: 5px; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 20px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--white); background: var(--focus); }
.timeline li:last-child { padding-bottom: 0; }
.timeline p { margin-bottom: 5px; }
.timeline blockquote { margin: 8px 0; color: var(--brand-dark); }
.contact-list { display: grid; gap: 12px; }
.contact { border-top: 1px solid var(--line); padding-top: 12px; }
.contact:first-child { border-top: 0; padding-top: 0; }
.contact h3, .contact p { margin-bottom: 5px; }
.inbox-layout { display: grid; grid-template-columns: minmax(190px, .7fr) minmax(0, 1.4fr); gap: 15px; align-items: start; }
.thread-list, .thread-messages { list-style: none; margin: 0; padding: 0; }
.thread-list li + li { border-top: 1px solid var(--line); }
.thread-link { width: 100%; display: grid; grid-template-columns: minmax(0,1fr) auto; column-gap: 8px; padding: 11px 13px; color: var(--ink); background: transparent; border: 0; border-radius: 6px; text-align: left; overflow-wrap: anywhere; }
.thread-link:hover, .thread-link[aria-current="true"] { background: var(--brand-soft); }
.thread-link .thread-preview { grid-column: 1 / -1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-messages { display: grid; gap: 11px; margin: 12px 0 14px; }
.thread-message { max-width: min(100%, 62ch); width: fit-content; justify-self: start; padding: 10px 13px; background: #edf3f7; border-radius: 10px; overflow-wrap: anywhere; }
.thread-message.outbound { background: var(--brand-soft); justify-self: end; }
.thread-message p { margin: 0 0 5px; }
.thread-message p:last-child { margin-bottom: 0; }
.email-address, .email-detail { overflow-wrap: anywhere; }
.email-message-body { margin: 16px 0; padding: 14px 0; border-block: 1px solid var(--line); }
.email-thread summary { cursor: pointer; margin-block: 8px; }
.message-preview { margin: 0; padding: 11px 13px; background: #f7fbfe; border: 1px solid var(--line); border-radius: 7px; }
.message-preview p { margin-bottom: 6px; }
.message-preview p:last-child { margin-bottom: 0; }
.description { white-space: pre-wrap; overflow-wrap: anywhere; }
.details-list { display: grid; gap: 11px; margin: 0; }
.details-list > div { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.details-list > div:last-child { border-bottom: 0; padding-bottom: 0; }
.details-list dt { font-size: .82rem; color: var(--muted); }
.details-list dd { margin: 2px 0 0; }
.attachments { display: grid; gap: 5px; padding: 8px 12px 12px; border: 1px solid var(--line); border-radius: 6px; margin: 0; }
.attachments legend { font-size: .86rem; font-weight: 650; padding: 0 4px; }
.form-stack { display: grid; gap: 15px; }
.provider-details { border: 1px solid var(--line); border-radius: 6px; padding: 9px 12px; }
.provider-details > summary { cursor: pointer; font-size: .88rem; font-weight: 650; }
.provider-details[open] > summary { margin-bottom: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
label { display: grid; align-content: start; gap: 5px; min-width: 0; font-size: .86rem; font-weight: 650; }
input, select, textarea { width: 100%; min-height: 39px; padding: 7px 10px; border: 1px solid var(--control-line); border-radius: 6px; color: var(--ink); background: var(--white); font-weight: 400; }
input[type="checkbox"] { width: 17px; min-height: 17px; margin: 0; accent-color: var(--brand); }
.check { display: flex; gap: 8px; align-items: center; }
textarea { min-height: 91px; resize: vertical; }
textarea.tall { min-height: 146px; }
.field-hint { font-weight: 400; color: var(--muted); font-size: .82rem; }
.full { grid-column: 1 / -1; }
.form-error { margin: 0; color: var(--red); font-size: .88rem; }
.form-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 1px; }
.split { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.notice { position: fixed; z-index: 30; bottom: 20px; right: 20px; max-width: min(420px, calc(100vw - 40px)); padding: 11px 16px; color: var(--white); background: var(--night); border-radius: 8px; box-shadow: 0 5px 20px #0b2f433d; }
.notice.error { background: var(--red); }
dialog { max-width: min(660px, calc(100vw - 28px)); width: 100%; max-height: calc(100vh - 34px); padding: 23px; border: 1px solid var(--control-line); border-radius: 13px; color: var(--ink); background: var(--white); box-shadow: 0 20px 80px #071f2e43; }
dialog::backdrop { background: #0b2f43b0; }
.dialog-head { display: flex; justify-content: space-between; align-items: start; gap: 15px; margin-bottom: 17px; }
.dialog-head h2 { margin: 4px 0 0; }
.login-wrap { display: grid; place-items: center; padding: 20px; min-height: 100vh; background: radial-gradient(ellipse at 20% 5%, var(--brand-soft), transparent 55%), var(--surface); }
.login-card { width: min(100%, 435px); border: 1px solid var(--line); border-radius: 16px; padding: clamp(22px, 6vw, 34px); background: var(--white); box-shadow: 0 18px 50px #0b2f4318; }
.login-card h1 { font-size: 2rem; margin: 0 0 23px; }

@media (max-width: 900px) {
  .workspace { grid-template-columns: 175px minmax(0, 1fr); }
  .sidebar { padding-inline: 11px; }
  .detail-grid, .settings-grid, .inbox-layout { grid-template-columns: 1fr; }
  .overview-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-grid { grid-template-columns: 1fr; }
}

@media (max-width: 660px) {
  .workspace { display: block; }
  .sidebar { display: none; position: fixed; z-index: 10; top: 56px; left: 0; width: min(280px, 84vw); height: calc(100dvh - 56px); box-shadow: 0 20px 60px #0b2f4355; }
  .workspace.menu-open .sidebar { display: flex; }
  .menu-toggle { display: inline-flex !important; }
  .topbar { min-height: 56px; }
  #local-date { display: none; }
  .heading { display: block; }
  .heading-actions { margin-top: 12px; }
  .metrics { grid-template-columns: 1fr; }
  .metric { display: flex; align-items: center; justify-content: space-between; }
  .metric strong { font-size: 1.5rem; }
  .overview-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-metric { display: grid; justify-content: stretch; padding: 12px; }
  .overview-metric strong { font-size: 1.75rem; }
  .form-grid { grid-template-columns: 1fr; }
  .table-wrap table { min-width: 530px; }
  .card, .panel { padding: 15px; }
}

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