/* ApplianceIQ Network OS — static MVP design system */

:root {
  --radius: 0.75rem;

  --navy: oklch(0.22 0.05 255);
  --navy-foreground: oklch(0.98 0.005 240);
  --electric: oklch(0.62 0.21 255);
  --electric-foreground: oklch(0.99 0 0);
  --teal: oklch(0.68 0.13 180);
  --teal-foreground: oklch(0.18 0.04 255);

  --background: oklch(0.985 0.005 240);
  --foreground: oklch(0.22 0.05 255);
  --surface: oklch(1 0 0);

  --muted: oklch(0.955 0.008 240);
  --muted-foreground: oklch(0.48 0.03 250);
  --border: oklch(0.91 0.012 240);

  --sidebar: oklch(0.18 0.045 255);
  --sidebar-foreground: oklch(0.92 0.01 240);
  --sidebar-accent: oklch(0.26 0.05 255);
  --sidebar-border: oklch(0.3 0.04 255);

  /* status colors */
  --amber-bg: oklch(0.94 0.06 85); --amber-fg: oklch(0.4 0.1 70); --amber-bd: oklch(0.82 0.1 80);
  --indigo-bg: oklch(0.93 0.04 275); --indigo-fg: oklch(0.4 0.12 275); --indigo-bd: oklch(0.8 0.08 275);
  --violet-bg: oklch(0.93 0.045 300); --violet-fg: oklch(0.42 0.13 300); --violet-bd: oklch(0.8 0.09 300);
  --sky-bg: oklch(0.93 0.045 235); --sky-fg: oklch(0.4 0.1 235); --sky-bd: oklch(0.8 0.08 235);
  --emerald-bg: oklch(0.93 0.06 155); --emerald-fg: oklch(0.4 0.1 155); --emerald-bd: oklch(0.8 0.1 155);
  --orange-bg: oklch(0.93 0.06 55); --orange-fg: oklch(0.42 0.12 45); --orange-bd: oklch(0.8 0.1 50);
  --rose-bg: oklch(0.93 0.05 15); --rose-fg: oklch(0.42 0.15 15); --rose-bd: oklch(0.8 0.1 15);
  --zinc-bg: oklch(0.93 0.005 240); --zinc-fg: oklch(0.4 0.01 240); --zinc-bd: oklch(0.82 0.008 240);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  line-height: 1.5;
}
h1, h2, h3, h4 { letter-spacing: -0.02em; margin: 0; font-weight: 600; color: var(--navy); }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
img { max-width: 100%; }

.container-page { width: 100%; margin-inline: auto; padding-inline: 1.25rem; max-width: 80rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border-radius: var(--radius); font-weight: 500; font-size: .875rem; cursor: pointer;
  border: 1px solid transparent; white-space: nowrap; transition: background-color .15s, opacity .15s;
  height: 2.5rem; padding: 0 1rem;
}
.btn-navy { background: var(--navy); color: var(--navy-foreground); }
.btn-navy:hover { opacity: .92; }
.btn-electric { background: var(--electric); color: var(--electric-foreground); box-shadow: 0 4px 14px -6px oklch(0.62 0.21 255 / .4); }
.btn-electric:hover { opacity: .92; }
.btn-teal { background: var(--teal); color: var(--teal-foreground); }
.btn-teal:hover { opacity: .92; }
.btn-outline { background: var(--surface); border-color: var(--border); }
.btn-outline:hover { background: var(--muted); }
.btn-ghost { background: transparent; color: var(--muted-foreground); }
.btn-ghost:hover { color: var(--foreground); }
.btn-sm { height: 2.1rem; padding: 0 .75rem; font-size: .8125rem; }
.btn-lg { height: 3rem; padding: 0 1.5rem; font-size: 1rem; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* Cards / surfaces */
.card { border: 1px solid var(--border); background: var(--surface); border-radius: 1rem; }
.card-pad { padding: 1.25rem; }
.rounded-xl { border-radius: .75rem; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: .4rem; border-radius: 999px;
  border: 1px solid; padding: .1rem .65rem; font-size: .75rem; font-weight: 500; white-space: nowrap;
}
.badge-dot { width: .35rem; height: .35rem; border-radius: 999px; background: currentColor; opacity: .7; }

.tone-electric { background: color-mix(in oklab, var(--electric) 10%, white); color: var(--electric); border-color: color-mix(in oklab, var(--electric) 25%, white); }
.tone-teal { background: color-mix(in oklab, var(--teal) 15%, white); color: var(--teal-foreground); border-color: color-mix(in oklab, var(--teal) 30%, white); }
.tone-amber { background: var(--amber-bg); color: var(--amber-fg); border-color: var(--amber-bd); }
.tone-indigo { background: var(--indigo-bg); color: var(--indigo-fg); border-color: var(--indigo-bd); }
.tone-violet { background: var(--violet-bg); color: var(--violet-fg); border-color: var(--violet-bd); }
.tone-sky { background: var(--sky-bg); color: var(--sky-fg); border-color: var(--sky-bd); }
.tone-emerald { background: var(--emerald-bg); color: var(--emerald-fg); border-color: var(--emerald-bd); }
.tone-orange { background: var(--orange-bg); color: var(--orange-fg); border-color: var(--orange-bd); }
.tone-rose { background: var(--rose-bg); color: var(--rose-fg); border-color: var(--rose-bd); }
.tone-zinc { background: var(--zinc-bg); color: var(--zinc-fg); border-color: var(--zinc-bd); }

/* Forms */
.field { display: block; }
.field + .field { margin-top: .9rem; }
.field label { display: block; font-size: .75rem; font-weight: 500; margin-bottom: .35rem; }
.input, select.input, textarea.input {
  height: 2.75rem; width: 100%; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); padding: 0 .75rem; font-size: .875rem; outline: none;
}
textarea.input { height: auto; padding: .6rem .75rem; min-height: 5.5rem; resize: vertical; }
.input:focus { border-color: var(--electric); box-shadow: 0 0 0 3px color-mix(in oklab, var(--electric) 20%, transparent); }

