@charset "UTF-8";
.flash-message {
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  z-index: 9999;
  padding: 0 15px;
  text-align: center;
}

.notice {
  background-color: #d4edda;
  color: #155724;
  padding: 10px;
  border-radius: 5px;
}

.alert {
  background-color: #f8d7da;
  color: #721c24;
  padding: 10px;
  border-radius: 5px;
}

/* fixed-topナビゲーションバーのためのbodyパディング */
body {
  padding-top: 70px;
}

/* かっこいいフォント設定 */
.navbar-brand {
  font-family: "Poppins", sans-serif !important;
  font-weight: 700 !important;
  font-size: 1.5rem !important;
  letter-spacing: 0.5px !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

.carousel-inner img {
  height: 400px;
  object-fit: cover;
}

footer a:hover {
  text-decoration: underline;
}

.extra-padding {
  padding-left: 10rem !important;
  padding-right: 10rem !important;
}
@media (max-width: 768px) {
  .extra-padding {
    padding-left: 3rem !important;
    padding-right: 3rem !important;
  }
}

@media (max-width: 768px) {
  #law .title {
    font-size: 20px;
  }
  #terms .title {
    font-size: 20px;
  }
  #privacy .title {
    font-size: 20px;
  }
}
#user-show .hover-pointer:hover {
  background-color: #f8f9fa;
  cursor: pointer;
}
#user-show .text-purple {
  color: #8e44ad;
}
#user-show .sticky-top {
  position: sticky;
  top: 60px;
  /* ← ここを0から60pxなどに変更 */
  z-index: 1030;
  background-color: white;
}

#mypage .hover-pointer:hover {
  background-color: #f8f9fa;
  cursor: pointer;
}
#mypage .text-purple {
  color: #d63384;
}
#mypage .month-selector-wrapper {
  top: 56px;
  /* navbar高さ */
  z-index: 1020;
  padding-top: 5px;
  padding-bottom: 5px;
}
#mypage .user-info-wrapper {
  top: 110px;
  /* selectorの下 */
  z-index: 1010;
}
#mypage .sticky-top {
  position: sticky;
}
#mypage .z-index-sticky {
  z-index: 1030;
}

#sales-index .month-selector-wrapper {
  position: sticky;
  top: 56px;
  /* ナビバーの高さ */
  z-index: 1020;
  padding-top: 8px;
  padding-bottom: 8px;
  background-color: white;
}
#sales-index .z-index-sticky {
  z-index: 1030;
}

.dropdown-menu-custom {
  z-index: 99999 !important;
  position: absolute !important;
}

.nav-item.dropdown {
  position: relative !important;
}

.navbar-nav .dropdown-menu {
  z-index: 99999 !important;
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
}

.navbar-logo {
  height: 32px;
  width: auto;
  max-width: 40px;
}

.navbar-brand {
  font-size: 1.25rem;
  font-weight: 500;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (max-width: 768px) {
  body {
    padding-top: 60px;
  }
  .navbar-logo {
    height: 28px;
    max-width: 35px;
  }
  .navbar-brand {
    font-size: 1.1rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}
#custom-slider {
  position: relative;
  width: 100%;
  height: auto;
  overflow: hidden;
}
#custom-slider .slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  transition: opacity 5s ease-in-out;
  z-index: 0;
  text-align: center;
}
#custom-slider .slide.active {
  opacity: 1;
  z-index: 1;
  position: relative;
}
#custom-slider .slide img {
  width: 100vw;
  height: 66vh;
  object-fit: cover;
  display: block;
  margin: 0 auto;
  max-width: none;
}
#custom-slider .slide .caption {
  position: absolute;
  bottom: 10%;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  text-align: center;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}
#custom-slider .slide .caption h2 {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: bold;
  margin-bottom: 1rem;
  white-space: nowrap;
}
#custom-slider .slide .caption p {
  font-size: clamp(1rem, 3vw, 1.8rem);
  white-space: nowrap;
}

@media (max-width: 576px) {
  #custom-slider .slide .caption h2 {
    font-size: 1.6rem;
  }
  #custom-slider .slide .caption p {
    font-size: 1.1rem;
  }
}
#slider-dots .dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin: 0 5px;
  background-color: #ccc;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
#slider-dots .dot.active {
  background-color: #b47c4d;
}

#slider-dots {
  background-color: #f8f9fa;
  padding: 12px 0;
}

#works {
  position: relative;
  scroll-margin-top: 300px;
}
#works .works-title {
  margin-bottom: 50px;
}
#works .work-card {
  background-color: white;
  padding: 16px;
  border-radius: 12px;
  transition: background-color 0.3s ease;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}
#works .work-card:hover {
  background-color: rgba(222, 205, 178, 0.7411764706) !important;
}
#works .work-card img {
  border-radius: 8px;
  margin-bottom: 12px;
}
#works .work-card .work-title {
  font-weight: 600;
  font-size: 1.1rem;
}
#works .work-card .work-description {
  font-size: 0.95rem;
  color: #444;
}

/* ✨ Fadein 基本 */
.fadein {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s ease, transform 1s ease;
}

/* ✨ 表示時 */
.fadein.show {
  opacity: 1;
  transform: translateY(0);
}

/* ✨ 順番付き遅延（delay-1 ～ delay-6） */
.fadein.delay-1 {
  transition-delay: 0s;
}

.fadein.delay-2 {
  transition-delay: 0.1s;
}

.fadein.delay-3 {
  transition-delay: 0.2s;
}

.fadein.delay-4 {
  transition-delay: 0.3s;
}

.fadein.delay-5 {
  transition-delay: 0.4s;
}

.fadein.delay-6 {
  transition-delay: 0.5s;
}

/* ✨ Bootstrap Carousel Smooth FadeIn / FadeOut */
.carousel-fade .carousel-inner {
  position: relative;
  background-color: #000;
}

.carousel-fade .carousel-item {
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* 表示中のアイテムにだけ透過解除・上に重ねる */
.carousel-fade .carousel-item.active {
  opacity: 1;
  z-index: 1;
  position: relative;
}

/* 前後アニメーション中も同様の効果にする */
.carousel-fade .carousel-item-next.carousel-item-left,
.carousel-fade .carousel-item-prev.carousel-item-right {
  opacity: 1;
  z-index: 1;
  position: relative;
}

.carousel-item img {
  transition: opacity 1.5s ease-in-out;
}

#features p {
  max-width: 220px;
  margin: 0 auto;
  text-align: center;
  font-size: 16px;
}
#features h4.hover-effect {
  display: inline-block;
  transition: all 0.3s ease;
  position: relative;
  font-weight: 600;
}
#features h4.hover-effect:hover {
  transform: translateY(-3px) scale(1.05);
  color: #b47c4d;
}
@media (max-width: 1000px) {
  #features p {
    font-size: 14px !important;
  }
  #features h4 {
    font-size: 20px !important;
  }
}

