/* 他の社内アプリ（参画者プロフィール・参画者契約管理など）と同じデザインに揃えている。アクセント色だけアプリごとに変える */
:root {
  --bg: #F7F8FA;
  --surface: #FFFFFF;
  --border: #E4E7EC;
  --soft: #F3F4F6;
  --accent: #0D9488;
  --accent-light: #E6F6F4;
  --text-primary: #111827;
  --text-secondary: #5B6370;
  --text-muted: #9BA1AA;
  --danger: #D6363C;
  --danger-bg: #FCE6E6;
  --thumb: 40px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scrollbar-gutter: stable; overflow-x: hidden; }
body { font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Hiragino Kaku Gothic Pro', 'Noto Sans JP', 'Inter', sans-serif; background: var(--bg); color: var(--text-primary); font-size: 14px; }
button, input, select, textarea { font-family: inherit; }
[hidden] { display: none !important; }
svg { flex: none; }

.app-header {
  background: var(--surface); border-bottom: 1px solid #EEF0F3; height: 68px;
  padding: 0 28px; display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 100;
}
.app-header .logo { display: flex; align-items: center; gap: 12px; height: 36px; text-decoration: none; color: inherit; }
.app-header .logo-badge {
  width: 36px; height: 36px; background: var(--accent); border-radius: 8px;
  display: flex; align-items: center; justify-content: center; color: white; flex: none;
}
.app-header .logo-badge svg { width: 22px; height: 22px; }
.app-title { font-size: 16px; font-weight: 600; color: var(--text-primary); margin: 0 20px 0 0; white-space: nowrap; line-height: 1; }
.header-right { margin-left: auto; display: flex; align-items: center; height: 36px; gap: 12px; font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.page-tabs { display: flex; gap: 4px; margin-left: 20px; min-width: 0; overflow-x: auto; }
.page-tab { flex: none; height: 32px; padding: 0 14px; display: inline-flex; align-items: center; gap: 6px; border: none; border-radius: 8px; background: none; font-size: 13px; font-weight: 600; color: var(--text-secondary); text-decoration: none; cursor: pointer; }
.page-tab:hover { background: var(--soft); color: var(--text-primary); }
.page-tab.on { background: var(--accent-light); color: var(--accent); }
.page-tab .tab-count { font-size: 12px; font-weight: 500; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.page-tab.on .tab-count { color: var(--accent); }

.main { max-width: 1180px; margin: 0 auto; padding: 14px 28px 80px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; }
.panel.flush { padding: 0; overflow: hidden; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 18px; }
.toolbar .count-label { margin-left: auto; font-size: 12px; color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.search-field { position: relative; display: flex; align-items: center; }
.search-field > span { position: absolute; left: 10px; display: flex; color: var(--text-muted); pointer-events: none; }
.search-field svg { width: 14px; height: 14px; }
input[type=search] {
  height: 36px; width: 200px; border: 1px solid var(--border); border-radius: 8px; padding: 0 10px 0 32px;
  font-size: 13px; background: var(--surface); color: var(--text-primary); outline: none;
}
input[type=search]:focus { border-color: var(--accent); }
.filter-select { height: 36px; max-width: 240px; border: 1px solid var(--border); border-radius: 8px; padding: 0 10px; font-size: 13px; background: var(--surface); color: var(--text-primary); }

.icon-btn {
  height: 28px; width: 28px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; justify-content: center; flex: none; text-decoration: none;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { color: var(--text-primary); background: var(--bg); }
.icon-btn.danger:hover { color: var(--danger); }
.icon-btn.spinning svg { animation: spin .8s linear infinite; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none; text-decoration: none; height: 32px; padding: 0 18px; border: none; border-radius: 8px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(0.95); }
.btn:disabled { opacity: 0.5; cursor: default; filter: none; }
.btn svg { width: 16px; height: 16px; }
.head-btn { padding: 0 14px; }
.btn-secondary { background: var(--surface); color: var(--text-primary); border: 1px solid var(--border); font-weight: 500; }
.btn-secondary:hover { background: var(--bg); filter: none; }

.table-scroll { overflow: auto; }
table.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.data-table th {
  text-align: left; font-weight: 600; color: #FFFFFF; font-size: 13px; line-height: 1.3; white-space: nowrap;
  padding: 7px 8px; border-bottom: 1px solid #4B5563; background: #4B5563;
}
table.data-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); color: var(--text-primary); vertical-align: middle; }
table.data-table th:first-child, table.data-table td:first-child { padding-left: 18px; }
table.data-table th:last-child, table.data-table td:last-child { padding-right: 18px; }
table.data-table tbody tr:last-child td { border-bottom: none; }
.item-table tbody tr { cursor: pointer; }
@media (hover: hover) and (pointer: fine) {
  .item-table tbody tr:hover td { background: #FAFBFC; }
}
.item-table .c-no { width: 48px; font-variant-numeric: tabular-nums; }
.item-table td.c-no { color: var(--text-secondary); }
.item-table .c-image { width: calc(var(--thumb) + 16px); }

.thumb {
  width: var(--thumb); height: var(--thumb); border-radius: 6px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; background: var(--soft); color: #C7CCD3;
}
.thumb svg { width: 50%; height: 50%; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.dim { color: var(--text-muted); }
.empty { padding: 16px 0; font-size: 13px; color: var(--text-muted); }
.panel-empty { padding: 48px 18px; display: flex; flex-direction: column; align-items: center; gap: 14px; font-size: 13px; color: var(--text-muted); text-align: center; }
.loader { display: flex; justify-content: center; padding: 48px; color: var(--text-muted); }
.loader svg { width: 20px; height: 20px; animation: spin .8s linear infinite; }

.page-head { position: relative; display: flex; align-items: center; gap: 10px; margin: 6px 0 18px; }
.page-head h2 { font-size: 18px; font-weight: 600; flex: 1; min-width: 0; line-height: 1.6; }
@media (min-width: 1220px) { .page-head .back-btn { position: absolute; left: -44px; top: 50%; transform: translateY(-50%); } }

.info-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 0 18px 4px; min-width: 0; }
.info-card-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-primary); line-height: 20px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.info-card-title svg { flex: none; width: 16px; height: 16px; color: var(--accent); }
.setting-card { margin-bottom: 16px; padding-bottom: 14px; }
.badge { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-linked { background: #DCFCE7; color: #166534; }
.badge-unlinked { background: var(--danger-bg); color: var(--danger); }
.select-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--soft); min-height: 60px; }
.select-row:last-child, .select-row.box-row { border-bottom: none; }
.select-label { flex: none; width: 168px; display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-secondary); overflow-wrap: anywhere; }
.select-value { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-primary); overflow: hidden; }
.select-value.dim { color: var(--text-muted); }
.select-value svg { width: 14px; height: 14px; color: var(--text-secondary); }
.select-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.select-path { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--text-muted); }
.name-input { width: 100%; height: 36px; border: 1px solid var(--border); border-radius: 8px; padding: 0 10px; font-size: 13px; font-weight: 400; color: var(--text-primary); background: var(--surface); outline: none; }
.name-input:focus { border-color: var(--accent); }

