:root {
  --bg: #fff7fb;
  --card: #ffffff;
  --card-border: #f3d9e6;
  --text: #4b3b44;
  --muted: #8a7480;
  --primary: #de7fa6;
  --primary-dark: #c9658f;
  --primary-soft: #fbe3ee;
  --danger: #d85b7b;
  --shadow: 0 10px 30px rgba(222, 127, 166, 0.12);
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: linear-gradient(180deg, #fff8fc 0%, #fff3f9 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
}

a {
  color: var(--primary-dark);
  text-decoration: none;
}

body {
  min-height: 100vh;
}

.app-shell {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 82px 16px 96px;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 20px;
}

.card + .card {
  margin-top: 14px;
}

.section-title {
  margin: 0 0 14px;
  font-size: 20px;
  font-weight: 800;
}

.field {
  margin-bottom: 14px;
}

.label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.input,
.textarea,
.select {
  width: 100%;
  appearance: none;
  border: 1px solid #ebd3df;
  background: #fff;
  border-radius: 14px;
  padding: 14px 14px;
  font-size: 16px;
  color: var(--text);
  outline: none;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(222, 127, 166, 0.12);
}

.textarea {
  min-height: 120px;
  resize: vertical;
}

.button {
  width: 100%;
  border: none;
  border-radius: 16px;
  padding: 15px 16px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.18s ease;
}

.button-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  box-shadow: 0 10px 22px rgba(201, 101, 143, 0.22);
}

.button-soft {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.error-box {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff1f5;
  color: var(--danger);
  border: 1px solid #f4c8d6;
  font-size: 14px;
  font-weight: 700;
}

.hero-card {
  position: relative;
  overflow: hidden;
  padding: 24px 20px;
  background:
    radial-gradient(circle at top right, rgba(255,255,255,0.75), transparent 28%),
    linear-gradient(135deg, #f6bad2 0%, #de7fa6 100%);
  color: #fff;
  border: none;
}

.hero-card h2 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 800;
}

.hero-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255,255,255,0.92);
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.metric-card {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.metric-label {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.metric-value {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  color: var(--primary-dark);
}

.action-list {
  display: grid;
  gap: 10px;
}

.action-link {
  display: block;
  padding: 14px 16px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--card-border);
  color: var(--text);
  font-weight: 700;
  box-shadow: var(--shadow);
}

.small-note {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.divider {
  height: 1px;
  background: #f1dde7;
  margin: 14px 0;
  border: 0;
}

.center-stack {
  display: grid;
  gap: 14px;
}

.chart-box {
  position: relative;
  width: 100%;
  height: 220px;
}

.app-header {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  max-width: 440px;
  margin: 0 auto;
  z-index: 1000;
  padding: 12px 16px calc(10px + env(safe-area-inset-top));
  background: rgba(255,255,255,0.96);
  border-bottom: 1px solid #f1dde7;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 20px rgba(222, 127, 166, 0.08);
}

.app-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.app-header-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.app-header-logo {
  font-size: 18px;
  font-weight: 900;
  color: var(--primary-dark);
  line-height: 1;
}

.app-header-sub {
  font-size: 11px;
  color: var(--muted);
  line-height: 1;
}

.app-header-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}

.app-header-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-dark);
  white-space: nowrap;
}

.footer-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid #f1dde7;
  box-shadow: 0 -8px 24px rgba(222, 127, 166, 0.08);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.footer-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  color: var(--muted);
  border-radius: 14px;
  font-size: 11px;
  font-weight: 700;
}

.footer-nav-item-active {
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.footer-nav-icon {
  font-size: 18px;
  line-height: 1;
}

.footer-nav-label {
  font-size: 10px;
  line-height: 1.1;
}

#dashboardCalendar .fc-toolbar-title,
#calendar .fc-toolbar-title {
  font-size: 18px;
}

#dashboardCalendar .fc-event-title,
#calendar .fc-event-title {
  white-space: normal !important;
  word-break: break-word;
  font-size: 11px;
  line-height: 1.2;
}

#dashboardCalendar .fc-daygrid-event,
#calendar .fc-daygrid-event {
  border-radius: 8px;
  padding: 2px 4px;
}

#dashboardCalendar .fc-daygrid-day-number,
#calendar .fc-daygrid-day-number {
  font-size: 13px;
}

