/* ===================================================
   シフトメーカーAI - メインスタイルシート
   kintone風 業務アプリデザイン
=================================================== */

/* CSS変数 */
:root {
  --primary: #0061AF;
  --primary-light: #3a8fd4;
  --primary-dark: #004d8a;
  --primary-bg: #e8f2fa;
  --accent: #0079C2;
  --success: #28a745;
  --success-bg: #e8f5e9;
  --warning: #f0a500;
  --warning-bg: #fff8e1;
  --danger: #dc3545;
  --danger-bg: #fde8ea;
  --info: #17a2b8;
  --info-bg: #e1f5f8;

  --text-primary: #1a1a2e;
  --text-secondary: #555770;
  --text-muted: #8a8ea8;
  --text-light: #b8bbcc;

  --bg-white: #ffffff;
  --bg-light: #f5f6fa;
  --bg-gray: #eceef5;

  --border: #dde1ed;
  --border-light: #eceef5;
  --border-focus: #0061AF;

  --sidebar-width: 240px;
  --sidebar-collapsed: 64px;
  --header-height: 64px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --shadow-card: 0 2px 8px rgba(0, 97, 175, 0.08);

  --radius: 6px;
  --radius-lg: 10px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  --font: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
  --transition: 0.2s ease;
}

/* リセット & ベース */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: var(--font);
  background: var(--bg-light);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: var(--font); border: none; background: none; }
input, select, textarea { font-family: var(--font); }

.hidden { display: none !important; }

/* ===== ログイン画面 ===== */
.login-screen {
  min-height: 100vh;
  background: linear-gradient(135deg, #e8f2fa 0%, #f5f6fa 40%, #fff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.login-screen::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(0,97,175,0.08) 0%, transparent 70%);
  border-radius: 50%;
}

.login-container {
  width: 100%;
  max-width: 440px;
  z-index: 1;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.logo-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 8px 24px rgba(0, 97, 175, 0.3);
}

.logo-icon i {
  font-size: 28px;
  color: white;
}

.logo-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.logo-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
}

.login-card {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.login-tabs {
  display: flex;
  background: var(--bg-light);
  border-bottom: 1px solid var(--border);
}

.login-tab {
  flex: 1;
  padding: 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.login-tab.active {
  background: white;
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 2px 0 var(--primary) inset;
}

.login-tab:hover:not(.active) {
  color: var(--text-secondary);
  background: var(--bg-gray);
}

#loginForm {
  padding: 28px;
}

.login-demo-note {
  margin-top: 16px;
  padding: 10px 12px;
  background: var(--info-bg);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--info);
}

/* ===== メインアプリレイアウト ===== */
.main-app {
  display: flex;
  min-height: 100vh;
}

/* ===== サイドバー ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--text-primary);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition), width var(--transition);
  overflow-x: hidden;
  overflow-y: auto;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

.sidebar-header {
  padding: 16px 16px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.sidebar-logo i {
  font-size: 20px;
  color: #5eb3f5;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-size: 15px;
  font-weight: 700;
  color: white;
  white-space: nowrap;
}

.sidebar-toggle {
  color: rgba(255,255,255,0.5);
  font-size: 16px;
  padding: 4px;
  border-radius: var(--radius);
  transition: color var(--transition);
}

.sidebar-toggle:hover {
  color: white;
  background: rgba(255,255,255,0.1);
}

.store-info {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}

.store-name {
  font-size: 13px;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.store-user {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 10px 0;
}

.nav-section {
  margin-bottom: 4px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 10px 16px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13px;
  color: rgba(255,255,255,0.65);
  transition: all var(--transition);
  border-radius: 0;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}

.nav-item i {
  width: 18px;
  text-align: center;
  font-size: 14px;
  flex-shrink: 0;
  color: rgba(255,255,255,0.4);
  transition: color var(--transition);
}

.nav-item span:first-of-type {
  flex: 1;
}

.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: white;
}

.nav-item:hover i {
  color: rgba(255,255,255,0.7);
}

.nav-item.active {
  background: rgba(0, 121, 194, 0.25);
  color: white;
  border-left: 3px solid var(--primary-light);
}

.nav-item.active i {
  color: #5eb3f5;
}

.nav-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.8);
  flex-shrink: 0;
}

/* ===== アコーディオン（シフト表サブメニュー） ===== */

