
* {
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  margin: 0;
  padding: 20px;
  background: #f5f7fb;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
}

h1 {
  text-align: center;
  margin-bottom: 20px;
}

.nav-menu {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}

.nav-menu a {
  padding: 10px 20px;
  background: #e5e7eb;
  color: #111827;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: background 0.2s;
}

.nav-menu a:hover {
  background: #d1d5db;
}

.nav-menu a.active {
  background: #2563eb;
  color: #fff;
}

.card {
  background: #ffffff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.04);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px 16px;
  margin-bottom: 16px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }
  
  .container {
    max-width: 100%;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .nav-menu {
    flex-direction: column;
    gap: 8px;
  }
  
  .nav-menu a {
    text-align: center;
    padding: 12px 16px;
  }
  
  .filter-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  
  .filter-row label {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-row input {
    width: 100%;
  }
  
  table {
    font-size: 0.75rem;
  }
  
  th, td {
    padding: 6px 4px;
  }
  
  .btn-primary, .btn-secondary {
    width: 100%;
    padding: 12px 18px;
    margin-bottom: 8px;
  }
  
  input, select {
    padding: 12px 10px;
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  label {
    font-size: 1rem;
    margin-bottom: 8px;
  }
}

label {
  font-size: 0.9rem;
  color: #333;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

input, select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #d3d7e0;
  font-size: 0.9rem;
}

input:focus, select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37,99,235,0.3);
}

/* Searchable dropdown styles */
input[list] {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 8px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 32px;
}

input[list]::-webkit-calendar-picker-indicator {
  display: none;
}

.btn-primary {
  background: #2563eb;
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-secondary {
  background: #e5e7eb;
  color: #111827;
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
}

.btn-secondary:hover {
  background: #d1d5db;
}

.message {
  margin-top: 8px;
  font-size: 0.9rem;
}

.message.success {
  color: #16a34a;
}

.message.error {
  color: #dc2626;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.filter-row label {
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

.filter-row input {
  width: 160px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

thead {
  background: #eff1f5;
}

th, td {
  padding: 8px 6px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

tbody tr:nth-child(even) {
  background: #f9fafb;
}

/* Settings Page Styles */
.settings-input-group {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.settings-input-group input {
  flex: 1;
}

.item-list, .district-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.item-actions {
  display: flex;
  gap: 8px;
}

.district-item {
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  margin-bottom: 10px;
}

.district-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.trips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.trip-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #dbeafe;
  color: #1e40af;
  border-radius: 6px;
  font-size: 0.85rem;
}

.trip-input {
  width: 120px;
  padding: 6px 8px;
  font-size: 0.85rem;
}

.btn-delete {
  background: #dc2626;
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
}

.btn-delete:hover {
  background: #b91c1c;
}

.btn-delete-small {
  background: transparent;
  color: #dc2626;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: bold;
  padding: 0 4px;
  line-height: 1;
}

.btn-delete-small:hover {
  color: #b91c1c;
}

.btn-secondary-small {
  background: #e5e7eb;
  color: #111827;
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
}

.btn-secondary-small:hover {
  background: #d1d5db;
}

/* Additional Mobile Optimizations */
@media (max-width: 480px) {
  h1 {
    font-size: 1.5rem;
    margin-bottom: 15px;
  }
  
  h2 {
    font-size: 1.2rem;
  }
  
  .card {
    padding: 15px;
    margin-bottom: 15px;
  }
  
  /* Make table scrollable on very small screens */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  table {
    min-width: 600px;
  }
  
  /* Improve touch targets */
  button {
    min-height: 44px;
  }
  
  input, select {
    min-height: 44px;
  }
}

/* Landscape phone optimization */
@media (max-width: 768px) and (orientation: landscape) {
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.btn-edit {
  background: #f59e0b;
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
}

.btn-edit:hover {
  background: #d97706;
}

.btn-edit-small {
  background: transparent;
  color: #f59e0b;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 0 4px;
  line-height: 1;
}

.btn-edit-small:hover {
  color: #d97706;
}
/* Summary Page Styles */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.summary-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.summary-card h3 {
  margin: 0 0 10px 0;
  font-size: 0.9rem;
  opacity: 0.9;
}

.summary-value {
  font-size: 1.8rem;
  font-weight: bold;
  margin: 0;
}

.monthly-table-container {
  margin-bottom: 24px;
}

.summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 12px;
}

.summary-table th {
  background: #f8fafc;
  padding: 12px 8px;
  border: 1px solid #e2e8f0;
  font-weight: 600;
  text-align: center;
}

.summary-table td {
  padding: 10px 8px;
  border: 1px solid #e2e8f0;
  text-align: right;
}

.summary-table td:first-child {
  text-align: left;
  font-weight: 500;
}

.negative-balance {
  color: #dc2626;
  font-weight: bold;
}

.external-usage-container {
  margin-top: 24px;
}

.external-month-section {
  margin-bottom: 24px;
  padding: 16px;
  background: #f8fafc;
  border-radius: 8px;
  border-left: 4px solid #3b82f6;
}

.external-month-section h4 {
  margin: 0 0 12px 0;
  color: #1e40af;
  font-size: 1.1rem;
}

.external-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  background: white;
  border-radius: 6px;
  overflow: hidden;
}

.external-table th {
  background: #e2e8f0;
  padding: 8px 6px;
  border: 1px solid #cbd5e1;
  font-weight: 600;
}

.external-table td {
  padding: 6px;
  border: 1px solid #e2e8f0;
  text-align: center;
}

.external-table td:last-child {
  text-align: right;
  font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }
  
  .summary-table, .external-table {
    font-size: 0.75rem;
  }
  
  .summary-table th, .summary-table td,
  .external-table th, .external-table td {
    padding: 6px 4px;
  }
}
/* Edit/Delete Button Styles */
.btn-edit {
  background: #f59e0b;
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  margin-right: 6px;
}

.btn-edit:hover {
  background: #d97706;
}

.btn-delete {
  background: #dc2626;
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
}

.btn-delete:hover {
  background: #b91c1c;
}

/* Table action column */
table td:last-child {
  text-align: center;
  white-space: nowrap;
}
/* Main System Selection Styles */
.system-selection {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.system-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 32px;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.system-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 35px rgba(0,0,0,0.2);
}

.fuel-system {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.safety-system {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.system-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.system-card h2 {
  margin: 0 0 12px 0;
  font-size: 1.5rem;
}

.system-card p {
  margin: 0 0 20px 0;
  opacity: 0.9;
  line-height: 1.5;
}

.system-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
}

.feature-tag {
  background: rgba(255,255,255,0.2);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  backdrop-filter: blur(10px);
}

.btn-system {
  background: rgba(255,255,255,0.2);
  color: white;
  border: 2px solid rgba(255,255,255,0.3);
  padding: 12px 32px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.btn-system:hover {
  background: rgba(255,255,255,0.3);
  border-color: rgba(255,255,255,0.5);
  transform: scale(1.05);
}

/* System Header Styles */
.system-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.btn-back {
  background: #e5e7eb;
  color: #111827;
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s;
}

.btn-back:hover {
  background: #d1d5db;
}

.system-header h1 {
  margin: 0;
  flex: 1;
}

/* Welcome Section for Safety System */
.welcome-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.welcome-card {
  background: white;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.04);
  text-align: center;
}

.welcome-card h2 {
  margin: 0 0 12px 0;
  color: #1f2937;
}

.welcome-card p {
  margin: 0 0 20px 0;
  color: #6b7280;
  line-height: 1.5;
}

/* Form Section Styles */
.form-section {
  margin-top: 16px;
}

.form-section label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-section textarea {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #d3d7e0;
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
}

.form-section textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37,99,235,0.3);
}

/* Table Container for Responsive Tables */
.table-container {
  overflow-x: auto;
  margin-top: 12px;
}

.table-container table {
  min-width: 800px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .system-selection {
    grid-template-columns: 1fr;
  }
  
  .system-card {
    padding: 24px 20px;
  }
  
  .system-icon {
    font-size: 3rem;
  }
  
  .system-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .welcome-section {
    grid-template-columns: 1fr;
  }
}
/* Test Result Status Colors */
.test-passed {
  color: #16a34a;
  font-weight: 600;
}

.test-failed {
  color: #dc2626;
  font-weight: 600;
}

/* Vehicle Inspection Status Colors */
.status-normal {
  color: #16a34a;
  font-weight: 600;
}

.status-abnormal {
  color: #dc2626;
  font-weight: 600;
}

/* Vehicle Inspection Checkbox Styles */
.inspection-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.inspection-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background-color: #fafafa;
}

.inspection-label {
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.3;
}

.checkbox-group {
  display: flex;
  gap: 12px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: normal;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background-color 0.2s;
  font-size: 13px;
}

