/* =========================================================
   タケノコ — 社内向け業務画面

   YouTube のデザイン原則に沿う。
     ・UIの主役は白・グレー・黒。色は意味のある箇所にだけ使う
       （評価の序列、締切の切迫、リンク、受注の達成）
     ・境界線は控えめに。案件ごとの区切りだけ引き、あとは余白とホバーで示す
     ・選択状態は黒地に白抜き、リンクは青、注意は赤
     ・角は大きめに丸める（チップとボタンは完全な丸）

   ビルド工程を持たないよう、素のCSSで書く。
   ========================================================= */

:root {
  --bg:        #FFFFFF;
  --bg-soft:   #F9F9F9;
  --hover:     #F2F2F2;
  --hover-2:   #E5E5E5;

  --ink:       #0F0F0F;
  --ink-2:     #606060;
  --muted:     #909090;

  --line:      #E5E5E5;

  /* 意味を持つ色だけを使う */
  --link:      #065FD4;   /* リンク */
  --danger:    #CC0000;   /* 締切が迫っている */
  --ok:        #1E7B34;   /* 受注など達成 */

  /* 評価。良い→注意 の順に緑・青・橙・灰。
     締切の赤とは役割が重ならないよう、評価に赤は使わない */
  --gr-s:      #137333;
  --gr-a:      #1A73E8;
  --gr-b-bg:   #FEF0D5;
  --gr-b-ink:  #A15C00;
  --gr-c-bg:   #F1F3F4;
  --gr-c-ink:  #7A7A7A;

  --r-sm:  8px;
  --r:    12px;
  --r-lg: 16px;

  --side-w: 240px;
  --head-h: 56px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont,
               "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* =========================================================
   ヘッダー
   ========================================================= */

.appbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--head-h);
  background: var(--bg);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
}

.brand { display: flex; align-items: center; text-decoration: none; flex: 0 0 auto; }
.brand .name { font-size: 18px; font-weight: 700; letter-spacing: .04em; }

/* 検索バー */
.appbar .search { flex: 1 1 auto; max-width: 600px; }
.appbar .search form { display: flex; }
.appbar .search input {
  flex: 1;
  height: 40px;
  border: 1px solid var(--hover-2);
  border-right: none;
  border-radius: 999px 0 0 999px;
  padding: 0 16px;
  font: inherit;
  background: var(--bg);
}
.appbar .search input:focus {
  outline: none;
  border-color: var(--link);
  box-shadow: inset 0 0 0 1px var(--link);
}
.appbar .search button {
  width: 64px;
  border: 1px solid var(--hover-2);
  border-radius: 0 999px 999px 0;
  background: var(--bg-soft);
  cursor: pointer;
  font-size: 15px;
  color: var(--ink-2);
}
.appbar .search button:hover { background: var(--hover); }

.appbar .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
  text-decoration: none;
}
.appbar .who { font-size: 13px; color: var(--ink-2); }

/* =========================================================
   レイアウト
   ========================================================= */

.shell { display: flex; align-items: flex-start; }

.sidebar {
  position: sticky;
  top: var(--head-h);
  flex: 0 0 var(--side-w);
  width: var(--side-w);
  height: calc(100vh - var(--head-h));
  overflow-y: auto;
  padding: 8px 12px 40px;
  background: var(--bg);
}

