.iris-demo {
  --demo-purple: #4a3bc9;
  --demo-blue: #2964db;
  --demo-green: #20c46a;
  --demo-ink: #111b2c;
  margin-top: 3rem;
  overflow: hidden;
  border: 1px solid #30465b;
  background: #070a11;
  box-shadow: 0 24px 60px #10233826;
  color: #f5f8fc;
}

.iris-demo__topbar,
.iris-demo__brand,
.iris-demo__tabs,
.iris-demo__intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.iris-demo__topbar {
  padding: 0.9rem clamp(1rem, 3vw, 2rem);
  border-bottom: 1px solid #24354a;
  background: #050b15;
}

.iris-demo__brand {
  justify-content: flex-start;
  gap: 1rem;
}

.iris-demo__brand img {
  width: 105px;
  max-height: 36px;
  object-fit: contain;
}

.iris-demo__brand > span {
  padding-left: 1rem;
  border-left: 1px solid #52657a;
  font-size: 1.08rem;
  font-weight: 800;
}

.iris-demo__brand small {
  display: block;
  color: #b7c8d7;
  font-size: 0.68rem;
  font-weight: 400;
}

.iris-demo__sample {
  color: #b7c8d7;
  font-size: 0.76rem;
  text-align: right;
}

.iris-demo__tabs {
  justify-content: flex-start;
  gap: 0;
  overflow-x: auto;
  border-bottom: 1px solid #24354a;
  scrollbar-width: thin;
}

.iris-demo__tab {
  flex: 1 0 auto;
  min-height: 54px;
  padding: 0.85rem 1rem;
  border: 0;
  border-bottom: 3px solid transparent;
  background: #091523;
  color: #b8cad7;
  font: 700 0.86rem/1.2 var(--font);
  cursor: pointer;
}

.iris-demo__tab:hover,
.iris-demo__tab[aria-selected="true"] {
  background: #132139;
  color: #fff;
}

.iris-demo__tab[aria-selected="true"] {
  border-bottom-color: var(--green);
}

.iris-demo__panel {
  min-width: 0;
  padding: clamp(1rem, 3vw, 2.5rem);
}

.iris-demo__panel[hidden] {
  display: none;
}

.iris-demo__intro {
  align-items: end;
  margin-bottom: clamp(1.4rem, 3vw, 2.5rem);
}

.iris-demo__intro > div {
  max-width: 600px;
}
.iris-demo__intro p {
  max-width: 44ch;
  margin: 0;
  color: #c2d2df;
  line-height: 1.55;
}
.iris-demo__intro h3 {
  margin: 0.4rem 0 0;
  color: #fff;
  font-size: clamp(2rem, 3vw, 3rem);
}
.iris-demo__overline {
  color: #46cde5;
  font-size: 0.77rem;
  font-weight: 700;
}

/* Monitoramento de pátio */
.patio-live {
  border: 1px solid #383079;
  background: #050509;
  color: #f4f5fa;
}

.patio-live__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #34305a;
  font-size: 0.78rem;
}

