
  body {
    font-family: Arial, sans-serif;
    margin: 0;
    background: #f5f6f8;
    color: #222;
  }

  header {
    background: #1d2d44;
    color: white;
    padding: 14px 20px;
  }

  nav a {
    color: white;
    margin-right: 14px;
    text-decoration: none;
    font-size: 14px;
  }

  .container {
    padding: 18px 24px;
  }

  .card {
    background: white;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 18px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
  }

  .flash {
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 12px;
  }

  .flash.success {
    background: #e6f6ea;
    color: #1e6b36;
  }

  .flash.error {
    background: #fdeaea;
    color: #8c1d18;
  }

  .flash.warning {
    background: #fff7e6;
    color: #8a5a00;
  }

  table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
  }

  th, td {
    border-bottom: 1px solid #e6e6e6;
    padding: 8px 6px;
    text-align: left;
    vertical-align: top;
  }

  th {
    background: #f1f4f8;
    position: sticky;
    top: 0;
  }

  .right {
    text-align: right;
  }

  .muted {
    color: #667;
    font-size: 12px;
  }

  input[type=text],
  input[type=password],
  input[type=number],
  textarea,
  select {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    border: 1px solid #c9cfd6;
    border-radius: 6px;
  }

  textarea {
    min-height: 160px;
    font-family: Consolas, monospace;
  }

  button,
  .button {
    background: #1d5fa7;
    color: white;
    border: 0;
    border-radius: 6px;
    padding: 9px 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
  }

  .button.secondary {
    background: #5b6570;
  }

  .grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
  }

  .grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }

  .login-box {
    max-width: 420px;
    margin: 70px auto;
  }

  .kpi {
    font-size: 26px;
    font-weight: bold;
  }

  .small {
    font-size: 12px;
  }

  .topbar {
    background: #1d2d44;
    color: white;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
  }

  .brand {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
  }

  .brand-mark {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: 1px;
  }

  .brand-name {
    font-size: 24px;
    font-weight: 700;
  }

  .topnav {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
  }

  .topnav a {
    color: white;
    text-decoration: none;
    font-size: 14px;
    padding: 6px 10px;
    border-radius: 6px;
    margin-right: 0;
  }

  .topnav a:hover {
    text-decoration: none;
    background: rgba(255,255,255,0.12);
  }

  .topnav a.active {
    background: rgba(255,255,255,0.18);
    font-weight: 700;
    box-shadow: inset 0 -2px 0 rgba(255,255,255,0.55);
  }

  .hero-card {
    text-align: center;
    padding: 32px;
  }

  .hero-title {
    font-size: 34px;
    font-weight: 800;
    margin-bottom: 6px;
  }

  .hero-subtitle {
    font-size: 16px;
    color: #5d6b82;
    margin-bottom: 28px;
  }

  .pie-wrap {
    width: 460px;
    height: 460px;
    margin: 0 auto;
    position: relative;
  }

  .pie-slice {
    position: absolute;
    width: 210px;
    height: 210px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 22px;
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    box-shadow: 0 16px 30px rgba(0,0,0,0.18);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
  }

  .pie-slice:hover {
    box-shadow: 0 20px 36px rgba(0,0,0,0.24);
  }

  .slice-tl {
    top: 0;
    left: 0;
    border-radius: 100% 0 0 0;
    background: linear-gradient(145deg, #2d6cdf, #194ea9);
    transform: translate(-8px, -8px);
  }

  .slice-tr {
    top: 0;
    right: 0;
    border-radius: 0 100% 0 0;
    background: linear-gradient(145deg, #3f82f0, #245fbe);
    transform: translate(8px, -8px);
  }

  .slice-bl {
    bottom: 0;
    left: 0;
    border-radius: 0 0 0 100%;
    background: linear-gradient(145deg, #295fc4, #173f87);
    transform: translate(-8px, 8px);
  }

  .slice-br {
    bottom: 0;
    right: 0;
    border-radius: 0 0 100% 0;
    background: linear-gradient(145deg, #1e4f9f, #12356e);
    transform: translate(8px, 8px);
  }

  .slice-tl:hover { transform: translate(-8px, -12px); }
  .slice-tr:hover { transform: translate(8px, -12px); }
  .slice-bl:hover { transform: translate(-8px, 12px); }
  .slice-br:hover { transform: translate(8px, 12px); }

  .pie-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 118px;
    height: 118px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 10px 22px rgba(0,0,0,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: 900;
    color: #184a9a;
  }

  .disabled {
    opacity: 0.45;
    pointer-events: none;
  }

  .group-mfg {
    background: #dcecc8 !important;
  }

  .group-rwx {
    background: #cfe0fb !important;
  }

  .sep-right {
    border-right: 2px solid #aab4c3 !important;
  }

  .model-link {
    font-weight: 700;
    text-decoration: none;
  }

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

  .low-margin {
    background: #fff4d6;
  }
.profit-high {
  color: #1e7e34;
  font-weight: 700;
}

.home-shell {
  text-align: center;
  padding: 34px 24px 42px;
}

.hub-wrap {
  width: 560px;
  height: 560px;
  margin: 18px auto 0;
  position: relative;
}

.hub-segment {
  position: absolute;
  width: 260px;
  height: 260px;
  background: #04245f;
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 26px;
  box-sizing: border-box;
  font-weight: 700;
  letter-spacing: 0.2px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.14);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.hub-segment span {
  max-width: 120px;
  line-height: 1.3;
  font-size: 18px;

  white-space: normal;      /* allow wrapping */
  word-wrap: break-word;    /* break long words if needed */
  overflow-wrap: break-word;
  text-align: center;
}

.hub-segment:hover {
  transform: scale(1.025);
  box-shadow: 0 14px 28px rgba(0,0,0,0.20);
  background: #0a2e73;
}

.seg-tl {
  top: 20px;
  left: 20px;
  border-top-left-radius: 260px;
}

.seg-tr {
  top: 20px;
  right: 20px;
  border-top-right-radius: 260px;
}

.seg-bl {
  bottom: 20px;
  left: 20px;
  border-bottom-left-radius: 260px;
}

.seg-br {
  bottom: 20px;
  right: 20px;
  border-bottom-right-radius: 260px;
}

.hub-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 180px;
  height: 180px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: white;
  color: #123a84;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
  font-weight: 800;
  box-shadow: 0 10px 26px rgba(0,0,0,0.18);
  z-index: 5;
}

.hub-wrap::before,
.hub-wrap::after {
  content: "";
  position: absolute;
  background: #f5f6f8;
  z-index: 4;
  border-radius: 4px;
}

.hub-wrap::before {
  width: 20px;
  height: 100%;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

.hub-wrap::after {
  width: 100%;
  height: 20px;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
}

.disabled {
  opacity: 0.40;
  pointer-events: none;
}

@media (max-width: 700px) {
  .hub-wrap {
    width: 360px;
    height: 360px;
  }

  .hub-segment {
    width: 165px;
    height: 165px;
    padding: 16px;
  }

  .hub-segment span {
    font-size: 14px;
    max-width: 90px;
  }

  .hub-center {
    width: 120px;
    height: 120px;
    font-size: 34px;
  }

  .seg-tl,
  .seg-tr,
  .seg-bl,
  .seg-br {
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
  }

  .seg-tl {
    top: 14px;
    left: 14px;
    border-top-left-radius: 165px;
  }

  .seg-tr {
    top: 14px;
    right: 14px;
    border-top-right-radius: 165px;
  }

  .seg-bl {
    bottom: 14px;
    left: 14px;
    border-bottom-left-radius: 165px;
  }

  .seg-br {
    bottom: 14px;
    right: 14px;
    border-bottom-right-radius: 165px;
  }

  .hub-wrap::before {
    width: 14px;
  }

  .hub-wrap::after {
    height: 14px;
  }
}

.profit-mid {
  color: #b08900;
  font-weight: 700;
}

.profit-low {
  color: #c92a2a;
  font-weight: 700;
}

/* ===== Production Ledger ===== */
.production-table {
  font-size: 12px;
}

.production-table th,
.production-table td {
  white-space: nowrap;
}

.production-table td:nth-child(13),
.production-table td:nth-child(14) {
  white-space: normal;
  min-width: 220px;
}

.inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pill-status {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  margin-left: 6px;
}

.pill-status.deposit { background: #dbeafe; color: #1d4ed8; }
.pill-status.wip { background: #fef3c7; color: #92400e; }
.pill-status.ready { background: #dcfce7; color: #166534; }
.pill-status.shipped { background: #e5e7eb; color: #374151; }

.status-deposit td:first-child,
.status-deposit td:nth-child(9) { color: #1d4ed8; font-weight: 700; }

.status-wip td:first-child,
.status-wip td:nth-child(9) { color: #92400e; font-weight: 700; }

.status-ready_to_ship td:first-child,
.status-ready_to_ship td:nth-child(9) { color: #166534; font-weight: 700; }

.status-shipped td:first-child,
.status-shipped td:nth-child(9) { color: #374151; font-weight: 700; }

.production-table { font-size: 12px; }
.production-table th, .production-table td { white-space: nowrap; }
.production-table td:nth-child(14), .production-table td:nth-child(15) { white-space: normal; min-width: 220px; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.pill-status { display: inline-block; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; margin-left: 6px; }
.pill-status.deposit { background: #dbeafe; color: #1d4ed8; }
.pill-status.wip { background: #fef3c7; color: #92400e; }
.pill-status.ready { background: #dcfce7; color: #166534; }
.pill-status.shipped { background: #e5e7eb; color: #374151; }
.pill-status.canceled { background: #fee2e2; color: #991b1b; }
.prod-good { color: #166534; font-weight: 700; }
.prod-watch { color: #b45309; font-weight: 700; }
.prod-bad { color: #b91c1c; font-weight: 700; }

.hero-subtitle.left {
  margin-bottom: 0;
  text-align: left;
}

.workspace-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.info-card h3 {
  margin-top: 0;
  margin-bottom: 10px;
}

.info-card p {
  margin: 0;
  color: #475467;
  line-height: 1.5;
}

.sales-workspace-grid {
  align-items: stretch;
}

.hub-wrap-blue .seg-tl {
  background: linear-gradient(145deg, #5c8ae5, #345fad);
}

.home-sales-segment {
  background: linear-gradient(145deg, #76d98a, #3ca95b) !important;
}
.home-sales-segment:hover {
  background: linear-gradient(145deg, #62ca78, #2f934b) !important;
}

.hub-wrap-blue .seg-tr {
  background: linear-gradient(145deg, #a7b3cc, #8e9ab5);
}

.hub-wrap-blue .seg-bl {
  background: linear-gradient(145deg, #173f87, #0c2b64);
}

.hub-wrap-blue .seg-br {
  background: linear-gradient(145deg, #0f3277, #06245d);
}

.hub-wrap-green .hub-segment {
  color: #ffffff;
}

.hub-wrap-green .seg-tl {
  background: linear-gradient(145deg, #76d98a, #3ca95b);
}

.hub-wrap-green .seg-tr {
  background: linear-gradient(145deg, #62ca78, #2f934b);
}

.hub-wrap-green .seg-bl {
  background: linear-gradient(145deg, #3ca95b, #22743a);
}

.hub-wrap-green .seg-br {
  background: linear-gradient(145deg, #2d8f49, #1b6332);
}

.hub-wrap-green .hub-center {
  color: #1f7a39;
}

.sales-hub-wrap {
  margin-bottom: 30px;
}

.sales-legend-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  max-width: 1120px;
  margin: 0 auto;
}

.mini-tile {
  display: block;
  text-decoration: none;
  color: #1f2937;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.mini-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.10);
}

.mini-tile strong {
  display: block;
  margin-bottom: 6px;
  color: #176534;
}

.mini-tile span {
  display: block;
  color: #475467;
  line-height: 1.4;
}

@media (max-width: 1100px) {
  .sales-legend-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .workspace-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .sales-legend-grid {
    grid-template-columns: 1fr;
  }
}


.sales-tracking-hero {
  align-items: flex-start;
}

.ledger-status-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.sales-tracking-summary-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

.tracking-stat-card {
  min-height: 132px;
}

.tracking-stat-label {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #176534;
  margin-bottom: 8px;
}

.tracking-stat-value {
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 8px;
  color: #123a84;
}

.tracking-rank-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #eef2f7;
}

.tracking-rank-row:last-child {
  border-bottom: 0;
}

.ledger-table-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 14px;
}

.tracking-table-wrap {
  max-height: 68vh;
  overflow: auto;
}

.tracking-ledger-table {
  font-size: 12px;
}

.tracking-ledger-table thead th {
  background: #eef4fb;
  color: #29435f;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  z-index: 2;
}

.tracking-ledger-table tbody tr:nth-child(even) {
  background: #fbfcfe;
}

.tracking-ledger-table tbody tr:hover {
  background: #f4f9ff;
}

.row-index {
  color: #6b7280;
  font-weight: 700;
}

.notes-cell {
  min-width: 210px;
  white-space: normal !important;
  line-height: 1.35;
}

.status-chip {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.status-chip-deposit { background: #dbeafe; color: #1d4ed8; }
.status-chip-wip { background: #fef3c7; color: #92400e; }
.status-chip-ready_to_ship { background: #dcfce7; color: #166534; }
.status-chip-shipped { background: #e5e7eb; color: #374151; }
.status-chip-canceled { background: #fee2e2; color: #991b1b; }

.inline-form-stack {
  flex-direction: column;
  align-items: stretch;
}

.inline-form-stack select,
.inline-form-stack button {
  width: 100%;
}

.status-canceled td:first-child,
.status-canceled td:nth-child(11) {
  color: #991b1b;
  font-weight: 700;
}

@media (max-width: 1100px) {
  .sales-tracking-summary-grid {
    grid-template-columns: 1fr;
  }

  .ledger-table-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

.sales-tracking-summary-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.tracking-stat-value-small {
  font-size: 32px;
}

.tracking-table-wrap {
  overflow: auto;
}

.spreadsheet-ledger-table {
  table-layout: fixed;
  font-size: 12px;
}

.spreadsheet-ledger-table th,
.spreadsheet-ledger-table td {
  padding: 4px 6px;
  line-height: 1.15;
  vertical-align: middle;
  white-space: nowrap;
}

.spreadsheet-ledger-table th {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: #edf2f7;
}

.spreadsheet-ledger-table .notes-cell,
.spreadsheet-ledger-table .ledger-notes-cell {
  white-space: normal;
  min-width: 180px;
}

.spreadsheet-ledger-table .ledger-customer {
  font-weight: 600;
}

.spreadsheet-ledger-table .ledger-job-id {
  color: #1a4c98;
}

.ledger-canceled-row {
  background: #f3a14a30;
}

.compact-update-inline-form {
  display: flex;
  align-items: center;
  gap: 6px;
}

.compact-update-inline-form select,
.compact-update-inline-form input[type=date] {
  width: auto;
  min-width: 112px;
  padding: 4px 6px;
  font-size: 12px;
}

.compact-update-inline-form button {
  padding: 5px 8px;
  font-size: 12px;
  white-space: nowrap;
}

.small-button {
  padding: 5px 8px;
  font-size: 12px;
}

@media (max-width: 1200px) {
  .sales-tracking-summary-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 760px) {
  .sales-tracking-summary-grid-4,
  .sales-tracking-summary-grid {
    grid-template-columns: 1fr;
  }

  .compact-update-inline-form {
    flex-direction: column;
    align-items: stretch;
  }
}


.pill-status.pending { background: #eef2ff; color: #3730a3; }
.pill-status.canceled { background: #fee2e2; color: #991b1b; }

.sales-tracking-summary-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.compact-ledger-table {
  table-layout: fixed;
}

.compact-ledger-table col.col-index { width: 34px; }
.compact-ledger-table col.col-inv-date { width: 118px; }
.compact-ledger-table col.col-job-id { width: 124px; }
.compact-ledger-table col.col-customer { width: 124px; }
.compact-ledger-table col.col-notes { width: 320px; }
.compact-ledger-table col.col-salesman { width: 86px; }
.compact-ledger-table col.col-model { width: 86px; }
.compact-ledger-table col.col-state { width: 52px; }
.compact-ledger-table col.col-deposit-date { width: 108px; }
.compact-ledger-table col.col-status { width: 126px; }
.compact-ledger-table col.col-rts { width: 108px; }
.compact-ledger-table col.col-quick-update { width: 122px; }

.compact-ledger-table th,
.compact-ledger-table td {
  padding: 4px 5px;
}

.compact-ledger-table th:first-child,
.compact-ledger-table td:first-child {
  padding-left: 4px;
  padding-right: 4px;
  text-align: left;
}

.compact-ledger-table .ledger-job-link {
  color: #1a4c98;
  text-decoration: underline;
  font-weight: 700;
}

.compact-ledger-table .ledger-notes-cell,
.compact-ledger-table .notes-cell {
  width: 320px;
  min-width: 320px;
  max-width: 320px;
  white-space: normal !important;
  word-break: break-word;
}

.compact-ledger-table .ledger-customer,
.compact-ledger-table td:nth-child(6),
.compact-ledger-table td:nth-child(7),
.compact-ledger-table td:nth-child(8),
.compact-ledger-table td:nth-child(9),
.compact-ledger-table td:nth-child(11) {
  white-space: nowrap;
}

.compact-ledger-table .compact-update-inline-form {
  display: block;
}

.compact-ledger-table .compact-update-inline-form select {
  width: 100%;
  min-width: 0;
}

.cost-analysis-table .cost-group-header td {
  background: #f8fafc;
  border-top: 2px solid #d6deea;
  padding: 10px 8px;
}

.cost-group-toggle {
  background: transparent;
  color: #1f3552;
  padding: 0;
  border: 0;
  font-weight: 800;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.cost-group-toggle:hover {
  color: #123a84;
}

.cost-group-chevron {
  font-size: 14px;
  width: 12px;
  display: inline-block;
}

.cost-analysis-table tbody tr.cost-group-row:nth-child(even) {
  background: #fbfcfe;
}

@media (max-width: 1200px) {
  .sales-tracking-summary-grid-3 {
    grid-template-columns: 1fr;
  }
  .compact-ledger-table col.col-notes { width: 280px; }
  .compact-ledger-table .ledger-notes-cell,
  .compact-ledger-table .notes-cell {
    width: 280px;
    min-width: 280px;
    max-width: 280px;
  }
}

.models-overview-head,
.section-header-row,
.workspace-topbar,
.workspace-actions,
.workspace-form-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.models-overview-copy {
  max-width: 720px;
}

.models-overview-tip {
  max-width: 280px;
  text-align: right;
}

.model-admin-grid,
.workspace-main-grid,
.workspace-bom-grid {
  align-items: start;
}

.workspace-steps {
  margin: 0;
  padding-left: 18px;
}

.workspace-steps li + li {
  margin-top: 8px;
}

.workspace-shell {
  padding: 18px 20px;
}

.workspace-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.workspace-input-grid {
  gap: 14px;
}

.workspace-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.workspace-metric-card {
  background: #f7f9fc;
  border: 1px solid #e0e7f0;
  border-radius: 10px;
  padding: 12px;
}

.workspace-metric-card .kpi {
  font-size: 22px;
  margin-top: 4px;
}

.bom-paste-area {
  min-height: 220px;
}

.workspace-bom-table-wrap {
  max-height: 420px;
  overflow: auto;
}

.compact-ledger-table col.col-index { width: 24px; }
.compact-ledger-table col.col-inv-date { width: 92px; }
.compact-ledger-table col.col-job-id { width: 112px; }
.compact-ledger-table col.col-customer { width: 150px; }
.compact-ledger-table col.col-notes { width: 360px; }
.compact-ledger-table col.col-salesman { width: 86px; }
.compact-ledger-table col.col-model { width: 72px; }
.compact-ledger-table col.col-state { width: 42px; }
.compact-ledger-table col.col-deposit-date { width: 96px; }
.compact-ledger-table col.col-status { width: 96px; }
.compact-ledger-table col.col-rts { width: 96px; }
.compact-ledger-table col.col-quick-update { width: 116px; }

.compact-ledger-table th,
.compact-ledger-table td {
  padding: 5px 4px;
}

.compact-ledger-table thead th {
  letter-spacing: 0.01em;
}

.compact-ledger-table .ledger-customer {
  white-space: normal;
  word-break: break-word;
}

.compact-ledger-table td:nth-child(6),
.compact-ledger-table td:nth-child(7),
.compact-ledger-table td:nth-child(8),
.compact-ledger-table td:nth-child(9),
.compact-ledger-table td:nth-child(11) {
  white-space: nowrap;
}

.cost-analysis-table .cost-group-header td {
  background: #f7f9fc;
}

@media (max-width: 1100px) {
  .models-overview-head,
  .section-header-row,
  .workspace-topbar,
  .workspace-actions,
  .workspace-form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .models-overview-tip {
    text-align: left;
    max-width: none;
  }

  .workspace-metrics-grid {
    grid-template-columns: 1fr;
  }
}


.workspace-preview-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 18px;
}

.workspace-metrics-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.workspace-preview-table td {
  padding: 9px 0;
  border-bottom: 1px solid #eef2f7;
}

.workspace-preview-table tr:last-child td {
  border-bottom: 0;
}

.workspace-options-list {
  margin-bottom: 0;
}

@media (max-width: 1100px) {
  .workspace-preview-grid,
  .workspace-metrics-grid-4 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 780px) {
  .workspace-preview-grid,
  .workspace-metrics-grid-4 {
    grid-template-columns: 1fr;
  }
}

.hub-wrap-gray .hub-segment {
  color: #fff;
}
.hub-wrap-gray .seg-tl {
  background: linear-gradient(145deg, #8f949a, #70757b);
}
.hub-wrap-gray .seg-tr {
  background: linear-gradient(145deg, #9da2a8, #7f848a);
}
.hub-wrap-gray .seg-bl {
  background: linear-gradient(145deg, #7f848a, #666b71);
}
.hub-wrap-gray .seg-br {
  background: linear-gradient(145deg, #8b9096, #6f747a);
}
.hub-wrap-gray .hub-center {
  background: #fff;
  color: #123a84;
}
.inventory-shell .mini-tile {
  min-height: 96px;
}
.inventory-legend-grid {
  margin-top: 24px;
}
.inventory-kpis .card {
  margin-bottom: 0;
}
.print-sheet {
  background: #fff;
}

.home-sales-segment {
  background: linear-gradient(145deg, #3f9c45, #217a35);
}

.home-sales-segment:hover {
  background: linear-gradient(145deg, #47a84d, #26853a);
}


.inventory-pie-shell {
  display: flex;
  justify-content: center;
  margin: 28px 0 34px;
  padding: 8px 0 14px;
}

.inventory-pie {
  position: relative;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: conic-gradient(
    #9ea4ab 0deg 72deg,
    #878e96 72deg 144deg,
    #747b83 144deg 216deg,
    #646b72 216deg 288deg,
    #555c63 288deg 360deg
  );
  box-shadow: 0 16px 34px rgba(0,0,0,0.16);
  overflow: hidden;
}

.inventory-pie::after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18);
  pointer-events: none;
}

.inventory-slice {
  position: absolute;
  inset: 0;
  display: block;
  z-index: 2;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.inventory-slice:hover {
  transform: scale(1.02);
  filter: brightness(1.05);
}

.inventory-slice-purchase {
  clip-path: polygon(50% 50%, 50% 0%, 82% 10%, 97% 35%, 79% 52%);
}

.inventory-slice-cut {
  clip-path: polygon(50% 50%, 79% 52%, 97% 35%, 95% 72%, 68% 93%);
}

.inventory-slice-burn {
  clip-path: polygon(50% 50%, 68% 93%, 32% 93%, 5% 72%, 22% 52%);
}

.inventory-slice-reorder {
  clip-path: polygon(50% 50%, 22% 52%, 5% 72%, 3% 35%, 18% 10%);
}

.inventory-slice-transactions {
  clip-path: polygon(50% 50%, 18% 10%, 50% 0%, 82% 10%, 79% 52%, 22% 52%);
}

.inventory-label {
  position: absolute;
  z-index: 5;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 20px;
  line-height: 1.18;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0,0,0,0.28);
}

.inventory-label:hover {
  text-decoration: underline;
}

.inventory-label-purchase {
  top: 102px;
  right: 82px;
}

.inventory-label-cut {
  top: 305px;
  right: 114px;
}

.inventory-label-burn {
  bottom: 68px;
  left: 50%;
  transform: translateX(-50%);
}

.inventory-label-reorder {
  top: 294px;
  left: 70px;
}

.inventory-label-transactions {
  top: 118px;
  left: 50%;
  transform: translateX(-50%);
}

.inventory-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 182px;
  height: 182px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #fff;
  color: #1a3d80;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
  font-weight: 800;
  box-shadow: 0 12px 26px rgba(0,0,0,0.18);
  z-index: 6;
}

@media (max-width: 700px) {
  .inventory-pie {
    width: 360px;
    height: 360px;
  }

  .inventory-center {
    width: 120px;
    height: 120px;
    font-size: 34px;
  }

  .inventory-label {
    font-size: 14px;
  }

  .inventory-label-purchase {
    top: 62px;
    right: 48px;
  }

  .inventory-label-cut {
    top: 192px;
    right: 72px;
  }

  .inventory-label-burn {
    bottom: 46px;
  }

  .inventory-label-reorder {
    top: 186px;
    left: 42px;
  }

  .inventory-label-transactions {
    top: 70px;
  }

  .inventory-edit-grid {
    grid-template-columns: 1fr;
  }
}

.part-link {
  font-weight: 700;
  color: #153a7a;
  text-decoration: none;
}

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

.inventory-critical td {
  background: #fdeaea;
}

.inventory-low td {
  background: #fff2d8;
}

.inventory-near td {
  background: #fffbe0;
}

.inventory-healthy td {
  background: #eef8ee;
}

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

.inventory-edit-notes {
  grid-column: 1 / -1;
}

.inventory-edit-notes textarea {
  min-height: 120px;
  font-family: Arial, sans-serif;
}

.inventory-edit-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.queue-actions {
  justify-content: flex-start;
  margin-top: 0;
}

.print-controls {
  justify-content: flex-end;
}

@media print {
  .no-print,
  .topbar {
    display: none !important;
  }

  .container {
    padding: 0;
  }

  .card.print-sheet {
    box-shadow: none;
    margin: 0;
    padding: 0;
  }
}

@media (max-width: 700px) {
  .inventory-pie {
    width: 360px;
    height: 360px;
  }

  .inventory-center {
    width: 120px;
    height: 120px;
    font-size: 34px;
  }

  .inventory-slice span {
    font-size: 15px;
  }

  .inventory-slice-purchase span { transform: translate(84px, -78px); }
  .inventory-slice-cut span { transform: translate(110px, 36px); }
  .inventory-slice-burn span { transform: translate(0, 118px); }
  .inventory-slice-reorder span { transform: translate(-110px, 36px); }
  .inventory-slice-transactions span { transform: translate(0, -100px); }

  .inventory-edit-grid {
    grid-template-columns: 1fr;
  }
}

.inventory-hub-wrap .seg-tl {
  background: linear-gradient(145deg, #a7adb4, #8d949c);
}
.inventory-hub-wrap .seg-tr {
  background: linear-gradient(145deg, #8f969d, #767d85);
}
.inventory-hub-wrap .seg-bl {
  background: linear-gradient(145deg, #777e86, #636970);
}
.inventory-hub-wrap .seg-br {
  background: linear-gradient(145deg, #5e656d, #4d545b);
}
.inventory-hub-wrap .hub-segment:hover {
  filter: brightness(1.05);
}

.inventory-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.inventory-toolbar-search {
  flex: 1 1 320px;
}

.vendor-group {
  border: 1px solid #d9dde3;
  border-radius: 10px;
  margin-bottom: 14px;
  overflow: hidden;
  background: #fff;
}

.vendor-group summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 14px;
  font-weight: 700;
  background: #eef2f6;
}

.vendor-group summary::-webkit-details-marker {
  display: none;
}

.vendor-group summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 8px;
  transition: transform 0.15s ease;
}

.vendor-group[open] summary::before {
  transform: rotate(90deg);
}

.vendor-group table {
  margin-bottom: 0;
}

.inventory-shell .mini-tile span {
  line-height: 1.3;
}

@media (max-width: 900px) {
  .inventory-toolbar {
    align-items: stretch;
  }
  .inventory-toolbar > * {
    width: 100%;
  }
}


.cost-master-table input[type=text],
.cost-master-table input[type=number] {
  min-width: 0;
}

.cost-master-table .add-row td {
  background: #f8fafc;
}

.inventory-purchase-table {
  table-layout: fixed;
}

.inventory-purchase-table .col-part { width: 92px; }
.inventory-purchase-table .col-desc { width: 360px; }
.inventory-purchase-table .col-code { width: 70px; }
.inventory-purchase-table .col-measure { width: 80px; }
.inventory-purchase-table .col-priority { width: 72px; }
.inventory-purchase-table .col-status { width: 76px; }
.inventory-purchase-table .col-num { width: 86px; }
.inventory-purchase-table .col-cost { width: 90px; }
.inventory-purchase-table .col-notes { width: auto; }

.inventory-purchase-table td,
.inventory-purchase-table th,
.inventory-queue-table td,
.inventory-queue-table th {
  white-space: nowrap;
}

.inventory-purchase-table td:nth-child(2),
.inventory-purchase-table td:last-child,
.inventory-purchase-table th:nth-child(2),
.inventory-purchase-table th:last-child,
.inventory-queue-table td:nth-child(2),
.inventory-queue-table th:nth-child(2) {
  white-space: normal;
}

.vendor-group summary {
  padding-left: 12px;
}

.vendor-group table th,
.vendor-group table td {
  padding-left: 6px;
  padding-right: 6px;
}


.inventory-pie-five {
  width: 520px;
  height: 520px;
  background: conic-gradient(
    #9fa5ac 0deg 72deg,
    #8b929a 72deg 144deg,
    #757d86 144deg 216deg,
    #656d75 216deg 288deg,
    #545c64 288deg 360deg
  );
}

.inventory-divider {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 52%;
  background: rgba(255,255,255,0.96);
  transform-origin: center bottom;
  z-index: 4;
  border-radius: 10px;
}
.inventory-divider-v { transform: translate(-50%, -100%); }
.inventory-divider-d1 { transform: translate(-50%, -100%) rotate(72deg); }
.inventory-divider-d2 { transform: translate(-50%, -100%) rotate(-72deg); }

.inventory-slice-models { clip-path: polygon(50% 50%, 22% 52%, 3% 35%, 18% 10%, 50% 0%); }
.inventory-slice-costmaster { clip-path: polygon(50% 50%, 18% 10%, 50% 0%, 82% 10%, 79% 52%); }
.inventory-label-models { top: 102px; left: 58px; max-width: 126px; }
.inventory-label-costmaster { top: 108px; right: 78px; left: auto; max-width: 122px; }
.inventory-label-reorder { top: 298px; left: 42px; max-width: 128px; }
.inventory-label-cut { top: 308px; right: 96px; }
.inventory-label-burn { bottom: 62px; }
.inventory-center { background: #ffffff !important; }

.inventory-selectable-row { cursor: pointer; }
.inventory-selectable-row:hover td {
  box-shadow: inset 0 0 0 9999px rgba(29,95,167,0.06);
}
.inventory-row-selected td {
  box-shadow: inset 0 0 0 9999px rgba(29,95,167,0.18);
}

.inventory-purchase-table td,
.inventory-purchase-table th,
.vendor-group table td,
.vendor-group table th {
  padding-left: 8px;
  padding-right: 8px;
}

.bom-actions-cell {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
}
.bom-actions-cell .button,
.bom-actions-cell button { white-space: nowrap; }
.workspace-bom-table-wrap input[type=text],
.workspace-bom-table-wrap input[type=number] {
  min-width: 0;
}

@media (max-width: 700px) {
  .inventory-pie-five { width: 360px; height: 360px; }
  .inventory-label-models { top: 62px; left: 28px; max-width: 96px; }
  .inventory-label-costmaster { top: 68px; right: 36px; left: auto; max-width: 96px; }
  .inventory-label-reorder { top: 188px; left: 28px; max-width: 100px; }
  .inventory-label-cut { top: 196px; right: 54px; }
}

.bom-row-error td {
  background: #fdeaea !important;
}

.bom-row-warning td {
  background: #fff6db !important;
}

.bom-row-ok td {
  background: inherit;
}


.home-inventory-segment {
  background: linear-gradient(145deg, #f6df7a, #ddb83d) !important;
  color: #3f3205 !important;
}
.home-inventory-segment:hover {
  background: linear-gradient(145deg, #f0d867, #d2ab2d) !important;
}

.home-crm-segment {
  background: linear-gradient(145deg, #b9deff, #82bff5) !important;
  color: #103a63 !important;
}
.home-crm-segment:hover {
  background: linear-gradient(145deg, #abd5fb, #72b3ec) !important;
}

.hub-wrap-production .seg-tl { background: linear-gradient(145deg, #2d6cdf, #194ea9); }
.hub-wrap-production .seg-tr { background: linear-gradient(145deg, #3f82f0, #245fbe); }
.hub-wrap-production .seg-bl { background: linear-gradient(145deg, #295fc4, #173f87); }
.hub-wrap-production .seg-br { background: linear-gradient(145deg, #1e4f9f, #12356e); }
.hub-center-production { color: #184a9a; }
.production-shell .hero-subtitle { color: #4f6486; }

.hub-wrap-crm .hub-segment,
.crm-placeholder {
  background: linear-gradient(145deg, #b9deff, #82bff5);
  color: #103a63;
  cursor: default;
}
.hub-wrap-crm .hub-segment:hover { transform: none; box-shadow: 0 8px 22px rgba(0,0,0,0.14); background: linear-gradient(145deg, #b9deff, #82bff5); }
.hub-center-crm { color: #2d679b; }
.crm-shell .hero-subtitle { color: #4677a2; }

.inventory-pie-yellow {
  background: conic-gradient(
    #e0bf45 0deg 72deg,
    #e6c95a 72deg 144deg,
    #d8b73f 144deg 216deg,
    #edcf6b 216deg 288deg,
    #d4ad2d 288deg 360deg
  );
}
.inventory-center-yellow {
  color: #8f6b00;
}
.inventory-feature-row {
  max-width: 1120px;
  margin: 0 auto 18px;
}
.inventory-feature-card {
  display: block;
  text-decoration: none;
  border-radius: 18px;
  padding: 24px 26px;
  border: 1px solid #ead48a;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}
.inventory-feature-card strong {
  display: block;
  font-size: 32px;
  line-height: 1.1;
  margin-bottom: 8px;
  color: #6e5300;
}
.inventory-feature-card span {
  color: #5d5b4d;
  font-size: 15px;
}
.inventory-feature-card-primary {
  background: linear-gradient(145deg, #fff6d6, #f6e399);
}

.table-wrap {
  overflow: auto;
}

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

.parts-pull-card {
  background: linear-gradient(180deg, #f7fbff 0%, #ffffff 100%);
  max-width: 1100px;
  margin: 0 auto;
}
.parts-pull-toolbar {
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.parts-pull-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.parts-pull-header {
  margin-top: 10px;
  margin-bottom: 12px;
  text-align: center;
}
.parts-pull-brand {
  font-size: 28px;
  font-weight: 800;
  color: #2d4d7f;
}
.parts-pull-model {
  font-size: 18px;
  font-weight: 700;
  color: #4b5d73;
}
.parts-pull-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.parts-pull-chip {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid #cfe0f5;
  background: #f6fbff;
  color: #365f9f;
  font-weight: 700;
  text-decoration: none;
}
.parts-pull-chip.active {
  background: #365f9f;
  color: #fff;
  border-color: #365f9f;
}
.parts-pull-sheet {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
  align-items: start;
}
.parts-pull-group {
  break-inside: avoid;
  page-break-inside: avoid;
}
.parts-pull-group-title {
  background: #365f9f;
  color: #fff;
  padding: 8px 12px;
  border-radius: 10px 10px 0 0;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 13px;
}
.parts-pull-table {
  width: 100%;
  border: 1px solid #d7e2f1;
  border-top: 0;
  table-layout: fixed;
  font-size: 13px;
}
.parts-pull-table thead th {
  background: #eef5ff;
  font-size: 12px;
  padding: 7px 8px;
}
.parts-pull-table td {
  padding: 6px 8px;
  vertical-align: top;
}
.parts-pull-table tbody tr:nth-child(even) {
  background: #fbfdff;
}
.parts-pull-table .check-col {
  width: 34px;
  text-align: center;
}
.parts-pull-table .qty-col {
  width: 54px;
  text-align: center;
}
.parts-pull-table .part-col {
  width: 88px;
}
.parts-pull-table .note-col {
  width: 100px;
}
.print-checkbox {
  display: none;
  width: 14px;
  height: 14px;
  border: 1.4px solid #444;
  border-radius: 2px;
}
@media (max-width: 980px) {
  .parts-pull-sheet {
    grid-template-columns: 1fr;
  }
}
@media print {
  @page {
    size: letter portrait;
    margin: 0.35in;
  }
  body {
    background: #fff;
  }
  .no-print,
  nav,
  .flash-container,
  .topbar,
  .sidebar {
    display: none !important;
  }
  .content,
  .page,
  .card,
  .parts-pull-card {
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: 0 !important;
    background: #fff !important;
    max-width: none !important;
  }
  .parts-pull-brand {
    font-size: 18px;
    color: #000;
  }
  .parts-pull-model {
    font-size: 12px;
    color: #000;
  }
  .parts-pull-sheet {
    gap: 10px 12px;
  }
  .parts-pull-group-title {
    background: #dfe8f4 !important;
    color: #000 !important;
    border: 1px solid #8aa3c4;
    border-bottom: 0;
    font-size: 11px;
    padding: 5px 8px;
  }
  .parts-pull-table {
    font-size: 10px;
  }
  .parts-pull-table thead th,
  .parts-pull-table td {
    padding: 4px 5px;
  }
  .parts-pull-table input[type='checkbox'] {
    display: none !important;
  }
  .print-checkbox {
    display: inline-block;
  }
}

.schedule-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.production-schedule-table td:nth-child(4),
.production-schedule-table td:nth-child(10) {
  min-width: 220px;
  white-space: normal;
}

@media (max-width: 1100px) {
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .grid-4 {
    grid-template-columns: 1fr;
  }
  .inventory-feature-card strong {
    font-size: 24px;
  }
}

.production-schedule-table {
  min-width: 1120px;
}

.production-schedule-table td {
  vertical-align: middle;
}

.schedule-description {
  min-width: 180px;
  white-space: normal;
}

.schedule-static-cell {
  white-space: nowrap;
  font-weight: 700;
  color: #5c6470;
}

.schedule-cell-input {
  min-width: 88px;
  width: 100%;
  padding: 6px 8px;
  font-size: 12px;
}

.schedule-notes-input {
  min-width: 220px;
}

.schedule-action-cell {
  min-width: 82px;
}

.schedule-action-cell form {
  margin: 0;
}


.users-grid { align-items: start; }
.permissions-editor { display: grid; gap: 12px; margin: 14px 0 18px; }
.permission-card { border: 1px solid #d9e1ec; border-radius: 10px; padding: 12px; background: #fafcff; }
.permission-card.compact { margin-top: 8px; }
.permission-module, .permission-all { display: block; font-weight: 700; margin-bottom: 8px; }
.permission-children { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; font-size: 13px; }
.permission-details { margin-top: 8px; }
.permission-details summary { cursor: pointer; color: #1d5fa7; font-weight: 700; }
.permission-edit-form { margin-top: 10px; }
@media (max-width: 900px) { .permission-children { grid-template-columns: 1fr; } }


.crm-page h1 { margin: 0; }
.page-head { display:flex; justify-content:space-between; gap:16px; align-items:flex-start; margin-bottom:16px; flex-wrap:wrap; }
.button-row { display:flex; gap:10px; flex-wrap:wrap; }
.crm-dashboard-cards { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-bottom:18px; }
.crm-metric-card { background:white; border-radius:10px; padding:18px; box-shadow:0 1px 3px rgba(0,0,0,.08); text-decoration:none; color:#222; }
.crm-metric-card:hover { transform:translateY(-1px); }
.metric-label { color:#5d6b82; font-size:14px; }
.metric-value { font-size:30px; font-weight:800; margin-top:6px; }
.crm-filter-grid, .crm-form-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; }
.crm-form-grid.compact { grid-template-columns:repeat(2,1fr); }
.crm-form-grid .full { grid-column:1 / -1; }
.crm-tabs-grid { display:grid; grid-template-columns:1.1fr 0.9fr; gap:18px; }
.crm-meta-block { margin-top:16px; display:grid; grid-template-columns:repeat(2,1fr); gap:10px; }
.crm-timeline { margin-top:16px; display:flex; flex-direction:column; gap:12px; }
.crm-timeline-item { border-top:1px solid #e6e6e6; padding-top:10px; }
.crm-timeline-meta { font-size:12px; color:#5d6b82; margin-bottom:4px; }
.small-btn { padding:6px 10px; font-size:12px; }
.crm-card-list { display:none; }
.lookup-columns { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }
.lookup-list { list-style:none; margin:10px 0 0; padding:0; display:flex; flex-direction:column; gap:8px; }
.inline-add { display:flex; gap:8px; }
.inline-add input { flex:1; }
@media (max-width: 1100px) { .crm-dashboard-cards { grid-template-columns:repeat(2,1fr);} .crm-tabs-grid { grid-template-columns:1fr; } .crm-filter-grid, .crm-form-grid { grid-template-columns:repeat(2,1fr);} .lookup-columns { grid-template-columns:1fr; } }
@media (max-width: 840px) { .desktop-table { display:none; } .crm-card-list { display:block; } .crm-lead-card { margin-bottom:12px; } .crm-card-title { font-size:18px; font-weight:700; margin-bottom:4px; } .crm-card-meta { color:#5d6b82; font-size:13px; margin-bottom:10px; } .crm-card-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:8px; margin-bottom:12px; } .crm-filter-grid, .crm-form-grid, .crm-form-grid.compact, .crm-meta-block { grid-template-columns:1fr; } .crm-dashboard-cards { grid-template-columns:1fr; } }


.crm-hub-wrap { margin-bottom: 28px; }
.crm-shell .crm-dashboard-cards { margin-top: 8px; }
.crm-shell .crm-metric-card { text-align: left; }
@media (max-width: 840px) {
  .crm-shell .hub-wrap { margin-bottom: 18px; }
}


.crm-filter-grid-wide { grid-template-columns: 2fr 2fr 1.2fr 1.2fr 1.2fr auto; align-items:end; }
.crm-pagination { display:flex; justify-content:flex-end; align-items:center; gap:12px; margin-top:14px; }
.crm-page-status { color:#5d6b82; font-weight:600; }
.crm-detail-stack { display:flex; flex-direction:column; gap:18px; }
.crm-notes-panel { background:#eef5ff; border:1px solid #d7e6fb; }
.crm-notes-panel h3 { margin-bottom:10px; }
@media (max-width: 1100px) { .crm-filter-grid-wide { grid-template-columns:repeat(2,1fr); } }
@media (max-width: 840px) { .crm-filter-grid-wide { grid-template-columns:1fr; } }

/* Inventory five-slice spacing refinements */
.inventory-divider-d3 { transform: translate(-50%, -100%) rotate(144deg); }
.inventory-divider-d4 { transform: translate(-50%, -100%) rotate(-144deg); }
.inventory-label-models { top: 98px; left: 72px; max-width: 110px; text-align:center; }
.inventory-feature-row { display:flex; gap:14px; flex-wrap:wrap; }
.inventory-feature-row .inventory-feature-card { flex:1 1 280px; }
@media (max-width: 700px) {
  .inventory-label-models { top: 64px; left: 38px; max-width: 82px; }
}

/* Spreadsheet-style operations pages */
.spreadsheet-shell { overflow:hidden; }
.spreadsheet-table thead th { font-size:12px; line-height:1.15; white-space:nowrap; }
.spreadsheet-table tbody td { vertical-align:middle; }
.spreadsheet-table input[type=number],
.spreadsheet-table input[type=date],
.spreadsheet-table .sheet-select {
  min-width:90px;
  width:100%;
  padding:6px 8px;
  border:1px solid #cfd7e6;
  border-radius:6px;
  background:#fff;
}
.spreadsheet-table .sheet-select { min-width:140px; }
.spreadsheet-table .calc-col {
  background:#e5f5e3;
  font-weight:700;
  text-align:center;
}
.spreadsheet-table .notes-col { min-width:120px; color:#5d6b82; }
.spreadsheet-table .sheet-actions {
  display:flex;
  gap:8px;
  align-items:center;
  min-width:130px;
}
.spreadsheet-table .sheet-actions form { margin:0; }
.weights-sheet .calc-col, .assembly-sheet .calc-col { box-shadow: inset 0 0 0 9999px rgba(81, 147, 88, 0.14); }
@media (max-width: 1100px) {
  .spreadsheet-table .sheet-select { min-width:120px; }
}


.crm-detail-single { display:block; }
.crm-notes-panel { margin-top:16px; background:linear-gradient(180deg,#f1f7ff 0%, #ffffff 85%); border:1px solid #d7e5fb; }
.danger-zone { border:1px solid #f2d2d2; background:#fff8f8; }
.button.danger { background:#c33a3a; color:#fff; }
.button.danger:hover { background:#a92f2f; }
.series-sheet-stack { display:flex; flex-direction:column; gap:16px; }
.series-sheet-card { overflow:hidden; }
.series-sheet-head { padding:10px 12px; border-bottom:1px solid #dde6f1; }
.series-sheet-card.tint-1 .series-sheet-head { background:#eef5ff; }
.series-sheet-card.tint-2 .series-sheet-head { background:#eef8f0; }
.series-sheet-card.tint-3 .series-sheet-head { background:#fff6ea; }
.series-sheet-card.tint-4 .series-sheet-head { background:#f7eefb; }
.series-sheet-card .table-wrap { padding:0 0 6px 0; }
.series-sheet-card .spreadsheet-table thead th { position:sticky; top:0; background:#f8fbff; z-index:2; }


.build-pill{display:inline-block;margin-left:10px;padding:2px 8px;border-radius:999px;background:rgba(255,255,255,.15);font-size:12px;font-weight:600;vertical-align:middle;}
.crm-discount-card{margin-top:18px;}
.crm-discount-summary{margin-top:12px;padding:10px 12px;border-radius:10px;background:#f3f6fb;}
.crm-discount-summary.success{border-left:4px solid #2f855a;}
.crm-discount-summary.danger{border-left:4px solid #c53030;background:#fff5f5;}


/* 2026-04-14 corrective spacing and CRM access tiles */
.inventory-label-costmaster { top: 98px; left: 62px; right: auto; max-width: 108px; text-align: center; }
.inventory-label-models { top: 96px; right: 74px; left: auto; max-width: 110px; text-align: center; }
.inventory-label-reorder { top: 306px; left: 56px; max-width: 118px; text-align: center; }
@media (max-width: 700px) {
  .inventory-label-costmaster { top: 64px; left: 30px; max-width: 86px; }
  .inventory-label-models { top: 62px; right: 36px; left: auto; max-width: 86px; }
  .inventory-label-reorder { top: 202px; left: 24px; max-width: 92px; }
}
.crm-quick-links { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:14px; margin-top:18px; }
.tile-disabled { opacity:0.72; }
.tile-disabled:hover { transform:none; }
@media (max-width: 840px) {
  .crm-quick-links { grid-template-columns:1fr; }
}


/* 2026-04-15 inventory click-map and layout corrections */
.inventory-slice-map{position:absolute;inset:0;z-index:3;}
.inventory-slice-map a{cursor:pointer;}
.inventory-svg-slice{fill:rgba(255,255,255,0.001);pointer-events:all;}
.inventory-svg-slice:hover{fill:rgba(255,255,255,0.10);}
.inventory-label{z-index:5;pointer-events:none;}
.inventory-center{z-index:6;}
.inventory-label-costmaster{top:96px;left:26%;right:auto;max-width:126px;text-align:center;transform:translateX(-50%);}
.inventory-label-models{top:100px;left:74%;right:auto;max-width:126px;text-align:center;transform:translateX(-50%);}
.inventory-label-reorder{top:286px;left:42px;max-width:132px;text-align:center;}
.inventory-label-cut{top:294px;right:88px;text-align:center;}
.inventory-label-burn{bottom:40px;left:50%;transform:translateX(-50%);text-align:center;}
@media (max-width:700px){
  .inventory-label-costmaster{top:64px;left:26%;right:auto;max-width:104px;transform:translateX(-50%);}
  .inventory-label-models{top:64px;left:74%;right:auto;max-width:104px;transform:translateX(-50%);}
  .inventory-label-reorder{top:198px;left:20px;max-width:108px;}
  .inventory-label-cut{top:200px;right:46px;}
  .inventory-label-burn{bottom:26px;}
}
.sales-ledger-add-panel[hidden]{display:none !important;}
.sales-ledger-add-toggle{margin-bottom:14px;display:flex;justify-content:flex-end;}
.crm-quick-links .mini-tile.tile-disabled{pointer-events:none;}

.workspace-page-title{font-size:2rem;font-weight:800;letter-spacing:.04em;text-transform:uppercase;color:#1f3b73;margin-bottom:6px;}
.workspace-model-title{font-size:1.55rem;margin:0;}
.sale-options-block{margin-top:16px;padding:14px;border:1px solid #d8dee7;border-radius:14px;background:#f8fafc;}
.sale-option-rows{display:flex;flex-direction:column;gap:10px;}
.sale-option-row{display:grid;grid-template-columns:minmax(260px,1fr) 110px auto;gap:10px;align-items:center;}
.inventory-import-form .grid-3{align-items:end;}

.compact-stats-grid{gap:10px;}
.mini-stat{border:1px solid #d8dee7;border-radius:14px;padding:12px;background:#f8fafc;}
.mini-stat .k{font-size:.78rem;text-transform:uppercase;letter-spacing:.05em;color:#607086;}
.mini-stat .v{font-size:1.2rem;font-weight:800;color:#1f3b73;margin-top:4px;}


.cost-analysis-table td.left,
.cost-analysis-table th.left {
  text-align: left;
}
