/* ─── リセット・基本 ─────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Hiragino Sans', 'Meiryo', sans-serif; font-size: 14px; background: #f4f6f9; color: #333; }
button { cursor: pointer; font-family: inherit; font-size: 13px; }
input, textarea, select { font-family: inherit; font-size: 13px; }

/* ─── ヘッダー ─────────────────────────────── */
.header {
  display: flex; align-items: center; gap: 12px;
  background: #1a73e8; color: #fff;
  padding: 0 16px; height: 52px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 4px rgba(0,0,0,.2);
  transition: background .3s;
}
.header.admin-mode { background: #e53935; }
.logo { font-size: 16px; font-weight: bold; white-space: nowrap; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav-btn {
  background: transparent; color: rgba(255,255,255,.8);
  border: none; border-bottom: 3px solid transparent;
  padding: 0 14px; height: 52px; font-size: 13px;
  transition: color .15s, border-color .15s;
}
.nav-btn:hover { color: #fff; }
.nav-btn.active { color: #fff; border-bottom-color: #fff; font-weight: bold; }
.admin-toggle { display: flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.admin-toggle input { width: 16px; height: 16px; cursor: pointer; }

/* 管理者チェックボックス */
.header-right { display: flex; align-items: center; }
.admin-checkbox-label {
  display: flex; align-items: center; gap: 6px;
  color: rgba(255,255,255,.8); font-size: 13px;
  cursor: pointer; user-select: none; white-space: nowrap;
  padding: 4px 10px; border-radius: 6px;
  border: 1px solid rgba(255,255,255,.3);
  transition: background .15s;
}
.admin-checkbox-label:hover { background: rgba(255,255,255,.1); }
.admin-checkbox-label.is-admin { color: #fff; border-color: rgba(255,255,255,.5); background: rgba(255,255,255,.15); }
.admin-checkbox-label input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; accent-color: #ffe082; }

/* 確定シフトバッジ（一般モード） */
.confirmed-badge {
  background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7;
  border-radius: 6px; padding: 4px 10px; font-size: 12px;
}

/* ─── ページコンテナ ─────────────────────────── */
.page { padding: 16px; max-width: 100%; }

/* ─── ツールバー ─────────────────────────────── */
.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.month-nav { display: flex; align-items: center; gap: 6px; }
.month-nav button {
  background: #fff; border: 1px solid #ccc; border-radius: 4px;
  width: 30px; height: 30px; font-size: 16px; line-height: 1;
}
.month-nav button:hover { background: #f0f0f0; }
.month-label { font-size: 18px; font-weight: bold; min-width: 110px; text-align: center; }

/* ─── ボタン ─────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 14px; border-radius: 5px; border: none; font-size: 13px;
  transition: opacity .15s;
}
.btn:hover { opacity: .85; }
.btn-primary   { background: #1a73e8; color: #fff; }
.btn-success   { background: #2e7d32; color: #fff; border: none; }
.btn-success:hover { background: #1b5e20; }
.btn-danger    { background: #ea4335; color: #fff; }
.btn-ghost     { background: #fff; color: #555; border: 1px solid #ccc; }
.btn-sm        { padding: 4px 10px; font-size: 12px; }

/* ─── シフト表 ─────────────────────────────── */
.shift-table-wrap {
  overflow-x: auto;
  border-radius: 0;
  box-shadow: none;
  background: #fff;
}
.shift-table {
  border-collapse: collapse;
  font-size: 12px;
  table-layout: fixed;
  width: 100%;
}
/* 折り返し禁止はセル単位で指定（サマリー行は除く） */
.shift-table .col-name,
.shift-table .col-type,
.shift-table .shift-cell,
.shift-table .th-date,
.shift-table .slot-cell,
.shift-table .slot-label,
.shift-table .slot-total { white-space: nowrap; }
.shift-table th,
.shift-table td {
  border: 1px solid #e0e0e0;
  padding: 0;
  text-align: center;
  vertical-align: middle;
  min-width: 42px;
  height: 32px;
}
/* スタッフ名列 */
.col-name {
  position: sticky; left: 0; z-index: 10;
  background: #fff; width: 80px; min-width: 80px;
  text-align: left; padding: 4px 8px; font-weight: bold;
  border-right: 2px solid #bbb !important;
  overflow: hidden; text-overflow: ellipsis;
}
.col-type {
  position: sticky; left: 80px; z-index: 10;
  background: #fff; width: 52px; min-width: 52px;
  font-size: 11px; color: #666;
  border-right: 2px solid #ddd !important;
}
/* ヘッダー行 */
.shift-table thead th {
  position: sticky; top: 0; z-index: 20;
  background: #f8f9fa; font-weight: bold;
}
.shift-table thead th.col-name { z-index: 30; }
.shift-table thead th.col-type { z-index: 30; }
/* 合計列 */
.col-total {
  position: sticky; right: 0; z-index: 10;
  background: #fff; min-width: 44px; width: 44px;
  text-align: center; font-weight: normal; font-size: 11px;
  border-left: 2px solid #bbb !important;
  border-right: none !important;
}
.shift-table thead th.col-total { z-index: 30; background: #fff; font-weight: normal; }

/* 日付ヘッダー */
.th-date { width: 42px; min-width: 42px; }
.th-date .day-num  { font-weight: bold; font-size: 12px; }
.th-date .day-name { font-size: 10px; color: #777; }
/* 曜日カラー */
.day-sat .day-num, .day-sat .day-name { color: #1565c0; }
.day-sun .day-num, .day-sun .day-name { color: #c62828; }
.day-hol .day-num, .day-hol .day-name { color: #c62828; }
.th-date.day-sat { background: #e8eaf6 !important; }
.th-date.day-sun { background: #ffebee !important; }
.th-date.day-hol { background: #ffebee !important; }


/* ヘッダーとスタッフ行の区切り */
.shift-table thead tr:last-child th { border-bottom: 2px solid #999; }

/* Dr→DH、DH→DA グループ区切り線 */
.row-Dr + .row-DH td,
.row-Dr + .row-DH .col-name { border-top: 2px solid #bbb !important; }
.row-DH + .row-DA td,
.row-DH + .row-DA .col-name { border-top: 2px solid #bbb !important; }

/* 役割別：名前セルのみ色分け */
.row-Dr .col-name { background: #daeeff !important; }
.row-DH .col-name { background: #fde8ef !important; }
.row-DA .col-name { background: #edf8f0 !important; }

/* 役割カラー */
.role-Dr { color: #1565c0; font-weight: bold; }
.role-DH { color: #2e7d32; }
.role-DA { color: #6a1b9a; }

/* サマリー行 */
.summary-row th {
  font-size: 11px; font-weight: normal;
  position: sticky; top: 32px; z-index: 20;
}
.summary-row .col-name {
  font-weight: bold; font-size: 11px;
  background: #fff !important; color: #555;
  top: 32px; z-index: 30;
}
.summary-row .col-type {
  background: #fff !important;
  top: 32px; z-index: 30;
}
.summary-cell {
  text-align: center; padding: 1px 0;
  background: #fff;
  overflow: hidden; max-width: 42px; min-width: 42px;
}
.sum-clip { width: 40px; overflow: hidden; margin: 0 auto; }
.sum-line { line-height: 1.4; font-size: 9px; white-space: nowrap; }
.sum-slot { color: #555; }
.sum-critical { background: #fff !important; }
.sum-warning  { background: #fff !important; }
.sum-ok       { background: #fff !important; }

/* 調整が必要なセルのハイライト */
.col-warn { outline: 2px solid #ff8f00 !important; outline-offset: -2px; }

/* 治療枠・P処枠・合計行 */
.slot-row td { height: 28px; text-align: center; font-size: 10px; }
.slot-label {
  position: sticky; left: 0; z-index: 10;
  background: #fff !important; font-weight: bold;
  font-size: 11px; padding: 2px 6px;
  border-top: 1px solid #e0e0e0 !important;
}
.treat-row { background: #fff; border-top: 3px solid #999; }
.prev-row  { background: #fff; }
.total-row { background: #fff; font-weight: bold; }

.slot-cell { padding: 2px; font-size: 12px; border: 1px solid #e0e0e0; }
.slot-sum  { font-weight: bold; }
.slot-total {
  position: sticky; right: 0;
  background: #fff; font-weight: bold; font-size: 12px;
  text-align: center; padding: 0 6px;
  border-left: 1px solid #e0e0e0 !important;
  min-width: 40px;
}
.grand-total { background: #fff !important; font-size: 13px; }

.slot-input {
  width: 36px; height: 22px; text-align: center;
  border: 1px solid #bbb; border-radius: 3px;
  font-size: 11px; padding: 0 2px;
}

/* 警告パネル */
.alert-panel {
  background: #fff8e1; border: 1px solid #ffe082; border-radius: 8px;
  padding: 10px 14px; margin-bottom: 14px;
  font-size: 13px;
}
.alert-panel strong { display: block; margin-bottom: 8px; color: #e65100; }
.alert-list { display: flex; flex-wrap: wrap; gap: 6px; }
.alert-item {
  display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px;
}
.alert-critical { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }
.alert-warning  { background: #fff3e0; color: #e65100; border: 1px solid #ffcc80; }
.alert-info     { background: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }
.alert-panel-info { background: #e8f4fd; border-color: #90caf9; }
.alert-panel-info strong { color: #1565c0; }
.closure-affected-cell { outline: 2px solid #1565c0 !important; outline-offset: -2px; }

/* セルステータス */
.shift-cell { width: 42px; height: 32px; cursor: pointer; transition: filter .1s; }
.shift-cell:hover { filter: brightness(.93); }
.shift-cell.locked { cursor: default; }
.shift-cell.locked:hover { filter: none; }

.s-終日      { background: #fff; color: #2e7d32; }
.s-reception { background: #edf8f0; color: #2e7d32; }
.s-AM   { background: #fff; color: #e65100; }
.s-PM   { background: #fff; color: #e65100; }
.s-有給 { background: #fff; color: #1565c0; }
.s-代休 { background: #fff; color: #6a1b9a; }
.s-休み { background: #fff; color: #9e9e9e; }
.s-調整 { background: #fff; color: #c62828; }
.s-x   { background: #fff; color: #757575; }
.s-    { background: #fff; color: #bbb; }

/* 今日列 */
.today-col { background: #fffde7 !important; }
.shift-table thead .today-col { background: #fff176 !important; }

/* 申請マーク */
.has-request::after {
  content: '●'; font-size: 7px; color: #e53935;
  position: absolute; top: 1px; right: 2px;
}
.shift-cell { position: relative; }

/* ─── セクションヘッダー ──────────────────────── */
.section-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.section-title { font-size: 17px; font-weight: bold; }
.month-select-inline {
  padding: 4px 8px; border: 1px solid #ccc; border-radius: 6px;
  background: #fff; font-size: 14px; font-weight: bold; color: #1a237e;
  cursor: pointer;
}

/* ─── 申請カード ─────────────────────────────── */
.request-cards { display: flex; flex-direction: column; gap: 8px; }
.request-card {
  background: #fff; border: 1px solid #e0e0e0; border-radius: 8px;
  padding: 12px 16px; display: flex; align-items: center; gap: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.request-card .staff-badge {
  font-weight: bold; font-size: 14px; min-width: 80px;
}
.request-card .date-info { flex: 1; }
.request-card .date-info .date { font-weight: bold; }
.request-card .date-info .type-badge {
  display: inline-block; font-size: 11px; padding: 2px 8px;
  border-radius: 10px; margin-left: 6px;
}
.badge-希望休 { background: #ffebee; color: #c62828; }
.badge-出勤可能 { background: #e8f5e9; color: #2e7d32; }
.badge-pending  { background: #fff3e0; color: #e65100; }
.badge-approved { background: #e8f5e9; color: #2e7d32; }
.badge-rejected { background: #fafafa; color: #9e9e9e; }
.request-card .actions { display: flex; gap: 6px; }

/* ─── 申請フォーム ────────────────────────────── */
.request-form-wrap { max-width: 700px; }
.staff-select-row { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.staff-select-row select {
  padding: 6px 10px; border: 1px solid #ccc; border-radius: 5px;
  font-size: 14px; min-width: 140px;
}
.request-calendar {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
  margin-bottom: 20px;
}
.request-calendar .cal-header {
  text-align: center; font-size: 11px; font-weight: bold;
  color: #666; padding: 4px 0;
}
.request-calendar .cal-header.sat { color: #1565c0; }
.request-calendar .cal-header.sun { color: #c62828; }
.cal-day {
  aspect-ratio: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  border-radius: 6px; border: 2px solid transparent;
  font-size: 13px; cursor: pointer; background: #f5f5f5;
  transition: all .15s; user-select: none;
}
.cal-day:hover { border-color: #1a73e8; }
.cal-day.selected-off    { background: #ffebee; border-color: #e53935; color: #c62828; font-weight: bold; }
.cal-day.selected-attend { background: #e8f5e9; border-color: #34a853; color: #2e7d32; font-weight: bold; }
.cal-day.is-holiday      { color: #c62828; }
.cal-day.is-sat          { color: #1565c0; }
.cal-day.locked          { background: #e0e0e0; cursor: not-allowed; color: #aaa; }
.cal-day.already-requested { opacity: .5; }
.cal-day .cal-day-sub    { font-size: 9px; color: inherit; opacity: .7; }
.cal-day.empty           { background: transparent; cursor: default; border: none; }

.request-legend { display: flex; gap: 16px; margin-bottom: 12px; font-size: 12px; }
.legend-item { display: flex; align-items: center; gap: 4px; }
.legend-dot { width: 12px; height: 12px; border-radius: 3px; }

/* ─── スタッフ設定 ────────────────────────────── */
.staff-list-table { width: 100%; border-collapse: collapse; background: #fff;
  border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.staff-list-table th { background: #f8f9fa; padding: 10px 12px; text-align: left; border-bottom: 2px solid #e0e0e0; }
.staff-list-table td { padding: 8px 12px; border-bottom: 1px solid #f0f0f0; }
.staff-list-table tr:hover td { background: #f8f9fa; }
.day-check-group { display: flex; gap: 6px; flex-wrap: wrap; }
.day-check { display: flex; align-items: center; gap: 3px; font-size: 12px; }
.day-check input { width: 14px; height: 14px; }

/* ─── ポップオーバー ───────────────────────────── */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 200; }
.popover {
  position: fixed; z-index: 210; background: #fff; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.2); padding: 16px; min-width: 240px;
}
.popover-label { font-weight: bold; margin-bottom: 12px; font-size: 13px; }
.status-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
.status-btn {
  padding: 8px 4px; border-radius: 6px; border: 2px solid transparent;
  font-size: 13px; font-weight: bold; cursor: pointer; text-align: center;
}
.status-btn:hover { border-color: #1a73e8; }
.status-btn.selected { border-color: #1a73e8; }
.cell-note {
  width: 100%; border: 1px solid #ccc; border-radius: 5px;
  padding: 6px; resize: vertical; margin-bottom: 10px;
}
.popover-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ─── トースト ───────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #323232; color: #fff; padding: 10px 20px; border-radius: 6px;
  font-size: 14px; z-index: 300; box-shadow: 0 4px 12px rgba(0,0,0,.3);
  transition: opacity .3s;
}
.toast.toast-success { background: #34a853; }
.toast.toast-error   { background: #ea4335; }

/* ─── 確定/未確定バッジ ──────────────────────── */
.status-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: bold;
}
.status-badge.confirmed { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.status-badge.draft     { background: #fff3e0; color: #e65100; border: 1px solid #ffcc80; }
#monthStatusBar { display: flex; align-items: center; gap: 8px; }
.btn-outline { background: transparent; color: #666; border: 1px solid #ccc; }
.btn-outline:hover { background: #f5f5f5; }
.btn-draft     { background: #fff3e0; color: #e65100; border: 1px solid #ffcc80; }
.btn-draft:hover { background: #ffe0b2; }
.btn-confirmed { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.btn-confirmed:hover { background: #c8e6c9; }
.btn-request { background: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }
.btn-request:hover { background: #bbdefb; }

/* ─── 設定説明書 ──────────────────────────────── */
.guide-page { max-width: 800px; padding: 24px 20px; }
.guide-title { font-size: 22px; font-weight: bold; margin-bottom: 6px; }
.guide-subtitle { font-size: 13px; color: #666; margin-bottom: 24px; }
.guide-section { margin-bottom: 32px; }
.guide-h3 { font-size: 16px; font-weight: bold; color: #1a237e; border-bottom: 2px solid #c5cae9; padding-bottom: 6px; margin-bottom: 12px; }
.guide-h4 { font-size: 13px; font-weight: bold; color: #555; margin: 12px 0 6px; }
.guide-note { font-size: 13px; color: #666; margin-bottom: 10px; }
.guide-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 10px; }
.guide-table th { background: #e8eaf6; padding: 7px 12px; text-align: left; font-weight: bold; border-bottom: 2px solid #c5cae9; }
.guide-table td { padding: 7px 12px; border-bottom: 1px solid #eeeeee; }
.guide-table tr:hover td { background: #fafafa; }
.guide-list { font-size: 13px; color: #444; padding-left: 20px; line-height: 2; }
.guide-list li { margin-bottom: 2px; }
.guide-footer { font-size: 12px; color: #999; margin-top: 32px; border-top: 1px solid #eee; padding-top: 12px; }
.s-chip { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: bold; }
.badge-type-常勤 { background: #e3f2fd; color: #1565c0; border-radius: 4px; padding: 2px 6px; font-size: 12px; }
.badge-type-非常勤 { background: #f3e5f5; color: #6a1b9a; border-radius: 4px; padding: 2px 6px; font-size: 12px; }
.badge-type-特別 { background: #fff3e0; color: #e65100; border-radius: 4px; padding: 2px 6px; font-size: 12px; }

/* ─── 申請オプション選択 ──────────────────────── */
.request-options {
  display: flex; flex-wrap: wrap; gap: 16px;
  background: #f8f9fa; border: 1px solid #e0e0e0;
  border-radius: 8px; padding: 12px 16px; margin-bottom: 14px;
}
.option-group { display: flex; align-items: center; gap: 10px; }
.option-label {
  font-size: 13px; font-weight: bold; color: #555;
  white-space: nowrap; min-width: 64px;
}
.radio-group { display: flex; flex-wrap: wrap; gap: 12px; }
.radio-group label {
  display: flex; align-items: center; gap: 4px;
  font-size: 14px; cursor: pointer; white-space: nowrap;
}
.radio-group input[type="radio"] { accent-color: #1a73e8; cursor: pointer; }

/* ─── 申請カレンダー 選択状態 ────────────────────── */
.cal-day { position: relative; }
.cal-day-num { display: block; }
.req-label {
  font-size: 10px; font-weight: bold; line-height: 1;
  margin-top: 2px; letter-spacing: 0;
}
.req-label-done    { color: #888; font-weight: normal; }
.req-label-pending { color: #999; font-weight: normal; font-style: italic; }
.cal-day.already-requested-pending {
  background: #f5f5f5;
  border: 1px dashed #bbb;
  color: #888;
}

/* 非常勤：出勤申請 */
.cal-day.req-full  { background: #c8e6c9 !important; border-color: #2e7d32 !important; color: #1b5e20; }
.cal-day.req-am    { background: #bbdefb !important; border-color: #1565c0 !important; color: #0d47a1; }
.cal-day.req-pm    { background: #e1bee7 !important; border-color: #6a1b9a !important; color: #4a148c; }

/* 常勤：有給 */
.cal-day.req-paid    { background: #ffcdd2 !important; border-color: #c62828 !important; color: #b71c1c; }
.cal-day.req-paid-am { background: #ffcdd2 !important; border-color: #c62828 !important; color: #b71c1c; }
.cal-day.req-paid-pm { background: #ffcdd2 !important; border-color: #c62828 !important; color: #b71c1c; }

/* 常勤：代休 */
.cal-day.req-sub    { background: #ffe0b2 !important; border-color: #e65100 !important; color: #bf360c; }
.cal-day.req-sub-am { background: #ffe0b2 !important; border-color: #e65100 !important; color: #bf360c; }
.cal-day.req-sub-pm { background: #ffe0b2 !important; border-color: #e65100 !important; color: #bf360c; }

/* ─── 休診日 ─────────────────────────────────── */
.day-closed,
.shift-cell.day-closed,
.slot-cell.day-closed {
  background: #e0e0e0 !important;
  color: #999 !important;
}
.th-date.day-closed {
  background: #d6d6d6 !important;
  color: #888 !important;
}
.closure-toggle {
  font-size: 10px; margin-top: 2px; cursor: pointer;
  color: #e53935; font-weight: bold;
  padding: 0 2px; border-radius: 3px;
}
.closure-toggle:hover { background: #ffebee; }
.closure-label {
  font-size: 10px; margin-top: 2px;
  color: #888; font-weight: bold;
}
.closure-affect {
  font-size: 10px; color: #1565c0; font-weight: bold; margin-top: 1px;
}

/* ─── 休診設定ページ ─────────────────────────── */
.closure-wrap { padding: 16px; max-width: 640px; }
.closure-calendar {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 6px; margin-bottom: 24px;
}
.closure-day {
  aspect-ratio: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  border-radius: 8px; cursor: pointer; font-size: 15px;
  font-weight: 500; border: 2px solid transparent;
  background: #f5f5f5; transition: background .15s;
  user-select: none;
}
.closure-day:hover { background: #e0e0e0; }
.closure-day.is-holiday { color: #e53935; background: #fff5f5; }
.closure-day.is-sat { color: #1a73e8; }
.closure-day.closure-active {
  background: #bdbdbd !important; border-color: #757575 !important;
  color: #fff !important;
}
.closure-day-label { font-size: 10px; font-weight: bold; color: #fff; }
.closure-list { margin-top: 8px; }
.closure-list h3 { margin-bottom: 10px; font-size: 15px; }
.closure-list ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.closure-list li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.btn-xs { padding: 2px 8px; font-size: 12px; }

/* ─── 有給・代休管理 ─────────────────────────── */
.leave-page { display: flex; flex-direction: column; gap: 28px; }
.leave-section { background: #fff; border-radius: 10px; padding: 20px 24px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.leave-h3 { font-size: 16px; font-weight: bold; margin-bottom: 16px; color: #333; border-bottom: 2px solid #e0e0e0; padding-bottom: 8px; }
.leave-section-title { font-size: 13px; font-weight: bold; color: #555; margin: 18px 0 8px; }

.leave-summary-cards { display: flex; gap: 16px; margin-bottom: 4px; flex-wrap: wrap; }
.leave-card { background: #f8f9fa; border-radius: 8px; padding: 12px 20px; min-width: 100px; text-align: center; border: 1px solid #e0e0e0; }
.leave-card-label { font-size: 11px; color: #888; margin-bottom: 4px; }
.leave-card-val { font-size: 24px; font-weight: bold; color: #333; }
.leave-card-val.s-有給 { color: #1565c0; }
.leave-card-val.s-代休 { color: #6a1b9a; }
.leave-unit { font-size: 13px; font-weight: normal; margin-left: 2px; }
.leave-card-ok  { border-color: #a5d6a7; background: #f1f8e9; }
.leave-card-warn { border-color: #ef9a9a; background: #ffebee; }
.leave-card-warn .leave-card-val { color: #c62828; }

.leave-expired-note { font-size: 12px; color: #e65100; margin-top: 6px; }
.leave-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 4px; }
.leave-table th { background: #f5f5f5; padding: 6px 10px; text-align: left; font-weight: bold; border-bottom: 1px solid #ddd; }
.leave-table td { padding: 6px 10px; border-bottom: 1px solid #f0f0f0; }
.leave-row-expired td { color: #aaa; }
.badge-expired { background: #ffebee; color: #c62828; border-radius: 4px; padding: 1px 5px; font-size: 11px; }

.leave-date-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.leave-date-tag { background: #e3f2fd; color: #1565c0; border-radius: 12px; padding: 3px 10px; font-size: 12px; }

.next-grant-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.next-grant-label { font-size: 13px; color: #444; white-space: nowrap; font-weight: bold; }
.next-grant-input { border: 1px solid #ccc; border-radius: 4px; padding: 5px 8px; font-size: 13px; }
.next-grant-days-input { border: 1px solid #ccc; border-radius: 4px; padding: 5px 8px; font-size: 13px; width: 70px; }
.next-grant-display { font-size: 13px; color: #1a237e; font-weight: bold; }
.next-grant-preview { font-size: 13px; color: #1565c0; margin-top: 6px; padding-left: 4px; }

.leave-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 4px; }
.leave-form label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #555; }
.leave-form input[type="date"],
.leave-form input[type="number"],
.leave-form input[type="text"] {
  border: 1px solid #ccc; border-radius: 4px; padding: 5px 8px; font-size: 13px;
}

.staff-select { padding: 6px 10px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; min-width: 120px; }

/* ─── ユーティリティ ─────────────────────────── */
.hidden { display: none !important; }
.flex { display: flex; }
.gap-8 { gap: 8px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.text-muted { color: #888; font-size: 12px; }
.badge {
  display: inline-block; font-size: 11px; padding: 2px 8px;
  border-radius: 10px; font-weight: bold;
}
.empty-msg { text-align: center; color: #aaa; padding: 40px; font-size: 15px; }

/* ─── レスポンシブ ────────────────────────────── */
@media (max-width: 600px) {

  /* ヘッダー：ロゴ非表示にしてナビを横スクロール */
  .header {
    flex-wrap: nowrap; height: auto; padding: 0;
    flex-direction: column; gap: 0;
  }
  .header-left { display: none; }
  .header-right {
    position: absolute; top: 6px; right: 10px; z-index: 10;
  }
  .admin-checkbox-label { font-size: 12px; padding: 3px 8px; }
  .nav {
    width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap; gap: 0;
    scrollbar-width: none;
    padding-right: 90px; /* 管理者ボタンの幅分を確保 */
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav-btn {
    padding: 0 12px; height: 44px; font-size: 12px;
    white-space: nowrap; flex-shrink: 0;
  }

  /* ページ全体 */
  .page { padding: 10px; }

  /* ツールバー */
  .toolbar { gap: 6px; }
  .month-label { font-size: 14px; }

  /* シフト表：横スクロール＋名前列固定 */
  .shift-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .shift-table { font-size: 11px; }
  .col-name { position: sticky; left: 0; background: #fff; z-index: 5; min-width: 56px; }
  .shift-table thead .col-name { background: #f5f5f5; }
  .shift-cell, .th-date { min-width: 32px; }

  /* 申請フォーム */
  .request-options { padding: 8px; }
  .radio-group { flex-wrap: wrap; gap: 6px; }
  .request-legend { flex-wrap: wrap; }

  /* 有給・代休ページ */
  .leave-page { flex-direction: column; }
  .leave-summary-cards { gap: 8px; }
  .leave-card { min-width: 80px; padding: 10px; }
  .leave-form { flex-direction: column; align-items: flex-start; gap: 8px; }
  .leave-table { font-size: 12px; }
  .leave-table th, .leave-table td { padding: 5px 6px; }

  /* ポップオーバー */
  .popover-inner { padding: 12px; min-width: 260px; }
  .status-grid { gap: 6px; }
  .status-btn { min-width: 52px; font-size: 12px; padding: 8px 4px; }

  /* アラートパネル */
  .alert-panel { padding: 8px 10px; font-size: 12px; }
  .alert-list { gap: 4px; }

  /* 設定説明書 */
  .guide-page { padding: 10px; }
  .guide-table { font-size: 12px; }
  .guide-table th, .guide-table td { padding: 5px 8px; }

  /* ボタン：タップしやすいサイズ */
  .btn { min-height: 36px; padding: 6px 14px; }
  .btn-sm { min-height: 32px; }
}
