/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --star-boss-eval: #10b981;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --accent: #0ea5e9;
  --grey-50: #f8fafc;
  --grey-100: #f1f5f9;
  --grey-200: #e2e8f0;
  --grey-300: #cbd5e1;
  --grey-400: #94a3b8;
  --grey-600: #475569;
  --grey-700: #334155;
  --grey-800: #1e293b;
  --star-self: #f59e0b;
  --star-boss: #3b82f6;
  --star-prev: #22c55e;
  --cell-grey: #d1d5db;
  --cell-valid: #ffffff;
  --cell-salary: #fef3c7;
  --success: #16a34a;
  --error: #dc2626;
  --radius: 12px;
  --radius-sm: 6px;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
  background: var(--grey-50);
  color: var(--grey-800);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: white; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-ghost { background: transparent; color: var(--grey-600); border: 1px solid var(--grey-300); }
.btn-ghost:hover { background: var(--grey-100); color: var(--grey-800); }
.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ── Alerts ────────────────────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 13px; }
.alert-error { background: #fee2e2; color: var(--error); border: 1px solid #fca5a5; }
.alert-success { background: #dcfce7; color: var(--success); border: 1px solid #86efac; }

/* ── Form Elements ─────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; color: var(--grey-700); font-size: 13px; }
.form-input, .form-select {
  width: 100%; padding: 10px 14px; border: 1px solid var(--grey-300);
  border-radius: var(--radius-sm); font-size: 14px; background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.form-input:focus, .form-select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(37 99 235 / 0.15);
}
.hint { margin-top: 6px; font-size: 12px; color: var(--grey-400); }
.input-sm { width: 100px; }

/* ── Page Header ───────────────────────────────────────────────────────────── */
.page-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 60%, #0ea5e9 100%);
  color: white; padding: 0 24px; box-shadow: var(--shadow);
}
.page-header--staff {
  background: linear-gradient(135deg, #EE859A 0%, #EEBFC0 100%);
}
.header-inner {
  max-width: 1100px; margin: 0 auto; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
}
.header-inner h1 { font-size: 18px; font-weight: 700; letter-spacing: 0.02em; }
.header-actions, .header-user { display: flex; align-items: center; gap: 12px; }
.user-name { font-size: 13px; opacity: 0.9; }

/* ── Login Page ────────────────────────────────────────────────────────────── */
.login-page {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 60%, #38bdf8 100%);
  display: flex; align-items: center; justify-content: center;
}
.login-container { width: 100%; max-width: 420px; padding: 24px; }
.login-card {
  background: white; border-radius: var(--radius); padding: 40px 36px;
  box-shadow: var(--shadow-lg);
}
.login-header { text-align: center; margin-bottom: 32px; }
.logo-icon { font-size: 48px; margin-bottom: 12px; }
.login-header h1 { font-size: 22px; font-weight: 700; color: var(--grey-800); margin-bottom: 6px; }
.subtitle { font-size: 13px; color: var(--grey-400); }
.login-form {}

/* ── Menu Page ─────────────────────────────────────────────────────────────── */
.menu-page { background: var(--grey-100); }
.menu-container { max-width: 700px; margin: 48px auto; padding: 0 24px; }
.welcome-text { text-align: center; margin-bottom: 32px; font-size: 16px; color: var(--grey-600); }
.welcome-text strong { color: var(--grey-800); }
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.menu-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 36px 24px; border-radius: var(--radius); background: white;
  text-decoration: none; color: inherit; box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s; border: 2px solid transparent;
}
.menu-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.menu-card-primary { border-color: var(--primary); }
.menu-card-primary { border-color: var(--primary); }
.menu-card-primary:hover { background: var(--primary-light); }
.menu-card-secondary:hover { background: var(--grey-50); border-color: var(--grey-300); }
.menu-card-eval { border-color: #0DB9B1; }
.menu-card-eval:hover { background: #E0F7F6; }
.menu-card-icon { font-size: 40px; margin-bottom: 12px; }
.menu-card-title { font-size: 18px; font-weight: 700; color: var(--grey-800); margin-bottom: 8px; }
.menu-card-desc { font-size: 13px; color: var(--grey-500); }

/* ── Matrix Page ───────────────────────────────────────────────────────────── */
.matrix-page { background: var(--grey-50); }
.matrix-page-container { max-width: 960px; margin: 0 auto; padding: 24px; }

.staff-selector {
  background: white; border-radius: var(--radius-sm); padding: 16px 20px;
  margin-bottom: 20px; box-shadow: var(--shadow); border: 1px solid var(--grey-200);
}
.selector-row { display: flex; align-items: center; gap: 12px; }
.selector-row label { font-weight: 600; color: var(--grey-700); white-space: nowrap; }
.selector-row .form-select { max-width: 280px; }

.matrix-subject-banner {
  display: flex; align-items: center; gap: 12px;
  background: white; border-radius: var(--radius-sm);
  padding: 14px 20px; margin-bottom: 16px;
  box-shadow: var(--shadow); border: 1px solid var(--grey-200);
}
.matrix-subject-label {
  font-size: 11px; font-weight: 700; color: var(--grey-400);
  text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap;
}
.matrix-subject-name {
  font-size: 20px; font-weight: 800; color: var(--grey-800); letter-spacing: -0.01em;
}

.score-summary {
  display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap;
}
.score-card {
  flex: 1; min-width: 180px; background: white; border-radius: var(--radius-sm);
  padding: 16px 18px; box-shadow: var(--shadow); border: 1px solid var(--grey-200);
}
.score-label {
  font-size: 11px; font-weight: 700; color: var(--grey-400);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 10px;
}
.score-main-row {
  display: flex; align-items: baseline; gap: 5px; margin-bottom: 4px;
}
.score-main {
  font-size: 20px; font-weight: 800; letter-spacing: -0.01em;
}
.self-color   { color: var(--star-self); }
.boss-color   { color: var(--star-boss); }
.neutral-color { color: var(--grey-700); }
.score-hint { font-size: 12px; color: var(--grey-400); font-weight: 400; }
.score-detail-line {
  font-size: 12px; color: var(--grey-500); margin-bottom: 6px;
}
.score-detail-line strong { color: var(--grey-800); }
.score-lv-cl {
  display: flex; align-items: center; gap: 8px; margin-top: 4px;
}
.score-lv-item {
  font-size: 16px; color: var(--grey-700);
}
.score-lv-item strong {
  font-size: 26px; font-weight: 800; letter-spacing: -0.02em; color: var(--grey-800);
}
.score-lv-sep {
  font-size: 18px; color: var(--grey-300); font-weight: 300;
}
.star.sm { font-size: 14px; }

/* ── Matrix Grid ───────────────────────────────────────────────────────────── */
.matrix-wrapper {
  display: flex; align-items: center; gap: 8px; margin-bottom: 20px;
  background: white; border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow); border: 1px solid var(--grey-200);
  overflow-x: auto;
}
.y-axis-label {
  writing-mode: vertical-lr; text-orientation: mixed;
  font-size: 12px; font-weight: 700; color: var(--grey-500);
  letter-spacing: 0.1em; min-width: 20px;
  white-space: nowrap;
}
.matrix-area { flex: 1; min-width: 0; }

.salary-badge {
  text-align: right; font-size: 11px; font-weight: 700;
  color: #92400e; margin-bottom: 6px; padding-right: 4px;
}

.matrix-grid { display: table; width: 100%; border-collapse: separate; border-spacing: 3px; }
.matrix-row { display: table-row; }

.row-label-cell {
  display: table-cell; width: 60px; min-width: 52px;
  vertical-align: middle; padding-right: 8px; text-align: right;
}
.stage-label { font-size: 11px; font-weight: 700; color: var(--grey-600); display: block; }
.level-label { font-size: 10px; color: var(--grey-400); display: block; }

.header-row .row-label-cell {}
.col-header {
  display: table-cell; text-align: center; font-size: 10px;
  font-weight: 700; color: var(--grey-500); padding-bottom: 6px;
  white-space: normal; word-break: keep-all; line-height: 1.4;
  width: 64px; max-width: 64px;
}

.matrix-cell {
  display: table-cell; width: 64px; height: 42px;
  border-radius: 4px; text-align: center; vertical-align: middle;
  position: relative; transition: transform 0.1s;
}
.matrix-cell:hover { transform: scale(1.05); z-index: 1; }

.cell-valid { background: var(--cell-valid); border: 1px solid var(--grey-200); }
.cell-grey { background: var(--cell-grey); border: 1px solid #b0b7c0; }
.cell-salary { background: var(--cell-salary); border: 1px solid #fcd34d; }
.cell-has-star { border-width: 2px !important; }

.start-row .row-label-cell {
  font-size: 11px; font-weight: 700; color: var(--grey-400);
  text-align: right; padding-right: 8px;
}
.start-cell {
  display: table-cell; background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  border-radius: 4px; text-align: center; vertical-align: middle;
  border: 1px solid var(--primary-light); height: 32px;
}
.start-text { font-size: 12px; font-weight: 700; color: var(--primary); letter-spacing: 0.05em; }

.x-axis-label {
  text-align: center; margin-top: 10px;
  font-size: 12px; font-weight: 700; color: var(--grey-500); letter-spacing: 0.1em;
}

/* ── Stars ─────────────────────────────────────────────────────────────────── */
.star {
  font-size: 22px; line-height: 1; display: inline-block;
  filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.2));
}
.star-self      { color: var(--star-self); }
.star-boss      { color: var(--star-boss); }
.star-prev      { color: var(--star-prev); }
.star-boss-eval { color: var(--star-boss-eval); }

/* ── Legend ────────────────────────────────────────────────────────────────── */
.legend {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
  background: white; border-radius: var(--radius-sm); padding: 16px 20px;
  box-shadow: var(--shadow); border: 1px solid var(--grey-200); margin-bottom: 16px;
}
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--grey-600); }
.legend-pos { font-size: 12px; color: var(--grey-400); margin-left: 4px; }
.legend-pos em { font-style: normal; color: #e67e22; }

.cell-sample {
  display: inline-block; width: 20px; height: 14px; border-radius: 3px;
}
.cell-sample.cell-valid { background: white; border: 1px solid var(--grey-300); }
.cell-sample.cell-grey-sample { background: var(--cell-grey); border: 1px solid #b0b7c0; }
.cell-sample.cell-salary-sample { background: var(--cell-salary); border: 1px solid #fcd34d; }

.no-data-notice {
  background: #fff7ed; border: 1px solid #fed7aa; border-radius: var(--radius-sm);
  padding: 16px 20px; color: #c2410c;
}
.no-data-notice code { background: var(--grey-100); padding: 2px 6px; border-radius: 3px; font-size: 12px; }

/* ── Settings Page ─────────────────────────────────────────────────────────── */
.settings-container { max-width: 800px; margin: 0 auto; padding: 32px 24px; }
.section-title { font-size: 20px; font-weight: 700; margin-bottom: 24px; color: var(--grey-800); }
.settings-card {
  background: white; border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow); border: 1px solid var(--grey-200); margin-bottom: 20px;
}
.settings-card h3 { font-size: 15px; font-weight: 700; color: var(--grey-800); margin-bottom: 10px; }
.settings-desc { font-size: 13px; color: var(--grey-600); margin-bottom: 16px; line-height: 1.7; }
.settings-note { font-size: 12px; color: var(--grey-400); margin-top: 12px; }
.settings-list { padding-left: 20px; font-size: 13px; color: var(--grey-600); line-height: 1.9; }
.threshold-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.threshold-item label { font-size: 12px; font-weight: 600; color: var(--grey-600); margin-bottom: 4px; display: block; }
.settings-actions { display: flex; gap: 12px; padding-top: 8px; }

/* Valid cells display table */
.valid-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.valid-table th { background: var(--grey-100); padding: 8px 10px; text-align: center; font-weight: 600; border: 1px solid var(--grey-200); }
.valid-table td { padding: 7px 10px; text-align: center; border: 1px solid var(--grey-200); }
.valid-cell-indicator.is-valid { background: white; color: var(--success); font-weight: 700; }
.valid-cell-indicator.is-grey { background: var(--cell-grey); color: var(--grey-400); }
.valid-table-wrap { overflow-x: auto; }

/* legend sample cell */
.cell-valid-sample { background: white; border: 1px solid var(--grey-300); }

/* settings dimension inputs */
.dimension-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dimension-item label { display: block; margin-bottom: 6px; font-weight: 600; color: var(--grey-700); font-size: 13px; }
.dim-input-row { display: flex; align-items: center; gap: 8px; }
.dim-unit { font-size: 13px; color: var(--grey-600); }
.input-md { width: 80px; }

/* info table in settings */
.info-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.info-table th { width: 160px; background: var(--grey-50); padding: 10px 12px; text-align: left; font-weight: 600; border: 1px solid var(--grey-200); vertical-align: top; color: var(--grey-700); }
.info-table td { padding: 10px 12px; border: 1px solid var(--grey-200); color: var(--grey-600); line-height: 1.7; }

/* ── Print Styles ──────────────────────────────────────────────────────────── */
.print-only { display: none; }

@media print {
  .no-print { display: none !important; }
  .print-only { display: block; }

  body { background: white; font-size: 12px; }
  .matrix-page-container { padding: 0; max-width: 100%; }
  .matrix-wrapper {
    box-shadow: none; border: 1px solid var(--grey-300);
    break-inside: avoid; padding: 16px;
  }
  .legend {
    box-shadow: none; border: 1px solid var(--grey-300);
    break-inside: avoid;
  }
  .print-header { margin-bottom: 16px; }
  .print-header h2 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
  .matrix-cell { height: 38px; }
  .star { font-size: 18px; }
}

/* ── Eval Form ─────────────────────────────────────────────────────────────── */
:root {
  --eval-teal:       #0DB9B1;
  --eval-teal-dark:  #0AA09A;
  --eval-teal-mid:   #6DD5D0;
  --eval-teal-light: #E0F7F6;
}

.eval-page { background: var(--grey-100); }
.eval-container { max-width: 800px; margin: 0 auto; padding: 32px 24px; }

/* Stepper */
.eval-stepper { display: flex; margin-bottom: 28px; gap: 2px; }
.stepper-step {
  flex: 1; padding: 9px 4px; background: var(--grey-200); color: var(--grey-400);
  font-size: 11px; font-weight: 600; text-align: center;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%);
}
.stepper-step:first-child {
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%);
}
.stepper-step:last-child {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 10px 50%);
}
.stepper-step.active    { background: var(--eval-teal);     color: white; }
.stepper-step.completed { background: var(--eval-teal-mid); color: white; }

