@import url("variables.css");

body.page-circuito {
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(42, 157, 143, 0.1), transparent 55%),
    var(--dc-paper);
  font-family: var(--font-body);
  color: var(--dc-ink);
}

.cir-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 28px 32px;
}

.cir-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 14px;
  align-items: end;
  margin-bottom: 16px;
}

.cir-toolbar label {
  display: grid;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dc-muted);
}

.cir-toolbar input[type="date"] {
  border: 1px solid var(--dc-line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font: inherit;
  text-transform: none;
  letter-spacing: 0;
  min-width: 150px;
  background: var(--dc-white);
  color: var(--dc-ink);
}

.cir-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.cir-chip {
  border: 1px solid rgba(42, 157, 143, 0.35) !important;
  color: var(--dc-teal-deep) !important;
  background: rgba(42, 157, 143, 0.08) !important;
}

.cir-chip:hover {
  background: rgba(42, 157, 143, 0.16) !important;
}

.cir-chip.is-active {
  background: var(--dc-teal) !important;
  border-color: var(--dc-teal) !important;
  color: #fff !important;
}

.cir-totales {
  margin: 0;
  margin-left: auto;
  color: var(--dc-navy);
  font-size: 0.95rem;
  font-weight: 600;
}

.cir-totales strong {
  font-weight: 800;
  color: var(--dc-teal-deep);
}

.page-circuito .panel {
  background: var(--dc-white);
  border: 1px solid var(--dc-line);
  border-radius: var(--radius-card);
  box-shadow: var(--dc-shadow);
  overflow: hidden;
}

.page-circuito .panel__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--dc-line);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--dc-navy);
}

.page-circuito .panel__head-icon {
  display: inline-flex;
  color: var(--dc-teal);
}

.page-circuito .panel__body {
  padding: 12px 14px 16px;
}

.cir-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.cir-chart-body {
  max-height: 240px;
  display: grid;
  place-items: center;
}

.cir-chart-body canvas {
  max-height: 200px !important;
  width: 100% !important;
}

.cir-chart-body--tall canvas {
  max-height: 220px !important;
}

.cir-chart-body .empty {
  margin: 0;
  color: var(--dc-muted);
}

.cir-tabla-panel .table-wrap {
  max-height: min(48vh, 520px);
  overflow: auto;
  padding: 0;
}

.cir-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.cir-table th,
.cir-table td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--dc-line);
}

.cir-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #0f3d3a;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cir-table tbody tr:nth-child(even) {
  background: rgba(42, 157, 143, 0.04);
}

.cir-table tbody tr:hover {
  background: rgba(42, 157, 143, 0.1);
}

.cir-table .cir-min {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cir-table .cir-min--espera {
  color: #b42318;
}

.cir-table .cir-min--cocina {
  color: #b45309;
}

.cir-table .cir-min--servir {
  color: #1f7a70;
}

.cir-table .cir-min--cobro {
  color: #4b5563;
}

.cir-table .cir-min--total {
  color: var(--dc-navy);
  font-weight: 800;
}

.cir-table .cir-min--money {
  color: var(--dc-teal-deep);
  font-weight: 800;
}

.cir-table .cir-pedido {
  font-weight: 700;
  color: var(--dc-navy);
}

.cir-table .cir-mesa {
  display: inline-flex;
  min-width: 34px;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(42, 157, 143, 0.12);
  color: var(--dc-teal-deep);
  font-weight: 700;
  font-size: 0.82rem;
}

.cir-table .empty {
  text-align: center;
  color: var(--dc-muted);
  padding: 28px 12px;
}

.cir-chart-body--tall {
  max-height: 280px;
  height: 240px;
}

.cir-section {
  margin-bottom: 16px;
}

.cir-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 10px 16px 0;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--dc-muted);
}

.cir-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cir-legend__item::before {
  content: "";
  width: 16px;
  height: 3px;
  border-radius: 99px;
  background: currentColor;
}

.cir-legend__item--cli {
  color: #2a9d8f;
}

.cir-legend__item--mozo {
  color: #0f3d3a;
}

.cir-legend__item--coc {
  color: #c56a1a;
}

