@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #dc2626;
  --secondary: #ef4444;
  --accent: #fbbf24;
  --bg: #fef2f2;
  --surface: #ffffff;
  --text: #7f1d1d;
  --text-strong: #450a0a;
  --border: #fecaca;
  --danger: #991b1b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: radial-gradient(circle at 0% 0%, #fee2e2 0, #fef2f2 35%, #fff 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

.app-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(transparent 96%, #fee2e2 100%),
    linear-gradient(90deg, transparent 96%, #fee2e2 100%);
  background-size: 32px 32px;
  opacity: 0.5;
}

.layout {
  position: relative;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--border);
  padding: 28px 20px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(4px);
}

.sidebar h1 {
  margin: 0;
  font-size: 24px;
  color: var(--text-strong);
}

.caption {
  margin: 10px 0 22px;
  font-size: 12px;
}

.sidebar nav {
  display: grid;
  gap: 8px;
}

.sidebar nav a {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 12px;
  transition: background-color 180ms ease, border-color 180ms ease;
}

.sidebar nav a.router-link-active,
.sidebar nav a:hover {
  border-color: var(--border);
  background: #fff5f5;
}

.sidebar-foot {
  position: absolute;
  bottom: 24px;
  left: 20px;
  right: 20px;
  display: grid;
  gap: 12px;
}

.content {
  padding: 24px;
}

.page {
  display: grid;
  gap: 18px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}

.page-head h2 {
  margin: 0;
  font-size: 30px;
  color: var(--text-strong);
}

.page-head p {
  margin: 6px 0 0;
}

.page-actions {
  display: flex;
  gap: 10px;
}

.cards {
  display: grid;
  gap: 12px;
}

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

.card,
.task-row,
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}

.task-row {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px 26px;
}

.task-row-main {
  display: flex;
  align-items: center;
  gap: 24px;
  flex: 0 1 48%;
  min-width: 0;
  padding-left: 14px;
}

.task-row-content {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.task-row h3 {
  margin: 0;
  color: var(--text-strong);
}

.task-row p {
  margin: 0;
  min-width: 0;
  line-height: 1.5;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-right: 0;
  white-space: nowrap;
}

.task-row-meta {
  flex: 0 0 auto;
  min-width: 320px;
  display: flex;
  justify-content: center;
}

.task-row.done {
  opacity: 0.72;
}

.task-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  flex: 0 0 auto;
  margin-left: auto;
}

.task-check {
  width: 18px;
  height: 18px;
  margin: 0;
  appearance: none;
  border: 1.6px solid #f2b8b8;
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  position: relative;
  flex: 0 0 auto;
  transition: background-color 180ms ease, border-color 180ms ease;
}

.task-check:hover {
  border-color: #e88f8f;
}

.task-check:checked {
  border-color: var(--primary);
  background: var(--primary);
}

.task-check:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.settings-form {
  max-width: 700px;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

input:not(.task-check),
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  color: var(--text-strong);
  background: #fff;
}

input:not(.task-check):focus,
select:focus,
textarea:focus,
button:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-strong);
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

.btn:hover {
  background: #fff5f5;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn.primary:hover {
  background: var(--secondary);
}

.btn.danger {
  border-color: #fecaca;
  color: var(--danger);
}

.btn.full {
  width: 100%;
}

.pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}

.auth-card {
  width: min(460px, 100%);
}

.login-page .auth-card {
  margin: 0 auto;
}

.auth-card h1 {
  margin: 0;
  color: var(--text-strong);
}

.auth-card p {
  margin: 10px 0 18px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.error {
  color: var(--danger);
  font-size: 14px;
}

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(127, 29, 29, 0.26);
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal {
  width: min(560px, 100%);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}

.modal h3 {
  margin: 0 0 12px;
  color: var(--text-strong);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-foot {
    position: static;
    margin-top: 12px;
  }

  .two-col,
  .task-row {
    grid-template-columns: 1fr;
    display: grid;
    gap: 14px;
    padding: 16px;
  }

  .task-row-main {
    gap: 14px;
    padding-left: 4px;
    flex: initial;
  }

  .task-row-meta {
    min-width: 0;
  }

  .task-row-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