.concept-section {
  background: #f9f9f9;
  padding: 80px 20px;
  text-align: center;
}
.concept-section .section-title {
  font-size: 2.2rem;
  font-weight: bold;
  margin-bottom: 40px;
}
.concept-section .concept-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
}
.concept-section .concept-image {
  flex: 1;
  min-width: 320px;
}
.concept-section .concept-image img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}
.concept-section .concept-image .concept-caption {
  font-size: 0.95rem;
  margin-top: 10px;
  text-align: left;
}
.concept-section .concept-points {
  flex: 1;
  min-width: 320px;
}
.concept-section .concept-points .point {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 30px;
  text-align: left;
}
.concept-section .concept-points .point .concept-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  margin-top: 4px;
  flex-shrink: 0;
}
.concept-section .concept-points .point h4 {
  font-weight: bold;
  font-size: 1.2rem;
  margin-bottom: 5px;
}
.concept-section .concept-points .point p {
  margin: 0;
  font-size: 0.95rem;
}

#inquiries, #inquiry, #answer {
  padding: 100px;
}

@media (max-width: 768px) {
  #inquiries, #inquiry, #answer {
    padding: 100px 20px;
  }
}
@media (max-width: 500px) {
  #inquiries, #inquiry, #answer {
    font-size: 10px;
  }
}
.clickable-row:hover {
  background-color: #f8f9fa !important;
}

.incentive-container {
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.incentive-main-content {
  padding-top: 30px;
}

.incentive-header-controls {
  gap: 0.5rem;
}

.incentive-month-input {
  width: 160px;
}

.incentive-summary-card {
  background: linear-gradient(135deg, #87ceeb 0%, #b0e0e6 100%);
  color: #2c3e50;
  border: none;
}
.incentive-summary-card .card-body {
  padding: 2rem;
}
.incentive-summary-card .summary-item {
  text-align: center;
}
.incentive-summary-card .summary-item .summary-label {
  font-size: 0.9rem;
  opacity: 0.9;
  margin-bottom: 0.5rem;
}
.incentive-summary-card .summary-item .summary-value {
  font-size: 1.8rem;
  font-weight: bold;
  margin-bottom: 0;
}
.incentive-summary-card .summary-item .summary-subvalue {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0;
}

.incentive-category-card {
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.incentive-category-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}
.incentive-category-card .category-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}
.incentive-category-card .category-amount {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}
.incentive-category-card .category-count {
  font-size: 0.9rem;
  color: #6c757d;
}

.hierarchy-table .user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e9ecef;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: #495057;
  margin-right: 0.5rem;
}
.hierarchy-table .level-badge {
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
}
.hierarchy-table .sales-amount {
  font-weight: 600;
  color: #28a745;
}
.hierarchy-table .incentive-amount {
  font-weight: 600;
  color: #007bff;
}

.date-selector-card {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
}
.date-selector-card .quick-select-buttons .btn {
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

.breadcrumb-custom {
  background: transparent;
  padding: 0;
  margin-bottom: 1.5rem;
}
.breadcrumb-custom .breadcrumb-item {
  font-size: 0.9rem;
}
.breadcrumb-custom .breadcrumb-item.active {
  color: #6c757d;
}
.breadcrumb-custom .breadcrumb-item a {
  color: #007bff;
  text-decoration: none;
}
.breadcrumb-custom .breadcrumb-item a:hover {
  text-decoration: underline;
}

.level-history-card .timeline-item {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 1rem;
}
.level-history-card .timeline-item:before {
  content: "";
  position: absolute;
  left: 0.5rem;
  top: 0.5rem;
  width: 0.5rem;
  height: 0.5rem;
  background: #007bff;
  border-radius: 50%;
}
.level-history-card .timeline-item:after {
  content: "";
  position: absolute;
  left: 0.75rem;
  top: 1rem;
  width: 1px;
  height: calc(100% - 0.5rem);
  background: #e9ecef;
}
.level-history-card .timeline-item:last-child:after {
  display: none;
}
.level-history-card .timeline-item .timeline-date {
  font-size: 0.8rem;
  color: #6c757d;
  margin-bottom: 0.25rem;
}
.level-history-card .timeline-item .timeline-content {
  font-size: 0.9rem;
}

.export-buttons .btn {
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #6c757d;
}
.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}
.empty-state .empty-message {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}
.empty-state .empty-description {
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .incentive-container {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }
  .incentive-summary-card .card-body {
    padding: 1.5rem;
  }
  .incentive-summary-card .summary-item {
    margin-bottom: 1.5rem;
  }
  .incentive-summary-card .summary-item:last-child {
    margin-bottom: 0;
  }
  .hierarchy-table {
    font-size: 0.9rem;
  }
  .hierarchy-table .user-avatar {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
  }
  .export-buttons {
    text-align: center;
  }
  .export-buttons .btn {
    width: 100%;
    margin-right: 0;
    margin-bottom: 0.5rem;
  }
}
@media (max-width: 576px) {
  .incentive-summary-card .summary-value {
    font-size: 1.5rem;
  }
  .incentive-summary-card .summary-subvalue {
    font-size: 1rem;
  }
  .incentive-category-card .category-amount {
    font-size: 1.3rem;
  }
}
eakdown.html.erb .breakdown-item {
  padding: 1rem;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  text-align: center;
  margin-bottom: 1rem;
}

.breakdown-label {
  font-size: 0.9rem;
  color: #6c757d;
  margin-bottom: 0.5rem;
}

.breakdown-value {
  font-size: 1.5rem;
  font-weight: bold;
}

.incentive-summary-card .summary-value {
  font-size: 2rem;
  font-weight: bold;
}

.table th {
  font-weight: 600;
  font-size: 0.9rem;
}

.table td {
  font-size: 0.9rem;
}

#admin {
  padding: 100px 0;
}

@media (max-width: 768px) {
  #admin {
    padding: 100px 20px;
  }
}
.referral-link {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 1rem;
}
.referral-link:hover {
  background-color: #f8f9fa;
  cursor: pointer;
}

.inactive-user {
  background-color: #f8f9fa !important;
  opacity: 0.7;
  border: 2px solid #dee2e6 !important;
}
.inactive-user .user-name {
  color: #6c757d !important;
}
.inactive-user .user-stats {
  color: #6c757d !important;
}
.inactive-user:hover {
  opacity: 0.8;
}

.user-node-link:has(.inactive-user) .user-node {
  background-color: #f8f9fa;
  border-color: #dee2e6;
  opacity: 0.7;
}

.admin-purchases-edit .page-header {
  margin-top: 40px;
}
.admin-purchases-edit .card {
  border: none;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}
.admin-purchases-edit .card-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
}
.admin-purchases-edit .form-control-lg {
  font-size: 1.1rem;
  padding: 0.75rem 1rem;
}
.admin-purchases-edit .input-group-text {
  font-weight: bold;
  background-color: #e9ecef;
}
.admin-purchases-edit .border-primary {
  border-color: #0d6efd !important;
}
@media (max-width: 768px) {
  .admin-purchases-edit .d-flex.justify-content-between {
    flex-direction: column;
    align-items: flex-start !important;
  }
  .admin-purchases-edit .me-2 {
    margin-bottom: 0.5rem;
    margin-right: 0 !important;
  }
}