.patio-live__live {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #c8f4d7;
}
.patio-live__live i,
.patio-live__legend i {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  background: var(--demo-green);
}
.patio-live__live.is-paused {
  color: #d9d9e5;
}
.patio-live__live.is-paused i {
  background: #b1b2bd;
}
.patio-live__toolbar button {
  padding: 0.42rem 0.7rem;
  border: 1px solid #6e70a8;
  background: #171b35;
  color: #fff;
  font: inherit;
  cursor: pointer;
}
.patio-live__toolbar button:hover {
  background: #2a2c62;
}
.patio-live__map-scroll,
.patio-live__table-scroll {
  overflow-x: auto;
}
.patio-live__map {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 1.3rem;
  min-width: 680px;
  padding: 1.2rem;
  border: 2px solid var(--demo-purple);
  margin: 0.65rem;
  border-radius: 8px;
}
.patio-live__lanes {
  min-width: 0;
}
.patio-live__lane {
  display: grid;
  grid-template-columns: 90px 86px minmax(0, 1fr) 54px;
  align-items: center;
  gap: 0.65rem;
  min-height: 90px;
}
.patio-live__lane + .patio-live__lane {
  border-top: 1px solid #27263d;
}
.patio-live__lane-title {
  font-size: 0.76rem;
  font-weight: 700;
}
.patio-live__lane-title small {
  display: block;
  color: #bfc4d7;
  font-weight: 400;
}
.patio-live__end {
  color: #c5cadc;
  font-size: 0.64rem;
}
.patio-live__rail {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 44px;
  isolation: isolate;
}
.patio-live__rail::before {
  content: "";
  position: absolute;
  z-index: -2;
  left: 0;
  right: 0;
  top: 20px;
  height: 3px;
  background: #d6d7ff;
  box-shadow: 0 0 8px #7a73ff;
}
.patio-live__rail::after {
  content: "";
  position: absolute;
  right: 0;
  top: 14px;
  border-left: 12px solid #f4f4ff;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
}
.patio-live__lane[data-patio-lane="B"] .patio-live__rail::after {
  right: auto;
  left: 0;
  transform: rotate(180deg);
}
.patio-live__sensor {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  background: var(--demo-green);
  border: 2px solid #b8edc8;
  color: #d9f8e0;
  font-size: 0.52rem;
  text-indent: 0;
}
.patio-live__wagon {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: min(170px, 55%);
  min-height: 33px;
  padding: 0.2rem 0.45rem;
  border: 1px solid #777b93;
  border-radius: 6px;
  background: #333e54;
  color: #f9fbff;
  font-size: 0.67rem;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}
