:root {
  --accent: #9a39c6;
  --accent-dark: #7b2ca3;
  --ink: #1f2733;
  --panel: #ffffff;
  --bg: #f3f6f8;
  --border: #dde4ea;
  --ok: #2ea84b;
  --warn: #e07b39;
  --danger: #c62828;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

header.top-bar {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

header.top-bar h1 {
  margin: 0;
  font-size: 1.25rem;
}

header.top-bar .subtitle {
  margin: 2px 0 0;
  font-size: 0.82rem;
  color: #667;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 20px 60px;
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

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

.btn.secondary {
  background: #607d8b;
}

.btn.secondary:hover { background: #4b606b; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 18px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.card h2, .card h3 {
  margin-top: 0;
}

.flash {
  padding: 10px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.flash.success { background: #e6f7ea; color: #206b34; }
.flash.danger  { background: #fdeaea; color: #a12727; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

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

th {
  background: #f8fafb;
  font-weight: 700;
}

tr:hover td { background: #fbf7fd; }

a { color: var(--accent-dark); }

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}

.filters select, .filters input {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.88rem;
}

.new-log-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

form .field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}

form label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #445;
  margin-bottom: 4px;
}

form input[type=text],
form input[type=date],
form input[type=number],
form select,
form textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
}

form textarea { resize: vertical; min-height: 42px; }

.checklist-table td, .checklist-table th { vertical-align: top; }

.checklist-table input[type=text] { width: 100%; }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #fff;
}

.badge.ok { background: var(--ok); }
.badge.warn { background: var(--warn); }
.badge.fail { background: var(--danger); }
.badge.neutral { background: #90a4ae; }

.photo-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.photo-grid a img {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.section-title {
  margin: 26px 0 10px;
  font-size: 1.02rem;
  border-left: 4px solid var(--accent);
  padding-left: 10px;
}

.signature-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.muted { color: #778; font-size: 0.85rem; }

.archived-tag {
  background: #90a4ae;
  color: #fff;
  font-size: 0.7rem;
  padding: 1px 8px;
  border-radius: 999px;
  margin-left: 6px;
}
