:root {
  color-scheme: light;
  --bg: #fff7df;
  --surface: #ffffff;
  --surface-muted: #fff3bf;
  --ink: #07111f;
  --muted: #6f675c;
  --line: #f0d67a;
  --brand: #ffc400;
  --brand-ink: #07111f;
  --navy: #061321;
  --blue: #2c76d2;
  --teal: #138a72;
  --amber: #9b6500;
  --red: #c33a32;
  --green: #23824f;
  --shadow: 0 18px 42px rgba(24, 20, 10, 0.1);
  --radius: 8px;
  --sidebar: 292px;
  --calendar-head-height: 86px;
  --calendar-slot-height: 72px;
  --calendar-grid-height: 720px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
}

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

button {
  cursor: pointer;
}

.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 76px;
  padding: 14px 28px;
  color: #fff;
  background: var(--navy);
  border-top: 4px solid var(--brand);
}

.workspace-title,
.workspace-user {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.workspace-logo,
.user-avatar {
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  font-weight: 900;
}

.workspace-logo {
  width: 44px;
  height: 44px;
  color: var(--ink);
  background: var(--brand);
  font-size: 22px;
}

.user-avatar {
  width: 38px;
  height: 38px;
  color: var(--navy);
  background: #d7dfc2;
}

.workspace-title strong,
.workspace-user strong {
  display: block;
  line-height: 1.2;
}

.workspace-title p,
.workspace-user p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.64);
  font-size: 13px;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  gap: 24px;
  min-height: calc(100vh - 76px);
  padding: 36px 24px 48px;
}

.sidebar {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 124px);
  padding: 22px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 28px rgba(113, 91, 19, 0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 12px 28px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  color: var(--ink);
  background: var(--brand);
  font-weight: 800;
}

.brand h1,
.brand p,
.topbar h2,
.topbar p,
.panel h3,
.list-heading h3,
.modal h3 {
  margin: 0;
}

.brand h1 {
  font-size: 18px;
  line-height: 1.2;
}

.brand p,
.eyebrow {
  color: var(--muted);
  font-size: 12px;
}

.nav-tabs {
  display: grid;
  gap: 10px;
}

.nav-tab,
.mobile-tab {
  border: 0;
  color: var(--muted);
  background: transparent;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 14px;
  border-radius: var(--radius);
  color: #504b43;
  font-size: 16px;
  font-weight: 800;
  text-align: left;
}

.nav-tab span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  color: var(--ink);
  background: #fff6cd;
  text-align: center;
}

.nav-tab:hover,
.nav-tab.active {
  color: var(--ink);
  background: #fff1ad;
}

.nav-tab.active {
  box-shadow: inset 3px 0 0 var(--brand);
}

.sidebar-footer {
  display: grid;
  gap: 8px;
  margin: auto 12px 0;
}

.main {
  min-width: 0;
  padding: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 18px 20px;
  border: 1px solid #f2dc83;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 28px rgba(113, 91, 19, 0.06);
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.topbar h2 {
  margin-top: 4px;
  font-size: 26px;
  letter-spacing: 0;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 180px 160px;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid #f2dc83;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid #ead27a;
  border-radius: var(--radius);
  background: #fffdfa;
}

.search-field input {
  width: 100%;
  min-width: 0;
  height: 42px;
  border: 0;
  outline: 0;
  background: transparent;
}

select,
input,
textarea {
  border: 1px solid #e1d8c5;
  border-radius: var(--radius);
  color: var(--ink);
  background: #fffdfa;
}

.toolbar select {
  height: 44px;
  padding: 0 12px;
}

.primary-button,
.ghost-button,
.text-button,
.complete-button,
.icon-button {
  min-height: 40px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}

.primary-button {
  padding: 0 16px;
  color: var(--brand-ink);
  background: var(--brand);
  font-weight: 700;
}

.primary-button:hover {
  background: #ffd236;
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-color: #d3bd62;
  color: var(--ink);
  background: #fffdfa;
  font-weight: 700;
}

.ghost-button:hover {
  border-color: #c49b00;
  background: #fff4bd;
}

.complete-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  border-color: #bfe7cf;
  color: #11633d;
  background: #f0fbf5;
  font-weight: 800;
}

