* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: #111;
  background: #f4f4f4;
}

body.auth-pending .app {
  display: none;
}

body:not(.auth-pending) .login-screen {
  display: none;
}

[hidden] {
  display: none !important;
}

.app:not(.permissions-ready) .menu-button,
.app:not(.permissions-ready) .menu-group-title {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #0b0b0b;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 26px;
  border: 1px solid #2e2e2e;
  border-radius: 8px;
  color: #fff;
  background: #111;
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.34);
}

.login-brand {
  font-family: 'Montserrat', Arial, Helvetica, sans-serif;
  font-size: 1.45rem;
  font-weight: 800;
}

.login-card h1 {
  margin: 0;
  font-size: 1.1rem;
}

.login-card .field {
  display: grid;
  gap: 6px;
}

.login-card .field label {
  color: #cfcfcf;
  font-size: 0.76rem;
  font-weight: 800;
}

.login-card .field input {
  min-height: 42px;
  border: 1px solid #4a4a4a;
  border-radius: 6px;
  padding: 9px 11px;
  color: #fff;
  background: #080808;
}

.login-error {
  min-height: 18px;
  margin: 0;
  color: #ff7d7d;
  font-size: 0.82rem;
  font-weight: 800;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 0.2s ease;
}

.app.screen-monitoramento {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.app.sidebar-collapsed {
  grid-template-columns: 76px minmax(0, 1fr);
}

.app.sidebar-hover-expanded {
  grid-template-columns: 330px minmax(0, 1fr);
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: 100%;
  overflow: hidden;
  color: #fff;
  background: #050505;
  border-right: 1px solid #000;
  z-index: 5;
}

.app.screen-monitoramento .sidebar {
  height: 100vh;
  max-height: 100vh;
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 14px 16px;
  border-bottom: 1px solid #2c2c2c;
}

.brand-name {
  font-family: 'Montserrat', Arial, Helvetica, sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid #fff;
  border-radius: 6px;
  color: #fff;
  background: #000;
  cursor: pointer;
}

.icon-button:hover {
  color: #000;
  background: #fff;
}

.sidebar-content {
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 16px;
  scrollbar-color: #4a4a4a #050505;
  scrollbar-width: thin;
}

.sidebar-logout {
  align-self: flex-start;
  margin: auto 16px 14px;
  border: 0;
  padding: 6px 0;
  color: #bdbdbd;
  background: transparent;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.sidebar-logout:hover {
  color: #fff;
  text-decoration: underline;
}

.sidebar-content::-webkit-scrollbar {
  width: 9px;
}

.sidebar-content::-webkit-scrollbar-track {
  background: #050505;
}

.sidebar-content::-webkit-scrollbar-thumb {
  border: 2px solid #050505;
  border-radius: 999px;
  background: #4a4a4a;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
  background: #777;
}

.sidebar-content::-webkit-scrollbar-button {
  display: none;
}

.menu {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-bottom: 1px solid #2c2c2c;
}

.menu-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #fff;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.menu-button:hover,
.menu-button.active {
  border-color: #fff;
  color: #000;
  background: #fff;
}

.menu-group {
  display: grid;
  gap: 6px;
}

.menu-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #d7d7d7;
  background: transparent;
  font-size: 0.84rem;
  font-weight: 800;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
}

.menu-group-title:hover,
.menu-group.open .menu-group-title {
  border-color: #fff;
  color: #fff;
}

.submenu-label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 8px 12px;
  color: #d7d7d7;
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
}

.submenu {
  display: none;
  gap: 6px;
  padding-left: 16px;
}

.menu-group.open > .submenu {
  display: grid;
}

.menu-chevron {
  margin-left: auto;
  font-size: 1rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

.menu-group.open .menu-chevron {
  transform: rotate(90deg);
}

.submenu.nested {
  padding-left: 28px;
}

.submenu .menu-button {
  min-height: 36px;
  padding: 8px 10px;
  font-size: 0.9rem;
}

.menu-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
}

.menu-icon svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-header {
  display: none;
}
.sidebar-header h2 {
  margin: 0;
  font-size: 1.08rem;
}
.sidebar-header p {
  margin: 8px 0 0;
  color: #c7c7c7;
  line-height: 1.45;
  font-size: 0.88rem;
}

.vehicle-filters,
.vehicle-list {
  display: none;
}

.vehicle-button {
  position: relative;
  width: 100%;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  background: #101010;
  color: #fff;
  padding: 12px 44px 12px 12px;
  text-align: left;
  cursor: pointer;
}

.vehicle-button:hover,
.vehicle-button.active {
  border-color: #fff;
  background: #fff;
  color: #000;
}

.vehicle-button span {
  display: block;
  line-height: 1.4;
  font-size: 0.86rem;
}

.signal-icon {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-grid;
  grid-template-columns: repeat(3, 4px);
  align-items: end;
  gap: 3px;
  width: 24px;
  height: 22px;
  padding: 4px;
  border: 1px solid currentColor;
  border-radius: 6px;
  color: #16813a;
  background: rgba(255, 255, 255, 0.08);
}

.signal-icon::before,
.signal-icon span,
.signal-icon::after {
  content: '';
  display: block;
  width: 4px;
  border-radius: 3px 3px 0 0;
  background: currentColor;
}

.signal-icon::before {
  height: 6px;
}
.signal-icon span {
  height: 10px;
}
.signal-icon::after {
  height: 14px;
}
.signal-icon.off {
  color: #b51616;
}
.signal-icon.off::before,
.signal-icon.off span,
.signal-icon.off::after {
  opacity: 0.35;
}

.vehicle-button:hover .signal-icon,
.vehicle-button.active .signal-icon {
  background: rgba(0, 0, 0, 0.08);
}

.vehicle-button .signal-icon {
  display: inline-grid;
}

.app.sidebar-collapsed .brand-name,
.app.sidebar-collapsed .menu-text,
.app.sidebar-collapsed .sidebar-header,
.app.sidebar-collapsed .vehicle-filters,
.app.sidebar-collapsed .vehicle-list,
.app.sidebar-collapsed .menu-group-title .menu-text,
.app.sidebar-collapsed .menu-chevron,
.app.sidebar-collapsed .submenu-label,
.app.sidebar-collapsed .sidebar-logout {
  display: none;
}

.app.sidebar-collapsed .sidebar-top {
  justify-content: center;
  padding: 14px 10px;
}
.app.sidebar-collapsed .menu {
  padding: 12px 10px;
}
.app.sidebar-collapsed .menu-button,
.app.sidebar-collapsed .menu-group-title {
  justify-content: center;
  padding: 10px;
}
.app.sidebar-collapsed .submenu,
.app.sidebar-collapsed .submenu.nested {
  padding-left: 0;
}

.app.sidebar-hover-expanded .brand-name,
.app.sidebar-hover-expanded .menu-text,
.app.sidebar-hover-expanded .menu-group-title .menu-text,
.app.sidebar-hover-expanded .menu-chevron,
.app.sidebar-hover-expanded .submenu-label,
.app.sidebar-hover-expanded .sidebar-logout {
  display: inline-flex;
}

.app.sidebar-hover-expanded .sidebar-top {
  justify-content: space-between;
  padding: 14px 16px;
}

.app.sidebar-hover-expanded .menu {
  padding: 14px;
}

.app.sidebar-hover-expanded .menu-button,
.app.sidebar-hover-expanded .menu-group-title {
  justify-content: flex-start;
  padding: 10px 12px;
}

.app.sidebar-hover-expanded .submenu {
  padding-left: 16px;
}

.app.sidebar-hover-expanded .submenu.nested {
  padding-left: 28px;
}

.main-area {
  min-width: 0;
  background: #f4f4f4;
}

.app.screen-monitoramento .main-area {
  min-height: 0;
  height: 100vh;
  overflow: hidden;
}

.map-area {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden;
}

.app.screen-monitoramento .map-area {
  min-height: 0;
  height: 100vh;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  min-height: 64px;
  padding: 14px 22px;
  color: #000;
  background: #fff;
  border-bottom: 1px solid #000;
}

header h1 {
  margin: 0;
  font-size: 1.2rem;
}

.summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.summary span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid #000;
  border-radius: 6px;
  color: #000;
  background: #fff;
  font-size: 0.84rem;
  white-space: nowrap;
}

#map {
  flex: 1 1 auto;
  min-height: 0;
}

.monitoring-drawer {
  flex: 0 0 auto;
  display: block;
  height: 56px;
  border-top: 1px solid #000;
  color: #fff;
  background: #000;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.16);
  overflow: hidden;
  transition: height 0.2s ease;
  --drawer-height: min(42vh, 360px);
}

.monitoring-drawer.open {
  height: var(--drawer-height);
}

.drawer-resize-handle {
  display: none;
  height: 8px;
  border-bottom: 1px solid #1f1f1f;
  background: #050505;
  cursor: ns-resize;
  touch-action: none;
}

.drawer-resize-handle::before {
  content: '';
  display: block;
  width: 72px;
  height: 3px;
  margin: 2px auto 0;
  border-radius: 999px;
  background: #4a4a4a;
}

.monitoring-drawer.open .drawer-resize-handle {
  display: block;
}

.monitoring-drawer-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 48px;
  padding: 8px 14px;
  color: #fff;
  background: #000;
}

.monitoring-drawer.open .monitoring-drawer-head {
  grid-template-columns: 120px minmax(0, 1fr) 120px;
}

.monitoring-drawer-head h2 {
  display: none;
  margin: 0;
  font-size: 0.98rem;
  text-transform: uppercase;
  text-align: center;
  grid-column: 2;
}

.monitoring-drawer.open .monitoring-drawer-head h2 {
  display: block;
}

.monitoring-drawer-head .icon-button {
  width: 120px;
  border-color: transparent;
  background: #111;
  justify-self: center;
}

.monitoring-drawer-head .icon-button:hover {
  border-color: transparent;
  background: #1d1c1c;
  color: #fff;
}

.drawer-toggle-icon {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 18px;
}

.drawer-toggle-icon::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translate(-50%, -65%) rotate(45deg);
  transition: transform 0.2s ease;
}

.monitoring-drawer:not(.open) .drawer-toggle-icon::before {
  transform: translate(-50%, -35%) rotate(225deg);
}

.monitoring-drawer.open .monitoring-drawer-head .icon-button {
  grid-column: 3;
  justify-self: center;
}

.vehicle-table-wrap {
  display: none;
  max-height: calc(var(--drawer-height) - 56px);
  overflow: auto;
}

.monitoring-drawer.open .vehicle-table-wrap {
  display: block;
}

.vehicle-table {
  min-width: 1240px;
  font-size: 0.84rem;
  color: #fff;
  background: #000;
}

.vehicle-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 7px;
  vertical-align: bottom;
  border-bottom: 1px solid #333;
  background: #000;
  color: #fff;
}

