/* ==========================================
   NiraiDesk レンタル管理スタイル (rental.css)
   css/ ディレクトリに配置
   ========================================== */

/* --- ページ共通 --- */
.rental-page {
  padding: 0;
}

.rental-loading {
  text-align: center;
  padding: 40px;
  color: #94a3b8;
  font-size: 14px;
}

.rental-empty {
  text-align: center;
  padding: 40px;
  color: #94a3b8;
  font-size: 14px;
}

/* --- 確認AI・教育 --- */
.rental-help-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding-bottom: 32px;
  color: #1e293b;
}

.rhelp-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  padding: 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, #ecfeff, #f0fdfa);
  border: 1px solid #a5f3fc;
}

.rhelp-header h2 {
  margin: 2px 0 5px;
  color: #164e63;
  font-size: 21px;
}

.rhelp-header p {
  margin: 0;
  color: #475569;
  font-size: 12px;
  line-height: 1.7;
}

.rhelp-eyebrow {
  color: #0e7490;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
}

.rhelp-readonly {
  flex-shrink: 0;
  padding: 7px 10px;
  border-radius: 999px;
  background: #fff;
  color: #0f766e;
  font-size: 10px;
  font-weight: 800;
  border: 1px solid #99f6e4;
}

.rhelp-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
  padding: 4px;
  border-radius: 12px;
  background: #e2e8f0;
}

.rhelp-tabs button {
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #64748b;
  font: 800 13px inherit;
  cursor: pointer;
}

.rhelp-tabs button.active {
  background: #fff;
  color: #0e7490;
  box-shadow: 0 1px 4px rgba(15, 23, 42, .12);
}

.rhelp-card {
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
}

.rhelp-question-card > label {
  display: block;
  margin-bottom: 8px;
  color: #164e63;
  font-size: 15px;
  font-weight: 800;
}

.rhelp-question-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.rhelp-question-row textarea {
  width: 100%;
  min-height: 54px;
  box-sizing: border-box;
  resize: vertical;
  padding: 11px 12px;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  font: 13px/1.6 inherit;
}

.rhelp-question-row textarea:focus {
  outline: 0;
  border-color: #0891b2;
  box-shadow: 0 0 0 3px rgba(8, 145, 178, .12);
}

.rhelp-question-row > button {
  padding: 0 17px;
  border: 0;
  border-radius: 10px;
  background: #0891b2;
  color: #fff;
  font: 800 13px inherit;
  cursor: pointer;
}

.rhelp-privacy {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
  font-size: 10px;
  line-height: 1.6;
}

.rhelp-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin: 12px -2px 0;
  padding: 2px 2px 7px;
  scrollbar-width: thin;
}

.rhelp-chips button {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font: 700 11px inherit;
  cursor: pointer;
}

.rhelp-chips button.active {
  border-color: #0891b2;
  background: #ecfeff;
  color: #0e7490;
}

.rhelp-suggestions,
.rhelp-history-list,
.rhelp-quiz-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.rhelp-suggestion,
.rhelp-quiz-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  width: 100%;
  min-height: 65px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  color: #334155;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
}

.rhelp-suggestion.best {
  border-color: #22d3ee;
  background: #ecfeff;
}

.rhelp-suggestion strong,
.rhelp-quiz-button strong {
  display: block;
  margin-bottom: 3px;
  font-size: 12px;
  line-height: 1.45;
}

.rhelp-suggestion small,
.rhelp-quiz-button small {
  display: block;
  color: #64748b;
  font-size: 10px;
  line-height: 1.45;
}

.rhelp-results-title {
  margin-top: 12px;
  color: #0e7490;
  font-size: 11px;
  font-weight: 800;
}

.rhelp-empty {
  padding: 18px 8px 8px;
  color: #94a3b8;
  text-align: center;
  font-size: 11px;
}

.rhelp-noanswer {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 11px;
  line-height: 1.6;
}

.rhelp-answer {
  scroll-margin-top: 10px;
  border-color: #a5f3fc;
}

.rhelp-answer-head,
.rhelp-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.rhelp-answer h3,
.rhelp-section-head h3,
.rhelp-history h3,
.rhelp-quiz h3,
.rhelp-boundary h3,
.rhelp-local-note h3 {
  margin: 4px 0 8px;
  color: #164e63;
  font-size: 16px;
}

.rhelp-category {
  color: #0891b2;
  font-size: 10px;
  font-weight: 800;
}

.rhelp-favorite {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  background: #fff;
  color: #94a3b8;
  font-size: 23px;
  cursor: pointer;
}

.rhelp-favorite.active {
  border-color: #facc15;
  background: #fefce8;
  color: #eab308;
}

.rhelp-answer section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

.rhelp-answer section h4 {
  margin: 0 0 7px;
  color: #334155;
  font-size: 12px;
}

.rhelp-answer p,
.rhelp-boundary p,
.rhelp-local-note p,
.rhelp-section-copy {
  margin: 0;
  color: #475569;
  font-size: 11px;
  line-height: 1.75;
}

.rhelp-conclusion {
  padding: 12px !important;
  border: 0 !important;
  border-radius: 10px;
  background: #ecfeff;
}

.rhelp-answer ol {
  margin: 0;
  padding-left: 21px;
  color: #475569;
  font-size: 11px;
  line-height: 1.7;
}

.rhelp-answer li + li {
  margin-top: 4px;
}

