/* ===== みかん作業スケジュール：全体デザイン =====
   方針：読みやすさ・押しやすさ優先。意味を持つ色は固定
   緑=出勤 / 灰=休み / 黄=未定 / 青=作業あり / 赤=雨天中止 / オレンジ=アプリの差し色 */
:root {
  --brand: #e8770e; --brand-dark: #b45309; --brand-bg: #fffaf3;
  --ok: #1f7a3d; --ok-dark: #17622f; --ink: #212529; --muted: #6c757d; --line: #e3e6ea;
  --bs-success: #1f7a3d; --bs-success-rgb: 31, 122, 61;
}
html { font-size: 18px; -webkit-text-size-adjust: 100%; }
body { background: var(--brand-bg); color: var(--ink); line-height: 1.6; -webkit-tap-highlight-color: transparent;
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", system-ui, sans-serif; }
.container { max-width: 720px; --bs-gutter-x: 1.1rem; }
:focus-visible { outline: 3px solid #1c7ed6; outline-offset: 2px; }

/* ヘッダー */
.app-nav { background: #fff; border-bottom: 4px solid var(--brand); padding: .5rem 0; position: sticky; top: 0; z-index: 20; }
.app-nav .navbar-brand { color: var(--brand-dark); font-size: 1.3rem; letter-spacing: .02em; }

/* ボタン */
.btn { min-height: 48px; border-radius: 12px; font-weight: 700; }
.btn-lg { min-height: 56px; font-size: 1.1rem; }
.d-grid > .btn-lg { padding: 1rem; font-size: 1.15rem; }
.btn-success { --bs-btn-bg: var(--ok); --bs-btn-border-color: var(--ok); --bs-btn-hover-bg: var(--ok-dark); --bs-btn-hover-border-color: var(--ok-dark); --bs-btn-active-bg: var(--ok-dark); --bs-btn-active-border-color: var(--ok-dark); --bs-btn-disabled-bg: var(--ok); --bs-btn-disabled-border-color: var(--ok); }
.btn-outline-success { --bs-btn-color: var(--ok); --bs-btn-border-color: var(--ok); --bs-btn-hover-bg: var(--ok); --bs-btn-hover-border-color: var(--ok); --bs-btn-active-bg: var(--ok); --bs-btn-active-border-color: var(--ok); }
.form-control, .form-select { font-size: 1.05rem; border-radius: 12px; border-color: #ced4da; }
.card { border-radius: 16px; border-color: var(--line); box-shadow: 0 1px 3px rgba(0,0,0,.06); overflow: hidden; }
.card-header { background: #fff; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
.list-group-item { border-color: var(--line); }
.alert { border-radius: 14px; }

/* ログイン */
.login-box { max-width: 420px; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 1.5rem 1.25rem; margin-top: 1rem; box-shadow: 0 4px 14px rgba(0,0,0,.06); }
.login-title { text-align: center; color: var(--brand-dark); font-weight: 800; margin: .25rem 0 1.25rem; }
.login-title small { display: block; color: var(--muted); font-size: .85rem; font-weight: 400; }

/* 月間カレンダー（共通） */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-bottom: 1rem; }
.cal > * { min-width: 0; } /* 中身で列が広がって右端が切れるのを防ぐ */
#cal { margin-bottom: 9rem; } /* 入力画面は下の保存バーの分だけ空ける */
.wd { text-align: center; font-weight: 700; padding: 4px 0; }
.wd.sun { color: #c62828; } .wd.sat { color: #1565c0; }
.day { overflow: hidden; border: 2px solid transparent; border-radius: 12px; min-height: 68px; padding: 2px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; touch-action: manipulation; user-select: none; }
div.day { cursor: default; }
.day .num { font-size: 1.1rem; font-weight: 700; }
.day .lab { font-size: .95rem; font-weight: 700; }
.day.st-partial .lab { font-size: .72rem; white-space: nowrap; }
.day.today, .aday.today { border-color: var(--ink); box-shadow: 0 0 0 2px #fff inset; }
.day.outside { opacity: .35; background: #e9ecef; color: var(--muted); }
.st-available { background: var(--ok); color: #fff; }
.st-partial { background: #a8dcb4; color: #14401f; }
.st-off { background: #b0b5ba; color: var(--ink); }
.st-undecided { background: #ffe066; color: var(--ink); }
.lg { padding: 1px 6px; border-radius: 6px; white-space: nowrap; }

/* 入力画面の保存バー・選択パネル */
.savebar { z-index: 10; position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid #ccc; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); max-width: 720px; margin: 0 auto; box-shadow: 0 -4px 12px rgba(0,0,0,.08); }
.noscroll { overflow: hidden; }
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1040; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; max-width: 720px; margin: 0 auto; background: #fff; z-index: 1050; border-radius: 20px 20px 0 0; padding: 16px 14px calc(16px + env(safe-area-inset-bottom)); max-height: 92vh; overflow-y: auto; }

/* 管理者・全体カレンダー */
.acal { margin-bottom: 1rem; }
.aday { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; min-height: 92px; padding: 3px 2px; display: flex; flex-direction: column; align-items: stretch; text-decoration: none; color: inherit; background: #fff; }
.aday .top { display: flex; justify-content: space-between; align-items: center; padding: 0 3px; }
.aday .num { font-weight: 700; font-size: 1rem; }
.aday .wx { font-size: 1.05rem; line-height: 1; }
.aday .n { white-space: nowrap; font-size: .78rem; font-weight: 700; text-align: center; border-radius: 4px; margin-top: 1px; line-height: 1.25; }
.aday.past { background: #f3f4f6; opacity: .65; }

/* 作業予定バッジ・天気 */
.pill { white-space: nowrap; overflow: hidden; font-size: .62rem; font-weight: 700; text-align: center; border-radius: 5px; padding: 1px 0; line-height: 1.25; margin: 1px 0; }
.pill-lg { display: inline-block; font-size: 1rem; font-weight: 700; border-radius: 10px; padding: 4px 14px; }
.pl-work { background: #0d6efd; color: #fff; }
.pl-off { background: #6c757d; color: #fff; }
.pl-rain { background: #dc3545; color: #fff; }
.pl-none { background: #f1f3f5; color: #6c757d; font-weight: 400; }
.plan-dl dt { font-size: .85rem; color: var(--muted); margin-top: .6rem; }
.plan-dl dd { margin: 0; white-space: pre-wrap; font-size: 1.1rem; }
.wx-line { border-top: 1px dashed #ced4da; padding-top: .5rem; font-size: 1.05rem; }

/* 月の見出し：狭い画面は「見出し／前月・翌月」の2行、広い画面は1行 */
.month-bar { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; align-items: center; }
.month-bar > :first-child { grid-column: 1; grid-row: 2; }
.month-bar > :last-child { grid-column: 2; grid-row: 2; }
.month-bar > .month-title { grid-column: 1 / -1; grid-row: 1; text-align: center; margin: 0; }
.month-bar .btn { white-space: nowrap; }
@media (min-width: 576px) {
  .month-bar { grid-template-columns: auto 1fr auto; }
  .month-bar > :first-child { grid-row: 1; grid-column: 1; }
  .month-bar > :last-child { grid-row: 1; grid-column: 3; }
  .month-bar > .month-title { grid-row: 1; grid-column: 2; }
}
/* 作業予定の一覧：今日の行を最初に画面上部へ（固定ヘッダーの分だけ空ける） */
[data-scroll-today] { scroll-margin-top: 80px; }
.past-row { opacity: .6; }
