/* ファイルパス: public/css/style.css */
:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --border: #dbe3ee;
  --border-strong: #c7d2e3;
  --text: #172033;
  --muted: #667085;
  --muted-2: #8a94a6;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --primary-soft: #eff6ff;
  --green: #16a34a;
  --green-soft: #ecfdf3;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --amber: #d97706;
  --amber-soft: #fffbeb;
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.06);
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --header-h: 68px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Yu Gothic", "YuGothic", "Meiryo", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 34%),
    linear-gradient(135deg, #f8fbff 0%, #f2f6fb 100%);
}
.auth-shell { width: min(460px, calc(100vw - 32px)); }
.auth-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 38px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.brand-mark {
  width: 54px;
  height: 54px;
  display: inline-grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, #2563eb, #16a34a);
  color: #fff;
  font-weight: 800;
  letter-spacing: -0.04em;
  font-size: 26px;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.24);
}
.brand-mark-sm { width: 34px; height: 34px; border-radius: 12px; font-size: 18px; }
.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.09em;
}
h1, h2, h3 { letter-spacing: -0.03em; line-height: 1.25; }
h1 { margin: 8px 0 10px; font-size: 32px; }
h2 { margin: 0; font-size: 18px; }
.muted { color: var(--muted); margin: 0; }
.small-muted { color: var(--muted); font-size: 12px; }
.stack-lg { display: grid; gap: 10px; margin-top: 28px; }
.field-label { display: block; color: #344054; font-size: 12px; font-weight: 700; margin-top: 8px; }
.input, .title-input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}
.input:focus, .title-input:focus {
  border-color: rgba(37, 99, 235, 0.65);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10);
}
.title-input {
  border: none;
  background: transparent;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
  padding: 4px 0;
  min-height: 30px;
}
.title-input:focus { box-shadow: none; }

.btn {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 9px 14px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
  background: #fff;
  transition: transform 0.12s, box-shadow 0.12s, background 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-soft); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-strong); }
.btn-secondary { background: var(--surface-soft); border-color: var(--border); }
.btn-soft { background: var(--green-soft); border-color: #bbf7d0; color: #166534; }
.btn-ghost { background: transparent; border-color: var(--border); color: #344054; }
.btn-danger-soft { background: var(--red-soft); border-color: #fecaca; color: #991b1b; }
.btn-block { width: 100%; }
.icon-btn {
  border: 0;
  background: transparent;
  font-size: 24px;
  cursor: pointer;
  color: var(--muted);
}
.form-message { min-height: 22px; margin: 6px 0 0; color: var(--red); font-size: 13px; }
.note-box {
  margin-top: 22px;
  padding: 14px;
  border-radius: 14px;
  background: var(--primary-soft);
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
  font-size: 13px;
}

.app-header {
  height: var(--header-h);
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 26px;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}
.app-logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 850; font-size: 18px; letter-spacing: -0.04em; }
.app-nav { display: flex; align-items: center; gap: 10px; }
.nav-link { padding: 9px 12px; border-radius: 999px; color: var(--muted); font-weight: 700; }
.nav-link.active { color: var(--primary); background: var(--primary-soft); }
.page-shell { width: min(1180px, calc(100vw - 40px)); margin: 28px auto 70px; }
.wide-shell { width: min(1380px, calc(100vw - 40px)); }
.hero-card, .toolbar-card, .panel-card, .wbs-table-card, .empty-state, .auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
}
.hero-card {
  border-radius: var(--radius-lg);
  padding: 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow-soft);
}
.toolbar-card {
  margin-top: 18px;
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.search-input { max-width: 360px; }
.board-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}
.board-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 14px;
}
.board-card h2 { font-size: 18px; word-break: break-word; }
.board-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.metric {
  padding: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.metric strong { display: block; font-size: 18px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: #475467;
  font-size: 12px;
  font-weight: 800;
}
.pill.share-on { background: var(--green-soft); color: #166534; border-color: #bbf7d0; }
.pill.warn { background: var(--amber-soft); color: #92400e; border-color: #fed7aa; }
.empty-state {
  margin-top: 20px;
  border-radius: var(--radius-lg);
  padding: 42px;
  text-align: center;
  color: var(--muted);
}
.toast-root { position: fixed; right: 18px; bottom: 18px; z-index: 1000; display: grid; gap: 10px; }
.toast {
  min-width: 260px;
  max-width: 420px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: var(--shadow);
  color: var(--text);
}
.toast.error { border-color: #fecaca; background: #fff7f7; color: #991b1b; }
.toast.success { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }

.modal {
  border: 0;
  background: transparent;
  padding: 0;
  width: min(640px, calc(100vw - 40px));
}
.modal::backdrop { background: rgba(15, 23, 42, 0.36); backdrop-filter: blur(3px); }
.modal-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
}
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin: 18px 0; }
.stat-card { border: 1px solid var(--border); border-radius: var(--radius-md); background: #fff; padding: 16px; box-shadow: var(--shadow-soft); }
.stat-card strong { font-size: 24px; display: block; }

@media (max-width: 980px) {
  .app-header { height: auto; min-height: var(--header-h); flex-wrap: wrap; padding: 12px 16px; }
  .app-nav { flex-wrap: wrap; }
  .page-shell { width: min(100vw - 24px, 1180px); }
  .hero-card, .toolbar-card { align-items: stretch; flex-direction: column; }
}



/* 以下を style.css の末尾に追加してください。エラー本文が長い場合でも画面を壊さないための安全表示です。 */
.toast-root {
  max-width: min(420px, calc(100vw - 36px));
  pointer-events: none;
}

.toast {
  width: min(420px, calc(100vw - 36px));
  max-height: 160px;
  overflow: auto;
  white-space: pre-line;
  word-break: break-word;
  overflow-wrap: anywhere;
  pointer-events: auto;
}


