/* 统一业务与移动端可用性 */

.app-back-button,
.mobile-tools-button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink-soft);
  font-weight: 700;
}

.mobile-tools-button { display: none; }

.searchable-customer-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
}

.customer-select-search {
  border-color: #8db9a5;
  background: #f7fbf9;
}

.field-hint {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.followup-calendar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin: 0 0 14px;
}

.followup-calendar button {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--ink-soft);
  box-shadow: var(--shadow-soft);
}

.followup-calendar strong { color: var(--green-deep); font-size: 21px; }
.followup-calendar span { font-size: 11px; }

.task-summary-card[role="button"],
.source-overview-card,
.team-card[role="button"],
[data-followup-owner] {
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.task-summary-card[role="button"]:hover,
.source-overview-card:hover,
.team-card[role="button"]:hover {
  border-color: #8fb7a4;
  box-shadow: 0 10px 26px rgba(31, 82, 62, .11);
  transform: translateY(-1px);
}

[data-followup-owner]:hover td {
  background: #f3faf6;
}

.cancelled-row {
  opacity: .64;
  background: #f6f6f4;
}

.cancelled-row .money,
.cancelled-row .profit {
  text-decoration: line-through;
}

.table-action.danger,
.danger-button {
  color: #9a3d36;
  border-color: rgba(154, 61, 54, .28);
}

.danger-button {
  background: #9a3d36;
  color: #fff;
}

.table-action:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.task-card.appointment {
  border-color: #80b199;
  background: #f6fbf8;
}

.task-card.appointment .indicator { background: var(--green); }
.task-card .item-meta strong { color: var(--green-deep); }
.task-card .task-date { display: grid; gap: 3px; justify-items: end; }
.task-card .task-date small { color: var(--muted); font-size: 9px; font-weight: 500; }

.previous-followup {
  border-left: 3px solid var(--green);
  background: var(--green-soft);
}

.ux-record-list { display: grid; gap: 8px; }
.ux-record-row {
  width: 100%;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink-soft);
  text-align: left;
}
.ux-record-row span,
.ux-record-row strong,
.ux-record-row small { display: block; }
.ux-record-row small { margin-top: 5px; color: var(--muted); }
.ux-record-row b { color: var(--green); white-space: nowrap; }

.ux-highlight {
  animation: uxPulse 1.1s ease-in-out 2;
  outline: 3px solid rgba(31, 118, 86, .26) !important;
  outline-offset: 4px;
}

@keyframes uxPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(31, 118, 86, .1); }
  50% { box-shadow: 0 0 0 12px rgba(31, 118, 86, .12); }
}

.inquiry-search-toolbar {
  margin-bottom: 10px;
  padding: 0;
  border: 0;
  background: transparent;
}

.inquiry-search-toolbar .search-box { width: min(100%, 420px); }

/* The old generated question-mark tooltips are intentionally removed. */
.button-help { display: none !important; }
.has-button-help { padding-right: initial !important; }

@media (max-width: 820px) {
  .topbar {
    position: sticky;
    top: 0;
    z-index: 80;
    gap: 8px;
  }

  body.ux-modal-open .topbar { z-index: 95; }
  body.ux-modal-open .modal-backdrop.open { padding-top: 78px; }
  body.ux-modal-open .mobile-tools-button,
  body.ux-modal-open .mobile-menu,
  body.ux-modal-open .topbar-actions {
    visibility: hidden;
  }
  body.ux-modal-open .app-back-button {
    visibility: visible;
  }

  .breadcrumb { display: none; }
  .mobile-tools-button { display: inline-flex; align-items: center; }
  .app-back-button { display: inline-flex; align-items: center; }
  .app-back-button[hidden] { display: none; }

  .topbar-actions { margin-left: auto; gap: 7px; }
  .topbar-actions .user-switcher { min-width: 44px; }
  .topbar-actions .user-copy { display: none; }

  .enhanced-top-actions {
    position: fixed;
    z-index: 110;
    top: 68px;
    left: 12px;
    right: 12px;
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 18px 48px rgba(25, 50, 40, .2);
    backdrop-filter: blur(14px);
  }

  .enhanced-top-actions.mobile-open { display: grid; }
  .enhanced-top-actions .top-icon-button {
    width: auto;
    min-width: 0;
    min-height: 48px;
    padding: 0 12px !important;
    font-size: 13px;
    text-align: center;
  }

  .enhanced-top-actions .top-icon-button::before { content: none !important; }
  #logoutButton { grid-column: 1 / -1; }

  .followup-calendar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .followup-zone-grid { grid-template-columns: 1fr; }
  .followup-zone .task-card {
    min-height: 94px;
    grid-template-columns: 4px minmax(0, 1fr) auto;
  }
  .followup-zone .task-date {
    grid-column: 3;
    align-self: start;
    font-size: 10px;
  }

  .dual-followup-layout .task-detail {
    scroll-margin-top: 76px;
    margin-bottom: 24px;
  }

  .mobile-customer-card { cursor: pointer; }
  .mobile-customer-action-bar { bottom: max(12px, env(safe-area-inset-bottom)); }
  .modal {
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  #orderTableBody .table-actions {
    display: grid;
    gap: 7px;
  }
}

@media (max-width: 520px) {
  .followup-calendar { grid-template-columns: 1fr 1fr; }
  .followup-calendar button { min-height: 58px; padding: 10px 11px; }
  .task-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .followup-zone .task-card {
    grid-template-columns: 4px minmax(0, 1fr);
  }
  .followup-zone .task-date {
    grid-column: 2;
    justify-items: start;
  }
}
