/* PO Receiving Universal Styles - Bootstrap-based (Fleetara-style) */

/* Global spinner animation */
.spinner {
  color: gray;
  font-style: italic;
  font-size: 1.2em;
  display: inline-block;
  width: 2em;
  height: 2em;
  border: 4px solid transparent;
  border-top: 4px solid gray;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Navbar and header styling */
header .navbar {
  z-index: 1050;
}

body {
  margin: 0;
  padding-top: 0;
}

/* Solid background for expanded mobile menu */
@media (max-width: 991.98px) {
  .navbar-collapse {
    background-color: #212529;
  }
}

/* Make navbar brand image smaller on very small screens */
@media (max-width: 575.98px) {
  header .navbar .navbar-brand img {
    width: 56px;
    height: auto;
  }
}

/* Use dynamic navbar height to offset the main content */
.offset-by-nav {
  padding-top: calc(var(--navH, 70px) + 12px);
}

@media (max-width: 575.98px) {
  .offset-by-nav {
    padding-top: calc(var(--navH, 70px) + 16px);
  }
}

/* Main container min-height accounting for navbar */
main.container {
  min-height: calc(100vh - var(--navH, 70px)) !important;
}

/* Card styling */
.card {
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.section-header {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #212529;
}

/* Form inputs styling */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="date"],
input[type="file"],
select,
textarea {
  border-radius: 0.375rem;
  border: 1px solid #ced4da;
  padding: 0.5rem 0.75rem;
  width: 100%;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="date"]:focus,
input[type="file"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Remove number input spinners */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

button:not(.btn):not(.navbar-toggler) {
  border-radius: 0.375rem;
  padding: 0.5rem 1rem;
  font-weight: 600;
  transition: all 0.2s;
  border: 1px solid transparent;
  cursor: pointer;
}

button.btn-primary,
button.primary {
  background-color: #0d6efd;
  color: white;
  border-color: #0d6efd;
}

button.btn-primary:hover,
button.primary:hover {
  background-color: #0b5ed7;
  border-color: #0a58ca;
}

button.btn-success {
  background-color: #198754;
  color: white;
  border-color: #198754;
}

button.btn-success:hover {
  background-color: #157347;
  border-color: #146c43;
}

button.btn-secondary,
button.secondary {
  background-color: #6c757d;
  color: white;
  border-color: #6c757d;
}

button.btn-secondary:hover,
button.secondary:hover {
  background-color: #5c636a;
  border-color: #565e64;
}

button.btn-danger,
button.danger {
  background-color: #dc3545;
  color: white;
  border-color: #dc3545;
}

button.btn-danger:hover,
button.danger:hover {
  background-color: #bb2d3b;
  border-color: #b02a37;
}

button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Table styling */
table {
  width: 100%;
  font-size: 0.875rem;
}

th {
  font-weight: 600;
  color: #212529;
  background-color: #f8f9fa;
  padding: 0.75rem;
  border-bottom: 2px solid #dee2e6;
}

td {
  padding: 0.75rem;
  border-bottom: 1px solid #dee2e6;
}

tbody tr:hover {
  background-color: #f8f9fa;
}

.row-alt:nth-child(even) {
  background-color: #f8f9fa;
}

/* Sticky footer for forms */
/* Tab styling */
.nav-tabs .nav-link {
  border: 1px solid transparent;
  border-radius: 0.375rem 0.375rem 0 0;
  color: #495057;
  font-weight: 600;
}

.nav-tabs .nav-link:hover {
  border-color: #e9ecef #e9ecef #dee2e6;
  color: #212529;
}

.nav-tabs .nav-link.active {
  color: #495057;
  background-color: #fff;
  border-color: #dee2e6 #dee2e6 #fff;
}

/* Search results styling */
.search-result-item {
  display: block;
  text-align: left;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  padding: 1rem;
  margin-bottom: 0.5rem;
  transition: all 0.2s;
  text-decoration: none;
  color: inherit;
}

.search-result-item:hover {
  background-color: #f8f9fa;
  border-color: #0d6efd;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-result-title {
  font-weight: 600;
  color: #212529;
  margin-bottom: 0.25rem;
}

.search-result-meta {
  font-size: 0.875rem;
  color: #6c757d;
}

/* Search suggestions */
.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  margin-top: 0.25rem;
  max-height: 280px;
  overflow-y: auto;
  z-index: 1000;
}

.search-suggestion {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 0.5rem 0.75rem;
}

.search-suggestion:hover,
.search-suggestion:focus {
  background-color: #f8f9fa;
}

.search-suggestion-title {
  font-weight: 600;
  color: #212529;
  margin-bottom: 0.125rem;
}

.search-suggestion-meta {
  font-size: 0.8125rem;
  color: #6c757d;
}

/* Alert styling */
.alert {
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 0.375rem;
  border: 1px solid transparent;
}

.alert-success {
  color: #0f5132;
  background-color: #d1e7dd;
  border-color: #badbcc;
}

.alert-danger {
  color: #842029;
  background-color: #f8d7da;
  border-color: #f5c2c7;
}

.alert-info {
  color: #055160;
  background-color: #cff4fc;
  border-color: #b6effb;
}

.alert-warning {
  color: #664d03;
  background-color: #fff3cd;
  border-color: #ffecb5;
}

/* Badge styling */
.badge {
  display: inline-block;
  padding: 0.35em 0.65em;
  font-size: 0.75em;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.375rem;
}

.badge-primary {
  background-color: #0d6efd;
}

.badge-success {
  background-color: #198754;
}

.badge-danger {
  background-color: #dc3545;
}

.badge-warning {
  background-color: #ffc107;
  color: #000;
}

.badge-info {
  background-color: #0dcaf0;
  color: #000;
}

/* Utility classes */
.text-muted {
  color: #6c757d !important;
}

.text-primary {
  color: #0d6efd !important;
}

.text-success {
  color: #198754 !important;
}

.text-danger {
  color: #dc3545 !important;
}

.text-warning {
  color: #ffc107 !important;
}

.mb-0 {
  margin-bottom: 0 !important;
}

.mb-1 {
  margin-bottom: 0.25rem !important;
}

.mb-2 {
  margin-bottom: 0.5rem !important;
}

.mb-3 {
  margin-bottom: 1rem !important;
}

.mb-4 {
  margin-bottom: 1.5rem !important;
}

.mb-5 {
  margin-bottom: 3rem !important;
}

.mt-0 {
  margin-top: 0 !important;
}

.mt-1 {
  margin-top: 0.25rem !important;
}

.mt-2 {
  margin-top: 0.5rem !important;
}

.mt-3 {
  margin-top: 1rem !important;
}

.mt-4 {
  margin-top: 1.5rem !important;
}

.mt-5 {
  margin-top: 3rem !important;
}

.p-0 {
  padding: 0 !important;
}

.p-1 {
  padding: 0.25rem !important;
}

.p-2 {
  padding: 0.5rem !important;
}

.p-3 {
  padding: 1rem !important;
}

.p-4 {
  padding: 1.5rem !important;
}

.p-5 {
  padding: 3rem !important;
}

.w-100 {
  width: 100% !important;
}

.h-100 {
  height: 100% !important;
}

.d-none {
  display: none !important;
}

.d-block {
  display: block !important;
}

.d-flex {
  display: flex !important;
}

.d-grid {
  display: grid !important;
}

.flex-column {
  flex-direction: column !important;
}

.flex-row {
  flex-direction: row !important;
}

.align-items-center {
  align-items: center !important;
}

.justify-content-between {
  justify-content: space-between !important;
}

.justify-content-center {
  justify-content: center !important;
}

.gap-2 {
  gap: 0.5rem !important;
}

.gap-3 {
  gap: 1rem !important;
}

.gap-4 {
  gap: 1.5rem !important;
}

/* Grid utilities */
.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
}

.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.grid-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.grid-cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

@media (min-width: 768px) {
  .md-grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .md-grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .md-grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

/* Loading state */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Hidden utility */
.hidden {
  display: none !important;
}

/* Responsive utilities */
@media (max-width: 768px) {
  .card {
    padding: 1rem;
  }

  table {
    font-size: 0.8rem;
  }

  th,
  td {
    padding: 0.5rem;
  }
}