.checkbox-label:hover {
  background-color: #e5e7eb;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .inspection-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .inspection-item {
    padding: 10px;
  }
  
  .inspection-label {
    font-size: 13px;
  }
  
  .checkbox-label {
    font-size: 12px;
    padding: 5px 8px;
  }
  
  .checkbox-label input[type="checkbox"] {
    width: 14px;
    height: 14px;
  }
}

/* Tablet and larger mobile devices */
@media (min-width: 480px) and (max-width: 1024px) {
  .inspection-grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  
  .inspection-item {
    padding: 11px;
  }
}

/* Emergency equipment specific styles (3 options) */
.inspection-item .checkbox-group {
  flex-wrap: wrap;
}

.inspection-item .checkbox-group .checkbox-label {
  flex: 1;
  min-width: fit-content;
}

/* Mobile adjustments for 3-option groups */
@media (max-width: 768px) {
  .inspection-item .checkbox-group {
    flex-direction: column;
    gap: 8px;
  }
  
  .inspection-item .checkbox-label {
    justify-content: flex-start;
  }
}

/* Mechanic Verification Styles */
.inspection-info {
  background-color: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.inspection-info p {
  margin: 5px 0;
  font-size: 14px;
}

.verification-table-container {
  overflow-x: auto;
  margin-bottom: 20px;
}

.verification-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.verification-table th,
.verification-table td {
  border: 1px solid #dee2e6;
  padding: 10px;
  text-align: left;
}

.verification-table th {
  background-color: #f8f9fa;
  font-weight: 600;
  color: #495057;
}

.verification-table .mechanic-verification {
  width: 100%;
  padding: 5px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 13px;
}

.verification-table .mechanic-signature {
  width: 100%;
  padding: 5px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 13px;
}

.verification-actions {
  text-align: center;
  margin-top: 20px;
}

.no-data-message {
  text-align: center;
  padding: 40px;
  color: #6c757d;
  font-style: italic;
}

/* Modal Styles */
.modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: #fff;
  margin: 5% auto;
  padding: 0;
  border-radius: 8px;
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #dee2e6;
}

.modal-header h2 {
  margin: 0;
  color: #495057;
}

.close {
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  color: #aaa;
}

.close:hover {
  color: #000;
}

.modal-body {
  padding: 20px;
}

/* Report Styles */
.report-results {
  margin-top: 20px;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 8px;
}

.report-header {
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #dee2e6;
}

.report-header h4 {
  margin: 0 0 10px 0;
  color: #495057;
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.summary-card {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #dee2e6;
  text-align: center;
}

.summary-card h5 {
  margin: 0 0 15px 0;
  color: #495057;
  font-size: 16px;
}

.summary-card p {
  margin: 5px 0;
  font-size: 14px;
}

.no-data {
  text-align: center;
  color: #6c757d;
  font-style: italic;
  padding: 20px;
}

/* Equipment Status Colors */
.status-complete {
  color: #28a745;
  font-weight: 600;
}

.status-incomplete {
  color: #ffc107;
  font-weight: 600;
}

.status-missing {
  color: #dc3545;
  font-weight: 600;
}

/* Verification Status Colors */
.status-verified {
  color: #28a745;
  font-weight: 600;
}

.status-rejected {
  color: #dc3545;
  font-weight: 600;
}

.status-pending {
  color: #ffc107;
  font-weight: 600;
}

/* Warehouse Verification Styles */
.warehouse-verification {
  width: 100%;
  padding: 5px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 13px;
}

.warehouse-signature {
  width: 100%;
  padding: 5px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 13px;
}

/* Signature Section Styles */
.signature-section {
  margin-bottom: 20px;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #dee2e6;
}

.signature-section label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #495057;
}

.signature-section input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 14px;
}

/* Report Table Styles */
.report-table-container {
  margin-top: 20px;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  overflow: visible;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  table-layout: fixed;
}

.report-table th,
.report-table td {
  border: 1px solid #dee2e6;
  padding: 6px 4px;
  text-align: center;
  vertical-align: middle;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Column width distribution for vehicle inspection table (mechanic report) */
.mechanic-report-table th:nth-child(1),
.mechanic-report-table td:nth-child(1) { width: 3%; } /* # */
.mechanic-report-table th:nth-child(2),
.mechanic-report-table td:nth-child(2) { width: 7%; } /* วันที่ */
.mechanic-report-table th:nth-child(3),
.mechanic-report-table td:nth-child(3) { width: 8%; } /* พนักงานขับรถ */
.mechanic-report-table th:nth-child(4),
.mechanic-report-table td:nth-child(4) { width: 6%; } /* ทะเบียนรถ */
.mechanic-report-table th:nth-child(5),
.mechanic-report-table td:nth-child(5) { width: 5%; } /* เขตการวิ่ง */
.mechanic-report-table th:nth-child(6),
.mechanic-report-table td:nth-child(6) { width: 5%; } /* น้ำมันเครื่อง */
.mechanic-report-table th:nth-child(7),
.mechanic-report-table td:nth-child(7) { width: 5%; } /* หม้อน้ำ */
.mechanic-report-table th:nth-child(8),
.mechanic-report-table td:nth-child(8) { width: 5%; } /* กรองอากาศ */
.mechanic-report-table th:nth-child(9),
.mechanic-report-table td:nth-child(9) { width: 5%; } /* ระบบไฟ */
.mechanic-report-table th:nth-child(10),
.mechanic-report-table td:nth-child(10) { width: 4%; } /* แตร */
.mechanic-report-table th:nth-child(11),
.mechanic-report-table td:nth-child(11) { width: 4%; } /* ลมรถ */
.mechanic-report-table th:nth-child(12),
.mechanic-report-table td:nth-child(12) { width: 5%; } /* ยางรถ */
.mechanic-report-table th:nth-child(13),
.mechanic-report-table td:nth-child(13) { width: 4%; } /* เบรค */
.mechanic-report-table th:nth-child(14),
.mechanic-report-table td:nth-child(14) { width: 6%; } /* แบตเตอรี่ */
.mechanic-report-table th:nth-child(15),
.mechanic-report-table td:nth-child(15) { width: 6%; } /* โครงสร้าง */
.mechanic-report-table th:nth-child(16),
.mechanic-report-table td:nth-child(16) { width: 6%; } /* เครื่องยนต์ */
.mechanic-report-table th:nth-child(17),
.mechanic-report-table td:nth-child(17) { width: 10%; } /* ชื่อช่างผู้ทวนสอบ */

.report-table th {
  background-color: #f8f9fa;
  font-weight: 600;
  color: #495057;
  position: sticky;
  top: 0;
  z-index: 10;
}

.report-table tbody tr:nth-child(even) {
  background-color: #f8f9fa;
}

.report-table tbody tr:hover {
  background-color: #e9ecef;
}

.mechanic-name,
.warehouse-name {
  font-weight: 600;
  color: #495057;
  background-color: #fff3cd !important;
}

/* Report Actions */
.report-actions {
  margin-top: 20px;
  text-align: center;
  padding: 20px;
  border-top: 1px solid #dee2e6;
}

.report-actions button {
  margin: 0 10px;
}

/* Print styles */
@media print {
  /* Hide all elements except the report content */
  .system-header,
  .card:not(#reportSection),
  .report-actions,
  .btn-primary,
  .btn-secondary {
    display: none !important;
  }
  
  body {
    margin: 0;
    padding: 10px;
  }
  
  .container {
    max-width: none;
    margin: 0;
  }
  
  /* Ensure report section is visible */
  #reportSection {
    display: block !important;
    background: white !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  
  .report-table-container {
    border: none;
    margin: 0;
  }
  
  .report-table {
    font-size: 9px;
    width: 100%;
    page-break-inside: avoid;
  }
  
  .report-table th,
  .report-table td {
    padding: 3px 2px;
    font-size: 9px;
    word-wrap: break-word;
  }
  
  .report-header {
    margin-bottom: 15px;
    margin-top: 0;
  }
  
  .report-header h3 {
    font-size: 16px;
    margin: 0 0 10px 0;
  }
  
  /* Hide print button in report actions */
  .report-actions {
    display: none !important;
  }
  
  /* Warehouse verification print styles */
  .verification-actions {
    display: none !important;
  }
  
  .signature-section {
    display: none !important;
  }
}

/* Column width distribution for emergency equipment table (warehouse report) */
.warehouse-report-table th:nth-child(1),
.warehouse-report-table td:nth-child(1) { width: 3%; } /* # */
.warehouse-report-table th:nth-child(2),
.warehouse-report-table td:nth-child(2) { width: 7%; } /* วันที่ */
.warehouse-report-table th:nth-child(3),
.warehouse-report-table td:nth-child(3) { width: 8%; } /* พนักงานขับรถ */
.warehouse-report-table th:nth-child(4),
.warehouse-report-table td:nth-child(4) { width: 6%; } /* ทะเบียนรถ */
.warehouse-report-table th:nth-child(5),
.warehouse-report-table td:nth-child(5) { width: 5%; } /* เขตการวิ่ง */
.warehouse-report-table th:nth-child(6),
.warehouse-report-table td:nth-child(6) { width: 6%; } /* สายแบต */
.warehouse-report-table th:nth-child(7),
.warehouse-report-table td:nth-child(7) { width: 6%; } /* แม่แรง */
.warehouse-report-table th:nth-child(8),
.warehouse-report-table td:nth-child(8) { width: 6%; } /* กระบองไฟ */
.warehouse-report-table th:nth-child(9),
.warehouse-report-table td:nth-child(9) { width: 6%; } /* เสื้อสะท้อน */
.warehouse-report-table th:nth-child(10),
.warehouse-report-table td:nth-child(10) { width: 7%; } /* ป้าย 3 เหลี่ยม */
.warehouse-report-table th:nth-child(11),
.warehouse-report-table td:nth-child(11) { width: 6%; } /* บล็อกล้อ */
.warehouse-report-table th:nth-child(12),
.warehouse-report-table td:nth-child(12) { width: 7%; } /* ถังดับเพลิง */
.warehouse-report-table th:nth-child(13),
.warehouse-report-table td:nth-child(13) { width: 6%; } /* ไฟฉาย */
.warehouse-report-table th:nth-child(14),
.warehouse-report-table td:nth-child(14) { width: 15%; } /* ชื่อพนักงานแผนกคลัง FG */

/* Mobile responsive for report table */
@media (max-width: 768px) {
  .report-table {
    font-size: 9px;
  }
  
  .report-table th,
  .report-table td {
    padding: 4px 2px;
    font-size: 9px;
  }
}

/* Tablet responsive */
@media (max-width: 1024px) {
  .report-table {
    font-size: 10px;
  }
  
  .report-table th,
  .report-table td {
    padding: 5px 3px;
  }
}

/* Mobile responsive for verification table */
@media (max-width: 768px) {
  .verification-table {
    font-size: 12px;
  }
  
  .verification-table th,
  .verification-table td {
    padding: 8px 5px;
  }
  
  .verification-table .mechanic-verification,
  .verification-table .mechanic-signature {
    font-size: 12px;
    padding: 4px;
  }
  
  .modal-content {
    width: 95%;
    margin: 2% auto;
  }
  
  .report-summary {
    grid-template-columns: 1fr;
  }
}
/* Consumption Analysis Styles */
.consumption-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.consumption-card {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.consumption-table-container {
  margin-bottom: 24px;
}

.consumption-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 12px;
}

.consumption-table th {
  background: #f8fafc;
  padding: 12px 8px;
  border: 1px solid #e2e8f0;
  font-weight: 600;
  text-align: center;
}

.consumption-table td {
  padding: 10px 8px;
  border: 1px solid #e2e8f0;
  text-align: center;
}

.consumption-table td:first-child,
.consumption-table td:nth-child(2) {
  text-align: left;
}

/* Efficiency Status Colors */
.efficiency-ดีมาก {
  color: #16a34a;
  font-weight: bold;
}

.efficiency-ดี {
  color: #65a30d;
  font-weight: bold;
}

.efficiency-ปานกลาง {
  color: #d97706;
  font-weight: bold;
}

.efficiency-ต้องปรับปรุง {
  color: #dc2626;
  font-weight: bold;
}

.daily-consumption-container {
  margin-top: 24px;
}

.daily-vehicle-section {
  margin-bottom: 24px;
  padding: 16px;
  background: #f8fafc;
  border-radius: 8px;
  border-left: 4px solid #10b981;
}

.daily-vehicle-section h4 {
  margin: 0 0 12px 0;
  color: #059669;
  font-size: 1.1rem;
}

.daily-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  background: white;
  border-radius: 6px;
  overflow: hidden;
}

.daily-table th {
  background: #e2e8f0;
  padding: 8px 6px;
  border: 1px solid #cbd5e1;
  font-weight: 600;
  font-size: 0.75rem;
}

.daily-table td {
  padding: 6px;
  border: 1px solid #e2e8f0;
  text-align: center;
}

/* Responsive adjustments for consumption page */
@media (max-width: 768px) {
  .consumption-summary {
    grid-template-columns: 1fr;
  }
  
  .consumption-table, .daily-table {
    font-size: 0.7rem;
  }
  
  .consumption-table th, .consumption-table td,
  .daily-table th, .daily-table td {
    padding: 4px 2px;
  }
}
/* Daily consumption comparison styles */
.below-average {
  background-color: #fee2e2 !important;
  color: #991b1b;
}

.above-average {
  background-color: #ffffff;
}

.comparison-cell {
  font-weight: bold;
  text-align: center;
}

.below-average .comparison-cell {
  color: #dc2626;
}

.above-average .comparison-cell {
  color: #16a34a;
}

.summary-row {
  background-color: #f3f4f6 !important;
  font-weight: bold;
  border-top: 2px solid #d1d5db;
}

.summary-row td {
  padding: 10px 6px !important;
}

/* Enhanced daily table styles */
.daily-table th:nth-child(9) {
  background: #e0f2fe;
  color: #0369a1;
}

.daily-vehicle-section h4 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  margin: 0 0 12px 0;
}

