/* ===========================================================================
   demos.css — Sistema de diseno: demo pages
   Paleta de alto contraste, layout 2 columnas, orientado a negocio
   =========================================================================== */

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

:root {
  /* Surfaces */
  --bg:              #DCE2EA;
  --surface:         #FFFFFF;
  --surface-alt:     #F4F6F9;

  /* Text — alto contraste */
  --text:            #032D60;
  --text-secondary:  #44546F;
  --text-muted:      #66758C;

  /* Borders */
  --border:          #C7D0DB;
  --border-light:    #D4DCE6;

  /* Primary */
  --cta:             #0176D3;
  --cta-hover:       #025CB2;
  --cta-light:       #EAF5FE;

  /* Accent */
  --accent:          #0B5CAB;
  --accent-hover:    #084D96;
  --accent-light:    #EEF4FF;

  --hero-from:       #16325C;
  --hero-to:         #1B3F73;

  /* Danger */
  --danger:          #DC2626;
  --danger-light:    #FEF2F2;

  /* Misc */
  --radius-sm:   6px;
  --radius:      6px;
  --radius-lg:   8px;
  --shadow-xs:   0 1px 2px rgba(0,0,0,.05);
  --shadow:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:   0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -2px rgba(0,0,0,.04);
  --shadow-lg:   0 10px 25px -5px rgba(0,0,0,.1), 0 4px 10px -4px rgba(0,0,0,.06);
  --font:        'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:   'SF Mono', 'Cascadia Code', 'Consolas', monospace;
  --ease:        180ms ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background:
    linear-gradient(180deg, #E5EAF1 0%, #D7DEE7 100%);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ===== TOPBAR ============================================================= */
.topbar {
  background: #E9EEF4;
  border-bottom: 1px solid var(--border-light);
  padding: .7rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
}

.topbar__back {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: .8rem;
  font-weight: 500;
  transition: color var(--ease);
}
.topbar__back:hover { color: var(--accent); }

.topbar__title-mobile {
  display: none;
  font-size: .84rem;
  font-weight: 700;
  color: var(--text);
}

.topbar__trust {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .7rem;
  color: var(--text-muted);
}

/* ===== BUTTONS ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .65rem 1.4rem;
  font-size: .875rem;
  font-weight: 600;
  font-family: var(--font);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--ease);
  white-space: nowrap;
  text-decoration: none;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Hero CTA — grande, blanco, llama la atencion */
/* CTA principal verde */
.btn--cta {
  background: var(--cta);
  color: #fff;
  box-shadow: 0 1px 2px rgba(1,118,211,.18);
}
.btn--cta:hover:not(:disabled) {
  background: var(--cta-hover);
  box-shadow: 0 2px 6px rgba(1,118,211,.22);
}

/* Outline */
.btn--outline {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn--outline:hover:not(:disabled) {
  background: var(--surface-alt);
  border-color: var(--border);
}

/* Ghost — minimal */
.btn--ghost {
  background: transparent;
  color: var(--accent);
  padding-left: .5rem;
  padding-right: .5rem;
}
.btn--ghost:hover { background: var(--accent-light); }

.btn--sm { font-size: .8rem; padding: .45rem .9rem; }
.btn--full { width: 100%; margin-top: .75rem; }
.btn--stack { margin-top: 0; margin-bottom: .85rem; }

/* ===== LAYOUT 2 COLUMNAS ================================================= */
.main {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0 1rem 1.5rem;
  flex: 1;
}

.layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 0;
  align-items: start;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  overflow: hidden;
  background: #EDF1F5;
  box-shadow: 0 20px 40px -28px rgba(0,0,0,.45);
}

.col-left {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: sticky;
  top: 0;
  align-self: start;
  background: #EDF1F5;
  border-right: 1px solid var(--border-light);
}

.col-right {
  background: #F3F6FA;
  min-height: 620px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
}

/* ===== PANELS (izquierda) ================================================= */
.panel {
  background: var(--surface);
  border: none;
  border-bottom: 1px solid var(--border-light);
  border-radius: 0;
  padding: 1rem;
  box-shadow: none;
}

.panel--muted {
  background: var(--surface-alt);
  border-color: rgba(209,213,219,.85);
  box-shadow: none;
}

.panel--workspace { padding: 1rem; }

.panel--mini { padding-top: .55rem; padding-bottom: .55rem; }

.panel--nav {
  background: #E2E8EF;
}

.panel--action {
  background: #F1F6FB;
  border-bottom-color: #CDD9E6;
}

.btn--demo-primary {
  margin-bottom: .85rem;
}

.panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .45rem;
}

.panel__header--compact { margin-bottom: .2rem; }

.panel__eyebrow {
  display: inline-block;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: .25rem;
}

.panel-status {
  display: inline-flex;
  align-items: center;
  padding: .38rem .7rem;
  border-radius: 999px;
  background: #E6EDF7;
  color: #355D8A;
  font-size: .74rem;
  font-weight: 700;
}

.side-action--left {
  text-align: left;
}

.panel__title {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .98rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .35rem;
}
.panel__title svg { color: var(--accent); flex-shrink: 0; }

.panel__title--sm { font-size: .92rem; }

.panel__desc {
  font-size: .84rem;
  color: var(--text-secondary);
  margin-bottom: .8rem;
  line-height: 1.5;
}

.panel__micro {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: .5rem;
}

/* ===== DROP ZONE ========================================================== */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.1rem .9rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--ease), background var(--ease);
  background: #F6F8FB;
}

.drop-zone:hover,
.drop-zone--dragover {
  border-color: var(--cta);
  background: #F2F8FE;
}

.drop-zone__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
}

.drop-zone__label {
  font-size: .92rem;
  font-weight: 700;
  color: var(--text);
}

