/* SHO-HAN 追加モジュール 共通スタイル
   ログイン管理 / チャット / 通話 — Theme: navy #0F2451, MD3風 */

:root {
  --navy: #0F2451;
  --navy-700: #1b356e;
  --navy-600: #274a92;
  --navy-50: #eef2fb;
  --accent: #3b82f6;
  --surface: #ffffff;
  --surface-2: #f5f7fb;
  --surface-3: #eaeef6;
  --on-surface: #1a2233;
  --on-surface-muted: #5b6678;
  --outline: #d6deec;
  --danger: #d92d20;
  --danger-bg: #fee4e2;
  --warn: #f59e0b;
  --ok: #16a34a;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-1: 0 1px 2px rgba(15,36,81,.08), 0 1px 3px rgba(15,36,81,.06);
  --shadow-2: 0 4px 12px rgba(15,36,81,.10), 0 2px 6px rgba(15,36,81,.06);
  --shadow-3: 0 12px 32px rgba(15,36,81,.18), 0 6px 12px rgba(15,36,81,.10);
  --font: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body { font-family: var(--font); color: var(--on-surface); background: var(--surface-2); -webkit-font-smoothing: antialiased; }
a { color: inherit; }

/* ---------- App bar ---------- */
.app-bar {
  background: linear-gradient(110deg, var(--navy) 0%, var(--navy-600) 100%);
  color: #fff; padding: 12px 18px; display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-2); position: sticky; top: 0; z-index: 50;
}
.app-bar h1 { font-size: 18px; font-weight: 700; margin: 0; letter-spacing: .02em; display:flex; align-items:center; gap:8px; }
.app-bar .spacer { flex: 1; }
.app-bar a { text-decoration: none; }
.app-bar .nav-link { color:#fff; opacity:.85; font-size:13px; font-weight:600; padding:6px 10px; border-radius:8px; }
.app-bar .nav-link:hover { opacity:1; background:rgba(255,255,255,.12); }

/* ---------- Buttons ---------- */
.btn { appearance:none; border:0; cursor:pointer; font-family:inherit; font-weight:600; font-size:14px;
  padding:10px 18px; border-radius:999px; background:var(--navy); color:#fff; transition:filter .15s, transform .05s, box-shadow .15s; box-shadow:var(--shadow-1); }
.btn:hover { filter:brightness(1.08); }
.btn:active { transform:translateY(1px); }
.btn:disabled { opacity:.5; cursor:not-allowed; }
.btn-ghost { background:transparent; color:var(--navy); box-shadow:none; border:1.5px solid var(--outline); }
.btn-ghost:hover { background:var(--navy-50); filter:none; }
.btn-sm { padding:6px 12px; font-size:13px; }
.btn-danger { background:var(--danger); }
.btn-icon { width:42px; height:42px; padding:0; display:grid; place-items:center; border-radius:50%; font-size:18px; }
.btn-block { width:100%; }

/* ---------- Avatar ---------- */
.avatar { border-radius:50%; display:grid; place-items:center; font-weight:700; color:#fff; flex:none; user-select:none; }
.avatar.sm { width:32px; height:32px; font-size:13px; }
.avatar.md { width:40px; height:40px; font-size:15px; }
.avatar.lg { width:56px; height:56px; font-size:20px; }
.online-dot { width:10px; height:10px; border-radius:50%; background:#9aa6b8; border:2px solid #fff; }
.online-dot.on { background:var(--ok); }

/* ---------- Inputs ---------- */
.input, select.input, textarea.input {
  width:100%; padding:11px 14px; border:1.5px solid var(--outline); border-radius:var(--radius-sm);
  font-family:inherit; font-size:15px; color:var(--on-surface); background:#fff; transition:border-color .15s, box-shadow .15s;
}
.input:focus { outline:none; border-color:var(--navy-600); box-shadow:0 0 0 3px rgba(39,74,146,.15); }
.field { display:flex; flex-direction:column; gap:6px; margin-bottom:14px; }
.field label { font-size:13px; font-weight:600; color:var(--on-surface-muted); }

/* ---------- Card ---------- */
.card { background:var(--surface); border-radius:var(--radius); box-shadow:var(--shadow-1); padding:18px; }

/* ---------- Badge ---------- */
.badge { display:inline-grid; place-items:center; min-width:20px; height:20px; padding:0 6px; border-radius:999px;
  background:var(--danger); color:#fff; font-size:11px; font-weight:700; }
.chip { display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border-radius:999px; background:var(--surface-3); font-size:12px; font-weight:600; color:var(--on-surface-muted); }
.chip.admin { background:#e0e7ff; color:#3730a3; }

/* ---------- Toast ---------- */
.toast { position:fixed; left:50%; bottom:28px; transform:translateX(-50%); background:var(--navy); color:#fff;
  padding:12px 22px; border-radius:999px; box-shadow:var(--shadow-3); z-index:9999; font-size:14px; font-weight:600; }
.toast.err { background:var(--danger); }

/* ---------- Modal ---------- */
.modal-bg { position:fixed; inset:0; background:rgba(15,36,81,.45); display:grid; place-items:center; z-index:200; padding:16px; }
.modal { background:#fff; border-radius:var(--radius); box-shadow:var(--shadow-3); width:100%; max-width:520px; max-height:90vh; overflow:auto; }
.modal h2 { margin:0; padding:18px 20px; font-size:17px; border-bottom:1px solid var(--surface-3); }
.modal .body { padding:18px 20px; }
.modal .foot { padding:14px 20px; display:flex; gap:10px; justify-content:flex-end; border-top:1px solid var(--surface-3); }

/* ---------- Switch ---------- */
.switch { position:relative; display:inline-block; width:46px; height:26px; flex:none; }
.switch input { opacity:0; width:0; height:0; }
.switch .slider { position:absolute; inset:0; background:#c3ccdd; border-radius:999px; transition:.2s; }
.switch .slider:before { content:""; position:absolute; height:20px; width:20px; left:3px; top:3px; background:#fff; border-radius:50%; transition:.2s; box-shadow:var(--shadow-1); }
.switch input:checked + .slider { background:var(--ok); }
.switch input:checked + .slider:before { transform:translateX(20px); }

.spinner { width:36px; height:36px; border:3px solid var(--surface-3); border-top-color:var(--navy); border-radius:50%; animation:spin .8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
.muted { color:var(--on-surface-muted); }
