:root {
  --bg: #f6f3ee;
  --paper: #fffdf8;
  --ink: #1f2523;
  --muted: #66716d;
  --line: #ded8ce;
  --teal: #0d766c;
  --teal-soft: #d9f2ed;
  --gold: #a35d00;
  --gold-soft: #fff0d1;
  --red: #b42318;
  --red-soft: #ffe1df;
  --blue: #315a9f;
  --radius: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
}

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

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.pane {
  display: grid;
  gap: 12px;
  min-height: 100vh;
  padding: 12px;
}

.login-view,
.standup-view {
  display: grid;
  gap: 12px;
}

.brand-row,
.pane-header,
.tile-header,
.button-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pane-header,
.tile-header {
  justify-content: space-between;
}

.brand-row.compact {
  min-width: 0;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: #27231f;
  color: #fffaf0;
  font-weight: 900;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
}

h2 {
  font-size: 16px;
}

.brand-row p,
.tile-header span,
.muted,
.message,
.card small {
  color: var(--muted);
}

.brand-row p,
.tile-header span {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.tile {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.sync-panel {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  background: var(--paper);
}

.sync-panel div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sync-panel strong {
  font-size: 14px;
}

.sync-panel p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

#dataAsOf {
  font-weight: 800;
}

.sync-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.sync-panel.online {
  border-left-color: var(--teal);
}

.sync-panel.online .sync-badge {
  background: var(--teal-soft);
  color: var(--teal);
}

.sync-panel.pending {
  border-left-color: var(--gold);
}

.sync-panel.pending .sync-badge {
  background: var(--gold-soft);
  color: var(--gold);
}

.sync-panel.offline,
.sync-panel.failed {
  border-left-color: var(--red);
}

.sync-panel.offline .sync-badge,
.sync-panel.failed .sync-badge {
  background: var(--red-soft);
  color: var(--red);
}

.stack {
  display: grid;
  gap: 10px;
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  text-transform: none;
}

textarea {
  resize: vertical;
}

.primary,
.ghost,
.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 900;
  text-decoration: none;
}

.primary {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.ghost,
.ghost-link {
  background: #fff;
  color: var(--ink);
}

.compact-button {
  min-height: 30px;
  padding: 0 8px;
  font-size: 12px;
}

.universal-filter-tile {
  gap: 12px;
}

.universal-filter-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(240px, 1fr) minmax(240px, 1fr);
  gap: 10px;
  align-items: start;
}

.filter-field {
  position: relative;
  display: grid;
  gap: 5px;
}

.filter-field > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.filter-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.filter-button strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-filter-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 14px 28px rgba(31, 37, 35, 0.16);
}

.multi-filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-transform: none;
}

.multi-filter-option + .multi-filter-option {
  border-top: 1px solid #eee7dd;
}

.multi-filter-option input {
  width: 16px;
  min-height: 16px;
  padding: 0;
}

.metrics,
.field-grid,
.detail-grid {
  display: grid;
  gap: 8px;
}

.metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

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

.metric {
  display: grid;
  gap: 4px;
  min-width: 0;
  min-height: 62px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  text-align: left;
}

button.metric:hover,
button.metric:focus-visible {
  border-color: var(--teal);
  outline: none;
}

.metric span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  line-height: 1.15;
  text-transform: uppercase;
}

.metric strong {
  font-size: 17px;
  line-height: 1;
}

.metric small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.2;
}

.progression-tile {
  gap: 8px;
}

.progression-tile .tile-header {
  align-items: flex-start;
}

.progression-tile .tile-header div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

#renewalProgressionHealth {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.progress-bar {
  display: flex;
  min-height: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ebe5da;
}

.progress-bar span {
  min-width: 0;
}

.progress-bar .saved,
.progress-card.saved {
  --progress-color: var(--teal);
}

.progress-bar .wip,
.progress-card.wip {
  --progress-color: var(--gold);
}

.progress-bar .confirmed,
.progress-card.confirmed {
  --progress-color: var(--red);
}