.vehicle-table th span {
  display: block;
  margin-bottom: 5px;
  font-size: 0.7rem;
  text-transform: uppercase;
}

.vehicle-table th select {
  width: 100%;
  min-height: 30px;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 4px 7px;
  color: #fff;
  background: #101010;
  font-size: 0.78rem;
}

.vehicle-filter-panel input {
  min-height: 30px;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 4px 8px;
  color: #fff;
  background: #101010;
  font-size: 0.78rem;
}

.vehicle-filter-clear {
  min-height: 30px;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 4px 8px;
  color: #fff;
  background: #151515;
  cursor: pointer;
}

.vehicle-filter-th {
  min-width: 120px;
}

.vehicle-filter-menu {
  position: relative;
}

.vehicle-filter-menu summary {
  display: grid;
  min-height: 30px;
  align-items: center;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 4px 8px;
  color: #fff;
  background: #101010;
  font-size: 0.78rem;
  cursor: pointer;
  list-style: none;
}

.vehicle-filter-menu summary::-webkit-details-marker {
  display: none;
}

.vehicle-filter-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  display: grid;
  gap: 8px;
  width: 280px;
  max-height: 320px;
  padding: 10px;
  border: 1px solid #444;
  border-radius: 8px;
  background: #080808;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.45);
}

.vehicle-filter-options {
  display: grid;
  gap: 4px;
  overflow: auto;
  max-height: 210px;
}

.vehicle-filter-option {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  font-size: 0.78rem;
  cursor: pointer;
}

.vehicle-filter-option input {
  margin: 0;
}

.vehicle-filter-empty {
  color: #aaa;
  font-size: 0.78rem;
}

.occurrence-pill {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #facc15;
  color: #111;
  font-weight: 800;
}

.vehicle-table td {
  border-bottom: 1px solid #242424;
  color: #fff;
  background: #000;
}

.vehicle-table tbody tr:nth-child(even) td {
  background: #000;
}

.vehicle-table tbody tr {
  cursor: pointer;
}

.vehicle-table tbody tr:hover td,
.vehicle-table tbody tr.active td {
  background: #1d1c1c;
}

.vehicle-table tbody tr.grid-focus td {
  background: #2d2812;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -1px 0 rgba(255, 255, 255, 0.35);
}

.vehicle-table .signal-icon {
  position: static;
  display: inline-grid;
  background: rgba(255, 255, 255, 0.08);
}

.screen {
  display: none;
  min-width: 0;
  min-height: 100vh;
  padding: 28px;
}

.screen.active {
  display: block;
}
.app.screen-monitoramento .map-area {
  display: flex;
}
.app:not(.screen-monitoramento) .map-area {
  display: none;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}

.page-head h1 {
  margin: 0 0 6px;
  font-size: 1.45rem;
}
.page-head p {
  margin: 0;
  color: #555;
  line-height: 1.45;
}

.card {
  border: 1px solid #000;
  border-radius: 8px;
  background: #000;
  padding: 18px;
  margin-bottom: 18px;
}

.card-title {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
}

.filter-grid,
.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

#reportFilters {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  overflow-x: visible;
  padding-bottom: 2px;
}

#reportFilters .field {
  flex: 0 0 260px;
}

.compact-filter-grid {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  overflow-x: visible;
  padding-bottom: 2px;
}

.compact-filter-grid .field {
  flex: 0 0 220px;
}

.compact-filter-grid .date-br-field {
  flex: 0 0 190px !important;
}

#diariaStepOne.compact-filter-grid {
  align-items: flex-start;
}

#diariaStepOne .field {
  align-self: flex-start;
}

.diaria-modal-confirmed .entity-modal-panel {
  width: min(1794px, calc(100vw - 48px));
}

.diaria-plates-field {
  flex: 0 0 180px !important;
  max-width: 180px;
}

.tenant-cnpj-picker.diaria-plates-field {
  flex: 1 1 auto !important;
  max-width: none;
}

.tenant-cnpj-picker .diaria-plates-list {
  max-height: 150px;
}

.tenant-cnpj-picker .diaria-plate-option span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.diaria-plate-search {
  width: 100%;
  min-height: 28px;
  margin-bottom: 5px;
  border: 1px solid #4a4a4a;
  border-radius: 5px;
  padding: 5px 7px;
  color: #fff;
  background: #080808;
  font-size: 0.78rem;
}

.diaria-plate-toolbar {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 5px;
}

.diaria-plate-count {
  min-width: 70px;
  color: #cfcfcf;
  font-size: 0.66rem;
}

.btn.compact {
  min-height: 24px;
  padding: 3px 7px;
  font-size: 0.7rem;
}

.diaria-plates-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 88px;
  overflow: auto;
  border: 1px solid #333;
  border-radius: 5px;
  padding: 4px;
  background: #050505;
}

.diaria-plate-option {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 20px;
  border: 0;
  border-radius: 3px;
  padding: 2px 4px;
  color: #fff;
  background: transparent;
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 800;
}

.diaria-plate-option:hover {
  background: #151515;
}

.entity-modal .diaria-plates-field .diaria-plate-option input[type="checkbox"] {
  appearance: none !important;
  -webkit-appearance: none !important;
  display: inline-block !important;
  width: 9px !important;
  min-width: 9px !important;
  max-width: 9px !important;
  height: 9px !important;
  min-height: 9px !important;
  max-height: 9px !important;
  flex: 0 0 9px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid #fff !important;
  border-radius: 1px !important;
  background: #000 !important;
  box-shadow: none !important;
}

.entity-modal .diaria-plates-field .diaria-plate-option input[type="checkbox"]:checked {
  background: #000 !important;
  box-shadow: inset 0 0 0 2px #000, inset 0 0 0 4px #fff !important;
}

.entity-modal .diaria-plates-field .diaria-plate-option input[type="checkbox"]:indeterminate {
  background: linear-gradient(#000 0 35%, #fff 35% 65%, #000 65% 100%) !important;
}

.diaria-launch-table .informar-fs-select.is-alert {
  border-color: #ff3b3b;
  color: #fff;
  background: #8d1111;
  box-shadow: 0 0 0 2px rgba(255, 59, 59, 0.22);
}

.diaria-launch-table {
  min-width: 1680px;
  font-size: 0.78rem;
}

.diaria-launch-table th,
.diaria-launch-table td {
  padding: 6px;
  vertical-align: middle;
}

.diaria-launch-table th,
.diaria-launch-table td,
.app:not(.screen-monitoramento) .diaria-launch-table th,
.app:not(.screen-monitoramento) .diaria-launch-table td,
.app:not(.screen-monitoramento) .diaria-launch-table tbody tr:nth-child(even) td {
  color: #fff;
  background: #000;
}

.diaria-launch-table tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
}

.diaria-launch-table th,
.diaria-launch-table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
}

.diaria-launch-table input,
.diaria-launch-table select {
  width: 100%;
  min-height: 32px;
  border: 1px solid #5a5a5a;
  border-radius: 5px;
  padding: 5px 7px;
  color: #fff;
  background: #0b0b0b;
}

.diaria-row-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid #666;
  border-radius: 5px;
  color: #fff;
  background: #0b0b0b;
  cursor: pointer;
}

.diaria-row-delete:hover {
  border-color: #ff4d4d;
  color: #ff4d4d;
  background: #160606;
}

.diaria-row-delete svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hidden {
  display: none !important;
}

.diaria-attach-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 32px;
  border: 1px solid #6a6a6a;
  border-radius: 6px;
  color: #fff;
  background: #0b0b0b;
  cursor: pointer;
}

.diaria-attach-button:hover,
.diaria-attach-button.has-file {
  border-color: #fff;
  background: #161616;
}

.diaria-attach-button.has-file {
  box-shadow: inset 0 0 0 2px #fff;
}

.diaria-attach-button span {
  color: #fff;
  font-size: 1.05rem;
  line-height: 1;
}

.diaria-attach-button input {
  position: absolute;
  width: 1px !important;
  height: 1px !important;
  opacity: 0;
  pointer-events: none;
}

.diaria-launch-table th:nth-child(6),
.diaria-launch-table td:nth-child(6) {
  width: 92px;
  max-width: 92px;
}

.diaria-launch-table th:nth-child(5),
.diaria-launch-table td:nth-child(5) {
  width: 80px;
  max-width: 80px;
}

.diaria-launch-table th:nth-child(10),
.diaria-launch-table td:nth-child(10) {
  width: 84px;
  max-width: 84px;
}

.diaria-launch-table input[name="cte_vinculado"] {
  width: 72px;
  min-width: 72px;
}

.diaria-launch-table input[name="cte_vinculado"]::-webkit-outer-spin-button,
.diaria-launch-table input[name="cte_vinculado"]::-webkit-inner-spin-button,
.diaria-launch-table input[name="descarga_vinculada"]::-webkit-outer-spin-button,
.diaria-launch-table input[name="descarga_vinculada"]::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.diaria-launch-table .diaria-small-number,
.diaria-launch-table .diaria-money-input {
  width: 76px;
  min-width: 76px;
}

.diaria-money-input:disabled,
#justValorDiaria:disabled {
  opacity: 1;
  cursor: not-allowed;
  color: #d8d8d8;
  background: #181818;
}

.diarias-table th:nth-child(8),
.diarias-table td:nth-child(8) {
  width: 96px;
  max-width: 96px;
}

.diarias-table th:nth-child(12),
.diarias-table td:nth-child(12) {
  width: 86px;
  max-width: 86px;
}

.diaria-placa-cell {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.diaria-ocorrencia-alert {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid #ff3b3b;
  border-radius: 50%;
  color: #fff;
  background: #d60000;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
  cursor: help;
}

.diaria-ocorrencia-alert::after {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 9px);
  z-index: 50;
  display: none;
  min-width: 260px;
  max-width: 420px;
  padding: 10px 12px;
  border: 1px solid #fff;
  border-radius: 6px;
  color: #fff;
  background: #000;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.32);
  content: attr(data-tooltip);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.35;
  text-transform: none;
  white-space: pre-line;
  transform: translateX(-50%);
}

.diaria-ocorrencia-alert:hover::after,
.diaria-ocorrencia-alert:focus::after {
  display: block;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid #999;
  border-radius: 6px;
  padding: 8px 10px;
  color: #111;
  background: #fff;
}

.field textarea {
  min-height: 76px;
  resize: vertical;
}

.full {
  grid-column: 1 / -1;
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.finance-emitidos-actions {
  justify-content: flex-end;
  margin: 0 0 10px;
}

.btn {
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid #000;
  border-radius: 6px;
  background: #fff;
  color: #000;
  cursor: pointer;
}

.btn.primary {
  background: #000;
  color: #fff;
}
.btn:hover {
  background: #111;
  color: #fff;
}

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

.kpi {
  border: 1px solid #000;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.kpi span {
  display: block;
  padding: 7px 9px;
  background: #d9d9d9;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.kpi strong {
  display: block;
  padding: 10px;
  min-height: 38px;
  overflow-wrap: anywhere;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid #000;
  border-radius: 8px;
  background: #000;
}

table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  font-size: 0.86rem;
}

