:root {
  --bg: #ffffff;
  --bg-secondary: #f5f5f5;
  --text: #1a1a1a;
  --text-secondary: #666666;
  --border: #e0e0e0;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --success: #16a34a;
  --warning: #d97706;
  --radius: 6px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "SF Mono", Monaco, "Cascadia Code", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1a1a;
    --bg-secondary: #2a2a2a;
    --text: #e5e5e5;
    --text-secondary: #999999;
    --border: #404040;
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --danger: #ef4444;
    --danger-hover: #f87171;
    --success: #22c55e;
    --warning: #fbbf24;
  }
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.container { max-width: 960px; margin: 0 auto; padding: 2rem 1rem; }

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: var(--danger-hover); }
.btn-small { padding: 0.25rem 0.5rem; font-size: 0.75rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

input, select {
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 0.875rem;
  font-family: var(--font);
  width: 100%;
}

input:focus, select:focus { outline: 2px solid var(--primary); outline-offset: -1px; }

label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.25rem; }

.form-group { margin-bottom: 1rem; }

table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th, td { padding: 0.5rem; text-align: left; border-bottom: 1px solid var(--border); }
th { font-weight: 600; color: var(--text-secondary); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }

.badge { display: inline-block; padding: 0.125rem 0.5rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 500; }
.badge-active { background: #dcfce7; color: #166534; }
.badge-expired { background: #fef3c7; color: #92400e; }
.badge-deleted { background: #fee2e2; color: #991b1b; }
.badge-revoked { background: #fee2e2; color: #991b1b; }

@media (prefers-color-scheme: dark) {
  .badge-active { background: #166534; color: #dcfce7; }
  .badge-expired { background: #92400e; color: #fef3c7; }
  .badge-deleted { background: #991b1b; color: #fee2e2; }
  .badge-revoked { background: #991b1b; color: #fee2e2; }
}

.progress-bar { width: 100%; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; margin: 0.5rem 0; }
.progress-bar-fill { height: 100%; background: var(--primary); transition: width 0.3s; }

.drop-zone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 2rem; text-align: center; cursor: pointer; transition: border-color 0.15s; }
.drop-zone.drag-over { border-color: var(--primary); background: rgba(37, 99, 235, 0.05); }

.hidden { display: none !important; }
.text-secondary { color: var(--text-secondary); }
.text-small { font-size: 0.75rem; }
.text-mono { font-family: var(--mono); }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

.flex { display: flex; }
.flex-between { justify-content: space-between; }
.flex-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

.download-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.download-card { width: 100%; max-width: 420px; }
.brand { font-size: 0.875rem; color: var(--text-secondary); text-align: center; margin-bottom: 1.5rem; }

.alert { padding: 0.75rem 1rem; border-radius: var(--radius); font-size: 0.875rem; margin-bottom: 1rem; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }

@media (prefers-color-scheme: dark) {
  .alert-warning { background: #451a03; color: #fde68a; border-color: #78350f; }
  .alert-error { background: #450a0a; color: #fecaca; border-color: #7f1d1d; }
  .alert-success { background: #052e16; color: #bbf7d0; border-color: #166534; }
}
