/* Caixa: a planilha de vendas vira um painel de cobrança. Claro, tinta azul-marinho e um índigo vivo. */
.sc-caixa {
  --ink: #12142b;
  --muted: #6b6f86;
  --line: #e8e9f1;
  --indigo: #4b3cf0;
  --good: #0c9f6f;
  --bad: #e5484d;
  background:
    radial-gradient(60% 80% at 82% 8%, rgb(122 108 255 / 0.32), transparent 62%),
    radial-gradient(50% 60% at 8% 92%, rgb(12 159 111 / 0.16), transparent 62%),
    linear-gradient(160deg, #eef0fb, #dde2f3);
  color: var(--ink);
}

/* A planilha, inclinada, de onde saem os dados */
.cx-sheet-pos {
  position: absolute;
  top: 8em;
  left: calc(50% - 32.5em);
  width: 19em;
  transform: perspective(50em) rotateY(18deg) rotateX(4deg);
  transform-origin: left center;
}

.cx-sheet {
  overflow: hidden;
  border-radius: 0.9em;
  background: #fff;
  box-shadow: 0 0 0 1px rgb(18 20 43 / 0.06), 0 2em 3.5em -1.5em rgb(18 20 43 / 0.4);
}

.cx-sheet__bar {
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.6em 0.8em;
  border-bottom: 1px solid var(--line);
}

.cx-sheet__ico {
  display: grid;
  place-items: center;
  width: 1.5em;
  height: 1.5em;
  border-radius: 0.4em;
  background: #1f9d55;
  color: #fff;
}

.cx-sheet__ico .sc-ico {
  width: 1em;
  height: 1em;
}

.cx-sheet__bar b {
  font-size: 0.8em;
}

.cx-sheet__bar span:last-child {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.66em;
}

.cx-r {
  --flash: rgb(75 60 240 / 0.16);
  display: grid;
  grid-template-columns: 1.7em 1.7fr 1fr 0.9fr 1fr;
  font-size: 0.66em;
}

.cx-r span {
  overflow: hidden;
  padding: 0.5em 0.55em;
  border-right: 1px solid #eef0f3;
  border-bottom: 1px solid #eef0f3;
  white-space: nowrap;
}

.cx-r span:first-child {
  background: #f6f7fa;
  color: #9a9db0;
  text-align: center;
}

.cx-r--letters span {
  background: #f6f7fa;
  color: #9a9db0;
  text-align: center;
}

.cx-r--head span {
  font-weight: 700;
}

.cx-r .is-late {
  color: var(--bad);
  font-weight: 650;
}

.cx-r .is-ok {
  color: var(--good);
  font-weight: 650;
}

.cx-beam {
  position: absolute;
  top: 14.5em;
  left: calc(50% - 13.6em);
  width: 4.8em;
  height: 4em;
  overflow: visible;
  fill: none;
  stroke: var(--indigo);
  stroke-width: 2.5;
  stroke-linecap: round;
  opacity: 0.7;
}

/* O painel */
.cx-app {
  position: absolute;
  top: 2.4em;
  left: calc(50% - 9em);
  display: grid;
  grid-template-columns: 4.2em minmax(0, 1fr);
  width: 40em;
  height: 35em;
  overflow: hidden;
  border-radius: 1.3em;
  background: #fff;
  box-shadow: 0 0 0 1px rgb(18 20 43 / 0.06), 0 2.5em 4.5em -1.5em rgb(18 20 43 / 0.45);
}

.cx-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9em;
  padding: 1.2em 0;
  border-right: 1px solid var(--line);
  background: #f7f8fc;
  color: #9a9db0;
}

.cx-side > span {
  display: grid;
  place-items: center;
  width: 2.2em;
  height: 2.2em;
  border-radius: 0.7em;
}

.cx-side .sc-ico {
  width: 1.15em;
  height: 1.15em;
}

.cx-side .is-on {
  background: rgb(75 60 240 / 0.1);
  color: var(--indigo);
}

.cx-side .cx-logo {
  margin-bottom: 0.6em;
  background: linear-gradient(140deg, #7a6cff, var(--indigo));
  color: #fff;
  font-weight: 850;
  font-stretch: 120%;
}

.cx-main {
  display: flex;
  flex-direction: column;
  gap: 1.1em;
  min-width: 0;
  padding: 1.4em 1.6em;
}

.cx-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
}

.cx-kicker {
  color: var(--muted);
  font-size: 0.72em;
}

.cx-title {
  font-size: 1.5em;
  font-weight: 750;
  font-stretch: 105%;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.cx-tools {
  display: flex;
  align-items: center;
  gap: 0.7em;
}

.cx-search {
  display: flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.55em 0.9em;
  border-radius: 99em;
  background: #f3f4f9;
  color: var(--muted);
  font-size: 0.72em;
}

.cx-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8em;
}

.cx-kpi {
  display: grid;
  align-content: start;
  gap: 0.25em;
  padding: 0.9em 1em;
  border: 1px solid var(--line);
  border-radius: 1em;
}

.cx-kpi p {
  color: var(--muted);
  font-size: 0.72em;
}