/* Job Selector */
.eval-section-header { margin-bottom: 24px; }
.eval-section-header h2 { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.eval-section-header p  { color: var(--grey-600); }
.eval-job-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.eval-job-card {
  display: block; background: white; border: 2px solid var(--grey-200);
  border-radius: var(--radius); padding: 28px 16px; text-align: center;
  text-decoration: none; color: var(--grey-800); font-weight: 700; font-size: 16px;
  transition: all 0.15s;
}
.eval-job-card:hover {
  border-color: var(--eval-teal); background: var(--eval-teal-light);
  color: var(--eval-teal-dark); transform: translateY(-2px); box-shadow: var(--shadow);
}

/* Question Card */
.eval-question-card {
  background: white; border-radius: var(--radius); padding: 20px 24px;
  margin-bottom: 12px; border: 1px solid var(--grey-200);
}
.eval-q-text {
  font-size: 14px; font-weight: 600; color: var(--grey-800);
  margin-bottom: 14px; line-height: 1.7; white-space: pre-line;
}
.eval-empty-section {
  background: white; border-radius: var(--radius); padding: 40px;
  text-align: center; color: var(--grey-400); border: 1px dashed var(--grey-300);
  margin-bottom: 16px;
}

/* Radio */
.eval-radio-group { display: flex; flex-direction: column; gap: 6px; }
.eval-radio-label {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 9px 12px; border-radius: var(--radius-sm); border: 1px solid var(--grey-200);
  font-size: 13px; transition: all 0.12s; user-select: none;
}
.eval-radio-label:hover { background: var(--eval-teal-light); border-color: var(--eval-teal); }
.eval-radio-label input[type="radio"] { accent-color: var(--eval-teal); width: 15px; height: 15px; flex-shrink: 0; }
.eval-radio-label:has(input:checked) { background: var(--eval-teal-light); border-color: var(--eval-teal); }
.eval-radio-label:has(input:checked) span { color: var(--eval-teal-dark); font-weight: 600; }

/* Textarea */
.eval-textarea { resize: vertical; min-height: 120px; }

/* Nav */
.eval-nav-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--grey-200);
}
.btn-eval { background: var(--eval-teal); color: white; padding: 12px 32px; font-size: 15px; }
.btn-eval:hover { background: var(--eval-teal-dark); color: white; }

