/* ===== SHARED CHECKLIST CARD =====
   Dashboard checklist chrome aligned with the landing showcase language
   (public/landing/style.css .checklist-card): soft surface, larger radius,
   success-tinted glow, icon-led header, green completion. Purple stays
   reserved for interactive CTAs (Edit / Mark Complete / selection chips). */

.checklists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-5, 20px);
}

.checklist-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--space-6, 24px);
  box-shadow: var(--shadow-card), var(--shadow-card-glow);
  transition:
    border-color 0.2s ease,
    box-shadow 0.25s ease,
    transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  --card-status-accent: var(--status-due);
  overflow: hidden;
}

.checklist-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-status-accent);
  pointer-events: none;
  z-index: 1;
}

.checklist-card:hover {
  border-color: color-mix(in srgb, var(--success) 35%, var(--border));
  box-shadow: var(--shadow-card-hover), 0 0 56px rgba(var(--success-rgb), 0.16);
  transform: translateY(-2px);
}

.checklist-card.is-complete {
  --card-status-accent: var(--status-complete);
  box-shadow:
    var(--shadow-card),
    0 0 48px rgba(var(--status-complete-rgb), 0.18);
}

.checklist-card.is-overdue {
  --card-status-accent: var(--status-overdue);
  box-shadow:
    var(--shadow-card),
    0 0 40px rgba(var(--status-overdue-rgb), 0.16);
}

.checklist-card.is-in-progress {
  --card-status-accent: var(--status-progress);
  box-shadow:
    var(--shadow-card),
    0 0 40px rgba(var(--status-progress-rgb), 0.14);
}

.checklist-card.is-due {
  --card-status-accent: var(--status-due);
}

@media (prefers-reduced-motion: reduce) {
  .checklist-card,
  .checklist-card:hover {
    transition: border-color 0.15s;
    transform: none;
  }
}

/* ----- Header ----- */
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3, 12px);
  margin-bottom: var(--space-3, 12px);
}

.card-name-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.card-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--success) 15%, transparent);
  color: var(--success);
}

.card-icon--purple {
  background: color-mix(in srgb, var(--brand) 15%, transparent);
  color: var(--brand-light);
}

.card-name {
  font-weight: 600;
  font-size: var(--text-base, 1rem);
  color: var(--text);
  line-height: 1.3;
}

.card-schedule {
  font-family: var(--font-mono);
  font-size: var(--text-xs, 0.75rem);
  color: var(--text-muted);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.card-schedule--recur {
  color: var(--success);
  background: color-mix(in srgb, var(--success) 10%, transparent);
  border-color: color-mix(in srgb, var(--success) 28%, transparent);
}

.card-schedule--meta {
  opacity: 0.9;
  font-weight: 400;
}

.card-assignee {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-assignee svg {
  flex-shrink: 0;
  opacity: 0.85;
}

.card-archived-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--danger);
  background: rgba(var(--danger-rgb), 0.1);
  border: 1px solid rgba(var(--danger-rgb), 0.3);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.card-sample-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--brand-light);
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  cursor: help;
}

.card-status-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
}

.card-status-badge--complete {
  color: var(--status-complete);
  background: rgba(var(--status-complete-rgb), 0.12);
  border-color: rgba(var(--status-complete-rgb), 0.35);
}

.card-status-badge--overdue {
  color: var(--status-overdue);
  background: rgba(var(--status-overdue-rgb), 0.12);
  border-color: rgba(var(--status-overdue-rgb), 0.35);
}

.card-status-badge--progress {
  color: var(--status-progress);
  background: rgba(var(--status-progress-rgb), 0.12);
  border-color: rgba(var(--status-progress-rgb), 0.35);
}

.card-actions {
  display: flex;
  gap: 6px;
  margin-bottom: var(--space-4, 16px);
}

.card-action-link {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  background: none;
  cursor: pointer;
}

.card-action-link:hover {
  border-color: var(--brand-light);
  color: var(--text);
  background: rgba(var(--brand-rgb), 0.08);
}

/* ----- Progress ----- */
.card-progress {
  font-family: var(--font-mono);
  font-size: var(--text-xs, 0.75rem);
  color: var(--text-muted);
  margin-bottom: var(--space-4, 16px);
}

.card-progress .accent {
  color: var(--success);
  font-weight: 600;
}

.card-progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: var(--radius-full);
  margin-top: 8px;
  overflow: hidden;
}

.card-progress-fill {
  height: 100%;
  background: var(--success);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.checklist-card.is-complete .card-progress-fill,
.checklist-card.is-complete .exec-ring__fill {
  background: var(--status-complete);
  stroke: var(--status-complete);
}

.checklist-card.is-overdue .card-progress-fill,
.checklist-card.is-overdue .exec-ring__fill {
  background: var(--status-overdue);
  stroke: var(--status-overdue);
}

.checklist-card.is-in-progress .card-progress-fill,
.checklist-card.is-in-progress .exec-ring__fill {
  background: var(--status-progress);
  stroke: var(--status-progress);
}

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

/* ----- Items ----- */
.item-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.item-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  border: 1px solid transparent;
  user-select: none;
}

.item-row:hover {
  background: var(--surface-raised);
  border-color: var(--border);
}

.item-row.pending {
  opacity: 0.55;
}

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

.item-checkbox {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.item-checkbox-input:checked ~ .item-checkbox {
  background: var(--success);
  border-color: var(--success);
}

.item-checkbox-input:checked ~ .item-checkbox svg {
  display: block;
}

.item-checkbox svg {
  display: none;
}

.item-checkbox-input:focus-visible ~ .item-checkbox {
  box-shadow: 0 0 0 2px rgba(var(--success-rgb), 0.45);
}

.item-checkbox-input:checked ~ .item-text {
  color: var(--text-muted);
  text-decoration: line-through;
}

.item-text {
  font-size: var(--text-sm, 0.9rem);
  flex: 1;
  color: var(--text);
}

/* ----- Footer ----- */
.card-footer {
  margin-top: var(--space-4, 16px);
  padding-top: var(--space-4, 16px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-complete {
  background: var(--brand);
  color: var(--bg);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.btn-complete:hover {
  background: var(--brand-dim);
  box-shadow: 0 6px 16px rgba(var(--brand-rgb), 0.28);
}

.btn-complete:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.completed-badge {
  font-family: var(--font-mono);
  font-size: var(--text-xs, 0.75rem);
  color: var(--status-complete);
  font-weight: 500;
}

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