/*
 * CC.jp EntryHub の管理系ページの共通スタイル（Vercel / Resend / Supabase のダッシュボードの型）。
 *   左にサイドバー（切り替え・メニュー・自分）、本文は「ページ名 → 絞り込みの帯 → 1行で完結する一覧」、
 *   行を押すと詳細（ラベルと値の格子）。画面の幅いっぱいを使い、横スクロールは出さない
 *   （幅が足りないときは優先度の低い列から隠す）。シリーズの色はここでは使わない。
 * 使わないもの：数字を並べたタイル、グラデーション、ピル型、絵文字、色付きの帯、片側だけ色付きの線。
 */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600&family=Geist+Mono:wght@400;500&display=swap');

:root {
  --bg: #ffffff;
  --side: #fafafa;
  --subtle: #fafafa;
  --border: #ebebeb;
  --border-strong: #d9d9d9;
  --fg: #0a0a0a;
  --fg-2: #3f3f46;
  --muted: #71717a;
  --faint: #a1a1aa;
  --hover: #f4f4f5;
  --active: #ededee;
  --green: #16a34a;
  --red: #dc2626;
  --red-text: #b91c1c;
  --red-bg: #fef2f2;
  --amber: #d97706;
  --amber-text: #a16207;
  --amber-bg: #fefce8;
  --radius: 6px;
  --side-w: 248px;
  --gutter: clamp(16px, 3vw, 40px);
  --sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic', Meiryo, sans-serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.55 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ================= app shell ================= */
.side { position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: var(--side); border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 20; }
.side__top { padding: 14px 12px 8px; }
.side__brand { display: flex; align-items: center; gap: 9px; padding: 6px 8px; font-weight: 600; letter-spacing: -.01em; }
.mark { width: 22px; height: 22px; border-radius: 5px; background: var(--fg); color: #fff; display: grid; place-items: center; font: 600 11px/1 var(--mono); flex: none; }
.switch { position: relative; margin: 10px 0 0; }
.switch select { width: 100%; height: 36px; padding: 0 30px 0 10px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; appearance: none; cursor: pointer; font-weight: 500; }
.switch svg { position: absolute; right: 9px; top: 10px; pointer-events: none; color: var(--muted); }
.nav { padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav__sep { height: 1px; background: var(--border); margin: 8px 12px; }
.nav__label { font-size: 11.5px; color: var(--muted); padding: 10px 10px 4px; letter-spacing: .02em; }
.nav a { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: var(--radius); color: var(--fg-2); }
.nav a:hover { background: var(--hover); color: var(--fg); }
.nav a[aria-current='page'] { background: var(--active); color: var(--fg); font-weight: 500; }
.side__me { margin-top: auto; padding: 12px 14px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--active); display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--fg-2); flex: none; }
.side__who { min-width: 0; flex: 1; line-height: 1.3; }
.side__who b { display: block; font-weight: 500; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side__who span { font-size: 12px; color: var(--muted); }
.iconbtn { width: 30px; height: 30px; display: grid; place-items: center; border: 0; background: none; border-radius: var(--radius); color: var(--muted); cursor: pointer; flex: none; }
.iconbtn:hover { background: var(--hover); color: var(--fg); }

.top { display: none; }
.content { margin-left: var(--side-w); min-height: 100vh; }
.main { padding: 36px var(--gutter) 80px; }

@media (max-width: 900px) {
  .side { transform: translateX(-100%); transition: transform .18s; box-shadow: none; }
  body.nav-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .25); }
  .top { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 12px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: #fff; z-index: 10; }
  .top b { font-weight: 600; }
  .content { margin-left: 0; }
  .main { padding-top: 24px; }
}

/* ================= page ================= */
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.crumbs a:hover { color: var(--fg); }
.page-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 0 0 22px; }
.page-hd h1 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -.025em; line-height: 1.25; }
.page-hd p { margin: 6px 0 0; color: var(--muted); }
.page-hd__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.section-title { font-size: 15px; font-weight: 600; margin: 40px 0 12px; }
.tabs { display: flex; gap: 4px; margin: 0 0 20px; }
.tabs a, .tabs button { height: 32px; padding: 0 12px; display: inline-flex; align-items: center; border-radius: var(--radius); border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 13.5px; }
.tabs a:hover, .tabs button:hover { color: var(--fg); }
.tabs [aria-selected='true'] { background: var(--active); color: var(--fg); font-weight: 500; }