th,
td {
  padding: 8px;
  border-bottom: 1px solid #d6d6d6;
  text-align: left;
  vertical-align: top;
}

th {
  background: #111;
  color: #fff;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.76rem;
  white-space: nowrap;
}

tbody tr:nth-child(even) td {
  background: #f7f7f7;
}
.money,
.number {
  text-align: right;
  white-space: nowrap;
}

.section-title {
  display: inline-flex;
  align-self: flex-start;
  width: fit-content;
  max-width: 100%;
  margin: 8px 0;
  padding: 6px 10px;
  color: #fff;
  background: #000;
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.grand-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  max-width: 480px;
  margin: 20px 0 0 auto;
  padding: 14px 18px;
  color: #fff;
  background: #000;
  font-size: 1.35rem;
  font-weight: 800;
}

.report-issued-note {
  margin-top: auto;
  padding-top: 24px;
  color: #555;
  font-size: 0.72rem;
  line-height: 1.35;
  text-align: center;
}

.finance-empty,
.finance-alert {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #cfcfcf;
  border-radius: 8px;
  color: #555;
  background: #fafafa;
  line-height: 1.45;
}

.finance-alert {
  border-color: #000;
  color: #000;
  background: #fff;
  font-weight: 700;
}

.finance-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.finance-selection-box {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid #000;
  border-radius: 8px;
  background: #fafafa;
}

.finance-selection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.finance-selection-head h3 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 800;
  text-transform: uppercase;
}

.finance-selection-head span {
  color: #555;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.finance-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #999;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.finance-choice:hover {
  border-color: #000;
  background: #f7f7f7;
}

.finance-choice:has(input:checked) {
  border-color: #000;
  background: #000;
  color: #fff;
}

.finance-choice input {
  width: 18px;
  height: 18px;
  accent-color: #000;
}

.ocr-upload {
  display: grid;
  gap: 12px;
}

.ocr-upload-area.is-hidden {
  display: none;
}

.ocr-results-card.is-hidden {
  display: none;
}

.card.is-hidden {
  display: none;
}

.ocr-dropzone {
  display: grid;
  place-items: center;
  min-height: 148px;
  padding: 22px;
  border: 1px dashed #777;
  border-radius: 8px;
  color: #f4f4f4;
  background: #0b0b0b;
  text-align: center;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}

.ocr-dropzone:hover,
.ocr-dropzone:focus,
.ocr-dropzone.dragging {
  border-color: #fff;
  background: #161616;
  outline: none;
}

.ocr-dropzone input {
  display: none;
}

.ocr-dropzone strong {
  display: block;
  margin-bottom: 5px;
  color: #fff;
  font-size: 1rem;
}

.ocr-dropzone span {
  color: #cfcfcf;
  font-size: 0.86rem;
}

.ocr-thumb {
  width: 92px;
  height: 64px;
  border: 1px solid #999;
  border-radius: 6px;
  object-fit: cover;
  background: #f1f1f1;
  cursor: pointer;
}

.lote-thumb {
  width: 64px;
  height: 45px;
  cursor: zoom-in;
}

.route-thumb {
  display: block;
  width: 72px;
  height: 52px;
  border: 1px solid #999;
  border-radius: 4px;
  object-fit: cover;
  background: #fff;
}

.route-thumb-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.route-thumb-button:focus-visible {
  outline: 2px solid #111827;
  outline-offset: 2px;
}

#lotesTable th,
#lotesTable td {
  vertical-align: middle;
}

#lotesTable td:first-child,
#lotesTable th:first-child {
  width: 78px;
  text-align: center;
}

.lote-preview-panel {
  width: min(980px, calc(100vw - 32px));
}

.lote-preview-image {
  display: block;
  max-width: 100%;
  max-height: min(72vh, 720px);
  margin: 0 auto;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
}

.lote-image-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 72px;
  margin-top: 10px;
  color: #555;
  font-size: 0.86rem;
}

.lote-dropzone {
  min-height: 120px;
}

.lote-pending-box {
  display: grid;
  gap: 10px;
  margin: 12px 0 14px;
  padding: 12px;
  border: 1px solid #333;
  border-radius: 8px;
  background: #0d0d0d;
}

.lote-pending-box strong,
.lote-pending-box span {
  display: block;
}

.lote-pending-box strong {
  color: #fff;
  font-size: 0.9rem;
  text-transform: uppercase;
}

.lote-pending-box span {
  margin-top: 3px;
  color: #cfcfcf;
  font-size: 0.78rem;
}

.lote-pending-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 112px;
  overflow: auto;
}

.lote-pending-chip {
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid #777;
  border-radius: 999px;
  color: #fff;
  background: #181818;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
}

.lote-pending-chip:hover {
  color: #000;
  background: #fff;
}

.ocr-thumb-progress {
  display: inline-grid;
  place-items: center;
  padding: 3px;
  border-radius: 8px;
  background:
    conic-gradient(#16813a var(--ocr-progress), #2a2a2a 0);
}

.ocr-thumb-progress .ocr-thumb {
  border-color: #050505;
}

.ocr-thumb-progress.complete {
  box-shadow: 0 0 0 1px #16813a;
}

.ocr-thumb-placeholder {
  display: inline-grid;
  place-items: center;
  width: 92px;
  height: 64px;
  border: 1px solid #999;
  border-radius: 6px;
  color: #555;
  background: #f1f1f1;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.ocr-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 1600;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.72);
}

.ocr-preview-modal.open {
  display: flex;
}

.ocr-preview-modal img {
  max-width: min(920px, 100%);
  max-height: calc(100vh - 96px);
  border: 1px solid #fff;
  border-radius: 8px;
  background: #fff;
}

.ocr-diff {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  color: #fff;
  font-weight: 800;
}

.ocr-diff.negative {
  background: #b51616;
}
.ocr-diff.positive {
  background: #16813a;
}

.edit-icon-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid #000;
  border-radius: 6px;
  color: #fff;
  background: #000;
  cursor: pointer;
}

.edit-icon-button:hover {
  color: #000;
  background: #fff;
}

.edit-icon-button.danger {
  border-color: #6a1f1f;
  background: #240909;
}

.edit-icon-button.danger:hover {
  border-color: #fff;
  color: #fff;
  background: #b51616;
}

.edit-icon-button svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ordens-table {
  min-width: 2180px;
}

.entity-modal-panel.ordens-modal-panel {
  width: min(1472px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  background: #050505;
}

.ordens-modal-panel .entity-modal-body {
  min-height: min(75vh, 900px);
  background: #050505;
}

.ordens-modal-panel .page-head p {
  color: #cfcfcf;
}

.ordens-table-wrap {
  background: #000;
}

.ordem-page-filters {
  align-items: end;
}

.ordem-page-filters .field {
  min-width: 180px;
}

.ordem-page-filters .date-br-field {
  max-width: 230px;
}

.ordem-filter-actions,
.ordem-start-actions {
  align-items: end;
  margin-top: 0;
}

.entity-modal-panel.ordem-start-modal-panel {
  width: min(760px, calc(100vw - 28px));
  background: #050505;
}

.ordem-start-grid {
  align-items: end;
}

.ordens-generate-actions {
  justify-content: flex-end;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #2b2b2b;
}

.ordens-table td {
  vertical-align: middle;
  background: #050505;
}

.ordens-table .ordem-destino-cell {
  width: 86px;
  min-width: 86px;
}

.ordens-table .ordem-lote-cell {
  width: 170px;
  min-width: 170px;
}

.ordens-table .ordem-qtd-cell {
  width: 78px;
  min-width: 78px;
}

.ordens-table .ordem-conjunto-cell {
  width: 190px;
  min-width: 190px;
}

.ordem-conjunto-picker.diaria-plates-field {
  flex: none !important;
  max-width: 180px;
}

.ordem-conjunto-picker .diaria-plates-list {
  max-height: 76px;
}

.ordem-conjunto-picker .ordem-disponibilidade {
  display: block;
  margin-top: 4px;
  color: #cfcfcf;
  font-size: 0.68rem;
}

.ordens-table .ordem-km-cell {
  width: 92px;
  min-width: 92px;
}

.ordens-table .ordem-frete-cell {
  width: 110px;
  min-width: 110px;
}

.ordens-table .ordem-destino-cell input,
.ordens-table .ordem-lote-cell input,
.ordens-table .ordem-qtd-cell input,
.ordens-table .ordem-km-cell input,
.ordens-table .ordem-frete-cell input {
  min-width: 0;
  width: 100%;
}

.ordens-table tbody tr:nth-child(even) td {
  background: #080808;
}

.ordens-table input,
.ordens-table select,
.ordens-table textarea {
  width: 100%;
  min-height: 34px;
  border: 1px solid #5a5a5a;
  border-radius: 6px;
  color: #fff;
  background: transparent;
  padding: 7px 8px;
}

.ordens-table input[readonly] {
  color: #fff;
  background: transparent;
}

.ordens-table select option {
  color: #fff;
  background: #050505;
}

.ordens-table input::file-selector-button {
  margin-right: 8px;
  border: 1px solid #666;
  border-radius: 6px;
  color: #fff;
  background: #111;
  padding: 6px 8px;
  cursor: pointer;
}

.ordens-table textarea {
  min-height: 46px;
  resize: vertical;
}

.ordens-table small {
  display: block;
  margin-top: 5px;
  color: #cfcfcf;
  font-size: 0.72rem;
}

.ordem-programacao-groups {
  display: grid;
  gap: 12px;
}

.ordem-programacao-group {
  overflow: hidden;
  border: 1px solid #444;
  border-radius: 8px;
  background: #000;
}

.ordem-programacao-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid transparent;
}

.ordem-programacao-group.is-expanded .ordem-programacao-group-head {
  border-bottom-color: rgba(255, 255, 255, 0.55);
}

.ordem-programacao-group h3 {
  margin: 0 0 4px;
  color: #fff;
  font-size: 1rem;
  text-transform: uppercase;
}

.ordem-programacao-group p {
  margin: 0;
  color: #cfcfcf;
  font-size: 0.82rem;
}

.ordem-programacao-group-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.ordem-programacao-detail-wrap {
  border: 0;
  border-radius: 0;
}

.ordem-programacao-detail-wrap table th,
.ordem-programacao-detail-wrap table td,
.app:not(.screen-monitoramento) .ordem-programacao-detail-wrap table tbody tr:nth-child(even) td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
  color: #fff !important;
  background: #000 !important;
}

.ordem-sugestoes-shell {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) 28px;
  gap: 6px;
  align-items: start;
  min-width: 230px;
  max-width: 380px;
}

.ordem-sugestoes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  max-height: 28px;
  overflow: hidden;
}

