/* ===== Dashboard instantáneo (usa los tokens de styles.css) ===== */
body.dash { min-height: 100vh; }
.dash [hidden] { display: none !important; }
button.btn { font-family: var(--font-sans); cursor: pointer; border: 0; }
button.btn--ghost { background: transparent; border: 1px solid rgba(46, 46, 46, .25); }

.dnav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 3vw, 40px);
  background: rgba(249, 249, 249, .8);
  border-bottom: 1px solid var(--line-2);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
}
.dnav__title { font-size: 13px; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }

.dwrap { max-width: 1400px; margin-inline: auto; padding: 0 clamp(16px, 3vw, 40px) 80px; }

/* ----- Upload ----- */
.drop {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: clamp(60px, 10vh, 110px) 0 40px; gap: 22px;
}
.drop__glow { position: absolute; inset: 0 -20vw; pointer-events: none; background: radial-gradient(50% 55% at 50% 30%, rgba(155, 167, 242, .45), transparent); z-index: -1; }
.drop__title { font-size: clamp(36px, 5.4vw, 80px); font-weight: 700; letter-spacing: -.035em; line-height: 1.02; max-width: 15ch; }
.drop__sub { color: var(--muted); font-size: clamp(15px, 1.4vw, 19px); max-width: 52ch; line-height: 1.6; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  width: min(560px, 100%); margin-top: 14px; padding: 42px 24px 34px;
  border: 1.5px dashed rgba(46, 46, 46, .22); border-radius: 24px;
  background: #fff; cursor: pointer;
  transition: border-color .3s, background .3s, transform .4s var(--ease);
}
.dropzone svg { color: var(--lav-deep); }
.dropzone strong { font-size: 20px; font-weight: 600; }
.dropzone > span:not(.btn) { color: var(--muted-2); font-size: 13px; letter-spacing: .08em; }
.dropzone .btn { margin-top: 10px; }
.dropzone:hover, .dropzone.over { border-color: var(--lav-deep); background: rgba(155, 167, 242, .14); transform: translateY(-2px); }
.dropzone.loading { pointer-events: none; opacity: .6; }
.drop__note { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13.5px; }