/* ================= controls ================= */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: var(--radius); border: 1px solid var(--border-strong); background: #fff; color: var(--fg); font-size: 13.5px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn--primary { background: var(--fg); border-color: var(--fg); color: #fff; }
.btn--primary:hover { background: #27272a; }
.btn--block { width: 100%; height: 40px; font-size: 14px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn .count { opacity: .6; font-variant-numeric: tabular-nums; }
.input, .select { height: 34px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: #fff; font-size: 13.5px; }
.input { width: 100%; }
.input--lg { height: 40px; font-size: 14px; }
.select { padding-right: 30px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2371717a' stroke-width='1.5'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; cursor: pointer; }
.input:focus, .select:focus, .switch select:focus { outline: none; border-color: var(--fg); box-shadow: 0 0 0 3px rgba(0, 0, 0, .06); }
.search { position: relative; flex: 1 1 260px; min-width: 180px; }
.search svg { position: absolute; left: 10px; top: 9px; color: var(--muted); }
.search .input { padding-left: 32px; }
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.label { display: block; font-size: 13px; font-weight: 500; margin: 0 0 6px; }
.hint { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }
.field { margin: 0 0 18px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.check input { width: 15px; height: 15px; accent-color: var(--fg); margin: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 20px; }

.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; width: 30px; height: 30px; display: grid; place-items: center; border-radius: var(--radius); color: var(--muted); }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover, .menu[open] > summary { background: var(--hover); color: var(--fg); }
.menu__list { position: absolute; right: 0; top: 34px; z-index: 30; min-width: 190px; padding: 4px; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 28px rgba(0, 0, 0, .09); }
.menu__list button, .menu__list a { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 7px 10px; border: 0; background: none; border-radius: 4px; font-size: 13px; cursor: pointer; }
.menu__list button:hover, .menu__list a:hover { background: var(--hover); }

/* ================= data table（1行で完結。はみ出す文字は省略、狭い画面は列を隠す） ================= */
.dt { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; border: 1px solid var(--border); border-radius: 8px; font-size: 13.5px; }
.dt th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; height: 38px; padding: 0 14px; background: var(--subtle); border-bottom: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dt th:first-child { border-top-left-radius: 8px; }
.dt th:last-child { border-top-right-radius: 8px; }
.dt td { height: 50px; padding: 0 14px; border-bottom: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dt tr:last-child td { border-bottom: 0; }
.dt tbody tr { cursor: pointer; }
.dt tbody tr:hover td { background: var(--subtle); }
.dt tr.is-off td { color: var(--faint); }
.dt .sub { color: var(--muted); margin-left: 8px; }
.dt .num { font-family: var(--mono); font-size: 12.5px; color: var(--fg-2); }
.dt .w-act { width: 52px; text-align: right; padding-right: 8px; overflow: visible; }
.dt td.w-act { overflow: visible; }
.empty { padding: 56px 20px; text-align: center; color: var(--muted); }
@media (max-width: 1280px) { .hide-xl { display: none; } }
@media (max-width: 1080px) { .hide-lg { display: none; } }
@media (max-width: 760px) { .hide-md { display: none; } }

/* 汎用の表（アカウントなど。折り返して横スクロールさせない） */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--border); border-radius: 8px; font-size: 13.5px; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; height: 38px; padding: 0 14px; background: var(--subtle); border-bottom: 1px solid var(--border); }
.tbl th:first-child { border-top-left-radius: 8px; }
.tbl th:last-child { border-top-right-radius: 8px; }
.tbl td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; overflow-wrap: anywhere; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.is-off td { color: var(--faint); }

/* ================= 状態（点と文字だけ） ================= */
.state { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.state::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.state--ok::before { background: var(--green); }
.state--ng::before { background: var(--red); }
.state--warn::before { background: var(--amber); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.notice { display: flex; align-items: center; gap: 10px; padding: 9px 13px; border-radius: var(--radius); font-size: 13px; margin: 0 0 20px; background: var(--subtle); color: var(--fg-2); border: 1px solid var(--border); }
.notice--amber { background: var(--amber-bg); color: var(--amber-text); border-color: #fef08a; }
.notice--red { background: var(--red-bg); color: var(--red-text); border-color: #fecaca; }
.notice--green { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--fg); color: #fff; padding: 9px 16px; border-radius: var(--radius); font-size: 13px; z-index: 50; }

/* ================= 詳細（Vercel のデプロイ詳細の型） ================= */
.box { border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.box + .box { margin-top: 16px; }
.box__hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px 12px 20px; border-bottom: 1px solid var(--border); font-weight: 500; min-height: 56px; flex-wrap: wrap; }
.box__body { padding: 20px; }
.box__ft { padding: 12px 20px; border-top: 1px solid var(--border); background: var(--subtle); border-radius: 0 0 8px 8px; display: flex; gap: 8px; justify-content: flex-end; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px 28px; }
.kv dt { font-size: 12.5px; color: var(--muted); margin: 0 0 3px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv dd .sub { display: block; color: var(--muted); font-size: 12.5px; }

/* メールの見本（Supabase のテンプレート画面の型） */
.preview { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
.preview__list { display: flex; flex-direction: column; gap: 2px; }
.preview__list button { text-align: left; height: 34px; padding: 0 10px; border: 0; background: none; border-radius: var(--radius); color: var(--fg-2); cursor: pointer; }
.preview__list button:hover { background: var(--hover); }
.preview__list button[aria-selected='true'] { background: var(--active); color: var(--fg); font-weight: 500; }
.preview iframe { width: 100%; height: 900px; border: 0; display: block; border-radius: 0 0 8px 8px; }
@media (max-width: 900px) { .preview { grid-template-columns: 1fr; } }

/* ================= シリーズ一覧（トップ） ================= */
.series { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.series__item { display: flex; flex-direction: column; padding: 22px; border: 1px solid var(--border); border-radius: 8px; min-height: 170px; }
.series__item:hover { border-color: var(--border-strong); background: var(--subtle); }
.series__logo { height: 30px; display: flex; align-items: center; margin: 0 0 18px; }
.series__logo img { max-height: 24px; max-width: 190px; }
.series__name { font-weight: 600; font-size: 15px; }
.series__desc { color: var(--muted); font-size: 13px; }
.series__next { margin-top: auto; padding-top: 18px; font-size: 13px; color: var(--muted); }
.series__next b { color: var(--fg); font-weight: 500; }

/* ================= ログイン ================= */
.auth { max-width: 360px; margin: 16vh auto 0; padding: 0 20px; }
.auth__brand { display: flex; justify-content: center; align-items: center; gap: 9px; font-weight: 600; margin: 0 0 36px; }
.auth h1 { font-size: 24px; font-weight: 600; letter-spacing: -.02em; text-align: center; margin: 0 0 8px; }
.auth__lead { text-align: center; color: var(--muted); margin: 0 0 28px; }
.auth__foot { text-align: center; color: var(--muted); font-size: 12.5px; margin: 28px 0 0; }
.auth__foot a { text-decoration: underline; }

/* ブランド：CC.jp のロゴ＋EntryHub */
.brand-logo { height: 20px; width: auto; display: block; }
.side__brand { gap: 8px; font-size: 15px; }
.auth__brand .brand-logo { height: 26px; }
.auth__brand { font-size: 18px; gap: 10px; }