.ordem-sugestoes-shell.is-expanded .ordem-sugestoes {
  max-height: none;
}

.ordem-sugestao-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #555;
  border-radius: 999px;
  color: #fff;
  background: #0b0b0b;
  padding: 4px 8px;
  font-size: 0.78rem;
  font-weight: 800;
}

.ordem-sugestao-chip small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  min-height: 18px;
  margin: 0;
  border-radius: 999px;
  color: #000;
  background: #fff;
  font-size: 0.66rem;
}

.ordem-sugestoes-toggle {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid #666;
  border-radius: 50%;
  color: #fff;
  background: #111;
  cursor: pointer;
}

.ordem-sugestoes-toggle:hover {
  border-color: #fff;
  background: #1d1d1d;
}

.ordem-sugestoes-toggle svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 2.3;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ordem-distribution-actions {
  align-items: center;
  gap: 8px;
}

.ordem-progress-ring {
  --progress: 0deg;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #fff;
  background:
    radial-gradient(circle at center, #050505 54%, transparent 55%),
    conic-gradient(#fff var(--progress), #333 0);
  font-size: 0.68rem;
  font-weight: 900;
}

.ordem-eye-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid #666;
  border-radius: 50%;
  color: #fff;
  background: #101010;
  cursor: pointer;
}

.ordem-eye-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.ordem-eye-button svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.entity-modal-panel.ordem-distribution-modal-panel {
  width: min(1180px, calc(100vw - 32px));
  background: #050505;
}

.ordem-preview-table-wrap {
  max-height: min(62vh, 680px);
}

.ordem-preview-table th,
.ordem-preview-table td,
.app:not(.screen-monitoramento) .ordem-preview-table th,
.app:not(.screen-monitoramento) .ordem-preview-table td,
.app:not(.screen-monitoramento) .ordem-preview-table tbody tr:nth-child(even) td {
  vertical-align: middle;
  border-bottom: 1px solid rgba(255, 255, 255, 0.62);
  color: #fff !important;
  background: #000 !important;
}

.ordem-preview-table tr,
.app:not(.screen-monitoramento) .ordem-preview-table tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.62);
}

.ordem-preview-table small {
  display: block;
  margin-top: 4px;
  color: #cfcfcf;
  font-size: 0.72rem;
}

.ordem-preview-actions {
  justify-content: flex-end;
  margin-top: 14px;
}

.ordem-tms-progress {
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  color: #fff;
  background: #000;
}

.ordem-tms-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.ordem-tms-progress-track {
  height: 8px;
  overflow: hidden;
  border: 1px solid #666;
  border-radius: 999px;
  background: #101010;
}

.ordem-tms-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #fff;
  transition: width 0.25s ease;
}

.ordem-icon-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-right: 6px;
  border: 1px solid #666;
  border-radius: 50%;
  color: #fff;
  background: #111;
  cursor: pointer;
}

.ordem-icon-button:disabled,
.ordem-icon-button:disabled:hover {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: #555;
  color: #999;
  background: #111;
}

.ordem-icon-button:hover {
  border-color: #fff;
  background: #1d1d1d;
}

.ordem-icon-button.primary {
  color: #000;
  border-color: #fff;
  background: #fff;
}

.ordem-icon-button.primary:hover {
  color: #fff;
  background: #1d1d1d;
}

.ordem-download-icon {
  margin-right: 0;
}

.ordem-icon-button svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ocr-edit-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1.15fr) minmax(260px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.ocr-edit-layout > .ocr-accuracy {
  grid-column: 1 / -1;
  margin-top: 0;
}

.ocr-edit-preview {
  width: 100%;
  min-height: 420px;
  border: 1px solid #000;
  border-radius: 8px;
  object-fit: contain;
  background: #f4f4f4;
  transform-origin: top left;
  transition: transform 0.12s ease;
}

.ocr-zoom-panel {
  min-width: 0;
}

.ocr-zoom-toolbar {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.ocr-zoom-stage {
  max-height: min(72vh, 720px);
  overflow: auto;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  background: #050505;
}

.ocr-zoom-stage .ocr-edit-preview {
  display: block;
  min-width: 100%;
  border: 0;
  border-radius: 0;
}

.ocr-edit-fields {
  display: grid;
  gap: 12px;
}

.ocr-field-confirm label {
  display: block;
}

.ocr-inline-confirm {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  appearance: none;
  display: grid;
  place-items: center;
  margin: 0;
  border: 1px solid #fff;
  border-radius: 4px;
  background: #000;
  cursor: pointer;
}

.ocr-inline-confirm:checked {
  background: #000;
}

.ocr-inline-confirm:checked::after {
  content: '';
  width: 16px;
  height: 9px;
  border-left: 3px solid #16813a;
  border-bottom: 3px solid #16813a;
  transform: rotate(-45deg) translate(1px, -2px);
}

.ocr-input-confirm-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 10px;
  align-items: center;
}

.ocr-row-actions {
  display: inline-flex;
  gap: 7px;
  white-space: nowrap;
}

.ocr-check-cell {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  cursor: pointer;
}

.ocr-check-cell input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ocr-check-cell span {
  display: block;
  width: 20px;
  height: 20px;
  border: 1px solid #fff;
  border-radius: 4px;
  background: transparent;
}

.ocr-check-cell input:checked + span {
  background: #16813a;
  box-shadow: inset 0 0 0 4px #050505;
}

.ocr-conference-box {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  background: #0b0b0b;
}

.ocr-conference-box h3 {
  margin: 0 0 10px;
  color: #fff;
  font-size: 0.86rem;
  text-transform: uppercase;
}

.ocr-conference-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}

.ocr-conference-grid label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  color: #f4f4f4;
  font-size: 0.86rem;
}

.ocr-conference-grid input {
  width: 17px;
  height: 17px;
  accent-color: #16813a;
}

.ocr-accuracy,
.ocr-progress-shell {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  background: #0b0b0b;
}

.ocr-accuracy-head,
.ocr-progress-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: #fff;
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
}

.ocr-progress-bar {
  height: 12px;
  border: 1px solid #4a4a4a;
  border-radius: 999px;
  overflow: hidden;
  background: #050505;
}

.ocr-progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: #16813a;
  transition: width 0.2s ease;
}

.ocr-accuracy.low .ocr-progress-bar span {
  background: #b51616;
}

.ocr-accuracy.ok .ocr-progress-bar span {
  background: #16813a;
}

.ocr-tms-footer {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

#saveOcrTms {
  justify-self: start;
  opacity: 0.45;
}

#saveOcrTms.ready {
  border-color: #16813a;
  color: #fff;
  background: #16813a;
  opacity: 1;
}

#saveOcrTms:disabled {
  cursor: not-allowed;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.rule-card-list {
  display: grid;
  gap: 10px;
}

.rule-card {
  border: 1px solid #000;
  border-radius: 8px;
  padding: 12px;
  background: #000;
}

.rule-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.rule-card strong {
  display: block;
  color: #000;
}

.rule-card small {
  display: block;
  margin-top: 3px;
  color: #555;
}

.permission-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tenant-cnpj-details {
  margin-top: 2px;
}

.tenant-cnpj-details summary {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid #4a4a4a;
  border-radius: 6px;
  color: #fff;
  background: #0b0b0b;
  font-size: 0.74rem;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}

.tenant-cnpj-details summary::marker,
.tenant-cnpj-details summary::-webkit-details-marker {
  display: none;
}

.tenant-cnpj-details summary::after {
  content: "+";
  margin-left: 8px;
  font-size: 0.9rem;
  line-height: 1;
}

.tenant-cnpj-details[open] summary {
  margin-bottom: 8px;
}

.tenant-cnpj-details[open] summary::after {
  content: "-";
}

.permission-tags span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid #999;
  border-radius: 999px;
  background: transparent;
  font-size: 0.75rem;
  font-weight: 800;
}

.permission-tags span small,
.rule-check-option small {
  color: inherit;
  opacity: 0.66;
  font-size: 0.68rem;
  font-weight: 800;
}

.rule-sections {
  display: grid;
  gap: 9px;
}

.rule-tag-section {
  display: grid;
  gap: 5px;
}

.rule-tag-section small {
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 0.68rem;
  font-weight: 900;
}

.rule-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 6px;
  padding: 8px;
  border: 1px solid #999;
  border-radius: 6px;
  background: #fff;
}

.rule-check-option {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 5px 7px;
  border: 1px solid #d0d0d0;
  border-radius: 5px;
  color: #111;
  background: #f7f7f7;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
}

.rule-check-option span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.rule-check-option input[type="checkbox"] {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: #111;
}

.rule-tree {
  display: grid;
  gap: 10px;
}

.rule-tree-module {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #999;
  border-radius: 6px;
  background: #fff;
}

.rule-tree-module h3 {
  margin: 0;
  color: #111;
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.rule-tree-guides {
  display: grid;
  gap: 7px;
}

.rule-guide-details {
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  background: #f7f7f7;
}

.rule-guide-details summary {
  display: flex;
  align-items: center;
  padding: 7px 8px;
  cursor: pointer;
  list-style: none;
}

.rule-guide-details summary::marker,
.rule-guide-details summary::-webkit-details-marker {
  display: none;
}

.rule-guide-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #111;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 900;
}

.rule-guide-toggle input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #111;
}

.rule-guide-toggle span {
  display: grid;
  gap: 2px;
}

.rule-guide-toggle small,
.rule-tree-empty {
  color: inherit;
  opacity: 0.66;
  font-size: 0.68rem;
  font-weight: 800;
}

.rule-action-grid {
  margin: 0 8px 8px;
  border-color: #d8d8d8;
  background: #fff;
}

.rule-tree-empty {
  display: inline-flex;
  padding: 7px 0;
}

.rule-builder {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid #999;
  border-radius: 6px;
  background: #fff;
}

.rule-builder-rows {
  display: grid;
  gap: 8px;
}

.rule-row {
  display: grid;
  grid-template-columns: minmax(163px, 0.51fr) minmax(516px, auto) auto;
  gap: 6px;
  align-items: center;
  padding: 7px;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  background: #f7f7f7;
}

.rule-row-guide {
  min-width: 0;
  margin: 0;
}

.rule-row-guide label {
  min-height: 15px;
  margin-bottom: 3px;
  line-height: 1;
}

.rule-row-guide select {
  height: 38px;
  min-height: 38px;
}

.rule-row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  min-height: 28px;
  min-width: 0;
  align-self: end;
}

.rule-action-chip,
.field .rule-action-chip {
  display: inline-grid;
  grid-template-columns: 13px auto;
  align-items: center;
  justify-items: center;
  justify-content: center;
  column-gap: 6px;
  height: 38px;
  min-height: 0;
  min-width: 110px;
  padding: 4px 10px;
  margin: 0;
  border: 1px solid #c8c8c8;
  border-radius: 5px;
  color: #111;
  background: #fff;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.rule-action-chip span {
  display: inline-block;
  line-height: 1;
  white-space: nowrap;
}