.page-circuito .hp-kpis {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 14px;
}

.cir-podios {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.cir-podio-panel {
  overflow: hidden;
}

.cir-podio-panel--ok .panel__head-icon {
  color: var(--dc-teal);
}

.cir-podio-panel--bad .panel__head-icon {
  color: #b42318;
}

.cir-podio-lead {
  margin: 0;
  padding: 0 16px 4px;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--dc-muted);
}

.cir-podio-body {
  min-height: 268px;
  display: grid;
  place-items: end center;
  padding: 8px 14px 6px !important;
}

.cir-podio-panel--ok .cir-podio-body {
  background:
    linear-gradient(180deg, rgba(42, 157, 143, 0.08) 0%, transparent 48%),
    var(--dc-white);
}

.cir-podio-panel--bad .cir-podio-body {
  background:
    linear-gradient(180deg, rgba(180, 35, 24, 0.08) 0%, transparent 48%),
    var(--dc-white);
}

.cir-podio-body .empty {
  margin: auto;
  color: var(--dc-muted);
  font-size: 0.92rem;
  place-self: center;
  text-align: center;
}

.cir-podio {
  display: grid;
  grid-template-columns: 1fr 1.12fr 1fr;
  gap: 10px;
  align-items: end;
  width: 100%;
}

.cir-podio__slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
  opacity: 0;
  transform: translateY(16px);
  animation: cir-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.cir-podio__slot--2 { animation-delay: 0.08s; }
.cir-podio__slot--1 { animation-delay: 0.18s; }
.cir-podio__slot--3 { animation-delay: 0.28s; }

@keyframes cir-rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cir-podio__medal {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.98rem;
  margin-bottom: 8px;
  box-shadow: 0 6px 16px rgba(15, 61, 58, 0.12);
}

.cir-podio__slot--1 .cir-podio__medal {
  width: 48px;
  height: 48px;
  font-size: 1.12rem;
}