/* Grids/util */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .35rem; } .gap-2 { gap: .6rem; } .gap-3 { gap: .9rem; }
.text-xs { font-size: .75rem; } .text-sm { font-size: .875rem; }
.muted { color: var(--muted-foreground); }
.mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; }

@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .lg-hide, .sm-hide { display: none !important; }
}

/* ===== Marketing site ===== */
.site-header {
  position: sticky; top: 0; z-index: 30; background: color-mix(in oklab, var(--background) 85%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
}
.site-header .container-page { height: 4rem; display: flex; align-items: center; justify-content: space-between; }
.logo { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; }
.logo .mark {
  display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem;
  border-radius: .6rem; background: var(--electric); color: var(--electric-foreground); font-size: 1rem;
}
.logo.light { color: var(--navy-foreground); }
.logo .sub { color: var(--muted-foreground); font-weight: 400; }
.site-nav { display: flex; align-items: center; gap: 1.75rem; font-size: .875rem; color: var(--muted-foreground); }
.site-nav a:hover { color: var(--foreground); }
@media (max-width: 800px) { .site-nav { display: none; } }

.hero { position: relative; overflow: hidden; padding: 3.5rem 0 4rem; }
.hero-grid { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 1000px) { .hero-grid { grid-template-columns: 7fr 5fr; gap: 3.5rem; } }
.pill {
  display: inline-flex; align-items: center; gap: .5rem; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); padding: .3rem .8rem; font-size: .75rem; font-weight: 500; color: var(--muted-foreground);
}
.pulse { width: .4rem; height: .4rem; border-radius: 999px; background: var(--teal); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
h1.hero-title { font-size: clamp(2.1rem, 5vw, 3.6rem); line-height: 1.05; margin-top: 1.1rem; }
.text-electric { color: var(--electric); }
.underline-teal { text-decoration: underline; text-decoration-color: var(--teal); text-decoration-thickness: 4px; text-underline-offset: 4px; }
.hero-sub { margin-top: 1.1rem; font-size: 1.1rem; color: var(--muted-foreground); max-width: 34rem; line-height: 1.6; }
.hero-form { margin-top: 1.5rem; display: flex; gap: .5rem; max-width: 30rem; flex-wrap: wrap; }
.hero-form .input { flex: 1; height: 3rem; font-size: 1rem; min-width: 12rem; }
.hero-note { margin-top: .7rem; font-size: .75rem; color: var(--muted-foreground); }
.hero-trust { margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: 1.2rem; font-size: .875rem; }

.chat-card { position: relative; }
.chat-glow { position: absolute; inset: -.75rem; background: linear-gradient(135deg, color-mix(in oklab, var(--electric) 20%, transparent), color-mix(in oklab, var(--teal) 15%, transparent), transparent); border-radius: 1.5rem; filter: blur(20px); }
.chat-inner { position: relative; border-radius: 1rem; border: 1px solid var(--border); background: var(--surface); padding: 1.5rem; box-shadow: 0 20px 40px -20px oklch(0.22 0.05 255 / .15); }
.chat-bubble { max-width: 90%; border-radius: 1rem; padding: .65rem .9rem; font-size: .875rem; line-height: 1.5; }
.chat-you { margin-left: auto; background: var(--muted); border-top-right-radius: .2rem; }
.chat-ai { background: color-mix(in oklab, var(--electric) 10%, white); color: var(--navy); border-top-left-radius: .2rem; }
.chat-label { font-size: .625rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-foreground); margin-bottom: .2rem; display: block; }
.stat-mini { border-radius: .6rem; background: var(--muted); padding: .5rem 0; text-align: center; }
.stat-mini .l { font-size: .625rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-foreground); }
.stat-mini .v { font-size: .875rem; font-weight: 600; color: var(--navy); }

