/* 習慣図鑑 管理画面：アプリと同じ紺・金・アイボリー（指示書の基本色） */
:root {
  --navy: #10233f; --gold: #c5a46a; --goldText: #7c5c22; --ivory: #f7f4ed; --paper: #fffdf8;
  --ink: #17263a; --soft: #5a6170; --line: #e3d6ba; --ok: #3e6b4f; --ng: #9e3b32; --warn: #a06a12;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--ivory); color: var(--ink);
  font-family: "Noto Sans JP", "Hiragino Sans", system-ui, sans-serif; font-size: 14px; line-height: 1.6; }
h1, h2, h3 { font-family: "Noto Serif JP", "Hiragino Mincho ProN", serif; }
.bar { background: var(--navy); color: #f6f1e6; display: flex; align-items: center; gap: 24px;
  padding: 10px 24px; border-bottom: 3px solid var(--gold); position: sticky; top: 0; z-index: 5; }
.bar h1 { margin: 0; font-size: 20px; }
.bar h1 span { font-size: 13px; color: var(--gold); margin-left: 6px; }
.bar nav { display: flex; gap: 16px; align-items: center; flex: 1; }
.bar nav a { color: #f6f1e6; text-decoration: none; }
.bar nav a:hover { color: var(--gold); }
.bar nav #logout { margin-left: auto; }
main { max-width: 1180px; margin: 0 auto; padding: 20px 24px 80px; }
.muted { color: var(--soft); }
.small { font-size: 12px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 16px; }
.card h2 { margin: 0 0 10px; font-size: 18px; }
.card h3 { margin: 14px 0 6px; font-size: 15px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > label { flex: 1 1 200px; }
label { display: block; font-size: 12px; color: var(--soft); margin-bottom: 8px; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1px solid #cdb585; border-radius: 6px; padding: 6px 8px; margin-top: 2px; }
textarea { min-height: 64px; resize: vertical; }
input[type=checkbox] { width: auto; }
button { font: inherit; cursor: pointer; border-radius: 6px; padding: 6px 14px;
  border: 1px solid #8c6a2d; background: linear-gradient(#d8bd85, #b08a4a); color: #fff; font-weight: 600; }
button.ghost { background: transparent; color: inherit; border-color: currentColor; font-weight: 400; }
button.plain { background: #fff; color: var(--ink); border-color: #cdb585; font-weight: 400; }
button.danger { background: var(--ng); border-color: var(--ng); }
button:disabled { opacity: .5; cursor: default; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--soft); font-weight: 600; }
tr.click:hover { background: #f3ecdc; cursor: pointer; }
.badge { display: inline-block; font-size: 11px; border-radius: 4px; padding: 0 6px; border: 1px solid; white-space: nowrap; }
.badge.ok { color: var(--ok); } .badge.ng { color: var(--ng); } .badge.wait { color: var(--warn); } .badge.dim { color: var(--soft); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }
.habit { border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 10px; background: #fff; }
.alert { border-left: 4px solid var(--ng); background: #fbeeee; padding: 8px 12px; border-radius: 6px; margin: 8px 0; }
.note { border-left: 4px solid var(--gold); background: #faf4e6; padding: 8px 12px; border-radius: 6px; margin: 8px 0; }
.ai-out { white-space: pre-wrap; font-size: 13px; background: #fff; border: 1px dashed #cdb585; border-radius: 8px; padding: 10px; max-height: 480px; overflow: auto; }
.preview { background: #f7f4ed; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.preview .pcard { width: 200px; background: #fffdf8; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; text-align: center; }
.preview .pimg { height: 120px; background: linear-gradient(135deg, #213555, #0c1828); display: flex; align-items: center; justify-content: center; color: #dcc48f; font-size: 42px; font-family: serif; }
.preview .pimg img { width: 100%; height: 100%; object-fit: cover; }
.chips span { display: inline-block; border: 1px solid #cdb585; border-radius: 999px; padding: 0 8px; margin: 2px; font-size: 12px; color: var(--goldText); }
#toast { position: fixed; right: 20px; bottom: 20px; background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 8px; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 420px; }
#toast.show { opacity: .95; }
.sticky-actions { position: sticky; bottom: 0; background: var(--ivory); padding: 10px 0; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
