:root {
  color-scheme: dark;
  --bg: #07111f;
  --panel: rgba(11, 24, 43, 0.92);
  --panel-strong: #13223d;
  --text: #f3f7ff;
  --muted: #8ba0bf;
  --accent: #5c7cff;
  --accent-soft: rgba(92, 124, 255, 0.18);
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 18px 45px rgba(5, 9, 18, 0.3);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-strong: #f3f5ff;
  --text: #000000;
  --muted: #444444;
  --accent: #5c7cff;
  --accent-soft: rgba(92, 124, 255, 0.25);
  --border: rgba(92, 124, 255, 0.25);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  padding: 2rem;
  max-width: 1380px;
  margin: 0 auto;
}

.hero {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: 1.4fr 1fr;
  align-items: center;
  padding: 1.5rem;
  background: rgba(92, 124, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 1.4rem;
}

:root[data-theme="light"] .hero {
  background: rgba(92, 124, 255, 0.1);
  border: 1.5px solid rgba(92, 124, 255, 0.2);
}

.eyebrow {
  margin: 0 0 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.78rem;
  color: #98b4ff;
}

.hero h1 {
  margin: 0 0 0.45rem;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

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

.hero__shortcuts {
  margin-top: 0.35rem;
  font-size: 0.95rem;
  color: #c0d2ff;
}

.hero__note {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
}

.hero__note a {
  color: #98b4ff;
  text-decoration: none;
  border-bottom: 1px solid rgba(152, 180, 255, 0.4);
}

.hero__note a:hover {
  border-bottom-color: #98b4ff;
}

.task-form {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  background: rgba(7, 17, 31, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
}

.toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1rem;
  padding: 0.95rem 1rem;
  background: rgba(7, 17, 31, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
}

:root[data-theme="light"] .toolbar {
  background: #f9fafb;
  border: 1.5px solid rgba(92, 124, 255, 0.15);
}

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

.toolbar__actions {
  display: flex;
  gap: 0.7rem;
  align-items: center;
}

.task-search {
  flex: 1;
  border-radius: 999px;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

:root[data-theme="light"] .task-search {
  background: #ffffff;
  border: 1.5px solid rgba(92, 124, 255, 0.25);
  color: #000000;
}

:root[data-theme="light"] .task-search::placeholder {
  color: #888888;
}

.toolbar__button {
  border: none;
  border-radius: 999px;
  padding: 0.7rem 0.95rem;
  background: rgba(92, 124, 255, 0.16);
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 180ms ease;
}

.toolbar__button:hover {
  background: rgba(92, 124, 255, 0.24);
}

:root[data-theme="light"] .toolbar__button {
  background: rgba(92, 124, 255, 0.12);
  color: #2d3e8f;
}

:root[data-theme="light"] .toolbar__button:hover {
  background: rgba(92, 124, 255, 0.2);
}

.toolbar__theme {
  border: none;
  border-radius: 999px;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  background: rgba(92, 124, 255, 0.16);
  color: var(--text);
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toolbar__theme:hover {
  background: rgba(92, 124, 255, 0.24);
}

:root[data-theme="light"] .toolbar__theme {
  background: rgba(92, 124, 255, 0.12);
}

:root[data-theme="light"] .toolbar__theme:hover {
  background: rgba(92, 124, 255, 0.2);
}

.toolbar__reset {
  border: none;
  border-radius: 999px;
  padding: 0.8rem 1rem;
  background: rgba(255, 122, 122, 0.16);
  color: #ffd0d0;
  cursor: pointer;
}

.toolbar__reset:hover {
  background: rgba(255, 122, 122, 0.24);
}

:root[data-theme="light"] .toolbar__reset {
  background: rgba(255, 122, 122, 0.2);
  color: #c41e3a;
  font-weight: 600;
}

:root[data-theme="light"] .toolbar__reset:hover {
  background: rgba(255, 122, 122, 0.3);
}

.task-form input,
.task-form select,
.task-form button {
  border-radius: 999px;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  background: var(--panel-strong);
  color: var(--text);
}

:root[data-theme="light"] .task-form input,
:root[data-theme="light"] .task-form select {
  background: #f9fafb;
  border: 1.5px solid rgba(92, 124, 255, 0.2);
  color: #000000;
}

.task-form button {
  cursor: pointer;
  background: #3b6bff;
  border: none;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.task-form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(59, 107, 255, 0.22);
}

.matrix-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quadrant {
  padding: 1rem;
  background: var(--panel);
  border-radius: 22px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  min-height: 320px;
  position: relative;
  overflow: hidden;
}

:root[data-theme="light"] .quadrant {
  border: 1.5px solid rgba(92, 124, 255, 0.1);
}


.quadrant--do {
  background: rgba(92, 124, 255, 0.22);
}

:root[data-theme="light"] .quadrant--do {
  background: rgba(92, 124, 255, 0.14);
}

.quadrant--schedule {
  background: rgba(120, 190, 255, 0.2);
}

:root[data-theme="light"] .quadrant--schedule {
  background: rgba(120, 190, 255, 0.14);
}

.quadrant--delegate {
  background: rgba(255, 183, 77, 0.2);
}

:root[data-theme="light"] .quadrant--delegate {
  background: rgba(255, 183, 77, 0.14);
}

.quadrant--eliminate {
  background: rgba(255, 122, 122, 0.2);
}

:root[data-theme="light"] .quadrant--eliminate {
  background: rgba(255, 122, 122, 0.14);
}

.quadrant__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.quadrant__label {
  margin: 0 0 0.2rem;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #8fb3ff;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.quadrant__icon {
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  opacity: 0.9;
}

.quadrant h2 {
  margin: 0;
  font-size: 1rem;
}

.badge {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #cddcff;
  font-weight: 700;
}

:root[data-theme="light"] .badge {
  background: rgba(92, 124, 255, 0.2);
  color: #2d3e8f;
}

.dropzone {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 250px;
  padding: 0.7rem;
  border: 1px dashed transparent;
  border-radius: 16px;
  transition: border-color 180ms ease, background 180ms ease;
}

.dropzone.drag-over {
  border-color: var(--accent);
  background: rgba(92, 124, 255, 0.12);
}

.task-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.85rem 0.9rem;
  border-radius: 14px;
  background: rgba(7, 17, 31, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: grab;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
  animation: card-pop 180ms ease;
}

:root[data-theme="light"] .task-card {
  background: #ffffff;
  border: 1.5px solid rgba(92, 124, 255, 0.2);
}

:root[data-theme="light"] .task-card__title {
  color: #000000;
}

:root[data-theme="light"] .task-card:hover {
  border-color: rgba(92, 124, 255, 0.6);
}

:root[data-theme="light"] .task-card.is-selected {
  border-color: #5c7cff;
  box-shadow: 0 0 0 2px rgba(92, 124, 255, 0.2);
}

:root[data-theme="light"] .task-card.is-overdue {
  border-color: rgba(255, 122, 122, 0.5);
  box-shadow: 0 0 0 2px rgba(255, 122, 122, 0.15);
  background: rgba(255, 122, 122, 0.05);
}

.task-card:hover {
  transform: translateY(-2px);
  border-color: rgba(92, 124, 255, 0.45);
}

.task-card.is-selected {
  border-color: rgba(92, 124, 255, 0.65);
  box-shadow: 0 0 0 1px rgba(92, 124, 255, 0.24);
}

.task-card.is-dragging {
  opacity: 0.6;
  transform: scale(0.98);
}

.task-card.is-target {
  border-color: var(--accent);
  background: rgba(92, 124, 255, 0.16);
}

.task-card.is-overdue {
  border-color: rgba(255, 122, 122, 0.7);
  box-shadow: 0 0 0 1px rgba(255, 122, 122, 0.2);
  background: rgba(255, 122, 122, 0.14);
}

.task-card__content {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.task-card__title {
  margin: 0;
  line-height: 1.4;
  color: var(--text);
  cursor: text;
  white-space: pre-wrap;
}

.task-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.task-card__badge {
  display: inline-flex;
  align-items: center;
  padding: 0.24rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  color: #dfe8ff;
  background: rgba(255, 255, 255, 0.08);
}

.task-card__badge--priority {
  background: rgba(92, 124, 255, 0.2);
}

.task-card__badge--due {
  background: rgba(255, 183, 77, 0.18);
}

.task-card__badge--overdue {
  background: rgba(255, 122, 122, 0.2);
  color: #ffd0d0;
}

:root[data-theme="light"] .task-card__badge {
  background: rgba(92, 124, 255, 0.12);
  color: #2d3e8f;
}

:root[data-theme="light"] .task-card__badge--priority {
  background: rgba(92, 124, 255, 0.2);
  color: #2d3e8f;
}

:root[data-theme="light"] .task-card__badge--due {
  background: rgba(255, 183, 77, 0.25);
  color: #c67700;
}

:root[data-theme="light"] .task-card__badge--overdue {
  background: rgba(255, 122, 122, 0.25);
  color: #c41e3a;
}

.task-card__edit-input {
  width: 100%;
  border: 1px solid rgba(92, 124, 255, 0.45);
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  background: rgba(7, 17, 31, 0.85);
  color: var(--text);
}

.task-card__due {
  margin-top: 0.5rem;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 0.45rem 0.55rem;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.task-card__delete {
  border: none;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #ff9aa4;
  cursor: pointer;
}

.empty-state {
  margin: 0;
  padding: 0.8rem;
  text-align: center;
  color: var(--muted);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 14px;
}

.context-menu {
  position: fixed;
  z-index: 30;
  min-width: 150px;
  padding: 0.5rem;
  border-radius: 14px;
  background: rgba(7, 17, 31, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
}

.context-menu__title {
  margin: 0 0 0.4rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.context-menu__item {
  display: block;
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  margin-top: 0.25rem;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.context-menu__item:hover {
  background: rgba(92, 124, 255, 0.16);
}

.dialog {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  place-items: center;
  padding: 1rem;
  background: rgba(3, 8, 15, 0.75);
}

.dialog:not([hidden]) {
  display: grid;
}

.dialog[hidden] {
  display: none !important;
}

.dialog__panel {
  width: min(100%, 360px);
  padding: 1.2rem;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
}

.dialog__panel h2 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.dialog__panel p {
  margin: 0 0 1rem;
  color: var(--muted);
  line-height: 1.5;
}

.dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.7rem;
}

.dialog__button {
  border: none;
  border-radius: 999px;
  padding: 0.7rem 0.95rem;
  cursor: pointer;
}

.dialog__button--secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.dialog__button--primary {
  background: #3b6bff;
  color: #ffffff;
  font-weight: 600;
}

.dialog__button--primary:hover {
  background: #5c7cff;
}

.dialog__button--danger {
  background: rgba(255, 122, 122, 0.2);
  color: #ffd0d0;
}

:root[data-theme="light"] .dialog__button--secondary {
  background: #f0f4ff;
  color: #2d3e8f;
}

:root[data-theme="light"] .dialog__button--primary {
  background: #5c7cff;
  color: #ffffff;
}

@keyframes card-pop {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

  .matrix-grid {
    grid-template-columns: 1fr;
  }

  .toolbar__actions {
    flex-direction: column;
    align-items: stretch;
  }
}