/* 矢印アイコン */
.nav-accordion-arrow {
  font-size: 10px !important;
  width: auto !important;
  margin-left: auto;
  transition: transform 0.25s ease;
  color: rgba(255,255,255,0.35) !important;
  flex-shrink: 0;
}

.nav-accordion-trigger.open .nav-accordion-arrow {
  transform: rotate(180deg);
  color: rgba(255,255,255,0.6) !important;
}

/* 親メニューのアクティブ状態（サブが開いている時も青く） */
.nav-accordion-trigger.sub-active {
  background: rgba(0,121,194,0.20);
  color: rgba(255,255,255,0.9);
  border-left: 3px solid var(--primary-light);
}

.nav-accordion-trigger.sub-active i:first-child {
  color: #5eb3f5;
}

/* サブメニューコンテナ */
.nav-sub-menu {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease, opacity 0.25s ease;
  opacity: 0;
  background: rgba(0,0,0,0.18);
}

.nav-sub-menu.open {
  max-height: 300px;
  opacity: 1;
}

/* サブメニュー各アイテム */
.nav-sub-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 8px 36px;
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  transition: all var(--transition);
  border-left: 2px solid transparent;
  white-space: nowrap;
  overflow: hidden;
}

.nav-sub-item i {
  width: 14px;
  text-align: center;
  font-size: 12px;
  flex-shrink: 0;
  color: rgba(255,255,255,0.3);
  transition: color var(--transition);
}

.nav-sub-item:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.85);
}

.nav-sub-item:hover i {
  color: rgba(255,255,255,0.6);
}

.nav-sub-item.active {
  color: white;
  background: rgba(0,121,194,0.20);
  border-left-color: #5eb3f5;
}

.nav-sub-item.active i {
  color: #5eb3f5;
}

/* 当日バッジ（今日の日付を小さく表示） */
.nav-sub-today-badge {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.4);
  margin-left: 2px;
}

/* 特別ハイライト：当日・明日 */
.nav-sub-item.highlight-today {
  color: rgba(255,255,255,0.85);
}

.nav-sub-item.highlight-today i {
  color: #f9c74f;
}

.nav-sub-item.highlight-tomorrow i {
  color: #90e0ef;
}

.nav-badge-warn {
  background: rgba(240, 165, 0, 0.25);
  color: #f0c040;
}

.nav-badge-danger {
  background: rgba(220, 53, 69, 0.25);
  color: #ff6b7a;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  overflow: hidden;
}

.user-name {
  font-size: 12px;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 10px;
  color: rgba(255,255,255,0.4);
}

.btn-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius);
  color: rgba(255,255,255,0.4);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.btn-icon:hover {
  color: white;
  background: rgba(255,255,255,0.1);
}

/* ===== メインコンテンツ ===== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.page-header {
  height: var(--header-height);
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.page-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mobile-menu-btn {
  display: none;
  font-size: 18px;
  color: var(--text-secondary);
  padding: 4px 8px;
}

.page-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.page-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.page-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

/* ===== フォーム部品 ===== */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}

.form-label.required::after {
  content: ' *';
  color: var(--danger);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text-primary);
  background: white;
  transition: all var(--transition);
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0, 97, 175, 0.12);
}

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

.form-input::placeholder { color: var(--text-light); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-error {
  font-size: 11px;
  color: var(--danger);
  margin-top: 4px;
}

/* ===== ボタン ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius);
  transition: all var(--transition);
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 14px;
}

.btn-xl {
  padding: 16px 32px;
  font-size: 16px;
  border-radius: var(--radius-lg);
}

.btn-full { width: 100%; }

.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(0, 97, 175, 0.3);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.btn-success:hover {
  background: #218838;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
  transform: translateY(-1px);
}

.btn-warning {
  background: var(--warning);
  color: white;
  border-color: var(--warning);
}

.btn-warning:hover {
  background: #d4920a;
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

.btn-danger:hover {
  background: #c82333;
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary-bg);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--bg-light);
  color: var(--text-primary);
}

.btn-ai {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-ai:hover {
  background: linear-gradient(135deg, #5a6fd6, #6a4394);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
  transform: translateY(-2px);
}

/* ===== カード ===== */
.card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-white);
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title i {
  color: var(--primary);
  font-size: 15px;
}