.progress-bar .open,
.progress-card.open,
.progress-card.saveable {
  --progress-color: var(--blue);
}

.progress-card.upsell,
.progress-legend i.upsell {
  --progress-color: var(--gold);
}

.progress-card.outreach {
  --progress-color: var(--gold);
}

.progress-card.likely,
.progress-legend i.likely {
  --progress-color: var(--red);
}

.progress-card.net,
.progress-legend i.net {
  --progress-color: var(--ink);
}

.progress-bar .saved,
.progress-bar .wip,
.progress-bar .confirmed,
.progress-bar .open {
  background: var(--progress-color);
}

.progress-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
}

.progress-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.progress-legend i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--muted);
}

.progress-legend i.saved {
  background: var(--teal);
}

.progress-legend i.wip {
  background: var(--gold);
}

.progress-legend i.confirmed {
  background: var(--red);
}

.progress-legend i.open {
  background: var(--blue);
}

.progress-legend i.upsell,
.progress-legend i.likely,
.progress-legend i.net {
  background: var(--progress-color);
}

.outlook-waterfall {
  display: block;
  min-height: 218px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow-x: auto;
  overflow-y: hidden;
}

.waterfall-svg {
  display: block;
  width: 100%;
  min-width: 840px;
  height: auto;
  fill: none;
  stroke: none;
  color: var(--ink);
  font-family: var(--font);
}

.waterfall-grid-line {
  stroke: rgba(92, 101, 97, 0.18);
  stroke-width: 1;
}

.waterfall-axis {
  stroke: rgba(25, 31, 28, 0.36);
  stroke-width: 1.1;
}

.waterfall-axis-label,
.waterfall-label {
  fill: var(--muted);
  stroke: none;
  font-weight: 700;
  letter-spacing: 0;
  paint-order: normal;
  text-anchor: middle;
}

.waterfall-axis-label {
  fill: rgba(102, 113, 109, 0.78);
  font-size: 8px;
  text-anchor: end;
}

.waterfall-label {
  fill: var(--ink);
  font-size: 9px;
  font-weight: 800;
}

.waterfall-value {
  fill: var(--ink);
  stroke: none;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0;
  paint-order: normal;
  text-anchor: middle;
}

.waterfall-connector {
  stroke: rgba(25, 31, 28, 0.46);
  stroke-linecap: round;
  stroke-width: 1.5;
}

.waterfall-bar {
  fill: var(--blue);
  stroke: none;
  filter: none;
}

.waterfall-value-bg {
  fill: rgba(255, 255, 255, 0.95);
  stroke: var(--line);
  stroke-width: 1;
}

.waterfall-value-bg.total {
  fill: #f4f1ea;
  stroke: #cbc4b8;
}

.waterfall-value-bg.context {
  fill: #f4f7fd;
  stroke: #c7d4ef;
}

.waterfall-value-bg.positive {
  fill: #ecf7f4;
  stroke: #b7ddd5;
}

.waterfall-value-bg.negative {
  fill: #fff1ef;
  stroke: #efbbb5;
}

.waterfall-bar.total {
  fill: var(--ink);
}

.waterfall-bar.context {
  fill: var(--blue);
  opacity: 0.82;
}

.waterfall-bar.positive {
  fill: var(--teal);
}

.waterfall-bar.negative {
  fill: var(--red);
}

.waterfall-step-node {
  cursor: help;
}

.waterfall-step-node:hover .waterfall-bar,
.waterfall-step-node:focus .waterfall-bar {
  stroke: var(--ink);
  stroke-width: 2;
}

.outlook-waterfall-step {
  position: relative;
  display: grid;
  grid-template-rows: 58px auto auto;
  gap: 3px;
  min-width: 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  outline: none;
}

.outlook-waterfall-step:hover,
.outlook-waterfall-step:focus {
  z-index: 20;
}

.outlook-waterfall-plot {
  position: relative;
  min-height: 58px;
  overflow: hidden;
  border-radius: 7px;
  background: #e6ded0;
}