.complete-button span {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: #fff;
  background: #1fbf75;
  font-size: 12px;
  line-height: 1;
}

.complete-button:hover {
  border-color: #1fbf75;
  background: #dff8ea;
}

.text-button {
  min-height: 32px;
  padding: 0 4px;
  color: #806000;
  background: transparent;
  font-weight: 800;
}

.text-button:hover {
  color: var(--ink);
}

.icon-button {
  display: grid;
  width: 38px;
  min-width: 38px;
  place-items: center;
  border-color: #e1d8c5;
  color: var(--muted);
  background: var(--surface);
  font-size: 22px;
  line-height: 1;
}

.icon-button:hover {
  color: var(--ink);
  background: var(--surface-muted);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.metric {
  position: relative;
  display: block;
  min-height: 118px;
  width: 100%;
  padding: 18px;
  overflow: hidden;
  border: 1px solid #f0d67a;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(113, 91, 19, 0.06);
  text-align: left;
}

.metric::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: var(--brand);
  content: "";
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 14px;
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
}

.metric small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.metric-button:hover,
.metric-button:focus-visible {
  border-color: #c49b00;
  background: #fff9df;
  transform: translateY(-1px);
}

.metric-button:focus-visible {
  outline: 3px solid rgba(255, 196, 0, 0.35);
  outline-offset: 2px;
}

.work-grid,
.money-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 24px;
  align-items: start;
}

.money-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.money-summary-card {
  appearance: none;
  min-height: 104px;
  padding: 16px;
  border: 1px solid #f0d67a;
  border-radius: var(--radius);
  background: #fffefa;
  color: inherit;
  font: inherit;
  text-align: left;
  box-shadow: 0 10px 24px rgba(113, 91, 19, 0.06);
  cursor: pointer;
  transition:
    border-color 120ms ease,
    box-shadow 120ms ease,
    transform 120ms ease,
    background 120ms ease;
}

.money-summary-card.primary {
  border-color: #ffc400;
  background: #fff3bf;
}

.money-summary-card:hover,
.money-summary-card.active {
  border-color: #c49b00;
  background: #fff7d6;
  box-shadow: 0 14px 30px rgba(113, 91, 19, 0.11);
  transform: translateY(-1px);
}

.money-summary-card:focus-visible {
  outline: 3px solid rgba(255, 196, 0, 0.35);
  outline-offset: 2px;
}

.money-summary-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.money-summary-card strong {
  display: block;
  margin-top: 12px;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.1;
}

.money-summary-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-calendar {
  margin-bottom: 24px;
}

.panel,
.customer-list-wrap,
.detail-panel {
  border: 1px solid #f0d67a;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 14px 32px rgba(113, 91, 19, 0.07);
}

.panel {
  padding: 20px;
}

.panel-heading,
.list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.calendar-heading {
  align-items: flex-start;
}

.calendar-heading > div:first-child {
  display: grid;
  gap: 4px;
}

.calendar-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.panel-heading h3,
.list-heading h3 {
  color: var(--ink);
  font-size: 19px;
  font-weight: 900;
}

.panel-heading span,
.list-heading span {
  color: var(--muted);
  font-size: 13px;
}

.priority-list,
.timeline,
.money-list,
.contract-list,
.customer-list,
.action-board {
  display: grid;
  gap: 12px;
}

.priority-item,
.timeline-item,
.money-item,
.contract-item,
.action-card,
.customer-card {
  border: 1px solid #efd676;
  border-radius: var(--radius);
  background: #fffefa;
}

.priority-item,
.timeline-item,
.money-item,
.contract-item,
.action-card {
  padding: 16px 18px;
}

.priority-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.priority-item h4,
.customer-card h4,
.action-card h4,
.money-item h4,
.contract-item h4 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
}

.priority-item p,
.timeline-item p,
.customer-card p,
.action-card p,
.money-item p,
.contract-item p,
.detail-panel p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.badge,
.stage-pill,
.risk-pill,
.status-pill,
.type-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.stage-pill {
  color: #0b2d4e;
  background: #e6f0ff;
}