.card-body {
  padding: 20px;
}

.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* ===== ダッシュボード スタッツカード ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--transition);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-icon.primary { background: var(--primary-bg); color: var(--primary); }
.stat-icon.success { background: var(--success-bg); color: var(--success); }
.stat-icon.warning { background: var(--warning-bg); color: var(--warning); }
.stat-icon.danger  { background: var(--danger-bg);  color: var(--danger); }
.stat-icon.info    { background: var(--info-bg);    color: var(--info); }

.stat-info {
  flex: 1;
  min-width: 0;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.stat-change {
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
}

.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ===== テーブル ===== */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  background: white;
}

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

thead {
  background: var(--bg-light);
  border-bottom: 2px solid var(--border);
}

th {
  padding: 11px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }

tbody tr {
  transition: background var(--transition);
}

tbody tr:hover { background: var(--bg-light); }

/* ===== バッジ ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-full);
}

.badge-primary { background: var(--primary-bg); color: var(--primary); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-info    { background: var(--info-bg);    color: var(--info); }
.badge-gray    { background: var(--bg-gray);    color: var(--text-muted); }

/* ===== シフトカレンダー ===== */
.shift-calendar {
  overflow-x: auto;
}

.shift-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  min-width: 900px;
}

.shift-table th {
  padding: 8px 6px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  background: #f5f6fa;
  border: 1px solid var(--border);
  white-space: nowrap;
}

