/* ============================================================
   管理者画面 スタイル
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Hiragino Kaku Gothic ProN', 'Meiryo', 'Yu Gothic', sans-serif;
  background: #f0f2f5;
  color: #333;
  font-size: 14px;
}

/* ---- ログイン画面 ---- */
.login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #1a1a2e, #0f3460);
}

.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 48px 40px;
  width: 360px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.login-card h1 {
  font-size: 22px;
  text-align: center;
  margin-bottom: 8px;
  color: #1565c0;
}

.login-card p {
  text-align: center;
  color: #888;
  margin-bottom: 28px;
  font-size: 13px;
}

/* ---- PIN パッド ---- */
.pin-card {
  width: 320px;
  padding: 40px 32px 36px;
  text-align: center;
}

#pin-dots {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 28px 0 10px;
}

.pin-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #1565c0;
  background: transparent;
  transition: background 0.15s, transform 0.1s;
}

.pin-dot.filled {
  background: #1565c0;
  transform: scale(1.15);
}

.pin-error-text {
  color: #c62828;
  font-size: 13px;
  min-height: 20px;
  margin-bottom: 18px;
}

#pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 260px;
  margin: 0 auto;
}

.pin-key {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 1px solid #e0e0e0;
  background: #f8f9fa;
  font-size: 24px;
  font-family: inherit;
  font-weight: bold;
  color: #333;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  transition: background 0.1s, transform 0.1s;
  user-select: none;
}

