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

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #f5f4f0;
  --surface: #ffffff;
  --surface2: #f0efe9;
  --border: rgba(0, 0, 0, 0.09);
  --border-md: rgba(0, 0, 0, 0.15);
  --text: #1a1a18;
  --text-2: #6b6b65;
  --text-3: #9b9b94;
  --accent: #2563eb;
  --accent-dim: #dbeafe;
  --accent-txt: #1e40af;
  --danger: #dc2626;
  --danger-dim: #fee2e2;
  --danger-txt: #991b1b;
  --warn-dim: #fef3c7;
  --warn-txt: #92400e;
  --ok-dim: #dcfce7;
  --ok-txt: #166534;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.07), 0 1px 2px rgba(0, 0, 0, 0.05);
  --font: 'DM Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
  --input-h: 38px;
  /* unified input/select height */
}

html,
body {
  height: 100%;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
}

/* Road stripe texture on entire page */
body {
  background-color: #1a1a18;
  background-image: url('/images/road.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

/* Semi-transparent overlay so text stays readable */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(245, 244, 240, 0.88);
  pointer-events: none;
  z-index: 0;
}

/* Everything sits above the overlay */
#app,
#login-screen,
#register-screen,
#forgot-screen {
  position: relative;
  z-index: 1;
}

/* ── App shell ────────────────────────────────────────── */
#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar backdrop ─────────────────────────────────── */
#sidebar-backdrop {
  display: none !important;
  pointer-events: none !important;
  background: none !important;
}

#app.sidebar-open::after {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
  z-index: 45;
  pointer-events: auto;
  cursor: pointer;
}

/* ── Sidebar ──────────────────────────────────────────── */
.sidebar {
  width: 220px !important;
  min-width: 220px !important;
  height: 100vh !important;
  overflow-y: auto !important;
  flex-shrink: 0 !important;
  position: fixed !important;
  left: 0;
  top: 0;
  z-index: 50;
  transform: translateX(-100%);
  transition: transform 0.22s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

#app.sidebar-open .sidebar {
  transform: translateX(0);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

.sidebar-title {
  font-size: 14px;
  font-weight: 600;
}

.sidebar-sub {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 1px;
}

.nav-section {
  padding: 0.4rem 1rem 0.2rem;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-top: 0.4rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 1rem;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-2);
  border-left: 2px solid transparent;
  transition: background 0.1s, color 0.1s;
}

.nav-item svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.65;
}

.nav-item:hover {
  background: var(--surface2);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent-txt);
  border-left-color: var(--accent);
  font-weight: 500;
}

.nav-item.active svg {
  opacity: 1;
}

/* ── Main area ────────────────────────────────────────── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  width: 100%;
}

/* ── Top bar ──────────────────────────────────────────── */
.topbar {
  flex-shrink: 0;
  height: 48px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar.auto-banner {
  background: linear-gradient(90deg, #1e3c72 0%, #2a5298 100%);
  border-bottom: none;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.topbar-title-group {
  min-width: 0;
}

.topbar-title {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-sub {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auto-banner .topbar-title {
  color: #fff;
}

.auto-banner .topbar-sub {
  color: rgba(255, 255, 255, 0.82);
}

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

/* ── Hamburger ────────────────────────────────────────── */
.hamburger-btn {
  width: 32px;
  height: 28px;
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  background: transparent;
  border: none;
  padding: 4px;
  cursor: pointer;
  flex-shrink: 0;
}

.hamburger-btn span {
  display: block;
  width: 100%;
  height: 3px;
  background: var(--text);
  border-radius: 2px;
}

.auto-banner .hamburger-btn span {
  background: #fff;
}

/* ── API status dot (replaces text badge) ─────────────── */
.api-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.3s;
}

.api-dot.online {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
}

.api-dot.offline {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25);
}

.api-dot.connecting {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
}

/* ── User dropdown ────────────────────────────────────── */
.user-dropdown-wrap {
  position: relative;
}

.topbar-user-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 3px 10px 3px 4px;
  cursor: pointer;
  color: #fff;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s;
}

.topbar-user-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.topbar-user-btn .avatar-sm {
  width: 26px;
  height: 26px;
  font-size: 10px;
}

.topbar-username {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 210px;
  background: var(--surface);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.13);
  z-index: 100;
  padding: 10px;
}

.user-dropdown-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 6px;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  font-family: var(--font);
  background: none;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text);
  text-align: left;
  transition: background 0.1s;
}

