:root {
  --tr-teal: #0f766e;
  --tr-ink: #172321;
  --tr-muted: #63716f;
  --tr-soft: #eef7f5;
  --tr-line: #dbe7e4;
}

body {
  color: var(--tr-ink);
  background: #f8fbfa;
}

a {
  color: var(--tr-teal);
  text-decoration: none;
}

a:hover {
  color: #0b5f58;
}

.btn-primary {
  background: var(--tr-teal);
  border-color: var(--tr-teal);
}

.btn-primary:hover {
  background: #0b5f58;
  border-color: #0b5f58;
}

.btn-outline-primary {
  color: var(--tr-teal);
  border-color: var(--tr-teal);
}

.btn-outline-primary:hover {
  background: var(--tr-teal);
  border-color: var(--tr-teal);
}

.text-teal {
  color: var(--tr-teal);
}

.hero-band {
  background: linear-gradient(180deg, #ffffff 0%, #eef7f5 100%);
}

.card {
  border-color: var(--tr-line);
  border-radius: 8px;
}

.metric-card {
  min-height: 104px;
}

.vehicle-photo {
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #e6eeec;
}

.photo-thumb {
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.timeline {
  border-left: 2px solid var(--tr-line);
  margin-left: 0.7rem;
  padding-left: 1rem;
}

.timeline-item {
  position: relative;
  margin-bottom: 1rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.45rem;
  top: 0.25rem;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: var(--tr-teal);
}

.phone-preview {
  max-width: 280px;
  border: 10px solid #172321;
  border-radius: 28px;
  background: #f8fbfa;
  min-height: 430px;
}

.phone-top {
  width: 90px;
  height: 5px;
  border-radius: 10px;
  background: #172321;
  margin: 13px auto;
}

.mini-card {
  background: #ffffff;
  border: 1px solid var(--tr-line);
  border-radius: 8px;
  padding: 0.9rem;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1030;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  min-height: 64px;
}

.bottom-nav a,
.bottom-nav button {
  border: 0;
  background: transparent;
  color: var(--tr-muted);
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.bottom-add {
  margin: 0.55rem;
  border-radius: 999px !important;
  background: var(--tr-teal) !important;
  color: white !important;
  font-weight: 700;
}

.has-bottom-nav footer {
  margin-bottom: 64px;
}

.install-toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: min(360px, calc(100vw - 2rem));
  background: #ffffff;
  border: 1px solid var(--tr-line);
  border-radius: 8px;
  padding: 1rem;
  z-index: 1040;
}

.tr-form-shell {
  max-width: 980px;
  margin: 0 auto;
}

.tr-form-wrapper {
  max-width: 720px;
  margin: 0 auto;
}

.tr-form-card {
  border: 1px solid var(--tr-line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(23, 35, 33, 0.06);
  padding: 1.25rem;
}

.tr-form-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.tr-form-subtitle {
  color: var(--tr-muted);
  margin-bottom: 1.25rem;
}

.tr-form-section {
  padding-top: 0.75rem;
}

.tr-form-section + .tr-form-section {
  border-top: 1px solid var(--tr-line);
  margin-top: 1rem;
  padding-top: 1.25rem;
}

.tr-form-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.9rem;
}

.tr-field {
  min-width: 0;
}

.tr-field .e-input-group,
.tr-field .e-control-wrapper {
  width: 100%;
}

.tr-select {
  min-height: 2.5rem;
}

.tr-file-control {
  min-height: 42px;
}

.tr-form-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.tr-action-primary,
.tr-action-secondary {
  min-width: 132px;
}

.tr-local-error,
.e-error {
  color: #b42318;
  font-size: 0.84rem;
  margin-top: 0.35rem;
}

.tr-calendar-card {
  background: #ffffff;
  border: 1px solid var(--tr-line);
  border-radius: 8px;
  padding: 0.75rem;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(23, 35, 33, 0.06);
}

.tr-calendar-page .e-schedule {
  border: 0;
}

.tr-calendar-page .e-schedule .e-toolbar {
  border-radius: 8px 8px 0 0;
}

.tr-calendar-dialog-content span {
  display: block;
  color: var(--tr-muted);
  font-size: 0.78rem;
}

.tr-calendar-dialog-content strong {
  font-size: 0.94rem;
}

.tr-calendar-dialog-meta {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tr-calendar-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tr-calendar-mobile-agenda {
  background: #ffffff;
  border: 1px solid var(--tr-line);
  border-radius: 8px;
  padding: 1rem;
}

.tr-calendar-agenda-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
  align-items: start;
  width: 100%;
  border: 1px solid var(--tr-line);
  border-radius: 8px;
  background: #ffffff;
  padding: 0.8rem;
  text-align: left;
}

.tr-calendar-agenda-item small {
  display: block;
  color: var(--tr-muted);
  margin-top: 0.15rem;
}

.tr-calendar-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  margin-top: 0.3rem;
}

.tr-calendar-empty {
  color: var(--tr-muted);
  border: 1px dashed var(--tr-line);
  border-radius: 8px;
  padding: 1rem;
}

.tr-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.tr-page-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.tr-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tr-reminders-grid {
  align-items: stretch;
}

.tr-reminder-card {
  height: 100%;
  border: 1px solid rgba(23, 35, 33, 0.1);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(23, 35, 33, 0.06);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.tr-reminder-card:hover,
.tr-reminder-card:focus {
  border-color: rgba(15, 118, 110, 0.28);
  box-shadow: 0 12px 28px rgba(23, 35, 33, 0.09);
  transform: translateY(-1px);
  outline: 0;
}

.tr-reminder-card.is-overdue {
  border-color: rgba(180, 35, 24, 0.28);
}

.tr-reminder-body {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 1rem;
}

.tr-reminder-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.tr-type-badge,
.tr-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.65rem;
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.tr-type-badge {
  color: #0f4f49;
  background: #e5f4f1;
  border: 1px solid #c7e5df;
}

.tr-status-badge {
  color: #42504d;
  background: #eef2f1;
  border: 1px solid #d9e4e1;
}

.tr-status-active {
  color: #0b5f58;
  background: #ddf4ef;
  border-color: #b8e1d9;
}

.tr-status-completed {
  color: #166534;
  background: #dcfce7;
  border-color: #bbf7d0;
}

.tr-status-overdue,
.tr-status-expired {
  color: #9f1c13;
  background: #fee4df;
  border-color: #fecdca;
}

.tr-status-dismissed {
  color: #5f4b14;
  background: #fef3c7;
  border-color: #fde68a;
}

.tr-reminder-title {
  color: var(--tr-ink);
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 0.25rem;
}

.tr-reminder-vehicle {
  color: var(--tr-muted);
  font-size: 0.9rem;
  margin-bottom: 0.95rem;
}

.tr-reminder-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.tr-reminder-meta div {
  min-width: 0;
  border: 1px solid var(--tr-line);
  border-radius: 8px;
  background: #f8fbfa;
  padding: 0.65rem;
}

.tr-reminder-meta span {
  display: block;
  color: var(--tr-muted);
  font-size: 0.74rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
  text-transform: uppercase;
}

.tr-reminder-meta strong {
  display: block;
  color: var(--tr-ink);
  font-size: 0.93rem;
  font-weight: 700;
}

.tr-overdue-note {
  border-radius: 8px;
  color: #9f1c13;
  background: #fff1ef;
  border: 1px solid #fecdca;
  padding: 0.6rem 0.7rem;
  font-size: 0.86rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.tr-reminder-description {
  color: var(--tr-muted);
  font-size: 0.9rem;
  margin: 0 0 0.85rem;
}

.tr-reminder-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.5rem;
}

.tr-reminder-actions form {
  margin: 0;
}

.tr-reminder-actions .btn {
  min-width: 86px;
}

.tr-empty-state {
  border: 1px dashed var(--tr-line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(23, 35, 33, 0.04);
  padding: 2rem;
  text-align: center;
}

@media (max-width: 991.98px) {
  .has-bottom-nav .install-toast {
    bottom: 5rem;
  }
}

@media (max-width: 576px) {
  .tr-page-header {
    flex-direction: column;
  }

  .tr-page-actions,
  .tr-page-actions .btn,
  .tr-page-actions .dropdown,
  .tr-page-actions .dropdown-toggle {
    width: 100%;
  }

  .tr-page-actions {
    justify-content: stretch;
  }

  .tr-form-card {
    padding: 1rem;
  }

  .tr-form-actions {
    align-items: stretch;
  }

  .tr-form-actions .e-btn,
  .tr-form-actions .btn {
    width: 100%;
  }

  .tr-calendar-card {
    padding: 0.25rem;
  }

  .tr-calendar-page .e-schedule .e-toolbar-items {
    min-height: 48px;
  }

  .tr-calendar-page .e-schedule .e-toolbar .e-toolbar-item .e-tbar-btn {
    min-height: 38px;
  }

  .tr-calendar-dialog-meta {
    grid-template-columns: 1fr;
  }

  .tr-calendar-dialog-actions .e-btn {
    width: 100%;
  }

  .tr-reminder-meta {
    grid-template-columns: 1fr;
  }

  .tr-reminder-actions {
    align-items: stretch;
  }

  .tr-reminder-actions,
  .tr-reminder-actions form,
  .tr-reminder-actions .btn {
    width: 100%;
  }
}
