.ui-card,
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
}

.icon-slot {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  min-height: 22px;
  border-radius: 999px;
  color: currentColor;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.sidebar-link .icon-slot,
.stat-card-icon,
.topbar-icon {
  background: #f3f5fa;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.card-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.card-title {
  margin: 0;
  color: #0f172a;
  font-size: 15.5px;
  line-height: 20px;
  font-weight: 700;
  letter-spacing: -0.005em;
}

.card-badge {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #f0f3f8;
  color: #64748b;
  font-size: 11px;
  font-weight: 650;
}

.card-description {
  margin: 7px 0 0;
  color: #536174;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 400;
}

.button,
.checkbox-button,
.period-select {
  border: 1px solid var(--card-border);
  border-radius: 10px;
  background: #ffffff;
  color: #1f2937;
  min-height: 36px;
  padding: 0 14px;
  font-weight: 600;
}

.button-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.button-primary:hover {
  background: var(--accent-strong);
}

.button-secondary:hover,
.checkbox-button:hover,
.period-select:hover {
  border-color: #c7d0de;
  background: #fbfcff;
}

.button-danger {
  border-color: #fecdd3;
  background: var(--danger-soft);
  color: #e11d48;
}

.button-disabled {
  cursor: default;
  opacity: 0.48;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 150px;
  color: var(--text-soft);
  text-align: center;
}

.inline-link {
  align-self: flex-start;
  margin-top: auto;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  font-weight: 650;
  padding: 0;
}

.loading-card,
.error-card {
  padding: 22px;
  border-radius: var(--radius-lg);
  background: #ffffff;
  border: 1px solid var(--card-border);
  color: var(--text-muted);
}


/* App modal confirmation */
.app-confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 38%, rgba(139, 92, 246, 0.22), transparent 34%),
    rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.16s ease;
}

.app-confirm-backdrop.is-visible {
  opacity: 1;
}

.app-confirm-backdrop.is-closing {
  opacity: 0;
}

.app-confirm-card {
  width: min(520px, 100%);
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 16px;
  border: 1px solid rgba(221, 227, 238, 0.92);
  border-radius: 24px;
  background:
    radial-gradient(circle at 14% 0%, rgba(109, 69, 245, 0.10), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.22);
  padding: 20px;
  transform: translateY(8px) scale(0.985);
  transition: transform 0.16s ease;
}

.app-confirm-backdrop.is-visible .app-confirm-card {
  transform: translateY(0) scale(1);
}

.app-confirm-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: rgba(109, 69, 245, 0.10);
  color: #6d45f5;
  font-size: 22px;
  line-height: 1;
  font-weight: 900;
  font-family: Arial, sans-serif;
}

.app-confirm-tone-danger .app-confirm-icon {
  background: rgba(239, 68, 68, 0.10);
  color: #ef4444;
}

.app-confirm-copy {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.app-confirm-title {
  margin: 0;
  color: #0f172a;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.app-confirm-message {
  display: grid;
  gap: 6px;
  color: #52617a;
  font-size: 13.5px;
  line-height: 1.48;
  font-weight: 500;
}

.app-confirm-message p {
  margin: 0;
}

.app-confirm-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.app-confirm-btn {
  min-height: 42px;
  border-radius: 14px;
  padding: 0 16px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.app-confirm-btn:hover {
  transform: translateY(-1px);
}

.app-confirm-btn-secondary {
  background: #ffffff;
  border-color: #dfe6f1;
  color: #52617a;
}

.app-confirm-btn-secondary:hover {
  border-color: #cbd5e1;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.app-confirm-btn-primary {
  background: linear-gradient(135deg, #6d45f5 0%, #8b5cf6 100%);
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(109, 69, 245, 0.22);
}

.app-confirm-tone-danger .app-confirm-btn-primary {
  background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
  box-shadow: 0 12px 28px rgba(239, 68, 68, 0.22);
}

@media (max-width: 560px) {
  .app-confirm-card {
    grid-template-columns: 1fr;
  }

  .app-confirm-actions {
    flex-direction: column-reverse;
  }

  .app-confirm-btn {
    width: 100%;
  }
}
