/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", sans-serif;
  background: #f0f2f7;
  color: #2d3142;
  font-size: 14px;
  line-height: 1.5;
}
a { text-decoration: none; }

/* ===== App Shell ===== */
.app-shell { display: flex; min-height: 100vh; }

/* ===== Sidebar ===== */
.sidebar {
  width: 220px;
  background: #1b2438;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: hidden;
  z-index: 100;
}
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

/* Scrollbar styling for sidebar */
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 18px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .02em;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-icon { font-size: 20px; }

.nav-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #4a6080;
}
.nav-section-label:hover { color: #7fa8ff; }
.accordion-icon {
  font-size: 12px;
  transition: transform .2s;
  font-style: normal;
  text-transform: none;
  letter-spacing: 0;
}
.nav-section-body { overflow: hidden; }
.nav-section-body.accordion-collapsed { display: none; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: #9aaabb;
  font-size: 13.5px;
  font-weight: 500;
  transition: background .15s, color .15s;
  border-radius: 0;
  cursor: pointer;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #e0e8f0; }
.nav-item.active { background: rgba(74,108,247,.18); color: #7fa8ff; font-weight: 600; }
.nav-icon { font-size: 15px; width: 18px; text-align: center; }

/* ===== Main Content ===== */
.main-content {
  flex: 1;
  min-width: 0;
  padding: 28px 32px;
  margin-left: 220px;
}

/* ===== Flash ===== */
.flash {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 14px;
}
.flash-notice { background: #d1e7dd; color: #0a5c36; }
.flash-alert  { background: #f8d7da; color: #842029; }

/* ===== Login ===== */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f2f7;
}
.login-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,.10);
  padding: 40px 36px 36px;
  width: 100%;
  max-width: 380px;
}
.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: #1b2438;
  margin-bottom: 28px;
}
.login-brand .brand-icon { font-size: 24px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.form-label { font-size: 12px; font-weight: 600; color: #555; display: block; margin-bottom: 4px; }
.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d5d9e0;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color .15s;
}
.form-input:focus { outline: none; border-color: #4a6cf7; box-shadow: 0 0 0 3px rgba(74,108,247,.1); }
.btn-login {
  width: 100%;
  padding: 11px;
  background: #4a6cf7;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  margin-top: 4px;
}
.btn-login:hover { background: #3a5ce5; }
.role-options { display: flex; gap: 16px; }
.role-option { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.role-radio { accent-color: #4a6cf7; width: 16px; height: 16px; cursor: pointer; }
.role-label { font-size: 14px; color: #1b2438; }

/* ===== Sidebar logout ===== */
.sidebar-footer {
  padding: 16px;
  background: #1b2438;
  border-top: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.btn-logout {
  display: block;
  width: 100%;
  padding: 8px 14px;
  background: rgba(255,255,255,.06);
  color: #9aaabb;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.btn-logout:hover { background: rgba(220,50,50,.18); color: #f0a0a0; border-color: rgba(220,50,50,.3); }

/* ===== Breadcrumb ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #9aaabb;
  margin-bottom: 8px;
}
.breadcrumb a { color: #9aaabb; text-decoration: none; }
.breadcrumb a:hover { color: #4a6cf7; }
.breadcrumb-sep { font-size: 10px; }

/* ===== Page Header ===== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-title { font-size: 20px; font-weight: 700; color: #1b2438; }
.page-header-actions { display: flex; gap: 8px; align-items: center; }

/* カテゴリフォーム */
.category-project-list { display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow-y: auto; border: 1px solid #e8eaf0; border-radius: 6px; padding: 8px; }
.category-project-item { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 4px; cursor: pointer; font-size: 13px; }
.category-project-item:hover { background: #f5f7fc; }
.category-project-code { font-family: monospace; font-size: 12px; color: #555; min-width: 60px; }
.category-project-name { color: #333; }

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 8px 16px;
  background: #4a6cf7;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: background .15s;
  white-space: nowrap;
}
.btn:hover { background: #3a5ce5; color: #fff; }
.btn-secondary { background: #fff; color: #555; border: 1px solid #d5d9e0; }
.btn-secondary:hover { background: #f5f6fa; color: #333; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-docx { background: #217346; }
.btn-docx:hover { background: #185c38; color: #fff; }
.btn-danger { background: #fff; color: #c0392b; border: 1px solid #e0b0b0; }
.btn-danger:hover { background: #fdf0f0; color: #a93226; }

.detail-actions-bar {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #f0f2f7;
}

/* ===== Summary Cards ===== */
.summary-cards {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.summary-card {
  background: #fff;
  border-radius: 10px;
  padding: 16px 22px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  min-width: 160px;
}
.summary-card .label { display: block; font-size: 11px; color: #888; margin-bottom: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.summary-card .value { display: block; font-size: 22px; font-weight: 700; color: #1b2438; }

/* ===== Search Bar ===== */
.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.search-input {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px;
  border: 1px solid #d5d9e0;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
}
.search-input:focus { outline: none; border-color: #4a6cf7; }
.status-select {
  padding: 8px 10px;
  border: 1px solid #d5d9e0;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
}

/* ===== Table ===== */
.table-wrapper {
  overflow-x: auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th, .data-table td {
  padding: 11px 16px;
  text-align: left;
  border-bottom: 1px solid #f0f2f7;
}
.data-table th {
  background: #f8f9fc;
  font-weight: 700;
  color: #555;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}
.data-table th a { color: inherit; }
.data-table th a:hover { color: #4a6cf7; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f8f9ff; }
.col-code { font-family: monospace; color: #666; }
.col-date { white-space: nowrap; }
.col-amount { text-align: right !important; font-family: monospace; font-weight: 700; }
.col-amount.has-amount { color: #1b2438; }

/* ===== Badge ===== */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-active, .badge-承認済 { background: #d1e7dd; color: #0a5c36; }
.badge-inactive, .badge-停止 { background: #f8d7da; color: #842029; }
.badge-awaiting_invoice { background: #fff3cd; color: #856404; }
.badge-paid { background: #d1e7dd; color: #0a5c36; }
.badge-default { background: #e9ecef; color: #555; }

/* ===== Pagination ===== */
.pagination-bar { margin-top: 18px; display: flex; justify-content: center; gap: 4px; }
.pagination-bar a, .pagination-bar em, .pagination-bar span {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid #d5d9e0;
  border-radius: 6px;
  color: #4a6cf7;
  background: #fff;
  font-style: normal;
}
.pagination-bar em, .pagination-bar .current { background: #4a6cf7; color: #fff; border-color: #4a6cf7; }
.pagination-bar a:hover { background: #f0f2f7; }

/* ===== Dashboard Widgets ===== */
.widget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 8px;
}
.widget {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 6px rgba(0,0,0,.08);
  min-height: 200px;
  display: flex;
  flex-direction: column;
}
.widget-header {
  padding: 16px 20px 14px;
  border-bottom: 1px solid #f0f2f7;
  display: flex;
  align-items: center;
  gap: 10px;
}
.widget-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.widget-icon.blue { background: #e8edff; }
.widget-icon.green { background: #e6f4ec; }
.widget-icon.orange { background: #fff3e0; }
.widget-icon.purple { background: #f3e8ff; }
.widget-title { font-size: 14px; font-weight: 700; color: #1b2438; }
.widget-body {
  flex: 1;
  padding: 24px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wip-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 2px dashed #c9d0db;
  border-radius: 8px;
  color: #9aaabb;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
}
.wip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c9d0db;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}

/* ===== Import Area ===== */
.import-area {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  padding: 18px 24px 20px;
  margin-bottom: 24px;
}
.import-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.import-icon { font-size: 18px; }
.import-title { font-size: 14px; font-weight: 700; color: #1b2438; }
.import-hint  { font-size: 12px; color: #9aaabb; margin-left: 4px; }

.dropzone {
  border: 2px dashed #c9d0db;
  border-radius: 8px;
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .2s, background .2s;
  cursor: pointer;
  position: relative;
}
.dropzone.drag-over { border-color: #4a6cf7; background: #f0f3ff; }
.dropzone-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px;
}
.dropzone-icon { font-size: 28px; }
.dropzone-text { font-size: 13px; font-weight: 600; color: #555; }
.dropzone-sub  { font-size: 12px; color: #aaa; }
.dropzone-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #4a6cf7;
  font-size: 14px;
  font-weight: 600;
}
.loading-spinner {
  width: 22px; height: 22px;
  border: 3px solid #e0e8ff;
  border-top-color: #4a6cf7;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.dropzone-result { padding: 12px 20px; font-size: 13px; font-weight: 600; }
.import-ok    { color: #0a7c4a; }
.import-warn  { color: #856404; }
.import-error { color: #842029; }
.import-filename {
  display: block;
  font-size: 12px;
  color: #666;
  margin-bottom: 6px;
  font-weight: 400;
}

/* ===== Detail / Form (purchase_orders) ===== */
.detail-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.detail-header h2 { font-size: 16px; font-weight: 700; }
.detail-actions { display: flex; gap: 8px; }
.detail-card { background: #fff; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.07); padding: 24px; margin-top: 16px; }
.detail-table { width: 100%; border-collapse: collapse; }
.detail-table th, .detail-table td { padding: 12px 16px; border-bottom: 1px solid #f0f2f7; vertical-align: top; }
.detail-table th { width: 160px; color: #666; font-weight: 600; background: #f8f9fc; white-space: nowrap; }
.detail-table tr:last-child th, .detail-table tr:last-child td { border-bottom: none; }
.desc-cell { white-space: pre-wrap; line-height: 1.6; }

.form-section { background: #fff; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.07); padding: 24px; margin-bottom: 20px; }
.section-title { font-size: 15px; font-weight: 700; color: #1b2438; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 1px solid #f0f2f7; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 24px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group-full { grid-column: 1 / -1; }
.form-group label { font-size: 12px; font-weight: 600; color: #555; }
.form-group { position: relative; }
.form-control { padding: 8px 12px; border: 1px solid #d5d9e0; border-radius: 6px; font-size: 14px; background: #fff; width: 100%; }
/* ── オートコンプリートドロップダウン ── */
.ac-dropdown {
  position: absolute; top: calc(100% - 2px); left: 0; right: 0; z-index: 200;
  background: #fff; border: 1px solid #4a6cf7; border-top: none;
  border-radius: 0 0 6px 6px; box-shadow: 0 6px 16px rgba(0,0,0,.12);
  list-style: none; margin: 0; padding: 4px 0; max-height: 220px; overflow-y: auto;
}
.ac-item {
  padding: 7px 12px; font-size: 13px; cursor: pointer; color: #2d3142;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ac-item:hover, .ac-item.ac-active { background: #eef2ff; color: #3a5cf7; }
.form-control:focus { outline: none; border-color: #4a6cf7; box-shadow: 0 0 0 3px rgba(74,108,247,.1); }
textarea.form-control { resize: vertical; font-family: inherit; }
.form-control-static {
  padding: 8px 12px;
  border: 1px solid #e8eaf0;
  border-radius: 6px;
  font-size: 14px;
  background: #f8f9fc;
  color: #555;
  min-height: 38px;
  display: flex;
  align-items: center;
}
.form-actions { display: flex; gap: 12px; align-items: center; }
.edit-id { font-size: 13px; font-weight: 400; color: #888; margin-left: 8px; }

.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.alert-success { background: #d1e7dd; color: #0a5c36; }
.alert-error { background: #f8d7da; color: #842029; }
.alert ul { margin: 0; padding-left: 20px; }

/* ===== Sheet ===== */
.sheet-fy-selector { display: flex; gap: 6px; }
.cf-sort-selector {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: #555;
}
.cf-sort-selector select {
  padding: 3px 8px; border: 1px solid #c5cee0; border-radius: 6px;
  font-size: 13px; background: #fff; cursor: pointer;
}

.sheet-container {
  background: #e8eaf0;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  overflow-x: auto;
  overflow-y: auto;
}
.sheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  white-space: nowrap;
}
.sheet-table th {
  background: #f8f9fc;
  font-weight: 700;
  color: #555;
  font-size: 11px;
  padding: 8px 10px;
  border: 1px solid #e8eaf0;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 2;
}
.sheet-table td {
  padding: 5px 8px;
  border: 1px solid #e8eaf0;
  color: #2d3142;
}
.sheet-col-no     { width: 40px; }
.sheet-col-cat    { width: 52px; }
.sheet-col-acct   { width: 140px; }
.sheet-col-pay    { width: 100px; }
.sheet-col-pj     { width: 80px; }
.sheet-col-desc   { min-width: 160px; max-width: 240px; white-space: normal; }
.sheet-col-vendor { min-width: 120px; max-width: 160px; }
.sheet-col-note   { min-width: 80px; max-width: 120px; white-space: normal; }
.sheet-col-month  { width: 72px; }
.sheet-col-total  { width: 88px; }

.sheet-cell-no, .sheet-cell-cat {
  text-align: center; color: #777; font-size: 11px;
}
.sheet-cell-no {
  display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 3px;
}
.sheet-cell-acct { font-weight: 600; color: #333; }
.sheet-cell-pay, .sheet-cell-pj { font-size: 11px; color: #666; }
.sheet-cell-desc, .sheet-cell-vendor, .sheet-cell-note {
  font-size: 12px; color: #444;
}
.sheet-cell-value {
  text-align: right;
  font-family: 'Courier New', monospace;
  color: #bbb;
}
.sheet-cell-value.has-value { color: #1b2438; }
.sheet-cell-total {
  text-align: right;
  font-family: 'Courier New', monospace;
  background: #f5f7ff;
  color: #bbb;
}
.sheet-cell-total.has-value { color: #1b2438; font-weight: 700; }

/* セクション見出し */
.sheet-section-header td {
  background: #1b2438;
  color: #e0e8f0;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .04em;
  padding: 6px 12px;
}

/* データ行ゼブラ */
.sheet-data-row:nth-child(even) td { background: #fafbfd; }

/* 科目小計 */
.sheet-subtotal td {
  background: #e8edff;
  font-weight: 600;
  color: #2d3a6a;
}
.sheet-subtotal-label { font-size: 11px; color: #4a60b0; }
.sheet-subtotal td.sheet-cell-value { text-align: right; font-family: 'Courier New', monospace; }

/* カテゴリ合計 */
.sheet-cat-total td {
  background: #3a4e80;
  color: #dce6ff;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  text-align: right;
}
.sheet-cattotal-label { text-align: left !important; font-size: 12px; }
.sheet-cat-total td.sheet-cell-value { text-align: right; color: #dce6ff; }

/* 総合計 */
.sheet-grand-total td {
  background: #1b2438;
  color: #fff;
  font-weight: 700;
  text-align: right;
  font-family: 'Courier New', monospace;
  font-size: 13px;
}
.sheet-grand-total td:first-child { text-align: left; }

/* 入力セル */
.sheet-cell-input-td { padding: 0 !important; }
.cell-input {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 80px;
  padding: 5px 8px;
  border: none;
  background: transparent;
  text-align: right;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: #2d3142;
  outline: none;
  -moz-appearance: textfield;
}
.cell-input::-webkit-inner-spin-button,
.cell-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.cell-input:focus {
  background: #fffbe6;
  box-shadow: inset 0 0 0 2px #f4b942;
}
.sheet-data-row:nth-child(even) .cell-input { background: transparent; }
.sheet-data-row:nth-child(even) .cell-input:focus { background: #fffbe6; }

/* 総計列 */
.sheet-col-grand { min-width: 90px; }
.sheet-cell-grand,
.sub-grand,
.cat-grand,
.grand-grand {
  text-align: right;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  background: #f0f4ff;
  font-weight: 600;
  color: #2d3a6a;
}
.sheet-cat-total td.cat-grand  { background: #2e3f70; color: #dce6ff; }
.sheet-grand-total td.grand-grand { background: #111b2e; color: #fff; }

/* 数値セル（総計・年度計） */
.sheet-cell-total {
  text-align: right;
  font-family: 'Courier New', monospace;
  font-size: 13px;
}

/* ===== カラムフィルター ===== */
.cf-th { position: relative; }

.th-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  white-space: nowrap;
}

.col-filter-btn {
  background: none;
  border: none;
  padding: 0 2px;
  cursor: pointer;
  color: #b0bec8;
  font-size: 9px;
  line-height: 1;
  border-radius: 2px;
  flex-shrink: 0;
  transition: color .15s;
}
.col-filter-btn:hover { color: #4a6cf7; }
.col-filter-btn.active { color: #4a6cf7; font-weight: 700; }

.col-filter-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 1px);
  left: 0;
  background: #fff;
  border: 1px solid #c5cee0;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 6px 16px rgba(0,0,0,.14);
  z-index: 50;
  padding: 6px;
  gap: 4px;
  min-width: 140px;
  white-space: normal;
}
.col-filter-dropdown.open { display: flex; flex-wrap: wrap; }

.col-filter-input {
  flex: 1;
  min-width: 0;
  padding: 4px 7px;
  border: 1px solid #d5d9e0;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  color: #2d3142;
  outline: none;
}
.col-filter-input:focus { border-color: #4a6cf7; box-shadow: 0 0 0 2px rgba(74,108,247,.15); }

.col-filter-clear {
  background: none;
  border: none;
  cursor: pointer;
  color: #9aaabb;
  font-size: 15px;
  padding: 0 4px;
  border-radius: 4px;
  line-height: 1;
  flex-shrink: 0;
}
.col-filter-clear:hover { color: #e53e3e; background: #fff0f0; }

.sheet-table th.filter-active {
  background: #e8edff;
  color: #3a4e80;
}

/* 登録ボタンエリア */
.sheet-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0 4px;
}
.sheet-actions-hint {
  font-size: 12px;
  color: #8090a8;
}

/* ===== サマリシート ===== */
.summary-table { font-size: 12px; }

/* FY ヘッダ行 */
.summary-header-fy th {
  background: #1b2438;
  color: #b0c4de;
  font-weight: 700;
  text-align: center;
  padding: 5px 6px;
  border: 1px solid #2d3a5a;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 3;
}
.summary-table thead tr:nth-child(2) th {
  top: 28px;
}
.summary-corner { background: #111b2e !important; left: 0; z-index: 5; }

/* 列幅 */
.summary-col-label    { width: 90px;  min-width: 80px; position: sticky; left: 0;     z-index: 4; background: #f8f9fc; }
.summary-col-pj       { width: 72px;  min-width: 64px; position: sticky; left: 89px;  z-index: 4; background: #f8f9fc; border-left: none; }
.summary-col-sticky   { width: 162px; min-width: 144px; position: sticky; left: 0; z-index: 4; background: #f8f9fc; padding: 0 !important; }
.summary-col-sticky::after { content: ''; position: absolute; top: 0; right: -2px; bottom: -1px; width: 2px; background: #b0b8d0; z-index: 1; }
.sheet-table th.summary-col-sticky { z-index: 4; }
.summary-col-sticky .split-wrap { display: flex; align-items: stretch; }
.summary-col-sticky .split-a { width: 90px; flex-shrink: 0; padding: 8px 6px; border-right: 1px solid #e8eaf0; }
.summary-col-sticky .split-b { width: 72px; flex-shrink: 0; padding: 8px 6px; text-align: center; }
.summary-col-name     { width: 160px; min-width: 120px; }
.summary-col-contract { width: 100px; min-width: 90px;  text-align: right; }
.summary-col-end      { width: 82px;  min-width: 76px;  text-align: center; }
.summary-col-month    { width: 76px;  min-width: 68px;  text-align: right; }
.summary-col-fytotal  { width: 88px;  min-width: 80px;  text-align: right; background: #f0f4ff; }
.summary-col-grand    { width: 96px;  min-width: 88px;  text-align: right; background: #e6ecff; }

/* セクション見出し */
.summary-section-header td {
  background: #2d3a6a;
  color: #c8d8f0;
  font-weight: 700;
  font-size: 11px;
  padding: 5px 10px;
  border-bottom: 1px solid #e8eaf0;
  position: sticky;
  top: var(--sheet-section-top, 60px);
  left: 0;
  z-index: 2;
}

/* 折りたたみ可能なセクション見出し */
.summary-special-toggle td {
  cursor: pointer;
  user-select: none;
}
.summary-special-toggle td:hover { background: #1e2d56; }
.summary-toggle-icon {
  display: inline-block;
  margin-right: 6px;
  font-style: normal;
  transition: transform 0.2s;
}
.summary-special-toggle.collapsed .summary-toggle-icon { transform: rotate(-90deg); }

/* データ行 */
.summary-data-row td {
  padding: 4px 8px;
  border: 1px solid #e8eaf0;
  white-space: nowrap;
}
.summary-cell-val,
.summary-cell-fytotal,
.summary-cell-grand,
.summary-cell-contract {
  text-align: right;
  font-family: 'Courier New', monospace;
}
.summary-cell-end      { text-align: center; font-size: 11px; color: #666; }
.summary-cell-label    { position: sticky; left: 0;     z-index: 1; background: #fff; }
.summary-cell-pj       { text-align: center; font-size: 11px; color: #555; position: sticky; left: 89px; z-index: 1; background: #fff; border-left: none; }
.summary-cell-sticky   { position: sticky; left: 0; z-index: 1; background: #fff; padding: 0 !important; }
.summary-cell-label::after { content: ''; position: absolute; top: 0; right: -2px; bottom: -1px; width: 2px; background: #b0b8d0; z-index: 1; }
.summary-cell-sticky::after { content: ''; position: absolute; top: 0; right: -2px; bottom: -1px; width: 2px; background: #b0b8d0; z-index: 1; }
.summary-cell-sticky .split-wrap { display: flex; align-items: stretch; }
.summary-cell-sticky .split-a { width: 90px; flex-shrink: 0; padding: 4px 8px; border-right: 1px solid #e8eaf0; }
.summary-cell-sticky .split-b { width: 72px; flex-shrink: 0; padding: 4px 8px; text-align: center; font-size: 11px; color: #555; }
.summary-cell-name     { color: #333; }

/* 売上行 */
.summary-row-revenue td { background: #f0f8ff; }
.summary-row-revenue .summary-cell-val,
.summary-row-revenue .summary-cell-fytotal { color: #1a5c9a; }
.summary-row-revenue .summary-cell-grand   { color: #0d3f70; font-weight: 600; background: #dceeff; }

/* 原価行 */
.summary-row-cost td { background: #fff9f0; }
.summary-row-cost .summary-cell-val,
.summary-row-cost .summary-cell-fytotal  { color: #7a4000; }
.summary-row-cost .summary-cell-grand    { color: #5a2e00; font-weight: 600; background: #ffeedd; }

/* カテゴリ集計行 */
.summary-row-revenue.summary-category-header td { background: #d8f0d8; }
.summary-row-revenue.summary-category-header .summary-cell-fytotal { color: #1a5c9a; background: #c8e8c8; }
.summary-row-revenue.summary-category-header .summary-cell-grand   { color: #0d3f70; font-weight: 700; background: #b8e0b8; }
.summary-row-cost.summary-category-header td { background: #f0e8d0; }
.summary-row-cost.summary-category-header .summary-cell-fytotal { color: #7a4000; background: #e8d8b8; }
.summary-row-cost.summary-category-header .summary-cell-grand   { color: #5a2e00; font-weight: 700; background: #e0cca0; }
.summary-row-revenue.summary-category-header .summary-cell-sticky { background: #d8f0d8; }
.summary-row-cost.summary-category-header .summary-cell-sticky { background: #f0e8d0; }
.category-accordion-btn {
  background: none;
  border: 1px solid #aab8a0;
  border-radius: 3px;
  padding: 1px 4px;
  cursor: pointer;
  font-size: 9px;
  color: #557055;
  line-height: 1;
  flex-shrink: 0;
}
.category-accordion-btn:hover { background: #c8e8c8; }
.summary-category-item td { opacity: 0.9; }
.summary-row-revenue.summary-category-item td { background: #f4fbf4; }
.summary-row-cost.summary-category-item td { background: #fdf9f4; }

/* 特殊集計行 */
.summary-row-special td { background: #f6f8ff; }
.summary-row-special .summary-cell-label { font-weight: 600; color: #3a4e80; }
.summary-row-special .summary-cell-sticky .split-a { font-weight: 600; color: #3a4e80; }
.summary-row-special .summary-cell-fytotal { background: #e8edff; }
.summary-row-special .summary-cell-grand   { background: #dce3ff; font-weight: 600; }

/* 合計行 */
.summary-total-row td {
  padding: 5px 8px;
  font-weight: 700;
  white-space: nowrap;
  font-family: 'Courier New', monospace;
  text-align: right;
}
.summary-total-row .summary-cell-label { text-align: left; font-size: 12px; }
.summary-row-total-revenue td { background: #dceeff; color: #0d3f70; }
.summary-row-total-cost    td { background: #ffeedd; color: #5a2e00; }
.summary-row-total-gross   td { background: #d4f4e0; color: #1a5c30; font-size: 13px; }

/* 赤字セル */
.gross-deficit {
  background: #e53935 !important;
  color: #fff !important;
}
/* 保存ボタン無効時 */
button[type="submit"]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.summary-cell-fytotal { background: #f0f4ff; }
.summary-cell-grand   { background: #e6ecff; font-weight: 600; }

/* サマリ入力セル */
.summary-cell-input-td { padding: 0 !important; }
.summary-cell-input {
  display: block;
  width: 100%;
  min-width: 72px;
  padding: 4px 8px;
  border: none;
  background: transparent;
  text-align: right;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: #2d3142;
  outline: none;
  -moz-appearance: textfield;
}
.summary-cell-input::-webkit-inner-spin-button,
.summary-cell-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.summary-cell-input:focus {
  background: #fffbe6;
  box-shadow: inset 0 0 0 2px #f4b942;
}
.summary-row-special .summary-cell-input { background: #f6f8ff; }
.summary-row-special .summary-cell-input:focus { background: #fffbe6; }
.summary-row-cost .summary-cell-input { background: #fff9f0; }

/* ===== Member monthly section ===== */
.member-first-row td { border-top: 2px solid #e8edf3 !important; }
.data-table tbody tr:first-child.member-first-row td { border-top: none !important; }

.member-monthly-tr td  { background: #f4f6ff !important; border-top: 1px solid #c7d2fe !important; }
.member-monthly-tr:hover td { background: #f4f6ff !important; }
.member-monthly-cell   { padding: 0 !important; }

/* ── Sheet ─── */
.mms-wrap  { overflow-x: auto; }
.mms-table { border-collapse: collapse; font-size: 12px; min-width: 100%; }

.mms-table thead tr { background: #e8edff; }
.mms-table thead th {
  padding: 5px 12px; font-size: 10px; font-weight: 700;
  color: #4a6cf7; letter-spacing: .06em; text-transform: uppercase;
  border-right: 1px solid #c7d2fe; white-space: nowrap;
  text-align: right;
}
.mms-table thead th.mms-label-col { text-align: left; min-width: 240px; }
.mms-month-col { min-width: 110px; }

/* プロジェクト行 */
.mms-proj-row td {
  padding: 6px 12px; border-bottom: 1px solid #eef0f8;
  border-right: 1px solid #eef0f8; background: #fff;
}
.mms-proj-row:hover td { background: #f8faff; }
.mms-label-cell { text-align: left; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mms-pj-name    { color: #334155; }
.mms-role       { color: #94a3b8; font-size: 11px; }
.mms-amount-cell { text-align: right !important; font-family: 'Courier New', monospace; color: #1e293b; }

/* 合計行 */
.mms-total-row td {
  padding: 7px 12px; font-weight: 700; background: #dde3ff;
  border-top: 2px solid #b3bfff; border-right: 1px solid #c7d2fe;
}
.mms-total-label-cell {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: #3730a3; white-space: nowrap;
}
.mms-total-amount-cell {
  text-align: right !important; font-family: 'Courier New', monospace;
  color: #1e293b; white-space: nowrap;
}
.mms-toggle-btn {
  background: none; border: 1px solid #818cf8; border-radius: 3px;
  color: #4a6cf7; font-size: 10px; padding: 1px 5px;
  cursor: pointer; line-height: 1.4; flex-shrink: 0;
}
.mms-toggle-btn:hover { background: #e0e7ff; }

/* ===== Assignment Sheet ===== */
.assignment-section { margin-top: 24px; }
.section-hint { font-size: 11px; font-weight: 400; color: #94a3b8; margin-left: 6px; }
.assignment-table-wrap { overflow-x: auto; }
.assignment-table { min-width: 860px; }

.ac-col-num     { width: 36px; text-align: center !important; }
.ac-col-member  { min-width: 160px; }
.ac-col-project { min-width: 150px; }
.ac-col-role    { min-width: 100px; }
.ac-col-util    { width: 80px; }
.ac-col-price   { width: 120px; }
.ac-col-fee     { width: 120px; }
.ac-col-date    { width: 120px; }
.ac-col-del     { width: 40px; text-align: center !important; }
.ac-rownum      { text-align: center; color: #94a3b8; font-size: 12px; }

.assignment-table .form-control { font-size: 12px; padding: 4px 6px; height: auto; }
.ac-select { font-size: 12px; }

.btn-del-row {
  background: none; border: none; color: #ef4444;
  cursor: pointer; font-size: 13px; padding: 3px 7px; border-radius: 4px;
}
.btn-del-row:hover { background: #fee2e2; }

.month-row-td { background: #f8fafc; padding: 8px 16px !important; border-top: none !important; }
.month-cells-wrap { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 6px; }
.month-row-label {
  font-size: 10px; font-weight: 700; letter-spacing: .06em;
  color: #94a3b8; align-self: flex-end; margin-right: 4px; padding-bottom: 4px;
}
.month-cell { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.month-cell-label { font-size: 10px; color: #64748b; white-space: nowrap; }
.month-cell-input {
  width: 88px; padding: 3px 5px; border: 1px solid #d1d5db;
  border-radius: 4px; font-size: 12px; text-align: right;
  font-family: 'Courier New', monospace;
}
.month-cell-input:focus { outline: none; border-color: #4a6cf7; background: #f0f4ff; }

/* Assignment display (show page) */
.assignment-display-header {
  padding: 12px 20px 0; font-size: 13px; font-weight: 700; color: #555;
}
.assignment-display-table { border-top: 1px solid #f0f2f7; }
.month-display-td { background: #f8fafc; padding: 8px 20px !important; border-top: none !important; }
.month-display-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.month-display-cell { display: flex; flex-direction: column; align-items: center; }
.month-display-amount { font-size: 12px; font-weight: 700; color: #1e293b; font-family: 'Courier New', monospace; }

/* ===== Members ===== */
.member-table .col-member-name    { width: 130px; }
.member-table .col-member-company { width: 220px; }
.member-table .col-member-project { }
.member-table .col-member-price   { width: 140px; text-align: right; }

.member-tr-first td { border-top: 2px solid #e8edf3; }
.member-tr-cont  td { border-top: 1px dashed #f0f2f7; }
.member-table tbody tr:first-child td { border-top: none; }

.member-name-cell    { font-weight: 700; color: #1e293b; vertical-align: top; padding-top: 14px; }
.member-company-cell { color: #475569; font-size: 13px; vertical-align: top; padding-top: 14px; }
.member-pj-cell      { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.member-price-cell   { text-align: right; font-weight: 700; font-size: 13px; color: #1e293b; white-space: nowrap; }
.member-none-cell    { color: #94a3b8; }

.member-pj-name { font-size: 13px; color: #334155; }
.member-pj-role { font-size: 11px; color: #94a3b8; padding-left: 2px; }

.price-unit { font-size: 11px; font-weight: 400; color: #94a3b8; }
.price-none { font-size: 12px; color: #cbd5e1; font-weight: 400; }

.stat-badge {
  padding: 4px 12px;
  border-radius: 20px;
  background: #4a6cf7;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}
.stat-badge-muted { background: #e2e8f0; color: #64748b; }

.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.member-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  overflow: hidden;
  border: 1px solid #e8edf3;
}
.member-card-inactive { opacity: .6; }

.member-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid #f1f5f9;
  position: relative;
}

.member-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4a6cf7, #7fa8ff);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.member-card-inactive .member-avatar { background: #94a3b8; }

.member-info { flex: 1; min-width: 0; }
.member-name { font-size: 15px; font-weight: 700; color: #1e293b; margin-bottom: 4px; }
.member-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.member-position { font-size: 12px; color: #64748b; }
.member-id-label { font-size: 11px; color: #94a3b8; }

.member-emp-badge {
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.emp-fulltime  { background: #dbeafe; color: #1d4ed8; }
.emp-contract  { background: #fef3c7; color: #92400e; }

.member-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}
.status-active   { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.2); }
.status-inactive { background: #94a3b8; }

.member-projects { padding: 12px 16px; }
.member-projects-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 8px;
}

.pj-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  background: #f8fafc;
  margin-bottom: 6px;
}
.pj-row:last-child { margin-bottom: 0; }
.pj-row-inactive { opacity: .55; }
.pj-row-left  { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; }
.pj-row-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.pj-code-tag {
  padding: 2px 7px;
  border-radius: 4px;
  background: #e0e7ff;
  color: #3730a3;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.pj-name { font-size: 12.5px; color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pj-role { font-size: 11px; color: #94a3b8; white-space: nowrap; }

.pj-price { font-size: 13px; font-weight: 700; color: #1e293b; }
.pj-price-unit { font-size: 10px; font-weight: 400; color: #94a3b8; margin-left: 1px; }
.pj-price-none { font-size: 11px; color: #cbd5e1; font-weight: 400; }
.pj-util {
  font-size: 11px;
  color: #64748b;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
}

.member-no-project {
  padding: 12px 16px;
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
  font-style: italic;
}

.member-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
}
.member-contract-range { font-size: 11px; color: #94a3b8; }
.member-total-price { font-size: 12px; font-weight: 700; color: #4a6cf7; }
.summary-row-cost .summary-cell-input:focus { background: #fffbe6; }

/* ===== 発注シート ===== */
.po-sheet-table .po-sheet-row td { background: #fff; }
.po-sheet-table .po-sheet-row:nth-child(even) td { background: #fafbfd; }
.po-sheet-table .po-has-amount { color: #1b2438; font-weight: 500; }
.po-sheet-total-row td {
  background: #1e3a5f;
  color: #e8f0ff;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  text-align: right;
  border: 1px solid #16304f;
  padding: 5px 8px;
  white-space: nowrap;
}
.po-sheet-total-row .summary-cell-pj { text-align: left; font-size: 12px; color: #e8f0ff; }
.po-sheet-total-row .summary-cell-fytotal { background: #17304e; }
.po-sheet-total-row .summary-cell-grand   { background: #0f2236; color: #fff; }

/* ===== 原価・販管費見込み — 発注参照行 ===== */
.po-ref-section-header td {
  background: #78350f;
  color: #fef3c7;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 5px 10px;
  border-bottom: 1px solid #92400e;
}
.po-ref-row td {
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
}
.po-ref-row .sheet-cell-value,
.po-ref-row .sheet-cell-total,
.po-ref-row .sheet-cell-grand {
  text-align: right;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #92400e;
}
.po-ref-row .po-ref-amount.has-value { color: #78350f; font-weight: 600; }
.po-ref-subtotal td {
  background: #fef3c7;
  border-top: 2px solid #f59e0b;
  border-bottom: 1px solid #fde68a;
  padding: 5px 8px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  text-align: right;
  white-space: nowrap;
}
.po-ref-subtotal-label {
  text-align: left !important;
  font-weight: 700;
  font-size: 11px;
  color: #78350f;
}

/* ===== Code-Select Combobox ===== */
.cs-wrapper {
  position: relative;
  display: flex;
  align-items: stretch;
}
.cs-wrapper .cs-input {
  flex: 1;
  border-radius: 6px 0 0 6px;
  border-right: none;
}
.cs-wrapper .cs-input:focus {
  z-index: 1;
}
.cs-btn {
  padding: 0 9px;
  border: 1px solid #d5d9e0;
  border-radius: 0 6px 6px 0;
  background: #f5f6fa;
  color: #667;
  cursor: pointer;
  font-size: 11px;
  flex-shrink: 0;
  transition: background .15s;
  line-height: 1;
}
.cs-btn:hover { background: #e8eaf0; color: #333; }
.cs-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 300;
  background: #fff;
  border: 1px solid #c5cad5;
  border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 6px 16px rgba(0,0,0,.12);
  min-width: 100%;
  white-space: nowrap;
}
.cs-dropdown.cs-open { display: block; }
.cs-filter-wrap {
  padding: 6px 8px;
  border-bottom: 1px solid #f0f2f7;
}
.cs-filter {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid #d5d9e0;
  border-radius: 4px;
  font-size: 12px;
  outline: none;
  background: #fafbfc;
}
.cs-filter:focus { border-color: #4a6cf7; background: #fff; }
.cs-list {
  list-style: none;
  max-height: 220px;
  overflow-y: auto;
  margin: 0;
  padding: 4px 0;
}
.cs-option {
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  color: #2d3142;
}
.cs-option:hover { background: #f0f4ff; color: #4a6cf7; }
.cs-option[hidden] { display: none; }
.po-ref-subtotal .po-ref-amount.has-value { color: #78350f; font-weight: 700; }

/* ===== 予測シミュレーション ===== */
.sim-scenario-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.sim-scenario-label { font-size: 12px; font-weight: 600; color: #666; }
.sim-scenario-current {
  padding: 4px 10px;
  background: #4a6cf7;
  color: #fff;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}
.sim-scenario-input-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.sim-input-label { font-size: 12px; font-weight: 600; color: #555; }
.sim-scenario-name-input {
  padding: 6px 10px;
  border: 1px solid #d5d9e0;
  border-radius: 6px;
  font-size: 13px;
  width: 200px;
}
.sim-scenario-name-input:focus { outline: none; border-color: #4a6cf7; }

/* テーブル列幅 */
.sim-table { font-size: 12px; }
.sim-col-type  { width: 72px; min-width: 64px; position: sticky; left: 0;    z-index: 4; background: #f8f9fc; }
.sim-col-pj    { width: 72px; min-width: 64px; position: sticky; left: 71px; z-index: 4; background: #f8f9fc; border-left: none; }
.sim-col-sticky { width: 144px; min-width: 128px; position: sticky; left: 0; z-index: 4; background: #f8f9fc; padding: 0 !important; }
.sim-col-sticky::after { content: ''; position: absolute; top: 0; right: -2px; bottom: -1px; width: 2px; background: #b0b8d0; z-index: 1; }
.sheet-table th.sim-col-sticky { z-index: 4; }
.sim-col-sticky .split-wrap { display: flex; align-items: stretch; }
.sim-col-sticky .split-a { width: 72px; flex-shrink: 0; padding: 8px 6px; border-right: 1px solid #e8eaf0; text-align: center; }
.sim-col-sticky .split-b { width: 72px; flex-shrink: 0; padding: 8px 6px; text-align: center; }
.sim-col-name  { min-width: 140px; }
.sim-col-month { width: 80px; min-width: 72px; text-align: right; }
.sim-col-total { width: 90px; min-width: 80px; text-align: right; }

/* FYヘッダ行 */
.sim-header-fy th {
  background: #1b2438;
  color: #b0c4de;
  font-weight: 700;
  text-align: center;
  padding: 5px 6px;
  border: 1px solid #2d3a5a;
  position: sticky;
  top: 0;
  z-index: 3;
}
.sim-table thead tr:nth-child(2) th {
  top: 28px;
}
.sim-corner { background: #111b2e !important; left: 0; z-index: 5; }

/* セクションヘッダ */
.sim-section-header td {
  background: #2d3a6a;
  color: #c8d8f0;
  font-weight: 700;
  font-size: 11px;
  padding: 5px 10px;
  border-bottom: 1px solid #e8eaf0;
  position: sticky;
  top: var(--sheet-section-top, 60px);
  left: 0;
  z-index: 2;
}

/* 区分セル */
.sim-cell-type {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
}
.sim-cell-sticky { position: sticky; left: 0; z-index: 1; background: #fff; padding: 0 !important; }
.sim-cell-sticky::after { content: ''; position: absolute; top: 0; right: -2px; bottom: -1px; width: 2px; background: #b0b8d0; z-index: 1; }
.sim-cell-sticky .split-wrap { display: flex; align-items: stretch; }
.sim-cell-sticky .split-a { width: 72px; flex-shrink: 0; padding: 4px 6px; text-align: center; font-size: 11px; font-weight: 700; white-space: nowrap; border-right: 1px solid #e8eaf0; }
.sim-cell-sticky .split-b { width: 72px; flex-shrink: 0; padding: 4px 6px; text-align: center; font-size: 11px; color: #555; }
.sim-type-rev  { color: #1a5c9a; background: #f0f8ff; }
.sim-type-cost { color: #7a4000; background: #fff9f0; }
.sim-type-gross { color: #555; background: #f5f5f5; }
.sim-cell-pj { text-align: center; font-size: 11px; color: #555; position: sticky; left: 71px; z-index: 1; background: #fff; border-left: none; }
.sim-cell-name { color: #333; }

/* 売上行 */
.sim-rev td { background: #f0f8ff; border: 1px solid #e8eaf0; padding: 4px 8px; }
.sim-rev .sim-cell-pj, .sim-rev .sim-cell-name { background: #f0f8ff; }

/* 原価行 */
.sim-cost td { background: #fff9f0; border: 1px solid #e8eaf0; padding: 4px 8px; }

/* 粗利行 */
.sim-gross td { background: #f8f8f8; border: 1px solid #e8eaf0; padding: 4px 8px; }

/* 特殊コスト行 */
.sim-special td { background: #f6f8ff; border: 1px solid #e8eaf0; padding: 4px 8px; }

/* 入力セル */
.sim-input-td { padding: 0 !important; }
.sim-input {
  display: block;
  width: 100%;
  min-width: 78px;
  padding: 4px 8px;
  border: none;
  background: transparent;
  text-align: right;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: #2d3142;
  outline: none;
  -moz-appearance: textfield;
}
.sim-input::-webkit-inner-spin-button,
.sim-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.sim-input:focus { background: #fffbe6; box-shadow: inset 0 0 0 2px #f4b942; }

/* 計算セル（粗利・合計） */
.sim-calc-td, .sim-total-td, .sim-profit-td {
  text-align: right;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid #e8eaf0;
}

/* 年度計セル */
.sim-fy-total {
  text-align: right;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  border: 1px solid #e8eaf0;
  background: #f0f4ff;
  color: #2d3a6a;
}

/* 既存月（読み取り専用）列ヘッダ */
.sim-col-hist { background: #e8edf5 !important; color: #6b7a99 !important; }
.sim-hist-fy-label {
  background: #2a3550 !important;
  color: #7a9cbf !important;
  font-style: italic;
}
.sim-future-fy-label {
  background: #1b2438 !important;
  color: #b0c4de !important;
}

/* 既存月（読み取り専用）データセル */
.sim-hist-td {
  text-align: right;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid #e0e4ec;
  background: #f4f6fb;
  color: #7a8aaa;
  cursor: default;
}
.sim-rev .sim-hist-td    { background: #e8f3fc; color: #7aa5c5; }
.sim-cost .sim-hist-td   { background: #fdf5ea; color: #c09060; }
.sim-gross .sim-hist-td  { background: #f2f2f2; color: #888; }
.sim-special .sim-hist-td { background: #eef1fc; color: #7a88c0; }

/* メンバープロジェクト行（サマリ・シミュレーション共通） */
.summary-member-pj td:first-child { border-left: 3px solid #4a9c4a !important; }
.sim-member-pj .sim-type-rev { border-left: 3px solid #4a9c4a !important; }

/* カテゴリ集計行（シミュレーション） */
.sim-cat-rev td  { background: #d8f0d8; }
.sim-cat-cost td { background: #f0e8d0; }
.sim-cat-gross td { background: #f0f0e8; }
.sim-cat-rev .sim-type-rev   { background: #c8e8c8; color: #1a5c1a; }
.sim-cat-cost .sim-type-cost { background: #e8d8b8; color: #7a4000; }
.sim-cat-rev .sim-hist-td    { background: #c0e4c0; color: #2a6c2a; }
.sim-cat-cost .sim-hist-td   { background: #e8d4b0; color: #8a5020; }
.sim-cat-gross .sim-hist-td  { background: #e4e4d4; color: #666; }
.sim-cat-display-td { text-align: right; padding: 4px 8px; font-size: 12px; white-space: nowrap; }
.sim-cat-calc-td    { text-align: right; padding: 4px 8px; font-size: 12px; white-space: nowrap; }
.sim-category-item td { opacity: 0.9; }

/* 既存月の合計セル */
.sim-hist-total { background: #e8ecf8 !important; color: #8090b8 !important; }

/* sheet-fy-label（FYセレクタ前テキスト） */
.sheet-fy-label { font-size: 12px; color: #666; margin-right: 4px; }

/* 正負の色分け */
.sim-pos { color: #1a6e3c !important; background: #edfaf3 !important; font-weight: 700; }
.sim-neg { color: #842029 !important; background: #fdf0f0 !important; font-weight: 700; }

/* 合計行 */
.sim-total-rev td, .sim-total-cost td, .sim-total-profit td {
  font-weight: 700;
  border: 1px solid #c8d0e8;
  padding: 5px 8px;
}
.sim-total-rev    td { background: #dceeff; color: #0d3f70; }
.sim-total-cost   td { background: #ffeedd; color: #5a2e00; }
.sim-total-profit td { background: #d4f4e0; color: #1a5c30; font-size: 13px; }
.sim-total-label {
  text-align: left !important;
  font-family: inherit;
  font-size: 12px;
}
.sim-total-profit .sim-neg { background: #f8d7da !important; color: #842029 !important; }
.sim-total-profit .sim-pos { background: #d4f4e0 !important; color: #1a5c30 !important; }

/* FY別合計セル・総計セル（サマリ同等構成） */
.sim-col-contract { width: 92px; min-width: 80px; text-align: right; }
.sim-col-end      { width: 78px; min-width: 68px; text-align: center; }
.sim-col-fytotal  { width: 88px; min-width: 78px; text-align: right; background: #f0f4ff !important; }
.sim-col-grand    { width: 96px; min-width: 86px; text-align: right; background: #e6ecff !important; }

.sim-fytotal {
  text-align: right;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border: 1px solid #e0e4f0;
  background: #f0f4ff;
  color: #3a4e80;
}
.sim-grand-total {
  text-align: right;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  border: 1px solid #d0d8f8;
  background: #e6ecff;
  color: #2d3a6a;
}

/* 按分行 */
.sim-alloc td { background: #f3f0ff; border: 1px solid #e8eaf0; padding: 4px 8px; }
.sim-alloc .sim-hist-td { background: #ece8f8; color: #7070b8; }
.sim-type-alloc { color: #6040a0; font-size: 11px; font-style: italic; }
.sim-alloc-simulation td { background: #fff8ec; border-color: #f5d78e; }
.sim-alloc-simulation .sim-hist-td { background: #fef3d0; color: #a07020; }
.sim-badge-simulation { display: inline-block; background: #e8a000; color: #fff; font-size: 9px; font-weight: 700; padding: 1px 4px; border-radius: 3px; letter-spacing: 0.5px; }
.sim-cell-contract { text-align: right; font-family: 'Courier New', monospace; font-size: 11px; color: #555; }
.sim-cell-end      { text-align: center; font-size: 11px; color: #666; }

/* 合計行 FY・総計セル */
.sim-total-rev .sim-fytotal, .sim-total-rev .sim-grand-total { background: #c8e8ff; color: #0d3f70; font-weight: 700; border-color: #a0c8f0; }
.sim-total-cost .sim-fytotal, .sim-total-cost .sim-grand-total { background: #ffddc8; color: #5a2e00; font-weight: 700; border-color: #f0c0a0; }
.sim-total-profit .sim-fytotal, .sim-total-profit .sim-grand-total { background: #c0f0d0; color: #1a5c30; font-weight: 700; border-color: #90d8b0; }

/* 共通費グループシミュレーションパネル */
.group-sim-panel { margin-top: 28px; border-radius: 8px; overflow: hidden; border: 1px solid #c8d0e8; }
.group-sim-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: #2d3a6a; color: #c8d8f0;
  cursor: pointer; font-weight: 700; font-size: 13px; user-select: none;
}
.group-sim-panel-header:hover { background: #3a4a80; }
.group-sim-panel-body { background: #fff; padding: 16px; }
.group-sim-collapsed .group-sim-panel-body { display: none; }

/* ── 予実管理・着地見込み ─────────────────────────────────── */
.pl-tabs { display: flex; gap: 4px; margin: 0 0 16px; border-bottom: 2px solid #e0e4ef; }
.pl-tab-link {
  padding: 8px 20px; font-size: 13px; font-weight: 600; color: #666;
  text-decoration: none; border-radius: 4px 4px 0 0;
  border: 1px solid transparent; border-bottom: none; margin-bottom: -2px;
}
.pl-tab-link:hover { color: #4a6cf7; background: #f0f4ff; }
.pl-tab-link.active {
  color: #4a6cf7; background: #fff;
  border-color: #e0e4ef; border-bottom-color: #fff;
}
.num-cell { text-align: right !important; font-family: 'Courier New', monospace; color: #1b2438; }
.num-cell.total-cell { font-weight: 700; }
.pl-table { font-size: 12px; }
.pl-col-code { width: 64px; white-space: nowrap; }
.pl-col-name { min-width: 140px; }
.pl-col-item { width: 90px; white-space: nowrap; font-size: 11px; color: #555; }
.pl-label-budget   { color: #1d4ed8; }
.pl-label-actual   { color: #047857; }
.pl-label-variance { color: #b45309; }
.pl-label-cumulative { color: #7c3aed; font-size: 10px; }
.pl-row-budget   td { background: #f0f6ff; }
.pl-row-actual   td { background: #f0fdf4; }
.pl-row-variance td { background: #fffbeb; }
.pl-row-cumulative td { background: #faf5ff; border-bottom: 2px solid #e0e4ef; }
.num-positive { color: #047857; font-weight: 600; }
.num-negative { color: #b91c1c; font-weight: 600; }
.landing-actual-th    { background: #dbeafe; }
.landing-forecast-th  { background: #fef9c3; }
.landing-actual-cell  { background: #eff6ff; }
.landing-forecast-cell{ background: #fefce8; }
.pl-landing-legend { display: flex; gap: 16px; margin-bottom: 12px; font-size: 12px; }
.legend-actual   { color: #1d4ed8; }
.legend-forecast { color: #b45309; }
.empty-state-box { padding: 32px; text-align: center; color: #666; background: #f8f9fc;
  border: 1px dashed #d1d5db; border-radius: 8px; margin: 24px 0; }

/* ── 実績値入力 ───────────────────────────────────────────── */
.actual-scope-selector { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.scope-label { font-size: 13px; color: #666; }
.actual-table { font-size: 12px; }
.actual-col-code  { width: 64px; white-space: nowrap; }
.actual-col-name  { min-width: 160px; }

/* 四半期列ヘッダーの色分け */
.actual-col-q1 { background: #dbeafe !important; color: #1e40af !important; }
.actual-col-q2 { background: #dcfce7 !important; color: #166534 !important; }
.actual-col-q3 { background: #fef3c7 !important; color: #92400e !important; }
.actual-col-q4 { background: #ede9fe !important; color: #5b21b6 !important; }

/* セル型入力 */
.actual-cell-td { padding: 0 !important; }
.actual-cell-q1 { background: #eff6ff; }
.actual-cell-q2 { background: #f0fdf4; }
.actual-cell-q3 { background: #fffbeb; }
.actual-cell-q4 { background: #faf5ff; }
.actual-cell-input {
  display: block;
  width: 100%;
  min-width: 72px;
  padding: 4px 6px;
  border: none;
  background: transparent;
  text-align: right;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: #2d3142;
  outline: none;
  -moz-appearance: textfield;
}
.actual-cell-input::-webkit-inner-spin-button,
.actual-cell-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.actual-cell-input:focus { background: #fffbe6; box-shadow: inset 0 0 0 2px #f4b942; }
.actual-row-empty td { color: #bbb; }

/* ── 差異シート ──────────────────────────────────────────── */
.diff-table { font-size: 11px; }
.diff-header-months th { text-align: center; background: #f0f2f7; font-size: 11px; }
.diff-month-group { border-left: 2px solid #d1d5db; }
.diff-col { width: 66px; white-space: nowrap; }
.diff-forecast { background: #f0f6ff; color: #1d4ed8; }
.diff-actual   { background: #f0fdf4; color: #047857; }
.diff-gap      { background: #fffbeb; }
.diff-corner   { background: #f0f2f7; }

/* ── PJ別原価 ────────────────────────────────────────────── */
.pj-cost-table { font-size: 12px; }
.pj-cost-table .desc-cell { max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filter-bar { margin-bottom: 16px; }
.filter-form { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.filter-select { padding: 5px 8px; font-size: 13px; border: 1px solid #dde1f0; border-radius: 4px; }
.filter-input  { padding: 5px 10px; font-size: 13px; border: 1px solid #dde1f0; border-radius: 4px; width: 220px; }
.result-count  { font-size: 12px; color: #888; margin-top: 8px; }
.mono { font-family: monospace; font-size: 12px; }

/* ── 売上・入金計画 ──────────────────────────────────────── */
.revenue-table { font-size: 12px; }
.rev-col-pj       { width: 72px; white-space: nowrap; }
.rev-col-name     { min-width: 140px; }
.rev-col-contract { width: 100px; }
.revenue-input-cell { padding: 2px; }
.revenue-input { width: 80px; padding: 3px 6px; font-size: 12px; text-align: right;
  border: 1px solid #dde1f0; border-radius: 3px; font-family: inherit; }
.revenue-input:focus { border-color: #4a6cf7; outline: none; background: #f0f4ff; }
.section-title { font-size: 14px; font-weight: 700; color: #2d3142; margin: 16px 0 10px; }

/* ── グループ共通科目 ────────────────────────────────────── */
.accounts-table { font-size: 12px; }
.row-discontinued td { color: #aaa; text-decoration: line-through; }
.text-center { text-align: center; }

/* ── ドラッグコピー ──────────────────────────────────────── */
.drag-source { outline: 2px solid #4a6cf7 !important; }
.drag-copied { background: #d0f0c0 !important; transition: background 0.4s; }

/* ── FY グループヘッダー ─────────────────────────────────── */
.sheet-fy-group-header th { background: #e8ecf8; text-align: center; font-size: 11px; font-weight: 700; padding: 3px 6px; }
.fy-group-label { border-left: 2px solid #b0b8d8; color: #3a4a7a; }

/* ===== シナリオ比較 ===== */
.sim-compare-btn { background: #f0f4ff; color: #4a6cf7; border: 1px solid #c0ccff; }
.sim-compare-btn:hover { background: #4a6cf7; color: #fff; }

/* ── diff ビュー ── */
.sim-diff-summary {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 13px; margin-bottom: 12px; color: #444;
}
.sim-diff-scenario-badge {
  display: inline-block; padding: 2px 10px; border-radius: 10px;
  font-size: 12px; font-weight: 700;
}
.sim-diff-badge-0 { background: #dbeafe; color: #1d4ed8; }
.sim-diff-badge-1 { background: #dcfce7; color: #15803d; }
.sim-diff-badge-2 { background: #fef9c3; color: #92400e; }
.sim-diff-badge-3 { background: #fce7f3; color: #9d174d; }

.sim-diff-table { font-size: 12px; }
.sim-diff-th-scenario { min-width: 120px; }
.sim-diff-th-type { width: 72px; min-width: 64px; }
.sim-diff-th-pj  { width: 72px; min-width: 64px; }

/* プロジェクトグループヘッダー */
.sim-diff-pj-header td {
  background: #e8ecf8; color: #1a2448;
  font-weight: 700; font-size: 12px; padding: 6px 12px;
  border: 1px solid #c8d0e8; border-top: 3px solid #4a6cf7;
}

/* シナリオ名セル */
.sim-diff-scenario-cell {
  font-weight: 700; font-size: 11px; white-space: nowrap;
  padding: 4px 10px !important;
}
.sim-diff-label-0 { color: #1d4ed8; }
.sim-diff-label-1 { color: #15803d; }
.sim-diff-label-2 { color: #92400e; }
.sim-diff-label-3 { color: #9d174d; }

/* シナリオ切り替わり行（2つ目以降のシナリオの最初の行）に区切り線 */
.sim-diff-new-scenario td { border-top: 2px solid #b0b8d0 !important; }

.sim-diff-cell { text-align: right; white-space: nowrap; }
.sim-diff-changed {
  background: #fde68a !important;
  color: #78350f !important;
  font-weight: 700;
}
.sim-diff-fy-col  { border-left: 2px solid #c0ccff !important; }
.sim-diff-grand-col { border-left: 2px solid #a0b0ff !important; font-weight: 700; }

/* プロジェクト間スペーサー */
.sim-diff-separator td { height: 8px; background: #f1f5f9; border: none; }

/* ── 共通 ────────────────────────────────────────────────── */
.empty-msg { text-align: center; padding: 32px; color: #888; }
.sheet-save-bar { padding: 12px 0; display: flex; gap: 8px; }
.btn-save { background: #4a6cf7; color: #fff; border: none; padding: 8px 24px;
  border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; }

/* ── 原価・販管費シート 底部バー ─────────────────────────── */
.cf-bottom-bar {
  position: sticky;
  bottom: 0;
  z-index: 40;
  background: #fff;
  border-top: 1px solid #d0d7e6;
  box-shadow: 0 -2px 8px rgba(0,0,0,.08);
}
.cf-bottom-bar-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
}
.cf-add-row-form {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}
.cf-add-row-form .cf-meta-select { flex-shrink: 0; width: 72px; }
.cf-add-row-form .cf-ac-wrap { flex: 1; min-width: 0; }
.cf-add-row-form .cf-bar-wide { flex: 1.5; }
.cf-bottom-bar .cf-ac-dropdown {
  top: auto;
  bottom: calc(100% + 2px);
  border-radius: 6px;
  max-height: 220px;
}
.cf-add-row-btn {
  background: none;
  border: 1px dashed #4a6cf7;
  color: #4a6cf7;
  border-radius: 4px;
  padding: 5px 14px;
  font-size: 12px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.cf-add-row-btn:hover { background: #4a6cf7; color: #fff; }
.cf-save-new-btn { margin-left: auto; }

/* auto-save ステータス */
.sheet-data-row[data-save-status="pending"] .sheet-cell-no,
.sheet-data-row[data-save-status="saving"]  .sheet-cell-no {
  color: #888;
}
.sheet-data-row[data-save-status="saving"]::after {
  content: '';
}
.sheet-data-row[data-save-status="saved"] {
  animation: cf-save-flash .6s ease-out;
}
@keyframes cf-save-flash {
  0%   { background: #d1fae5; }
  100% { background: transparent; }
}
.sheet-data-row[data-save-status="error"] td {
  outline: 1px solid #e53e3e !important;
}

.cf-new-badge {
  font-size: 10px;
  font-weight: 700;
  color: #4a6cf7;
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.cf-del-row-btn {
  background: none;
  border: 1px solid #d0d0d0;
  color: #c0c0c0;
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 11px;
  cursor: pointer;
  line-height: 1.4;
  transition: background .15s, color .15s, border-color .15s;
}
.cf-del-row-btn:hover { border-color: #e53e3e; color: #e53e3e; }
.cf-new-row td { background: #f0f4ff !important; }
.cf-row-latest td { background: #fef9c3 !important; border-left: 3px solid #f59e0b !important; }
.cf-meta-input, .cf-meta-select {
  width: 100%;
  min-width: 60px;
  padding: 3px 6px;
  border: 1px solid #c5cee0;
  border-radius: 4px;
  font-size: 12px;
  background: #fff;
  color: #2d3142;
}
.cf-meta-input:focus, .cf-meta-select:focus {
  border-color: #4a6cf7;
  outline: none;
  box-shadow: 0 0 0 2px rgba(74,108,247,.15);
}

/* ── Autocomplete ドロップダウン ─────────────────────────── */
.cf-ac-wrap { position: relative; }
.cf-ac-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  min-width: 180px;
  max-height: 180px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #c5cee0;
  border-radius: 6px;
  box-shadow: 0 6px 16px rgba(0,0,0,.14);
  z-index: 200;
}
.cf-ac-dropdown.open { display: block; }
.cf-ac-item {
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cf-ac-item:hover { background: #eef1ff; }

/* ── フィルターサジェスト ─────────────────────────────────── */
.cf-filter-sugg-list {
  width: 100%;
  border-top: 1px solid #e8ecf0;
  margin-top: 4px;
  padding-top: 4px;
}
.cf-filter-sugg-item {
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cf-filter-sugg-item:hover { background: #eef1ff; }

/* ── DB確認モーダル ───────────────────────────────────────── */
.cf-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cf-modal-box {
  background: #fff;
  border-radius: 10px;
  padding: 28px 32px;
  min-width: 300px;
  box-shadow: 0 12px 40px rgba(0,0,0,.2);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.cf-modal-msg { font-size: 14px; color: #2d3142; line-height: 1.6; }
.cf-modal-btns { display: flex; gap: 10px; justify-content: flex-end; }
.btn-save:hover { background: #3a5cf7; }

/* ── プロジェクトページ ──────────────────────────────────── */
.window-section { margin-bottom: 24px; }
.window-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: #f5f7fb; border: 1px solid #e2e6f0;
  border-radius: 6px; cursor: pointer; user-select: none;
}
.window-section-header:hover { background: #eaeef7; }
.window-section-header .section-title { margin: 0; border: none; padding: 0; }
.window-section-body { padding: 16px; border: 1px solid #e2e6f0; border-top: none; border-radius: 0 0 6px 6px; }
.window-section-body.accordion-collapsed { display: none; }
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */
