.isp-wrap {
  max-width: 640px;
}

/* Prince WA conditional notice -- same light-red palette as the portal's
   existing .flash-msg--danger (app_v2.css), just scoped/sized for an
   inline under-field notice instead of a page-level banner. */
.isp-prince-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: -6px 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fef2f2;
  border: 1px solid rgba(220, 38, 38, 0.35);
  color: #7f1d1d;
  font-size: 13px;
  line-height: 1.4;
  max-width: 100%;
  box-sizing: border-box;
}

.isp-prince-notice-icon {
  flex: 0 0 auto;
  margin-top: 1px;
  color: #b42318;
}

.isp-toolbar-row {
  gap: 8px;
}

.isp-new-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 90, 0, 0.22);
  background: rgba(255, 90, 0, 0.07);
  color: #ff5a00;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.isp-new-btn:hover {
  background: rgba(255, 90, 0, 0.12);
  border-color: rgba(255, 90, 0, 0.28);
}

.isp-status-group {
  margin-bottom: 12px;
}

.isp-status-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 13px 16px;
  cursor: pointer;
  text-align: left;
}

.isp-status-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.isp-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.isp-status-name {
  font-weight: 700;
  font-size: 14px;
}

.isp-count {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
}

.isp-status-body {
  display: grid;
  gap: 10px;
  padding: 10px 0 4px;
}

.isp-card-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 12px;
}

.isp-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border: 1px solid rgba(17, 17, 17, 0.1);
  border-radius: 999px;
  background: #f2f2f2;
}

.isp-pill--accent {
  color: #ff5a00;
  background: rgba(255, 90, 0, 0.07);
  border-color: rgba(255, 90, 0, 0.14);
}

.isp-details-panel {
  background: #ffffff;
  border: 1px solid rgba(255, 90, 0, 0.22);
}

.isp-details-head {
  border-bottom-color: rgba(255, 90, 0, 0.18);
}

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

.isp-detail-box {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 90, 0, 0.14);
  border-radius: 14px;
  padding: 12px;
}

.isp-table-wrap {
  overflow-x: auto;
  margin-top: 14px;
  border: 1px solid rgba(255, 90, 0, 0.18);
  border-radius: 14px;
  background: #fff;
}

.isp-subitem-group {
  margin-top: 14px;
}

.isp-subitem-group:first-child {
  margin-top: 0;
}

.isp-subitem-group-title {
  font-size: 13px;
  font-weight: 700;
  color: rgba(120, 53, 15, 0.75);
  margin-bottom: 6px;
}

.isp-subitem-group .isp-table-wrap {
  margin-top: 0;
}

.isp-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 13px;
}

.isp-table th,
.isp-table td {
  text-align: left;
  padding: 9px;
  border-bottom: 1px solid rgba(255, 90, 0, 0.12);
  vertical-align: top;
}

.isp-table th {
  color: rgba(22, 53, 96, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10px;
}

/* New ISP Report modal: uniform vertical rhythm. Every direct field/
   section of .isp-form (Email, Customer, Date, Production codes,
   Photos/files) uses the same bottom margin as .locates-field's own
   14px -- .isp-codes-section and .isp-files-section didn't have this
   before, so they sat flush against whatever came before/after them.
   The Submit button gets extra breathing room so it never looks stuck
   to the file-upload block right above it. */
.isp-form > .isp-codes-section,
.isp-form > .isp-files-section {
  margin-bottom: 14px;
}

.isp-form > .locates-actions {
  margin-top: 18px;
}

.isp-codes-section {
  border: 1px solid rgba(17, 17, 17, 0.1);
  border-radius: 17px;
  padding: 12px;
  background: #fbfbfc;
}

.isp-codes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.isp-codes-label {
  font-weight: 700;
  font-size: 14px;
}

.isp-codes-help {
  color: rgba(17, 17, 17, 0.45);
  font-size: 12px;
  line-height: 1.35;
}

.isp-mini-btn {
  border: 1px solid rgba(17, 17, 17, 0.1);
  border-radius: 999px;
  background: #fff;
  color: #ff5a00;
  padding: 9px 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.isp-code-rows {
  display: grid;
  gap: 9px;
}

.isp-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 8px;
  align-items: end;
}

.isp-code-remove {
  height: 44px;
  border: 1px solid rgba(17, 17, 17, 0.1);
  border-radius: 12px;
  background: #fff;
  color: #b42318;
  font-weight: 900;
  cursor: pointer;
}

.isp-code-preview {
  grid-column: 1 / -1;
  color: rgba(17, 17, 17, 0.45);
  font-size: 12px;
  line-height: 1.35;
  padding: 0 2px;
}

.isp-form-state {
  margin-bottom: 12px;
}

/* SURF MI fixed checkbox codes -- same card language as .isp-codes-section
   (Prince's searchable rows), just a checkbox list instead of a select. */
.isp-surf-code-list {
  display: grid;
  gap: 6px;
}

.isp-surf-code-row {
  display: grid;
  grid-template-columns: auto 1fr 64px;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid rgba(17, 17, 17, 0.06);
  cursor: pointer;
}

.isp-surf-code-row:last-child {
  border-bottom: none;
}

.isp-surf-code-label {
  font-size: 13px;
}

.surf-code-qty {
  width: 64px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(17, 17, 17, 0.12);
  padding: 0 8px;
  font-size: 13px;
}

.isp-files-section {
  border: 1px solid rgba(17, 17, 17, 0.1);
  border-radius: 17px;
  padding: 12px;
  background: #fbfbfc;
  display: grid;
  gap: 8px;
}

/* Styled upload area -- native input is visually hidden (never
   display:none, so it stays focusable/keyboard-operable); the visible
   "Upload files" button is its <label>, and the same zone doubles as a
   drag/drop target. Cumulative selection + per-file remove happen in JS
   against the same selectedFiles array/backend flow as before -- this is
   a styling layer only. */
.isp-upload-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  padding: 20px 14px;
  border: 1.5px dashed rgba(17, 17, 17, 0.16);
  border-radius: 14px;
  background: #fff;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.isp-upload-zone.is-dragover {
  border-color: #ff5a00;
  background: rgba(255, 90, 0, 0.05);
}