.drop-zone__sub {
  font-size: .76rem;
  color: var(--text-muted);
}

/* ===== FILE INFO ========================================================== */
.file-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .7rem .85rem;
  background: #EEF3F8;
  border: 1px solid #CCD8E5;
  border-radius: var(--radius);
  margin-top: .5rem;
}

.file-info__left {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-width: 0;
}

.file-info__name {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-info__meta {
  display: block;
  font-size: .7rem;
  color: var(--text-muted);
}

.file-info__remove {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: .2rem;
  border-radius: var(--radius-sm);
  transition: color var(--ease);
}
.file-info__remove:hover { color: var(--danger); }

/* ===== COLUMN TAGS ======================================================== */
.col-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.col-tag {
  font-family: var(--font-mono);
  font-size: .76rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-light);
  padding: .32rem .65rem;
  border-radius: 100px;
}

/* ===== SIDE ACTION ======================================================== */
.side-action { text-align: center; }

/* ===== RESULT — EMPTY STATE =============================================== */
.result-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.8rem 1.25rem;
}

.result-empty__icon {
  color: var(--border);
  margin-bottom: 1rem;
}

.result-empty__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: .3rem;
}

.result-empty__sub {
  font-size: .84rem;
  color: var(--text-muted);
  max-width: 320px;
  line-height: 1.5;
}

.workspace-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: .9rem;
  border-bottom: 1px solid var(--border-light);
}

.workspace-head__eyebrow {
  display: inline-block;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: .25rem;
}

.workspace-head__title {
  font-size: 1.02rem;
  line-height: 1.2;
  margin-bottom: .35rem;
}

.workspace-head__text {
  font-size: .8rem;
  color: var(--text-secondary);
  max-width: 520px;
}

.workspace-status {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  white-space: nowrap;
  padding: .45rem .72rem;
  border-radius: 999px;
  background: #EEF4FF;
  color: #0B5CAB;
  font-size: .74rem;
  font-weight: 700;
}

.workspace-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cta);
  box-shadow: 0 0 0 4px rgba(1,118,211,.14);
}

/* ===== RESULT — PREVIEW =================================================== */
.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .75rem;
}

.result-header__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: .2rem .6rem;
  font-size: .7rem;
  font-weight: 600;
  color: var(--accent);
  background: #EEF4FF;
  border-radius: 100px;
}

/* ===== DATA TABLE ========================================================= */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  min-height: 360px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

.data-table th {
  background: var(--hero-from);
  color: #fff;
  font-weight: 600;
  text-align: left;
  padding: .72rem .9rem;
  white-space: nowrap;
}

.data-table td {
  padding: .72rem .9rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
}

.data-table tbody tr:nth-child(even) { background: var(--surface-alt); }
.data-table tbody tr:last-child td { border-bottom: none; }

.table-note {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: .5rem;
  text-align: center;
}

/* ===== RESULT — SUCCESS =================================================== */
.result-success {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem 1rem;
}

.result-success__icon { color: var(--cta); margin-bottom: .75rem; }

.result-success__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .3rem;
}

.result-success__desc {
  font-size: .84rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.result-success__features {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  margin-bottom: 1.25rem;
  text-align: left;
}

.feat {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .82rem;
  color: var(--text-secondary);
}
.feat svg { color: var(--cta); flex-shrink: 0; }

/* ===== ALERTS ============================================================= */
.alert {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  padding: .7rem .85rem;
  border-radius: var(--radius);
  font-size: .8rem;
  line-height: 1.45;
  margin-top: .6rem;
}
.alert svg { flex-shrink: 0; margin-top: .05rem; }

.alert--error {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(220,38,38,.15);
}

/* ===== CTA BAND =========================================================== */
/* ===== LOADER ============================================================= */
.loader {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
.loader--dark {
  border-color: rgba(15,23,42,.15);
  border-top-color: var(--hero-from);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== TOAST ============================================================== */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  padding: .65rem 1.25rem;
  border-radius: var(--radius);
  font-size: .825rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  max-width: 90vw;
  text-align: center;
}
.toast--success { background: var(--cta); color: #fff; }
.toast--error   { background: var(--danger); color: #fff; }

/* ===== FOOTER ============================================================= */
.footer {
  text-align: center;
  padding: 1rem 1.5rem 1.4rem;
  font-size: .82rem;
  color: var(--text-muted);
}

.panel--validation {
  margin-top: .85rem;
  background: var(--surface-alt);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: .95rem 1rem;
  box-shadow: 0 12px 24px -20px rgba(0,0,0,.28);
}

/* ===== RESPONSIVE ========================================================= */
@media (max-width: 920px) {
  .layout {
    grid-template-columns: 1fr;
    border-radius: 8px;
  }

  .col-right {
    min-height: 360px;
    order: 1;
  }

  .col-left {
    position: static;
    order: 2;
    border-right: none;
    border-top: 1px solid var(--border-light);
  }

  .main {
    padding: 1.1rem 1rem 2rem;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: .65rem 1rem;
  }

  .topbar__trust {
    display: none;
  }

  .side-action--left {
    display: none;
  }

  .topbar__title-mobile {
    display: block;
  }

  .panel--action {
    order: -1;
  }

  .btn--demo-primary {
    width: 100%;
    margin-bottom: 0;
  }

  .panel__desc,
  .workspace-head__text,
  .result-empty__sub,
  .result-success__desc {
    font-size: .82rem;
  }

  .panel,
  .col-right {
    padding: .95rem;
  }

  .panel--validation {
    margin-top: .8rem;
  }

  .data-table {
    font-size: .8rem;
  }

  .data-table th,
  .data-table td {
    padding: .58rem .68rem;
  }

  .result-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
