/* Color Palette */
:root {
  --primary-blue: #0056b3;
  --light-blue: #007bff;
  --sky-blue: #0099cc;
  --ocean-blue: #004d99;
  --dark-blue: #003d7a;
  --accent-teal: #17a2b8;
  --light-gray: #f8f9fa;
  --white: #ffffff;
  --border-gray: #dee2e6;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #e8f4f8 0%, #f0f8fb 100%);
  color: #2c3e50;
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

/* Navigation Bar */
nav {
  background: linear-gradient(135deg, #004d99 0%, #0056b3 100%);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

nav a {
  color: var(--white);
  text-decoration: none;
  font-weight: 500;
}

nav a:hover {
  color: #b3d9ff;
  transition: color 0.3s ease;
}

/* Headings */
h1 {
  color: var(--ocean-blue);
  font-size: 2.5rem;
  margin-bottom: 20px;
  font-weight: 700;
}

h2 {
  color: #003d7a;
  font-size: 1.8rem;
  margin-bottom: 15px;
  font-weight: 600;
}

h3 {
  color: var(--sky-blue);
  font-size: 1.3rem;
  margin-bottom: 10px;
  font-weight: 600;
}

/* Forms */
form {
  background-color: var(--white);
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 86, 179, 0.1);
  border-top: 4px solid var(--light-blue);
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--ocean-blue);
  font-weight: 600;
  font-size: 0.95rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 12px;
  margin-bottom: 10px;
  border: 2px solid var(--border-gray);
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--light-blue);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
  margin-right: 10px;
  margin-bottom: 10px;
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--light-blue) 0%,
    var(--primary-blue) 100%
  );
  color: var(--white);
}

.btn-primary:hover {
  background: linear-gradient(
    135deg,
    var(--primary-blue) 0%,
    var(--dark-blue) 100%
  );
  box-shadow: 0 4px 12px rgba(0, 86, 179, 0.3);
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: #6c757d;
  color: var(--white);
}

.btn-secondary:hover {
  background-color: #5a6268;
  box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.9rem;
}

.btn-outline-primary {
  background-color: transparent;
  color: var(--light-blue);
  border: 2px solid var(--light-blue);
}

.btn-outline-primary:hover {
  background-color: var(--light-blue);
  color: var(--white);
}

.btn-outline-warning {
  background-color: transparent;
  color: #ff9800;
  border: 2px solid #ff9800;
}

.btn-outline-warning:hover {
  background-color: #ff9800;
  color: var(--white);
}

.btn-outline-danger {
  background-color: transparent;
  color: #dc3545;
  border: 2px solid #dc3545;
}

.btn-outline-danger:hover {
  background-color: #dc3545;
  color: var(--white);
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 86, 179, 0.08);
  margin-bottom: 20px;
}

.table thead {
  background: linear-gradient(135deg, #004d99 0%, #0056b3 100%);
  color: var(--white);
}

.table th {
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--border-gray);
}

.table th a {
  color: var(--white);
  text-decoration: none;
}

.table th a:hover {
  color: #b3d9ff;
  text-decoration: none;
}

.table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-gray);
}

.table tbody tr:hover {
  background-color: #f0f7ff;
  transition: background-color 0.2s ease;
}

.table-responsive {
  overflow-x: auto;
}

/* Filter Section */
.filter-section {
  background-color: var(--white);
  padding: 15px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 86, 179, 0.08);
  margin-bottom: 20px;
}

.filter-form {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.filter-form .form-label {
  margin-bottom: 0;
  font-size: 0.95rem;
  white-space: nowrap;
}

.filter-form .form-select {
  min-width: 200px;
}

/* Cards */
.card {
  background-color: var(--white);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 86, 179, 0.1);
  border-left: 4px solid var(--light-blue);
  margin-bottom: 20px;
}

.card-body {
  padding: 25px;
}