.trust-strip { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); }
.trust-strip .container-page { padding: 1.25rem; display: grid; grid-template-columns: repeat(2,1fr); gap: 1rem; }
@media (min-width: 700px) { .trust-strip .container-page { grid-template-columns: repeat(4,1fr); } }
.trust-item { display: flex; align-items: center; gap: .5rem; font-size: .875rem; font-weight: 500; }

.section { padding: 4rem 0; }
.eyebrow { font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--electric); }
.step-card { position: relative; border-radius: 1rem; border: 1px solid var(--border); background: var(--surface); padding: 1.5rem; }
.step-num {
  position: absolute; top: -.75rem; left: 1.5rem; width: 1.75rem; height: 1.75rem; border-radius: 999px;
  background: var(--navy); color: var(--navy-foreground); display: grid; place-items: center; font-size: .75rem; font-weight: 700;
}

.guarantee-section { background: var(--navy); color: var(--navy-foreground); }
.guarantee-section .muted { color: color-mix(in oklab, var(--navy-foreground) 75%, transparent); }
.guarantee-card-yes { border-radius: 1rem; border: 1px solid color-mix(in oklab, var(--teal) 30%, transparent); background: color-mix(in oklab, var(--teal) 10%, transparent); padding: 1.25rem; }
.guarantee-card-no { border-radius: 1rem; border: 1px solid color-mix(in oklab, white 10%, transparent); background: color-mix(in oklab, white 5%, transparent); padding: 1.25rem; }

.review-card { border-radius: 1rem; border: 1px solid var(--border); background: var(--surface); padding: 1.25rem; }
.stars { color: oklch(0.8 0.15 85); }

details.faq { border-radius: .8rem; border: 1px solid var(--border); background: var(--surface); padding: 1rem; }
details.faq summary { cursor: pointer; font-weight: 600; color: var(--navy); display: flex; justify-content: space-between; align-items: center; list-style: none; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq p { margin-top: .7rem; color: var(--muted-foreground); font-size: .875rem; line-height: 1.6; }
details.faq[open] summary .chev { transform: rotate(90deg); }
.chev { transition: transform .15s; }

.final-cta { border-radius: 1.5rem; border: 1px solid var(--border); background: linear-gradient(135deg, var(--surface), var(--muted)); padding: 3rem 2rem; text-align: center; }

.site-footer { border-top: 1px solid var(--border); background: var(--surface); }
.site-footer .container-page { padding: 2rem 1.25rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; font-size: .875rem; color: var(--muted-foreground); }

/* ===== Admin shell ===== */
body.admin-body { background: var(--background); min-height: 100vh; }
.admin-sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40; width: 16rem; background: var(--sidebar);
  color: var(--sidebar-foreground); border-right: 1px solid var(--sidebar-border);
  transform: translateX(-100%); transition: transform .2s;
}
.admin-sidebar.open { transform: translateX(0); }
@media (min-width: 1024px) { .admin-sidebar { transform: translateX(0); } }
.admin-sidebar .logohead { height: 4rem; display: flex; align-items: center; padding: 0 1.25rem; border-bottom: 1px solid var(--sidebar-border); }
.admin-nav { padding: .75rem; display: flex; flex-direction: column; gap: .15rem; }
.admin-nav a {
  display: flex; align-items: center; gap: .7rem; border-radius: .6rem; padding: .55rem .75rem; font-size: .875rem;
  color: color-mix(in oklab, var(--sidebar-foreground) 80%, transparent);
}
.admin-nav a:hover { background: var(--sidebar-accent); color: var(--sidebar-foreground); }
.admin-nav a.active { background: var(--electric); color: var(--electric-foreground); }
.admin-nav a .ic { width: 1.1rem; text-align: center; }
.admin-sidebar .portal-switch {
  position: absolute; left: 1rem; right: 1rem; bottom: 1rem; border-radius: .6rem;
  background: color-mix(in oklab, var(--sidebar-accent) 60%, transparent); padding: .6rem .75rem; font-size: .75rem;
  display: flex; align-items: center; gap: .5rem;
}