/* Responsive adjustments for new column */
@media (max-width: 768px) {
  .daily-table {
    font-size: 0.65rem;
  }
  
  .daily-table th, .daily-table td {
    padding: 3px 2px;
  }
  
  .comparison-cell {
    font-size: 0.6rem;
  }
}
/* Modal Styles */
.modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: #fefefe;
  margin: 5% auto;
  padding: 0;
  border-radius: 12px;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 12px 12px 0 0;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.close {
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
  padding: 0 8px;
  border-radius: 4px;
  transition: background 0.2s;
}

.close:hover {
  background: rgba(255,255,255,0.2);
}

.modal-body {
  padding: 24px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  justify-content: flex-end;
}

.target-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 12px;
}

.target-table th {
  background: #f8fafc;
  padding: 12px 8px;
  border: 1px solid #e2e8f0;
  font-weight: 600;
  text-align: center;
}

.target-table td {
  padding: 10px 8px;
  border: 1px solid #e2e8f0;
  text-align: center;
}

.btn-delete-target {
  background: #dc2626;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
}

.btn-delete-target:hover {
  background: #b91c1c;
}

/* Target comparison styles */
.target-comparison {
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-block;
  min-width: 80px;
  text-align: center;
}

.target-achieved {
  background: #dcfce7;
  color: #166534;
}

.target-not-achieved {
  background: #fee2e2;
  color: #991b1b;
}

/* Info box styles */
.info-box {
  background: #f0f9ff;
  border: 1px solid #0ea5e9;
  border-radius: 8px;
  padding: 16px;
  margin-top: 16px;
}

.info-box p {
  margin: 4px 0;
  font-size: 0.9rem;
  color: #0369a1;
}

.info-box strong {
  color: #1e40af;
}

/* Equipment checklist styles */
.equipment-checklist {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 16px 0;
}

.equipment-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.equipment-item label {
  flex: 1;
  margin: 0;
  font-weight: 500;
  color: #374151;
}

.equipment-item select {
  width: 120px;
  margin: 0;
}

/* Equipment status styles */
.status-ครบ {
  color: #16a34a;
  font-weight: bold;
  background-color: #dcfce7;
  padding: 4px 8px;
  border-radius: 4px;
}

.status-ไม่ครบ {
  color: #d97706;
  font-weight: bold;
  background-color: #fef3c7;
  padding: 4px 8px;
  border-radius: 4px;
}

.status-สูญหาย {
  color: #dc2626;
  font-weight: bold;
  background-color: #fee2e2;
  padding: 4px 8px;
  border-radius: 4px;
}

/* Responsive modal */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    margin: 2% auto;
  }
  
  .modal-header {
    padding: 16px 20px;
  }
  
  .modal-body {
    padding: 20px;
  }
  
  .modal-actions {
    flex-direction: column;
  }
}
/* Percentage column styles */
.percentage-cell {
  font-weight: bold;
  text-align: center;
}

.percentage-good {
  color: #16a34a;
  background-color: #dcfce7;
}

.percentage-low {
  color: #dc2626;
  background-color: #fee2e2;
}

/* Enhanced daily table styles for new columns */
.daily-table th:nth-child(6) {
  background: #f0f9ff;
  color: #0369a1;
}

.daily-table th:nth-child(8) {
  background: #fef3c7;
  color: #92400e;
}

.daily-table th:nth-child(9) {
  background: #fef0ff;
  color: #a21caf;
}

.daily-table th:nth-child(10) {
  background: #f0fdf4;
  color: #166534;
}

.daily-table th:nth-child(11) {
  background: #fff7ed;
  color: #c2410c;
}

.daily-table th:nth-child(12) {
  background: #f3f4f6;
  color: #374151;
}

.daily-table th:nth-child(13) {
  background: #fef2f2;
  color: #991b1b;
}

.daily-table th:nth-child(14) {
  background: #ecfdf5;
  color: #065f46;
}