.rule-row-extra-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, max-content));
  justify-content: start;
  gap: 2px 4px;
  padding-top: 2px;
  overflow: visible;
}

.rule-row-extra-actions .rule-action-chip {
  grid-template-columns: 9px auto;
  column-gap: 3px;
  min-height: 0;
  height: 18px;
  min-width: 0;
  padding: 1px 4px;
  font-size: 0.5rem;
  font-weight: 800;
}

.rule-action-chip input[type="checkbox"],
.field .rule-action-chip input[type="checkbox"],
.entity-modal .field .rule-action-chip input[type="checkbox"],
.app:not(.screen-monitoramento) .field .rule-action-chip input[type="checkbox"] {
  appearance: auto;
  -webkit-appearance: checkbox;
  display: block;
  width: 13px;
  min-width: 13px;
  max-width: 13px;
  height: 13px;
  min-height: 13px;
  max-height: 13px;
  margin: 0;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  accent-color: #111;
}

.rule-row-extra-actions .rule-action-chip input[type="checkbox"],
.field .rule-row-extra-actions .rule-action-chip input[type="checkbox"],
.entity-modal .field .rule-row-extra-actions .rule-action-chip input[type="checkbox"],
.app:not(.screen-monitoramento) .field .rule-row-extra-actions .rule-action-chip input[type="checkbox"] {
  width: 8px;
  min-width: 8px;
  max-width: 8px;
  height: 8px;
  min-height: 8px;
  max-height: 8px;
  padding: 0;
}

.rule-row-remove {
  align-self: end;
  justify-self: end;
  grid-column: 3;
  grid-row: 1;
  margin-bottom: 0;
}

.user-modal-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid #d6d6d6;
}

.user-modal-tab {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  background: transparent;
  color: #000;
  cursor: pointer;
  font-weight: 800;
}

.user-modal-tab.active {
  border-color: #000;
  background: #000;
  color: #fff;
}

.user-tab-panel {
  display: none;
}

.user-tab-panel.active {
  display: block;
}

.field select[multiple] {
  min-height: 128px;
  padding: 8px;
}

.finance-modal {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: none;
  background: rgba(0, 0, 0, 0.72);
  padding: 24px;
}

.finance-modal.open {
  display: block;
}

.entity-modal {
  position: fixed;
  inset: 0;
  z-index: 1450;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.64);
}

.entity-modal.open {
  display: flex;
}

.entity-modal-panel {
  width: min(920px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  border: 1px solid #000;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
}

#usuarioModal .entity-modal-panel {
  width: min(1200px, 100%);
}

#novoFechamentoModal .entity-modal-panel {
  width: min(1240px, 100%);
}

#usuarioForm {
  align-items: end;
}

.user-password-field {
  grid-column: 4;
}

.password-input-wrap {
  position: relative;
}

.password-input-wrap input {
  padding-right: 42px;
}

.password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 5px;
  color: #cfcfcf;
  background: transparent;
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle:hover,
.password-toggle.is-visible {
  color: #fff;
  background: #1f1f1f;
}

.password-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.entity-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  color: #fff;
  background: #000;
}

.entity-modal-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.entity-modal-body {
  padding: 18px;
}

.finance-modal-shell {
  display: flex;
  flex-direction: column;
  width: min(1180px, 100%);
  max-height: calc(100vh - 48px);
  margin: 0 auto;
  border: 1px solid #000;
  border-radius: 10px;
  overflow: hidden;
  background: #f4f4f4;
}

.finance-modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  color: #fff;
  background: #000;
}

.finance-modal-header h2 {
  margin: 0 0 4px;
  font-size: 1.12rem;
}

.finance-modal-header span {
  color: #d5d5d5;
  font-size: 0.86rem;
}

.finance-modal-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.finance-modal-actions .btn {
  border-color: #fff;
}

.finance-modal-actions .finance-icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
}

.finance-modal-actions .finance-icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.finance-modal-body {
  overflow-y: auto;
  padding: 24px;
}

.report-sheet {
  width: min(100%, 210mm);
  min-height: 297mm;
  margin: 0 auto 28px;
  padding: 34px;
  border: 1px solid #d0d0d0;
  background: #fff;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
  page-break-after: always;
  display: flex;
  flex-direction: column;
}

.report-sheet:last-child {
  margin-bottom: 0;
}

.report-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 2px solid #000;
}

.report-brand {
  font-family: 'Montserrat', Arial, Helvetica, sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
}

.report-title {
  margin-top: 6px;
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
}

.report-title-top {
  margin: 0 0 18px;
  text-align: center;
  font-size: 1.25rem;
}

.report-meta {
  display: grid;
  gap: 4px;
  min-width: 280px;
  margin-top: -6px;
  font-size: 0.88rem;
}

.report-meta div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.report-meta-value {
  font-weight: 400;
  text-align: right;
}

.report-sheet .kpi-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 12px;
}

.report-sheet .kpi-grid.report-kpi-line {
  gap: 6px;
}

.report-sheet .kpi span {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 6px;
  font-size: 0.66rem;
  line-height: 1.15;
}

.report-sheet .kpi strong {
  min-height: 34px;
  padding: 8px 6px;
  font-size: 0.82rem;
  font-weight: 800;
}

.report-sheet table {
  min-width: 0;
  font-size: 0.78rem;
}

.report-sheet th,
.report-sheet td {
  padding: 6px;
}

.report-sheet .report-ctes-wrap {
  overflow-x: visible;
}

.report-sheet .report-ctes-table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
  font-size: 0.58rem;
}

.report-sheet .report-ctes-table th,
.report-sheet .report-ctes-table td {
  padding: 3px 2px;
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
}

.report-sheet .report-ctes-table th {
  font-size: 0.5rem;
  white-space: nowrap;
  overflow-wrap: normal;
}

.report-sheet .report-ctes-table .money,
.report-sheet .report-ctes-table .number {
  white-space: normal;
}

.report-sheet .report-subtotal-row td {
  border-top: 1px solid #111;
  border-bottom: 0;
  background: #eeeeee;
  font-weight: 800;
}

.report-sheet .report-ctes-table th:nth-child(1) { width: 7%; }
.report-sheet .report-ctes-table th:nth-child(2) { width: 9%; }
.report-sheet .report-ctes-table th:nth-child(3) { width: 7%; }
.report-sheet .report-ctes-table th:nth-child(4) { width: 8%; }
.report-sheet .report-ctes-table th:nth-child(5) { width: 8%; }
.report-sheet .report-ctes-table th:nth-child(6) { width: 11%; }
.report-sheet .report-ctes-table th:nth-child(7) { width: 8%; }
.report-sheet .report-ctes-table th:nth-child(8) { width: 9%; }
.report-sheet .report-ctes-table th:nth-child(9) { width: 8%; }
.report-sheet .report-ctes-table th:nth-child(10) { width: 10%; }
.report-sheet .report-ctes-table th:nth-child(11) { width: 10%; }

.report-sheet .report-diarias-wrap {
  overflow-x: visible;
}

.report-sheet .report-diarias-table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
  font-size: 0.68rem;
}

.report-sheet .report-diarias-table th,
.report-sheet .report-diarias-table td {
  padding: 4px 3px;
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
}

.report-sheet .report-diarias-table th {
  font-size: 0.58rem;
  white-space: nowrap;
  overflow-wrap: normal;
}

.report-sheet .report-diarias-table .money,
.report-sheet .report-diarias-table .number {
  white-space: normal;
}

.report-sheet .report-diarias-table th:nth-child(1) { width: 6%; }
.report-sheet .report-diarias-table th:nth-child(2) { width: 10%; }
.report-sheet .report-diarias-table th:nth-child(3) { width: 9%; }
.report-sheet .report-diarias-table th:nth-child(4) { width: 21%; }
.report-sheet .report-diarias-table th:nth-child(5) { width: 8%; }
.report-sheet .report-diarias-table th:nth-child(6) { width: 8%; }
.report-sheet .report-diarias-table th:nth-child(7) { width: 12%; }
.report-sheet .report-diarias-table th:nth-child(8) { width: 7%; }
.report-sheet .report-diarias-table th:nth-child(9) { width: 19%; }

.report-sheet .report-bank-wrap {
  overflow-x: visible;
}

.report-sheet .report-bank-table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
  font-size: 0.64rem;
}

.report-sheet .report-bank-table th,
.report-sheet .report-bank-table td {
  padding: 3px 4px;
  line-height: 1.15;
  overflow-wrap: anywhere;
  white-space: normal;
}

.report-sheet .report-bank-table th {
  width: 14%;
  font-size: 0.56rem;
  white-space: nowrap;
}

.report-sheet .report-bank-table td {
  width: 36%;
}

.report-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.report-button {
  min-height: 96px;
  padding: 16px;
  border: 1px solid #000;
  border-radius: 8px;
  background: #fff;
  color: #000;
  text-align: left;
  cursor: pointer;
}

.report-button:hover {
  background: #000;
  color: #fff;
}
.report-button strong {
  display: block;
  margin-bottom: 6px;
}
.report-button span {
  display: block;
  line-height: 1.35;
  font-size: 0.84rem;
}

.date-br-field {
  flex-basis: 190px !important;
  max-width: 190px;
}

.date-time-br-field {
  flex-basis: 230px !important;
  max-width: 230px;
}

.compact-plant-field {
  flex-basis: 110px !important;
  max-width: 110px;
}

.compact-plant-field select {
  width: 110px;
}

.compact-plate-field {
  flex-basis: 150px !important;
  max-width: 150px;
}

.compact-plate-field select {
  width: 150px;
}

.date-br-field .date-br-row {
  width: 190px;
}

.date-time-br-field .date-br-row {
  width: 230px;
}

.date-br-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 0;
  align-items: center;
  min-height: 40px;
  border: 1px solid #5a5a5a;
  border-radius: 6px;
  overflow: hidden;
  background: #0b0b0b;
}

