/* Tracker list shared bits */
@media (max-width: 640px) {
  .habits-main {
    padding-left: 0;
    padding-right: 0;
  }
}
.tracker-avatar {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(119, 136, 115, 0.25);
  background: rgba(255, 255, 255, 0.65);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  flex-shrink: 0;
}
.tracker-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* -------------------------------
   Analytics dashboard styles in use
--------------------------------*/
.analytics-shell {
  display: grid;
  gap: 14px;
}
.is-hidden {
  display: none !important;
}
.panel-card {
  background: #fff;
  border: 1px solid var(--progio-border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 10px 28px rgba(47, 53, 36, 0.08);
}
.panel-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.panel-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.bulk-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.bulk-actions__btn {
  font-size: 0.78rem;
  line-height: 1;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(119, 136, 115, 0.35);
  background: rgba(255, 255, 255, 0.9);
  color: rgba(27, 39, 21, 0.85);
  font-weight: 800;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background-color 0.12s ease;
  box-shadow: 0 8px 16px rgba(16, 24, 40, 0.08);
}
.bulk-actions__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(16, 24, 40, 0.12);
}
.bulk-actions__btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.bulk-actions__btn--danger {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.panel-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--progio-ink);
}
.panel-subtitle {
  font-size: 0.9rem;
  color: var(--progio-olive);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #f3f6ec;
  border: 1px solid var(--progio-border);
  color: var(--progio-forest);
  font-weight: 700;
  font-size: 0.85rem;
}
.pill--soft {
  background: #fff5ef;
  border-color: rgba(255, 122, 47, 0.24);
  color: #e5671f;
}
.pill--ghost {
  background: #ffffff;
  border-color: rgba(119, 136, 115, 0.35);
  color: #374151;
}
.pill--muted {
  background: #f9faf3;
  color: #6b7280;
  border-style: dashed;
}
.panel-hint {
  font-size: 0.9rem;
  color: #6b7280;
  margin-top: 2px;
}
.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  gap: 14px;
  align-items: start;
}
.main-column,
.side-column {
  display: grid;
  gap: 12px;
  align-items: start;
}
.panel-card--hero {
  box-shadow: 0 14px 32px rgba(47, 53, 36, 0.08);
  border-color: rgba(119, 136, 115, 0.24);
}
.stacked-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-height: none;
  overflow-y: visible;
  padding: 0 4px 4px;
}