.modal { position: fixed; inset: 0; z-index: 2000; background: rgba(17, 24, 39, 0.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-dialog { position: relative; width: 760px; max-width: 100%; max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--bg); border-radius: 12px; overflow: hidden; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2); }
.modal-dialog.tall { height: 80vh; }
.modal-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; }
.modal-close { position: absolute; top: 10px; right: 10px; z-index: 1; width: 32px; height: 32px; border-radius: 50%; border: none; background: var(--surface); color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15); }
.modal-close svg { width: 16px; height: 16px; }
.modal .info-card-title { padding-right: 40px; }
.modal-foot { flex: none; display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface); }

.picker-search { display: flex; gap: 8px; padding-top: 14px; }
.picker-search input { flex: 1; min-width: 0; height: 36px; border: 1px solid var(--border); border-radius: 8px; padding: 0 12px; font-size: 13px; outline: none; }
.picker-search input:focus { border-color: var(--accent); }
.picker-search .btn { height: 36px; }
.breadcrumb { font-size: 12px; color: var(--text-secondary); margin: 12px 0 6px; }
.breadcrumb a { color: var(--accent); text-decoration: none; cursor: pointer; }
.picker-current { padding: 6px 0 10px; }
.file-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--soft); min-height: 48px; }
.file-row:last-child { border-bottom: none; }
.file-row .name { all: unset; display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; font-size: 13px; color: var(--text-primary); cursor: pointer; }
.file-row .name:hover { color: var(--accent); }
.file-row .name svg { width: 14px; height: 14px; }
.file-row .name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .path { min-width: 0; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--text-muted); }