.user-dropdown-item:hover {
  background: var(--surface2);
}

.user-dropdown-signout {
  color: var(--danger-txt);
}

.user-dropdown-signout:hover {
  background: var(--danger-dim);
}

.avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent-txt);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Scrollable content ───────────────────────────────── */
.main-content-wrapper {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
}

.main-content-wrapper::-webkit-scrollbar {
  width: 7px;
}

.main-content-wrapper::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

.content {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

/* ── Footer ───────────────────────────────────────────── */
.app-footer {
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: #fff !important;
  background: linear-gradient(to right, #1e3c72, #2a5298) !important;
  position: relative;
  overflow: hidden;
}

/* ── Modal ────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

/* ── Auth screens ─────────────────────────────────────── */
#login-screen,
#register-screen,
#forgot-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 72px 24px;
  /* Road background visible through body */
  background: transparent;
  position: relative;
}

.auth-bar {
  position: absolute;
  left: 0;
  width: 100%;
  height: 22px;
  background: linear-gradient(90deg, #1e3c72, #2a5298);
  pointer-events: none;
}

.auth-bar-top {
  top: 0;
}

.auth-bar-bottom {
  bottom: 0;
}

.login-container {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 24px;

  width: min(1000px, calc(100vw - 40px));
  height: min(720px, calc(100vh - 100px));
}


.login-image {
  flex: 1;
  min-width: 0;
}



.login-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}



.login-wrap {
  flex: 1;
  min-width: 0;
  max-width: none;
}


.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1.5rem;
}

.login-logo h1 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.login-logo p {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 1px;
}

.logo-mark {
  width: 40px;
  height: 40px;
  background: var(--accent);
  color: #fff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

.login-links {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
}

.login-links a {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
}

.login-links a:hover {
  text-decoration: underline;
}

.auth-note {
  margin-top: 1rem;
  padding: 10px 12px;
  border: 1px solid var(--border-md);
  border-radius: var(--radius);
  background: var(--surface2);
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-2);
}

/* ── Forms — unified height ───────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 0.875rem;
}

.form-group label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-2);
}

/* ALL inputs/selects same height — the key fix */
input[type=text],
input[type=email],
input[type=password],
input[type=number],
input[type=date],
select,
textarea {
  width: 100%;
  height: var(--input-h);
  padding: 0 10px;
  font-size: 13px;
  font-family: var(--font);
  border: 1px solid var(--border-md);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
  line-height: var(--input-h);
  /* removes browser default extra height on select */
  -webkit-appearance: none;
  appearance: none;
}

/* textarea gets auto height override */
textarea {
  height: auto;
  padding: 8px 10px;
  line-height: 1.5;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
}

input::placeholder {
  color: var(--text-3);
}

/* select arrow */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236b6b65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

.form-error {
  background: var(--danger-dim);
  color: var(--danger-txt);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 12px;
  margin-bottom: 1rem;
}

.form-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #6ee7b7;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 12px;
}

.field-hint {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 3px;
  line-height: 1.4;
}

/* ── Multi-column form grids ──────────────────────────── */
/* 4-column for wide forms (vehicles add, providers add, expenses) */
.form-row-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

/* 2-column for narrower forms */
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

