:root {
  --bg: #070b14;
  --bg-elevated: #0f172af0;
  --bg-input: #0206178c;
  --surface: #0f172ae0;
  --ink: #f8fafc;
  --ink-secondary: #cbd5e1;
  --ink-muted: #94a3b8;
  --accent: #38bdf8;
  --accent-bright: #7dd3fc;
  --accent-deep: #0ea5e9;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.18);
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --radius: 1rem;
  --radius-sm: 0.75rem;
  --font: "Cairo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --max: 80rem;
  --shadow: 0 25px 50px -12px rgb(0 0 0 / 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

::selection {
  background: rgba(56, 189, 248, 0.28);
}

/* —— Brand background (from live site) —— */
.login-brand-panel {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: #070b14;
  overflow: hidden;
  pointer-events: none;
}

.login-brand-mesh,
.login-brand-grid {
  position: absolute;
  inset: 0;
}

.login-brand-mesh {
  background:
    radial-gradient(ellipse 80% 60% at 20% 20%, rgba(56, 189, 248, 0.18), transparent 55%),
    radial-gradient(ellipse 70% 50% at 80% 80%, rgba(99, 102, 241, 0.16), transparent 50%),
    radial-gradient(ellipse 50% 40% at 60% 10%, rgba(16, 185, 129, 0.08), transparent 45%),
    linear-gradient(160deg, #070b14, #0f172a 40%, #111827);
}

.login-brand-grid {
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 20%, transparent 100%);
}

.login-brand-orb {
  position: absolute;
  border-radius: 9999px;
  filter: blur(40px);
  pointer-events: none;
}

.login-brand-orb-1 {
  width: 280px;
  height: 280px;
  top: -80px;
  right: -60px;
  background: #22d3ee38;
}

.login-brand-orb-2 {
  width: 320px;
  height: 320px;
  bottom: 10%;
  left: -100px;
  background: #6366f133;
}

.login-brand-orb-3 {
  width: 200px;
  height: 200px;
  top: 45%;
  right: 15%;
  background: #3b82f626;
}

/* —— Header —— */
.app-site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #070b14f7;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.3);
  backdrop-filter: blur(12px);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1rem;
  height: 3.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .header-inner {
    padding: 0 1.5rem;
    height: 4rem;
  }
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.brand-logo {
  height: 2.1rem;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .brand-logo {
    height: 2.45rem;
  }
}

.brand-text {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-text span {
  color: var(--accent-bright);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.session-label {
  display: none;
  font-size: 0.8rem;
  color: var(--ink-muted);
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 640px) {
  .session-label {
    display: inline;
  }
}

.app-header-btn {
  height: 2.5rem;
  min-width: 2.5rem;
  padding: 0 0.75rem;
  border-radius: 0.75rem;
  background: #ffffff0f;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.app-header-btn:hover {
  background: #ffffff1c;
  border-color: #38bdf859;
  color: #f8fafc;
}

.app-header-btn-primary {
  background: #0ea5e926;
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #7dd3fc;
}

.app-header-btn-primary:hover {
  background: #0ea5e940;
  border-color: #38bdf880;
  color: #e0f2fe;
}

/* —— Login page —— */
.app-page {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.login-shell {
  width: min(100%, 26rem);
  animation: rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-card {
  border-radius: var(--radius);
  border: 1px solid #ffffff24;
  background: #0f172af0;
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
  padding: 1.5rem 1.35rem 1.35rem;
}

@media (min-width: 640px) {
  .login-card {
    padding: 1.75rem 1.6rem 1.5rem;
  }
}

.login-head {
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-badge {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  background: linear-gradient(to bottom right, #2563eb, #1d4ed8);
  box-shadow: 0 10px 15px -3px rgb(37 99 235 / 0.25);
  color: #fff;
}

.login-badge-icon {
  width: 1.75rem;
  height: 1.75rem;
}

.login-title {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 1.875rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.login-lead {
  margin: 0.5rem 0 0;
  color: var(--ink-secondary);
  font-size: 0.95rem;
}

.input-with-icon {
  position: relative;
}

.input-icon {
  position: absolute;
  inset-inline-start: 0.85rem;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  color: var(--ink-muted);
  pointer-events: none;
}

.input-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.app-input.has-icon {
  padding-inline-start: 2.75rem;
}

.app-input.has-toggle {
  padding-inline-end: 3rem;
}

.input-toggle {
  position: absolute;
  inset-inline-end: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  border-radius: 0.5rem;
  padding: 0.45rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.input-toggle:hover {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}

.input-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
}

.wa-fab {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 50;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 9999px;
  background: #22c55e;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.35);
  transition: background 0.2s ease, transform 0.2s ease;
}

.wa-fab:hover {
  background: #16a34a;
  transform: translateY(-2px);
}

.wa-fab svg {
  width: 1.75rem;
  height: 1.75rem;
}

@media (min-width: 640px) {
  .wa-fab {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 4rem;
    height: 4rem;
  }

  .wa-fab svg {
    width: 2rem;
    height: 2rem;
  }
}

.form-stack {
  display: grid;
  gap: 0.95rem;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field > span {
  font-size: 0.875rem;
  font-weight: 700;
  color: #e2e8f0;
}

.app-input {
  width: 100%;
  min-height: 3rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 2px solid #fff3;
  background: #0206178c;
  color: #fff;
  transition: all 0.15s ease;
}

.app-input::placeholder {
  color: #94a3b8;
}

.app-input:focus {
  outline: 2px solid transparent;
  border-color: #38bdf899;
  box-shadow: 0 0 0 4px rgb(56 189 248 / 0.2);
}

.app-btn-primary {
  width: 100%;
  min-height: 3.25rem;
  border: 0;
  border-radius: 0.75rem;
  padding: 0.9rem 1rem;
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(to right, #2563eb, #1d4ed8);
  box-shadow: 0 10px 15px -3px rgb(37 99 235 / 0.2);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.app-btn-primary:hover {
  background: linear-gradient(to right, #1d4ed8, #1e40af);
}

.app-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.app-btn-ghost {
  width: 100%;
  min-height: 2.75rem;
  margin-top: 0.35rem;
  border: 1px solid var(--line, #334155);
  border-radius: 0.75rem;
  padding: 0.65rem 1rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink-muted, #94a3b8);
  background: transparent;
  cursor: pointer;
}

.app-btn-ghost:hover {
  color: var(--ink, #e2e8f0);
  border-color: #64748b;
}

.form-link {
  color: #60a5fa;
  text-decoration: none;
  font-weight: 600;
}

.form-link:hover {
  text-decoration: underline;
}

.login-forgot {
  margin: 0.25rem 0 0;
  text-align: center;
}

.otp-input {
  letter-spacing: 0.35em;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
}

.status {
  margin: 0.35rem 0 0;
  min-height: 1.2rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.status.is-error {
  color: var(--danger);
}

.status.is-ok {
  color: var(--ok);
}

.login-foot {
  margin: 1rem 0 0;
  font-size: 0.8rem;
  color: var(--ink-muted);
  text-align: center;
}

/* —— Dashboard header —— */
.dashboard-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 11, 20, 0.97);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.3);
}

.dashboard-header-glow {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(14, 165, 233, 0.07), transparent, rgba(99, 102, 241, 0.06));
}

.dashboard-header-line {
  pointer-events: none;
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(56, 189, 248, 0.5), transparent);
}

.dashboard-header-inner {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 0.75rem;
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
}

@media (min-width: 640px) {
  .dashboard-header-inner {
    padding: 0 1.5rem;
    height: 4rem;
  }
}

.brand-text-wrap {
  min-width: 0;
}

.brand-heading {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 640px) {
  .brand-heading {
    font-size: 1.125rem;
  }
}

.brand-lockup:hover .brand-heading {
  color: var(--accent-bright);
}

.dashboard-header-btn,
.dashboard-logout-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  min-width: 2.5rem;
  padding: 0.5rem;
  border-radius: 0.75rem;
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

@media (min-width: 640px) {
  .dashboard-header-btn,
  .dashboard-logout-btn {
    padding: 0.625rem 1rem;
    min-width: 0;
  }
}

.dashboard-header-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
}

.dashboard-header-btn:hover {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(56, 189, 248, 0.35);
  color: #f8fafc;
}

.dashboard-logout-btn {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: #fca5a5;
}

.dashboard-logout-btn:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(248, 113, 113, 0.5);
  color: #fecaca;
}

.dashboard-header-btn .ico,
.dashboard-logout-btn .ico {
  width: 1.1rem;
  height: 1.1rem;
  color: var(--accent);
  flex-shrink: 0;
}

.dashboard-logout-btn .ico {
  color: inherit;
}

.dashboard-header-btn .btn-label,
.dashboard-logout-btn .btn-label {
  display: none;
}

@media (min-width: 640px) {
  .dashboard-header-btn .btn-label,
  .dashboard-logout-btn .btn-label {
    display: inline;
  }
}

/* —— Dashboard layout —— */
.dash-layout {
  position: relative;
  z-index: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: #e2e8f0;
}

.dash-main {
  flex: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem 0.75rem 2.5rem;
  animation: rise 0.45s ease both;
}

@media (min-width: 640px) {
  .dash-main {
    padding: 1.5rem 1.5rem 3rem;
  }
}

@media (min-width: 1024px) {
  .dash-main {
    padding: 2rem 2rem 3.5rem;
  }
}

.dash-welcome {
  margin-bottom: 1.25rem;
}

.dash-welcome-title {
  margin: 0;
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 800;
  color: #fff;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 640px) {
  .stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.stat-card {
  border-radius: 1rem;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.2);
}

.stat-card-amber {
  border-color: rgba(251, 191, 36, 0.3);
  background: linear-gradient(to bottom right, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.05));
}

.stat-card-sky {
  border-color: rgba(56, 189, 248, 0.3);
  background: linear-gradient(to bottom right, rgba(14, 165, 233, 0.2), rgba(2, 132, 199, 0.05));
}

.stat-card-emerald {
  border-color: rgba(52, 211, 153, 0.3);
  background: linear-gradient(to bottom right, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.05));
}

.stat-card-neutral {
  border-color: rgba(255, 255, 255, 0.15);
  background: linear-gradient(to bottom right, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
}

.stat-label {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.stat-card-amber .stat-label {
  color: #fde68a;
}

.stat-card-sky .stat-label {
  color: #7dd3fc;
}

.stat-card-emerald .stat-label {
  color: #6ee7b7;
}

.stat-value {
  margin: 0.35rem 0 0;
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.stat-value-sm {
  font-size: 0.95rem;
}

.stat-value-sm.is-ok {
  color: #6ee7b7;
}

.stat-value-sm.is-err {
  color: #fca5a5;
}

.dash-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: start;
}

@media (min-width: 1024px) {
  .dash-columns {
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
  }
}

.dash-primary {
  display: grid;
  gap: 1rem;
}

.vin-card {
  position: relative;
  overflow: hidden;
  padding: 0;
}

.vin-card-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to bottom right, rgba(37, 99, 235, 0.05), transparent, rgba(99, 102, 241, 0.05));
}

.vin-card-body {
  position: relative;
  padding: 1.25rem;
}

@media (min-width: 640px) {
  .vin-card-body {
    padding: 2rem;
  }
}

.vin-card-head {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.vin-icon {
  flex-shrink: 0;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to bottom right, #2563eb, #1d4ed8);
  box-shadow: 0 10px 15px -3px rgb(37 99 235 / 0.25);
  color: #fff;
}

.vin-icon svg {
  width: 1.75rem;
  height: 1.75rem;
}

.vin-card-title {
  margin: 0.35rem 0 0;
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 800;
  color: #fff;
}

.vin-form {
  display: grid;
  gap: 1rem;
}

.vin-field {
  position: relative;
}

.vin-input {
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border-radius: 1rem;
  padding: 1rem 1rem 2.5rem;
  min-height: 4.5rem;
}

@media (min-width: 640px) {
  .vin-input {
    font-size: 1.25rem;
    letter-spacing: 0.2em;
    padding: 1.25rem 1rem 2.5rem;
  }
}

.vin-meta {
  position: absolute;
  bottom: 0.75rem;
  inset-inline: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  pointer-events: none;
}

.vin-hint {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.vin-count {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 0.375rem;
  background: #e2e8f0;
  color: #475569;
}

.vin-submit {
  border-radius: 1rem;
  min-height: 3.5rem;
  font-size: 1rem;
}

.vin-submit svg {
  width: 1.25rem;
  height: 1.25rem;
}

.tips-card {
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  padding: 1.25rem;
}

.tips-title {
  margin: 0 0 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 800;
  color: #fff;
}

.tips-title svg {
  width: 1rem;
  height: 1rem;
  color: #f59e0b;
}

.tips-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.5rem;
}

.tips-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--ink-secondary);
}

.tips-list li::before {
  content: '';
  margin-top: 0.45rem;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 9999px;
  background: var(--accent);
  flex-shrink: 0;
}

.history-panel {
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 23, 42, 0.88);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.history-panel-mobile {
  display: block;
}

.history-panel-desktop {
  display: none;
}

@media (min-width: 1024px) {
  .history-panel-mobile {
    display: none;
  }

  .history-panel-desktop {
    display: block;
    position: sticky;
    top: 5.5rem;
  }
}

.history-head {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.9rem 1rem;
  background: linear-gradient(to right, rgba(14, 165, 233, 0.15), rgba(255, 255, 255, 0.04));
}

.history-head h3 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 800;
  color: #fff;
}

.history-head p {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.history-body {
  padding: 0.75rem;
  max-height: 280px;
  overflow-y: auto;
}

@media (min-width: 1024px) {
  .history-panel-desktop .history-body {
    max-height: calc(100vh - 220px);
  }
}

.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
  border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 3px;
}

.history-list {
  display: grid;
  gap: 0.5rem;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  padding: 0.6rem;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.history-main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 0.2rem;
}

.history-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.history-date {
  font-size: 0.72rem;
  color: var(--ink-muted);
}

.history-status {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.history-status.is-ok {
  color: #6ee7b7;
  border-color: rgba(110, 231, 183, 0.25);
  background: rgba(16, 185, 129, 0.12);
}

.history-status.is-err {
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.25);
  background: rgba(239, 68, 68, 0.12);
}

.history-status.is-pending {
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.25);
  background: rgba(245, 158, 11, 0.12);
}

.history-item:hover {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(255, 255, 255, 0.09);
}

.history-vin {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  text-align: start;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0;
}

.history-vin:hover {
  color: var(--accent-bright);
}

.history-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 0.5rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease;
}

.history-btn svg {
  width: 0.875rem;
  height: 0.875rem;
}

.history-btn span {
  display: none;
}

@media (min-width: 640px) {
  .history-btn span {
    display: inline;
  }
}

.history-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.history-btn-pdf {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
}

.history-btn-pdf:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
}

.history-btn-open {
  background: #0284c7;
  color: #fff;
  border-color: transparent;
}

.history-btn-open:hover:not(:disabled) {
  background: #0ea5e9;
}

/* —— Footer —— */
.site-footer {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(7, 11, 20, 0.8);
  backdrop-filter: blur(16px);
  color: #fff;
}

.site-footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem 1rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.footer-grid h3 {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.footer-grid p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ink-muted);
  line-height: 1.6;
}

.footer-grid ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.5rem;
}

