/* ========== Reset & Base ========== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  touch-action: manipulation;
}

html {
  overflow-x: hidden;
  color-scheme: dark;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #1a1a2e;
  color: #e0e0e0;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ========== Header ========== */
.header {
  background: transparent;
  color: #fff;
  padding: 12px 20px;
  min-height: 200px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5000;
  overflow: hidden;
}

.header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: #0f0f1a url('../images/header-bg.webp') no-repeat right center;
  background-size: cover;
  opacity: 0.85;
  z-index: -1;
}

.header-spacer {
  min-height: 200px;
}

.header-title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
}

.header-logo {
  font-family: 'Fredoka', sans-serif;
  font-size: 2.5rem;
  font-weight: 600;
  color: #e91e7b;
  transform: rotate(-10deg);
  letter-spacing: 2px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
  pointer-events: none;
  flex-shrink: 1;
  min-width: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  position: absolute;
  top: 12px;
  right: 16px;
}

.btn-signin {
  background: #252547;
  color: #e0e0e0;
  border: 1px solid #3a3a5c;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
}
.btn-signin:hover {
  background: #3a3a5c;
}

.header-user {
  font-size: 0.85rem;
  opacity: 0.8;
}

@media (max-height: 500px) and (orientation: landscape) {
  .header {
    min-height: 20vh;
    padding: 8px 16px;
  }

  .header-spacer {
    min-height: 20vh;
  }

  .header-logo {
    font-size: 1.8rem;
  }
}

.btn {
  padding: 6px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: opacity 0.2s;
}

.btn:hover {
  opacity: 0.85;
}

.btn-primary {
  background: #6c5ce7;
  color: #fff;
}

.btn-secondary {
  background: #4a4a6a;
  color: #fff;
}

.btn-danger {
  background: #d63384;
  color: #fff;
}

.btn-outline {
  background: transparent;
  border: 1px solid #ccc;
  color: #e0e0e0;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 0.8rem;
}

/* ========== Hamburger Menu ========== */
.hamburger-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 6000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.menu-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.menu-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 260px;
  height: 100%;
  background: #16162b;
  box-shadow: -2px 0 8px rgba(0,0,0,0.7);
  z-index: 6001;
  padding: 50px 20px 20px;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}
.menu-panel.open {
  transform: translateX(0);
}

.menu-item {
  display: block;
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 8px;
  background: #252547;
  border: 1px solid #3a3a5c;
  border-radius: 6px;
  text-align: left;
  font-size: 0.95rem;
  color: #e0e0e0;
  cursor: pointer;
  transition: background 0.2s;
}

.menu-item:hover {
  background: #353560;
}

.menu-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: #888;
}

/* ========== Container ========== */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

/* ========== Auth Forms ========== */
.auth-container {
  max-width: 400px;
  margin: 60px auto;
  padding: 30px;
  background: #252547;
  border-radius: 8px;
  border: 1px solid #3a3a5c;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.auth-container h2 {
  text-align: center;
  margin-bottom: 24px;
  color: #fff;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  font-size: 0.85rem;
  color: #a0a0b8;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #3a3a5c;
  border-radius: 6px;
  font-size: 0.95rem;
  background: #1a1a2e !important;
  color: #e0e0e0 !important;
  -webkit-appearance: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #6c5ce7;
}

.form-group input:-webkit-autofill,
.form-group input:-webkit-autofill:hover,
.form-group input:-webkit-autofill:focus {
  -webkit-text-fill-color: #e0e0e0;
  -webkit-box-shadow: 0 0 0px 1000px #1a1a2e inset;
  border: 1px solid #3a3a5c;
  transition: background-color 5000s ease-in-out 0s;
}

.form-actions {
  margin-top: 20px;
}

.form-actions .btn {
  width: 100%;
  padding: 10px;
  font-size: 1rem;
}

.auth-link {
  text-align: center;
  margin-top: 16px;
  font-size: 0.85rem;
}

.auth-link a {
  color: #a29bfe;
  cursor: pointer;
  text-decoration: underline;
}

.alert {
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 0.85rem;
}

.alert-error {
  background: rgba(231, 76, 60, 0.15);
  color: #ff6b6b;
  border: 1px solid rgba(231, 76, 60, 0.3);
}

.alert-success {
  background: rgba(46, 213, 115, 0.15);
  color: #2ed573;
  border: 1px solid rgba(46, 213, 115, 0.3);
}

