/* =========================
   全体リセット
   ========================= */

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
    "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  background: #f6f8fa;
  color: #0a0a0a;
  overscroll-behavior-y: none;
}

/* =========================
   ヘッダー（2段構成・固定）
   ========================= */

.mw-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.mw-header-top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: #1bbf83;
  padding: 12px 16px 10px;
}

.mw-app-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}

.mw-tenant-bar {
  background: #5bcf9b;
  padding: 8px 16px 10px;
  color: #fff;
  margin: 0;
  border-radius: 0;
  border: none;
  box-shadow: none;
}

.mw-tenant-main {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.mw-tenant-sub {
  font-size: 12px;
  opacity: 0.95;
}

/* =========================
   メインエリア（ホーム / その他ビュー）
   ========================= */

.home,
.view {
  padding-top: 132px; /* ヘッダー2段ぶん */
  padding-left: 16px;
  padding-right: 16px;
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); /* タブバー＋ホームバー */
  max-width: 820px;
  margin: 0 auto;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.home-title {
  margin: 12px 4px 8px 4px;
  font-size: 20px;
  color: #0e7a57;
}

/* =========================
   カード
   ========================= */

.card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e6f1ec;
  box-shadow: 0 6px 20px rgba(15, 181, 122, 0.1);
  padding: 16px;
  margin: 12px 0;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #0e7a57;
}

.card-body {
  font-size: 14px;
}

.card-empty {
  margin: 4px 0 0 0;
  color: #666;
}

/* ホーム：未対応サマリ */

.stats-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.stat-item {
  flex: 1;
  text-align: center;
}

.stat-label {
  font-size: 12px;
  color: #555;
}

.stat-value {
  margin-top: 4px;
  font-weight: 600;
}

/* ホーム：今月の売上 */

.revenue-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.revenue-main {
  font-size: 20px;
  font-weight: 700;
}

.revenue-sub {
  font-size: 12px;
  color: #555;
  margin-top: 4px;
}

/* =========================
   ボタン
   ========================= */

.btn {
  appearance: none;
  border: none;
  border-radius: 12px;
  padding: 12px 14px;
  background: #11b97b;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}

.btn:active {
  transform: translateY(1px);
}

.btn-full {
  width: 100%;
}

.btn-secondary {
  background: #e6f1ec;
  color: #15624b;
}

/* 丸い小さいボタン（カレンダーの < > 用） */

.btn-circle {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* 今日ボタン */

.btn-today {
  margin-left: 8px;
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 20px;
  background: #1bbf83;
  color: #fff;
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.btn-today:active {
  transform: translateY(1px);
}

/* =========================
   フォーム共通
   ========================= */

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

/* ラベル */

.form-label {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
  color: #333;
}

/* テキスト入力・日付入力・時刻入力など */

.form-input,
.form-textarea {
  width: 100%;
  font-size: 16px; /* iOS のズーム抑止 */
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d3e2dc;
  outline: none;
  box-sizing: border-box;
}

.form-input:focus,
.form-textarea:focus {
  border-color: #1bbf83;
  box-shadow: 0 0 0 2px rgba(27, 191, 131, 0.15);
}

.form-textarea {
  resize: vertical;
}

/* 補足テキスト */

.form-help {
  font-size: 11px;
  color: #777;
  margin-top: 4px;
}

/* 読み取り専用っぽいピル */

.form-readonly-pill {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: #eef5f2;
  font-size: 13px;
}

/* 送信ボタン行 */

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

/* =========================
   スケジュール：時刻入力レイアウト
   ========================= */

/* 1行に2つ並べる想定だった .form-row を
   スケジュールフォームでは縦並びにして使う */

.form-row {
  display: block;
  margin-bottom: 12px;
}

.form-row .form-group.half {
  width: 100%;
  padding: 0;
  margin-bottom: 12px;
}

/* 日付ピル：日付がちょうど入るくらいのサイズ感 */

#scheduleFormDateLabel {
  width: auto;
  max-width: 190px;   /* お好みで 170〜200 くらいで調整OK */
  text-align: left;
  padding: 8px 14px;
}

/* 時刻入力欄：幅を細くして左寄せ */

#scheduleStartTime,
#scheduleEndTime {
  width: 120px !important;      /* もう少し細くしたければ 110px */
  max-width: 120px !important;
  text-align: left !important;
  padding-left: 10px !important;
  font-feature-settings: "tnum"; /* 数字が揃って見やすく */
}

/* iOS Safari の time入力内部も左寄せ */

input[type="time"]::-webkit-datetime-edit,
input[type="time"]::-webkit-datetime-edit-fields-wrapper,
input[type="time"]::-webkit-datetime-edit-hour-field,
input[type="time"]::-webkit-datetime-edit-minute-field,
input[type="time"]::-webkit-datetime-edit-ampm-field {
  text-align: left !important;
}

/* =========================
   スケジュール一覧
   ========================= */

.schedule-date-label {
  font-size: 14px;
  margin-left: 4px;
  color: #0e7a57;
}

.schedule-empty {
  font-size: 14px;
  color: #555;
  margin: 8px 0 4px;
}

.schedule-item {
  padding: 8px 0;
  border-top: 1px solid #e5efea;
  font-size: 14px;
}

.schedule-item:first-of-type {
  border-top: none;
}

.schedule-time {
  font-weight: 600;
  margin-bottom: 2px;
}

.schedule-mainline {
  margin-left: 0;
}

/* =========================
   カレンダー（スケジュール画面）
   ========================= */

.calendar-header-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}

.calendar-title {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
}

/* 曜日ヘッダー */

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  font-size: 12px;
  margin-bottom: 8px;
  text-align: center;
  color: #555;
}

.calendar-weekday {
  padding: 2px 0;
}

/* 日付グリッド */

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

/* 日付ボタン */

.calendar-day {
  width: 100%;
  border-radius: 999px;
  padding: 8px 0;
  border: none;
  background: #f3f4f6;
  font-size: 14px;
  text-align: center;
  cursor: pointer;
  color: #2563eb;
}

/* 本日より前の日：薄め */

.calendar-day.past {
  color: #9ca3af;
}

/* 今日 */

.calendar-day.today {
  border: 2px solid #1bbf83;
  font-weight: 600;
}

/* 選択中 */

.calendar-day.selected {
  background: #1bbf83;
  color: #fff;
}

/* 日付なしセル */

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

/* 説明文 */

.calendar-note {
  font-size: 11px;
  color: #666;
  margin-top: 10px;
}

/* =========================
   ボトムタブバー
   ========================= */

.mw-tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  padding: 6px 0;
  background: linear-gradient(135deg, #16c177, #0fb57a);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

.mw-tab {
  flex: 1;
  text-decoration: none;
  color: #333;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 0;
}

.mw-tab-icon {
  width: 28px;
  height: 28px;
  display: block;
  filter: brightness(0.15);
}

.mw-tab-label {
  line-height: 1.2;
}

/* アクティブ状態 */

.mw-tab.active .mw-tab-label {
  color: #ffffff;
  font-weight: 600;
}

.mw-tab.active .mw-tab-icon {
  filter: brightness(10);
}

/* =========================
   レスポンシブ
   ========================= */

@media (min-width: 720px) {
  .home,
  .view {
    padding-left: 24px;
    padding-right: 24px;
  }
}

/* iOS Safari の time入力を強制左寄せ */
#scheduleStartTime,
#scheduleEndTime {
  text-align: left !important;
}

/* 内部の表示部分も左寄せ */
#scheduleStartTime::-webkit-datetime-edit,
#scheduleEndTime::-webkit-datetime-edit {
  text-align: left !important;
}
