:root{
  --bg: #07101d;
  --bg-soft: #0c1728;
  --panel: rgba(255,255,255,0.04);
  --panel-strong: rgba(255,255,255,0.06);
  --panel-soft: rgba(255,255,255,0.03);
  --line: rgba(255,255,255,0.10);
  --line-strong: rgba(255,255,255,0.16);
  --text: #eef4ff;
  --muted: #9cafcb;
  --accent: #74a7ff;
  --accent-2: #8b69ff;
  --success: #34d39a;
  --warning: #f6b84d;
  --danger: #ff6d7a;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --shadow: 0 22px 60px rgba(0,0,0,0.36);
  --max: 1320px;
}

*{
  box-sizing: border-box;
}

html{
  scroll-behavior: smooth;
}

body{
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(116,167,255,0.18), transparent 25%),
    radial-gradient(circle at top right, rgba(139,105,255,0.14), transparent 25%),
    linear-gradient(180deg, #07101d 0%, #081322 42%, #07101d 100%);
}

button,
input,
textarea,
select{
  font: inherit;
}

button{
  cursor: pointer;
  border: none;
}

.io-app-shell{
  min-height: 100vh;
}

.io-app-topbar,
.io-app-main,
.io-app-footer{
  width: min(calc(100% - 28px), var(--max));
  margin: 0 auto;
}

.io-app-topbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
}