.html.erb .card {
  border: none;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.card-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
}

.form-control-lg {
  font-size: 1.1rem;
  padding: 0.75rem 1rem;
}

.input-group-text {
  font-weight: bold;
  background-color: #e9ecef;
}

.border-success {
  border-color: #198754 !important;
}

.form-select {
  font-size: 1rem;
}

/* 検索欄のスタイル */
#user_search {
  border: 2px solid #e9ecef;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

#user_search:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

#user_search::placeholder {
  color: #6c757d;
  font-style: italic;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .d-flex.justify-content-between {
    flex-direction: column;
    align-items: flex-start !important;
  }
  .me-2 {
    margin-bottom: 0.5rem;
    margin-right: 0 !important;
  }
  .row.mb-3 {
    margin-bottom: 1rem !important;
  }
}
.table th {
  border-top: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.table td {
  vertical-align: middle;
  font-size: 0.9rem;
}

.badge {
  font-size: 0.75rem;
}

.table-hover tbody tr:hover {
  background-color: rgba(0, 123, 255, 0.05);
}

.clickable-row:hover {
  background-color: rgba(0, 123, 255, 0.1) !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .d-flex.justify-content-between {
    flex-direction: column;
    align-items: flex-start !important;
  }
  .d-flex.align-items-center.me-3 {
    margin-top: 1rem;
    margin-right: 0 !important;
  }
  .table-responsive {
    font-size: 0.8rem;
  }
  .card-body {
    padding: 1rem 0.5rem;
  }
}
.admin-users-container {
  padding-top: 80px;
}

.timeline {
  position: relative;
  padding-left: 15px;
  max-width: 100%;
}

.timeline-item {
  position: relative;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-left: 2px solid #dee2e6;
}
.timeline-item:last-child {
  border-left: none;
  margin-bottom: 0;
}
.timeline-item.current .timeline-content {
  background: #d4edda;
  border-left-color: #28a745;
}

.timeline-marker {
  position: absolute;
  left: -6px;
  top: 5px;
  background: white;
  border-radius: 50%;
  width: 12px;
  height: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.timeline-content {
  margin-left: 10px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 3px solid #007bff;
  text-align: center;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}
@media (max-width: 768px) {
  .edit-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem;
  }
  .edit-title {
    white-space: nowrap !important;
    font-size: 1.3rem !important;
    margin-bottom: 0 !important;
    align-self: flex-start !important;
    text-align: left !important;
  }
  .edit-buttons {
    display: flex !important;
    gap: 0.75rem !important;
    width: 100%;
  }
  .edit-buttons .btn {
    flex: 1 !important;
    margin-right: 0 !important;
  }
}
.total-sales-volume {
  color: #9400d3;
}

.wott-purchase-count {
  color: #ff6b6b;
}

.stats-card {
  transition: all 0.3s ease;
  border: none;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stats-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.clickable-card {
  cursor: pointer;
}

.clickable-card:hover {
  transform: translateY(-8px) !important;
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.3) !important;
}

.stats-icon {
  opacity: 0.8;
}

.stats-number {
  font-weight: 700;
  margin: 0;
}

.stats-label {
  font-weight: 500;
  opacity: 0.9;
}

/* レベル別統計のスタイル */
.level-stats-list {
  font-size: 0.9rem;
}

.level-stat-item {
  display: flex;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.level-stat-item:last-child {
  border-bottom: none;
}

.level-stat-item .level-name {
  flex: 1;
  margin-left: 0.5rem;
  font-size: 0.85rem;
}

.level-stat-item .level-count {
  font-weight: 600;
  min-width: 40px;
  text-align: right;
  font-size: 0.9rem;
}

.financial-item {
  margin-bottom: 1rem;
}

.financial-item:last-child {
  margin-bottom: 0;
}

/* レベル変更申請表示のスタイル */
.level-change-application {
  background-color: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 0.375rem;
  padding: 0.75rem;
}

.level-change-text {
  font-weight: 500;
  color: #856404;
}

.application-details {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #ffeaa7;
}

/* 基本情報テーブルのスタイル */
.table-borderless td {
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-all;
  hyphens: auto;
}

/* 住所専用スタイル */
.address-cell {
  max-width: 1px !important;
  width: 1px !important;
}

.address-content {
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  word-break: break-all !important;
  white-space: normal !important;
  line-height: 1.4;
}

.address-text {
  display: block;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  word-break: break-all !important;
  white-space: normal !important;
}

/* 下位ユーザーの購入履歴行のスタイル */
.descendant-purchase-row {
  background-color: #f8f9fa !important;
}

.descendant-purchase-row:hover {
  background-color: #e9ecef !important;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  /* ヘッダーの上部余白を小さくする */
  .mobile-header {
    margin-top: 20px !important;
  }
  .stats-card {
    margin-bottom: 1rem;
  }
  .stats-number {
    font-size: 1.5rem !important;
  }
  .stats-icon i {
    font-size: 1.5rem !important;
  }
  .level-stats-section,
  .financial-stats-section {
    margin-bottom: 1.5rem;
  }
  .level-stat-item {
    padding: 0.3rem 0;
  }
  .level-stat-item .level-name {
    font-size: 0.8rem;
  }
  .level-stat-item .level-count {
    font-size: 0.85rem;
    min-width: 35px;
  }
  /* 基本情報テーブルのモバイル対応 */
  .table-borderless th {
    width: 35% !important;
    font-size: 0.85rem;
    padding: 0.5rem 0.25rem;
    vertical-align: top;
  }
  .table-borderless td {
    width: 65% !important;
    font-size: 0.85rem;
    padding: 0.5rem 0.25rem;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: break-all !important;
    hyphens: auto !important;
    max-width: 0;
  }
  /* メールアドレスと住所の特別な処理 */
  .table-borderless td.text-break {
    line-height: 1.4;
    white-space: normal !important;
  }
  /* 住所セルの強制改行 */
  .address-cell {
    max-width: 0 !important;
    width: 65% !important;
    overflow: hidden !important;
  }
  .address-content {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: break-all !important;
    white-space: normal !important;
    line-height: 1.3 !important;
    font-size: 0.8rem !important;
  }
  .address-text {
    display: block !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: break-all !important;
    white-space: normal !important;
  }
}
.hierarchy-container-vertical {
  font-family: "Courier New", monospace;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 8px;
  overflow: auto;
  min-height: 400px;
}

.hierarchy-row {
  display: flex;
  align-items: flex-start;
  margin-bottom: 15px;
  position: relative;
}

.hierarchy-row.level-0 {
  margin-bottom: 30px;
}

.user-node {
  padding: 10px 15px;
  background: white;
  border-radius: 8px;
  border-left: 4px solid #007bff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  width: 280px;
  position: relative;
  flex-shrink: 0;
}

.children-container {
  margin-left: 30px;
  flex: 1;
  position: relative;
}

.children-container::before {
  content: "";
  position: absolute;
  left: -15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: #dee2e6;
}

.children-container .hierarchy-row::before {
  content: "";
  position: absolute;
  left: -15px;
  top: 50%;
  width: 15px;
  height: 2px;
  background-color: #dee2e6;
}

.user-name {
  font-weight: bold;
  color: #2c3e50;
  font-size: 14px;
  margin-bottom: 8px;
}

.user-stats {
  font-size: 11px;
  color: #6c757d;
}

.user-stats .row {
  margin: 0;
}

.user-stats .col-6 {
  padding: 2px 4px;
}

/* レベル別の色分け */
.level-0 .user-node {
  border-left-color: #dc3545;
}

.level-1 .user-node {
  border-left-color: #fd7e14;
}

.level-2 .user-node {
  border-left-color: #ffc107;
}

.level-3 .user-node {
  border-left-color: #28a745;
}

.level-4 .user-node {
  border-left-color: #20c997;
}

.level-5 .user-node {
  border-left-color: #17a2b8;
}

.level-6 .user-node {
  border-left-color: #6f42c1;
}

.level-7 .user-node {
  border-left-color: #e83e8c;
}

/* リンクスタイル */
.user-node-link {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: all 0.2s ease;
}

.user-node-link:hover {
  text-decoration: none;
  color: inherit;
}

.user-node-link:hover .user-node {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  cursor: pointer;
}

.user-node-link .user-node {
  transition: all 0.2s ease;
}

.sales-positive {
  color: #28a745;
  font-weight: bold;
}

.sales-zero {
  color: #6c757d;
}

.bonus-positive {
  color: #17a2b8;
  font-weight: bold;
}

.bonus-zero {
  color: #6c757d;
}

/* カスタムレベルバッジの色 */
.bg-muted {
  background-color: #6c757d !important;
}

/* レベルバッジのスタイル調整 */
.badge {
  font-size: 10px;
  font-weight: 600;
  border-radius: 12px;
  padding: 4px 8px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .user-node {
    width: 250px;
  }
  .children-container {
    margin-left: 20px;
  }
  .hierarchy-row {
    flex-direction: column;
  }
  .children-container {
    margin-left: 0;
    margin-top: 15px;
  }
  .children-container::before {
    display: none;
  }
  .children-container .hierarchy-row::before {
    display: none;
  }
}
.fixed-column {
  min-width: 220px;
}

.month-selector-field {
  width: 150px;
}

.fixed-table td,
.scroll-table td {
  height: 60px;
  vertical-align: middle;
  padding: 12px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fixed-table th,
.scroll-table th {
  height: 50px;
  vertical-align: middle;
  padding: 12px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agency-name-col {
  width: 220px;
}

.sales-col,
.total-sales-col,
.incentive-col {
  min-width: 120px;
}

.date-col {
  min-width: 100px;
}

.action-col {
  min-width: 80px;
}

.clickable-name {
  cursor: pointer;
  color: #0d6efd;
  text-decoration: none;
}

.clickable-name:hover {
  text-decoration: underline;
  color: #0a58ca;
}

/* コンパクトな固定ヘッダーエリア */
.sticky-header {
  position: fixed !important;
  top: 60px !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 9999 !important;
  background: white !important;
  border-bottom: 2px solid #dee2e6 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
  width: 100% !important;
  height: 80px !important;
}

.sticky-header + .container-fluid {
  margin-top: 80px !important;
}

.sticky-header .card {
  border: none !important;
  box-shadow: none !important;
  height: 100% !important;
}

.sticky-header .card-body {
  background: white !important;
  padding: 0.75rem 1rem !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
}

.sticky-header h4 {
  font-size: 1.1rem !important;
  margin-bottom: 0 !important;
}

.sticky-header small {
  font-size: 0.75rem !important;
}

.sticky-header .form-control-sm {
  font-size: 0.8rem !important;
  padding: 0.25rem 0.5rem !important;
}

.sticky-header .input-group-text {
  padding: 0.25rem 0.5rem !important;
}

.sticky-header .btn-sm {
  font-size: 0.75rem !important;
  padding: 0.25rem 0.5rem !important;
}

.incentive-summary-card .summary-value {
  font-size: 2rem;
  font-weight: bold;
}

.table th {
  font-weight: 600;
  font-size: 0.9rem;
}

.table td {
  font-size: 0.9rem;
}

.sticky-header small {
  white-space: nowrap !important;
}

.sticky-header .fa-user-tie {
  font-size: 1.2rem !important;
}

/* 戻るボタンのスタイル */
.sticky-header .btn-outline-secondary {
  border-color: #6c757d !important;
  color: #6c757d !important;
  font-size: 0.75rem !important;
}

.sticky-header .btn-outline-secondary:hover {
  background-color: #6c757d !important;
  border-color: #6c757d !important;
  color: white !important;
}

/* 改行防止 */
.sticky-header .flex-nowrap {
  flex-wrap: nowrap !important;
}

.sticky-header .text-nowrap {
  white-space: nowrap !important;
}

.sticky-header .flex-shrink-0 {
  flex-shrink: 0 !important;
}

/* 右側のボタンとフォームの配置 */
.sticky-header .gap-2 {
  gap: 0.5rem !important;
}

.sticky-header .d-flex.gap-2 > * {
  flex-shrink: 0 !important;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .sticky-header {
    top: 50px !important;
    height: 70px !important;
  }
  .sticky-header + .container-fluid {
    margin-top: 70px !important;
  }
  .sticky-header .card-body {
    padding: 0.5rem !important;
  }
  .sticky-header h4 {
    font-size: 1rem !important;
  }
}
.admin-dashboard-container {
  padding-top: 100px;
}

.system-status-card {
  transition: all 0.3s ease;
  cursor: pointer;
}

.system-status-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.table tbody tr:hover {
  background-color: #f8f9fa;
}

.table tbody tr {
  transition: background-color 0.2s ease;
}

/* コンパクトな固定ヘッダーエリア */
.sticky-header {
  position: fixed !important;
  top: 60px !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 9999 !important;
  background: white !important;
  border-bottom: 2px solid #dee2e6 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
  width: 100% !important;
  height: 80px !important; /* 固定の高さを設定 */
}

/* メインコンテンツエリアのマージン調整 */
.sticky-header + .container-fluid {
  margin-top: 80px !important; /* ヘッダーの高さに合わせて調整 */
}

/* カード内のコンテンツ - コンパクト化 */
.sticky-header .card {
  border: none !important;
  box-shadow: none !important;
  height: 100% !important;
}

.sticky-header .card-body {
  background: white !important;
  padding: 0.75rem 1rem !important; /* パディングを縮小 */
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
}

/* アイコンとテキストのサイズ調整 */
.sticky-header h4 {
  font-size: 1.1rem !important;
  margin-bottom: 0 !important;
}

.sticky-header small {
  font-size: 0.75rem !important;
}

.sticky-header .fa-user-tie {
  font-size: 1.2rem !important;
}

/* フォーム要素のコンパクト化 */
.sticky-header .form-control-sm {
  font-size: 0.8rem !important;
  padding: 0.25rem 0.5rem !important;
}

.sticky-header .input-group-text {
  padding: 0.25rem 0.5rem !important;
}

.sticky-header .btn-sm {
  font-size: 0.75rem !important;
  padding: 0.25rem 0.5rem !important;
}

/* 改行防止 */
.sticky-header .flex-nowrap {
  flex-wrap: nowrap !important;
}

.sticky-header .text-nowrap {
  white-space: nowrap !important;
}

.sticky-header .flex-shrink-0 {
  flex-shrink: 0 !important;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .sticky-header {
    top: 50px !important;
    height: 70px !important;
  }
  .sticky-header + .container-fluid {
    margin-top: 70px !important;
  }
  .sticky-header .card-body {
    padding: 0.5rem !important;
  }
  .sticky-header h4 {
    font-size: 1rem !important;
  }
}
/* 統計情報カードの通常表示 */
.row.mb-5 .card {
  background-color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.status-summary {
  padding: 1rem;
  border-radius: 8px;
  transition: background-color 0.2s;
}

.status-summary:hover {
  background-color: #f8f9fa;
}

.level-change {
  font-size: 0.9rem;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .table-responsive {
    font-size: 0.875rem;
  }
  .table th,
  .table td {
    padding: 0.5rem 0.25rem;
  }
  .level-change {
    font-size: 0.8rem;
  }
}
.level-change-display {
  display: flex;
  align-items: center;
  font-size: 1.1rem;
}

.reason-text {
  background-color: #f8f9fa;
  padding: 1rem;
  border-radius: 0.375rem;
  border-left: 4px solid #007bff;
}

@media (max-width: 768px) {
  .level-change-display {
    flex-direction: column;
    align-items: flex-start;
  }
  .level-change-display .fas {
    margin: 0.5rem 0;
    transform: rotate(90deg);
  }
}
.system-status-card {
  transition: all 0.3s ease;
  cursor: pointer;
}

.system-status-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.alert {
  border-left: 4px solid;
}

.alert-success {
  border-left-color: #28a745;
}

.alert-warning {
  border-left-color: #ffc107;
}

.alert-danger {
  border-left-color: #dc3545;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.category-card {
  transition: all 0.3s ease;
  border: 2px solid #e9ecef;
}

.category-card:hover {
  border-color: #0d6efd;
}

.stat-item {
  padding: 1rem;
}

/* スマホ対応のレスポンシブCSS */
@media (max-width: 768px) {
  /* ヘッダー部分をスマホ用に調整 */
  .d-flex.justify-content-between.align-items-center {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
  .d-flex.align-items-center {
    flex-direction: column !important;
    align-items: flex-start !important;
    width: 100%;
  }
  .d-flex.align-items-center h4 {
    margin-bottom: 1rem !important;
    margin-right: 0 !important;
  }
  .d-flex.align-items-center form {
    width: 100%;
    flex-direction: column !important;
    align-items: flex-start !important;
  }
  .d-flex.align-items-center form label {
    margin-bottom: 0.5rem !important;
    margin-right: 0 !important;
  }
  .d-flex.align-items-center form input[type=month] {
    width: 100% !important;
    max-width: 300px;
  }
  /* 統計カードのスマホ対応 */
  .col-md-6 {
    margin-bottom: 1rem;
  }
  /* テーブルのスマホ対応 */
  .table-responsive {
    font-size: 0.875rem;
  }
  .table th,
  .table td {
    padding: 0.5rem 0.25rem;
    white-space: nowrap;
  }
  /* バッジのサイズ調整 */
  .badge {
    font-size: 0.75rem;
  }
  /* ボタンのサイズ調整 */
  .btn-sm {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }
}
.receipt-preview {
  font-family: "Noto Sans JP", sans-serif;
  line-height: 1.6;
}

.receipt-preview h2 {
  border-bottom: 2px solid #333;
  padding-bottom: 10px;
}

@media print {
  .receipt-preview {
    box-shadow: none !important;
    border: none !important;
  }
}
.z-index-sticky {
  z-index: 1030;
}

.month-selector-wrapper {
  padding: 1rem 0;
  border-bottom: 1px solid #dee2e6;
  margin-bottom: 1rem;
}

.table th {
  font-weight: 600;
  font-size: 0.9rem;
}

.table td {
  font-size: 0.9rem;
}

.table-hover tbody tr:hover {
  background-color: rgba(0, 123, 255, 0.05);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .d-flex.justify-content-between {
    flex-direction: column;
    align-items: flex-start !important;
  }
  .d-flex.justify-content-between > div:first-child {
    margin-bottom: 0.5rem;
  }
  .d-flex.gap-2 {
    flex-direction: column;
    width: 100%;
  }
  .d-flex.gap-2 .btn {
    width: 100%;
    margin-bottom: 0.25rem;
  }
  .table-responsive {
    font-size: 0.8rem;
  }
  .container {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  .month-selector-wrapper {
    padding: 0.5rem 0;
  }
}
.email-edit-form {
  display: none;
}

/* navbarを常に最前面に表示 */
.navbar {
  z-index: 99999 !important;
  position: fixed !important;
  top: 0 !important;
  width: 100% !important;
}

/* sticky要素のz-indexを調整 */
.month-selector-wrapper {
  z-index: 1020 !important;
}

.user-info-wrapper {
  z-index: 1010 !important;
}

/* 下位紹介者のメールアドレス改行対応 */
.text-break {
  word-wrap: break-word !important;
  word-break: break-all !important;
  overflow-wrap: break-word !important;
  white-space: normal !important;
  max-width: 100% !important;
}

/* 下位紹介者カード内のテキスト調整 */
.card-body .mb-2 p {
  word-wrap: break-word;
  word-break: break-all;
  overflow-wrap: break-word;
}

/* スマホでの調整 */
@media (max-width: 768px) {
  .mypage-container {
    margin-top: 100px !important;
  }
  .month-selector-wrapper {
    top: 70px !important;
  }
  .user-info-wrapper {
    top: 130px !important;
  }
  /* スマホでのメールアドレス表示調整 */
  .text-break {
    font-size: 12px !important;
    line-height: 1.3 !important;
  }
}
.order-card {
  height: 200px !important;
}

.order-card .card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
}

.order-card .card-title {
  margin-bottom: 20px;
}

.order-card-with-image {
  height: 200px !important;
}

.order-card-with-image .card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding-top: 10px;
}

/* 住所選択カードのスタイル */
.address-option {
  border: 2px solid #e9ecef;
  transition: all 0.3s ease;
  cursor: pointer;
}

.address-option:hover {
  border-color: #0d6efd;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.address-option .form-check-input:checked ~ .form-check-label .card-body,
.address-option:has(.form-check-input:checked) {
  border-color: #0d6efd;
  background-color: #f8f9ff;
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.15);
}

.address-option .form-check-input:checked ~ .form-check-label h6 {
  color: #0d6efd !important;
}

.address-option .form-check-label {
  cursor: pointer;
  padding: 0;
}

.address-option .form-check {
  margin-bottom: 0;
}

.address-option .form-check-input {
  margin-top: 0.5rem;
  transform: scale(1.2);
}

/* 選択された住所の表示エリア */
#selected-address-display,
#multi-selected-address-display {
  border-left: 4px solid #198754;
  background-color: #f8fff9;
}

/* 住所未登録時のメッセージ */
.alert-danger {
  border-left: 4px solid #dc3545;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .address-option .form-check-input {
    transform: scale(1.4);
    margin-top: 0.75rem;
  }
  .address-option h6 {
    font-size: 1rem;
  }
  .address-option .small {
    font-size: 0.875rem;
  }
}
/* アクセシビリティ改善 */
.address-option:focus-within {
  outline: 2px solid #0d6efd;
  outline-offset: 2px;
}

.form-check-input:focus {
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* 既存のdelivery-optionスタイルも保持 */
.delivery-option .btn-check:checked + .btn-outline-primary {
  background-color: #0d6efd;
  border-color: #0d6efd;
  color: white;
}

.delivery-option .btn-check:checked + .btn-outline-info {
  background-color: #0dcaf0;
  border-color: #0dcaf0;
  color: white;
}

.delivery-option .btn-check:checked + .btn-outline-success {
  background-color: #198754;
  border-color: #198754;
  color: white;
}

.delivery-option .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.delivery-option .btn {
  transition: all 0.2s ease;
}

.hover-card {
  transition: all 0.3s ease;
  cursor: pointer;
}

.hover-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

.hover-card .card-body {
  padding: 2rem;
}

.hover-card i {
  transition: all 0.3s ease;
}

.hover-card:hover i {
  transform: scale(1.1);
}

.invoice-preview,
.receipt-preview {
  font-family: "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
}

.invoice-preview h3,
.invoice-preview h5,
.invoice-preview h6,
.receipt-preview h3,
.receipt-preview h5,
.receipt-preview h6 {
  margin-bottom: 0.5rem;
}

.invoice-preview p,
.receipt-preview p {
  margin-bottom: 0.25rem;
}

@media print {
  .invoice-preview,
  .receipt-preview {
    box-shadow: none !important;
    border: none !important;
  }
}
/* スマホ用テーブルスタイル */
.mobile-table-container {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-table {
  min-width: 600px;
}

.mobile-table .fixed-col-1,
.mobile-table .fixed-col-2 {
  position: sticky;
  background-color: white;
  z-index: 10;
}

.mobile-table .fixed-col-1 {
  left: 0;
  min-width: 80px;
  border-right: 2px solid #dee2e6;
}

.mobile-table .fixed-col-2 {
  left: 80px;
  min-width: 100px;
  border-right: 2px solid #dee2e6;
}

.mobile-table thead .fixed-col-1,
.mobile-table thead .fixed-col-2 {
  background-color: #f8f9fa !important;
}

.mobile-table tfoot .fixed-col-1,
.mobile-table tfoot .fixed-col-2 {
  background-color: #f8f9fa !important;
}

.mobile-table .scroll-col {
  min-width: 100px;
}

/* バッジのサイズ調整 */
@media (max-width: 767px) {
  .badge {
    font-size: 0.7em;
    padding: 0.25em 0.4em;
  }
}
/* スマホ用銀行情報スタイル */
.bank-info-mobile {
  font-size: 14px;
}

.bank-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  white-space: nowrap;
  overflow: hidden;
}

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

.bank-label {
  color: #666;
  font-weight: 500;
  min-width: 80px;
  flex-shrink: 0;
}

.bank-value {
  text-align: right;
  font-weight: 600;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-left: 10px;
}

/* スマホでのテーブル横スクロール改善 */
@media (max-width: 768px) {
  .table-responsive {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
  }
  .table-responsive::-webkit-scrollbar {
    height: 8px;
  }
  .table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
  }
  .table-responsive::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
  }
  .table-responsive::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
  }
  /* テーブル内のテキストサイズ調整 */
  .table-responsive .table {
    font-size: 0.875rem;
  }
  .table-responsive .table th,
  .table-responsive .table td {
    padding: 0.5rem 0.75rem;
  }
}
/* 横スクロールのヒント表示 */
.table-responsive::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 20px;
  background: linear-gradient(to left, rgba(255, 255, 255, 0.8), transparent);
  pointer-events: none;
}