/* Deviation column styles */
.deviation-cell {
  font-weight: bold;
  text-align: center;
}

.deviation-positive {
  color: #16a34a;
  background-color: #dcfce7;
}

.deviation-negative {
  color: #dc2626;
  background-color: #fee2e2;
}

/* Distance efficiency column styles */
.distance-efficiency-cell {
  font-weight: bold;
  text-align: center;
}

.distance-positive {
  color: #16a34a;
  background-color: #dcfce7;
}

.distance-negative {
  color: #dc2626;
  background-color: #fee2e2;
}

/* Fuel consumption change column styles */
.fuel-consumption-cell {
  font-weight: bold;
  text-align: center;
}

.fuel-positive {
  color: #16a34a;
  background-color: #dcfce7;
}

.fuel-negative {
  color: #dc2626;
  background-color: #fee2e2;
}

/* Cumulative liters column styles */
.cumulative-cell {
  font-weight: bold;
  text-align: center;
}

.cumulative-positive {
  color: #16a34a;
  background-color: #dcfce7;
}

.cumulative-negative {
  color: #dc2626;
  background-color: #fee2e2;
}

/* Cost change column styles */
.cost-change-cell {
  font-weight: bold;
  text-align: center;
}

.cost-positive {
  color: #16a34a;
  background-color: #dcfce7;
}

.cost-negative {
  color: #dc2626;
  background-color: #fee2e2;
}

/* District column styles */
.district-cell {
  text-align: center;
  font-weight: 500;
  color: #065f46;
}

/* Responsive adjustments for all calculation columns */
@media (max-width: 768px) {
  .percentage-cell, .deviation-cell, .distance-efficiency-cell, .fuel-consumption-cell, .cumulative-cell, .cost-change-cell, .district-cell {
    font-size: 0.7rem;
    padding: 3px 2px;
  }
}
/* Print styles for Summary and Consumption pages */
@media print {
  /* Hide navigation and controls when printing */
  .system-header,
  .nav-menu,
  .filter-row,
  .btn-back,
  .btn-primary,
  .btn-secondary {
    display: none !important;
  }
  
  /* Print header styles */
  .print-header {
    margin-bottom: 30px;
    page-break-inside: avoid;
  }
  
  .print-header h1 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #333;
  }
  
  .print-header p {
    font-size: 14px;
    margin: 5px 0;
    color: #666;
  }
  
  /* Summary page print styles */
  .summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
    page-break-inside: avoid;
  }
  
  .summary-card {
    border: 1px solid #ddd;
    padding: 15px;
    background: white;
  }
  
  .summary-card h3 {
    font-size: 14px;
    margin-bottom: 10px;
  }
  
  .summary-value {
    font-size: 18px;
    font-weight: bold;
  }
  
  /* Consumption page print styles */
  .consumption-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
    page-break-inside: avoid;
  }
  
  .consumption-card {
    border: 1px solid #ddd;
    padding: 15px;
    background: white;
  }
  
  /* Table print styles */
  .summary-table,
  .consumption-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
    margin-bottom: 20px;
  }
  
  .summary-table th,
  .summary-table td,
  .consumption-table th,
  .consumption-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
  }
  
  .summary-table th,
  .consumption-table th {
    background-color: #f5f5f5;
    font-weight: bold;
  }
  
  /* Page break controls */
  .monthly-table-container,
  .consumption-table-container {
    page-break-inside: avoid;
  }
  
  .external-usage-container,
  .daily-consumption-container {
    page-break-before: auto;
    page-break-inside: avoid;
  }
  
  /* Hide modals when printing */
  .modal {
    display: none !important;
  }
  
  /* Ensure proper margins for printing */
  body {
    margin: 0;
    padding: 15px;
    font-size: 12px;
    line-height: 1.4;
  }
  
  .container {
    max-width: none;
    margin: 0;
    padding: 0;
  }
  
  .card {
    box-shadow: none;
    border: none;
    padding: 0;
    margin: 0;
  }
}

/* Mobile-optimized Fire Extinguisher Form */
@media (max-width: 768px) {
  /* Larger touch targets for mobile */
  .inspection-item .checkbox-label {
    padding: 12px 16px;
    font-size: 14px;
    min-height: 44px; /* iOS recommended minimum touch target */
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 4px;
    background-color: #ffffff;
    justify-content: center;
    text-align: center;
  }
  
  .inspection-item .checkbox-label:hover,
  .inspection-item .checkbox-label:active {
    background-color: #f3f4f6;
    border-color: #2563eb;
  }
  
  .inspection-item .checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
  }
  
  /* Single column layout for mobile */
  .inspection-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .inspection-item {
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  }
  
  .inspection-label {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #1f2937;
    text-align: center;
  }
  
  /* Stack checkboxes vertically on mobile */
  .inspection-item .checkbox-group {
    flex-direction: column;
    gap: 8px;
  }
  
  /* Form inputs optimization for mobile */
  .form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .form-grid label {
    font-size: 15px;
    font-weight: 600;
  }
  
  .form-grid input,
  .form-grid select {
    padding: 14px 12px;
    font-size: 16px; /* Prevents zoom on iOS */
    border-radius: 8px;
    border: 2px solid #e5e7eb;
  }
  
  .form-grid input:focus,
  .form-grid select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
  }
  
  /* Button optimization for mobile */
  .btn-primary {
    width: 100%;
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 600;
    margin-top: 20px;
    border-radius: 12px;
  }
  
  .btn-secondary {
    width: 100%;
    padding: 14px 18px;
    font-size: 15px;
    margin-top: 8px;
    border-radius: 10px;
  }
  
  /* Remarks textarea optimization */
  #remarks {
    padding: 14px 12px;
    font-size: 16px;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    min-height: 100px;
    resize: vertical;
  }
  
  #remarks:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
  }
  
  /* Filter section mobile optimization */
  .filter-row {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  
  .filter-row label {
    flex-direction: column;
    font-weight: 600;
    gap: 8px;
  }
  
  .filter-row input {
    width: 100%;
    padding: 14px 12px;
    font-size: 16px;
    border-radius: 8px;
  }
  
  .filter-row button {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
  }
  
  /* Status colors for mobile - more prominent */
  .status-ครบ {
    background-color: #dcfce7 !important;
    color: #166534 !important;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
  }
  
  .status-ไม่ครบ {
    background-color: #fef3c7 !important;
    color: #92400e !important;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
  }
  
  .status-สูญหาย {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
  }
  
  /* Table mobile optimization */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  table {
    font-size: 12px;
    min-width: 800px;
  }
  
  th, td {
    padding: 8px 4px;
    white-space: nowrap;
  }
  
  /* Navigation menu mobile optimization */
  .nav-menu {
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
  }
  
  .nav-menu a {
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    border-radius: 10px;
  }
  
  /* System header mobile optimization */
  .system-header {
    margin-bottom: 16px;
  }
  
  .system-header h1 {
    font-size: 20px;
    margin: 10px 0;
  }
  
  .btn-back {
    padding: 10px 16px;
    font-size: 14px;
    border-radius: 8px;
    margin-bottom: 10px;
  }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
  body {
    padding: 8px;
  }
  
  .card {
    padding: 16px;
    margin-bottom: 16px;
  }
  
  .inspection-item .checkbox-label {
    padding: 14px 12px;
    font-size: 13px;
  }
  
  .inspection-label {
    font-size: 14px;
  }
  
  .system-header h1 {
    font-size: 18px;
  }
}
/* Mobile-optimized Vehicle Inspection (Radiator) Form */
@media (max-width: 768px) {
  /* Vehicle inspection specific mobile styles */
  .inspection-item .checkbox-group {
    flex-direction: row; /* Keep horizontal for 2-option groups */
    gap: 8px;
    justify-content: space-between;
  }
  
  /* 2-option checkbox labels for vehicle inspection */
  .inspection-item .checkbox-group .checkbox-label {
    flex: 1;
    padding: 14px 12px;
    font-size: 14px;
    min-height: 48px; /* Larger touch target for mobile */
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    margin: 0;
    background-color: #ffffff;
    justify-content: center;
    text-align: center;
    font-weight: 600;
    transition: all 0.2s ease;
  }
  
  /* Different colors for normal/abnormal states */
  .inspection-item .checkbox-group .checkbox-label:first-child {
    border-color: #10b981;
    color: #065f46;
    background-color: #ecfdf5;
  }
  
  .inspection-item .checkbox-group .checkbox-label:last-child {
    border-color: #ef4444;
    color: #991b1b;
    background-color: #fef2f2;
  }
  
  .inspection-item .checkbox-group .checkbox-label:hover,
  .inspection-item .checkbox-group .checkbox-label:active {
    transform: scale(0.98);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  }
  
  /* Selected state styling */
  .inspection-item .checkbox-group .checkbox-label:has(input:checked):first-child {
    background-color: #10b981;
    color: white;
    border-color: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  }
  
  .inspection-item .checkbox-group .checkbox-label:has(input:checked):last-child {
    background-color: #ef4444;
    color: white;
    border-color: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
  }
  
  .inspection-item .checkbox-group .checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    accent-color: currentColor;
  }
  
  /* Vehicle inspection grid mobile layout */
  .inspection-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .inspection-item {
    padding: 18px;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    background-color: #fafafa;
    border: 1px solid #e5e7eb;
  }
  
  .inspection-label {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 14px;
    color: #1f2937;
    text-align: center;
    padding-bottom: 8px;
    border-bottom: 2px solid #e5e7eb;
  }
  
  /* Status colors for vehicle inspection table */
  .status-normal {
    background-color: #dcfce7 !important;
    color: #166534 !important;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 8px;
    text-align: center;
  }
  
  .status-abnormal {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 8px;
    text-align: center;
  }
  
  /* Vehicle inspection table mobile optimization */
  .table-container table {
    font-size: 11px;
    min-width: 1000px; /* Wider table for more columns */
  }
  
  .table-container th,
  .table-container td {
    padding: 6px 3px;
    white-space: nowrap;
    text-align: center;
  }
  
  /* Action buttons in table */
  .table-container .btn-edit,
  .table-container .btn-delete {
    padding: 4px 8px;
    font-size: 10px;
    margin: 1px;
    border-radius: 4px;
  }
}

