:root {
  --bg: #eef1f8;
  --bg-2: #f7f8fc;
  --surface: #ffffff;
  --border: #e7e9f0;
  --text: #1f2430;
  --text-muted: #8b91a1;
  --primary: #5b60e6;
  --primary-dark: #474cd1;
  --primary-soft: #eef0fe;
  --accent-note: #5b60e6;
  --accent-task: #17b877;
  --danger: #e5484d;
  --shadow-sm: 0 1px 2px rgba(24, 28, 44, 0.05);
  --shadow-md: 0 6px 20px rgba(24, 28, 44, 0.08);
  --shadow-lg: 0 12px 32px rgba(24, 28, 44, 0.12);
  --radius: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI",
    "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 600px at 100% -10%, #e6ebff 0%, transparent 55%),
    radial-gradient(1000px 500px at -10% 0%, #eafff4 0%, transparent 45%),
    var(--bg);
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 20px 80px;
}

/* ---------- Header ---------- */
.app-header {
  margin-bottom: 32px;
}

.app-header h1 {
  margin: 0 0 8px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

/* ---------- Dashboard ---------- */
.dashboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 36px;
}

.dashboard-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 18px 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), #7c80f0);
}

.dashboard-card:nth-child(3)::before {
  background: linear-gradient(90deg, #17b877, #4fd39b);
}

.dashboard-card:nth-child(4)::before {
  background: linear-gradient(90deg, #e5484d, #f2777b);
}

.dashboard-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.dashboard-number {
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.dashboard-number.success {
  color: #17b877;
}

.dashboard-number.danger {
  color: var(--danger);
}

.dashboard-label {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}

/* ---------- Latest review banner ---------- */
.review-banner {
  position: relative;
  background: linear-gradient(135deg, #5b60e6 0%, #7c53e0 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 36px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.review-banner::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 160px;
  height: 160px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.review-banner-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.review-banner-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.review-banner-week {
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.18);
  padding: 3px 10px;
  border-radius: 999px;
}

.review-banner-comment {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  position: relative;
  z-index: 1;
}

/* ---------- Panels & sections ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
}

.section {
  margin: 8px 0 36px;
}

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

.section h2 {
  margin-bottom: 14px;
  padding-left: 2px;
}

/* ---------- Forms ---------- */
.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form.inline {
  flex-direction: row;
  align-items: center;
}

.form.inline input {
  flex: 1;
}

.form input,
.form textarea {
  width: 100%;
  padding: 13px 15px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-2);
  resize: vertical;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.form input::placeholder,
.form textarea::placeholder {
  color: #b3b8c6;
}

.form input:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.form-hint {
  margin: -2px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.form input[type="week"] {
  max-width: 220px;
}

.review-item::before {
  background: #7c53e0;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
}

.form button {
  padding: 12px 22px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #6469ea, var(--primary));
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(91, 96, 230, 0.28);
  transition: transform 0.12s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.form button:hover {
  filter: brightness(1.05);
  box-shadow: 0 6px 16px rgba(91, 96, 230, 0.36);
}

.form button:active {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(91, 96, 230, 0.3);
}

/* ---------- Lists ---------- */
.list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.item {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px 16px 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 4px;
  border-radius: 4px;
  background: var(--accent-note);
}

.item:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.item-title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.item-body {
  white-space: pre-wrap;
  color: #545b6b;
  font-size: 14px;
  margin-bottom: 10px;
}

.item-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.item-actions {
  display: flex;
  gap: 12px;
}

.item-actions button {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 4px;
  border-radius: 6px;
  color: var(--text-muted);
  transition: color 0.12s ease, background 0.12s ease;
}

.item-actions button:hover {
  background: #fbeaeb;
  color: var(--danger);
}

.item-actions button.delete {
  color: #c0687a;
}

/* ---------- Task items ---------- */
.task-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.task-item::before {
  background: var(--accent-task);
}

.task-item .task-check {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  accent-color: var(--accent-task);
  cursor: pointer;
  flex-shrink: 0;
}

.task-main {
  flex: 1;
}

.task-text {
  font-size: 14.5px;
  font-weight: 500;
}

.task-item.done::before {
  background: #c7ccd6;
}

.task-item.done {
  background: #f7f8fb;
}

.task-item.done .task-text {
  text-decoration: line-through;
  color: #a6acba;
  font-weight: 400;
}

/* ---------- Empty state ---------- */
.empty {
  color: var(--text-muted);
  font-size: 14px;
  padding: 22px;
  text-align: center;
  background: var(--surface);
  border: 1.5px dashed #d5d9e4;
  border-radius: var(--radius-sm);
}

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  .container {
    padding: 32px 14px 60px;
  }
  .dashboard {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .dashboard-card {
    padding: 16px 8px 14px;
  }
  .dashboard-number {
    font-size: 26px;
  }
  .app-header h1 {
    font-size: 24px;
  }
  .panel {
    padding: 20px 18px;
  }
}
