:root {
  --navy: #0e1c59;
  --blue: #0067b1;
  --bg: #f3f5f9;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --danger: #b91c1c;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-top: 4.75rem;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
}
.topbar a { color: #fff; }
.brand { font-weight: 700; letter-spacing: 0.02em; }
.topbar-meta { font-size: 0.875rem; opacity: 0.9; display: flex; gap: 1rem; align-items: center; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 8px 24px rgba(14, 28, 89, 0.06);
}

.login-page {
  min-height: calc(100vh - 4.75rem);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #0e1c59, #0067b1);
  padding: 1.5rem;
}
.login-card { width: 100%; max-width: 400px; }
.login-card h1 { margin: 0 0 0.25rem; color: var(--navy); }
.login-card p.sub { margin: 0 0 1.25rem; color: var(--muted); }

.alert-fixed {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: #fff7ed;
  color: #7c2d12;
  border-bottom: 3px solid #f59e0b;
  padding: 0.8rem 1.25rem;
  box-shadow: 0 10px 24px rgba(124, 45, 18, 0.12);
}
.alert-fixed-icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: #f59e0b;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.alert-fixed-body strong {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 0.15rem;
}
.alert-fixed-body p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  max-width: 72rem;
}

label { display: block; font-size: 0.875rem; font-weight: 600; margin-bottom: 0.35rem; }
input, select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  font-size: 1rem;
  margin-bottom: 0.9rem;
}
button, .btn {
  display: inline-block;
  background: var(--navy);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 0.65rem 1rem;
  font-weight: 600;
  cursor: pointer;
}
button:hover, .btn:hover { background: var(--blue); text-decoration: none; }
.btn-ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.4); }

.error {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.filters {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 1rem;
}
.filters input, .filters select { margin: 0; }
.muted { color: var(--muted); font-size: 0.875rem; }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.7rem 0.55rem; border-bottom: 1px solid var(--border); }
th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
tr:hover td { background: #f8fafc; }
.click-row { cursor: pointer; }

.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 1rem; }

pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 10px;
  overflow: auto;
  font-size: 0.85rem;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.meta-item { background: #f8fafc; border-radius: 8px; padding: 0.75rem; }
.meta-item span { display: block; color: var(--muted); font-size: 0.75rem; text-transform: uppercase; }
.meta-item strong { font-size: 0.95rem; }

@media (max-width: 900px) {
  body { padding-top: 6.5rem; }
  .login-page { min-height: calc(100vh - 6.5rem); }
  .filters { grid-template-columns: 1fr 1fr; }
  table { font-size: 0.8rem; }
}