/* Extra small mobile devices - Vehicle Inspection */
@media (max-width: 480px) {
  .inspection-item .checkbox-group .checkbox-label {
    padding: 12px 8px;
    font-size: 13px;
    min-height: 44px;
  }
  
  .inspection-label {
    font-size: 15px;
  }
  
  .inspection-item {
    padding: 16px;
  }
  
  .table-container table {
    font-size: 10px;
  }
  
  .table-container th,
  .table-container td {
    padding: 4px 2px;
  }
}

/* Tablet landscape - Vehicle Inspection */
@media (min-width: 769px) and (max-width: 1024px) {
  .inspection-grid {
    grid-template-columns: 1fr 1fr;
    gap: 18px;
  }
  
  .inspection-item .checkbox-group .checkbox-label {
    padding: 12px 16px;
    font-size: 15px;
  }
}
/* Mobile-optimized Verification Pages (Mechanic & Warehouse) */
@media (max-width: 768px) {
  /* Search section mobile optimization */
  .form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .form-grid label {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
  }
  
  .form-grid input,
  .form-grid select {
    padding: 14px 12px;
    font-size: 16px; /* Prevents zoom on iOS */
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    background-color: #ffffff;
  }
  
  .form-grid input:focus,
  .form-grid select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
    outline: none;
  }
  
  /* Button optimization for mobile */
  .btn-primary,
  .btn-secondary {
    width: 100%;
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
  }
  
  .btn-primary {
    background: #2563eb;
    color: white;
  }
  
  .btn-primary:hover,
  .btn-primary:active {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
  }
  
  .btn-secondary {
    background: #e5e7eb;
    color: #374151;
  }
  
  .btn-secondary:hover,
  .btn-secondary:active {
    background: #d1d5db;
    transform: translateY(-1px);
  }
  
  /* Inspection info section */
  .inspection-info {
    background-color: #f8fafc;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
  }
  
  .inspection-info p {
    margin: 8px 0;
    font-size: 15px;
    line-height: 1.5;
  }
  
  .inspection-info strong {
    color: #1e293b;
    font-weight: 600;
  }
  
  /* Verification table mobile optimization */
  .verification-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  }
  
  .verification-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    font-size: 14px;
    background: white;
  }
  
  .verification-table th {
    background-color: #f1f5f9;
    color: #334155;
    font-weight: 600;
    padding: 16px 12px;
    text-align: left;
    border-bottom: 2px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 10;
  }
  
  .verification-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
  }
  
  .verification-table tbody tr:hover {
    background-color: #f8fafc;
  }
  
  /* Verification select dropdowns */
  .mechanic-verification,
  .warehouse-verification {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background-color: white;
    color: #374151;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
  }
  
  .mechanic-verification:focus,
  .warehouse-verification:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
    outline: none;
  }
  
  .mechanic-verification option,
  .warehouse-verification option {
    padding: 10px;
    font-size: 14px;
  }
  
  /* Status colors for verification tables */
  .status-normal {
    background-color: #dcfce7 !important;
    color: #166534 !important;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 8px;
    text-align: center;
  }
  
  .status-abnormal {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 8px;
    text-align: center;
  }
  
  .status-complete {
    background-color: #dcfce7 !important;
    color: #166534 !important;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 8px;
    text-align: center;
  }
  
  .status-incomplete {
    background-color: #fef3c7 !important;
    color: #92400e !important;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 8px;
    text-align: center;
  }
  
  .status-missing {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 8px;
    text-align: center;
  }
  
  /* Verification actions section */
  .verification-actions {
    background-color: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-top: 20px;
  }
  
  .signature-section {
    margin-bottom: 20px;
  }
  
  .signature-section label {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
    display: block;
  }
  
  .signature-section input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background-color: white;
    color: #374151;
  }
  
  .signature-section input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
    outline: none;
  }
  
  .signature-section input::placeholder {
    color: #9ca3af;
    font-style: italic;
  }
  
  /* No data message */
  .no-data-message {
    text-align: center;
    padding: 40px 20px;
    background-color: #f8fafc;
    border-radius: 12px;
    border: 2px dashed #cbd5e1;
    color: #64748b;
    font-size: 16px;
    line-height: 1.6;
  }
  
  .no-data-message small {
    display: block;
    margin-top: 12px;
    font-size: 14px;
    color: #94a3b8;
  }
  
  /* Navigation menu mobile optimization */
  .nav-menu {
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
  }
  
  .nav-menu a {
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    border-radius: 10px;
  }
  
  /* System header mobile optimization */
  .system-header {
    margin-bottom: 16px;
  }
  
  .system-header h1 {
    font-size: 20px;
    margin: 10px 0;
    line-height: 1.3;
  }
  
  .btn-back {
    padding: 10px 16px;
    font-size: 14px;
    border-radius: 8px;
    margin-bottom: 10px;
    background: #e5e7eb;
    border: none;
    color: #374151;
    font-weight: 500;
  }
  
  .btn-back:hover,
  .btn-back:active {
    background: #d1d5db;
    transform: translateY(-1px);
  }
  
  /* Card sections */
  .card {
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    background: white;
    border: 1px solid #e2e8f0;
  }
  
  .card h2 {
    font-size: 18px;
    margin-bottom: 16px;
    color: #1e293b;
    font-weight: 700;
  }
  
  .card h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: #334155;
    font-weight: 600;
  }
}

/* Extra small mobile devices - Verification pages */
@media (max-width: 480px) {
  body {
    padding: 8px;
  }
  
  .card {
    padding: 16px;
    margin-bottom: 16px;
  }
  
  .verification-table {
    font-size: 12px;
    min-width: 500px;
  }
  
  .verification-table th,
  .verification-table td {
    padding: 10px 8px;
  }
  
  .mechanic-verification,
  .warehouse-verification {
    font-size: 13px;
    padding: 8px 10px;
  }
  
  .system-header h1 {
    font-size: 18px;
  }
  
  .inspection-info {
    padding: 14px;
  }
  
  .verification-actions {
    padding: 16px;
  }
}

/* Tablet landscape - Verification pages */
@media (min-width: 769px) and (max-width: 1024px) {
  .form-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  
  .btn-primary,
  .btn-secondary {
    width: auto;
    min-width: 150px;
    display: inline-block;
    margin-right: 10px;
  }
  
  .verification-table {
    font-size: 15px;
  }
  
  .verification-table th,
  .verification-table td {
    padding: 12px 14px;
  }
}
/* Searchable Dropdown Styles */
input[list] {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 40px;
  cursor: pointer;
}

input[list]:focus {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%232563eb' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
}

/* Hide default datalist dropdown arrow on webkit browsers */
input[list]::-webkit-calendar-picker-indicator {
  display: none;
}

/* Enhanced mobile styles for searchable dropdowns */
@media (max-width: 768px) {
  input[list] {
    padding: 14px 40px 14px 12px;
    font-size: 16px; /* Prevents zoom on iOS */
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    background-color: #ffffff;
    background-size: 18px;
    background-position: right 14px center;
  }
  
  input[list]:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
    outline: none;
  }
  
  input[list]::placeholder {
    color: #9ca3af;
    font-style: italic;
  }
  
  /* Enhanced datalist styling */
  datalist {
    display: none;
  }
  
  /* Custom dropdown behavior for better mobile experience */
  input[list]:focus {
    background-color: #f8fafc;
  }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
  input[list] {
    padding: 12px 36px 12px 10px;
    font-size: 16px;
    background-size: 16px;
    background-position: right 12px center;
  }
}

/* Tablet and larger screens */
@media (min-width: 769px) {
  input[list] {
    padding: 10px 36px 10px 12px;
    font-size: 14px;
    background-size: 16px;
    background-position: right 12px center;
  }
  
  input[list]:hover {
    border-color: #d1d5db;
    background-color: #f9fafb;
  }
}

