:root {
  --bg: #071523;
  --bg-2: #0d2334;
  --card: rgba(255, 252, 246, 0.9);
  --card-strong: rgba(255, 255, 255, 0.96);
  --ink: #142534;
  --muted: #5f6f7d;
  --line: rgba(20, 37, 52, 0.12);
  --primary: #005482;
  --primary-2: #0a3550;
  --accent: #f9a351;
  --danger: #a83f39;
  --shadow: 0 30px 80px rgba(4, 16, 28, 0.22);
  --radius: 28px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #071523 0%, #0c2941 42%, #12334b 100%);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(249, 163, 81, 0.18), transparent 24rem),
    radial-gradient(circle at 85% 15%, rgba(39, 151, 203, 0.18), transparent 28rem),
    url("https://images.unsplash.com/photo-1516321318423-f06f85e504b3?auto=format&fit=crop&w=1800&q=80") center/cover;
  opacity: 0.22;
  pointer-events: none;
}

button,
textarea,
input,
select {
  font: inherit;
}

button,
a.button {
  cursor: pointer;
}

.page-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(7, 21, 35, 0.1), rgba(7, 21, 35, 0.35));
}

.hero {
  position: relative;
  min-height: 720px;
  color: #fff;
  background:
    linear-gradient(115deg, rgba(5, 22, 36, 0.92), rgba(8, 46, 74, 0.76)),
    url("https://images.unsplash.com/photo-1554224154-26032fced8bd?auto=format&fit=crop&w=1800&q=80") center/cover;
  padding: 24px clamp(18px, 5vw, 72px) 120px;
  border-bottom-left-radius: 44px;
  border-bottom-right-radius: 44px;
  box-shadow: var(--shadow);
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 18px;
  background: rgba(8, 26, 42, 0.5);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: #fff;
  text-decoration: none;
}

.brand-logo {
  width: 110px;
  height: auto;
  display: block;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.15));
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.05rem;
}

.brand small {
  color: rgba(255, 255, 255, 0.72);
}

.nav-actions,
.hero-actions,
.input-actions,
.table-actions,
.import-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.nav-link {
  color: #fff;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  transition: background 150ms ease, transform 150ms ease;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.hero-content {
  width: min(860px, 100%);
  padding-top: 96px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.hero .eyebrow {
  color: #ffd0a3;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2.8rem, 7vw, 6rem);
  line-height: 0.92;
  letter-spacing: -0.08em;
  margin-bottom: 24px;
}

h2 {
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 0.98;
  letter-spacing: -0.06em;
  margin-bottom: 12px;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.hero-content p:not(.eyebrow),
.section-heading p,
.hint,
.preview-entry p,
.insight-output,
.auth-summary {
  color: var(--muted);
}

.hero-content p:not(.eyebrow) {
  max-width: 740px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 1.12rem;
  line-height: 1.7;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 13px 19px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 18px 32px rgba(0, 84, 130, 0.28);
}

.secondary {
  color: var(--primary-2);
  background: #e5f0f7;
}

.ghost {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.ghost-dark {
  color: var(--ink);
  background: rgba(20, 37, 52, 0.08);
}

.danger {
  color: #fff;
  background: var(--danger);
}

.wide {
  width: 100%;
}

.stack {
  width: min(1240px, calc(100% - 28px));
  margin: -84px auto 80px;
  position: relative;
  z-index: 1;
}

.panel {
  margin-bottom: 22px;
  background: rgba(255, 248, 240, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  padding: clamp(20px, 4vw, 42px);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.section-heading.compact {
  margin-bottom: 18px;
}

.section-heading p {
  max-width: 760px;
  line-height: 1.6;
  margin-bottom: 0;
}

.auth-summary {
  border-radius: 999px;
  padding: 12px 16px;
  background: rgba(20, 37, 52, 0.06);
  font-weight: 800;
}

.auth-grid,
.log-layout,
.insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.input-card,
.preview-card,
.import-card {
  background: var(--card-strong);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
}

label {
  display: block;
  margin-bottom: 10px;
  font-weight: 900;
}

input,
textarea,
select {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 15px 16px;
  color: var(--ink);
  background: #fffcf7;
  line-height: 1.6;
  margin-bottom: 14px;
}

input:focus,
textarea:focus,
select:focus {
  outline: 3px solid rgba(0, 84, 130, 0.18);
  border-color: var(--primary);
}

.hint {
  margin: 12px 0 0;
  line-height: 1.55;
}

.import-card {
  margin-top: 22px;
}

.import-controls input[type="file"] {
  flex: 1 1 320px;
  margin: 0;
}

.pillar-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.pillar-card {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  border: 0;
  border-radius: 24px;
  padding: 0;
  color: #fff;
  text-align: left;
  background: #102c2a;
  box-shadow: 0 18px 42px rgba(16, 44, 42, 0.21);
}

.pillar-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--image) center/cover;
  transform: scale(1.03);
  transition: transform 240ms ease;
}

.pillar-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(3, 16, 15, 0.08), rgba(3, 16, 15, 0.84));
}

.pillar-card:hover::before {
  transform: scale(1.08);
}

.pillar-card.is-selected {
  outline: 4px solid var(--accent);
}

.pillar-content {
  position: absolute;
  inset: auto 0 0;
  z-index: 1;
  padding: 24px;
}

.pillar-content h3 {
  font-size: 1.45rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

.pillar-content p {
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.45;
}

.pillar-metrics {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 8px 11px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-weight: 800;
}

.preview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

#previewCount,
#actualCount {
  border-radius: 999px;
  padding: 8px 11px;
  background: #f5e3d0;
  font-weight: 900;
}

.preview-list,
.insight-output {
  display: grid;
  gap: 12px;
  max-height: 460px;
  overflow: auto;
  margin-bottom: 16px;
}

.preview-entry,
.actual-entry,
.insight-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 15px;
  background: #fffbf2;
}

.preview-entry p {
  margin-bottom: 12px;
}

.empty-state {
  margin: 0;
  padding: 18px;
  color: var(--muted);
  background: rgba(20, 37, 52, 0.05);
  border-radius: 18px;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.summary-strip article {
  border-radius: 20px;
  padding: 18px;
  background: var(--card-strong);
  border: 1px solid var(--line);
}

.summary-strip span {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.summary-strip strong {
  display: block;
  margin-top: 4px;
  font-size: 2rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card-strong);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

th,
td {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.pillar-badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--primary-2);
  background: #e5f0f7;
  font-weight: 900;
}

.delete-row {
  color: var(--danger);
  background: transparent;
  border: 0;
  font-weight: 900;
}

dl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0;
}

dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

dd {
  margin: 3px 0 0;
  font-weight: 900;
}

.markdown p,
.markdown ul {
  margin: 0 0 12px;
  line-height: 1.6;
}

.markdown ul {
  padding-left: 18px;
}

@media (max-width: 1080px) {
  .pillar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-grid,
  .log-layout,
  .insight-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .hero {
    min-height: 620px;
    padding-bottom: 90px;
    border-bottom-left-radius: 28px;
    border-bottom-right-radius: 28px;
  }

  .topbar,
  .section-heading {
    display: block;
  }

  .nav-actions,
  .table-actions {
    margin-top: 16px;
  }

  .brand {
    align-items: flex-start;
  }

  .brand-logo {
    width: 88px;
  }

  .stack {
    margin-top: -56px;
  }

  .pillar-grid,
  .summary-strip,
  dl {
    grid-template-columns: 1fr;
  }
}
