:root {
  --bg: #ffffff;
  --bg2: #f8f9fa;
  --bg3: #e9ecef;
  --border: #dee2e6;
  --text: #212529;
  --text2: #6c757d;
  --text3: #adb5bd;
  --accent: #0d9488;
  --accent2: rgba(13,148,136,0.1);
  --success: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --radius: 8px;
  --radius-lg: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}

/* ── Topbar ───────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 0 1rem;
  height: 52px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px; height: 36px;
  background: none; border: none;
  cursor: pointer; padding: 8px 6px;
  border-radius: var(--radius);
  flex-shrink: 0;
  transition: background .15s;
}
.topbar-hamburger:hover { background: var(--bg3); }
.topbar-hamburger span {
  display: block;
  width: 100%; height: 2px;
  background: var(--text2);
  border-radius: 2px;
}
.nav-logo {
  font-family: 'M PLUS Rounded 1c', 'Noto Sans JP', sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: .05em;
  flex: 1;
}
.nav-user { font-size: .8rem; color: var(--text3); white-space: nowrap; }

/* ── Sidebar ──────────────────────────────────────────────────────── */
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.55);
}
.sidebar-backdrop.show { display: block; }

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 260px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  z-index: 210;
  transform: translateX(-100%);
  transition: transform .25s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  pointer-events: none;
}
.sidebar.open { transform: translateX(0); pointer-events: auto; }

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem .75rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-logo {
  font-family: 'M PLUS Rounded 1c', 'Noto Sans JP', sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--accent);
  letter-spacing: .05em;
  text-decoration: none;
}
.sidebar-close {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: none; border: none;
  color: var(--text3); cursor: pointer;
  border-radius: var(--radius);
  transition: background .15s, color .15s;
}
.sidebar-close:hover { background: var(--bg3); color: var(--text); }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: .5rem 0;
  flex: 1;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .75rem 1.25rem;
  color: var(--text2);
  text-decoration: none;
  font-size: .95rem;
  transition: background .12s, color .12s;
}
.sidebar-link:hover { background: var(--bg3); color: var(--text); }
.sidebar-link.active { color: var(--accent); background: var(--accent2); }
.sidebar-link svg { flex-shrink: 0; }
.sidebar-link--logout { width: 100%; background: none; border: none; cursor: pointer; color: var(--text3); }
.sidebar-link--logout:hover { background: var(--bg3); color: #d94040; }

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: .4rem .75rem;
}

/* ── Main ─────────────────────────────────────────────────────────── */
.main {
  max-width: 860px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

/* ── Page header ─────────────────────────────────────────────────── */
.page-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .85rem;
  margin-bottom: 1.5rem;
}
.page-header--stacked {
  flex-direction: column;
  align-items: flex-start;
}
.record-header-actions {
  display: flex;
  gap: .5rem;
  margin-top: .5rem;
}
.page-title {
  position: relative;
  display: inline-block;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}
.page-title::after {
  content: '';
  position: absolute;
  left: -8px;
  bottom: 0;
  width: calc(100% + 16px);
  height: 3px;
  background: repeating-linear-gradient(-45deg, #6ad1c8, #6ad1c8 2px, #fff 2px, #fff 4px);
}
.page-desc { font-size: .85rem; color: var(--text3); margin-top: -.75rem; margin-bottom: 1.25rem; }

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1.1rem;
  border-radius: var(--radius);
  border: none;
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: opacity .15s, transform .1s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .35; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--bg); color: var(--text); border: 2px solid var(--accent); }
.btn-primary:hover { background: var(--accent2); }
.btn-ghost { background: var(--bg); color: var(--accent); border: 1px solid var(--accent); }
.btn-ghost:hover { background: var(--accent2); }
.btn-link { background: none; border: none; padding: 0; color: var(--accent); font-size: inherit; cursor: pointer; text-decoration: underline; }
.btn-lg { padding: .7rem 1.5rem; font-size: 1rem; }

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--radius);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  transition: background .15s;
}
.btn-icon svg { width: 15px; height: 15px; }
.btn-icon:hover { background: var(--bg3); }
.btn-icon--danger { color: var(--danger); }
.btn-icon--danger:hover { background: rgba(248,113,113,.1); }