.outlook-waterfall-plot span {
  position: absolute;
  right: 12%;
  left: 12%;
  min-height: 4px;
  border-radius: 7px 7px 3px 3px;
  background: var(--muted);
}

.outlook-waterfall-step.total .outlook-waterfall-plot span {
  background: var(--ink);
}

.outlook-waterfall-step.context .outlook-waterfall-plot span {
  background: var(--blue);
  opacity: 0.72;
}

.outlook-waterfall-step.positive .outlook-waterfall-plot span {
  background: var(--teal);
}

.outlook-waterfall-step.negative .outlook-waterfall-plot span {
  background: var(--red);
}

.outlook-waterfall-step strong {
  overflow: hidden;
  font-size: 11px;
  line-height: 1.1;
  text-overflow: ellipsis;
}

.outlook-waterfall-step small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 900;
  line-height: 1.15;
  text-transform: uppercase;
}

.outlook-waterfall-tooltip {
  position: absolute;
  top: 7px;
  left: 50%;
  z-index: 30;
  display: grid;
  gap: 4px;
  width: min(218px, 76vw);
  padding: 9px;
  border-radius: var(--radius);
  background: rgba(18, 29, 39, 0.96);
  color: #fff;
  box-shadow: 0 14px 32px rgba(18, 29, 39, 0.24);
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transform: translate(-50%, 7px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.outlook-waterfall-step:first-child .outlook-waterfall-tooltip {
  left: 0;
  transform: translate(0, 7px);
}

.outlook-waterfall-step:last-child .outlook-waterfall-tooltip {
  right: 0;
  left: auto;
  transform: translate(0, 7px);
}

.outlook-waterfall-step:hover .outlook-waterfall-tooltip,
.outlook-waterfall-step:focus .outlook-waterfall-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.outlook-waterfall-step:first-child:hover .outlook-waterfall-tooltip,
.outlook-waterfall-step:first-child:focus .outlook-waterfall-tooltip,
.outlook-waterfall-step:last-child:hover .outlook-waterfall-tooltip,
.outlook-waterfall-step:last-child:focus .outlook-waterfall-tooltip {
  transform: translate(0, 0);
}

.outlook-waterfall-tooltip span {
  color: rgba(255, 255, 255, 0.75);
  font-size: 9px;
  font-weight: 900;
  line-height: 1.15;
  text-transform: uppercase;
}

.outlook-waterfall-tooltip strong {
  color: #fff;
  font-size: 16px;
}

.outlook-waterfall-tooltip small,
.outlook-waterfall-tooltip p,
.outlook-waterfall-tooltip em {
  color: rgba(255, 255, 255, 0.78);
  font-size: 10px;
  line-height: 1.3;
}

.outlook-waterfall-tooltip em {
  display: block;
  font-style: normal;
}

.progress-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  gap: 6px;
}

.progress-cards:empty {
  display: none;
}

.progress-card {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
  min-height: 108px;
  padding: 8px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--progress-color, var(--teal));
  border-radius: var(--radius);
  background: #fff;
}

.progress-card.base {
  --progress-color: var(--ink);
}

.progress-card span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  line-height: 1.15;
  text-transform: uppercase;
}

.progress-card strong {
  font-size: 16px;
  line-height: 1;
}

.progress-card small,
.progress-card p,
.progress-card em {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.progress-card p {
  margin-top: 2px;
}

.progress-card em {
  overflow: hidden;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-focus {
  animation: section-pulse 0.9s ease-out;
}

@keyframes section-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(13, 118, 108, 0.28);
  }

  100% {
    box-shadow: 0 0 0 8px rgba(13, 118, 108, 0);
  }
}

