* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: #1a1a1a;
  background: #f0f0f0;
}
a {
  color: #2563eb;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Login */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
}
.login-box {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  width: 100%;
  max-width: 360px;
}
.login-box h1 {
  margin: 0 0 0.25rem 0;
  font-size: 1.5rem;
}
.login-subtitle {
  margin: 0 0 1.5rem 0;
  color: #666;
}
.login-form label {
  display: block;
  margin-bottom: 1rem;
}
.login-form input {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin-top: 0.25rem;
}
.login-form button {
  width: 100%;
  margin-top: 0.5rem;
}

/* App layout */
.app {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 220px;
  background: #1e3a5f;
  color: #fff;
  padding: 1rem 0;
}
.sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sidebar a {
  display: block;
  padding: 0.6rem 1.25rem;
  color: rgba(255,255,255,0.9);
}
.sidebar a:hover {
  background: rgba(255,255,255,0.1);
  text-decoration: none;
}
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar {
  background: #fff;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid #e5e5e5;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
}
.topbar-user {
  color: #555;
  font-size: 0.9rem;
}
.content {
  flex: 1;
  padding: 1.5rem;
  background: #f5f5f5;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}
.btn-primary {
  background: #2563eb;
  color: #fff;
}
.btn-primary:hover {
  background: #1d4ed8;
}
.btn-secondary {
  background: #e5e7eb;
  color: #374151;
}
.btn-secondary:hover {
  background: #d1d5db;
}
.btn-outline {
  background: transparent;
  border: 1px solid #2563eb;
  color: #2563eb;
}

/* Flash */
.flash {
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}
.flash-success {
  background: #d1fae5;
  color: #065f46;
}
.flash-error {
  background: #fee2e2;
  color: #991b1b;
}
.flash-info {
  background: #dbeafe;
  color: #1e40af;
}
.prep-table .row-excluded {
  background: #f3f4f6;
  color: #6b7280;
}
.prep-table .row-selected {
  background: #dbeafe;
}
.muted {
  color: #6b7280;
  font-size: 0.9rem;
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.card {
  background: #fff;
  padding: 1.25rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.card h3 {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  color: #666;
}
.card-value {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 600;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-top: 1rem;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th,
.data-table td {
  padding: 0.6rem 1rem;
  text-align: left;
  border-bottom: 1px solid #eee;
}
.data-table th {
  background: #f8fafc;
  font-weight: 600;
  font-size: 0.85rem;
}
.data-table .empty {
  color: #888;
  font-style: italic;
  text-align: center;
  padding: 2rem;
}

/* Prep / forms */
.prep-actions {
  margin-bottom: 1.5rem;
}
.upload-block {
  background: #fff;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}
.upload-block h3 {
  margin: 0 0 0.75rem 0;
  font-size: 1rem;
}
.action-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.settings-form label {
  display: block;
  margin-bottom: 1rem;
}
.settings-form input,
.settings-form textarea {
  display: block;
  width: 100%;
  max-width: 480px;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin-top: 0.25rem;
}
.settings-form textarea {
  resize: vertical;
  min-height: 120px;
}
.settings-form h3 {
  margin: 1.5rem 0 0.75rem 0;
}
.settings-form h3:first-child {
  margin-top: 0;
}
.user-form {
  margin: 1rem 0;
  padding: 1rem;
  background: #fff;
  border-radius: 8px;
  max-width: 400px;
}
.user-form label {
  display: block;
  margin-bottom: 0.75rem;
}
.user-form input,
.user-form select {
  margin-left: 0.5rem;
  padding: 0.35rem 0.5rem;
}
.hidden {
  display: none !important;
}
.btn-sm {
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
}
.user-form-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: #f8fafc;
  border-radius: 6px;
}
.user-form-inline label {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.user-form-inline input,
.user-form-inline select {
  padding: 0.35rem 0.5rem;
}
.edit-row td {
  vertical-align: middle;
  border-bottom: 1px solid #eee;
}