.shift-table th.sat { background: #e8f0ff; color: #1a5abf; }
.shift-table th.sun, .shift-table th.holiday { background: #ffeaea; color: var(--danger); }

.shift-table td {
  padding: 4px 4px;
  border: 1px solid var(--border-light);
  text-align: center;
  min-width: 48px;
  max-width: 72px;
  vertical-align: middle;
}

.shift-table td.staff-name-cell {
  text-align: left;
  padding: 8px 12px;
  font-weight: 600;
  min-width: 100px;
  background: var(--bg-light);
  border-right: 2px solid var(--border);
  position: sticky;
  left: 0;
  z-index: 1;
}

.shift-cell {
  background: var(--primary-bg);
  color: var(--primary-dark);
  border-radius: 4px;
  padding: 3px 4px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.3;
  transition: all var(--transition);
  border: 1px solid rgba(0,97,175,0.15);
}

.shift-cell:hover {
  background: var(--primary);
  color: white;
  transform: scale(1.05);
}

.shift-cell.confirmed {
  background: var(--success-bg);
  color: #1a6b2a;
  border-color: rgba(40,167,69,0.2);
}

.shift-cell.rest {
  background: var(--bg-gray);
  color: var(--text-muted);
  border-color: var(--border);
  font-size: 9px;
}

.shift-cell.short {
  background: var(--warning-bg);
  color: #8a5a00;
  border-color: rgba(240,165,0,0.2);
}

.shift-date-header {
  font-size: 13px;
  font-weight: 700;
}

.shift-day-header {
  font-size: 10px;
  font-weight: 400;
}

.shortage-indicator {
  font-size: 9px;
  font-weight: 700;
  color: var(--danger);
  margin-top: 2px;
}

/* ===== 人員不足/充足バー ===== */
.coverage-bar {
  height: 4px;
  border-radius: 2px;
  margin-top: 3px;
}

.coverage-bar.ok { background: var(--success); }
.coverage-bar.warn { background: var(--warning); }
.coverage-bar.ng { background: var(--danger); }

/* ===== カレンダー (希望入力用) ===== */
.request-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}

.cal-header-cell {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 6px 0;
}

.cal-header-cell.sat { color: #1a5abf; }
.cal-header-cell.sun { color: var(--danger); }

.cal-day {
  aspect-ratio: 1;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  background: white;
  padding: 4px;
  min-height: 44px;
  position: relative;
  overflow: hidden;
}

.cal-day:hover:not(.cal-day-empty):not(.cal-day-past) {
  border-color: var(--primary);
  background: var(--primary-bg);
}

.cal-day.available {
  background: var(--success-bg);
  border-color: rgba(40,167,69,0.3);
  color: #1a6b2a;
}

.cal-day.unavailable {
  background: var(--danger-bg);
  border-color: rgba(220,53,69,0.3);
  color: #9b1a26;
}

.cal-day.preferred {
  background: var(--primary-bg);
  border-color: rgba(0,97,175,0.3);
  color: var(--primary-dark);
}

.cal-day.time-limited {
  background: var(--warning-bg);
  border-color: rgba(240,165,0,0.3);
  color: #6b4a00;
}

.cal-day.cal-day-empty {
  background: var(--bg-light);
  cursor: default;
  color: transparent;
  border-color: var(--border-light);
}

.cal-day.cal-day-past {
  opacity: 0.4;
  cursor: default;
}

.cal-day-date {
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
}

.cal-day-icon {
  font-size: 11px;
  margin-top: 2px;
}

.cal-day.sat .cal-day-date { color: #1a5abf; }
.cal-day.sun .cal-day-date { color: var(--danger); }

/* ===== AIアシスタントパネル ===== */
.ai-panel {
  background: linear-gradient(135deg, #f0f4ff 0%, #faf0ff 100%);
  border: 1px solid rgba(102, 126, 234, 0.2);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
}

.ai-panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.ai-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: white;
}

.ai-panel-title {
  font-size: 13px;
  font-weight: 700;
  color: #3d3d6b;
}

.ai-suggestion {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  background: white;
  border-radius: var(--radius);
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  border-left: 3px solid #667eea;
}

.ai-suggestion:last-child { margin-bottom: 0; }

.ai-suggestion i {
  margin-top: 1px;
  color: #667eea;
  flex-shrink: 0;
}

/* ===== アラート ===== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}

.alert i { flex-shrink: 0; margin-top: 1px; }

.alert-info    { background: var(--info-bg);    color: #0c6878; border-left: 3px solid var(--info); }
.alert-success { background: var(--success-bg); color: #1a5c30; border-left: 3px solid var(--success); }
.alert-warning { background: var(--warning-bg); color: #7a5200; border-left: 3px solid var(--warning); }
.alert-danger  { background: var(--danger-bg);  color: #8b1a24; border-left: 3px solid var(--danger); }

/* ===== プログレスバー ===== */
.progress-bar {
  height: 6px;
  background: var(--bg-gray);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

/* ===== スタッフカード ===== */
.staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.staff-card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 16px;
  box-shadow: var(--shadow-card);
  transition: all var(--transition);
  cursor: pointer;
}

.staff-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--primary);
}

.staff-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.staff-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.staff-card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.staff-card-kana {
  font-size: 11px;
  color: var(--text-muted);
}

.staff-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.staff-card-stat {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
}

.staff-card-stat:last-child { border-bottom: none; }

.staff-card-stat-value {
  font-weight: 600;
  color: var(--text-primary);
}

/* ===== モーダル ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  backdrop-filter: blur(2px);
}

.modal-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  z-index: 201;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-light);
  flex-shrink: 0;
}

.modal-title {
  font-size: 15px;
  font-weight: 700;
}

.modal-close {
  font-size: 16px;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: var(--radius);
  transition: all var(--transition);
}

.modal-close:hover {
  color: var(--text-primary);
  background: var(--bg-gray);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--bg-light);
  flex-shrink: 0;
}

/* ===== トースト通知 ===== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 999;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  max-width: 360px;
  animation: slideInRight 0.3s ease;
  color: white;
}

.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.warning { background: var(--warning); }
.toast.info    { background: var(--info); }

@keyframes slideInRight {
  from { transform: translateX(100px); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateX(20px); }
}

/* ===== ステップインジケーター ===== */
.steps {
  display: flex;
  align-items: center;
  margin-bottom: 28px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  position: relative;
  min-width: 80px;
}

.step::after {
  content: '';
  position: absolute;
  top: 18px;
  left: 60%;
  right: -40%;
  height: 2px;
  background: var(--border);
}

.step:last-child::after { display: none; }

.step.done::after {
  background: var(--primary);
}

.step-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  background: white;
  z-index: 1;
  transition: all var(--transition);
}

.step.done .step-number {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.step.active .step-number {
  background: white;
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0,97,175,0.12);
}

.step-label {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.3;
}

.step.active .step-label { color: var(--primary); font-weight: 600; }
.step.done .step-label { color: var(--text-secondary); }

