/* Starkwood ONE v2.1.56 — Client Database updated-prototype enhancement */

/* Starkwood ONE v2.1.56 — Client Database header/report-control layout fix */

.sw-cd-titleblock-v2156 {
  position: relative;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 22px;
  row-gap: 3px;
  align-items: start;
  min-height: 0;
  padding-right: 0 !important;
  margin-bottom: 18px;
  box-sizing: border-box;
}

.sw-cd-titleblock-v2156 > h1,
.sw-cd-titleblock-v2156 > h2 {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  margin-bottom: 0;
}

.sw-cd-titleblock-v2156 > p {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  max-width: 100%;
  margin-top: 0;
  margin-bottom: 0;
  overflow-wrap: anywhere;
}

.sw-cd-report-controls {
  position: static;
  grid-column: 2;
  grid-row: 1 / span 2;
  display: grid;
  grid-template-columns: minmax(182px, auto) 106px 98px;
  align-items: stretch;
  gap: 9px;
  justify-self: end;
  margin: 0;
  z-index: 2;
}

.sw-cd-report-controls.sw-cd-no-actions {
  display: none;
}

.sw-cd-period-select {
  width: 106px;
  min-width: 106px;
  height: 48px;
  margin: 0;
  border: 1px solid #dbe3ef;
  border-radius: 9px;
  padding: 0 10px;
  background: #fff;
  color: #334155;
  font: 500 12px/1 Arial, sans-serif;
  outline: none;
}

.sw-cd-period-select:focus {
  border-color: #2f59e8;
  box-shadow: 0 0 0 3px rgba(47, 89, 232, .12);
}

.sw-cd-download-button,
.sw-cd-generate-button,
.sw-cd-print-button,
.sw-cd-close-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 9px;
  font: 700 12px/1.2 Arial, sans-serif;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
  box-sizing: border-box;
}

.sw-cd-download-button {
  width: 100%;
  min-width: 182px;
  min-height: 48px;
  padding: 7px 12px;
  border: 1px solid #18a56d;
  background: #fff;
  color: #07965e;
  text-align: center;
  white-space: nowrap;
}

.sw-cd-download-button svg {
  flex: 0 0 auto;
}

.sw-cd-download-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  line-height: 1.05;
}

.sw-cd-download-copy strong {
  font-size: 12px;
  line-height: 14px;
}

.sw-cd-download-copy small {
  font-size: 9px;
  line-height: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.sw-cd-generate-button {
  width: 98px;
  min-width: 98px;
  min-height: 48px;
  margin: 0;
  border: 0;
  padding: 0 10px;
  background: #2f59e8;
  color: #fff;
  box-shadow: 0 8px 18px rgba(47, 89, 232, .16);
  text-align: center;
}

.sw-cd-download-button:hover,
.sw-cd-generate-button:hover,
.sw-cd-print-button:hover {
  transform: translateY(-1px);
}

.sw-cd-download-button:hover {
  box-shadow: 0 8px 18px rgba(7, 150, 94, .12);
}

.sw-cd-generate-button:hover,
.sw-cd-print-button:hover {
  box-shadow: 0 10px 22px rgba(47, 89, 232, .22);
}

.sw-cd-download-button:disabled,
.sw-cd-generate-button:disabled {
  cursor: wait;
  opacity: .72;
  transform: none;
}

.sw-cd-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.sw-cd-button-spinner {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255,255,255,.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: swCdSpin .7s linear infinite;
}

.sw-cd-button-spinner-green {
  border-color: rgba(7,150,94,.28);
  border-top-color: #07965e;
}

@keyframes swCdSpin { to { transform: rotate(360deg); } }

/* Updated prototype report viewer */
.sw-cd-modal {
  position: fixed;
  inset: 0;
  z-index: 1000200;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  background: rgba(11, 23, 57, .65);
  overflow: hidden;
  isolation: isolate;
}

.sw-cd-doc-toolbar {
  width: min(842px, 100vw);
  min-height: 50px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-sizing: border-box;
  flex: 0 0 auto;
}

.sw-cd-doc-title {
  min-width: 0;
  color: #fff;
  font: 700 14px/20px Arial, sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sw-cd-doc-title span {
  margin-left: 7px;
  color: rgba(255,255,255,.62);
  font-size: 10px;
  font-weight: 400;
}

.sw-cd-doc-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.sw-cd-print-button,
.sw-cd-close-button {
  min-height: 34px;
  padding: 0 12px;
}

.sw-cd-print-button {
  border: 0;
  background: #2f59e8;
  color: #fff;
  box-shadow: 0 8px 18px rgba(47, 89, 232, .16);
}

.sw-cd-close-button {
  border: 1px solid #fff;
  background: #fff;
  color: #334155;
  box-shadow: none;
}

.sw-cd-doc-area {
  width: 842px;
  max-width: 100vw;
  max-height: calc(100vh - 50px);
  overflow: auto;
  padding: 24px 24px 0;
  box-sizing: border-box;
  background: #d7dce6;
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-overflow-scrolling: touch;
}

.sw-cd-a4-page {
  width: 794px;
  min-height: 1123px;
  padding: 76px;
  margin: 0 0 24px;
  box-sizing: border-box;
  flex: 0 0 auto;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15,23,42,.22);
  color: #0b1739;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  line-height: 1.42;
}

.sw-cd-report-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.sw-cd-report-head h2 {
  margin: 0;
  color: #0b1739;
  font-size: 16px;
  line-height: 22px;
  font-weight: 700;
}

.sw-cd-report-head p {
  margin: 2px 0 0;
  color: #94a3b8;
  font-size: 10px;
  line-height: 14px;
}

.sw-cd-report-head time {
  color: #94a3b8;
  font-size: 10px;
  line-height: 14px;
  white-space: nowrap;
}

.sw-cd-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0;
}