/* ── Buttons ──────────────────────────────────────────── */
.btn {
  padding: 10px 14px;
  min-height: var(--input-h);
  height: auto;
  /* ✅ critical fix */
  font-size: 13px;
  font-family: var(--font);
  font-weight: 500;
  border: 1px solid var(--border-md);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.btn:hover {
  background: var(--surface2);
}

.btn-primary,
button.btn-primary,
a.btn-primary {
  background: linear-gradient(to right, #1e3c72, #2a5298) !important;
  color: #fff !important;
  border: none !important;
}

.btn-primary:hover,
button.btn-primary:hover {
  background: linear-gradient(to right, #355fa3, #3b6ed6) !important;
}

.btn-danger {
  background: var(--danger-dim);
  color: var(--danger-txt);
  border-color: var(--danger);
}

.btn-danger:hover {
  background: #fecaca;
}

.btn-block {
  width: 100%;
  height: 42px;
  margin-top: 8px;
  flex-shrink: 0;
}

.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 11.5px;
}

/* Content buttons blue by default */
.content .btn:not(.btn-danger):not(.btn-logout) {
  background: linear-gradient(to right, #1e3c72, #2a5298);
  color: #fff;
  border: none;
}

.content .btn:not(.btn-danger):not(.btn-logout):hover {
  background: linear-gradient(to right, #355fa3, #3b6ed6);
}

/* ── Cards ────────────────────────────────────────────── */
.card {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(2px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
}

.card-sub {
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--mono);
}

/* ── Metrics ──────────────────────────────────────────── */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 1.25rem;
}

.metric {
  background: var(--surface2);
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
}

.metric-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-2);
  margin-bottom: 6px;
}

.metric-value {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.metric-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 3px;
}

/* ── Tables ───────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

th {
  text-align: left;
  padding: 0 8px 8px 0;
  font-weight: 600;
  font-size: 11.5px;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 9px 8px 9px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: var(--surface2);
}

.mono {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-2);
}

.row-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.table-subline {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 3px;
}

/* ── Badges ───────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-active,
.badge-verified,
.badge-paid {
  background: var(--ok-dim);
  color: var(--ok-txt);
}

.badge-inactive,
.badge-unverified {
  background: var(--surface2);
  color: var(--text-2);
}

.badge-pending,
.badge-warn {
  background: var(--warn-dim);
  color: var(--warn-txt);
}

.badge-refunded,
.badge-overdue,
.badge-error {
  background: var(--danger-dim);
  color: var(--danger-txt);
}

.badge-admin {
  background: #ede9fe;
  color: #4c1d95;
}

.badge-user,
.badge-owner {
  background: var(--accent-dim);
  color: var(--accent-txt);
}

.badge-mechanic,
.badge-staff {
  background: #d1fae5;
  color: #065f46;
}

.badge-viewer {
  background: var(--surface2);
  color: var(--text-2);
}

.badge-enterprise {
  background: #fef3c7;
  color: #78350f;
}

.badge-pro {
  background: var(--accent-dim);
  color: var(--accent-txt);
}

.badge-basic {
  background: var(--surface2);
  color: var(--text-2);
}

/* ── Alerts ───────────────────────────────────────────── */
.alert-list {
  display: flex;
  flex-direction: column;
}

.alert-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.alert-item:last-child {
  border-bottom: none;
}

.alert-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-danger {
  background: var(--danger);
}

.dot-warn {
  background: #f59e0b;
}

.dot-info {
  background: var(--accent);
}

.alert-text {
  font-size: 12.5px;
  font-weight: 500;
}

.alert-sub {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 2px;
}

/* ── Provider rows ────────────────────────────────────── */
.provider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.provider-row:last-child {
  border-bottom: none;
}

.star {
  color: #f59e0b;
  font-size: 12px;
}

.empty-star {
  color: var(--border-md);
  font-size: 12px;
}

/* ── Avatar ───────────────────────────────────────────── */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.av-blue {
  background: var(--accent-dim);
  color: var(--accent-txt);
}

/* ── Grid layouts ─────────────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.grid-2.page-split {
  grid-template-columns: minmax(300px, 1fr) minmax(380px, 1fr);
  align-items: start;
}

/* ── Tabs ─────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.tab {
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-2);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* ── Info rows ────────────────────────────────────────── */
.info-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  min-width: 130px;
  color: var(--text-2);
}

