/*
 * CENTRAL FLEET SYSTEMS — PROFESSIONAL SITE FINISH
 * 2026-10-20  /  site-wide presentation only
 * Consistent headings, surfaces, action controls and tables across the
 * customer workspace, workshop, dispatch, compliance and partner portals.
 * No workflow, access-control, business-data or routing changes.
 * Intentionally does not restyle the authenticated login flow.
 */
:root {
  --cfs-finish-surface: #0d1c2c;
  --cfs-finish-surface-soft: #102338;
  --cfs-finish-stroke: rgba(145,184,213,.16);
  --cfs-finish-stroke-focus: rgba(71,208,224,.53);
  --cfs-finish-copy: #edf5fb;
  --cfs-finish-muted: #a2b6ca;
  --cfs-finish-tint: #65d6e0;
  --cfs-finish-radius: 14px;
  --cfs-finish-shadow: 0 9px 28px rgba(0,0,0,.13);
}

/* Clearer and more consistent typography without changing branding. */
body:not(.cfs-platform-admin-mode) :is(
  .ff-page-heading h1,
  .ff2-page-heading h1,
  .ff-wp-head h1,
  .ff-dispatch-head h1,
  .ff-audit-head h1,
  .ff-report-head h1,
  .ff-calendar-page-head h1
) {
  font-size: clamp(24px, 2.35vw, 32px) !important;
  line-height: 1.16 !important;
  letter-spacing: -.035em !important;
  font-weight: 780 !important;
  margin: 0 0 7px !important;
  overflow-wrap: break-word;
}

:is(
  .ff-page-heading,
  .ff2-page-heading,
  .ff-wp-head,
  .ff-dispatch-head,
  .ff-audit-head,
  .ff-report-head,
  .ff-calendar-page-head
) {
  gap: 14px !important;
  align-items: center;
  min-width: 0;
  padding-bottom: 16px !important;
  margin-bottom: 20px !important;
  border-bottom: 1px solid var(--cfs-finish-stroke);
}

:is(
  .ff-page-heading,
  .ff2-page-heading,
  .ff-wp-head,
  .ff-dispatch-head,
  .ff-audit-head,
  .ff-report-head,
  .ff-calendar-page-head
) p {
  color: var(--cfs-finish-muted) !important;
  line-height: 1.55 !important;
  max-width: 76ch;
}

:is(.ff-page-eyebrow,.ff2-page-eyebrow) {
  color: var(--cfs-finish-tint) !important;
  letter-spacing: .11em !important;
  font-size: 11px !important;
}

/* Consistent horizontal breathing room, without overriding router geometry. */
@media (min-width: 901px) {
  body.ff-show-real-page #admin:not(.hidden),
  body.ff-clean-legacy #admin:not(.hidden),
  body.ff-unified-legacy-view #admin:not(.hidden) {
    padding-top: 26px !important;
    padding-right: clamp(18px,2.1vw,34px) !important;
    padding-bottom: 70px !important;
    padding-left: clamp(18px,2.1vw,34px) !important;
  }

  body.cfs-nav-collapsible.ff-show-real-page #top,
  body.cfs-nav-collapsible.ff-clean-legacy #top,
  body.cfs-nav-collapsible.ff-unified-legacy-view #top {
    padding-left: 96px !important;
  }
}

#admin :is(.admin-tab-panel,.ff-shell-hub),
#admin :is(.ff-hub-grid,.ff2-action-grid,.ff-settings-grid) {
  min-width: 0 !important;
}

#admin :is(.ff-hub-grid,.ff2-action-grid,.ff-settings-grid) > * {
  min-width: 0;
}

