/* ============================================================
   SourceMyParts — Responsive CSS
   Mobile-first, breakpoints: sm=480, md=768, lg=1024, xl=1280
   ============================================================ */

/* ── Reset & Variables ────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green-primary: #1f7a36;
  --green:       #1a6b2a;
  --green-dark:  #145222;
  --green-light: #e8f5eb;
  --green-mid:   #2d8a40;
  --text:        #1a1a1a;
  --text-gray:   #6b7280;
  --border:      #e5e7eb;
  --white:       #ffffff;
  --bg:          #f9fafb;
  --red:         #dc2626;
  --orange:      #f59e0b;
  --blue:        #3b82f6;
  --purple:      #8b5cf6;
  --nav-h:       60px;
  --sidebar-w:   240px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--white);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a   { text-decoration: none; color: inherit; }

/* ── Utility ──────────────────────────────────────────────── */
.hidden   { display: none !important; }
.flex     { display: flex; }
.grid     { display: grid; }
.w-full   { width: 100%; }
.text-gray{ color: var(--text-gray); }
.text-green{ color: var(--green); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-sm  { font-size: 13px; }
.text-xs  { font-size: 12px; }
.mt-4 { margin-top:16px; } .mt-6 { margin-top:24px; }
.mb-4 { margin-bottom:16px; } .mb-6 { margin-bottom:24px; }
.gap-2 { gap:8px; } .gap-3 { gap:12px; } .gap-4 { gap:16px; }
.items-center { align-items:center; }
.justify-between { justify-content:space-between; }
.text-center { text-align:center; }
.truncate { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* ── Navbar ───────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  height: var(--nav-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.navbar-brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 18px; color: var(--text);
  flex-shrink: 0;
}
.navbar-brand .logo-icon {
  width: 34px; height: 34px;
  background: var(--green); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 16px;
}
.navbar-brand .green { color: var(--green); }

/* Desktop nav links — hidden on mobile */
.navbar-nav {
  display: none;
  list-style: none; gap: 24px;
}
.navbar-nav a {
  font-size: 14px; font-weight: 500; color: var(--text-gray);
  transition: color .2s; white-space: nowrap;
}
.navbar-nav a:hover, .navbar-nav a.active { color: var(--text); }
.navbar-nav a.active { border-bottom: 2px solid var(--green); padding-bottom: 2px; }

.navbar-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* Hamburger */
.hamburger {
  display: flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 36px; height: 36px; cursor: pointer; padding: 4px;
  background: none; border: none;
}
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--text); border-radius: 2px; transition: all .3s;
}