/* Alerts */
.alert {
  padding: 16px;
  margin-bottom: 20px;
  border-left: 4px solid transparent;
  border-radius: 6px;
  font-weight: 500;
}

.alert-success {
  color: #155724;
  background-color: #d4edda;
  border-left-color: #28a745;
}

.alert-danger {
  color: #721c24;
  background-color: #f8d7da;
  border-left-color: #dc3545;
}

.alert-warning {
  color: #856404;
  background-color: #fff3cd;
  border-left-color: #ffc107;
}

.alert-info {
  color: #0c5460;
  background-color: #d1ecf1;
  border-left-color: var(--accent-teal);
}

/* Utility Classes */
.mb-3 {
  margin-bottom: 1.5rem;
}

.d-inline {
  display: inline;
}

.w-auto {
  width: auto;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  color: var(--ocean-blue);
  font-weight: 600;
}

.form-control {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--border-gray);
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--light-blue);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-select {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--border-gray);
  border-radius: 6px;
  font-size: 1rem;
  background-color: var(--white);
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.form-select:focus {
  outline: none;
  border-color: var(--light-blue);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-control-plaintext {
  padding: 8px 0;
  color: #2c3e50;
  font-weight: 500;
}

/* Text Utilities */
.text-decoration-none {
  text-decoration: none;
}

.text-muted {
  color: #6c757d;
}

/* Links */
a {
  color: var(--light-blue);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--primary-blue);
  text-decoration: underline;
}

code {
  background-color: #f5f5f5;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: "Courier New", monospace;
  color: #dc3545;
}

/* Responsive Design */
@media (max-width: 768px) {
  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.4rem;
  }

  .container {
    padding: 15px;
  }

  form {
    padding: 20px;
  }

  .btn {
    display: block;
    width: 100%;
    margin-bottom: 10px;
  }

  .table {
    font-size: 0.85rem;
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .table th,
  .table td {
    padding: 8px 6px;
    min-width: 80px;
  }

  .table th:first-child,
  .table td:first-child {
    position: sticky;
    left: 0;
    background: inherit;
    z-index: 1;
  }

  .table thead th:first-child {
    background: linear-gradient(135deg, #004d99 0%, #0056b3 100%);
  }

  .table tbody td:first-child {
    background: var(--white);
    font-weight: 600;
  }

  .table tbody tr:hover td:first-child {
    background-color: #f0f7ff;
  }

  .filter-form {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-form .form-select {
    min-width: 100%;
  }

  nav a {
    font-size: 0.9rem;
    padding: 8px 10px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.5rem;
  }

  .table {
    font-size: 0.75rem;
  }

  .table th,
  .table td {
    padding: 6px 4px;
    min-width: 70px;
  }

  .btn-sm {
    padding: 6px 10px;
    font-size: 0.8rem;
  }
}

/* Status Badge Styling */
.status-badge {
  display: inline-block;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  text-decoration: none !important;
  line-height: 1 !important;
}

.status-badge.status-new {
  background-color: transparent !important;
  color: inherit !important;
  border-left: none !important;
  border: none !important;
}

.status-badge.status-in-progress {
  background-color: transparent !important;
  color: inherit !important;
  border-left: none !important;
  border: none !important;
}

.status-badge.status-waiting-parts {
  background-color: transparent !important;
  color: inherit !important;
  border-left: none !important;
  border: none !important;
}

.status-badge.status-complete {
  background-color: transparent !important;
  color: inherit !important;
  border-left: none !important;
  border: none !important;
}

/* Status select styling with background colors */
#status {
  background-size: 1.5em 1.5em;
  padding-left: 2.5rem;
}

#status option[value="New"] {
  background-color: #fee;
  color: #c00;
}

#status option[value="In progress"] {
  background-color: #ffeaa7;
  color: #d63031;
}

#status option[value="Waiting parts"] {
  background-color: #74b9ff;
  color: #0055d4;
}

#status option[value="Complete"] {
  background-color: #55efc4;
  color: #00b894;
}
