:root {
  --bg-0: #05130f;
  --bg-1: #081f18;
  --ink: #eef7f0;
  --ink-dim: #b9c9c0;
  --green: #6fbf73;
  --green-soft: #9fd6a3;
  --gold: #d9b56a;
  --card: rgba(255, 255, 255, 0.045);
  --card-border: rgba(255, 255, 255, 0.09);
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: radial-gradient(ellipse at 50% -10%, #0e3126 0%, var(--bg-1) 45%, var(--bg-0) 100%);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  overflow-x: hidden;
}

#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 56px 20px 80px;
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  margin-bottom: 56px;
  max-width: 640px;
}

.hero__emblem {
  position: relative;
  width: 148px;
  height: 148px;
  margin: 0 auto 22px;
}

.hero__emblem-glow {
  position: absolute;
  inset: -30px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(159, 214, 163, 0.35) 0%, rgba(217, 181, 106, 0.12) 45%, transparent 70%);
  filter: blur(6px);
  animation: pulse 4.5s ease-in-out infinite;
}

.hero__emblem img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid rgba(217, 181, 106, 0.55);
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.03), 0 18px 40px rgba(0, 0, 0, 0.45);
  animation: float 6s ease-in-out infinite;
  background: #fff;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

.hero__title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  letter-spacing: 0.5px;
  margin: 0 0 8px;
  background: linear-gradient(180deg, #ffffff 0%, var(--green-soft) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__tagline {
  margin: 0 0 14px;
  color: var(--ink-dim);
  font-size: 1.05rem;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid rgba(217, 181, 106, 0.35);
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(217, 181, 106, 0.06);
}

/* ---------- Grid ---------- */
.doc-grid {
  width: 100%;
  max-width: 1100px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}

.doc-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 26px 24px 22px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  animation: rise 0.6s ease both;
  animation-delay: var(--delay, 0ms);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.doc-card:hover {
  transform: translateY(-4px);
  border-color: rgba(159, 214, 163, 0.4);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(159, 214, 163, 0.08);
}

.doc-card__icon {
  width: 46px;
  height: 46px;
  margin-bottom: 14px;
  color: var(--green-soft);
}
.doc-card__icon--xlsx { color: #8fd6a0; }
.doc-card__icon svg { width: 100%; height: 100%; }

.doc-card__title {
  font-size: 1.05rem;
  margin: 0 0 8px;
  color: var(--ink);
  line-height: 1.35;
}

.doc-card__desc {
  font-size: 0.88rem;
  color: var(--ink-dim);
  margin: 0 0 20px;
  line-height: 1.5;
  flex: 1;
}

.doc-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { background: rgba(255, 255, 255, 0.12); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: linear-gradient(135deg, #6fbf73, #3f8f52);
  border-color: transparent;
  color: #06170f;
  font-weight: 600;
}
.btn--primary:hover { background: linear-gradient(135deg, #7fce83, #4a9e5d); }

.footer-note {
  margin-top: 64px;
  color: var(--ink-dim);
  font-size: 0.8rem;
  text-align: center;
  opacity: 0.75;
}

/* ---------- Modal viewer ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(3, 10, 8, 0.78);
  backdrop-filter: blur(6px);
}
.modal.is-open { display: flex; }
body.modal-open { overflow: hidden; }

.modal__panel {
  width: 100%;
  max-width: 1000px;
  height: min(88vh, 900px);
  background: #0b241c;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.modal__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal__title {
  flex: 1;
  font-size: 0.95rem;
  color: var(--ink);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal__close {
  background: transparent;
  border: none;
  color: var(--ink-dim);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}
.modal__close:hover { color: var(--ink); }

.modal__body {
  flex: 1;
  overflow: auto;
  background: #f5f2e8;
  position: relative;
}

#pdfFrame {
  width: 100%;
  height: 100%;
  border: none;
}

.xlsx-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 12px 0;
  background: #0b241c;
  overflow-x: auto;
}
.xlsx-tab {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink-dim);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: none;
  padding: 6px 14px;
  border-radius: 8px 8px 0 0;
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
}
.xlsx-tab.is-active { background: #f5f2e8; color: #10241a; font-weight: 600; }

.xlsx-container { padding: 18px; overflow: auto; height: 100%; }
.xlsx-loading { color: #5a5548; font-size: 0.9rem; padding: 20px; }

.xlsx-container table {
  border-collapse: collapse;
  font-size: 0.8rem;
  color: #1c2a20;
  background: #fff;
}
.xlsx-container td, .xlsx-container th {
  border: 1px solid #cfcabb;
  padding: 4px 9px;
  white-space: nowrap;
}

@media print {
  body > *:not(.modal) { display: none !important; }
  #starfield { display: none !important; }
}

@media (max-width: 640px) {
  .hero__emblem { width: 112px; height: 112px; }
  .modal { padding: 0; }
  .modal__panel { height: 100vh; border-radius: 0; max-width: none; }
}