.date-br-text {
  position: relative;
  z-index: 3;
  min-width: 0;
  height: 38px;
  padding-left: 10px;
  padding-right: 8px;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.date-br-text::placeholder {
  letter-spacing: 1px;
}

.date-br-picker {
  position: absolute;
  top: 0;
  right: 0;
  left: auto;
  width: 42px;
  max-width: 42px;
  min-width: 42px;
  height: 38px;
  padding: 0;
  border: 0 !important;
  border-left: 1px solid #5a5a5a !important;
  border-radius: 0 !important;
  color: transparent;
  background: transparent;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.date-br-calendar-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 38px;
  border-left: 1px solid #5a5a5a;
  color: #fff;
  pointer-events: none;
}

.date-br-calendar-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.farol-list {
  display: grid;
  gap: 8px;
  overflow-x: auto;
}

.farol-head,
.farol-row {
  display: grid;
  grid-template-columns:
    110px minmax(300px, 1fr)
    110px 120px 120px 120px 90px 90px;
  align-items: center;
  gap: 0;
  min-width: 1120px;
}

.farol-head {
  padding: 0 12px 4px;
  color: #555;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.farol-head span,
.farol-row > * {
  min-width: 0;
  padding: 0 10px;
}

.farol-head span + span,
.farol-row > * + * {
  border-left: 1px solid #d6d6d6;
}

.farol-row {
  padding: 12px;
  border: 1px solid #d6d6d6;
  border-radius: 8px;
  background: #fff;
}

.farol-km-list .farol-head,
.farol-km-list .farol-row {
  grid-template-columns: 110px 150px 70px minmax(280px, 1fr) 110px 110px 120px 130px 80px 120px 120px 90px 90px;
  min-width: 1590px;
}

.farol-plate {
  font-weight: 800;
  color: #000;
  white-space: nowrap;
}

.farol-bar-area {
  min-width: 0;
  padding-left: 0;
}

.farol-bar-label {
  position: relative;
  height: 14px;
  margin-bottom: 6px;
  color: #333;
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
}

.farol-goal-label {
  position: absolute;
  left: var(--franquia-width);
  transform: translateX(-50%);
  white-space: nowrap;
}

.farol-bar {
  position: relative;
  height: 30px;
  border: 1px solid #000;
  border-radius: 999px;
  overflow: hidden;
  background: #f1f1f1;
}

.farol-bar::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--franquia-width);
  background: #d9d9d9;
}

.farol-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--used-width);
  background: #16813a;
}

.farol-bar-overflow {
  position: absolute;
  inset: 0 auto 0 var(--franquia-width);
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(var(--used-width) - var(--franquia-width));
  background: #b51616;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}

.farol-bar-overflow.compact {
  left: var(--used-width);
  width: auto;
  min-width: 52px;
  padding: 0 8px;
  border-radius: 999px;
  background: transparent;
  color: #b51616;
  transform: none;
}

.farol-bar-overflow.positive {
  background: #16813a;
  color: #fff;
}

.farol-bar-overflow.positive.compact {
  background: transparent;
  color: #16813a;
}

.farol-bar-fill.excedente {
  width: var(--used-width);
  background: #b51616;
}

.farol-bar-fill.warning {
  background: #f39c12;
}

.farol-bar-balance {
  position: absolute;
  inset: 0 auto 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  left: var(--used-width);
  width: calc(var(--franquia-width) - var(--used-width));
  color: #16813a;
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}

.farol-bar-balance.compact {
  left: var(--used-width);
  width: auto;
  min-width: 52px;
  padding: 0 8px;
  color: #c67605;
}

.farol-bar-balance.negative {
  color: #b51616;
}

.farol-bar-balance.negative.compact {
  color: #b51616;
}

.tarifa-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 220px 250px 120px 120px 120px;
  align-items: center;
  gap: 0;
  min-width: 980px;
  padding: 12px;
  border: 1px solid #d6d6d6;
  border-radius: 8px;
  background: #fff;
}

.tarifa-row > *,
.tarifa-head span {
  min-width: 0;
  padding: 0 10px;
}

.tarifa-row > * + *,
.tarifa-head span + span {
  border-left: 1px solid #d6d6d6;
}

.tarifa-head {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 220px 250px 120px 120px 120px;
  gap: 0;
  min-width: 980px;
  padding: 0 12px 4px;
  color: #555;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.tarifa-name,
.tarifa-value {
  color: #000;
  font-weight: 800;
}

.tarifa-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
}

.tarifa-dot {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #d9d9d9;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.tarifa-dot.red {
  background: #b51616;
}
.tarifa-dot.blue {
  background: #1f67d2;
}
.tarifa-dot.green {
  background: #16813a;
}

.tarifa-dot-label {
  margin-left: 6px;
  color: #555;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.evolucao-chart-wrap {
  overflow-x: auto;
}

.evolucao-chart {
  width: 100%;
  min-width: 760px;
  height: 360px;
  border: 1px solid #d6d6d6;
  border-radius: 8px;
  background: #fff;
}

.evolucao-axis {
  stroke: #000;
  stroke-width: 1;
}

.evolucao-grid {
  stroke: #e6e6e6;
  stroke-width: 1;
}

.evolucao-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.evolucao-point {
  stroke: #fff;
  stroke-width: 2;
}

.evolucao-label {
  fill: #333;
  font-size: 12px;
  font-weight: 700;
}

.evolucao-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.evolucao-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.84rem;
  font-weight: 800;
}

.evolucao-legend-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.trip-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.8fr);
  gap: 18px;
  align-items: stretch;
  min-height: 0;
}

#tripMap {
  width: 100%;
  height: min(62vh, 620px);
  min-height: 420px;
  border: 1px solid #000;
  border-radius: 8px;
  overflow: hidden;
  background: #e9e9e9;
}

.trip-summary {
  display: grid;
  align-content: start;
  gap: 5px;
  max-height: min(62vh, 620px);
  min-height: 420px;
  overflow-y: auto;
  padding-right: 6px;
}

.trip-point {
  position: relative;
  width: 100%;
  text-align: left;
  padding: 6px 92px 6px 8px;
  border: 1px solid #d6d6d6;
  border-radius: 6px;
  color: inherit;
  background: #fff;
  cursor: pointer;
}

.trip-point:hover,
.trip-point.active {
  border-color: var(--trip-color, #16813a);
  box-shadow: inset 3px 0 0 var(--trip-color, #16813a);
}

.trip-point strong {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
  font-size: 0.76rem;
  line-height: 1.2;
}

.trip-color-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--trip-color, #16813a);
}

.trip-point span {
  display: block;
  color: #555;
  font-size: 0.72rem;
  line-height: 1.2;
}

.trip-status {
  position: absolute;
  top: 7px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  color: #fff;
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.trip-status.loaded {
  background: #16813a;
}

.trip-status.unloading {
  background: #1f67d2;
}

.trip-status.empty {
  background: #555;
}

.trip-start-pin {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid #fff;
  border-radius: 50% 50% 50% 0;
  background: #1f67d2;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
  transform: rotate(-45deg);
}

.trip-start-pin::after {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
}

.trip-truck-marker {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 3px solid var(--trip-color, #16813a);
  border-radius: 14px;
  color: #111;
  background: #fff;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.36);
}

.trip-truck-marker svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.farol-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--franquia-width);
  width: 2px;
  background: #000;
}

.farol-metrics {
  display: contents;
}

.farol-metric {
  min-width: 0;
  color: #000;
  font-size: 0.82rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.farol-metric.muted {
  color: #777;
  font-size: 0.76rem;
}

.state-badge,
.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #fff;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-align: center;
}

.state-badge.green {
  background: #16813a;
}
.state-badge.red,
.status.red {
  background: #b51616;
  color: #fff;
}
.state-badge.orange {
  background: #f39c12;
  color: #000;
}
.state-badge.neutral,
.status {
  background: #555;
  color: #fff;
}

.automation-warning-details {
  min-width: 220px;
}

.automation-warning-details summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
}

.automation-warning-details summary::marker,
.automation-warning-details summary::-webkit-details-marker {
  display: none;
}

.automation-warning-details summary small {
  color: #777;
  font-weight: 800;
}

.automation-warning-list {
  margin-top: 8px;
  max-width: 420px;
}

.automation-warning-item {
  border: 1px solid #333;
  border-radius: 6px;
  padding: 8px;
  margin-bottom: 6px;
  background: #111;
}

.automation-warning-item strong,
.automation-warning-item span,
.automation-warning-item p,
.automation-warning-item small {
  display: block;
}

.automation-warning-item p {
  margin: 4px 0;
}

.automation-warning-item span,
.automation-warning-item small,
.muted {
  color: #777;
}

.automation-control-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid #333;
  border-radius: 50%;
  background: #111;
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.automation-control-button span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.82rem;
  line-height: 1;
}

.automation-control-button.pause {
  border-color: #b51616;
}

.automation-control-button.pause span {
  background: #b51616;
}

.automation-control-button.resume {
  border-color: #16813a;
}

.automation-control-button.resume span {
  background: #16813a;
}

.automation-control-button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.green-text {
  color: #16813a;
}
.orange-text {
  color: #c67605;
}
.red-text {
  color: #b51616;
}
.neutral-text {
  color: #555;
}

.plate-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.plate-line strong {
  font-size: 1rem;
  white-space: nowrap;
}
.trip-count {
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}
.vehicle-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.info-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1000;
  width: min(390px, 100vw);
  height: 100vh;
  overflow-y: auto;
  background: #fff;
  color: #000;
  border-left: 1px solid #000;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.18);
  transform: translateX(100%);
  transition: transform 0.2s ease;
}

.info-panel.open {
  transform: translateX(0);
}

.info-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 14px 18px;
  background: #000;
  color: #fff;
}

.info-panel-header h2 {
  margin: 0;
  font-size: 1.05rem;
}
.info-panel-body {
  padding: 18px;
  color: #000;
  background: #fff;
}
.plate-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.plate {
  font-size: 1.35rem;
  font-weight: 800;
  color: #000;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-bottom: 22px;
  border: 1px solid #d6d6d6;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.info-item {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 9px 10px;
  border: 0;
  border-bottom: 1px solid #e2e2e2;
  border-radius: 0;
  color: #000;
  background: #fff;
}

.info-item:last-child {
  border-bottom: 0;
}

.info-item small {
  display: block;
  margin-bottom: 0;
  color: #555;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.info-item strong {
  display: block;
  color: #000;
  font-size: 0.86rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.last-load-grid {
  margin-bottom: 24px;
}

.info-empty {
  margin-bottom: 22px;
  padding: 12px;
  border: 1px solid #999;
  border-radius: 8px;
  color: #555;
  background: #fff;
  font-weight: 700;
}

.info-item a {
  color: #000;
  text-decoration: underline;
}

.info-table {
  width: 100%;
  min-width: 0;
  margin: 0 0 22px;
  border: 1px solid #d6d6d6;
  border-radius: 8px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  color: #000;
  background: #fff;
  font-size: 0.86rem;
}

.info-table th,
.info-table td {
  padding: 9px 10px;
  border: 0;
  border-bottom: 1px solid #e2e2e2;
  color: #000;
  background: #fff;
  vertical-align: middle;
}

.info-table tr:last-child th,
.info-table tr:last-child td {
  border-bottom: 0;
}

.info-table th {
  width: 132px;
  color: #555;
  font-size: 0.76rem;
  font-weight: 800;
  text-align: left;
  text-transform: uppercase;
}

.info-table td {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.info-table a {
  color: #000;
  text-decoration: underline;
}

.info-panel-body .history-title:not(:first-child) {
  margin-top: 6px;
}
.history-title {
  margin: 0 0 12px;
  font-size: 1rem;
  color: #000;
}

.timeline {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  position: relative;
  padding-left: 22px;
  color: #333;
  line-height: 1.45;
  font-size: 0.92rem;
}

.timeline li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  width: 10px;
  height: 10px;
  border: 1px solid #000;
  border-radius: 50%;
  background: #fff;
}

.timeline time {
  display: block;
  margin-bottom: 2px;
  color: #000;
  font-weight: 800;
  font-size: 0.84rem;
}

.leaflet-popup-content {
  margin: 12px;
  line-height: 1.4;
  max-width: 300px;
}
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  border-radius: 8px;
  color: #000;
  background: #fff;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
}