/* Mobile drawer */
.mobile-nav {
  display: none;
  position: fixed; top: var(--nav-h); left: 0; right: 0; bottom: 0;
  background: var(--white); z-index: 199;
  overflow-y: auto; padding: 16px;
  border-top: 1px solid var(--border);
}
.mobile-nav.open { display: block; }
.mobile-nav ul { list-style: none; }
.mobile-nav ul li a {
  display: block; padding: 14px 8px;
  border-bottom: 1px solid var(--border);
  font-size: 16px; font-weight: 500; color: var(--text);
}
.mobile-nav .mobile-actions {
  display: flex; flex-direction: column; gap: 10px; margin-top: 20px;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 8px;
  font-weight: 600; font-size: 14px; cursor: pointer;
  border: none; transition: all .2s; text-decoration: none;
  white-space: nowrap;
}
.btn-primary  { background: var(--green); color: white; }
.btn-primary:hover { background: var(--green-dark); }
.btn-outline  { background: transparent; border: 1.5px solid var(--green); color: var(--green); }
.btn-outline:hover { background: var(--green-light); }
.btn-outline-gray { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline-gray:hover { background: var(--bg); }
.btn-danger   { background: var(--red); color: white; }
.btn-sm  { padding: 6px 12px; font-size: 12px; }
.btn-lg  { padding: 13px 26px; font-size: 15px; }
.btn-block { width: 100%; }

/* ── Alerts ───────────────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: 8px;
  font-size: 14px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
}
.alert-success { background: var(--green-light); color: var(--green); border: 1px solid rgba(26,107,42,.2); }
.alert-error   { background: #fef2f2; color: var(--red); border: 1px solid rgba(220,38,38,.2); }
.alert-info    { background: #eff6ff; color: #1d4ed8; border: 1px solid rgba(29,78,216,.2); }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: white; border: 1px solid var(--border);
  border-radius: 12px; padding: 16px;
  transition: box-shadow .2s;
}
.card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.07); }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge-green  { background: var(--green-light); color: var(--green); }
.badge-blue   { background: #eff6ff; color: #1d4ed8; }
.badge-orange { background: #fffbeb; color: #92400e; }
.badge-red    { background: #fef2f2; color: var(--red); }
.badge-gray   { background: #f3f4f6; color: #4b5563; }
.badge-purple { background: #f5f3ff; color: #6d28d9; }

/* ── Forms ────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; font-size: 13px; font-weight: 600;
  margin-bottom: 6px; color: var(--text);
}
.form-group label .required { color: var(--red); margin-left: 2px; }

.form-control {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 14px; color: var(--text); background: white;
  transition: border-color .15s; font-family: inherit;
  -webkit-appearance: none; appearance: none;
}
.form-control:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(26,107,42,.1); }
.form-control.is-invalid { border-color: var(--red); }
.form-error { font-size: 12px; color: var(--red); margin-top: 4px; }

.form-row { display: grid; grid-template-columns: 1fr; gap: 0; }

/* Upload area */
.upload-area {
  border: 2px dashed var(--border); border-radius: 10px;
  padding: 24px; text-align: center; cursor: pointer; transition: all .2s;
}
.upload-area:hover { border-color: var(--green); background: var(--green-light); }
.upload-area .upload-icon { font-size: 28px; margin-bottom: 8px; color: var(--green); }
.upload-area p { font-size: 13px; color: var(--text-gray); }
.upload-area strong { color: var(--green); }

/* Toggle */
.toggle { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #ccc; border-radius: 12px; transition: .3s;
}
.toggle-slider:before {
  content: ''; position: absolute;
  height: 18px; width: 18px; left: 3px; bottom: 3px;
  background: white; border-radius: 50%; transition: .3s;
}
.toggle input:checked + .toggle-slider { background: var(--green); }
.toggle input:checked + .toggle-slider:before { transform: translateX(20px); }
.toggle-wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.toggle-wrap:last-child { border-bottom: none; }
.toggle-label { font-size: 14px; display: flex; align-items: center; gap: 8px; }

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  padding: 40px 16px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 28px;
}
.hero-content { width: 100%; }
.hero h1 { font-size: 32px; font-weight: 700; line-height: 1.2; margin-bottom: 14px; }
.hero h1 .green { color: var(--green); }
.hero p { color: var(--text-gray); font-size: 15px; margin-bottom: 22px; }
.hero-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-features { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.hero-feature { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; }
.hero-feature .icon {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--green-light); display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}
.hero-image { display: none; }

/* Search bar */
.search-bar { background: var(--green); padding: 24px 16px; }
.search-bar h3 { color: white; font-size: 15px; margin-bottom: 14px; font-weight: 600; }
.search-form { display: flex; flex-direction: column; gap: 10px; }
.search-form .form-group { flex: 1; margin-bottom: 0; }
.search-form label { color: rgba(255,255,255,.8); font-size: 12px; margin-bottom: 6px; display: block; }
.search-form select, .search-form input[type="text"] {
  width: 100%; padding: 10px 14px;
  border: none; border-radius: 8px; background: white;
  font-size: 14px; color: var(--text); -webkit-appearance: none;
}

