:root {
  font-family: "Space Grotesk", system-ui, sans-serif;
  line-height: 1.5;
  font-weight: 400;
  color: #121212;
  background-color: #f5f2eb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

.app {
  min-height: 100vh;
  padding: 40px clamp(24px, 4vw, 64px) 20px;
  color: var(--text-primary);
  transition: color 0.3s ease;
} 


[data-theme="light"] {
  --surface: #ffffff;
  --surface-muted: #f5f2eb;
  --surface-strong: #0f0f0f;
  --text-primary: #161616;
  --text-secondary: #4a4a4a;
  --accent: #f97316;
  --accent-soft: #ffe5cf;
  --lane: #f0ede4;
  --border: rgba(15, 15, 15, 0.1);
  --shadow: 0 18px 40px rgba(20, 20, 20, 0.08);
  --card-shadow: 0 12px 24px rgba(18, 18, 18, 0.08);
  --pill: #fff3e6;
  --pill-text: #7a3c00;
    
}
[data-theme="dark"] { 
  --surface: #1b1b1f;
  --surface-muted: #141417;
  --surface-strong: #f9f7f2;
  --text-primary: #f7f5ef;
  --text-secondary: #b8b3a9;
  --accent: #f97316;
  --accent-soft: #3a2413;
  --lane: #242428;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  --card-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
  --pill: #2a1b10;
  --pill-text: #ffc89a;
    
}
[data-theme="warm"] { 
  --surface: #fff7f2;
  --surface-muted: #f8efe7;
  --surface-strong: #2a1a14;
  --text-primary: #2a1a14;
  --text-secondary: #644b41;
  --accent: #e65d3a;
  --accent-soft: #ffe0d7;
  --lane: #f2e2d4;
  --border: rgba(42, 26, 20, 0.1);
  --shadow: 0 18px 40px rgba(88, 54, 42, 0.12);
  --card-shadow: 0 12px 24px rgba(86, 52, 40, 0.12);
  --pill: #ffe7d6;
  --pill-text: #9a3b1e;
    
}
[data-theme="cold"] { 
  --surface: #f6fbff;
  --surface-muted: #eaf3fb;
  --surface-strong: #102031;
  --text-primary: #102031;
  --text-secondary: #405468;
  --accent: #3d7bff;
  --accent-soft: #dfe9ff;
  --lane: #dfe9f5;
  --border: rgba(16, 32, 49, 0.1);
  --shadow: 0 18px 40px rgba(21, 46, 72, 0.12);
  --card-shadow: 0 12px 24px rgba(21, 46, 72, 0.12);
  --pill: #e8f0ff;
  --pill-text: #2d5bd3;
}


.app__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--surface);
  padding: 28px 32px;
  border-radius: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  animation: float-in 0.6s ease;
  max-width:100%;
}

.app__eyebrow {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-secondary);
  margin: 0 0 6px;
}

.app h1 {
  font-family: "Fraunces", serif;
  font-size: clamp(26px, 3.2vw, 42px);
  margin: 0;
}

.app__subtitle {
  margin: 10px 0 0;
  color: var(--text-secondary);
}

.app__controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.primary {
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--card-shadow);
}

.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
}

.danger {
  background: transparent;
  border: 1px solid rgba(219, 68, 55, 0.4);
  color: #db4437;
  padding: 6px 10px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.segmented {
  display: inline-flex;
  background: var(--surface-muted);
  padding: 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.segmented button {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.segmented button.active {
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: var(--card-shadow);
}

select {
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 600;
}

.filters {
  margin-top: 18px;
  background: var(--surface);
  border-radius: 18px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}

.filters__label {
  font-weight: 600;
}

.filters__group {
  display: grid;
  gap: 8px;
}

.filters__group > span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  font-weight: 600;
}

.filters__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filters__empty {
  color: var(--text-secondary);
  font-size: 13px;
}

.chip {
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
}

.chip--active {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--text-primary);
}

.filters button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.status {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 600;
}

.status--error {
  border-color: rgba(219, 68, 55, 0.4);
  color: #b3261e;
  background: rgba(219, 68, 55, 0.08);
}

.status--debug {
  border-color: rgba(59, 130, 246, 0.4);
  color: #1d4ed8;
  background: rgba(59, 130, 246, 0.12);
}

.board {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 32px auto 0px;
  padding:0px;
  max-width:100%;
}

.board__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap: 20px;
}

.board__done-row {
  width: 100%;
}

.column {
  background: var(--surface);
  border-radius: 20px;
  padding: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 520px;
  animation: rise-in 0.5s ease;
}

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

.column__header h2 {
  margin: 0;
  font-size: 18px;
}

.column__count {
  background: var(--accent-soft);
  color: var(--text-primary);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 12px;
}

.column__lanes {
  display: flex;
  flex-direction: column;
  gap: 16px;
}


.board__done-row .column__lanes {
  flex-direction: row;
}

