/* ==========================================================
   Patropas Auto Repair — shared stylesheet
   ========================================================== */

:root {
  --navy:        #0d1521;
  --navy-2:      #182539;
  --carbon:      #0a0e16;
  --orange:      #e8511c;
  --orange-2:    #c63f0c;
  --silver:      #a8aeb8;
  --silver-dk:   #6b6f78;
  --bg:          #f5f3ee;
  --surface:     #ffffff;
  --text:        #0f1620;
  --muted:       #5a5a5a;
  --border:      #e1ddd5;
  --success:     #1b7a3f;
  --warn:        #c98a17;
  --danger:      #b32026;
  --radius:      4px;
  --radius-lg:   8px;
  --shadow-sm:   0 1px 2px rgba(13,21,33,.05);
  --shadow-md:   0 12px 36px rgba(13,21,33,.12);
  --shadow-lg:   0 24px 80px rgba(13,21,33,.18);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--orange-2); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* ---------- Layout ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.section { padding: 96px 0; }
.section.tight { padding: 48px 0; }
.section.dark { background: var(--carbon); color: #fff; }
.section.dark h2 { color: #fff; }
.section.dark .lede, .section.dark p { color: var(--silver); }

/* Small all-caps label that sits above a section heading (premium idiom) */
.section-label {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  letter-spacing: 3.5px; text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 16px;
  position: relative; padding-left: 36px;
}
.section-label::before {
  content: ""; position: absolute; left: 0; top: 50%;
  width: 26px; height: 2px; background: var(--orange);
}
.section.dark .section-label { color: var(--silver); }
.section.dark .section-label::before { background: var(--silver-dk); }
.grid { display: grid; gap: 20px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* ---------- Header / nav ---------- */
.site-header {
  background: var(--carbon);
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.06);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(8px);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 18px; padding-bottom: 18px;
}
.brand {
  display: flex; align-items: center; gap: 14px;
  color: #fff; font-weight: 700; font-size: 17px; letter-spacing: 0.2px;
}
.brand:hover { text-decoration: none; }
.brand img { width: 44px; height: 44px; }
.brand .small {
  display: block; font-size: 10.5px; font-weight: 500;
  color: var(--silver); letter-spacing: 2.2px; text-transform: uppercase;
  margin-top: 2px;
}
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  color: rgba(255,255,255,.78); padding: 10px 16px; border-radius: 2px;
  font-weight: 600; font-size: 12.5px; letter-spacing: 1.4px;
  text-transform: uppercase;
  transition: color .15s ease, background .15s ease;
}
.nav a:hover { color: #fff; background: rgba(255,255,255,.04); text-decoration: none; }
.nav a.active { color: var(--orange); background: transparent; }
.nav .staff-link {
  margin-left: 10px;
  border: 1px solid rgba(255,255,255,.18);
  color: #fff;
}
.nav .staff-link:hover { background: var(--orange); border-color: var(--orange); color: #fff; }

/* Hamburger toggle (hidden by default; shown on small screens) */
.nav-toggle {
  display: none;
  background: transparent; border: none; cursor: pointer;
  padding: 8px;
  flex-direction: column; gap: 5px;
}
.nav-toggle span {
  display: block; width: 24px; height: 2px; background: #fff;
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--orange); color: #fff;
  border: 1px solid var(--orange); cursor: pointer;
  padding: 14px 26px; border-radius: 2px;
  font-size: 12.5px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase;
  text-decoration: none;
  transition: background .2s ease, border-color .2s ease, transform .15s ease;
}
.btn:hover { background: var(--orange-2); border-color: var(--orange-2); text-decoration: none; color:#fff; transform: translateY(-1px); }
.btn.ghost {
  background: transparent; color: #fff;
  border: 1px solid rgba(255,255,255,.4);
}
.btn.ghost:hover { background: #fff; color: var(--navy); border-color: #fff; }
.btn.ghost-dark {
  background: transparent; color: var(--navy); border: 1px solid var(--navy);
}
.btn.ghost-dark:hover { background: var(--navy); color: #fff; }
.btn.sm { padding: 8px 14px; font-size: 11px; letter-spacing: 1px; }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: #8a1a1f; border-color: #8a1a1f; }
.btn.success { background: var(--success); border-color: var(--success); }

/* ---------- Hero ---------- */
.hero {
  background: var(--carbon);
  color: #fff; padding: 140px 0 120px;
  position: relative; overflow: hidden;
  min-height: 80vh; display: flex; align-items: center;
}
/* Blurred photo layer — low-res photo becomes atmospheric texture */
.hero-bg-img {
  position: absolute; inset: -24px; z-index: 0;
  background-size: cover; background-position: center;
  filter: blur(4px) brightness(0.85) saturate(1);
  transform: scale(1.05); /* hides blur-edge fringe */
}
.hero-overlay {
  position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(232,81,28,.08) 0%, transparent 55%),
    linear-gradient(180deg, rgba(10,14,22,.30) 0%, rgba(10,14,22,.72) 100%);
}
.hero::before {
  /* thin orange accent strip on top */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, var(--orange), transparent 60%);
  z-index: 3;
}
.hero::after {
  content: ""; position: absolute; right: -120px; bottom: -120px;
  width: 460px; height: 460px; border-radius: 50%;
  background: radial-gradient(circle, rgba(232,81,28,.18) 0%, transparent 70%);
  z-index: 2;
}
.hero .container { position: relative; z-index: 4; }
.hero .eyebrow {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  letter-spacing: 4px; text-transform: uppercase;
  color: var(--silver); margin-bottom: 22px;
  padding-left: 36px; position: relative;
}
.hero .eyebrow::before {
  content: ""; position: absolute; left: 0; top: 50%;
  width: 26px; height: 2px; background: var(--orange);
}
.hero h1 {
  font-size: clamp(38px, 5.4vw, 62px); margin: 0 0 22px;
  line-height: 1.05; font-weight: 800;
  letter-spacing: -0.02em; max-width: 880px;
}
.hero h1 .accent { color: var(--orange); }
.hero p {
  font-size: 19px; color: rgba(255,255,255,.78); max-width: 640px;
  margin: 0 0 36px; line-height: 1.55;
}
.hero .actions { display: flex; gap: 14px; flex-wrap: wrap; position: relative; z-index: 1; }

/* Image header used on services / about / service-detail pages */
.page-header {
  background: var(--carbon);
  color: #fff; padding: 120px 0 80px;
  position: relative; overflow: hidden;
}
.page-header-bg-img {
  position: absolute; inset: -24px; z-index: 0;
  background-size: cover; background-position: center;
  filter: blur(4px) brightness(0.7) saturate(0.95);
  transform: scale(1.05);
}
.page-header-overlay {
  position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(232,81,28,.10) 0%, transparent 55%),
    linear-gradient(180deg, rgba(10,14,22,.35) 0%, rgba(10,14,22,.80) 100%);
}
.page-header::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, var(--orange), transparent 60%);
  z-index: 3;
}
.page-header .container { position: relative; z-index: 2; }
.page-header .eyebrow {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  letter-spacing: 4px; text-transform: uppercase;
  color: var(--silver); margin-bottom: 18px;
  padding-left: 36px; position: relative;
}
.page-header .eyebrow::before {
  content: ""; position: absolute; left: 0; top: 50%;
  width: 26px; height: 2px; background: var(--orange);
}
.page-header h2 {
  color: #fff;
  font-size: clamp(34px, 4.6vw, 52px);
  margin: 0 0 14px;
  font-weight: 800; letter-spacing: -0.02em; line-height: 1.1;
}
.page-header p { color: rgba(255,255,255,.78); max-width: 720px; margin: 0; font-size: 17px; }