/* ----- Board ----- */
.board { padding-top: 28px; display: flex; flex-direction: column; gap: 18px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.toolbar__file { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.toolbar__file strong { display: block; font-size: 16px; font-weight: 600; }
.toolbar__file div span { display: block; font-size: 12.5px; color: var(--muted); }
.file-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(140deg, #9ba7f2, #6c7ae6); font-size: 11px; font-weight: 800; letter-spacing: .06em; }

.sel {
  appearance: none; -webkit-appearance: none;
  height: 40px; padding: 0 38px 0 16px; border-radius: 999px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%232e2e2e' stroke-opacity='.6' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
  border: 1px solid var(--line); color: var(--ink);
  font: 500 14px/1 var(--font-sans); cursor: pointer; max-width: 240px;
  transition: border-color .3s;
}
.sel:hover, .sel:focus { border-color: rgba(46, 46, 46, .4); outline: none; }
.sel option { background: #fff; color: var(--ink); }
.sel.active { border-color: var(--lav-deep); background-color: var(--lav-soft); }

.filters { display: flex; flex-wrap: wrap; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; min-height: 0; }
.chips:empty { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px 0 14px; border-radius: 999px;
  background: linear-gradient(180deg, #9ba7f2, #6c7ae6); color: #fff; font-size: 13px; font-weight: 500; border: 0; cursor: pointer;
}
.chip b { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: rgba(0, 0, 0, .25); font-size: 11px; }
.chip--clear { background: transparent; border: 1px solid var(--line); color: var(--muted); padding: 0 14px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.kpi { padding: 22px 22px 20px; border-radius: 20px; background: var(--card); border: 1px solid var(--line-2); }
.kpi span { display: block; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.kpi strong { display: block; margin-top: 12px; font-size: clamp(28px, 2.6vw, 38px); font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.kpi em { display: block; margin-top: 10px; font-style: normal; font-size: 12.5px; color: var(--lav-deep); }
.kpi:first-child { background: linear-gradient(150deg, rgba(155, 167, 242, .4), rgba(255, 255, 255, .02)); border-color: rgba(108, 122, 230, .35); }

.controls { display: flex; flex-wrap: wrap; gap: 14px 22px; padding: 16px 18px; border-radius: 18px; background: var(--card); border: 1px solid var(--line-2); }
.controls label { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }

.charts { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.card { padding: 20px 22px 22px; border-radius: 20px; background: var(--card); border: 1px solid var(--line-2); min-width: 0; }
.card--line { grid-column: 1 / -1; }
.card__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card__head h2 { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.hint { font-size: 12px; color: var(--muted-2); }
.chart-box { position: relative; height: 330px; }
.chart-box--short { height: 260px; }

.search {
  height: 40px; width: min(320px, 100%); padding: 0 16px; border-radius: 999px; background: #fff;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line); color: var(--ink);
  font: 400 14px var(--font-sans);
}
.search:focus { outline: none; border-color: rgba(46, 46, 46, .4); }
.table-wrap { overflow: auto; max-height: 520px; border-radius: 12px; border: 1px solid var(--line-2); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 11px 14px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line-2); }
th {
  position: sticky; top: 0; z-index: 1; background: #f3f4fb;
  font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  cursor: pointer; user-select: none;
}
th:hover { color: var(--ink); }
th .dir { color: var(--lav-deep); margin-left: 6px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.muted { color: var(--muted-2); }
tbody tr:hover td { background: rgba(155, 167, 242, .1); }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-size: 13px; color: var(--muted); }
.pbtn { width: 36px; height: 36px; margin-left: 8px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; font-size: 15px; }
.pbtn:disabled { opacity: .3; cursor: default; }
.pbtn:not(:disabled):hover { border-color: var(--ink); }

.cta {
  display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap;
  margin-top: 16px; padding: 28px 30px; border-radius: 22px;
  background: radial-gradient(80% 140% at 100% 0%, rgba(155, 167, 242, .55), transparent), var(--card);
  border: 1px solid rgba(108, 122, 230, .3);
}
.cta p { font-size: clamp(18px, 1.8vw, 24px); font-weight: 600; letter-spacing: -.01em; max-width: 34ch; }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 80; transform: translate(-50%, 20px);
  padding: 12px 20px; border-radius: 999px; background: var(--ink); color: #fff; border: 1px solid var(--lav);
  font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .3s, transform .4s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 960px) {
  .charts { grid-template-columns: 1fr; }
  .dnav__title { display: none; }
}
@media (max-width: 560px) {
  .dnav .btn { padding: 0 14px; font-size: 13px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 16px 14px; }
  .kpi strong { font-size: 24px; }
  .controls { flex-direction: column; }
  .controls label { justify-content: space-between; }
  .sel { max-width: 62vw; }
  .chart-box { height: 280px; }
  .cta { padding: 22px; }
}

/* ----- piezas que en el portafolio venían de su styles.css ----- */
.dash { --card: #fff; }
.dash .card, .dash .kpi, .dash .controls { box-shadow: 0 14px 40px rgba(40, 46, 110, .06); }
.dnav__logo { display: flex; align-items: center; gap: 10px; }
.dnav__logo img:last-child { height: 15px; width: auto; }
.eyebrow--center { justify-content: center; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #2fbf71; box-shadow: 0 0 0 0 rgba(47, 191, 113, .5); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(47, 191, 113, 0); } 100% { box-shadow: 0 0 0 0 rgba(47, 191, 113, 0); } }
.dash .btn { height: 46px; }
.dash .btn--sm { height: 40px; }
@media (max-width: 560px) { .dnav__logo img:last-child { display: none; } }
