.cc-page {
  gap: 16px !important;
}

.cc-page .cc-header-card {
  background: #fff !important;
  border: 1px solid #dce4ef !important;
  border-radius: 16px !important;
  padding: 16px 18px !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.cc-page .cc-header-card h1 {
  font-weight: 800 !important;
}

.cc-page .cc-kpi-shell {
  grid-template-columns: minmax(0, 1fr) 320px !important;
  gap: 14px !important;
}

.cc-page .cc-kpi-grid {
  gap: 10px !important;
}

.cc-page .cc-kpi-shell > div:last-child {
  position: sticky;
  top: 74px;
  align-self: start;
}

.cc-page .cc-fondo-wrap {
  background: #fbfcfe;
  border: 1px solid #dce4ef;
  border-radius: 14px;
  padding: 16px;
}

.cc-page .cc-history-card-offset {
  margin-top: 8px !important;
}

.cc-page .cc-history-head {
  background: #f8fafc !important;
}

.cc-page .cc-history-title {
  letter-spacing: -0.01em;
}

.cc-page .cc-capture-panel {
  display: none !important;
}

/* Popout solo por entrada a ruta /corte-caja (sin launcher visible) */
.cc-popout-launcher {
  display: none !important;
}

.cc-popout-launcher .cc-launcher-left {
  display: none !important;
}

.cc-popout-launcher .cc-launcher-right {
  display: flex !important;
}

.cc-popout-launcher .cc-launcher-badge {
  border-radius: 999px !important;
  padding: 10px 14px !important;
  font-size: 11px !important;
  box-shadow: 0 8px 20px rgba(249, 115, 22, 0.35) !important;
}

/* Historial de cortes con vista previa lateral */
.cc-history-host-parent {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 14px !important;
}

.cc-history-body-with-preview {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
  gap: 14px !important;
  min-width: 0;
  width: 100%;
}

.cc-history-body-with-preview > .cc-history-main {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
}

.cc-history-host-parent > * {
  flex-basis: 100%;
}

.cc-history-host-parent > .cc-history-main {
  flex: 1 1 0% !important;
  flex-basis: auto !important;
  min-width: 0 !important;
}

.cc-history-main {
  min-width: 0;
}

.cc-history-preview-panel {
  border: 1px solid #dce4ef;
  border-radius: 12px;
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  flex-shrink: 0;
  flex-basis: auto !important;
}

.cc-history-preview-head {
  padding: 12px 14px;
  border-bottom: 1px solid #e8edf5;
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}

.cc-history-preview-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
}

.cc-history-preview-empty {
  font-size: 12px;
  color: #64748b;
  padding: 20px 10px;
  text-align: center;
}

.cc-detail-card {
  border: 1px solid #dfe5ee;
  border-radius: 10px;
  background: #fff;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cc-detail-title {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
}

.cc-detail-top {
  border: 1px solid #e5eaf2;
  border-radius: 10px;
  background: #f8fafc;
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
}

.cc-detail-date {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}

.cc-detail-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  font-weight: 800;
}

.cc-detail-diff {
  font-size: clamp(16px, 3.2vw, 26px);
  line-height: 1.05;
  font-weight: 900;
  font-family: "JetBrains Mono", monospace;
  color: #dc2626;
  letter-spacing: -0.01em;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cc-detail-right {
  text-align: right;
  min-width: 120px;
  margin-left: auto;
}

.cc-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.cc-detail-box {
  border: 1px solid #e5eaf2;
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

.cc-detail-box-accent {
  border-width: 2px;
}

.cc-detail-box-accent.is-negative {
  border-color: #fecaca;
  background: #fef2f2;
}

.cc-detail-box-accent.is-positive {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.cc-detail-box-accent.is-neutral {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.cc-detail-box-accent .cc-detail-row strong {
  font-weight: 900;
}

.cc-detail-value {
  margin-top: 4px;
  font-size: clamp(15px, 1.05vw, 20px);
  line-height: 1.1;
  font-weight: 900;
  font-family: "JetBrains Mono", monospace;
  color: #0f172a;
  white-space: nowrap;
  overflow-wrap: normal;
}

.cc-detail-muted {
  margin-top: 4px;
  font-size: 12px;
  color: #64748b;
}

.cc-detail-row {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 13px;
  color: #0f172a;
}

.cc-detail-row strong {
  font-family: "JetBrains Mono", monospace;
}

.cc-detail-row.cc-strong {
  margin-top: 10px;
  border-top: 1px dashed #cbd5e1;
  padding-top: 10px;
  font-size: 18px;
  font-weight: 800;
}

.cc-detail-actions {
  display: flex;
  gap: 8px;
}

.cc-history-preview-btn {
  flex: 1;
  border: 1px solid #dce4ef;
  background: #f8fafc;
  color: #0f172a;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.cc-history-preview-btn.primary {
  border-color: #fb923c;
  background: #fff7ed;
  color: #c2410c;
}

.cc-history-table tbody tr.cc-history-selected {
  background: #fff7ed !important;
}

/* Historial: mostrar solo Fecha(1), Hora(2), Efect. esp.(6), Tarjeta/Transf.esp.(7), Diferencia(11) y Acciones(12) */
/* Ocultar: T(3), Ventas(4), Total ventas(5), MXN contado(8), USD(9), Total físico(10) */
.cc-history-table thead th:nth-child(3),
.cc-history-table thead th:nth-child(4),
.cc-history-table thead th:nth-child(8),
.cc-history-table thead th:nth-child(9),
.cc-history-table thead th:nth-child(10),
.cc-history-table tbody td:nth-child(3),
.cc-history-table tbody td:nth-child(4),
.cc-history-table tbody td:nth-child(8),
.cc-history-table tbody td:nth-child(9),
.cc-history-table tbody td:nth-child(10) {
  display: none !important;
}

@media (max-width: 1200px) {
  .cc-page .cc-kpi-shell {
    grid-template-columns: 1fr !important;
  }

  .cc-page .cc-kpi-shell > div:last-child {
    position: static;
  }

  .cc-history-body-with-preview {
    grid-template-columns: 1fr;
  }

  .cc-detail-diff {
    font-size: clamp(24px, 8vw, 34px);
    white-space: normal;
  }

  .cc-detail-top {
    align-items: start;
  }

  .cc-detail-right {
    text-align: left;
    margin-left: 0;
    min-width: 0;
  }

  .cc-history-preview-panel {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .cc-detail-diff {
    font-size: 22px;
  }
}

@media (max-width: 900px) {
  .cc-page .cc-header-card {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 12px !important;
  }

  .cc-page .cc-kpi-grid {
    grid-template-columns: 1fr !important;
  }
}