/* Done Screen */
.eval-done-card {
  background: white; border-radius: var(--radius); padding: 56px 32px;
  text-align: center; border: 1px solid var(--grey-200); box-shadow: var(--shadow);
}
.eval-done-icon {
  width: 64px; height: 64px; background: var(--eval-teal); color: white;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; margin: 0 auto 20px;
}
.eval-done-title { font-size: 22px; font-weight: 700; color: var(--grey-800); margin-bottom: 16px; }
.eval-done-msg   { color: var(--grey-600); line-height: 1.9; margin-bottom: 8px; }
.eval-done-sub   { color: var(--grey-400); font-size: 13px; }

/* ── Eval Hub Page ─────────────────────────────────────────────────────────── */
.hub-header { text-align: center; margin-bottom: 28px; }
.hub-header h2 { font-size: 22px; font-weight: 700; color: var(--grey-800); margin-bottom: 4px; }
.hub-subtitle { color: var(--grey-500); font-size: 14px; font-weight: 600; }

.hub-notice {
  border-radius: var(--radius-sm); padding: 10px 16px;
  font-size: 13px; margin-bottom: 20px;
}
.hub-notice-warn { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }

.hub-tasks {
  background: white; border-radius: var(--radius); border: 1px solid var(--grey-200);
  box-shadow: var(--shadow); overflow: hidden; margin-bottom: 24px;
}
.hub-task {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--grey-100);
  gap: 16px;
}
.hub-task:last-child { border-bottom: none; }
.hub-task-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.hub-task-icon { font-size: 22px; flex-shrink: 0; }
.hub-task-info { display: flex; flex-direction: column; gap: 2px; }
.hub-task-name { font-size: 16px; font-weight: 700; color: var(--grey-800); }
.hub-task-desc { font-size: 13px; color: var(--grey-500); }
.hub-task-na   { font-size: 13px; color: var(--grey-400); font-style: italic; }
.hub-task-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.hub-badge {
  font-size: 12px; font-weight: 700; padding: 3px 10px;
  border-radius: 99px; white-space: nowrap;
}
.badge-done    { background: #dcfce7; color: #15803d; }
.badge-pending { background: #fef9c3; color: #a16207; }
.badge-na      { background: var(--grey-100); color: var(--grey-400); }

/* Validation Dialog */
.eval-dialog-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.eval-dialog {
  background: white; border-radius: var(--radius); padding: 36px 32px;
  text-align: center; max-width: 400px; width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.eval-dialog-icon  { font-size: 40px; margin-bottom: 12px; }
.eval-dialog-title { font-size: 18px; font-weight: 700; color: var(--grey-800); margin-bottom: 10px; }
.eval-dialog-msg   { font-size: 14px; color: var(--grey-600); line-height: 1.7; margin-bottom: 24px; }

.eval-target-banner {
  background: #eff6ff; border: 1px solid #bfdbfe; border-radius: var(--radius-sm);
  padding: 10px 16px; margin-bottom: 20px; font-size: 14px; color: #1d4ed8;
}

/* ── Draft Restore Banner ──────────────────────────────────────────────────── */
.draft-restore-bar {
  background: #fefce8; border: 1px solid #fde047; border-radius: var(--radius-sm);
  padding: 12px 16px; margin-bottom: 20px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.draft-restore-msg {
  font-size: 13px; color: #713f12; line-height: 1.5; flex: 1;
}
.draft-restore-msg strong { color: #92400e; }
.draft-restore-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn-draft-restore {
  background: #f59e0b; color: white; border: none; border-radius: var(--radius-sm);
  padding: 6px 14px; font-size: 13px; font-weight: 700; cursor: pointer;
  white-space: nowrap;
}
.btn-draft-restore:hover { background: #d97706; }
.btn-draft-dismiss {
  background: transparent; color: #92400e; border: 1px solid #fcd34d;
  border-radius: var(--radius-sm); padding: 6px 14px; font-size: 13px;
  font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn-draft-dismiss:hover { background: #fef3c7; }
.draft-saved-indicator {
  position: fixed; bottom: 20px; right: 20px;
  background: #1e293b; color: white; border-radius: var(--radius-sm);
  padding: 8px 14px; font-size: 12px; opacity: 0;
  transition: opacity 0.3s; pointer-events: none; z-index: 100;
}
.hub-back { display: flex; justify-content: center; }

/* ── Radar Chart Page ──────────────────────────────────────────────────────── */
.menu-card-radar {
  background: linear-gradient(135deg, #EE859A 0%, #EEBFC0 100%);
  color: white;
}
.menu-card-radar .menu-card-desc { color: rgba(255,255,255,0.85); }
.menu-card-radar:hover { opacity: 0.9; }

.radar-page { background: var(--grey-50); }
.radar-container {
  max-width: 1200px; margin: 40px auto; padding: 0 20px 60px;
}
.radar-header { text-align: center; margin-bottom: 20px; }
.radar-header h2 { font-size: 22px; font-weight: 700; color: var(--grey-800); margin-bottom: 6px; }
.radar-subtitle { color: var(--grey-500); font-size: 13px; margin-bottom: 16px; }

/* 2カラムレイアウト */
.radar-dual-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .radar-dual-layout { grid-template-columns: 1fr; }
}

.radar-panel {}
.radar-panel-heading {
  font-size: 15px; font-weight: 700; color: var(--grey-700);
  margin-bottom: 4px;
}

.radar-card {
  background: white; border-radius: var(--radius); border: 1px solid var(--grey-200);
  box-shadow: var(--shadow); padding: 24px 20px 20px;
}
.radar-job-badge {
  display: inline-block; background: #ede9fe; color: #6d28d9;
  font-size: 12px; font-weight: 600; padding: 3px 12px;
  border-radius: 99px; margin-bottom: 16px;
}
.radar-job-badge-360 {
  background: #d1fae5; color: #065f46;
}
.radar-chart-wrap {
  display: flex; justify-content: center; margin-bottom: 16px;
}
.radar-chart-wrap canvas { max-width: 100%; }

.radar-legend {
  display: flex; gap: 20px; justify-content: center;
  margin-bottom: 16px; font-size: 13px;
}
.radar-legend-self  { color: #3b82f6; font-weight: 600; }
.radar-legend-other { color: #f97316; font-weight: 600; }
.radar-legend-na    { color: var(--grey-400); }
.radar-legend-360   { color: #10b981; font-weight: 600; }

.radar-score-table { border-top: 1px solid var(--grey-200); padding-top: 14px; }
.radar-score-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.radar-score-table th {
  text-align: left; padding: 7px 10px; color: var(--grey-500);
  font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--grey-200);
}
.radar-score-table td { padding: 8px 10px; border-bottom: 1px solid var(--grey-100); color: var(--grey-700); }
.radar-score-table .score-val        { font-weight: 700; color: #3b82f6; text-align: right; }
.radar-score-table .score-val-other  { color: #f97316; }
.radar-score-table .score-val-360    { color: #10b981; }
.radar-sample-badge {
  display: inline-block; background: #fff7ed; color: #c2410c;
  font-size: 10px; font-weight: 700; padding: 1px 6px;
  border-radius: 4px; border: 1px solid #fed7aa; vertical-align: middle; margin-left: 4px;
}
.radar-sample-notice {
  text-align: center; font-size: 12px; color: #c2410c;
  background: #fff7ed; border: 1px solid #fed7aa;
  border-radius: 6px; padding: 6px 12px; margin-bottom: 16px;
}

.radar-empty {
  background: white; border-radius: var(--radius); border: 1px solid var(--grey-200);
  box-shadow: var(--shadow); padding: 48px 24px; text-align: center; color: var(--grey-500);
}
.radar-viewed-banner {
  display: inline-block; background: #ede9fe; color: #6d28d9;
  font-size: 13px; padding: 4px 14px; border-radius: 99px; margin-top: 6px;
}
/* 期ナビゲーションバー */
.period-nav-bar {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; margin-bottom: 20px;
  background: white; border: 1px solid var(--grey-200);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 24px;
}
.period-nav-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  font-size: 16px; font-weight: 700; text-decoration: none;
  background: var(--primary-light); color: var(--primary);
  border: 1.5px solid var(--primary); transition: all 0.15s;
}
.period-nav-btn:hover { background: var(--primary); color: white; }
.period-nav-btn.disabled {
  background: var(--grey-100); color: var(--grey-300);
  border-color: var(--grey-200); cursor: not-allowed; pointer-events: none;
}
.period-nav-label {
  font-size: 18px; font-weight: 700; color: var(--grey-800);
  min-width: 140px; text-align: center; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.period-nav-badge {
  font-size: 11px; font-weight: 700; padding: 2px 8px;
  background: var(--primary); color: white; border-radius: 10px;
  vertical-align: middle;
}

.radar-nav { margin-top: 24px; display: flex; justify-content: center; }

/* ── Eval Detail Section ───────────────────────────────────────────────────── */
.eval-detail-section {
  background: white; border: 1px solid var(--grey-200);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 24px 28px; margin-top: 28px;
}
.eval-detail-heading {
  font-size: 15px; font-weight: 700; color: var(--grey-800);
  border-left: 4px solid var(--primary); padding-left: 12px;
  margin-bottom: 18px;
}
.eval-detail-tbl-wrap { overflow-x: auto; }
.eval-detail-tbl {
  width: 100%; border-collapse: collapse; font-size: 12px;
}
.eval-detail-tbl th {
  background: var(--grey-100); color: var(--grey-600);
  font-weight: 700; padding: 8px 10px;
  border-bottom: 2px solid var(--grey-200); text-align: center; white-space: nowrap;
}
.eval-detail-tbl td { padding: 7px 10px; border-bottom: 1px solid var(--grey-100); vertical-align: middle; }
.edt-cat  { width: 110px; }
.edt-q    { text-align: left; }
.edt-score { width: 72px; }
.edt-avg  { width: 50px; }
.edt-dist { width: 36px; }
.edt-cat-cell {
  font-size: 11px; font-weight: 600; color: var(--grey-500);
  white-space: nowrap; vertical-align: top; padding-top: 10px;
}
.edt-q-cell { color: var(--grey-700); line-height: 1.5; }
.edt-score-cell, .edt-avg-cell { text-align: center; font-weight: 700; }
.edt-avg-cell { color: var(--primary); font-size: 13px; }
.edt-na { color: var(--grey-300); }
/* スコアバッジ（1-5色分け）*/
.edt-score-badge {
  display: inline-block; min-width: 28px; padding: 2px 6px;
  border-radius: 4px; font-size: 13px; font-weight: 700; text-align: center;
}
.edt-s1 { background: #fee2e2; color: #991b1b; }
.edt-s2 { background: #fef3c7; color: #92400e; }
.edt-s3 { background: var(--grey-100); color: var(--grey-600); }
.edt-s4 { background: #d1fae5; color: #065f46; }
.edt-s5 { background: #a7f3d0; color: #064e3b; }
/* 得票分布セル（PC用） */
.edt-dist-cell {
  text-align: center; font-size: 11px; font-weight: 600;
  color: var(--grey-300); border-left: 1px solid var(--grey-100);
}
.edt-dist-cell.has-vote { color: var(--grey-700); }
/* モバイル用横並びバッジ（PC では非表示） */
.edt-dist-mobile { display: none; }
.edt-dmob {
  display: inline-flex; flex-direction: column; align-items: center;
  min-width: 34px; padding: 3px 5px; border-radius: 5px;
  background: var(--grey-100); color: var(--grey-400);
}
.edt-dmob.has-vote { color: var(--grey-700); }
.edt-dmob.edt-d1.has-vote { background: #fff5f5; color: #991b1b; }
.edt-dmob.edt-d2.has-vote { background: #fffbeb; color: #92400e; }
.edt-dmob.edt-d3.has-vote { background: var(--grey-50);  color: var(--grey-600); }
.edt-dmob.edt-d4.has-vote { background: #f0fdf4; color: #065f46; }
.edt-dmob.edt-d5.has-vote { background: #dcfce7; color: #064e3b; }
.edt-dmob-lbl { font-size: 9px; font-weight: 400; line-height: 1.2; }
.edt-dmob-val { font-size: 13px; font-weight: 700; line-height: 1.3; }
.edt-d1.has-vote { background: #fff5f5; color: #991b1b; }
.edt-d2.has-vote { background: #fffbeb; color: #92400e; }
.edt-d3.has-vote { background: var(--grey-50); color: var(--grey-600); }
.edt-d4.has-vote { background: #f0fdf4; color: #065f46; }
.edt-d5.has-vote { background: #dcfce7; color: #064e3b; }
/* 自由記述エリア */
.eval-text-section { margin-top: 22px; }
.eval-text-section-title {
  font-size: 12px; font-weight: 700; color: var(--grey-600);
  margin-bottom: 10px; padding-bottom: 6px;
  border-bottom: 1px solid var(--grey-200);
}
.eval-text-group { margin-bottom: 14px; }
.eval-text-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--grey-50); border: 1px solid var(--grey-200);
  margin-bottom: 8px; font-size: 13px; line-height: 1.7;
}
.eval-text-label {
  font-size: 10px; font-weight: 700; white-space: nowrap;
  padding: 2px 8px; border-radius: 3px; margin-top: 2px;
}
.eval-text-label.self { background: #dbeafe; color: #1e40af; }
.eval-text-label.boss { background: #ffedd5; color: #9a3412; }
.eval-text-body { color: var(--grey-700); flex: 1; }
/* 360テキスト */
.eval-360-text-group { margin-bottom: 20px; }
.eval-360-responses {
  list-style: none; display: flex; flex-direction: column; gap: 6px;
}
.eval-360-responses li {
  padding: 9px 14px; background: #f0fdf4;
  border: 1px solid #bbf7d0; border-radius: var(--radius-sm);
  font-size: 13px; color: var(--grey-700); line-height: 1.6;
}
.eval-360-responses li::before { content: '💬 '; }

/* ── Admin Pages ───────────────────────────────────────────────────────────── */
:root { --admin-accent: #1e293b; --admin-accent-light: #f1f5f9; --admin-green: #10b981; --admin-red: #ef4444; }

.menu-card-admin { background: #fdf8f0; border-color: #e8d0a8; }
.menu-card-admin:hover { background: #faefd8; opacity: 1; }

.admin-badge-owner { font-weight: 600; }
.admin-badge-admin { font-weight: 600; color: #dbeafe; }
.admin-page { background: var(--grey-50); }
.admin-container { max-width: 1100px; margin: 0 auto; padding: 32px 20px 60px; }
.admin-page-header { margin-bottom: 24px; }
.admin-breadcrumb { font-size: 13px; color: var(--grey-500); text-decoration: none; display: inline-block; margin-bottom: 8px; }
.admin-breadcrumb:hover { color: var(--grey-700); }
.admin-page-header h2 { font-size: 22px; font-weight: 700; color: var(--grey-800); margin-bottom: 4px; }
.admin-page-subtitle { font-size: 13px; color: var(--grey-500); }

.admin-saved-notice { background: #dcfce7; color: #15803d; border: 1px solid #86efac; border-radius: var(--radius-sm); padding: 10px 16px; font-size: 13px; margin-bottom: 20px; }

.admin-menu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 32px; }
.admin-menu-card { background: white; border: 1px solid var(--grey-200); border-radius: var(--radius); padding: 28px 24px; text-decoration: none; color: var(--grey-800); box-shadow: var(--shadow); transition: box-shadow 0.15s, transform 0.15s; display: block; }
.admin-menu-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.12); transform: translateY(-2px); }
.admin-menu-icon { font-size: 32px; margin-bottom: 12px; }
.admin-menu-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.admin-menu-desc { font-size: 13px; color: var(--grey-500); line-height: 1.6; }
.admin-back { display: flex; }

.admin-card { background: white; border: 1px solid var(--grey-200); border-radius: var(--radius); padding: 20px 20px 16px; box-shadow: var(--shadow); margin-bottom: 16px; }
.admin-card-title { font-size: 13px; font-weight: 600; color: var(--grey-500); margin-bottom: 14px; }
.admin-action-bar { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.btn-admin { background: var(--admin-accent); color: white; padding: 9px 20px; font-size: 13px; }
.btn-admin:hover { background: #0f172a; color: white; }

/* 給与テーブル */
.admin-salary-layout { display: grid; grid-template-columns: 1fr 280px; gap: 16px; align-items: start; }
.salary-tbl-wrap { overflow-x: auto; }
.salary-tbl { border-collapse: collapse; font-size: 12px; width: 100%; }
.salary-tbl th, .salary-tbl td { border: 0.5px solid var(--grey-200); padding: 0; }
.salary-tbl th { background: var(--grey-50); color: var(--grey-500); font-size: 11px; font-weight: 600; text-align: center; padding: 5px 6px; white-space: nowrap; }
.cls-sub { font-weight: 400; font-size: 10px; color: var(--grey-400); }
.lvl-header { background: var(--grey-50); font-size: 11px; font-weight: 600; color: var(--grey-500); text-align: center; padding: 5px 8px; }
.salary-input { width: 64px; border: none; background: transparent; font-size: 12px; text-align: right; padding: 5px 6px; outline: none; color: var(--grey-700); }
.salary-input:focus { background: #eff6ff; color: #1d4ed8; }
.salary-cell.active-cell { background: #dcfce7 !important; }
.salary-cell.active-cell .salary-input { color: #065f46; font-weight: 700; }
.salary-cell.capped-cell { background: #fef2f2; }
.salary-cell.capped-cell .salary-input { color: #991b1b; }
.salary-legend { display: flex; gap: 16px; margin-top: 10px; font-size: 11px; color: var(--grey-500); flex-wrap: wrap; }
.sal-leg { display: flex; align-items: center; gap: 5px; }
.sal-leg-box { width: 12px; height: 12px; border-radius: 2px; }
.active-cell-color { background: #dcfce7; border: 1px solid #6ee7b7; }
.capped-cell-color  { background: #fef2f2; border: 1px solid #fca5a5; }

/* シミュレーター */
.sim-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.sim-sel label { font-size: 12px; color: var(--grey-500); display: block; margin-bottom: 4px; }
.sim-sel select { width: 100%; font-size: 13px; }
.sim-result { background: var(--grey-50); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 12px; }
.sim-result-label { font-size: 11px; color: var(--grey-500); margin-bottom: 2px; }
.sim-result-val { font-size: 24px; font-weight: 700; color: var(--grey-800); }
.sim-result-note { font-size: 11px; color: var(--grey-500); margin-top: 4px; line-height: 1.5; }
.cap-badge { display: inline-block; background: #fef2f2; color: #991b1b; font-size: 11px; padding: 2px 8px; border-radius: 4px; margin-top: 6px; }
.ok-badge  { display: inline-block; background: #dcfce7; color: #065f46; font-size: 11px; padding: 2px 8px; border-radius: 4px; margin-top: 6px; }
.sim-eff-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--grey-500); margin-bottom: 14px; }
.sim-eff-val { font-size: 15px; font-weight: 700; color: var(--grey-800); }
.sim-eff-hint { font-size: 10px; color: var(--grey-400); }
.sim-rule { background: #eff6ff; border-radius: var(--radius-sm); padding: 12px; }
.sim-rule-title { font-size: 11px; font-weight: 700; color: #1e40af; margin-bottom: 6px; }
.sim-rule-item { font-size: 11px; color: #1e40af; margin-bottom: 3px; }

/* ポジション設定 */
.pos-staff-selector { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 14px 20px; }
.pos-sel-label { font-size: 14px; font-weight: 600; color: var(--grey-700); white-space: nowrap; }
.pos-main-grid { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
.pos-left { display: flex; flex-direction: column; gap: 16px; }
.pos-right { display: flex; flex-direction: column; }

.pos-map-wrap { overflow-x: auto; }
.pos-map-tbl { border-collapse: collapse; font-size: 11px; width: 100%; }
.pos-map-tbl th { background: var(--grey-50); color: var(--grey-500); font-size: 9px; font-weight: 600; text-align: center; padding: 4px 3px; border: 0.5px solid var(--grey-200); white-space: normal; word-break: keep-all; line-height: 1.4; max-width: 52px; }
.pos-stage-label { background: var(--grey-50); font-size: 10px; font-weight: 600; color: var(--grey-500); text-align: center; padding: 4px 6px; border: 0.5px solid var(--grey-200); white-space: nowrap; }
.pos-map-cell { border: 0.5px solid var(--grey-200); text-align: center; padding: 3px 2px; font-size: 12px; background: white; min-width: 34px; line-height: 1.2; }
.pos-map-cell.pos-active   { background: #dcfce7; border: 1.5px solid #10b981; }
.pos-map-cell.pos-prev     { background: #f5f3ff; border: 1.5px solid #7c3aed; }
.pos-map-cell.pos-proposed { background: #fff7ed; border: 1.5px solid #f97316; }
.pos-map-cell.pos-invalid  { background: var(--grey-200); cursor: not-allowed !important; }
.pos-cell-marker { display: block; font-size: 11px; font-weight: 700; min-height: 13px; color: #065f46; }
.pos-proposed .pos-cell-marker { color: #f97316; }
.pos-cell-prev-marker { display: block; font-size: 11px; font-weight: 700; min-height: 13px; color: #7c3aed; }
.pos-cell-sal    { display: block; font-size: 9px; color: var(--grey-500); }
.pos-active   .pos-cell-sal { color: #065f46; font-weight: 600; }
.pos-proposed .pos-cell-sal { color: #c2410c; font-weight: 600; }
.pos-invalid  .pos-cell-sal { opacity: 0.4; }

/* 給与テーブルの無効セル */
.salary-cell-invalid { background: var(--cell-grey) !important; }
.salary-cell-invalid .salary-input { background: transparent; color: var(--grey-400); text-align: center; }
.pos-cls-cell { border: 0.5px solid var(--grey-200); text-align: center; padding: 5px 3px; font-size: 10px; background: white; color: var(--grey-500); }
.pos-cls-cell.pos-cls-active { background: #dbeafe; color: #1e40af; font-weight: 700; border: 1.5px solid #3b82f6; }
.pos-map-legend { display: flex; gap: 14px; margin-top: 8px; font-size: 11px; color: var(--grey-500); }
.pos-leg { display: flex; align-items: center; gap: 5px; }
.pos-leg-dot { width: 10px; height: 10px; border-radius: 2px; }
.pos-leg-dot.active { background: #dcfce7; border: 1.5px solid #10b981; }
.pos-leg-dot.cls    { background: #dbeafe; border: 1.5px solid #3b82f6; }

/* Stage/Level 行ラベルのハイライト */
.pos-row-stage { background: #fef3c7; }
.pos-row-stage .pos-sl-s { color: #92400e; font-weight: 700; }
.pos-row-level { background: #dbeafe; }
.pos-row-level .pos-sl-l { color: #1e40af; font-weight: 700; }
.pos-row-both  { background: linear-gradient(to right, #fef3c7 50%, #dbeafe 50%); }
.pos-row-both .pos-sl-s { color: #92400e; font-weight: 700; }
.pos-row-both .pos-sl-l { color: #1e40af; font-weight: 700; }

.pos-sl-s { display: block; font-size: 10px; font-weight: 600; color: var(--grey-600); }
.pos-sl-l { display: block; font-size: 9px;  color: var(--grey-400); }

.pos-input-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.pos-input-group label { font-size: 12px; font-weight: 600; color: var(--grey-600); display: block; margin-bottom: 5px; }
.pos-input-hint { font-size: 10px; font-weight: 400; color: var(--grey-400); }
.pos-input-group select { width: 100%; font-size: 13px; }

/* 評価スコア */
.eval-tab-bar { display: flex; border-bottom: 1px solid var(--grey-200); margin-bottom: 14px; }
.eval-tab-btn { padding: 7px 14px; font-size: 12px; background: none; border: none; border-bottom: 2px solid transparent; color: var(--grey-500); cursor: pointer; }
.eval-tab-btn.active { color: var(--grey-800); border-bottom-color: var(--grey-800); font-weight: 600; }
.eval-score-panel { display: none; }
.eval-score-panel.active { display: block; }
.eval-no-data { font-size: 12px; color: var(--grey-400); text-align: center; padding: 20px 0; }
.score-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.score-cat { font-size: 12px; color: var(--grey-600); width: 130px; flex-shrink: 0; }
.score-bar-outer { flex: 1; height: 6px; background: var(--grey-100); border-radius: 3px; overflow: hidden; }
.score-bar-inner { height: 100%; border-radius: 3px; transition: width 0.3s; }
.score-num { font-size: 12px; font-weight: 700; width: 28px; text-align: right; flex-shrink: 0; }

/* ── 360 Eval Hub ──────────────────────────────────────────────────────────── */
.e360-status-bar {
  background: white; border: 1px solid var(--grey-200);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 20px; margin-bottom: 20px;
}
.e360-progress-label {
  font-size: 13px; color: var(--grey-600); margin-bottom: 12px;
}
.e360-progress-label strong { color: var(--grey-800); font-size: 16px; }
.e360-all-done { color: var(--success); font-weight: 700; font-size: 14px; }

.e360-chips-row {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.e360-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 99px; font-size: 12px;
  border: 1.5px solid; white-space: nowrap;
}
.e360-chip-done {
  background: #dcfce7; border-color: #86efac; color: #15803d;
}
.e360-chip-pending {
  background: #fef9c3; border-color: #fde047; color: #a16207;
}
.e360-chip-name { font-weight: 600; }
.e360-chip-badge { font-size: 11px; opacity: 0.85; }

/* ── Simulator v2 ──────────────────────────────────────────────────────────── */
.sim2-section { margin-bottom: 18px; }
.sim2-section-title { font-size: 12px; font-weight: 700; color: var(--grey-700); margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--grey-200); }
.sim2-fields { display: flex; flex-direction: column; gap: 7px; }
.sim2-field { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sim2-field label { font-size: 12px; color: var(--grey-600); white-space: nowrap; min-width: 80px; }
.sim2-field select { font-size: 13px; flex: 1; padding: 5px 6px; border: 1px solid var(--grey-300); border-radius: var(--radius-sm); }
.sim2-input-unit { display: flex; align-items: center; gap: 6px; flex: 1; }
.sim2-input-unit span { font-size: 12px; color: var(--grey-500); white-space: nowrap; }

.sim2-main-result { background: var(--grey-50); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 10px; }
.sim2-result-label { font-size: 11px; color: var(--grey-500); margin-bottom: 3px; }
.sim2-result-big { font-size: 28px; font-weight: 800; color: var(--grey-800); line-height: 1.1; }
.sim2-unit { font-size: 16px; font-weight: 600; }
.sim2-result-sub { font-size: 11px; color: var(--grey-400); margin-top: 5px; }

.sim2-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sim2-mini-card { background: var(--grey-50); border-radius: var(--radius-sm); padding: 10px 12px; }
.sim2-mini-label { font-size: 10px; color: var(--grey-500); margin-bottom: 3px; }
.sim2-mini-val { font-size: 17px; font-weight: 700; color: var(--grey-800); }
.sim2-mini-unit { font-size: 10px; color: var(--grey-400); margin-top: 1px; }

.sim2-gap-alert { padding: 9px 12px; border-radius: var(--radius-sm); font-size: 12px; margin: 10px 0 8px; }
.sim2-gap-warn { background: #fef3c7; border: 1px solid #fcd34d; color: #92400e; }
.sim2-gap-ok   { background: #dcfce7; border: 1px solid #86efac; color: #15803d; }

.sim2-compare-table { width: 100%; font-size: 12px; border-collapse: collapse; margin-bottom: 8px; }
.sim2-compare-table td { padding: 6px 4px; border-bottom: 1px solid var(--grey-100); color: var(--grey-600); }
.sim2-compare-table td:last-child { text-align: right; font-weight: 600; color: var(--grey-700); }
.sim2-compare-total td { border-top: 1.5px solid var(--grey-300); border-bottom: none; color: var(--grey-800); padding-top: 8px; }

.sim2-notice { font-size: 10px; color: var(--grey-400); line-height: 1.7; }

/* ── Position Map（D&D職種別） ─────────────────────────────────────────────── */
.posmap-team-tabs {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px;
}
.posmap-team-tab {
  padding: 8px 22px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
  text-decoration: none; color: var(--grey-600); border: 1.5px solid var(--grey-300);
  background: white; transition: all 0.15s;
}
.posmap-team-tab:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.posmap-team-tab.active { background: var(--primary); color: white; border-color: var(--primary); }

.posmap-matrix-wrap {
  overflow-x: auto; margin-bottom: 20px;
  background: white; border: 1px solid var(--grey-200);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px;
}
.posmap-tbl { border-collapse: collapse; font-size: 12px; }
.posmap-corner {
  font-size: 11px; font-weight: 700; color: var(--grey-500);
  text-align: center; padding: 6px 12px; min-width: 52px;
}
.posmap-col-hdr {
  font-size: 10px; font-weight: 700; color: var(--grey-500);
  text-align: center; padding: 6px 4px; border: 0.5px solid var(--grey-200);
  min-width: 80px; white-space: normal; word-break: keep-all; line-height: 1.4;
}
.posmap-row-lbl {
  font-size: 11px; font-weight: 700; color: var(--grey-500);
  text-align: center; padding: 4px 10px; white-space: nowrap;
  border-right: 1px solid var(--grey-200);
}
.posmap-cell {
  border: 0.5px solid var(--grey-200); vertical-align: top;
  padding: 4px 5px; min-height: 56px; min-width: 100px;
}
.posmap-cell-valid  { background: white; }
.posmap-cell-invalid { background: var(--cell-grey); }
.posmap-cell-valid.posmap-over {
  background: #eff6ff !important;
  outline: 2px dashed var(--primary); outline-offset: -2px;
}
.posmap-sal {
  font-size: 11px; color: var(--grey-400); text-align: right;
  margin-bottom: 4px; line-height: 1;
}
.posmap-cell-staff { display: flex; flex-wrap: wrap; gap: 3px; min-height: 24px; }

/* スタッフバッジ */
.posmap-badge {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 3px 8px; border-radius: 4px; border: 1.5px solid;
  cursor: grab; white-space: nowrap; user-select: none;
  transition: opacity 0.15s, transform 0.1s;
  line-height: 1.5;
}
.posmap-badge:hover  { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(0,0,0,0.12); }
.posmap-badge-drag   { opacity: 0.4; cursor: grabbing; }

/* 未配置プール */
.posmap-pool-section {
  background: white; border: 1px solid var(--grey-200);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px; margin-bottom: 20px;
}
.posmap-pool-label {
  font-size: 12px; font-weight: 700; color: var(--grey-600); margin-bottom: 10px;
}
.posmap-pool-hint { font-weight: 400; color: var(--grey-400); }
.posmap-pool {
  display: flex; flex-wrap: wrap; gap: 6px;
  min-height: 44px; padding: 8px;
  border: 2px dashed var(--grey-300); border-radius: var(--radius-sm);
}
.posmap-pool.posmap-over { background: #eff6ff; border-color: var(--primary); }

/* アクションバー */
.posmap-action-bar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap; margin-bottom: 24px;
  background: white; border: 1px solid var(--grey-200);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 20px;
}
.posmap-save-btn { flex-shrink: 0; }

/* 凡例 */
.posmap-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12px; }
.posmap-leg-item { display: flex; align-items: center; gap: 5px; color: var(--grey-700); }
.posmap-leg-dot {
  display: inline-block; width: 12px; height: 12px;
  border-radius: 3px; border: 1.5px solid; flex-shrink: 0;
}

/* ── Stage Tooltip ─────────────────────────────────────────────────────────── */
[data-tip] { position: relative; }
[data-tip]:not([data-tip=""]) { cursor: help; }
[data-tip]:not([data-tip=""])::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--grey-800);
  color: #f1f5f9;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.6;
  padding: 7px 12px;
  border-radius: 6px;
  white-space: normal;
  width: 220px;
  z-index: 500;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
[data-tip]:not([data-tip=""]):hover::after { opacity: 1; }

/* 列ヘッダー用（下向き）*/
[data-tip-below] { position: relative; }
[data-tip-below]:not([data-tip-below=""]) { cursor: help; }
[data-tip-below]:not([data-tip-below=""])::after {
  content: attr(data-tip-below);
  position: absolute;
  left: 50%;
  top: calc(100% + 6px);
  transform: translateX(-50%);
  background: var(--grey-800);
  color: #f1f5f9;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.6;
  padding: 7px 12px;
  border-radius: 6px;
  white-space: normal;
  width: 220px;
  z-index: 500;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
[data-tip-below]:not([data-tip-below=""]):hover::after { opacity: 1; }

/* ── DH技能評価 ───────────────────────────────────────────────────────────── */
.menu-card-skill { background: linear-gradient(135deg, #0e7490 0%, #0891b2 100%); color: white; }
.menu-card-skill .menu-card-desc { color: rgba(255,255,255,0.85); }
.menu-card-skill:hover { opacity: 0.9; }

/* スタッフ自己評価フォーム */
.skill-eval-card { background: white; border: 1px solid var(--grey-200); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; box-shadow: var(--shadow); }
.skill-eval-tbl { width: 100%; border-collapse: collapse; }
.skill-eval-tbl th, .skill-eval-tbl td { padding: 10px 14px; border: 1px solid var(--grey-200); text-align: left; }
.skill-eval-tbl th { background: var(--grey-100); font-weight: 600; font-size: 13px; }
.skill-name-col { width: 40%; }
.skill-status-col { width: 60%; }
.skill-name-cell { font-weight: 600; color: var(--grey-700); }
.skill-select { padding: 6px 10px; border: 1px solid var(--grey-300); border-radius: var(--radius-sm); font-size: 13px; width: 160px; }
.eval-submit-area { text-align: center; margin: 20px 0; }
.eval-nav { text-align: center; margin-top: 12px; }
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #86efac; border-radius: var(--radius-sm); padding: 10px 16px; font-size: 13px; margin-bottom: 16px; }

/* admin_position 技能評価テーブル */
.skill-eval-section { margin-top: 24px; }
.skill-eval-tbl-wrap { overflow-x: auto; margin-bottom: 16px; }
.skill-eval-admin-tbl { width: 100%; border-collapse: collapse; min-width: 480px; }
.skill-eval-admin-tbl th, .skill-eval-admin-tbl td { padding: 9px 14px; border: 1px solid var(--grey-200); text-align: center; }
.skill-eval-admin-tbl th { background: var(--grey-100); font-size: 12px; font-weight: 600; color: var(--grey-700); }
.skill-eval-admin-tbl .skill-name-col { width: 20%; text-align: left; }
.skill-eval-admin-tbl .skill-ro-col { width: 25%; }
.skill-eval-admin-tbl .skill-edit-col { width: 30%; }
.skill-name-cell { font-weight: 600; color: var(--grey-700); text-align: left !important; }
.skill-ro-cell { }
.skill-edit-cell { }
.skill-final-select { padding: 5px 8px; border: 1px solid var(--grey-300); border-radius: var(--radius-sm); font-size: 13px; width: 140px; }
.skill-save-bar { display: flex; align-items: center; gap: 14px; }
.skill-save-msg { font-size: 13px; font-weight: 600; }

/* 面談記録 */
.interview-card { }
.interview-grid { display: flex; flex-direction: column; gap: 18px; }
.interview-field-full { display: flex; flex-direction: column; gap: 5px; }
.interview-label { font-size: 13px; font-weight: 600; color: var(--grey-700); }
.interview-unit { font-size: 12px; font-weight: 400; color: var(--grey-400); }
.interview-textarea { resize: vertical; min-height: 72px; font-size: 14px; line-height: 1.6; }
.interview-score-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; }
.interview-score-block { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 150px; }
.interview-score-input { width: 100%; font-size: 18px; font-weight: 700; text-align: center; padding: 8px; }
.interview-diff-display { height: 44px; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; color: var(--grey-400); border: 1px solid var(--grey-200); border-radius: var(--radius-sm); background: var(--grey-50); }

/* 習得状況バッジ */
.skill-status-badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.skill-status-未習得  { background: #fee2e2; color: #b91c1c; }
.skill-status-習得中  { background: #fef3c7; color: #92400e; }
.skill-status-習得済み { background: #d1fae5; color: #065f46; }
.skill-status-- { background: var(--grey-100); color: var(--grey-400); }
.skill-status-na { font-size: 12px; color: var(--grey-400); }

/* matrix.ejs 技能最終評価表示 */
.skill-final-display { max-width: 500px; margin: 28px auto 0; padding: 0 20px; }
.skill-final-title { font-size: 15px; font-weight: 700; color: var(--grey-700); margin-bottom: 10px; border-left: 4px solid #0891b2; padding-left: 10px; }
.skill-final-tbl { width: 100%; border-collapse: collapse; }
.skill-final-tbl th, .skill-final-tbl td { padding: 8px 14px; border: 1px solid var(--grey-200); }
.skill-final-tbl th { background: var(--grey-100); font-size: 12px; font-weight: 600; }

/* ── DH技能種別管理ページ ──────────────────────────────────────────────────── */
.salary-cls-th { font-size: 9px; font-weight: 600; text-align: center; padding: 4px 3px; white-space: normal; word-break: keep-all; line-height: 1.4; max-width: 60px; }
.admin-card-note { font-size: 12px; color: var(--grey-400); margin-bottom: 12px; }
.skill-mgmt-tbl { width: 100%; border-collapse: collapse; }
.skill-mgmt-tbl th, .skill-mgmt-tbl td { padding: 10px 14px; border: 1px solid var(--grey-200); text-align: left; }
.skill-mgmt-tbl th { background: var(--grey-100); font-size: 12px; font-weight: 600; color: var(--grey-700); }
.skill-mgmt-order { width: 70px; }
.skill-mgmt-name { width: 160px; }
.skill-mgmt-status { }
.skill-mgmt-action { width: 130px; }
.skill-mgmt-order-cell { color: var(--grey-400); text-align: center; }
.skill-add-form { display: flex; gap: 10px; align-items: center; }
.skill-add-input { padding: 8px 12px; border: 1px solid var(--grey-300); border-radius: var(--radius-sm); font-size: 14px; width: 240px; }
.skill-active-badge { background: #d1fae5; color: #065f46; }
.skill-status-無効 { background: var(--grey-100); color: var(--grey-400); }

/* 無効行（admin_position の技能テーブル） */
.skill-row-inactive { background: var(--grey-50); opacity: 0.7; }
/* 退職済み行 */
.staff-row-retired { background: #fff5f5; opacity: 0.75; }
.staff-retired-badge { background: #fee2e2; color: #991b1b; }
/* チーム配属変更バッジ */
.team-row-changed { background: #fefce8; }
.team-changed-badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 700; background: #fef08a; color: #854d0e;
}
.skill-inactive-badge { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 10px; font-size: 10px; font-weight: 600; background: var(--grey-200); color: var(--grey-600); vertical-align: middle; }

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .menu-grid { grid-template-columns: 1fr; }
  .login-card { padding: 28px 20px; }
  /* マトリクスページ余白を詰める */
  .matrix-page-container { padding: 8px; }
  .matrix-wrapper { padding: 10px 6px; gap: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .score-summary { flex-direction: column; }
  .y-axis-label { display: none; }
  /* table-layout: fixed で列幅を厳密に固定 */
  .matrix-grid { border-spacing: 2px; width: auto; table-layout: fixed; }
  .col-header { width: 34px; min-width: 34px; max-width: 34px; font-size: 7px; padding-bottom: 3px; word-break: break-all; white-space: normal; }
  .matrix-cell { width: 34px; min-width: 34px; height: 28px; border-radius: 3px; }
  .star { font-size: 14px; }
  .stage-label { font-size: 9px; }
  .level-label { font-size: 8px; }
  /* 行ラベルを sticky にして横スクロール時も常に表示 */
  .row-label-cell { width: 32px; min-width: 32px; padding-right: 4px; position: sticky; left: 0; background: white; z-index: 2; }
  .x-axis-label { font-size: 10px; margin-top: 6px; }

  /* 回答詳細テーブル：モバイルではカード形式に変換 */
  .eval-detail-tbl thead { display: none; }
  .eval-detail-tbl tbody { display: block; }
  .eval-detail-tbl tr {
    display: flex; flex-direction: column;
    padding: 10px 12px; border-bottom: 1px solid var(--grey-200);
    gap: 4px;
  }
  .eval-detail-tbl td {
    display: block; padding: 0; border: none; width: 100%;
  }
  .edt-cat-cell {
    font-size: 10px; color: var(--grey-400); font-weight: 700;
    white-space: nowrap; padding: 0;
  }
  .edt-q-cell {
    font-size: 13px; color: var(--grey-800); line-height: 1.6;
  }
  .edt-score-cell, .edt-avg-cell {
    display: inline-block; width: auto; text-align: left;
  }
  .edt-score-cell::before { content: attr(data-label); font-size: 10px; color: var(--grey-400); margin-right: 6px; }
  /* 個別 dist 列は非表示、モバイル用バッジ行に切り替え */
  .eval-detail-tbl .edt-dist-cell { display: none; }
  .eval-detail-tbl .edt-dist-mobile {
    display: flex; flex-wrap: wrap; gap: 5px; padding: 2px 0;
  }
  .eval-detail-tbl .edt-avg-cell { display: block; width: auto; text-align: left; }
  .edt-avg-cell::before { content: attr(data-label); font-size: 10px; color: var(--grey-400); margin-right: 6px; }
}
