:root {
  --blue: #1a5f7a;
  --blue-dark: #124456;
  --green: #2e7d4f;
  --red: #b3261e;
  --amber: #a66a00;
  --bg: #f4f6f7;
  --card: #ffffff;
  --border: #d9e0e3;
  --text: #1b2630;
  --muted: #5c6b73;
  font-size: 16px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  background: var(--blue-dark);
  color: #fff;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.topbar .brand { font-weight: 700; font-size: 1.1rem; }
.topbar .who { font-size: 0.85rem; opacity: 0.9; }
.topbar a { color: #fff; }

nav.tabs {
  background: var(--blue);
  display: flex;
  overflow-x: auto;
  white-space: nowrap;
}
nav.tabs a {
  color: #fff;
  padding: 0.6rem 0.9rem;
  font-size: 0.92rem;
  display: inline-block;
}
nav.tabs a.active { background: var(--blue-dark); font-weight: 600; }

.container { max-width: 980px; margin: 0 auto; padding: 1rem; }
.auth-container { max-width: 420px; margin: 3rem auto; padding: 1rem; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
}
h1 { font-size: 1.4rem; margin: 0.2rem 0 1rem; }
h2 { font-size: 1.15rem; margin: 0.2rem 0 0.7rem; }
h3 { font-size: 1rem; margin: 0.2rem 0 0.5rem; }

label { display: block; font-weight: 600; font-size: 0.88rem; margin: 0.6rem 0 0.25rem; }
input, select, textarea {
  width: 100%;
  padding: 0.55rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  background: #fff;
  color: var(--text);
}
textarea { min-height: 90px; }

.btn {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  font-size: 0.95rem;
  cursor: pointer;
  margin-top: 0.6rem;
}
.btn:hover { background: var(--blue-dark); }
.btn.secondary { background: #e7ebed; color: var(--text); }
.btn.secondary:hover { background: #d9e0e3; }
.btn.danger { background: var(--red); }
.btn.small { padding: 0.35rem 0.65rem; font-size: 0.82rem; margin-top: 0; }

.error-box { background: #fdecea; border: 1px solid var(--red); color: var(--red); padding: 0.6rem; border-radius: 6px; margin-bottom: 0.8rem; font-size: 0.9rem; }
.notice-box { background: #e8f3ec; border: 1px solid var(--green); color: var(--green); padding: 0.6rem; border-radius: 6px; margin-bottom: 0.8rem; font-size: 0.9rem; }

table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.5rem 0.4rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; }

.badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.badge.gray { background: #e7ebed; color: var(--muted); }
.badge.blue { background: #dceaf0; color: var(--blue-dark); }
.badge.green { background: #dff0e5; color: var(--green); }
.badge.red { background: #fbe0de; color: var(--red); }
.badge.amber { background: #faf0dc; color: var(--amber); }

.grid { display: grid; gap: 0.8rem; }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 680px) {
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
  .container { padding: 0.6rem; }
  table, thead, tbody, th, td, tr { display: block; }
  thead { display: none; }
  tr { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 0.6rem; padding: 0.4rem; }
  td { border: none; padding: 0.25rem 0.2rem; }
  td::before { content: attr(data-label); font-weight: 600; color: var(--muted); display: block; font-size: 0.72rem; text-transform: uppercase; }
}

.muted { color: var(--muted); font-size: 0.88rem; }
.flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.stat { text-align: center; padding: 0.8rem; }
.stat .num { font-size: 1.7rem; font-weight: 700; color: var(--blue-dark); }
.stat .label { font-size: 0.8rem; color: var(--muted); }
code { background: #eef1f2; padding: 0.1rem 0.3rem; border-radius: 4px; }
