/* ─────────────────────────────
   Page / Topbar
───────────────────────────── */

.order-page {
  min-height: 100vh;
  background: var(--background-color);
  padding: 20px;
}

.order-topbar {
  width: 100%;
  min-height: 76px;
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: 220px 1fr 220px;
  align-items: center;
  gap: 16px;
  background: #ffffff;
  border-radius: 24px;
  padding: 14px 18px;
  box-shadow: var(--shadow-card);
}

.topbar-left {
  display: flex;
  align-items: center;
}

.order-logo {
  width: 180px;
  height: auto;
}

.order-tabs {
  display: grid;
  grid-template-columns: repeat(3, 120px);
  justify-content: center;
  align-items: center;
  gap: 8px;
  background: #f2f4f6;
  padding: 6px;
  border-radius: 18px;
}

.tab-button {
  width: 120px;
  height: 46px;
  min-width: 120px;
  max-width: 120px;
  padding: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--text-sub-color);
  font-size: 15px;
  font-weight: 800;
  line-height: 46px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
}

.tab-button.active {
  background: var(--primary-color);
  color: #ffffff;
}

.order-user-box {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 0;
}

.order-user-box strong {
  color: var(--text-main-color);
  font-size: 15px;
  font-weight: 800;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.order-user-box span {
  color: var(--text-sub-color);
  font-size: 13px;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.user-menu-wrap {
  position: relative;
  flex-shrink: 0;
}

.user-menu-trigger {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-sub-color);
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
}

.user-menu-trigger:hover {
  background: #f2f4f6;
  color: var(--text-main-color);
}

.user-menu-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 140px;
  background: #ffffff;
  border: 1px solid #edf0f4;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  z-index: 200;
  overflow: hidden;
}

.user-menu-dropdown.active {
  display: block;
}

.user-menu-item {
  width: 100%;
  padding: 11px 16px;
  text-align: left;
  font-size: 14px;
  color: var(--text-main-color);
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.12s;
}

.user-menu-item:hover {
  background: #f7f8fa;
}

.user-menu-item.danger {
  color: #ef4444;
}

.user-menu-item.danger:hover {
  background: #fef2f2;
}

/* ─────────────────────────────
     Common Section
  ───────────────────────────── */

.tab-page {
  display: none;
  width: 100%;
  margin: 0;
  background: #ffffff;
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.tab-page.active {
  display: block;
}

.section-header,
.order-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

/* ─────────────────────────────
   Register page (popup window)
───────────────────────────── */

.register-page {
  min-height: 100vh;
  background: var(--background-color);
  display: flex;
  justify-content: center;
  padding: 20px 20px 88px;
}

.register-page .edit-shell {
  width: 100%;
  max-width: 800px;
}

.register-page .detail-actions-fixed {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  border-radius: 0;
  padding: 12px 24px;
}

.compact-auto-refresh-select {
  height: 32px;
  border: 1px solid #d9dee8;
  border-radius: 9px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
  background: #ffffff;
  color: var(--text-label-color);
  cursor: pointer;
}

.compact-auto-refresh-select.active {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.auto-refresh-countdown {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e8eaf0;
  color: var(--text-sub-color);
  font-size: 12px;
  font-weight: 800;
  transition: background 0.2s, color 0.2s;
}

.auto-refresh-countdown.active {
  background: var(--primary-color);
  color: #ffffff;
}

/* ─────────────────────────────
   Section titles
───────────────────────────── */

.section-header h1,
.order-section-title h1 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main-color);
}

.section-header p,
.order-section-title p {
  margin: 0;
  font-size: 14px;
  color: var(--text-sub-color);
}

.small-button {
  height: 34px;
  padding: 0 14px;
  border-radius: 10px;
  background: var(--primary-color);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.empty-message,
.placeholder-card {
  padding: 42px 12px;
  text-align: center;
  color: var(--text-sub-color);
  font-size: 15px;
}

/* ─────────────────────────────
     Notice
  ───────────────────────────── */

.notice-table-header {
  display: grid;
  grid-template-columns: 90px 1fr 130px;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 16px;
  background: #f2f4f6;
  color: var(--text-label-color);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.notice-list {
  margin-top: 10px;
}

.notice-item {
  display: grid;
  grid-template-columns: 90px 1fr 130px;
  gap: 12px;
  align-items: center;
  padding: 15px 18px;
  border-bottom: 1px solid #edf0f4;
  cursor: pointer;
}

.notice-item:hover {
  background: #f8fafc;
}

.notice-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main-color);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.notice-date {
  text-align: center;
  font-size: 14px;
  color: var(--text-sub-color);
}

.notice-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #d9dee8;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-sub-color);
  background: #ffffff;
}

.notice-badge.new {
  color: #e5484d;
  border-color: rgba(229, 72, 77, 0.28);
  background: rgba(229, 72, 77, 0.08);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 22px;
}

