/* SCALE Rec — 自前スタイル（参考のCSSは使わず、抽出したデザイントークンで組み直し） */

:root {
  --base-100: #ffffff;
  --base-150: #fafaff;
  --base-200: #f6f5fa;
  --base-250: #edecf4;
  --base-300: #e3e2ed;
  --base-400: #b0aed0;
  --base-500: #5a5d8d;
  --base-600: #000852;
  --primary-200: #c1c1ff;
  --primary-300: #8585ff;
  --primary-400: #1d1dff;
  --primary-500: #000082;

  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 232px;
  --font: "Lato", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--base-150);
  color: var(--base-600);
  font-size: 14px;
  line-height: 1.5;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

/* ---------- レイアウト ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--base-100);
  border-right: 1px solid var(--base-300);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.logo { padding: 4px 8px 20px; }
.logo img { display: block; height: auto; }
.logo.stacked { padding: 0 0 20px; text-align: center; }
.logo.stacked img { margin: 0 auto; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--base-600); text-decoration: none; cursor: pointer;
  border: 0; background: none; width: 100%; text-align: left;
}
.nav-item:hover { background: var(--base-200); }
.nav-item.active { background: var(--base-250); font-weight: 700; }
.nav-item .dot { width: 18px; text-align: center; color: var(--primary-400); flex-shrink: 0; }
.nav-sep { height: 1px; background: var(--base-300); margin: 12px 4px; }
.sidebar-foot { margin-top: auto; font-size: 12px; color: var(--base-500); padding: 8px; }

.main { flex: 1; min-width: 0; padding: 28px 32px 64px; }
.page-title { font-size: 22px; font-weight: 900; margin: 0 0 20px; letter-spacing: -0.01em; }

/* ---------- タブ・フィルタ ---------- */
.tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.tab {
  padding: 8px 16px; border-radius: 999px; border: 0; cursor: pointer;
  background: transparent; color: var(--base-500); font-weight: 700;
}
.tab.active { background: var(--base-250); color: var(--base-600); }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.search {
  flex: 1; min-width: 240px; max-width: 420px;
  padding: 10px 14px; border: 1px solid var(--base-300);
  border-radius: var(--radius-sm); background: var(--base-100);
}
.search:focus { outline: 2px solid var(--primary-200); border-color: var(--primary-300); }

/* ---------- 会議カード ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 16px; }

.card {
  background: var(--base-100); border: 1px solid var(--base-300);
  border-radius: var(--radius); overflow: hidden; cursor: pointer;
  transition: box-shadow .12s ease, transform .12s ease;
}
.card:hover { box-shadow: 0 6px 20px rgba(0, 8, 82, .10); transform: translateY(-1px); }
.thumb {
  aspect-ratio: 16 / 9; background: var(--base-250);
  display: flex; align-items: center; justify-content: center; position: relative;
}
.thumb .play {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255, 255, 255, .9); color: var(--primary-400);
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.thumb .len {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(0, 8, 82, .78); color: #fff;
  font-size: 11px; padding: 2px 6px; border-radius: 4px;
}
.card-body { padding: 12px 14px 14px; }
.card-title {
  font-weight: 700; margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 42px;
}
.card-meta { font-size: 12px; color: var(--base-500); }

/* ---------- 汎用 ---------- */
.panel {
  background: var(--base-100); border: 1px solid var(--base-300);
  border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
}
.panel h2 { font-size: 15px; font-weight: 900; margin: 0 0 4px; }
.panel .hint { font-size: 12px; color: var(--base-500); margin: 0 0 16px; }

.row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; }
.row input[type="radio"] { margin-top: 3px; accent-color: var(--primary-400); }
.row strong { font-weight: 900; }
.row .desc { color: var(--base-500); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--base-300); }
th { font-size: 12px; color: var(--base-500); font-weight: 700; }

.bar { height: 8px; background: var(--base-250); border-radius: 999px; overflow: hidden; width: 160px; }
.bar > span { display: block; height: 100%; background: var(--primary-400); }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge.ok { background: #e6f7ee; color: #067647; }
.badge.warn { background: #fff4e5; color: #b54708; }
.badge.dead { background: #fdecec; color: #b42318; }

.btn {
  padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid var(--primary-400);
  background: var(--primary-400); color: #fff; font-weight: 700; cursor: pointer;
}
.btn:hover { background: var(--primary-500); border-color: var(--primary-500); }
.btn.ghost { background: transparent; color: var(--primary-400); }
.btn.ghost:hover { background: var(--base-200); }

.empty { padding: 56px 20px; text-align: center; color: var(--base-500); }
.empty .big { font-size: 15px; font-weight: 700; color: var(--base-600); margin-bottom: 6px; }

/* ---------- ログイン ---------- */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login {
  width: 340px; background: var(--base-100); border: 1px solid var(--base-300);
  border-radius: var(--radius); padding: 32px;
}
.login h1 { font-size: 18px; margin: 0 0 20px; }
.login input {
  width: 100%; padding: 11px 14px; border: 1px solid var(--base-300);
  border-radius: var(--radius-sm); margin-bottom: 12px;
}
.login .btn { width: 100%; }
.err { color: #b42318; font-size: 12px; min-height: 18px; }

/* ---------- 詳細 ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; }
.player {
  background: var(--base-600); border-radius: var(--radius);
  aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center;
  color: var(--base-400); text-align: center; padding: 24px;
}
.notes textarea {
  width: 100%; min-height: 220px; padding: 12px;
  border: 1px solid var(--base-300); border-radius: var(--radius-sm); resize: vertical;
}
@media (max-width: 1000px) { .detail { grid-template-columns: 1fr; } }