/* ===== 生成結果コンテナ ===== */
.generation-result {
  border: 2px solid var(--success);
  border-radius: var(--radius-lg);
  padding: 20px;
  background: var(--success-bg);
  margin-top: 24px;
  display: none;
}

.generation-result.show { display: block; }

/* ===== タブ ===== */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
}

.tab {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tab:hover { color: var(--primary); }

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ===== セクション区切り ===== */
.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title i { color: var(--primary); font-size: 14px; }

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-light);
  margin-left: 8px;
}

/* ===== 空状態 ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
  display: block;
}

.empty-state-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state-desc {
  font-size: 13px;
  max-width: 300px;
  margin: 0 auto 20px;
  line-height: 1.6;
}

/* ===== ローディング ===== */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ===== 通知カード ===== */
.notification-item {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
}

.notification-item:hover { background: var(--bg-light); }
.notification-item:last-child { border-bottom: none; }

.notification-item.unread { background: var(--primary-bg); }

.notif-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.notif-content { flex: 1; }
.notif-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.notif-desc  { font-size: 12px; color: var(--text-muted); }
.notif-time  { font-size: 11px; color: var(--text-light); margin-top: 4px; }

/* ===== スマホ用 ===== */
.staff-mobile {
  min-height: 100vh;
  background: var(--bg-light);
  display: flex;
  flex-direction: column;
}

.mobile-header {
  background: var(--text-primary);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: white;
}

.mobile-logo i { color: #5eb3f5; }

.mobile-user {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
}

.mobile-nav {
  background: white;
  border-bottom: 1px solid var(--border);
  display: flex;
  box-shadow: var(--shadow-sm);
}

.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all var(--transition);
  border-bottom: 2px solid transparent;
}

.mobile-nav-item.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.mobile-nav-item i { font-size: 18px; }

.mobile-content {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
}

/* ===== 分析グラフエリア ===== */
.chart-container {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.chart-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 12px;
}

.chart-bar-label {
  width: 80px;
  color: var(--text-secondary);
  font-weight: 500;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-bar-track {
  flex: 1;
  height: 20px;
  background: var(--bg-gray);
  border-radius: 10px;
  overflow: hidden;
}

.chart-bar-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.8s ease;
  display: flex;
  align-items: center;
  padding-right: 8px;
  justify-content: flex-end;
  font-size: 10px;
  font-weight: 700;
  color: white;
}

.chart-bar-value {
  width: 50px;
  text-align: right;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ===== フィルター・検索エリア ===== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-input-wrap i {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
}

.search-input-wrap input {
  padding-left: 32px;
}

/* ===== 凡例 ===== */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ===== ページレイアウト ===== */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
}

.content-grid-wide {
  grid-template-columns: 1fr;
}

/* ===== 設定フォーム ===== */
.settings-section {
  margin-bottom: 32px;
}

.settings-divider {
  height: 1px;
  background: var(--border-light);
  margin: 24px 0;
}

/* ===== リスト ===== */
.info-list {
  list-style: none;
  padding: 0;
}

.info-list li {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}

.info-list li:last-child { border-bottom: none; }

.info-list .label { color: var(--text-muted); }
.info-list .value { font-weight: 600; color: var(--text-primary); }

/* ===== レスポンシブ ===== */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }

  .sidebar {
    transform: translateX(-240px);
    width: 240px;
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content { margin-left: 0; }

  .mobile-menu-btn { display: flex; }

  .page-content { padding: 16px; }

  .page-header { padding: 0 16px; }

  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }

  .form-row, .form-row-3 { grid-template-columns: 1fr; }

  .staff-grid { grid-template-columns: 1fr; }

  .modal-container { max-width: calc(100% - 32px); }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .page-title { font-size: 16px; }
}

/* ===== ドラッグ&ドロップ ===== */
.draggable {
  cursor: grab;
}

.draggable:active { cursor: grabbing; }

.drag-over {
  background: var(--primary-bg) !important;
  border: 2px dashed var(--primary) !important;
}

/* ===================================================
   時間帯ガントチャート（当日・明日シフト表）
=================================================== */

/* ページ全体のラッパー */
.gantt-page {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* 日付ナビゲーションバー */
.gantt-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: #eaf3ec;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border: 1px solid #c5dfc9;
  border-bottom: none;
}