.page-button {
  height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  background: #f2f4f6;
  color: var(--text-label-color);
  font-size: 14px;
  font-weight: 700;
}

.page-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ─────────────────────────────
     Order Query
  ───────────────────────────── */

.order-query-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
}

.compact-date-row,
.compact-control-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.compact-date-row label,
.compact-date-row span {
  color: var(--text-sub-color);
  font-size: 12px;
  font-weight: 700;
}

.compact-date-input,
.compact-search-input {
  height: 32px;
  border: 1px solid #d9dee8;
  border-radius: 9px;
  padding: 0 9px;
  font-size: 13px;
  background: #ffffff;
}

.compact-date-input {
  width: 138px;
}

.compact-search-input {
  width: 180px;
}

/* ─────────────────────────────
     Level Toggle
  ───────────────────────────── */

.level-toggle-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.level-toggle {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  background-color: #f5f6f9;
  color: #66686f;
  transition: 0.15s ease;
  white-space: nowrap;
}

.level-toggle[data-level-group="assigning"].active {
  background-color: #ecf3ff;
  color: #65a1fc;
  border-color: #d7e7ff;
}

.level-toggle[data-level-group="assigned"].active {
  background-color: #e4f4ef;
  color: #62b593;
  border-color: #cce9de;
}

.level-toggle[data-level-group="started"].active {
  background-color: #fdf2e6;
  color: #f2a35a;
  border-color: #f8ddc0;
}

.level-toggle[data-level-group="done"].active {
  background-color: #e8e9ea;
  color: #96989c;
  border-color: #d8dadd;
}

.level-toggle:not(.active) {
  background-color: #ffffff;
  color: #96989c;
  border-color: #e8e9ea;
}

.level-toggle:not(.active):hover {
  background-color: #f5f6f9;
  color: #66686f;
  border-color: #d8dadd;
}

/* ─────────────────────────────
     Order Layout / Table
  ───────────────────────────── */

#ordersPage {
  height: calc(100vh - 130px);
  overflow: hidden;
}

.order-list-layout {
  height: calc(100vh - 245px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 16px;
  align-items: stretch;
}

.order-table-card {
  height: 100%;
  overflow: auto;
  border: 1px solid #edf0f4;
  border-radius: 18px;
}

.order-table {
  width: 100%;
  min-width: 1060px;
  border-collapse: collapse;
}

.order-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
}

.order-table th {
  height: 40px;
  background: #f2f4f6;
  color: var(--text-label-color);
  font-size: 13px;
  font-weight: 800;
  text-align: left;
  padding: 0 12px;
  white-space: nowrap;
}

.order-table td {
  height: 44px;
  border-top: 1px solid #edf0f4;
  font-size: 13px;
  padding: 0 12px;
  white-space: nowrap;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-row {
  cursor: pointer;
}

.order-row:hover {
  background: #f8fafc;
}

.order-row.selected {
  background: rgba(117, 172, 255, 0.16);
}

.table-empty {
  text-align: center;
  color: var(--text-sub-color);
  height: 120px !important;
}

.order-col-no {
  width: 48px;
  min-width: 48px;
  max-width: 48px;
  text-align: center;
  color: #96989c;
  font-weight: 700;
}

.order-empty-cell {
  padding: 24px;
  text-align: center;
  color: #96989c;
}

/* ─────────────────────────────
     Status
  ───────────────────────────── */

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 66px;
  height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  background: #f2f4f6;
  color: var(--text-sub-color);
}

.order-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  background: #f2f4f6;
  color: var(--text-sub-color);
}

.status-0,
.status-1 {
  background: #ecf3ff;
  color: #65a1fc;
}

.status-2 {
  background: #e4f4ef;
  color: #62b593;
}

.status-3 {
  background: #fdf2e6;
  color: #f2a35a;
}

.status-4 {
  background: #e8e9ea;
  color: #96989c;
}

.status-5 {
  background: #fdecec;
  color: #e5484d;
}

/* ─────────────────────────────
     Detail Panel / Detail Tabs
  ───────────────────────────── */

.order-detail-panel {
  height: 100%;
  min-height: 0;
  border: 1px solid #edf0f4;
  border-radius: 18px;
  background: #ffffff;
  overflow-y: auto;
}

.detail-empty {
  height: 100%;
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-sub-color);
  font-size: 14px;
}

.detail-shell {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px;
  border-bottom: 1px solid #edf0f4;
}

.detail-header.simple {
  padding: 18px 20px;
}

.detail-header h2,
.detail-header.simple h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  color: var(--text-main-color);
}

.detail-title-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-title-row h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  color: var(--text-main-color);
  white-space: nowrap;
}

.detail-post-date {
  color: var(--text-sub-color);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.detail-subtitle {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--text-sub-color);
  line-height: 1.4;
}

.detail-close-button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f2f4f6;
  font-size: 22px;
}