.admin-topbar { position: sticky; top: 0; z-index: 30; background: color-mix(in oklab, var(--background) 85%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
@media (min-width: 1024px) { .admin-topbar, .admin-main { padding-left: 16rem; } }
.admin-topbar-inner { height: 4rem; display: flex; align-items: center; justify-content: space-between; padding: 0 1.25rem; }
.menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; border-radius: .6rem; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
@media (min-width: 1024px) { .menu-btn { display: none; } }
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: var(--navy); color: var(--navy-foreground); font-weight: 600; font-size: .75rem; }
.avatar.sm { width: 2rem; height: 2rem; }
.avatar.md { width: 2.25rem; height: 2.25rem; }
.avatar.lg { width: 2.75rem; height: 2.75rem; font-size: .875rem; }

.admin-main { padding: 1.25rem; }
@media (min-width: 1024px) { .admin-main { padding: 2rem; } }
.admin-inner { max-width: 88rem; margin: 0 auto; display: flex; flex-direction: column; gap: 2rem; }

.stat-card { border: 1px solid var(--border); background: var(--surface); border-radius: .8rem; padding: 1rem; }
.stat-card .top { display: flex; align-items: center; justify-content: space-between; font-size: .75rem; color: var(--muted-foreground); }
.stat-card .val { margin-top: .5rem; font-size: 1.5rem; font-weight: 600; color: var(--navy); }

table.dtable { width: 100%; border-collapse: collapse; font-size: .875rem; }
table.dtable thead { background: color-mix(in oklab, var(--muted) 60%, transparent); color: var(--muted-foreground); text-align: left; }
table.dtable th { padding: .65rem 1rem; font-size: .75rem; font-weight: 500; text-transform: uppercase; letter-spacing: .03em; }
table.dtable td { padding: .75rem 1rem; border-top: 1px solid var(--border); }
table.dtable tbody tr:hover { background: color-mix(in oklab, var(--muted) 40%, transparent); }

.job-row-link { display: block; padding: 1rem; border-radius: .8rem; }
.job-row-link:hover { border-color: color-mix(in oklab, var(--electric) 40%, var(--border)); box-shadow: 0 2px 10px -6px oklch(0.22 0.05 255 / .15); }

.filter-bar { border: 1px solid var(--border); background: var(--surface); border-radius: .8rem; padding: 1rem; }

.timeline { margin-top: 1.25rem; display: flex; align-items: center; gap: .4rem; overflow-x: auto; }
.tl-step { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; }
.tl-dot { width: 1.25rem; height: 1.25rem; border-radius: 999px; display: grid; place-items: center; border: 1px solid var(--border); font-size: .625rem; font-weight: 700; background: var(--background); color: var(--muted-foreground); }
.tl-dot.done { background: var(--teal); color: var(--teal-foreground); border-color: var(--teal); }
.tl-dot.active { background: var(--electric); color: var(--electric-foreground); border-color: var(--electric); }
.tl-label { font-size: .75rem; color: var(--muted-foreground); }
.tl-label.active { font-weight: 600; color: var(--navy); }
.tl-label.done { color: var(--foreground); }
.tl-line { width: 1.5rem; height: 1px; background: var(--border); }
.tl-line.done { background: var(--teal); }

.kv .l { font-size: .6875rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-foreground); }
.kv .v { margin-top: .15rem; color: var(--foreground); word-break: break-word; }

.match-card { border-radius: .8rem; border: 1px solid var(--border); background: var(--background); padding: .75rem; }
.match-card.top { border-color: color-mix(in oklab, var(--electric) 40%, transparent); background: color-mix(in oklab, var(--electric) 5%, transparent); }
.reason-chip { display: inline-flex; align-items: center; gap: .25rem; border-radius: 999px; border: 1px solid var(--border); padding: .1rem .5rem; font-size: .625rem; background: var(--muted); color: var(--muted-foreground); }
.reason-chip.ok { border-color: color-mix(in oklab, var(--teal) 30%, transparent); background: color-mix(in oklab, var(--teal) 10%, transparent); color: var(--teal-foreground); }

.score-ring { position: relative; width: 2.5rem; height: 2.5rem; display: grid; place-items: center; flex-shrink: 0; }
.score-ring span { position: absolute; font-size: .625rem; font-weight: 700; }

.progress-track { height: .375rem; width: 100%; border-radius: 999px; background: var(--muted); overflow: hidden; }
.progress-fill { height: 100%; background: var(--electric); transition: width .2s; }

.tab-btn { height: 2.5rem; border-radius: .6rem; padding: 0 1rem; font-size: .875rem; font-weight: 500; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.tab-btn.active { background: var(--navy); color: var(--navy-foreground); border-color: var(--navy); }

.bar-chart { display: flex; flex-direction: column; gap: .5rem; }
.bar-row { display: grid; grid-template-columns: 6rem 1fr 2.5rem; align-items: center; gap: .6rem; font-size: .8125rem; }
.bar-track { height: .6rem; border-radius: 999px; background: var(--muted); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--electric); }
.bar-fill.teal { background: var(--teal); }

.donut-wrap { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.legend-dot { width: .6rem; height: .6rem; border-radius: 999px; display: inline-block; margin-right: .4rem; }

.settings-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; border: 1px solid var(--border); background: var(--surface); border-radius: .8rem; padding: 1.25rem; }