.stacked-row {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "meta"
    "progress";
  gap: 12px;
  align-items: start;
  padding: 12px 14px 14px;
  border-radius: 14px;
  transition: border-color 0.18s ease, box-shadow 0.24s ease, transform 0.12s ease, background-color 0.18s ease;
  cursor: pointer;
  border: 1px solid rgba(119, 136, 115, 0.24);
  background: linear-gradient(180deg, #ffffff 0%, #fbfcf7 100%);
  box-shadow: 0 3px 10px rgba(16, 24, 40, 0.05);
  position: relative;
  overflow: hidden;
}
.stacked-row--create {
  text-decoration: none;
  text-align: center;
  place-items: center;
}
.stacked-row > * {
  position: relative;
  z-index: 1;
}
.stacked-row__spark {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.52;
  filter: saturate(1.02) contrast(1.02);
}
.stacked-row__select {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(119, 136, 115, 0.28);
  background: rgba(255, 255, 255, 0.92);
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease, border-color 0.12s ease, background-color 0.12s ease;
}
.stacked-row__mini-progress {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  --ring: #2f8f57;
  --track: rgba(47, 143, 87, 0.18);
  box-shadow: none;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: rgba(27, 39, 21, 0.8);
  z-index: 2;
}
.stacked-row__mini-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.stacked-row__mini-ring-track,
.stacked-row__mini-ring-progress {
  fill: none;
  stroke-width: 4.6;
}
.stacked-row__mini-ring-track {
  stroke: var(--track);
}
.stacked-row__mini-ring-progress {
  stroke: var(--ring);
  stroke-dasharray: 100;
  stroke-dashoffset: calc(100 - var(--p, 0));
  stroke-linecap: round;
}
.stacked-row__mini-progress span {
  position: relative;
  z-index: 1;
}
.stacked-row__checkbox {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
}
.stacked-row__checkmark {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 2px solid rgba(119, 136, 115, 0.6);
  background: #fff;
  box-sizing: border-box;
  position: relative;
}
.stacked-row.is-selected .stacked-row__select {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.15);
}
.stacked-row.is-selected {
  border-color: rgba(34, 197, 94, 0.4);
  background: linear-gradient(180deg, #f4fff8 0%, #ffffff 100%);
  box-shadow: 0 10px 22px rgba(34, 197, 94, 0.12);
}
.stacked-row.is-selected .stacked-row__checkmark {
  border-color: #16a34a;
  background: #22c55e;
}
.stacked-row.is-selected .stacked-row__checkmark::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 9px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  left: 3px;
  top: 0px;
  transform: rotate(45deg);
}
:root[data-tracker-select] .stacked-row__select {
  opacity: 1;
  pointer-events: auto;
}
:root[data-tracker-select] .stacked-row__mini-progress {
  opacity: 0;
  pointer-events: none;
}
.stacked-row__delete-form {
  display: none;
}
.stacked-row__meta {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  grid-area: meta;
  min-width: 0;
}
.stacked-row__title {
  font-weight: 800;
  color: var(--progio-ink);
  font-size: 1.08rem;
}
.stacked-row__trend {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-weight: 800;
  font-size: 0.88rem;
  letter-spacing: 0.01em;
}
.stacked-row__trend-label {
  font-weight: 700;
  font-size: 0.72rem;
  color: rgba(46, 53, 36, 0.55);
}
.stacked-row__trend-icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.stacked-row__trend-icon svg {
  width: 12px;
  height: 12px;
}
.stacked-row__trend--up {
  color: #16a34a;
}
.stacked-row__trend--up .stacked-row__trend-icon {
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  box-shadow: 0 6px 12px rgba(22, 163, 74, 0.25);
}
.stacked-row__trend--down {
  color: #dc2626;
}
.stacked-row__trend--down .stacked-row__trend-icon {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 6px 12px rgba(220, 38, 38, 0.25);
}
.stacked-row__subtitle {
  display: none;
}
.stacked-row__submeta {
  display: none;
}
.stacked-row__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(119, 136, 115, 0.22);
  background: rgba(247, 248, 236, 0.82);
  color: rgba(27, 39, 21, 0.76);
  font-weight: 800;
  font-size: 0.78rem;
}
.stacked-tile-meta {
  display: grid;
  gap: 4px;
  margin-top: -2px;
}
.tile-meta-line {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  color: rgba(27, 39, 21, 0.62);
  font-weight: 800;
  font-size: 0.74rem;
  line-height: 1.2;
  flex-wrap: wrap;
}
.tile-meta-dot {
  display: none;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(119, 136, 115, 0.35);
  flex: 0 0 auto;
}
.tile-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.tile-meta-item::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(119, 136, 115, 0.25);
  box-shadow: 0 0 0 3px rgba(119, 136, 115, 0.10);
}
.tile-meta-item--time::before {
  background: rgba(168, 85, 247, 0.55);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.14);
}
.tile-meta-item--uploads::before {
  background: rgba(34, 197, 94, 0.55);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.14);
}
.stacked-row__muted {
  color: rgba(27, 39, 21, 0.55);
  font-weight: 700;
  font-size: 0.8rem;
}
.stacked-row__value {
  display: grid;
  justify-items: end;
  align-items: center;
  gap: 4px;
}
.stacked-row__action {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  color: #e5671f;
  font-weight: 700;
  text-align: right;
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
}
.stacked-row__action form {
  margin: 0;
}
.stacked-row__icon-btn {
  appearance: none;
  width: 34px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.1rem;
  line-height: 1;
  transition: transform 0.12s ease, background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.stacked-row__icon-btn--danger {
  border: 1px solid rgba(220, 38, 38, 0.28);
  background: rgba(220, 38, 38, 0.06);
  color: #b91c1c;
}
.stacked-row__icon-btn--danger:hover {
  background: rgba(220, 38, 38, 0.18);
  border-color: rgba(220, 38, 38, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(220, 38, 38, 0.12);
}
.stacked-row__icon-btn--danger:focus-visible {
  outline: 2px solid rgba(220, 38, 38, 0.35);
  outline-offset: 2px;
}
.stacked-row__cta {
  font-weight: 700;
  font-size: 1rem;
  color: #e5671f;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.stacked-row__cta::after {
  content: "\2197";
  font-size: 0.85rem;
}
.stacked-row:hover {
  border-color: rgba(229, 103, 31, 0.35);
  box-shadow: 0 10px 24px rgba(229, 103, 31, 0.08);
  background: linear-gradient(180deg, #fff8f2 0%, #ffffff 100%);
}
.stacked-row.stacked-row--danger-hover,
.stacked-row.stacked-row--danger-hover:hover {
  border-color: rgba(220, 38, 38, 0.45);
  box-shadow: 0 10px 24px rgba(229, 103, 31, 0.08);
  background: linear-gradient(180deg, rgba(254, 242, 242, 1) 0%, #ffffff 100%);
}
.stacked-row:active {
  transform: translateY(0);
}
.stacked-row:focus-within {
  outline: none;
}
.stacked-row__cta {
  font-size: 1rem;
  color: #e5671f;
  font-weight: 700;
}
.stacked-row:hover {
  border: 1px solid rgba(255, 122, 47, 0.26);
  background: #fff9f3;
  box-shadow: 0 12px 24px rgba(47, 53, 36, 0.08);
  transform: translateY(0);
}
.stacked-row:focus-visible {
  outline: 2px solid #ff7a2f;
  outline-offset: 2px;
  border-color: rgba(255, 122, 47, 0.32);
  box-shadow: 0 12px 24px rgba(47, 53, 36, 0.12);
}
.activity-list {
  display: grid;
  gap: 8px;
}
.activity-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--progio-border);
  background: linear-gradient(180deg, #ffffff 0%, #fbfcf7 100%);
  box-shadow: 0 6px 16px rgba(47, 53, 36, 0.08);
}
.activity-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff7a2f;
  box-shadow: 0 0 0 4px rgba(255, 122, 47, 0.12);
}
.activity-title {
  font-weight: 800;
  color: var(--progio-ink);
}
.activity-meta {
  display: grid;
  gap: 2px;
}
.activity-progress {
  display: grid;
  gap: 2px;
  justify-items: end;
  text-align: right;
}
.activity-percent {
  font-weight: 800;
  color: #2e3524;
}
.tracker-avatar--chip {
  width: 50px;
  height: 50px;
}

@media (max-width: 1024px) {
  .stacked-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .stacked-list {
    grid-template-columns: 1fr;
  }
  .stacked-row {
    padding: 12px;
  }
  .stacked-row__spark {
    opacity: 0.46;
  }
}

@media (max-width: 1024px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .panel-card {
    padding: 12px;
  }
  .stacked-list {
    max-height: none;
    min-height: 0;
  }
  .stacked-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "meta action"
      "progress progress";
    gap: 10px;
    padding: 12px;
  }
  .stacked-row__meta { grid-area: meta; }
  .stacked-row__progress { grid-area: progress; }
  .stacked-row__action { grid-area: action; }
  .stacked-row__mini-progress {
    position: static;
    width: 100%;
    height: auto;
    border-radius: 999px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(47, 143, 87, 0.18);
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    place-items: stretch;
    gap: 10px;
    box-shadow: 0 6px 12px rgba(47, 53, 36, 0.08);
    grid-area: progress;
  }
  .stacked-row__mini-progress::before {
    content: "";
    height: 8px;
    border-radius: 999px;
    background: var(--track);
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    z-index: 0;
  }
  .stacked-row__mini-progress::after {
    content: "";
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, #2f8f57, #4bbf7a);
    width: calc(var(--p, 0) * 1%);
    max-width: 100%;
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    z-index: 1;
  }
  .stacked-row__mini-ring {
    display: none;
  }
  .stacked-row__mini-progress span {
    justify-self: end;
    font-size: 0.78rem;
  }
}
