:root {
  --bg: #0A0F1E;
  --bg-alt: #111827;
  --card: #1a2237;
  --card-hover: #232d47;
  --border: rgba(148, 163, 184, 0.15);
  --text: #F1F5F9;
  --text-muted: #94A3B8;
  --accent: #4F46E5;
  --accent-light: #6366F1;
  --error: #EF4444;
  --error-bg: rgba(239, 68, 68, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(79, 70, 229, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.08) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
}

.site-header,
.container,
.login-card,
.viewer-header {
  position: relative;
  z-index: 1;
}

.site-header,
.viewer-header {
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner,
.viewer-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
}

.brand h1,
.viewer-title h1 {
  font-size: 1.1rem;
  font-weight: 600;
}

.brand p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-badge {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 6px 12px;
  background: var(--card);
  border-radius: 999px;
  border: 1px solid var(--border);
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.page-intro {
  margin-bottom: 32px;
}

.page-intro h2 {
  font-size: 1.75rem;
  margin-bottom: 8px;
}

.page-intro p {
  color: var(--text-muted);
  max-width: 640px;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.report-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.report-card:hover {
  background: var(--card-hover);
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-2px);
}

.report-category {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-light);
  background: rgba(99, 102, 241, 0.12);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.report-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  line-height: 1.4;
}

.report-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.report-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.report-link {
  color: var(--accent-light);
  font-weight: 500;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  width: 100%;
}

.btn-primary:hover {
  background: var(--accent-light);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--card);
  color: var(--text);
}

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px 32px;
}

.login-brand {
  text-align: center;
  margin-bottom: 32px;
}

.login-brand .brand-icon {
  margin: 0 auto 16px;
}

.login-brand h1 {
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.login-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-form label span {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.login-form input {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.login-form input:focus {
  border-color: var(--accent-light);
}

.alert {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.alert-error {
  background: var(--error-bg);
  color: #FCA5A5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.empty-state {
  padding: 48px;
  text-align: center;
  color: var(--text-muted);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.viewer-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.viewer-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.viewer-title {
  min-width: 0;
}

.viewer-title h1 {
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.report-frame {
  flex: 1;
  width: 100%;
  border: none;
  background: #0A0F1E;
}

@media (max-width: 768px) {
  .header-inner,
  .viewer-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .viewer-nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .report-grid {
    grid-template-columns: 1fr;
  }
}
