* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #fafaf7;
  color: #1c1c1b;
  line-height: 1.5;
}

.header {
  background: #324654;
  color: #fafaf7;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.header h1 { font-size: 1.25rem; font-weight: 600; }

.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e0ddd6;
  padding: 0 2rem;
  background: #fff;
}
.tab {
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  border: none;
  background: none;
  font-size: 0.9rem;
  color: #666;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.tab:hover { color: #1c1c1b; }
.tab.active { color: #324654; border-bottom-color: #324654; font-weight: 600; }

.content { padding: 2rem; max-width: 1100px; }

.panel { display: none; }
.panel.active { display: block; }

.card {
  background: #fff;
  border: 1px solid #e0ddd6;
  border-radius: 6px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

h2 { font-size: 1.1rem; margin-bottom: 1rem; }
h3 { font-size: 0.95rem; margin-bottom: 0.75rem; }

.form-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.form-group { display: flex; flex-direction: column; gap: 0.25rem; }
.form-group label { font-size: 0.8rem; color: #666; }
.form-group input, .form-group select, .form-group textarea {
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9rem;
  font-family: inherit;
}
.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: #324654;
}

button.primary {
  background: #324654;
  color: #fff;
  border: none;
  padding: 0.5rem 1.25rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
}
button.primary:hover { background: #263a47; }

button.secondary {
  background: #fff;
  color: #324654;
  border: 1px solid #324654;
  padding: 0.4rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
}
button.secondary:hover { background: #f0efe9; }

button.danger {
  background: #fff;
  color: #b33;
  border: 1px solid #b33;
  padding: 0.4rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
}
button.danger:hover { background: #fef0f0; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
th { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 2px solid #e0ddd6; color: #666; font-weight: 600; }
td { padding: 0.5rem 0.75rem; border-bottom: 1px solid #e0ddd6; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge.active { background: #e6f4e6; color: #2a6e2a; }
.badge.revoked { background: #fef0f0; color: #b33; }
.badge.expired { background: #fff3e0; color: #995500; }
.badge.tracking-full { background: #e8edf1; color: #324654; }
.badge.tracking-basic { background: #f5f0e6; color: #7a6b3a; }
.badge.tracking-none { background: #f0f0f0; color: #888; }
.badge.method-email { background: #e8edf1; color: #324654; }
.badge.method-domain { background: #e3ecf5; color: #2f5573; }
.badge.method-open { background: #fdf3e3; color: #8a6d1f; }
.badge.method-public { background: #fce8e8; color: #b3382f; }
.badge.method-pin { background: #ece6f5; color: #5a3f8a; }
.muted { color: #bbb; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: #fff;
  border: 1px solid #e0ddd6;
  border-radius: 6px;
  padding: 1rem;
  text-align: center;
}
.stat-card .value { font-size: 1.75rem; font-weight: 700; color: #324654; }
.stat-card .label { font-size: 0.8rem; color: #666; margin-top: 0.25rem; }

.bar-chart { margin: 1rem 0; }
.bar-row {
  display: flex;
  align-items: center;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
}
.bar-label { width: 80px; text-align: right; padding-right: 0.75rem; color: #666; flex-shrink: 0; }
.bar-track { flex: 1; background: #e0ddd6; border-radius: 3px; height: 22px; position: relative; }
.bar-fill { background: #324654; border-radius: 3px; height: 100%; min-width: 2px; transition: width 0.3s; }
.bar-value { position: absolute; right: 6px; top: 2px; font-size: 0.75rem; color: #666; }

.empty { color: #999; font-style: italic; padding: 2rem; text-align: center; }
.copied { color: #2a6e2a; font-size: 0.8rem; margin-left: 0.5rem; }
.error { color: #b33; font-size: 0.85rem; margin-top: 0.5rem; }
.loading { color: #666; font-style: italic; }
