/* Base layout */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background-color: #f9fafb; min-height: 100vh; padding: 2rem 1rem; }
.container { max-width: 1200px; margin: 0 auto; }

/* Cards & headings */
.card { background: white; border-radius: 12px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); margin-bottom: 2rem; }
.card-header { padding: 1.5rem; border-bottom: 1px solid #e5e7eb; background: #3b82f6; color: white; border-radius: 12px 12px 0 0; }
.card-body { padding: 1.5rem; }
h1 { font-size: 1.5rem; font-weight: 700; }
h2 { font-size: 1.125rem; font-weight: 600; margin-bottom: 1rem; color: #374151; }

/* Forms */
.form-group { margin-bottom: 1rem; }
input[type="text"], input[type="password"] { width: 100%; padding: 0.75rem; border: 1px solid #d1d5db; border-radius: 8px; font-size: 1rem; }
input[type="text"]:focus, input[type="password"]:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); }

/* Search form alignment (desktop) */
.search-form { display: flex; gap: 1rem; align-items: flex-end; }
.search-form .form-group { flex: 1; }

/* Buttons */
.btn { padding: 0.75rem 1.5rem; border: none; border-radius: 8px; font-size: 1rem; font-weight: 500; cursor: pointer; text-decoration: none; display: inline-block; }
.btn-primary { background: #3b82f6; color: white; }
.btn-primary:hover:not(:disabled) { background: #2563eb; }
.btn:disabled { background: #9ca3af; cursor: not-allowed; }

/* Alerts */
.alert { padding: 1rem; border-radius: 8px; margin-bottom: 1rem; }
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }

/* Info box */
.client-info { background: #eff6ff; border: 1px solid #dbeafe; padding: 1rem; border-radius: 8px; margin-bottom: 1rem; color: #1e40af; }

/* Table */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.75rem; border-bottom: 1px solid #e5e7eb; }
th { font-weight: 600; color: #374151; background: #f9fafb; }
tr:nth-child(even) { background: #f9fafb; }

/* Left column bold; right column aligned right */
table td:first-child { font-weight: 600; }
table th:nth-child(2), table td:nth-child(2) { text-align: right; font-variant-numeric: tabular-nums; }

/* Values: keep same font as rest of table (no typewriter look) */
.currency { font-family: inherit; font-weight: 400; }

/* Status box */
.status-box { margin-top: 1rem; padding: 0.75rem; background: #f3f4f6; border-radius: 8px; font-size: 0.875rem; }
.status-info { display: flex; justify-content: space-between; align-items: center; }
.status-limited { color: #dc2626; margin-top: 0.5rem; }
.status-note { margin-top: 0.5rem; color: #6b7280; }

/* Footer */
.footer { text-align: center; color: #6b7280; margin-top: 2rem; font-size: 0.875rem; }

/* Mobile improvements for search form */
@media (max-width: 768px) {
  .search-form { flex-direction: column; align-items: stretch; }
  .search-form .form-group { margin-bottom: 0.75rem; }
  .search-form .btn, .search-form button { width: 100%; }
}

/* Subtle header emphasis for table header row */
thead th {
  background: rgba(59, 130, 246, 0.06); /* gentle blue tint */
  color: #1f2937;                       /* slightly darker text */
  font-size: 1.2rem;                    /* your chosen size */
  font-weight: 600;                     /* confidently bold */
  border-bottom: 2px solid #dbeafe;     /* a touch thicker divider */
}

/* Slightly smaller body rows (keeps header at 1.2rem) */
.table-container tbody td { font-size: 0.9rem; line-height: 1.35; }

/* ==== Price card header layout ==== */
.price-header { display: flex; align-items: center; gap: 1rem; }
.price-header .header-text { flex: 1 1 auto; min-width: 0; }
.price-header .header-image { margin-left: auto; flex: 0 0 auto; }
.price-header .header-image img { display: block; width: auto; max-height: 72px; margin: 0; border-radius: 8px; }

/* Bigger vehicle photo on larger screens */
@media (min-width: 1024px) { .price-header .header-image img { max-height: 140px; } }
@media (min-width: 768px) and (max-width: 1023.98px) { .price-header .header-image img { max-height: 110px; } }

/* Compact spec row under the ID */
.header-meta {
  margin-top: .4rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: .35rem 1rem;
  font-size: .95rem;
}
.header-meta .k { font-weight: 600; opacity: .9; }
.header-meta .v { font-weight: 500; opacity: 1; }

/* Ensure good contrast on the blue header */
.card-header, .card-header h1, .header-meta .k, .header-meta .v, .vehicle-id { color: #fff; }

/* Tablet: specs to 2 columns */
@media (max-width: 1023.98px) {
  .header-meta { grid-template-columns: 1fr 1fr; }
}

/* Small screens: stack header; image below; let image grow */
@media (max-width: 768px) {
  .price-header { flex-direction: column; align-items: flex-start; }
  .price-header .header-image { margin-left: 0; align-self: stretch; width: 100%; }
  .price-header .header-image img {
    display: block;
    width: 100%;      /* fill header width */
    height: auto;     /* keep aspect ratio */
    max-height: none; /* don't cap on mobile */
  }
}

/* Very small screens: one property per line */
@media (max-width: 560px) {
  .header-meta { grid-template-columns: 1fr; font-size: .9rem; }
}
/* Client info layout + mobile-friendly logout */
.client-info{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}
.client-logout{margin-left:auto}
.logout-link{color:#dc2626;text-decoration:none;font-size:.875rem;padding:.25rem .5rem;border-radius:6px;line-height:1.2}
.logout-link:hover{text-decoration:underline}
@media (max-width:640px){
  .client-logout{width:100%;margin-left:0;text-align:right}
  .logout-link{display:inline-block}
}
/* Keep lock + text together; allow whole link to move to next line */
.logout-link{display:inline-flex;align-items:center;gap:.35rem;white-space:nowrap;color:#dc2626;text-decoration:none;font-size:.875rem;padding:.25rem .5rem;border-radius:6px;line-height:1.2}
.logout-link:hover{text-decoration:underline}

/* Mask pincode characters while keeping numeric keypad */
.pin-input { -webkit-text-security: disc; letter-spacing: 0.12em; }

/* Status box: wrap nicely on small widths */
.status-info{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}
.status-info>span{white-space:nowrap}                  /* keep each span atomic */
.status-info>span:first-child{flex:1 1 auto;min-width:0}
.status-info>span:last-child{flex:0 0 auto;margin-left:auto}
@supports (min-width:max-content){.status-info>span:last-child{min-width:max-content}}
@media (max-width:480px){.status-info>span:last-child{flex-basis:100%;margin-left:0;text-align:left}}

/* Login screen spacing: more space above the form and between label/input */
.card .card-body > p + form { margin-top: 1.25rem; }                     /* space between the intro <p> and the form */
.card .card-body form label[for="pincode"] { display:block; margin-bottom: .625rem; }  /* space between label and input */

/* (Optional) a touch more breathing room on very small phones */
@media (max-width: 480px){
  .card .card-body > p + form { margin-top: 1.5rem; }
  .card .card-body form label[for="pincode"] { margin-bottom: .75rem; }
}
/* Page title: keep client name inline on desktop; move to its own line on mobile */
.card-header h1{display:flex;align-items:baseline;gap:.35rem;flex-wrap:wrap}
.card-header h1 .heading-client{font-weight:700;overflow-wrap:anywhere}
@media (max-width:640px){
  .card-header h1{display:block}
  .card-header h1 .heading-client{display:block;margin-top:.15rem}
}
/* Make + model wrap together to next line only if needed */
.price-title{display:flex;flex-wrap:wrap;gap:.35rem;align-items:baseline}
.price-title .label{flex:0 0 auto}
.price-title .mm{flex:1 1 auto;white-space:nowrap;min-width:0}

/* Label bold, make/model normal, and wrap as needed on mobile */
.price-title{display:flex;flex-wrap:wrap;gap:.35rem;align-items:baseline;font-weight:400}
.price-title .label{font-weight:700}
.price-title .mm{font-weight:400;white-space:nowrap;min-width:0}
