/* static/css/board.css
   役割: シフト一覧ページの見た目。事務所の大きな画面で一覧しやすいことを優先している。 */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Meiryo", "Yu Gothic", sans-serif;
  font-size: 13px;
  background: #f1f5f9;
  color: #1f2937;
}

/* ===== ヘッダー ===== */
.page-header {
  background: #1a1a2e; color: #fff;
  padding: 10px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.header-left, .header-right { display: flex; align-items: center; gap: 12px; }
.page-header h1 { font-size: 16px; font-weight: bold; letter-spacing: .05em; }
.meta { font-size: 12px; color: #9ca3af; }
.inline { display: inline; }

.tabs { display: flex; gap: 4px; }
.tab {
  padding: 6px 18px; border-radius: 4px 4px 0 0;
  color: #cbd5e1; text-decoration: none; font-weight: bold;
  background: rgba(255,255,255,.08);
}
.tab.active { background: #3b82f6; color: #fff; }

.btn {
  padding: 6px 14px; border-radius: 4px; border: none;
  cursor: pointer; font-size: 12px; font-family: inherit; text-decoration: none;
  display: inline-block;
}
.btn-primary { background: #3b82f6; color: #fff; width: 100%; padding: 10px; font-size: 14px; }
.btn-ghost { background: transparent; border: 1px solid #64748b; color: #e2e8f0; }
.btn-plain { background: transparent; border: none; color: #94a3b8; }
.btn-nav { background: #fff; border: 1px solid #cbd5e1; color: #334155; }
.btn:hover { opacity: .85; }

/* ===== 日付バー ===== */
.controls {
  background: #fff; padding: 8px 18px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border-bottom: 1px solid #e2e8f0;
}
.date-label { font-size: 17px; font-weight: bold; min-width: 190px; }
.date-form input {
  border: 1px solid #cbd5e1; border-radius: 4px; padding: 5px 8px;
  font-family: inherit; font-size: 12px;
}
.spacer { flex: 1; }
.count { font-weight: bold; color: #1d4ed8; background: #eff6ff;
  border: 1px solid #bfdbfe; border-radius: 12px; padding: 3px 12px; }

.legend { display: flex; align-items: center; gap: 10px; }
.legend-item { display: flex; align-items: center; gap: 4px; font-size: 11px; color: #475569; }
.legend-item i { width: 18px; height: 12px; border-radius: 2px; display: inline-block; }

.messages { list-style: none; padding: 8px 18px; }
.messages li { padding: 8px 12px; border-radius: 4px; margin-bottom: 4px; font-size: 12px; }
.messages .success { background: #d1fae5; color: #065f46; }
.messages .warning { background: #fef3c7; color: #92400e; }
.messages .error   { background: #fee2e2; color: #991b1b; }

/* ===== 表の共通 ===== */
.table-wrapper {
  overflow: auto; max-height: calc(100vh - 110px);
  background: #fff; margin: 10px; border: 1px solid #e2e8f0; border-radius: 6px;
}
.board-table { border-collapse: separate; border-spacing: 0; width: 100%; }
.board-table thead th {
  position: sticky; top: 0; z-index: 3;
  background: #334155; color: #fff; font-size: 12px; font-weight: bold;
  padding: 8px 10px; border-right: 1px solid #475569; white-space: nowrap;
}
.board-table th.store-col {
  position: sticky; left: 0; z-index: 2;
  background: #f8fafc; color: #0f172a; text-align: left;
  border-right: 2px solid #cbd5e1; border-bottom: 1px solid #e2e8f0;
  padding: 8px 10px; white-space: nowrap; vertical-align: top;
}
.board-table thead th.store-col { z-index: 4; background: #334155; color: #fff; }
.store-name { display: block; font-size: 13px; font-weight: bold; }
.store-count { display: block; font-size: 11px; color: #64748b; font-weight: normal; }
.empty { color: #cbd5e1; }
.empty-row { padding: 14px; text-align: center; color: #94a3b8; }

/* ===== 遊技 ===== */
.amusement .cat-col { width: 30%; }
.amusement .cat-cell {
  vertical-align: top; padding: 8px 10px;
  border-right: 1px solid #e2e8f0; border-bottom: 1px solid #e2e8f0;
}
.amusement tbody tr:nth-child(even) .cat-cell { background: #fafafa; }
.person {
  display: flex; align-items: baseline; gap: 8px;
  padding: 3px 0; border-bottom: 1px dotted #e5e7eb;
}
.person:last-child { border-bottom: none; }
.person .role { font-size: 11px; color: #64748b; min-width: 6.5em; }
.person .name { font-size: 14px; font-weight: bold; }
.person .time { font-size: 11px; color: #94a3b8; margin-left: auto; }

/* ===== 外食 ===== */
.food .staff-col { white-space: nowrap; padding: 4px 10px; font-size: 13px;
  border-right: 1px solid #e2e8f0; border-bottom: 1px solid #f1f5f9; }
.food .time-col { white-space: nowrap; padding: 4px 8px; font-size: 11px; color: #64748b;
  border-right: 2px solid #cbd5e1; border-bottom: 1px solid #f1f5f9; }
.food .hour-col { width: 30px; text-align: center; padding: 6px 2px; }
.food .hour-cell {
  width: 30px; text-align: center; font-size: 10px; color: #fff; font-weight: bold;
  border-right: 1px solid #eef2f7; border-bottom: 1px solid #f1f5f9;
}
.food tbody th.store-col { background: #f8fafc; }

/* ===== ログイン ===== */
.login-body { display: flex; align-items: center; justify-content: center; height: 100vh; }
.login-box {
  background: #fff; padding: 28px 32px; border-radius: 8px; width: 320px;
  box-shadow: 0 8px 24px rgba(15,23,42,.12);
  display: flex; flex-direction: column; gap: 14px;
}
.login-box h1 { font-size: 18px; text-align: center; }
.login-box label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #475569; }
.login-box input {
  border: 1px solid #cbd5e1; border-radius: 4px; padding: 8px;
  font-family: inherit; font-size: 14px;
}
.login-error { background: #fee2e2; color: #991b1b; padding: 8px; border-radius: 4px; font-size: 12px; }

/* ===== 店舗フィルター ===== */
.store-filter {
  background: #fff; padding: 7px 18px;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  border-bottom: 1px solid #e2e8f0;
}
.filter-label { font-size: 11px; color: #64748b; margin-right: 4px; }
.chip {
  font-size: 12px; padding: 3px 11px; border-radius: 14px;
  border: 1px solid #cbd5e1; color: #475569; background: #fff; text-decoration: none;
}
.chip:hover { border-color: #94a3b8; }
.chip.on { background: #3b82f6; border-color: #2563eb; color: #fff; font-weight: bold; }
.chip.all { background: #334155; border-color: #334155; color: #fff; font-weight: bold; }

/* ===== 面談予定の印 ===== */
/* 氏名の欄ぜんたいがクリック範囲。普段は薄く、印が付くとオレンジで目立たせる。 */
[data-mark-toggle] { cursor: pointer; }
[data-mark-toggle]:hover { filter: brightness(.97); }
.mark {
  font-size: 10px; font-weight: bold; line-height: 1.6;
  padding: 0 7px; border-radius: 10px; flex: none;
  border: 1px dashed #94a3b8; color: #94a3b8; background: rgba(255,255,255,.7);
  opacity: 0;
}
[data-mark-toggle]:hover .mark { opacity: 1; }
.person.on, .food .staff-col.on { box-shadow: inset 0 0 0 2px #f97316; }
.food .staff-col.on { background: #fff7ed; }
.person.on .mark, .staff-col.on .mark {
  opacity: 1; background: #f97316; border: 1px solid #ea580c; color: #fff;
}
.legend-mark {
  border-radius: 10px; background: #f97316; color: #fff; width: auto; padding: 0 7px;
  font-size: 10px; font-weight: bold; display: inline-flex; align-items: center;
  justify-content: center; font-style: normal; height: 16px;
}

/* 氏名の背景に職位色が付くので、区切り線と余白を調整する */
.person { border-bottom: none; margin-bottom: 3px; border-radius: 3px; padding: 4px 8px; }
.person:last-child { margin-bottom: 0; }
.food .staff-col .name { margin-right: 6px; }
.food .staff-col { display: flex; align-items: center; justify-content: space-between; gap: 6px; }

/* ===== 人名検索 ===== */
.search-form { display: flex; gap: 6px; align-items: center; }
.search-form input[type="search"] {
  border: 1px solid #cbd5e1; border-radius: 4px; padding: 6px 10px;
  font-family: inherit; font-size: 13px; width: 320px;
}
.btn-search { background: #3b82f6; color: #fff; }
.date-label.period { font-size: 14px; min-width: 230px; text-align: center; }
.notice { margin: 14px 18px; padding: 12px 14px; background: #fff;
  border: 1px solid #e2e8f0; border-radius: 6px; color: #475569; font-size: 13px; }

.search .days-col { white-space: nowrap; text-align: center; font-size: 12px;
  color: #475569; padding: 4px 8px; border-right: 2px solid #cbd5e1;
  border-bottom: 1px solid #f1f5f9; }
.search .day-col { width: 34px; padding: 4px 2px; text-align: center; line-height: 1.3; }
.search .day-col.holiday { background: #7f1d1d; }
.day-num { display: block; font-size: 11px; }
.day-week { display: block; font-size: 10px; color: #cbd5e1; font-weight: normal; }
.search .day-cell {
  width: 34px; text-align: center; font-size: 12px; font-weight: bold;
  border-right: 1px solid #eef2f7; border-bottom: 1px solid #f1f5f9;
}
.search th.store-col { min-width: 190px; }
.search th.store-col .mark { position: absolute; right: 8px; top: 8px; }
.search th.store-col { position: sticky; left: 0; }
.search tbody th.store-col { position: relative; }

/* ===== まだ提出されていない店 ===== */
.pending-notice {
  margin: 8px 10px 0; padding: 8px 14px; border-radius: 6px;
  background: #fef3c7; color: #92400e; font-size: 12px; border: 1px solid #fde68a;
}
.cat-cell.pending, .empty-row.pending {
  background: repeating-linear-gradient(45deg, #fafafa, #fafafa 8px, #f3f4f6 8px, #f3f4f6 16px);
  text-align: center;
}
.pending-label { font-size: 12px; color: #b45309; font-weight: bold; }

/* ===== 人名検索のロック ===== */
.search th.store-col { display: flex; align-items: center; gap: 8px; }
.search th.store-col.locked { background: #fff7ed; box-shadow: inset 3px 0 0 #f59e0b; }
.lock {
  font-size: 15px; text-decoration: none; flex: none; line-height: 1;
  opacity: .45; filter: grayscale(1);
}
.lock:hover { opacity: 1; filter: none; }
.search th.store-col.locked .lock { opacity: 1; filter: none; }
.person-cell { position: relative; flex: 1; display: block; padding: 2px 0; }
.person-cell .mark { position: absolute; right: 4px; top: 2px; }
.person-cell.on { box-shadow: inset 0 0 0 2px #f97316; border-radius: 3px; }
.locked-count { background: #fff7ed; color: #b45309; border-color: #fed7aa; }
