* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #eef2f6;
  color: #1c2733;
}

a { color: #1f6feb; }

.topnav {
  background: #14283d;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  flex-wrap: wrap;
}

.topnav a {
  color: #cdd9e6;
  text-decoration: none;
  padding: 14px 4px;
  font-size: 0.95rem;
}

.topnav a:hover { color: #fff; }
.topnav .brand { font-weight: 700; color: #fff; margin-right: 12px; }
.topnav .right { margin-left: auto; }

main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px 18px 48px;
}

h1 { font-size: 1.4rem; }
h2 { font-size: 1.1rem; color: #3a4b5e; }

.card {
  background: #fff;
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.stats { display: flex; flex-wrap: wrap; gap: 14px; }

.stat {
  background: #fff;
  border-radius: 10px;
  padding: 16px 20px;
  min-width: 130px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.stat .num { font-size: 1.9rem; font-weight: 700; }
.stat .lbl { color: #6b7a8d; font-size: 0.85rem; }
.stat.alert .num { color: #c0392b; }

a.stat { text-decoration: none; color: inherit; display: block; }
.stat.clickable { cursor: pointer; transition: box-shadow 0.12s ease; }
.stat.clickable:hover { box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18); }

table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #e3e9ef; }
th { color: #6b7a8d; font-weight: 600; }
tr:hover td { background: #f6f9fc; }

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 600;
  background: #e3e9ef;
  color: #3a4b5e;
}
.pill.flag { background: #fbdcd9; color: #842029; }
.pill.full { background: #fde7d3; color: #7a3e00; }
.pill.ok { background: #d8f3df; color: #0f5132; }
.pill.no { background: #fbdcd9; color: #842029; }

label { display: block; font-size: 0.85rem; color: #6b7a8d; margin: 10px 0 4px; }

input, select, textarea {
  font: inherit;
  padding: 9px 10px;
  border: 1px solid #c7d0da;
  border-radius: 7px;
  width: 100%;
}

.row-fields { display: flex; flex-wrap: wrap; gap: 12px; }
.row-fields > div { flex: 1; min-width: 140px; }

button, .btn {
  font: inherit;
  padding: 9px 16px;
  border: 0;
  border-radius: 7px;
  background: #1f6feb;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button.secondary, .btn.secondary { background: #5b6b7d; }
button.danger, .btn.danger { background: #c0392b; }
button.small, .btn.small { padding: 5px 10px; font-size: 0.85rem; }

.flash {
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-weight: 600;
}
.flash.ok { background: #d8f3df; color: #0f5132; }
.flash.err { background: #fbdcd9; color: #842029; }

.qr-pair { display: flex; flex-wrap: wrap; gap: 24px; }
.qr-box { text-align: center; }
.qr-box img { width: 200px; height: 200px; border: 1px solid #e3e9ef; }

.login-wrap {
  max-width: 360px;
  margin: 80px auto;
  padding: 0 18px;
}

.muted { color: #6b7a8d; font-size: 0.88rem; }
.inline-form { display: inline; }
