/* Design tokens — ver docs/06_Frontend/Design_Reference.md. Fonte de verdade: docs/design/. */
:root {
  --tf-bg: #f5f5f3;
  --tf-text: #10192e;
  --tf-text-secondary: rgba(16, 25, 46, .6);
  --tf-primary: #2563eb;
  --tf-primary-hover: #1d4ed8;
  --tf-sidebar-bg: #0d1526;
  --tf-sidebar-active-bg: rgba(59, 130, 246, .18);
  --tf-sidebar-active-border: #3b82f6;
  --tf-border-card: rgba(15, 23, 42, .08);
  --tf-border-input: rgba(15, 23, 42, .14);
  --tf-disabled-bg: #94a3b8;
  --tf-row-hover: #fafaf8;
  --tf-toast-bg: #10192e;
  --tf-font: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --tf-font-mono: "IBM Plex Mono", "Cascadia Mono", monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--tf-bg);
  color: var(--tf-text);
  font-family: var(--tf-font);
}

.tf-app {
  display: flex;
  min-height: 100vh;
}

.tf-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--tf-sidebar-bg);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.tf-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 20px;
  font-weight: 700;
  font-size: 16px;
}

.tf-brand-badge {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--tf-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.tf-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 14px;
}

.tf-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  border-left: 3px solid transparent;
  color: rgba(255, 255, 255, .75);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
}

.tf-nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, .04);
}

.tf-nav-item.active {
  background: var(--tf-sidebar-active-bg);
  border-left-color: var(--tf-sidebar-active-border);
  color: #fff;
}

.tf-nav-badge {
  background: #dc2626;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
}

.tf-sidebar-footer {
  margin-top: auto;
  padding: 12px 14px 0;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.tf-sidebar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
}

.tf-sidebar-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(59, 130, 246, .25);
  color: #93c5fd;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.tf-sidebar-user-info {
  min-width: 0;
}

.tf-sidebar-user-name {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tf-sidebar-user-role {
  color: rgba(255, 255, 255, .4);
  font-size: 11.5px;
}

.tf-sidebar-link {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  display: block;
  width: 100%;
  padding: 8px;
  border-radius: 7px;
  color: rgba(255, 255, 255, .6);
  font-family: var(--tf-font);
  font-size: 12.5px;
  margin-bottom: 2px;
}

.tf-sidebar-link:last-child {
  margin-bottom: 0;
}

.tf-sidebar-link:hover {
  background: rgba(255, 255, 255, .06);
  color: #fff;
}

.tf-content {
  flex: 1;
  padding: 26px 28px;
}

.tf-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  margin: -26px -28px 24px;
  padding: 0 28px;
  background: #fff;
  border-bottom: 1px solid var(--tf-border-card);
}

.tf-page-header h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--tf-text);
}

.tf-page-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tf-page-header-actions select {
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid var(--tf-border-input);
  font-family: var(--tf-font);
  font-size: 13px;
  color: var(--tf-text);
  background: #fff;
}

.tf-home-greeting h2 {
  margin: 0 0 4px;
  font-size: 21px;
  font-weight: 700;
  color: var(--tf-text);
}

.tf-home-greeting p {
  margin: 0 0 22px;
  font-size: 14px;
  color: var(--tf-text-secondary);
}

.tf-login-layout {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0d1526 radial-gradient(circle at 50% 20%, rgba(37, 99, 235, .35), transparent 60%);
  font-family: var(--tf-font);
}

.tf-login-card {
  width: 360px;
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}

.tf-login-subtitulo {
  margin: 0 0 20px;
  font-size: 13px;
  color: var(--tf-text-secondary);
}

.tf-login-card .tf-field-label {
  margin-top: 16px;
}

.tf-login-demo {
  margin: 20px 0 0;
  font-size: 12px;
  color: rgba(16, 25, 46, .4);
  text-align: center;
}

.tf-login-card input {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 7px;
  border: 1px solid var(--tf-border-input);
  font-family: var(--tf-font);
  font-size: 14px;
}

