:root {
  color-scheme: light;
  --bg: #f8fafc;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --green: #15803d;
  --green-dark: #166534;
  --green-bg: #f0fdf4;
  --amber-bg: #fffbeb;
  --amber-text: #b45309;
  --red-bg: #fef2f2;
  --red-text: #b91c1c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

a {
  color: inherit;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.header-inner {
  max-width: 56rem;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
}

.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav a {
  font-size: 0.875rem;
  text-decoration: none;
}

.nav a:hover {
  color: var(--green);
}

.nav-name {
  display: none;
}

@media (min-width: 640px) {
  .nav-name {
    display: inline;
  }
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.page {
  width: 100%;
  max-width: 56rem;
  margin: 0 auto;
  padding: 2rem 1rem;
}

h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
}

h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 1rem;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.8125rem;
}

.center {
  text-align: center;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  margin-top: 1.5rem;
}

.form-card {
  border-top: 3px solid var(--green);
  padding-top: 0;
  overflow: hidden;
}

.form-card-heading {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 0 -1.25rem 1.25rem;
  padding: 1.1rem 1.25rem;
  background: var(--green-bg);
  border-bottom: 1px solid var(--border);
}

.form-card-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.form-card-heading h2 {
  margin: 0 0 0.15rem;
}

.form-card-heading p {
  margin: 0;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

label > input,
label > select {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}

label > input:focus,
label > select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 1px var(--green);
}

.grid-2 {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.btn,
.btn-outline {
  display: inline-block;
  border: none;
  border-radius: 0.375rem;
  padding: 0.55rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

.btn {
  background: var(--green);
  color: #fff;
}

.btn:hover {
  background: var(--green-dark);
}

.btn-outline {
  background: #fff;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.btn-outline:hover {
  background: #f8fafc;
}

.btn-block {
  width: 100%;
  text-align: center;
}

@media (min-width: 640px) {
  .btn-block {
    width: auto;
  }
}

.inline-form {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

.inline-form input[type="text"] {
  flex: 1;
  min-width: 12rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-family: inherit;
}

.alert-error {
  background: var(--red-bg);
  color: var(--red-text);
  padding: 0.6rem 0.9rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.alert-success {
  background: var(--green-bg);
  color: var(--green-dark);
  padding: 0.6rem 0.9rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.list {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.list-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

a.list-card:hover {
  border-color: var(--green);
}

.list-card.static {
  cursor: default;
}

.list-card-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
}

.title {
  font-weight: 500;
  margin: 0 0 0.15rem;
}

.badge {
  background: var(--green-bg);
  color: var(--green-dark);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
}

.badge-amber {
  background: var(--amber-bg);
  color: var(--amber-text);
}

.empty {
  border: 1px dashed #cbd5e1;
  border-radius: 0.75rem;
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
}

.back-link {
  font-size: 0.875rem;
  color: var(--green);
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

.entry-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.15s ease;
}

.entry-card:hover {
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

.entry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.vehicle-pill {
  display: inline-block;
  margin-top: 0.3rem;
  padding: 0.15rem 0.6rem;
  background: #f1f5f9;
  color: #334155;
  border-radius: 0.375rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}

.photos {
  margin-top: 0.85rem;
}

.photos a {
  text-decoration: none;
  display: block;
}

.photo-frame {
  position: relative;
  display: block;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  overflow: hidden;
}

.photo-frame img {
  width: 100%;
  height: 10rem;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}

.photos a:hover .photo-frame img {
  transform: scale(1.04);
}

.photo-zoom {
  position: absolute;
  bottom: 0.4rem;
  right: 0.4rem;
  width: 1.6rem;
  height: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  border-radius: 999px;
  font-size: 0.8rem;
  pointer-events: none;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 2.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.section-header h2 {
  margin: 0;
}

.auth-card {
  width: 100%;
  max-width: 24rem;
  margin: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 2rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.auth-card h1 {
  font-size: 1.25rem;
}

.auth-card form {
  margin-top: 1.5rem;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3rem 1rem 1.5rem;
  z-index: 100;
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 0.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.lightbox-caption {
  color: #f1f5f9;
  font-size: 0.875rem;
  margin: 0;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: none;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  font-size: 1.375rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.24);
}

body.lightbox-open {
  overflow: hidden;
}