/* つばめ音楽教室 — 月謝・回数券・振替管理デモ */
:root {
  --acc: #DB2777;
  --acc-d: #9D174D;
  --acc-bg: #FCE7F3;
  --ok-bg: #D1FAE5;
  --warn-bg: #FEF3C7;
  --bg: #F4F6F8;
  --ink: #1F2937;
  --mut: #6B7280;
  --line: #E5E7EB;
  --danger: #DC2626;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { background: var(--bg); color: var(--ink); font-family: 'Noto Sans JP', sans-serif; font-size: 15px; line-height: 1.6; }

/* ---- chrome ---- */
.demo-banner {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: #1F2937; color: #fff; font-size: 12px; padding: 7px 12px;
}
.bn-reset { background: none; border: 1px solid #6B7280; color: #D1D5DB; border-radius: 6px; font-size: 11px; padding: 3px 9px; cursor: pointer; font-family: inherit; }

.app-header {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, var(--acc), var(--acc-d));
  color: #fff; padding: 14px 16px;
}
.logo-emoji { font-size: 30px; }
.shop-name { font-weight: 900; font-size: 17px; line-height: 1.3; }
.shop-sub { font-size: 11px; opacity: .85; }
.role-switch { margin-left: auto; }
.role-switch select {
  appearance: none; background: rgba(255,255,255,.18); color: #fff;
  border: 1px solid rgba(255,255,255,.5); border-radius: 8px;
  font-family: inherit; font-size: 13px; font-weight: 700; padding: 7px 10px;
}
.role-switch option { color: #1F2937; }

main { padding: 14px 14px 86px; max-width: 560px; margin: 0 auto; }

/* ---- cards ---- */
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 12px; }
.card.slim { padding: 12px 14px; }
.card.tap { cursor: pointer; }
.sec-t { font-weight: 900; font-size: 14px; margin: 14px 0 8px; }
.card .sec-t, .card.slim .sec-t { margin-top: 0; }
.row-sp { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.mut { color: var(--mut); font-size: 12px; }
.bad-t { color: var(--danger); font-weight: 900; }

.badge { display: inline-block; font-size: 12px; font-weight: 900; border-radius: 999px; padding: 4px 12px; }
.bg-ok { background: var(--ok-bg); color: #047857; }
.bg-stop { background: #FEE2E2; color: #B91C1C; }

.notice { background: var(--bg); border-radius: 10px; padding: 11px 13px; font-size: 13px; margin-bottom: 10px; }
.notice b { font-weight: 900; }
.notice.ok-n { background: var(--ok-bg); color: #065F46; margin-bottom: 12px; }
.notice.warn-n { background: var(--warn-bg); color: #92400E; }
.card .notice:last-child { margin-bottom: 0; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  border: 1px solid transparent; border-radius: 10px; cursor: pointer;
  font-family: inherit; font-weight: 700; font-size: 13px; padding: 9px 14px;
  background: var(--acc-bg); color: var(--acc-d);
}
.btn.primary { background: var(--acc); color: #fff; }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn.danger { background: #fff; border-color: #FCA5A5; color: var(--danger); }
.btn.big { font-size: 15px; padding: 14px 18px; border-radius: 12px; }
.btn.wide { width: 100%; margin-top: 8px; }
.btn.mini2 { font-size: 11px; padding: 6px 10px; border-radius: 8px; }
.btn:disabled { opacity: .45; cursor: default; }
.btnrow { display: flex; gap: 6px; flex-wrap: wrap; }
.slot-btn { justify-content: flex-start; font-size: 14px; }

/* ---- board (today header) ---- */
.board { text-align: center; background: linear-gradient(160deg, #FDF2F8, #fff); }
.board-lb { font-size: 12px; font-weight: 700; color: var(--mut); letter-spacing: .1em; }
.board-num { font-size: 56px; font-weight: 900; color: var(--acc-d); line-height: 1.15; }
.board-num small { font-size: 22px; margin-left: 2px; }
.board-sub { font-size: 13px; color: var(--mut); }
.board-sub b { color: var(--ink); font-size: 16px; }

/* ---- status pills ---- */
.stpill { display: inline-block; font-size: 11px; font-weight: 900; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.st-ok { background: var(--ok-bg); color: #047857; }
.st-bad { background: #FEE2E2; color: #B91C1C; }
.st-wait { background: var(--warn-bg); color: #B45309; }
.st-mut { background: #E5E7EB; color: #6B7280; }
.tagchip { display: inline-block; font-size: 10px; font-weight: 900; background: var(--acc-bg); color: var(--acc-d); border-radius: 6px; padding: 1px 6px; vertical-align: 1px; }

/* ---- lesson rows ---- */
.q-row { display: flex; align-items: center; gap: 12px; }
.t-time { font-size: 17px; font-weight: 900; color: var(--acc-d); min-width: 52px; text-align: center; line-height: 1.2; }
.q-info { flex: 1; font-size: 13px; line-height: 1.5; }
.q-btns { display: flex; flex-direction: column; gap: 5px; align-items: stretch; min-width: 86px; }

/* ---- ticket dots ---- */
.tk-dots { display: flex; gap: 7px; flex-wrap: wrap; margin: 10px 0; }
.dot { width: 15px; height: 15px; border-radius: 50%; background: var(--acc); }
.dot.used { background: #E5E7EB; }
.tk-remain { font-size: 14px; }
.tk-remain b { font-size: 22px; font-weight: 900; color: var(--acc-d); }

/* ---- stats ---- */
.stats3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 6px; text-align: center; }
.stat-n { font-size: 24px; font-weight: 900; color: var(--acc-d); line-height: 1.2; }
.stat-n.small { font-size: 17px; }
.stat-n.bad { color: var(--danger); }
.stat-u { font-size: 12px; margin-left: 1px; }
.stat-lb { font-size: 11px; color: var(--mut); }

/* ---- info ---- */
.info-row { display: flex; gap: 10px; font-size: 13px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.info-row:last-child { border-bottom: none; }
.info-lb { min-width: 8em; color: var(--mut); flex-shrink: 0; }

/* ---- forms ---- */
.fld { margin-bottom: 12px; }
.fld label { display: block; font-size: 12px; font-weight: 700; color: var(--mut); margin-bottom: 4px; }
.fld input, .fld select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  font-family: inherit; font-size: 15px; padding: 11px 12px; background: #fff; color: var(--ink);
}

/* ---- tabbar ---- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  display: flex; background: #fff; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 10px; font-weight: 700; color: var(--mut); padding: 8px 0 9px;
}
.tab.on { color: var(--acc); }
.tab-ic { font-size: 20px; line-height: 1; }

/* ---- sheet ---- */
#sheet { display: none; position: fixed; inset: 0; z-index: 60; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: #fff; border-radius: 18px 18px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  max-width: 560px; margin: 0 auto; max-height: 80vh; overflow-y: auto;
}
.sh-head { display: flex; align-items: center; justify-content: space-between; font-weight: 900; font-size: 16px; margin-bottom: 6px; }
.sh-sub { font-size: 12px; color: var(--mut); margin-bottom: 14px; }

/* ---- toast / spinner ---- */
#toast {
  position: fixed; bottom: 78px; left: 50%; transform: translateX(-50%) translateY(16px);
  background: #1F2937; color: #fff; font-size: 13px; font-weight: 700;
  border-radius: 999px; padding: 10px 18px; opacity: 0; pointer-events: none;
  transition: all .25s; z-index: 70; white-space: nowrap; max-width: 92vw;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.spin-overlay {
  display: none; position: fixed; inset: 0; z-index: 80;
  background: rgba(255,255,255,.7); align-items: center; justify-content: center; flex-direction: column; gap: 12px;
}
.spinner { width: 38px; height: 38px; border: 4px solid var(--acc-bg); border-top-color: var(--acc); border-radius: 50%; animation: sp .8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.spin-msg { font-size: 13px; font-weight: 700; color: var(--acc-d); }

/* ---- intro overlay ---- */
.overlay {
  display: flex; position: fixed; inset: 0; z-index: 90;
  background: rgba(17,24,39,.55); align-items: center; justify-content: center; padding: 20px;
}
.intro { background: #fff; border-radius: 18px; padding: 26px 22px; max-width: 380px; text-align: center; }
.demo-chip { display: inline-block; background: var(--warn-bg); color: #92400E; font-size: 11px; font-weight: 900; border-radius: 999px; padding: 4px 12px; margin-bottom: 10px; }
.intro-emoji { font-size: 44px; }
.intro h1 { font-size: 20px; font-weight: 900; margin: 6px 0 2px; }
.intro .sub { font-size: 12px; color: var(--mut); margin-bottom: 12px; }
.intro ul { list-style: none; text-align: left; font-size: 13px; margin: 0 0 14px; }
.intro li { padding: 4px 0; }

@media (min-width: 760px) {
  main { max-width: 560px; }
}
