/* ── Tasks Surface Styles ────────────────── */

.tasks-app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Header ──────────────────────────────── */
.tasks-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-shrink: 0;
}
.tasks-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}
.tasks-stats {
  font-size: 13px;
  color: var(--text-3);
}
.tasks-header__right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.tasks-view-tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-raised);
  border-radius: var(--radius);
  padding: 2px;
}
.tasks-view-tab {
  padding: 5px 14px;
  font-size: 13px;
  border: none;
  background: transparent;
  color: var(--text-2);
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  transition: var(--transition);
}
.tasks-view-tab:hover { color: var(--text); background: var(--bg-hover); }
.tasks-view-tab--active { color: var(--text); background: var(--bg-surface); }

/* ── List View ───────────────────────────── */
.task-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.task-list__filters {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-shrink: 0;
}
.task-filter {
  padding: 5px 10px;
  font-size: 13px;
  background: var(--bg-raised);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.task-list__count {
  font-size: 12px;
  color: var(--text-3);
}
.task-list__loading, .task-list__empty {
  display: flex;
  justify-content: center;
  padding: 40px 0;
  color: var(--text-3);
  font-size: 14px;
}

/* ── Task Card ───────────────────────────── */
.task-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  transition: var(--transition);
}
.task-card:hover {
  border-color: var(--border-light);
  background: var(--bg-raised);
}
.task-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.task-card__priority { font-size: 10px; }
.task-card__title {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}
.task-card__title:hover { color: var(--accent); }
.task-card__status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}
.task-card__status--todo        { background: var(--accent-dim); color: var(--accent); }
.task-card__status--in_progress { background: var(--warning-dim); color: var(--warning); }
.task-card__status--done        { background: var(--success-dim); color: var(--success); }
.task-card__status--cancelled   { background: var(--bg-raised); color: var(--text-3); }

.task-card__desc {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 6px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-card__footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-3);
}
.task-card__actions {
  margin-left: auto;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: var(--transition);
}
.task-card:hover .task-card__actions { opacity: 1; }

/* ── Inline buttons ──────────────────────── */
.task-btn {
  border: none;
  background: var(--bg-raised);
  color: var(--text-2);
  cursor: pointer;
  border-radius: var(--radius);
  transition: var(--transition);
}
.task-btn--sm { padding: 2px 8px; font-size: 13px; }
.task-btn:hover { background: var(--bg-hover); color: var(--text); }
.task-btn--danger:hover { background: var(--danger-dim); color: var(--danger); }

/* ── Board View ──────────────────────────── */
.task-board {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
}
.task-board__col {
  background: var(--bg-raised);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.task-board__col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.task-board__col-count {
  font-size: 11px;
  color: var(--text-3);
  background: var(--bg-hover);
  padding: 1px 7px;
  border-radius: 10px;
}
.task-board__col-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.task-board__card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  cursor: pointer;
  transition: var(--transition);
}
.task-board__card:hover {
  border-color: var(--accent);
}
.task-board__card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.task-board__card-due {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
}

/* ── Form ────────────────────────────────── */
.task-form { display: flex; flex-direction: column; gap: 12px; }
.task-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.task-form__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.task-form textarea,
.task-form input,
.task-form select {
  width: 100%;
  padding: 7px 10px;
  font-size: 13px;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
}
.task-form textarea:focus,
.task-form input:focus,
.task-form select:focus {
  outline: none;
  border-color: var(--accent);
}

/* ── Statusbar widget ────────────────────── */
.task-status-widget {
  font-size: 12px;
  color: var(--text-3);
  padding: 4px 10px;
}

/* ── Slot containers ─────────────────────── */
.sw-slot {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sw-slot--statusbar {
  padding: 4px 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-3);
  flex-shrink: 0;
}
.sw-slot--toolbar {
  padding: 4px 12px;
  flex-shrink: 0;
}