@media (min-width: 769px) {
  .table-responsive::after {
    display: none;
  }
}
.bg-info {
  background-color: #a8d8ea !important;
  color: #333 !important;
}

.form-check-label {
  cursor: pointer;
}

.form-check-input:checked {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

#stem-cell-section {
  display: none;
}

/* PCサイズ時の調整 */
@media (min-width: 992px) {
  .card-body {
    padding: 1rem !important;
  }
  /* 予約カードの縦幅を圧縮 */
  .card .card-body {
    padding: 0.75rem !important;
  }
  .card .mb-2 {
    margin-bottom: 0.5rem !important;
  }
  .card .mb-3 {
    margin-bottom: 0.75rem !important;
  }
  /* フォントサイズを少し小さく */
  .card h6 {
    font-size: 0.95rem;
  }
  .card .small,
  .card small {
    font-size: 0.8rem;
  }
  /* 行間を詰める */
  .card .d-flex {
    line-height: 1.3;
  }
}
/* スマホ向けのスタイル調整 */
@media (max-width: 768px) {
  .container-fluid {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
  .card {
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }
  .card-body {
    padding: 12px !important;
  }
  .btn-sm {
    font-size: 0.8rem;
    padding: 4px 8px;
  }
  .badge {
    font-size: 0.7rem;
  }
  h5,
  h6 {
    font-size: 1rem;
  }
  .small,
  small {
    font-size: 0.8rem;
  }
}
/* カードのホバー効果 */
.card:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transition: box-shadow 0.2s ease;
}

