:root {
  --bg: #fbfbfd;
  --panel-bg: #ffffff;
  --item-bg: #f5f5f7;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --border: rgba(0, 0, 0, 0.07);
  --accent: #0071e3;
  --accent-dark: #0058b0;
  --danger: #ff3b30;
  --indigo: #5e5ce6;
  --orange: #ff9f0a;
  --green: #34c759;
  --purple: #af52de;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.05), 0 8px 20px rgba(0, 0, 0, 0.045);
  --shadow-hover: 0 6px 20px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro JP", "Hiragino Sans",
    "Hiragino Kaku Gothic ProN", "Yu Gothic", "Segoe UI", "Meiryo", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(0, 113, 227, 0.18);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(251, 251, 253, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 16px 24px;
}

.app-header h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.app {
  max-width: 1040px;
  margin: 0 auto;
  padding: 36px 24px 90px;
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.stat-icon svg {
  width: 20px;
  height: 20px;
}

.stat-notes .stat-icon {
  background: rgba(0, 113, 227, 0.1);
  color: var(--accent);
}

.stat-tasks .stat-icon {
  background: rgba(94, 92, 230, 0.1);
  color: var(--indigo);
}

.stat-completed .stat-icon {
  background: rgba(52, 199, 89, 0.1);
  color: var(--green);
}

.stat-incomplete .stat-icon {
  background: rgba(255, 159, 10, 0.1);
  color: var(--orange);
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.stat-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.review-card {
  grid-column: 1 / -1;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 20px 24px;
}

.review-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.review-card-title {
  font-size: 13px;
  font-weight: 600;
}

.review-card-week {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.review-card-comment {
  margin: 0;
  font-size: 15px;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.review-card-comment.is-empty {
  color: var(--muted);
  font-size: 14px;
}

.review-icon {
  color: var(--purple);
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 720px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
  .dashboard {
    grid-template-columns: 1fr;
  }
}

.panel {
  min-width: 0;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 24px;
}

.panel-wide {
  margin-top: 20px;
}

.panel h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.section-icon {
  display: inline-flex;
  color: var(--accent);
}

.section-icon svg {
  width: 18px;
  height: 18px;
}

.note-form,
.task-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.task-form {
  flex-direction: row;
}

@media (max-width: 480px) {
  .task-form {
    flex-direction: column;
  }
}

.review-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.review-form button {
  align-self: flex-start;
}

input,
textarea {
  font: inherit;
  padding: 11px 14px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--text);
  resize: vertical;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input::placeholder,
textarea::placeholder {
  color: #a1a1a6;
}

.task-form input {
  flex: 1;
  min-width: 0;
}

.task-form button {
  flex: none;
  white-space: nowrap;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}

button {
  font: inherit;
  font-weight: 590;
  border: none;
  border-radius: 980px;
  padding: 11px 24px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

button:hover {
  background: var(--accent-dark);
}

button:active {
  transform: scale(0.97);
}

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.note-list,
.task-list,
.review-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 460px;
  overflow-y: auto;
}

.note-list::-webkit-scrollbar,
.task-list::-webkit-scrollbar,
.review-list::-webkit-scrollbar {
  width: 8px;
}

.note-list::-webkit-scrollbar-thumb,
.task-list::-webkit-scrollbar-thumb,
.review-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 8px;
}

.note-list::-webkit-scrollbar-track,
.task-list::-webkit-scrollbar-track,
.review-list::-webkit-scrollbar-track {
  background: transparent;
}

.empty-message {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
  padding: 40px 0;
  text-align: center;
}

.note-item,
.task-item,
.review-item {
  background: var(--item-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.note-item:hover,
.task-item:hover,
.review-item:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.note-item,
.review-item {
  padding: 12px 14px;
}

.note-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.note-title {
  font-weight: 600;
  word-break: break-word;
}

.note-date {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  margin-left: auto;
}

.note-body {
  margin: 0;
  font-size: 14px;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.review-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.review-week-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--purple);
  background: rgba(175, 82, 222, 0.1);
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.review-date {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.review-comment {
  margin: 0;
  font-size: 14px;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.task-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 14px;
}

.task-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.task-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  flex: none;
  border-radius: 6px;
  border: 1.5px solid rgba(0, 0, 0, 0.2);
  background: #fff;
  position: relative;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.task-item input[type="checkbox"]:hover {
  border-color: var(--accent);
}

.task-item input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.task-item input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.task-item input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.task-title {
  flex: 1;
  word-break: break-word;
}

.task-item.completed .task-title {
  text-decoration: line-through;
  text-decoration-color: rgba(0, 0, 0, 0.25);
  color: var(--muted);
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 32px;
}

.task-date {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.task-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.task-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
}

.task-item.completed .task-status::before {
  background: var(--green);
}

.delete-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.delete-btn svg {
  width: 16px;
  height: 16px;
}

.delete-btn:hover {
  background: rgba(255, 59, 48, 0.1);
  color: var(--danger);
}