/* Improved accessibility for searchable dropdowns */
input[list]:disabled {
  background-color: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
  border-color: #d1d5db;
}

input[list]:invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Animation for dropdown interaction */
input[list] {
  transition: all 0.2s ease;
}

input[list]:focus {
  transform: translateY(-1px);
}

/* Custom styling for different input types in forms */
.form-grid input[list] {
  width: 100%;
}

.filter-row input[list] {
  min-width: 200px;
}

@media (max-width: 768px) {
  .filter-row input[list] {
    width: 100%;
    min-width: auto;
  }
}
/* ========================================
   COMPREHENSIVE MOBILE & TABLET OPTIMIZATION
   ======================================== */

/* Universal Mobile Optimizations */
@media (max-width: 768px) {
  /* Base mobile styles */
  * {
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
  }
  
  input, textarea, select {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
  }
  
  /* Body and container optimizations */
  body {
    padding: 8px;
    font-size: 16px;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
  }
  
  .container {
    max-width: 100%;
    padding: 0;
  }
  
  /* Typography optimizations */
  h1 {
    font-size: 20px;
    line-height: 1.3;
    margin: 10px 0 16px 0;
    text-align: center;
  }
  
  h2 {
    font-size: 18px;
    line-height: 1.3;
    margin: 12px 0;
  }
  
  h3 {
    font-size: 16px;
    line-height: 1.3;
    margin: 10px 0;
  }
  
  /* Card optimizations */
  .card {
    padding: 16px;
    margin-bottom: 16px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  }
  
  /* Form optimizations */
  .form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .form-section {
    margin-bottom: 20px;
  }
  
  label {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
  }
  
  input, select, textarea {
    width: 100%;
    padding: 14px 12px;
    font-size: 16px; /* Prevents zoom on iOS */
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background-color: #ffffff;
    transition: all 0.2s ease;
    box-sizing: border-box;
  }
  
  input:focus, select:focus, textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
    outline: none;
    transform: translateY(-1px);
  }
  
  textarea {
    min-height: 100px;
    resize: vertical;
  }
  
  /* Button optimizations */
  button, .btn-primary, .btn-secondary {
    width: 100%;
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 8px;
    min-height: 48px; /* iOS recommended minimum */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }
  
  .btn-primary {
    background: #2563eb;
    color: white;
  }
  
  .btn-primary:hover, .btn-primary:active {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
  }
  
  .btn-secondary {
    background: #e5e7eb;
    color: #374151;
  }
  
  .btn-secondary:hover, .btn-secondary:active {
    background: #d1d5db;
    transform: translateY(-1px);
  }
  
  .btn-back {
    width: auto;
    padding: 10px 16px;
    font-size: 14px;
    margin-bottom: 12px;
    min-height: 40px;
  }
  
  /* Table optimizations */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 16px -16px;
    padding: 0 16px;
  }
  
  table {
    width: 100%;
    min-width: 600px;
    font-size: 12px;
    border-collapse: collapse;
  }
  
  th, td {
    padding: 8px 4px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
  }
  
  th {
    background-color: #f8fafc;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
  }
  
  /* Filter row optimizations */
  .filter-row {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  
  .filter-row label {
    flex-direction: column;
    gap: 8px;
  }
  
  .filter-row input {
    width: 100%;
  }
  
  .filter-row button {
    width: 100%;
    margin-bottom: 4px;
  }
  
  /* Navigation menu optimizations */
  .nav-menu {
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
  }
  
  .nav-menu a {
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    border-radius: 10px;
    display: block;
  }
  
  /* System header optimizations */
  .system-header {
    margin-bottom: 16px;
    text-align: center;
  }
  
  /* Message optimizations */
  .message {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 12px 0;
    font-size: 14px;
    text-align: center;
  }
  
  .message.success {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
  }
  
  .message.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
  }
  
  /* Modal optimizations */
  .modal {
    padding: 16px;
  }
  
  .modal-content {
    width: 95%;
    max-width: 400px;
    margin: 10% auto;
    padding: 20px;
    border-radius: 12px;
  }
  
  /* Settings page optimizations */
  .settings-input-group {
    flex-direction: column;
    gap: 12px;
  }
  
  .item, .district-item {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
  }
  
  .item-actions {
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
  }
  
  .item-actions button {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    margin-bottom: 4px;
  }
  
  /* Login section optimizations */
  #loginSection {
    max-width: 400px;
    margin: 20px auto;
    padding: 24px;
  }
  
  #loginSection input {
    margin-bottom: 16px;
  }
}

/* iPad and Tablet Optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
  body {
    padding: 16px;
  }
  
  .container {
    max-width: 100%;
  }
  
  .form-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  
  .card {
    padding: 24px;
  }
  
  h1 {
    font-size: 24px;
  }
  
  h2 {
    font-size: 20px;
  }
  
  input, select, textarea {
    padding: 12px 14px;
    font-size: 15px;
  }
  
  button, .btn-primary, .btn-secondary {
    width: auto;
    min-width: 120px;
    padding: 12px 24px;
    font-size: 15px;
    display: inline-flex;
    margin-right: 8px;
    margin-bottom: 8px;
  }
  
  .filter-row {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  
  .filter-row button {
    width: auto;
    min-width: 100px;
  }
  
  table {
    font-size: 14px;
    min-width: auto;
  }
  
  th, td {
    padding: 10px 8px;
  }
  
  .nav-menu {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .nav-menu a {
    width: auto;
    min-width: 150px;
  }
}

/* Large Tablet and Small Desktop */
@media (min-width: 1025px) and (max-width: 1200px) {
  .container {
    max-width: 1000px;
    margin: 0 auto;
  }
  
  .form-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

/* Touch and Interaction Enhancements */
@media (hover: none) and (pointer: coarse) {
  /* Touch device specific styles */
  button:active, .btn-primary:active, .btn-secondary:active {
    transform: scale(0.98);
  }
  
  input:active, select:active, textarea:active {
    transform: scale(1.02);
  }
  
  .nav-menu a:active {
    transform: scale(0.98);
  }
}

/* High DPI Display Optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Crisp borders and shadows for retina displays */
  .card {
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
  }
  
  input, select, textarea {
    border-width: 1px;
  }
  
  button, .btn-primary, .btn-secondary {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }
}