/* アイコンの色調整 */
.fas.fa-calendar {
  color: #0d6efd;
}

.fas.fa-syringe {
  color: #17a2b8;
}

.fas.fa-hospital {
  color: #6f42c1;
}

.payment-option:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
  transition: all 0.3s ease;
}

.payment-option {
  transition: all 0.3s ease;
}

.payment-option-disabled {
  background-color: #f8f9fa;
  opacity: 0.7;
  cursor: not-allowed;
}

.payment-option-disabled .card-body {
  background-color: #f8f9fa;
}

.top-page-container {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  position: relative;
  top: 0;
  left: 0;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}
.top-page-container picture {
  width: 100%;
  height: 100%;
  display: flex;
}

.top-page-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

body:has(.top-page-container) {
  padding-top: 0 !important;
  /* navbarを透明にして画像の上に重ねる */
  /* フッターを表示し、画像の直下に配置 */
}
body:has(.top-page-container) .container-fluid {
  padding: 0 !important;
  margin: 0 !important;
}
body:has(.top-page-container) main {
  margin: 0 !important;
  padding: 0 !important;
}
body:has(.top-page-container) .custom-navbar {
  background: rgba(44, 62, 80, 0.9) !important;
  position: absolute !important;
  top: 0 !important;
  width: 100% !important;
  z-index: 1000 !important;
}
body:has(.top-page-container) footer {
  position: relative !important;
  z-index: 10 !important;
  background-color: rgba(0, 0, 0, 0.8) !important;
  color: white !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* レスポンシブ対応 */
@media (max-width: 1400px) {
  .top-page-container {
    overflow: hidden !important;
  }
  .top-page-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
  }
}
@media (max-width: 991.98px) {
  body:has(.top-page-container) {
    padding-top: 0 !important;
  }
  .top-page-container {
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    overflow: hidden;
  }
  .top-page-image {
    object-fit: cover;
    object-position: center center;
    width: 100%;
    height: 100%;
    display: block;
  }
}
@media (max-width: 390px) {
  .top-page-image {
    object-fit: contain;
    object-position: 47% center;
  }
}
.hierarchy-container-vertical {
  font-family: "Courier New", monospace;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 8px;
  overflow: auto;
  min-height: 400px;
}

