.detail-page {
  color: #1f2937;
}

.detail-heading {
  margin-bottom: 18px;
}

.detail-heading h1 {
  color: #181f2a;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: #666f7e;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.back-link:hover {
  color: #c50000;
}

.summary-strip {
  display: grid;
  grid-template-columns: 1.2fr 2.25fr 1.35fr 1.35fr 1.25fr 1.25fr;
  gap: 28px;
  margin-bottom: 19px;
  border: 1px solid #e1e6ee;
  border-radius: 7px;
  background: #fff;
  padding: 21px 20px 22px;
  box-shadow: 0 4px 15px rgba(15, 23, 42, 0.05);
}

.summary-strip div {
  min-width: 0;
}

.summary-strip span:first-child,
.summary-strip div > span:first-child {
  display: block;
  margin-bottom: 11px;
  color: #202833;
  font-size: 13px;
  font-weight: 500;
}

.summary-strip strong {
  display: block;
  color: #1f2937;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
}

.summary-strip .red-code {
  color: #f00000;
  font-size: 17px;
  font-weight: 600;
}

.detail-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.detail-tab {
  display: inline-flex;
  height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid #dde3ec;
  border-radius: 6px;
  background: #fff;
  padding: 0 22px;
  color: #111827;
  font-size: 14px;
  font-weight: 500;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.detail-tab.active {
  border-color: #c60000;
  background: linear-gradient(180deg, #cf0000 0%, #b90000 100%);
  color: #fff;
  box-shadow: 0 7px 14px rgba(193, 0, 0, 0.18);
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 20px;
  align-items: start;
}

.detail-main {
  display: grid;
  gap: 12px;
}

.info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 14px;
}

.detail-card,
.side-card {
  border: 1px solid #e2e7ef;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.045);
}

.detail-card {
  padding: 15px 14px 12px;
}

.detail-card h2,
.side-card h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #1c2430;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
}

.detail-card h2 svg,
.side-card h2 svg {
  color: #d10000;
  stroke-width: 2.2;
}

.info-box {
  margin-top: 13px;
  border: 1px solid #e5eaf1;
  border-radius: 7px;
  padding: 13px 12px 10px;
}

.detail-list {
  display: grid;
  gap: 13px;
  margin: 0;
}

.detail-list div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.detail-list.two-col div {
  grid-template-columns: 145px minmax(0, 1fr);
}

.detail-list dt,
.side-list dt {
  color: #667085;
  font-size: 13px;
  font-weight: 500;
}

