:root {
  --navy: #1e3a5f;
  --navy-dark: #14273f;
  --accent: #2f7a4f;
  --gray-bg: #f4f6f8;
  --border: #dde3e8;
  --text: #24313f;
  --text-muted: #64748b;
  --red: #b3261e;
  --orange: #b5680c;
  --green: #2f7a4f;
  --gray: #5f6b76;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--gray-bg);
  color: var(--text);
}
a { color: var(--navy); }
.topbar {
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.5rem;
}
.topbar .brand { font-weight: 600; font-size: 1.05rem; }
.topbar nav a {
  color: #dce6f0;
  text-decoration: none;
  margin-left: 1.2rem;
  font-size: 0.92rem;
}
.topbar nav a:hover { color: #fff; text-decoration: underline; }
.topbar .userinfo { font-size: 0.85rem; color: #b9c9da; }
.container {
  max-width: 1150px;
  margin: 0 auto;
  padding: 1.8rem 1.5rem 3rem;
}
h1 { font-size: 1.5rem; margin: 0 0 1.2rem; }
h2 { font-size: 1.15rem; margin: 1.8rem 0 0.8rem; }
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem 1.4rem;
  margin-bottom: 1.2rem;
}
.stats-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.stat-box {
  flex: 1;
  min-width: 140px;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--navy);
  border-radius: 6px;
  padding: 0.9rem 1.1rem;
}
.stat-box .num { font-size: 1.6rem; font-weight: 700; }
.stat-box .label { font-size: 0.82rem; color: var(--text-muted); }
.stat-box.red { border-left-color: var(--red); }
.stat-box.orange { border-left-color: var(--orange); }
.stat-box.green { border-left-color: var(--green); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--border); text-align: left; }
th { background: #eef1f4; font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.02em; color: var(--text-muted); }
tr:hover td { background: #fafbfc; }
.badge {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #fff;
}
.badge-green { background: var(--green); }
.badge-orange { background: var(--orange); }
.badge-red { background: var(--red); }
.badge-gray { background: var(--gray); }
form .field { margin-bottom: 1rem; }
label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.3rem; }
input, select, textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.92rem;
  font-family: inherit;
}
textarea { min-height: 70px; }
.btn {
  display: inline-block;
  background: var(--navy);
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--navy-dark); }
.btn.secondary { background: #fff; color: var(--navy); border: 1px solid var(--navy); }
.btn.danger { background: var(--red); }
.btn.small { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.alert { padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: 0.9rem; }
.alert-error { background: #fdecea; color: var(--red); border: 1px solid #f5c6c2; }
.alert-success { background: #eaf6ee; color: var(--green); border: 1px solid #bfe3ca; }
.filters { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 1rem; align-items: end; }
.filters .field { margin-bottom: 0; min-width: 150px; }
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy), var(--navy-dark));
}
.login-card {
  background: #fff;
  border-radius: 10px;
  padding: 2.2rem 2rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}
.login-card h1 { text-align: center; font-size: 1.2rem; margin-bottom: 1.5rem; }
.muted { color: var(--text-muted); font-size: 0.85rem; }
@media (max-width: 700px) {
  .grid-2 { grid-template-columns: 1fr; }
  table, thead, tbody, th, td, tr { display: block; }
  thead { display: none; }
  tr { margin-bottom: 0.8rem; border: 1px solid var(--border); border-radius: 6px; }
  td { border: none; padding: 0.4rem 0.7rem; }
  td::before { content: attr(data-label); font-weight: 600; display: block; font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; }
}