.hierarchy-row {
  display: flex;
  align-items: flex-start;
  margin-bottom: 15px;
  position: relative;
}

.hierarchy-row.level-0 {
  margin-bottom: 30px;
}

.user-node {
  padding: 10px 15px;
  background: white;
  border-radius: 8px;
  border-left: 4px solid #007bff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  width: 280px;
  position: relative;
  flex-shrink: 0;
}

.user-node.current-user {
  border-left-color: #28a745;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  font-weight: bold;
}

.children-container {
  margin-left: 30px;
  flex: 1;
  position: relative;
}

.children-container::before {
  content: "";
  position: absolute;
  left: -15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: #dee2e6;
}

.children-container .hierarchy-row::before {
  content: "";
  position: absolute;
  left: -15px;
  top: 50%;
  width: 15px;
  height: 2px;
  background-color: #dee2e6;
}

.user-name {
  font-weight: bold;
  color: #2c3e50;
  font-size: 14px;
  margin-bottom: 8px;
}

.user-stats {
  font-size: 11px;
  color: #6c757d;
}

/* レベル別の色分け */
.level-0 .user-node {
  border-left-color: #28a745;
}

.level-1 .user-node {
  border-left-color: #fd7e14;
}

.level-2 .user-node {
  border-left-color: #ffc107;
}

