:root {
  --bg: #f7f8fb;
  --panel: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --blue: #2563eb;
  --blue-soft: #eaf1ff;
  --shadow: 0 18px 45px rgba(17, 24, 39, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Noto Sans JP", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(760px, 1fr) 300px;
}
.sidebar, .right-panel {
  background: rgba(255, 255, 255, 0.86);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.sidebar {
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-icon {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center;
  color: #fff; background: linear-gradient(135deg, #2563eb, #1d4ed8);
  font-weight: 800;
}
.brand-name { font-weight: 800; font-size: 18px; flex: 1; }
.icon-button, .round-button {
  border: 0; background: transparent; color: var(--muted);
  width: 34px; height: 34px; border-radius: 10px;
}
.icon-button:hover, .round-button:hover { background: #f1f5f9; color: var(--text); }
.nav-menu { display: grid; gap: 7px; }
.nav-item, .settings-button {
  border: 0; background: transparent; display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 12px 14px; border-radius: 12px;
  color: #334155; font-weight: 700; text-align: left;
}
.nav-item.active, .nav-item:hover { background: var(--blue-soft); color: var(--blue); }
.divider { height: 1px; background: var(--line); }
.section-heading { display:flex; align-items:center; justify-content:space-between; color: var(--muted); font-weight: 800; margin-bottom: 12px; }
.project-list { display: grid; gap: 8px; margin-bottom: 16px; }
.project-item {
  border: 0; background: transparent; padding: 9px 10px; border-radius: 10px;
  display: flex; align-items: center; gap: 10px; color: #334155; font-weight: 600;
}
.project-item:hover, .project-item.selected { background: #f1f5f9; }
.dot { width: 10px; height: 10px; border-radius: 99px; flex: 0 0 auto; }
.outline-button, .ghost-button, .primary-button, .link-button, .text-button, .select-filter {
  border-radius: 12px; border: 1px solid var(--line); background: #fff;
  padding: 10px 14px; font-weight: 800; color: #334155;
}
.outline-button { width: 100%; color: var(--blue); border-color: #bfdbfe; }
.primary-button { background: var(--blue); color: #fff; border-color: var(--blue); box-shadow: 0 10px 25px rgba(37,99,235,.22); }
.ghost-button:hover, .outline-button:hover { background: #f8fafc; }
.settings-button { margin-top: auto; color: var(--muted); }

.main { padding: 32px 32px 42px; overflow: auto; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.eyebrow { margin: 0 0 4px; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
h1 { margin: 0; font-size: 30px; letter-spacing: .04em; }
.top-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.search-box { display: flex; align-items: center; gap: 8px; background:#fff; border:1px solid var(--line); border-radius: 12px; padding: 0 12px; min-width: 250px; height: 44px; }
.search-box input { border:0; outline:0; width:100%; background: transparent; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 18px; margin-bottom: 26px; }
.stat-card { background: #fff; border:1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); display:flex; align-items:center; gap:16px; }
.stat-icon { width:52px; height:52px; border-radius:99px; display:grid; place-items:center; font-size:24px; }
.stat-card strong { display:block; font-size:34px; line-height:1; margin-top: 6px; letter-spacing: .06em; }
.stat-card span { color: var(--muted); font-size:13px; font-weight:700; }

.board { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 14px; align-items: start; }
.column { background: rgba(255,255,255,.58); border: 1px solid var(--line); border-radius: 18px; min-height: 560px; padding: 12px; }
.column-header { display:flex; justify-content:space-between; align-items:center; padding: 6px 4px 12px; font-weight: 900; }
.count-badge { background:#eef2f7; color:#64748b; padding: 3px 9px; border-radius: 99px; font-size:12px; margin-left:6px; }
.task-stack { display: grid; gap: 10px; min-height: 90px; }
.task-card { background:#fff; border:1px solid var(--line); border-radius: 14px; padding: 13px; box-shadow: 0 8px 20px rgba(15,23,42,.05); transition: transform .16s ease, box-shadow .16s ease; }
.task-card:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(15,23,42,.09); }
.task-card.dragging { opacity: .55; }
.task-top { display:flex; align-items:flex-start; gap:9px; }
.task-title { font-weight: 800; flex:1; }
.task-card.done .task-title { color:#94a3b8; text-decoration: line-through; }
.checkbox { width:16px; height:16px; accent-color: var(--blue); margin-top: 4px; }
.priority { display:inline-flex; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 900; margin: 10px 0 8px 24px; }
.priority.low { color:#15803d; background:#dcfce7; }
.priority.mid { color:#b45309; background:#fef3c7; }
.priority.high { color:#dc2626; background:#fee2e2; }
.task-meta { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-left: 24px; color:var(--muted); font-size:12px; font-weight:700; }
.tag { display:inline-flex; align-items:center; gap:6px; background:#f1f5f9; border: 1px solid #e2e8f0; border-radius:8px; padding: 3px 8px; }
.add-inline { margin-top: 12px; color:#64748b; background: transparent; border:0; padding: 10px 6px; font-weight: 800; }

.right-panel { border-left: 1px solid var(--line); border-right:0; padding: 24px 18px; overflow:auto; height:100vh; position:sticky; top:0; }
.panel-card { background:#fff; border: 1px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); margin-bottom: 18px; }
.panel-title { display:flex; align-items:center; justify-content:space-between; font-weight:900; margin-bottom: 14px; }
.timeline { display:grid; gap: 14px; }
.timeline-item { display:grid; grid-template-columns: 46px 1fr; gap:10px; font-size:13px; }
.timeline-time { color:#64748b; font-weight:800; }
.timeline-body { border-left: 2px solid #e5e7eb; padding-left: 10px; position:relative; }
.timeline-body::before { content:""; width:8px; height:8px; border-radius:50%; background: var(--blue); position:absolute; left:-5px; top:5px; }
.timeline-body strong { display:block; font-size:13px; }
.timeline-body span { color:var(--muted); font-size:12px; }
.calendar-header { display:flex; align-items:center; justify-content:space-between; margin-bottom: 14px; }
.calendar-header button { border:0; background:#f8fafc; width:30px; height:30px; border-radius:10px; }
.calendar-weekdays, .calendar-grid { display:grid; grid-template-columns: repeat(7, 1fr); text-align:center; gap: 7px; }
.calendar-weekdays { color:#64748b; font-size:12px; font-weight:900; margin-bottom: 8px; }
.calendar-day { height:30px; display:grid; place-items:center; border-radius: 10px; font-size:12px; font-weight:800; color:#334155; }
.calendar-day.other { color:#cbd5e1; }
.calendar-day.today { background: var(--blue); color:#fff; }
.calendar-day.has-task { outline: 2px solid #bfdbfe; }
.memo-card ul { margin:0; padding-left: 18px; display:grid; gap: 9px; color:#334155; font-size:13px; line-height:1.7; }
.link-button, .text-button { border:0; color:var(--blue); background:transparent; padding: 10px 0 0; }
.text-button { padding:0; }

.modal-backdrop { position:fixed; inset:0; background:rgba(15,23,42,.38); display:grid; place-items:center; z-index: 20; padding: 20px; }
.modal-backdrop[hidden] { display:none; }
.modal { width:min(540px, 100%); background:#fff; border-radius:22px; padding:22px; box-shadow: 0 30px 80px rgba(15,23,42,.24); display:grid; gap:14px; }
.modal-header { display:flex; align-items:center; justify-content:space-between; }
.modal h2 { margin:0; }
.modal label { display:grid; gap:7px; font-weight:800; color:#334155; }
.modal input, .modal select, .modal textarea { width:100%; border:1px solid var(--line); border-radius:12px; padding:11px 12px; outline:0; }
.modal input:focus, .modal select:focus, .modal textarea:focus { border-color:#93c5fd; box-shadow:0 0 0 4px #dbeafe; }
.form-grid { display:grid; grid-template-columns: 1fr 1fr; gap:12px; }
.modal-actions { display:flex; justify-content:flex-end; gap:10px; margin-top: 6px; }

@media (max-width: 1200px) {
  .app-shell { grid-template-columns: 240px 1fr; }
  .right-panel { display:none; }
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position:static; height:auto; }
  .main { padding: 22px; }
  .topbar { flex-direction:column; }
  .stats-grid, .board { grid-template-columns: 1fr; }
  .column { min-height: auto; }
  .search-box { min-width: 100%; }
  .top-actions { width:100%; justify-content:stretch; }
  .top-actions > * { flex:1; }
}
