/* ESSC 勤怠管理 共通スタイル — 業務ソフト風の落ち着いたデザイン */

* { -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Inter', 'Noto Sans JP', sans-serif;
  font-feature-settings: 'palt';
  color: #343a40;
}

/* 数値表示は等幅系で揃える */
.num { font-variant-numeric: tabular-nums; }

/* カード */
.card {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

/* 入力欄 */
.field {
  border: 1px solid #ced4da;
  border-radius: 6px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.field:focus {
  outline: none;
  border-color: #1d5fbf;
  box-shadow: 0 0 0 3px rgba(29, 95, 191, .12);
}

/* ボタン */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  font-weight: 600;
  border-radius: 6px;
  transition: background-color .15s, box-shadow .15s, transform .05s;
  cursor: pointer;
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: #1d5fbf; color: #fff; }
.btn-primary:hover { background: #174e9e; }
.btn-secondary { background: #fff; color: #495057; border: 1px solid #ced4da; }
.btn-secondary:hover { background: #f8f9fa; }
.btn-success { background: #2b8a3e; color: #fff; }
.btn-success:hover { background: #237032; }
.btn-danger-ghost { background: #fff; color: #c92a2a; border: 1px solid #ffc9c9; }
.btn-danger-ghost:hover { background: #fff5f5; }

/* ステータスバッジ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .72rem;
  font-weight: 600;
  padding: .2rem .55rem;
  border-radius: 9999px;
  white-space: nowrap;
}
.badge-gray    { background: #f1f3f5; color: #868e96; }
.badge-blue    { background: #dcebfe; color: #174e9e; }
.badge-green   { background: #d3f9d8; color: #237032; }
.badge-red     { background: #ffe3e3; color: #c92a2a; }
.badge-yellow  { background: #fff3bf; color: #997404; }

/* テーブル */
.tbl { width: 100%; border-collapse: collapse; font-size: .82rem; }
.tbl th {
  background: #f8f9fa;
  color: #495057;
  font-weight: 600;
  padding: .55rem .6rem;
  border-bottom: 1px solid #dee2e6;
  white-space: nowrap;
}
.tbl td {
  padding: .5rem .6rem;
  border-bottom: 1px solid #f1f3f5;
  white-space: nowrap;
}
.tbl tbody tr:hover { background: #f8fbff; }

/* タブ（アンダーライン方式・アクセントバー無し） */
.tab-item {
  position: relative;
  padding: .7rem 1rem;
  font-size: .85rem;
  font-weight: 500;
  color: #868e96;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s;
}
.tab-item:hover { color: #343a40; }
.tab-item.active {
  color: #1d5fbf;
  font-weight: 700;
  border-bottom-color: #1d5fbf;
}

/* セグメントコントロール（時間区分切替） */
.seg {
  display: flex;
  background: #f1f3f5;
  border-radius: 8px;
  padding: 3px;
}
.seg button {
  flex: 1;
  padding: .45rem .3rem;
  font-size: .78rem;
  font-weight: 600;
  color: #868e96;
  border-radius: 6px;
  transition: all .15s;
}
.seg button.active {
  background: #fff;
  color: #1d5fbf;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .1);
}

/* ステッパー入力 */
.stepper {
  display: flex;
  align-items: center;
  border: 1px solid #ced4da;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.stepper button {
  width: 44px;
  height: 44px;
  font-size: 1.1rem;
  color: #495057;
  background: #f8f9fa;
  flex-shrink: 0;
}
.stepper button:active { background: #e9ecef; }
.stepper input {
  width: 100%;
  height: 44px;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 700;
  border: none;
  outline: none;
  color: #212529;
}

/* モーダル */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(33, 37, 41, .45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
}
@media (min-width: 640px) {
  .modal-backdrop { align-items: center; }
}
.modal-panel {
  background: #fff;
  width: 100%;
  max-width: 480px;
  border-radius: 14px 14px 0 0;
  max-height: 88vh;
  overflow-y: auto;
  animation: slideUp .2s ease-out;
}
@media (min-width: 640px) {
  .modal-panel { border-radius: 12px; }
}
@keyframes slideUp {
  from { transform: translateY(24px); opacity: .6; }
  to { transform: translateY(0); opacity: 1; }
}

/* トースト */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: #343a40;
  color: #fff;
  font-size: .85rem;
  font-weight: 500;
  padding: .6rem 1.2rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(16, 24, 40, .2);
  z-index: 60;
  animation: toastIn .2s ease-out;
  white-space: nowrap;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* カレンダーグリッド */
.cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: .85rem;
  cursor: pointer;
  position: relative;
  transition: background .15s;
}
.cal-day:hover { background: #f1f3f5; }
.cal-day.selected {
  background: #1d5fbf;
  color: #fff;
  font-weight: 700;
}
.cal-day.other-month { color: #ced4da; }
.cal-day .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #2b8a3e;
  position: absolute;
  bottom: 5px;
}
.cal-day.selected .dot { background: #fff; }

/* スクロールバー（デスクトップ） */
::-webkit-scrollbar { height: 8px; width: 8px; }
::-webkit-scrollbar-thumb { background: #ced4da; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* 印刷 */
@media print {
  .no-print { display: none !important; }
}
