:root {
  --ink: #14202b;
  --muted: #667586;
  --soft: #eef3f7;
  --line: #d8e1ea;
  --panel: #ffffff;
  --page: #f5f7f9;
  --nav: #162431;
  --nav-2: #203242;
  --blue: #28516d;
  --orange: #ff6c37;
  --orange-dark: #dd5525;
  --green: #24a06b;
  --shadow: 0 18px 45px rgba(21, 34, 46, .08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family: Inter, "Segoe UI", Arial, Helvetica, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 292px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  color: #f6fbff;
  background:
    linear-gradient(180deg, rgba(22, 36, 49, .96), rgba(16, 27, 37, .98)),
    url("https://www.ptstransportes.com.br/images/resource/serv-2.jpg") center/cover;
  padding: 22px 16px;
}

.brand-card {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  padding: 16px;
  margin-bottom: 22px;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand img {
  width: 148px;
  max-height: 58px;
  object-fit: contain;
}

.brand span {
  min-width: 42px;
  border-radius: 6px;
  color: #fff;
  background: var(--orange);
  font-weight: 800;
  padding: 8px 10px;
  text-align: center;
}

.brand-card p {
  color: #c7d4df;
  margin: 12px 0 0;
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 5px;
}

.nav-label {
  color: #9eb0bf;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  margin: 18px 10px 6px;
  text-transform: uppercase;
}

.nav-link {
  display: flex;
  align-items: center;
  min-height: 42px;
  border-radius: 7px;
  color: #eaf1f7;
  line-height: 1.25;
  padding: 10px 12px;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255,255,255,.12);
}

.nav-link.active {
  box-shadow: inset 3px 0 0 var(--orange);
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  border-bottom: 1px solid rgba(216,225,234,.8);
  background: rgba(255,255,255,.92);
  padding: 0 34px;
  backdrop-filter: blur(12px);
}

.topbar-title {
  display: grid;
  gap: 3px;
}

.topbar-title span,
.eyebrow,
.metrics span,
.bi-code,
.form-heading span,
.hero-stat span,
.panel-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.topbar-title strong {
  font-size: 17px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.role-pill {
  border: 1px solid #cfe0eb;
  border-radius: 999px;
  color: var(--blue);
  background: #f7fbfd;
  font-size: 13px;
  font-weight: 800;
  padding: 8px 12px;
}

.hero-panel,
.bi-grid,
.metrics,
.panel,
.empty-state {
  margin-left: 34px;
  margin-right: 34px;
}

.hero-panel {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  min-height: 210px;
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(20, 32, 43, .96), rgba(40, 81, 109, .72)),
    url("https://www.ptstransportes.com.br/images/resource/serv-1.jpg") center/cover;
  box-shadow: var(--shadow);
  margin-top: 28px;
  margin-bottom: 22px;
  padding: 28px;
}

.detail-hero {
  min-height: 190px;
  background:
    linear-gradient(90deg, rgba(20, 32, 43, .96), rgba(40, 81, 109, .68)),
    url("https://www.ptstransportes.com.br/images/resource/serv-55.jpg") center/cover;
}

.hero-panel h1 {
  max-width: 840px;
  margin: 6px 0 0;
  font-size: 38px;
  line-height: 1.05;
}

.hero-panel .eyebrow,
.hero-panel .hero-copy {
  color: #dce8f1;
}

.hero-copy {
  max-width: 720px;
  margin: 12px 0 0;
  line-height: 1.55;
}

.hero-stat {
  min-width: 138px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 8px;
  background: rgba(255,255,255,.12);
  padding: 18px;
  text-align: right;
}

.hero-stat strong {
  display: block;
  color: #fff;
  font-size: 42px;
  line-height: 1;
  margin-top: 8px;
}

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 7px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 800;
  padding: 0 16px;
}

.primary-button {
  color: #fff;
  background: var(--orange);
}

.primary-button:hover {
  background: var(--orange-dark);
}

.primary-button:disabled {
  cursor: wait;
  opacity: .72;
}

