@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/rev-wordmark.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
  unicode-range: U+52, U+65, U+76;
}

:root {
  color-scheme: light;
  --surface: #fff;
  --sidebar: #f8f8fa;
  --raised: #f6f7f9;
  --hover: #eff0f3;
  --border: #e0e3e9;
  --text: #20242c;
  --secondary: #575e6b;
  --accent: #3658cf;
  --accent-hover: #2b48ad;
  --accent-soft: #edf1ff;
  --green: #1e6249;
  --green-soft: #e8f6ee;
  --amber: #775019;
  --amber-soft: #fff3dd;
  --error: #a42b31;
  --error-soft: #fcecef;
  --radius: 8px;
  font: 14px/1.5 Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--surface);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100dvh; }
h1, h2, p, dl, dd, ul { margin: 0; }
a { color: var(--accent-hover); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:is(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
::selection { background: var(--accent-soft); color: var(--accent-hover); }
input, select, textarea { caret-color: var(--accent-hover); }
p, dd { overflow-wrap: anywhere; }
button:disabled, select:disabled { opacity: .62; cursor: wait; }

.launcher { display: flex; flex-direction: column; background: var(--surface); }
.launcher-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  min-height: 56px;
  gap: 8px 20px;
  padding: 8px 20px;
  border-bottom: 1px solid var(--border);
}
.product-lockup { display: flex; align-items: center; gap: 13px; }
.product-lockup img { display: block; width: 81px; height: auto; }
.product-lockup strong {
  border-left: 1px solid var(--border);
  padding-left: 13px;
  font: 800 26px/1 "Bricolage Grotesque", system-ui, sans-serif;
}
.account-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.account-controls label { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.account-controls select { width: min(17rem, 100%); min-height: 34px; }
#status { color: var(--secondary); font-size: 12px; }
#status:empty { display: none; }
.launcher iframe { flex: 1; width: 100%; border: 0; background: var(--surface); }
.auth {
  display: grid;
  place-items: center;
  padding: clamp(16px, 5vw, 72px);
  background: #f4f3f0;
}
.auth-shell {
  width: min(100%, 480px);
  overflow: hidden;
  border: 1px solid #e3e0db;
  border-radius: 16px;
  background: var(--surface);
}
.auth-entry { width: min(100%, 1056px); }
.auth-panel { display: grid; align-items: center; padding: clamp(28px, 5.6vw, 80px); }
.auth-content { width: 100%; max-width: 360px; margin-inline: auto; }
.auth .product-lockup { margin-bottom: 42px; }
.auth .product-lockup img { width: 100px; }
.auth .product-lockup strong { font-size: 34px; }
.auth h1 {
  margin-bottom: 10px;
  font-size: clamp(31px, 4vw, 46px);
  line-height: 1.08;
  font-weight: 650;
  letter-spacing: -.04em;
  text-wrap: balance;
}
.auth p { color: var(--secondary); font-size: 16px; }
.auth p + p { margin-top: 8px; }
.auth form { margin-top: 24px; }
.auth .auth-microsoft {
  width: 100%;
  min-height: 54px;
  gap: 11px;
  margin-top: 28px;
  padding: 10px 14px;
  background: #242630;
  border-color: #242630;
  color: white;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}
.auth .auth-microsoft:hover { background: #393b46; border-color: #393b46; }
.auth .auth-microsoft:active { background: #15171d; }
.auth-microsoft img { flex: none; }
.auth-visual { display: none; }
@media (min-width: 761px) {
  .auth-entry { display: grid; grid-template-columns: 1.04fr 1fr; min-height: 558px; }
  .auth-visual {
    display: block;
    background: #ded9d0 url("/rev-signin.jpg") center / cover no-repeat;
  }
}
@media (max-width: 760px) {
  .auth-entry { max-width: 480px; }
  .auth-entry .auth-panel { min-height: 380px; }
}

.workspace { display: grid; grid-template-columns: 192px minmax(0, 1fr); }
.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  padding: 14px 10px;
}
.sidebar nav { display: grid; gap: 3px; }
.sidebar a {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 6px 9px;
  border-radius: 7px;
  color: var(--secondary);
  font-weight: 550;
}
.sidebar a:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.sidebar a[aria-current="page"] { color: var(--accent-hover); background: var(--accent-soft); }
.nav-mark { width: 16px; height: 16px; flex: 0 0 16px; }
.nav-mark path, .nav-mark rect, .nav-mark circle {
  fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round;
}
.workspace main { min-width: 0; }
.workspace article { max-width: 1260px; padding: 25px 30px 38px; }
h1 { font-size: 28px; line-height: 1.21; letter-spacing: -.028em; font-weight: 650; }
h2 { font-size: 15px; font-weight: 650; line-height: 1.4; }
.head, .section-head, .line { display: flex; justify-content: space-between; align-items: center; gap: 8px 14px; flex-wrap: wrap; }
.head { margin-bottom: 21px; }
.head p { margin-top: 5px; }
.section-head { margin-bottom: 8px; }
.muted { color: var(--secondary); font-size: 13px; }
.workspace section { margin-block: 20px; }
.rows { list-style: none; padding: 0; border-block: 1px solid var(--border); }
.line { padding: 11px 3px; }
.line + .line { border-top: 1px solid var(--border); }
.line > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.line strong { font-weight: 625; }
.line strong a { color: var(--text); }
.line strong a:hover { color: var(--accent-hover); }
.line p { margin-top: 2px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.actions strong { font-variant-numeric: tabular-nums; }
.actions:empty { display: none; }
.end { justify-content: flex-end; margin-top: 12px; }
.badge {
  display: inline-block;
  border-radius: 5px;
  padding: 3px 7px;
  background: var(--raised);
  color: var(--secondary);
  font-size: 12px;
  font-weight: 600;
}
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font-weight: 575;
  cursor: pointer;
}
.btn:hover { background: var(--hover); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.inline { display: inline; margin: 0; }
.editor {
  max-width: 600px;
  margin: 14px 0;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.editor h2 { margin-bottom: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px 13px; }
.wide { grid-column: 1 / -1; }
label { display: grid; gap: 4px; min-width: 0; color: var(--secondary); font-size: 13px; }
input, select, textarea {
  min-width: 0;
  max-width: 100%;
  min-height: 35px;
  padding: 6px 8px;
  border: 1px solid #cdd2dc;
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}
textarea { min-height: 82px; resize: vertical; }
.period { display: flex; align-items: end; gap: 6px; }
.tabs { display: flex; flex-wrap: wrap; gap: 0 16px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.tabs a { padding: 8px 2px; border-bottom: 2px solid transparent; color: var(--secondary); font-weight: 575; }
.tabs :is(.active, [aria-current="page"]) { border-color: var(--accent); color: var(--accent-hover); }
.deal-statuses a { white-space: nowrap; }
.deal-statuses a span { margin-left: 2px; font-size: 12px; font-variant-numeric: tabular-nums; }
.deal-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 14px; margin: 0 0 16px; }
.deal-filters select { min-width: 140px; }
.quick-views { display: flex; flex-wrap: wrap; gap: 6px; }
.quick-views [aria-current="page"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-hover); }
.clear-filter { padding-block: 8px; }
.record-table { width: 100%; border-collapse: collapse; text-align: left; }
.record-table :is(th, td) { padding: 10px 12px; vertical-align: top; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.record-table thead th { border-top: 1px solid var(--border); background: var(--raised); color: var(--secondary); font-size: 12px; font-weight: 575; }
.record-table tbody th { min-width: 110px; font-weight: 625; }
.record-table tbody th a { color: var(--text); }
.record-table tbody th a:hover { color: var(--accent-hover); }
.record-table td time { white-space: nowrap; }
.record-table .numeric { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.record-detail { display: block; margin-top: 3px; color: var(--secondary); font-size: 12px; font-weight: 450; }
.record-description { display: block; max-width: 68ch; margin-top: 5px; color: var(--text); font-size: 14px; font-weight: 400; white-space: pre-wrap; overflow-wrap: anywhere; }
.record-label { display: none; }
.table-follow-up { width: 29%; }
.follow-up-due { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 8px; margin-top: 4px; color: var(--secondary); font-size: 12px; }
.timeline-date { text-align: right; font-variant-numeric: tabular-nums; }
.activity-outcome { margin-top: 4px; }
.company-stats dd { font-size: 14px; }
.deal-overview-top {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  align-items: start;
  gap: 20px;
  padding: 8px 0 20px;
  border-bottom: 1px solid var(--border);
}
.workspace .deal-overview-top > section { min-width: 0; margin: 0; }
.deal-overview-top > section + section { border-inline-start: 1px solid var(--border); padding-inline-start: 20px; }
.deal-facts { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px 16px; }
.deal-facts dt { color: var(--secondary); font-size: 12px; }
.deal-facts dd { margin-top: 3px; font-weight: 575; }
.deal-description { margin-top: 15px; }
.deal-description h3 { margin: 0 0 3px; font-size: 13px; font-weight: 625; }
.target-fields { margin-top: 14px; }
.invoice-details { flex-basis: 100%; display: grid; gap: 6px; }
.receipt-list { padding: 0 12px; list-style: none; border-radius: var(--radius); background: var(--raised); }
.receipt-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: start; gap: 6px 12px; padding: 7px 0; }
.receipt-list li + li { border-top: 1px solid var(--border); }
.receipt-list time { margin-inline: 4px; color: var(--secondary); font-size: 12px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit,minmax(123px,1fr)); border-block: 1px solid var(--border); }
.stats div { min-width: 0; padding: 10px 12px; }
.stats dt { color: var(--secondary); font-size: 12px; }
.stats dd { margin-top: 3px; font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }
.empty { padding: 8px 0; color: var(--secondary); font-size: 13px; }
.message { margin-bottom: 13px; padding: 8px 11px; border-radius: 6px; background: var(--green-soft); color: var(--green); }
.message.error { background: var(--error-soft); color: var(--error); }
.report-row { padding: 7px 0; border-top: 1px solid var(--border); }
.report-row summary { padding: 5px 4px; color: var(--secondary); cursor: pointer; }
.report-row strong { margin-right: 10px; color: var(--text); }
.report-tools, .back { display: block; margin-bottom: 10px; }

@media (max-width: 760px) {
  .deal-overview-top { grid-template-columns: minmax(0,1fr); gap: 15px; }
  .deal-overview-top > section + section { border-inline-start: 0; border-top: 1px solid var(--border); padding: 14px 0 0; }
  .workspace { grid-template-columns: minmax(0,1fr); grid-template-rows: auto 1fr; }
  .sidebar { padding: 6px 12px; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar nav { display: flex; flex-wrap: wrap; }
  .sidebar a { padding: 5px 8px; }
  .workspace article { padding: 19px 14px 28px; }
  .record-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .record-table, .record-table tbody { display: block; }
  .record-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 9px 12px;
    padding: 12px 0;
    border-top: 1px solid var(--border);
  }
  .record-table tbody :is(th, td) { width: auto; padding: 0; border: 0; }
  .record-table tbody th, .record-table .table-follow-up { grid-column: 1 / -1; }
  .record-table .numeric { text-align: left; white-space: normal; }
  .record-label { display: block; margin-bottom: 2px; color: var(--secondary); font-size: 12px; }
}
@media (max-width: 420px) {
  .deal-facts { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .launcher-bar { padding: 8px 12px; }
  .account-controls { width: 100%; }
  .product-lockup img { width: 71px; }
  .account-controls select { width: min(14rem,100%); }
  .form-grid { grid-template-columns: 1fr; }
  h1 { font-size: 24px; }
}
@media (pointer: coarse) {
  :is(.btn, .sidebar a, .tabs a, input, select) { min-height: 44px; }
  :is(input, select, textarea) { font-size: 16px; }
}

.create-editor { display: grid; gap: 16px; }
.create-editor .end { margin-top: 0; }
.relation-field { display: grid; gap: 5px; min-width: 0; }
.relation-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.create-link {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--accent-hover);
  font-size: 13px;
  font-weight: 575;
  cursor: pointer;
}
.create-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.create-link:disabled { color: var(--secondary); cursor: default; text-decoration: none; }
.create-related {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 3px 0 0;
  padding: 10px 12px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--sidebar);
}
.create-related legend { padding: 0 4px; font-weight: 625; }
.deal-details { min-width: 0; margin: 0; padding: 10px 0 0; border: 0; border-top: 1px solid var(--border); }
.deal-details legend { padding: 0 8px 0 0; font-weight: 625; }
.field-error { color: var(--error); font-size: 12px; }
[aria-invalid="true"] { border-color: var(--error); }
.message.error a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
@media (pointer: coarse) {
  .relation-header .create-link { min-height: 44px; }
}

.followup-feedback { color: var(--green); font-size: 13px; font-weight: 550; }
.followup-feedback.field-error { color: var(--error); }

.overview-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(100%,169px),1fr));
  border: 1px solid var(--border);
  border-radius: 10px;
}
.overview-stats > div { min-width: 0; padding: 11px 14px; }
.overview-stats > div + div { border-left: 1px solid var(--border); }
.overview-stats dt { color: var(--secondary); font-size: 13px; }
.overview-stats dd { margin: 2px 0; font-size: 21px; font-weight: 650; font-variant-numeric: tabular-nums; }
.dashboard-kpis .overview-stats { border: 0; background: var(--accent-soft); }
.dashboard-kpis .overview-stats > div { padding: 14px clamp(10px, 2vw, 22px); }
.dashboard-kpis .overview-stats > div + div { border-color: #d7def4; }
.dashboard-kpis .overview-stats dd { font-size: clamp(19px, 2.45vw, 32px); font-weight: 675; letter-spacing: -.027em; }
.dashboard-grid { display: grid; grid-template-columns: repeat(12,minmax(0,1fr)); gap: 16px; }
.dashboard-grid > section {
  grid-column: span 5;
  min-width: 0;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.dashboard-grid > section:first-child, .dashboard-grid > section:nth-child(4) { grid-column: span 7; }
.dashboard-grid .section-head { margin-bottom: 12px; }
.report-context { margin-bottom: 8px; }
.head .actions:has(.period) { align-items: flex-end; }
@media (max-width: 420px) {
  .report-downloads { flex-basis: 100%; }
}
.dashboard-grid .section-head a { font-size: 13px; font-weight: 575; }
.money-trend {
  --plot-height: 156px;
  display: grid;
  grid-template-columns: max-content minmax(0,1fr);
  column-gap: 10px;
  margin: 26px 0 0;
}
.trend-scale { display: flex; flex-direction: column; justify-content: space-between; height: var(--plot-height); color: var(--secondary); font-size: 11px; }
.trend-scale span:first-child { transform: translateY(-50%); }
.trend-scale span:last-child { transform: translateY(50%); }
.trend-groups {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  padding: 0;
  list-style: none;
  text-align: center;
}
.trend-groups::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: var(--plot-height);
  border-block: 1px solid var(--border);
  background: linear-gradient(var(--border),var(--border)) center / 100% 1px no-repeat;
  pointer-events: none;
}
.trend-bars { display: flex; gap: 5px; justify-content: center; align-items: end; height: var(--plot-height); }
.trend-column {
  position: relative;
  width: min(25%, 31px);
  height: max(2px,var(--bar-size));
  border-radius: 4px 4px 0 0;
  background: var(--accent);
}
.trend-column.receipts { background: #27816e; }
.trend-value { position: absolute; inset: auto auto 100% 50%; transform: translateX(-50%); font-size: 10px; white-space: nowrap; }
.trend-month { display: block; margin-top: 7px; color: var(--secondary); font-size: 12px; }
.trend-legend { display: flex; justify-content: center; gap: 14px; margin-top: 10px; color: var(--secondary); font-size: 12px; }
.trend-legend span { display: flex; gap: 5px; align-items: center; }
.trend-legend span::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }
.trend-legend span + span::before { background: #27816e; }
.attention-rows { border-block: 1px solid var(--border); }
.attention-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  color: var(--text);
}
.attention-row + .attention-row { border-top: 1px solid var(--border); }
.attention-row .badge { margin-inline-start: auto; }
.attention-row::after {
  content: "";
  width: 6px;
  height: 6px;
  margin: 0 4px 0 1px;
  border-top: 1.5px solid var(--secondary);
  border-right: 1.5px solid var(--secondary);
  transform: rotate(45deg);
}
.attention-row:hover { background: var(--sidebar); text-decoration: none; }
.attention-row:hover strong { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }
.receivables-total, .pipeline-totals, .closure-totals { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.receivables-total { margin-top: 10px; }
.receivables-total div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; width: 100%; }
:is(.receivables-total,.pipeline-totals,.closure-totals) dt { color: var(--secondary); font-size: 12px; }
:is(.receivables-total,.pipeline-totals,.closure-totals) dd { font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; }
.panel-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 13px; }
.stage-bars { margin-top: 12px; padding: 0; list-style: none; }
.stage-bars a { display: grid; grid-template-columns: 86px minmax(0,1fr) 24px; gap: 7px; align-items: center; padding: 4px 2px; color: var(--text); font-size: 13px; }
.stage-bars a strong { text-align: right; font-variant-numeric: tabular-nums; }
.stage-track { height: 7px; border-radius: 4px; background: var(--hover); }
.stage-track i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.stage-track.won i { background: #27816e; }
.stage-track.lost i { background: #7a8090; }
.closure-totals { margin-bottom: 10px; }
.dashboard-grid .record-table :is(th, td) { padding-inline: 6px; }
@media (min-width: 761px) and (max-width: 1060px) {
  .workspace .dashboard-grid > section { grid-column: 1 / -1; }
  .record-table :is(th, td) { padding-inline: 8px; }
}
@media (max-width: 760px) {
  .workspace .dashboard-grid > section { grid-column: 1 / -1; }
  .money-trend { --plot-height: 125px; }
  .trend-value { display: none; }
  .dashboard-grid .record-table :is(th, td) { padding-inline: 0; }
}
@media (max-width: 590px) {
  .overview-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .overview-stats > div { padding: 9px 10px; }
  .overview-stats > div:nth-child(odd) { border-left: 0; }
  .overview-stats > div:nth-child(n+3) { border-top: 1px solid var(--border); }
  .overview-stats > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .overview-stats dd { font-size: 18px; }
  .dashboard-kpis .overview-stats { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .dashboard-kpis .overview-stats > div { padding: 10px 8px; }
  .dashboard-kpis .overview-stats > div:last-child:nth-child(odd) { grid-column: auto; }
  .dashboard-kpis .overview-stats > div + div { border-top: 0; border-left: 1px solid #d7def4; }
  .dashboard-kpis .overview-stats dd { font-size: clamp(13px, 3.6vw, 19px); }
  .dashboard-kpis .overview-stats .muted { font-size: 11px; }
}