.detail-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 12px;
  background: #f8fafc;
  border-bottom: 1px solid #edf0f4;
}

.detail-tab {
  width: 100%;
  height: 38px;
  padding: 0;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-sub-color);
  background: transparent;
  text-align: center;
  white-space: nowrap;
}

.detail-tab.active {
  background: #ffffff;
  color: var(--text-main-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.detail-tab-pages {
  flex: 1;
  min-height: 0;
}

.detail-tab-page {
  display: none;
}

.detail-tab-page.active {
  display: block;
}

.detail-body {
  padding: 16px 20px;
}

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

.detail-section:last-child {
  margin-bottom: 0;
}

.detail-section h3 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 900;
  color: var(--text-main-color);
}

.detail-section-content {
  border: 1px solid #edf0f4;
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff;
}

.detail-pair-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid #f2f4f6;
}

.detail-triple-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid #f2f4f6;
}

.detail-single-row {
  display: grid;
  grid-template-columns: 1fr;
  border-bottom: 1px solid #f2f4f6;
}

.detail-section-content > *:last-child {
  border-bottom: 0;
}

.detail-field {
  min-width: 0;
  padding: 10px 12px;
  border-right: 1px solid #f2f4f6;
}

.detail-field:last-child {
  border-right: 0;
}

.detail-label {
  margin-bottom: 4px;
  color: var(--text-sub-color);
  font-size: 12px;
  font-weight: 800;
}

.detail-value {
  color: var(--text-main-color);
  font-size: 13px;
  line-height: 1.45;
  word-break: break-all;
}

.empty-field {
  background: #fafbfc;
}

.readonly-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 22px;
  font-size: 13px;
  color: var(--text-main-color);
}

.readonly-checkbox input {
  width: 15px;
  height: 15px;
  accent-color: var(--primary-color);
}

.detail-empty-box {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #d9dee8;
  border-radius: 14px;
  color: var(--text-sub-color);
  font-size: 14px;
  background: #fafbfc;
}

.detail-empty-box.inner {
  min-height: 140px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.detail-actions-fixed {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  margin-top: auto;
  border-top: 1px solid #edf0f4;
  background: #ffffff;
}

.detail-actions-fixed .detail-action-button {
  flex: 1;
  min-width: 0;
}

.detail-action-button.danger {
  background: #fef2f2;
  color: #ef4444;
  border: 1px solid #fecaca;
}

.detail-action-button.danger:hover {
  background: #fee2e2;
}

/* 취소사유 입력 UI */
.cancel-reason-area {
  flex: 0 0 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cancel-reason-label {
  font-size: 13px;
  font-weight: 600;
  color: #ef4444;
}

.cancel-reason-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-main-color);
  border: 1px solid #fecaca;
  border-radius: 10px;
  resize: none;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.cancel-reason-input:focus {
  border-color: #ef4444;
}

.detail-action-button {
  height: 42px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 900;
}

.detail-action-button.primary {
  background: var(--primary-color);
  color: #ffffff;
}

.detail-action-button.secondary {
  background: #f2f4f6;
  color: var(--text-label-color);
}

/* ─────────────────────────────
     Collapsible Detail Section
  ───────────────────────────── */

.detail-collapsible-section {
  overflow: hidden;
}

.detail-collapsible-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
}

.detail-collapsible-summary::-webkit-details-marker {
  display: none;
}

.detail-collapsible-summary h3 {
  margin: 0;
}

.detail-collapsible-icon {
  font-size: 12px;
  color: #777;
}

.detail-collapsible-section[open] .detail-section-content {
  margin-top: 10px;
}

.detail-collapsible-section[open] .detail-collapsible-icon {
  font-size: 0;
}

.detail-collapsible-section[open] .detail-collapsible-icon::after {
  content: "접기 ▲";
  font-size: 12px;
}

/* ─────────────────────────────
     Photo / Driver Location
  ───────────────────────────── */

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

.vehicle-photo-item {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #f2f4f6;
  border: 1px solid #edf0f4;
  cursor: pointer;
}

.vehicle-photo-item:hover {
  border-color: #65a1fc;
}

.vehicle-photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.driver-location-actions {
  padding: 12px;
  border-top: 1px solid #f2f4f6;
}

.driver-location-actions .small-button {
  width: 100%;
  height: 38px;
  border-radius: 10px;
}

/* ─────────────────────────────
     Modal
  ───────────────────────────── */

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  padding: 24px;
  background: rgba(15, 23, 42, 0.45);
  align-items: center;
  justify-content: center;
}

.modal-backdrop.active {
  display: flex;
}

