:root {
  color-scheme: light dark;
  --accent: #17458f;
  --accent-gold: #febd11;
  --border: #d8d8d8;
  --error: #b3261e;
  --bg-flash-ok: #e6f4ea;
  --bg-flash-err: #fce8e6;
}

* { box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  color: #1c1c1c;
  background: #fafafa;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background: #ffffff;
  color: var(--accent);
  border-bottom: 3px solid var(--accent-gold);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.topbar .brand {
  font-weight: 600;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--accent);
}
.topbar .brand-logo { height: 36px; width: auto; display: block; }

.topbar nav a {
  color: var(--accent);
  text-decoration: none;
  margin-left: 1rem;
  font-weight: 500;
  opacity: 0.9;
}
.topbar nav a:hover { opacity: 1; text-decoration: underline; }
.topbar nav .user { margin-left: 1rem; opacity: 0.7; font-size: 0.9rem; color: #444; }

.container {
  max-width: 720px;
  margin: 2rem auto;
  padding: 0 1rem 3rem;
}

h1 { margin-top: 0; }

.flash {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
}
.flash-success { background: var(--bg-flash-ok); color: #1e4620; }
.flash-error { background: var(--bg-flash-err); color: var(--error); }

form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 480px;
  margin-bottom: 1.5rem;
}

form.inline-form { flex-direction: row; margin: 0; max-width: none; }

input[type="text"],
input[type="password"],
input[type="number"],
textarea,
select {
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 1rem;
}

input[type="number"] {
  width: 5rem;
}

fieldset {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
}
fieldset label { display: block; margin: 0.4rem 0; font-weight: normal; }

.qty-label {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  max-width: 220px;
  gap: 1rem;
}

button {
  padding: 0.55rem 1.1rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  width: fit-content;
}
button:hover { opacity: 0.9; }

.menu-photo {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
  display: block;
}

.menu-pdf {
  width: 100%;
  height: 70vh;
  min-height: 400px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  display: block;
}

table.results-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}
table.results-table th,
table.results-table td {
  text-align: left;
  padding: 0.5rem;
  border-bottom: 1px solid var(--border);
}

table.results-table .totals-row td {
  font-weight: 600;
  background: rgba(23, 69, 143, 0.08);
  border-bottom: 2px solid var(--accent);
}

@media (prefers-color-scheme: dark) {
  body { background: #16181a; color: #eee; }
  .container { color: #eee; }
  input, textarea, select { background: #24272a; color: #eee; border-color: #3a3d40; }
  fieldset { border-color: #3a3d40; }
  table.results-table th, table.results-table td { border-color: #3a3d40; }
}
