:root {
  --color-bg: #f4f6fb;
  --color-surface: #ffffff;
  --color-border: #e2e8f0;
  --color-text: #1f2937;
  --color-muted: #6b7280;
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-success: #10b981;
  --color-danger: #ef4444;
  --shadow-soft: 0 12px 32px rgba(15, 23, 42, 0.08);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --max-width: 1100px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(100% - 2.5rem, var(--max-width));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.header-layout {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  padding: 1.2rem 0;
}

.branding {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.branding h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
}

.tagline {
  margin: 0.25rem 0 0;
  color: var(--color-muted);
  font-size: 0.95rem;
}

.logo {
  display: grid;
  place-items: center;
  min-width: 2.6rem;
  min-height: 2.6rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), #60a5fa);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.site-nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-weight: 600;
  color: var(--color-muted);
}

main {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  padding: 3rem 0 4rem;
}

.hero {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(79, 70, 229, 0.08));
}

.hero-layout {
  display: grid;
  gap: 2rem;
  padding: 2.5rem 0;
}

.hero-copy h2 {
  margin: 0 0 1rem;
  font-size: 2rem;
  line-height: 1.2;
}

.hero-copy p {
  margin: 0;
  color: var(--color-muted);
  line-height: 1.6;
}

.hero-actions {
  margin-top: 1.6rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-stats {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  box-shadow: var(--shadow-soft);
}

.hero-stats dl {
  margin: 0;
  display: grid;
  gap: 1.5rem;
}

.hero-stats dt {
  font-size: 0.9rem;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-stats dd {
  margin: 0.3rem 0 0;
  font-size: 1.9rem;
  font-weight: 700;
}

.panel {
  scroll-margin-top: 5rem;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.panel-head h2 {
  margin: 0;
  font-size: 1.6rem;
}

.panel-head p {
  margin: 0.4rem 0 0;
  color: var(--color-muted);
  max-width: 38ch;
}

.panel-grid {
  display: grid;
  gap: 1.5rem;
}

.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.card h3 {
  margin: 0;
  font-size: 1.2rem;
}

.field,
.filter-bar .field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
}

.field-group {
  display: grid;
  gap: 1rem;
}

.field label {
  font-weight: 600;
  color: var(--color-text);
}

.field span {
  font-size: 0.85rem;
  color: var(--color-muted);
  font-weight: 400;
}

input,
select,
textarea {
  font: inherit;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: #fff;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.65rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.28);
}

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

.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-ghost:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.pill-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.pill-list__item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.pill-list__title {
  font-weight: 600;
}

.pill-list__meta {
  color: var(--color-muted);
  font-size: 0.9rem;
}

.pill-list__empty {
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px dashed var(--color-border);
  color: var(--color-muted);
  text-align: center;
}

.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.table-wrapper {
  margin-top: 1.5rem;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

thead {
  background: rgba(37, 99, 235, 0.08);
  color: var(--color-text);
}

thead th {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.85rem 1rem;
}

tbody td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.95rem;
}

tbody tr:hover {
  background: rgba(37, 99, 235, 0.06);
}

.table-empty {
  text-align: center;
  color: var(--color-muted);
  font-size: 0.95rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-priority-low {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success);
}

.badge-priority-medium {
  background: rgba(37, 99, 235, 0.15);
  color: var(--color-primary);
}

.badge-priority-high {
  background: rgba(239, 68, 68, 0.18);
  color: var(--color-danger);
}

.badge-status-todo {
  background: rgba(148, 163, 184, 0.22);
  color: #475569;
}

.badge-status-in-progress {
  background: rgba(245, 158, 11, 0.2);
  color: #b45309;
}

.badge-status-done {
  background: rgba(16, 185, 129, 0.18);
  color: var(--color-success);
}

.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 1.8rem 0 2.5rem;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.footer-layout {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: center;
}

.footer-note {
  margin: 0;
}

#toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  transform: translateY(20px);
  background: var(--color-primary);
  color: #fff;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  font-weight: 600;
}

#toast[data-variant='error'] {
  background: var(--color-danger);
}

.toast--visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (min-width: 720px) {
  .header-layout {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .hero-layout {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    align-items: stretch;
  }

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

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

  .filter-bar {
    flex-direction: row;
    align-items: flex-end;
  }

  .footer-layout {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 1.5rem, var(--max-width));
  }

  main {
    gap: 2.5rem;
    padding-bottom: 3rem;
  }

  #toast {
    left: 50%;
    right: auto;
    transform: translate(-50%, 20px);
  }

  .toast--visible {
    transform: translate(-50%, 0);
  }
}