.cx-kpi b {
  font-size: 1.45em;
  font-weight: 750;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.cx-good,
.cx-bad {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 0.3em;
  padding: 0.25em 0.6em;
  border-radius: 99em;
  font-size: 0.66em;
  font-weight: 650;
}

.cx-good {
  background: rgb(12 159 111 / 0.12);
  color: var(--good);
}

.cx-bad {
  background: rgb(229 72 77 / 0.12);
  color: var(--bad);
}

.cx-kpi--ring {
  display: flex;
  align-items: center;
  gap: 0.8em;
}

.cx-ring {
  width: 3.6em;
  height: 3.6em;
  flex: none;
  fill: none;
  stroke-width: 5;
  transform: rotate(-90deg);
}

.cx-ring circle {
  stroke: #eceefa;
}

.cx-ring .cx-ring__fg {
  stroke: var(--indigo);
  stroke-linecap: round;
  stroke-dasharray: 78 100;
}

.film.is-playing .cx-ring__fg {
  animation: cx-ring 1s var(--ease-out) both;
  animation-delay: calc(var(--film) * 0.44);
}

@keyframes cx-ring {
  from {
    stroke-dasharray: 0 100;
  }
}

.cx-row2 {
  display: grid;
  flex: 1;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.8em;
  min-height: 0;
}

.cx-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 1em;
  border: 1px solid var(--line);
  border-radius: 1em;
}

.cx-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6em;
}

.cx-card__head b {
  font-size: 0.85em;
}

.cx-card__head > span {
  color: var(--muted);
  font-size: 0.7em;
}

.cx-chart__total {
  display: grid;
  margin-top: 0.5em;
  font-size: 1.5em;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.cx-chart__total small {
  display: flex;
  align-items: center;
  gap: 0.3em;
  color: var(--good);
  font-size: 0.45em;
  font-weight: 600;
  letter-spacing: 0;
}

.cx-chart > svg {
  display: block;
  width: 100%;
  margin-top: auto;
  overflow: visible;
}

.cx-area {
  fill: url(#cx-fill);
}

.cx-line {
  fill: none;
  stroke: var(--indigo);
  stroke-width: 3;
  stroke-linecap: round;
}

.cx-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 0.4em;
  color: #9a9db0;
  font-family: var(--mono);
  font-size: 0.6em;
}

.cx-card__head .cx-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.45em 0.75em;
  overflow: hidden;
  border-radius: 99em;
  background: var(--indigo);
  color: #fff;
  font-size: 0.68em;
  font-weight: 650;
  white-space: nowrap;
}

.cx-person {
  display: grid;
  grid-template-columns: 2em minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6em;
  margin-top: 0.75em;
}

.cx-person .sc-av {
  font-size: 0.72em;
}

.cx-person > span:nth-child(2) {
  display: grid;
  min-width: 0;
  line-height: 1.2;
}

.cx-person b {
  overflow: hidden;
  font-size: 0.78em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.cx-person small {
  color: var(--muted);
  font-size: 0.68em;
}

.cx-days {
  font-size: 0.66em;
  font-weight: 650;
}

.cx-days .sc-out {
  padding: 0.25em 0.6em;
  border-radius: 99em;
  background: rgb(229 72 77 / 0.12);
  color: var(--bad);
}

.cx-days .sc-in {
  padding: 0.25em 0.6em;
  border-radius: 99em;
  background: rgb(12 159 111 / 0.12);
  color: var(--good);
}

.cx-toast {
  position: absolute;
  right: 1.4em;
  bottom: 1.4em;
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.7em 1.1em;
  border-radius: 99em;
  background: var(--ink);
  color: #fff;
  font-size: 0.78em;
  font-weight: 600;
  box-shadow: 0 1em 2em -0.6em rgb(18 20 43 / 0.5);
}

.cx-toast .sc-ico {
  color: #42d9a4;
}

/* O cursor clica em "Lembrar todos" (medidas a partir do canto de cima à direita do cartão) */
.cx-cursor {
  right: 0;
  left: auto;
}

.film.is-playing .cx-cursor {
  animation: cx-cursor var(--film) var(--ease-out) both;
}

@keyframes cx-cursor {
  0%, 53% { opacity: 0; transform: translate(-7em, 9em); }
  56% { opacity: 1; transform: translate(-5em, 6em); }
  60% { transform: translate(-2.5em, 1.75em) scale(1); }
  61.5% { transform: translate(-2.5em, 1.75em) scale(0.85); }
  63% { opacity: 1; transform: translate(-2.5em, 1.75em) scale(1); }
  67%, 100% { opacity: 0; transform: translate(-1em, 5em); }
}

@container film (max-width: 560px) {
  .sc-caixa {
    font-size: 2.6cqw;
  }

  .cx-sheet-pos,
  .cx-beam {
    display: none;
  }

  .cx-app {
    top: 2em;
    left: 1em;
    width: calc(100% - 2em);
    height: 44em;
  }

  .cx-row2 {
    grid-template-columns: minmax(0, 1fr);
  }
}