.info-val {
  font-weight: 500;
}

/* ── Utility ──────────────────────────────────────────── */
.loading {
  color: var(--text-3);
  font-size: 13px;
  padding: 2rem;
  text-align: center;
}

.empty-state {
  color: var(--text-3);
  font-size: 13px;
  padding: 2rem;
  text-align: center;
  border: 1px dashed var(--border-md);
  border-radius: var(--radius-lg);
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}

.section-kicker {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 8px;
}

.pager {
  display: flex;
  align-items: center;
  gap: 8px;
}

code {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--surface2);
  padding: 1px 5px;
  border-radius: 4px;
}

.note {
  font-size: 11.5px;
  color: var(--text-2);
  background: var(--surface2);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin-bottom: 12px;
}

/* ── Expense page ─────────────────────────────────────── */
.expense-total-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-top: .75rem;
}

.expense-total-value {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.6px;
  color: var(--accent-txt);
  margin: 4px 0;
}

/* ── Payment filters ──────────────────────────────────── */
.payment-history-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

/* ── Reminder toasts ──────────────────────────────────── */
#reminder-toast-container {
  display: none !important;
}

.reminder-toast {
  background: var(--surface);
  border: 1px solid rgba(220, 38, 38, 0.18);
  border-left: 4px solid var(--danger);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  padding: 12px 12px 10px;
}

.reminder-toast-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.reminder-toast-title,
.reminder-toast-service {
  font-weight: 600;
}

.reminder-toast-vehicle,
.reminder-toast-detail {
  color: var(--text-2);
  font-size: 12px;
  margin-top: 2px;
}

.reminder-toast-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.reminder-toast-close {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--text-2);
  font-size: 18px;
  line-height: 1;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 1100px) {
  .form-row-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 860px) {

  .grid-2,
  .grid-2.page-split {
    grid-template-columns: 1fr;
  }

  .form-row-4,
  .form-row-2 {
    grid-template-columns: 1fr;
  }

  .payment-history-filters {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .payment-history-filters {
    grid-template-columns: 1fr;
  }

  .login-container {
    flex-direction: column;
    align-items: center;
    gap: 18px;
  }

  .login-wrap,

  .login-image {
    flex: 1;
    min-width: 0;
  }



  .login-image {
    flex: 1;
    min-width: 0;
  }



  .login-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }


  .topbar-username {
    display: none;
  }

  #reminder-toast-container {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .app-footer {
    height: 36px;
    font-size: 11px;
  }
}




/* ============================================================================
   Auto-Matic Feature Patch styles
   ============================================================================ */
html,
body {
  min-height: 100%;
}

.auth-screen {
  overflow-y: auto;
  padding: 24px 0;
}

.login-container {
  max-height: none;
}


.login-wrap {
  flex: 1;
  min-width: 0;
  max-width: none;
}


.register-screen .login-wrap,
#register-screen .login-wrap {
  flex: 1;
  min-width: 0;
  max-width: none;
}


.main-content-wrapper {
  background-image: linear-gradient(rgba(245, 244, 240, .82), rgba(245, 244, 240, .88)), url('/images/road.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.feature-bg,
.form-card,
.data-card {
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(2px);
}

.form-group input,
.form-group select,
.form-group textarea {
  min-height: 42px;
}

.form-row-2,
.form-row-3,
.form-row-4 {
  display: grid;
  gap: 12px;
  align-items: end;
}

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

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

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

.equal-form-grid>.card {
  min-height: 220px;
}

.button-align {
  display: flex;
  align-items: end;
}

.compact-table table td,
.compact-table table th {
  padding-top: 8px;
  padding-bottom: 8px;
}

.reminder-toast {
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%);
  bottom: auto !important;
  top: 90px !important;
  max-width: 460px;
}

#reminder-toast-container {
  display: none !important;
}

.sidebar {
  display: flex;
  flex-direction: column;
}