.sw-cd-summary-chip {
  min-width: 100px;
  padding: 6px 12px;
  border-radius: 8px;
  background: #f7f9fc;
  box-sizing: border-box;
}

.sw-cd-summary-chip > div {
  color: #94a3b8;
  font-size: 8.5px;
  line-height: 12px;
  letter-spacing: .3px;
  text-transform: uppercase;
}

.sw-cd-summary-chip strong {
  display: block;
  margin-top: 1px;
  color: #0b1739;
  font-size: 13px;
  line-height: 18px;
}

.sw-cd-empty-report {
  padding: 8px 0;
  color: #cbd2e0;
  font-size: 11px;
}

.sw-cd-report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 9px;
  line-height: 13px;
}

.sw-cd-report-table th {
  padding: 3px 4px;
  border-bottom: 1.5px solid #1e293b;
  color: #334155;
  text-align: left;
  font-weight: 700;
}

.sw-cd-report-table td {
  padding: 2.5px 4px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: top;
}

.sw-cd-report-table th:nth-child(1),
.sw-cd-report-table td:nth-child(1),
.sw-cd-report-table th:nth-child(3),
.sw-cd-report-table td:nth-child(3),
.sw-cd-report-table th:nth-child(4),
.sw-cd-report-table td:nth-child(4),
.sw-cd-report-table th:nth-child(5),
.sw-cd-report-table td:nth-child(5) {
  white-space: nowrap;
}

.sw-cd-report-footer {
  margin-top: 12px;
  padding-top: 6px;
  border-top: 1px solid #e2e8f0;
  color: #94a3b8;
  font-size: 8.5px;
  line-height: 12px;
  text-align: center;
}

@media (max-width: 1180px) {
  .sw-cd-titleblock-v2156 {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    row-gap: 4px;
  }

  .sw-cd-titleblock-v2156 > h1,
  .sw-cd-titleblock-v2156 > h2 {
    grid-column: 1;
    grid-row: 1;
  }

  .sw-cd-titleblock-v2156 > p {
    grid-column: 1;
    grid-row: 2;
  }

  .sw-cd-report-controls {
    grid-column: 1;
    grid-row: 3;
    width: min(100%, 420px);
    margin-top: 13px;
    justify-self: end;
  }
}

@media (max-width: 700px) {
  .sw-cd-titleblock-v2156 {
    margin-bottom: 14px;
  }

  .sw-cd-report-controls {
    width: 100%;
    grid-template-columns: 1fr;
    align-items: stretch;
    justify-self: stretch;
  }

  .sw-cd-download-button,
  .sw-cd-period-select,
  .sw-cd-generate-button {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    height: 44px;
    margin: 0;
  }

  .sw-cd-download-copy {
    flex-direction: row;
    gap: 6px;
  }

  .sw-cd-download-copy small {
    white-space: normal;
  }

  .sw-cd-generate-button span br {
    display: none;
  }

  .sw-cd-modal {
    padding-top: 0;
  }

  .sw-cd-doc-toolbar {
    padding: 0 10px;
  }

  .sw-cd-doc-title span {
    display: none;
  }

  .sw-cd-doc-actions {
    gap: 6px;
  }

  .sw-cd-print-button,
  .sw-cd-close-button {
    padding: 0 9px;
  }

  .sw-cd-doc-area {
    max-height: calc(100vh - 50px);
    padding: 16px 12px 0;
  }
}

@media print {
  @page { size: A4; margin: .5in; }

  body * {
    visibility: hidden !important;
  }

  #sw-client-db-print-root,
  #sw-client-db-print-root * {
    visibility: visible !important;
  }

  #sw-client-db-print-root {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    max-width: none !important;
    max-height: none !important;
    overflow: visible !important;
    display: block !important;
    padding: 0 !important;
    background: none !important;
  }

  .sw-cd-a4-page {
    width: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
  }

  .sw-cd-doc-toolbar {
    display: none !important;
  }

  .sw-cd-report-table tr {
    break-inside: avoid;
  }

  body {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