.pin-key:hover  { background: #e3f2fd; border-color: #90caf9; }
.pin-key:active { background: #bbdefb; transform: scale(0.93); }
.pin-del        { font-size: 20px; color: #888; }

@keyframes pinShake {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-10px); }
  40%     { transform: translateX(10px); }
  60%     { transform: translateX(-8px); }
  80%     { transform: translateX(8px); }
}
.pin-shake { animation: pinShake 0.4s ease; }

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

.form-group label {
  display: block;
  font-size: 13px;
  color: #555;
  margin-bottom: 6px;
  font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #1565c0;
  box-shadow: 0 0 0 3px rgba(21,101,192,0.15);
}

.btn-primary {
  width: 100%;
  padding: 13px;
  background: #1565c0;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover { background: #0d47a1; }
.btn-primary:disabled { background: #90a4ae; cursor: not-allowed; }

.error-text { color: #c62828; font-size: 13px; margin-top: 10px; text-align: center; }

/* ---- 管理画面全体レイアウト ---- */
.admin-wrapper { min-height: 100vh; }

.admin-header {
  background: #1565c0;
  color: #fff;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.admin-header h1 { font-size: 18px; letter-spacing: 1px; }

.admin-header .header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
}

.btn-logout {
  padding: 7px 18px;
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
}

.btn-logout:hover { background: rgba(255,255,255,0.3); }

/* ---- タブナビゲーション ---- */
.tab-nav {
  display: flex;
  background: #fff;
  border-bottom: 2px solid #e0e0e0;
  padding: 0 20px;
  overflow-x: auto;
}

.tab-btn {
  padding: 14px 24px;
  border: none;
  background: none;
  font-size: 14px;
  font-family: inherit;
  font-weight: bold;
  color: #666;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: all 0.15s;
}

.tab-btn:hover { color: #1565c0; }
.tab-btn.active { color: #1565c0; border-bottom-color: #1565c0; }

/* ---- タブコンテンツ ---- */
.tab-content {
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

/* ---- カード ---- */
.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  margin-bottom: 20px;
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h2 {
  font-size: 16px;
  color: #333;
}

.card-body { padding: 20px; }

/* ---- テーブル ---- */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  background: #f5f7fa;
  padding: 10px 12px;
  text-align: left;
  font-size: 12px;
  color: #666;
  border-bottom: 2px solid #e0e0e0;
  white-space: nowrap;
}

.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}

.data-table tr:hover td { background: #fafbff; }

.text-right { text-align: right; }
.text-muted  { color: #999; }
.text-red    { color: #c62828; }
.highlight-green { background: #e8f5e9; }

/* バッジ */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
}

.badge.active   { background: #e8f5e9; color: #2e7d32; }
.badge.inactive { background: #fce4ec; color: #c62828; }
.badge.special  { background: #fff3e0; color: #e65100; }

/* ---- 小ボタン ---- */
.btn-sm {
  padding: 5px 14px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
}

.btn-sm:hover { opacity: 0.8; }

.btn-edit   { background: #e3f2fd; color: #1565c0; }
.btn-delete { background: #fce4ec; color: #c62828; }
.btn-sm.btn-primary { background: #1565c0; color: #fff; }

/* ---- ツールバー ---- */
.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.toolbar select,
.toolbar input[type="number"],
.toolbar input[type="date"] {
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}

/* ---- スピナー（年月選択） ---- */
.spinner-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.spinner-group input[type="number"] {
  width: 52px;
  text-align: center;
  -moz-appearance: textfield;
  font-weight: bold;
  font-size: 15px;
  padding: 6px 4px;
  border: 1px solid #ccc;
  border-radius: 6px 0 0 6px;
  border-right: none;
  background: #fff;
}

.spinner-group input[type="number"]::-webkit-inner-spin-button,
.spinner-group input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.spinner-arrows {
  display: flex;
  flex-direction: column;
  margin-right: 6px;
}

.spinner-arrow {
  width: 24px;
  height: 17px;
  border: 1px solid #ccc;
  background: #f8f9fa;
  font-size: 8px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  padding: 0;
  transition: background 0.15s;
}

.spinner-arrow.up {
  border-radius: 0 6px 0 0;
  border-bottom: none;
}

.spinner-arrow.down {
  border-radius: 0 0 6px 0;
}

.spinner-arrow:hover {
  background: #e3f2fd;
  color: #1565c0;
}

.spinner-arrow:active {
  background: #bbdefb;
}

.btn-search {
  padding: 9px 20px;
  background: #1565c0;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  font-weight: bold;
  cursor: pointer;
}

.btn-search:hover { background: #0d47a1; }

.btn-add {
  padding: 9px 20px;
  background: #2e7d32;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  font-weight: bold;
  cursor: pointer;
}

.btn-add:hover { background: #1b5e20; }

/* ---- モーダル ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-box {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  overflow: hidden;
}

.modal-header {
  padding: 16px 20px;
  background: #f5f7fa;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 { font-size: 16px; }

.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #888;
  line-height: 1;
}

.modal-body { padding: 24px; }

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid #e0e0e0;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.btn-cancel {
  padding: 10px 24px;
  background: #eee;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}

.btn-save {
  padding: 10px 24px;
  background: #1565c0;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  font-weight: bold;
  cursor: pointer;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
  font-size: 14px;
}

.info-row .label { color: #888; }
.info-row .value { font-weight: bold; }

/* ---- 管理者メッセージ ---- */
.admin-message {
  position: fixed;
  top: 70px;
  right: 20px;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: bold;
  z-index: 999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.admin-message.success { background: #e8f5e9; color: #2e7d32; border-left: 4px solid #4caf50; }
.admin-message.error   { background: #fce4ec; color: #c62828; border-left: 4px solid #f44336; }

/* ---- 退勤忘れアラート ---- */
.unclosed-alert {
  margin: 12px 24px;
  padding: 14px 20px;
  background: #fff3e0;
  border-left: 5px solid #ff9800;
  border-radius: 8px;
  color: #e65100;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ---- チェックボックス ---- */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
}

.checkbox-label input { width: 16px; height: 16px; cursor: pointer; }

/* ---- 特別日セクション ---- */
.special-day-form {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

/* ---- Utility ---- */
.hidden { display: none !important; }

.table-scroll { overflow-x: auto; }

/* ---- レスポンシブ ---- */
@media (max-width: 768px) {
  .tab-btn { padding: 12px 14px; font-size: 13px; }
  .tab-content { padding: 16px; }
  .toolbar { gap: 8px; }
  .data-table th, .data-table td { padding: 8px; font-size: 12px; }
}

/* ---- カスタム日付ピッカー ---- */
.dp-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  transition: border-color 0.2s;
  user-select: none;
}
.dp-input:hover { border-color: #1565c0; box-shadow: 0 0 0 3px rgba(21,101,192,0.1); }

.dp-popup {
  position: fixed;
  z-index: 2000;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.15);
  width: 280px;
  padding: 14px;
}

.dp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.dp-title { font-size: 13px; font-weight: bold; color: #333; }
.dp-nav {
  background: none;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 3px 10px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  color: #555;
}
.dp-nav:hover { background: #f0f0f0; }

.dp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  margin-bottom: 10px;
}
.dp-dow {
  text-align: center;
  font-size: 11px;
  font-weight: bold;
  color: #888;
  padding: 4px 0 6px;
}
.dp-dow.dp-red { color: #c62828; }
.dp-dow.dp-sat { color: #1565c0; }

.dp-day {
  text-align: center;
  font-size: 13px;
  padding: 6px 2px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s;
  line-height: 1.4;
}
.dp-day:hover:not(.dp-empty) { background: #e3f2fd; }
.dp-day.dp-red  { color: #c62828; font-weight: bold; }
.dp-day.dp-sat  { color: #1565c0; }
.dp-day.dp-today { outline: 2px solid #1565c0; font-weight: bold; border-radius: 6px; }
.dp-day.dp-selected { background: #1565c0 !important; color: #fff !important; font-weight: bold; }
.dp-day.dp-selected.dp-today { outline-color: #fff; }
.dp-day.dp-empty { cursor: default; pointer-events: none; }

.dp-footer {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid #eee;
  padding-top: 10px;
}
.dp-footer-btn {
  padding: 5px 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  background: #f8f8f8;
  color: #555;
}
.dp-footer-btn:hover { background: #ececec; }
.dp-today-btn { color: #1565c0; border-color: #90caf9; background: #e3f2fd; }
.dp-today-btn:hover { background: #bbdefb; }

/* 数値入力の上下矢印を非表示 */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] { -moz-appearance: textfield; }