.footer-grid a {
  font-size: 0.875rem;
  color: var(--ink-secondary);
  transition: color 0.15s ease;
}

.footer-grid a:hover {
  color: #fff;
}

.footer-contact {
  display: grid;
  gap: 0.75rem;
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

@media (min-width: 640px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
  }
}

.footer-bottom p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ink-secondary);
}

.footer-cta {
  display: flex;
  gap: 0.75rem;
}

.footer-wa,
.footer-call {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff !important;
}

.footer-wa {
  background: #22c55e;
}

.footer-wa:hover {
  background: #16a34a;
}

.footer-call {
  background: #3b82f6;
}

.footer-call:hover {
  background: #2563eb;
}

.profile-main {
  max-width: 36rem;
}

.profile-card {
  margin-top: 1rem;
  display: grid;
  gap: 1.5rem;
}

.profile-section {
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-section-title {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.profile-stats {
  padding-bottom: 0.25rem;
}

.data-block .row.row-editable {
  align-items: center;
  flex-wrap: wrap;
}

.profile-inline-edit {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 12rem;
  justify-content: flex-end;
  min-width: 0;
}

.profile-inline-input {
  min-height: 2.5rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: end;
  flex: 1 1 auto;
  min-width: 0;
}

.profile-save-btn {
  flex: 0 0 auto;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(14, 165, 233, 0.12);
  color: #7dd3fc;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.profile-save-btn:hover:not(:disabled) {
  background: rgba(14, 165, 233, 0.22);
  border-color: rgba(56, 189, 248, 0.55);
}

.profile-save-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.profile-inline-status {
  margin: 0.35rem 0 0;
  min-height: 1.25rem;
}

.profile-forgot {
  margin: 0;
  text-align: center;
}

/* —— App workspace (legacy helpers) —— */
.app-shell {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
  display: grid;
  gap: 1.1rem;
  animation: rise 0.45s ease both;
}

@media (min-width: 640px) {
  .app-shell {
    padding: 1.5rem 1.5rem 3.5rem;
  }
}

.app-intro {
  padding: 0.25rem 0 0.75rem;
}

.section-title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 700;
}

.section-lead {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 0.95rem;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 1rem;
  align-items: start;
}

.app-card {
  border-radius: var(--radius);
  border: 1px solid #ffffff24;
  background: #0f172af0;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  padding: 1.15rem 1.1rem;
}

.panel-kicker {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.panel-title {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.panel-head .panel-title {
  margin: 0;
}

.credit-meter {
  display: grid;
  gap: 0.15rem;
  padding: 0.95rem 1rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.35), rgba(14, 165, 233, 0.18));
  border: 1px solid rgba(56, 189, 248, 0.25);
  margin-bottom: 0.85rem;
}

.credit-meter .label {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-bright);
  font-weight: 700;
}

.credit-meter .value {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.1;
}

.credit-meter .sub {
  font-size: 0.82rem;
  color: var(--ink-secondary);
}

.data-block .row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.9rem;
}

.data-block .row:last-child {
  border-bottom: 0;
}

.data-block .row span:first-child {
  color: var(--ink-muted);
}

.data-block .row strong {
  font-weight: 700;
  text-align: end;
  word-break: break-all;
}

.muted {
  margin: 0;
  color: var(--ink-muted);
}

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

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

table.data th,
table.data td {
  text-align: start;
  padding: 0.7rem 0.45rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: middle;
}

table.data th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  font-weight: 700;
}

table.data tbody tr:hover {
  background: rgba(56, 189, 248, 0.05);
}

#order-vin {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pill-status {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 0.4rem;
  font-size: 0.74rem;
  font-weight: 700;
  background: rgba(148, 163, 184, 0.15);
  color: var(--ink-secondary);
}

.pill-status.is-ok {
  background: rgba(52, 211, 153, 0.15);
  color: var(--ok);
}

.pill-status.is-warn {
  background: rgba(251, 191, 36, 0.15);
  color: var(--warn);
}

.pill-status.is-err {
  background: rgba(248, 113, 113, 0.15);
  color: var(--danger);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