.level-3 .user-node {
  border-left-color: #17a2b8;
}

.level-4 .user-node {
  border-left-color: #20c997;
}

.level-5 .user-node {
  border-left-color: #6f42c1;
}

.level-6 .user-node {
  border-left-color: #e83e8c;
}

.level-7 .user-node {
  border-left-color: #dc3545;
}

/* リンクスタイル */
.user-node-link {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: all 0.2s ease;
}

.user-node-link:hover {
  text-decoration: none;
  color: inherit;
}

.user-node-link:hover .user-node {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  cursor: pointer;
}

.user-node-link .user-node {
  transition: all 0.2s ease;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .hierarchy-container-vertical {
    padding: 10px;
  }
  .user-node {
    width: 100%;
    max-width: 280px;
    font-size: 13px;
  }
  .user-name {
    font-size: 13px;
  }
  .user-stats {
    font-size: 10px;
  }
  /* 階層ごとに左マージンを増やして階層を視覚化 */
  .level-0 {
    margin-left: 0;
  }
  .level-1 {
    margin-left: 20px;
  }
  .level-2 {
    margin-left: 40px;
  }
  .level-3 {
    margin-left: 60px;
  }
  .level-4 {
    margin-left: 80px;
  }
  .level-5 {
    margin-left: 100px;
  }
  .level-6 {
    margin-left: 120px;
  }
  .level-7 {
    margin-left: 140px;
  }
  /* 子要素のコンテナは左マージンをリセット */
  .children-container {
    margin-left: 0;
    margin-top: 10px;
  }
  /* 接続線は非表示 */
  .children-container::before {
    display: none;
  }
  .children-container .hierarchy-row::before {
    display: none;
  }
  /* 階層の視覚的な区切り線を追加 */
  .hierarchy-row:not(.level-0)::after {
    content: "";
    position: absolute;
    left: -10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #dee2e6;
    opacity: 0.5;
  }
}
.tooltip-inner {
  white-space: pre-line !important;
  text-align: left !important;
  max-width: 300px !important;
}

/* カスタムナビゲーションバー */
.custom-navbar {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%) !important;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

nav.navbar.custom-navbar .container-fluid {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: space-between !important;
}

/* トップページでも確実にスタイルを適用 */
body .custom-navbar,
html body .custom-navbar {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%) !important;
}

/* ナビゲーションブランド */
.navbar-brand,
body .navbar-brand,
html body .navbar-brand {
  font-family: "Poppins", sans-serif !important;
  font-weight: 700 !important;
  font-size: 1.5rem !important;
  letter-spacing: 0.5px !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
  color: #ffffff !important;
  flex: 0 0 auto !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
}

.navbar-brand:hover,
.navbar-brand:focus,
body .navbar-brand:hover,
body .navbar-brand:focus {
  color: #ffffff !important;
}

/* ナビゲーションリンク */
.navbar-nav .nav-link,
body .navbar-nav .nav-link,
html body .navbar-nav .nav-link {
  font-family: "Inter", "メイリオ", "Meiryo", sans-serif !important;
  font-weight: 500 !important;
  font-size: 0.95rem !important;
  letter-spacing: 0.3px !important;
  transition: all 0.3s ease !important;
  color: #ffffff !important;
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus,
body .navbar-nav .nav-link:hover,
body .navbar-nav .nav-link:focus {
  transform: translateY(-1px) !important;
  text-shadow: 0 2px 8px rgba(255, 255, 255, 0.3) !important;
  color: #ffffff !important;
  opacity: 1 !important;
}

#navbarNav {
  padding-right: 20px;
}

/* ナビゲーションロゴ */
.navbar-logo {
  height: 40px;
  width: auto;
}

/* カスタムドロップダウンメニュー */
.custom-dropdown {
  position: relative;
}

.custom-dropdown-toggle,
body .custom-dropdown-toggle,
html body .custom-dropdown-toggle {
  cursor: pointer;
  text-decoration: none !important;
  font-family: "Inter", "メイリオ", "Meiryo", sans-serif !important;
  font-weight: 600 !important;
  font-size: 0.95rem !important;
  letter-spacing: 0.3px !important;
  color: #ffffff !important;
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
}

.custom-dropdown-toggle:hover,
.custom-dropdown-toggle:focus,
body .custom-dropdown-toggle:hover,
body .custom-dropdown-toggle:focus {
  color: #ffffff !important;
  transform: translateY(-1px) !important;
  text-shadow: 0 2px 8px rgba(255, 255, 255, 0.3) !important;
  opacity: 1 !important;
}

.custom-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  min-width: 160px;
  padding: 0.5rem 0;
  margin: 0;
  list-style: none;
  z-index: 1000;
  /* 初期状態（非表示） */
  opacity: 0;
  transform: translateY(-15px) scale(0.95);
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-dropdown-menu.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
  pointer-events: auto;
}

