/* ===== 基本スタイル（管理系画面・共通部品） ===== */
:root {
  /* 色とフォントは /brand/brand.css で決めています */
  --bg: var(--cloud);
  --accent: var(--brand-deep);
  --accent-ink: #ffffff;
  --accent-soft: var(--brand-soft);
  --radius-s: 4px;
  --radius: 8px;
  --radius-l: 12px;
  --font: var(--font-jp);
  --display: var(--font-en);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .8em; }
img, video { max-width: 100%; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ボタン */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  font: inherit; font-weight: 700; font-size: .95rem;
  padding: .55em 1.1em; border-radius: var(--radius-s);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .12s, border-color .12s, transform .06s;
}
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, black); border-color: color-mix(in srgb, var(--accent) 88%, black); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
/* サイトの丸い矢印ボタンと同じ形 */
.btn.round { border-radius: 99px; }
.btn.small { font-size: .82rem; padding: .35em .75em; }
.btn.big { font-size: 1.15rem; padding: .8em 1.6em; border-radius: var(--radius); }

/* 入力 */
.input, .select, textarea.input {
  font: inherit; width: 100%;
  padding: .55em .75em; border-radius: var(--radius-s);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
textarea.input { resize: vertical; min-height: 4.5em; line-height: 1.5; }
.input:focus, .select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.field { display: grid; gap: .3em; margin-bottom: .9em; }
.field > span { font-size: .85rem; font-weight: 700; color: var(--ink-2); }
.field small, .hint-text { color: var(--ink-3); font-size: .8rem; }
.row { display: flex; gap: .6em; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--ink-3); }
.stack > * + * { margin-top: .8em; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; background: var(--surface); }
.seg button { font: inherit; font-size: .88rem; font-weight: 700; border: 0; background: transparent; padding: .45em .9em; cursor: pointer; color: var(--ink-2); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--brand-deep); color: #fff; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1em 1.2em; }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: .1em .55em; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }
.badge.gray { background: #E9EEF0; color: var(--ink-2); }
.badge.ok { background: #e2f5eb; color: var(--ok); }
.badge.warn { background: #fff2d6; color: #8a5a00; }

/* トップバー */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 1em;
  padding: .6em 1.2em; background: var(--surface); border-bottom: 1px solid var(--line);
}
.logo { display: inline-flex; align-items: center; gap: .7em; color: var(--ink-2); text-decoration: none; font-weight: 700; font-size: .9rem; white-space: nowrap; }
.logo .brand-logo { height: 26px; }
.logo span { padding-left: .7em; border-left: 1px solid var(--line); }

/* 通知 */
.toasts { position: fixed; bottom: 1.2em; left: 50%; transform: translateX(-50%); z-index: 1000; display: grid; gap: .5em; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: .65em 1.1em; border-radius: var(--radius-s); font-size: .9rem; font-weight: 700; box-shadow: 0 6px 24px rgba(32, 48, 58, .2); transition: opacity .3s, transform .3s; }
.toast.error { background: var(--danger); }
.toast.ok { background: var(--ok); }
.toast.out { opacity: 0; transform: translateY(6px); }

/* ダイアログ */
.dialog { border: 0; border-radius: var(--radius-l); padding: 1.4em; width: min(440px, 92vw); box-shadow: 0 20px 60px rgba(32, 48, 58, .25); color: var(--ink); }
.dialog::backdrop { background: rgba(32, 48, 58, .45); }
.dialog p { white-space: pre-line; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .6em; margin-top: 1em; }

.empty { text-align: center; color: var(--ink-3); padding: 2.4em 1em; }
.spinner { width: 1.2em; height: 1.2em; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: .5em .6em; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .8rem; color: var(--ink-2); font-weight: 700; }
.table tr:last-child td { border-bottom: 0; }
.scroll-x { overflow-x: auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
