* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }

.pb-safe { padding-bottom: max(env(safe-area-inset-bottom, 0px), 8px); }

/* Force dark inputs everywhere */
input, textarea, select {
  background-color: rgb(17 24 39) !important;
  color: white !important;
  border-color: rgb(55 65 81) !important;
  -webkit-appearance: none;
  appearance: none;
}
input::placeholder, textarea::placeholder { color: rgb(107 114 128); }
input:focus, textarea:focus, select:focus { outline: none; border-color: #EA580C !important; }
input:-webkit-autofill,
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 100px rgb(17 24 39) inset !important;
  -webkit-text-fill-color: white !important;
}
select option { background-color: rgb(17 24 39); color: white; }

/* Hide scrollbar */
::-webkit-scrollbar { width: 0; background: transparent; }

.nav-btn { transition: color 0.15s; min-width: 48px; }

/* Shared card style for forms */
.form-input {
  width: 100%;
  background: rgb(17 24 39);
  color: white;
  border: 1px solid rgb(55 65 81);
  border-radius: 0.5rem;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
}
.form-input:focus { border-color: #EA580C; outline: none; }

.btn-primary {
  background: #EA580C;
  color: black;
  font-weight: 700;
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  width: 100%;
  font-size: 0.9rem;
}
.btn-ghost {
  color: rgb(156 163 175);
  font-weight: 600;
  padding: 0.625rem 1.25rem;
  width: 100%;
  font-size: 0.875rem;
}

/* DVIR item states */
.dvir-ok    { background: rgba(21,128,61,0.2); border-color: rgb(21,128,61); }
.dvir-defect { background: rgba(234,88,12,0.2); border-color: #EA580C; }
.dvir-blank  { background: rgb(31 41 55); border-color: rgb(75 85 99); }

/* Detention timer pulse */
@keyframes pulse-orange {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.timer-active { animation: pulse-orange 2s ease-in-out infinite; }

/* Receipt photo capture */
.receipt-cap-label {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  background: rgb(31 41 55); border: 1.5px dashed rgb(55 65 81);
  border-radius: 0.75rem; padding: 0.75rem; cursor: pointer;
  color: rgb(156 163 175); font-size: 0.875rem; transition: border-color 0.15s, color 0.15s;
}
.receipt-cap-label:active { border-color: #EA580C; color: #EA580C; }
.receipt-preview { width: 100%; border-radius: 0.625rem; border: 1px solid rgb(55 65 81); display: block; max-height: 200px; object-fit: contain; background: rgb(17 24 39); }
.receipt-thumb { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; cursor: pointer; border: 1px solid rgb(55 65 81); flex-shrink: 0; }
.scan-state { font-size: 0.7rem; text-align: center; color: #EA580C; padding: 0.25rem 0; margin-top: 4px; }

/* DVIR section dividers */
.dvir-section-header {
  font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: rgb(107 114 128); font-weight: 800; padding: 0.75rem 0 0.25rem;
  border-top: 1px solid rgb(31 41 55); margin-top: 0.5rem;
}
.dvir-section-header.first { border-top: none; padding-top: 0; margin-top: 0; }

/* Tax screen */
.tax-line {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.5rem 0; border-bottom: 1px solid rgb(31 41 55); font-size: 0.875rem;
}
.tax-bar-wrap { background: rgb(31 41 55); border-radius: 9999px; height: 5px; overflow: hidden; }
.tax-bar { background: #EA580C; height: 5px; border-radius: 9999px; transition: width 0.4s ease; }

/* Filter pills on list screens */
.filter-pill {
  font-size: 0.72rem; font-weight: 700; padding: 0.28rem 0.85rem;
  border-radius: 9999px; border: 1px solid rgb(55 65 81);
  color: rgb(156 163 175); background: transparent; white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.filter-pill.active { background: #EA580C; border-color: #EA580C; color: #000; }

/* Location button in trip form */
.loc-btn {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.7rem; color: #EA580C; padding: 3px 7px;
  border: 1px solid rgba(234,88,12,0.4); border-radius: 0.4rem;
  white-space: nowrap; font-weight: 700;
}
.loc-btn:disabled { opacity: 0.5; }
