/* ============================================================
   style.css — シフト管理システム
   ============================================================ */

:root {
  --color-primary:       #1e3a5f;
  --color-primary-hover: #2d5295;
  --color-accent:        #3b82f6;
  --color-am:            #3b82f6;
  --color-pm:            #f59e0b;
  --color-all:           #8b5cf6;
  --color-success:       #10b981;
  --color-danger:        #ef4444;
  --color-bg:            #f1f5f9;
  --color-card:          #ffffff;
  --color-border:        #e2e8f0;
  --color-text:          #1e293b;
  --color-text-sub:      #64748b;
  --shadow-sm:           0 1px 3px rgba(0,0,0,.10);
  --shadow-md:           0 4px 16px rgba(0,0,0,.12);
  --radius:              8px;
  --radius-sm:           4px;
}

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

body {
  font-family: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Noto Sans JP',
               Meiryo, 'Yu Gothic', sans-serif;
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
}

/* ─── Loading ───────────────────────────────────────────────── */
.loading-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Login Page ────────────────────────────────────────────── */
.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #1e3a5f 0%, #2d5fa8 100%);
}

.login-card {
  background: white;
  border-radius: 16px;
  padding: 48px 40px;
  width: 400px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 24px 48px rgba(0,0,0,.28);
}

.login-logo { text-align: center; margin-bottom: 36px; }
.login-logo h1 {
  font-size: 21px;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.4;
}
.login-logo p {
  margin-top: 6px;
  font-size: 13px;
  color: var(--color-text-sub);
}

.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-sub);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 6px;
}

.form-control,
.form-select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--color-text);
  background: white;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

/* ─── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
  width: 100%;
  padding: 13px;
  font-size: 15px;
}
.btn-primary:hover:not(:disabled) { background: var(--color-primary-hover); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }

.demo-section { margin-top: 20px; }
.demo-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--color-text-sub);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.demo-divider::before,
.demo-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}
.demo-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-demo {
  padding: 10px;
  font-size: 13px;
  border: 1.5px solid;
  background: white;
}
.btn-demo-admin {
  border-color: #2563eb;
  color: #2563eb;
}
.btn-demo-admin:hover { background: #eff6ff; }
.btn-demo-worker {
  border-color: #16a34a;
  color: #16a34a;
}
.btn-demo-worker:hover { background: #f0fdf4; }

.btn-secondary {
  background: white;
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
}
.btn-secondary:hover { background: var(--color-bg); }

.btn-danger { background: var(--color-danger); color: white; border: none; }
.btn-danger:hover { background: #dc2626; }

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: white;
  cursor: pointer;
  font-size: 18px;
  color: var(--color-text-sub);
  transition: all .15s;
  flex-shrink: 0;
}
.btn-icon:hover { background: var(--color-bg); color: var(--color-text); }

/* ─── Error / Alert ─────────────────────────────────────────── */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
}
.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  display: none;
}
.alert-error.visible { display: block; }

/* ─── App Shell ─────────────────────────────────────────────── */
.app-wrapper {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  overflow: hidden;
}

/* ─── Header ────────────────────────────────────────────────── */
.app-header {
  background: var(--color-primary);
  color: #fff;
  height: 56px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  z-index: 100;
}

.header-brand { display: flex; align-items: center; gap: 12px; }
.header-brand h1 { font-size: 17px; font-weight: 700; letter-spacing: .02em; }
.header-badge {
  background: rgba(255,255,255,.15);
  color: rgba(255,255,255,.9);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.header-user {
  font-size: 13px;
  color: rgba(255,255,255,.85);
}
.btn-logout {
  padding: 6px 14px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: var(--radius-sm);
  color: white;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s;
}
.btn-logout:hover { background: rgba(255,255,255,.22); }

/* ─── App Navigation ─────────────────────────────────────────── */
.app-nav {
  background: white;
  border-bottom: 2px solid var(--color-border);
  padding: 0 24px;
  display: flex;
  gap: 0;
  flex-shrink: 0;
}

.nav-item {
  padding: 12px 20px;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-sub);
  cursor: pointer;
  transition: color .15s, border-color .15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-item:hover { color: var(--color-text); }
.nav-item.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}

