:root {
  --ink: #172027;
  --muted: #687783;
  --line: #d9e2e8;
  --bg: #f1f5f7;
  --surface: #ffffff;
  --soft: #f8fafb;
  --unit4: #f4721e;
  --unit4-dark: #2b1f16;
  --blue: #237c9b;
  --green: #16845c;
  --amber: #c27b1b;
  --red: #a73a31;
  --deep: #2b1f16;
  --car-tint: #fff2e9;
  --service-tint: #eaf6fb;
  --place-tint: #eaf7ef;
  --queue-tint: #fff7e8;
  --bay-tint: #edf8f2;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 56px;
  border: 0;
  border-radius: 8px;
  background: var(--unit4);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  padding: 0 18px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

input:not([type="checkbox"]):not([type="radio"]),
select {
  width: 100%;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 18px;
  padding: 12px 14px;
}

input:focus,
select:focus {
  border-color: var(--unit4);
  box-shadow: 0 0 0 4px rgba(244, 114, 30, 0.14);
  outline: none;
}

input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  padding: 0;
  vertical-align: middle;
}

label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.app-shell {
  min-height: 100vh;
}

.eyebrow {
  color: var(--unit4);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.primary-action {
  background: var(--unit4);
}

.ghost-button {
  background: #e8eef2;
  color: var(--ink);
}

.form-error {
  color: var(--red);
  font-weight: 900;
}

.success-message {
  background: #e8f6ef;
  border: 1px solid #b9dfcd;
  border-radius: 8px;
  color: #0f6848;
  font-weight: 900;
  padding: 14px;
}

/* Nav bar */
.nav-bar {
  background: var(--deep);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  /* anchor for mobile dropdown */
  isolation: isolate;
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  height: 56px;
  max-width: 1200px;
  margin: 0 auto;
}

.nav-logo {
  height: 28px;
  display: block;
  filter: brightness(0) invert(1); /* dark logo → white on dark nav bar */
}

.nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav-links a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
}

.nav-links a:hover,
.nav-links a.active {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.nav-user {
  font-size: 14px;
  color: rgba(255,255,255,0.75);
}

.btn-ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  min-height: 36px;
  font-size: 13px;
  padding: 0 12px;
}

.btn-ghost:hover {
  background: rgba(255,255,255,0.1);
}

/* Admin sidebar navigation */
.nav-bar.admin-nav-bar {
  background: #222d32;
  bottom: 0;
  color: #c2c7d0;
  left: 0;
  overflow-y: auto;
  position: fixed;
  top: 0;
  width: 250px;
  z-index: 100;
}

.admin-app-shell {
  margin-left: 250px;
  min-height: 100vh;
}

.admin-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-sidebar-brand {
  align-items: center;
  background: #1a2226;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  color: #fff;
  display: flex;
  gap: 10px;
  min-height: 58px;
  padding: 0 14px;
  text-decoration: none;
}

.admin-brand-mark {
  align-items: center;
  background: var(--unit4);
  border-radius: 4px;
  color: #fff;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 900;
  height: 32px;
  justify-content: center;
  width: 36px;
}

.admin-sidebar-brand span:last-child,
.admin-sidebar-user span:last-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.admin-sidebar-brand strong,
.admin-sidebar-user strong {
  font-size: 14px;
  line-height: 1.1;
}

.admin-sidebar-brand small,
.admin-sidebar-user small {
  color: #8fa0ad;
  font-size: 11px;
}

.admin-sidebar-user {
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  gap: 10px;
  padding: 14px;
}

