:root {
  --brand: #1f3864;
  --brand-light: #edf2f8;
  --green: #1a7f37;
  --green-bg: #d9f2e3;
  --yellow: #9a6700;
  --yellow-bg: #fff3cd;
  --red: #b3261e;
  --red-bg: #fbdede;
  --border: #dde3ea;
  --text: #1c2530;
  --muted: #6b7684;
}
* { box-sizing: border-box; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  background: #f5f7fa;
  color: var(--text);
}
header.topbar {
  background: var(--brand);
  color: white;
  padding: 10px 24px;
}
.topbar-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.topbar .brand { font-weight: 700; font-size: 17px; white-space: nowrap; }
.topbar select, .topbar input[type="search"] {
  padding: 6px 10px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.1); color: white; font-size: 13px;
}
.topbar select option { color: #111; }
.topbar input[type="search"]::placeholder { color: rgba(255,255,255,0.7); }
.topbar-user { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.role-pill { background: rgba(255,255,255,0.15); padding: 2px 9px; border-radius: 999px; font-size: 11.5px; }
.topbar form.logout button {
  background: transparent; border: 1px solid rgba(255,255,255,0.4); color: white;
  padding: 5px 10px; border-radius: 6px; cursor: pointer; font-size: 12.5px;
}
nav.tabs { display: flex; gap: 3px; flex-wrap: wrap; padding: 8px 24px 0; background: var(--brand); }
nav.tabs a {
  color: rgba(255,255,255,0.82); text-decoration: none; padding: 8px 12px;
  border-radius: 8px 8px 0 0; font-size: 13.5px;
}
nav.tabs a.active { background: #f5f7fa; color: var(--brand); font-weight: 600; }
nav.tabs a:hover:not(.active) { background: rgba(255,255,255,0.12); color: white; }
main { max-width: 1180px; margin: 26px auto; padding: 0 20px 60px; }
h1 { font-size: 22px; margin: 0 0 18px; }
h2 { font-size: 17px; margin: 26px 0 10px; }
.card {
  background: white; border: 1px solid var(--border); border-radius: 10px;
  padding: 18px 20px; margin-bottom: 18px;
}
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 11px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
tr:hover td { background: #fafbfc; }
a.btn, button.btn {
  display: inline-block; background: var(--brand); color: white; border: none;
  padding: 9px 16px; border-radius: 7px; text-decoration: none; font-size: 14px; cursor: pointer;
}
a.btn.secondary, button.btn.secondary { background: white; color: var(--brand); border: 1px solid var(--brand); }
a.btn.danger, button.btn.danger { background: white; color: var(--red); border: 1px solid var(--red); }
a.btn.small, button.btn.small { padding: 5px 10px; font-size: 12.5px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-yellow { background: var(--yellow-bg); color: var(--yellow); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-grey { background: #eceff3; color: var(--muted); }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 24px; }
.kpi { background: white; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.kpi .num { font-size: 24px; font-weight: 700; color: var(--brand); }
.kpi .label { font-size: 12px; color: var(--muted); margin-top: 4px; }
.kpi.red .num { color: var(--red); }
.kpi.yellow .num { color: var(--yellow); }
.kpi.green .num { color: var(--green); }
a.kpi { display: block; text-decoration: none; color: inherit; }
a.kpi:hover { border-color: var(--brand); box-shadow: 0 1px 4px rgba(31, 56, 100, 0.15); }
form.inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; min-width: 180px;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 20px; }
.muted { color: var(--muted); font-size: 13px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.filters a { padding: 6px 12px; border-radius: 999px; font-size: 13px; text-decoration: none; border: 1px solid var(--border); color: var(--text); }
.filters a.active { background: var(--brand); color: white; border-color: var(--brand); }
.actions-cell { display: flex; gap: 8px; flex-wrap: wrap; }
.small { font-size: 12px; }
.section-tabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.section-tabs a { padding: 7px 14px; border-radius: 8px; text-decoration: none; font-size: 13.5px; border: 1px solid var(--border); color: var(--text); background: white; }
.section-tabs a.active { background: var(--brand); color: white; border-color: var(--brand); }
.notes-list { list-style: none; margin: 0; padding: 0; }
.notes-list li { padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.notes-list .meta { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.checkbox-list { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.checkbox-list label { font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.login-wrap { max-width: 380px; margin: 90px auto; }
.login-card { background: white; border: 1px solid var(--border); border-radius: 12px; padding: 32px; }
.login-card h1 { text-align: center; }
.error-box { background: var(--red-bg); color: var(--red); padding: 10px 14px; border-radius: 8px; font-size: 13.5px; margin-bottom: 14px; }
.info-box { background: var(--brand-light); color: var(--brand); padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.demo-creds { font-size: 12px; color: var(--muted); margin-top: 18px; text-align: center; line-height: 1.6; }
.company-tag { font-size: 11.5px; color: var(--muted); background: #eceff3; padding: 2px 8px; border-radius: 999px; }