.edit-card { padding: 4px 18px; }
.edit-row { display: grid; grid-template-columns: 168px minmax(0, 1fr); align-items: center; padding: 6px 0; border-bottom: 1px solid var(--soft); min-width: 0; }
.edit-row:last-child { border-bottom: none; }
.edit-label { padding-right: 12px; font-size: 12px; font-weight: 600; color: var(--text-secondary); overflow-wrap: anywhere; line-height: 18px; }
.edit-field { min-width: 0; }
.edit-input { width: 100%; height: 36px; border: 1px solid var(--border); border-radius: 8px; padding: 0 10px; font-size: 13px; color: var(--text-primary); background: var(--surface); outline: none; }
.edit-input:focus { border-color: var(--accent); }
.image-field { display: flex; align-items: center; gap: 10px; }
.image-field .thumb { --thumb: 64px; }
.image-inputs { flex: 1; min-width: 0; display: grid; gap: 6px; justify-items: start; }
.image-inputs input[type=file] { display: none; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); z-index: 3000;
  max-width: calc(100% - 32px); padding: 10px 14px; border-radius: 8px; font-size: 13px;
  background: #DCFCE7; color: #166534; box-shadow: 0 4px 12px rgba(17, 24, 39, 0.12);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger-bg); color: var(--danger); }

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

@media (max-width: 640px) {
  .app-header { column-gap: 6px; padding: 0 14px; }
  .app-header .logo { flex: none; }
  .page-tabs { margin-left: 4px; flex: 1; }
  .page-tab { padding: 0 10px; }
  .app-title { display: none; }
  .main { padding: 14px 14px 60px; }
  .toolbar .search-field, .toolbar input[type=search] { flex: 1; width: auto; min-width: 0; }
  .toolbar .filter-select { flex-basis: 100%; max-width: none; }
  .toolbar .count-label { display: none; }
  .item-table thead { display: none; }
  .item-table, .item-table tbody { display: block; }
  .item-table tbody tr {
    display: grid; grid-template-columns: var(--thumb) minmax(0, 1fr); column-gap: 12px;
    padding: 14px; border-top: 8px solid var(--bg);
  }
  .item-table tbody tr:first-child { border-top: none; }
  .item-table td { display: flex; gap: 8px; grid-column: 2; padding: 1px 0 !important; border: none; }
  .item-table td::before { content: attr(data-label); flex: none; width: 96px; font-size: 12px; font-weight: 600; color: var(--text-secondary); line-height: 18px; }
  .item-table td.blank { display: none; }
  .item-table td.c-no { width: auto; gap: 0; font-weight: 600; color: var(--text-primary); }
  .item-table td.c-no::before { content: "No."; width: auto; font-size: inherit; font-weight: inherit; color: inherit; line-height: inherit; }
  .item-table td.c-image { grid-column: 1; grid-row: 1 / span 30; width: auto; }
  .item-table td.c-image::before { content: none; }
  :root { --thumb: 56px; }
  .modal { padding: 0; }
  .modal-dialog, .modal-dialog.tall { width: 100%; height: 100%; max-height: none; border-radius: 0; }
  .select-row { flex-wrap: wrap; }
  .select-label { width: 100%; }
  .edit-row { grid-template-columns: minmax(0, 1fr); row-gap: 4px; }
}
