/* Admin ダッシュボード 概要タブ（描画は overview.js）。
   帳簿の流儀で組む: 数字は右で揃え（tabular-nums）、面は箱を並べずヘアラインで
   区切り、色は「対応が要る」ところにだけ 1 色（signal）を置く。 */

#adm-tab-overview {
    --ov-ink:         #0f1f3d;
    --ov-text:        #2b3445;
    --ov-muted:       #6b7484;
    --ov-faint:       #98a0ae;
    --ov-line:        #e6e9ef;
    --ov-hover:       #f7f9fc;
    --ov-fill:        #2f5fa5;
    --ov-fill-soft:   #c9d8ef;
    --ov-signal:      #c2410c;
}

/* ---- 見出し: 大文字・字間広げの eyebrow ではなく、文として読める見出し ---- */
#adm-tab-overview .adm-section-title {
    text-transform: none; letter-spacing: -0.01em;
    font-size: 0.95rem; font-weight: 600; color: var(--ov-ink);
    margin: 1.75rem 0 0.65rem;
}

/* ---- ツールバー: 白い箱をやめ、右端に最終更新と更新ボタンだけ ---- */
#adm-tab-overview .adm-ov-toolbar {
    background: transparent; border: 0; padding: 0; margin: 0 0 0.25rem;
    justify-content: flex-end; gap: 0.75rem;
}
#adm-tab-overview .adm-ov-toolbar .adm-count { margin-left: 0; color: var(--ov-faint); font-variant-numeric: tabular-nums; }
.adm-ov-refresh { display: inline-flex; align-items: center; gap: 0.4rem; background: #fff; }
.adm-ov-refresh svg { width: 13px; height: 13px; flex: 0 0 auto; }

/* ---- 面の共通 ---- */
.adm-ov-surface,
.adm-ov-list,
.adm-panel,
#adm-tab-overview .adm-stats-grid {
    background: #fff; border: 1px solid var(--adm-border); border-radius: 10px;
}

/* ---- 要対応: 一覧。件数ありの行だけ並べ、問題なしは脚注にまとめる ---- */
.adm-ov-list { overflow: hidden; margin-bottom: 0.25rem; }
.adm-ov-row {
    display: grid; grid-template-columns: 8px 1fr auto auto; align-items: center; gap: 0.9rem;
    width: 100%; padding: 0.85rem 1.15rem;
    background: #fff; border: 0; border-bottom: 1px solid var(--ov-line);
    text-align: left; font: inherit; color: var(--ov-text); cursor: pointer;
}
.adm-ov-row:last-child { border-bottom: 0; }
.adm-ov-row:hover { background: var(--ov-hover); }
.adm-ov-row:focus-visible { outline: 2px solid var(--ov-fill); outline-offset: -2px; }
.adm-ov-row-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ov-signal); }
.adm-ov-row-l { font-size: 0.9rem; font-weight: 500; }
.adm-ov-row-n {
    font-size: 1.15rem; font-weight: 600; color: var(--ov-ink);
    font-variant-numeric: tabular-nums; letter-spacing: -0.01em; min-width: 2.5em; text-align: right;
}
.adm-ov-row-go {
    display: inline-flex; align-items: center; justify-content: flex-end; gap: 0.1rem;
    min-width: 7em; font-size: 0.78rem; color: var(--ov-faint);
}
.adm-ov-row-go svg { width: 14px; height: 14px; }
.adm-ov-row:hover .adm-ov-row-go { color: var(--ov-fill); }
.adm-ov-row.is-empty { display: block; cursor: default; color: var(--ov-muted); font-size: 0.88rem; }
.adm-ov-row.is-empty:hover { background: #fff; }
.adm-ov-foot {
    padding: 0.6rem 1.15rem; font-size: 0.78rem; color: var(--ov-faint);
    border-top: 1px solid var(--ov-line); background: #fbfcfd;
}
.adm-ov-foot + .adm-ov-foot { border-top: 0; padding-top: 0; }
.adm-ov-foot-k { color: var(--ov-muted); font-weight: 600; margin-right: 0.35rem; }

/* ---- 集計: 箱を並べず 1 枚の面をヘアラインで区切る（収支サマリーも同じ器） ---- */
#adm-tab-overview .adm-stats-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1px; overflow: hidden; margin-bottom: 0.25rem;
}
#adm-tab-overview .adm-stat {
    background: #fff; border: 0; border-radius: 0; padding: 1rem 1.15rem 0.95rem;
    box-shadow: 0 0 0 1px var(--ov-line);
}
#adm-tab-overview .adm-stat .sl { text-transform: none; letter-spacing: 0; font-size: 0.8rem; font-weight: 500; color: var(--ov-muted); }
#adm-tab-overview .adm-stat .sv { font-size: 1.7rem; font-weight: 600; letter-spacing: -0.02em; color: var(--ov-ink); margin-top: 0.2rem; }
#adm-tab-overview .adm-stat .sv.money { font-size: 1.35rem; letter-spacing: -0.01em; }
#adm-tab-overview .adm-stat .sv.money.neg { color: var(--ov-signal); }
#adm-tab-overview .adm-stat .ss { font-size: 0.76rem; color: var(--ov-faint); margin-top: 0.2rem; }

