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

:root {
  --bg: #fafafa;
  --fg: #1a1a1a;
  --muted: #666;
  --border: #e0e0e0;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --success-bg: #ecfdf5;
  --success-fg: #065f46;
  --error-bg: #fef2f2;
  --error-fg: #991b1b;
  --card-bg: #fff;
  --nav-bg: #111;
  --radius: 6px;
}

html {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

h1 {
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 0.5rem;
}

/* Nav */
nav.top-nav {
  background: var(--nav-bg);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
nav.top-nav a {
  color: #fff;
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
  opacity: 0.85;
}
nav.top-nav a:hover {
  opacity: 1;
  text-decoration: none;
}
nav.top-nav .brand {
  font-weight: 700;
  font-size: 1rem;
  opacity: 1;
  margin-right: auto;
}

/* Main */
main.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
}

/* Flash */
.flash {
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.flash-notice {
  background: var(--success-bg);
  color: var(--success-fg);
}

/* Errors */
.form-errors {
  background: var(--error-bg);
  color: var(--error-fg);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.form-errors ul {
  margin: 0;
  padding-left: 1.25rem;
}

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}
th, td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
th {
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
td {
  font-size: 0.95rem;
}
tr:last-child td {
  border-bottom: none;
}

/* Cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin: 0.6rem 0;
}
.card small {
  color: var(--muted);
}

/* Forms */
label {
  font-weight: 500;
  font-size: 0.9rem;
  display: block;
  margin-bottom: 0.25rem;
}

input[type="text"],
input[type="date"],
textarea,
select {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 400px;
  background: #fff;
}
input[type="text"]:focus,
input[type="date"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

textarea {
  max-width: 100%;
  resize: vertical;
}

.field {
  margin-bottom: 1rem;
}

input[type="submit"],
.btn {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 1.1rem;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
input[type="submit"]:hover,
.btn:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--bg);
}

/* Stars */
.stars {
  color: #f59e0b;
  letter-spacing: 1px;
}

/* Actions row */
.actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

/* Inline links */
.meta-links {
  font-size: 0.85rem;
  color: var(--muted);
}
.meta-links a {
  color: var(--muted);
}
.meta-links a:hover {
  color: var(--accent);
}
