/* cards */
.card {
  background: #fff;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.summary-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.summary-card {
  padding: 16px;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
}

.summary-card-clickable {
  text-decoration: none;
  color: inherit;
  display: block;
  cursor: pointer;
  transition: all 0.2s;
}

.summary-card-clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.summary-card .label {
  font-size: 14px;
}

.summary-card .amount {
  font-size: 24px;
}

.income {
  color: #00c284;
}

.expense {
  color: #f87171;
}

.balance {
  color: #60a5fa;
}

/* category page header */
.category-page-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.category-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-icon-sm {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.category-icon-sm svg {
  width: 32px;
  height: 32px;
}

/* category card */
.categories-row {
  display: flex;
  gap: 6px;

  overflow-x: auto;
  overflow-y: hidden;

  white-space: nowrap;
  padding-bottom: 14px;
}

.category-card {
  flex-shrink: 0;
  padding: 8px;
  border-radius: 8px;
  text-align: center;
  text-decoration: none;
  color: #44403c;
  transition: opacity 0.15s;
}

.category-card:hover .category-icon svg,
.category-card:hover .category-card-amount {
  color: var(--cat-color);
}

.category-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 6px;
  color: #666;
}

.category-icon svg {
  width: 64px;
  height: 64px;
}

.category-card-amount {
  font-size: 16px;
  font-weight: 600;
  color: #666;
}

.categories-row::-webkit-scrollbar {
  height: 4px;
}

.categories-row::-webkit-scrollbar-thumb {
  background: #d4cfc8;
  border-radius: 4px;
}

.tag-badge {
  color: #fff;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  min-width: 32px;
  text-align: center;
  background: #3B82F6;
}

.tag-badge-expense {
  background: #f87171;
}

.tag-badge-income {
  background: #00c284;
}

.tag-badge-unused {
  background: #9ca3af;
}

.tag-list-container {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #ddd;
  overflow: hidden;
}

.tag-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}

.tag-list-row:last-child {
  border-bottom: none;
}

.tag-list-row:hover {
  background: #f9fafb;
}

.tag-list-name {
  flex: 1;
  font-weight: 500;
}

.tag-list-amount {
  color: #6b7280;
  font-size: 14px;
}


/* Tags list */
.tags-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tags-list .card {
  cursor: pointer;
  transition: box-shadow 0.2s;
}

.tags-list .card:hover {
  box-shadow: 0 4px 6px rgba(0,0,0,0.15);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

/* Tag details sidebar statistics */
.stats-list {
  display: flex;
  flex-direction: column;
}

.stats-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #e0e0e0;
}

.stats-list-item:last-child {
  border-bottom: none;
}

.stats-list-value {
  font-weight: 600;
  font-size: 16px;
}

.form-actions {
  max-width: 364px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.form-actions-end {
  justify-content: flex-end;
}

.form-actions .text-link {
  color: #000;
  text-decoration: none;
}

.button-group {
  display: flex;
  gap: 8px;
}

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

.stat-card {
  background: #f9fafb;
  padding: 12px;
  border-radius: 6px;
}

.stat-card .label {
  font-size: 12px;
  margin-bottom: 4px;
}

.stat-card .value {
  font-size: 20px;
  font-weight: 600;
}

.transactions-list {
  max-height: 400px;
  overflow-y: auto;
}

.transaction-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #e0e0e0;
  gap: 12px;
}

.transaction-item:last-child {
  border-bottom: none;
}

.transaction-item > div {
  flex: 1;
}

.transaction-item > div:last-child {
  text-align: right;
  font-weight: 600;
}

/* Category summary list */
.category-list-container {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #ddd;
  overflow: hidden;
  padding: 0 16px;
}

.category-summary-list {
  display: flex;
  flex-direction: column;
}

.category-summary-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #e8e8e8;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}

.category-summary-row:last-child {
  border-bottom: none;
}

.category-summary-row:hover {
  background: #f9fafb;
}

.category-summary-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: flex-start;
}

.category-summary-icon svg {
  width: 32px;
  height: 32px;
}

.category-summary-name {
  flex: 1;
  font-weight: 500;
  line-height: 1.4;
}

.category-summary-amount {
  text-align: right;
  line-height: 1.4;
}