/* Dark Mode Support (if system preference) */
@media (prefers-color-scheme: dark) {
  /* Optional: Add dark mode styles if needed */
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print Optimizations */
@media print {
  body {
    padding: 0;
    font-size: 12pt;
  }
  
  .btn-back, .filter-row, .nav-menu, button {
    display: none !important;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }
  
  table {
    font-size: 10pt;
  }
  
  th, td {
    padding: 4px;
  }
}
/* ========================================
   SAFETY-MAIN PAGE MOBILE OPTIMIZATION
   ======================================== */

/* Welcome section base styles */
.welcome-section {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.welcome-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
}

.welcome-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.welcome-card h2 {
  margin: 0 0 12px 0;
  font-size: 18px;
  color: #1e293b;
  font-weight: 700;
}

.welcome-card p {
  margin: 0 0 16px 0;
  color: #64748b;
  line-height: 1.6;
  font-size: 14px;
}

.welcome-card .btn-primary {
  width: 100%;
  margin: 0;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  border-radius: 8px;
  transition: all 0.2s ease;
}

/* Mobile optimizations for safety-main */
@media (max-width: 768px) {
  .welcome-section {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 0 4px;
  }
  
  .welcome-card {
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    margin-bottom: 4px;
  }
  
  .welcome-card h2 {
    font-size: 18px;
    line-height: 1.3;
    margin-bottom: 12px;
    text-align: center;
  }
  
  .welcome-card p {
    font-size: 15px;
    line-height: 1.5;
    text-align: center;
    margin-bottom: 20px;
    color: #475569;
  }
  
  .welcome-card .btn-primary {
    width: 100%;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: #2563eb;
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
  }
  
  .welcome-card .btn-primary:hover,
  .welcome-card .btn-primary:active {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
  }
  
  /* Different colors for different cards */
  .welcome-card:nth-child(1) .btn-primary {
    background: #dc2626; /* Red for emergency equipment */
  }
  
  .welcome-card:nth-child(1) .btn-primary:hover,
  .welcome-card:nth-child(1) .btn-primary:active {
    background: #b91c1c;
    box-shadow: 0 4px 12px rgba(220,38,38,0.3);
  }
  
  .welcome-card:nth-child(2) .btn-primary {
    background: #2563eb; /* Blue for vehicle inspection */
  }
  
  .welcome-card:nth-child(2) .btn-primary:hover,
  .welcome-card:nth-child(2) .btn-primary:active {
    background: #1d4ed8;
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
  }
  
  .welcome-card:nth-child(3) .btn-primary {
    background: #059669; /* Green for mechanic verification */
  }
  
  .welcome-card:nth-child(3) .btn-primary:hover,
  .welcome-card:nth-child(3) .btn-primary:active {
    background: #047857;
    box-shadow: 0 4px 12px rgba(5,150,105,0.3);
  }
  
  .welcome-card:nth-child(4) .btn-primary {
    background: #7c3aed; /* Purple for warehouse verification */
  }
  
  .welcome-card:nth-child(4) .btn-primary:hover,
  .welcome-card:nth-child(4) .btn-primary:active {
    background: #6d28d9;
    box-shadow: 0 4px 12px rgba(124,58,237,0.3);
  }
  
  /* Enhanced card styling for mobile */
  .welcome-card:nth-child(1) {
    border-left: 4px solid #dc2626;
  }
  
  .welcome-card:nth-child(2) {
    border-left: 4px solid #2563eb;
  }
  
  .welcome-card:nth-child(3) {
    border-left: 4px solid #059669;
  }
  
  .welcome-card:nth-child(4) {
    border-left: 4px solid #7c3aed;
  }
  
  /* Animation for mobile */
  .fade-in-mobile {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
  }
  
  @keyframes fadeInUp {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  /* System header mobile optimization for safety-main */
  .system-header {
    text-align: center;
    margin-bottom: 20px;
    padding: 16px 0;
  }
  
  .system-header h1 {
    font-size: 20px;
    line-height: 1.3;
    margin: 12px 0;
    color: #1e293b;
  }
  
  .system-header .btn-back {
    width: auto;
    padding: 10px 16px;
    font-size: 14px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 12px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  .system-header .btn-back:hover,
  .system-header .btn-back:active {
    background: #e2e8f0;
    transform: translateY(-1px);
  }
  
  /* Navigation menu for safety-main mobile */
  .nav-menu {
    display: none; /* Hide on mobile since we have cards */
  }
}

/* Tablet optimizations for safety-main */
@media (min-width: 769px) and (max-width: 1024px) {
  .welcome-section {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  
  .welcome-card {
    padding: 24px;
  }
  
  .welcome-card h2 {
    font-size: 20px;
  }
  
  .welcome-card p {
    font-size: 15px;
  }
  
  .welcome-card .btn-primary {
    padding: 14px 20px;
    font-size: 15px;
  }
  
  .nav-menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
  }
  
  .nav-menu a {
    flex: 1;
    min-width: 200px;
    max-width: 250px;
    text-align: center;
    padding: 12px 16px;
  }
}

/* Desktop optimizations for safety-main */
@media (min-width: 1025px) {
  .welcome-section {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    max-width: 800px;
    margin: 24px auto 0;
  }
  
  .welcome-card {
    padding: 28px;
  }
  
  .welcome-card h2 {
    font-size: 22px;
  }
  
  .welcome-card p {
    font-size: 16px;
  }
  
  .welcome-card .btn-primary {
    width: auto;
    padding: 12px 24px;
    font-size: 15px;
    display: inline-block;
  }
}
/* ========================================
   SINGLE VERIFICATION INTERFACE STYLES
   ======================================== */

/* Single verification section */
.single-verification-section {
  background-color: #f8fafc;
  padding: 20px;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  margin-bottom: 20px;
}

.single-verification-section h3 {
  margin: 0 0 16px 0;
  font-size: 18px;
  color: #1e293b;
  font-weight: 700;
  text-align: center;
}

.verification-options {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 20px;
}

.verification-radio {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 16px 20px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background-color: #ffffff;
  transition: all 0.2s ease;
  min-width: 180px;
  justify-content: center;
}

.verification-radio:hover {
  border-color: #cbd5e1;
  background-color: #f8fafc;
}

.verification-radio input[type="radio"] {
  margin-right: 12px;
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.radio-label {
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.radio-label.confirm {
  color: #059669;
}

.radio-label.reject {
  color: #dc2626;
}

/* Selected state */
.verification-radio:has(input:checked) {
  background-color: #f0f9ff;
  border-color: #2563eb;
  box-shadow: 0 4px 12px rgba(37,99,235,0.15);
}

.verification-radio:has(input:checked) .radio-label.confirm {
  color: #059669;
  background-color: #dcfce7;
  padding: 8px 12px;
  border-radius: 6px;
}

.verification-radio:has(input:checked) .radio-label.reject {
  color: #dc2626;
  background-color: #fee2e2;
  padding: 8px 12px;
  border-radius: 6px;
}

/* Remarks section */
.remarks-section {
  margin-bottom: 20px;
}

.remarks-section label {
  font-size: 15px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
  display: block;
}

.remarks-section textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

.remarks-section textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
  outline: none;
}

/* Mobile optimizations for single verification */
@media (max-width: 768px) {
  .single-verification-section {
    padding: 16px;
    margin-bottom: 16px;
  }
  
  .single-verification-section h3 {
    font-size: 16px;
    margin-bottom: 16px;
  }
  
  .verification-options {
    flex-direction: column;
    gap: 12px;
  }
  
  .verification-radio {
    width: 100%;
    min-width: auto;
    padding: 16px;
    justify-content: flex-start;
  }
  
  .verification-radio input[type="radio"] {
    width: 18px;
    height: 18px;
    margin-right: 12px;
  }
  
  .radio-label {
    font-size: 15px;
    flex: 1;
  }
  
  .verification-radio:has(input:checked) .radio-label.confirm,
  .verification-radio:has(input:checked) .radio-label.reject {
    padding: 6px 10px;
    border-radius: 6px;
    font-weight: 700;
  }
  
  .remarks-section textarea {
    padding: 14px 12px;
    font-size: 16px; /* Prevents zoom on iOS */
    min-height: 100px;
  }
  
  /* Enhanced signature section for mobile */
  .signature-section {
    margin-bottom: 20px;
  }
  
  .signature-section label {
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    display: block;
  }
  
  .signature-section input {
    width: 100%;
    padding: 14px 12px;
    font-size: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background-color: #ffffff;
  }
  
  .signature-section input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
    outline: none;
  }
  
  .signature-section input:required:invalid {
    border-color: #ef4444;
  }
  
  .signature-section input:required:valid {
    border-color: #10b981;
  }
}

/* Tablet optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
  .verification-options {
    gap: 20px;
  }
  
  .verification-radio {
    min-width: 200px;
    padding: 18px 24px;
  }
  
  .radio-label {
    font-size: 16px;
  }
}

/* Enhanced form validation styles */
.verification-radio input[type="radio"]:required:invalid + .radio-label {
  opacity: 0.7;
}

.verification-radio input[type="radio"]:checked + .radio-label {
  opacity: 1;
}

/* Animation for verification selection */
.verification-radio {
  transform: scale(1);
  transition: all 0.2s ease;
}

.verification-radio:active {
  transform: scale(0.98);
}

.verification-radio:has(input:checked) {
  animation: verificationSelected 0.3s ease;
}

@keyframes verificationSelected {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* Focus styles for accessibility */
.verification-radio input[type="radio"]:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.verification-radio input[type="radio"]:focus + .radio-label {
  color: #2563eb;
}
/* ========================================
   MOBILE HISTORY TOGGLE FUNCTIONALITY
   ======================================== */

/* History section base styles */
.history-section {
  position: relative;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.history-header h2 {
  margin: 0;
  flex: 1;
}

.mobile-toggle-btn {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 120px;
  justify-content: center;
}

.mobile-toggle-btn:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

.mobile-toggle-btn:active {
  transform: scale(0.98);
}

.history-content {
  transition: all 0.3s ease;
}

/* Mobile-specific styles */
@media (max-width: 768px) {
  .history-section {
    margin-top: 20px;
  }
  
  .history-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
  }
  
  .history-header h2 {
    text-align: center;
    font-size: 18px;
    color: #1e293b;
    margin: 0;
  }
  
  .mobile-toggle-btn {
    display: inline-flex !important;
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
    border-radius: 10px;
    background: #2563eb;
    color: white;
    border: 2px solid #2563eb;
    box-shadow: 0 2px 8px rgba(37,99,235,0.2);
  }
  
  .mobile-toggle-btn:hover,
  .mobile-toggle-btn:active {
    background: #1d4ed8;
    border-color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
  }
  
  .mobile-toggle-btn span {
    font-weight: 600;
  }
  
  .history-content {
    margin-top: 16px;
    padding: 16px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  }
  
  /* Animation for content show/hide */
  .history-content {
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  /* Enhanced filter row in mobile history */
  .history-content .filter-row {
    margin-bottom: 16px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
  }
  
  .history-content .filter-row label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
  }
  
  .history-content .filter-row input {
    padding: 12px;
    font-size: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
  }
  
  .history-content .filter-row button {
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
  }
  
  /* Table styling in mobile history */
  .history-content .table-container {
    margin: 0 -16px;
    padding: 0 16px;
  }
  
  .history-content table {
    font-size: 11px;
    min-width: 700px;
  }
  
  .history-content th,
  .history-content td {
    padding: 6px 4px;
    white-space: nowrap;
  }
  
  .history-content th {
    background: #f1f5f9;
    font-weight: 600;
    color: #475569;
  }
  
  .history-content .btn-edit,
  .history-content .btn-delete {
    padding: 4px 8px;
    font-size: 10px;
    margin: 1px;
    border-radius: 4px;
  }
}

/* Tablet styles - show history by default */
@media (min-width: 769px) and (max-width: 1024px) {
  .mobile-toggle-btn {
    display: none !important;
  }
  
  .history-content {
    display: block !important;
  }
  
  .history-header {
    flex-direction: row;
    align-items: center;
  }
}

/* Desktop styles - show history by default */
@media (min-width: 1025px) {
  .mobile-toggle-btn {
    display: none !important;
  }
  
  .history-content {
    display: block !important;
  }
  
  .history-header h2 {
    margin-bottom: 16px;
  }
}

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

.history-content.loading::after {
  content: "กำลังโหลด...";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255,255,255,0.9);
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
  color: #374151;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Enhanced mobile experience indicators */
@media (max-width: 768px) {
  .history-section::before {
    content: "📱 แตะเพื่อดูประวัติ";
    position: absolute;
    top: -8px;
    right: 16px;
    background: #fef3c7;
    color: #92400e;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    z-index: 10;
  }
  
  .history-content[style*="block"]::before {
    display: none;
  }
}

/* Accessibility improvements */
.mobile-toggle-btn:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.mobile-toggle-btn[aria-expanded="true"] {
  background: #1d4ed8;
}

.mobile-toggle-btn[aria-expanded="false"] {
  background: #2563eb;
}

/* Animation for toggle icon */
.mobile-toggle-btn span:last-child {
  transition: transform 0.2s ease;
}

.mobile-toggle-btn[aria-expanded="true"] span:last-child {
  transform: rotate(180deg);
}
/* ========================================
   MOBILE PAGE SELECTION INTERFACE
   ======================================== */

/* Base styles for main page */
.desktop-view {
  display: block;
}

.mobile-view {
  display: none;
}

/* Mobile page selection styles */
.mobile-page-selection {
  padding: 16px 0;
}

.mobile-header {
  text-align: center;
  margin-bottom: 24px;
  padding: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  color: white;
}

.mobile-header p {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.page-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.page-category {
  background: #ffffff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  border: 1px solid #e2e8f0;
}

.page-category h3 {
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  text-align: center;
  padding-bottom: 12px;
  border-bottom: 2px solid #e2e8f0;
}

.page-buttons {
  display: grid;
  gap: 12px;
}

.page-btn {
  display: flex;
  align-items: center;
  padding: 16px;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.page-btn:hover,
.page-btn:active {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.page-icon {
  font-size: 24px;
  margin-right: 16px;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #f8fafc;
}

.page-title {
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 4px;
  display: block;
}

.page-desc {
  font-size: 13px;
  color: #64748b;
  display: block;
}

.page-btn .page-title,
.page-btn .page-desc {
  flex: 1;
}

/* Color coding for different page types */
.fuel-page {
  border-left: 4px solid #2563eb;
}

.fuel-page:hover {
  border-color: #2563eb;
  background: #f0f9ff;
}

.fuel-page .page-icon {
  background: #dbeafe;
  color: #2563eb;
}

.safety-page {
  border-left: 4px solid #dc2626;
}

.safety-page:hover {
  border-color: #dc2626;
  background: #fef2f2;
}

.safety-page .page-icon {
  background: #fee2e2;
  color: #dc2626;
}

.settings-page {
  border-left: 4px solid #059669;
}

.settings-page:hover {
  border-color: #059669;
  background: #f0fdf4;
}

.settings-page .page-icon {
  background: #dcfce7;
  color: #059669;
}

/* Mobile-specific optimizations */
@media (max-width: 768px) {
  .desktop-view {
    display: none !important;
  }
  
  .mobile-view {
    display: block !important;
  }
  
  .container {
    padding: 8px;
  }
  
  .container h1 {
    font-size: 20px;
    text-align: center;
    margin: 16px 0 20px 0;
    color: #1e293b;
  }
  
  .mobile-page-selection {
    padding: 0;
  }
  
  .mobile-header {
    margin: 0 4px 20px 4px;
    padding: 20px 16px;
  }
  
  .mobile-header p {
    font-size: 16px;
  }
  
  .page-grid {
    gap: 20px;
    padding: 0 4px;
  }
  
  .page-category {
    padding: 16px;
    border-radius: 12px;
  }
  
  .page-category h3 {
    font-size: 16px;
    margin-bottom: 12px;
  }
  
  .page-buttons {
    gap: 10px;
  }
  
  .page-btn {
    padding: 16px 12px;
    min-height: 72px;
    border-radius: 10px;
  }
  
  .page-icon {
    font-size: 20px;
    width: 36px;
    height: 36px;
    margin-right: 12px;
    border-radius: 8px;
  }
  
  .page-title {
    font-size: 15px;
    line-height: 1.3;
    margin-bottom: 2px;
  }
  
  .page-desc {
    font-size: 12px;
    line-height: 1.3;
  }
  
  /* Enhanced touch feedback */
  .page-btn:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }
  
  /* Animation for page buttons */
  .page-btn {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
  }
  
  .page-btn:nth-child(1) { animation-delay: 0.1s; }
  .page-btn:nth-child(2) { animation-delay: 0.2s; }
  .page-btn:nth-child(3) { animation-delay: 0.3s; }
  .page-btn:nth-child(4) { animation-delay: 0.4s; }
  
  @keyframes fadeInUp {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* Tablet optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
  .desktop-view {
    display: block !important;
  }
  
  .mobile-view {
    display: none !important;
  }
}

/* Desktop optimizations */
@media (min-width: 1025px) {
  .desktop-view {
    display: block !important;
  }
  
  .mobile-view {
    display: none !important;
  }
}

/* Accessibility improvements */
.page-btn:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.page-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* Loading state for mobile buttons */
.page-btn.loading {
  opacity: 0.6;
  pointer-events: none;
}

.page-btn.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 16px;
  width: 16px;
  height: 16px;
  border: 2px solid #e2e8f0;
  border-top: 2px solid #2563eb;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Enhanced visual hierarchy */
.page-category:nth-child(1) {
  border-top: 3px solid #2563eb;
}

.page-category:nth-child(2) {
  border-top: 3px solid #dc2626;
}

.page-category:nth-child(3) {
  border-top: 3px solid #059669;
}

/* Mobile navigation hints */
@media (max-width: 768px) {
  .mobile-header::after {
    content: "👆 แตะเพื่อเลือกหน้าที่ต้องการ";
    display: block;
    margin-top: 8px;
    font-size: 14px;
    opacity: 0.9;
    font-weight: 400;
  }
}

/* Login Page Styles */
.login-body {
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 20px;
}

.login-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  padding: 40px;
  text-align: center;
}

.login-header h1 {
  color: #1f2937;
  margin: 0 0 10px 0;
  font-size: 28px;
  font-weight: 700;
}

.login-header h2 {
  color: #6b7280;
  margin: 0 0 30px 0;
  font-size: 16px;
  font-weight: 400;
}

.login-form {
  text-align: left;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #374151;
  font-weight: 500;
  font-size: 14px;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #ffffff;
}

.form-group input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-login {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-login:hover:not(:disabled) {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.btn-login:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  width: 100%;
  padding: 12px;
  background: #6b7280;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: #4b5563;
}

.spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.message {
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 500;
}

.message.success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.message.error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.message.info {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

.login-footer {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}

.login-footer p {
  color: #6b7280;
  font-size: 14px;
  margin: 0;
}

/* Logout Button Styles */
.btn-logout {
  background: #dc2626 !important;
  color: white !important;
  border: none !important;
  padding: 8px 16px !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  transition: all 0.2s !important;
  white-space: nowrap !important;
  display: inline-block !important;
  text-decoration: none !important;
}

.btn-logout:hover {
  background: #b91c1c !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.3) !important;
}

/* Mobile responsive สำหรับ user info */
@media (max-width: 768px) {
  .user-info {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
  
  .btn-logout {
    width: 100%;
    min-height: 44px; /* Touch target */
  }
}

.user-info {
  display: flex !important;
  align-items: center;
  gap: 15px;
  color: #374151;
  font-size: 14px;
  margin: 10px 0;
  padding: 10px 15px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  position: relative;
}

.user-name {
  font-weight: 500;
  color: #1f2937;
}

/* Mobile Login Styles */
@media (max-width: 768px) {
  .login-container {
    padding: 10px;
  }
  
  .login-card {
    padding: 30px 20px;
  }
  
  .login-header h1 {
    font-size: 24px;
  }
  
  .form-group input {
    font-size: 16px; /* Prevent iOS zoom */
  }
  
  .btn-login {
    min-height: 48px; /* Touch target */
  }
}