.patio-live__lane.is-passing .patio-live__wagon {
  border-color: #aac1ff;
  background: #1b35aa;
  box-shadow: 0 0 20px #394fe7aa;
}
.patio-live__lane.is-passing .patio-live__sensor {
  box-shadow: 0 0 14px #2add78;
}
.patio-live__legend {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  border-left: 1px solid #34305a;
  padding-left: 1rem;
  font-size: 0.65rem;
}
.patio-live__legend strong {
  font-size: 0.68rem;
}
.patio-live__legend span {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.patio-live__legend .legend-identificado {
  background: #283ce7;
}
.patio-live__legend .legend-sem-tag {
  background: #f2a81e;
}
.patio-live__legend .legend-sensor {
  background: var(--demo-green);
}
.patio-live__summaries {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  padding: 0 0.65rem 0.65rem;
}
.patio-live__summary {
  min-width: 0;
  padding: 0.75rem 1rem;
  border: 2px solid var(--demo-purple);
  border-radius: 8px;
}
.patio-live__summary > strong {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
}
.patio-live__summary dl {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
}
.patio-live__summary dt {
  color: #bdc5d6;
  font-size: 0.64rem;
}
.patio-live__summary dd {
  margin: 0;
  color: #f6ee52;
  font-size: 0.79rem;
  font-weight: 700;
}
.patio-live__tables {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  padding: 0.15rem 0.65rem 0.65rem;
}
.patio-live__table-wrap {
  min-width: 0;
  border: 1px solid #312e65;
}
.patio-live__table-wrap h4 {
  margin: 0;
  padding: 0.65rem;
  background: #24206c;
  font-size: 0.76rem;
  text-align: center;
}
.patio-live__table-wrap h4 span {
  font-weight: 400;
}
.patio-live table {
  width: 100%;
  min-width: 360px;
  border-collapse: collapse;
  font-size: 0.68rem;
}
.patio-live th {
  padding: 0.65rem 0.45rem;
  background: #302778;
  text-align: left;
}
.patio-live td {
  padding: 0.58rem 0.45rem;
  border-top: 1px solid #292945;
}
.patio-live tbody tr {
  background: #0e0e18;
}
.patio-live tbody tr:first-child {
  background: #1b1b35;
}
.patio-live tbody td:nth-child(3) {
  font-weight: 700;
}
.patio-live__no-tag {
  color: #ffc246;
}

/* Diagnóstico do equipamento */
.status-device {
  display: grid;
  grid-template-columns: minmax(280px, 1.7fr) repeat(
      3,
      minmax(100px, 0.56fr)
    ) minmax(135px, 0.8fr);
  gap: 0.65rem;
  padding: 0.75rem;
  border: 1px solid #dce4ee;
  border-radius: 20px;
  background: #f5f8fc;
  color: #172238;
}
.status-device__identity,
.status-device__gauge,
.status-device__state > div {
  min-width: 0;
  padding: 1rem;
  border: 1px solid #e0e6ee;
  border-radius: 15px;
  background: #fff;
}
.status-device__serial {
  display: block;
  padding: 0.35rem 0.6rem;
  border-radius: 20px;
  background: #e9eeff;
  color: #2358c4;
  font-size: 0.67rem;
  font-weight: 800;
}
.status-device__identity h4 {
  margin: 0.75rem 0;
  font-size: 1.07rem;
}
.status-device__location {
  display: inline-block;
  padding: 0.35rem 0.55rem;
  border: 1px solid #e1e7ee;
  border-radius: 20px;
  color: #58718a;
  font-size: 0.69rem;
}
.status-device__history {
  margin-top: 0.8rem;
  padding: 0.75rem;
  border: 1px solid #e4e9f0;
  border-radius: 12px;
}
.status-device__history strong {
  font-size: 0.72rem;
}
.status-device__history-legend {
  float: right;
  color: #536b7e;
  font-size: 0.62rem;
}
.status-device__history-legend i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin: 0 0.25rem 0 0.5rem;
  border-radius: 50%;
  background: var(--demo-green);
}
.status-device__history-legend i:last-of-type {
  background: #ef5151;
}
.status-device__history svg {
  display: block;
  width: 100%;
  height: 110px;
  margin-top: 0.5rem;
}
.status-device__history-grid {
  fill: none;
  stroke: #e8edf2;
  stroke-width: 1;
  stroke-dasharray: 3 4;
}
.status-device__history-line {
  fill: none;
  stroke: #1fbe61;
  stroke-width: 2;
  stroke-dasharray: 4 3;
}
.status-device__history-drop {
  fill: none;
  stroke: #21bf63;
  stroke-width: 2;
}
.status-device__history-off {
  fill: #ef5151;
}
.status-device__history-note {
  color: #60748a;
  font-size: 0.62rem;
}
.status-device__gauge {
  text-align: center;
}
.status-device__gauge > span {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
}
.status-device__gauge > small {
  display: block;
  margin-top: 1rem;
  color: #61758a;
  font-size: 0.62rem;
}
.status-device__dial {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 94px;
  height: 94px;
  margin: 1.2rem auto 0;
  background: conic-gradient(
    var(--gauge-color) var(--gauge-progress),
    #dce3eb 0
  );
  border-radius: 50%;
  transform: rotate(-15deg);
}
.status-device__dial::before {
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: #fff;
  content: "";
}
.status-device__dial strong,
.status-device__dial small {
  position: relative;
  transform: rotate(15deg);
}
.status-device__dial strong {
  font-size: 1.4rem;
}
.status-device__dial small {
  color: #647c92;
  font-size: 0.72rem;
}
.status-device__state {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.status-device__state > span {
  padding: 0.45rem;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 800;
  text-align: center;
}
.status-device__online {
  background: #ddf7e7;
  color: #126d3e;
}
.status-device__idle {
  background: #e6eaf2;
  color: #536174;
}
.status-device__state > div {
  flex: 1;
  padding: 0.7rem;
}
.status-device__state small {
  display: block;
  color: #657b91;
  font-size: 0.6rem;
}
.status-device__state strong {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.72rem;
}

/* Indicadores */
.charts-view {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  padding: 0.7rem;
  background: #edf1f7;
}
.charts-view__card {
  min-width: 0;
  min-height: 235px;
  margin: 0;
  padding: 0.75rem;
  border: 1px solid #d9e1eb;
  border-radius: 12px;
  background: #fff;
  color: #172238;
}
.charts-view__card figcaption {
  margin: 0;
  color: #172238;
  font-size: 0.82rem;
  font-weight: 800;
}
.charts-view__plot {
  width: 100%;
  height: 180px;
  margin-top: 0.3rem;
}
.charts-view__plot svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.charts-view__plot .grid {
  stroke: #dfe6ee;
  stroke-width: 1;
}
.charts-view__plot .axis-label {
  fill: #5c6e82;
  font:
    10px Arial,
    sans-serif;
}
.charts-view__plot .area {
  opacity: 0.2;
}
.charts-view__plot .line {
  fill: none;
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.charts-view__plot .point {
  fill: #fff;
  stroke-width: 2;
}
.charts-view__donut-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  min-height: 177px;
}
.charts-view__donut {
  flex: none;
  position: relative;
  width: 130px;
  height: 130px;
  border-radius: 50%;
}
.charts-view__donut::after {
  content: "";
  position: absolute;
  inset: 32px;
  border-radius: 50%;
  background: #fff;
}
.charts-view__donut--identificacao {
  background: conic-gradient(#1fbf63 0 87.5%, #ef5151 87.5%);
}
.charts-view__donut--prefixos {
  background: conic-gradient(
    #00b6d7 0 50%,
    #f08a22 50% 87.5%,
    #ce68ec 87.5%
  );
}
.charts-view__examples {
  margin: 0.35rem 0 0;
  color: #5c6e82;
  font-size: 0.7rem;
}
.charts-view__legend {
  display: grid;
  gap: 0.45rem;
  color: #34435a;
  font-size: 0.65rem;
}
.charts-view__legend span {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.charts-view__legend i {
  width: 8px;
  height: 8px;
  flex: none;
  background: var(--swatch);
}
.charts-view__bar {
  fill: #21bf63;
}
.charts-view__bar--miss {
  fill: #ef5151;
}

/* Consulta e relatórios */
.reports-view {
  padding: clamp(1rem, 2vw, 1.5rem);
  background: #f7f9fc;
  color: #182334;
}
.reports-view__filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.reports-view__filters label {
  display: grid;
  gap: 0.3rem;
  margin: 0;
  color: #34435a;
  font-size: 0.75rem;
  font-weight: 700;
}
.reports-view__filters input,
.reports-view__filters select {
  min-width: 0;
  width: 100%;
  height: 40px;
  padding: 0.5rem 0.65rem;
  border: 1px solid #cbd6e2;
  border-radius: 5px;
  background: #fff;
  color: #172238;
  font: 0.82rem var(--font);
}
.reports-view__filters input:focus-visible,
.reports-view__filters select:focus-visible {
  outline-color: #285bd5;
}
.reports-view__actions {
  display: flex;
  grid-column: 1 / -1;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.35rem 0 0.8rem;
}
.reports-view__actions button {
  padding: 0.6rem 0.8rem;
  border: 0;
  border-radius: 4px;
  background: #3445b6;
  color: #fff;
  font: 700 0.78rem var(--font);
  cursor: pointer;
}
.reports-view__actions button:nth-child(2) {
  background: #e2e8f0;
  color: #172238;
}
.reports-view__actions button:nth-child(3) {
  background: #239d50;
}
.reports-view__actions button:hover {
  filter: brightness(1.08);
}
.reports-view__heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-top: 1px solid #d6dfe9;
  font-size: 0.8rem;
}
.reports-view__heading span {
  color: #53667c;
}
.reports-view__results {
  display: grid;
  gap: 0.55rem;
}
.reports-view__group {
  overflow: hidden;
  border: 1px solid #d2dce8;
  border-radius: 6px;
  background: #fff;
}
.reports-view__group summary {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem;
  background: #1d2939;
  color: #fff;
  cursor: pointer;
  list-style: none;
}
.reports-view__group summary::-webkit-details-marker {
  display: none;
}
.reports-view__group summary::before {
  content: "+";
  font-size: 1.25rem;
  line-height: 1;
}
.reports-view__group[open] summary::before {
  content: "−";
}
.reports-view__group summary strong {
  flex: none;
  font-size: 0.8rem;
}
.reports-view__group summary span {
  min-width: 0;
  font-size: 0.74rem;
}
.reports-view__group summary time {
  margin-left: auto;
  color: #c3d5df;
  font-size: 0.68rem;
  white-space: nowrap;
}
.reports-view__table-scroll {
  overflow-x: auto;
  padding: 0.75rem;
}
.reports-view table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  font-size: 0.68rem;
}
.reports-view th,
.reports-view td {
  padding: 0.6rem 0.45rem;
  border: 1px solid #d4dce6;
  text-align: left;
  white-space: nowrap;
}
.reports-view th {
  background: #343434;
  color: #fff;
}
.reports-view tbody tr:nth-child(even) {
  background: #eef2f7;
}
.reports-view__empty {
  padding: 1.4rem;
  background: #fff;
  color: #53667c;
  font-size: 0.85rem;
}
.reports-view__note {
  margin: 0.8rem 0 0;
  color: #65788d;
  font-size: 0.72rem;
}

.iris-demo__panel.is-animating .patio-live__lane.is-passing .patio-live__wagon {
  animation: demo-wagon 850ms ease-out both;
}
.iris-demo__panel.is-animating .status-device__gauge,
.iris-demo__panel.is-animating .charts-view__card {
  animation: demo-card 500ms ease-out both;
}
.iris-demo__panel.is-animating .status-device__gauge:nth-of-type(2),
.iris-demo__panel.is-animating .charts-view__card:nth-child(2n) {
  animation-delay: 90ms;
}
@keyframes demo-wagon {
  from {
    opacity: 0.4;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes demo-card {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  .status-device {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .status-device__identity {
    grid-column: 1 / -1;
  }
  .status-device__gauge {
    min-height: 175px;
  }
}

@media (max-width: 800px) {
  .iris-demo__intro {
    align-items: start;
    flex-direction: column;
  }
  .iris-demo__intro p {
    max-width: 65ch;
  }
  .patio-live__summaries,
  .patio-live__tables,
  .charts-view {
    grid-template-columns: 1fr;
  }
  .reports-view__filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 570px) {
  .iris-demo__topbar {
    align-items: start;
    flex-direction: column;
    gap: 0.35rem;
  }
  .iris-demo__sample {
    text-align: left;
  }
  .iris-demo__tab {
    min-width: 140px;
  }
  .iris-demo__panel {
    padding: 1rem;
  }
  .patio-live__map {
    min-width: 680px;
  }
  .patio-live__summary dl {
    justify-content: flex-start;
    gap: 1rem;
  }
  .status-device {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .status-device__identity,
  .status-device__state {
    grid-column: 1 / -1;
  }
  .status-device__gauge {
    min-height: 160px;
  }
  .status-device__gauge:nth-of-type(4) {
    grid-column: 1 / -1;
  }
  .status-device__state {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .charts-view__donut-row {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .reports-view__filters {
    grid-template-columns: 1fr;
  }
  .reports-view__group summary {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .reports-view__group summary time {
    width: 100%;
    margin-left: 1.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .iris-demo *,
  .iris-demo *::before,
  .iris-demo *::after {
    animation: none !important;
    transition: none !important;
  }
}