.gantt-nav-arrow {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--primary);
  background: white;
  transition: all var(--transition);
}

.gantt-nav-arrow:hover {
  background: var(--primary-bg);
}

.gantt-nav-arrow.disabled {
  opacity: 0.4;
  pointer-events: none;
  border-color: var(--border);
  color: var(--text-muted);
}

.gantt-nav-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

/* テーブル外枠 */
.gantt-table-wrap {
  overflow-x: auto;
  border: 1px solid #c5dfc9;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: white;
  box-shadow: var(--shadow-card);
}

/* ガントチャートテーブル本体 */
.gantt-table {
  border-collapse: collapse;
  font-size: 12px;
  width: 100%;
  min-width: 860px;
  table-layout: fixed;
}

/* セクションラベルセル（ホール/キッチン） */
.gantt-section-cell {
  background: #f5f9f5;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  padding: 8px 10px;
  border: 1px solid #dde8de;
  text-align: center;
  vertical-align: middle;
  letter-spacing: 0.5px;
  position: sticky;
  left: 0;
  z-index: 3;
}

/* スタッフ名ヘッダー行の時間数字セル */
.gantt-time-header {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 4px 0;
  border: 1px solid #dde8de;
  background: #f8fbf8;
  vertical-align: bottom;
  white-space: nowrap;
}

/* 必要人数行 */
.gantt-req-header {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 0;
  border: 1px solid #dde8de;
  background: #eaf3ec;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* スタッフ名セル */
.gantt-name-cell {
  position: sticky;
  left: 0;
  z-index: 2;
  background: white;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  padding: 6px 10px;
  border: 1px solid #dde8de;
  white-space: nowrap;
  min-width: 100px;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.gantt-name-cell.veteran {
  color: var(--primary);
}

/* 30分単位セル */
.gantt-slot {
  border: 1px solid #eaf0ea;
  padding: 0;
  height: 32px;
  vertical-align: middle;
  position: relative;
}

/* シフトブロック（緑斜線・赤・黄色） */
.gantt-block {
  display: block;
  height: 26px;
  border-radius: 2px;
  cursor: pointer;
  transition: opacity 0.15s;
  position: relative;
  overflow: hidden;
}

.gantt-block:hover { opacity: 0.8; }

/* 出勤可能（緑 斜線ハッチング） */
.gantt-block.available {
  background-color: #c8e6c9;
  background-image: repeating-linear-gradient(
    -45deg,
    #6abf6a 0px,
    #6abf6a 2px,
    #c8e6c9 2px,
    #c8e6c9 7px
  );
  border: 1px solid #81c784;
}

/* 希望出勤（濃い緑 斜線） */
.gantt-block.preferred {
  background-color: #a5d6a7;
  background-image: repeating-linear-gradient(
    -45deg,
    #388e3c 0px,
    #388e3c 2px,
    #a5d6a7 2px,
    #a5d6a7 7px
  );
  border: 1px solid #66bb6a;
}

/* 確定シフト（緑 斜線） */
.gantt-block.confirmed {
  background-color: #b9e4bb;
  background-image: repeating-linear-gradient(
    -45deg,
    #4caf50 0px,
    #4caf50 2px,
    #b9e4bb 2px,
    #b9e4bb 7px
  );
  border: 1px solid #66bb6a;
}

/* ドラフトシフト（黄 斜線） */
.gantt-block.draft {
  background-color: #fff9c4;
  background-image: repeating-linear-gradient(
    -45deg,
    #f9a825 0px,
    #f9a825 2px,
    #fff9c4 2px,
    #fff9c4 7px
  );
  border: 1px solid #fbc02d;
}

/* 休み希望（ピンク/赤 塗りつぶし） */
.gantt-block.unavailable {
  background-color: #f8bbd0;
  border: 1px solid #e57373;
  cursor: default;
}

/* 時間限定（オレンジ斜線） */
.gantt-block.time-limited {
  background-color: #ffe0b2;
  background-image: repeating-linear-gradient(
    -45deg,
    #fb8c00 0px,
    #fb8c00 2px,
    #ffe0b2 2px,
    #ffe0b2 7px
  );
  border: 1px solid #ffb74d;
}

/* 時刻テキスト（ブロック内） */
.gantt-block-time {
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  font-weight: 700;
  color: rgba(0,0,0,0.55);
  pointer-events: none;
  white-space: nowrap;
}

/* 時間区切り（1時間ごとに太線） */
.gantt-slot.hour-start {
  border-left: 2px solid #c5dfc9;
}

/* 人数カウント行（下部） */
.gantt-count-row td {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 0;
  border: 1px solid #dde8de;
  background: #eaf3ec;
}

.gantt-count-ok   { color: var(--success); }
.gantt-count-warn { color: var(--warning); }
.gantt-count-ng   { color: var(--danger);  }

/* 現在時刻ライン */
.gantt-now-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--danger);
  z-index: 5;
  pointer-events: none;
}

