/* ===========================
   Global base styles
   =========================== */

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

html, body {
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #0f172a 0, #020617 45%, #020617 100%);
  color: #e5e7eb;
  min-height: 100vh;
}

a {
  color: #0ea5e9;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

main {
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* ===========================
   System bar
   =========================== */

.system-bar {
  background: linear-gradient(to right, #0f172a, #020617);
  border-bottom: 1px solid rgba(30,64,175,0.8);
  font-size: 11px;
  color: #e5e7eb;
}

.system-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.35rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.system-bar-env {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.12rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(251,191,36,0.8);
  background: rgba(30,64,175,0.6);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #facc15;
}

.system-bar-text {
  color: #cbd5f5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===========================
   Header / navigation
   =========================== */

header {
  border-bottom: 1px solid rgba(15,23,42,0.8);
  background: rgba(15,23,42,0.95);
  backdrop-filter: blur(12px);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 0.9rem;
  background: rgba(14,165,233,0.12);
  color: #0ea5e9;
  border: 1px solid rgba(14,165,233,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.brand-text-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.brand-text-sub {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #9ca3af;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.2rem;
  font-size: 0.85rem;
}

nav a {
  color: #e5e7eb;
}

nav a:hover {
  color: #0ea5e9;
  text-decoration: none;
}

/* ===========================
   Buttons
   =========================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.4);
  background: rgba(15,23,42,0.9);
  color: #e5e7eb;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  border-color: transparent;
  background: #0ea5e9;
  color: #020617;
  box-shadow: 0 0 20px rgba(14,165,233,0.4);
}

.btn-primary:hover {
  background: #38bdf8;
}

.btn:hover {
  border-color: rgba(56,189,248,0.6);
}

/* ===========================
   Generic layout helpers
   =========================== */

.card {
  background: rgba(15,23,42,0.97);
  border-radius: 1.4rem;
  border: 1px solid rgba(30,64,175,0.7);
  padding: 1rem;
  box-shadow: 0 20px 40px rgba(15,23,42,0.9), 0 0 24px rgba(56,189,248,0.15);
}

.section-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.section-sub {
  font-size: 0.85rem;
  color: #9ca3af;
}

.grid {
  display: grid;
  gap: 1rem;
}

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

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

/* ===========================
   Auction cards (used on list pages)
   =========================== */

.auction-card {
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at top, rgba(15,23,42,1), rgba(15,23,42,0.96));
  border-radius: 1.2rem;
  border: 1px solid rgba(30,64,175,0.7);
  overflow: hidden;
  box-shadow: 0 16px 32px rgba(15,23,42,0.9);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  text-decoration: none;
  color: inherit;
}

.auction-card:hover {
  transform: translateY(-3px);
  border-color: rgba(56,189,248,0.8);
  box-shadow: 0 22px 40px rgba(15,23,42,0.95), 0 0 24px rgba(56,189,248,0.2);
}

.auction-thumb {
  position: relative;
  height: 180px;
  background: #020617;
  overflow: hidden;
}

.auction-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge-live {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  padding: 0.18rem 0.55rem;
  font-size: 10px;
  text-transform: uppercase;
  border-radius: 999px;
  background: rgba(22,163,74,0.2);
  color: #bbf7d0;
  border: 1px solid rgba(34,197,94,0.7);
}

.auction-body {
  padding: 0.8rem 0.9rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.auction-title {
  font-size: 0.9rem;
  font-weight: 600;
}

.auction-vin {
  font-size: 0.72rem;
  color: #9ca3af;
}

.auction-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 0.4rem;
}

.auction-price {
  text-align: right;
}

.auction-price-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: #94a3b8;
}

.auction-price-value {
  font-size: 0.9rem;
  color: #0ea5e9;
  font-weight: 600;
}

/* Extra small line on home/sections */
.auction-extra-line {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: #9ca3af;
}

/* ===========================
   Forms
   =========================== */

.form {
  display: grid;
  gap: 0.7rem;
}

.form-row {
  display: grid;
  gap: 0.7rem;
}

.form-row-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  font-size: 0.78rem;
  color: #cbd5f5;
  display: block;
  margin-bottom: 0.18rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="datetime-local"],
input[type="date"],
textarea,
select {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(51,65,85,0.9);
  background: rgba(15,23,42,0.98);
  color: #e5e7eb;
  font-size: 0.8rem;
}

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

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 1px rgba(56,189,248,0.35);
}

/* ===========================
   Tables
   =========================== */

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.7rem;
  font-size: 0.8rem;
}

.table th,
.table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid rgba(30,64,175,0.5);
}

.table th {
  text-align: left;
  font-size: 0.72rem;
  color: #9ca3af;
  text-transform: uppercase;
}

/* ===========================
   Alerts
   =========================== */

.alert {
  margin-bottom: 0.8rem;
  border-radius: 0.9rem;
  padding: 0.5rem 0.7rem;
  font-size: 0.78rem;
}