.io-app-brand{
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.io-app-brand__mark{
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  box-shadow: 0 14px 28px rgba(0,0,0,0.22);
}

.io-app-brand__copy{
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.io-app-brand__copy strong{
  font-size: 16px;
  letter-spacing: 0.01em;
}

.io-app-brand__copy span{
  color: var(--muted);
  font-size: 12px;
}

.io-app-statusbar{
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.status-pill{
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.status-pill.is-ready{
  color: #dffbf0;
  border-color: rgba(52,211,154,0.22);
  background: rgba(52,211,154,0.10);
}

.status-pill.is-warning{
  color: #fff4da;
  border-color: rgba(246,184,77,0.24);
  background: rgba(246,184,77,0.10);
}

.status-pill.is-danger{
  color: #ffe1e5;
  border-color: rgba(255,109,122,0.24);
  background: rgba(255,109,122,0.10);
}

.io-app-main{
  padding: 10px 0 48px;
}

.hero-card,
.health-card,
.workspace,
.screen-card{
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-card{
  border-radius: var(--radius-xl);
  padding: 26px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
  align-items: stretch;
}

.eyebrow{
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  color: #dce8ff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid rgba(116,167,255,0.20);
  background: rgba(116,167,255,0.10);
}

.hero-card__copy h1{
  margin: 16px 0 12px;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.hero-card__copy p{
  margin: 0;
  max-width: 760px;
  color: var(--muted);
  line-height: 1.75;
  font-size: 16px;
}

.hero-card__side{
  display: grid;
  gap: 14px;
}

.info-box{
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--panel-strong);
}

.info-box__label{
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.info-box__value{
  display: block;
  margin-top: 10px;
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -0.03em;
}

.health-grid{
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.health-card{
  min-height: 190px;
  padding: 20px;
  border-radius: var(--radius-lg);
}

.health-card__label{
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.health-card__value{
  display: block;
  margin-top: 14px;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.health-card__text{
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}

.workspace{
  margin-top: 24px;
  padding: 22px;
  border-radius: var(--radius-xl);
}

.workspace__head h2{
  margin: 14px 0 0;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.io-tabs{
  margin-top: 22px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.io-tab{
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  white-space: nowrap;
  color: var(--muted);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 700;
  transition: transform 0.18s ease, border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.io-tab:hover{
  transform: translateY(-1px);
}

.io-tab.is-active{
  color: #ffffff;
  border-color: rgba(116,167,255,0.24);
  background: linear-gradient(135deg, rgba(139,105,255,0.28), rgba(116,167,255,0.20));
}

.io-screen{
  display: none;
  margin-top: 20px;
}

.io-screen.is-active{
  display: block;
}

.screen-section-head{
  margin-bottom: 16px;
  padding: 18px 18px 0;
}

.screen-section-head h3{
  margin: 14px 0 8px;
  font-size: clamp(24px, 3.8vw, 34px);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.screen-section-head p{
  margin: 0;
  max-width: 860px;
  color: var(--muted);
  line-height: 1.72;
  font-size: 14px;
}

.screen-grid{
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.screen-card{
  min-height: 180px;
  padding: 20px;
  border-radius: 20px;
  grid-column: span 4;
  position: relative;
  overflow: hidden;
}

.screen-card::before{
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(116,167,255,0), rgba(116,167,255,0.42), rgba(139,105,255,0));
  opacity: 0.9;
}

.screen-card h3{
  margin: 0 0 10px;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.screen-card p{
  margin: 0;
  color: var(--muted);
  line-height: 1.72;
  font-size: 14px;
}

.screen-card__meta{
  margin-top: 16px;
  color: #d9e6ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.screen-card__topline{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.screen-card__topline h3{
  margin: 0;
}

.screen-badge{
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border: 1px solid rgba(116,167,255,0.24);
  background: rgba(116,167,255,0.12);
  color: #dce8ff;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

button.screen-badge:hover{
  transform: translateY(-1px);
  border-color: rgba(116,167,255,0.36);
  background: rgba(116,167,255,0.18);
}

button.screen-badge:disabled{
  opacity: 0.45;
  cursor: not-allowed;
}

.screen-badge--soft{
  border-color: rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: var(--muted);
}

.screen-card__stack{
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.screen-placeholder{
  min-height: 58px;
  padding: 14px 15px;
  border-radius: 14px;
  border: 1px dashed rgba(116,167,255,0.24);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.02));
  color: #d7e6ff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  display: flex;
  align-items: center;
}

#btnPickImportFile,
#btnPreviewImportFile,
#btnClearImportJob,
#btnApplyImportJob,
#btnRebuildImportDerived,
#btnSaveManualImport,
#btnResetManualImport{
  min-width: 140px;
}

#importDropzoneShell{
  min-height: 110px;
  border-style: dashed;
  border-width: 1px;
  border-color: rgba(116,167,255,0.34);
  background:
    radial-gradient(circle at top left, rgba(116,167,255,0.10), transparent 44%),
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.02));
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 18px;
}

#importSelectedFileName,
#importPreviewSummary,
#importPreviewRowsShell,
#importPreviewTotalsShell,
#importIssuesShell,
#importDuplicateShell,
#importBusinessRulesShell,
#importApplySummaryShell,
#importApplyResultShell,
#manualBrokerShell,
#manualSymbolShell,
#manualOperationShell,
#importHistoryFiltersShell,
#importHistoryListShell,
#importHistoryDetailShell{
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.02));
}

#importPreviewRowsShell,
#importHistoryListShell,
#importHistoryDetailShell{
  min-height: 88px;
  align-items: flex-start;
}

[data-screen="importaciones"] .screen-card{
  grid-column: span 6;
}

[data-screen="importaciones"] .screen-card:nth-child(4),
[data-screen="importaciones"] .screen-card:nth-child(5),
[data-screen="importaciones"] .screen-card:nth-child(6){
  min-height: 220px;
}

[data-screen="importaciones"] .screen-card__stack{
  gap: 10px;
}

[data-screen="importaciones"] .screen-card__topline:last-child{
  margin-top: 4px;
  margin-bottom: 0;
}

.io-app-footer{
  padding: 0 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1180px){
  .hero-card,
  .health-grid{
    grid-template-columns: 1fr;
  }

  .screen-card{
    grid-column: span 6;
  }

  [data-screen="importaciones"] .screen-card{
    grid-column: span 6;
  }
}

@media (max-width: 780px){
  .screen-grid{
    grid-template-columns: 1fr;
  }

  .screen-card{
    grid-column: auto;
  }

  .screen-section-head{
    padding: 12px 4px 0;
  }

  .screen-card__topline{
    flex-direction: column;
    align-items: flex-start;
  }

  [data-screen="importaciones"] .screen-card{
    grid-column: auto;
  }
}

@media (max-width: 720px){
  .io-app-topbar,
  .io-app-main,
  .io-app-footer{
    width: min(calc(100% - 20px), var(--max));
  }

  .io-app-topbar{
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 0;
  }

  .io-app-statusbar{
    width: 100%;
    justify-content: flex-start;
  }

  .hero-card,
  .workspace,
  .health-card,
  .screen-card{
    padding: 18px;
    border-radius: 22px;
  }

  .hero-card__copy h1{
    font-size: 34px;
  }

  .workspace__head h2,
  .screen-section-head h3{
    font-size: 28px;
  }

  .status-pill{
    width: 100%;
    justify-content: center;
  }

  .screen-placeholder{
    min-height: 52px;
    padding: 13px 14px;
  }

  #importDropzoneShell{
    min-height: 92px;
    padding: 16px;
  }

  .screen-badge{
    min-height: 32px;
  }

  #btnPickImportFile,
  #btnPreviewImportFile,
  #btnClearImportJob,
  #btnApplyImportJob,
  #btnRebuildImportDerived,
  #btnSaveManualImport,
  #btnResetManualImport{
    width: 100%;
  }

  .io-app-footer{
    flex-direction: column;
    align-items: flex-start;
  }
}