/* ─── Toolbar ───────────────────────────────────────────────── */
.board-toolbar {
  background: white;
  border-bottom: 1px solid var(--color-border);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.view-toggle {
  display: flex;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.view-toggle button {
  padding: 6px 18px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  color: var(--color-text-sub);
  transition: all .15s;
}
.view-toggle button.active {
  background: var(--color-primary);
  color: white;
}
.view-toggle button:not(.active):hover { background: var(--color-bg); }

.date-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.date-label {
  font-size: 14px;
  font-weight: 600;
  min-width: 220px;
  text-align: center;
  color: var(--color-text);
}

.btn-today {
  padding: 6px 12px;
  background: transparent;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  color: var(--color-text-sub);
  transition: all .15s;
}
.btn-today:hover { background: var(--color-bg); color: var(--color-text); }

.toolbar-sep {
  width: 1px;
  height: 24px;
  background: var(--color-border);
  flex-shrink: 0;
}
.toolbar-space { flex: 1; }

.btn-lock {
  padding: 6px 12px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: white;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  color: var(--color-text-sub);
  transition: all .15s;
  white-space: nowrap;
}
.btn-lock:hover { background: var(--color-bg); }
.btn-lock.active {
  background: #fef9c3;
  border-color: #ca8a04;
  color: #854d0e;
  font-weight: 600;
}

/* ─── Board Container ───────────────────────────────────────── */
.board-container {
  flex: 1;
  overflow: auto;
  padding: 20px 24px;
}

/* ─── Shift Table ───────────────────────────────────────────── */
.shift-table-wrap {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  overflow: auto;
}

.shift-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}

/* Header row */
.shift-table thead th {
  background: #f8fafc;
  padding: 10px 12px;
  text-align: center;
  font-weight: 600;
  color: var(--color-text-sub);
  border-bottom: 2px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 20;
}
.shift-table thead th:first-child {
  text-align: left;
  width: 160px;
  min-width: 140px;
  position: sticky;
  left: 0;
  z-index: 30;
}
.shift-table thead th:last-child { border-right: none; }

/* Body cells */
.shift-table tbody td {
  padding: 5px 8px;
  vertical-align: top;
  border-bottom: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  min-width: 140px;
}
.shift-table tbody td:first-child {
  position: sticky;
  left: 0;
  background: #f8fafc;
  z-index: 10;
  min-width: 140px;
  max-width: 180px;
  font-weight: 600;
}
.shift-table tbody tr:last-child td { border-bottom: none; }
.shift-table tbody td:last-child { border-right: none; }
.shift-table tbody tr:hover td { background: #fafbfd; }
.shift-table tbody tr:hover td:first-child { background: #eef2f7; }

/* Today highlight */
.shift-table th.col-today { background: #eff6ff; color: var(--color-accent); }
.shift-table td.col-today { background: #f8fbff; }
.shift-table tr:hover td.col-today { background: #eff7ff; }

/* Weekend colors */
.shift-table th.col-sat { color: #2563eb; }
.shift-table th.col-sun { color: #dc2626; }

/* Time-slot header colors */
.shift-table th.slot-am { color: #1d4ed8; }
.shift-table th.slot-pm { color: #b45309; }
.shift-table th.slot-all { color: #6d28d9; }

/* ─── Holiday ───────────────────────────────────────────────── */
.shift-table th.col-holiday { background: #fff1f2; color: #dc2626; }
.shift-table td.col-holiday-row { background: #fff8f8; }

.day-holiday {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: #dc2626;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 72px;
}

/* ─── Site Cell ─────────────────────────────────────────────── */
.site-cell-name { display: block; color: var(--color-text); }
.site-cell-id { font-size: 11px; color: var(--color-text-sub); font-weight: normal; }

/* ─── Day header ────────────────────────────────────────────── */
.day-date { font-size: 14px; font-weight: 700; display: block; }
.day-dow  { font-size: 11px; font-weight: 400; }

/* ─── Assignment Badges ─────────────────────────────────────── */
.cell-content {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  min-height: 20px;
  align-content: flex-start;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 5px;
  border-radius: 11px;
  font-size: 11px;
  font-weight: 500;
  user-select: none;
  white-space: nowrap;
}
.badge-am  { background: #dbeafe; color: #1d4ed8; }
.badge-pm  { background: #fef3c7; color: #b45309; }
.badge-all { background: #ede9fe; color: #6d28d9; }

.badge-slot-label {
  font-size: 10px;
  font-weight: 700;
  opacity: .75;
}

.badge-del {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  opacity: .45;
  padding: 0 0 0 2px;
  color: inherit;
  transition: opacity .12s;
}
.badge-del:hover { opacity: 1; }

/* Add button in cell */
.btn-add-assign {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px dashed #cbd5e1;
  background: transparent;
  color: #94a3b8;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
  padding: 0;
}
.btn-add-assign:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: #eff6ff;
}

/* ─── Empty State ───────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 72px 24px;
  color: var(--color-text-sub);
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; opacity: .4; }
.empty-state h2 { font-size: 18px; margin-bottom: 8px; color: var(--color-text); }
.empty-state p { font-size: 14px; }

/* ─── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fade-in .15s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: white;
  border-radius: var(--radius);
  width: 460px;
  max-width: 100%;
  box-shadow: var(--shadow-md);
  animation: slide-in .15s ease;
}

@keyframes slide-in {
  from { transform: translateY(-16px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--color-text-sub);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  transition: background .12s;
}
.modal-close:hover { background: var(--color-bg); color: var(--color-text); }

.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.modal-footer .btn { min-width: 80px; }

.modal-info-box {
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--color-text-sub);
  margin-bottom: 20px;
}
.modal-info-box strong { color: var(--color-text); }

.slot-group {
  display: flex;
  gap: 8px;
}
.slot-opt {
  flex: 1;
  padding: 10px 8px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all .15s;
  color: var(--color-text-sub);
}
.slot-opt:hover { border-color: #94a3b8; color: var(--color-text); }
.slot-opt.active[data-slot="AM"]  { border-color: #3b82f6; background: #dbeafe; color: #1d4ed8; }
.slot-opt.active[data-slot="PM"]  { border-color: #f59e0b; background: #fef3c7; color: #b45309; }
.slot-opt.active[data-slot="ALL"] { border-color: #8b5cf6; background: #ede9fe; color: #6d28d9; }

.modal-error {
  margin-top: 12px;
  padding: 10px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  color: #b91c1c;
  font-size: 13px;
  display: none;
}
.modal-error.visible { display: block; }

/* ─── Copy Date Button ──────────────────────────────────────── */
.btn-copy-date {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  background: white;
  color: var(--color-text-sub);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.btn-copy-date:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: white;
}

/* ─── Bulk Assignment Modal ─────────────────────────────────── */
.bulk-modal {
  width: 520px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}
.bulk-modal .modal-body {
  overflow-y: auto;
  flex: 1;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.bulk-modal-date {
  font-size: 13px;
  color: var(--color-text-sub);
  margin-left: 8px;
}
.bulk-section {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.bulk-section-label {
  background: #f8fafc;
  border-bottom: 1px solid var(--color-border);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-sub);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.bulk-current-list {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bulk-assign-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 2px;
}
.bulk-badge { font-size: 11px; padding: 2px 6px; }
.bulk-assign-name { font-size: 13px; }
.bulk-assign-phone {
  font-size: 12px;
  color: var(--color-accent);
  text-decoration: none;
  flex: 1;
  white-space: nowrap;
}
.bulk-assign-phone:hover { text-decoration: underline; }
.bulk-del {
  background: none;
  border: 1px solid #fca5a5;
  border-radius: var(--radius-sm);
  color: #ef4444;
  font-size: 14px;
  line-height: 1;
  width: 22px;
  height: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .12s;
}
.bulk-del:hover { background: #fee2e2; }
.bulk-slot-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
}
.bulk-slot-label {
  font-size: 12px;
  color: var(--color-text-sub);
  white-space: nowrap;
  min-width: 36px;
}
.bulk-slot-row .slot-group { flex: 1; }
.bulk-slot-row .slot-opt { padding: 6px 8px; font-size: 12px; }
.bulk-worker-list {
  max-height: 240px;
  overflow-y: auto;
  padding: 6px 12px;
}
.bulk-worker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 4px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
}
.bulk-worker-row:last-child { border-bottom: none; }
.bulk-worker-row:hover { background: #f8fafc; }
.bulk-check {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--color-accent);
  flex-shrink: 0;
}
.bulk-worker-name { font-size: 13px; }
.bulk-empty {
  padding: 12px 4px;
  font-size: 13px;
  color: var(--color-text-sub);
}

/* ─── Toast Notifications ───────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow-md);
  font-size: 13px;
  min-width: 240px;
  max-width: 340px;
  border-left: 4px solid transparent;
  animation: toast-in .2s ease;
}
.toast-success { border-color: var(--color-success); }
.toast-error   { border-color: var(--color-danger); }
.toast-icon    { font-size: 16px; flex-shrink: 0; }
@keyframes toast-in {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ─── Page Header ────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
}
.required {
  color: var(--color-danger);
  font-size: 12px;
}

/* ─── Sites Table ────────────────────────────────────────────── */
.sites-table-wrap {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  overflow: auto;
}

.sites-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.sites-table thead th {
  background: #f8fafc;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--color-text-sub);
  border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
}
.sites-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.sites-table tbody tr:last-child td { border-bottom: none; }
.sites-table tbody tr:hover td { background: #fafbfd; }

.td-name  { min-width: 160px; }
.td-address { min-width: 140px; color: var(--color-text-sub); }
.td-date  { white-space: nowrap; color: var(--color-text-sub); }
.td-budget { text-align: right; white-space: nowrap; }
.td-status { white-space: nowrap; }
.td-actions { white-space: nowrap; text-align: right; }

.site-row-name { display: block; font-weight: 600; }
.site-row-note {
  display: block;
  font-size: 11px;
  color: var(--color-text-sub);
  margin-top: 2px;
}

/* ─── Status Badge ───────────────────────────────────────────── */
.badge-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.badge-status-active { background: #dcfce7; color: #166534; }
.badge-status-done   { background: #f1f5f9; color: #475569; }

/* ─── Row Action Button ──────────────────────────────────────── */
.btn-row-action {
  padding: 5px 12px;
  background: white;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  color: var(--color-text-sub);
  transition: all .15s;
}
.btn-row-action:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: #eff6ff;
}

/* ─── Modal (larger variant) ─────────────────────────────────── */
.modal-lg { width: 640px; }

/* ─── Form Grid (2-column) ───────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-col-full { grid-column: 1 / -1; }

textarea.form-control {
  resize: vertical;
  min-height: 72px;
}

.btn-status-toggle {
  margin-right: auto;
}

/* ─── Modal footer button alignment ─────────────────────────── */
.modal-footer { flex-wrap: wrap; }

/* ─── Worker Page ────────────────────────────────────────────── */
.wk-page {
  max-width: 520px;
  margin: 0 auto;
  padding: 16px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.wk-spinner-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 80px 0;
}

/* ── Month Header ──────────────────────────────────────── */
.wk-month-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0;
}

.wk-month-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.wk-month-label {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
}

.wk-lock-badge {
  font-size: 11px;
  font-weight: 600;
  color: #854d0e;
  background: #fef9c3;
  border: 1px solid #ca8a04;
  border-radius: 10px;
  padding: 1px 10px;
}

.wk-month-nav {
  width: 38px;
  height: 38px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: white;
  font-size: 22px;
  line-height: 1;
  color: var(--color-text-sub);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.wk-month-nav:hover { background: var(--color-bg); color: var(--color-text); }

/* ── Calendar ──────────────────────────────────────────── */
.wk-calendar {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* ── Day Row ───────────────────────────────────────────── */
.wk-day-row {
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  transition: background .1s;
}
.wk-day-row:last-child { border-bottom: none; }
.wk-day-row:hover { background: #fafbfd; }

.wk-row-today   { background: #eff6ff; border-left: 3px solid var(--color-accent); }
.wk-row-holiday { background: #fff1f2; }
.wk-row-today:hover { background: #e8f4ff; }
.wk-row-expanded { background: #f8fafc; }

.wk-day-main {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 10px 12px;
  min-height: 50px;
}

/* 日付列 */
.wk-date-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 30px;
  flex-shrink: 0;
}
.wk-day-num {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--color-text);
}
.wk-row-sun .wk-day-num { color: #dc2626; }
.wk-row-sat .wk-day-num { color: #2563eb; }

.wk-day-dow {
  font-size: 10px;
  color: var(--color-text-sub);
}
.wk-row-sun .wk-day-dow     { color: #dc2626; }
.wk-row-sat .wk-day-dow     { color: #2563eb; }
.wk-row-holiday .wk-day-num { color: #dc2626; }

.wk-holiday-dot {
  font-size: 9px;
  font-weight: 700;
  color: #dc2626;
  background: #fee2e2;
  border-radius: 3px;
  padding: 0 3px;
  line-height: 1.6;
  margin-top: 1px;
}

/* シフト列 */
.wk-shift-col {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  min-width: 0;
}
.wk-no-shift { font-size: 12px; color: #cbd5e1; }

.wk-assign {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.wk-list-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 6px;
}
.wk-list-site {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

/* ── 希望ボタン列（常時表示）──────────────────────────── */
.wk-hope-col {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.wk-lock-icon { font-size: 12px; }

.wk-hope-group-inline {
  display: flex;
  gap: 2px;
}

.wk-hope-btn {
  min-width: 26px;
  height: 28px;
  padding: 0 3px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: white;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all .12s;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  white-space: nowrap;
  letter-spacing: -0.5px;
}
.wk-hope-btn:hover:not([disabled]) { background: var(--color-bg); border-color: #94a3b8; }
.wk-hope-btn[disabled] { cursor: default; opacity: .5; }

/* ○ 出勤希望 */
.wk-hope-btn.hope-present.active { background: #dcfce7; border-color: #16a34a; color: #166534; }
/* △前 午前のみ可 */
.wk-hope-btn.hope-half-am.active { background: #fef9c3; border-color: #ca8a04; color: #854d0e; }
/* △後 午後のみ可 */
.wk-hope-btn.hope-half-pm.active { background: #ffedd5; border-color: #ea580c; color: #9a3412; }
/* × 休み希望 */
.wk-hope-btn.hope-absent.active  { background: #fee2e2; border-color: #dc2626; color: #991b1b; }
/* — 未記入 */
.wk-hope-btn.hope-none.active    { background: #f1f5f9; border-color: #94a3b8; color: #475569; }
/* 旧 hope-half は後方互換で残す */
.wk-hope-btn.hope-half.active    { background: #fef9c3; border-color: #ca8a04; color: #854d0e; }

/* ── 月次サマリー ──────────────────────────────────────── */
.wk-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 6px 14px 8px;
  background: #f0f9ff;
  border-bottom: 1px solid #bae6fd;
  font-size: 12px;
  color: #0369a1;
}
.wk-summary span { white-space: nowrap; }

/* ── 日報ボタン（旧メモボタン代替）──────────────────── */
.wk-report-btn {
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: white;
  font-size: 12px;
  cursor: pointer;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .12s;
  padding: 0;
}
.wk-report-btn:hover      { background: var(--color-bg); }
.wk-report-btn.has-report { border-color: var(--color-accent); color: var(--color-accent); }
.wk-report-btn.active     { background: #eff6ff; border-color: var(--color-accent); }

/* ── 日報パネル（展開時・シンプル版）────────────────── */
.wk-report-panel {
  padding: 10px 14px 14px;
  border-top: 1px dashed var(--color-border);
  background: #f8fafc;
}

.wk-rpt-site-disp {
  font-size: 12px;
  color: var(--color-text-sub);
  margin-bottom: 8px;
}

.wk-rpt-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  margin-bottom: 8px;
}

.wk-rpt-field {
  display: flex;
  align-items: center;
  gap: 6px;
}

.wk-rpt-label {
  font-size: 12px;
  color: var(--color-text-sub);
  white-space: nowrap;
}

.wk-rpt-num {
  width: 60px;
  font-size: 13px;
  font-family: inherit;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 4px 6px;
  background: white;
  color: var(--color-text);
  text-align: center;
}
.wk-rpt-num:focus          { outline: none; border-color: var(--color-accent); }
.wk-rpt-num[disabled]      { background: #f1f5f9; color: #94a3b8; }
.wk-rpt-unit               { font-size: 12px; color: var(--color-text-sub); }

.wk-rpt-radio {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 13px;
  cursor: pointer;
}

.wk-rpt-note-row {
  margin-bottom: 8px;
}

.wk-rpt-textarea {
  width: 100%;
  box-sizing: border-box;
  font-size: 13px;
  font-family: inherit;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  background: white;
  color: var(--color-text);
  resize: none;
  min-height: 46px;
}
.wk-rpt-textarea:focus     { outline: none; border-color: var(--color-accent); }
.wk-rpt-textarea[disabled] { background: #f1f5f9; color: #94a3b8; }

.wk-rpt-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.wk-cancel-btn {
  padding: 5px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: white;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  color: var(--color-text-sub);
  transition: background .12s;
}
.wk-cancel-btn:hover { background: var(--color-bg); }
.wk-save-rpt-btn {
  padding: 5px 18px !important;
  font-size: 13px !important;
  width: auto !important;
}

/* ── 月次集計テーブル ────────────────────────────────── */
.wk-monthly-section {
  margin: 12px 0 24px;
  padding: 0 4px;
}

.wk-monthly-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-sub);
  padding: 0 4px 6px;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 0;
}

.wk-monthly-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.wk-monthly-tbl th,
.wk-monthly-tbl td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: middle;
}
.wk-monthly-tbl thead th {
  font-size: 11px;
  color: var(--color-text-sub);
  font-weight: 600;
  background: #f8fafc;
}
.wk-tbl-num  { text-align: center; width: 56px; color: var(--color-text); }
.wk-tbl-site { font-weight: 600; white-space: nowrap; }
.wk-tbl-client { min-width: 100px; }
.wk-tbl-save { width: 52px; text-align: center; }

.wk-client-input {
  width: 100%;
  box-sizing: border-box;
  font-size: 12px;
  font-family: inherit;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 3px 6px;
  background: white;
  color: var(--color-text);
}
.wk-client-input:focus    { outline: none; border-color: var(--color-accent); }
.wk-client-input[disabled] { background: #f1f5f9; color: #94a3b8; }

.wk-client-save-btn {
  font-size: 11px !important;
  padding: 3px 8px !important;
  width: auto !important;
  background: #f1f5f9 !important;
  border: 1px solid var(--color-border) !important;
  color: var(--color-text) !important;
}
.wk-client-save-btn:hover { background: #e2e8f0 !important; }

.wk-tbl-total-label { font-size: 11px; color: var(--color-text-sub); text-align: right; }
.wk-tbl-total       { font-weight: 700; }

.wk-absent-summary {
  font-size: 12px;
  color: #dc2626;
  padding: 6px 4px 0;
}

.wk-submit-row {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}
.wk-hope-submit-btn {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
}
.wk-hope-submit-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

/* ─── 作業者管理 ────────────────────────────────────────────── */
.wm-page       { max-width: 720px; margin: 0 auto; }
.wm-header     { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.wm-title      { font-size: 18px; font-weight: 700; margin: 0; }
.wm-loading    { display: flex; justify-content: center; padding: 40px; }

.wm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.wm-table th, .wm-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}
.wm-table thead th {
  font-size: 12px;
  color: var(--color-text-sub);
  background: #f8fafc;
  font-weight: 600;
}
.wm-th-qr {
  width: 40px;
  text-align: center;
  padding: 4px 6px;
}
.wm-qr-icon-btn {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 3px 6px;
  font-size: 14px;
  cursor: pointer;
  line-height: 1;
  color: var(--color-text-sub);
  transition: background 0.15s, color 0.15s;
}
.wm-qr-icon-btn:hover {
  background: var(--color-border);
  color: var(--color-text);
}
.wm-edit-btn {
  font-size: 12px !important;
  padding: 3px 12px !important;
  width: auto !important;
  background: #f1f5f9 !important;
  border: 1px solid var(--color-border) !important;
  color: var(--color-text) !important;
}
.wm-edit-btn:hover { background: #e2e8f0 !important; }

/* モーダル */
.wm-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.wm-modal {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 440px;
  margin: 16px;
}
.wm-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--color-border);
  font-weight: 700;
  font-size: 15px;
}
.wm-modal-close {
  background: none; border: none; font-size: 16px;
  cursor: pointer; color: var(--color-text-sub); padding: 0 4px;
}
.wm-modal-body    { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.wm-modal-footer  { padding: 12px 20px 16px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--color-border); }

.wm-field         { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.wm-field label   { font-size: 12px; color: var(--color-text-sub); font-weight: 600; }
.wm-field-row     { flex-direction: row; gap: 12px; }
.wm-required      { color: #dc2626; }
.wm-error         { font-size: 13px; color: #dc2626; padding: 6px 10px; background: #fee2e2; border-radius: var(--radius-sm); }
.wm-cancel        { background: white !important; border: 1.5px solid var(--color-border) !important; color: var(--color-text-sub) !important; }

/* ─── Kanban Board (1日表示) ─────────────────────────────────── */
.kanban-board {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-height: 320px;
  padding-bottom: 8px;
}

.kanban-col {
  flex: 0 0 170px;
  min-width: 150px;
  max-width: 200px;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.kanban-col-header {
  padding: 10px 14px;
  border-bottom: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #f8fafc;
  border-radius: var(--radius) var(--radius) 0 0;
}

.kanban-col-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
  white-space: normal;
  line-height: 1.3;
  word-break: break-all;
}

.kanban-col-count {
  font-size: 11px;
  font-weight: 600;
  color: white;
  background: var(--color-primary);
  padding: 1px 7px;
  border-radius: 10px;
  flex-shrink: 0;
}

.kanban-drop-zone {
  flex: 1;
  padding: 6px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  align-items: start;
  min-height: 60px;
  transition: background .15s, outline .15s;
}

.kanban-drop-zone.drag-over {
  background: #eff6ff;
  outline: 2px dashed var(--color-accent);
  outline-offset: -2px;
  border-radius: var(--radius-sm);
}

.kanban-col-footer {
  padding: 6px 8px 8px;
  border-top: 1px solid var(--color-border);
}

.kanban-col-footer .btn-add-assign {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1.5px dashed #cbd5e1;
  height: 30px;
  font-size: 12px;
  color: #94a3b8;
  background: transparent;
  cursor: pointer;
  transition: all .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.kanban-col-footer .btn-add-assign:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: #eff6ff;
}

/* ─── Kanban Card ────────────────────────────────────────────── */
.kanban-card {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px 5px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 500;
  cursor: grab;
  user-select: none;
  transition: opacity .15s, box-shadow .15s;
  position: relative;
  overflow: hidden;
}

.kanban-card:active { cursor: grabbing; }

.kanban-card.badge-am  { background: #dbeafe; color: #1d4ed8; }
.kanban-card.badge-pm  { background: #fef3c7; color: #b45309; }
.kanban-card.badge-all { background: #ede9fe; color: #6d28d9; }

.kanban-card.dragging {
  opacity: 0.35;
  box-shadow: 0 4px 12px rgba(0,0,0,.18);
}

.kcard-slot {
  font-size: 10px;
  font-weight: 700;
  opacity: .7;
  flex-shrink: 0;
}

.kcard-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kcard-del {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  opacity: .4;
  padding: 0;
  color: inherit;
  transition: opacity .12s;
  flex-shrink: 0;
}
.kcard-del:hover { opacity: 1; }

/* ─── Week Badge (draggable) ─────────────────────────────────── */
.week-badge {
  cursor: grab;
}
.week-badge:active { cursor: grabbing; }
.week-badge.dragging { opacity: 0.35; }

/* ─── Week drop zone hover ───────────────────────────────────── */
.week-drop-zone.drag-over {
  background: #eff6ff;
  outline: 2px dashed var(--color-accent);
  outline-offset: -2px;
  border-radius: var(--radius-sm);
  min-height: 32px;
}

/* ═══════════════════════════════════════════════════════════════
   職長（Foreman）機能スタイル
   ═══════════════════════════════════════════════════════════════ */

/* ─── Workers 管理: 職長バッジ ───────────────────────────────── */
.wm-foreman-badge {
  display: inline-block;
  background: #7c3aed;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: .03em;
}

.wm-check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

/* ─── Board: 職長バッジ（週表示バッジ内） ───────────────────── */
.week-foreman-badge {
  display: inline-block;
  background: #7c3aed;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 0 4px;
  border-radius: 3px;
  margin-right: 2px;
  line-height: 16px;
  vertical-align: middle;
  flex-shrink: 0;
}

.week-badge.is-foreman {
  outline: 2px solid #7c3aed;
  outline-offset: -1px;
}

/* ─── Board: 職長バッジ（カンバンカード内） ─────────────────── */
.kcard-foreman-badge {
  display: inline-block;
  background: #7c3aed;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 0 5px;
  border-radius: 3px;
  margin-right: 4px;
  line-height: 16px;
  vertical-align: middle;
}

.kanban-card.is-foreman {
  border-left: 3px solid #7c3aed;
}

/* ─── Sites: 職長優先順位セクション ─────────────────────────── */
.sm-hint {
  font-size: 11px;
  color: var(--color-text-muted, #6b7280);
  font-weight: 400;
}

.sm-fp-loading, .sm-fp-error, .sm-fp-empty {
  color: var(--color-text-muted, #6b7280);
  font-size: 13px;
  padding: 8px 0;
}

.sm-fp-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.sm-fp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 6px 10px;
}

.sm-fp-rank {
  width: 20px;
  text-align: center;
  font-weight: 700;
  color: #7c3aed;
  flex-shrink: 0;
}

.sm-fp-name {
  flex: 1;
  font-size: 14px;
}

.sm-fp-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

.sm-fp-btn {
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 13px;
  cursor: pointer;
  color: #64748b;
  line-height: 1.4;
  transition: background .1s;
}
.sm-fp-btn:hover { background: #f1f5f9; }
.sm-fp-remove { color: #ef4444; }
.sm-fp-remove:hover { background: #fee2e2; border-color: #fca5a5; }

.sm-fp-btn-placeholder {
  display: inline-block;
  width: 30px;
}

.sm-fp-add-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.sm-fp-select {
  flex: 1;
  font-size: 14px;
}

.sm-fp-footer {
  margin-top: 8px;
}

/* ─── Foreman Lock Modal ─────────────────────────────────────── */
.foreman-lock-modal {
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.foreman-lock-modal .modal-body {
  overflow-y: auto;
  flex: 1;
}

.flm-alert-banner {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  color: #92400e;
  margin-bottom: 14px;
}

.flm-ok-banner {
  background: #d1fae5;
  border: 1px solid #10b981;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  color: #065f46;
  margin-bottom: 14px;
}

.flm-info {
  color: #6b7280;
  font-size: 14px;
  padding: 12px 0;
}

.flm-table-wrap {
  overflow-x: auto;
}

.flm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.flm-table th {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  color: #374151;
}

.flm-table td {
  border: 1px solid #e2e8f0;
  padding: 6px 10px;
  vertical-align: middle;
}

.flm-table tr.flm-row-alert td {
  background: #fff7ed;
}

.flm-td-date { width: 60px; white-space: nowrap; }
.flm-td-site { min-width: 100px; }
.flm-td-foreman { display: flex; align-items: center; gap: 6px; }
.flm-td-foreman .form-select { flex: 1; font-size: 13px; }

.flm-warn {
  color: #f59e0b;
  font-size: 14px;
  flex-shrink: 0;
}

.flm-manual {
  display: inline-block;
  background: #ddd6fe;
  color: #5b21b6;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   未アサイン（Unassigned Workers）セクション
   ═══════════════════════════════════════════════════════════════ */

/* ─── 週表示: 未アサイン行 ───────────────────────────────────── */
.row-unassigned {
  background: #f8fafc;
  border-top: 2px solid #e2e8f0;
}

.ua-label-cell {
  vertical-align: top;
  padding: 6px 8px !important;
}

.ua-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  background: #e2e8f0;
  border-radius: 4px;
  padding: 2px 7px;
  white-space: nowrap;
}

.ua-week-cell {
  padding: 5px 6px !important;
  vertical-align: top;
}

.ua-chip {
  display: inline-block;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  font-size: 11px;
  color: #475569;
  padding: 1px 7px;
  margin: 1px 2px;
  white-space: nowrap;
  line-height: 1.6;
}

.ua-all-ok {
  font-size: 11px;
  color: #94a3b8;
  font-style: italic;
}

/* ─── カンバン: 未アサインセクション ─────────────────────────── */
.ua-kanban-section {
  margin-top: 16px;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.ua-kanban-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.ua-count {
  font-size: 12px;
  color: #64748b;
  background: #e2e8f0;
  border-radius: 10px;
  padding: 1px 7px;
}

.ua-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* ─── 読み取り専用: ロック状態バッジ ─────────────────────────── */
.lock-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 600;
}

/* ─── 職長資格バッジ（★）─────────────────────────────────────
   カンバンカード・週バッジ・一括モーダル・未アサイン欄で共通利用 */

/* カンバンカード内 ★ */
.kcard-qual-badge {
  display: inline-block;
  font-size: 10px;
  color: #b45309;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 3px;
  padding: 0 3px;
  line-height: 14px;
  vertical-align: middle;
  margin-right: 2px;
  flex-shrink: 0;
}

/* 週表示バッジ内 ★ */
.week-qual-badge {
  display: inline-block;
  font-size: 9px;
  color: #b45309;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 3px;
  padding: 0 2px;
  line-height: 13px;
  vertical-align: middle;
  margin-right: 1px;
  flex-shrink: 0;
}

/* 一括モーダル作業者リスト内 ★ */
.bulk-qual-badge {
  display: inline-block;
  font-size: 10px;
  color: #b45309;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 3px;
  padding: 0 3px;
  line-height: 15px;
  vertical-align: middle;
  margin-right: 4px;
  flex-shrink: 0;
}

/* 未アサイン欄チップ内 ★ */
.ua-qual-badge {
  display: inline-block;
  font-size: 9px;
  color: #b45309;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 2px;
  padding: 0 2px;
  line-height: 13px;
  vertical-align: middle;
  margin-right: 2px;
}

/* ─── 現場マスタ: 職長設定列 ─────────────────────────────────── */
.td-foreman {
  white-space: nowrap;
  font-size: 13px;
}

.fp-unset {
  color: #94a3b8;
  font-size: 12px;
}

.fp-name {
  color: #1e293b;
  font-weight: 500;
}

.fp-extra {
  color: #64748b;
  font-size: 11px;
  margin-left: 2px;
}

/* ─── 一括アサインモーダル: 検索＋チップ選択 UI ─────────────── */

/* 検索入力欄 */
.bulk-search-wrap {
  margin: 8px 0 6px;
}
.bulk-search {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 10px 6px 28px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
  background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 8px center;
  outline: none;
  transition: border-color .15s;
}
.bulk-search:focus {
  border-color: #6366f1;
  background-color: #fff;
}

/* チップクラウド */
.bulk-chip-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px 2px 6px;
}

/* 個別チップ */
.bulk-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  font-size: 13px;
  color: #334155;
  background: #f8fafc;
  cursor: pointer;
  user-select: none;
  transition: background .12s, border-color .12s, color .12s;
  white-space: nowrap;
}
.bulk-chip:hover {
  border-color: #818cf8;
  background: #eef2ff;
  color: #4338ca;
}
.bulk-chip.selected {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #fff;
}
.bulk-chip.selected .chip-qual {
  color: #fde68a;
}

/* チップ内の職長資格 ★ */
.chip-qual {
  font-size: 10px;
  color: #b45309;
  line-height: 1;
}

/* 選択中カウント（セクションラベル横） */
.bulk-sel-count {
  display: none;
  margin-left: 8px;
  font-size: 11px;
  font-weight: 600;
  color: #4f46e5;
  background: #eef2ff;
  border-radius: 10px;
  padding: 1px 8px;
}
.bulk-sel-count.visible {
  display: inline-block;
}

/* 旧チェックボックスリストの名残を非表示（チップUIに完全移行） */
.bulk-worker-list { display: none; }

/* ─── カンバン列: 職長行 ─────────────────────────────────────── */
.kanban-foreman-row {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  padding: 3px 8px;
  margin: 0;
  background: #f0f4ff;
  border: none;
  border-bottom: 1px solid #e2e8f0;
  cursor: pointer;
  font-size: 12px;
  text-align: left;
  transition: background .12s;
}
.kanban-foreman-row:hover { background: #e0e7ff; }

.kfr-label {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: #4f46e5;
  border-radius: 3px;
  padding: 1px 4px;
  flex-shrink: 0;
}
.kfr-name  { color: #1e293b; font-weight: 500; }
.kfr-unset { color: #94a3b8; font-style: italic; }

/* 週バッジ内: 職長バッジをボタン化 */
button.week-foreman-badge {
  border: none;
  cursor: pointer;
  padding: 0 3px;
  border-radius: 2px;
  line-height: inherit;
  font-size: inherit;
  font-family: inherit;
}
button.week-foreman-badge:hover { filter: brightness(1.15); }

/* ─── 職長変更ポップオーバー ─────────────────────────────────── */
.foreman-popover {
  position: fixed;
  z-index: 9999;
  width: 240px;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fpop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.fpop-title {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
}
.fpop-close {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 16px;
  color: #94a3b8;
  line-height: 1;
  padding: 0 2px;
}
.fpop-close:hover { color: #334155; }
.fpop-meta {
  font-size: 12px;
  color: #64748b;
  margin-top: -4px;
}
.fpop-select { font-size: 13px; }
.fpop-footer {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 2px;
}

/* ─── マイシフト: 職長アイコン ───────────────────────────────── */
.wk-foreman-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 6px;
  padding: 2px 7px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #92400e;
  vertical-align: middle;
  transition: background .12s;
}
.wk-foreman-btn:hover { background: #fde68a; }
.wk-foreman-icon { font-size: 14px; }
.wk-foreman-label { font-size: 11px; }

/* ─── 職長チーム日報モーダル ─────────────────────────────────── */
.ftm-modal { max-width: 540px; width: 95vw; }

.ftm-meta {
  font-size: 12px;
  color: #64748b;
  margin-left: 8px;
}

.ftm-hint {
  font-size: 12px;
  color: #6366f1;
  background: #eef2ff;
  border-radius: 6px;
  padding: 6px 10px;
  margin: 0 0 10px;
}

.ftm-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 55vh;
  overflow-y: auto;
}

.ftm-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.ftm-row-first {
  background: #f0f4ff;
  border-color: #c7d2fe;
}

.ftm-name {
  width: 80px;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 500;
  color: #1e293b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ftm-fields {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}

.ftm-field {
  display: flex;
  align-items: center;
  gap: 4px;
}
.ftm-field-lbl {
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
}
.ftm-num {
  width: 58px;
  padding: 3px 5px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  font-size: 13px;
  text-align: right;
}
.ftm-field-car { gap: 4px; }
.ftm-radio { font-size: 12px; color: #334155; cursor: pointer; }

.ftm-error, .ftm-empty {
  font-size: 13px;
  color: #dc2626;
  padding: 10px;
}

/* ============================================================
   出退勤打刻カード
   ============================================================ */

.atd-card {
  margin: 12px 12px 4px;
  padding: 16px 18px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.atd-no-shift {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  align-items: center;
}
.atd-no-shift-msg {
  font-size: 14px;
  color: #64748b;
}

.atd-ready {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid #93c5fd;
}
.atd-working {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1px solid #86efac;
}
.atd-done {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.atd-site {
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.atd-times {
  font-size: 13px;
  color: #475569;
}

.atd-done-msg {
  font-size: 13px;
  color: #16a34a;
  font-weight: 500;
}

.atd-btn {
  padding: 14px 0;
  border: none;
  border-radius: 10px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  letter-spacing: .04em;
  transition: opacity .15s, transform .1s;
}
.atd-btn:active { transform: scale(.97); }

.atd-btn-in {
  background: #2563eb;
  color: #fff;
}
.atd-btn-in:hover  { background: #1d4ed8; }

.atd-btn-out {
  background: #16a34a;
  color: #fff;
}
.atd-btn-out:hover { background: #15803d; }

/* ── 写真確認オーバーレイ ── */
.atd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}

.atd-preview-box {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.atd-preview-label {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  text-align: center;
}

.atd-preview-img {
  width: 100%;
  border-radius: 10px;
  object-fit: cover;
  max-height: 52vh;
}

.atd-preview-note {
  font-size: 12px;
  color: #64748b;
  text-align: center;
}

.atd-preview-actions {
  display: flex;
  gap: 10px;
}
.atd-preview-actions button { flex: 1; padding: 12px 0; font-size: 15px; }

.atd-preview-err {
  font-size: 13px;
  color: #dc2626;
  min-height: 18px;
  text-align: center;
}