/* ── Dashboard summary ──────────────────────────────────────────── */
.dashboard-attendance-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 1rem;
  margin: -.35rem 0 1.25rem;
  background: rgba(245,158,11,.1);
  border: 1px solid rgba(245,158,11,.35);
  border-radius: var(--radius);
}
.dashboard-attendance-notice__main {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: 0;
}
.dashboard-attendance-notice__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  background: rgba(245,158,11,.16);
  color: #b45309;
  font-weight: 700;
  line-height: 1;
}
.dashboard-attendance-notice__text {
  color: var(--text);
  font-size: .9rem;
  font-weight: 700;
}
.dashboard-attendance-notice__sub {
  color: var(--text2);
  font-size: .78rem;
  line-height: 1.5;
}
.dashboard-attendance-notice__action {
  flex-shrink: 0;
  border-color: rgba(245,158,11,.55);
  color: #9a5b08;
}
.dashboard-attendance-notice__action:hover {
  background: rgba(245,158,11,.14);
}

.dashboard-summary {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--accent);
}
.dashboard-sales-row {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(220px, 1.05fr);
  gap: 1.25rem;
  align-items: end;
}
.dashboard-sales-main,
.dashboard-budget { min-width: 0; }
.dashboard-sales-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .15rem;
}
.dashboard-sales-label {
  font-size: .85rem;
  color: var(--text3);
  min-width: 0;
}
.dashboard-sales-value {
  font-family: sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.15;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}
