/* =============================================================================
   案件受注ページ — v6.12.0-alpha.4 / Phase 1.7-C + 1.7-D
   ============================================================================= */

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 28px;
}

/* タブ切替 */
.order-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--color-divider, rgba(0,0,0,.08));
}
.order-tab {
  padding: 12px 22px;
  font-size: var(--text-sm, 13px);
  font-weight: 500;
  color: var(--color-text-muted, #5f6368);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: color var(--tr, 180ms), border-color var(--tr, 180ms);
  font-family: inherit;
}
.order-tab:hover {
  color: var(--color-text, #202124);
}
.order-tab.active {
  color: var(--color-primary, #1a73e8);
  border-bottom-color: var(--color-primary, #1a73e8);
}
.order-tab-panel {
  display: none;
}
.order-tab-panel.active {
  display: block;
}

/* カード */
.order-card {
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, rgba(60,64,67,.14));
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--shadow-1, 0 1px 2px rgba(60,64,67,.10));
}
.order-section-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--color-text, #202124);
  margin: 0 0 6px 0;
}
.order-section-hint {
  font-size: 12px;
  color: var(--color-text-muted, #5f6368);
  margin: 0 0 24px 0;
  line-height: 1.6;
}

/* フォーム共通 */
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 12px;
}
@media (max-width: 600px) {
  .form-row-2 { grid-template-columns: 1fr; }
}
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text, #202124);
  margin-bottom: 6px;
}
.form-group label small {
  font-size: 11px;
  font-weight: 400;
  color: var(--color-text-muted, #5f6368);
  margin-left: 6px;
}
.form-group label .req {
  color: var(--color-red, #c5221f);
}
.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  border: 1px solid var(--color-border, rgba(60,64,67,.14));
  border-radius: 8px;
  background: var(--color-surface, #fff);
  color: var(--color-text, #202124);
  transition: border-color var(--tr, 180ms);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary, #1a73e8);
}

/* 日付モード切替 */
.date-mode-tabs {
  display: inline-flex;
  background: var(--color-surface-2, #f1f3f4);
  border-radius: 9999px;
  padding: 3px;
  margin-bottom: 10px;
}
.date-mode-tab {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted, #5f6368);
  background: transparent;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  font-family: inherit;
  transition: var(--tr, 180ms);
}
.date-mode-tab.active {
  background: var(--color-surface, #fff);
  color: var(--color-text, #202124);
  box-shadow: var(--shadow-1, 0 1px 2px rgba(60,64,67,.10));
}

.multi-date-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.multi-date-row input[type="date"] {
  width: auto;
  flex: 1;
  max-width: 220px;
}
.multi-date-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 24px;
}
.multi-date-chip {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px 0 12px;
  border-radius: 9999px;
  background: var(--color-primary-soft, rgba(26,115,232,0.10));
  color: var(--color-primary, #1a73e8);
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.multi-date-chip .x {
  margin-left: 6px;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}
.multi-date-chip .x:hover {
  color: var(--color-red, #c5221f);
}

.range-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.range-row input[type="date"] {
  width: auto;
  flex: 1;
  max-width: 220px;
}

/* プレビュー */
.order-preview {
  padding: 12px 16px;
  border: 1px dashed var(--color-border, rgba(60,64,67,.14));
  border-radius: 10px;
  background: var(--color-surface-2, #f8f9fa);
  font-size: 13px;
  color: var(--color-text-muted, #5f6368);
  margin: 18px 0;
}
.order-preview strong {
  color: var(--color-primary, #1a73e8);
  font-size: 16px;
}

/* スロットリスト（haichi.css の .aj-slots-list / .aj-slot-row を流用、ここで再宣言） */
.aj-slots-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}
.aj-slot-row {
  display: grid;
  grid-template-columns: 22px minmax(96px, 1fr) minmax(96px, 1fr) auto minmax(60px, 0.7fr) minmax(0, 1.2fr) auto;
  gap: 6px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--color-border, rgba(60,64,67,.14));
  border-radius: 8px;
  background: var(--color-surface, #fff);
  transition: opacity 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.aj-slot-row > input[type="time"],
.aj-slot-row > input[type="number"],
.aj-slot-row > input[type="text"] {
  width: 100%;
  min-width: 0;
  padding: 4px 6px;
  font-size: 12px;
}
.aj-slot-overnight-cell {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--color-text-muted, #5f6368);
  white-space: nowrap;
}
.aj-slot-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 28px;
  font-size: 18px;
  line-height: 1;
  color: var(--color-text-muted, #9aa0a6);
  cursor: grab;
  user-select: none;
  border-radius: 4px;
}
.aj-slot-handle:hover {
  background: var(--color-surface-2, #f1f3f4);
  color: var(--color-text, #202124);
}
.aj-slot-handle:active { cursor: grabbing; }
.aj-slot-row.aj-slot-dragging { opacity: 0.4; }
.aj-slot-row.aj-slot-drag-over {
  border-color: var(--color-primary, #1a73e8);
  box-shadow: 0 0 0 2px var(--color-primary-soft, rgba(26,115,232,0.15));
}
.aj-slot-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--color-red, #c5221f);
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
.aj-slot-delete:hover { background: rgba(217, 48, 37, 0.08); }

/* リスト */
.list-filter-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.list-filter-row .form-group { margin-bottom: 0; }
.list-filter-row input[type="date"] {
  width: 160px;
}
.list-filter-row select { min-width: 160px; }

.tentative-list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tentative-list-table th {
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  color: var(--color-text-muted, #5f6368);
  border-bottom: 1px solid var(--color-divider, rgba(0,0,0,.08));
  background: var(--color-surface-2, #f8f9fa);
}
.tentative-list-table td {
  padding: 12px;
  border-bottom: 1px solid var(--color-divider, rgba(0,0,0,.08));
  color: var(--color-text, #202124);
}
.tentative-list-table tr:hover td {
  background: var(--color-surface-2, #f8f9fa);
}
.tentative-list-table .row-actions {
  display: inline-flex;
  gap: 6px;
}
.tentative-list-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--color-text-muted, #5f6368);
  font-size: 14px;
}

/* 仮バッジ（haichi の .tentative-badge と同仕様、独立宣言） */
.tentative-badge-inline {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 8px;
  border-radius: 9999px;
  background: rgba(242, 153, 0, 0.12);
  color: #b06000;
  font-size: 11px;
  font-weight: 600;
  margin-right: 6px;
  flex-shrink: 0;
}

/* ボタン */
.gs-btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 16px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--color-border, rgba(60,64,67,.14));
  background: var(--color-surface, #fff);
  color: var(--color-text, #202124);
  box-shadow: var(--shadow-1, 0 1px 2px rgba(60,64,67,.10));
  transition: var(--tr, 180ms);
}
.gs-btn-pill:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-2, 0 2px 6px rgba(60,64,67,.16));
}
.gs-btn-pill.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; }
.gs-btn-pill.btn-secondary { background: var(--color-surface-2, #f8f9fa); }
.gs-btn-primary {
  background: var(--color-primary, #1a73e8);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-2, 0 2px 6px rgba(60,64,67,.16));
}
.gs-btn-primary:hover { filter: brightness(1.05); }
.gs-btn-danger {
  background: var(--color-red, #c5221f);
  color: #fff;
  border-color: transparent;
}
.gs-btn-danger:hover { filter: brightness(1.05); }

/* エラー / トースト */
.error-message {
  padding: 10px 14px;
  background: rgba(217, 48, 37, 0.08);
  border: 1px solid rgba(217, 48, 37, 0.30);
  border-radius: 8px;
  color: var(--color-red, #c5221f);
  font-size: 13px;
  margin: 12px 0;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 10px 16px;
  border-radius: 9999px;
  background: var(--color-text, #202124);
  color: #fff;
  font-size: 13px;
  box-shadow: var(--shadow-2, 0 2px 6px rgba(60,64,67,.16));
  animation: toastIn 0.3s ease;
}
.toast.error { background: var(--color-red, #c5221f); }
.toast.success { background: var(--color-green, #34a853); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

.loading {
  padding: 40px 20px;
  text-align: center;
  color: var(--color-text-muted, #5f6368);
  font-size: 14px;
}

/* v6.12.0-alpha.5 (Phase 1.7-E) 確定モーダル — 独自 .cc-overlay クラスで他モーダルと衝突回避 */
.cc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  padding: 20px;
}
.cc-overlay.active { display: flex; }
.cc-modal {
  background: var(--color-surface, #fff);
  border-radius: 16px;
  padding: 22px;
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-2, 0 2px 6px rgba(60,64,67,.16));
  position: relative;
}
.cc-body {
  font-size: 14px;
  line-height: 1.7;
  color: var(--color-text, #202124);
  margin-bottom: 14px;
}
.cc-body p { margin: 0 0 14px 0; }
.cc-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 400;
}
.cc-info {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--color-primary-soft, rgba(26,115,232,0.08));
  font-size: 12px;
  color: var(--color-text, #202124);
  display: flex;
  align-items: center;
  gap: 8px;
}
.cc-info-icon {
  color: var(--color-primary, #1a73e8);
  font-size: 10px;
  line-height: 1;
}

/* モーダル */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal-box {
  background: var(--color-surface, #fff);
  border-radius: 16px;
  padding: 22px;
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-2, 0 2px 6px rgba(60,64,67,.16));
  position: relative;
}
.modal-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-divider, rgba(0,0,0,.08));
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--color-text-muted, #5f6368);
  padding: 4px 8px;
}