.custom-dropdown-menu li {
  margin: 0;
}

.custom-dropdown-item {
  display: block;
  width: 100%;
  padding: 0.375rem 1rem;
  color: #212529;
  text-decoration: none;
  background-color: transparent;
  border: 0;
  transition: all 0.2s ease-in-out;
  font-family: "Inter", sans-serif !important;
  font-weight: 500 !important;
  font-size: 0.9rem !important;
  letter-spacing: 0.2px !important;
}

.custom-dropdown-item:hover {
  background-color: #f8f9fa;
  color: #1e2125;
  text-decoration: none;
  transform: translateX(5px);
}

/* レスポンシブ対応 */
@media (max-width: 991.98px) {
  .navbar-collapse {
    background-color: #2c3e50;
    padding: 1rem;
    margin-top: 0.5rem;
    border-radius: 0.375rem;
  }
  .navbar-nav {
    width: 100%;
  }
  .nav-item {
    width: 100%;
    text-align: left;
  }
  .custom-dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    background-color: #495057;
    border-radius: 0;
    width: 100%;
    /* スマホでも初期状態は非表示 */
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .custom-dropdown-menu.show {
    max-height: 300px; /* 十分な高さを設定 */
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
  }
  .custom-dropdown-item {
    color: #ffffff;
    padding-left: 2rem;
  }
  .custom-dropdown-item:hover {
    background-color: #6c757d;
    color: #ffffff;
    transform: none;
  }
}
/* ナビゲーショントグラー */
.navbar-toggler {
  border-color: rgba(255, 255, 255, 0.3);
  margin-left: auto;
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25);
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* モバイルでのナビゲーションバー調整 */
@media (max-width: 991.98px) {
  nav.navbar.custom-navbar .container-fluid {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
  }
  .custom-navbar .navbar-brand,
  nav.custom-navbar .navbar-brand,
  .navbar.custom-navbar .navbar-brand {
    flex: 0 0 auto !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
  }
  .custom-navbar .navbar-toggler {
    margin-left: auto;
  }
}
.postal-code-loading .fa-spinner {
  animation: spin 1s linear infinite;
}
.postal-code-loading small {
  font-size: 0.75rem;
  color: #6c757d !important;
}

.postal-code-error small {
  font-size: 0.75rem;
  color: #dc3545 !important;
}
.postal-code-error small .fa-exclamation-triangle {
  margin-right: 0.25rem;
}

.postal-code-input.loading {
  background-image: url("data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 0C3.58 0 0 3.58 0 8s3.58 8 8 8 8-3.58 8-8-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6s2.69-6 6-6 6 2.69 6 6-2.69 6-6 6z' fill='%236c757d'/%3e%3cpath d='M8 4c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z' fill='%236c757d'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 16px;
  padding-right: 2.5rem;
}
.postal-code-input.success {
  border-color: #198754;
  background-image: url("data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 0C3.58 0 0 3.58 0 8s3.58 8 8 8 8-3.58 8-8-3.58-8-8-8zm3.5 6.5L7 11 4.5 8.5l1-1L7 9l3.5-3.5 1 1z' fill='%23198754'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 16px;
  padding-right: 2.5rem;
}
.postal-code-input.error {
  border-color: #dc3545;
  background-image: url("data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 0C3.58 0 0 3.58 0 8s3.58 8 8 8 8-3.58 8-8-3.58-8-8-8zm3.5 10.5L10.5 11.5 8 9l-2.5 2.5L4.5 10.5 7 8 4.5 5.5 5.5 4.5 8 7l2.5-2.5L11.5 5.5 9 8l2.5 2.5z' fill='%23dc3545'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 16px;
  padding-right: 2.5rem;
}

.address-input.auto-filled {
  background-color: #f8f9fa;
  border-color: #198754;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

@media (max-width: 576px) {
  .postal-code-loading small,
  .postal-code-error small {
    font-size: 0.7rem;
  }
  .postal-code-input.loading, .postal-code-input.success, .postal-code-input.error {
    background-size: 14px 14px;
    padding-right: 2.25rem;
  }
}
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.postal-code-loading,
.postal-code-error {
  animation: fadeIn 0.3s ease-out;
}

.form-control.postal-code-input:focus.loading {
  box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.25);
}
.form-control.postal-code-input:focus.success {
  box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25);
}
.form-control.postal-code-input:focus.error {
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.devise-password-card {
  border: none;
  transition: transform 0.3s ease;
  border-radius: 12px;
}
.devise-password-card:hover {
  transform: translateY(-5px);
}

.devise-btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  font-weight: 600;
  padding: 12px;
}
.devise-btn-primary:hover {
  background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.devise-btn-success {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  border: none;
  font-weight: 600;
  padding: 12px;
}
.devise-btn-success:hover {
  background: linear-gradient(135deg, #218838 0%, #1ea080 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.devise-input-group .input-group-text {
  border-right: none;
  background-color: #f8f9fa;
}
.devise-input-group .form-control {
  border-left: none;
}
.devise-input-group .form-control:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}
.devise-input-group.success-focus .form-control:focus {
  border-color: #28a745;
  box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}
.devise-input-group .btn-outline-secondary {
  border-left: none;
}

.devise-password-edit .devise-input-group .form-control {
  border-right: none;
}

.devise-icon {
  font-size: 48px;
}
.devise-icon.primary {
  color: #667eea;
}
.devise-icon.success {
  color: #28a745;
}

@media (max-width: 768px) {
  .d-flex.align-items-center-login {
    align-items: center !important;
  }
}
/* 全体のフォント設定 */
body {
  padding-top: 70px; /* ナビゲーションバーの高さ分のパディング */
  font-family: "Inter", "メイリオ", "Meiryo", sans-serif !important;
  font-weight: 400;
  line-height: 1.6;
}

/* 見出しフォント */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Poppins", "Inter", "メイリオ", "Meiryo", sans-serif !important;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* ボタンフォント */
.btn {
  font-family: "Inter", "メイリオ", "Meiryo", sans-serif !important;
  font-weight: 500;
  letter-spacing: 0.2px;
}

/* カードタイトル */
.card-title {
  font-family: "Poppins", "Inter", "メイリオ", "Meiryo", sans-serif !important;
  font-weight: 600;
}

/* テーブルヘッダー */
.table th {
  font-family: "Inter", "メイリオ", "Meiryo", sans-serif !important;
  font-weight: 600;
  letter-spacing: 0.2px;
}

/* ナビゲーション要素の確実な表示 */
.navbar-nav .nav-link,
.custom-dropdown-toggle {
  color: #ffffff !important;
  opacity: 1 !important;
  visibility: visible !important;
}

section {
  padding: 100px 0;
}

/* スライダーには余白を入れない */
#slider {
  margin-top: 0;
}

#law,
#privacy,
#terms {
  margin-top: 100px;
}
#law h2.title,
#privacy h2.title,
#terms h2.title {
  text-align: center;
  padding-bottom: 50px;
}

@media (max-width: 576px) {
  #law table {
    font-size: 0.8rem;
  }
}
