
:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --text: #142033;
  --muted: #64748b;
  --line: #dbe3ec;
  --accent: #b7791f;
  --blue: #2563eb;
  --green: #16803c;
  --red: #c0392b;
  --dark: #10233f;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.hidden { display: none !important; }
.screen { min-height: 100vh; }
#loginView {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 430px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 36px;
  box-shadow: 0 12px 34px rgba(16,35,63,.08);
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent);
}
h1 { margin: 8px 0 6px; font-size: 28px; }
h2 { margin: 0 0 14px; font-size: 20px; }
.subtitle { color: var(--muted); margin: 0 0 28px; }
label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin: 16px 0 7px;
}
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 13px;
  font-size: 15px;
  background: #fff;
}
button {
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  font-weight: 700;
  cursor: pointer;
}
.primary { background: var(--dark); color: #fff; }
.secondary { background: #e9eef5; color: var(--dark); }
.login-card .primary { width: 100%; margin-top: 22px; }
.message { min-height: 20px; margin-top: 12px; color: var(--muted); font-size: 14px; }
.message.error { color: var(--red); }
.message.success { color: var(--green); }

.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.topbar h1 { font-size: 22px; }
.user-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}
.content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px;
  display: grid;
  gap: 28px;
}
.search-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}
.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 12px;
}
.kpi-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  cursor: pointer;
  text-align: left;
}
.kpi-card:hover { border-color: #9fb1c5; }
.kpi-label { color: var(--muted); font-size: 13px; }
.kpi-value { font-size: 28px; font-weight: 800; margin-top: 5px; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.result-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
}
.result-title { font-weight: 800; font-size: 17px; }
.result-meta {
  margin-top: 8px;
  color: var(--muted);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 7px 18px;
  font-size: 14px;
}
.badge {
  display: inline-block;
  border-radius: 999px;
  background: #edf2f7;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
}
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
}
th, td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
  vertical-align: top;
}
th { background: #f8fafc; }

@media (max-width: 700px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .user-actions { width: 100%; justify-content: space-between; }
  .content { padding: 18px; }
  .search-row { grid-template-columns: 1fr; }
}
