:root {
  --brand: #2f7d6b;
  --brand-dark: #245e51;
  --bg: #f4f6f5;
  --card: #ffffff;
  --line: #dfe5e3;
  --text: #223;
  --muted: #6b7772;
  --danger: #c0453b;
  --warn-bg: #fff4d6;
  --warn-line: #e6c84a;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
}
.hidden { display: none !important; }

/* ヘッダー */
header.app-header {
  background: var(--brand);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
header.app-header h1 { font-size: 18px; margin: 0; font-weight: 700; }
header.app-header .user { font-size: 14px; display: flex; align-items: center; gap: 12px; }

/* モード表示バナー */
.mode-banner {
  padding: 8px 16px;
  font-size: 13px;
  text-align: center;
}
.mode-banner.demo { background: var(--warn-bg); border-bottom: 1px solid var(--warn-line); color: #6b5300; }
.mode-banner.cloud { background: #e4f3ee; border-bottom: 1px solid #b9ded2; color: var(--brand-dark); }

/* タブ */
nav.tabs { display: flex; background: var(--card); border-bottom: 1px solid var(--line); overflow-x: auto; }
nav.tabs button {
  flex: 1 0 auto;
  border: none;
  background: none;
  padding: 14px 16px;
  font-size: 15px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}
nav.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 700; }

/* コンテンツ */
main { max-width: 920px; margin: 0 auto; padding: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; }
.card h2 { margin: 0 0 12px; font-size: 17px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; flex: 1 1 140px; }
.field.full { flex-basis: 100%; }
.field label { font-size: 13px; color: var(--muted); }

input, select, textarea, button {
  font-family: inherit;
  font-size: 16px;
}
input, select, textarea {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  width: 100%;
}
textarea { resize: vertical; min-height: 60px; }

.btn {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 16px;
  cursor: pointer;
  font-weight: 700;
}
.btn:hover { background: var(--brand-dark); }
.btn.secondary { background: #eef2f0; color: var(--text); }
.btn.secondary:hover { background: #e2e8e5; }
.btn.danger { background: var(--danger); }
.btn.small { padding: 6px 12px; font-size: 14px; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; vertical-align: top; }
th { color: var(--muted); font-weight: 600; background: #f9fbfa; }
tr:hover td { background: #fafcfb; }

.toast {
  position: fixed;
  bottom: 20px; left: 50%; transform: translateX(-50%);
  background: #333; color: #fff; padding: 12px 20px; border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,.2); z-index: 100; font-size: 15px;
}
.toast.err { background: var(--danger); }

/* ログイン画面 */
.login-wrap { max-width: 380px; margin: 8vh auto; }
.login-wrap .card { padding: 28px; }
.login-wrap h1 { text-align: center; color: var(--brand); font-size: 22px; margin: 0 0 4px; }
.login-wrap p.sub { text-align: center; color: var(--muted); font-size: 13px; margin: 0 0 20px; }

.muted { color: var(--muted); font-size: 13px; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: #eef2f0; color: var(--muted); }
.link-btn { background: none; border: none; color: var(--brand); cursor: pointer; text-decoration: underline; font-size: 14px; padding: 0; }

@media (max-width: 600px) {
  .field { flex-basis: 100%; }
}
