:root {
  --primary: #1763e8;
  --bg: #f5f7fb;
}
body {
  background: #f5f7fb;
}
.sidebar {
  width: 220px;
  background: #f8faff;
}
.sidebar .brand {
  font-size: 17px;
  padding: 20px 14px;
}
.sidebar .nav-item {
  padding: 9px 14px;
  min-height: 38px;
}
.sidebar .nav-label {
  margin: 12px 14px 6px;
  font-size: 11px;
}
.identity {
  padding: 12px;
}
.main {
  margin-left: 220px;
}
.content {
  padding: 20px 24px;
  max-width: 1800px;
}
.topbar {
  height: 58px;
  gap: 16px;
}
.top-search {
  margin-left: auto;
  max-width: 330px;
}
.global-actions {
  display: flex;
  gap: 8px;
  white-space: nowrap;
}
.page-head {
  margin-bottom: 16px;
}
.page-head h1 {
  font-size: 24px;
}
.page-head p {
  margin: 5px 0;
  font-size: 13px;
}
.surface {
  padding: 16px;
  border-radius: 7px;
  box-shadow: none;
  border: 1px solid #e0e6f0;
}
.module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.module-card {
  margin: 0;
  padding: 16px;
}
.module-card h2 {
  font-size: 16px;
  display: flex;
  gap: 9px;
  align-items: center;
  margin: 0 0 10px;
  color: #173451;
}
.module-card h2 .icon {
  color: #1763e8;
}
.module-card > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.module-card .link {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 3px 0;
  text-align: left;
}
.module-card .link .icon {
  width: 12px;
}
.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
}
.section-head h2,
.surface > h2 {
  font-size: 16px;
}
.overview-lines {
  display: grid;
  gap: 5px;
}
.overview-lines button {
  border: 0;
  border-bottom: 1px solid #edf0f6;
  border-radius: 0;
  display: flex;
  justify-content: space-between;
  background: white;
}
.overview-lines b {
  color: #1763e8;
}
.overdue {
  color: #c83333;
}
.document-types {
  flex-wrap: wrap;
}
.customer-grid {
  display: grid;
  grid-template-columns: 1fr 1.7fr;
  gap: 16px;
}
.timeline {
  padding: 12px 0;
  border-bottom: 1px solid #e7edf5;
}
.timeline small {
  display: block;
  color: #65758d;
  font-size: 12px;
}
.timeline p {
  margin: 6px 0;
}
.deal-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(200px, 1fr));
  gap: 12px;
  overflow: auto;
  min-height: 360px;
  padding-bottom: 12px;
}
.deal-board > section {
  background: #edf2f8;
  padding: 10px;
  border-radius: 6px;
}
.deal-board h2 {
  font-size: 14px;
  display: flex;
  justify-content: space-between;
}
.deal-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  white-space: normal;
  text-align: left;
  background: white;
  width: 100%;
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid #e1e6ee;
}
.deal-card span {
  font-size: 12px;
  color: #4b6179;
}
.deal-card small {
  color: #65758d;
}
.goal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}
.goal-amount {
  font-size: 24px;
  display: block;
}
.goal-amount small {
  font-size: 14px;
  color: #65758d;
}
progress {
  width: 100%;
  height: 10px;
  margin: 12px 0;
  accent-color: #1763e8;
}
.io-top {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}
.io-top label {
  min-width: 200px;
}
.io-top select {
  margin-top: 5px;
}
.mapping-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.mapping-grid select {
  height: 80px;
}
.compare-table {
  min-width: 900px;
}
.compare-table pre {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 12px;
  max-width: 350px;
  line-height: 1.6;
}
.compare-table td {
  vertical-align: top;
}
.io-review {
  background: #fffbef;
}
.io-error {
  background: #fff1f1;
}
.compare-existing {
  border-left: 3px solid #b4c5df;
  padding: 8px;
  background: #f5f8fd;
}
.ai-draft {
  white-space: pre-wrap;
  font-family: inherit;
  line-height: 1.8;
  background: #f4f8ff;
  padding: 20px;
}
.preview-entry {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
}
.notice {
  font-size: 12px;
}
.form-grid label {
  min-width: 0;
}
input,
select,
textarea {
  max-width: 100%;
}
table th,
table td {
  padding: 10px 12px;
}
.initial {
  padding: 40px;
}
.mobile-nav {
  z-index: 50;
}
@media (max-width: 1150px) {
  .module-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .top-search {
    display: none;
  }
  .goal-grid {
    grid-template-columns: 1fr 1fr;
  }
  .work-grid {
    grid-template-columns: 1fr 280px;
  }
  .sidebar {
    width: 200px;
  }
  .main {
    margin-left: 200px;
  }
  .content {
    padding: 16px;
  }
  .mapping-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 800px) {
  .sidebar {
    width: 230px;
  }
  .main {
    margin-left: 0;
  }
  .content {
    padding: 12px 12px 85px;
  }
  .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .module-card {
    padding: 12px;
  }
  .module-card h2 {
    font-size: 15px;
  }
  .module-card .link {
    font-size: 12px;
  }
  .work-grid,
  .customer-grid,
  .goal-grid {
    grid-template-columns: 1fr;
  }
  .topbar {
    padding: 10px 12px;
    height: 54px;
  }
  .global-actions button {
    font-size: 12px;
    padding: 7px;
  }
  .topbar .crumb {
    max-width: 120px;
    font-size: 12px;
  }
  .page-head h1 {
    font-size: 21px;
  }
  .page-head {
    align-items: flex-start;
  }
  .page-head .actions {
    flex-wrap: wrap;
  }
  .mapping-grid {
    grid-template-columns: 1fr 1fr;
  }
  .surface {
    padding: 12px;
  }
  .module-card .link .icon {
    display: none;
  }
  .document-types .tab {
    font-size: 12px;
    padding: 8px;
  }
  .form-grid.four {
    grid-template-columns: 1fr 1fr;
  }
  .sticky-actions {
    bottom: 62px;
  }
}
/* The base shell already reserves a grid column for its fixed sidebar. */
.app {
  grid-template-columns: 220px minmax(0, 1fr);
}
.main {
  margin-left: 0;
}
.sidebar {
  padding: 12px 10px;
}
.sidebar .brand {
  padding: 10px 8px 18px;
}
.sidebar .nav-label {
  margin: 8px 0 2px;
  padding: 6px 14px;
}
.sidebar .nav-item {
  margin: 1px 0;
  padding: 8px 12px;
}
.module-card .link {
  min-height: 27px;
}
.module-card h2 {
  margin-bottom: 9px;
}
.content > .notice {
  margin-bottom: 14px;
}
.work-grid .surface {
  min-width: 0;
}
.work-grid table td:last-child {
  white-space: nowrap;
}
.work-grid table td:nth-last-child(2) {
  white-space: nowrap;
}
.module-grid {
  align-items: stretch;
}
.preview-entry button {
  box-shadow: 0 4px 18px #1232;
}
@media (max-width: 1150px) {
  .app {
    grid-template-columns: 200px minmax(0, 1fr);
  }
}
@media (max-width: 800px) {
  .app {
    display: block;
  }
  .main {
    margin-left: 0;
  }
  .sidebar .identity strong {
    font-size: 13px;
  }
  .module-card .link {
    min-height: 27px;
  }
}