.rhelp-checks li::marker {
  content: '✓  ';
  color: #16a34a;
  font-weight: 900;
}

.rhelp-answer .rhelp-prohibited {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #fecaca;
  border-radius: 10px;
  background: #fef2f2;
}

.rhelp-prohibited h4 {
  color: #b91c1c !important;
}

.rhelp-answer .rhelp-escalate {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  background: #fff7ed;
}

.rhelp-escalate h4 {
  color: #c2410c !important;
}

.rhelp-source {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 9px;
  line-height: 1.5;
}

.rhelp-source button,
.rhelp-feedback button {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid #0891b2;
  border-radius: 8px;
  background: #fff;
  color: #0e7490;
  font: 800 10px inherit;
  cursor: pointer;
}

.rhelp-history h3 {
  font-size: 13px;
}

.rhelp-boundary {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.rhelp-learning-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.rhelp-learning-summary > div {
  display: grid;
  gap: 3px;
  padding: 12px 8px;
  border: 1px solid #dbeafe;
  border-radius: 11px;
  background: #eff6ff;
  text-align: center;
}

.rhelp-learning-summary strong {
  color: #1d4ed8;
  font-size: 20px;
}

.rhelp-learning-summary span,
.rhelp-section-head > span {
  color: #64748b;
  font-size: 9px;
}

.rhelp-quiz-button {
  min-height: 56px;
}

.rhelp-quiz {
  scroll-margin-top: 10px;
  border-color: #bfdbfe;
}

.rhelp-scenario {
  margin: 6px 0 12px;
  padding: 12px;
  border-radius: 10px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.65;
}

.rhelp-choices {
  display: grid;
  gap: 8px;
}

.rhelp-choices button {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: #334155;
  text-align: left;
  font: 700 11px/1.55 inherit;
  cursor: pointer;
}

.rhelp-choices button span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e0f2fe;
  color: #0369a1;
}

.rhelp-feedback {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  font-size: 10px;
  line-height: 1.6;
}