@media (max-width: 380px) {
  .metric-grid {
    grid-template-columns: 1fr;
  }
}

.footer-nav-4 {
  grid-template-columns: repeat(4, 1fr);
}


/* ===== UI UPGRADE START ===== */

/* ボタン押下感 */
.button,
button {
  transition: all 0.15s ease;
}

.button:active,
button:active {
  transform: scale(0.96);
  opacity: 0.9;
}

/* カードの質感アップ */
.card {
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.08);
}

/* 入力欄のフォーカス強化 */
.input:focus,
.textarea:focus,
.select:focus {
  border-color: #e48fb3;
  box-shadow: 0 0 0 3px rgba(228,143,179,0.15);
  transition: all 0.2s ease;
}

/* シートのぬるっと表示 */
.calendar-sheet {
  transition: all 0.25s ease;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
}

.calendar-sheet.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* backdropもふわっと */
.calendar-sheet-backdrop {
  transition: opacity 0.2s ease;
  opacity: 0;
}

.calendar-sheet-backdrop.show {
  opacity: 1;
}

/* タップしやすくする */
.button {
  min-height: 44px;
}

/* リストアイテムのタップ感 */
.ranking-item,
.visit-card {
  transition: all 0.15s ease;
}

.ranking-item:active,
.visit-card:active {
  transform: scale(0.98);
  background: #fff3f8;
}

/* ===== UI UPGRADE END ===== */


/* 今日の日付強調 */
.fc .fc-day-today {
  background: #fff2f7 !important;
  border-radius: 10px;
}

/* 日付数字 */
.fc .fc-daygrid-day-number {
  font-weight: 700;
}


/* カレンダータップ感 */
.fc .fc-daygrid-day {
  transition: transform 0.1s ease, background 0.15s ease;
}

.fc .fc-daygrid-day:active {
  transform: scale(0.96);
  background: #ffe8f1;
}

/* イベント押したとき */
.fc-event:active {
  transform: scale(0.97);
  opacity: 0.9;
}


/* イベントの見やすさ */
.fc-event {
  border: none !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}


/* ===== MOBILE OPTIMIZE START ===== */
@media (max-width: 480px) {
  .dashboard-monthbar-btn {
    min-width: 44px !important;
    height: 36px !important;
    font-size: 17px !important;
  }

  .dashboard-monthbar-title {
    font-size: 15px !important;
  }

  .fc .fc-daygrid-event {
    padding: 3px 4px !important;
    border-radius: 8px !important;
  }

  .fc-dashboard-shop-line {
    font-size: 10px !important;
    line-height: 1.15 !important;
  }

  .fc-dashboard-time-line {
    font-size: 9px !important;
    line-height: 1.1 !important;
  }

  .calendar-sheet {
    width: calc(100% - 16px) !important;
    bottom: 8px !important;
    padding: 14px !important;
    border-radius: 18px !important;
  }

  .calendar-sheet-actions {
    gap: 12px !important;
  }

  .input,
  .select,
  .textarea,
  .button {
    min-height: 44px !important;
  }

  .textarea {
    min-height: 88px !important;
  }

  .label {
    font-size: 12px !important;
    margin-bottom: 6px !important;
  }
}
/* ===== MOBILE OPTIMIZE END ===== */


/* ===== PayPay風リスト ===== */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #eee;
}

.history-left {
  display: flex;
  gap: 12px;
  align-items: center;
}

.history-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #f2f2f2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.history-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-title {
  font-weight: 700;
  font-size: 14px;
}

.history-date {
  font-size: 12px;
  color: #888;
}

.history-right {
  font-weight: 700;
  font-size: 15px;
}

.history-badge {
  margin-top: 4px;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-block;
}

.badge-green {
  background: #e6f7ee;
  color: #1f9d5c;
}

.badge-yellow {
  background: #fff3cd;
  color: #d39e00;
}



.footer-nav-5 .footer-nav-item {
  width: 20%;
}

/* ===== footer nav 5対応（自動分割）===== */
.footer-nav {
  display: flex;
}

.footer-nav-item {
  flex: 1;
  min-width: 0;
  text-align: center;
}

/* 5タブでも潰れないように微調整 */
.footer-nav-icon {
  font-size: 14px;
}

.footer-nav-label {
  font-size: 10px;
}