/* ---- パネル ---- */
.adm-panel { padding: 1.1rem 1.25rem; }
.adm-panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0.75rem; margin-bottom: 0.25rem; }
.adm-panel-grid > .adm-panel { min-width: 0; }
.adm-panel-title {
    display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap;
    font-size: 0.86rem; font-weight: 600; color: var(--ov-ink); margin-bottom: 0.8rem;
}
.adm-panel-title-gap { margin-top: 1.25rem; }
.adm-panel-sub { font-weight: 400; color: var(--ov-faint); font-size: 0.76rem; font-variant-numeric: tabular-nums; }

/* ---- 積み上げバー + 凡例 ---- */
.adm-dist-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: #eef1f5; margin-bottom: 0.7rem; }
.adm-dist-seg { display: block; height: 100%; min-width: 2px; }
.adm-dist-seg + .adm-dist-seg { border-left: 1px solid #fff; }
.adm-dist-empty { flex: 1; }
.adm-dist-legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 1.25rem; }
.adm-dist-row {
    display: grid; grid-template-columns: 8px 1fr auto 3.2em; align-items: center; gap: 0.5rem;
    padding: 0.28rem 0; font-size: 0.8rem; color: var(--ov-text); border-bottom: 1px solid var(--ov-line);
}
.adm-dist-row.is-zero { color: var(--ov-faint); }
.adm-dist-dot { width: 8px; height: 8px; border-radius: 50%; }
.adm-dist-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-dist-n { font-weight: 600; color: var(--ov-ink); font-variant-numeric: tabular-nums; }
.adm-dist-row.is-zero .adm-dist-n { color: var(--ov-faint); font-weight: 500; }
.adm-dist-pct { text-align: right; color: var(--ov-faint); font-variant-numeric: tabular-nums; }

/* ---- 日別バー: 84 日ぶんを横スクロールで見る。今日は集計途中なので薄く ----
   バーの幅は固定（1 日 = 1 本）。画面幅で割ると日数が増えるほど 1 本が潰れて、
   締切前の駆け込みが見えなくなる。足りないぶんは横に流す。 */
.adm-bars-scroll {
    overflow-x: auto; overflow-y: hidden; padding-bottom: 0.2rem;
    border-bottom: 1px solid var(--ov-line);
    scrollbar-width: thin;
    /* 開いた直後は右端（直近）を見せる。JS で scrollLeft を動かすと、タブが
       まだ非表示のうちに描いたときに幅が 0 で効かない。rtl なら初期位置が
       右端になるので、描画の順番に左右されない。中身は ltr に戻して
       「古い日 → 新しい日」の並びを保つ。 */
    direction: rtl;
}
.adm-bars-scroll > * { direction: ltr; }
.adm-bars-scroll:focus-visible { outline: 2px solid var(--ov-fill); outline-offset: 2px; }
.adm-bars { display: flex; align-items: flex-end; gap: 3px; height: 170px; padding-top: 1.1rem; width: max-content; min-width: 100%; }
.adm-bar-col {
    flex: 0 0 15px; display: flex; flex-direction: column; align-items: center;
    justify-content: flex-end; height: 100%;
}
.adm-bar-n { font-size: 0.65rem; font-weight: 600; color: var(--ov-muted); line-height: 1; margin-bottom: 0.25rem; font-variant-numeric: tabular-nums; }
.adm-bar { display: block; width: 100%; background: var(--ov-fill); border-radius: 2px 2px 0 0; }
.adm-bar-col.is-today .adm-bar { background: var(--ov-fill-soft); }
/* 日付は 7 日ごとにしか入れない。空のラベルでも高さを確保して、
   バーの下端がそろうようにする。 */