.vehicle-pin {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid #fff;
  border-radius: 50% 50% 50% 0;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
  transform: rotate(-45deg);
}

.vehicle-pin::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
}
.vehicle-pin.green {
  background: #16813a;
}
.vehicle-pin.red {
  background: #b51616;
}

.popup-card {
  width: min(280px, calc(100vw - 72px));
  min-width: 220px;
}
.popup-card strong {
  color: #000;
  font-size: 1rem;
  overflow-wrap: anywhere;
}
.popup-signal-row {
  display: flex;
  justify-content: flex-end;
  min-height: 24px;
  margin: 2px 0 6px;
}

.popup-card .signal-icon {
  position: static;
  display: inline-grid;
  background: rgba(0, 0, 0, 0.04);
}

.popup-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin-top: 6px;
  color: #444;
  font-size: 0.86rem;
}
.popup-row b {
  min-width: 0;
  color: #000;
  font-weight: 800;
  text-align: right;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.popup-row .state-badge {
  max-width: 150px;
}

.popup-info-button {
  width: 100%;
  min-height: 36px;
  margin-top: 12px;
  border: 1px solid #000;
  border-radius: 6px;
  color: #fff;
  background: #000;
  cursor: pointer;
}

.popup-info-button:hover {
  color: #000;
  background: #fff;
}

/* Dark operational theme for all non-monitoring screens. */
body {
  color: #f4f4f4;
  background: #050505;
}

.app:not(.screen-monitoramento) .main-area,
.app:not(.screen-monitoramento) .screen {
  color: #f4f4f4;
  background: #070707;
}

.app:not(.screen-monitoramento) .page-head h1,
.app:not(.screen-monitoramento) .card-title,
.app:not(.screen-monitoramento) .history-title,
.app:not(.screen-monitoramento) .tarifa-name,
.app:not(.screen-monitoramento) .tarifa-value,
.app:not(.screen-monitoramento) .farol-plate,
.app:not(.screen-monitoramento) .farol-metric,
.app:not(.screen-monitoramento) .plate,
.entity-modal h2,
.entity-modal strong,
.finance-modal h2 {
  color: #fff;
}

.app:not(.screen-monitoramento) .page-head p,
.app:not(.screen-monitoramento) .finance-empty,
.app:not(.screen-monitoramento) .trip-point span,
.app:not(.screen-monitoramento) .rule-card small,
.app:not(.screen-monitoramento) .farol-head,
.app:not(.screen-monitoramento) .tarifa-head,
.app:not(.screen-monitoramento) .tarifa-dot-label,
.app:not(.screen-monitoramento) .evolucao-label,
.entity-modal .field label,
.entity-modal small,
.finance-modal-header span {
  color: #cfcfcf;
}

.app:not(.screen-monitoramento) .card,
.app:not(.screen-monitoramento) .kpi,
.app:not(.screen-monitoramento) .report-button,
.app:not(.screen-monitoramento) .farol-row,
.app:not(.screen-monitoramento) .tarifa-row,
.app:not(.screen-monitoramento) .trip-point,
.app:not(.screen-monitoramento) .rule-card,
.app:not(.screen-monitoramento) .finance-selection-box,
.app:not(.screen-monitoramento) .finance-empty,
.app:not(.screen-monitoramento) .finance-alert,
.entity-modal-panel,
.entity-modal-body,
.finance-modal-shell,
.finance-modal-body {
  border-color: #3a3a3a;
  color: #f4f4f4;
  background: #141414;
}

.app:not(.screen-monitoramento) .kpi span,
.app:not(.screen-monitoramento) .section-title,
.entity-modal-header,
.finance-modal-header {
  color: #fff;
  background: #000;
  border-color: #3a3a3a;
}

.app:not(.screen-monitoramento) .kpi strong,
.app:not(.screen-monitoramento) .info-item strong,
.app:not(.screen-monitoramento) .report-button strong,
.app:not(.screen-monitoramento) .rule-card strong {
  color: #fff;
}

.app:not(.screen-monitoramento) .field label,
.app:not(.screen-monitoramento) .finance-selection-head span,
.app:not(.screen-monitoramento) .info-item small {
  color: #cfcfcf;
}

.app:not(.screen-monitoramento) .field input,
.app:not(.screen-monitoramento) .field select,
.app:not(.screen-monitoramento) .field textarea,
.entity-modal .field input,
.entity-modal .field select,
.entity-modal .field textarea {
  border-color: #5a5a5a;
  color: #fff;
  background: #0b0b0b;
}

.app:not(.screen-monitoramento) .field input::placeholder,
.app:not(.screen-monitoramento) .field textarea::placeholder,
.entity-modal .field input::placeholder,
.entity-modal .field textarea::placeholder {
  color: #9a9a9a;
}

.app:not(.screen-monitoramento) .btn,
.entity-modal .btn,
.finance-modal-actions .btn {
  border-color: #666;
  color: #fff;
  background: #111;
}

.app:not(.screen-monitoramento) .btn.primary,
.entity-modal .btn.primary {
  border-color: #fff;
  color: #000;
  background: #fff;
}

.app:not(.screen-monitoramento) .btn:hover,
.entity-modal .btn:hover,
.finance-modal-actions .btn:hover {
  border-color: #fff;
  color: #000;
  background: #fff;
}

.app:not(.screen-monitoramento) .btn.primary:hover,
.entity-modal .btn.primary:hover {
  color: #fff;
  background: #111;
}

.app:not(.screen-monitoramento) .table-wrap,
.finance-modal .table-wrap {
  border-color: #3a3a3a;
  background: #0b0b0b;
}

.app:not(.screen-monitoramento) table {
  color: #f4f4f4;
  background: #0b0b0b;
}

.app:not(.screen-monitoramento) th {
  color: #fff;
  background: #000;
  border-bottom-color: #3a3a3a;
}

.app:not(.screen-monitoramento) td {
  color: #f4f4f4;
  border-bottom-color: #2a2a2a;
  background: #121212;
}

.app:not(.screen-monitoramento) tbody tr:nth-child(even) td {
  background: #181818;
}

.app:not(.screen-monitoramento) tfoot td {
  color: #fff;
  border-top: 2px solid #fff;
  border-bottom: 0;
  background: #000;
  font-weight: 800;
}

.app:not(.screen-monitoramento) .money,
.app:not(.screen-monitoramento) .number {
  color: #fff;
}

.app:not(.screen-monitoramento) .diarias-table th,
.app:not(.screen-monitoramento) .diarias-table td,
.app:not(.screen-monitoramento) .diarias-table tbody tr:nth-child(even) td,
.app:not(.screen-monitoramento) .diaria-launch-table th,
.app:not(.screen-monitoramento) .diaria-launch-table td,
.app:not(.screen-monitoramento) .diaria-launch-table tbody tr:nth-child(even) td {
  color: #fff;
  background: #000;
}

.app:not(.screen-monitoramento) .diarias-table tr,
.app:not(.screen-monitoramento) .diaria-launch-table tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
}

.app:not(.screen-monitoramento) .diarias-table th,
.app:not(.screen-monitoramento) .diarias-table td,
.app:not(.screen-monitoramento) .diaria-launch-table th,
.app:not(.screen-monitoramento) .diaria-launch-table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
}

.diarias-table th,
.diarias-table td,
.diarias-table tbody tr:nth-child(even) td,
.diaria-launch-table th,
.diaria-launch-table td,
.diaria-launch-table tbody tr:nth-child(even) td {
  color: #fff !important;
  background: #000 !important;
}

.diarias-table tr,
.diaria-launch-table tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
}

.diarias-table th,
.diarias-table td,
.diaria-launch-table th,
.diaria-launch-table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
}

.app:not(.screen-monitoramento) .farol-head span + span,
.app:not(.screen-monitoramento) .farol-row > * + *,
.app:not(.screen-monitoramento) .tarifa-row > * + *,
.app:not(.screen-monitoramento) .tarifa-head span + span {
  border-left-color: #3a3a3a;
}

.app:not(.screen-monitoramento) .farol-bar-label {
  color: #cfcfcf;
}

.app:not(.screen-monitoramento) .farol-bar {
  border-color: #5a5a5a;
  background: #0b0b0b;
}

.app:not(.screen-monitoramento) .farol-bar::before {
  background: #303030;
}

.app:not(.screen-monitoramento) .farol-marker {
  background: #fff;
}

.app:not(.screen-monitoramento) .tarifa-dot {
  background: #3a3a3a;
}

.app:not(.screen-monitoramento) .tarifa-dot.red {
  background: #b51616;
}

.app:not(.screen-monitoramento) .tarifa-dot.blue {
  background: #1f67d2;
}

.app:not(.screen-monitoramento) .tarifa-dot.green {
  background: #16813a;
}

.app:not(.screen-monitoramento) .evolucao-chart {
  border-color: #3a3a3a;
  background: #111;
}

.app:not(.screen-monitoramento) .evolucao-axis {
  stroke: #fff;
}

.app:not(.screen-monitoramento) .evolucao-grid {
  stroke: #303030;
}

.app:not(.screen-monitoramento) #tripMap {
  border-color: #3a3a3a;
  background: #111;
}

.app:not(.screen-monitoramento) .permission-tags span,
.app:not(.screen-monitoramento) .finance-choice {
  border-color: #4a4a4a;
  color: #fff;
  background: #0b0b0b;
}

.app:not(.screen-monitoramento) .rule-check-grid,
.entity-modal .rule-check-grid {
  border-color: #3a3a3a;
  background: #0b0b0b;
}

.app:not(.screen-monitoramento) .rule-check-option,
.entity-modal .rule-check-option {
  border-color: #4a4a4a;
  color: #fff;
  background: #111;
}

.app:not(.screen-monitoramento) .rule-tree-module,
.entity-modal .rule-tree-module,
.app:not(.screen-monitoramento) .rule-action-grid,
.entity-modal .rule-action-grid {
  border-color: #3a3a3a;
  background: #0b0b0b;
}

.app:not(.screen-monitoramento) .rule-tree-module h3,
.entity-modal .rule-tree-module h3,
.app:not(.screen-monitoramento) .rule-guide-toggle,
.entity-modal .rule-guide-toggle {
  color: #fff;
}