.alert-success {
  background: rgba(22,163,74,0.12);
  border: 1px solid rgba(34,197,94,0.6);
  color: #bbf7d0;
}

.alert-error {
  background: rgba(248,113,113,0.12);
  border: 1px solid rgba(248,113,113,0.6);
  color: #fecaca;
}

/* ===========================
   Footer
   =========================== */

footer {
  border-top: 1px solid rgba(15,23,42,0.9);
  background: rgba(2,6,23,0.98);
  color: #6b7280;
  font-size: 0.75rem;
  padding: 1rem 1.5rem 1.3rem;
  margin-top: 1rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ===========================
   Trio Tenders search page
   (Pickles-style layout)
   =========================== */

.tt-search-page {
  margin-top: 1.8rem;
  margin-bottom: 3rem;
}

/* Header */

.tt-search-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  margin-bottom: 1.8rem;
}

.tt-search-title-block h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.tt-search-title-block p {
  font-size: 0.9rem;
  color: #cbd5f5;
  max-width: 34rem;
}

.tt-search-stats {
  display: flex;
  gap: 1.2rem;
}

.tt-search-stat {
  text-align: right;
}

.tt-search-stat .value {
  font-size: 1.2rem;
  font-weight: 600;
  color: #0ea5e9;
}

.tt-search-stat .label {
  font-size: 0.78rem;
  color: #9ca3af;
}

/* Main layout: filters + results */

.tt-search-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 2rem;
}

/* Filters sidebar */

.tt-filters {
  background: rgba(15,23,42,0.98);
  border-radius: 1.1rem;
  border: 1px solid rgba(30,64,175,0.8);
  padding: 1.1rem 1.2rem;
  font-size: 0.8rem;
}

.tt-filters-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tt-filter-section h3 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.tt-filter-field label {
  font-size: 0.75rem;
  color: #cbd5f5;
  display: block;
  margin-bottom: 0.15rem;
}

.tt-filter-field input[type="text"],
.tt-filter-field select {
  width: 100%;
}

.tt-filter-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.tt-filter-apply,
.tt-filter-clear {
  width: 100%;
  justify-content: center;
}

.tt-filter-note {
  font-size: 0.72rem;
  color: #9ca3af;
}

/* Results panel */

.tt-results {
  background: rgba(15,23,42,0.97);
  border-radius: 1.1rem;
  border: 1px solid rgba(30,64,175,0.8);
  padding: 1.1rem 1.2rem;
}

.tt-results-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  margin-bottom: 1.1rem;
}

.tt-results-count {
  font-size: 0.9rem;
  font-weight: 500;
}

.tt-results-sub {
  font-size: 0.78rem;
  color: #9ca3af;
  margin-top: 0.15rem;
}

.tt-results-sort {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  font-size: 0.75rem;
  color: #9ca3af;
}

.tt-results-sort select {
  font-size: 0.8rem;
}

/* Result list & cards */

.tt-results-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tt-result-card {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 1rem;
  padding: 0.85rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(30,64,175,0.8);
  background: radial-gradient(circle at top, rgba(15,23,42,1), rgba(15,23,42,0.97));
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.tt-result-card:hover {
  border-color: rgba(56,189,248,0.75);
  box-shadow: 0 18px 32px rgba(15,23,42,0.95), 0 0 20px rgba(56,189,248,0.22);
  transform: translateY(-1px);
}

.tt-result-thumb {
  border-radius: 0.8rem;
  overflow: hidden;
  background: #020617;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tt-result-thumb img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.tt-result-no-photo {
  font-size: 0.8rem;
  color: #9ca3af;
}

.tt-result-main {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.tt-result-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.tt-result-top h2 {
  font-size: 0.98rem;
  font-weight: 600;
}

.tt-result-price {
  font-size: 1rem;
  font-weight: 600;
  color: #0ea5e9;
}

.tt-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  font-size: 0.78rem;
  color: #9ca3af;
}

.tt-result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.1rem;
}

.tt-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  border: 1px solid rgba(148,163,184,0.7);
}

.tt-tag-live {
  border-color: rgba(34,197,94,0.8);
  color: #bbf7d0;
}

.tt-tag-brand {
  border-color: rgba(56,189,248,0.8);
  color: #bae6fd;
}

.tt-result-footer {
  margin-top: 0.25rem;
  font-size: 0.78rem;
  color: #0ea5e9;
}

.tt-results-empty {
  font-size: 0.85rem;
  color: #9ca3af;
}

/* ===========================
   Responsive
   =========================== */

@media (max-width: 900px) {
  .nav-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.7rem;
  }
}

@media (max-width: 1000px) {
  .tt-search-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 700px) {
  .tt-search-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .tt-search-stats {
    gap: 1rem;
  }

  .tt-result-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .tt-result-thumb img {
    height: 180px;
  }

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