.risk-low {
  color: var(--green);
  background: #e8f4ee;
}

.risk-mid {
  color: var(--amber);
  background: #fff4df;
}

.risk-high {
  color: var(--red);
  background: #fdebea;
}

.status-pill {
  color: #365066;
  background: #edf2f6;
}

.type-pending {
  color: #7d5200;
  background: #ffefad;
}

.type-closed {
  color: #0b6845;
  background: #dff8ea;
}

.badge {
  color: var(--muted);
  background: #fff3c2;
}

.customer-layout {
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.customer-list-wrap {
  padding: 20px;
}

.customer-group {
  display: grid;
  gap: 10px;
  scroll-margin-top: 18px;
}

.customer-group + .customer-group {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #f0d67a;
}

.customer-group-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.customer-group-heading strong,
.customer-group-heading em {
  color: var(--ink);
  font-size: 15px;
  font-style: normal;
  font-weight: 900;
}

.customer-group-heading span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.list-empty {
  padding: 14px;
  border: 1px dashed #eadca8;
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 248, 221, 0.5);
  font-size: 13px;
}

.customer-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  position: relative;
  align-items: center;
  width: 100%;
  min-height: 92px;
  padding: 12px 14px 12px 18px;
  overflow: hidden;
  text-align: left;
}

.customer-card::before {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 4px;
  border-radius: 0 999px 999px 0;
  content: "";
}

.customer-card.is-pending {
  background: #fffaf2;
}

.customer-card.is-pending::before {
  background: var(--brand);
}

.customer-card.is-closed {
  border-color: #bfe7cf;
  background: #f3fbf6;
}

.customer-card.is-closed::before {
  background: #2fa66a;
}

.customer-card:hover,
.customer-card.active {
  border-color: #c49b00;
  background: #fff7d6;
}

.customer-card.is-closed:hover,
.customer-card.is-closed.active {
  border-color: #2fa66a;
  background: #e8f8ee;
}

.customer-card.active {
  box-shadow: 0 8px 22px rgba(31, 42, 57, 0.08);
}

.customer-card.is-closed.active {
  box-shadow: 0 8px 22px rgba(31, 42, 57, 0.08);
}

.customer-row-main,
.customer-title-block {
  min-width: 0;
}

.customer-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.customer-card h4,
.customer-card p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-card p {
  max-width: 100%;
}

.customer-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.customer-row-metrics {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 6px 12px;
  align-content: center;
  min-width: 110px;
}

.customer-row-metrics > div:not(.compact-progress) {
  display: grid;
  gap: 2px;
}

.customer-row-metrics span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.customer-row-metrics strong {
  color: var(--ink);
  font-size: 16px;
  line-height: 1;
}

.compact-progress {
  grid-column: 1 / -1;
  width: 100%;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #f2e8c8;
}

.compact-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #159a78);
}

.customer-card.is-closed .compact-progress span {
  background: linear-gradient(90deg, #2fa66a, #0f8c72);
}

.progress-wrap {
  display: grid;
  gap: 7px;
}

.progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.progress-track {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #f3ead0;
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--teal));
}

.detail-panel {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  min-height: 560px;
  padding: 20px;
  overflow: auto;
  scroll-margin-top: 16px;
}

