/* Fleet – modern theme, mobile-first, transitions */
:root {
  --fleet-primary: #0d6efd;
  --fleet-primary-dark: #0a58ca;
  --fleet-bg: #f8fafc;
  --fleet-card-shadow: 0 1px 3px rgba(0,0,0,.08);
  --fleet-card-shadow-hover: 0 4px 12px rgba(0,0,0,.12);
  --fleet-radius: 0.5rem;
  --fleet-radius-lg: 0.75rem;
  --fleet-transition: 0.2s ease;
  --fleet-navbar-bg: #1e293b;
  --fleet-touch-min: 44px;
}

* {
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--fleet-bg);
  font-size: 1rem;
  line-height: 1.5;
  padding-bottom: 2rem;
}

/* Navbar – mobile-friendly, modern */
.navbar {
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  transition: box-shadow var(--fleet-transition);
}
.navbar-brand {
  font-weight: 600;
  letter-spacing: 0.02em;
}
.navbar-nav-pills {
  align-items: center;
}
.navbar-nav-pills .nav-link {
  position: relative;
  padding: 0.5rem 0.75rem !important;
  margin: 0 0.25rem;
  border-radius: 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: rgba(241, 245, 249, 0.8);
  transition:
    color var(--fleet-transition),
    background-color var(--fleet-transition),
    transform 0.12s ease;
}
.navbar-nav-pills .nav-link::after {
  content: '';
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.15rem;
  height: 2px;
  border-radius: 999px;
  background-color: transparent;
  transform: scaleX(0.4);
  transform-origin: center;
  transition:
    background-color var(--fleet-transition),
    transform var(--fleet-transition);
}
.navbar-nav-pills .nav-link:hover,
.navbar-nav-pills .nav-link:focus {
  color: #ffffff;
  text-decoration: none;
}
.navbar-nav-pills .nav-link:hover::after,
.navbar-nav-pills .nav-link:focus::after {
  background-color: rgba(148, 163, 184, 0.7);
  transform: scaleX(1);
}
.navbar-nav-pills .nav-link.active {
  color: #ffffff;
}
.navbar-nav-pills .nav-link.active::after {
  background-color: #ffffff;
  transform: scaleX(1);
}
.navbar .btn {
  min-height: var(--fleet-touch-min);
  padding: 0.5rem 0.75rem;
}
.navbar-user-toggle {
  border-radius: 999px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Nav link boxes – icon + text in a box */
.navbar-nav-boxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.navbar-nav-boxes .nav-link-box {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem !important;
  margin: 0 !important;
  border: 1px solid rgba(241, 245, 249, 0.2);
  border-radius: var(--fleet-radius);
  background: rgba(255, 255, 255, 0.06);
  min-height: var(--fleet-touch-min);
}
.navbar-nav-boxes .nav-link-box::after {
  display: none;
}
.navbar-nav-boxes .nav-link-box:hover,
.navbar-nav-boxes .nav-link-box:focus {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(241, 245, 249, 0.35);
}
.navbar-nav-boxes .nav-link-box.active {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(241, 245, 249, 0.5);
}
.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-icon svg {
  width: 1.125rem;
  height: 1.125rem;
}
.nav-text {
  white-space: nowrap;
}
.navbar-nav-boxes .nav-link-box.dropdown-toggle::after {
  margin-left: 0.25rem;
}
.nav-icon-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-icon-sm svg {
  width: 1rem;
  height: 1rem;
}
.navbar .dropdown-menu-dark {
  background: var(--fleet-navbar-bg, #1e293b);
  border: 1px solid rgba(241, 245, 249, 0.15);
  border-radius: var(--fleet-radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  padding: 0.35rem;
}
.navbar .dropdown-menu-dark .dropdown-item {
  border-radius: 0.35rem;
  padding: 0.5rem 0.75rem;
}
.navbar .dropdown-menu-dark .dropdown-item:hover,
.navbar .dropdown-menu-dark .dropdown-item:focus {
  background: rgba(255, 255, 255, 0.1);
}
.navbar .dropdown-menu-dark .dropdown-item.active {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}
@media (max-width: 991.98px) {
  .navbar-nav-boxes {
    margin-top: 0.5rem;
  }
  .navbar-nav-boxes .nav-link-box {
    width: 100%;
    justify-content: flex-start;
  }
  .navbar-nav-boxes .dropdown-menu {
    border: none;
    box-shadow: none;
    padding-left: 0.5rem;
    margin-top: 0.25rem;
  }
}

/* Cards */
.card {
  border: none;
  border-radius: var(--fleet-radius-lg);
  box-shadow: var(--fleet-card-shadow);
  transition: box-shadow var(--fleet-transition), transform var(--fleet-transition);
}
.card:hover {
  box-shadow: var(--fleet-card-shadow-hover);
}
.card-body {
  padding: 1.25rem;
}

/* Buttons – larger touch targets on mobile */
.btn {
  border-radius: var(--fleet-radius);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  min-height: var(--fleet-touch-min);
  padding: 0.5rem 1rem;
}
.btn:active {
  transform: scale(0.98);
}
.btn-primary {
  box-shadow: 0 2px 4px rgba(13, 110, 253, .3);
}
.btn-primary:hover {
  box-shadow: 0 4px 8px rgba(13, 110, 253, .35);
}

/* Tables – responsive, mobile cards */
.table-responsive {
  border-radius: var(--fleet-radius-lg);
  overflow: hidden;
  box-shadow: var(--fleet-card-shadow);
}
.table {
  margin-bottom: 0;
}
.table thead th {
  border-bottom-width: 2px;
  font-weight: 600;
  white-space: nowrap;
}
.table tbody tr {
  transition: background-color var(--fleet-transition);
}

/* Mobile: horizontal scroll for tables, ensure touch targets */
@media (max-width: 767.98px) {
  .table-responsive {
    -webkit-overflow-scrolling: touch;
    margin-left: -0.75rem;
    margin-right: -0.75rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  .table td, .table th {
    padding: 0.75rem 0.5rem;
    white-space: nowrap;
  }
  .table td .btn, .table td .form-control {
    min-height: 44px;
  }
  /* Card-style rows for tables with .fleet-cards */
  .table.fleet-cards thead { display: none; }
  .table.fleet-cards tbody tr {
    display: block;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #fff;
    border-radius: var(--fleet-radius-lg);
    box-shadow: var(--fleet-card-shadow);
  }
  .table.fleet-cards tbody td {
    display: block;
    padding: 0.5rem 0;
    border: none;
    border-bottom: 1px solid #eee;
    white-space: normal;
  }
  .table.fleet-cards tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #64748b;
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
  }
  .table.fleet-cards tbody td:last-child {
    border-bottom: none;
    padding-top: 0.75rem;
  }
}

/* Forms – mobile-friendly inputs */
.form-control, .form-select {
  border-radius: var(--fleet-radius);
  min-height: var(--fleet-touch-min);
  transition: border-color var(--fleet-transition), box-shadow var(--fleet-transition);
}
.form-control:focus, .form-select:focus {
  box-shadow: 0 0 0 3px rgba(13, 110, 253, .2);
}
.form-label {
  font-weight: 500;
}

/* Alerts */
.alert {
  border: none;
  border-radius: var(--fleet-radius);
  animation: fleetFadeIn 0.3s ease;
}
@keyframes fleetFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Main content */
main.container {
  max-width: 1200px;
  animation: fleetFadeIn 0.25s ease;
}
h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
@media (max-width: 575.98px) {
  h1 { font-size: 1.5rem; }
}

/* Inline forms in tables – stack on mobile */
.d-flex.flex-wrap.gap-2 {
  gap: 0.5rem !important;
}
.d-flex.flex-wrap.gap-2 .form-control,
.d-flex.flex-wrap.gap-2 input[type="number"] {
  min-width: 0;
}
@media (max-width: 767.98px) {
  .d-flex.flex-wrap.gap-2 form {
    width: 100%;
  }
  .d-flex.flex-wrap.gap-2 input[type="datetime-local"],
  .d-flex.flex-wrap.gap-2 input[type="number"] {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* Badges */
.badge {
  font-weight: 500;
  padding: 0.35em 0.65em;
  border-radius: 0.375rem;
}

/* Icon-only buttons in tables */
.btn-icon {
  padding: 0.3rem 0.45rem;
  min-width: 2.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-icon .icon-16 {
  width: 1rem;
  height: 1rem;
}

/* Footer */
footer {
  margin-top: 2rem;
  padding-top: 1rem;
}