.tf-login-card button {
  width: 100%;
  margin-top: 20px;
  padding: 11px;
  border: none;
  border-radius: 8px;
  background: var(--tf-primary);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.tf-login-card button:hover:not(:disabled) {
  background: var(--tf-primary-hover);
}

.tf-login-card button:disabled {
  background: var(--tf-disabled-bg);
  cursor: not-allowed;
}

.tf-login-erro {
  color: #b91c1c;
  font-size: 13px;
  margin: 12px 0 0;
}

/* Compartilhado entre todos os drawers laterais (Frete/Motorista/Veículo/Cliente/Viagem —
   Form e Detalhe) — mesma duplicação de CSS scoped do Blazor mencionada acima. */
.tf-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  background: #fff;
  box-shadow: -10px 0 30px rgba(0, 0, 0, .15);
  padding: 20px;
  overflow-y: auto;
  z-index: 100;
  animation: tf-drawer-in .18s ease;
}

@keyframes tf-drawer-in {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.tf-drawer-460 {
  width: 460px;
}

.tf-drawer-620 {
  width: 620px;
}

.tf-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.tf-drawer-header h2 {
  margin: 0;
  font-size: 18px;
  color: var(--tf-text);
}

.tf-drawer-fechar {
  background: none;
  border: none;
  font-size: 22px;
  color: rgba(16, 25, 46, .4);
  cursor: pointer;
}

.tf-drawer-body p {
  font-size: 13.5px;
  margin: 6px 0;
}

.tf-drawer label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--tf-text-secondary);
  margin-top: 14px;
}

.tf-drawer input,
.tf-drawer select,
.tf-drawer textarea {
  width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
  padding: 9px 11px;
  border-radius: 7px;
  border: 1px solid var(--tf-border-input);
  font-family: var(--tf-font);
  font-size: 13.5px;
  color: var(--tf-text);
}

.tf-field-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--tf-text);
  margin-bottom: 6px;
}

.tf-form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.tf-form-campo {
  margin-bottom: 14px;
}

.tf-form-secao-titulo {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: rgba(16, 25, 46, .45);
  margin-bottom: 10px;
}

