:root {
  color-scheme: light dark;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --brand-blue: #10558c;
  --brand-blue-dark: #0d4573;
  --brand-dark: #201e1e;
}

body {
  margin: 0;
  background: #f4f5f7;
  color: #1a1a1a;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background: #fff;
  color: var(--brand-dark);
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.brand { display: flex; align-items: center; gap: 0.75rem; }
.brand img { height: 20px; width: auto; max-width: 140px; display: block; }
.brand-divider { width: 1px; height: 22px; background: #d1d5db; }
.brand-tagline { font-size: 0.95rem; font-weight: 600; color: var(--brand-dark); }

.topbar h1 { margin: 0; font-size: 1.1rem; }
.topbar nav a { color: #4b5563; text-decoration: none; margin-left: 1.25rem; font-size: 0.9rem; }
.topbar nav a:hover { color: var(--brand-blue); }

.layout {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: 1.5rem;
  padding: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
}

.card {
  background: #fff;
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.card label {
  display: block;
  margin-bottom: 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #374151;
}

.card label.checkbox { display: flex; align-items: center; gap: 0.5rem; font-weight: 500; }
.card label.checkbox input { width: auto; }

.card input, .card select {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.5rem;
  font-size: 1rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  box-sizing: border-box;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

#lines-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
#lines-table td { padding: 0.35rem 0; border-bottom: 1px solid #eee; }
#lines-table td:last-child { text-align: right; font-family: ui-monospace, monospace; }

.totals { margin-top: 1rem; border-top: 2px solid var(--brand-dark); padding-top: 0.75rem; }
.totals div { display: flex; justify-content: space-between; padding: 0.3rem 0; }
.totals strong { font-family: ui-monospace, monospace; }

.note { color: #6b7280; font-size: 0.85rem; margin-top: 0.75rem; }

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.auth-card {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  width: 320px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.auth-card .brand-logo { display: block; height: 26px; width: auto; max-width: 160px; margin: 0 auto 1.25rem; }
.auth-card h1 {
  margin-top: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #6b7280;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.auth-card label { display: block; margin-bottom: 0.9rem; font-size: 0.9rem; font-weight: 600; }
.auth-card input {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.55rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  box-sizing: border-box;
}
.auth-card button {
  width: 100%;
  padding: 0.6rem;
  background: var(--brand-blue);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
}
.auth-card button:hover { background: var(--brand-blue-dark); }
.auth-card .error { color: #b91c1c; font-size: 0.9rem; }

.admin-table { width: 100%; border-collapse: collapse; background: #fff; }
.admin-table th, .admin-table td { padding: 0.5rem 0.75rem; border-bottom: 1px solid #eee; text-align: left; font-size: 0.9rem; }
.admin-table th { background: #f9fafb; }
.admin-actions a { margin-right: 0.75rem; color: var(--brand-blue); }

.card button[type="submit"] {
  background: var(--brand-blue);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.55rem 1.1rem;
  font-size: 1rem;
  cursor: pointer;
}
.card button[type="submit"]:hover { background: var(--brand-blue-dark); }