/* Stats bar */
.stats-bar {
  background: var(--bg); padding: 24px 16px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
.stat-item { text-align: center; }
.stat-item .num { font-size: 24px; font-weight: 700; }
.stat-item .label { font-size: 12px; color: var(--text-gray); margin-top: 4px; }

/* Footer bar */
.footer-bar {
  background: var(--green); padding: 20px 16px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.footer-item { display: flex; align-items: center; gap: 10px; color: white; }
.footer-item .fi-icon {
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.footer-item .fi-title { font-weight: 700; font-size: 13px; }
.footer-item .fi-sub   { font-size: 11px; opacity: .8; }

/* Sections */
.section { padding: 32px 16px; }
.section-title { font-size: 20px; font-weight: 700; margin-bottom: 8px; }

/* How it works steps */
.how-steps { display: flex; flex-direction: column; gap: 20px; }
.step-item { display: flex; align-items: flex-start; gap: 14px; }
.step-icon {
  width: 48px; height: 48px; background: var(--green-light);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.step-arrow { display: none; }
.step-item h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.step-item p  { font-size: 12px; color: var(--text-gray); }

/* Part cards grid */
.cards-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.part-card img { width: 100%; height: 120px; object-fit: contain; background: var(--bg); border-radius: 8px; margin-bottom: 12px; padding: 8px; }
.part-card h4  { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.part-card .vehicle { color: var(--text-gray); font-size: 12px; margin-bottom: 10px; }
.part-card .price   { font-size: 18px; font-weight: 700; margin-bottom: 12px; }

/* Category grid */
.category-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.category-card {
  border: 1px solid var(--border); border-radius: 12px;
  padding: 20px 12px; text-align: center; cursor: pointer; transition: all .2s;
}
.category-card:hover { border-color: var(--green); background: var(--green-light); }
.category-card .cat-icon { font-size: 32px; margin-bottom: 10px; display: block; }
.category-card h4 { font-size: 13px; font-weight: 600; }

/* Breadcrumb */
.breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 12px 16px; font-size: 12px; color: var(--text-gray);
  border-bottom: 1px solid var(--border);
}
.breadcrumb a { color: var(--text-gray); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb .current { color: var(--green); font-weight: 600; }

/* ── Search Results ───────────────────────────────────────── */
.results-layout { display: flex; flex-direction: column; gap: 20px; padding: 16px; }
.filter-sidebar { background: white; border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.filter-sidebar h3 { font-size: 15px; font-weight: 700; margin-bottom: 16px; }
.filter-group { margin-bottom: 16px; }
.filter-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.checkbox-group { display: flex; flex-direction: column; gap: 8px; }
.checkbox-group label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 400; cursor: pointer; }

.results-main h2 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.results-meta { color: var(--text-gray); font-size: 13px; margin-bottom: 16px; }
.sort-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }

.result-item {
  display: flex; flex-direction: column; gap: 12px;
  border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; margin-bottom: 12px; background: white;
}
.result-item .result-top { display: flex; gap: 12px; align-items: flex-start; }
.result-item .result-top img, .result-item .result-top .result-img {
  width: 64px; height: 64px; object-fit: contain;
  background: var(--bg); border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.result-info h4 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.result-info .vehicle { color: var(--text-gray); font-size: 12px; }
.result-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.result-price { font-size: 20px; font-weight: 700; }

/* ── Part Detail ──────────────────────────────────────────── */
.part-detail-layout { display: flex; flex-direction: column; gap: 24px; padding: 16px; }
.main-image { border: 1px solid var(--border); border-radius: 12px; padding: 20px; text-align: center; background: var(--bg); margin-bottom: 12px; }
.thumb-row { display: flex; gap: 8px; }
.thumb { width: 60px; height: 60px; border: 2px solid var(--border); border-radius: 8px; padding: 4px; cursor: pointer; }
.thumb.active { border-color: var(--green); }
.part-info h1 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.part-info .vehicle-sub { color: var(--text-gray); font-size: 14px; margin-bottom: 14px; }
.part-info .price { font-size: 28px; font-weight: 700; margin-bottom: 20px; }
.detail-table { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 20px; }
.detail-row { display: flex; padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.detail-row:last-child { border-bottom: none; }
.detail-row .key { color: var(--text-gray); width: 120px; flex-shrink: 0; }
.detail-row .val { font-weight: 500; }
.verified-badge { color: var(--green); font-size: 12px; margin-left: 6px; font-weight: 600; }
.part-actions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.help-box { border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.help-box .help-text h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.help-box .help-text p  { color: var(--text-gray); font-size: 12px; }

/* ── App Layout (sidebar + main) ──────────────────────────── */
.app-layout { display: flex; min-height: calc(100vh - var(--nav-h)); position: relative; }

/* Mobile sidebar overlay */
.sidebar {
  position: fixed; top: var(--nav-h); left: -260px; bottom: 0;
  width: 260px; background: white; border-right: 1px solid var(--border);
  padding: 20px 14px; overflow-y: auto; transition: left .3s; z-index: 150;
}
.sidebar.open { left: 0; }
.sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4);
  z-index: 149;
}
.sidebar-overlay.open { display: block; }

.sidebar-profile { padding: 0 6px 16px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.sidebar-profile .avatar {
  width: 44px; height: 44px; background: var(--text); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: white;
  font-size: 18px; font-weight: 700; margin-bottom: 8px;
}
.sidebar-profile h4 { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.sidebar-profile .email { font-size: 12px; color: var(--text-gray); margin-bottom: 6px; }
.sidebar-profile a { font-size: 13px; color: var(--green); font-weight: 500; }

.sidebar-nav { list-style: none; }
.sidebar-nav li { margin-bottom: 2px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 10px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: var(--text-gray); transition: all .15s;
}
.sidebar-nav a:hover { background: var(--bg); color: var(--text); }
.sidebar-nav a.active { background: var(--green-light); color: var(--green); font-weight: 600; }
.sidebar-nav a.logout { color: var(--red); }
.sidebar-nav a.logout:hover { background: #fef2f2; }
.nav-icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }

/* Main content area */
.main-content { flex: 1; padding: 20px 16px; min-width: 0; }

/* Sidebar toggle button (mobile) */
.sidebar-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 1px solid var(--border);
  border-radius: 8px; background: white; cursor: pointer; font-size: 18px;
  margin-right: 4px;
}

/* ── Admin Sidebar ────────────────────────────────────────── */
.admin-sidebar {
  position: fixed; top: 0; left: -240px; bottom: 0;
  width: var(--sidebar-w); background: #0d1117;
  display: flex; flex-direction: column;
  overflow-y: auto; transition: left .3s; z-index: 150;
}
.admin-sidebar.open { left: 0; }
.admin-logo { padding: 18px 20px 14px; border-bottom: 1px solid rgba(255,255,255,.1); }
.admin-logo h2 { color: white; font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.admin-logo p  { color: rgba(255,255,255,.4); font-size: 11px; margin-top: 2px; }

.admin-main { display: flex; flex-direction: column; min-height: 100vh; }
.admin-main-content { flex: 1; padding: 20px 16px; background: var(--bg); overflow-x: hidden; }

/* Admin top bar */
.admin-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: white; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100; gap: 10px;
}
.admin-topbar h2 { font-size: 16px; font-weight: 700; }
.admin-topbar p  { font-size: 11px; color: var(--text-gray); }

/* ── Dashboard Stats Cards ────────────────────────────────── */
.stats-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.stat-card {
  background: white; border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; display: flex; align-items: center; gap: 12px;
}
.stat-card .stat-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0;
}
.stat-icon.green  { background: var(--green-light); }
.stat-icon.blue   { background: #eff6ff; }
.stat-icon.orange { background: #fffbeb; }
.stat-icon.purple { background: #f5f3ff; }
.stat-icon.red    { background: #fef2f2; }
.stat-card .stat-num   { font-size: 22px; font-weight: 700; line-height: 1; }
.stat-card .stat-label { font-size: 11px; color: var(--text-gray); margin-top: 3px; }
.stat-card .stat-link  { font-size: 12px; color: var(--green); font-weight: 600; margin-top: 6px; display: block; }

/* ── Data Tables ──────────────────────────────────────────── */
.data-table-wrap { background: white; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 20px; }
.data-table-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; gap: 8px;
}
.data-table-header h3 { font-size: 15px; font-weight: 700; }

/* Responsive table: scroll on mobile */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 600px; }
.data-table th {
  text-align: left; padding: 10px 14px; background: var(--bg);
  font-size: 11px; font-weight: 700; color: var(--text-gray);
  text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg); }

.activity-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 500px; }
.activity-table th { text-align: left; padding: 10px 14px; color: var(--text-gray); font-weight: 600; font-size: 12px; border-bottom: 1px solid var(--border); }
.activity-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.activity-table tr:last-child td { border-bottom: none; }
.activity-icon { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }

/* ── Pagination ───────────────────────────────────────────── */
.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px; padding: 16px; }
.page-btn {
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 8px; font-size: 13px;
  cursor: pointer; color: var(--text); background: white; transition: all .15s; text-decoration: none;
}
.page-btn:hover { border-color: var(--green); color: var(--green); }
.page-btn.active { background: var(--green); color: white; border-color: var(--green); }

/* ── Toolbar / Search ─────────────────────────────────────── */
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar-search {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px;
  background: white; flex: 1; min-width: 160px;
}
.toolbar-search input { border: none; outline: none; font-size: 13px; width: 100%; color: var(--text); background: transparent; }
.toolbar select { padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; background: white; }

/* Tab nav */
.tab-nav { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab-btn {
  padding: 10px 14px; font-size: 13px; font-weight: 500; color: var(--text-gray);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  cursor: pointer; background: none; border-top: none; border-left: none; border-right: none;
  transition: all .15s; text-decoration: none; display: inline-block; white-space: nowrap;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--green); border-bottom-color: var(--green); font-weight: 600; }

/* Page headers */
.page-header { margin-bottom: 20px; }
.page-header h1 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.page-header p  { color: var(--text-gray); font-size: 13px; }

/* ── Profile ──────────────────────────────────────────────── */
.profile-layout { display: flex; flex-direction: column; gap: 16px; }
.profile-card { background: white; border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.profile-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.profile-card h3 { font-size: 15px; font-weight: 700; }
.profile-avatar-wrap { position: relative; width: 64px; margin-bottom: 14px; }
.profile-avatar { width: 64px; height: 64px; background: var(--text); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-size: 24px; }
.avatar-edit { position: absolute; bottom: 0; right: 0; width: 22px; height: 22px; background: var(--green); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-size: 10px; cursor: pointer; }
.field-row { margin-bottom: 14px; }
.field-label { font-size: 12px; color: var(--text-gray); margin-bottom: 4px; }
.field-value { font-size: 14px; font-weight: 500; }

/* ── Order Tracking ───────────────────────────────────────── */
.tracking-steps { padding: 4px 0; }
.tracking-step { display: flex; gap: 14px; padding-bottom: 20px; position: relative; }
.tracking-step::before { content: ''; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: var(--border); }
.tracking-step:last-child::before { display: none; }
.tracking-step.done::before { background: var(--green); }
.step-dot { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--border); background: white; display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; z-index: 1; }
.tracking-step.done .step-dot { background: var(--green); border-color: var(--green); color: white; }
.step-content h4 { font-size: 13px; font-weight: 600; }
.step-content .step-time { font-size: 11px; color: var(--text-gray); margin-top: 2px; }
.step-content .step-desc { font-size: 12px; color: var(--text-gray); margin-top: 3px; }

/* ── Order Summary ────────────────────────────────────────── */
.order-summary { background: white; border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.order-summary h3 { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.summary-row { display: flex; justify-content: space-between; font-size: 14px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.summary-row:last-child { border-bottom: none; }
.summary-row.total { font-weight: 700; font-size: 16px; color: var(--green); }
.savings-box { background: var(--green-light); border-radius: 8px; padding: 10px 14px; font-size: 13px; color: var(--green); font-weight: 600; margin-top: 12px; }

/* ── Quote Detail ─────────────────────────────────────────── */
.quote-detail-layout { display: flex; flex-direction: column; gap: 24px; padding: 16px; }
.price-box { background: white; border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.price-box .total-price { font-size: 28px; font-weight: 700; margin-bottom: 4px; }
.price-box .incl-gst { font-size: 12px; color: var(--text-gray); margin-bottom: 14px; }
.price-breakdown { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 14px; }
.price-row { display: flex; justify-content: space-between; padding: 10px 14px; font-size: 13px; border-bottom: 1px solid var(--border); }
.price-row:last-child { border-bottom: none; font-weight: 700; font-size: 14px; color: var(--green); }
.valid-date { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-gray); margin-bottom: 16px; }
.confidence-list { margin-top: 14px; border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.confidence-list h4 { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.confidence-item { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 6px; color: var(--text-gray); }
.confidence-item::before { content: '✓'; color: var(--green); font-weight: 700; }

/* Supplier profile */
.supplier-profile { background: white; border: 1px solid var(--border); border-radius: 12px; padding: 18px; margin-top: 20px; }
.supplier-profile .sup-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.sup-logo { width: 48px; height: 48px; border-radius: 8px; background: #1d4ed8; color: white; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; flex-shrink: 0; }
.stars { color: var(--orange); font-size: 13px; }
.sup-stats { display: flex; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.sup-stat .val { font-size: 14px; font-weight: 700; }
.sup-stat .key { font-size: 11px; color: var(--text-gray); }

/* Message list */
.sup-avatar { width: 40px; height: 40px; border-radius: 8px; background: #1d4ed8; color: white; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); flex-shrink: 0; }

/* Pipeline */
.pipeline { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.pipeline-stage { min-width: 100px; background: white; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; text-align: center; flex-shrink: 0; }
.pipeline-stage .stage-count { font-size: 22px; font-weight: 700; color: var(--green); }
.pipeline-stage .stage-label { font-size: 11px; color: var(--text-gray); margin-top: 4px; }

/* Donut */
.donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.donut-legend { flex: 1; min-width: 120px; }
.donut-legend-item { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-bottom: 6px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* Auth pages */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 24px 16px; }
.auth-card { background: white; border: 1px solid var(--border); border-radius: 16px; padding: 28px 24px; width: 100%; max-width: 420px; }
.auth-logo { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; margin-bottom: 24px; justify-content: center; }
.auth-logo .logo-icon { width: 36px; height: 36px; background: var(--green); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-size: 16px; }
.auth-card h2 { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.auth-card .sub { color: var(--text-gray); font-size: 13px; margin-bottom: 22px; }
.auth-footer { text-align: center; margin-top: 18px; font-size: 13px; color: var(--text-gray); }
.auth-footer a { color: var(--green); font-weight: 600; }

/* Spec table */
.spec-table { width: 100%; font-size: 13px; margin-bottom: 18px; }
.spec-table tr { border-bottom: 1px solid var(--border); }
.spec-table td { padding: 10px 0; }
.spec-table td:first-child { color: var(--text-gray); width: 140px; }
.spec-table td:last-child { font-weight: 500; }

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

/* ── sm: 480px ────────────────────────────────────────────── */
@media (min-width: 480px) {
  .hero h1 { font-size: 36px; }
  .hero-features { flex-direction: row; flex-wrap: wrap; }
  .stats-bar { grid-template-columns: repeat(4, 1fr); }
  .cards-grid { gap: 16px; }
  .category-grid { grid-template-columns: repeat(4, 1fr); }
  .form-row { grid-template-columns: 1fr 1fr; gap: 16px; }
}

/* ── md: 768px ────────────────────────────────────────────── */
@media (min-width: 768px) {
  :root { --nav-h: 64px; }

  .navbar { padding: 0 32px; }
  .navbar-nav { display: flex; }
  .hamburger { display: none; }

  .hero { padding: 48px 48px; flex-direction: row; align-items: center; justify-content: space-between; gap: 32px; }
  .hero-content { max-width: 520px; }
  .hero h1 { font-size: 42px; }
  .hero-image { display: block; }
  .hero-features { flex-direction: row; }

  .search-bar { padding: 28px 48px; }
  .search-form { flex-direction: row; align-items: flex-end; }

  .stats-bar { padding: 28px 48px; }
  .footer-bar { padding: 24px 48px; grid-template-columns: repeat(4, 1fr); }

  .section { padding: 40px 48px; }
  .how-steps { flex-direction: row; align-items: flex-start; gap: 8px; }
  .step-item { flex-direction: column; align-items: center; text-align: center; }
  .step-arrow { display: block; font-size: 18px; color: var(--text-gray); flex-shrink: 0; margin-top: 16px; }

  .results-layout { flex-direction: row; padding: 24px 48px; }
  .filter-sidebar { width: 240px; flex-shrink: 0; height: fit-content; }

  .result-item { flex-direction: row; align-items: center; gap: 16px; }
  .result-item .result-top { flex: 1; }
  .result-item .result-bottom { flex-direction: column; align-items: flex-end; }

  .part-detail-layout { flex-direction: row; padding: 28px 48px; }
  .part-images { width: 380px; flex-shrink: 0; position: sticky; top: 80px; }
  .part-actions { flex-direction: row; }

  /* Sidebar: static on tablet+ */
  .sidebar { position: static; left: 0; width: 240px; min-height: calc(100vh - var(--nav-h)); }
  .sidebar-overlay { display: none !important; }
  .sidebar-toggle { display: none; }

  .main-content { padding: 28px 28px; }

  .admin-sidebar { position: static; left: 0; }
  .admin-main-content { padding: 24px 28px; }

  .stats-cards { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .stat-card .stat-num { font-size: 26px; }

  .profile-layout { display: grid; grid-template-columns: 1fr 1fr; }

  .quote-detail-layout { flex-direction: row; padding: 24px 48px; }
  .breadcrumb { padding: 14px 48px; }
}

/* ── lg: 1024px ───────────────────────────────────────────── */
@media (min-width: 1024px) {
  .navbar { padding: 0 48px; }

  .hero { padding: 56px 80px; }
  .hero h1 { font-size: 48px; }

  .search-bar { padding: 28px 80px; }
  .stats-bar { padding: 32px 80px; }
  .footer-bar { padding: 24px 80px; }
  .section { padding: 48px 80px; }

  .results-layout { padding: 28px 80px; }
  .part-detail-layout { padding: 32px 80px; }
  .quote-detail-layout { padding: 32px 80px; }
  .breadcrumb { padding: 16px 80px; }

  .cards-grid { grid-template-columns: repeat(4, 1fr); }

  .stats-cards { gap: 20px; }
  .main-content { padding: 32px 36px; }
  .admin-main-content { padding: 28px 32px; }
}

/* ── xl: 1280px ───────────────────────────────────────────── */
@media (min-width: 1280px) {
  .stats-cards { gap: 24px; }
}

/* ── Print ────────────────────────────────────────────────── */
@media print {
  .navbar, .sidebar, .admin-sidebar, .footer-bar, footer { display: none; }
  .main-content { padding: 0; }
  .data-table { font-size: 11px; }
}

/* ============================================================
   ADDITIONAL RESPONSIVE FIXES
   ============================================================ */

/* Toolbar forms wrap on mobile */
.data-table-header form { flex-wrap: wrap; }
.data-table-header .toolbar-search { min-width: 140px; }

/* Admin topbar compact on mobile */
@media (max-width: 767px) {
  .admin-topbar h2 { font-size: 14px; }
  .admin-topbar p  { display: none; }
  .stats-cards .stat-num { font-size: 18px; }
  .stats-cards .stat-card { padding: 12px; }
  .stats-cards .stat-icon { width: 36px; height: 36px; font-size: 16px; }

  /* Sidebar profile compact */
  .sidebar-profile h4 { font-size: 13px; }

  /* Page header stack on mobile */
  .page-header { display: block; }

  /* Buttons full width on mobile forms */
  .auth-card .btn-block { font-size: 15px; }

  /* Pipeline scroll */
  .pipeline { -webkit-overflow-scrolling: touch; }

  /* Data table header stack */
  .data-table-header { flex-direction: column; align-items: flex-start; gap: 10px; }

  /* Form row single col on very small screens */
  .form-row { grid-template-columns: 1fr; gap: 0; }

  /* Tabs scroll horizontally */
  .tab-nav { -webkit-overflow-scrolling: touch; }

  /* Part detail image smaller */
  .main-image { height: auto; }

  /* Quote detail image */
  .quote-detail-layout .main-image { height: auto; }

  /* Order summary full width */
  .order-summary { width: 100%; }

  /* Hero badge text */
  .hero-badge { font-size: 11px; }

  /* Footer grid 2-col */
  footer > div { grid-template-columns: 1fr !important; }
}

/* sm breakpoint extras */
@media (min-width: 480px) {
  .form-row { grid-template-columns: 1fr 1fr; gap: 16px; }
  .hero h1 { font-size: 36px; }
  .section-title { font-size: 22px; }
}

/* md breakpoint extras */
@media (min-width: 768px) {
  footer > div:first-child { grid-template-columns: 2fr 1fr 1fr !important; }

  /* Data table header row on medium+ */
  .data-table-header { flex-direction: row; align-items: center; }

  /* Sidebar always visible — hide toggle */
  .sidebar-toggle { display: none !important; }
  .admin-topbar h2 { font-size: 18px; }
  .admin-topbar p  { display: block; }
}

/* lg extras */
@media (min-width: 1024px) {
  footer > div:first-child { grid-template-columns: 2fr 1fr 1fr 1fr !important; }
  .stats-cards .stat-num { font-size: 26px; }
}

/* ── Touch-friendly tap targets ─────────────────────────────── */
@media (hover: none) {
  .btn { min-height: 44px; }
  .sidebar-nav a { min-height: 44px; }
  .page-btn { width: 40px; height: 40px; }
  .tab-btn { padding: 12px 16px; }
  .form-control { font-size: 16px; } /* prevent iOS zoom */
}

/* ── Safe area for notched phones ───────────────────────────── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .footer-bar { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  footer      { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}

/* ── Smooth scrolling on mobile ─────────────────────────────── */
.table-scroll, .pipeline, .tab-nav {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* ── Card hover only on non-touch ───────────────────────────── */
@media (hover: hover) {
  .card:hover        { box-shadow: 0 4px 20px rgba(0,0,0,.08); }
  .category-card:hover { border-color: var(--green); background: var(--green-light); }
  .result-item:hover   { box-shadow: 0 2px 12px rgba(0,0,0,.06); }
}

/* ── Loading state ───────────────────────────────────────────── */
.btn:disabled, .btn[disabled] {
  opacity: .6; cursor: not-allowed; pointer-events: none;
}

/* ── Focus visible for accessibility ────────────────────────── */
.btn:focus-visible,
.form-control:focus-visible,
.sidebar-nav a:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

/* ── Responsive images in cards ─────────────────────────────── */
.part-card .part-img {
  width: 100%; aspect-ratio: 4/3;
  object-fit: contain; background: var(--bg);
  border-radius: 8px; margin-bottom: 12px;
}

/* ── Sticky price box on desktop ────────────────────────────── */
@media (min-width: 768px) {
  .price-box { position: sticky; top: 80px; }
  .part-images { position: sticky; top: 80px; align-self: flex-start; }
}

/* ── Admin sidebar always visible on desktop ─────────────────── */
@media (min-width: 768px) {
  .admin-sidebar {
    position: static !important;
    left: 0 !important;
  }
  .sidebar-overlay { display: none !important; }
  #adminHamburger { display: none !important; }
}
