/* ── リセット＆ベース ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Hiragino Sans', 'Meiryo', sans-serif;
  font-size: 14px;
  background: #f0f4f8;
  color: #1a202c;
  min-height: 100vh;
}
a { color: #2b7a78; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── ナビゲーション ───────────────────────────────── */
.nav {
  background: #1a6b6b;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 52px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
.nav-brand { font-size: 1rem; font-weight: 700; letter-spacing: .04em; }
.nav-right { display: flex; align-items: center; gap: 16px; font-size: .82rem; }
.nav-user { opacity: .85; }
.nav-role {
  background: rgba(255,255,255,.18);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: .75rem;
}
.nav-logout-btn {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.35);
  color: #fff;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: .8rem;
}
.nav-logout-btn:hover { background: rgba(255,255,255,.28); }

/* ── メインコンテンツ ─────────────────────────────── */
.main { max-width: 1000px; margin: 0 auto; padding: 28px 16px 48px; }
.page-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 20px; color: #1a6b6b; }

/* ── カード ──────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.10);
  margin-bottom: 20px;
  overflow: hidden;
}
.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid #e2e8f0;
  font-weight: 700;
  font-size: .95rem;
  color: #1a6b6b;
}
.card-body { padding: 20px; }

/* ── フォーム ────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 4px;
}
.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #cbd5e0;
  border-radius: 5px;
  font-size: .9rem;
  outline: none;
  transition: border-color .15s;
}
.form-control:focus { border-color: #2b7a78; box-shadow: 0 0 0 2px rgba(43,122,120,.15); }
select.form-control { background: #fff; }

/* ── ボタン ──────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 8px 20px;
  border-radius: 5px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background .15s, opacity .15s;
}
.btn-primary  { background: #2b7a78; color: #fff; }
.btn-primary:hover  { background: #235f5d; }
.btn-danger   { background: #e53e3e; color: #fff; }
.btn-danger:hover   { background: #c53030; }
.btn-outline  {
  background: transparent;
  border: 1px solid #2b7a78;
  color: #2b7a78;
}
.btn-outline:hover  { background: #ebf8ff; }
.btn-sm { padding: 4px 12px; font-size: .8rem; }
.btn + .btn { margin-left: 8px; }

/* ── アラート ────────────────────────────────────── */
.alert {
  padding: 10px 16px;
  border-radius: 5px;
  margin-bottom: 16px;
  font-size: .88rem;
}
.alert-error   { background: #fff5f5; border: 1px solid #fc8181; color: #742a2a; }
.alert-success { background: #f0fff4; border: 1px solid #68d391; color: #22543d; }
.alert-info    { background: #ebf8ff; border: 1px solid #63b3ed; color: #2a4365; }
.alert-warning { background: #fffbeb; border: 1px solid #f6ad55; color: #744210; }

/* ── テーブル ────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th {
  background: #f7fafc;
  border-bottom: 2px solid #e2e8f0;
  padding: 9px 12px;
  text-align: left;
  font-weight: 600;
  color: #4a5568;
  white-space: nowrap;
}
td {
  border-bottom: 1px solid #e2e8f0;
  padding: 9px 12px;
  vertical-align: middle;
}
tr:hover td { background: #f7fafc; }

/* ── バッジ ──────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: .72rem;
  font-weight: 600;
}
.badge-admin    { background: #ebf4ff; color: #2b6cb0; }
.badge-staff    { background: #f0fff4; color: #276749; }
.badge-sharoushi{ background: #faf5ff; color: #6b46c1; }
.badge-shift    { background: #fffaf0; color: #c05621; }
.badge-takara   { background: #e2e8f0; color: #4a5568; }
.badge-active   { background: #f0fff4; color: #276749; }
.badge-inactive { background: #fff5f5; color: #c53030; }
.badge-locked   { background: #fffbeb; color: #744210; }

/* ── ログインページ ───────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a6b6b 0%, #2b9e9e 100%);
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  padding: 36px 36px 28px;
  width: 100%;
  max-width: 400px;
}
.login-logo {
  text-align: center;
  margin-bottom: 24px;
}
.login-logo h1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1a6b6b;
  line-height: 1.4;
}
.login-logo p {
  font-size: .78rem;
  color: #718096;
  margin-top: 4px;
}

/* ── 同意ページ ──────────────────────────────────── */
.consent-body {
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 16px;
  max-height: 260px;
  overflow-y: auto;
  font-size: .85rem;
  line-height: 1.8;
  color: #2d3748;
  margin-bottom: 16px;
}
.consent-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .9rem;
  cursor: pointer;
  margin-bottom: 16px;
}

/* ── ダッシュボードカードグリッド ────────────────────── */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.menu-item {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px 18px;
  text-align: center;
  color: #2d3748;
  transition: box-shadow .15s, border-color .15s;
  cursor: pointer;
}
.menu-item:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.10);
  border-color: #2b7a78;
  text-decoration: none;
}
.menu-item-icon { font-size: 2rem; margin-bottom: 8px; }
.menu-item-label { font-size: .88rem; font-weight: 600; color: #2d3748; }
.menu-item-desc  { font-size: .75rem; color: #718096; margin-top: 3px; }
.menu-section-title {
  font-size: .78rem;
  font-weight: 700;
  color: #718096;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 20px 0 8px;
}

/* ── チェックボックス ────────────────────────────── */
.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.form-check input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; }

/* ── 403ページ ────────────────────────────────────── */
.error-page {
  text-align: center;
  padding: 80px 20px;
}
.error-page h1 { font-size: 3rem; color: #e53e3e; margin-bottom: 12px; }
.error-page p  { color: #718096; margin-bottom: 20px; }

/* ── レスポンシブ ─────────────────────────────────── */
@media (max-width: 600px) {
  .main { padding: 16px 12px 40px; }
  .login-card { padding: 24px 20px 20px; }
  .nav-right .nav-user { display: none; }
  .menu-grid { grid-template-columns: repeat(2, 1fr); }
  .table-wrap { font-size: .8rem; }
  td, th { padding: 7px 8px; }
}