.status-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.status-card,
.mini-fact {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.status-card span,
.mini-fact span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

.status-card strong,
.mini-fact strong {
  font-size: 17px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.status-card small,
.mini-fact small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.compact-list {
  max-height: 280px;
  overflow: auto;
  padding-right: 2px;
}

.suggestion-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 2px;
}

.suggestion-chip {
  flex: 0 0 auto;
  min-height: 28px;
  max-width: 124px;
  padding: 0 9px;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.agent-form label {
  min-width: 0;
}

.agent-form textarea {
  min-height: 58px;
}

.agent-form .primary {
  align-self: end;
  min-width: 88px;
  white-space: nowrap;
}

.agent-answer {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 180px;
  max-height: 260px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbf8f1;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.chat-empty {
  color: var(--muted);
}

.chat-row {
  display: flex;
  min-width: 0;
}

.chat-row.user {
  justify-content: flex-start;
}

.chat-row.rom {
  justify-content: flex-end;
}

.chat-bubble {
  display: grid;
  gap: 3px;
  max-width: 86%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.chat-row.user .chat-bubble {
  border-left: 4px solid var(--blue);
}

.chat-row.rom .chat-bubble {
  border-color: rgba(13, 118, 108, 0.25);
  border-right: 4px solid var(--teal);
  background: var(--teal-soft);
}

.chat-bubble span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.chat-bubble p {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.chat-bubble.pending p {
  color: var(--muted);
}

.chat-choice-row {
  display: grid;
  gap: 6px;
  margin-top: 4px;
}

.chat-choice {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 7px 9px;
  border: 1px solid rgba(13, 118, 108, 0.32);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.chat-choice:hover,
.chat-choice:focus-visible {
  border-color: var(--teal);
  outline: none;
}

.chat-choice strong {
  font-size: 12px;
  line-height: 1.2;
}

.chat-choice small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.account-detail {
  display: grid;
  gap: 10px;
}

.detail-block {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.detail-block strong {
  font-size: 13px;
}

.detail-block p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

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

.card {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.card.behind {
  border-left-color: var(--red);
  background: var(--red-soft);
}

.card.milestone {
  border-left-color: var(--gold);
  background: var(--gold-soft);
}

.card.renewal {
  border-left-color: var(--blue);
}

.card strong {
  overflow-wrap: anywhere;
}

.card span,
.card small {
  font-size: 12px;
  line-height: 1.35;
}

.check-chip-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  margin-top: 3px;
}

.check-chip {
  min-width: 0;
  padding: 3px 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 9px !important;
  font-weight: 900;
  line-height: 1 !important;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.check-chip.done {
  border-color: rgba(13, 118, 108, 0.35);
  background: var(--teal-soft);
  color: var(--teal);
}

.check-chip.open {
  border-color: rgba(180, 35, 24, 0.22);
  background: rgba(255, 255, 255, 0.72);
  color: var(--red);
}

.month-title {
  display: block;
  text-align: center;
}

.weekday-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.weekday-row span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.day {
  display: grid;
  gap: 2px;
  min-height: 46px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.day.blank {
  border-color: transparent;
  background: transparent;
  cursor: default;
}

.day.today {
  box-shadow: 0 0 0 2px rgba(13, 118, 108, 0.18);
}

.day.selected {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.day.has-items {
  border-left: 4px solid var(--blue);
}

.day strong {
  font-size: 12px;
}

.day span {
  color: var(--muted);
  font-size: 9px;
}

.agenda-title {
  margin-top: 4px;
}

.checklist {
  display: grid;
  gap: 7px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.check-row input {
  width: auto;
  min-height: auto;
}

@media (max-width: 340px) {
  .field-grid,
  .detail-grid,
  .status-overview,
  .progress-cards,
  .universal-filter-grid {
    grid-template-columns: 1fr;
  }

  .button-row {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

@media (max-width: 520px) {
  .universal-filter-grid {
    grid-template-columns: 1fr;
  }

  .metrics {
    grid-template-columns: repeat(5, minmax(46px, 1fr));
    gap: 4px;
  }

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

  .metric {
    min-height: 54px;
    padding: 6px 4px;
  }

  .metric span,
  .metric small {
    font-size: 8px;
  }

  .metric strong {
    font-size: 14px;
  }

  .agent-form {
    grid-template-columns: 1fr;
  }

  .agent-form .primary {
    width: 100%;
  }
}