/* Small inline photo strip used inside text-heavy pages */
.photo-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px; margin-top: 24px;
}
.photo-strip a {
  aspect-ratio: 1 / 1; overflow: hidden; border-radius: 4px;
  background: var(--surface); border: 1px solid var(--border);
  transition: transform .25s ease, box-shadow .25s ease;
}
.photo-strip a:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.photo-strip img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow-sm);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  position: relative;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--navy);
}
.card h3 {
  margin: 0 0 10px; color: var(--navy); font-size: 20px;
  font-weight: 700; letter-spacing: -0.01em;
}

/* Card used as a clickable link */
a.card { color: inherit; text-decoration: none; display: block; }
a.card:hover { text-decoration: none; }
a.card .card-arrow {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 16px;
  color: var(--orange); font-size: 12px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  transition: gap .2s ease;
}
a.card:hover .card-arrow { gap: 12px; color: var(--orange-2); }
.card p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.6; }
.card .icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 6px;
  background: var(--carbon); color: var(--orange);
  font-size: 24px; margin-bottom: 18px;
}

/* ---------- Headings ---------- */
.section h2 {
  font-size: clamp(28px, 3.8vw, 44px);
  color: var(--navy); margin: 0 0 16px;
  font-weight: 800; letter-spacing: -0.02em; line-height: 1.1;
}
.section .lede {
  color: var(--muted); font-size: 17px; max-width: 720px;
  margin: 0 0 48px; line-height: 1.6;
}

