/* 現場マッチ UI：デザイントークンと部品。管理画面（サイドバー）、LINE内（モバイル）、ログイン（中央）の3つの外枠で共通 */
:root {
  --bg: #f4f5fa;
  --surface: #ffffff;
  --surface-2: #f8f9fd;
  --line: #e6e8f2;
  --text: #0f1424;
  --muted: #6b7390;
  --brand: #6366f1;
  --brand-2: #8b5cf6;
  --brand-ink: #4338ca;
  --brand-soft: #eef0ff;
  --ink-900: #0b1020;
  --ink-800: #121a33;
  --success: #059669; --success-soft: #e6f8f0;
  --warn: #b45309; --warn-soft: #fff4e0;
  --danger: #dc2626; --danger-soft: #feecec;
  --info: #0369a1; --info-soft: #e5f4fb;
  --line-green: #06c755;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 20, 36, .04), 0 8px 24px -12px rgba(15, 20, 36, .12);
  --font: -apple-system, BlinkMacSystemFont, "Inter", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 17px; font-weight: 700; margin: 0 0 16px; letter-spacing: -.01em; }
h2 { font-size: 15px; font-weight: 700; margin: 0 0 12px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); font-size: 13px; }
.spacer { flex: 1; }

/* ---- 部品：カード・行・バッジ ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card + .card { margin-top: 20px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.row h1 { margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 20px; }
.badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; background: #eceef7; color: #475069; font-size: 12px; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.badge.is-success { background: var(--success-soft); color: var(--success); }
.badge.is-warn { background: var(--warn-soft); color: var(--warn); }
.badge.is-danger { background: var(--danger-soft); color: var(--danger); }
.badge.is-info { background: var(--info-soft); color: var(--info); }
.badge.is-brand { background: var(--brand-soft); color: var(--brand-ink); }
.status { background: var(--success-soft); color: var(--success); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 14px; margin-bottom: 16px; font-weight: 500; }
.error { background: var(--danger-soft); color: var(--danger); border-radius: var(--radius-sm); padding: 9px 14px; font-size: 13px; margin: 0 0 10px; font-weight: 500; }

/* ---- フォーム ---- */
label { display: block; font-size: 13px; font-weight: 600; color: #2b3350; margin: 14px 0 6px; }
input[type=email], input[type=password], input[type=tel], input[type=text], input[type=number], input[type=date], input[type=time], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #d6daea; border-radius: var(--radius-sm); font-size: 15px; font-family: inherit; color: var(--text); background: #fff; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(99, 102, 241, .16); }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); width: 17px; height: 17px; vertical-align: -3px; margin-right: 6px; }
label:has(> input[type=checkbox]), label:has(> input[type=radio]) { font-weight: 500; color: var(--text); }
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border: 0; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 6px 16px -8px rgba(99, 102, 241, .7); transition: transform .12s, box-shadow .12s, filter .12s; text-decoration: none;
}
button:hover, .btn:hover { filter: brightness(1.05); transform: translateY(-1px); text-decoration: none; }
button:active { transform: translateY(0); }
button.link { background: none; box-shadow: none; color: inherit; padding: 0; font-weight: 500; }
button.link:hover { transform: none; filter: none; text-decoration: underline; }
button.danger, td button.danger { background: var(--danger-soft); color: var(--danger); box-shadow: none; }
button.ghost, td button { background: #eceef7; color: #2b3350; box-shadow: none; }
td button { padding: 5px 12px; font-size: 13px; }
td form { display: inline-block; margin-right: 4px; }
td input, td select { width: auto; padding: 5px 8px; font-size: 13px; }

/* ---- 表 ---- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: 10px 12px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: none; letter-spacing: .02em; border-bottom: 1px solid var(--line); background: var(--surface-2); }
td { text-align: left; padding: 12px; border-bottom: 1px solid #eff1f8; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td, table tr:hover td { background: #fafbff; }
table:has(tr > th + td) tr > th:first-child { width: 140px; background: transparent; color: var(--muted); border-bottom: 1px solid #eff1f8; font-size: 13px; }
.card:has(> table), .card > .table-wrap { overflow-x: auto; }

/* ---- 外枠 1：管理画面・運営者画面（サイドバー） ---- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { background: radial-gradient(120% 80% at 0% 0%, #1b2547 0%, var(--ink-900) 60%); color: #c9d0ea; padding: 22px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; color: #fff; font-weight: 800; font-size: 17px; letter-spacing: -.01em; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); display: grid; place-items: center; box-shadow: 0 8px 20px -6px rgba(139, 92, 246, .8); }
.brand-mark svg { width: 18px; height: 18px; stroke: #fff; }
.brand small { display: block; font-size: 10px; font-weight: 600; color: #8c96ba; letter-spacing: .08em; margin-top: -2px; }
.nav-group { font-size: 11px; font-weight: 700; letter-spacing: .1em; color: #6c769c; padding: 16px 12px 6px; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: #c9d0ea; font-size: 14px; font-weight: 500; text-decoration: none; transition: background .12s, color .12s; }
.nav-link svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.nav-link.is-active { background: linear-gradient(135deg, rgba(99, 102, 241, .35), rgba(139, 92, 246, .25)); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.nav-link.is-active svg { opacity: 1; }
.sidebar-foot { margin-top: auto; padding-top: 18px; }
.who { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .06); margin-bottom: 8px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #38bdf8, var(--brand)); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 13px; flex: none; }
.who b { display: block; color: #fff; font-size: 13px; line-height: 1.3; }
.who span { font-size: 11px; color: #8c96ba; }
.sidebar button.link { color: #aab3d4; display: flex; align-items: center; gap: 10px; padding: 9px 12px; width: 100%; border-radius: 10px; font-size: 14px; }
.sidebar button.link:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.content { padding: 32px 40px 64px; min-width: 0; }
.content-inner { max-width: 1040px; margin: 0 auto; }
.topbar { display: none; }

/* ---- 外枠 2：ログイン・招待などの中央寄せ ---- */
.plain { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; background: radial-gradient(60% 50% at 20% 10%, rgba(99, 102, 241, .22), transparent 70%), radial-gradient(50% 50% at 90% 90%, rgba(139, 92, 246, .18), transparent 70%), var(--bg); }
.plain-inner { width: 100%; max-width: 420px; }
.plain .brand { color: var(--text); justify-content: center; padding-bottom: 22px; }
.plain .brand small { color: var(--muted); }
.plain button[type=submit] { width: 100%; margin-top: 18px; padding: 12px; font-size: 15px; }
.plain .card { padding: 28px; }

/* ---- 外枠 3：LINE内（モバイル） ---- */
.liff { max-width: 480px; margin: 0 auto; min-height: 100vh; padding: 0 0 84px; background: var(--bg); }
.liff-head { padding: 22px 20px 26px; color: #fff; background: radial-gradient(120% 140% at 0% 0%, #4f46e5 0%, #7c3aed 55%, #0b1020 130%); border-radius: 0 0 28px 28px; box-shadow: 0 16px 32px -20px rgba(79, 70, 229, .8); }
.liff-head .brand { padding: 0; font-size: 15px; }
.liff-head .brand-mark { width: 28px; height: 28px; background: rgba(255, 255, 255, .18); box-shadow: none; }
.liff-body { padding: 18px 16px 0; margin-top: -14px; }
.liff .card { padding: 20px; border-radius: 18px; }
.liff h1 { font-size: 19px; }
.liff button[type=submit], .liff .btn { width: 100%; margin-top: 14px; padding: 14px; font-size: 16px; border-radius: 14px; }
.liff-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: center; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .86); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
.liff-tabs-inner { display: flex; width: 100%; max-width: 480px; gap: 6px; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 4px; border-radius: 12px; color: var(--muted); font-size: 11px; font-weight: 600; text-decoration: none; }
.tab svg { width: 22px; height: 22px; }
.tab:hover { text-decoration: none; }
.tab.is-active { color: var(--brand-ink); background: var(--brand-soft); }
.item { display: block; padding: 14px 0; border-bottom: 1px solid #eff1f8; color: inherit; text-decoration: none; }
.item:last-child { border-bottom: 0; }
.item:hover { text-decoration: none; }
.item .t { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 700; font-size: 15px; }
.item .s { color: var(--muted); font-size: 13px; margin-top: 2px; }
.liff table th:first-child { width: 96px; }
.liff table { font-size: 14px; }
.liff-link { text-align: center; margin-top: 16px; }

/* ---- 数値カード（ダッシュボード） ---- */
.stat { display: flex; flex-direction: column; gap: 2px; padding: 18px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); }
.stat b { font-size: 26px; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: 12px; font-weight: 600; }
.pill-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.pill-nav a { padding: 6px 14px; border-radius: 999px; background: #eceef7; color: #475069; font-weight: 600; font-size: 13px; }
.pill-nav a.is-active, .pill-nav a:hover { background: var(--brand-soft); color: var(--brand-ink); text-decoration: none; }

/* ---- スマホ幅の管理画面 ---- */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { display: block; position: sticky; top: 0; z-index: 20; background: var(--ink-900); color: #fff; padding: 10px 12px 0; }
  .topbar .brand { padding: 0 4px 8px; font-size: 15px; }
  .topbar .scroll { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
  .topbar .nav-link { flex: none; padding: 7px 12px; font-size: 13px; }
  .topbar .nav-link svg { display: none; }
  .content { padding: 18px 14px 48px; }
  .card { padding: 18px; }
}

/* ---- 追加の部品 ---- */
.btn-line { background: var(--line-green); box-shadow: 0 10px 22px -10px rgba(6, 199, 85, .8); width: 100%; padding: 14px; font-size: 16px; border-radius: 14px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat a { color: inherit; }
.hero { padding: 26px; border-radius: var(--radius); color: #fff; background: radial-gradient(120% 140% at 0% 0%, #4f46e5 0%, #7c3aed 60%, #0b1020 140%); box-shadow: var(--shadow); margin-bottom: 20px; }
.hero h1 { color: #fff; font-size: 22px; margin-bottom: 4px; }
.hero p { margin: 0; opacity: .85; }
.liff .stack-actions form + form { margin-top: 0; }
.ghost-btn { background: #eceef7 !important; color: #2b3350 !important; box-shadow: none !important; }
.danger-btn { background: var(--danger-soft) !important; color: var(--danger) !important; box-shadow: none !important; }
.topbar .nav-group { display: none; }
.topbar .nav-link { white-space: nowrap; }
.hero p b { font-weight: 700; }
button svg { width: 18px; height: 18px; flex: none; }
.sidebar button.link { white-space: nowrap; }
.liff th, .liff td { padding: 9px 4px; }
.liff table:has(tr > th + td) tr > th:first-child { width: 84px; }
.liff h1 .badge { vertical-align: 3px; }
