* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f4f6fa;
  color: #1f2937;
  font-size: 14px;
}
a { color: #1a237e; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: #1a237e; color: #fff; padding: 0 24px; height: 52px;
}
.topbar .brand { font-weight: 700; letter-spacing: .5px; }
.topbar nav { display: flex; align-items: center; gap: 18px; }
.topbar nav a { color: #cfd6ff; }
.topbar nav a:hover { color: #fff; }
.topbar .who { color: #9aa6e8; font-size: 12px; }
.topbar .logout { color: #ffb4b4; }
.topbar nav a.lang.active { color: #fff; font-weight: 700; }

main { max-width: 1080px; margin: 24px auto 60px; padding: 0 20px; }
footer { text-align: center; color: #9ca3af; font-size: 12px; padding: 20px 0 40px; }

.card {
  background: #fff; border-radius: 10px; padding: 18px 20px; margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.card.narrow { max-width: 420px; margin: 60px auto; }
h1 { font-size: 17px; margin: 0 0 12px; color: #111827; }
.hint { color: #6b7280; font-size: 12.5px; margin: 6px 0 12px; line-height: 1.6; }

label { display: block; font-size: 12px; color: #6b7280; margin-bottom: 4px; }
input, button, select { font-size: 13px; font-family: inherit; }
input[type=email], input[type=password], input[type=date], input[type=text], select {
  padding: 7px 9px; border: 1px solid #d1d5db; border-radius: 6px; width: 100%;
  background: #fff; color: #111827;
}
input:focus { outline: none; border-color: #5b6ee1; box-shadow: 0 0 0 3px rgba(91,110,225,.12); }

.btn {
  display: inline-block; padding: 7px 14px; border-radius: 6px; border: 1px solid #d1d5db;
  background: #fff; color: #374151; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: #f3f4f6; }
.btn.primary { background: #1a237e; border-color: #1a237e; color: #fff; }
.btn.primary:hover { background: #283593; }
.btn.small { padding: 4px 9px; font-size: 12px; }
.btn.danger { color: #b91c1c; border-color: #fca5a5; }
.btn.danger:hover { background: #fee2e2; }

.row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.row > div { min-width: 160px; }
.row .grow { flex: 1; min-width: 220px; }
.align-end { display: flex; align-items: flex-end; }
.top-gap { margin-top: 14px; }

.flash { border-radius: 8px; padding: 9px 14px; margin-bottom: 14px; font-size: 13px; }
.flash.ok { background: #e8f5e9; color: #1b5e20; border: 1px solid #c8e6c9; }
.flash.error { background: #fdecea; color: #b71c1c; border: 1px solid #f5c6c2; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat { background: #fff; border-radius: 10px; padding: 14px 16px; box-shadow: 0 1px 3px rgba(0,0,0,.08); color: #6b7280; }
.stat span { display: block; font-size: 24px; font-weight: 700; color: #111827; }
.stat.warn span { color: #b45309; }
.stat.danger span { color: #b91c1c; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #eef0f4; vertical-align: middle; }
th { font-size: 12px; color: #6b7280; font-weight: 600; background: #fafbfe; }
tr:hover td { background: #fafbff; }
.empty { text-align: center; color: #9ca3af; padding: 22px; }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.small { font-size: 12px; color: #6b7280; }

.pill { display: inline-block; padding: 1px 9px; border-radius: 10px; font-size: 11px;
        background: #e5e7eb; color: #374151; }
.pill.active { background: #e8f5e9; color: #1b5e20; }
.pill.suspended { background: #fff4e5; color: #b45309; }
.pill.expired { background: #fdecea; color: #b71c1c; }
.pill.revoked { background: #374151; color: #fff; }
.pill.pending { background: #e0e7ff; color: #3730a3; }
.pill.company_suspended { background: #fdecea; color: #b71c1c; }
.pill.invalid { background: #f3f4f6; color: #6b7280; }

.breadcrumb { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 13px; color: #6b7280; }
.results-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.results-header h1 { margin: 0; }

.inline-form { display: flex; gap: 6px; align-items: center; }
.hidden-form { display: none; }
.inline { display: inline; }
.inline-form input[type=email] { min-width: 190px; }
.inline-form input[type=date] { width: 130px; }
.inline-form input[type=password] { min-width: 150px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .topbar { flex-direction: column; height: auto; padding: 10px 16px; gap: 8px; }
  .topbar nav { flex-wrap: wrap; justify-content: center; }
}
