/* ============================================================
   inohome — Design System v2 (Minimal & Stylish)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Noto+Sans+JP:wght@300;400;500;700&display=swap');

/* ── Variables ──────────────────────────────────────────── */
:root {
  --sidebar-width: 220px;
  --bottom-bar-height: 60px;

  /* Colors */
  --bg: #F7F8FA;
  --surface: #FFFFFF;
  --border: #EAECF0;
  --border-strong: #D0D5DD;
  --text: #101828;
  --text-sub: #667085;
  --text-muted: #98A2B3;

  /* Accent */
  --blue: #2563EB;
  --blue-soft: #EFF6FF;
  --orange: #F97316;
  --orange-soft: #FFF7ED;

  /* Calendar */
  --cal-sat: #2563EB;
  --cal-sun: #DC2626;
  --cal-holiday: #DC2626;
  --cal-today-bg: #EFF6FF;
  --cal-today-border: #2563EB;

  /* User */
  --koki: #2563EB;
  --koki-soft: #DBEAFE;
  --satomi: #F97316;
  --satomi-soft: #FFEDD5;

  /* Radius / Shadow */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --shadow: 0 1px 4px rgba(16, 24, 40, 0.06), 0 2px 8px rgba(16, 24, 40, 0.04);
}

/* ── Reset ──────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', 'Noto Sans JP', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  display: flex;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
}

input,
select,
textarea {
  font-family: inherit;
  font-size: 14px;
}

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  padding: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px 20px;
  border-bottom: 1px solid var(--border);
}

.logo-mark {
  width: 28px;
  height: 28px;
  background: var(--text);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-mark svg {
  width: 16px;
  height: 16px;
  fill: white;
}

.logo-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  color: var(--text-sub);
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.12s, color 0.12s;
}

.nav-item:hover {
  background: var(--bg);
  color: var(--text);
}

.nav-item.active {
  background: var(--bg);
  color: var(--text);
  font-weight: 600;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.55;
}

.nav-item.active .nav-icon,
.nav-item:hover .nav-icon {
  opacity: 1;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.user-badges {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-sub);
}

.user-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Main Content ───────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 36px 40px;
  min-height: 100vh;
}

/* ── Page Header ────────────────────────────────────────── */
.page-header {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  border: none;
  transition: background 0.12s, box-shadow 0.12s, transform 0.08s;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--text);
  color: #fff;
}

.btn-primary:hover {
  background: #1a2533;
}

.btn-ghost {
  background: transparent;
  color: var(--text-sub);
  border: 1px solid var(--border-strong);
}

.btn-ghost:hover {
  background: var(--bg);
  color: var(--text);
}

.btn-danger {
  background: transparent;
  color: #ef4444;
  border: 1px solid #fecaca;
}

.btn-danger:hover {
  background: #fef2f2;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-icon {
  padding: 5px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  border-radius: var(--r-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s;
}

.btn-icon:hover {
  background: var(--bg);
  color: var(--text);
}

.btn-icon svg {
  width: 15px;
  height: 15px;
}

/* ── Card ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}

/* ── Form ───────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-sub);
}

.form-control {
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ── Modal ──────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.35);
  backdrop-filter: blur(3px);
  z-index: 500;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  box-shadow: 0 8px 40px rgba(16, 24, 40, 0.18);
  padding: 28px;
  width: 460px;
  max-width: calc(100vw - 32px);
  animation: modalIn 0.16s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-6px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
}

/* ── Calendar ───────────────────────────────────────────── */
.calendar-wrapper {
  padding: 24px;
}

.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.calendar-month-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  max-width: 900px;
  margin: 0 auto;
}

.cal-day-label {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 0 8px;
  letter-spacing: 0.04em;
}

.cal-day-label.sat {
  color: var(--cal-sat);
  opacity: 0.7;
}

.cal-day-label.sun {
  color: var(--cal-sun);
  opacity: 0.7;
}

.cal-cell {
  min-height: 90px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 6px;
  background: var(--surface);
  overflow: hidden;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
}

.cal-cell:not(.other-month):hover {
  background: #F0F4FF;
  border-color: #C7D7FA;
}

.cal-cell.other-month {
  background: var(--bg);
  opacity: 0.35;
  cursor: default;
}

.cal-cell.other-month:hover {
  background: var(--bg);
  border-color: var(--border);
}

.cal-cell.today {
  border-color: var(--cal-today-border);
  background: var(--cal-today-bg);
}