.sidebar-bottom-actions {
  margin-top: auto;
  padding: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-bottom-button {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.danger-text {
  color: #9b1c1c !important;
}

.avatar-img,
.avatar-sm.avatar-img,
.avatar-lg.avatar-img {
  object-fit: cover;
  border-radius: 50%;
  display: inline-block;
}

.avatar-lg {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  background: var(--surface2);
}

.paperwork-frame {
  width: min(900px, 80vw);
  height: min(700px, 75vh);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: white;
}

.admin-panel-card {
  max-width: none !important;
}

.small-value {
  font-size: 18px !important;
}

@media (max-width: 1000px) {
  .form-row-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-row-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {

  .form-row-2,
  .form-row-4 {
    grid-template-columns: 1fr;
  }

  .paperwork-frame {
    width: 88vw;
  }
}


/* ── Production patch: real modal overlay and scrollable modal body ───────── */
#modal-overlay.modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.55);
  z-index: 99999 !important;
}

#modal-overlay .modal-box {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.form-row-2,
.form-row-3,
.form-row-4 {
  align-items: end;
}

.form-group input,
.form-group select,
.form-group textarea {
  min-height: var(--input-h, 42px);
}

#reminder-toast-container {
  display: none !important;
}

.feature-bg,
.card.form-card,
.card.data-card {
  background-image: linear-gradient(rgba(255, 255, 255, .92), rgba(255, 255, 255, .94)), url('/images/road.png');
  background-size: cover;
  background-position: center;
}

.admin-panel-card {
  max-height: calc(100vh - 210px);
  overflow-y: auto;
}

/* ============================================================================
   FINAL PATCH 2026-05-03
   Fixes:
   - Register/create account panel no longer clips fields.
   - Login/register image no longer forces the form off screen.
   - Auth pages scroll correctly on shorter screens.
   - Maintenance paperwork preview gets a usable frame size.
   - Modal content stays inside viewport and scrolls inside the modal.
   ============================================================================ */
html,
body {
  min-height: 100%;
}

body {
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

.auth-screen {
  min-height: 100vh !important;
  height: auto !important;
  overflow-y: auto !important;
  padding: 46px 18px 34px !important;
}

.auth-screen .login-container {
  min-height: calc(100vh - 92px) !important;
  height: auto !important;
  max-height: none !important;
  display: grid !important;
  grid-template-columns: minmax(280px, 520px) minmax(340px, 520px) !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 24px !important;
  overflow: visible !important;
}

.auth-screen .login-image {
  flex: 1;
  min-width: 0;
}


.auth-screen .login-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}


.auth-screen .login-wrap {
  flex: 1;
  min-width: 0;
  max-width: none;
}


#register-screen .login-wrap {
  flex: 1;
  min-width: 0;
  max-width: none;
}


#register-screen .login-logo {
  margin-bottom: 1rem !important;
}

#register-screen .form-group {
  margin-bottom: .7rem !important;
}

#register-screen .btn-block {
  margin-top: .35rem !important;
}

#modal-overlay.modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 100000 !important;
  display: none;
  align-items: center !important;
  justify-content: center !important;
  padding: 22px !important;
  overflow: hidden !important;
}

#modal-overlay .modal-box {
  width: min(760px, calc(100vw - 32px)) !important;
  max-height: calc(100vh - 44px) !important;
  overflow-y: auto !important;
}

.paperwork-frame {
  width: min(92vw, 900px) !important;
  height: min(78vh, 720px) !important;
  border: 1px solid var(--border-md) !important;
  border-radius: var(--radius) !important;
  background: #fff !important;
}

.paperwork-preview-box {
  width: min(92vw, 900px) !important;
  max-height: min(78vh, 720px) !important;
  overflow: auto !important;
  background: #fff !important;
  border: 1px solid var(--border-md) !important;
  border-radius: var(--radius) !important;
  padding: 8px !important;
}

.paperwork-preview-box img {
  display: block !important;
  max-width: 100% !important;
  height: auto !important;
  margin: 0 auto !important;
}

