/* =========================================================
   ALK ELETRODIESEL — Design System
   Paleta: vermelho / preto / cinza
   ========================================================= */

:root {
  /* Marca */
  --red: #e11d2e;
  --red-600: #c81e2c;
  --red-700: #a3161f;
  --red-50: #fef2f2;
  --red-100: #fee2e2;

  /* Neutros */
  --ink: #0b0d10;
  --ink-800: #14171d;
  --ink-700: #1e222a;
  --gray-50: #f7f8fa;
  --gray-100: #eef0f4;
  --gray-200: #e3e6ec;
  --gray-300: #ced3dc;
  --gray-400: #8a929e;
  --gray-500: #5c636f;
  --gray-600: #4c535e;
  --gray-700: #363c45;

  /* Semânticas */
  --success: #15a34a;
  --success-bg: #dcfce7;
  --warning: #b45309;
  --warning-bg: #fef3c7;
  --info: #0369a1;
  --info-bg: #e0f2fe;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --violet: #6d28d9;
  --violet-bg: #ede9fe;
  --blue: #1d4ed8;
  --blue-bg: #dbeafe;

  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --input-bg: #ffffff;
  --ring: rgba(225, 29, 46, .13);
  --text: #16191f;
  --text-soft: #4c535e;
  --text-muted: #636a76;
  --border: #e3e6ec;
  --border-strong: #ced3dc;

  /* Forma */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;
  --r-full: 999px;

  --shadow-xs: 0 1px 2px rgba(11, 13, 16, .06);
  --shadow-sm: 0 2px 8px rgba(11, 13, 16, .06);
  --shadow-md: 0 8px 24px rgba(11, 13, 16, .08);
  --shadow-lg: 0 18px 46px rgba(11, 13, 16, .12);
  --shadow-red: 0 10px 26px rgba(225, 29, 46, .28);

  --nav-h: 72px;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.icon { flex-shrink: 0; }

::selection { background: var(--red); color: #fff; }

:focus-visible {
  outline: 3px solid rgba(225, 29, 46, .45);
  outline-offset: 2px;
  border-radius: 4px;
}

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }

/* =========================================================
   Navegação
   ========================================================= */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(11, 13, 16, .93);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  box-shadow: 0 1px 0 rgba(225, 29, 46, .35);
}

.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: var(--nav-h);
}

.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: #fff; }
.brand:hover .brand-name { color: var(--red); }