.detail-list dd,
.side-list dd {
  margin: 0;
  color: #151b24;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

.map-row dd {
  display: flex;
  align-items: center;
  gap: 16px;
}

.map-thumb {
  position: relative;
  display: block;
  width: 142px;
  height: 70px;
  overflow: hidden;
  border: 1px solid #d8dee8;
  border-radius: 5px;
  background:
    linear-gradient(28deg, transparent 0 43%, #d8dee6 44% 48%, transparent 49%),
    linear-gradient(142deg, transparent 0 45%, #d8dee6 46% 50%, transparent 51%),
    linear-gradient(90deg, #f3f4f6 0 24%, #e8edf3 24% 28%, #f8fafc 28% 56%, #e8edf3 56% 60%, #f3f4f6 60% 100%);
}

.map-road {
  position: absolute;
  display: block;
  background: #cbd5e1;
}

.map-road.r1 {
  left: 22px;
  top: -14px;
  width: 11px;
  height: 110px;
  transform: rotate(43deg);
}

.map-road.r2 {
  right: 33px;
  top: -20px;
  width: 9px;
  height: 120px;
  transform: rotate(-38deg);
}

.map-road.r3 {
  left: -8px;
  top: 38px;
  width: 170px;
  height: 8px;
  transform: rotate(-8deg);
}

.map-pin {
  position: absolute;
  left: 58px;
  top: 17px;
  width: 29px;
  height: 29px;
  color: #f00000;
  fill: rgba(240, 0, 0, 0.2);
  stroke-width: 2.6;
}

.map-link {
  color: #f00000;
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  white-space: nowrap;
}

.detail-card.compact {
  padding-bottom: 17px;
}

.detail-card.compact .detail-list {
  margin-top: 18px;
}

.document-card {
  padding: 0;
  overflow: hidden;
}

.document-card h2 {
  padding: 15px 15px 11px;
}

.doc-table-wrap {
  overflow-x: auto;
}

.doc-table {
  width: 100%;
  min-width: 910px;
  border-collapse: separate;
  border-spacing: 0;
}

.doc-table th,
.doc-table td {
  border-right: 1px solid #e8edf3;
  border-bottom: 1px solid #e8edf3;
  padding: 9px 12px;
  color: #1f2937;
  font-size: 12px;
  line-height: 1.35;
}

.doc-table th {
  background: #fff2f2;
  font-weight: 600;
  text-align: center;
}

.doc-table td:first-child,
.doc-table td:nth-child(3),
.doc-table td:nth-child(5),
.doc-table td:nth-child(6),
.doc-table td:nth-child(7) {
  text-align: center;
}

.doc-table a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #0866e8;
  font-weight: 500;
  text-decoration: none;
}

.doc-table td button {
  display: inline-grid;
  width: 30px;
  height: 26px;
  place-items: center;
  margin: 0 2px;
  border: 1px solid #dbe2eb;
  border-radius: 5px;
  background: #fff;
  color: #1f2937;
}

.doc-table td button:hover {
  border-color: #c50000;
  color: #c50000;
}

.file-status {
  display: inline-flex;
  min-width: 70px;
  justify-content: center;
  border: 1px solid;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 500;
}

.file-status.valid {
  border-color: #b8e7c4;
  background: #eaf9ee;
  color: #249447;
}

.file-status.invalid {
  border-color: #ffd29d;
  background: #fff3e5;
  color: #ff8500;
}

.detail-side {
  display: grid;
  gap: 16px;
}

.side-card {
  padding: 17px 16px;
}

.side-list {
  display: grid;
  gap: 18px;
  margin: 18px 0 0;
}

.side-list div {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
  align-items: center;
}

.late-note {
  color: #f00000;
  font-weight: 500;
}

.action-stack {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}

.action-btn {
  display: inline-flex;
  height: 37px;
  align-items: center;
  gap: 10px;
  border: 1px solid;
  border-radius: 5px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 500;
  transition: filter 160ms ease, transform 160ms ease;
}

.action-btn:hover {
  filter: brightness(0.98);
}

.action-btn:active {
  transform: translateY(1px);
}

.action-btn.green {
  border-color: #acdcbc;
  background: #eef9f0;
  color: #238341;
}

.action-btn.orange {
  border-color: #ffd5a4;
  background: #fff5e8;
  color: #ff7900;
}

.action-btn.blue {
  border-color: #b7d4ff;
  background: #edf5ff;
  color: #1667e8;
}

.action-btn.red {
  border-color: #ffc5c5;
  background: #fff0f0;
  color: #e30000;
}

.action-btn.plain {
  border-color: #dfe5ed;
  background: #fff;
  color: #1f2937;
}

.note-card p {
  margin: 16px 0 0;
  color: #374151;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.55;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  overflow-y: auto;
  background: rgba(17, 24, 39, 0.54);
  padding: 28px;
}

.modal-overlay[hidden] {
  display: none;
}

.case-modal {
  width: min(100%, 650px);
  max-height: calc(100vh - 56px);
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 65px rgba(15, 23, 42, 0.28);
}

.supplement-modal {
  width: min(100%, 690px);
}

.modal-head {
  display: flex;
  height: 56px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #edf1f6;
  padding: 0 24px;
}

.modal-head h2 {
  color: #111827;
  font-size: 20px;
  font-weight: 600;
}

.modal-close {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 6px;
  color: #111827;
}

.modal-close:hover {
  background: #f3f4f6;
}

.modal-body {
  max-height: calc(100vh - 178px);
  overflow-y: auto;
  padding: 16px 24px 18px;
}

.modal-info {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid #a9ccff;
  border-radius: 5px;
  background: #eff6ff;
  padding: 12px 14px;
  color: #075ee4;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

.modal-info svg {
  flex: 0 0 auto;
  margin-top: 1px;
}

.modal-section {
  margin-top: 18px;
}

.modal-section h3 {
  margin-bottom: 14px;
  color: #1f2937;
  font-size: 14px;
  font-weight: 600;
}

.modal-summary-list {
  display: grid;
  gap: 16px;
  margin: 0;
}

.modal-summary-list div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 20px;
}

.modal-summary-list dt,
.modal-field > span:first-child {
  color: #374151;
  font-size: 13px;
  font-weight: 500;
}

.modal-summary-list dd {
  margin: 0;
  color: #111827;
  font-size: 13px;
  font-weight: 500;
}

.modal-summary-list .red-code {
  color: #f00000;
  font-weight: 600;
}

.modal-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.modal-field {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.modal-field.no-gap {
  display: block;
  margin-top: 10px;
}

.modal-field.no-gap > span:first-child {
  display: block;
  margin-bottom: 8px;
}

.modal-field b {
  color: #f00000;
  font-weight: 600;
}

.modal-select-wrap,
.modal-input-wrap {
  position: relative;
  display: block;
}

.modal-select-wrap select,
.modal-input-wrap input,
.modal-field textarea {
  width: 100%;
  border: 1px solid #d8dee8;
  border-radius: 6px;
  background: #fff;
  color: #111827;
  font-size: 13px;
  font-weight: 500;
  outline: none;
}

.modal-select-wrap select,
.modal-input-wrap input {
  height: 38px;
  padding: 0 38px 0 13px;
  appearance: none;
}

.modal-select-wrap svg,
.modal-input-wrap svg {
  position: absolute;
  right: 12px;
  top: 50%;
  color: #111827;
  transform: translateY(-50%);
  pointer-events: none;
}

.modal-field textarea {
  min-height: 68px;
  resize: vertical;
  padding: 12px 13px 20px;
  line-height: 1.5;
}

.textarea-count-wrap {
  position: relative;
  display: block;
}

.textarea-count-wrap em {
  position: absolute;
  right: 11px;
  bottom: 8px;
  color: #6b7280;
  font-size: 12px;
  font-style: normal;
  font-weight: 500;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid #edf1f6;
  padding: 14px 24px;
}

.modal-cancel,
.modal-submit {
  display: inline-flex;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 600;
}

.modal-cancel {
  border: 1px solid #d8dee8;
  background: #fff;
  color: #1f2937;
}

.modal-submit {
  border: 1px solid #c70000;
  background: linear-gradient(180deg, #d90000 0%, #c40000 100%);
  color: #fff;
  box-shadow: 0 6px 14px rgba(196, 0, 0, 0.2);
}

.supplement-group,
.supplement-row {
  border: 1px solid #e2e7ef;
  border-radius: 6px;
  background: #fff;
}

.supplement-group {
  padding: 0 12px 12px;
}

.supplement-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto 18px;
  gap: 12px;
  align-items: center;
  min-height: 44px;
  border: 0;
  border-bottom: 1px solid #edf1f6;
  border-radius: 0;
}

.supplement-row.collapsed {
  border: 1px solid #e2e7ef;
  border-radius: 6px;
  padding: 0 12px;
}

.supplement-row label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #1f2937;
  font-size: 13px;
  font-weight: 500;
}

.supplement-row input {
  width: 16px;
  height: 16px;
  accent-color: #16a34a;
}

.pill {
  display: inline-flex;
  height: 22px;
  align-items: center;
  border-radius: 999px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
}

.required-pill {
  background: #fff0f0;
  color: #ef1010;
}

.issue-text {
  color: #ef1010;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.date-field {
  margin-top: 2px;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 1320px) {
  .summary-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

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

@media (max-width: 980px) {
  .info-grid,
  .detail-side {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .summary-strip {
    grid-template-columns: 1fr;
  }

  .detail-list div,
  .detail-list.two-col div,
  .side-list div {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .detail-tab {
    flex: 1 1 auto;
    padding: 0 12px;
  }

  .modal-overlay {
    padding: 12px;
  }

  .modal-field,
  .modal-summary-list div {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .supplement-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px 0;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .modal-cancel,
  .modal-submit {
    width: 100%;
  }
}

/* Warning Box style in Reject Modal */
.reject-alert-box {
  display: flex;
  gap: 12px;
  border-radius: 8px;
  border: 1px solid #ffe4e4;
  background-color: #fff1f1;
  padding: 16px;
  font-size: 13px;
  color: #1f2937;
  line-height: 1.5;
  margin-bottom: 16px;
  text-align: left;
}
.reject-alert-box svg {
  flex-shrink: 0;
  color: #ef1010;
  width: 20px;
  height: 20px;
  margin-top: 2px;
}
.reject-alert-box .alert-title {
  font-weight: 700;
  color: #ef1010;
  margin-bottom: 2px;
}
.reject-alert-box .alert-desc {
  color: #4b5563;
}

/* Green Modal Submit Button */
.modal-submit.green {
  border-color: #15803d !important;
  background: linear-gradient(180deg, #16a34a 0%, #15803d 100%) !important;
  color: #fff !important;
  box-shadow: 0 6px 14px rgba(22, 163, 74, 0.2) !important;
}
.modal-submit.green:hover {
  background: #15803d !important;
}
