:root {
  --accent: #1f2937;
  --bg: #f5f6f8;
  --card: #ffffff;
  --border: #dfe3e8;
  --text: #1f2937;
  --muted: #6b7280;
  --danger: #b42318;
  --success: #0f7b3c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

header.topnav {
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

header.topnav .brand {
  font-weight: 700;
  font-size: 1.15rem;
}

header.topnav nav a {
  color: #fff;
  text-decoration: none;
  margin-right: 1rem;
  opacity: 0.9;
  font-size: 0.95rem;
}

header.topnav nav a:hover { opacity: 1; text-decoration: underline; }

header.topnav .user-box { font-size: 0.9rem; opacity: 0.9; }

main.content {
  max-width: 1100px;
  margin: 1.5rem auto;
  padding: 0 1rem;
}

footer.sitefooter {
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

h1, h2, h3 { margin-top: 0; }

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

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

th { background: #f0f1f3; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge.pending { background: #fef3c7; color: #92400e; }
.badge.printing { background: #dbeafe; color: #1e40af; }
.badge.done { background: #dcfce7; color: #166534; }
.badge.delivered { background: #e5e7eb; color: #374151; }

form.inline { display: inline; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

label { font-size: 0.85rem; color: var(--muted); display: block; margin-bottom: 0.2rem; }

input, select, button, textarea {
  font: inherit;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 100%;
}

button {
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  width: auto;
  padding: 0.5rem 1rem;
}

button:hover { opacity: 0.9; }

button.secondary { background: #6b7280; }
button.danger { background: var(--danger); }

.flash {
  padding: 0.6rem 0.9rem;
  border-radius: 6px;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.flash.success { background: #dcfce7; color: #166534; }
.flash.error { background: #fee2e2; color: #991b1b; }

.row-table th, .row-table td { padding: 0.4rem; }

.text-right { text-align: right; }
.text-muted { color: var(--muted); }
.mt-1 { margin-top: 1rem; }

a.button-link {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9rem;
}