@media (max-width: 980px) {
  .auth-screen .login-container {
    grid-template-columns: minmax(300px, 560px) !important;
  }

  .auth-screen .login-image {
    flex: 1;
    min-width: 0;
  }


  .auth-screen .login-wrap {
    flex: 1;
    min-width: 0;
    max-width: none;
  }

}

@media (max-width: 560px) {
  .auth-screen {
    padding: 38px 10px 28px !important;
  }

  .auth-screen .login-wrap {
    flex: 1;
    min-width: 0;
    max-width: none;
  }


  #register-screen .login-wrap>div[style*="grid-template-columns"] {
    display: block !important;
  }
}

/* ==========================================================================
   FINAL PATCH — KBB button, dashboard reminders, OAuth buttons, camera upload
   ========================================================================== */
.oauth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 10px;
  color: var(--text-2);
  font-size: 12px;
}

.oauth-divider::before,
.oauth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-md);
}

.oauth-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 4px;
}

.oauth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--border-md);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
}

.oauth-btn:hover {
  background: var(--surface2);
}

.dashboard-reminder-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-reminder-card {
  border: 1px solid rgba(220, 38, 38, 0.18);
}

.dashboard-reminder-flash .alert-item,
.alert-item.flash-reminder {
  animation: autoMaticReminderFlash 1.25s ease-in-out infinite alternate;
}

@keyframes autoMaticReminderFlash {
  from {
    background: #fff7ed;
    box-shadow: inset 0 0 0 1px rgba(251, 146, 60, 0.15);
  }

  to {
    background: #ffedd5;
    box-shadow: inset 0 0 0 1px rgba(251, 146, 60, 0.35), 0 0 14px rgba(251, 146, 60, 0.18);
  }
}

.kbb-actions {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.kbb-actions select {
  min-width: 220px;
}

.paperwork-input-hint {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 3px;
}

@media (max-width: 850px) {

  .dashboard-reminder-grid,
  .oauth-buttons {
    grid-template-columns: 1fr;
  }
}

/* ─────────────────────────────────────────────────────────────
   UX correction styles — stacked mobile layout, OAuth icons,
   blinking dashboard reminders, and cleaner form alignment.
   ───────────────────────────────────────────────────────────── */
.oauth-btn {
  gap: 10px;
  justify-content: center;
  min-height: 42px;
}

.oauth-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.oauth-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.oauth-github .oauth-icon {
  color: #111827;
}

.dashboard-reminders-card {
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.dashboard-reminders-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-reminder-card {
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: #fff8e6;
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .06);
}

.reminder-pill {
  display: inline-flex;
  width: fit-content;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.18);
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 6px;
}

.blink-reminder {
  animation: autoMaticReminderBlink 1.15s ease-in-out infinite alternate;
}

@keyframes autoMaticReminderBlink {
  from {
    box-shadow: 0 0 0 rgba(245, 158, 11, 0);
    filter: brightness(1);
  }

  to {
    box-shadow: 0 0 18px rgba(245, 158, 11, 0.45);
    filter: brightness(1.04);
  }
}

.inline-field-action,
.lookup-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.inline-field-action select,
.lookup-row select {
  flex: 1;
  min-width: 0;
}

.form-actions-right {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.form-actions-left {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  margin-top: 8px;
}

.inline-add-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin: 12px 0;
  background: rgba(255, 255, 255, .76);
}

.kbb-inline-link {
  margin: 0 0 12px 0;
}

.kbb-inline-link a {
  font-weight: 700;
  color: var(--primary, #1d4ed8);
  text-decoration: underline;
}

.review-snippet {
  max-width: 260px;
  color: var(--text-2);
  font-size: 12px;
}

.single-reminder-list .alert-list {
  display: block;
}

@media (max-width: 760px) {

  .grid-2,
  .form-row-2,
  .form-row-3,
  .form-row-4,
  .mobile-stack,
  .dashboard-reminders-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }

  .inline-field-action,
  .lookup-row {
    flex-direction: column;
  }

  .inline-field-action .btn,
  .lookup-row .btn,
  .form-actions-right .btn,
  .form-actions-left .btn {
    width: 100%;
  }

  .form-actions-right,
  .form-actions-left {
    flex-direction: column;
  }

  .table-wrap {
    overflow-x: auto;
  }
}


