:root {
  --bg: #08111f;
  --panel: rgba(10, 18, 34, 0.82);
  --panel-strong: #0e1729;
  --border: rgba(255, 255, 255, 0.08);
  --text: #ecf3ff;
  --muted: #9caec9;
  --primary: #4fd1c5;
  --accent: #ffb347;
  --danger: #ff6b6b;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
  --radius: 22px;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(79, 209, 197, 0.25), transparent 28%),
    radial-gradient(circle at top right, rgba(255, 179, 71, 0.18), transparent 24%),
    linear-gradient(160deg, #07101c 0%, #0b1424 48%, #060b14 100%);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  position: relative;
  overflow-x: hidden;
}

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 20%, rgba(79, 209, 197, 0.08), transparent 18%),
    radial-gradient(circle at 80% 15%, rgba(255, 179, 71, 0.08), transparent 18%);
  filter: blur(10px);
}

.shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
  position: relative;
  z-index: 1;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 28px;
  padding: 30px;
  margin-bottom: 24px;
}

.fincrece-logo-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 112px;
  height: 72px;
  min-height: 72px;
  max-width: 112px;
  margin: 0 0 14px;
  padding: 6px;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.fincrece-logo-img {
  display: block;
  width: 100%;
  height: 58px;
  object-fit: contain;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.02;
  max-width: 16ch;
}

.lead {
  color: var(--muted);
  max-width: 62ch;
  margin: 18px 0 0;
  line-height: 1.6;
}

.hero-stats {
  display: grid;
  gap: 12px;
  align-content: center;
}

.hero-stats div,
.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
}

.hero-stats strong,
.summary-item strong {
  font-size: 1.15rem;
}

.hero-stats span,
.summary-item span,
.muted,
.status,
.page-meta,
.table-head p {
  color: var(--muted);
}

.hero-stats .ghost {
  margin-top: 4px;
  min-height: 48px;
}

.grid {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 24px;
  margin-bottom: 24px;
}

.upload-card,
.summary-card,
.preview-card {
  padding: 24px;
}

.dropzone {
  border: 1.5px dashed rgba(255, 255, 255, 0.18);
  border-radius: 22px;
  min-height: 190px;
  display: grid;
  place-items: center;
  text-align: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  cursor: pointer;
}

.dropzone.dragover {
  transform: scale(1.01);
  border-color: var(--primary);
  background: rgba(79, 209, 197, 0.08);
}

.dropzone h2,
.summary-card h2,
.preview-card h2 {
  margin-top: 0;
}

.dropzone-copy p {
  color: var(--muted);
  margin: 8px 0 18px;
}

button,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

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

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.primary {
  background: var(--primary);
  color: #04141a;
  font-weight: 700;
}

.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.accent {
  background: var(--accent);
  color: #241300;
  font-weight: 700;
}

.danger {
  background: var(--danger);
  color: #fff6f6;
  font-weight: 700;
}

.ghost {
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(255, 107, 107, 0.35);
  color: #ffd7d7;
}

.file-info {
  margin: 16px 0 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: end;
  margin-top: 12px;
}

.control {
  display: grid;
  gap: 8px;
}

.control span {
  font-size: 0.92rem;
  color: var(--muted);
}

select {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 14px;
  border-radius: 14px;
}

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

.status {
  margin-top: 14px;
  min-height: 24px;
}

.summary-list {
  display: grid;
  gap: 10px;
}

.logs {
  margin-top: 16px;
  display: grid;
  gap: 8px;
}

.log-item {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 18px;
}

.section-header p {
  color: var(--muted);
  max-width: 60ch;
}

.preview {
  display: grid;
  gap: 16px;
}

.app-closed-card {
  max-width: 720px;
  margin: 72px auto;
  text-align: center;
}

.app-closed-card h1 {
  margin-top: 0;
}

.app-closed-card p {
  color: var(--muted);
  line-height: 1.6;
}

.page-card,
.table-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 18px;
  padding: 16px;
}

.page-head,
.table-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.badge,
.table-badge {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(79, 209, 197, 0.16);
  color: #8ff5ea;
  font-size: 0.78rem;
  white-space: nowrap;
}

.table-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.table-card h4 {
  margin: 0;
}

.matrix-wrap {
  overflow: auto;
  margin-top: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.02);
}

th,
td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  font-size: 0.92rem;
}

th {
  background: rgba(255, 255, 255, 0.05);
  color: #eaf6ff;
}

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

td {
  color: #dfe9f7;
}

@media (max-width: 980px) {
  .hero,
  .grid {
    grid-template-columns: 1fr;
  }

  .controls,
  .section-header {
    grid-template-columns: 1fr;
    display: grid;
  }
}

@media (max-width: 680px) {
  .shell {
    width: min(100% - 18px, 1240px);
    padding-top: 12px;
  }

  .hero,
  .upload-card,
  .summary-card,
  .preview-card {
    padding: 18px;
  }

  .buttons {
    width: 100%;
  }

  button {
    width: 100%;
  }
}
