/* 
  ATS (採用管理システム) - ディープネイビー・キーカラー＆モダンビジネスデザインシステム 
  Color Tokens: Premium Deep Navy / Midnight Blue Key Color
*/
:root {
  /* キーカラー (ディープネイビー / ミッドナイトブルー) */
  --brand-navy: #0f172a;
  --brand-navy-light: #1e293b;
  --brand-blue: #2563eb;
  --brand-blue-hover: #1d4ed8;

  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-secondary: #f1f5f9;
  --bg-active: #e2e8f0;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-on-navy: #ffffff;
  --text-on-navy-subtle: #cbd5e1;

  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  display: flex;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== サイドバー (青・紺色ベース / 白文字キーカラー) ===== */
.sidebar {
  width: 250px;
  background-color: var(--brand-navy);
  color: var(--text-on-navy);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0.875rem;
  z-index: 10;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.625rem 1.25rem 0.625rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 1rem;
}

.brand-logo {
  display: block;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  object-fit: contain;
}

.brand-titles {
  display: flex;
  flex-direction: column;
}

.brand-main-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.05em;
  line-height: 1.1;
}

.brand-sub-title {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-on-navy-subtle);
  margin-top: 0.25rem;
  letter-spacing: 0.02em;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.875rem;
  border-radius: var(--radius-md);
  color: #cbd5e1;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-icon {
  width: 18px;
  height: 18px;
  stroke: #94a3b8;
  transition: stroke 0.15s ease;
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.nav-item:hover .nav-icon {
  stroke: #ffffff;
}

.nav-item.active {
  background-color: var(--brand-blue);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.nav-item.active .nav-icon {
  stroke: #ffffff;
}

.user-profile {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.user-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #ffffff;
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-on-navy-subtle);
}

/* ===== メインエリア ===== */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--bg-primary);
}

.header {
  height: 60px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
}

.header-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.content-body {
  flex: 1;
  padding: 1.75rem;
  overflow-y: auto;
}

/* ===== キーカラー連動コンポーネント ===== */

/* カード */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

/* KPI グリッド */
.grid-kpi {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.kpi-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.5rem;
}

.kpi-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--brand-navy);
  letter-spacing: -0.02em;
}