.modal-card,
.order-detail-modal-card {
  width: min(760px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
}

.modal-card {
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 26px 28px 14px;
}

.modal-header h2 {
  margin: 12px 0 0;
  font-size: 23px;
  line-height: 1.35;
  color: var(--text-main-color);
}

.modal-close {
  width: 36px;
  min-width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f2f4f6;
  color: var(--text-main-color);
  font-size: 24px;
  line-height: 1;
}

.modal-meta {
  display: flex;
  gap: 18px;
  padding: 0 28px 16px;
  color: var(--text-sub-color);
  font-size: 14px;
  border-bottom: 1px solid #edf0f4;
}

.modal-content {
  max-height: 52vh;
  overflow-y: auto;
  padding: 24px 28px 30px;
  color: var(--text-main-color);
  font-size: 15px;
  line-height: 1.7;
}

.modal-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 10px 0;
}

/* ─────────────────────────────
     Order Edit View
  ───────────────────────────── */

.edit-shell {
  height: 100%;
}

.edit-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 20px 92px;
}

.edit-section {
  margin-bottom: 18px;
}

.edit-section h3 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 900;
  color: var(--text-main-color);
}

.edit-grid {
  display: grid;
  gap: 10px;
}

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

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

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

.edit-field {
  min-width: 0;
}

.edit-field label {
  display: block;
  margin-bottom: 5px;
  color: var(--text-sub-color);
  font-size: 12px;
}

.edit-input,
.edit-textarea {
  width: 100%;
  border: 1px solid #d9dee8;
  border-radius: 12px;
  background: #ffffff;
  color: var(--text-main-color);
  font-size: 13px;
}

.edit-input {
  height: 38px;
  padding: 0 11px;
}

.edit-textarea {
  resize: vertical;
  min-height: 92px;
  padding: 10px 11px;
  line-height: 1.5;
}

.edit-input:focus,
.edit-textarea:focus {
  border-color: var(--primary-color);
}

.edit-readonly {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 0 11px;
  border: 1px solid #edf0f4;
  border-radius: 12px;
  background: #f8fafc;
  color: var(--text-main-color);
  font-size: 13px;
}

.edit-checkbox {
  height: 38px;
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid #d9dee8;
  border-radius: 12px;
  background: #ffffff;
  color: var(--text-main-color) !important;
  font-size: 13px !important;
}

.edit-checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary-color);
}

.mt-10 {
  margin-top: 10px;
}

.hidden {
  display: none !important;
}

.return-car-field.hidden {
  display: none;
}

/* ─────────────────────────────
     Select / Payment UI
  ───────────────────────────── */

/* 선택 완료 후 select 글씨는 기존 입력값과 동일 */
select.edit-input {
  height: 38px;
  padding: 0 11px;
  font-size: 13px;
  line-height: 38px;
}

/* 드롭다운을 열었을 때 선택 항목 글씨만 크게 */
select.edit-input option {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.8;
}

/* 결제방법, 현금 결제자 select 닫힌 상태 */
[data-field="regi_pay_type"],
[data-cash-payment-select] {
  font-size: 13px;
}

.cash-payment-detail.hidden,
[data-cash-payment-custom].hidden {
  display: none !important;
}

.edit-help-text {
  margin-top: 6px;
  font-size: 12px;
  color: #777;
  line-height: 1.45;
}

.edit-help-tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 4px;
  border-radius: 50%;
  background-color: #fdecec;
  color: #e5484d;
  font-size: 11px;
  font-weight: 700;
  cursor: help;
}

/* ─────────────────────────────
     Address / Search Dialog
  ───────────────────────────── */

.edit-address-block {
  padding: 12px;
  border: 1px solid #edf0f4;
  border-radius: 14px;
  margin-bottom: 10px;
}

.edit-address-block .edit-address-display {
  min-height: 58px;
}

.edit-address-title {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 900;
  color: var(--text-main-color);
}

.edit-address-search-row {
  display: grid;
  grid-template-columns: 1fr 58px;
  gap: 6px;
  margin-bottom: 8px;
}

.edit-search-button {
  height: 38px;
  border-radius: 12px;
  background: var(--primary-color);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.edit-address-display {
  width: 100%;
  min-height: 54px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  padding: 11px 12px;
  border: 1px solid #d9dee8;
  border-radius: 14px;
  background: #ffffff;
  text-align: left;
}

.edit-address-display:hover {
  background: #f8fafc;
  border-color: var(--primary-color);
}

.edit-address-label {
  color: var(--text-sub-color);
  font-size: 12px;
}

.edit-address-display strong {
  color: var(--text-main-color);
  font-size: 13px;
  line-height: 1.45;
  word-break: break-all;
}

.address-dialog-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  padding: 18px;
  background: rgba(15, 23, 42, 0.48);
  align-items: center;
  justify-content: center;
}

.address-dialog-backdrop.active {
  display: flex;
}

.address-dialog-card {
  width: min(560px, 100%);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
}

.address-dialog-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid #edf0f4;
}

.address-dialog-header h3 {
  margin: 0;
  color: var(--text-main-color);
  font-size: 18px;
  font-weight: 900;
}

