:root {
  color-scheme: light dark;
  --primary: #3b82f6;
  --primary-dark: #1e40af;
  --border: #e5e7eb;
  --muted: #6b7280;
}

@media (prefers-color-scheme: dark) {
  :root {
    --border: #374151;
    --muted: #9ca3af;
  }
}

* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  margin: 0;
  padding: 16px;
  line-height: 1.5;
}

.app-container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Typography */
h1, h2, h3 {
  margin-top: 0;
  margin-bottom: 1rem;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Buttons */
.btn,
button,
input[type="submit"],
input[type="button"] {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  font: inherit;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
}

.btn-secondary {
  background-color: var(--muted);
  color: white;
}

.btn-secondary:hover {
  background-color: #4b5563;
}

.btn-sm {
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
}

/* Forms */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
textarea,
select {
  display: block;
  width: 100%;
  padding: 0.5rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font: inherit;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

/* Alerts */
.alert {
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.alert-success {
  background-color: #dcfce7;
  color: #166534;
}

@media (prefers-color-scheme: dark) {
  .alert-success {
    background-color: #064e3b;
    color: #d1fae5;
  }
}

.alert-danger {
  background-color: #fee2e2;
  color: #991b1b;
}

@media (prefers-color-scheme: dark) {
  .alert-danger {
    background-color: #7f1d1d;
    color: #fecaca;
  }
}

.alert-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  color: inherit;
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.table thead th {
  border-bottom: 2px solid var(--border);
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
}

.table tbody td {
  border-bottom: 1px solid var(--border);
  padding: 0.75rem;
}

/* Utilities */
.text-muted {
  color: var(--muted);
}

.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }

@media (max-width: 768px) {
  body {
    padding: 12px;
  }

  h1 {
    font-size: 1.5rem;
  }
}
