/* Reporting admin — palette from GB-Fingerprint landing */
:root {
  --dark: #0f3d6e;
  --brand: #1a6eb5;
  --light: #e8f0f8;
  --accent: #00b4d8;
  --white: #ffffff;
  --ink: #1a2332;
  --muted: #5a6578;
  --dark-2: #0a2d52;
  --shadow: 0 4px 24px rgba(15, 61, 110, 0.08);
  --shadow-lg: 0 12px 48px rgba(15, 61, 110, 0.14);
  --radius: 12px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--accent); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, opacity 0.2s;
}

.btn:hover:not(:disabled) { transform: translateY(-1px); }

.btn--primary {
  background: var(--accent);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(0, 180, 216, 0.35);
  width: 100%;
}

.btn--primary:hover:not(:disabled) {
  background: #00a0c0;
  box-shadow: 0 6px 24px rgba(0, 180, 216, 0.45);
}

.btn--primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* ── Login ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    linear-gradient(
      135deg,
      rgba(15, 61, 110, 0.92) 0%,
      rgba(15, 61, 110, 0.78) 50%,
      rgba(26, 110, 181, 0.72) 100%
    ),
    linear-gradient(160deg, var(--dark) 0%, var(--dark-2) 100%);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: var(--shadow-lg);
}

.login-card__brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--dark);
}

.login-card__mark {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 800;
}

.login-card__title {
  text-align: center;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--dark);
  margin: 16px 0 8px;
  letter-spacing: -0.02em;
}

.login-card__subtitle {
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 28px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 8px;
}

.form-group input {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--light);
  border: 1px solid rgba(15, 61, 110, 0.12);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.18);
  background: var(--white);
}

.form-group input.invalid {
  border-color: #d64545;
}

.field-error {
  display: none;
  margin-top: 6px;
  font-size: 0.8rem;
  color: #d64545;
}

.field-error.visible { display: block; }

.login-error {
  display: none;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: #fdecec;
  border-left: 4px solid #d64545;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #a32020;
}

.login-error.visible { display: block; }

/* ── Index layout ── */
.app-page {
  min-height: 100vh;
  display: flex;
  background: var(--light);
}

.sidebar {
  width: 200px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--dark) 0%, var(--dark-2) 100%);
  color: var(--white);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 100vh;
}

.sidebar__brand {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  text-align: center;
  padding: 4px 0 8px;
}

.env-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.env-btn,
.literal-btn {
  width: 100%;
  padding: 10px 8px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: transparent;
  color: rgba(232, 240, 248, 0.85);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.env-btn:hover,
.literal-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.env-btn.is-selected,
.literal-btn.is-selected {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(0, 180, 216, 0.35);
}

.literal-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  flex: 1;
  padding-right: 2px;
}

.literal-btn {
  text-align: left;
  padding: 10px 10px;
  line-height: 1.3;
  word-break: break-word;
}

.main {
  flex: 1;
  min-width: 0;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.main__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.main__title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--dark);
  letter-spacing: -0.02em;
}

.main__meta {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 20px;
  flex: 1;
  min-height: 0;
}

.chart-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 18px 12px;
  display: flex;
  flex-direction: column;
  min-height: 280px;
}

.chart-card__title {
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--dark);
}

.chart-card__canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 220px;
}

.status-banner {
  display: none;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--white);
  border-left: 4px solid var(--brand);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.status-banner.visible { display: block; }
.status-banner.is-error {
  border-left-color: #d64545;
  color: #a32020;
  background: #fdecec;
}

@media (max-width: 1100px) {
  .charts-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
}

@media (max-width: 720px) {
  .app-page { flex-direction: column; }
  .sidebar {
    width: 100%;
    min-height: auto;
  }
  .literal-list {
    max-height: 220px;
  }
}