.app:not(.screen-monitoramento) .rule-guide-details,
.entity-modal .rule-guide-details {
  border-color: #4a4a4a;
  background: #111;
}

.app:not(.screen-monitoramento) .rule-builder,
.entity-modal .rule-builder {
  border-color: #3a3a3a;
  background: #0b0b0b;
}

.app:not(.screen-monitoramento) .rule-row,
.entity-modal .rule-row {
  border-color: #4a4a4a;
  background: #111;
}

.app:not(.screen-monitoramento) .rule-action-chip,
.entity-modal .rule-action-chip {
  border-color: #4a4a4a;
  color: #fff;
  background: #0b0b0b;
}

@media (max-width: 860px) {
  .rule-row {
    grid-template-columns: 1fr;
  }

  .rule-row-actions {
    align-items: flex-start;
  }
}

.app:not(.screen-monitoramento) .rule-check-option:hover,
.entity-modal .rule-check-option:hover {
  border-color: #fff;
}

.app:not(.screen-monitoramento) .finance-choice:hover {
  border-color: #fff;
  background: #1d1d1d;
}

.app:not(.screen-monitoramento) .finance-choice:has(input:checked) {
  border-color: #fff;
  color: #000;
  background: #fff;
}

#novoFechamentoModal .finance-choice {
  border-color: #c62828;
  background: #fff;
  color: #111;
}

#novoFechamentoModal .finance-choice:hover {
  border-color: #9f1f1f;
  background: #fff;
}

#novoFechamentoModal .finance-choice:has(input:checked) {
  border-color: #222;
  background: #fff;
  color: #111;
}

#novoFechamentoModal .finance-select-table {
  min-width: 860px;
  color: #fff;
  background: #0b0b0b;
  border-collapse: collapse;
}

#novoFechamentoModal .finance-select-table th,
#novoFechamentoModal .finance-select-table td,
#novoFechamentoModal .finance-select-table tbody tr:nth-child(even) td {
  color: #fff;
  background: #0b0b0b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.42);
  text-align: left;
}

#novoFechamentoModal .finance-select-table th {
  color: #fff;
  background: #0b0b0b;
  font-size: 0.72rem;
  text-transform: uppercase;
}

#novoFechamentoModal .finance-select-table th:first-child,
#novoFechamentoModal .finance-select-table td:first-child {
  width: 42px;
  text-align: left;
}

#novoFechamentoModal .finance-select-table .money,
#novoFechamentoModal .finance-select-table .number {
  text-align: left;
}

#novoFechamentoModal .finance-select-table tbody tr {
  border-left: 2px solid #c62828;
}

#novoFechamentoModal .finance-select-table tbody tr:has(input:checked) {
  border-left-color: transparent;
}

#novoFechamentoModal .finance-select-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #111;
}

#novoFechamentoModal .finance-select-table .finance-subtotal-row td {
  border-top: 1px solid #fff;
  border-bottom: 0;
  color: #fff;
  background: #050505;
  font-weight: 900;
}

#novoFechamentoModal .finance-link-button {
  border: 0;
  padding: 0;
  color: #fff;
  background: transparent;
  font: inherit;
  font-weight: 900;
  text-decoration: underline;
  cursor: pointer;
}

#novoFechamentoModal .finance-link-button:hover {
  color: #ffb4b4;
}

#novoFechamentoModal .finance-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

#novoFechamentoModal .finance-summary-grid div {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: #0b0b0b;
  color: #fff;
}

#novoFechamentoModal .finance-summary-grid span {
  display: block;
  margin-bottom: 4px;
  color: #cfcfcf;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

#novoFechamentoModal .finance-summary-grid strong {
  font-size: 1rem;
}

#novoFechamentoModal .finance-balance-alert {
  margin: 12px 0 14px;
  padding: 12px 14px;
  border: 1px solid #ff7b7b;
  background: #4c0808;
  color: #fff;
  line-height: 1.45;
}

#novoFechamentoModal .finance-balance-alert.is-reduction {
  border-color: #55d48a !important;
  background: #0f3a24 !important;
}

#novoFechamentoModal .finance-balance-alert.is-increase {
  border-color: #ff7b7b !important;
  background: #4c0808 !important;
}

#novoFechamentoModal .finance-balance-alert[data-ajuste-tipo="reduzir"] {
  border-color: #55d48a !important;
  background: #0f3a24 !important;
}

#novoFechamentoModal .finance-balance-alert[data-ajuste-tipo="aumentar"] {
  border-color: #ff7b7b !important;
  background: #4c0808 !important;
}

#novoFechamentoModal .finance-balance-alert p {
  margin: 8px 0 0;
}

#novoFechamentoModal .finance-balance-alert ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

#novoFechamentoModal .finance-balance-alert li + li {
  margin-top: 4px;
}

#novoFechamentoModal .finance-select-table tr.is-disabled-row {
  color: #9ca3af;
}

#novoFechamentoModal .finance-select-table tr.is-disabled-row td {
  opacity: 0.72;
}

#novoFechamentoModal .finance-empty-small {
  color: #9ca3af;
  font-weight: 700;
}

#novoFechamentoModal .finance-refresh-progress {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #334155;
  background: #080d14;
}

#novoFechamentoModal .finance-refresh-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 0.78rem;
  font-weight: 800;
}

#novoFechamentoModal .finance-refresh-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #111827;
}

#novoFechamentoModal .finance-refresh-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #38bdf8;
  transition: width 220ms ease;
}

#novoFechamentoModal .finance-refresh-progress.is-error {
  border-color: #ff7b7b;
}

#novoFechamentoModal .finance-refresh-progress.is-error .finance-refresh-track span {
  background: #ff7b7b;
}

.app:not(.screen-monitoramento) .user-modal-tab {
  color: #fff;
}

.app:not(.screen-monitoramento) .user-modal-tab.active,
.entity-modal .user-modal-tab.active {
  border-color: #fff;
  color: #000;
  background: #fff;
}

.entity-modal .user-modal-tab {
  color: #fff;
}

.entity-modal .user-modal-tabs {
  border-bottom-color: #3a3a3a;
}

.entity-modal .ocr-edit-preview,
.entity-modal .ocr-thumb-placeholder {
  border-color: #3a3a3a;
  color: #cfcfcf;
  background: #0b0b0b;
}

.finance-modal .report-sheet {
  color: #111;
  background: #fff;
}

.finance-modal .report-sheet *,
.finance-modal .report-sheet strong,
.finance-modal .report-sheet .kpi strong {
  color: #111;
}

.finance-modal .report-sheet .table-wrap,
.finance-modal .report-sheet table {
  background: #fff;
}

.finance-modal .report-sheet th {
  color: #fff;
  background: #111;
}

.finance-modal .report-sheet td {
  color: #111;
  background: #fff;
}

.finance-modal .report-sheet .report-subtotal-row td {
  color: #111;
  background: #eeeeee;
}

.finance-modal .report-sheet .section-title,
.finance-modal .report-sheet .grand-total,
.finance-modal .report-sheet .grand-total span {
  color: #fff;
}

.finance-modal .report-sheet .report-issued-note {
  color: #555;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  html,
  body {
    width: 210mm;
    min-height: 297mm;
    margin: 0 !important;
    color: #111;
    background: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body > :not(#financeReportModal) {
    display: none !important;
  }

  #financeReportModal,
  #financeReportModal * {
    visibility: visible !important;
  }

  #financeReportModal {
    position: static !important;
    display: block !important;
    width: 210mm;
    min-height: 0;
    margin: 0 auto;
    padding: 0;
    overflow: visible !important;
    background: #fff;
  }

  .finance-modal-shell {
    max-height: none;
    width: 210mm;
    border: 0;
    border-radius: 0;
    overflow: visible;
    background: #fff;
  }

  .finance-modal-header,
  .finance-modal-actions {
    display: none !important;
  }

  .finance-modal-body {
    overflow: visible;
    width: 210mm;
    padding: 0;
  }

  .report-sheet {
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    padding: 34px;
    border: 0;
    box-shadow: none;
    page-break-after: always;
    break-after: page;
    overflow: visible;
  }

  .report-sheet:last-child {
    page-break-after: auto;
    break-after: auto;
  }

  .report-sheet .table-wrap {
    overflow: visible;
  }

  .report-header,
  .report-sheet .kpi-grid,
  .report-sheet .table-wrap,
  .report-sheet tr,
  .grand-total,
  .report-issued-note {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .grand-total {
    margin-top: 4mm;
    padding: 3mm 4mm;
    font-size: 0.95rem;
  }

  .report-issued-note {
    margin-top: 6mm;
    padding-top: 0;
    font-size: 0.58rem;
  }
}

@media (max-width: 1200px) {
  .screen {
    padding: 22px;
  }

  .filter-grid,
  .form-grid,
  .form-grid.two,
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #reportFilters .field,
  .compact-filter-grid .field {
    flex: 1 1 220px;
  }

  .page-head {
    flex-wrap: wrap;
  }
}

@media (max-width: 900px) {
  .app,
  .app.sidebar-collapsed {
    grid-template-columns: 1fr;
  }
  .app:not(.screen-monitoramento) {
    min-height: 100vh;
  }
  .sidebar {
    min-height: auto;
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .sidebar-top {
    position: sticky;
    top: 0;
    z-index: 8;
  }
  .sidebar-content {
    max-height: 46vh;
  }
  .app.sidebar-collapsed .sidebar-content {
    display: none;
  }
  .screen {
    min-height: auto;
    padding: 18px;
  }
  header {
    flex-direction: column;
    align-items: stretch;
  }
  .summary {
    justify-content: flex-start;
  }
  #map {
    min-height: 460px;
  }
  .admin-layout,
  .ocr-edit-layout {
    grid-template-columns: 1fr;
  }
  .filter-grid,
  .form-grid,
  .form-grid.two,
  .kpi-grid,
  .report-options {
    grid-template-columns: 1fr;
  }
  .page-head {
    flex-direction: column;
  }
  .grand-total {
    max-width: none;
    font-size: 1.1rem;
  }
}

@media (max-width: 640px) {
  .screen {
    padding: 12px;
  }

  .card {
    padding: 14px;
    margin-bottom: 12px;
  }

  .page-head {
    gap: 10px;
    margin-bottom: 12px;
  }

  .page-head h1 {
    font-size: 1.22rem;
  }

  .actions {
    align-items: stretch;
  }

  .actions .btn {
    flex: 1 1 100%;
    justify-content: center;
  }

  .entity-modal,
  .finance-modal {
    padding: 10px;
  }

  .entity-modal-panel,
  .finance-modal-shell {
    max-height: calc(100vh - 20px);
    width: 100%;
    border-radius: 8px;
  }

  .entity-modal-header,
  .finance-modal-header {
    align-items: flex-start;
  }

  .entity-modal-body,
  .finance-modal-body {
    padding: 12px;
  }
}