/* Product surfaces: unified border, background, and shadow. */
#admin :is(
  .ff-hub-card,.ff2-action-card,.ff2-integration-card,
  .ff-settings-card,.ff-settings-page-card,
  .ff-report-card,.ff-report-summary,.ff-report-table-scroll
),
#fixFleetWorkshopPlannerContent :is(.ff-wp-stat,.ff-wp-day,.ff-wp-lane,.ff-wp-repair,.ff-wp-booking),
#fixFleetDispatchContent :is(.ff-dispatch-stat,.ff-dispatch-panel,.ff-dispatch-allocation,.ff-dispatch-driver-card,.ff-dispatch-vehicle-card,.ff-dispatch-day),
#fixFleetAuditContent :is(.ff-audit-stat,.ff-audit-panel,.ff-audit-card),
:is(#garage,#recovery,#tech,#driver,#check,#job,#detail,#breakdown) :is(.card,.item,.notice,.garage-job-card,.tech-job-card) {
  border: 1px solid var(--cfs-finish-stroke) !important;
  border-radius: var(--cfs-finish-radius) !important;
  box-shadow: var(--cfs-finish-shadow);
}

/* Keep interactive tiles restrained, rather than glowing or jumping. */
#admin :is(.ff-hub-card,.ff2-action-card,.ff-settings-card,.ff-report-card) {
  background: linear-gradient(145deg,rgba(15,34,52,.97),rgba(10,25,40,.98)) !important;
  transition: border-color .18s ease,background .18s ease,box-shadow .18s ease !important;
  text-align: left;
}

#admin :is(.ff-hub-card,.ff2-action-card,.ff-settings-card,.ff-report-card):hover {
  transform: none !important;
  border-color: rgba(85,200,217,.40) !important;
  box-shadow: 0 12px 29px rgba(0,0,0,.18);
  background: linear-gradient(145deg,rgba(19,45,67,.98),rgba(11,30,47,.98)) !important;
}

#admin :is(.ff-hub-card,.ff2-action-card,.ff-settings-card,.ff-report-card) :is(h3,strong) {
  color: var(--cfs-finish-copy);
  line-height: 1.3;
}

#admin :is(.ff-hub-card,.ff2-action-card,.ff-settings-card,.ff-report-card) p {
  color: var(--cfs-finish-muted);
  line-height: 1.5;
}

#admin :is(.ff-hub-icon,.ff2-action-icon,.ff-settings-card-icon,.ff-report-icon) {
  border-radius: 12px !important;
}

/* Dashboard: reduce over-decoration and improve information hierarchy. */
#ffDesktopDashboardHost #ffGoalDashboard {
  color: var(--cfs-finish-copy);
}

#ffDesktopDashboardHost .ff-goal-topbar {
  gap: 16px !important;
  min-width: 0;
  border-bottom-color: var(--cfs-finish-stroke) !important;
}

#ffDesktopDashboardHost .ff-goal-greeting h1 {
  font-size: clamp(27px,2.8vw,38px) !important;
  letter-spacing: -.045em !important;
  line-height: 1.15 !important;
}

#ffDesktopDashboardHost .ff-goal-greeting p {
  color: var(--cfs-finish-muted) !important;
  line-height: 1.4 !important;
}

#ffDesktopDashboardHost :is(.ff-goal-kpi,.ff-goal-panel) {
  border-radius: 15px !important;
  border-color: var(--cfs-finish-stroke) !important;
  box-shadow: var(--cfs-finish-shadow) !important;
}

#ffDesktopDashboardHost .ff-goal-kpi:hover {
  transform: none !important;
  border-color: rgba(85,200,217,.30) !important;
}

#ffDesktopDashboardHost .ff-goal-panel > header {
  min-height: 47px;
  border-bottom: 1px solid rgba(145,184,213,.13) !important;
}

#ffDesktopDashboardHost .ff-goal-panel h2 {
  line-height: 1.3 !important;
  letter-spacing: -.015em !important;
}

/* Fleet, staff, garage, recovery, and fitter pages. */
:is(#vehicleForm,#users,#garage,#recovery,#tech,#job,#check):not(.hidden) {
  color: var(--cfs-finish-copy);
}

:is(#vehicleForm,#users,#garage,#recovery,#tech,#job,#check) > h2,
#driver > h1 {
  font-weight: 780 !important;
  font-size: clamp(23px,2.15vw,30px) !important;
  letter-spacing: -.03em !important;
  line-height: 1.2 !important;
  margin-bottom: 11px !important;
}