.dashboard-sales-value .dashboard-sales-number {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  margin-left: 0;
}
.dashboard-sales-value .dashboard-sales-unit {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text2);
  margin-left: .15rem;
}
.dashboard-budget-head,
.dashboard-budget-foot {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  font-size: .78rem;
  color: var(--text3);
  min-width: 0;
}
.dashboard-budget-head strong {
  color: var(--text);
  font-size: .9rem;
  white-space: nowrap;
}
.dashboard-budget-bar {
  height: 10px;
  margin: .45rem 0 .4rem;
  background: var(--bg3);
  border-radius: 999px;
  overflow: hidden;
}
.dashboard-budget-fill {
  min-width: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transform-origin: left center;
  will-change: transform;
}
.dashboard-budget-fill--up { background: #16a34a; }
.dashboard-budget-fill--down { background: #dc2626; }
.dashboard-diff { white-space: nowrap; }
.dashboard-diff--up { color: #16a34a; }
.dashboard-diff--down { color: #dc2626; }
.dashboard-diff--zero { color: var(--text3); }
.dashboard-budget-percent {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
.budget-change {
  display: inline-flex;
  align-items: center;
  gap: .1rem;
  font-size: .7rem;
  font-weight: 600;
}
.budget-change svg { flex-shrink: 0; }
.budget-change--up { color: #16a34a; }
.budget-change--down { color: #dc2626; }
.dashboard-meta-row {
  display: flex;
  gap: 1.25rem;
  margin-top: .85rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.dashboard-meta-item {
  display: flex;
  align-items: baseline;
  gap: .35rem;
  color: var(--text3);
  font-size: .78rem;
  white-space: nowrap;
}
.dashboard-meta-item strong {
  color: var(--text);
  font-size: .95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.dashboard-meta-item small {
  color: var(--text2);
  font-size: .75rem;
  font-weight: 400;
  margin-left: .08rem;
}
.dashboard-initiatives {
  margin: -.35rem 0 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.dashboard-initiatives-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .65rem;
}
.dashboard-initiatives-head h2 {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text2);
}
.dashboard-initiative-list {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.dashboard-initiative-row {
  display: grid;
  grid-template-columns: minmax(7rem, .9fr) minmax(0, 1fr) auto;
  gap: .75rem;
  align-items: center;
}
.dashboard-initiative-name {
  min-width: 0;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dashboard-initiative-meter {
  min-width: 0;
  height: 8px;
  background: var(--bg3);
  border-radius: 999px;
  overflow: hidden;
}
.dashboard-initiative-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transform-origin: left center;
  will-change: transform;
}
.dashboard-initiative-fill--high { background: #16a34a; }
.dashboard-initiative-fill--mid { background: #e08a00; }
.dashboard-initiative-fill--low { background: #dc2626; }
.dashboard-initiative-fill--none { width: 0; }
.dashboard-gauge-ready { transform: scaleX(0); }
.dashboard-gauge-stretch {
  animation: dashboardGaugeStretch .8s cubic-bezier(.16, 1, .3, 1) var(--gauge-delay, 0ms) both;
}
@keyframes dashboardGaugeStretch {
  0% { transform: scaleX(0); }
  100% { transform: scaleX(1); }
}
@media (prefers-reduced-motion: reduce) {
  .dashboard-gauge-ready,
  .dashboard-gauge-stretch {
    animation: none;
    transform: none;
  }
}
.dashboard-initiative-rate {
  min-width: 4.25rem;
  text-align: right;
  font-size: .78rem;
  color: var(--text3);
  white-space: nowrap;
}
.dashboard-initiative-rate strong {
  color: var(--text);
  font-size: .92rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.dashboard-initiative-rate small {
  display: block;
  color: var(--text3);
  font-size: .68rem;
  line-height: 1.1;
}

/* ── Memo card ────────────────────────────────────────────────────── */
.memo-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.memo-label { font-size: .75rem; color: var(--text3); margin-bottom: .25rem; }
.memo-body { color: var(--text2); white-space: pre-wrap; }

/* ── Section ─────────────────────────────────────────────────────── */
.section { margin-bottom: 2rem; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.section-title { font-family: 'Space Grotesk', sans-serif; font-size: 1rem; font-weight: 600; }
.link-more { font-size: .8rem; color: var(--accent); text-decoration: none; }
.link-more:hover { text-decoration: underline; }

/* ── Record list ─────────────────────────────────────────────────── */
.record-list { display: flex; flex-direction: column; gap: .5rem; }
.record-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .75rem 1rem;
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: transform .15s;
}
.record-row:hover { transform: translateY(-1px); }
.record-row:hover { border-color: var(--accent); }
.record-row--today { border-color: var(--accent); background: var(--accent2); }
.record-date { font-family: 'Space Grotesk', sans-serif; font-size: .875rem; color: var(--text2); min-width: 6rem; }
.record-date--sat { color: #5b9bd5; }
.record-date--sun { color: #e07070; }
.record-sales { font-family: 'Space Grotesk', sans-serif; font-weight: 600; color: var(--accent); flex: 1; }
.record-pax { font-size: .8rem; color: var(--text3); }

/* ── Chart ───────────────────────────────────────────────────────── */
.chart-wrap {
  position: relative;
  height: 260px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
}
.chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}
.chart-section { margin-bottom: 1.5rem; }
.chart-title { font-size: .9rem; font-weight: 600; color: var(--text2); margin-bottom: .5rem; }

/* ── Forms ───────────────────────────────────────────────────────── */
.form-section { margin-bottom: 1.5rem; }
.form-section-title { display: flex; align-items: center; justify-content: space-between; font-size: .9rem; font-weight: 600; color: var(--text2); margin-bottom: .75rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .75rem; margin-bottom: .75rem; }
.form-grid-2col { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.form-grid--2 { grid-template-columns: repeat(2, 1fr); }
.form-grid--3 { grid-template-columns: repeat(3, 1fr); }
.form-field { display: flex; flex-direction: column; gap: .35rem; }
.form-label { font-size: .8rem; color: var(--text2); font-weight: 500; }
.required { color: var(--danger); }
.form-input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: .6rem .85rem;
  font-size: .95rem;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
  -webkit-appearance: none;
}
.form-input:focus { border-color: var(--accent); }
.form-input--large { font-family: 'Space Grotesk', sans-serif; font-size: 1.25rem; padding: .75rem 1rem; }
.form-textarea {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: .6rem .85rem;
  font-size: .9rem;
  font-family: inherit;
  resize: vertical;
  outline: none;
  transition: border-color .15s;
}
.form-textarea:focus { border-color: var(--accent); }
.form-textarea--tall { min-height: 200px; }
.form-check { margin: .75rem 0; }
.form-check label { display: flex; align-items: center; gap: .5rem; font-size: .875rem; color: var(--text2); cursor: pointer; }
.form-check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: border-color .15s, background .15s;
}
.form-check input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.form-check input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.form-actions { display: flex; align-items: center; gap: .75rem; margin-top: 1rem; flex-wrap: wrap; }
.record-form { max-width: 640px; }
.record-basic-grid { display: flex; flex-direction: column; gap: .75rem; }

/* ── Item grid (record input) ──────────────────────────────────────── */
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; margin-bottom: .5rem; }
.item-field { display: flex; flex-direction: column; gap: .25rem; }
.item-label { font-size: .8rem; color: var(--text2); }

/* ── Date nav ────────────────────────────────────────────────────── */
.date-nav { display: flex; align-items: center; gap: .5rem; }
.date-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--radius);
  color: var(--accent);
  text-decoration: none;
  background: var(--bg);
  border: 1px solid var(--accent);
  transition: background .15s;
}
.date-nav-btn svg { width: 18px; height: 18px; }
.date-nav-btn:hover { background: var(--accent2); }
.date-nav-btn--disabled { opacity: .3; pointer-events: none; }
.date-nav-center { text-align: center; flex: 1; line-height: 1.2; }
.date-nav-center .page-title { font-size: 1.3rem; margin: 0; }
.date-nav-weekday { font-size: .85rem; color: var(--text); }
.date-nav-date { display: block; font-size: 1.3rem; font-weight: 700; color: var(--text); }
.badge-today { font-size: .7rem; font-weight: 600; background: var(--bg); color: var(--text); padding: .1rem .4rem; border-radius: 4px; vertical-align: middle; border: 1px solid var(--accent); }

/* ── Calendar ────────────────────────────────────────────────────── */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-head { padding: .35rem; text-align: center; font-size: .75rem; color: var(--text3); font-weight: 600; }
.cal-cell {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .5rem;
  min-height: 56px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: .15rem;
  transition: border-color .15s, background .15s;
}
.cal-cell:hover { background: var(--accent2); }
.cal-cell--empty { background: transparent; border-color: transparent; }
.cal-cell--recorded { border-color: var(--accent); background: var(--bg); }
.cal-cell--today { border-color: var(--accent); border-width: 2px; }
.cal-day { font-family: 'Space Grotesk', sans-serif; font-size: .875rem; font-weight: 600; }
.cal-sales { font-size: .75rem; color: #16a34a; font-family: 'Space Grotesk', sans-serif; font-weight: 600; }

/* ── Panel ───────────────────────────────────────────────────────── */
.panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.panel--info { border-color: rgba(251,146,60,.3); background: rgba(251,146,60,.05); }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.panel-header-text { display: flex; flex-direction: column; gap: .15rem; flex: 1; min-width: 0; }
.panel-header > .btn { flex-shrink: 0; }
.panel-title { font-size: .875rem; font-weight: 600; color: var(--text2); }

/* ── Variable chips ────────────────────────────────────────────────── */
.chip-bar { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: .5rem; }
.chip { padding: .18rem .55rem; border-radius: 999px; border: 1px solid var(--border); background: var(--bg3); color: var(--text2); font-size: .72rem; cursor: pointer; transition: background .15s, border-color .15s, color .15s; font-family: inherit; white-space: nowrap; line-height: 1.6; }
.chip:hover { background: var(--accent2); border-color: var(--accent); color: var(--accent); }
.chip--item { border-color: rgba(52,211,153,.25); color: rgba(52,211,153,.85); background: rgba(52,211,153,.06); }
.chip--item:hover { background: rgba(52,211,153,.15); border-color: var(--success); color: var(--success); }
/* ── Item picker bottom sheet ──────────────────────────────────── */
.itp-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 390; cursor: pointer; }
.itp-backdrop.show { display: block; }
.itp-panel { position: fixed; bottom: 0; left: 0; right: 0; background: var(--bg); border-top: 1px solid var(--border); border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding: 1.25rem 1.25rem 2rem; z-index: 400; transform: translateY(100%); transition: transform .25s cubic-bezier(.32,0,.67,0); max-height: 65vh; overflow-y: auto; }
.itp-panel.show { transform: translateY(0); transition: transform .25s cubic-bezier(.33,1,.68,1); }
.itp-hd { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.itp-title { font-weight: 600; font-size: .95rem; flex: 1; }
.itp-grid { display: flex; flex-wrap: wrap; gap: .5rem; }
.itp-item-btn { padding: .45rem .9rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg3); color: var(--text); font-size: .875rem; font-family: inherit; cursor: pointer; transition: background .15s, border-color .15s; }
.itp-item-btn:hover, .itp-item-btn:active { background: var(--accent2); border-color: var(--accent); color: var(--accent); }
.itp-type-row { display: flex; gap: .75rem; }
.itp-type-btn { flex: 1; padding: .75rem; border-radius: var(--radius); border: 1px solid rgba(52,211,153,.3); background: rgba(52,211,153,.06); color: var(--success); font-size: .9rem; font-weight: 600; font-family: inherit; cursor: pointer; transition: background .15s; }
.itp-type-btn:hover, .itp-type-btn:active { background: rgba(52,211,153,.18); }

/* ── Weekday grid ───────────────────────────────────────────────── */
.weekday-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: .5rem; margin-bottom: .75rem; }
.weekday-grid--wide { margin-bottom: 0; }
.weekday-cell { display: flex; flex-direction: column; gap: .25rem; }
.weekday-label { font-size: .72rem; color: var(--text2); text-align: center; font-weight: 600; }
.weekday-cell .form-input { text-align: center; padding: .35rem .25rem; font-size: .85rem; }

/* ── Item table ─────────────────────────────────────────────────── */
.item-table-wrap { width: 100%; overflow: hidden; }
.item-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.item-table th { font-size: .8rem; color: var(--text3); text-align: left; padding: .5rem; border-bottom: 1px solid var(--border); }
.item-table th:last-child { width: 8rem; text-align: right; }
.item-table td { padding: .5rem; border-bottom: 1px solid var(--bg3); font-size: .9rem; }
.item-table td:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-table td:last-child { width: 8rem; text-align: right; padding-left: .35rem; padding-right: 0; }
.item-table tr:last-child td { border-bottom: none; }
.item-name { font-weight: 500; }
.item-actions { display: inline-flex; justify-content: flex-end; gap: .25rem; align-items: center; max-width: 100%; }
.item-actions form { display: flex; flex: 0 0 auto; }
.item-actions .btn-icon { flex: 0 0 32px; }
.item-actions .item-target-btn {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 .65rem;
  background: var(--bg);
  border: 1px solid var(--accent);
  color: var(--accent);
}
.item-actions .item-target-btn:hover { background: var(--accent2); }
.row--inactive td { opacity: .5; }
.item-table .edit-row > td {
  background: var(--bg);
  padding: 1rem .5rem;
  text-align: left;
  width: auto;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}
.inline-form { display: flex; flex-direction: column; gap: .5rem; }

/* ── Template card ───────────────────────────────────────────────── */
.tmpl-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; margin-bottom: 1rem; }
.tmpl-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.tmpl-name { font-weight: 600; font-size: .95rem; display: flex; align-items: center; gap: .5rem; }
.tmpl-actions { display: flex; gap: .35rem; }
.tmpl-preview { font-size: .8rem; color: var(--text2); background: var(--bg3); border-radius: var(--radius); padding: .75rem 1rem; white-space: pre-wrap; border: 1px solid var(--border); }
.edit-panel { margin-top: 1rem; }
.tmpl-select-bar { display: flex; gap: .35rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.tmpl-tab { padding: .4rem .9rem; border-radius: var(--radius); border: 1px solid var(--border); font-size: .875rem; color: var(--text2); text-decoration: none; transition: background .15s; }
.tmpl-tab:hover { background: var(--bg3); }
.tmpl-tab.active { background: var(--accent2); border-color: var(--accent); color: var(--accent); }

/* ── Report ──────────────────────────────────────────────────────── */
.report-wrap { display: flex; flex-direction: column; gap: 1rem; }
.report-body { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; white-space: pre-wrap; font-family: 'Noto Sans JP', sans-serif; font-size: .9rem; line-height: 1.8; color: var(--text); }
.copy-msg { font-size: .8rem; color: var(--success); }

/* ── Analytics tabs ─────────────────────────────────────────────── */
.tab-bar { display: flex; gap: .35rem; margin-bottom: 1.25rem; }
.tab { padding: .4rem .9rem; border-radius: var(--radius); border: 1px solid var(--accent); background: var(--bg); font-size: .875rem; color: var(--accent); cursor: pointer; transition: background .15s; font-family: inherit; }
.tab:hover { background: var(--accent2); }
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Badge ───────────────────────────────────────────────────────── */
.badge { font-size: .7rem; padding: .15rem .4rem; border-radius: 4px; font-weight: 600; white-space: nowrap; }
.badge--active { background: rgba(52,211,153,.15); color: var(--success); }
.badge--inactive { background: var(--bg3); color: var(--text3); }
.badge--default { background: var(--bg); color: var(--accent); border: 1px solid var(--accent); }

/* ── Alerts ──────────────────────────────────────────────────────── */
.alert { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: .875rem; }
.alert--warn { background: rgba(251,191,36,.1); border: 1px solid rgba(251,191,36,.3); color: var(--warn); }

/* ── Misc ────────────────────────────────────────────────────────── */
.empty-msg { color: var(--text3); font-size: .9rem; padding: 2rem 0; text-align: center; }
.help-text { font-size: .8rem; color: var(--text3); margin-top: .75rem; }
.export-form { max-width: 420px; }
.hidden { display: none !important; }

/* ── Data Table ─────────────────────────────────────────────────── */
.data-table { border-top: 1px solid var(--border); }
.data-table-head {
  display: grid;
  grid-template-columns: 1fr auto auto auto auto;
  gap: .5rem;
  padding: .5rem 1rem;
  font-size: .75rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.data-table-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto auto;
  gap: .5rem;
  align-items: center;
  padding: .75rem 1rem;
  border-top: 1px solid var(--border);
  font-size: .9rem;
}
.data-cell--name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.data-cell--sub { color: var(--text2); }
.data-cell--actions { display: flex; gap: .25rem; }

/* 従業員テーブルは4カラム */
.data-table--employees .data-table-head,
.data-table--employees .data-table-row {
  grid-template-columns: 1fr auto auto auto;
}

/* ── btn-sm ──────────────────────────────────────────────────────── */
.btn-sm {
  padding: .2rem .55rem;
  font-size: .75rem;
  border-radius: 5px;
  height: auto;
  min-height: unset;
}
.btn-danger-ghost {
  background: none;
  border: 1px solid transparent;
  color: var(--danger);
}
.btn-danger-ghost:hover { background: rgba(248,113,113,.1); border-color: var(--danger); }

/* ── Badge extras ────────────────────────────────────────────────── */
.badge--staff { background: rgba(59,130,246,0.15); color: #60a5fa; }
.badge--part  { background: rgba(52,211,153,0.13); color: #34d399; }

/* ── Panel sub-title ─────────────────────────────────────────────── */
.panel-sub { font-size: .8rem; color: var(--text3); margin-top: .15rem; }

/* ── Modal ───────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,.6);
  align-items: center; justify-content: center;
  padding: 1rem;
  cursor: pointer;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 420px;
  max-height: 90vh; overflow-y: auto;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 1rem; font-weight: 600; }
.modal-close {
  background: none; border: none; color: var(--text3);
  cursor: pointer; padding: .25rem; display: flex;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: .5rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
}

/* ── Radio group ─────────────────────────────────────────────────── */
.radio-group { display: flex; gap: 1.5rem; padding-top: .25rem; }
.radio-label { display: flex; align-items: center; gap: .4rem; cursor: pointer; font-size: .9rem; }

/* ── Toggle ──────────────────────────────────────────────────────── */
.toggle-label { display: flex; align-items: center; gap: .75rem; cursor: pointer; font-size: .9rem; }
.toggle-input { display: none; }
.toggle-track {
  width: 40px; height: 22px; border-radius: 11px;
  background: var(--bg3); border: 1px solid var(--border);
  position: relative; transition: background .2s;
  flex-shrink: 0;
}
.toggle-track::after {
  content: ''; position: absolute;
  left: 3px; top: 3px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--text3); transition: transform .2s, background .2s;
}
.toggle-input:checked + .toggle-track { background: var(--bg); border-color: var(--accent); }
.toggle-input:checked + .toggle-track::after { transform: translateX(18px); background: var(--accent); }

/* ── Required mark ───────────────────────────────────────────────── */
.required { color: var(--danger); font-size: .8rem; }

/* ── Attendance ──────────────────────────────────────────────────── */
.attendance-list { display: flex; flex-direction: column; }
.attendance-item {
  display: flex; align-items: center; gap: 1rem;
  padding: .9rem 1rem;
  border-top: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s;
  user-select: none;
}
.attendance-item:hover { background: var(--bg3); }
.attendance-item--checked { background: var(--accent2); }
.attendance-item--checked:hover { background: var(--accent2); }
.attendance-checkbox { display: none; }
.attendance-name { flex: 1; font-weight: 500; font-size: .95rem; }
.attendance-type { font-size: .8rem; color: var(--text3); }
.attendance-check-icon {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: transparent; transition: all .15s;
  flex-shrink: 0;
}
.attendance-item--checked .attendance-check-icon {
  background: var(--bg); border-color: var(--accent); color: var(--accent);
}

/* ── item-unit ───────────────────────────────────────────────────── */
.item-unit { font-size: .75rem; color: var(--text3); margin-left: .25rem; }

/* ── form-grid--2 ────────────────────────────────────────────────── */
.form-grid--2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ── link ────────────────────────────────────────────────────────── */
.link { color: var(--accent); text-decoration: none; }
.link:hover { text-decoration: underline; }

/* ── Tablet ──────────────────────────────────────────────────────── */
@media (min-width: 760px) {
  .main {
    max-width: 1040px;
    padding: 2rem 2rem 4rem;
  }
  .record-page-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }
  .record-page-header .date-nav {
    width: min(100%, 360px);
  }
  .record-form--responsive {
    max-width: none;
    display: grid;
    grid-template-columns: minmax(280px, .95fr) minmax(320px, 1.05fr);
    gap: 1.25rem;
    align-items: start;
  }
  .record-form--single {
    grid-template-columns: minmax(0, 640px);
  }
  .record-basic-section,
  .record-items-section {
    margin-bottom: 0;
  }
  .record-basic-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .record-field--wide {
    grid-column: 1 / -1;
  }
  .record-items-section .item-grid {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    max-height: calc(100dvh - 260px);
    overflow-y: auto;
    padding-right: .25rem;
    -webkit-overflow-scrolling: touch;
  }
  .record-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    margin-top: .25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
  }
  .chart-wrap {
    height: 300px;
  }
}

/* ── Mobile ──────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .dashboard-attendance-notice {
    align-items: stretch;
    flex-direction: column;
    gap: .75rem;
    margin-top: -.25rem;
  }
  .dashboard-attendance-notice__action {
    justify-content: center;
    width: 100%;
  }
  .dashboard-summary { padding-bottom: .85rem; }
  .dashboard-sales-row {
    grid-template-columns: minmax(0, 1fr);
    gap: .8rem;
  }
  .dashboard-sales-value { font-size: 1.65rem; }
  .dashboard-sales-value .dashboard-sales-unit { font-size: .85rem; }
  .dashboard-meta-row {
    justify-content: flex-start;
    gap: .8rem 1rem;
  }
  .dashboard-initiatives { margin-top: -.2rem; }
  .dashboard-initiative-row {
    grid-template-columns: minmax(0, .95fr) minmax(4rem, 1fr) auto;
    gap: .55rem;
  }
  .dashboard-initiative-name { font-size: .8rem; }
  .dashboard-initiative-rate { min-width: 3.6rem; }
  .chart-wrap {
    height: 220px;
    padding: .75rem;
  }
  .form-grid--3 { grid-template-columns: 1fr 1fr; }
  .item-table th,
  .item-table td {
    padding: .55rem 0;
  }
  .item-table th:last-child,
  .item-table td:last-child {
    width: 7.75rem;
  }
  .item-table td:last-child {
    padding-left: .35rem;
  }
  .item-actions {
    gap: .25rem;
  }
  .item-table .edit-row > td {
    padding: 1rem 0;
    text-align: left;
    width: auto;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
  .edit-row .form-grid--3 {
    grid-template-columns: 1fr;
  }
  .cal-cell { min-height: 48px; padding: .35rem; }
  .cal-sales { font-size: .65rem; }
  .nav-user { display: none; }
}

/* ── Feedback Section ─────────────────────────────────────────────────────── */
.feedback-section {
  margin-top: 3rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
}
.feedback-toggle {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: none;
  border: none;
  color: var(--text2);
  font-size: .875rem;
  cursor: pointer;
  padding: .5rem 0;
}
.feedback-toggle:hover { color: var(--accent); }
.feedback-form {
  display: none;
  margin-top: .75rem;
}
.feedback-section.open .feedback-form { display: block; }
.feedback-section.open .feedback-toggle { display: none; }
.feedback-textarea {
  width: 100%;
  padding: .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .875rem;
  resize: vertical;
  min-height: 80px;
}
.feedback-textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.feedback-actions {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  margin-top: .5rem;
}
.feedback-thanks {
  display: none;
  color: var(--success);
  font-size: .875rem;
  padding: .5rem 0;
}

/* ── きのぴローディング ── */
#live-spinner {
  position: fixed;
  inset: 0;
  z-index: 99999;
  pointer-events: none;
  display: none;
  align-items: center;
  justify-content: center;
}
#live-spinner.show { display: flex; }

.kinopi-loader {
  display: grid;
  place-items: center;
  position: relative;
  width: 128px;
  height: 128px;
  padding: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, .7);
  border: 0;
  border-radius: var(--radius);
  box-shadow: 0 10px 24px rgba(33, 37, 41, .10);
}

.kinopi-loader::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 4;
  border: 1px solid #cfd4da;
  border-radius: inherit;
  pointer-events: none;
}

.kinopi-stage {
  position: relative;
  z-index: 1;
  width: 5rem;
  height: 4.6rem;
  font-size: 2rem;
  line-height: 1;
  color: var(--accent);
}

.kinopi-word {
  display: flex;
  position: absolute;
  left: 50%;
  top: 50%;
  align-items: flex-end;
  justify-content: center;
  gap: .12em;
  font-family: 'M PLUS Rounded 1c', 'Noto Sans JP', sans-serif;
  font-weight: 800;
  letter-spacing: 0;
  transform: translate(-50%, -50%);
  z-index: 3;
}

.kinopi-letter {
  display: inline-block;
  transform-origin: center bottom;
  will-change: transform;
}

.kinopi-loader.animate .kinopi-letter--ki,
.kinopi-loader.animate .kinopi-word > span:nth-child(1) { animation: kinopiLetterHit 1.42s ease-out infinite; animation-delay: -.06s; }
.kinopi-loader.animate .kinopi-letter--no,
.kinopi-loader.animate .kinopi-word > span:nth-child(2) { animation: kinopiLetterHit 1.42s ease-out infinite; animation-delay: .18s; }
.kinopi-loader.animate .kinopi-letter--pi,
.kinopi-loader.animate .kinopi-word > span:nth-child(3) { animation: kinopiLetterHitPi 1.42s ease-out infinite; animation-delay: .38s; }

.kinopi-ball-track {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 0;
  height: 0;
  transform: translate3d(-2.35em, 0, 0);
  will-change: transform;
}

.kinopi-ball {
  position: absolute;
  left: -.18em;
  top: -.18em;
  width: .36em;
  height: .36em;
  background: #14b8a6;
  border-radius: 50%;
  box-shadow: inset -2px -3px 0 rgba(0, 0, 0, .09), 0 .12em .18em rgba(13, 148, 136, .22);
  transform: translate3d(0, -2.45em, 0);
  will-change: transform;
}

.kinopi-loader.animate .kinopi-ball-track {
  animation: kinopiBallTravel 1.42s linear infinite;
  animation-delay: -.32s;
}

.kinopi-loader.animate .kinopi-ball {
  animation: kinopiBallFall 1.42s linear infinite;
  animation-delay: -.32s;
}

@keyframes kinopiLetterHit {
  0%, 6%, 38%, 100% { transform: translateY(0) scale(1); }
  10% { transform: translateY(.34em) scale(1.12, .74); }
  18% { transform: translateY(.2em) scale(1.05, .86); }
  27% { transform: translateY(-.06em) scale(.98, 1.04); }
  34% { transform: translateY(.02em) scale(1.01, .99); }
}

@keyframes kinopiLetterHitPi {
  0%, 6%, 42%, 100% { transform: translateY(0) scale(1); }
  10% { transform: translateY(.48em) scale(1.16, .68); }
  18% { transform: translateY(.3em) scale(1.08, .8); }
  29% { transform: translateY(-.08em) scale(.98, 1.05); }
  37% { transform: translateY(.03em) scale(1.02, .98); }
}

@keyframes kinopiBallTravel {
  0% { transform: translate3d(-2.62em, 0, 0); }
  100% { transform: translate3d(3.73em, 0, 0); }
}

@keyframes kinopiBallFall {
  0% {
    transform: translate3d(0, -2.45em, 0) scale(1);
    animation-timing-function: cubic-bezier(.55, 0, 1, .42);
  }
  24% {
    transform: translate3d(0, -.58em, 0) scale(1.15, .78);
    animation-timing-function: cubic-bezier(.07, .78, .2, 1);
  }
  33% {
    transform: translate3d(0, -1.82em, 0) scale(.97, 1.06);
    animation-timing-function: cubic-bezier(.55, 0, 1, .42);
  }
  41% {
    transform: translate3d(0, -.58em, 0) scale(1.15, .78);
    animation-timing-function: cubic-bezier(.07, .78, .2, 1);
  }
  50% {
    transform: translate3d(0, -1.62em, 0) scale(.98, 1.05);
    animation-timing-function: cubic-bezier(.55, 0, 1, .42);
  }
  58% {
    transform: translate3d(0, -.58em, 0) scale(1.15, .78);
    animation-timing-function: cubic-bezier(.08, .7, .24, 1);
  }
  72% {
    transform: translate3d(0, -1.86em, 0) scale(1);
    animation-timing-function: cubic-bezier(.55, 0, 1, .42);
  }
  100% {
    transform: translate3d(0, -2.45em, 0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .kinopi-loader.animate .kinopi-ball-track,
  .kinopi-loader.animate .kinopi-ball,
  .kinopi-loader.animate .kinopi-letter {
    animation: none;
  }
}

/* ── ボタン処理中状態 ── */
.btn.is-loading {
  pointer-events: none;
  opacity: 0.6;
}

  background: var(--bg3);
}

/* ── 通知プロンプトモーダル ── */
.push-modal-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}
.push-modal {
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 360px;
  width: 100%;
  text-align: center;
  animation: pushModalIn .25s ease-out;
}
@keyframes pushModalIn {
  from { opacity: 0; transform: scale(.95); }
  to { opacity: 1; transform: scale(1); }
}
.push-modal-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: var(--accent2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.push-modal-icon svg {
  width: 32px;
  height: 32px;
  color: var(--accent);
}
.push-modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 .75rem;
}
.push-modal-desc {
  font-size: .9rem;
  color: var(--text2);
  line-height: 1.5;
  margin: 0 0 1.5rem;
}
.push-modal-actions {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.push-modal-btn {
  width: 100%;
  padding: .875rem 1rem;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.push-modal-btn--enable {
  background: var(--accent);
  color: #fff;
}
.push-modal-btn--enable:hover {
  background: var(--accent-hover);
}
.push-modal-btn--later {
  background: transparent;
  color: var(--text2);
}
.push-modal-btn--later:hover {
  background: var(--bg);
}

/* Error Pages */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1rem;
  min-height: 60vh;
}
.error-icon {
  width: 80px;
  height: 80px;
  background: var(--bg2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: var(--text2);
}
.error-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 .75rem;
}
.error-desc {
  font-size: 1rem;
  color: var(--text2);
  margin: 0 0 1.5rem;
  max-width: 320px;
  line-height: 1.6;
}
.error-icon--danger {
  background: #fee2e2;
  color: #dc2626;
}
.error-actions {
  display: flex;
  gap: .75rem;
}