.address-dialog-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f2f4f6;
  color: var(--text-main-color);
  font-size: 22px;
  line-height: 1;
}

.address-dialog-search {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 64px;
  gap: 8px;
  padding: 14px 20px;
  border-bottom: 1px solid #edf0f4;
}

.address-result-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.address-dialog-card .address-result-list {
  flex: 1;
  min-height: 180px;
  overflow-y: auto;
  padding: 14px 20px 20px;
}

.address-result-list.hidden {
  display: none !important;
}

.address-result-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px;
  border: 1px solid #edf0f4;
  border-radius: 12px;
  background: #ffffff;
  text-align: left;
}

.address-result-item:hover {
  background: #f8fafc;
}

.address-result-item strong {
  color: var(--text-main-color);
  font-size: 13px;
  font-weight: 900;
}

.address-result-item span {
  color: var(--text-sub-color);
  font-size: 12px;
  line-height: 1.4;
}

.address-result-item small {
  color: #8b95a1;
  font-size: 12px;
  line-height: 1.35;
}

.address-result-empty {
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
  color: var(--text-sub-color);
  font-size: 13px;
  text-align: center;
}

.selected-address-box {
  flex: 0 0 auto;
  padding: 14px 20px 18px;
  border-top: 1px solid #edf0f4;
  background: #ffffff;
}

.selected-address-box.hidden {
  display: none;
}

.selected-address-title {
  margin-bottom: 6px;
  color: var(--text-sub-color);
  font-size: 12px;
  font-weight: 900;
}

.selected-address-main {
  color: var(--text-main-color);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.45;
}

.selected-address-sub {
  margin-top: 4px;
  color: var(--text-sub-color);
  font-size: 13px;
  line-height: 1.45;
}

.address-dialog-card .selected-address-box .detail-action-button {
  width: 100%;
}

/* ─────────────────────────────
     Additional / Stopover
  ───────────────────────────── */

.additional-edit-input {
  height: 34px;
  border-radius: 10px;
  font-size: 12px;
}

.stopover-edit-section {
  padding-top: 10px;
}

.stopover-edit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.stopover-edit-header label {
  color: var(--text-sub-color);
  font-size: 12px;
  font-weight: 800;
}

.stopover-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stopover-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  align-items: stretch;
  gap: 6px;
}

.stopover-address-button {
  min-height: 54px;
}

.stopover-remove-button {
  border-radius: 12px;
  background: #f2f4f6;
  color: #59616f;
  font-size: 12px;
  font-weight: 800;
}

.stopover-remove-button:hover {
  background: #fee2e2;
  color: #b91c1c;
}

.stopover-empty {
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  color: var(--text-sub-color);
  font-size: 12px;
  text-align: center;
}

.stopover-empty.hidden {
  display: none;
}

/* ─────────────────────────────
     Large Screen Layout
  ───────────────────────────── */

@media (min-width: 1025px) {
  html,
  body {
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  .order-page {
    height: 100vh;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .order-topbar {
    flex: 0 0 auto;
  }

  .tab-page {
    display: none;
    flex: 1;
    height: auto;
    min-height: 0;
    overflow: hidden;
  }

  .tab-page.active {
    display: flex;
    flex-direction: column;
  }

  #noticePage .section-header,
  #noticePage .notice-table-header,
  #noticePage .pagination,
  #ordersPage .order-section-header {
    flex: 0 0 auto;
  }

  #noticePage .notice-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
  }

  #ordersPage .order-list-layout {
    flex: 1;
    height: auto;
    min-height: 0;
    overflow: hidden;
  }

  #ordersPage .order-table-card,
  #ordersPage .order-detail-panel {
    height: 100%;
    min-height: 0;
  }

  #ordersPage .order-table-card {
    overflow: auto;
  }

  #ordersPage .order-detail-panel {
    overflow-y: auto;
  }

  #paymentPage.active {
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }
}

/* ─────────────────────────────
     Responsive
  ───────────────────────────── */

@media (max-width: 1200px) {
  .order-section-header {
    flex-direction: column;
  }

  .order-query-panel {
    width: 100%;
    align-items: stretch;
  }

  .compact-date-row,
  .compact-control-row {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 1024px) {
  html,
  body {
    min-height: 100%;
  }

  .order-page {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
  }

  .order-topbar {
    flex: 0 0 auto;
  }

  .tab-page {
    display: none;
    min-height: 0;
  }

  .tab-page.active {
    display: flex;
    flex-direction: column;
    flex: 1;
  }

  #ordersPage {
    height: auto;
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  #ordersPage .order-section-header {
    flex: 0 0 auto;
  }

  #ordersPage .order-list-layout {
    flex: 1;
    min-height: 0;
    height: auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  #ordersPage .order-table-card {
    flex: 1;
    height: auto;
    min-height: 0;
    max-height: none;
    margin-bottom: 0;
    overflow: auto;
  }

  #ordersPage .order-detail-panel {
    display: none;
  }
}

