:root {
  --bg: #0b1222;
  --panel: rgba(20, 28, 47, 0.85);
  --panel-strong: rgba(20, 28, 47, 0.95);
  --text: #e9eef8;
  --muted: #93a4c7;
  --accent: #4ade80;
  --accent-2: #22d3ee;
  --danger: #f87171;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 16px 50px rgba(5, 11, 25, 0.45);
  --radius: 16px;
  --radius-sm: 12px;
  --transition: 180ms ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at 10% 20%, #0f1a33, #0b1222 40%), radial-gradient(circle at 80% 0%, #0f2f3a, transparent 45%), #0b1222;
  color: var(--text);
}

.texture {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg width='160' height='160' viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' x2='0' y1='0' y2='1'%3E%3Cstop stop-color='%2356f0a9' stop-opacity='0.12'/%3E%3Cstop offset='1' stop-color='%2321b4c0' stop-opacity='0.08'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='160' height='160' fill='url(%23g)'/%3E%3C/svg%3E");
  opacity: 0.25;
  z-index: 0;
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: -0.02em;
}

p {
  margin: 0;
}

.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.branding {
  max-width: 720px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  color: var(--accent-2);
  margin-bottom: 6px;
}

.hero h1 {
  font-size: clamp(28px, 5vw, 44px);
  margin-bottom: 8px;
}

.lede {
  color: var(--muted);
  max-width: 620px;
}

.hero-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 600;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

.btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.1);
}

.btn.primary {
  background: linear-gradient(120deg, #3dd892, #1cb5c9);
  color: #081320;
}

.btn.primary:hover {
  box-shadow: 0 12px 30px rgba(34, 211, 238, 0.35);
}

.btn.ghost {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.stat-card {
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stat-card .label {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.stat-card .value {
  font-size: 28px;
  font-weight: 700;
}

.stat-card.critical {
  background: linear-gradient(140deg, rgba(248, 113, 113, 0.12), rgba(248, 113, 113, 0.04));
  border-color: rgba(248, 113, 113, 0.35);
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  align-items: end;
  padding: 16px;
  background: var(--panel-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.control {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control label {
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  transition: border-color var(--transition), background var(--transition);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-2);
  background: rgba(255, 255, 255, 0.08);
}

.control--actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.tasks {
  margin-top: 28px;
}

.tasks-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.pill {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  font-weight: 600;
}

.legend {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-right: 6px;
}

.legend-dot.high {
  background: #f59e0b;
}

.legend-dot.medium {
  background: #22d3ee;
}

.legend-dot.low {
  background: #4ade80;
}

.task-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.task-card {
  position: relative;
  padding: 16px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 180px;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.task-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.task-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.badges {
  display: flex;
  gap: 6px;
}

.badge {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 1px solid var(--border);
}

.badge.status.todo {
  color: #22d3ee;
  background: rgba(34, 211, 238, 0.12);
  border-color: rgba(34, 211, 238, 0.3);
}

.badge.status.in_progress {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
}

.badge.status.done {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.12);
  border-color: rgba(74, 222, 128, 0.3);
}

.badge.priority.high {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.35);
}

.badge.priority.medium {
  color: #22d3ee;
  background: rgba(34, 211, 238, 0.14);
  border-color: rgba(34, 211, 238, 0.35);
}

.badge.priority.low {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.14);
  border-color: rgba(74, 222, 128, 0.35);
}

.task-title {
  font-size: 18px;
}

.task-desc {
  color: var(--muted);
  line-height: 1.5;
  flex: 1;
}

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

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

.deadline::before {
  content: "⏳";
  font-size: 14px;
}

.task-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 12px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), border-color var(--transition);
}

.icon-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.16);
}

.icon-btn.delete:hover {
  background: rgba(248, 113, 113, 0.12);
  color: #fda4af;
}

.icon-btn.edit:hover {
  background: rgba(34, 211, 238, 0.12);
}

.task-card.overdue {
  border-color: rgba(248, 113, 113, 0.6);
  box-shadow: 0 12px 32px rgba(248, 113, 113, 0.18);
}

.task-card.overdue .deadline::before {
  content: "⚠️";
}

.empty-state {
  margin-top: 12px;
  text-align: center;
  color: var(--muted);
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 20;
}

.modal.hidden {
  display: none;
}

.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 9, 20, 0.7);
  backdrop-filter: blur(3px);
}

.modal__content {
  position: relative;
  width: min(640px, calc(100vw - 24px));
  background: #0f172a;
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 22px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  animation: fadeIn 180ms ease;
}

.modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.field {
  margin-bottom: 12px;
}

.field.inline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
}

.field__hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--danger);
}

.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  .hero {
    flex-direction: column;
  }

  .hero-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .toolbar {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  .control--actions {
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .app-shell {
    padding: 20px 16px 48px;
  }

  .stats {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .task-card {
    min-height: auto;
  }
}