.adm-bar-x {
    display: block; height: 1.15rem; padding-top: 0.35rem; white-space: nowrap;
    font-size: 0.62rem; color: var(--ov-faint); font-variant-numeric: tabular-nums;
}

/* ---- 項目と値の並び（査読の進行と期限） ---- */
.adm-ov-kv-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 2rem; }
.adm-ov-kv {
    display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem;
    padding: 0.5rem 0; border-bottom: 1px solid var(--ov-line); font-size: 0.84rem; color: var(--ov-text);
}
.adm-ov-kv-v { font-weight: 600; color: var(--ov-ink); font-variant-numeric: tabular-nums; font-size: 1.05rem; letter-spacing: -0.01em; }
.adm-ov-kv.is-hot .adm-ov-kv-v { color: var(--ov-signal); }
@media (max-width: 480px) { .adm-ov-kv-list { grid-template-columns: 1fr; } }

/* ---- 横棒 ---- */
.adm-hbar-row { display: grid; grid-template-columns: minmax(90px, 40%) 1fr 3em; align-items: center; gap: 0.6rem; font-size: 0.8rem; color: var(--ov-text); padding: 0.24rem 0; }
.adm-hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-hbar-track { display: block; height: 6px; border-radius: 3px; background: #eef1f5; overflow: hidden; }
.adm-hbar-track.is-untargeted { background: #f4f6f9; }
.adm-hbar-fill { display: block; height: 100%; background: var(--ov-fill); border-radius: 3px; }
.adm-hbar-n { text-align: right; font-weight: 600; color: var(--ov-ink); font-variant-numeric: tabular-nums; }

/* ---- セッション別 ---- */
.adm-panel-table { padding: 0; overflow-x: auto; }
.adm-ov-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; min-width: 560px; }
.adm-ov-table thead th {
    text-align: left; padding: 0.65rem 1.15rem; font-size: 0.74rem; font-weight: 500; color: var(--ov-muted);
    border-bottom: 1px solid var(--ov-line); white-space: nowrap;
}
.adm-ov-table tbody td { padding: 0.55rem 1.15rem; border-bottom: 1px solid var(--ov-line); vertical-align: middle; color: var(--ov-text); }
.adm-ov-table tbody tr:last-child td { border-bottom: none; }
.adm-ov-table tbody tr:hover td { background: var(--ov-hover); }
.adm-ov-table .adm-ov-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.adm-ov-table .adm-ov-session { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: var(--ov-ink); }
.adm-ov-table .adm-ov-progress { min-width: 180px; }
.adm-ov-table .adm-ov-progress .adm-hbar-track { min-width: 110px; }
.adm-ov-table .adm-ov-progress { display: flex; align-items: center; gap: 0.6rem; }
.adm-ov-table .adm-ov-progress .adm-hbar-track { flex: 1 1 auto; }
.adm-ov-short { font-size: 0.74rem; font-weight: 600; color: var(--ov-signal); white-space: nowrap; }
.adm-ov-table tr.is-short .adm-ov-session::before {
    content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
    background: var(--ov-signal); margin-right: 0.5rem; vertical-align: 2px;
}

@media (max-width: 700px) {
    .adm-ov-row { grid-template-columns: 8px 1fr auto; }
    .adm-ov-row-go { display: none; }
}
