:root {
  --bg: #f5f7f4;
  --bg-accent: #eaf3ed;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #ffffff;
  --ink: #112319;
  --muted: #5c6e64;
  --line: #d9e4dc;
  --brand: #0f7a5f;
  --brand-2: #176ca8;
  --brand-soft: #d9efe7;
  --danger: #b91c1c;
  --ok: #0a7a3f;
  --shadow: 0 16px 38px rgba(17, 35, 25, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Trebuchet MS", "Gill Sans", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 8%, #d7ebe1 0%, transparent 34%),
    radial-gradient(circle at 86% 15%, #d8e8f5 0%, transparent 33%),
    linear-gradient(160deg, var(--bg), var(--bg-accent));
  min-height: 100vh;
}

.layout {
  width: min(1120px, 100% - 2rem);
  margin: 1.25rem auto 2.5rem;
  display: grid;
  gap: 1rem;
}

#protectedArea {
  display: grid;
  gap: 1rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.hero {
  background: linear-gradient(135deg, #0f7a5f, #176ca8 65%, #0d4d78);
  color: #f6fffb;
  border: none;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.55rem, 2vw, 2.1rem);
  letter-spacing: 0.2px;
}

.hero p {
  margin: 0.45rem 0 0;
  max-width: 70ch;
  opacity: 0.96;
}

.auth-panel {
  display: grid;
  gap: 0.75rem;
  border-left: 5px solid var(--brand);
}

.auth-head h2 {
  margin: 0;
}

.auth-head p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 0.75rem;
}

.controls {
  display: grid;
  gap: 0.8rem;
}

.field {
  display: grid;
  gap: 0.35rem;
}

label {
  font-size: 0.83rem;
  color: var(--muted);
  letter-spacing: 0.2px;
}

input,
textarea,
button {
  font: inherit;
  border-radius: 11px;
  border: 1px solid var(--line);
  padding: 0.64rem 0.72rem;
}

input,
textarea {
  background: #ffffff;
  color: var(--ink);
}

input:focus,
textarea:focus {
  border-color: #8cbca7;
  outline: 2px solid rgba(23, 108, 168, 0.15);
  outline-offset: 0;
}

.add-task-form {
  display: flex;
  gap: 0.65rem;
  align-items: end;
}

.add-task-form .grow {
  flex: 1;
}

button {
  cursor: pointer;
  border-color: transparent;
  color: #f4fffd;
  background: linear-gradient(130deg, var(--brand), var(--brand-2));
  font-weight: 600;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  box-shadow: 0 8px 16px rgba(15, 122, 95, 0.2);
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(15, 122, 95, 0.26);
}

button.ghost {
  background: #edf3ef;
  color: #173126;
  border: 1px solid #d3e1d8;
  box-shadow: none;
}

button.ghost:hover {
  box-shadow: 0 8px 16px rgba(23, 49, 38, 0.08);
}

.auth-actions,
.actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.status {
  margin: 0;
  min-height: 1.1rem;
  color: var(--ok);
  font-size: 0.9rem;
  font-weight: 600;
}

.stats,
.monthly-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.8rem;
}

.stats article,
.monthly-stats article {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem;
}

.stats h2,
.monthly-stats h2 {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.stats p,
.monthly-stats p {
  margin: 0.4rem 0 0;
  font-size: 1.38rem;
  font-weight: 700;
}

.tasks-panel h2,
.monthly-panel h2,
.report-panel h2 {
  margin-top: 0;
}

.task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.task-item {
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand-soft);
  border-radius: 11px;
  padding: 0.58rem 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: #ffffff;
}

.task-item input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--brand);
}

.task-body {
  display: grid;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}

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

.task-title.done {
  text-decoration: line-through;
  color: var(--muted);
}

.task-meta {
  color: var(--muted);
  font-size: 0.76rem;
}

.delete-btn {
  background: #ffe9e9;
  color: #8f1818;
  border: 1px solid #ffcaca;
  box-shadow: none;
}

.delete-btn:hover {
  box-shadow: 0 8px 14px rgba(185, 28, 28, 0.14);
}

textarea {
  width: 100%;
  resize: vertical;
}

.empty {
  margin: 0;
  color: var(--muted);
}

.hidden {
  display: none !important;
}

@media (max-width: 760px) {
  .layout {
    width: min(1120px, 100% - 1rem);
    margin-top: 0.7rem;
  }

  .add-task-form,
  .auth-actions,
  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .stats,
  .monthly-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