/* ========== Calendar ========== */
.calendar-section {
  background: #252547;
  border-radius: 8px;
  border: 1px solid #3a3a5c;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  padding: 20px;
  margin-bottom: 24px;
}

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

.calendar-header h2 {
  font-size: 1.2rem;
  color: #fff;
}

.calendar-nav {
  background: none;
  border: 1px solid #3a3a5c;
  border-radius: 4px;
  padding: 4px 12px;
  cursor: pointer;
  font-size: 1rem;
  color: #c0c0d0;
  transition: background 0.2s;
}

.calendar-nav:hover {
  background: #353560;
}

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

.calendar-grid-animated {
  will-change: transform, opacity;
}

.calendar-grid-slide-from-left {
  animation: calendar-slide-from-left 500ms cubic-bezier(0.22, 1, 0.36, 1);
}

.calendar-grid-slide-from-right {
  animation: calendar-slide-from-right 500ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes calendar-slide-from-left {
  from {
    opacity: 0;
    transform: translateX(-28px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes calendar-slide-from-right {
  from {
    opacity: 0;
    transform: translateX(28px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.shop-home-calendar-animated {
  will-change: transform;
}

.shop-home-calendar-animated.calendar-grid-slide-from-left {
  animation: shop-home-calendar-slide-from-left 500ms cubic-bezier(0.22, 1, 0.36, 1);
}

.shop-home-calendar-animated.calendar-grid-slide-from-right {
  animation: shop-home-calendar-slide-from-right 500ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes shop-home-calendar-slide-from-left {
  from { transform: translateX(-40px); }
  to   { transform: translateX(0); }
}

@keyframes shop-home-calendar-slide-from-right {
  from { transform: translateX(40px); }
  to   { transform: translateX(0); }
}

.calendar-dow {
  text-align: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: #888;
  padding: 6px 0;
}

.calendar-cell {
  aspect-ratio: 1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s;
  min-height: 40px;
}

.shop-home-calendar-label {
  font-size: 0.72rem;
  line-height: 1.35;
  color: #aaaabb;
  word-break: keep-all;
  overflow-wrap: normal;
  font-variant-numeric: tabular-nums;
  white-space: pre-line;
}

.shop-home-calendar-grid {
  align-items: start;
}

.shop-home-calendar-cell {
  aspect-ratio: auto;
  min-height: 86px;
  height: auto;
}

.shop-home-calendar-cell.is-today {
  background: rgba(255, 255, 255, 0.06);
}

.calendar-cell:hover {
  transform: scale(1.05);
}

.calendar-cell.empty {
  cursor: default;
  background: transparent;
}

.calendar-cell.empty:hover {
  transform: none;
}

.calendar-cell.today {
  outline: 3px solid #6c5ce7;
  outline-offset: -3px;
}

.calendar-cell .date-num {
  position: relative;
  z-index: 1;
}

/* トップページカレンダー専用の土日・祝日装飾 */
.calendar-cell:not(.shop-home-calendar-cell) .date-num.weekend-date-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  isolation: isolate;
  width: 1.9em;
  height: 1.9em;
}

.calendar-cell:not(.shop-home-calendar-cell) .date-num.weekend-date-num::before {
  content: "";
  position: absolute;
  inset: 0.1em;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.15);
  filter: blur(4px);
  z-index: -1;
  pointer-events: none;
}

/* 店舗ホーム・キャストホーム等のカレンダー用 土日・祝日装飾 */
.shop-home-calendar-cell .date-num.weekend-date-num {
  position: relative !important;
  isolation: isolate;
}

.shop-home-calendar-cell .date-num.weekend-date-num::before {
  content: "";
  position: absolute;
  width: 1.5em;
  height: 1.5em;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: radial-gradient(circle, rgba(90, 90, 255, 0.9) 0%, rgba(90, 90, 255, 0) 100%);
  filter: blur(1.5px);
  z-index: -1;
  pointer-events: none;
}

.calendar-seat-gauge {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 1;
  font-size: 0.65rem;
  line-height: 1;
  max-width: calc(100% - 8px);
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  pointer-events: none;
}

.calendar-cell .event-crown {
  position: absolute;
  top: 1px;
  right: 1px;
  font-size: 0.55rem;
  line-height: 1;
  z-index: 1;
}

.calendar-cell .birthday-heart {
  position: absolute;
  top: 1px;
  left: 1px;
  font-size: 0.55rem;
  line-height: 1;
  z-index: 1;
}

@media (max-width: 640px) {
  .shop-home-calendar-grid {
    gap: 2px;
  }

  .shop-home-calendar-cell {
    min-height: 74px;
    padding: 4px !important;
  }

  .shop-home-calendar-label {
    font-size: 0.6rem;
    line-height: 1.2;
  }
}

/* ========== Modal ========== */
body.modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  overscroll-behavior: none;
}

.modal-content {
  background: #252547;
  border-radius: 10px;
  width: 90%;
  max-width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  border: 1px solid #3a3a5c;
  overflow: hidden;
}

.day-detail-modal-content {
  transform-origin: var(--day-modal-origin-x, 50%) var(--day-modal-origin-y, 50%);
}

.day-detail-modal-content.day-detail-modal-animate {
  animation: day-modal-zoom-in 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes day-modal-zoom-in {
  from {
    opacity: 0;
    transform: scale(0.2);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .day-detail-modal-content.day-detail-modal-animate {
    animation: none;
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #3a3a5c;
}

.modal-header h3 {
  font-size: 1.1rem;
  color: #fff;
}

.modal-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.timeline-open-btn {
  background: none;
  border: none;
  color: #d8d8ea;
  font-size: 1.05rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.timeline-open-btn:hover {
  color: #fff;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: #999;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.timeline-modal-content {
  height: 80vh;
  max-height: 80vh;
  background: #161629;
}

.timeline-modal-body {
  position: relative;
  padding: 0;
  overflow: auto;
}

.timeline-scroll {
  min-width: 100%;
  width: 100%;
}

.timeline-layout {
  display: flex;
  height: 100%;
  min-width: 100%;
}

.timeline-axis {
  width: 72px;
  height: 100%;
  padding: 20px;
  flex-shrink: 0;
}

.timeline-axis-row {
  position: relative;
  height: calc(100% / 24);
  min-height: 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.timeline-axis-row:last-child {
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.timeline-axis-label {
  position: absolute;
  top: -11px;
  left: 0;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.08);
  background: #161629;
  padding-right: 10px;
}

.timeline-axis-terminal-label {
  position: relative;
  top: -11px;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.08);
  background: #161629;
  padding-right: 10px;
}

.timeline-axis-row-current .timeline-axis-label {
  color: #eee;
}

.timeline-shop-columns {
  display: grid;
  gap: 0;
  height: 100%;
  flex: 1 1 auto;
  padding: 20px 20px 20px 0;
}

.timeline-shop-column {
  display: flex;
  min-width: 0;
}

.timeline-shop-track {
  position: relative;
  flex: 1;
}

.timeline-shop-row {
  height: calc(100% / 24);
  min-height: 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.timeline-shop-row:last-child {
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.timeline-shift-bar {
  position: absolute;
  width: 10px;
  border-radius: 0;
  opacity: 0.7;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.12);
  cursor: pointer;
}

.timeline-popup {
  position: fixed;
  z-index: 10000;
  width: auto;
  min-width: 200px;
  max-width: 80vw;
  max-height: 80vh;
  overflow-y: auto;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  color: #222;
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 14px 32px rgba(0,0,0,0.28);
  border: 1px solid rgba(0,0,0,0.08);
}

.timeline-popup-shop {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.timeline-popup-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.82rem;
  line-height: 1.4;
  padding: 4px 0;
}

.timeline-popup-name {
  color: #222;
  font-weight: 600;
}

.timeline-popup-time {
  color: #666;
  white-space: nowrap;
}

/* ========== Shop Card (in modal & main list) ========== */
.shop-block {
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
  border: 1px solid #3a3a5c;
  background: #1e1e38;
}

.shop-block-name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 8px;
}

.shop-block-score {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 8px;
}

.cast-list {
  list-style: none;
}

.cast-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #3a3a5c;
  font-size: 0.9rem;
}

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

.cast-name {
  font-weight: 500;
}

.cast-score {
  font-weight: 700;
  font-size: 0.85rem;
}

.cast-score.positive {
  color: var(--score-positive-color, #ff6b6b);
}

.cast-score.negative {
  color: var(--score-negative-color, #74b9ff);
}

.cast-score.neutral {
  color: var(--score-neutral-color, #888);
}

/* ========== Today Section ========== */
.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #3a3a5c;
}

.today-section {
  background: #252547;
  border-radius: 8px;
  border: 1px solid #3a3a5c;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  padding: 20px;
  margin-bottom: 24px;
}

.home-slide-in-left {
  animation: home-slide-in-left 500ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes home-slide-in-left {
  from {
    opacity: 0;
    transform: translateX(-28px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.view-slide-in-right {
  animation: view-slide-in-right 500ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes view-slide-in-right {
  from {
    opacity: 0;
    transform: translateX(28px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.no-data {
  color: #999;
  text-align: center;
  padding: 20px;
  font-size: 0.9rem;
}

/* ========== Registration Forms ========== */
.register-container {
  max-width: 560px;
  margin: 40px auto;
  padding: 30px;
  background: #252547;
  border-radius: 8px;
  border: 1px solid #3a3a5c;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.register-container h2 {
  margin-bottom: 24px;
  color: #fff;
}

.inline-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.inline-form .form-group {
  flex: 1;
  margin-bottom: 0;
}

/* ========== Staff Preference Slider ========== */
.pref-slider-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  position: relative;
}

.pref-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--score-negative-color, #74b9ff), var(--score-positive-color, #ff6b6b)) !important;
  outline: none;
}

.pref-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #6c5ce7;
  cursor: pointer;
}

.pref-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #6c5ce7;
  cursor: pointer;
}

.pref-slider::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--score-negative-color, #74b9ff), var(--score-positive-color, #ff6b6b));
}

.pref-tooltip {
  position: absolute;
  top: -32px;
  background: #6c5ce7;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  pointer-events: none;
  transform: translateX(-50%);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s;
}
.pref-tooltip.visible {
  opacity: 1;
}

.pref-value {
  min-width: 30px;
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
}

/* ========== Loading ========== */
.loading {
  text-align: center;
  padding: 40px;
  color: #999;
}

.loading::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #3a3a5c;
  border-top-color: #6c5ce7;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========== Shift Entry ========== */
.shift-entry {
  background: #1e1e38;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  border: 1px solid #3a3a5c;
}

.shift-entry-fields {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.shift-entry-fields .form-group {
  flex: 1;
}

.shift-remove-btn {
  align-self: flex-end;
  margin-bottom: 4px;
  flex-shrink: 0;
}

.shift-hint {
  font-size: 0.78rem;
  color: #f0a500;
  margin-top: 4px;
}

/* ========== Staff Schedule Modal Items ========== */
.cast-name-link {
  cursor: pointer;
}

.cast-name-link:hover {
  opacity: 0.7;
}

.staff-schedule-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #2a2a4a;
}

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

.staff-schedule-info {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.staff-schedule-date {
  font-weight: 700;
  font-size: 0.9rem;
  min-width: 80px;
}

.staff-schedule-time {
  font-size: 0.85rem;
  color: #a0a0b8;
}

.staff-schedule-shop {
  font-size: 0.8rem;
  color: #888;
}

.staff-schedule-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.cast-shift-time {
  font-size: 0.8rem;
  color: #888;
  margin-left: 4px;
}

.modal-shift-list {
  display: flex;
  flex-direction: column;
}

.modal-shift-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  align-items: center;
  column-gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid #3a3a5c;
  font-size: 0.9rem;
}

.modal-shift-list.with-score .modal-shift-row {
  grid-template-columns: minmax(0, 1fr) 104px 52px;
}

.modal-shift-row:last-child {
  border-bottom: none;
}

.modal-shift-name {
  min-width: 0;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.modal-shift-time {
  text-align: center;
  font-size: 0.8rem;
  color: #888;
  font-variant-numeric: tabular-nums;
  padding-left: 5px;
  padding-right: 5px;
}

.modal-shift-score {
  text-align: right;
  font-weight: 700;
  font-size: 0.85rem;
}

.modal-shift-score.positive {
  color: var(--score-positive-color, #ff6b6b);
}

.modal-shift-score.negative {
  color: var(--score-negative-color, #74b9ff);
}

.modal-shift-score.neutral {
  color: var(--score-neutral-color, #888);
}

@media (max-width: 640px) {
  .modal-shift-row {
    grid-template-columns: minmax(0, 1fr) 64px;
  }

  .modal-shift-list.with-score .modal-shift-row {
    grid-template-columns: minmax(0, 1fr) 64px 46px;
  }

  .modal-shift-time {
    font-size: 0.75rem;
    line-height: 1.15;
  }

  .modal-shift-sep {
    display: none;
  }

  .modal-shift-start,
  .modal-shift-end {
    display: block;
  }
}

.staff-detail-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.staff-detail-label {
  font-weight: 700;
  font-size: 0.9rem;
  color: #e0e0e0;
  margin-bottom: 6px;
}

.staff-detail-actions {
  display: flex;
  gap: 6px;
}

.staff-detail-divider {
  border: none;
  border-top: 1px solid #3a3a5c;
  margin: 8px 0;
}

.staff-modal-pref {
  padding: 8px 0;
}

.staff-info-section {
  text-align: center;
  padding: 8px 0;
}

.staff-info-image {
  margin-bottom: 8px;
}

.staff-photo {
  max-width: 100%;
  max-height: 200px;
  border-radius: 8px;
  object-fit: cover;
}

.staff-no-image {
  color: #666;
  font-size: 0.85rem;
  padding: 24px 0;
  background: #1e1e38;
  border-radius: 8px;
}

.staff-info-link {
  margin-top: 4px;
}

.staff-info-link a {
  color: #a29bfe;
  font-size: 0.85rem;
  word-break: break-all;
}

/* ========== My Page ========== */
.mypage-section {
  max-width: 560px;
  margin: 0 auto;
}

.mypage-card {
  background: #252547;
  border-radius: 8px;
  border: 1px solid #3a3a5c;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  padding: 20px;
  margin-bottom: 16px;
}

.mypage-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #3a3a5c;
}

.btn-block {
  display: block;
  width: 100%;
  padding: 10px;
  font-size: 0.95rem;
  margin-top: 12px;
}

.notif-instruction-box {
  background: rgba(240, 165, 0, 0.1);
  color: #f0a500;
  font-size: 0.85rem;
  line-height: 1.6;
  padding: 12px 14px;
  border-radius: 6px;
  margin-bottom: 12px;
}

.intro-page { text-align: left; }
.intro-page p { color: #d6d6e7; line-height: 1.8; }
.intro-page h2 { margin-top: 40px; }
.intro-page h3 { margin-top: 30px; color: #f3f3ff; }
.intro-page .intro-img { text-align: center; margin: 20px 0; }
.intro-page .intro-img img { max-width: 100%; border-radius: 14px; }
.intro-page .hl-blue { color: #74b9ff; }
.intro-page .hl-red { color: #ff6b6b; }

.mypage-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  font-size: 0.95rem;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #3a3a5c;
  border-radius: 26px;
  transition: 0.3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
  background: #6c5ce7;
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}

.mypage-sub-section {
  padding: 12px 0;
  border-top: 1px solid #3a3a5c;
}

.mypage-sub-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: #a0a0b8;
  margin-bottom: 10px;
}

.minutes-input {
  display: flex;
  align-items: center;
  gap: 8px;
}

.minutes-input input {
  width: 100px;
  padding: 10px 12px;
  border: 1px solid #3a3a5c;
  border-radius: 6px;
  font-size: 0.95rem;
  background: #1a1a2e;
  color: #e0e0e0;
}

.minutes-suffix {
  font-size: 0.9rem;
  color: #a0a0b8;
}

.form-hint {
  font-size: 0.78rem;
  color: #999;
  margin-top: 4px;
}

/* ========== Responsive ========== */
@media (max-width: 600px) {
  .container {
    padding: 12px;
  }

  .calendar-cell {
    font-size: 0.75rem;
    min-height: 34px;
  }

  .modal-content {
    width: 95%;
    max-height: 85vh;
  }

  .header,
  .header-spacer {
    min-height: 150px;
  }

  .header-title {
    font-size: 1.1rem;
  }

  .shift-entry-fields {
    gap: 4px;
  }

  .shift-entry-fields .form-group label {
    display: none;
  }

  .shift-entry-fields .form-group input {
    padding: 8px 4px;
    font-size: 0.85rem;
  }
}

/* Leaflet popup dark theme */
.leaflet-popup-content-wrapper {
  background: #252547;
  color: #e0e0e0;
  border-radius: 10px;
  box-shadow: 0 3px 14px rgba(0,0,0,0.5);
}
.leaflet-popup-tip {
  background: #252547;
}
.leaflet-popup-content a {
  color: #a29bfe;
}
.leaflet-control-zoom a {
  background: #252547 !important;
  color: #e0e0e0 !important;
  border-color: #3a3a5c !important;
}
.leaflet-control-zoom a:hover {
  background: #1e1e38 !important;
}

/* ========== Monthly Calendar (おきゅよて) ========== */
.monthly-calendar-modal {
  max-width: 95vw;
  width: 95vw;
  resize: horizontal;
  overflow: auto;
  min-width: 300px;
  background: linear-gradient(180deg, #4a5a8a 0%, #7b8dbd 40%, #a0aed0 100%) !important;
  color: #fff;
  border: none !important;
  border-radius: 12px !important;
  overflow: hidden;
}
.monthly-calendar-modal .modal-header {
  background: transparent;
  border-bottom: none;
  padding: 16px 16px 0;
}
.monthly-calendar-modal .modal-header h3 {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 400;
}
.monthly-calendar-modal .modal-body {
  padding: 0 8px 12px;
}
.monthly-header-block {
  text-align: center;
  padding: 30px 0 12px;
}
.monthly-header-month {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.8);
}
.monthly-header-year {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.6);
}
.monthly-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 8px;
}
.monthly-nav button {
  background: rgba(255,255,255,0.15) !important;
  border: none !important;
  color: #fff !important;
  width: 28px;
  height: 28px;
  border-radius: 50% !important;
  padding: 0 !important;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.monthly-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
}
.monthly-dow {
  text-align: center;
  font-size: 0.65rem;
  padding: 4px 0;
  color: rgba(255,255,255,0.7);
  font-weight: 600;
}
.monthly-cell {
  min-height: 58px;
  padding: 2px 1px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.monthly-cell-other {
  opacity: 0.3;
}
.monthly-day-num {
  font-size: 0.8rem;
  color: #fff;
  margin-bottom: 3px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.monthly-shift-badge {
  background: rgba(100,180,255,0.35);
  color: #fff;
  font-size: 0.55rem;
  padding: 1px 3px;
  border-radius: 2px;
  margin-bottom: 1px;
  white-space: nowrap;
  width: calc(100% - 2px);
  text-align: center;
}
.monthly-event-badge {
  background: rgba(255,180,100,0.4);
  color: #fff;
  font-size: 0.5rem;
  padding: 1px 2px;
  border-radius: 2px;
  margin-bottom: 1px;
  width: calc(100% - 2px);
  text-align: center;
  word-break: break-all;
  line-height: 1.3;
  white-space: pre-line;
}

/* ---------- Check-in ---------- */
[v-cloak] {
  display: none !important;
}
.btn-checkin {
  display: inline-block;
  background: #e8d040;
  color: #1a1a2e;
  border: none;
  border-radius: 999px;
  padding: 12px 32px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(232, 208, 64, 0.4);
  transition: opacity 0.2s, transform 0.1s;
}
.btn-checkin:hover:not(:disabled) {
  opacity: 0.9;
}
.btn-checkin:active:not(:disabled) {
  transform: scale(0.98);
}
.btn-checkin:disabled {
  background: #555;
  color: #999;
  cursor: not-allowed;
  box-shadow: none;
}

.checkin-banner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  background: linear-gradient(135deg, rgba(255, 245, 157, 0.9) 0%, rgba(249, 168, 37, 0.9) 100%);
  border: 2px solid rgba(249, 168, 37, 0.9);
  border-radius: 12px;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  z-index: 10;
  animation: checkin-blink 1.2s ease-in-out infinite;
  text-align: center;
  max-width: 60%;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.checkin-banner-line1 {
  font-size: 0.9rem;
  color: #fff;
}
.checkin-banner-line2 {
  font-size: 1.1rem;
  margin-top: 4px;
  color: #fff;
  word-break: break-all;
}
@keyframes checkin-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ---------- Rating stars ---------- */
.rating-stars {
  display: inline-flex;
  gap: 4px;
  font-size: 1.6rem;
  user-select: none;
  cursor: pointer;
}
.rating-star {
  color: #666;
  transition: color 0.1s;
  line-height: 1;
}
.rating-star.filled {
  color: #e8d040;
  text-shadow: 0 0 4px rgba(232, 208, 64, 0.4);
}
.rating-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px 0;
  gap: 12px;
}
.rating-row-label {
  font-size: 0.85rem;
  color: #d6d6e7;
  flex-shrink: 0;
}
.rating-staff-block {
  background: #1e1e38;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}
.rating-staff-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.rating-staff-name {
  font-size: 1rem;
  font-weight: 700;
  color: #f3f3ff;
}