.brand-mark {
  display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 11px;
  background: linear-gradient(140deg, #ff4d4d, var(--red) 55%, var(--red-700));
  color: #fff; font-weight: 800; font-size: .95rem; letter-spacing: .5px;
  box-shadow: var(--shadow-red);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 800; font-size: 1.06rem; letter-spacing: .06em; transition: color .2s var(--ease); }
.brand-tag { font-size: .64rem; letter-spacing: .22em; text-transform: uppercase; color: #b8c0cc; font-weight: 600; }

.nav { display: flex; align-items: center; gap: .35rem; }
.nav a {
  position: relative;
  color: #cfd4dd; text-decoration: none; font-weight: 500; font-size: .95rem;
  padding: .5rem .85rem; border-radius: var(--r-sm);
  transition: color .2s var(--ease), background .2s var(--ease);
}
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.nav .nav-cta {
  background: linear-gradient(135deg, #ff4d4d, var(--red)); color: #fff !important;
  padding: .55rem 1.05rem; font-weight: 600; box-shadow: var(--shadow-red);
  margin-left: .4rem;
}
.nav .nav-cta:hover { filter: brightness(1.08); }

.menu-toggle {
  display: none; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12);
  color: #fff; width: 44px; height: 44px; border-radius: var(--r-sm);
  font-size: 1.4rem; cursor: pointer; line-height: 1;
  align-items: center; justify-content: center;
}

@media (max-width: 900px) {
  .menu-toggle { display: flex; }
  .nav {
    position: fixed; inset: var(--nav-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: .2rem;
    background: var(--ink-800); border-bottom: 1px solid rgba(255, 255, 255, .08);
    padding: 1rem 1.25rem 1.4rem; margin: 0;
    transform: translateY(-140%); opacity: 0; pointer-events: none;
    transition: transform .3s var(--ease), opacity .25s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  .nav.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav a { padding: .8rem .9rem; font-size: 1rem; }
  .nav .nav-cta { margin: .5rem 0 0; text-align: center; }
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative; overflow: hidden;
  background: radial-gradient(1100px 600px at 78% 12%, rgba(225, 29, 46, .20), transparent 62%),
              linear-gradient(160deg, #101319 0%, var(--ink) 55%, #06070a 100%);
  color: #fff;
  padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(3rem, 6vw, 5rem);
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: url("../img/pattern.svg");
  background-size: 60px 60px; opacity: .5; pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  background: linear-gradient(90deg, var(--red), #ff7b7b 40%, transparent);
}
.hero-inner {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 5vw, 4rem); align-items: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  color: #ff8b8b; font-weight: 700; text-transform: uppercase;
  font-size: .74rem; letter-spacing: .18em;
  background: rgba(225, 29, 46, .12); border: 1px solid rgba(225, 29, 46, .3);
  padding: .35rem .85rem; border-radius: var(--r-full);
}
.hero-text h1 {
  font-size: clamp(2.2rem, 5.6vw, 3.5rem); line-height: 1.08;
  margin: 1.1rem 0 .9rem; font-weight: 800; letter-spacing: -.02em;
}
.hero-text h1 span { color: var(--red); }
.hero-sub { color: #b9c0cb; font-size: clamp(1rem, 1.6vw, 1.12rem); max-width: 34rem; }
.hero-actions { margin-top: 1.9rem; display: flex; gap: .8rem; flex-wrap: wrap; }

.hero-stats { display: flex; gap: 2rem; margin-top: 2.4rem; flex-wrap: wrap; }
.hero-stat strong { display: block; font-size: 1.6rem; font-weight: 800; color: #fff; }
.hero-stat span { font-size: .78rem; color: var(--gray-400); text-transform: uppercase; letter-spacing: .1em; }

.hero-visual { position: relative; }
.hero-visual img { width: 100%; height: auto; border-radius: var(--r-xl); box-shadow: var(--shadow-lg); }
.hero-visual::after {
  content: ""; position: absolute; inset: 12% -6% -8% 8%; z-index: -1;
  background: linear-gradient(135deg, rgba(225, 29, 46, .35), transparent 65%);
  filter: blur(42px); border-radius: var(--r-xl);
}

@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { order: -1; max-width: 520px; margin: 0 auto; }
}

/* =========================================================
   Botões
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .75rem 1.4rem; border-radius: var(--r-sm);
  font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer;
  border: 1.5px solid transparent; white-space: nowrap;
  transition: transform .18s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: linear-gradient(135deg, #ff4d4d, var(--red) 60%); color: #fff; box-shadow: var(--shadow-red); }
.btn-primary:hover { filter: brightness(1.07); box-shadow: 0 14px 34px rgba(225, 29, 46, .36); }

.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #23272f; }

.btn-outline { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-outline:hover { border-color: var(--red); color: var(--red); background: var(--red-50); }

.btn-outline-light { background: rgba(255, 255, 255, .06); color: #fff; border-color: rgba(255, 255, 255, .22); }
.btn-outline-light:hover { border-color: #fff; background: rgba(255, 255, 255, .13); }

.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

.btn-sm { padding: .45rem .85rem; font-size: .85rem; border-radius: var(--r-sm); }
.btn-lg { padding: .9rem 1.8rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* =========================================================
   Seções
   ========================================================= */
.section { padding: clamp(3rem, 6vw, 5rem) 0; }
.section-alt { background: var(--gray-50); }
.section-dark { background: linear-gradient(160deg, #12151b, var(--ink)); color: #fff; }

.section-head { max-width: 46rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-kicker {
  display: inline-flex; align-items: center; gap: .45rem;
  color: var(--red-600); font-weight: 700; font-size: .76rem;
  text-transform: uppercase; letter-spacing: .16em; margin-bottom: .7rem;
}
.section-kicker::before { content: ""; width: 26px; height: 2px; background: var(--red); border-radius: 2px; }
.section-title { font-size: clamp(1.6rem, 3.4vw, 2.3rem); line-height: 1.18; letter-spacing: -.02em; font-weight: 800; }
.section-sub { color: var(--text-soft); margin-top: .7rem; font-size: 1.02rem; }
.section-dark .section-sub { color: #a8b0bc; }

.page-header { background: var(--gray-50); border-bottom: 1px solid var(--border); padding: clamp(2rem, 5vw, 3.2rem) 0; }
.page-header h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 800; letter-spacing: -.02em; }
.page-header p { color: var(--text-soft); margin-top: .35rem; }
.page-header-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.page-header-row h1 { font-size: clamp(1.5rem, 3.2vw, 1.9rem); font-weight: 800; letter-spacing: -.02em; }

/* =========================================================
   Grade e cartões
   ========================================================= */
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1000px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1.5rem;
  box-shadow: var(--shadow-xs);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
}
.card h2, .card h3 { font-size: 1.12rem; font-weight: 700; letter-spacing: -.01em; margin-bottom: .5rem; display: flex; align-items: center; gap: .5rem; }
.card h2 .icon, .card h3 .icon { color: var(--red); }
.card p { color: var(--text-soft); font-size: .95rem; }

.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.card-accent { position: relative; overflow: hidden; }
.card-accent::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 4px;
  background: linear-gradient(180deg, var(--red), #ff8a8a);
}

.icon-badge {
  display: grid; place-items: center; width: 54px; height: 54px;
  border-radius: 14px; margin-bottom: 1.1rem;
  background: linear-gradient(140deg, var(--red-50), #fff);
  border: 1px solid var(--red-100); color: var(--red);
  transition: transform .25s var(--ease), background .25s var(--ease), color .25s var(--ease);
}
.card-hover:hover .icon-badge { background: linear-gradient(140deg, #ff4d4d, var(--red)); color: #fff; transform: scale(1.06); border-color: transparent; }
.icon-badge-dark { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .14); color: #ff8b8b; }

/* =========================================================
   Serviços
   ========================================================= */
.service-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
@media (max-width: 860px) { .service-list { grid-template-columns: 1fr; } }

.service-item {
  display: flex; gap: 1.15rem; align-items: flex-start;
  padding: 1.6rem; border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--shadow-xs);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
}
.service-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--red-100); }
.service-item h3 { font-size: 1.1rem; font-weight: 700; margin: 0 0 .4rem; }
.service-item p { color: var(--text-soft); font-size: .93rem; margin: 0; }
.service-item ul { margin: .7rem 0 0; padding-left: 1.1rem; color: var(--text-soft); font-size: .9rem; }
.service-item li { margin-bottom: .25rem; }

/* Galeria */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
@media (max-width: 900px) { .gallery { grid-template-columns: 1fr; } }
.gallery-item {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.gallery-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.gallery-item img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.gallery-item figcaption {
  position: absolute; inset: auto 0 0 0; padding: 1.6rem 1.1rem .9rem;
  background: linear-gradient(to top, rgba(11, 13, 16, .92), transparent);
  color: #fff;
}
.gallery-item figcaption strong { display: block; font-size: 1rem; font-weight: 700; }
.gallery-item figcaption span { font-size: .82rem; color: #b9c0cb; }

/* =========================================================
   Passos
   ========================================================= */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; counter-reset: step; }
@media (max-width: 960px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; padding: 1.5rem 1.4rem 1.4rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.step::before {
  counter-increment: step; content: "0" counter(step);
  position: absolute; top: -14px; left: 1.3rem;
  background: linear-gradient(135deg, #ff4d4d, var(--red)); color: #fff;
  font-weight: 800; font-size: .78rem; letter-spacing: .04em;
  padding: .28rem .65rem; border-radius: var(--r-full); box-shadow: var(--shadow-red);
}
.step h3 { margin: .6rem 0 .35rem; font-size: 1rem; font-weight: 700; }
.step p { color: var(--text-soft); font-size: .9rem; margin: 0; }

/* =========================================================
   Formulários
   ========================================================= */
.form { display: flex; flex-direction: column; gap: 1rem; }
.form label { font-weight: 600; font-size: .88rem; color: var(--text); letter-spacing: .01em; }
.form input, .form select, .form textarea {
  width: 100%; padding: .78rem .95rem;
  border: 1.5px solid var(--border); border-radius: var(--r-sm);
  background: var(--input-bg); font-size: 1rem; color: var(--text);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
.form textarea { resize: vertical; min-height: 88px; }
.form input::placeholder, .form textarea::placeholder { color: #a8b0bc; }
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none; border-color: var(--red); box-shadow: 0 0 0 4px var(--ring);
}
.form input:disabled { background: var(--gray-50); color: var(--text-muted); cursor: not-allowed; }
.form select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7380' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .8rem center; background-size: 18px; padding-right: 2.4rem;
}
.form h2, .form h3 { font-size: 1rem; font-weight: 700; margin-top: .6rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: .45rem; }
.form h2 .icon, .form h3 .icon { color: var(--red); }
.form-card { max-width: 720px; margin: 0 auto; }
.filter-row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.25rem; }
.filter-row input, .filter-row select {
  padding: .6rem .9rem; border: 1.5px solid var(--border); border-radius: var(--r-sm); background: var(--input-bg); color: var(--text); font-size: .95rem;
}
.filter-row input:focus, .filter-row select:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 4px var(--ring); }

/* =========================================================
   Flash
   ========================================================= */
.flash-wrap { padding-top: 1rem; }
.flash {
  display: flex; align-items: center; gap: .6rem;
  padding: .9rem 1.1rem; border-radius: var(--r-sm); margin-bottom: .6rem;
  font-weight: 500; font-size: .93rem; border: 1px solid transparent;
}
.flash-success { background: var(--success-bg); color: #14532d; border-color: #86efac; }
.flash-danger { background: var(--danger-bg); color: #991b1b; border-color: #fca5a5; }
.flash-info { background: var(--info-bg); color: #075985; border-color: #7dd3fc; }
.flash-warning { background: var(--warning-bg); color: #92400e; border-color: #fde047; }

/* =========================================================
   Badges de status
   ========================================================= */
.badge {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .3rem .7rem; border-radius: var(--r-full);
  font-size: .73rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-recebida { background: var(--gray-100); color: var(--gray-600); }
.badge-em-diagnostico, .badge-em-diagnóstico { background: var(--blue-bg); color: var(--blue); }
.badge-aguardando-peca, .badge-aguardando-peça { background: var(--warning-bg); color: var(--warning); }
.badge-em-execucao, .badge-em-execução { background: var(--violet-bg); color: var(--violet); }
.badge-finalizada { background: var(--success-bg); color: #15803d; }
.badge-entregue { background: #d1fae5; color: #047857; }
.badge-cancelada { background: var(--danger-bg); color: var(--danger); }

/* =========================================================
   Ordens de serviço
   ========================================================= */
.os-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.25rem; }
.os-card {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-xs);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease);
}
.os-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.os-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--red); }
.os-card-header {
  display: flex; justify-content: space-between; align-items: center; gap: .75rem;
  padding: 1rem 1.15rem 1rem 1.4rem; background: var(--gray-50); border-bottom: 1px solid var(--border);
}
.os-card-header strong { font-size: 1rem; font-weight: 800; letter-spacing: .02em; }
.os-card-body { padding: 1.15rem 1.15rem 1.15rem 1.4rem; }
.os-card-body p { margin: 0 0 .45rem; font-size: .9rem; color: var(--text-soft); }
.os-card-body p:last-child { margin-bottom: 0; }
.os-card-body strong { color: var(--text); font-weight: 600; }
.os-card-footer { padding: .9rem 1.15rem .9rem 1.4rem; border-top: 1px solid var(--border); background: var(--gray-50); display: flex; gap: .6rem; flex-wrap: wrap; }

/* =========================================================
   Fotos
   ========================================================= */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.1rem; }
.photo-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-xs);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.photo-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.photo-card img { width: 100%; height: 190px; object-fit: cover; background: var(--gray-100); }
.photo-obs { padding: .75rem .9rem .3rem; margin: 0; font-size: .88rem; color: var(--text); }
.photo-card .muted { padding: .2rem .9rem .85rem; display: block; margin-top: auto; }
.photo-card form { padding: 0 .9rem .9rem; }

/* =========================================================
   Chat
   ========================================================= */
.chat-box { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-xs); }
.chat-messages {
  max-height: 440px; overflow-y: auto; padding: 1.25rem;
  background: var(--gray-50); display: flex; flex-direction: column; gap: .8rem;
}
.chat-msg { display: flex; }
.chat-cliente { justify-content: flex-end; }
.chat-oficina { justify-content: flex-start; }
.chat-bubble {
  max-width: 78%; padding: .75rem 1rem; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--border); box-shadow: var(--shadow-xs);
}
.chat-cliente .chat-bubble { background: linear-gradient(135deg, #ff4d4d, var(--red)); color: #fff; border-color: transparent; }
.chat-who { font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; display: block; margin-bottom: .25rem; opacity: .95; }
.chat-bubble p { margin: 0; font-size: .93rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.chat-time { font-size: .68rem; opacity: .85; display: block; margin-top: .35rem; }
.chat-form { display: flex; gap: .6rem; padding: .9rem; background: var(--surface); border-top: 1px solid var(--border); }
.chat-form input {
  flex: 1; padding: .75rem 1rem; border: 1.5px solid var(--border);
  border-radius: var(--r-full); font-size: .98rem; background: var(--gray-50);
}
.chat-form input:focus { outline: none; border-color: var(--red); background: var(--input-bg); box-shadow: 0 0 0 4px var(--ring); }

/* =========================================================
   Blocos auxiliares
   ========================================================= */
.share-box { display: flex; gap: .5rem; flex-wrap: wrap; }
.share-box input {
  flex: 1; min-width: 200px; padding: .6rem .85rem; font-size: .84rem;
  border: 1.5px solid var(--border); border-radius: var(--r-sm); background: var(--gray-50); color: var(--text-soft);
}
.info-box {
  display: flex; gap: .8rem; align-items: flex-start;
  background: var(--info-bg); border: 1px solid #bae6fd; color: #075985;
  padding: .95rem 1.1rem; border-radius: var(--r-md); font-size: .92rem;
}
.info-box strong { display: block; margin-bottom: .15rem; }

.cta-band {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #1a1d24, var(--ink)); color: #fff;
  border-radius: var(--r-xl); padding: clamp(2rem, 5vw, 3.2rem);
  text-align: center; box-shadow: var(--shadow-lg);
}
.cta-band::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(600px 240px at 50% 0%, rgba(225, 29, 46, .28), transparent 70%);
}
.cta-band > * { position: relative; z-index: 1; }
.cta-band h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); font-weight: 800; letter-spacing: -.02em; }
.cta-band p { color: #b9c0cb; margin: .7rem auto 1.6rem; max-width: 40rem; }

/* Contato */
.contact-card { display: flex; gap: 1rem; align-items: flex-start; }
.contact-card .icon-badge { margin-bottom: 0; }
.contact-card a { color: var(--red); font-weight: 600; text-decoration: none; }
.contact-card a:hover { text-decoration: underline; }

/* =========================================================
   Tabelas
   ========================================================= */
.table-wrap {
  overflow-x: auto; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
}
.table { width: 100%; border-collapse: collapse; min-width: 620px; }
.table th, .table td { padding: .85rem 1rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table thead th {
  background: var(--gray-50); font-weight: 700; font-size: .74rem;
  text-transform: uppercase; letter-spacing: .08em; color: var(--gray-600);
  position: sticky; top: 0; text-align: left;
}
.table tbody tr { transition: background .15s var(--ease); }
.table tbody tr:hover { background: var(--gray-50); }
.table tbody tr:last-child td { border-bottom: none; }
.table td { font-size: .92rem; }
.actions { display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; }

/* =========================================================
   Layout admin
   ========================================================= */
.admin-layout { display: flex; min-height: calc(100vh - var(--nav-h)); background: var(--gray-50); }
.sidebar {
  width: 258px; flex-shrink: 0; padding: 1.5rem 1rem;
  background: linear-gradient(180deg, #12151b, #0a0c0f);
  color: #fff; position: sticky; top: var(--nav-h); height: calc(100vh - var(--nav-h));
  overflow-y: auto;
}
.sidebar-brand { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.6rem; padding-left: .4rem; }
.sidebar-brand .brand-name { font-size: .95rem; letter-spacing: .1em; }
.sidebar-nav { display: flex; flex-direction: column; gap: .25rem; }
.sidebar-nav a {
  display: flex; align-items: center; gap: .7rem;
  color: #a8b0bc; text-decoration: none; padding: .68rem .8rem;
  border-radius: var(--r-sm); font-weight: 500; font-size: .93rem;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.sidebar-nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sidebar-nav a .icon { opacity: .8; }
.sidebar-sep { height: 1px; background: rgba(255, 255, 255, .1); margin: .7rem .4rem; }
.sidebar-logout { color: #fca5a5 !important; }
.sidebar-logout:hover { background: rgba(225, 29, 46, .16) !important; color: #fecaca !important; }

.admin-content { flex: 1; min-width: 0; padding: clamp(1.2rem, 3vw, 2rem); }
.admin-content > h1 { font-size: clamp(1.4rem, 3vw, 1.8rem); font-weight: 800; letter-spacing: -.02em; margin-bottom: 1.2rem; }

@media (max-width: 900px) {
  .admin-layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar-nav a { padding: .5rem .7rem; font-size: .87rem; }
}

/* Stat tiles */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1.1rem; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1.15rem 1.25rem; box-shadow: var(--shadow-xs);
  position: relative; overflow: hidden;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-card::after {
  content: ""; position: absolute; right: -18px; top: -18px;
  width: 70px; height: 70px; border-radius: 50%; background: var(--red-50);
}
.stat-label { display: block; color: var(--text-muted); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; position: relative; z-index: 1; }
.stat-value { display: block; font-size: 1.75rem; font-weight: 800; margin-top: .3rem; letter-spacing: -.02em; position: relative; z-index: 1; }

/* Login */
.login-wrap { min-height: calc(100vh - var(--nav-h)); display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; background: radial-gradient(900px 500px at 50% 0%, rgba(225, 29, 46, .12), transparent 65%), var(--gray-50); }
.login-card {
  width: 100%; max-width: 410px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-xl);
  padding: 2.2rem 2rem; box-shadow: var(--shadow-lg);
}
.login-logo { display: flex; align-items: center; justify-content: center; gap: .6rem; margin-bottom: 1.2rem; }
.login-card .brand { color: var(--text); }
.login-card .brand-name { color: var(--text); }
.login-card .brand-tag { color: var(--gray-600); }
.login-card h1 { font-size: 1.2rem; font-weight: 700; text-align: center; margin-bottom: 1.4rem; }

/* =========================================================
   Rodapé
   ========================================================= */
.footer { background: var(--ink); color: #a8b0bc; margin-top: clamp(3rem, 7vw, 5rem); position: relative; }
.footer::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--red), #ff7b7b 50%, transparent); }
.footer-inner { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; padding: 3rem 0 2rem; }
.footer h2 { color: #fff; font-size: .95rem; font-weight: 700; margin-bottom: .8rem; }
.footer-inner p { font-size: .9rem; margin-bottom: .3rem; }
.footer-links { display: flex; flex-direction: column; gap: .5rem; }
.footer-links a { color: #a8b0bc; text-decoration: none; font-size: .9rem; }
.footer-links a:hover { color: #ff8b8b; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .09); padding: 1.2rem 0; font-size: .84rem; color: #98a0ac; }

/* =========================================================
   Utilitários
   ========================================================= */
.muted { color: var(--text-muted); }
.small { font-size: .86rem; }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: .6rem; }
.mt-2 { margin-top: 1.2rem; }
.mt-3 { margin-top: 2rem; }
.mb-1 { margin-bottom: .6rem; }
.mb-2 { margin-bottom: 1.2rem; }
.mb-3 { margin-bottom: 2rem; }
.nowrap { white-space: nowrap; }
.text-red { color: var(--red-600); }
.text-green { color: var(--success); }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }

.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--text-muted); }
.empty-state .icon { margin: 0 auto .8rem; color: var(--border-strong); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

@media print {
  .topbar, .footer, .sidebar, .btn { display: none !important; }
  body { background: #fff; }
}

/* =========================================================
   TEMA ESCURO
   ========================================================= */
body.tema-escuro {
  --bg: #0a0c10;
  --surface: #14171d;
  --surface-2: #1b1f27;
  --input-bg: #171b22;
  --text: #e9ecf1;
  --text-soft: #aab2be;
  --text-muted: #7e8794;
  --border: #262b34;
  --border-strong: #3a424e;

  --gray-50: #171b22;
  --gray-100: #1c212a;
  --gray-200: #242a34;
  --gray-300: #303743;
  --gray-400: #6d7684;
  --gray-500: #8b93a0;
  --gray-600: #aeb6c2;
  --gray-700: #ccd2da;

  --red-50: #2a1114;
  --red-100: #3d181c;

  --success-bg: #0d2a19;
  --danger-bg: #331314;
  --warning-bg: #33260a;
  --info-bg: #0b2437;
  --violet-bg: #241a3d;
  --blue-bg: #0f2044;

  --success: #4ade80;
  --danger: #f87171;
  --warning: #fbbf24;
  --info: #60a5fa;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .45);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, .45);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, .5);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, .6);
  --ring: rgba(225, 29, 46, .28);

  color-scheme: dark;
}

body.tema-escuro .section-alt,
body.tema-escuro .page-header { background: #0e1117; }

body.tema-escuro .hero {
  background:
    radial-gradient(1100px 600px at 78% 12%, rgba(225, 29, 46, .22), transparent 62%),
    linear-gradient(160deg, #12151c 0%, #0b0d12 55%, #07080b 100%);
}

body.tema-escuro .hero::after {
  background: linear-gradient(90deg, var(--red), #ff7b7b 40%, transparent);
}

body.tema-escuro .section-dark {
  background: linear-gradient(160deg, #10131a, #0a0c10);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

body.tema-escuro .footer {
  background: #07080b;
  border-top: 1px solid var(--border);
}
body.tema-escuro .footer::before { opacity: .8; }
body.tema-escuro .footer-bottom { border-top-color: var(--border); color: #6b7280; }

body.tema-escuro .cta-band {
  background: linear-gradient(140deg, #171b23, #0e1117);
  border: 1px solid var(--border);
}

body.tema-escuro .admin-layout { background: #0e1117; }
body.tema-escuro .sidebar {
  background: linear-gradient(180deg, #12151b, #0a0c10);
  border-right: 1px solid var(--border);
}

body.tema-escuro .topbar {
  background: rgba(10, 12, 16, .9);
  border-bottom-color: var(--border);
  box-shadow: 0 1px 0 rgba(225, 29, 46, .28);
}

body.tema-escuro .icon-badge {
  background: linear-gradient(140deg, #241a1d, #171b22);
  border-color: var(--border);
  color: #ff7b7b;
}
body.tema-escuro .card-hover:hover .icon-badge {
  background: linear-gradient(140deg, #ff4d4d, var(--red));
  color: #fff;
  border-color: transparent;
}

body.tema-escuro .table thead th { background: #12161d; color: var(--gray-500); }
body.tema-escuro .table tbody tr:hover { background: #171b22; }
body.tema-escuro .table-wrap { background: var(--surface); }

body.tema-escuro .btn-outline { border-color: var(--border-strong); color: var(--text); }
body.tema-escuro .btn-outline:hover { background: var(--red-50); border-color: var(--red); color: #ff7b7b; }
body.tema-escuro .btn-danger { background: var(--danger-bg); color: #fca5a5; border-color: #5c1f22; }
body.tema-escuro .btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
body.tema-escuro .btn-dark { background: #222731; color: #fff; }

body.tema-escuro .badge-recebida { background: #232a34; color: #b6bdc8; }
body.tema-escuro .badge-em-diagnostico,
body.tema-escuro .badge-em-diagnóstico { background: #10233f; color: #7cb0f5; }
body.tema-escuro .badge-aguardando-peca,
body.tema-escuro .badge-aguardando-peça { background: #3a2c0c; color: #fbbf24; }
body.tema-escuro .badge-em-execucao,
body.tema-escuro .badge-em-execução { background: #261a44; color: #c4b0f5; }
body.tema-escuro .badge-finalizada { background: #0d2a19; color: #6ee7a0; }
body.tema-escuro .badge-entregue { background: #0a2c22; color: #5eead4; }
body.tema-escuro .badge-cancelada { background: #331314; color: #fca5a5; }

body.tema-escuro .flash-success { background: #0d2a19; color: #86efac; border-color: #14532d; }
body.tema-escuro .flash-danger { background: #331314; color: #fca5a5; border-color: #7f1d1d; }
body.tema-escuro .flash-info { background: #0b2437; color: #7dd3fc; border-color: #075985; }
body.tema-escuro .flash-warning { background: #33260a; color: #fde047; border-color: #78350f; }

body.tema-escuro .info-box { background: #0b2437; border-color: #0c4a6e; color: #bae6fd; }

body.tema-escuro .photo-card img { background: #11151b; }
body.tema-escuro .share-box input { background: #11151b; color: var(--text-soft); }
body.tema-escuro .filter-row input, body.tema-escuro .filter-row select { color: var(--text); }
body.tema-escuro .form select option { background: #171b22; color: var(--text); }
body.tema-escuro .empty-state .icon { color: #333b47; }
body.tema-escuro .muted { color: var(--text-muted); }

body.tema-escuro ::selection { background: var(--red); color: #fff; }
body.tema-escuro ::-webkit-scrollbar { width: 10px; height: 10px; }
body.tema-escuro ::-webkit-scrollbar-track { background: #0e1117; }
body.tema-escuro ::-webkit-scrollbar-thumb { background: #2a313b; border-radius: 6px; }
body.tema-escuro ::-webkit-scrollbar-thumb:hover { background: #3a424e; }

/* ---- componentes novos ---- */
.alert {
  display: flex; gap: .8rem; align-items: flex-start;
  padding: .95rem 1.1rem; border-radius: var(--r-md);
  border: 1px solid transparent; font-size: .93rem; margin-bottom: 1.4rem;
}
.alert strong { display: block; margin-bottom: .15rem; }
.alert-warning { background: var(--warning-bg); border-color: #fde047; color: var(--warning); }
.alert-danger { background: var(--danger-bg); border-color: #fca5a5; color: var(--danger); }
.alert-info { background: var(--info-bg); border-color: #7dd3fc; color: var(--info); }

.error-card { text-align: center; max-width: 620px; margin: 2rem auto; padding: 2.5rem 2rem; }
.error-code {
  font-size: 4.5rem; font-weight: 800; line-height: 1; letter-spacing: -.04em;
  background: linear-gradient(135deg, #ff4d4d, var(--red));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: .6rem;
}

.check-list { list-style: none; margin: 0; padding: 0; }
.check-list li {
  position: relative; padding-left: 1.9rem; margin-bottom: .55rem;
  color: var(--text-soft); font-size: .92rem;
}
.check-list li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  width: 1.35rem; height: 1.35rem; border-radius: 50%;
  background: rgba(34, 197, 94, .14); color: #4ade80;
  display: grid; place-items: center; font-size: .78rem; font-weight: 700;
}

.sidebar-logout-form { margin: 0; }
.sidebar-logout {
  display: flex; align-items: center; gap: .7rem; width: 100%;
  background: none; border: none; cursor: pointer;
  color: #fca5a5; text-decoration: none; padding: .68rem .8rem;
  border-radius: var(--r-sm); font-weight: 500; font-size: .93rem; font-family: inherit;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.sidebar-logout:hover { background: rgba(225, 29, 46, .16) !important; color: #fecaca !important; }

/* =========================================================
   Controle mensal (relatorio por plano de contas)
   ========================================================= */
.table tfoot th, .table tfoot td {
  background: var(--gray-50);
  font-weight: 800;
  font-size: .92rem;
  border-top: 2px solid var(--border);
  border-bottom: none;
}
.table tfoot .text-green { color: var(--success); }
.table tfoot .text-red { color: var(--red-600); }

.relatorio-secao th {
  background: rgba(225, 29, 46, .08);
  color: var(--text);
  font-size: .74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .09em;
  padding: .6rem 1rem;
}
.relatorio-secao:hover th { background: rgba(225, 29, 46, .12); }

.relatorio-atual { background: rgba(225, 29, 46, .06); }
.relatorio-atual td { font-weight: 700; }
.relatorio-atual td a { color: var(--red-600); font-weight: 800; }

.table tbody tr a { color: var(--text); text-decoration: none; }
.table tbody tr a:hover { color: var(--red-600); text-decoration: underline; }