.isp-upload-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.isp-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(255, 90, 0, 0.09);
  border: 1px solid rgba(255, 90, 0, 0.22);
  color: #ff5a00;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.isp-upload-btn:hover {
  background: rgba(255, 90, 0, 0.15);
}

.isp-upload-input:focus-visible + .isp-upload-btn {
  outline: 2px solid #ff5a00;
  outline-offset: 2px;
}

.isp-upload-hint {
  font-size: 12px;
  color: rgba(17, 17, 17, 0.4);
}

.isp-files-list {
  display: grid;
  gap: 6px;
}

.isp-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(17, 17, 17, 0.08);
  font-size: 12.5px;
}

.isp-file-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.isp-file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.isp-file-size {
  font-size: 11px;
  color: rgba(17, 17, 17, 0.4);
}

.isp-file-remove {
  flex: 0 0 auto;
  border: 1px solid rgba(180, 35, 24, 0.2);
  border-radius: 999px;
  background: rgba(180, 35, 24, 0.06);
  color: #b42318;
  font-weight: 700;
  cursor: pointer;
  font-size: 12px;
  padding: 6px 12px;
}

.isp-file-remove:hover {
  background: rgba(180, 35, 24, 0.12);
}

@media (max-width: 520px) {
  .isp-new-btn {
    height: 40px;
    padding: 0 12px;
  }

  .isp-detail-grid,
  .isp-code-row {
    grid-template-columns: 1fr;
  }
}
/* New ISP report modal: bottom padding + no horizontal scroll */
.isp-new-modal {
  padding-bottom: 88px;
  overflow-x: hidden;
}

.isp-new-modal * {
  max-width: 100%;
  box-sizing: border-box;
}

.isp-new-wrap {
  overflow-x: hidden;
}
/* New ISP Report: fix date input width */
.isp-new-modal #reportDate {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* ISP modals: bottom space + prevent horizontal scrolling */
.isp-details-panel,
.isp-new-modal {
  padding-bottom: 88px;
  overflow-x: hidden;
}

.isp-details-wrap,
.isp-new-wrap {
  overflow-x: hidden;
}

.isp-details-panel *,
.isp-new-modal * {
  max-width: 100%;
  box-sizing: border-box;
}

.isp-details-panel #miDetailsBody {
  padding-bottom: 50px;
  overflow-x: hidden;
}

/* New ISP Report: keep date input inside modal */
.isp-new-modal #reportDate,
.isp-new-modal input[type="date"],
.isp-new-modal input[type="datetime-local"],
.isp-new-modal input[type="time"],
.isp-new-modal select,
.isp-new-modal textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: block;
  box-sizing: border-box;
}

/* New report unit-code rows */
.isp-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 8px;
  align-items: end;
}

.isp-code-preview {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: rgba(17, 17, 17, 0.45);
  font-size: 12px;
  line-height: 1.35;
  padding: 0 2px;
}

.isp-code-preview-text {
  min-width: 0;
}

.isp-code-remove-text {
  appearance: none;
  border: 0;
  background: transparent;
  color: #b42318;
  padding: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  cursor: pointer;
}

.isp-code-remove-text:hover {
  text-decoration: underline;
}

.isp-report-total {
  margin: 4px 0 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(31, 143, 77, 0.10);
  border: 1px solid rgba(31, 143, 77, 0.22);
  color: #1f8f4d;
  font-size: 14px;
  font-weight: 800;
}

@media (max-width: 520px) {
  .isp-code-row {
    grid-template-columns: 1fr;
  }

  .isp-codes-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Details modal tables must fit the panel (max-width: 640px) without horizontal
   scroll at any viewport width, not just under the 520px phone breakpoint. */
.isp-details-panel .isp-table-wrap {
  overflow-x: hidden;
}

.isp-details-panel .isp-table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}

.isp-details-panel .isp-table th,
.isp-details-panel .isp-table td {
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Extra breathing room before the "Leave an update" block, which otherwise
   sits right under the last table/updates section. */
.isp-update-form {
  margin-top: 26px;
}

/* Styled vertical scrollbar for the report details panel. */
.isp-details-panel #miDetailsBody {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 90, 0, 0.35) transparent;
}

.isp-details-panel #miDetailsBody::-webkit-scrollbar {
  width: 8px;
}

.isp-details-panel #miDetailsBody::-webkit-scrollbar-track {
  background: transparent;
}

.isp-details-panel #miDetailsBody::-webkit-scrollbar-thumb {
  background-color: rgba(255, 90, 0, 0.35);
  border-radius: 999px;
}

.isp-details-panel #miDetailsBody::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 90, 0, 0.55);
}