/* ボタン (キーカラー統一) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary {
  background-color: var(--brand-navy);
  color: #ffffff;
  border-color: var(--brand-navy);
}

.btn-primary:hover {
  background-color: var(--brand-navy-light);
  border-color: var(--brand-navy-light);
}

.btn-secondary {
  background-color: var(--bg-surface);
  color: var(--text-secondary);
  border-color: var(--border-color);
}

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

.btn-outline-danger {
  background-color: transparent;
  color: #dc2626;
  border-color: #fca5a5;
}

.btn-outline-danger:hover {
  background-color: #fef2f2;
}

.nav-btn-notify {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.notify-badge {
  background-color: #ef4444;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  line-height: 1;
}

/* 入力フィールド */
.select-input, .text-input {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.select-input:focus, .text-input:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* テーブル */
.table-container {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.data-table th {
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.data-table tbody tr:hover {
  background-color: #f8fafc;
}

/* バッジ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
}

.badge-info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.badge-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.badge-warning { background: #fffbe6; color: #b45309; border: 1px solid #fde68a; }
.badge-danger { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

/* タブバー (キーカラー下線) */
.tab-bar {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
}

.tab-btn {
  padding: 0.625rem 1rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.tab-btn.active {
  border-bottom-color: var(--brand-navy);
  color: var(--brand-navy);
  font-weight: 700;
}

/* モーダル */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-content {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 720px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background-color 0.15s ease;
}

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

.modal-body-inner {
  padding: 1.5rem;
  overflow-y: auto;
}

/* Shared workspace design */
:root {
  --brand-blue: #3659df;
  --brand-blue-hover: #2947be;
  --bg-primary: #f5f6fa;
  --bg-secondary: #f8f9fc;
  --text-primary: #202b42;
  --text-secondary: #58657c;
  --text-muted: #707e94;
  --border-color: #e4e8f0;
  --border-subtle: #eef1f6;
  --font-sans: 'Inter', 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', Meiryo, sans-serif;
  --surface: var(--bg-surface);
  --bg: var(--bg-surface);
  --border: var(--border-color);
  --primary: var(--brand-blue);
  --color-primary: var(--brand-blue);
}
body { font-size: 14px; line-height: 1.6; height: 100dvh; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #8099f1; outline-offset: 3px; }
.sidebar { width: 236px; flex-shrink: 0; padding: 24px 14px 18px; background: #111b30; box-shadow: none; }
.brand { padding: 0 8px 25px; gap: 10px; margin-bottom: 23px; }
.brand-main-title { font-size: 23px; letter-spacing: 0.07em; }
.brand-sub-title { font-size: 10px; color: #9facbf; letter-spacing: 0.08em; }
.brand-logo { width: 42px; height: 42px; }
.nav-menu { gap: 5px; scrollbar-width: thin; }
.nav-item { min-height: 43px; padding: 10px 13px; font-size: 12px; letter-spacing: 0.01em; border: 1px solid transparent; color: #aebbd0; border-radius: 8px; }
.nav-item.active { background: #263b65; border-color: #354e7e; box-shadow: inset 3px 0 #7798ff; color: #fff; }
.nav-item.active .nav-icon { stroke: #aac2ff; }
.nav-item:hover { background: #1e2d48; }
.nav-icon { flex-shrink: 0; width: 17px; height: 17px; }
.user-profile { padding: 18px 10px 0; gap: 9px; }
.user-profile .badge { align-self: flex-start; font-size: 10px; }
.user-name { font-size: 12px; }
.user-role { font-size: 11px; color: #9facbf; }
.main-wrapper { min-width: 0; }
.header { min-height: 76px; flex-shrink: 0; padding: 0 34px; gap: 20px; }
.header-title { font-size: 17px; letter-spacing: -0.03em; white-space: nowrap; }
.header-actions { gap: 10px; }
.header-actions .btn, .header-actions select { font-size: 12px; min-height: 36px; }
.header-actions .btn-outline-danger { color: #637089; border-color: var(--border-color); }
.header-actions .btn-outline-danger:hover { color: #b4233b; border-color: #edc6cd; }
.content-body { padding: 32px 34px 48px; scrollbar-gutter: stable; }
.card { border-radius: 14px; padding: 24px; box-shadow: 0 2px 5px #192b4a04; }
.card:hover { box-shadow: 0 2px 5px #192b4a04; }
.card h2 { letter-spacing: -0.025em; }
.grid-kpi { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; }
.grid-kpi .card { position: relative; padding: 23px; overflow: hidden; }
.grid-kpi .card::before { content: ''; position: absolute; top: 24px; right: 22px; width: 8px; height: 8px; border-radius: 50%; background: #718be6; box-shadow: 0 0 0 5px #eef2ff; }
.kpi-title { font-size: 12px; font-weight: 500; letter-spacing: 0; padding-right: 22px; margin-bottom: 13px; }
.kpi-value { font-size: 32px; font-weight: 650; font-variant-numeric: tabular-nums; }
.btn { min-height: 38px; padding: 9px 15px; border-radius: 8px; font-size: 12px; font-weight: 600; line-height: 1.3; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s; }
.btn-primary { background: var(--brand-blue); border-color: var(--brand-blue); box-shadow: 0 2px 3px #3659df18; }
.btn-primary:hover { background: var(--brand-blue-hover); border-color: var(--brand-blue-hover); }
.btn-secondary { background: #fff; color: #526078; }
button:disabled { cursor: not-allowed; opacity: .5; box-shadow: none; }
.form-control, .select-input, .text-input,
input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]), select, textarea {
  min-height: 43px; padding: 10px 13px; border: 1px solid #dce2ec;
  border-radius: 8px; background: #fff; color: var(--text-primary); font: inherit;
  font-size: 13px; line-height: 1.5; max-width: 100%; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #7c889c; }
.form-control:focus, .select-input:focus, .text-input:focus, input:focus, select:focus, textarea:focus { border-color: #6884e8; box-shadow: 0 0 0 3px #3659df14; }
select { cursor: pointer; padding-right: 30px; }
input:disabled, select:disabled, textarea:disabled { background: #f2f4f8; color: #748095; cursor: not-allowed; }
textarea { min-height: 108px; resize: vertical; }
label { color: #37455e; font-size: 12px; font-weight: 600; }
#manual-form > label { display: block; margin: 15px 0 7px; }
#manual-form > select { width: 100%; }
.table-container { border-radius: 12px; overflow-x: auto; box-shadow: 0 2px 5px #192b4a03; }
.data-table { font-size: 12px; }
.data-table th { background: #f9fafc; color: #6a768d; font-size: 11px; letter-spacing: .025em; text-transform: none; padding: 15px 20px; white-space: nowrap; }
.data-table td { padding: 16px 20px; height: 61px; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #f8faff; }
.data-table .btn { min-height: 31px; border-radius: 6px; font-size: 11px !important; }
.data-table td:last-child { white-space: nowrap; }
.badge { padding: 4px 9px; border-radius: 5px; font-size: 10px; font-weight: 600; line-height: 1.4; }
.badge-success { background: #ecf8f2; color: #247453; border-color: #d7eee1; }
.badge-info { background: #edf2ff; color: #4260b3; border-color: #dfe7ff; }
.badge-warning { background: #fff7e7; color: #94631c; border-color: #f4e6c8; }
.badge-danger { background: #fdf0f1; color: #af4659; border-color: #f2dbe0; }
.page-intro { margin-bottom: 28px; }
.page-eyebrow, .dialog-eyebrow { font-size: 10px; font-weight: 700; color: #607bc5; letter-spacing: .08em; margin-bottom: 7px; }
.page-intro h2 { font-size: 23px; font-weight: 650; letter-spacing: -.045em; margin-bottom: 7px; }
.page-intro p { font-size: 12px; color: var(--text-secondary); }
.tab-bar { gap: 7px; padding-bottom: 0; overflow-x: auto; }
.tab-btn { padding: 12px 16px 14px; font-size: 12px; white-space: nowrap; color: #6d7990; }
.tab-btn.active { border-bottom-color: var(--brand-blue); color: var(--brand-blue); }
.master-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 23px 0 18px; }
#master-desc-text { max-width: 740px; line-height: 1.8; font-size: 12px !important; }
.drag-handle { color: #b5bed0; }
.category-badge { display: inline-flex; align-items: center; gap: 7px; color: #61718a; font-size: 11px; }
.category-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.category-active { color: #4e6bc6; }.category-hired { color: #25865e; }.category-rejected { color: #b75a6b; }.category-withdrawn { color: #7c6a9c; }.category-on_hold { color: #a37932; }
.dialog-overlay, .modal-backdrop { padding: 24px; background: #15223e55; backdrop-filter: blur(4px); }
.dialog-overlay { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; }
.editor-dialog { background: #fff; border: 1px solid #ffffffa6; border-radius: 18px; padding: 32px; width: 100%; max-width: 480px; max-height: calc(100dvh - 48px); overflow-y: auto; box-shadow: 0 24px 80px #14234030, 0 4px 16px #14234012; }
.editor-dialog-title { font-size: 21px; letter-spacing: -.04em; font-weight: 650; margin-bottom: 8px; }
.dialog-description { font-size: 12px; color: #718098; margin-bottom: 28px; line-height: 1.8; }
.field-label { display: block; font-size: 12px; color: #3a4962; }
.field-hint { font-size: 11px; color: #708097; line-height: 1.8; margin-bottom: 20px; }
.dialog-footer { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border-subtle); }
.dialog-footer .btn { min-width: 86px; min-height: 40px; }
.editor-dialog [role=alert]:empty { display: none; }
.modal-content { border-radius: 16px; box-shadow: 0 24px 80px #14234030; }
.modal-header { padding: 22px 28px; }
.modal-body-inner { padding: 28px; }
.import-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.upload-dropzone { border: 1px dashed #bac9eb; border-radius: 12px; padding: 36px 20px; text-align: center; background: #f7f9ff; cursor: pointer; transition: background .15s; }
.upload-dropzone:hover { background: #eef3ff; }
.alert { padding: 12px 15px; border-radius: 8px; font-size: 12px; line-height: 1.7; }
.alert-danger { background: #fff2f3; border: 1px solid #f3dce1; color: #a53d53; }
.alert-info { background: #eff5ff; border: 1px solid #dae6ff; color: #34589b; }
body.login-page { overflow: auto; height: auto; min-height: 100dvh; background: radial-gradient(ellipse at 20% 10%, #e8eefb, transparent 55%), #f5f7fb; padding: 32px 0; }
.login-page .login-container { max-width: 450px; }
.login-page .login-box { padding: 36px; border-radius: 20px; box-shadow: 0 20px 70px #2639540b; }
.login-page .login-logo { width: 80px; height: 80px; margin-bottom: 10px; }
.login-page .login-title { font-size: 27px; }
.login-page .login-subtitle { font-size: 11px; letter-spacing: .08em; }
.login-welcome { color: #64748b; font-size: 12px; margin-top: 20px; }
.login-page .btn-login-primary { background: var(--brand-blue); border-color: var(--brand-blue); min-height: 45px; font-size: 13px; }
.login-page .btn-login-primary:hover { background: var(--brand-blue-hover); }
@media (max-width: 1200px) {
  .sidebar { width: 210px; padding-inline: 10px; }
  .header { padding-inline: 24px; }
  .content-body { padding: 25px 24px; }
  .import-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 800px) {
  .sidebar { width: 68px; padding: 20px 8px 12px; }
  .brand { padding: 0 4px 20px; justify-content: center; }
  .brand-titles, .nav-item > span, .user-profile { display: none; }
  .brand-logo { width: 40px; height: 40px; }
  .nav-item { justify-content: center; padding: 12px; }
  .nav-item.active { box-shadow: inset 2px 0 #7798ff; }
  .header { min-height: 72px; height: auto; padding: 15px 20px; flex-wrap: wrap; gap: 12px; }
  .header-actions { flex-wrap: wrap; }
  .content-body { padding: 22px 20px; }
  .master-toolbar { align-items: flex-start; gap: 15px; }
  .page-intro h2 { font-size: 20px; }
  .data-table th, .data-table td { padding: 13px 15px; }
}
@media (max-width: 520px) {
  .header { padding: 14px; }
  .header-title { font-size: 15px; }
  .header-actions { gap: 7px; width: 100%; }
  .header-actions select { width: 100%; }
  .content-body { padding: 20px 12px; }
  .master-toolbar { flex-direction: column; }
  .card { padding: 18px; }
  .grid-kpi { grid-template-columns: minmax(0, 1fr); }
  .dialog-overlay, .modal-backdrop { padding: 12px; }
  .editor-dialog { padding: 24px; max-height: calc(100dvh - 24px); border-radius: 14px; }
  .editor-dialog-title { font-size: 19px; }
  .modal-content { width: 100%; }
  .login-page .login-box { padding: 28px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
