:root {
  color-scheme: light;
  --ink: #1f1b16;
  --muted: #5f564c;
  --accent: #0f6b5b;
  --accent-2: #b0562a;
  --cream: #f7f1e7;
  --paper: #fffaf3;
  --shadow: 0 24px 60px rgba(31, 27, 22, 0.18);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background: #efe6da;
  display: flex;
  justify-content: center;
}

.bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 10% 10%, rgba(176, 86, 42, 0.18), transparent 45%),
    radial-gradient(circle at 90% 20%, rgba(15, 107, 91, 0.15), transparent 42%),
    linear-gradient(130deg, #efe6da, #f8f2e9 60%, #efe1d3);
  z-index: -1;
}

.app {
  width: min(1100px, 92vw);
  padding: 48px 0 80px;
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

h1 {
  font-family: "Playfair Display", serif;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  margin: 0;
}

.subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.fab {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: white;
  font-size: 2rem;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 24px rgba(15, 107, 91, 0.28);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(15, 107, 91, 0.32);
}

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

.workspace-tabs-bar {
  margin-bottom: 18px;
}

.workspace-input {
  display: flex;
  gap: 10px;
  align-items: center;
}

.workspace-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 6px;
}

.workspace-tabs.form {
  padding-top: 0;
  gap: 8px;
}

.workspace-tabs.form .tab {
  padding: 6px 12px;
  font-size: 0.9rem;
}

.tab {
  border: 1px solid rgba(31, 27, 22, 0.18);
  background: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tab.active {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 20px rgba(15, 107, 91, 0.22);
}

.tab:hover {
  transform: translateY(-1px);
}


select,
input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(31, 27, 22, 0.16);
  font-family: inherit;
  font-size: 0.95rem;
  background: #fff;
}

.stat {
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(31, 27, 22, 0.08);
}

.stat span {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
}

.stat strong {
  font-size: 1.6rem;
  font-family: "Playfair Display", serif;
}

.list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.note {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
  border: 1px solid rgba(31, 27, 22, 0.08);
  animation: rise 0.4s ease;
}

.note-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.check-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(31, 27, 22, 0.2);
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
}

.check-icon {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 2px solid rgba(31, 27, 22, 0.35);
  display: grid;
  place-items: center;
  position: relative;
}

.check-icon::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 4px;
  border-left: 2px solid transparent;
  border-bottom: 2px solid transparent;
  transform: rotate(-45deg);
}

.check-button.active {
  color: var(--ink);
  border-color: rgba(15, 107, 91, 0.5);
}

.check-button.active .check-icon {
  background: var(--accent);
  border-color: var(--accent);
}

.check-button.active .check-icon::after {
  border-left-color: #fff;
  border-bottom-color: #fff;
}

.done-group {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.priority-group {
  display: grid;
  gap: 12px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(31, 27, 22, 0.06);
}

.priority-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(31, 27, 22, 0.08);
  cursor: pointer;
  text-align: left;
}

.priority-title {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  color: var(--muted);
}

.priority-count {
  font-size: 0.85rem;
  color: var(--muted);
}

.priority-notes {
  display: grid;
  gap: 18px;
}

.priority-caret {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.priority-header[aria-expanded="false"] .priority-caret {
  transform: rotate(-45deg);
}

.priority-notes:not(.open) {
  display: none;
}

.priority-group.priority-do .priority-header {
  background: rgba(15, 107, 91, 0.12);
}

.priority-group.priority-schedule .priority-header {
  background: rgba(20, 74, 143, 0.12);
}

.priority-group.priority-delegate .priority-header {
  background: rgba(176, 86, 42, 0.12);
}

.priority-group.priority-eliminate .priority-header {
  background: rgba(82, 63, 56, 0.12);
}

.done-header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(31, 27, 22, 0.08);
  cursor: pointer;
}

.done-title {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  color: var(--muted);
}

.done-count {
  font-size: 0.85rem;
  color: var(--muted);
}

.done-caret {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.done-header[aria-expanded="true"] .done-caret {
  transform: rotate(225deg);
}

.done-notes {
  display: none;
  gap: 18px;
}

.done-notes.open {
  display: grid;
}


.note-text {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.done-priority {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.done-priority.prio.do {
  color: #0c4f44;
}

.done-priority.prio.schedule {
  color: #16456f;
}

.done-priority.prio.delegate {
  color: #7b3617;
}

.done-priority.prio.eliminate {
  color: #3a2f28;
}

.note.completed {
  opacity: 0.6;
  background: #f4eee4;
  box-shadow: none;
}

.note.completed .note-text {
  text-decoration: line-through;
}

.note-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.ghost,
.primary {
  border-radius: 999px;
  padding: 8px 14px;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

.ghost:disabled,
.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.icon-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}


.ghost {
  background: transparent;
  border: 1px solid rgba(31, 27, 22, 0.2);
  color: var(--ink);
}

.primary {
  background: var(--accent-2);
  color: #fff;
  box-shadow: 0 10px 20px rgba(176, 86, 42, 0.24);
}

.drawer {
  position: fixed;
  inset: 0;
  background: rgba(17, 14, 11, 0.35);
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  padding: 24px;
}

.drawer.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 14, 11, 0.35);
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  padding: 24px;
}

.modal.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: min(520px, 95vw);
  background: #fffdf8;
  border-radius: 24px;
  padding: 22px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
  border: 1px solid rgba(31, 27, 22, 0.1);
}

.workspace-manage {
  display: grid;
  gap: 16px;
}

.workspace-actions {
  display: grid;
  gap: 8px;
}

.workspace-action-buttons {
  display: flex;
  gap: 10px;
}

.drawer-card {
  width: min(640px, 95vw);
  background: #fffdf8;
  border-radius: 26px;
  padding: 24px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
  border: 1px solid rgba(31, 27, 22, 0.1);
  animation: pop 0.3s ease;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--muted);
}

textarea {
  width: 100%;
  min-height: 140px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(31, 27, 22, 0.16);
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
  background: #fff;
}

.priority-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.pill {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(31, 27, 22, 0.12);
  background: #fff;
  cursor: pointer;
  transition: border 0.2s ease, transform 0.2s ease;
}

.pill input {
  margin-top: 4px;
}

.pill small {
  color: var(--muted);
  font-size: 0.82rem;
}

.pill:has(input:checked) {
  border-color: rgba(15, 107, 91, 0.5);
  transform: translateY(-1px);
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
  padding-top: 6px;
}

.delete-options {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px dashed rgba(31, 27, 22, 0.2);
  color: var(--muted);
}

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

@keyframes pop {
  from {
    transform: scale(0.98);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@media (max-width: 700px) {
  .app {
    padding: 32px 0 60px;
  }

  .header {
    align-items: flex-start;
  }

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

  .workspace-action-buttons {
    flex-direction: column;
    align-items: stretch;
  }
}
.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(31, 27, 22, 0.14);
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.icon-button svg {
  width: 18px;
  height: 18px;
  fill: var(--ink);
}

.icon-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(31, 27, 22, 0.12);
}