.detail-panel.is-pending-detail {
  background: linear-gradient(180deg, #fffefa 0%, #fff9e8 100%);
}

.detail-panel.is-closed-detail {
  border-color: #bfe7cf;
  background: linear-gradient(180deg, #fbfffd 0%, #eefaf3 100%);
}

.empty-state {
  display: grid;
  min-height: 260px;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0d67a;
}

.detail-heading h3 {
  margin: 0;
  font-size: 24px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.detail-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.detail-tabs button {
  display: grid;
  gap: 3px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid #eadca8;
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 254, 250, 0.84);
  text-align: left;
}

.detail-tabs button.active {
  border-color: #c49b00;
  color: var(--ink);
  background: #fff3bf;
  box-shadow: inset 0 3px 0 var(--brand);
}

.is-closed-detail .detail-tabs button.active {
  border-color: #2fa66a;
  background: #dcf5e7;
  box-shadow: inset 0 3px 0 #2fa66a;
}

.detail-tabs strong {
  font-size: 14px;
}

.detail-tabs span {
  font-size: 12px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.detail-stat {
  min-height: 82px;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid #f3df88;
  background: #fff7d6;
}

.detail-stat span {
  color: var(--muted);
  font-size: 12px;
}

.detail-stat strong {
  display: block;
  margin-top: 8px;
  font-size: 17px;
  line-height: 1.2;
}

.focus-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.focus-card {
  display: grid;
  gap: 10px;
  min-height: 128px;
  padding: 14px;
  border: 1px solid #efd676;
  border-radius: var(--radius);
  background: #fffefa;
}

.focus-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.focus-card strong {
  color: var(--ink);
  font-size: 16px;
}

.focus-card p {
  margin: 0;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  gap: 10px;
  margin-top: 10px;
}

.overview-note-grid {
  grid-template-columns: 1fr;
}

.section-title {
  margin: 18px 0 10px;
  font-size: 15px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.section-heading .section-title {
  margin: 0;
}

.section-heading span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.timeline-item {
  position: relative;
}

.timeline-item strong {
  display: block;
  margin-bottom: 4px;
}

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.source-link {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.source-link:hover {
  text-decoration: underline;
}

.calendar-panel {
  overflow: hidden;
}

.calendar-board {
  min-width: 0;
  overflow-x: auto;
}

.calendar-week {
  display: grid;
  grid-template-columns: 72px repeat(7, minmax(132px, 1fr));
  min-width: 1000px;
  border: 1px solid #e7d187;
  border-radius: var(--radius);
  overflow: hidden;
  background: #fffefa;
}

.calendar-time-axis {
  position: relative;
  min-height: calc(var(--calendar-head-height) + var(--calendar-grid-height));
  border-right: 1px solid #eadca8;
  color: #8c94a3;
  background: #fffefa;
  font-size: 13px;
  font-weight: 700;
}

.calendar-time-axis span:first-child {
  display: grid;
  align-items: end;
  height: var(--calendar-head-height);
  padding: 0 10px 16px;
  border-bottom: 1px solid #eadca8;
}

.calendar-time-axis span:not(:first-child) {
  position: absolute;
  top: calc(var(--calendar-head-height) + var(--hour-index) * var(--calendar-slot-height) - 9px);
  right: 8px;
  left: 8px;
  text-align: right;
  line-height: 18px;
}

.calendar-day {
  display: grid;
  grid-template-rows: var(--calendar-head-height) var(--calendar-grid-height);
  min-width: 0;
  border-right: 1px solid #eadca8;
  background: #fffefa;
}

.calendar-week.is-compact .calendar-day {
  grid-template-rows: var(--calendar-head-height) var(--calendar-grid-height);
}

.calendar-day:last-child {
  border-right: 0;
}

.calendar-day.today-cell {
  background: #fff7d6;
}

.calendar-day-head {
  display: grid;
  gap: 6px;
  min-height: var(--calendar-head-height);
  padding: 14px 14px 10px;
  border-bottom: 1px solid #eadca8;
}

.calendar-day-head span {
  color: #667085;
  font-size: 15px;
  font-weight: 800;
}

.calendar-day-head strong {
  color: var(--ink);
  font-size: 32px;
  line-height: 1;
}

.today-cell .calendar-day-head span,
.today-cell .calendar-day-head strong {
  color: #0b63ff;
}

.calendar-events {
  position: relative;
  min-width: 0;
  min-height: var(--calendar-grid-height);
  padding: 0;
  cursor: crosshair;
}

.calendar-hour-grid {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(var(--calendar-slot-height) - 1px),
    rgba(234, 220, 168, 0.9) calc(var(--calendar-slot-height) - 1px),
    rgba(234, 220, 168, 0.9) var(--calendar-slot-height)
  );
  pointer-events: none;
}

.calendar-event {
  display: grid;
  position: absolute;
  left: 6px;
  width: calc(100% - 12px);
  align-content: start;
  gap: 2px;
  padding: 5px 7px 5px 8px;
  border: 0;
  border-left: 3px solid #4c7dff;
  border-radius: 5px;
  color: #0649d8;
  background: #eaf1ff;
  text-align: left;
  overflow: hidden;
  z-index: 1;
  line-height: 1.22;
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition:
    box-shadow 120ms ease,
    filter 120ms ease,
    opacity 120ms ease;
}

.calendar-event:hover {
  filter: brightness(0.98);
}

.calendar-event:active {
  cursor: grabbing;
}

.calendar-board.is-dragging {
  cursor: grabbing;
}

.calendar-event.is-dragging {
  opacity: 0.72;
  pointer-events: none;
  z-index: 20;
  cursor: grabbing;
  box-shadow: 0 12px 28px rgba(31, 42, 57, 0.18);
}

.calendar-events.is-drop-target {
  background: rgba(255, 248, 213, 0.45);
}

.calendar-drop-indicator {
  display: flex;
  position: absolute;
  right: 6px;
  left: 6px;
  align-items: center;
  padding: 0 8px;
  border: 1px dashed #c49b00;
  border-radius: 5px;
  color: #8a5d00;
  background: rgba(255, 239, 170, 0.52);
  font-size: 11px;
  font-weight: 900;
  pointer-events: none;
  z-index: 6;
}

.calendar-event strong,
.calendar-event span,
.calendar-event small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-event strong {
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.15;
}

.calendar-event span {
  display: -webkit-box;
  color: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.22;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.calendar-event small {
  color: rgba(6, 73, 216, 0.72);
  font-size: 11px;
  line-height: 1.15;
  white-space: nowrap;
}

.calendar-event.is-short {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 7px;
  white-space: nowrap;
}

.calendar-event.is-overlap-stack {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 7px;
  border-left-width: 4px;
  white-space: nowrap;
}

.calendar-event.is-short strong,
.calendar-event.is-short span,
.calendar-event.is-overlap-stack strong,
.calendar-event.is-overlap-stack span {
  display: block;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

.calendar-event.is-overlap-stack strong {
  max-width: 46%;
}

.calendar-event.is-overlap-stack span {
  flex: 1 1 auto;
}

.calendar-event.is-short small,
.calendar-event.is-medium small,
.calendar-event.is-overlap-stack small {
  display: none;
}

.calendar-event.event-high {
  border-left-color: #ff5a52;
  color: #9f1d17;
  background: #ffe5e2;
}

.calendar-event.event-mid {
  border-left-color: #ffc400;
  color: #8a5d00;
  background: #fff0b8;
}

.calendar-event.event-low {
  border-left-color: #1fbf75;
  color: #11633d;
  background: #def7e8;
}

.action-board {
  grid-template-columns: repeat(3, minmax(240px, 1fr));
}

.action-card {
  min-height: 160px;
}

.action-card header,
.money-item header,
.contract-item header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.action-date {
  color: var(--muted);
  font-size: 13px;
}

.overdue {
  color: var(--red);
  font-weight: 800;
}

.today {
  color: var(--amber);
  font-weight: 800;
}

.money-item,
.contract-item {
  display: grid;
  gap: 12px;
}

.money-values {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.modal {
  width: min(920px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  background: transparent;
}

.modal-card.compact {
  width: min(560px, calc(100vw - 28px));
}

.modal::backdrop {
  background: rgba(6, 19, 33, 0.48);
}

.modal-card {
  width: 100%;
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 22px;
  border: 1px solid #f0d67a;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.modal-heading h3 {
  margin-top: 4px;
  font-size: 22px;
}

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

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

.form-grid label {
  display: grid;
  gap: 7px;
  color: #6d6458;
  font-size: 14px;
  font-weight: 800;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(6, 19, 33, 0.03);
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus,
.search-field:focus-within,
.toolbar select:focus {
  border-color: #c49b00;
  outline: 3px solid rgba(255, 196, 0, 0.2);
}

.form-grid textarea {
  resize: vertical;
}

.inline-action-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.inline-action-field .ghost-button {
  min-height: 42px;
  white-space: nowrap;
}

.import-status {
  padding: 10px 12px;
  border: 1px solid #efd676;
  border-radius: var(--radius);
  background: #fffefa;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.import-status[data-status="loading"] {
  border-color: #f3c500;
  background: #fff7d2;
  color: #836300;
}

.import-status[data-status="success"] {
  border-color: #9fdcba;
  background: #ecfff5;
  color: #087248;
}

.import-status[data-status="error"] {
  border-color: #f0b8b4;
  background: #fff7f6;
  color: #ba2623;
}

.paste-attachment-zone {
  display: grid;
  gap: 8px;
}

.attachment-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.attachment-preview-list,
.followup-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attachment-preview {
  display: grid;
  position: relative;
  grid-template-rows: 86px auto;
  width: 112px;
  margin: 0;
  overflow: hidden;
  border: 1px solid #efd784;
  border-radius: var(--radius);
  background: #fffdf5;
}

.attachment-preview img,
.followup-attachment img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attachment-preview figcaption {
  overflow: hidden;
  padding: 5px 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-preview .icon-button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  min-height: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 18px;
}

.followup-attachments {
  margin-top: 10px;
}

.followup-attachment {
  display: block;
  width: 120px;
  height: 84px;
  overflow: hidden;
  border: 1px solid #efd784;
  border-radius: var(--radius);
  background: #fff8dd;
}

.followup-attachment:hover {
  border-color: #c49b00;
  filter: brightness(0.98);
}

.meeting-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(360px, 1.2fr);
  gap: 18px;
  align-items: start;
}

.meeting-input-panel,
.meeting-review-panel {
  min-width: 0;
}

.drop-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 104px;
  padding: 14px;
  border: 1px dashed #cfa900;
  border-radius: var(--radius);
  background: #fff8dd;
}

.drop-zone.dragging {
  border-color: var(--brand);
  background: #fff1ad;
}

.drop-zone strong {
  display: block;
  font-size: 15px;
}

.drop-zone p,
.review-heading p,
.change-row p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.review-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.review-heading h4 {
  margin: 0;
  font-size: 17px;
}

.meeting-insight-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.customer-match-panel,
.meeting-brief-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.customer-match-panel {
  padding: 12px;
  border: 1px solid #efd676;
  border-radius: var(--radius);
  background: #fffefa;
}

.meeting-brief-card {
  grid-template-columns: minmax(0, 1.25fr) minmax(220px, 0.75fr);
}

.brief-main,
.brief-side,
.insight-evidence {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #efd676;
  border-radius: var(--radius);
  background: #fffefa;
}

.brief-main {
  grid-row: span 2;
}

.brief-main span,
.brief-side span,
.insight-evidence strong {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
.brief-side strong {
  display: block;
  margin-top: 4px;
  font-size: 17px;
}

.brief-main p,
.brief-side p {
  margin: 5px 0 0;
  color: #6d6458;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  white-space: pre-line;
}

.insight-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.insight-tags span {
  padding: 5px 9px;
  border-radius: 999px;
  background: #fff0b4;
  color: #745600;
  font-size: 12px;
  font-weight: 900;
}

.insight-evidence.compact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.insight-evidence ul {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.insight-evidence li {
  padding-left: 10px;
  border-left: 3px solid var(--brand);
  color: #6d6458;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}

.change-list {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.change-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #efd676;
  border-radius: var(--radius);
  background: #fffefa;
}

.change-row strong {
  font-size: 13px;
}

.change-row p {
  margin-top: 0;
  word-break: break-word;
}

.change-arrow {
  color: #a87f00;
  font-weight: 800;
}

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

.span-2 {
  grid-column: 1 / -1;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
}

.modal-actions > div {
  display: flex;
  gap: 8px;
}

#deleteCustomer {
  color: var(--red);
}

.danger-button {
  border-color: #f0b8b4;
  color: var(--red);
  background: #fff7f6;
}

.danger-button:hover {
  border-color: var(--red);
  background: #fdebea;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 10;
  max-width: 320px;
  padding: 12px 14px;
  border-radius: var(--radius);
  color: #fff;
  background: var(--navy);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.mobile-nav {
  display: none;
}

@media (max-width: 1120px) {
  .metrics-grid,
  .money-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .work-grid,
  .money-layout,
  .customer-layout {
    grid-template-columns: 1fr;
  }

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

  .detail-panel {
    position: static;
    max-height: none;
    min-height: auto;
    overflow: visible;
  }

  .action-board {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }
}

@media (max-width: 780px) {
  body {
    padding-bottom: 72px;
  }

  .workspace-header {
    display: grid;
    padding: 12px 14px;
  }

  .workspace-user {
    display: none;
  }

  .app-shell {
    display: block;
    min-height: calc(100vh - 76px);
    padding: 16px 14px 96px;
  }

  .sidebar {
    display: none;
  }

  .main {
    padding: 0;
  }

  .topbar {
    align-items: flex-start;
    padding: 14px;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .topbar h2 {
    font-size: 24px;
  }

  .primary-button {
    min-width: 96px;
    padding: 0 12px;
  }

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

  .metrics-grid,
  .money-summary-grid,
  .action-board,
  .detail-grid,
  .focus-grid,
  .overview-grid {
    grid-template-columns: 1fr;
  }

  .detail-tabs {
    grid-template-columns: 1fr;
  }

  .calendar-heading {
    display: grid;
  }

  .calendar-controls {
    justify-content: flex-start;
  }

  .calendar-week {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .calendar-time-axis {
    display: none;
  }

  .calendar-day {
    grid-template-rows: auto var(--calendar-grid-height);
    border-right: 0;
    border-bottom: 1px solid #eadca8;
  }

  .calendar-day:last-child {
    border-bottom: 0;
  }

  .calendar-day-head {
    min-height: auto;
    grid-template-columns: auto 1fr;
    align-items: baseline;
  }

  .calendar-events {
    min-height: var(--calendar-grid-height);
  }

  .panel,
  .customer-list-wrap,
  .detail-panel {
    padding: 14px;
  }

  .customer-layout {
    gap: 12px;
  }

  .detail-heading {
    display: grid;
  }

  .section-heading {
    display: grid;
    align-items: start;
  }

  .detail-actions {
    justify-content: flex-start;
  }

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

  .meeting-layout,
  .review-grid,
  .customer-match-panel,
  .meeting-brief-card,
  .insight-evidence.compact {
    grid-template-columns: 1fr;
  }

  .inline-action-field {
    grid-template-columns: 1fr;
  }

  .drop-zone {
    display: grid;
  }

  .span-2 {
    grid-column: auto;
  }

  .modal-card {
    padding: 18px;
  }

  .modal-actions {
    display: grid;
  }

  .modal-actions > div {
    justify-content: stretch;
  }

  .modal-actions button {
    flex: 1;
  }

  .mobile-nav {
    position: fixed;
    right: 10px;
    bottom: 10px;
    left: 10px;
    z-index: 8;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    padding: 6px;
    border: 1px solid #f0d67a;
    border-radius: 8px;
    background: rgba(255, 253, 245, 0.96);
    box-shadow: 0 12px 28px rgba(31, 42, 57, 0.15);
    backdrop-filter: blur(10px);
  }

  .mobile-tab {
    min-height: 42px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
  }

  .mobile-tab.active {
    color: var(--ink);
    background: #fff1ad;
  }

  .toast {
    right: 14px;
    bottom: 78px;
    left: 14px;
    max-width: none;
  }
}

@media (max-width: 420px) {
  .topbar {
    display: grid;
  }

  .topbar-actions,
  .topbar .primary-button,
  .topbar .ghost-button {
    width: 100%;
  }

  .topbar-actions {
    display: grid;
  }

  .customer-card {
    grid-template-columns: 1fr;
  }

  .customer-row-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
  }

  .priority-item,
  .customer-card-top,
  .action-card header,
  .money-item header,
  .contract-item header {
    grid-template-columns: 1fr;
    display: grid;
  }
}