/* ============================================================================
   Auto-Matic final UI correction patch
   ============================================================================ */

.topbar-brand-title {
  color: #ffffff;
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0.2px;
  margin-bottom: 2px;
}

.app-footer {
  position: relative;
  overflow: hidden;
  gap: 8px;
}

.footer-logo {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  object-fit: cover;
  margin-left: 6px;
  background: #fff;
}

/* Compact dashboard reminders */
.dashboard-reminder-card {
  margin-bottom: 1rem;
}

.dashboard-reminder-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dashboard-reminder-count {
  font-size: 14px;
  font-weight: 700;
  color: var(--danger-txt);
  background: var(--danger-dim);
  padding: 2px 8px;
  border-radius: 999px;
}

.dashboard-org-card {
  margin-top: 0.75rem;
}

/* Toasts side by side and visibly blinking */
#reminder-toast-container {
  display: none !important;
}

.reminder-toast {
  width: min(300px, calc(100vw - 24px)) !important;
  pointer-events: auto;
  animation: reminderPulse 1.1s ease-in-out infinite alternate !important;
}

@keyframes reminderPulse {
  from {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, .15), var(--shadow);
    transform: translateY(0);
  }

  to {
    box-shadow: 0 0 0 5px rgba(220, 38, 38, .22), var(--shadow);
    transform: translateY(-1px);
  }
}

/* Maintenance forms line up */
.maintenance-log-grid,
.expense-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
  align-items: end;
}

.maintenance-log-grid .form-group,
.expense-filter-grid .form-group {
  margin-bottom: 0;
}

.maintenance-file-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--input-h);
}

.maintenance-file-inline input[type=file] {
  height: var(--input-h);
  display: flex;
  align-items: center;
  font-size: 12px;
}

/* Vehicle page: list first, collapsed add form at bottom */
.vehicle-add-toggle-row {
  display: flex;
  justify-content: flex-end;
  margin: 1rem 0;
}

.vehicle-add-collapsed {
  display: none;
}

.vehicle-add-collapsed.open {
  display: block;
}

/* Provider review snippets */
.review-snippet {
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.35;
  max-width: 280px;
}


to {
  left: calc(100vw + 120px);
}


/* Mobile: reduce side-by-side layouts */
@media (max-width: 768px) {

  .grid-2,
  .form-row-2,
  .form-row-3,
  .form-row-4,
  .maintenance-log-grid,
  .expense-filter-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }

  #reminder-toast-container {
    display: none !important;
  }

  .reminder-toast {
    width: calc(100vw - 24px) !important;
  }
}

/* ── Final requested header/footer/about/expense/car fixes ───────────── */
.topbar.auto-banner,
.topbar {
  position: relative !important;
}

.topbar-left {
  flex: 1 1 auto !important;
  min-width: 0 !important;
}

.topbar-actions {
  margin-left: auto !important;
  z-index: 3 !important;
}

.topbar-brand-title {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  font-size: 20px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  cursor: pointer !important;
  letter-spacing: 0.3px !important;
  white-space: nowrap !important;
  z-index: 2 !important;
}

.topbar-brand-title:hover {
  text-decoration: underline;
}

.topbar-title-group {
  padding-left: 6px;
}

.topbar-title,
.topbar-sub {
  max-width: 260px;
}

.app-footer {
  gap: 0 !important;
  text-align: center !important;
}

.app-footer img,
.app-footer svg,
.app-footer .footer-logo,
.app-footer .logo,
.app-footer .footer-icon {
  display: none !important;
}

.expense-filter-options {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 8px 0 12px;
}

.expense-filter-options label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 9px;
}

.expense-filter-options input[type="checkbox"] {
  width: auto;
  height: auto;
}