.rhelp-feedback.correct {
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.rhelp-feedback.wrong {
  border: 1px solid #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.rhelp-feedback p {
  margin: 5px 0;
}

.rhelp-feedback button {
  margin-top: 8px;
}

@media (max-width: 640px) {
  .rhelp-header {
    display: grid;
    padding: 14px;
  }

  .rhelp-readonly {
    justify-self: start;
  }

  .rhelp-question-row {
    grid-template-columns: 1fr;
  }

  .rhelp-question-row > button {
    min-height: 42px;
  }

  .rhelp-suggestions,
  .rhelp-history-list,
  .rhelp-quiz-list {
    grid-template-columns: 1fr;
  }

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

  .rhelp-source {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* --- フィルタバー --- */
.rental-filters {
  background: var(--card, #fff);
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.rf-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.rf-sep {
  color: #94a3b8;
  font-size: 13px;
  flex-shrink: 0;
}

.rf-input {
  flex: 1;
  padding: 10px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: white;
  min-width: 0;
}

.rf-input:focus {
  outline: none;
  border-color: #0891b2;
}

.rf-actions {
  display: flex;
  gap: 8px;
}

.rf-btn-filter {
  padding: 10px 16px;
  background: #f1f5f9;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  font-family: inherit;
}

.rf-btn-filter:active {
  background: #e2e8f0;
}

.rf-btn-add {
  flex: 1;
  padding: 10px 16px;
  background: #0891b2;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.rf-btn-add:active {
  background: #0e7490;
}

/* --- 予約カードリスト --- */
.rental-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rental-card {
  background: var(--card, #fff);
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
}

.rental-card:active {
  transform: scale(0.98);
}

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

.rc-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.rc-date {
  font-size: 12px;
  color: #94a3b8;
}

.rc-body {
  margin-bottom: 8px;
}

.rc-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.rc-meta {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 4px;
}

.rc-line-link-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  padding: 3px 8px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

.rc-line-link-badge--linked {
  color: #166534;
  background: #f0fdf4;
  border-color: #86efac;
}

.rc-line-link-badge--unlinked {
  color: #9a3412;
  background: #fff7ed;
  border-color: #fb923c;
}

.rc-items {
  font-size: 13px;
  color: #475569;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rc-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}

.rc-period {
  font-size: 12px;
  color: #94a3b8;
}

.rc-total {
  font-size: 16px;
  font-weight: 700;
  color: #0891b2;
}

.rc-badge-signed {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  color: #10b981;
  background: #f0fdf4;
  padding: 2px 8px;
  border-radius: 10px;
}

.rc-card-badges {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  flex-wrap: wrap;
}

/* --- モーダル（詳細・作成共通） --- */
.rental-modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 9000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.rental-modal {
  background: white;
  border-radius: 16px 16px 0 0;
  max-height: 92vh;
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.rm-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
}

.rm-header h3 {
  font-size: 17px;
  font-weight: 700;
}

.rm-close {
  width: 32px; height: 32px;
  border: none;
  background: #f1f5f9;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rm-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  -webkit-overflow-scrolling: touch;
}

.rm-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 16px;
}

.rm-status-select {
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

/* --- 予約詳細：お客様から変更依頼が来た時の入口 --- */
.rm-change-hub {
  margin: 0 0 22px;
  border: 2px solid #67e8f9;
  border-radius: 14px;
  background: linear-gradient(145deg, #ecfeff 0%, #f8fafc 72%);
  box-shadow: 0 8px 24px rgba(8, 145, 178, 0.1);
  overflow: hidden;
}

.rm-change-hub-summary {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 9px;
  min-height: 68px;
  padding: 11px 14px;
  box-sizing: border-box;
  color: #164e63;
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}

.rm-change-hub-summary::-webkit-details-marker { display: none; }

.rm-change-hub-summary-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: #cffafe;
  font-size: 19px;
}

.rm-change-hub-summary-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.rm-change-hub-summary-copy small {
  color: #0e7490;
  font-size: 10px;
  font-weight: 800;
}

.rm-change-hub-summary-copy strong {
  font-size: 15px;
  line-height: 1.35;
}

.rm-change-hub-summary-action::before {
  content: '開く';
  color: #0891b2;
  font-size: 11px;
  font-weight: 800;
}

.rm-change-hub[open] .rm-change-hub-summary-action::before { content: '閉じる'; }

.rm-change-hub-chevron {
  color: #0891b2;
  font-size: 19px;
  line-height: 1;
  transition: transform 0.18s ease;
}

.rm-change-hub[open] .rm-change-hub-chevron { transform: rotate(180deg); }

.rm-change-hub-body {
  padding: 14px;
  border-top: 1px solid #a5f3fc;
}

.rm-change-hub-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.rm-change-hub-eyebrow {
  margin-bottom: 2px;
  color: #0e7490;
  font-size: 11px;
  font-weight: 800;
}

.rm-change-hub h4 {
  margin: 0;
  color: #164e63;
  font-size: 18px;
}

.rm-change-hub-step {
  flex-shrink: 0;
  padding: 5px 8px;
  border-radius: 999px;
  background: #cffafe;
  color: #155e75;
  font-size: 10px;
  font-weight: 800;
}

.rm-change-hub-guide {
  margin: 8px 0 12px;
  color: #475569;
  font-size: 12px;
  line-height: 1.6;
}

.rm-change-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.rm-change-action {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 8px;
  min-height: 72px;
  padding: 10px;
  border: 1.5px solid #bae6fd;
  border-radius: 11px;
  background: #fff;
  color: #0f172a;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.rm-change-action:hover {
  border-color: #0891b2;
  box-shadow: 0 5px 14px rgba(8, 145, 178, 0.12);
  transform: translateY(-1px);
}

.rm-change-action:active { transform: translateY(0); }

.rm-change-action:disabled {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.rm-change-action-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #ecfeff;
  font-size: 19px;
}

.rm-change-action--partial .rm-change-action-icon { background: #fff7ed; }
.rm-change-action--add .rm-change-action-icon { background: #ecfdf5; }
.rm-change-action--schedule { grid-column: 1 / -1; }
.rm-change-action--schedule .rm-change-action-icon { background: #eff6ff; }

.rm-change-action-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.rm-change-action-copy strong {
  color: inherit;
  font-size: 13px;
  line-height: 1.3;
}

.rm-change-action-copy small {
  color: #64748b;
  font-size: 10px;
  line-height: 1.35;
}

.rm-change-action-copy em {
  color: #b45309;
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
}

.rm-change-action-arrow {
  color: #0891b2;
  font-size: 22px;
  font-weight: 400;
}

.rm-change-pending {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1.5px solid #fca5a5;
  border-radius: 10px;
  background: #fff1f2;
  color: #9f1239;
  font: 700 11px inherit;
  cursor: pointer;
}

.rm-change-danger-zone {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed #fda4af;
}

.rm-change-danger-zone > span {
  display: block;
  margin-bottom: 6px;
  color: #9f1239;
  font-size: 10px;
  font-weight: 800;
}

.rm-change-danger {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 11px;
  border: 1.5px solid #fda4af;
  border-radius: 10px;
  background: #fff;
  color: #be123c;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.rm-change-danger span:nth-child(2) {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rm-change-danger strong { font-size: 12px; }
.rm-change-danger small { color: #881337; font-size: 9px; }
.rm-change-danger b { font-size: 20px; font-weight: 400; }

.rm-section-focus {
  animation: rmSectionFocus 1.8s ease;
}

@keyframes rmSectionFocus {
  0%, 100% { box-shadow: none; }
  25%, 75% { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2); }
}

/* --- 品目変更：数量を間違えにくくする --- */
.rm-item-change-intro {
  margin-bottom: 18px;
  padding: 13px;
  border: 1px solid #bae6fd;
  border-radius: 11px;
  background: #f0f9ff;
  color: #334155;
  font-size: 12px;
  line-height: 1.7;
}

.rm-item-change-total {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid #bae6fd;
}

.rm-application-review {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: -6px 0 16px;
  padding: 11px;
  border: 1.5px solid #f59e0b;
  border-radius: 10px;
  background: #fffbeb;
  color: #92400e;
  font-size: 11px;
  line-height: 1.6;
}

.rm-application-review input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: 0 0 auto;
}

.rm-quantity-input-row {
  display: grid;
  grid-template-columns: minmax(92px, 1fr) 18px minmax(90px, 120px) 18px;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.rm-quantity-input-row input {
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
}

.rm-quantity-help {
  margin-top: 7px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 11px;
  line-height: 1.5;
}

.rm-item-change-note {
  margin-top: 8px;
  color: #64748b;
  font-size: 10px;
  line-height: 1.5;
}

.rm-refund-guidance {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 9px;
  padding: 10px;
  border: 1.5px solid #fb7185;
  border-radius: 9px;
  background: #fff1f2;
  color: #9f1239;
  line-height: 1.55;
}

.rm-refund-guidance strong { font-size: 13px; }
.rm-refund-guidance span { font-size: 11px; }

.rm-refund-guidance button {
  margin-top: 5px;
  padding: 9px 10px;
  border: 1px solid #be123c;
  border-radius: 8px;
  background: #fff;
  color: #9f1239;
  font: 800 11px inherit;
  cursor: pointer;
}

.rm-refund-guidance--settlement { margin: 0 0 12px; }

.rm-add-payment-guidance {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 9px;
  padding: 10px;
  border: 1.5px solid #38bdf8;
  border-radius: 9px;
  background: #f0f9ff;
  color: #075985;
  line-height: 1.55;
}

.rm-add-payment-guidance strong { font-size: 13px; }
.rm-add-payment-guidance span { font-size: 11px; }
.rm-add-payment-guidance--settlement { margin: 0 0 12px; }

.rm-add-payment-guidance button {
  margin-top: 5px;
  padding: 9px 10px;
  border: 1px solid #0284c7;
  border-radius: 8px;
  background: #fff;
  color: #075985;
  font: 800 11px inherit;
  cursor: pointer;
}

.rm-sizing-guidance,
.rm-sizing-request,
.rm-sizing-pending {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 11px 12px;
  border: 1.5px solid #22c55e;
  border-radius: 10px;
  background: #f0fdf4;
  color: #166534;
}

.rm-sizing-guidance { margin-top: 9px; }
.rm-sizing-guidance strong,
.rm-sizing-request strong,
.rm-sizing-pending strong { font-size: 13px; }
.rm-sizing-guidance span,
.rm-sizing-request span,
.rm-sizing-pending span,
.rm-sizing-request small,
.rm-sizing-pending small { font-size: 11px; line-height: 1.55; }

.rm-sizing-request { margin-bottom: 12px; }
.rm-sizing-pending { margin: -10px 0 20px; border-color: #f97316; background: #fff7ed; color: #9a3412; }
.rm-sizing-pending > div:first-child { display: flex; flex-direction: column; gap: 3px; }
.rm-sizing-request-actions,
.rm-sizing-pending-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 3px; }
.rm-sizing-request-actions button,
.rm-sizing-pending-actions button {
  flex: 1 1 180px;
  padding: 9px 10px;
  border: 1.5px solid #16a34a;
  border-radius: 8px;
  background: #fff;
  color: #166534;
  font: 800 11px inherit;
  cursor: pointer;
}
.rm-sizing-request-actions .rm-sizing-line-button,
.rm-sizing-pending-actions button:first-child { background: #06c755; border-color: #06c755; color: #fff; }
.rm-sizing-request-actions button:disabled,
.rm-sizing-pending-actions button:disabled { cursor: wait; opacity: 0.7; }

.rm-section {
  margin-bottom: 20px;
}

.rm-section-title {
  font-size: 14px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 10px;
}

.rm-line-link-status {
  display: flex;
  align-items: center;
  gap: 8px 12px;
  flex-wrap: wrap;
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1.5px solid;
  border-radius: 10px;
  font-size: 11px;
  line-height: 1.55;
}

.rm-line-link-status strong {
  flex: 0 0 auto;
  font-size: 13px;
}

.rm-line-link-status span {
  flex: 1 1 230px;
}

.rm-line-link-status--linked {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.rm-line-link-status--unlinked {
  border-color: #fb923c;
  background: #fff7ed;
  color: #9a3412;
}

.rm-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.rm-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 14px;
}

.rm-info .lbl {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
}

/* --- 品目詳細 --- */
.rd-item {
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 8px;
  margin-bottom: 8px;
}

.rd-item-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

.rd-size {
  background: #e0f2fe;
  color: #0284c7;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  margin-left: 6px;
}

.rd-item-detail {
  font-size: 13px;
  color: #64748b;
}

.rd-item-returned {
  font-size: 12px;
  color: #10b981;
  margin-top: 4px;
}

/* --- 料金 --- */
.rm-price-grid {
  background: #f8fafc;
  border-radius: 8px;
  padding: 12px;
}

.rm-price-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 14px;
}

.rm-price-row.ext {
  color: #ef4444;
}

.rm-price-total {
  display: flex;
  justify-content: space-between;
  padding: 10px 0 0;
  margin-top: 8px;
  border-top: 2px solid #0891b2;
  font-size: 16px;
  font-weight: 700;
  color: #0891b2;
}

.rm-payment {
  margin-top: 8px;
  font-size: 13px;
  color: #64748b;
}

/* --- 申込書 --- */
.rm-badge-ok {
  color: #10b981;
  font-size: 14px;
  font-weight: 600;
}

.rm-badge-pending {
  color: #f59e0b;
  font-size: 14px;
  margin-bottom: 8px;
}

.rm-btn-link {
  background: #f1f5f9;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}

/* --- メモ --- */
.rm-memo {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}

.rm-memo:focus {
  outline: none;
  border-color: #0891b2;
}

/* --- フッターボタン --- */
.rm-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid #f1f5f9;
  flex-shrink: 0;
  background: white;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

.rm-footer-row {
  display: flex;
  gap: 8px;
}

.rm-footer-row .rm-btn {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.rm-btn {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  background: #f1f5f9;
  color: #475569;
}

.rm-btn:active { opacity: 0.8; }

.rm-btn-save {
  background: #0891b2;
  color: white;
}

.rm-btn-return {
  background: #10b981;
  color: white;
}

.rm-btn-extend {
  background: #f59e0b;
  color: white;
}

.rm-btn-delete {
  background: #fef2f2;
  color: #ef4444;
}

.rm-btn-customer {
  background: #e0f2f1;
  color: #00695c;
}

/* --- ダイアログ（返却/延長） --- */
.rental-dialog-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.rental-dialog {
  background: white;
  border-radius: 14px;
  padding: 24px;
  width: 100%;
  max-width: 400px;
  animation: popIn 0.25s ease;
}

@keyframes popIn {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.rental-dialog h3 {
  font-size: 17px;
  margin-bottom: 16px;
}

.rd-field {
  margin-bottom: 14px;
}

.rd-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 6px;
}

.rd-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.rd-actions .rm-btn {
  flex: 1;
}

/* --- 在庫マトリクス --- */
.inventory-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.inv-category {
  background: var(--card, #fff);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.inv-cat-header {
  padding: 10px 14px;
  background: #f8fafc;
  font-weight: 700;
  font-size: 14px;
  border-bottom: 1px solid #f1f5f9;
}

.inv-item {
  padding: 10px 14px;
  border-bottom: 1px solid #f8fafc;
}

.inv-item:last-child { border: none; }

.inv-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.inv-name {
  font-size: 14px;
  font-weight: 600;
}

.inv-price {
  font-size: 12px;
  color: #94a3b8;
}

.inv-stock {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inv-bar-bg {
  flex: 1;
  height: 8px;
  background: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
}

.inv-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.inv-count {
  font-size: 13px;
  white-space: nowrap;
  min-width: 80px;
  text-align: right;
}

.inv-reserved {
  color: #f59e0b;
  font-size: 11px;
}

/* --- 新規予約 商品選択 --- */
.rc-category {
  margin-bottom: 12px;
}

.rc-cat-label {
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 6px;
}

.rc-product-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 14px;
}

.rc-product-item:has(input:checked) {
  border-color: #0891b2;
  background: #ecfeff;
}

.rc-product-item input[type="checkbox"] {
  accent-color: #0891b2;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.rc-prod-name {
  flex: 1;
}

.rc-prod-price {
  color: #0891b2;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}

/* ==========================================
   売上レポート (RentalReportPage) — ★ v44
   ========================================== */

.rr-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.rr-summary-card {
  background: var(--card-bg, #fff);
  padding: 14px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.rr-summary-num {
  font-size: 20px;
  font-weight: 800;
}

.rr-summary-label {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

.rr-section-card {
  background: var(--card-bg, #fff);
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.rr-section-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 12px;
}

.rr-breakdown-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.rr-breakdown-card {
  background: var(--card-bg, #fff);
  padding: 14px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.rr-breakdown-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 8px;
}

/* --- ナイトテーマ対応 --- */
[data-theme="night"] .rental-card,
[data-theme="night"] .rental-filters,
[data-theme="night"] .inv-category {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="night"] .rf-input {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}

[data-theme="night"] .rental-modal,
[data-theme="night"] .rental-dialog {
  background: #1e293b;
  color: #e2e8f0;
}

[data-theme="night"] .rm-header,
[data-theme="night"] .rm-footer {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="night"] .rm-close {
  background: #334155;
  color: #e2e8f0;
}

[data-theme="night"] .rm-body {
  background: #1e293b;
}

[data-theme="night"] .rd-item {
  background: #0f172a;
}

[data-theme="night"] .rm-price-grid {
  background: #0f172a;
}

[data-theme="night"] .rc-product-item {
  border-color: #334155;
}

[data-theme="night"] .rc-product-item:has(input:checked) {
  background: #164e63;
  border-color: #0891b2;
}

[data-theme="night"] .inv-cat-header {
  background: #0f172a;
}

[data-theme="night"] .inv-bar-bg {
  background: #334155;
}

[data-theme="night"] .rm-memo {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}

[data-theme="night"] .rc-name {
  color: #f1f5f9;
}

[data-theme="night"] .rm-btn-link {
  background: #334155;
  color: #e2e8f0;
}

[data-theme="night"] .rm-change-hub {
  border-color: #155e75;
  background: linear-gradient(145deg, #083344 0%, #0f172a 72%);
}

[data-theme="night"] .rm-change-hub h4,
[data-theme="night"] .rm-change-hub-eyebrow { color: #a5f3fc; }
[data-theme="night"] .rm-change-hub-summary { color: #cffafe; }
[data-theme="night"] .rm-change-hub-summary-icon { background: #164e63; }
[data-theme="night"] .rm-change-hub-summary-copy small { color: #67e8f9; }
[data-theme="night"] .rm-change-hub-body { border-top-color: #155e75; }
[data-theme="night"] .rm-change-hub-guide { color: #cbd5e1; }
[data-theme="night"] .rm-change-hub-step { background: #164e63; color: #cffafe; }
[data-theme="night"] .rm-change-action { background: #1e293b; border-color: #334155; color: #f1f5f9; }
[data-theme="night"] .rm-change-action-copy small { color: #94a3b8; }
[data-theme="night"] .rm-change-action:disabled { background: #0f172a; color: #64748b; }
[data-theme="night"] .rm-change-danger { background: #1e293b; border-color: #9f1239; }
[data-theme="night"] .rm-change-danger small { color: #fda4af; }
[data-theme="night"] .rm-item-change-intro { background: #0c4a6e; border-color: #075985; color: #e0f2fe; }
[data-theme="night"] .rm-application-review { background: #422006; border-color: #b45309; color: #fde68a; }
[data-theme="night"] .rm-quantity-input-row { color: #e2e8f0; }
[data-theme="night"] .rm-quantity-help { background: #431407; color: #fed7aa; }
[data-theme="night"] .rm-item-change-note { color: #94a3b8; }
[data-theme="night"] .rm-refund-guidance { background: #4c0519; border-color: #be123c; color: #fecdd3; }
[data-theme="night"] .rm-refund-guidance button { background: #1e293b; color: #fecdd3; }
[data-theme="night"] .rm-add-payment-guidance { background: #082f49; border-color: #0369a1; color: #bae6fd; }
[data-theme="night"] .rm-add-payment-guidance button { background: #1e293b; color: #bae6fd; }
[data-theme="night"] .rm-sizing-guidance,
[data-theme="night"] .rm-sizing-request { background: #052e16; border-color: #15803d; color: #bbf7d0; }
[data-theme="night"] .rm-sizing-pending { background: #431407; border-color: #c2410c; color: #fed7aa; }
[data-theme="night"] .rm-sizing-request-actions button,
[data-theme="night"] .rm-sizing-pending-actions button { background: #1e293b; color: #bbf7d0; }


/* ==========================================
   レンタルダッシュボード (RentalDashboardPage)
   ========================================== */

.rdash-loading {
  text-align: center;
  padding: 60px 20px;
  color: #94a3b8;
  font-size: 14px;
}

.rdash-date-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0 8px;
  flex-wrap: wrap;
  gap: 4px;
}

.rdash-date-header h2 {
  font-size: 20px;
  font-weight: 700;
}

.rdash-dow {
  margin-left: 6px;
  font-size: 15px;
  font-weight: 700;
  color: #0891b2;
}

.rdash-badge-online {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 600;
  background: #dcfce7;
  color: #16a34a;
}

/* --- サマリーカード --- */
.rdash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.rdash-stat {
  background: var(--card, #fff);
  border-radius: 10px;
  padding: 14px 8px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.rdash-stat-num {
  display: block;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.rdash-stat-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  margin-top: 2px;
}

.rdash-stat-revenue {
  background: linear-gradient(135deg, #ecfeff, #e0f7fa);
}

.rdash-stat-revenue .rdash-stat-num {
  color: #0891b2;
}

.rdash-stat-alert {
  background: #fef2f2;
}

.rdash-stat-alert .rdash-stat-num {
  color: #ef4444;
}

/* --- 超過アラート --- */
.rdash-alert-card {
  background: #fef2f2;
  border: 1.5px solid #fecaca;
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
}

.rdash-alert-title {
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  color: #dc2626;
  border-bottom: 1px solid #fecaca;
}

.rdash-alert-row {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #fee2e2;
}

.rdash-alert-row:last-child { border: none; }
.rdash-alert-row:active { background: #fee2e2; }

.rdash-alert-name {
  font-size: 14px;
  font-weight: 700;
}

.rdash-alert-detail {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.rdash-alert-phone {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}

/* --- セクションカード --- */
.rdash-section-card {
  background: var(--card, #fff);
  border-radius: 10px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  overflow: hidden;
}

.rdash-section-title {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  border-bottom: 1px solid #f1f5f9;
  background: #f8fafc;
}

/* --- タイムライン行 --- */
.rdash-timeline-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #f8fafc;
  cursor: pointer;
}

.rdash-timeline-row:last-child { border: none; }
.rdash-timeline-row:active { background: #f1f5f9; }

.rdash-timeline-time {
  font-size: 14px;
  font-weight: 700;
  color: #0891b2;
  min-width: 44px;
  text-align: center;
}

.rdash-timeline-body {
  flex: 1;
  min-width: 0;
}

.rdash-timeline-name {
  font-size: 14px;
  font-weight: 600;
}

.rdash-timeline-items {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rdash-timeline-price {
  font-size: 14px;
  font-weight: 700;
  color: #0891b2;
  white-space: nowrap;
}

/* --- 在庫サマリ --- */
.rdash-stock-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid #f8fafc;
}

.rdash-stock-row:last-child { border: none; }

.rdash-stock-name {
  font-size: 13px;
  font-weight: 600;
  min-width: 100px;
}

.rdash-stock-bar-bg {
  flex: 1;
  height: 8px;
  background: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
}

.rdash-stock-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.rdash-stock-count {
  font-size: 12px;
  min-width: 50px;
  text-align: right;
  white-space: nowrap;
}

/* --- ナイトテーマ対応 --- */
[data-theme="night"] .rdash-stat {
  background: #1e293b;
}

[data-theme="night"] .rdash-stat-revenue {
  background: linear-gradient(135deg, #0f2027, #164e63);
}

[data-theme="night"] .rdash-stat-alert {
  background: #2d1a1a;
}

[data-theme="night"] .rdash-section-card {
  background: #1e293b;
}

[data-theme="night"] .rdash-section-title {
  background: #0f172a;
  border-color: #334155;
}

[data-theme="night"] .rdash-timeline-row {
  border-color: #334155;
}

[data-theme="night"] .rdash-timeline-row:active {
  background: #334155;
}

[data-theme="night"] .rdash-timeline-name {
  color: #f1f5f9;
}

[data-theme="night"] .rdash-stock-bar-bg {
  background: #334155;
}

[data-theme="night"] .rdash-stock-row {
  border-color: #334155;
}

[data-theme="night"] .rdash-alert-card {
  background: #2d1a1a;
  border-color: #7f1d1d;
}

[data-theme="night"] .rdash-alert-title {
  color: #fca5a5;
  border-color: #7f1d1d;
}

[data-theme="night"] .rdash-alert-row {
  border-color: #451a1a;
}

[data-theme="night"] .rdash-alert-row:active {
  background: #451a1a;
}

/* --- レポート ナイトテーマ --- */
[data-theme="night"] .rr-summary-card,
[data-theme="night"] .rr-section-card,
[data-theme="night"] .rr-breakdown-card {
  background: #1e293b;
}

[data-theme="night"] .rr-summary-label {
  color: #94a3b8;
}

/* ==========================================
   ★ v44: レスポンシブ対応（スマホ最適化）
   ブレイクポイント: style.css に合わせて 768px
   ========================================== */

@media (max-width: 768px) {

  .rm-change-hub {
    margin-bottom: 18px;
  }

  .rm-change-hub-summary {
    grid-template-columns: 36px minmax(0, 1fr) auto 16px;
    min-height: 64px;
    padding: 10px 12px;
  }

  .rm-change-hub-summary-icon { width: 36px; height: 36px; }
  .rm-change-hub-body { padding: 12px; }

  .rm-change-hub-head {
    flex-direction: column;
    gap: 7px;
  }

  .rm-change-hub h4 { font-size: 17px; }
  .rm-change-hub-step { align-self: flex-start; }

  .rm-change-actions { grid-template-columns: 1fr; }

  .rm-change-action {
    min-height: 64px;
    padding: 9px 10px;
  }

  .rm-change-action-copy strong { font-size: 13px; }
  .rm-change-action-copy small { font-size: 10px; }

  .rm-change-pending {
    align-items: flex-start;
    flex-direction: column;
  }

  .rm-quantity-input-row {
    grid-template-columns: minmax(82px, 1fr) 16px minmax(74px, 96px) 16px;
    gap: 5px;
  }

  /* --- ページ共通 --- */
  .rental-page {
    padding: 0 2px;
  }

  /* --- フィルタバー --- */
  .rf-row {
    flex-wrap: wrap;
  }

  .rf-row .rf-input[type="date"] {
    flex: 0 0 calc(50% - 16px);
    font-size: 13px;
    padding: 8px 10px;
  }

  .rf-row .rf-input[type="text"] {
    flex: 1 1 100%;
    order: 1;
  }

  .rf-sep {
    flex: 0 0 auto;
  }

  .rf-actions {
    flex-direction: row;
  }

  .rf-btn-filter,
  .rf-btn-add {
    font-size: 13px;
    padding: 10px 12px;
    flex: 1;
  }

  /* --- ステータスタブ --- */
  .rb-status-tabs {
    gap: 4px !important;
    padding: 0 0 6px !important;
    margin-bottom: 6px !important;
  }

  .rb-tab {
    font-size: 11px !important;
    padding: 6px 10px !important;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .rb-tab-count {
    font-size: 10px !important;
  }

  /* --- 予約カード --- */
  .rental-card {
    padding: 12px;
  }

  .rc-name {
    font-size: 15px;
  }

  .rc-items {
    font-size: 12px;
  }

  .rc-total {
    font-size: 15px;
  }

  .rc-footer {
    flex-wrap: wrap;
    gap: 4px;
  }

  /* --- ワンタップ操作ボタン --- */
  .rb-actions {
    flex-wrap: wrap;
    gap: 4px;
  }

  .rb-actions button {
    font-size: 11px !important;
    padding: 5px 8px !important;
  }

  /* --- モーダル --- */
  .rental-modal {
    max-width: 100%;
    border-radius: 14px 14px 0 0;
    max-height: 95vh;
  }

  .rm-header {
    padding: 14px 16px;
  }

  .rm-header h3 {
    font-size: 16px;
  }

  .rm-body {
    padding: 14px 16px;
  }

  .rm-info-grid {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .rm-section-title {
    font-size: 13px;
  }

  .rm-info .lbl {
    font-size: 10px;
  }

  .rm-info {
    font-size: 13px;
  }

  /* --- モーダルフッター --- */
  .rm-footer {
    padding: 10px 16px;
    gap: 6px;
  }

  .rm-footer-row {
    gap: 6px;
  }

  .rm-btn {
    padding: 10px 10px;
    font-size: 12px;
  }

  /* --- ダイアログ（返却/延長） --- */
  .rental-dialog-overlay {
    padding: 12px;
  }

  .rental-dialog {
    padding: 20px;
  }

  /* --- 在庫マトリクス --- */
  .inv-item-header {
    flex-wrap: wrap;
    gap: 4px;
  }

  .inv-count {
    min-width: 60px;
    font-size: 12px;
  }

  /* --- 新規予約 商品選択 --- */
  .rc-product-item {
    font-size: 13px;
    padding: 8px;
    gap: 6px;
  }

  .rc-prod-price {
    font-size: 12px;
  }

  /* --- ダッシュボード サマリーカード --- */
  .rdash-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .rdash-stat {
    padding: 10px 6px;
  }

  .rdash-stat-num {
    font-size: 18px;
  }

  .rdash-stat-label {
    font-size: 9px;
  }

  /* --- ダッシュボード 日付ヘッダー --- */
  .rdash-date-header h2 {
    font-size: 18px;
  }

  .rdash-dow {
    font-size: 14px;
  }

  /* --- ダッシュボード タイムライン --- */
  .rdash-timeline-row {
    gap: 8px;
    padding: 8px 12px;
  }

  .rdash-timeline-time {
    font-size: 13px;
    min-width: 38px;
  }

  .rdash-timeline-name {
    font-size: 13px;
  }

  .rdash-timeline-items {
    font-size: 11px;
  }

  .rdash-timeline-price {
    font-size: 13px;
  }

  /* --- ダッシュボード 在庫サマリ --- */
  .rdash-stock-name {
    font-size: 12px;
    min-width: 80px;
  }

  .rdash-stock-count {
    font-size: 11px;
    min-width: 40px;
  }

  /* --- セクションカード --- */
  .rdash-section-title {
    font-size: 12px;
    padding: 8px 12px;
  }

  /* --- 超過アラート --- */
  .rdash-alert-title {
    font-size: 13px;
    padding: 8px 12px;
  }

  .rdash-alert-row {
    padding: 8px 12px;
  }

  .rdash-alert-name {
    font-size: 13px;
  }

  .rdash-alert-detail {
    font-size: 11px;
  }

  /* --- 売上レポート --- */
  .rr-summary-grid {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
  }

  .rr-summary-card {
    padding: 10px 6px;
  }

  .rr-summary-num {
    font-size: 16px;
  }

  .rr-summary-label {
    font-size: 10px;
  }

  .rr-section-card {
    padding: 12px;
  }

  .rr-section-title {
    font-size: 14px;
    margin: 0 0 10px;
  }

  .rr-breakdown-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .rr-breakdown-card {
    padding: 12px;
  }
}

/* --- 極小画面（375px以下 = iPhone SE等） --- */
@media (max-width: 375px) {
  .rf-row .rf-input[type="date"] {
    flex: 1 1 100%;
    font-size: 12px;
  }

  .rf-sep {
    display: none;
  }

  .rdash-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
  }

  .rdash-stat-num {
    font-size: 16px;
  }

  .rm-btn {
    padding: 8px 6px;
    font-size: 11px;
  }

  .rental-card {
    padding: 10px;
  }

  .rc-name {
    font-size: 14px;
  }

  .rr-summary-grid {
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }

  .rr-summary-grid .rr-summary-card:last-child {
    grid-column: span 2;
  }

  .rr-summary-num {
    font-size: 14px;
  }
}

/* ==========================================
   ★ S183: タブを6枚へ絞った分の受け皿
   - .rental-subheader   タブから外した画面の「戻り先」バー
   - .rdash-quick        ホームの大きいボタン（カレンダー・在庫・売上ほか）
   - .rset-admin         設定の「マスタ管理」（商品・BOX）
   ========================================== */

/* --- サブ画面の戻りバー ---
   各ページの render() が #main-content をまるごと書き換えるため、
   バーは #main-content の外に固定で置き、本文の位置は body のクラスでずらす。 */
.rental-subheader {
  position: fixed;
  top: var(--header-h, 54px);
  left: 0; right: 0;
  z-index: 99;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.rental-subheader-back {
  flex: 0 0 auto;
  padding: 7px 12px;
  border: 1.5px solid #cbd5e1;
  border-radius: 9px;
  background: #f8fafc;
  color: #334155;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.rental-subheader-title {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.rental-subpage .main-content {
  margin-top: calc(var(--header-h, 54px) + 44px);
}

/* --- ホームの大きいボタン --- */
.rdash-quick {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.rdash-quick-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 66px;
  padding: 12px 6px;
  border: 1px solid #dbe7e4;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  font-family: inherit;
  cursor: pointer;
}

.rdash-quick-btn:active {
  background: #f0fdfa;
}

.rdash-quick-icon {
  font-size: 22px;
  line-height: 1;
}

.rdash-quick-label {
  font-size: 11px;
  font-weight: 800;
  color: #334155;
  text-align: center;
  line-height: 1.3;
}

/* 未割当メールの件数。0件のときはJS側で display:none のままにする。 */
.rdash-quick-badge {
  position: absolute;
  top: 6px; right: 8px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- ホームからツアー画面へ戻る --- */
.rdash-exit-tour {
  padding: 6px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  background: #fff;
  color: #64748b;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

/* --- 設定のマスタ管理 --- */
.rset-admin {
  padding: 16px;
  margin-bottom: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
}

.rset-admin h3 {
  margin: 0 0 7px;
  font-size: 14px;
  color: #334155;
}

.rset-admin p {
  margin: 0 0 12px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.7;
}

.rset-admin-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

@media (min-width: 1024px) {
  /* PCではナビが左の縦帯になるので、戻りバーもその右へ寄せる。 */
  .rental-subheader { left: 76px; }
}