/* Holiday / weekend backgrounds */
.cal-cell.is-holiday:not(.other-month),
.cal-cell.is-sun:not(.other-month) {
  background: #FEF2F2;
}

.cal-cell.is-sat:not(.other-month) {
  background: #EFF6FF;
}

.cal-cell.today {
  background: var(--cal-today-bg) !important;
}

.cal-cell-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 3px;
  line-height: 1;
}

.cal-cell.today .cal-cell-num {
  color: var(--blue);
}

/* Day-of-week color tinting */
.cal-cell.is-sat .cal-cell-num {
  color: var(--cal-sat);
}

.cal-cell.is-sun .cal-cell-num {
  color: var(--cal-sun);
}

.cal-cell.is-holiday .cal-cell-num {
  color: var(--cal-holiday);
}

.cal-holiday-name {
  font-size: 9px;
  color: var(--cal-holiday);
  font-weight: 500;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ev-badge {
  display: block;
  font-size: 10px;
  font-weight: 500;
  padding: 2px 5px;
  border-radius: 3px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: opacity 0.12s;
}

.ev-badge:hover {
  opacity: 0.75;
}

.ev-badge.koki {
  background: var(--koki-soft);
  color: var(--koki);
}

.ev-badge.satomi {
  background: var(--satomi-soft);
  color: var(--satomi);
}

/* ── Kanban ─────────────────────────────────────────────── */
.kanban-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.kanban-col {
  border-radius: var(--r-lg);
  background: var(--bg);
  padding: 16px;
  min-height: 200px;
}

.kanban-col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.kanban-col-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-sub);
}

.kanban-col-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1px 8px;
}

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.s-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  animation: cardIn 0.15s ease;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.s-card.done {
  opacity: 0.55;
}

.s-card-row1 {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  justify-content: space-between;
}

.s-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.s-card.done .s-card-name {
  text-decoration: line-through;
  color: var(--text-muted);
}

.s-card-detail {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 3px;
}

.cat-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  margin-top: 6px;
  letter-spacing: 0.03em;
}

.cat-tag.Food {
  background: #FEF3C7;
  color: #B45309;
}

.cat-tag.Daily {
  background: #EDE9FE;
  color: #6D28D9;
}

.cat-tag.Other {
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.s-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

/* ── Add / Input rows ──────────────────────────────────── */
.input-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.input-row .form-control {
  flex: 1;
  min-width: 140px;
}

/* ── Section Header ─────────────────────────────────────── */
.section-hd {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* ── Add strip (above kanban) ──────────────────────────── */
.add-strip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

/* ── Template panel ─────────────────────────────────────── */
.template-panel {
  margin-top: 28px;
}

.template-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tmpl-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow);
}

.tmpl-name {
  font-size: 13px;
  font-weight: 600;
}

.tmpl-detail {
  font-size: 12px;
  color: var(--text-sub);
  margin-left: 4px;
}

.tmpl-cat {
  margin-left: auto;
}

/* ── Toast ──────────────────────────────────────────────── */
.toast-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
}

.toast {
  background: var(--text);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(16, 24, 40, 0.2);
  animation: toastIn 0.18s ease;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(12px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* ── Radio custom ───────────────────────────────────────── */
.radio-group {
  display: flex;
  gap: 10px;
}

.radio-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid var(--border-strong);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-sub);
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}

.radio-pill input {
  display: none;
}

.radio-pill.selected-koki {
  border-color: var(--koki);
  background: var(--koki-soft);
  color: var(--koki);
}

.radio-pill.selected-satomi {
  border-color: var(--satomi);
  background: var(--satomi-soft);
  color: var(--satomi);
}

/* ── Mobile Header ──────────────────────────────────────── */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  align-items: center;
  justify-content: center;
  z-index: 100;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}

/* ── Bottom Bar ─────────────────────────────────────────── */
.bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-bar-height);
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 200;
}

.bottom-bar .tabs {
  display: flex;
  height: 100%;
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.12s;
}

.tab-btn svg {
  width: 20px;
  height: 20px;
}

.tab-btn.active {
  color: var(--text);
}

/* ── Grid helpers ───────────────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .mobile-header {
    display: flex;
  }

  .bottom-bar {
    display: block;
  }

  .main-content {
    margin-left: 0;
    padding: 68px 14px calc(var(--bottom-bar-height) + 16px);
  }

  .kanban-board {
    grid-template-columns: 1fr;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .input-row {
    flex-direction: column;
  }
}