.gantt-now-label {
  position: absolute;
  top: -16px;
  left: -14px;
  font-size: 9px;
  font-weight: 700;
  color: var(--danger);
  background: white;
  border: 1px solid var(--danger);
  border-radius: 3px;
  padding: 1px 3px;
}

/* セクション間区切り行 */
.gantt-section-divider td {
  height: 6px;
  background: #f0f5f0;
  border: none;
  padding: 0;
}

/* 凡例 */
.gantt-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid #c5dfc9;
  font-size: 11px;
  color: var(--text-secondary);
  background: #f5f9f5;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.gantt-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.gantt-legend-swatch {
  width: 24px;
  height: 14px;
  border-radius: 2px;
}

.gantt-legend-swatch.confirmed {
  background-color: #b9e4bb;
  background-image: repeating-linear-gradient(
    -45deg, #4caf50 0, #4caf50 2px, #b9e4bb 2px, #b9e4bb 7px
  );
  border: 1px solid #66bb6a;
}

.gantt-legend-swatch.draft {
  background-color: #fff9c4;
  background-image: repeating-linear-gradient(
    -45deg, #f9a825 0, #f9a825 2px, #fff9c4 2px, #fff9c4 7px
  );
  border: 1px solid #fbc02d;
}

.gantt-legend-swatch.unavailable {
  background: #f8bbd0;
  border: 1px solid #e57373;
}

.gantt-legend-swatch.empty {
  background: white;
  border: 1px solid #dde8de;
}

/* サマリーバー */
.gantt-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  background: white;
  border: 1px solid #c5dfc9;
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
}

.gantt-summary-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 16px;
  background: var(--bg-light);
  border-radius: var(--radius);
  min-width: 80px;
}

.gantt-summary-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.gantt-summary-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.gantt-summary-item.ok    .gantt-summary-value { color: var(--success); }
.gantt-summary-item.warn  .gantt-summary-value { color: var(--warning); }
.gantt-summary-item.ng    .gantt-summary-value { color: var(--danger);  }

/* ===== ユーティリティ ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-primary-color { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }

.fw-bold { font-weight: 700; }
.fw-600  { font-weight: 600; }

.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

.w-full { width: 100%; }

/* ===== 印刷スタイル ===== */
@media print {
  .sidebar, .page-header, .filter-bar, .btn, .modal-overlay, .modal-container, .toast-container { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .page-content { padding: 0 !important; }
  body { background: white !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; }
  .shift-table { font-size: 9px !important; }
  .shift-cell { padding: 1px 2px !important; font-size: 8px !important; }
}

/* ===== アクセシビリティ強化 ===== */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ===== アニメーション ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-content > * {
  animation: fadeIn 0.25s ease;
}

/* ===== スクロールバー ===== */
.page-content::-webkit-scrollbar { width: 6px; }
.page-content::-webkit-scrollbar-track { background: var(--bg-light); }
.page-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.page-content::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

/* ===== テーブルコンテナのスクロール ===== */
.shift-calendar::-webkit-scrollbar { height: 6px; }
.shift-calendar::-webkit-scrollbar-track { background: var(--bg-light); }
.shift-calendar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ===== 今日のハイライト ===== */
.today-card {
  border-left: 3px solid var(--primary) !important;
}

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

/* ===== form-input-sm ===== */
.form-input-sm {
  padding: 6px 8px;
  font-size: 13px;
}

/* ===== モバイルオーバーレイ ===== */
@media (max-width: 768px) {
  .sidebar.open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: -1;
  }
}
