/* Techfortune Fleet brand overrides. Loaded last in <head> by 40-techfortune-branding.sh.
   Navy  #1A2B6B: brand text, sidebar
   Orange #E07B3A (--tf-btn): buttons, links, focus, checkboxes, active item, drag handle
   (--tf-orange #F4A261 is the original brand orange, now unused) */
:root {
  --tf-navy: #1a2b6b;
  --tf-navy-light: #2a3f8f;
  --tf-orange: #f4a261;
  --tf-orange-dark: #e08a45;
  --tf-orange-light: #f7bb88;
  --tf-btn: #e07b3a;
  --tf-btn-hover: #cc6a2d;
  --tf-btn-active: #b45a22;
}

/* Primary buttons */
.btn.btn-primary,
.btn.fb-button-primary,
a.btn.btn-primary,
a.btn.fb-button-primary,
.fc-button.btn-primary,
.fc-button.fb-button-primary {
  background-color: var(--tf-btn) !important;
  border-color: var(--tf-btn-hover) !important;
  color: #ffffff !important;
}
.btn.btn-primary:hover,
.btn.fb-button-primary:hover,
a.btn.btn-primary:hover,
a.btn.fb-button-primary:hover {
  background-color: var(--tf-btn-hover) !important;
}
.btn.btn-primary:active,
.btn.btn-primary:focus,
.btn.fb-button-primary:active,
.btn.fb-button-primary:focus,
a.btn.btn-primary:active,
a.btn.btn-primary:focus {
  background-color: var(--tf-btn-active) !important;
  border-color: var(--tf-navy) !important;
}
.btn.btn-primary *,
.btn.fb-button-primary * {
  color: inherit !important;
}

/* Links: button orange in both themes (~5.9:1 on the dark-theme background).
   Fleetbase colours links with Tailwind blue/sky classes; sidebar, buttons and map controls excluded. */
body a[class*='text-blue-']:not(.btn),
body a[class*='text-sky-']:not(.btn),
body .btn-link,
body .fb-button-link,
body .prose a,
body p a:not(.btn) {
  color: var(--tf-btn) !important;
}
body a[class*='text-blue-']:not(.btn):hover,
body a[class*='text-sky-']:not(.btn):hover,
body .btn-link:hover,
body .fb-button-link:hover,
body .prose a:hover,
body p a:not(.btn):hover {
  color: var(--tf-btn-hover) !important;
}
body[data-theme] .next-sidebar a {
  color: #e5e9f5 !important;
}

/* Focus highlights */
input:focus,
select:focus,
textarea:focus,
.form-input:focus {
  border-color: var(--tf-btn) !important;
  --tw-ring-color: rgb(224 123 58 / 0.5) !important;
}
input[type='checkbox'],
input[type='radio'] {
  color: var(--tf-btn) !important; /* Tailwind forms draws the checked fill from currentColor */
  --tw-ring-color: rgb(224 123 58 / 0.5) !important;
}
input[type='checkbox']:checked,
input[type='radio']:checked {
  background-color: var(--tf-btn) !important;
  border-color: var(--tf-btn-hover) !important;
}

/* Sidebar: navy in both themes */
body[data-theme] .next-sidebar,
body[data-theme] .next-sidebar .next-sidebar-content,
body[data-theme] .next-sidebar .next-sidebar-panel-container,
body[data-theme] .next-sidebar .next-content-panel,
body[data-theme] .next-sidebar .next-content-panel-header,
body[data-theme] .next-sidebar .next-sidebar-panel-toggle {
  background-color: var(--tf-navy) !important;
  border-color: rgb(255 255 255 / 0.08) !important;
}
body[data-theme] .next-sidebar::after {
  background-color: var(--tf-navy-light) !important;
}
body[data-theme] .next-sidebar,
body[data-theme] .next-sidebar a,
body[data-theme] .next-sidebar span,
body[data-theme] .next-sidebar div,
body[data-theme] .next-sidebar svg {
  color: #e5e9f5 !important;
}
body[data-theme] .next-sidebar .next-nav-item:hover,
body[data-theme] .next-sidebar .next-sidebar-panel-toggle:hover,
body[data-theme] .next-sidebar .next-content-panel-header:hover {
  background-color: var(--tf-navy-light) !important;
}
body[data-theme] .next-sidebar .next-nav-item.active {
  background-color: var(--tf-navy-light) !important;
  box-shadow: inset 3px 0 0 var(--tf-btn);
}
body[data-theme] .next-sidebar .next-nav-item.active,
body[data-theme] .next-sidebar .next-nav-item.active * {
  color: #ffffff !important;
}
.next-sidebar > .next-sidebar-content + .gutter:hover::before,
.next-sidebar.sidebar-is-resizing > .next-sidebar-content + .gutter::before {
  background-color: var(--tf-btn) !important;
}