.side-group { padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.side-group:last-child { border-bottom: none; }
.side-group .label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  padding: 8px 12px 4px;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  text-decoration: none;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.3;
}
.side-link:hover { background: var(--hover); }
.side-link.is-active { background: var(--hover); font-weight: 600; }
.side-link .ico { width: 20px; text-align: center; font-size: 15px; flex: 0 0 20px; }
.side-link .n { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.main { flex: 1 1 auto; min-width: 0; padding: 12px 24px 72px; max-width: 1320px; }

/* =========================================================
   フィルターチップ
   ========================================================= */

.chips {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 0 12px;
  margin-bottom: 8px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--hover);
  color: var(--ink);
  font-size: 13.5px;
  text-decoration: none;
  white-space: nowrap;
  border: none;
}
.chip:hover { background: var(--hover-2); }
.chip.is-on { background: var(--ink); color: #fff; }
.chip.is-on:hover { background: #272727; }

/* =========================================================
   見出し
   ========================================================= */

.page-title { display: flex; align-items: baseline; gap: 12px; margin: 4px 0 2px; }
.page-title h1 { font-size: 20px; font-weight: 700; margin: 0; }
.page-title .count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.page-sub { color: var(--muted); font-size: 13px; margin: 0 0 14px; }

/* =========================================================
   一覧
   ========================================================= */

.rows-head {
  display: grid;
  grid-template-columns: 34px minmax(0,1fr) auto auto auto auto;
  align-items: center;
  gap: 16px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--hover-2);
}
.rows-head .sortable {
  text-decoration: none;
  color: var(--ink-2);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.rows-head .sortable:hover { background: var(--hover); color: var(--ink); }
.rows-head .sortable.is-on { background: var(--ink); color: #fff; font-weight: 600; }
.rows-head .arrow { margin-left: 4px; font-size: 10px; }
.rows-head .col-dl  { min-width: 96px; text-align: right; }
.rows-head .col-st  { min-width: 64px; }
.rows-head .col-asg { width: 28px; }
.rows-head .col-ext { width: 32px; }

.rows { padding-top: 0; }

/* 案件ごとの区切り。
   角丸のホバーだけでは境目が分かりにくかったため、
   薄い線を引いて1件ずつの範囲を明示する。
   線は主張させず、ホバーの面で選択中を示す役割は残す。 */
.row {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0,1fr) auto auto auto auto;
  align-items: center;
  gap: 16px;
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
  color: inherit;
}
.row:hover { background: var(--hover); }
.rows .row:last-child { border-bottom: none; }

/* タイトルのリンクを行全体に広げる。
   行のどこを押しても詳細へ飛べるが、
   原文リンクは上に重ねられる（入れ子の<a>を避けるため） */
.row .ttl-link { text-decoration: none; color: inherit; }
.row .ttl-link::after { content: ''; position: absolute; inset: 0; z-index: 0; }

/* 募集ページ（原文）へ飛ぶボタン。行リンクより手前に置く。
   グレーの矢印だけでは押せると気づかれなかったため、
   常時うっすら面を敷き、色もリンク色にして「押せるもの」だと示す。 */
.row .ext {
  position: relative;
  z-index: 1;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--hover);
  color: var(--link);
  text-decoration: none;
  font-size: 14px;
}
.row .ext:hover { background: var(--link); color: #fff; }
.row .ext.is-none { visibility: hidden; }

/* 評価バッジ：序列が一目で分かるよう色を割り当てる。
   S=有望（緑） A=検討したい（青） B=要確認（橙） C=優先度低（灰） X=対象外 */
.row .gr, .gr {
  width: 28px; height: 28px;
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
}
.gr-S { background: var(--gr-s);    color: #fff; }
.gr-A { background: var(--gr-a);    color: #fff; }
.gr-B { background: var(--gr-b-bg); color: var(--gr-b-ink); }
.gr-C { background: var(--gr-c-bg); color: var(--gr-c-ink); }
.gr-X { background: transparent;    color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }

.row .ttl {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.row.unread .ttl { font-weight: 700; }
.row .sub {
  font-size: 12.5px;
  color: var(--ink-2);
  margin-top: 3px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.row .newdot {
  display: inline-block;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger);
  margin-right: 6px;
  vertical-align: 1px;
}

.pill {
  display: inline-block;
  font-size: 11.5px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--hover);
  color: var(--ink-2);
  white-space: nowrap;
}

.row .dl { text-align: right; min-width: 96px; }
.row .dl .d { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.row .dl .s { font-size: 11.5px; color: var(--muted); display: block; }
.dl.is-danger .d, .dl.is-danger .s { color: var(--danger); }
.dl.is-warn   .d { color: var(--ink); }
.dl.is-warn   .s { color: var(--ink-2); }
.dl.is-past   .d, .dl.is-past .s { color: var(--muted); font-weight: 400; }
.dl.is-none   .d { color: var(--muted); font-weight: 400; }

.st {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--hover);
  color: var(--ink-2);
  white-space: nowrap;
}
.st-検討中, .st-応募予定 { background: var(--hover); color: var(--ink); font-weight: 600; }
.st-応募済 { background: #E8E8E8; color: var(--ink); font-weight: 600; }
.st-受注   { background: var(--ok); color: #fff; font-weight: 700; }
.st-失注, .st-見送り { color: var(--muted); }

.row .asg {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--hover);
  display: grid; place-items: center;
  font-size: 12px; color: var(--ink-2);
}

/* =========================================================
   カード / 詳細
   ========================================================= */

.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px 22px;
  margin-bottom: 16px;
}
.card > h2 { font-size: 14px; font-weight: 600; color: var(--ink); margin: 0 0 14px; }

.detail { display: grid; grid-template-columns: minmax(0,1fr) 330px; gap: 24px; align-items: start; }

.doc-title { font-size: 24px; line-height: 1.4; font-weight: 700; margin: 8px 0 16px; }

dl.facts { display: grid; grid-template-columns: 6.5em minmax(0,1fr); gap: 9px 16px; margin: 0; font-size: 14px; }
dl.facts dt { color: var(--ink-2); }
dl.facts dd { margin: 0; word-break: break-word; }
dl.facts a { color: var(--link); }

.body-text {
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.9;
  max-height: 480px;
  overflow-y: auto;
  background: var(--bg-soft);
  border-radius: var(--r-sm);
  padding: 16px 18px;
}

.hits { display: flex; flex-wrap: wrap; gap: 6px; }
.hit { font-size: 12px; border-radius: 999px; padding: 3px 10px; background: var(--hover); color: var(--ink-2); }
.hit.plus  { background: var(--ink); color: #fff; }
.hit.minus { background: #FCE8E6;    color: var(--danger); }
.hit .p { opacity: .7; margin-left: 4px; font-variant-numeric: tabular-nums; }

.timeline { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.timeline li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: none; }
.timeline .when { color: var(--muted); font-size: 12px; }

.comment { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.comment:last-child { border-bottom: none; }
.comment .who { font-weight: 600; font-size: 13px; }
.comment .when { color: var(--muted); font-size: 12px; margin-left: 8px; }
.comment .body { white-space: pre-wrap; margin-top: 4px; }

/* 添付ファイル：1件ずつを押せる面として見せる */
.files { display: flex; flex-direction: column; gap: 8px; }
.file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  text-decoration: none;
  color: var(--link);
  font-size: 13.5px;
  line-height: 1.5;
}
.file:hover { background: var(--hover); border-color: var(--hover-2); }
.file .kind {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 3px 7px;
  border-radius: 4px;
  background: var(--ink);
  color: #fff;
}
.file .kind.pdf { background: var(--danger); }
.file .nm { flex: 1 1 auto; word-break: break-word; }
.file .go { flex: 0 0 auto; color: var(--muted); font-size: 13px; }
.file:hover .go { color: var(--link); }

/* =========================================================
   フォーム
   ========================================================= */

input[type="text"], input[type="password"], input[type="date"], select, textarea {
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--hover-2);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  width: 100%;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--link);
  box-shadow: inset 0 0 0 1px var(--link);
}

.btn {
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  padding: 9px 18px;
  white-space: nowrap;
}
.btn:hover { background: #272727; }
.btn.ghost { background: var(--hover); color: var(--ink); }
.btn.ghost:hover { background: var(--hover-2); }
.btn.small { padding: 6px 14px; font-size: 13px; }

.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }

/* =========================================================
   通知
   ========================================================= */

.notice, .alert { border-radius: var(--r-sm); padding: 12px 16px; margin-bottom: 18px; font-size: 14px; }
.notice { background: var(--hover); color: var(--ink); }
.alert  { background: #FCE8E6; color: var(--danger); }
.alert ul { margin: 6px 0 0; padding-left: 1.2em; }

.empty { text-align: center; padding: 72px 20px; color: var(--muted); }
.empty .big { font-size: 40px; margin-bottom: 12px; }

/* =========================================================
   ログイン
   ========================================================= */

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.login-box { width: 100%; max-width: 380px; }
.login-box .brand { justify-content: center; margin-bottom: 26px; }
.login-box .brand .name { font-size: 24px; letter-spacing: .06em; }
.login-box .card { padding: 28px 26px; }
.login-box .btn { width: 100%; padding: 12px; margin-top: 6px; }

/* =========================================================
   ページャ
   ========================================================= */

.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 26px; font-size: 13px; }
.pager .now { color: var(--muted); font-variant-numeric: tabular-nums; }

/* =========================================================
   フッター
   ========================================================= */

.foot { margin-top: 40px; padding: 18px 0 8px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }
.foot a { color: var(--link); }

/* =========================================================
   狭い画面
   ========================================================= */

@media (max-width: 1000px) {
  .detail { grid-template-columns: minmax(0,1fr); }
}

@media (max-width: 820px) {
  .sidebar { display: none; }
  .main { padding: 10px 14px 60px; }
  .appbar { gap: 10px; padding: 0 10px; }
  .appbar .search { max-width: none; }
  .brand .name, .appbar .who { display: none; }
  .row, .rows-head { grid-template-columns: 30px minmax(0,1fr) auto auto; row-gap: 6px; }
  .row .st, .row .asg,
  .rows-head .col-st, .rows-head .col-asg { display: none; }
  .row .ttl { font-size: 14px; }
}