.tf-drawer-acoes {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.tf-drawer-acoes button:disabled {
  background: var(--tf-disabled-bg);
  cursor: not-allowed;
}

.tf-aviso-piso {
  color: #92400e;
  background: rgba(146, 64, 15, .1);
  padding: 8px 10px;
  border-radius: 8px;
}

.tf-timeline {
  list-style: none;
  padding: 0;
  font-size: 12.5px;
  color: var(--tf-text-secondary);
}

.tf-timeline li {
  padding: 4px 0;
  border-bottom: 1px solid var(--tf-border-card);
}

.tf-btn-perigo {
  padding: 10px 16px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #b91c1c;
  color: #b91c1c;
  font-weight: 600;
  cursor: pointer;
}

.tf-btn-perigo:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.tf-btn-outline-primary {
  flex: 1;
  padding: 12px;
  border: 1px solid var(--tf-primary);
  border-radius: 8px;
  background: #fff;
  color: var(--tf-primary);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.tf-btn-outline-primary:hover:not(:disabled) {
  background: rgba(37, 99, 235, .06);
}

.tf-btn-outline-primary:disabled {
  border-color: var(--tf-disabled-bg);
  color: var(--tf-disabled-bg);
  cursor: not-allowed;
}

.tf-btn-full {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  font-size: 14px;
}

/* Compartilhado entre telas de lista (Fretes/Viagens/Motoristas/Veículos/Clientes/Documentos
   Fiscais) — extraído daqui porque CSS scoped do Blazor não é compartilhado entre componentes
   irmãos, e essas regras estavam duplicadas em cada Página.razor.css (ver Notes.md F13.S03/S04). */
.tf-btn-primary,
.tf-btn-secondary {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
}

.tf-btn-primary {
  background: var(--tf-primary);
  color: #fff;
}

.tf-btn-primary:hover:not(:disabled) {
  background: var(--tf-primary-hover);
}

.tf-btn-primary:disabled {
  background: var(--tf-disabled-bg);
  cursor: not-allowed;
}

.tf-btn-secondary {
  background: #fff;
  color: var(--tf-text);
  border: 1px solid var(--tf-border-input);
}

.tf-btn-secondary:hover {
  background: var(--tf-row-hover);
}

.tf-table-card {
  background: #fff;
  border: 1px solid var(--tf-border-card);
  border-radius: 12px;
  overflow: hidden;
}

.tf-tabela {
  width: 100%;
  border-collapse: collapse;
}

.tf-tabela thead tr {
  background: var(--tf-row-hover);
}

.tf-tabela th {
  text-align: left;
  padding: 11px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--tf-text-secondary);
  border-bottom: 1px solid var(--tf-border-card);
}

.tf-tabela td {
  padding: 12px 16px;
  font-size: 13.5px;
  color: var(--tf-text);
  border-bottom: 1px solid rgba(15, 23, 42, .06);
}

.tf-tabela tbody tr:last-child td {
  border-bottom: none;
}

.tf-tabela th.tf-num,
.tf-tabela td.tf-num {
  text-align: right;
}

.tf-linha-clicavel {
  cursor: pointer;
}

.tf-linha-clicavel:hover {
  background: var(--tf-row-hover);
}

.tf-mono {
  font-family: var(--tf-font-mono);
}

.tf-vazio {
  padding: 40px;
  text-align: center;
  color: rgba(16, 25, 46, .4);
  font-size: 14px;
}

.tf-badge {
  display: inline-block;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 700;
}

/* Ficha de segurança (ViaGate) — painel no detalhe do motorista. */
.tf-ficha-aprovada { background: #dcf5e4; color: #176b3a; }
.tf-ficha-pendente { background: #fff1d6; color: #8a5a00; }
.tf-ficha-ressalva { background: #ffe3cf; color: #9a3d00; }
.tf-ficha-cancelada { background: #eceef2; color: #4a5266; }

.tf-ficha-id {
  margin-left: 8px;
  font-size: 12px;
  color: var(--tf-text-secondary);
}

.tf-ficha-info {
  color: var(--tf-text-secondary);
}

.tf-ficha-pendencias {
  margin: 6px 0 0 18px;
  padding: 0;
}

.tf-ficha-veiculo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
}

.tf-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: var(--tf-toast-bg);
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  animation: tf-toast-in .15s ease;
}

@keyframes tf-toast-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Helm Staff Support Tools (protótipo Claude Design) — central de suporte técnico do staff.
   Só o que ainda não existia: tira de abas, cards de KPI e modal central de confirmação. */
.tf-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.tf-stat-card {
  background: #fff;
  border: 1px solid var(--tf-border-card);
  border-radius: 10px;
  padding: 15px 16px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.tf-stat-card-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--tf-text-secondary);
}

.tf-stat-card-value {
  font-family: var(--tf-font-mono);
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
}

.tf-stat-card-note {
  font-size: 11.5px;
  color: var(--tf-text-secondary);
}

.tf-tabs {
  display: flex;
  gap: 2px;
  padding: 0 8px;
  border-bottom: 1px solid var(--tf-border-card);
  overflow-x: auto;
}

.tf-tab {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 12px 12px 10px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--tf-text-secondary);
  box-shadow: inset 0 -2px 0 transparent;
}

.tf-tab.active {
  color: var(--tf-primary-hover);
  box-shadow: inset 0 -2px 0 var(--tf-primary);
}

.tf-tab-count {
  font-family: var(--tf-font-mono);
  font-size: 11px;
  margin-left: 6px;
  color: rgba(16, 25, 46, .5);
}

.tf-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(13, 21, 38, .5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.tf-modal {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 430px;
  box-shadow: 0 24px 60px rgba(13, 21, 38, .3);
  overflow: hidden;
}

.tf-modal-body {
  padding: 18px 20px 14px;
}

.tf-modal-body h3 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
}

.tf-modal-body p {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: var(--tf-text-secondary);
}

.tf-modal-meta {
  margin-top: 12px;
  background: var(--tf-row-hover);
  border: 1px solid var(--tf-border-card);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--tf-font-mono);
  font-size: 12px;
}

.tf-modal-acoes {
  padding: 13px 20px;
  background: var(--tf-row-hover);
  border-top: 1px solid var(--tf-border-card);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