.lane {
  background: var(--lane);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.lane--over {
  border: 1px dashed var(--accent);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.lane--empty {
  border: 1px dashed var(--border);
}

.lane__header {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  color: var(--text-secondary);
}

.lane__cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}


.board__done-row .lane__cards{
  flex-direction: row;
}

.lane__cards--grid {
  column-count: 3;
  column-gap: 16px;
  align-items: start;
}

.lane__cards--grid .card {
  max-width: 250px;
  display: inline-block;
  width: 100%;
  margin: 0 0 16px;
  break-inside: avoid;
}

@media (max-width: 1100px) {
  .lane__cards--grid {
    column-count: 2;
  }
}

@media (max-width: 700px) {
  .lane__cards--grid {
    column-count: 1;
  }
}


.board .card {
  background: var(--surface);
  border-radius: 16px;
  padding: 34px 16px 16px;
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  animation: card-pop 0.35s ease;
  position: relative;
  transition: transform 0.18s ease;
}

.card:active {
}

.card--dragging {
  opacity: 0.6;
  transform: scale(0.98) rotate(5deg);
}

.card h3 {
  margin: 8px 0 6px;
  font-size: 16px;
}

.card p {
  margin: 0 0 10px;
  color: var(--text-secondary);
  font-size: 14px;
}

.card__labels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-right: 84px;
}

.card__drag {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-muted);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  cursor: grab;
  user-select: none;
}

.drag-handle {
  font-size: 16px;
  line-height: 1;
  color: var(--text-primary);
  padding: 2px 4px;
}

.card__drag:active {
  cursor: grabbing;
}

.drop-slot {
  height: 12px;
  position: relative;
}

.drop-slot::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 50%;
  height: 2px;
  background: transparent;
  border-radius: 999px;
  transform: translateY(-50%);
}

.drop-slot--active::after {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.pill {
  background: var(--pill);
  color: var(--pill-text);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.card__actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.card__actions button {
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.card__actions button.has-comments:hover::after {
  content: attr(data-count) " comments";
  position: absolute;
  right: 0;
  top: -30px;
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  padding: 4px 8px;
  border-radius: 10px;
  font-size: 11px;
  white-space: nowrap;
  box-shadow: var(--card-shadow);
}

.comment-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.card__comments {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  display: grid;
  gap: 10px;
}

.card__comments-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

.comment-count {
  background: var(--accent-soft);
  color: var(--text-primary);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
}

.card__comments-list {
  display: grid;
  gap: 8px;
}

.comment {
  background: var(--surface-muted);
  border-radius: 12px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  font-size: 12px;
}

.comment p {
  margin: 0 0 6px;
}

.comment span {
  color: var(--text-secondary);
  font-size: 11px;
}

.comment textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: inherit;
  color: var(--text-primary);
}

.comment__actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.comment__actions button {
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
}

.card__comments-form {
  display: grid;
  gap: 8px;
}

.card__comments-form textarea {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  font-family: inherit;
  color: var(--text-primary);
}

.card__comments-form button {
  justify-self: flex-start;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}

.meta-chip {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
}

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  font-size: 13px;
}

.checklist input {
  margin-right: 8px;
}

.list {
  margin-top: 32px;
  background: var(--surface);
  border-radius: 20px;
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  animation: float-in 0.6s ease;
  max-width:100%;
}

.list table {
  width: 100%;
  border-collapse: collapse;
}

.list th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  padding-bottom: 12px;
}

.list td {
  padding: 14px 8px;
  border-top: 1px solid var(--border);
  vertical-align: top;
}

.table-subtext {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 6px;
}

.table-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.table-actions button {
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.calendar {
  margin-top: 32px;
  background: var(--surface);
  border-radius: 24px;
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  animation: float-in 0.6s ease;
  max-width:100%;
}

.calendar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.calendar__grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.calendar__cell {
  background: var(--lane);
  border-radius: 18px;
  padding: 16px;
  display: grid;
  gap: 10px;
}

.calendar__date {
  font-weight: 700;
}

.calendar__card {
  background: var(--surface);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 13px;
  display: grid;
  gap: 4px;
}

.calendar__actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.calendar__actions button {
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
}


.kanban-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 3000;
}

body.kanban-inner-open {
  overflow: hidden;
}

.kanban-modal {
  width: min(760px, 95vw);
  background: var(--surface);
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 24px;
  display: grid;
  gap: 20px;
  max-height: 90vh;
  overflow: auto;
    transform: translateY(0) scale(1);

}


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

.modal__body {
  display: grid;
  gap: 16px;
}

.modal__body label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

.modal__body input,
.modal__body textarea,
.modal__body select {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text-primary);
  font-family: inherit;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.checklist-form {
  background: var(--surface-muted);
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 10px;
}

.checklist-form__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

.checklist-form__header button {
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 6px 10px;
  cursor: pointer;
}

.checklist-form__item {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto auto;
  align-items: center;
}

.checklist-form__item input[type="text"] {
  width: 100%;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}

.empty-note {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

@media (max-width: 900px) {
  .app__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .app__controls {
    width: 100%;
    flex-wrap: wrap;
    justify-content: space-between;
  }
}


/* When Kanban edit modal is open, neutralize outer modal transform */
body.kanban-inner-open .modal {
  transform: none;
}

/* Inner Kanban modal: true viewport centering */
body.kanban-inner-open .kanban-modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 3000;
}

#kanban-widget button:hover{

    
}