@media (max-width: 900px) {
  .order-topbar {
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  .order-tabs {
    grid-column: 1 / -1;
    order: 3;
  }

  .order-user-box {
    justify-content: flex-end;
  }

  .user-menu-dropdown {
    right: 0;
    left: auto;
  }
}

@media (max-width: 640px) {
  .order-page {
    padding: 14px;
  }

  .order-topbar {
    min-height: auto;
    padding: 14px;
    border-radius: 20px;
  }

  .order-logo {
    width: 150px;
  }

  .detail-actions-fixed .detail-action-button {
    font-size: 12px;
    height: 38px;
  }

  .user-info strong {
    font-size: 13px;
  }

  .user-info span {
    font-size: 12px;
  }

  .user-menu-dropdown {
    min-width: 120px;
  }

  .order-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 6px;
    border-radius: 16px;
  }

  .tab-button,
  .tab-button.active {
    width: 100%;
    min-width: 0;
    max-width: none;
    height: 42px;
    padding: 0;
    font-size: 14px;
    line-height: 42px;
    text-align: center;
    white-space: nowrap;
  }

  .tab-page {
    padding: 18px 14px;
    border-radius: 20px;
  }

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

  .section-header h1,
  .order-section-title h1 {
    font-size: 20px;
    margin-bottom: 2px;
  }

  .order-section-title p {
    font-size: 12px;
  }

  .order-section-header {
    gap: 8px;
    margin-bottom: 10px;
  }

  .order-query-panel {
    gap: 5px;
  }

  .compact-date-row {
    width: 100%;
    display: grid;
    grid-template-columns: 44px 1fr 14px 1fr;
    align-items: center;
    gap: 4px;
  }

  .compact-date-row label,
  .compact-date-row span {
    font-size: 11px;
    text-align: center;
  }

  .compact-control-row {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
  }

  .compact-control-row #orderSearchInput {
    flex: 1;
    min-width: 80px;
  }

  .compact-date-input {
    width: 100%;
    height: 30px;
    min-width: 0;
    padding: 0 5px;
    font-size: 12px;
  }

  .compact-search-input {
    width: 100%;
    height: 30px;
    padding: 0 7px;
    font-size: 12px;
  }

  .compact-control-row .small-button {
    width: 54px;
    height: 30px;
    padding: 0;
    font-size: 12px;
    border-radius: 8px;
  }

  .level-toggle-group {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3px;
    padding: 3px;
  }

  .level-toggle {
    width: 100%;
    height: 28px;
    padding: 0 2px;
    font-size: 11px;
  }

  .order-table {
    min-width: 760px;
  }

  .order-table-card {
    max-height: 32vh;
  }

  .notice-table-header {
    display: none;
  }

  .notice-item {
    grid-template-columns: 58px 1fr;
    gap: 10px;
    padding: 16px 4px;
  }

  .notice-date {
    grid-column: 2;
    text-align: left;
    font-size: 13px;
  }

  .modal-backdrop {
    padding: 14px;
  }

  .modal-header {
    padding: 22px 20px 12px;
  }

  .modal-meta {
    padding: 0 20px 14px;
  }

  .modal-content {
    padding: 20px;
  }

  .order-detail-modal-card {
    width: 100%;
    max-height: 88vh;
    border-radius: 18px;
  }

  .detail-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .detail-post-date {
    text-align: left;
    white-space: normal;
  }

  .detail-body {
    padding: 14px;
  }

  .detail-tabs {
    gap: 4px;
    padding: 10px;
  }

  .detail-tab {
    height: 36px;
    font-size: 12px;
  }

  .detail-pair-row,
  .detail-triple-row {
    grid-template-columns: 1fr;
  }

  .detail-field {
    border-right: 0;
    border-bottom: 1px solid #f2f4f6;
  }

  .detail-field:last-child {
    border-bottom: 0;
  }

  .empty-field {
    display: none;
  }

  .vehicle-photo-grid {
    grid-template-columns: 1fr;
  }

  .edit-body {
    padding: 14px 14px 88px;
  }

  .edit-grid.two,
  .edit-grid.three {
    grid-template-columns: 1fr;
  }

  select.edit-input {
    height: 42px;
    line-height: 42px;
  }

  select.edit-input option {
    font-size: 18px;
  }

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

  .additional-edit-item {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .address-dialog-backdrop {
    padding: 12px;
  }

  .address-dialog-card {
    max-height: 86vh;
    border-radius: 18px;
  }

  .address-dialog-search {
    grid-template-columns: 1fr 58px;
    padding: 12px 14px;
  }

  .address-dialog-card .address-result-list {
    padding: 12px 14px 16px;
  }
}
.detail-action-button.disabled,
.detail-action-button:disabled {
  background: #e8e9ea !important;
  color: #96989c !important;
  cursor: not-allowed;
  opacity: 1;
}

