/* =========================================================
   SnapBoard 共通スタイル
   ========================================================= */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --line: #dfe3ec;
  --text: #1f2937;
  --text-sub: #5b6475;
  --primary: #f05a28;
  --primary-dark: #c8441a;
  --primary-soft: #fde8df;
  --danger: #c62828;
  --success: #1b7f4b;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "BIZ UDPGothic", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  line-height: 1.6;
}

a { color: var(--primary-dark); }
button, input, select, textarea { font: inherit; }
[hidden] { display: none !important; }

/* ---- ヘッダー ---- */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.site-header .brand {
  font-weight: 800;
  font-size: 20px;
  color: var(--text);
  text-decoration: none;
}
.site-header .brand span { color: var(--primary); }
.site-header .spacer { flex: 1; }
.site-header .user-name { display: inline-flex; align-items: center; gap: 6px; color: var(--text-sub); font-size: 14px; text-decoration: none; }
.avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: var(--primary-soft); color: var(--primary-dark); font-size: 13px; font-weight: 700; vertical-align: middle; }
.avatar-large { width: 72px; height: 72px; font-size: 28px; }
.avatar-edit { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }

/* ---- レイアウト ---- */
.container { width: min(960px, calc(100% - 32px)); margin: 24px auto 48px; }
.narrow { width: min(440px, calc(100% - 32px)); margin: 40px auto; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}
h1 { font-size: 24px; margin: 0 0 16px; }
h2 { font-size: 18px; margin: 0 0 12px; }
.sub { color: var(--text-sub); font-size: 14px; }

/* ---- フォーム ---- */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.field .hint { font-size: 13px; color: var(--text-sub); margin-top: 4px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.inline-form .field { flex: 1 1 200px; margin-bottom: 0; }

.btn {
  display: inline-block;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.6; cursor: wait; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { color: var(--danger); border-color: var(--danger); }
.btn-small { padding: 4px 10px; font-size: 14px; }
.btn-block { width: 100%; }

/* ---- メッセージ ---- */
.message { padding: 10px 12px; border-radius: 8px; margin-bottom: 16px; white-space: pre-line; }
.message.error { background: #fdecea; color: var(--danger); }
.message.success { background: #e7f6ee; color: var(--success); }

/* ---- 表 ---- */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: 13px; color: var(--text-sub); font-weight: 600; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: var(--primary-soft); color: var(--primary-dark); }
.copy-box { display: flex; gap: 8px; margin-top: 12px; }
.copy-box input { flex: 1; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }

.links { margin-top: 16px; font-size: 14px; display: flex; gap: 16px; flex-wrap: wrap; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.tile { display: block; color: var(--text); text-decoration: none; }
.tile.disabled { opacity: 0.55; }

/* ---- ステップ3: ナビ・掲示板・ファイル ---- */
.app-nav { flex-basis: 100%; display: flex; gap: 4px; overflow-x: auto; margin: 0 -4px; }
.app-nav a { padding: 6px 10px; border-radius: 8px; color: var(--text-sub); text-decoration: none; white-space: nowrap; font-size: 14px; }
.app-nav a[aria-current="page"] { background: var(--primary-soft); color: var(--primary-dark); font-weight: 700; }
.field input[readonly] { background: var(--bg); color: var(--text-sub); }
.field textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row .spacer { flex: 1; }
.page-head { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.page-head h1 { margin: 0; }

.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; }
.tabs button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; cursor: pointer; white-space: nowrap; }
.tabs button[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 12px; text-align: center; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filters input, .filters select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.filters input[type="search"] { flex: 1 1 200px; }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list .item { display: block; padding: 12px 4px; color: var(--text); text-decoration: none; }
.list .item:hover { background: var(--bg); }
.list .title { font-weight: 700; }
.list .unread .title::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--primary); vertical-align: middle; }
.meta { display: flex; gap: 4px 12px; flex-wrap: wrap; align-items: center; color: var(--text-sub); font-size: 13px; margin-top: 4px; }
.empty { color: var(--text-sub); padding: 16px 4px; }

/* 注意を引く文字（ファイルの削除が近い、ログイン失敗など） */
.due { font-size: 12px; }
.due.today { color: #8a6400; font-weight: 700; }
.due.overdue { color: var(--danger); font-weight: 700; }

.post-body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0 0; }
.post { border-top: 1px solid var(--line); padding: 16px 0; }
.post:first-child { border-top: 0; padding-top: 0; }
.post-head { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 14px; }
.post-head .name { font-weight: 700; }
.post-head .actions { margin-left: auto; display: flex; gap: 6px; }
.attachments { list-style: none; padding: 0; margin: 8px 0 0; display: flex; gap: 6px; flex-wrap: wrap; }
.attachments a { display: inline-block; padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; text-decoration: none; }


.usage { display: grid; gap: 6px; }
.usage meter { width: 100%; height: 14px; }
.board-row { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.board-row:last-child { margin-bottom: 16px; }
.board-row input { flex: 1; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
.card section + section { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.home-grid .card { margin-bottom: 0; }
.home-grid h2 { display: flex; justify-content: space-between; align-items: baseline; }
.home-grid h2 a { font-size: 13px; font-weight: 400; }

@media (max-width: 600px) {
  .table .hide-sm { display: none; }
  .card { padding: 16px; }
}

/* メンバー登録後に出す、本人に伝える内容 */
.issued-text { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 15px; line-height: 1.7; background: var(--bg); margin-bottom: 8px; resize: vertical; }
.member-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.login-name { font-size: 13px; color: var(--text-sub); }
.badge-warn { background: #fdecea; color: var(--danger); }

/* パスワード欄の「表示」ボタン（ブラウザ独自の目のマークは出さない） */
input[type="password"]::-ms-reveal, input[type="password"]::-ms-clear { display: none; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 64px; }
.password-toggle { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface, #fff); color: var(--text-sub); font-size: 13px; cursor: pointer; }
.password-toggle[aria-pressed="true"] { color: var(--primary-dark); border-color: var(--primary); }

/* ログイン画面の「メンバー／管理者」の切り替え */
.login-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 4px 0 20px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.login-tabs button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 8px; border: 0; background: var(--bg); color: var(--text-sub); cursor: pointer; font: inherit; }
.login-tabs button + button { border-left: 1px solid var(--line); }
.login-tabs button strong { font-size: 16px; }
.login-tabs button span { font-size: 12px; }
.login-tabs button[aria-selected="true"] { background: var(--surface); color: var(--primary-dark); box-shadow: inset 0 -3px 0 var(--primary); }
.login-tabs button[aria-selected="true"] strong { color: var(--text); }