.ghost-button {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

.bi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.bi-card,
.panel,
.empty-state,
.metrics article,
.login-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.bi-card {
  display: grid;
  gap: 14px;
  min-height: 212px;
  padding: 20px;
  box-shadow: 0 10px 24px rgba(24, 38, 50, .04);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.bi-card:hover {
  border-color: rgba(255,108,55,.55);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.bi-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bi-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  font-weight: 900;
}

.bi-card h2,
.empty-state h2,
.panel h2 {
  margin: 0;
}

.bi-card h2 {
  font-size: 20px;
  line-height: 1.2;
}

.bi-card p,
.empty-state p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

.card-action {
  align-self: end;
  color: var(--orange-dark);
  font-weight: 900;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.metrics article {
  display: grid;
  gap: 10px;
  padding: 18px 20px;
  box-shadow: 0 10px 24px rgba(24, 38, 50, .04);
}

.metrics article::before {
  content: "";
  display: block;
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: var(--orange);
}

.metrics strong {
  font-size: 23px;
  line-height: 1.2;
}

.panel,
.empty-state {
  margin-bottom: 24px;
  padding: 22px;
  box-shadow: 0 10px 24px rgba(24, 38, 50, .04);
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.status-bars {
  display: grid;
  gap: 12px;
}

.status-row {
  display: grid;
  grid-template-columns: minmax(120px, 220px) 1fr 80px;
  align-items: center;
  gap: 12px;
}

.status-row div {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf2;
}

.status-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
  background: #fff;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 14px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

th {
  color: var(--muted);
  background: #f7fafc;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

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

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    linear-gradient(90deg, rgba(20, 32, 43, .96), rgba(20, 32, 43, .58)),
    url("https://www.ptstransportes.com.br/images/resource/quemsomos.jpg") center/cover;
}

.login-panel {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 420px;
  width: min(1040px, calc(100% - 32px));
  gap: 34px;
  align-items: center;
}

.login-visual {
  color: #fff;
}

.login-visual img {
  width: 190px;
  margin-bottom: 44px;
}

.login-kicker {
  display: inline-flex;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px;
  color: #fff;
  background: rgba(255,255,255,.1);
  font-weight: 800;
  padding: 9px 12px;
}

.login-visual h1 {
  margin: 18px 0 12px;
  font-size: 58px;
  line-height: .96;
}

.login-visual p {
  max-width: 590px;
  color: #edf3f8;
  font-size: 19px;
  line-height: 1.5;
  margin: 0;
}

.login-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.login-facts span {
  border-radius: 999px;
  color: #fff;
  background: rgba(255,255,255,.14);
  font-size: 13px;
  font-weight: 800;
  padding: 9px 12px;
}

.login-card {
  display: grid;
  gap: 16px;
  padding: 28px;
  box-shadow: 0 28px 80px rgba(0,0,0,.24);
}

.form-heading {
  display: grid;
  gap: 5px;
}

.login-card h2 {
  margin: 0;
  font-size: 26px;
}

.alert {
  border-radius: 7px;
  color: #8a2f14;
  background: #fff0ea;
  padding: 12px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  padding: 0 12px;
}

input:focus {
  border-color: var(--orange);
  outline: 3px solid rgba(255,108,55,.16);
}

select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  padding: 0 10px;
}

.chart-title {
  align-items: flex-start;
}

.chart-controls {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.chart-controls label {
  min-width: 116px;
}

.chart-controls input {
  min-height: 38px;
}

.chart-stage {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #f8fbfd);
}

.chart-card {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 18px;
  opacity: 0;
  pointer-events: none;
  padding: 22px;
  transform: translateX(22px);
  transition: opacity .38s ease, transform .38s ease;
}

.chart-card.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) scale(1);
}

.chart-stage[data-effect="slide"] .chart-card {
  transform: translateX(42px);
}

.chart-stage[data-effect="zoom"] .chart-card {
  transform: scale(.96);
}

.chart-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.chart-card-head h3 {
  margin: 4px 0 0;
  font-size: 24px;
}

.chart-card-head strong {
  color: var(--blue);
  font-size: 32px;
}

.chart-kind {
  color: var(--orange-dark);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.chart-nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.chart-nav button {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 999px;
  background: #c8d4df;
  cursor: pointer;
  padding: 0;
}

.chart-nav button.active {
  width: 30px;
  background: var(--orange);
}

.donut-chart {
  display: grid;
  grid-template-columns: minmax(210px, 310px) minmax(220px, 1fr);
  align-items: center;
  gap: 28px;
  min-height: 300px;
}

.donut-chart svg {
  width: min(100%, 310px);
  transform: rotate(-90deg);
}

.donut-chart text {
  fill: var(--ink);
  font-size: 6px;
  font-weight: 900;
  transform: rotate(90deg);
  transform-origin: 20px 20px;
}

.donut-chart ul {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.donut-chart li {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 9px;
}

.donut-chart li i {
  width: 12px;
  height: 12px;
  border-radius: 4px;
}

.donut-chart li span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-chart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(34px, 1fr));
  align-items: end;
  gap: 10px;
  min-height: 310px;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 12px 12px 0;
}

.line-chart div {
  display: grid;
  grid-template-rows: 24px 1fr 22px;
  align-items: end;
  min-height: 290px;
  text-align: center;
}

.line-chart span {
  display: block;
  min-height: 8px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--orange), var(--blue));
}

.line-chart strong {
  color: var(--blue);
  font-size: 12px;
}

.line-chart small {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.compact-bars {
  align-self: center;
}

.resizable-table-wrap {
  max-height: 62vh;
}

.resizable-table {
  table-layout: fixed;
}

.resizable-table th {
  position: relative;
  min-width: 90px;
}

.resizable-table th span,
.resizable-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.resizable-table th span {
  display: block;
  padding-right: 10px;
}

.column-grip {
  position: absolute;
  top: 0;
  right: -4px;
  width: 9px;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: col-resize;
  padding: 0;
  z-index: 2;
}

.column-grip::after {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 4px;
  width: 1px;
  background: #bfd0de;
}

.bi-presentation:fullscreen {
  overflow: auto;
  background: var(--page);
  padding: 28px;
}

.bi-presentation:fullscreen .chart-stage {
  min-height: calc(100vh - 160px);
}

.user-form,
.user-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr)) auto auto;
  gap: 12px;
  align-items: end;
}

.user-row {
  border-top: 1px solid var(--line);
  padding: 18px 0;
}

.users-list .user-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.check {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  white-space: nowrap;
}

.check input,
.access-list input {
  min-height: auto;
  width: auto;
}

.access-list {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.access-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #f9fbfd;
  padding: 8px 10px;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .login-panel,
  .metrics,
  .user-form,
  .user-row,
  .donut-chart {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .chart-controls {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .topbar,
  .hero-panel,
  .bi-grid,
  .metrics,
  .panel,
  .empty-state {
    margin-left: 16px;
    margin-right: 16px;
  }

  .topbar {
    padding: 0 16px;
  }

  .hero-panel {
    margin-top: 16px;
    padding: 22px;
  }

  .hero-panel h1,
  .login-visual h1 {
    font-size: 36px;
  }
}