.admin-user-avatar {
  align-items: center;
  background: #3c8dbc;
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 900;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.admin-sidebar-nav {
  display: grid;
  gap: 2px;
  padding: 10px 0;
}

.admin-nav-section-header {
  align-items: center;
  background: transparent;
  border: none;
  color: #6f7f8b;
  cursor: pointer;
  display: flex;
  font-size: 11px;
  font-weight: 900;
  justify-content: space-between;
  letter-spacing: 0.04em;
  margin: 14px 14px 6px;
  padding: 0;
  text-transform: uppercase;
  width: calc(100% - 28px);
}

.admin-nav-chevron {
  transition: transform 0.15s ease;
}

.admin-nav-chevron.collapsed {
  transform: rotate(-90deg);
}

.admin-sidebar-nav a {
  align-items: center;
  border-left: 3px solid transparent;
  color: #c2c7d0;
  display: flex;
  gap: 10px;
  min-height: 40px;
  padding: 8px 14px 8px 11px;
  text-decoration: none;
}

.admin-sidebar-nav a:hover,
.admin-sidebar-nav a.active {
  background: #1e282c;
  border-left-color: var(--unit4);
  color: #fff;
}

.admin-nav-icon {
  color: #dce3e8;
  flex: 0 0 auto;
  height: 18px;
  width: 18px;
}

.admin-sidebar-nav a.active .admin-nav-icon,
.admin-sidebar-nav a:hover .admin-nav-icon {
  color: #fff;
}

.admin-sidebar-logout {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 4px;
  color: #c2c7d0;
  font-size: 13px;
  font-weight: 800;
  margin: auto 14px 14px;
  min-height: 36px;
  padding: 0 12px;
}

.admin-sidebar-logout:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

/* ── Hamburger button (hidden on desktop) ── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: transparent;
  border: none;
  min-height: 0;
  padding: 8px;
  cursor: pointer;
  width: 40px;
  height: 40px;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(255,255,255,0.85);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

/* X icon when open */
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile dropdown panel ── */
.nav-mobile-dropdown {
  display: none;
  position: absolute;
  top: 56px; /* nav-bar height */
  left: 0;
  right: 0;
  background: var(--deep);
  z-index: 99;
  border-top: 1px solid rgba(255,255,255,0.07);
  box-shadow: 0 8px 24px rgba(0,0,0,0.28);
  flex-direction: column;
}

.nav-mobile-dropdown.open { display: flex; }

.nav-mobile-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.nav-mobile-avatar {
  width: 34px;
  height: 34px;
  background: var(--unit4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 900;
  color: #fff;
  flex-shrink: 0;
}

.nav-mobile-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.nav-mobile-dropdown a {
  display: block;
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 600;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.nav-mobile-dropdown a:hover,
.nav-mobile-dropdown a:active {
  background: rgba(255,255,255,0.07);
  color: #fff;
}

.nav-mobile-signout {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  padding: 14px 18px;
  min-height: 0;
  cursor: pointer;
  margin-top: 4px;
}

.nav-mobile-signout:hover { color: #fff; }

/* Backdrop behind dropdown */
.nav-mobile-backdrop {
  display: none;
  position: fixed;
  inset: 56px 0 0 0;
  z-index: 98;
  background: rgba(0,0,0,0.35);
}

/* ── Mobile breakpoint ── */
@media (max-width: 640px) {
  /* Hide desktop links and sign-out */
  .nav-links-desktop  { display: none; }
  .nav-desktop-signout { display: none; }
  .nav-user           { display: none; }

  /* Show hamburger */
  .nav-hamburger { display: flex; }

  /* Show backdrop when menu is open */
  .nav-mobile-backdrop { display: block; }

  /* Keep nav bar a single row */
  .nav-inner { height: 56px; }
}

@media (max-width: 760px) {
  .nav-bar.admin-nav-bar {
    position: static;
    width: 100%;
  }

  .admin-app-shell {
    margin-left: 0;
  }

  .admin-sidebar {
    min-height: 0;
  }

  .admin-sidebar-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 8px;
  }

  .admin-sidebar-nav p {
    grid-column: 1 / -1;
    margin: 8px 6px 4px;
  }

  .admin-sidebar-nav a {
    border-left: 0;
    border-radius: 4px;
    padding: 8px;
  }

  .admin-sidebar-logout {
    margin: 8px;
  }
}