.drive-car {
  position: fixed !important;
  left: 90px !important;
  right: auto !important;
  bottom: 7px !important;
  width: auto !important;
  height: auto !important;
  font-size: 28px !important;
  line-height: 1 !important;
  z-index: 9999 !important;
  pointer-events: none !important;
  animation: autoMaticDriveRight 10s linear forwards !important;
}

.drive-car-body,
.drive-car-wheel {
  display: none !important;
}

@keyframes autoMaticDriveRight {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(calc(100vw + 180px));
  }
}

#reminder-toast-container {
  display: none !important;
}

.reminder-toast {
  pointer-events: auto !important;
  animation: autoMaticReminderBlink 1.15s ease-in-out infinite alternate !important;
}

@keyframes autoMaticReminderBlink {
  from {
    box-shadow: 0 0 0 rgba(220, 38, 38, 0.0);
    transform: translateY(0);
  }

  to {
    box-shadow: 0 0 18px rgba(220, 38, 38, 0.35);
    transform: translateY(-1px);
  }
}

@media (max-width: 700px) {
  .topbar-brand-title {
    font-size: 17px !important;
  }

  .topbar-title,
  .topbar-sub {
    display: none !important;
  }

  .expense-filter-options {
    gap: 7px;
  }
}

/* ── Auth screen sizing fix: login/register/forgot match ───────────── */
#login-screen .login-container,
#register-screen .login-container,
#forgot-screen .login-container {
  align-items: stretch;
  width: min(860px, calc(100vw - 48px));
  height: min(640px, calc(100vh - 144px));
  max-height: calc(100vh - 144px);
}

#login-screen .login-image,
#register-screen .login-image,
#forgot-screen .login-image {
  flex: 1;
  min-width: 0;
}


#login-screen .login-image img,
#register-screen .login-image img,
#forgot-screen .login-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}


#login-screen .login-wrap,
#register-screen .login-wrap,
#forgot-screen .login-wrap {
  flex: 1;
  min-width: 0;
  max-width: none;
}


#login-screen .logo-mark,
#register-screen .logo-mark,
#forgot-screen .logo-mark {
  width: 48px;
  height: 48px;
  font-size: 20px;
}

/* ── Footer car: one car, larger size, left → right ───────────────── */
.footer-copy {
  position: relative;
  z-index: 2;
  pointer-events: none;
}

#road {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

#driving-car {
  position: absolute;
  left: -72px;
  bottom: 2px;
  font-size: 38px;
  line-height: 1;
  opacity: 0;
  transform: scaleX(-1) !important;
  will-change: left, opacity;
}

#driving-car.driving {
  animation-name: autoMaticFooterDrive;
  animation-duration: 12s;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

@keyframes autoMaticFooterDrive {
  0% {
    left: calc(100% + 72px);
    opacity: 1;
  }

  94% {
    opacity: 1;
  }

  100% {
    left: -72px;
    opacity: 0;
  }
}

@media (max-width: 760px) {

  #login-screen .login-container,
  #register-screen .login-container,
  #forgot-screen .login-container {
    width: min(420px, calc(100vw - 32px));
    height: auto;
    max-height: none;
    flex-direction: column;
  }

  #login-screen .login-image,
  #register-screen .login-image,
  #forgot-screen .login-image {
    flex: 1;
    min-width: 0;
  }


  #login-screen .login-wrap,
  #register-screen .login-wrap,
  #forgot-screen .login-wrap {
    flex: 1;
    min-width: 0;
    max-width: none;
  }

}

/* ---- CAR ANIMATION ---- */
#driving-car {
  position: absolute;
  left: -80px;
  bottom: 4px;
  font-size: 32px;
  transform: scaleX(-1);
}

#driving-car.driving {
  animation: autoMaticFooterDrive 10s linear infinite;
}

@keyframes autoMaticFooterDrive {
  0% {
    left: -80px;
  }

  100% {
    left: calc(100% + 80px);
  }
}

/* ---- TOPBAR TITLE ---- */
.topbar {
  position: relative;
}

.topbar-brand-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-weight: 700;
  font-size: 16px;
}