/* ============================================
   DealTunnel Ops Dashboard — Components
   ============================================ */

/* ---- Cards ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  padding: 24px;
}

.card h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
}

/* ---- Stat cards ---- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  padding: 20px;
  text-align: center;
}

.stat-num {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--acc-text);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey);
  margin-top: 4px;
}

/* ---- Chips (filters) ---- */
.chip {
  display: inline-block;
  border: 1px solid var(--hairline);
  padding: 5px 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--grey);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.chip:hover {
  border-color: var(--acc-text);
  color: var(--acc-text);
}

.chip.a {
  border-color: var(--acc-text);
  color: var(--acc-text);
}

/* ---- Tables ---- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 16px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  text-align: left;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--acc-text);
  padding: 10px 12px;
  border-bottom: 2px solid var(--hairline);
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--hairline-soft);
  vertical-align: top;
}

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

td.num {
  font-family: var(--mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--acc-text);
}

td.dim {
  color: var(--grey);
}

tr.clickable {
  cursor: pointer;
  transition: background 0.15s;
}

tr.clickable:hover {
  background: var(--surface);
}

/* ---- Ficha de registro ---- */
.ficha {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  padding: 24px 26px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 2.2;
  position: relative;
  overflow: hidden;
}

.ficha .fid {
  color: var(--acc-text);
  letter-spacing: 0.12em;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 4px;
}

.ficha .row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px dashed var(--hairline);
  flex-wrap: wrap;
}

.ficha .row:last-child {
  border-bottom: 0;
}

.ficha .k {
  color: var(--grey);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ficha .v {
  text-align: right;
}

.ficha .ok {
  color: var(--acc-text);
}

.ficha .off {
  color: var(--grey);
}

/* ---- Funnel bars ---- */
.funnel {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.funnel-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.funnel-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--grey);
  width: 140px;
  flex-shrink: 0;
  text-align: right;
  letter-spacing: 0.04em;
}

.funnel-track {
  flex: 1;
  height: 20px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  position: relative;
  overflow: hidden;
}

.funnel-fill {
  height: 100%;
  background: var(--acc-fill);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.funnel-val {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--acc-text);
  width: 60px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---- Progress inline (mini blocks for hub table) ---- */
.progress-inline {
  display: flex;
  gap: 3px;
  align-items: center;
}

.progress-block {
  width: 8px;
  height: 8px;
  background: var(--dot-off);
  transition: background 0.3s;
}

.progress-block.on {
  background: var(--acc-fill);
}

/* ---- Channel cards ---- */
.channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.channel-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  padding: 16px;
  text-align: center;
}

.channel-name {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--grey);
  margin-bottom: 8px;
}

.channel-num {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--acc-text);
  font-variant-numeric: tabular-nums;
}

.channel-pct {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--grey);
  margin-top: 4px;
}

.channel-bar {
  margin-top: 8px;
  height: 3px;
  background: var(--dot-off);
}

.channel-bar-fill {
  height: 100%;
  background: var(--acc-fill);
  transition: width 0.6s ease;
}

/* ---- Meta row (info badges) ---- */
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--hairline);
  padding: 4px 10px;
  color: var(--grey);
}

.meta-tag.active {
  border-color: var(--acc-fill);
  color: var(--acc-text);
}

/* ---- Empty state ---- */
.empty {
  text-align: center;
  padding: 60px 24px;
  color: var(--grey);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty p {
  font-size: 14px;
  max-width: 400px;
  margin: 0 auto;
}

/* ---- Drop zone ---- */
.drop-zone {
  border: 1px dashed var(--hairline);
  padding: 48px 24px;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}

.drop-zone:hover,
.drop-zone.over {
  border-color: var(--acc-fill);
  background: var(--flash-bg);
}

.drop-zone p {
  font-size: 14px;
  color: var(--grey);
}

.drop-zone .mono {
  color: var(--acc-text);
}

/* ---- Buttons ---- */
.btn-primary {
  display: inline-block;
  background: var(--acc-fill);
  color: #101112;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 24px;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-primary:hover {
  opacity: 0.88;
}

.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--grey);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 24px;
  border: 1px solid var(--hairline);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.btn-secondary:hover {
  border-color: var(--acc-text);
  color: var(--acc-text);
}

/* ---- Responsive ---- */
@media (max-width: 840px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .funnel-label {
    width: 100px;
  }
}

@media (max-width: 640px) {
  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .channel-grid {
    grid-template-columns: 1fr 1fr;
  }

  .funnel-label {
    width: 100%;
  }

  .funnel-row {
    flex-wrap: wrap;
  }
}

@media (max-width: 500px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .funnel-row {
    flex-wrap: wrap;
  }

  .funnel-label {
    width: auto;
    text-align: left;
  }
}
