/* ============ Fularis.nurs デザインシステム ============ */
:root {
  --navy-900: #0b2038; --navy-800: #0e2a47; --navy-700: #143a5e;
  --coral: #f2705b; --coral-dark: #e05a44; --coral-light: #fde3dd; --coral-pale: #fdf1ee;
  --cream: #faf5f0; --card: #ffffff;
  --ink: #1d3a56; --ink-soft: #5a7186; --ink-faint: #9aacbc;
  --ok: #3d9e7c; --ok-pale: #e2f3ec;
  --warn: #c9962b; --warn-pale: #fbf3dc;
  --danger: #cc4b3c; --danger-pale: #fbe7e3;
  --radius: 18px; --radius-sm: 12px;
  --shadow: 0 4px 24px rgba(16, 42, 67, 0.07);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  background: var(--cream); color: var(--ink); font-size: 15px; line-height: 1.6;
}
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 15px; }

/* ---- layout ---- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; background: linear-gradient(180deg, var(--navy-800), var(--navy-900));
  color: #fff; padding: 24px 14px; display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: 0; height: 100vh; flex-shrink: 0;
}
.logo { display: flex; align-items: center; gap: 10px; padding: 0 10px 22px; }
.logo-mark {
  width: 40px; height: 40px; border-radius: 12px; background: var(--coral);
  display: grid; place-items: center; font-weight: 800; font-size: 20px; color: #fff;
}
.logo-mark-img {
  width: 40px; height: 40px; border-radius: 12px; background: #fff; padding: 3px;
  object-fit: contain; flex-shrink: 0;
}
.logo-full { width: 100%; max-width: 250px; display: block; margin: 0 auto 14px; }
.logo-name { font-weight: 700; font-size: 19px; letter-spacing: .02em; }
.logo-name small { display: block; font-size: 11px; color: var(--coral); font-weight: 600; letter-spacing: .12em; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px;
  color: #c6d4e2; font-size: 14px; font-weight: 500; border: none; background: none; text-align: left; width: 100%;
}
.nav-item svg { flex-shrink: 0; }
.nav-item.active { background: rgba(255,255,255,.09); color: #fff; box-shadow: inset 3px 0 0 var(--coral); }
.nav-item:hover { color: #fff; }
.sidebar-foot { margin-top: auto; background: rgba(255,255,255,.06); border-radius: 14px; padding: 16px; font-size: 12.5px; color: #c6d4e2; }
.sidebar-foot .coach { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; color: #fff; }
.coach-avatar { width: 38px; height: 38px; border-radius: 50%; background: #fff; color: var(--navy-800); display: grid; place-items: center; font-weight: 700; }
.btn-ghost {
  margin-top: 10px; width: 100%; padding: 9px; border-radius: 9px; border: 1px solid rgba(255,255,255,.25);
  background: none; color: #fff; font-size: 12.5px;
}
.btn-ghost:hover { background: rgba(255,255,255,.08); }

.main { flex: 1; padding: 34px 40px 60px; max-width: 1160px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 26px; gap: 12px; }
h1.greet { font-size: 30px; font-weight: 700; letter-spacing: .01em; }
.greet-sub { color: var(--ink-soft); margin-top: 4px; font-size: 14px; }
.avatar-chip { width: 42px; height: 42px; border-radius: 50%; background: var(--navy-800); color: #fff; display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }

/* ---- cards ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-bottom: 26px; }
.card { background: var(--card); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.card-label { font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.big-number { font-size: 44px; font-weight: 800; color: var(--coral); line-height: 1.1; }
.big-number .unit { font-size: 17px; color: var(--ink); font-weight: 700; margin-left: 3px; }
.pill { display: inline-block; background: var(--coral-pale); color: var(--coral-dark); font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 999px; }
.pill.ok { background: var(--ok-pale); color: var(--ok); }
.pill.warn { background: var(--warn-pale); color: var(--warn); }
.pill.danger { background: var(--danger-pale); color: var(--danger); }

.donut-wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.donut { position: relative; width: 110px; height: 110px; flex-shrink: 0; }
.donut svg { transform: rotate(-90deg); }
.donut-num { position: absolute; inset: 0; display: grid; place-items: center; font-size: 21px; font-weight: 800; color: var(--ink); }
.donut-num small { font-size: 11px; font-weight: 600; }

.donut-sm { width: 86px; height: 86px; }
.donut-sm .donut-num { font-size: 15px; }
.donut-sm .donut-num small { font-size: 9px; }
.journey { height: 8px; background: #f1e6de; border-radius: 999px; margin-top: 14px; overflow: hidden; }
.journey-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--coral-light), var(--coral)); width: 0%; transition: width .6s ease; }
.daily-mood {
  border: 1.5px solid #e4dcd4; background: #fff; border-radius: 10px; padding: 6px 10px 4px; line-height: 1.1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.daily-mood .e { font-size: 17px; }
.daily-mood .t { font-size: 9.5px; color: var(--ink-soft); font-weight: 600; }
.daily-mood.sel { border-color: var(--coral); background: var(--coral-pale); }
.daily-mood.sel .t { color: var(--coral-dark); }

/* スタンプカード */
.stamp-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 8px; max-width: 560px; }
.stamp {
  aspect-ratio: 1; border-radius: 50%; border: 1.5px dashed #e0d5cb; display: grid; place-items: center;
  font-size: 11px; color: var(--ink-faint); background: #fdfaf7; position: relative;
}
.stamp.on {
  border: none; background: var(--coral-pale); font-size: 20px;
  animation: stamp-pop .3s ease;
}
.stamp.milestone.on { background: var(--warn-pale); }
.stamp.current { border: 2px solid var(--coral); color: var(--coral-dark); font-weight: 700; }
@keyframes stamp-pop { 0% { transform: scale(.4); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
.cheer { margin-top: 14px; background: var(--coral-pale); border-radius: var(--radius-sm); padding: 12px 16px; font-size: 13.5px; font-weight: 600; color: var(--coral-dark); }
.week-notes { background: var(--coral-pale); border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 18px; font-size: 13px; }
.week-notes .t { font-weight: 700; color: var(--coral-dark); font-size: 12px; margin-bottom: 4px; }
.bars { display: flex; align-items: flex-end; gap: 9px; height: 84px; margin-top: 14px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; }
.bar { width: 100%; max-width: 22px; border-radius: 6px 6px 3px 3px; background: var(--coral); opacity: .85; min-height: 3px; }
.bar.today { background: var(--coral-dark); opacity: 1; }
.bar-day { font-size: 10.5px; color: var(--ink-faint); }

/* ---- report panel ---- */
.panel { background: var(--card); border-radius: var(--radius); padding: 28px 30px; box-shadow: var(--shadow); margin-bottom: 26px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.week-tag { color: var(--coral); font-size: 11.5px; font-weight: 700; letter-spacing: .14em; }
.panel-title { font-size: 21px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.check-badge { width: 34px; height: 34px; border: 2.5px solid var(--coral); border-radius: 10px; display: grid; place-items: center; color: var(--coral); font-weight: 800; }
.panel-note { color: var(--coral-dark); font-size: 12.5px; font-weight: 600; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 26px; }
.field label { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 7px; }
.field label small { font-weight: 500; color: var(--ink-faint); margin-left: 6px; }
.field textarea, .field input[type="text"], .field input[type="number"], .field input[type="date"], .field input[type="time"] {
  width: 100%; border: 1.5px solid #e4dcd4; border-radius: var(--radius-sm); padding: 12px 14px;
  background: #fff; resize: vertical; min-height: 48px; color: var(--ink);
}
.field textarea:focus, .field input:focus { outline: none; border-color: var(--coral); }
.mood-row { display: flex; gap: 10px; flex-wrap: wrap; }
.mood-btn {
  flex: 1; min-width: 110px; border: 1.5px solid #e4dcd4; background: #fff; border-radius: var(--radius-sm);
  padding: 11px 8px; font-size: 13.5px; font-weight: 600; color: var(--ink-soft);
}
.mood-btn.sel-順調 { border-color: var(--ok); background: var(--ok-pale); color: var(--ok); }
.mood-btn.sel-少し疲れた { border-color: var(--warn); background: var(--warn-pale); color: var(--warn); }
.mood-btn.sel-立て直したい { border-color: var(--danger); background: var(--danger-pale); color: var(--danger); }
.form-foot { display: flex; justify-content: flex-end; align-items: center; gap: 16px; margin-top: 22px; flex-wrap: wrap; }
.form-msg { color: var(--ink-soft); font-size: 13px; }
.btn-primary {
  background: linear-gradient(135deg, var(--coral), var(--coral-dark)); color: #fff; border: none;
  padding: 14px 34px; border-radius: 999px; font-size: 15px; font-weight: 700;
  box-shadow: 0 6px 18px rgba(242,112,91,.35);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:disabled { opacity: .55; cursor: default; }
.btn-secondary {
  background: #fff; border: 1.5px solid #e4dcd4; color: var(--ink); padding: 10px 20px;
  border-radius: 999px; font-size: 13.5px; font-weight: 600;
}
.btn-secondary:hover { border-color: var(--coral); color: var(--coral-dark); }

/* streak */
.streak-bar { display: flex; gap: 4px; margin-top: 10px; flex-wrap: wrap; }
.streak-cell { width: 14px; height: 14px; border-radius: 4px; background: #eee4dc; }
.streak-cell.on { background: var(--coral); }

/* ---- history ---- */
.history-item { border-top: 1px solid #f0e8e1; padding: 18px 4px; }
.history-item:first-child { border-top: none; }
.history-week { font-weight: 700; font-size: 14px; margin-bottom: 6px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.history-body { font-size: 13.5px; color: var(--ink-soft); }
.history-body b { color: var(--ink); font-weight: 600; }
.coach-comment {
  margin-top: 10px; background: var(--coral-pale); border-left: 3px solid var(--coral);
  border-radius: 0 10px 10px 0; padding: 10px 14px; font-size: 13.5px; color: var(--ink);
}
.coach-comment .who { font-size: 11.5px; font-weight: 700; color: var(--coral-dark); margin-bottom: 3px; }

/* ---- auth ---- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(160deg, var(--navy-800) 0%, var(--navy-900) 60%); }
.auth-card { background: #fff; border-radius: 22px; padding: 40px 36px; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.auth-card .logo { padding: 0 0 18px; }
.auth-card .logo-name { color: var(--ink); }
.auth-card h2 { font-size: 19px; margin-bottom: 4px; }
.auth-sub { color: var(--ink-soft); font-size: 13px; margin-bottom: 20px; }
.auth-card .field { margin-bottom: 14px; }
.auth-err { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 20px; }
.auth-switch { text-align: center; margin-top: 16px; font-size: 13px; color: var(--ink-soft); }
.auth-switch a { color: var(--coral-dark); font-weight: 600; cursor: pointer; }
.demo-box { margin-top: 22px; border-top: 1px dashed #e4dcd4; padding-top: 16px; text-align: center; }
.demo-box p { font-size: 12px; color: var(--ink-faint); margin-bottom: 10px; }

/* ---- admin table ---- */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi { background: var(--card); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.kpi .v { font-size: 30px; font-weight: 800; color: var(--ink); }
.kpi .v.coral { color: var(--coral); }
.kpi .k { font-size: 12.5px; color: var(--ink-soft); font-weight: 600; }
table.roster { width: 100%; border-collapse: collapse; }
.roster th { text-align: left; font-size: 12px; color: var(--ink-faint); font-weight: 600; padding: 8px 10px; border-bottom: 1.5px solid #f0e8e1; white-space: nowrap; }
.roster td { padding: 13px 10px; border-bottom: 1px solid #f6efe9; font-size: 14px; vertical-align: middle; }
.roster tr.clickable { cursor: pointer; }
.roster tr.clickable:hover { background: var(--coral-pale); }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.dot-ok { background: var(--ok); } .dot-miss { background: #d5c9bf; } .dot-danger { background: var(--danger); }

/* drawer */
.drawer-mask { position: fixed; inset: 0; background: rgba(11,32,56,.45); display: none; z-index: 40; }
.drawer-mask.open { display: block; }
.drawer {
  position: fixed; top: 0; right: -560px; width: min(560px, 96vw); height: 100vh; background: var(--cream);
  z-index: 50; transition: right .28s ease; overflow-y: auto; padding: 28px; box-shadow: -12px 0 40px rgba(0,0,0,.2);
}
.drawer.open { right: 0; }
.drawer-close { background: none; border: none; font-size: 26px; color: var(--ink-soft); float: right; }

/* ---- misc ---- */
.muted { color: var(--ink-faint); font-size: 12.5px; }
.section-title { font-size: 16px; font-weight: 700; margin: 26px 0 12px; }
.inline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inline-form input { border: 1.5px solid #e4dcd4; border-radius: 10px; padding: 9px 12px; }
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(80px); z-index: 90;
  background: var(--navy-800); color: #fff; padding: 12px 26px; border-radius: 999px; font-size: 14px;
  opacity: 0; transition: all .3s ease; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.hidden { display: none !important; }

/* ---- mobile ---- */
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; padding: 12px 16px; gap: 4px; overflow-x: auto; }
  .logo { padding: 0 10px 0 0; } .logo-name small { display: none; }
  .nav-item { width: auto; padding: 9px 12px; white-space: nowrap; font-size: 13px; }
  .nav-item svg { display: none; }
  .sidebar-foot { display: none; }
  .main { padding: 22px 16px 80px; }
  h1.greet { font-size: 23px; }
  .form-grid { grid-template-columns: 1fr; }
  .panel { padding: 20px 18px; }
}