/* 왕복여부 라벨 + 툴팁 */
.edit-label-with-tooltip {
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
}

/* 왕복여부 체크박스만 표시 */
.edit-checkbox.only-checkbox {
  width: 100%;
  height: 38px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.edit-checkbox.only-checkbox input {
  margin: 0;
}
/* DetailView 왕복여부 라벨 + 툴팁 */
.detail-label-with-tooltip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.return-option-field.hidden,
.return-car-field.hidden {
  display: none !important;
}

/* DetailView 왕복여부 체크박스만 표시 */
.readonly-checkbox.only-checkbox {
  width: 100%;
  min-height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.readonly-checkbox.only-checkbox input {
  margin: 0;
}

/* DetailView 물음표 툴팁 */
.detail-help-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: #fdecec;
  color: #e5484d;
  font-size: 11px;
  font-weight: 700;
  cursor: help;
}

.global-tooltip {
  position: fixed;
  z-index: 999999;
  max-width: 320px;
  padding: 9px 11px;
  border-radius: 8px;
  background: #333;
  color: #ffffff;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  text-align: center;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -100%);
}

.global-tooltip.active {
  opacity: 1;
  visibility: visible;
}


.image-viewer-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999999;
  padding: 24px;
  background: rgba(15, 23, 42, 0.72);
  align-items: center;
  justify-content: center;
}

.image-viewer-modal.active {
  display: flex;
}

.image-viewer-card {
  width: auto;
  min-width: 280px;
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 48px);
  display: inline-flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 18px;
  background: #ffffff;
}

.image-viewer-header {
  flex: 0 0 auto;
  height: 48px;
  padding: 0 14px 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #edf0f4;
}

.image-viewer-header strong {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main-color);
}

.image-viewer-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f2f4f6;
  color: var(--text-main-color);
  font-size: 24px;
  line-height: 1;
}

.image-viewer-body {
  flex: 0 1 auto;
  width: auto;
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 96px);
  overflow: auto;
  padding: 14px;
  text-align: center;
  background: #0f172a;

  display: flex;
  align-items: center;
  justify-content: center;
}

.image-viewer-body img {
  display: block;
  width: auto;
  height: auto;
  max-width: calc(100vw - 76px);
  max-height: calc(100vh - 130px);
  object-fit: contain;
  border-radius: 10px;
}

/* ─────────────────────────────
   Image List / Photo Tab
───────────────────────────── */

.image-section-card {
  padding: 14px;
  border: 1px solid #edf0f4;
  border-radius: 18px;
  background: #ffffff;
}

.image-section-card + .image-section-card {
  margin-top: 14px;
}

.image-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.image-section-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 900;
  color: var(--text-main-color);
}

.image-section-header p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-sub-color);
}

.image-count-badge {
  min-width: 30px;
  height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ecf3ff;
  color: #65a1fc;
  font-size: 13px;
  font-weight: 800;
}

.image-thumb-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.image-thumb-card {
  min-width: 0;
  padding: 0;
  border: 1px solid #edf0f4;
  border-radius: 16px;
  overflow: hidden;
  background: #ffffff;
  cursor: pointer;
  text-align: left;
  transition: 0.15s ease;
}

.image-thumb-card:hover {
  border-color: #65a1fc;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.image-thumb-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f2f4f6;
}

.image-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-thumb-footer {
  min-height: 48px;
  padding: 8px 9px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}

