:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
  --warning: #d97706;
  --ok: #16a34a;
  --bg: #f4f6fb;
  --card-bg: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 32px 20px;
  text-align: center;
}

.app-header h1 { margin: 0 0 6px; font-size: 2rem; }
.app-header p { margin: 0; opacity: 0.9; }

.container {
  max-width: 900px;
  margin: -20px auto 40px;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.card {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
  padding: 24px;
}

.card h2 { margin-top: 0; }

.form-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 14px;
}

.form-row label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--muted);
}

.form-row input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
}

button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  font-weight: 600;
}

button:hover { background: var(--primary-dark); }

button.secondary {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

button.secondary:hover { background: #eef2ff; }

.msg { min-height: 20px; font-size: 0.9rem; }

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

th { color: var(--muted); font-weight: 600; }

.empty { text-align: center; color: var(--muted); padding: 20px; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
}

.badge.ok { background: var(--ok); }
.badge.warning { background: var(--warning); }
.badge.danger { background: var(--danger); }

.row-actions { display: flex; gap: 6px; }
.row-actions button { padding: 6px 10px; font-size: 0.8rem; }
.row-actions button.delete { background: var(--danger); }
.row-actions button.delete:hover { background: #b91c1c; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.hidden { display: none; }

.modal-content {
  background: white;
  padding: 24px;
  border-radius: 12px;
  width: 300px;
}

.modal-content label {
  font-size: 0.85rem;
  color: var(--muted);
  display: block;
  margin: 10px 0 4px;
}

.modal-content input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