/* Brand text: headings navy in light theme (navy on dark backgrounds would be unreadable) */
body[data-theme='light'] h1,
body[data-theme='light'] h2,
body[data-theme='light'] h3,
body[data-theme='light'] h4,
body[data-theme='light'] h5,
body[data-theme='light'] h6,
body[data-theme='light'] .next-view-header-title,
body[data-theme='light'] .next-content-panel-title {
  color: var(--tf-navy) !important;
}
/* ...except inside the navy sidebar */
body[data-theme='light'] .next-sidebar h1,
body[data-theme='light'] .next-sidebar h2,
body[data-theme='light'] .next-sidebar h3,
body[data-theme='light'] .next-sidebar h4,
body[data-theme='light'] .next-sidebar h5,
body[data-theme='light'] .next-sidebar h6,
body[data-theme='light'] .next-sidebar .next-content-panel-title {
  color: #e5e9f5 !important;
}

/* Boot loader */
#boot-loader .loading-message {
  color: var(--tf-navy);
}

/* Login / auth pages: navy backdrop behind the white card (both themes).
   Targets the auth layout wrapper (templates/auth.hbs) and the invite page (templates/invite/for-user.hbs)
   by their class mix + the max-w-md card column. */
.min-h-screen.justify-center.bg-gray-50:has(> .max-w-md),
.min-h-screen.flex-col.justify-center.bg-gray-50:has(> .sm\:max-w-md) {
  background-color: var(--tf-navy) !important;
}
.min-h-screen.justify-center.bg-gray-50:has(> .max-w-md) .fleetbase-attribution-link,
.min-h-screen.justify-center.bg-gray-50:has(> .max-w-md) .fleetbase-attribution-version,
.min-h-screen.justify-center.bg-gray-50:has(> .max-w-md) .fleetbase-attribution-separator,
.min-h-screen.justify-center.bg-gray-50:has(> .max-w-md) .fleetbase-attribution-legal-link {
  color: #c7cde3 !important;
}

/* Invite + onboarding page info box: navy with white text (was bg-blue-200 / text-blue-900) */
.min-h-screen.flex-col.justify-center.bg-gray-50:has(> .sm\:max-w-md) .bg-blue-200,
.onboard-route-wrapper .bg-blue-200 {
  background-color: var(--tf-navy) !important;
}
.min-h-screen.flex-col.justify-center.bg-gray-50:has(> .sm\:max-w-md) .bg-blue-200 .text-blue-900,
.min-h-screen.flex-col.justify-center.bg-gray-50:has(> .sm\:max-w-md) .bg-blue-200 svg,
.onboard-route-wrapper .bg-blue-200 .text-blue-900,
.onboard-route-wrapper .bg-blue-200 svg {
  color: #ffffff !important;
}
/* Navy box sits on the dark-theme card (gray-800): give it a subtle edge so it doesn't blend in */
body[data-theme='dark'] .onboard-route-wrapper .bg-blue-200,
body[data-theme='dark'] .min-h-screen.flex-col.justify-center.bg-gray-50:has(> .sm\:max-w-md) .bg-blue-200 {
  box-shadow: inset 0 0 0 1px rgb(224 123 58 / 0.6) !important;
}