.image-thumb-footer span {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.image-thumb-footer small {
  font-size: 11px;
  color: #96989c;
}

/* 기존 vehicle-photo 스타일과 충돌 방지 */
.image-thumb-card img {
  display: block;
}

/* 모바일 */
@media (max-width: 640px) {
  .image-section-card {
    padding: 12px;
    border-radius: 16px;
  }

  .image-thumb-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .image-thumb-footer {
    min-height: 44px;
    padding: 7px 8px;
  }
}

/* ─────────────────────────────
   Driver Profile
───────────────────────────── */

.driver-profile-card {
  border: 1px solid #edf0f4;
  border-radius: 18px;
  background: #ffffff;
  overflow: hidden;
}

.driver-profile-main {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: #f8fafc;
  border-bottom: 1px solid #edf0f4;
}

.driver-avatar {
  width: 58px;
  height: 58px;
  min-width: 58px;
  border-radius: 50%;
  overflow: hidden;
  background: #ecf3ff;
  color: #65a1fc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  border: 1px solid #d7e7ff;
}

.driver-avatar img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.driver-profile-text {
  min-width: 0;
  flex: 1;
}

.driver-profile-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.driver-profile-top strong {
  color: var(--text-main-color);
  font-size: 17px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.driver-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  min-width: 62px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.driver-profile-sub {
  margin-top: 5px;
  color: var(--text-sub-color);
  font-size: 13px;
  font-weight: 600;
}

@media (max-width: 640px) {
  .driver-profile-main {
    padding: 14px;
  }

  .driver-avatar {
    width: 52px;
    height: 52px;
    min-width: 52px;
  }

  .driver-profile-info-grid {
    grid-template-columns: 1fr;
  }

  .driver-info-item,
  .driver-info-item:nth-child(2n),
  .driver-info-item:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid #f2f4f6;
  }

  .driver-info-item:last-child {
    border-bottom: 0;
  }
}

.driver-profile-card.compact {
  border: 1px solid #edf0f4;
  border-radius: 18px;
  background: #ffffff;
  overflow: hidden;
}

.driver-profile-card.compact .driver-profile-main {
  border-bottom: 0;
}

.driver-avatar {
  position: relative;
}

.driver-avatar-clickable {
  padding: 0;
  border: 1px solid #d7e7ff;
  cursor: pointer;
  transition: 0.15s ease;
}

.driver-avatar-clickable:hover {
  border-color: #65a1fc;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
}

.driver-avatar-fallback {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #65a1fc;
}

.driver-avatar.is-fallback .driver-avatar-fallback {
  display: flex;
}

.driver-avatar.is-fallback {
  background: #ecf3ff;
}

.driver-profile-icon {
  width: 30px;
  height: 30px;
}

.driver-avatar.is-fallback img {
  display: none;
}

.return-pay-badge {
  font-size: 11px;
  font-weight: 600;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  padding: 1px 5px;
  line-height: 1.4;
}

.swap-address-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 8px 0;
  padding: 7px 12px;
  background: #f1f5f9;
  border: 1px dashed #94a3b8;
  border-radius: 8px;
  color: #475569;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.swap-address-btn:hover {
  background: #e2e8f0;
  color: #1e293b;
}

#openAdditionalRegisterButton:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ─────────────────────────────
   Card Payment Tab
───────────────────────────── */

#paymentPage.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.payment-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: stretch;
}

.payment-table-card {
  height: 100%;
  overflow: auto;
  border: 1px solid #edf0f4;
  border-radius: 18px;
}

.payment-table {
  min-width: 1000px;
}

.payment-col-check {
  width: 44px;
  text-align: center !important;
  padding: 0 8px !important;
}

.payment-col-amount {
  text-align: right !important;
  font-weight: 700;
  color: var(--text-main-color);
}

.payment-row.checked {
  background: rgba(117, 172, 255, 0.1);
}

.payment-row.checked:hover {
  background: rgba(117, 172, 255, 0.18);
}

.payment-checkbox,
#checkAllPayments {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 2px solid #d9dee8;
  border-radius: 4px;
  background: #ffffff;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: background 0.15s, border-color 0.15s;
}

.payment-checkbox:checked,
#checkAllPayments:checked {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.payment-checkbox:indeterminate,
#checkAllPayments:indeterminate {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.payment-checkbox:checked::after,
#checkAllPayments:checked::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 9px;
  border: 2px solid #ffffff;
  border-top: none;
  border-left: none;
  transform: translate(-50%, -60%) rotate(45deg);
}

#checkAllPayments:indeterminate::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 2px;
  background: #ffffff;
  border: none;
  transform: translate(-50%, -50%);
}

.payment-summary-panel {
  height: 100%;
  min-height: 0;
  border: 1px solid #edf0f4;
  border-radius: 18px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.payment-summary-title {
  padding: 18px 20px 14px;
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main-color);
  border-bottom: 1px solid #edf0f4;
  flex-shrink: 0;
}

.payment-summary-items {
  flex: 1;
  overflow-y: auto;
  padding: 10px 16px;
}

.payment-summary-empty {
  height: 100%;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-sub-color);
  font-size: 13px;
}

.payment-summary-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px;
  border-bottom: 1px solid #f2f4f6;
  gap: 8px;
}

.payment-summary-item:last-child {
  border-bottom: none;
}

.payment-summary-carnum {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main-color);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-summary-amount {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-color);
  flex-shrink: 0;
}

.payment-summary-totals {
  border-top: 2px solid #edf0f4;
  padding: 14px 20px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.payment-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-sub-color);
}

.payment-total-row span:last-child {
  font-weight: 700;
  color: var(--text-main-color);
}

.payment-total-row.final {
  padding-top: 8px;
  border-top: 1px solid #edf0f4;
  font-size: 15px;
  color: var(--text-main-color);
  font-weight: 800;
}

.payment-total-row.final span:last-child {
  color: var(--primary-color);
  font-size: 16px;
}

.payment-submit-button {
  margin: 10px 16px 16px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-color);
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

.payment-submit-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

@media (max-width: 1024px) {
  .payment-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }

  .payment-summary-panel {
    height: auto;
    max-height: 340px;
  }
}
