* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin: 0;
  padding: 0;
  background: #f5f5f5;
  color: #333;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #ddd;
}

h1 {
  margin: 0;
  font-size: 28px;
}

.scan-btn {
  padding: 10px 20px;
  font-size: 14px;
  background: #0066cc;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.scan-btn:hover {
  background: #0052a3;
}

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

.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 1px solid #ddd;
}

.tab-btn {
  padding: 10px 16px;
  font-size: 14px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  color: #666;
}

.tab-btn.active {
  color: #0066cc;
  border-bottom-color: #0066cc;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* List view */
.subscriptions-list {
  display: grid;
  gap: 20px;
}

.month-section {
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
}

.month-header {
  padding: 16px;
  background: #f9f9f9;
  border-bottom: 1px solid #ddd;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.month-header h3 {
  margin: 0;
  font-size: 16px;
}

.month-header .count {
  font-size: 12px;
  color: #999;
  font-weight: normal;
}

.month-content {
  padding: 12px;
  display: grid;
  gap: 12px;
}

.sub-card {
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: start;
}

.sub-card-main {
  flex: 1;
}

.sub-name {
  font-weight: 600;
  font-size: 16px;
  margin: 0 0 4px 0;
}

.sub-vendor {
  font-size: 12px;
  color: #999;
  margin: 0 0 8px 0;
}

.sub-description {
  font-size: 13px;
  color: #666;
  margin-bottom: 8px;
}

.sub-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
}

.sub-chip {
  display: inline-block;
  padding: 4px 8px;
  background: #f0f0f0;
  border-radius: 4px;
  font-size: 12px;
  color: #666;
}

.sub-status {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.sub-status.active {
  background: #d4edda;
  color: #155724;
}

.sub-status.trial {
  background: #fff3cd;
  color: #856404;
}

.sub-card-right {
  text-align: right;
  min-width: 100px;
}

.sub-price {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 4px;
}

.sub-monthly {
  font-size: 12px;
  color: #999;
}

.sub-trial-warning {
  margin-top: 8px;
  padding: 8px;
  background: #fff3cd;
  border-left: 3px solid #ffc107;
  border-radius: 4px;
  font-size: 12px;
  color: #856404;
}

/* Summary & breakdown */
.summary-box {
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  display: grid;
  gap: 20px;
}

.summary-item {
  text-align: center;
  padding: 16px;
  background: #f9f9f9;
  border-radius: 6px;
  border: 1px solid #eee;
}

.summary-label {
  font-size: 12px;
  color: #999;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.summary-value {
  font-size: 24px;
  font-weight: 600;
  margin: 8px 0;
}

.categories-list {
  display: grid;
  gap: 12px;
}

.category-card {
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.category-name {
  font-weight: 600;
  font-size: 16px;
}

.category-stats {
  text-align: right;
}

.category-monthly {
  font-size: 18px;
  font-weight: 600;
}

.category-count {
  font-size: 12px;
  color: #999;
}

.empty {
  text-align: center;
  padding: 40px 20px;
  color: #999;
}

.loading {
  text-align: center;
  padding: 20px;
  color: #999;
}