.cir-podio-panel--ok .cir-podio__slot--1 .cir-podio__medal {
  background: linear-gradient(145deg, #f0c14b, #d4a017);
  color: #3d2e05;
}

.cir-podio-panel--ok .cir-podio__slot--2 .cir-podio__medal {
  background: linear-gradient(145deg, #d7dde5, #9aa5b1);
  color: #2a3340;
}

.cir-podio-panel--ok .cir-podio__slot--3 .cir-podio__medal {
  background: linear-gradient(145deg, #e0a878, #b87333);
  color: #3a2410;
}

.cir-podio-panel--bad .cir-podio__slot--1 .cir-podio__medal {
  background: linear-gradient(145deg, #c2412d, #8b1e14);
  color: #fff;
}

.cir-podio-panel--bad .cir-podio__slot--2 .cir-podio__medal {
  background: linear-gradient(145deg, #8a4a42, #5c2c28);
  color: #f6e7e4;
}

.cir-podio-panel--bad .cir-podio__slot--3 .cir-podio__medal {
  background: linear-gradient(145deg, #6b5348, #43302b);
  color: #f3e6dc;
}

.cir-podio__name {
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--dc-navy);
  line-height: 1.25;
  margin: 0 0 2px;
  max-width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cir-podio__slot--1 .cir-podio__name {
  font-size: 0.98rem;
}

.cir-podio__meta {
  margin: 0 0 8px;
  font-size: 0.72rem;
  color: var(--dc-muted);
  font-weight: 650;
  line-height: 1.35;
}

.cir-podio__time {
  display: block;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--dc-teal-deep);
}

.cir-podio-panel--bad .cir-podio__time {
  color: #b42318;
}

.cir-podio__money {
  display: block;
  font-weight: 800;
  color: var(--dc-navy);
  font-variant-numeric: tabular-nums;
}

.cir-podio__ratio {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--dc-muted);
}

.cir-podio__block {
  width: 100%;
  border-radius: 12px 12px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 12px;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.cir-podio__slot--1 .cir-podio__block { height: 118px; }
.cir-podio__slot--2 .cir-podio__block { height: 86px; }
.cir-podio__slot--3 .cir-podio__block { height: 68px; }

.cir-podio-panel--ok .cir-podio__slot--1 .cir-podio__block {
  background: linear-gradient(180deg, var(--dc-teal) 0%, var(--dc-teal-deep) 100%);
}

.cir-podio-panel--ok .cir-podio__slot--2 .cir-podio__block {
  background: linear-gradient(180deg, #3d6b66 0%, var(--dc-navy) 100%);
}

.cir-podio-panel--ok .cir-podio__slot--3 .cir-podio__block {
  background: linear-gradient(180deg, #5a8a84 0%, #2f5551 100%);
}

.cir-podio-panel--bad .cir-podio__slot--1 .cir-podio__block {
  background: linear-gradient(180deg, #c2412d 0%, #7a1a12 100%);
}

.cir-podio-panel--bad .cir-podio__slot--2 .cir-podio__block {
  background: linear-gradient(180deg, #8f3c34 0%, #4a1f1b 100%);
}

.cir-podio-panel--bad .cir-podio__slot--3 .cir-podio__block {
  background: linear-gradient(180deg, #6e4a42 0%, #3a2a26 100%);
}

.cir-podio__place {
  font-size: 1.2rem;
}

.cir-podio__slot--1 .cir-podio__place {
  font-size: 1.45rem;
}

.cir-sugs {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
}

.cir-sug {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-card);
  border: 1px solid rgba(197, 106, 26, 0.22);
  background: rgba(197, 106, 26, 0.08);
  color: var(--dc-navy);
  font-weight: 650;
  font-size: 0.92rem;
  line-height: 1.4;
}

.cir-sug p {
  margin: 0;
}

.cir-sug__icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: rgba(197, 106, 26, 0.16);
  color: #c56a1a;
}

.cir-sug__icon svg {
  width: 18px;
  height: 18px;
}

.cir-sug--espera,
.cir-sug--salon {
  border-color: rgba(180, 35, 24, 0.22);
  background: rgba(180, 35, 24, 0.07);
}

.cir-sug--espera .cir-sug__icon,
.cir-sug--salon .cir-sug__icon {
  background: rgba(180, 35, 24, 0.14);
  color: #b42318;
}

.cir-sug--servir {
  border-color: rgba(42, 157, 143, 0.28);
  background: rgba(42, 157, 143, 0.08);
}

.cir-sug--servir .cir-sug__icon {
  background: rgba(42, 157, 143, 0.16);
  color: var(--dc-teal-deep);
}

.cir-sug--cobro {
  border-color: rgba(75, 85, 99, 0.28);
  background: rgba(75, 85, 99, 0.08);
}

.cir-sug--cobro .cir-sug__icon {
  background: rgba(75, 85, 99, 0.14);
  color: #374151;
}

.cir-sug--pico,
.cir-sug--info {
  border-color: rgba(15, 61, 58, 0.16);
  background: rgba(15, 61, 58, 0.05);
}

.cir-sug--pico .cir-sug__icon,
.cir-sug--info .cir-sug__icon {
  background: rgba(15, 61, 58, 0.1);
  color: var(--dc-navy);
}

.hp-badge--now {
  background: rgba(42, 157, 143, 0.18);
  color: var(--dc-teal-deep);
}

.hp-table tr.is-ahora {
  outline: 2px solid rgba(42, 157, 143, 0.35);
  outline-offset: -2px;
}

.hp-table tr.is-lento td,
.cir-table tbody tr.is-lento td {
  background: rgba(180, 35, 24, 0.06);
}

.cir-table tbody tr.is-lento .cir-min.is-lento {
  color: #b42318;
  font-weight: 800;
}

@media (max-width: 980px) {
  .page-circuito .hp-kpis {
    grid-template-columns: 1fr 1fr;
  }

  .cir-podios {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .cir-shell {
    padding: 14px 16px 28px;
  }

  .cir-layout {
    grid-template-columns: 1fr;
  }

  .cir-totales {
    margin-left: 0;
    width: 100%;
  }

  .cir-tabla-panel .table-wrap {
    max-height: none;
  }
}

@media (max-width: 640px) {
  .page-circuito .hp-kpis {
    grid-template-columns: 1fr;
  }
}