:is(#vehicleForm,#users,#garage,#recovery,#tech,#driver,#check) > p,
:is(#garage,#recovery,#tech) .muted {
  color: var(--cfs-finish-muted) !important;
}

:is(#garage,#recovery,#tech,#job,#detail,#breakdown) :is(.item,.garage-job-card,.tech-job-card,.notice) {
  background: rgba(14,32,49,.92) !important;
}

/* Consistent buttons, without touching dashboard icon buttons and map controls. */
:is(#admin,#garage,#recovery,#tech,#driver,#check,#vehicleForm,#users,#job,#detail,#breakdown)
.button,
:is(#fixFleetWorkshopPlannerContent,#fixFleetDispatchContent,#fixFleetAuditContent)
:is(.ff-wp-toggle button,.ff-dispatch-toggle button) {
  border-radius: 10px !important;
  min-height: 42px;
  font-weight: 720 !important;
  font-size: 13px;
  letter-spacing: .01em;
  line-height: 1.25;
  transition: background .15s ease,border-color .15s ease,box-shadow .15s ease !important;
}

:is(#admin,#garage,#recovery,#tech,#driver,#check,#vehicleForm,#users,#job,#detail,#breakdown)
.button:hover:not(:disabled) {
  transform: none !important;
  filter: brightness(1.07);
}

:is(#admin,#garage,#recovery,#tech,#driver,#check,#vehicleForm,#users,#job,#detail,#breakdown)
:is(.button.primary,.button.success) {
  box-shadow: 0 5px 18px rgba(29,182,183,.12) !important;
}

:is(#admin,#garage,#recovery,#tech,#driver,#check,#vehicleForm,#users,#job,#detail,#breakdown)
:is(.button.secondary,.button.danger) {
  box-shadow: none !important;
}

/* Controls: consistent labels, clearer focus and available full width. */
:is(#admin,#garage,#recovery,#tech,#driver,#check,#vehicleForm,#users,#job,#detail,#breakdown)
:is(.label,.ff-wp-field label,.ff-dispatch-field label) {
  color: #c5d4e3 !important;
  font-size: 12px !important;
  font-weight: 720 !important;
  line-height: 1.45;
}

:is(#admin,#garage,#recovery,#tech,#driver,#check,#vehicleForm,#users,#job,#detail,#breakdown)
:is(input:not([type="checkbox"]):not([type="radio"]),textarea,select) {
  max-width: 100%;
  font-size: 14px;
  line-height: 1.35;
}

:is(#admin,#garage,#recovery,#tech,#driver,#check,#vehicleForm,#users,#job,#detail,#breakdown)
:is(input:not([type="checkbox"]):not([type="radio"]),textarea,select):focus-visible {
  outline-color: rgba(77,222,232,.80) !important;
  box-shadow: 0 0 0 3px rgba(48,190,206,.12) !important;
}

:is(#vehicleForm,#users,#check) :is(.actions,form .row) {
  margin-top: 14px;
}

:is(#vehicleForm,#users,#check) form {
  min-width: 0;
}

/* Workshop planner and live dispatch: structured and legible. */
:is(#fixFleetWorkshopPlannerContent,#fixFleetDispatchContent,#fixFleetAuditContent) {
  color: var(--cfs-finish-copy);
  min-width: 0;
}

#fixFleetWorkshopPlannerContent :is(.ff-wp-stat,.ff-wp-day,.ff-wp-lane),
#fixFleetDispatchContent :is(.ff-dispatch-stat,.ff-dispatch-day,.ff-dispatch-panel) {
  background-color: rgba(11,27,43,.88) !important;
}

:is(.ff-wp-stat-label,.ff-dispatch-stat-label,.ff-audit-stat-label),
:is(.ff-wp-meta,.ff-dispatch-meta,.ff-audit-meta) {
  color: var(--cfs-finish-muted) !important;
  line-height: 1.4 !important;
}

:is(.ff-wp-reg,.ff-dispatch-reg,.ff-wp-stat-value,.ff-dispatch-stat-value) {
  font-variant-numeric: tabular-nums;
}

:is(.ff-wp-day-head,.ff-dispatch-day-head,.ff-dispatch-panel-head) {
  border-bottom: 1px solid rgba(145,184,213,.11) !important;
}

/* Tables, fleet lists and reporting: quiet rows and consistent spacing. */
:is(#admin,#garage,#recovery,#tech,#users,#detail,#platformAdmin)
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

:is(#admin,#garage,#recovery,#tech,#users,#detail,#platformAdmin)
table th {
  padding: 12px 14px !important;
  color: #b4c7d8 !important;
  background: rgba(15,33,49,.90);
  text-align: left;
  font-size: 11px !important;
  font-weight: 760 !important;
  letter-spacing: .055em !important;
  white-space: nowrap;
}

:is(#admin,#garage,#recovery,#tech,#users,#detail,#platformAdmin)
table td {
  padding: 12px 14px !important;
  color: #d9e6f1;
  font-size: 13px;
  line-height: 1.5;
  vertical-align: middle;
  border-bottom: 1px solid rgba(145,184,213,.095) !important;
}

:is(#admin,#garage,#recovery,#tech,#users,#detail,#platformAdmin)
table tbody tr:hover {
  background: rgba(59,142,182,.055) !important;
}

:is(#fixFleetReportsContent,#fixFleetAuditContent)
:is(.ff-report-table-scroll,.ff-audit-table-wrap) {
  overflow-x: auto;
  border: 1px solid var(--cfs-finish-stroke) !important;
  border-radius: var(--cfs-finish-radius) !important;
}

:is(#fixFleetReportsContent,#fixFleetAuditContent)
:is(.ff-report-table-scroll,.ff-audit-table-wrap) table {
  width: 100%;
}

/* Empty/error states should look deliberately designed rather than broken. */
:is(
  .ff-wp-empty,.ff-dispatch-empty,.ff-goal-search-empty,
  .ff-calendar-empty-day,.ff-report-empty,.ff-audit-empty
) {
  color: var(--cfs-finish-muted) !important;
  line-height: 1.5 !important;
}

:is(#admin,#garage,#recovery,#tech,#check,#driver)
:is(.notice,.error,.success) {
  border-radius: 12px !important;
  line-height: 1.5;
}

/* Settings: navigable rows and scannable grouping. */
#adminSettingsHub :is(.ff-settings-preview,.ff-settings-page-card) {
  border: 1px solid var(--cfs-finish-stroke) !important;
  border-radius: 15px !important;
  overflow: hidden;
}

#adminSettingsHub .ff-setting-row {
  gap: 15px;
  padding: 15px 17px !important;
  border-bottom: 1px solid rgba(145,184,213,.10) !important;
  transition: background .14s ease;
}

#adminSettingsHub .ff-setting-row:last-child {
  border-bottom: none !important;
}

#adminSettingsHub .ff-setting-row:hover {
  background: rgba(67,163,193,.065) !important;
}

#adminSettingsHub .ff-setting-row strong {
  font-size: 14px;
}

#adminSettingsHub .ff-setting-row .muted {
  line-height: 1.45;
}

/* Deliberate modal spacing, restricted to known functional modals. */
:is(.ff-wp-modal,.ff-dispatch-modal,.ff-dc-modal-card) {
  border: 1px solid rgba(145,184,213,.24) !important;
  border-radius: 17px !important;
  background: #0c1b2b !important;
  box-shadow: 0 28px 80px rgba(0,0,0,.42) !important;
  max-width: min(96vw,720px);
  max-height: min(90vh,900px);
  overflow-y: auto;
}

:is(.ff-wp-modal,.ff-dispatch-modal,.ff-dc-modal-card) h2 {
  letter-spacing: -.025em;
  line-height: 1.2;
}

:is(.ff-wp-modal-backdrop,.ff-dispatch-modal-backdrop) {
  backdrop-filter: blur(5px);
}

/* Fleet-page links and keyboard cues. */
#admin a:not(.button),
:is(#garage,#recovery,#tech,#detail) a:not(.button) {
  text-underline-offset: 3px;
}

:is(#admin,#garage,#recovery,#tech,#driver,#check,#vehicleForm,#users,#job,#detail)
:is(button,a,input,select,textarea):focus-visible {
  outline: 2px solid #55cfdd !important;
  outline-offset: 2px;
}

/* All screens stay usable at smaller viewport widths. */
@media (max-width: 1200px) {
  #ffDesktopDashboardHost .ff-goal-topbar {
    flex-wrap: wrap !important;
    align-items: flex-start !important;
  }
  #ffDesktopDashboardHost .ff-goal-top-tools {
    min-width: 0;
  }
}

@media (max-width: 900px) {
  :is(
    .ff-page-heading,.ff2-page-heading,.ff-wp-head,.ff-dispatch-head,
    .ff-audit-head,.ff-report-head,.ff-calendar-page-head
  ) {
    flex-wrap: wrap;
    padding-bottom: 12px !important;
    margin-bottom: 16px !important;
  }

  :is(#admin,#garage,#recovery,#tech,#driver,#check,#vehicleForm,#users,#job,#detail,#breakdown) {
    min-width: 0;
  }

  #admin :is(.ff-hub-grid,.ff2-action-grid,.ff-settings-grid) {
    gap: 12px !important;
  }
}

@media (max-width: 600px) {
  :is(
    .ff-page-heading h1,.ff2-page-heading h1,.ff-wp-head h1,
    .ff-dispatch-head h1,.ff-audit-head h1,.ff-report-head h1
  ) {
    font-size: 23px !important;
  }
  #admin :is(.ff-hub-card,.ff2-action-card,.ff-settings-card,.ff-report-card) {
    padding: 15px !important;
  }
  #adminSettingsHub .ff-setting-row {
    padding: 13px 12px !important;
  }
  :is(#admin,#garage,#recovery,#tech,#users,#detail,#platformAdmin) table :is(th,td) {
    padding: 10px !important;
  }
  :is(.ff-wp-modal,.ff-dispatch-modal,.ff-dc-modal-card) {
    max-width: calc(100vw - 22px);
    max-height: 92vh;
  }
}

/* Follow system preference; do not force motion on operational pages. */
@media (prefers-reduced-motion: reduce) {
  #admin :is(.ff-hub-card,.ff2-action-card,.ff-settings-card,.ff-report-card),
  #adminSettingsHub .ff-setting-row {
    transition: none !important;
  }
}

/* Platform administration: same visual language, separate access/layout. */
body.cfs-platform-admin-mode #platformAdmin #cfsAdminControlBar,
body.cfs-platform-admin-mode #platformAdmin .card {
  border-color: var(--cfs-finish-stroke) !important;
  box-shadow: var(--cfs-finish-shadow) !important;
}

body.cfs-platform-admin-mode #platformAdmin #cfsAdminControlBar {
  border-radius: 15px !important;
}

body.cfs-platform-admin-mode #platformAdmin .cfsAdminLogo {
  background: linear-gradient(135deg,#1386bb,#1dbbb5) !important;
  box-shadow: 0 7px 21px rgba(29,187,181,.14) !important;
}

body.cfs-platform-admin-mode #platformAdmin :is(.cfsAdminInfo,.cfsHealthStat) {
  border-color: var(--cfs-finish-stroke) !important;
  border-radius: 12px !important;
}

body.cfs-platform-admin-mode #platformAdmin :is(.cfsAdminInfoLabel,.cfsExecSub) {
  color: var(--cfs-finish-muted) !important;
  line-height: 1.35;
}

body.cfs-platform-admin-mode #platformAdmin :is(.cfsExecTitle,.cfsAdminBrandTitle) {
  letter-spacing: -.01em !important;
  font-weight: 780 !important;
}

body.cfs-platform-admin-mode #platformAdmin :is(.card,.cfsExecPanel) {
  min-width: 0;
}

body.cfs-platform-admin-mode #platformAdmin .button {
  min-height: 42px;
  border-radius: 10px !important;
  font-weight: 730 !important;
}

@media (max-width: 640px) {
  body.cfs-platform-admin-mode #platformAdmin #cfsAdminControlBar {
    padding: 13px !important;
    gap: 12px;
  }
  body.cfs-platform-admin-mode #platformAdmin #cfsAdminInfoStrip {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
}
