/* RJDrive PWA — espelha o app Android */
.drive-app {
  --rj-ink: #0B1C2C;
  --rj-navy: #0F2A4A;
  --rj-amber: #C47A0A;
  --rj-amber-soft: #FFF4E0;
  --rj-bg: #EEF2F7;
  --rj-muted: #5A6B7D;
  --rj-card: #FFFFFF;
  --rj-line: #D8E0EA;
  --rj-success: #0F7A3A;
  --rj-success-soft: #E6F6EC;
  --rj-danger: #B42318;
  --rj-danger-soft: #FDECEC;
  --rj-info: #1D4ED8;
  --rj-info-soft: #E8EEFF;
  --rj-neutral: #64748B;
  --rj-neutral-soft: #F1F5F9;
  --d-nav-h: 56px;
  --d-top-h: 56px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  background: var(--rj-bg);
  color: var(--rj-ink);
  font-family: 'Roboto', sans-serif;
}

.drive-app #drive-shell {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  background: var(--rj-bg);
}

.d-status { height: var(--safe-t); background: var(--rj-navy); flex-shrink: 0; }

.d-topbar {
  display: flex;
  align-items: center;
  height: var(--d-top-h);
  padding: 0 16px;
  background: var(--rj-navy);
  flex-shrink: 0;
}

.d-topbar-title {
  flex: 1;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.d-topbar-sair {
  border: none;
  background: none;
  color: var(--rj-amber);
  font-weight: 700;
  font-size: 15px;
  padding: 8px;
  cursor: pointer;
}

.d-topbar-back {
  border: none;
  background: none;
  color: #fff;
  font-size: 22px;
  padding: 4px 10px 4px 0;
  cursor: pointer;
}

.d-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--d-nav-h) + var(--safe-b) + 8px);
}

.d-content.no-nav { padding-bottom: calc(var(--safe-b) + 16px); }

.d-page { padding: 20px 20px 0; }

.d-page-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  color: var(--rj-navy);
}

.d-page-sub {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--rj-muted);
}

.d-list { padding: 12px 16px 16px; }

.d-card {
  background: var(--rj-card);
  border: 1px solid var(--rj-line);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 12px;
}

.d-card-form {
  background: var(--rj-card);
  border: 1px solid var(--rj-line);
  border-radius: 16px;
  padding: 18px;
  margin: 0 20px 20px;
}

.d-label-section {
  font-size: 11px;
  font-weight: 700;
  color: var(--rj-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.d-ola {
  font-size: 26px;
  font-weight: 700;
  color: var(--rj-navy);
  margin: 0;
  letter-spacing: -0.01em;
}

.d-chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  margin-top: 6px;
}

.d-chip-amber { background: var(--rj-amber-soft); color: var(--rj-amber); }
.d-chip-success { background: var(--rj-success-soft); color: var(--rj-success); }
.d-chip-danger { background: var(--rj-danger-soft); color: var(--rj-danger); }
.d-chip-info { background: var(--rj-info-soft); color: var(--rj-info); }
.d-chip-neutral { background: var(--rj-neutral-soft); color: var(--rj-neutral); }

.d-caminhao {
  font-size: 18px;
  font-weight: 700;
  color: var(--rj-navy);
  margin-top: 10px;
}

.d-viagem-rota {
  font-size: 15px;
  color: var(--rj-muted);
  margin-top: 4px;
}

.d-field { margin-top: 14px; }

.d-field label:not(.d-radio), .d-field > span.lbl {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--rj-navy);
  margin-bottom: 6px;
}

.d-field input:not([type=radio]):not([type=checkbox]),
.d-field select,
.d-field textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--rj-line);
  border-radius: 12px;
  font-family: inherit;
  font-size: 16px;
  background: #fff;
}

.d-field input.valor {
  font-size: 22px;
  font-weight: 700;
  color: var(--rj-navy);
}

.d-field select, .d-select {
  background: var(--rj-neutral-soft);
  height: 52px;
}

.d-field-hint { font-size: 12px; color: var(--rj-muted); margin-top: 2px; }

.d-radio-group { margin-top: 6px; }

.d-radio {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  font-size: 14px;
  font-weight: 400;
  color: var(--rj-ink);
  cursor: pointer;
  margin-bottom: 0;
}

.d-radio input[type=radio] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin: 0;
  flex-shrink: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  accent-color: var(--rj-navy);
}

.d-btn-primary {
  display: block;
  width: 100%;
  height: 52px;
  margin-top: 16px;
  border: none;
  border-radius: 12px;
  background: var(--rj-navy);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.d-btn-outline {
  display: block;
  width: 100%;
  padding: 12px;
  margin-top: 10px;
  border: 1px solid var(--rj-navy);
  border-radius: 12px;
  background: #fff;
  color: var(--rj-navy);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.d-toggle {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.d-toggle button {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--rj-line);
  border-radius: 12px;
  background: #fff;
  color: var(--rj-muted);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}

.d-toggle button.active {
  border-color: var(--rj-navy);
  color: var(--rj-navy);
  background: var(--rj-neutral-soft);
}

.d-list-card {
  display: flex;
  border: 1px solid var(--rj-line);
  border-radius: 14px;
  margin-bottom: 10px;
  overflow: hidden;
  text-align: left;
  width: 100%;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}

.d-list-bar { width: 5px; min-height: 72px; flex-shrink: 0; }

.d-list-body { flex: 1; padding: 14px; }

.d-list-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--rj-navy);
}

.d-list-detail {
  margin-top: 6px;
  font-size: 14px;
  color: var(--rj-muted);
  line-height: 1.45;
  white-space: pre-line;
}

.d-bottomnav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  background: #fff;
  border-top: 1px solid var(--rj-line);
  padding-bottom: constant(safe-area-inset-bottom);
  padding-bottom: var(--safe-b);
  min-height: var(--d-nav-h);
  height: auto;
}

.d-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: none;
  background: none;
  color: var(--rj-muted);
  font-size: 11px;
  font-weight: 500;
  padding: 6px 2px;
  cursor: pointer;
  position: relative;
}

.d-nav-item.active { color: var(--rj-navy); font-weight: 600; }

.d-nav-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 28px;
  border-radius: 16px;
}

.d-nav-item.active .d-nav-icon-wrap { background: rgba(15, 42, 74, 0.12); }

.d-nav-item .material-symbols-rounded { font-size: 22px; }

.d-nav-badge {
  position: absolute;
  top: -2px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--rj-danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.d-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--rj-muted);
}

.d-swipe-card {
  position: relative;
  overflow: hidden;
  margin-bottom: 10px;
  border-radius: 14px;
}

.d-swipe-card .d-list-card { margin-bottom: 0; transition: transform 0.15s ease; }

.d-qr-preview {
  margin-top: 8px;
  padding: 10px;
  background: var(--rj-neutral-soft);
  border-radius: 12px;
  font-size: 12px;
  color: var(--rj-muted);
  word-break: break-all;
}

.d-qr-reader { width: 100%; border-radius: 12px; overflow: hidden; margin-top: 8px; }

.d-bottomnav[hidden] { display: none !important; }

@media (min-width: 768px) {
  .drive-app #drive-shell {
    max-width: 480px;
    margin: 0 auto;
    box-shadow: 0 0 40px rgba(0,0,0,0.08);
  }
  .d-bottomnav {
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%);
  }
}