/* ---------- Forms ---------- */
label { display: block; font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=number], input[type=tel],
input[type=date], input[type=password], select, textarea {
  width: 100%; padding: 9px 11px;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; font-family: inherit;
  background: #fff;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--orange); outline-offset: -1px; border-color: var(--orange);
}
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 14px; }
.form-actions { display: flex; gap: 10px; margin-top: 16px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%; border-collapse: collapse;
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
table.data th, table.data td {
  padding: 11px 14px; text-align: left; font-size: 14px;
  border-bottom: 1px solid var(--border);
}
table.data th {
  background: var(--navy); color: #fff; font-weight: 600; letter-spacing: .3px;
  font-size: 12px; text-transform: uppercase;
}
/* Keep column headers visible while scrolling long ledgers */
table.data thead th { position: sticky; top: 0; z-index: 2; }
table.data tbody tr:hover { background: #fcfaf6; }
table.data tbody tr:last-child td { border-bottom: none; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 12px;
  font-size: 11px; font-weight: 600; letter-spacing: .3px; text-transform: uppercase;
}
.badge.ok      { background: #d6efe0; color: var(--success); }
.badge.warn    { background: #fbedd0; color: #876009; }
.badge.danger  { background: #fad6d8; color: var(--danger); }
.badge.muted   { background: #e9e7e0; color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy); color: #c8d2dc;
  padding: 40px 0 24px; margin-top: 80px;
}
.site-footer .container { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 30px; }
.site-footer h4 { color: #fff; margin: 0 0 12px; font-size: 14px; text-transform: uppercase; letter-spacing: 1px; }
.site-footer a { color: #c8d2dc; }
.site-footer a:hover { color: var(--orange); text-decoration: none; }
.site-footer .copy { grid-column: 1 / -1; border-top: 1px solid #2a4360; padding-top: 16px; font-size: 12px; color: #8a99aa; }

/* ---------- Staff layout ---------- */
.staff-shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.staff-shell aside {
  background: var(--navy); color: #fff; padding: 24px 0;
}
.staff-shell aside .brand { padding: 0 22px 18px; border-bottom: 1px solid #2a4360; margin-bottom: 16px; }
.staff-shell aside nav { display: flex; flex-direction: column; padding: 0 12px; gap: 2px; }
.staff-shell aside nav a {
  color: #c8d2dc; padding: 10px 14px; border-radius: 6px; font-size: 14px;
}
.staff-shell aside nav a:hover { background: var(--navy-2); color: #fff; text-decoration: none; }
.staff-shell aside nav a.active { background: var(--orange); color: #fff; }
.staff-shell aside .logout {
  margin-top: 30px; padding: 0 12px;
}
.staff-shell aside .logout a { color: #ffb39a; font-size: 13px; }
.staff-shell main { padding: 30px 36px; background: var(--bg); }

/* Mobile drawer toggle for the staff sidebar — hidden until small screens */
.staff-nav-toggle { display: none; }
.staff-nav-backdrop { display: none; }
.staff-shell main h1 { color: var(--navy); margin: 0 0 6px; font-size: 26px; }
.staff-shell main .sub { color: var(--muted); margin: 0 0 28px; }

.toolbar { display: flex; gap: 10px; justify-content: space-between; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar .left { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar input[type=text], .toolbar select { width: auto; min-width: 180px; }

.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.stat-card .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .8px; }
.stat-card .value { font-size: 28px; color: var(--navy); font-weight: 700; margin-top: 4px; }
.stat-card .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- Tabs (accounting) ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 24px; flex-wrap: wrap; }
.tabs button {
  background: none; border: none; padding: 10px 18px; font-size: 14px; font-weight: 600;
  color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px;
  font-family: inherit;
}
.tabs button:hover { color: var(--navy); }
.tabs button.active { color: var(--orange); border-bottom-color: var(--orange); }
.acc-section { display: none; }
.acc-section.active { display: block; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(13,34,56,.55);
  display: none; align-items: flex-start; justify-content: center;
  padding: 60px 20px; z-index: 100;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: #fff; border-radius: var(--radius); width: 100%; max-width: 720px;
  padding: 24px 26px; box-shadow: 0 14px 60px rgba(0,0,0,.3);
  max-height: calc(100vh - 120px); overflow-y: auto;
}
.modal h2 { margin: 0 0 16px; color: var(--navy); font-size: 22px; }

/* ---------- Print (invoices/quotes) ---------- */
@media print {
  .site-header, .site-footer, .staff-shell aside, .toolbar, .no-print, .acc-main-ui,
  .modal-backdrop, .staff-nav-toggle, .staff-nav-backdrop { display: none !important; }
  .staff-shell { display: block; }
  .staff-shell main { padding: 0; background: #fff; }
  body { background: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  /* Generated documents print edge-to-edge without the on-screen card chrome */
  .legal-doc { border: none !important; border-radius: 0 !important; padding: 0 !important; max-width: none !important; }
}

/* ---------- Gallery ---------- */
.gallery-item {
  display: block; aspect-ratio: 1 / 1;
  border-radius: var(--radius); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.gallery-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); text-decoration: none; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Round logo treatment in brand */
.brand img, .staff-shell aside .brand img, .login-card .brand img {
  border-radius: 50%; object-fit: cover; background: #fff;
}

/* ---------- Misc ---------- */
.notice {
  background: #fff7e6; border: 1px solid #ffd99c; color: #6a4d10;
  padding: 12px 16px; border-radius: 6px; font-size: 14px;
  margin-bottom: 16px;
}
.empty {
  text-align: center; padding: 60px 20px; color: var(--muted);
  background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius);
}
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

/* ---------- Repair tracking: status banner + timeline ---------- */
.status-banner {
  border-radius: var(--radius-lg); padding: 24px 28px; margin-bottom: 24px;
  border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm);
  border-left: 6px solid var(--silver-dk);
}
.status-banner .status-label { font-size: 24px; font-weight: 800; color: var(--navy); letter-spacing: -0.01em; }
.status-banner .status-msg { color: var(--muted); margin-top: 6px; font-size: 15px; }
.status-banner.s-ok     { border-left-color: var(--success); }
.status-banner.s-warn   { border-left-color: var(--warn); }
.status-banner.s-danger { border-left-color: var(--danger); }
.status-banner.s-muted  { border-left-color: var(--silver-dk); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  position: relative; padding: 0 0 18px 26px; border-left: 2px solid var(--border);
}
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: 2px;
  width: 12px; height: 12px; border-radius: 50%; background: var(--orange);
  border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border);
}
.timeline .t-when { font-size: 12px; color: var(--muted); }
.timeline .t-text { margin-top: 2px; }
.timeline .t-by { font-size: 12px; color: var(--muted); }

/* Chips for signed-on mechanics */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #eef2f6; color: var(--navy); border: 1px solid var(--border);
  padding: 5px 12px; border-radius: 20px; font-size: 13px; font-weight: 600;
}

/* Hide the tagline under the brand on narrow screens so the nav has room */
@media (max-width: 980px) {
  .brand .small { display: none; }
  .brand { font-size: 16px; }
}

/* Mobile nav: hamburger replaces inline links below 820px */
@media (max-width: 820px) {
  .site-header .container { flex-wrap: wrap; }
  .nav-toggle { display: flex; }
  .nav {
    display: none; width: 100%; order: 3;
    flex-direction: column; gap: 2px;
    padding: 10px 0 4px;
    border-top: 1px solid rgba(255,255,255,.08);
    margin-top: 10px;
  }
  .nav.open { display: flex; }
  .nav a { padding: 10px 14px; }
  .nav .staff-link { margin-left: 0; margin-top: 4px; }
}

@media (max-width: 720px) {
  .split { grid-template-columns: 1fr; }
  .hero h1 { font-size: 30px; }

  /* Staff sidebar becomes a slide-in drawer */
  .staff-shell { grid-template-columns: 1fr; }
  .staff-shell aside {
    position: fixed; top: 0; left: 0; bottom: 0; width: 240px; z-index: 120;
    transform: translateX(-100%); transition: transform .25s ease; overflow-y: auto;
  }
  .staff-shell aside.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.45); }
  .staff-shell main { padding: 64px 18px 30px; }

  .staff-nav-toggle {
    display: flex; flex-direction: column; gap: 5px;
    position: fixed; top: 14px; left: 14px; z-index: 130;
    background: var(--navy); border: none; border-radius: 6px;
    padding: 11px 10px; cursor: pointer;
  }
  .staff-nav-toggle span { display: block; width: 22px; height: 2px; background: #fff; transition: transform .2s ease, opacity .2s ease; }
  .staff-nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .staff-nav-toggle.open span:nth-child(2) { opacity: 0; }
  .staff-nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .staff-nav-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(13,21,33,.5); z-index: 110; }
}
