/* Agilizando SS — tema industrial escuro (grafite/aço + vermelho) */

:root {
  --bg: #0d0f11;
  --bg-elevated: #14171a;
  --surface: #191d21;
  --surface-2: #22272c;
  --border: #2c3238;
  --border-strong: #3a4249;
  --text: #eef1f3;
  --muted: #98a3ac;
  --primary: #d92027;
  --primary-hover: #b8171e;
  --primary-bright: #ff777b;
  --primary-soft: rgba(217, 32, 39, 0.12);
  --success: #2ea86a;
  --warning: #e0a324;
  --danger: #e0413f;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.9);
  --maxw: 1180px;
  --header-h: 72px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .display {
  font-family: "Barlow Condensed", "Barlow", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.08;
  margin: 0 0 0.5em;
  font-weight: 700;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1rem; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

.section { padding: 72px 0; }
.section--tight { padding: 44px 0; }
.section--alt { background: var(--bg-elevated); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Barlow Condensed", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 12px;
}

.muted { color: var(--muted); }
.lead { font-size: 1.08rem; color: var(--muted); max-width: 62ch; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 24px; }
.stack > * + * { margin-top: 14px; }

.icon { width: 22px; height: 22px; flex-shrink: 0; }
.icon-lg { width: 30px; height: 30px; }
.icon-sm { width: 16px; height: 16px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(13, 15, 17, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  font-size: 1.45rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.brand .brand-mark {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1rem;
}

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

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

.nav a {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--muted);
  transition: color 0.15s, background 0.15s;
}

.nav a:hover { color: var(--text); background: var(--surface); }
.nav a.active { color: var(--text); }
.nav a.active::after {
  content: "";
  display: block;
  height: 2px;
  background: var(--primary);
  margin-top: 4px;
}
.nav-toggle {
  display: none;
  margin-left: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  cursor: pointer;
}

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: 10px 20px 18px;
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 4px; }
  .nav .btn { margin-top: 10px; justify-content: center; }
}

/* ---------- Botões ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
  background: var(--primary);
  color: #fff;
}

.btn:hover { background: var(--primary-hover); }
.btn:active { transform: translateY(1px); }

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

.btn--ghost { background: transparent; color: var(--muted); }
.btn--ghost:hover { background: var(--surface); color: var(--text); }

.btn--danger { background: transparent; border-color: rgba(224, 65, 63, 0.4); color: var(--danger); }
.btn--danger:hover { background: rgba(224, 65, 63, 0.12); }

.btn--sm { padding: 7px 12px; font-size: 0.9rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: 96px 0 84px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(120% 90% at 85% 0%, rgba(217, 32, 39, 0.16), transparent 60%),
    linear-gradient(180deg, #121517 0%, var(--bg) 100%);
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(135deg, rgba(255,255,255,0.025) 0 2px, transparent 2px 10px);
  pointer-events: none;
}

.hero .container { position: relative; z-index: 1; }
.hero h1 { max-width: 20ch; }
.hero h1 .accent { color: var(--primary); }
.hero-title { display: block; width: fit-content; }
.hero-title__line { display: block; white-space: nowrap; }
.hero-title__motion {
  color: transparent;
  background: linear-gradient(100deg, var(--text) 6%, var(--text) 25%, var(--primary) 43%, var(--primary-bright) 50%, var(--primary) 57%, var(--text) 75%, var(--text) 94%);
  background-size: 320% 100%;
  background-position: 100% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: hero-title-gradient 3.8s linear infinite;
}
@keyframes hero-title-gradient {
  from { background-position: 100% 50%; }
  to { background-position: 0% 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-title__motion { animation: none; background-position: 50% 50%; }
}
@media (max-width: 520px) {
  .hero-title__line { white-space: normal; }
}
.hero .lead { margin-bottom: 28px; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-top: 52px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.hero-stats strong {
  display: block;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 2rem;
  color: var(--primary);
  line-height: 1;
}

.hero-stats span { font-size: 0.9rem; color: var(--muted); }

/* ---------- Cards / grid ---------- */

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.card--flat { box-shadow: none; }
.card--pad-sm { padding: 16px; }

.card-service .icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  margin-bottom: 14px;
}

.card-service h3 { margin-bottom: 6px; }
.card-service p { color: var(--muted); margin: 0; font-size: 0.95rem; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.card-header h2, .card-header h3 { margin: 0; }

/* ---------- Produtos ---------- */

.product-media {
  aspect-ratio: 4 / 3;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}

.product-media img { width: 100%; height: 100%; object-fit: cover; }
.product-media .placeholder { color: var(--border-strong); }

.price {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.price--neutral { color: var(--text); }
.price--success { color: var(--success); }
.price--warning { color: var(--warning); }

.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.thumb {
  position: relative;
  width: 62px;
  height: 62px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0,0,0,0.7);
  border: none;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  padding: 3px 5px;
}

/* ---------- Badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
}

.badge--primary { background: var(--primary-soft); border-color: rgba(217,32,39,0.35); color: #ff6b6f; }
.badge--success { background: rgba(46,168,106,0.12); border-color: rgba(46,168,106,0.35); color: #4fd18d; }
.badge--warning { background: rgba(224,163,36,0.12); border-color: rgba(224,163,36,0.35); color: #ecc05a; }
.badge--danger  { background: rgba(224,65,63,0.12); border-color: rgba(224,65,63,0.35); color: #f0706e; }

/* ---------- Formulários ---------- */

.field { margin-bottom: 14px; }

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 6px;
}

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="search"], input[type="file"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.98rem;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

textarea { min-height: 110px; resize: vertical; }

.field-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.checkbox-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.95rem;
  color: var(--text);
}
.checkbox-inline input { width: auto; }

.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- Tabelas ---------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }

table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }

th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }

th {
  background: var(--bg-elevated);
  font-family: "Barlow Condensed", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.02); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Abas ---------- */

.tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  margin-bottom: 26px;
}

.tabs a {
  padding: 10px 16px;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--text); border-bottom-color: var(--primary); }

/* ---------- Alertas ---------- */

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.alert--success { border-color: rgba(46,168,106,0.4); background: rgba(46,168,106,0.1); }
.alert--error { border-color: rgba(224,65,63,0.4); background: rgba(224,65,63,0.1); }
.alert--info { border-color: rgba(217,32,39,0.3); background: var(--primary-soft); }
.alert--warning { border-color: rgba(224,163,36,0.4); background: rgba(224,163,36,0.1); }
.alert--neutral { border-color: var(--border-strong); background: var(--surface-2); }

.empty {
  padding: 34px 20px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

/* ---------- Auth ---------- */

.auth-wrap {
  min-height: calc(100vh - var(--header-h));
  display: grid;
  place-items: center;
  padding: 48px 20px;
  background: radial-gradient(90% 70% at 50% 0%, rgba(217,32,39,0.1), transparent 65%);
}

.auth-card { width: 100%; max-width: 430px; }

/* ---------- Blog ---------- */

.post-cover {
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 14px;
}
.post-cover img { width: 100%; height: 100%; object-fit: cover; }

.post-body { max-width: 72ch; font-size: 1.05rem; }
.post-body p { white-space: pre-wrap; }

/* ---------- Contato ---------- */

.contact-item { display: flex; gap: 12px; align-items: flex-start; }
.contact-item .icon { color: var(--primary); margin-top: 3px; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  padding: 48px 0 26px;
  margin-top: auto;
}

.footer-grid { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.footer-grid h4 { font-size: 1.05rem; margin-bottom: 12px; }
.footer-grid a { color: var(--muted); }
.footer-grid a:hover { color: var(--primary); }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 8px; }

.footer-bottom {
  border-top: 1px solid var(--border);
  margin-top: 32px;
  padding-top: 18px;
  font-size: 0.86rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- Whatsapp flutuante ---------- */

.wa-float {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #25d366;
  color: #06301a;
  box-shadow: 0 12px 26px -10px rgba(0,0,0,0.8);
}

/* ---------- Layout base ---------- */

body { display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; }

/* ---------- Impressão da OS ---------- */

@media print {
  .no-print { display: none !important; }
}

/* ---------- Painel: itens da OS, galeria e ações ---------- */

.form-section {
  margin: 26px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
}

.table--items input,
.table--items select {
  width: 100%;
  padding: 7px 9px;
  font-size: 0.9rem;
}

.actions-cell {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.inline-group {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.inline-group input,
.inline-group select { flex: 1 1 110px; }

.thumb-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.thumb {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

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

.thumb form { position: absolute; top: 2px; right: 2px; }

.thumb button {
  width: 20px;
  height: 20px;
  line-height: 1;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.72);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
}

details > summary {
  cursor: pointer;
  font-size: 0.9rem;
  padding: 4px 0;
}

.brand-logo {
  height: 46px;
  width: auto;
  display: block;
}
.site-footer .brand-logo { height: 54px; }
@media (max-width: 640px) { .brand-logo { height: 38px; } }

/* ---------- editor de conteúdo (blog) ---------- */
.editor-toolbar{display:flex;flex-wrap:wrap;gap:6px;align-items:center;padding:8px;border:1px solid var(--line);border-bottom:0;border-radius:10px 10px 0 0;background:rgba(255,255,255,.03)}
.editor-toolbar select{min-width:120px;padding:6px 8px;font-size:.85rem}
.editor{min-height:260px;max-height:520px;overflow:auto;padding:16px;border:1px solid var(--line);border-radius:0 0 10px 10px;background:var(--surface-2, rgba(0,0,0,.25));color:var(--text);line-height:1.65}
.editor:focus{outline:2px solid var(--primary);outline-offset:-2px}
.editor img{max-width:100%;height:auto;border-radius:8px;margin:10px 0}
.editor a{color:var(--primary)}
.editor blockquote{margin:12px 0;padding-left:14px;border-left:3px solid var(--primary);color:var(--muted)}
.post-body img{max-width:100%;height:auto;border-radius:10px;margin:16px 0}
.post-body a{color:var(--primary)}
.post-body blockquote{margin:16px 0;padding-left:16px;border-left:3px solid var(--primary);color:var(--muted)}
.post-body h2,.post-body h3{margin:22px 0 10px}

/* ---------- listagem de ferramentas ---------- */
.tool-list{display:flex;flex-direction:column;gap:8px}
.tool-row{display:flex;flex-wrap:wrap;align-items:center;gap:10px 12px;padding:8px 12px;min-height:52px;border:1px solid var(--line);border-radius:10px;background:rgba(255,255,255,.03)}
.tool-row--check{cursor:pointer}
.tool-row--check:has(input:checked){border-color:rgba(46,168,106,.55);background:rgba(46,168,106,.10)}
.tool-row input[type=checkbox]{width:20px;height:20px;flex:none;accent-color:var(--primary)}
.tool-thumb{width:38px;height:38px;flex:none;border-radius:8px;object-fit:cover;border:1px solid var(--line);background:rgba(0,0,0,.25);cursor:zoom-in}
.tool-thumb--empty,.tool-thumb--kit{display:flex;align-items:center;justify-content:center;color:var(--border-strong);cursor:default}
.tool-row__main{flex:1 1 240px;min-width:0;display:flex;flex-direction:column;gap:2px}
.tool-row__main strong{font-size:1rem}
.tool-row__main .muted{font-size:.85rem}
.tool-row>.badge{flex:none;align-self:center;white-space:nowrap}
.tool-row__actions{display:flex;align-items:center;gap:8px;flex:none;margin-left:auto}
.tool-row__actions select{padding:6px 8px;font-size:.82rem}
@media (max-width:720px){.tool-row__main{flex:1 1 100%}.tool-row__actions{margin-left:0}}

.lightbox{position:fixed;inset:0;z-index:200;background:rgba(0,0,0,.85);display:flex;align-items:center;justify-content:center;padding:24px;cursor:zoom-out}
.lightbox[hidden]{display:none}
.lightbox img{max-width:92vw;max-height:88vh;border-radius:10px;box-shadow:0 20px 60px rgba(0,0,0,.6)}
.tool-edit{flex:1 1 100%;margin-top:6px;border-top:1px dashed var(--line);padding-top:8px}
.tool-edit>summary{cursor:pointer;font-size:.85rem;color:var(--muted);list-style:none;display:inline-flex;align-items:center;gap:6px}
.tool-edit>summary::before{content:"✎"}
.tool-edit>summary:hover{color:var(--primary)}
.tool-edit[open]>summary{color:var(--primary);margin-bottom:10px}
.tool-edit .field-row{margin-bottom:8px}
a.badge{text-decoration:none}

/* Ferramentas: linha compacta + ficha */
.tool-row__main strong,.tool-row__title{font-family:"Barlow Condensed",sans-serif;font-size:1.05rem;font-weight:700;text-transform:uppercase;letter-spacing:.02em;color:var(--text);line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;max-width:100%}
.tool-row__title:hover{color:var(--primary)}
.tool-row__main .muted{font-size:.8rem;line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.tool-sheet{display:grid;grid-template-columns:280px 1fr;gap:24px;margin-top:18px}
.tool-sheet__media{background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius);aspect-ratio:1;display:grid;place-items:center;overflow:hidden}
.tool-sheet__media img{width:100%;height:100%;object-fit:cover;cursor:zoom-in}
.tool-sheet__media .placeholder{color:var(--border-strong)}
@media (max-width:720px){.tool-sheet{grid-template-columns:1fr}}
.data-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;margin:16px 0 0}
.data-list dt{font-size:.75rem;text-transform:uppercase;letter-spacing:.12em;color:var(--muted)}
.data-list dd{margin:2px 0 0;font-weight:600}

/* Edição rápida de textos (master) */
.editable{outline:1px dashed rgba(217,32,39,.45);outline-offset:3px;border-radius:3px;cursor:text;transition:background .15s}
.editable:hover{background:rgba(217,32,39,.10)}
.editable:focus{outline:2px solid var(--primary);background:rgba(217,32,39,.08)}
.edit-bar{position:fixed;left:50%;transform:translateX(-50%);bottom:18px;z-index:300;display:flex;align-items:center;gap:12px;padding:10px 16px;border-radius:999px;background:var(--surface);border:1px solid var(--border-strong);box-shadow:var(--shadow);font-size:.9rem}
.edit-bar[hidden]{display:none}


/* ---------- Páginas legais + banner de cookies ---------- */
.container--narrow { max-width: 860px; }
.legal h2 { font-size: 1.15rem; margin: 28px 0 8px; }
.legal p, .legal li { line-height: 1.75; }
.legal ul { padding-left: 20px; margin-bottom: 8px; }
.legal li { margin-bottom: 6px; }
.legal code { background: rgba(255,255,255,.08); padding: 1px 6px; border-radius: 4px; font-size: .9em; }
.footer-legal { display: flex; gap: 14px; flex-wrap: wrap; }
.footer-legal a { text-decoration: none; }
.cookie-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(6,8,11,.78); backdrop-filter: blur(3px);
}
.cookie-modal {
  width: 100%; max-width: 520px; padding: 26px;
  border-radius: 14px; background: #14161a;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 24px 60px rgba(0,0,0,.6);
}
.cookie-modal h3 { font-family: 'Barlow Condensed', sans-serif; font-size: 1.5rem; margin: 0 0 10px; }
.cookie-modal p { margin: 0 0 12px; font-size: .94rem; line-height: 1.65; }
.cookie-modal__actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
@media (max-width: 640px) {
  .cookie-modal__actions { flex-direction: column-reverse; }
  .cookie-modal__actions .btn { width: 100%; }
}

/* ---------- Lista de OS do cliente (linhas colapsáveis) ---------- */
.os-list { display: flex; flex-direction: column; gap: 8px; }
.os-row { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.os-row[open] { border-color: var(--border-strong); box-shadow: var(--shadow); }
.os-row__head {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; user-select: none;
}
.os-row__head::-webkit-details-marker { display: none; }
.os-row__num { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 1.05rem; color: #ff6b6f; white-space: nowrap; min-width: 72px; }
.os-row__plate { font-weight: 600; letter-spacing: 0.04em; min-width: 96px; white-space: nowrap; }
.os-row__date { color: var(--muted); font-size: 0.88rem; min-width: 150px; white-space: nowrap; }
.os-row__price { margin-left: auto; font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 1.15rem; color: var(--primary); white-space: nowrap; }
.os-row__pdf { flex: none; }
.os-row__chev { color: var(--muted); transition: transform .2s; flex: none; }
.os-row[open] .os-row__chev { transform: rotate(180deg); }
.os-row__body { padding: 16px 18px 20px; border-top: 1px solid var(--border); background: var(--bg-elevated); }
@media (max-width: 760px) {
  .os-row__head { flex-wrap: wrap; gap: 8px 12px; padding: 12px; }
  .os-row__num { min-width: 0; }
  .os-row__plate { min-width: 0; }
  .os-row__date { order: 5; width: 100%; min-width: 0; }
  .os-row__price { margin-left: 0; }
  .os-row__chev { margin-left: auto; }
}


/* ---------- Painel de gestão ---------- */
.stat-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.stat { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.stat span { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; }
.stat strong { font-family: "Barlow Condensed", sans-serif; font-size: 1.7rem; line-height: 1; }
.monitor-list { margin: 0 0 16px; }
.monitor-list div { display: flex; justify-content: space-between; gap: 18px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.monitor-list dt { color: var(--muted); }
.monitor-list dd { margin: 0; font-weight: 700; text-align: right; }

/* Seleção de painel (colaborador com OS como cliente) */
.grid--2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 720px) { .grid--2 { grid-template-columns: 1fr; } }
.card--link { display: block; text-decoration: none; color: inherit; transition: transform .15s ease, border-color .15s ease; }
.card--link:hover { transform: translateY(-2px); border-color: var(--brand, #e11d2e); }

/* Faixa de instalação do app (PWA) */
.pwa-install-bar {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 9000;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 14px;
  background: #14171a; border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 12px 30px rgba(0,0,0,.45);
}
.pwa-install-icon { width: 40px; height: 40px; border-radius: 10px; flex: 0 0 auto; }
.pwa-install-text { flex: 1 1 auto; font-size: 14px; line-height: 1.35; color: #e8eaed; }
.pwa-install-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.pwa-install-btn { white-space: nowrap; }
.pwa-install-close {
  background: none; border: 0; color: #9aa0a6; font-size: 22px; line-height: 1;
  cursor: pointer; padding: 4px 6px;
}
@media (min-width: 900px) { .pwa-install-bar { left: auto; right: 20px; max-width: 420px; } }

.os-row__vehicle { font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; }

/* ===== Itens da OS em telas pequenas: cada item vira um cartão em blocos ===== */
@media (max-width: 760px) {
  .table--items { display: block; border: 0; }
  .table--items thead { display: none; }
  .table--items tbody { display: block; }
  .table--items tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
  }
  .table--items td {
    display: block;
    width: auto;
    padding: 0;
    border: 0;
  }
  .table--items td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 3px;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .table--items td[data-label="Descrição"],
  .table--items td[data-label="Detalhe"],
  .table--items td[data-label="Situação"] { grid-column: 1 / -1; }
  .table--items td.item-remove { grid-column: 1 / -1; text-align: right; }
  .table--items input,
  .table--items select {
    font-size: 16px; /* evita zoom automático no iOS */
    padding: 10px;
  }
}

/* ---------- Registro fotográfico da OS ---------- */
.os-photo-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.os-photo-card h3 { margin-top: 0; }
.os-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.os-photo { margin: 0; }
.os-photo img { width: 100%; height: 90px; object-fit: cover; border-radius: 8px; border: 1px solid rgba(255,255,255,.12); }
.os-photo figcaption { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; font-size: .8rem; }
.os-photo figcaption input { width: 100%; font-size: .8rem; padding: 4px 6px; }
@media (max-width: 760px) {
  .os-photo-cards { grid-template-columns: 1fr; }
  .os-photo-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
}

/* ---------- KPIs, filtros e espaçamentos dos formulários ---------- */

.kpi-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.kpi { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px; }
.kpi-label { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.kpi-value { font-family: var(--font-display); font-size: 1.5rem; line-height: 1.1; }

.filters .field-row { margin-bottom: 0; }
.field-row { margin-bottom: 18px; }
.field-row:last-child { margin-bottom: 0; }
.field label { display: block; margin-bottom: 6px; }

/* ---------- Agenda ---------- */

.agenda { display: grid; gap: 16px; }
.agenda-day { padding: 18px 20px; }
.agenda-day__head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.agenda-block { margin-top: 12px; }
.agenda-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.agenda-item {
  display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  text-decoration: none; color: inherit;
}
.agenda-item:hover { border-color: var(--primary); }
.agenda-item__os { font-family: var(--font-display); color: var(--primary); }
.agenda-item__veic { font-weight: 600; }
.agenda-day { scroll-margin-top: calc(var(--header-h) + 20px); transition: border-color .2s, box-shadow .2s; }
.agenda-day.is-selected { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.agenda-calendar { padding: 20px; overflow: hidden; }
.agenda-calendar__head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.agenda-calendar__head h2 { margin: 0; font-size: 1.45rem; }
.agenda-calendar__legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: .82rem; }
.agenda-calendar__legend span { display: inline-flex; align-items: center; gap: 6px; }
.agenda-calendar__legend i { width: 10px; height: 10px; border-radius: 2px; }
.agenda-calendar__legend .is-entry { background: #e7b416; }
.agenda-calendar__legend .is-stay { background: #3b82f6; }
.agenda-calendar__weekdays, .agenda-calendar__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.agenda-calendar__weekdays { border: 1px solid var(--border); border-bottom: 0; background: var(--bg-elevated); }
.agenda-calendar__weekdays span { padding: 7px; text-align: center; color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; }
.agenda-calendar__grid { border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.agenda-calendar__blank, .agenda-calendar__day { min-height: 118px; border: 0; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg-elevated); }
.agenda-calendar__day { min-width: 0; padding: 8px; color: var(--text); text-align: left; font: inherit; overflow: hidden; }
.agenda-calendar__day.has-events { cursor: pointer; }
.agenda-calendar__day.has-events:hover { background: var(--surface-2); }
.agenda-calendar__day:disabled { color: var(--muted); opacity: .55; }
.agenda-calendar__day time { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.agenda-calendar__day time strong { font-size: .92rem; }
.agenda-calendar__day time small { color: var(--muted); font-size: .62rem; }
.agenda-calendar__events { display: grid; gap: 4px; }
.agenda-calendar__event { display: block; overflow: hidden; padding: 3px 5px; border-left: 3px solid; border-radius: 3px; white-space: nowrap; text-overflow: ellipsis; font-size: .7rem; line-height: 1.25; }
.agenda-calendar__event.is-entry { border-color: #e7b416; background: rgba(231,180,22,.12); color: #f0cd5c; }
.agenda-calendar__event.is-stay { border-color: #3b82f6; background: rgba(59,130,246,.14); color: #7fb2fb; }
.agenda-calendar__event.is-exit { border-color: #157f4a; background: rgba(21,127,74,.16); color: #4fc38a; }
.agenda-calendar__event.is-sameday { border-color: #7be8a4; background: rgba(123,232,164,.14); color: #a7f3c8; }
.agenda-calendar__event.is-note { border-color: #8b95a5; background: rgba(139,149,165,.14); color: #b7bfcb; }

/* Legenda de cores acima do calendário */
.agenda-legend { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 18px; color: var(--muted); font-size: .85rem; }
.agenda-legend strong { color: var(--text); }
.agenda-legend span { display: inline-flex; align-items: center; gap: 7px; }
.agenda-legend i { width: 12px; height: 12px; border-radius: 3px; }
.agenda-legend .is-entry { background: #e7b416; }
.agenda-legend .is-stay { background: #3b82f6; }
.agenda-legend .is-exit { background: #157f4a; }
.agenda-legend .is-sameday { background: #7be8a4; }
.agenda-legend .is-note { background: #8b95a5; }

.badge--info { border-color: #3b82f6; color: #7fb2fb; background: rgba(59,130,246,.14); }
.badge--muted { border-color: #8b95a5; color: #b7bfcb; background: rgba(139,149,165,.14); }
.agenda-note { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-left: 3px solid #8b95a5; border-radius: 6px; background: var(--bg-elevated); }
@media (max-width: 760px) {
  .agenda-calendar { padding: 12px; overflow-x: auto; }
  .agenda-calendar__head, .agenda-calendar__weekdays, .agenda-calendar__grid { min-width: 720px; }
  .agenda-calendar__blank, .agenda-calendar__day { min-height: 105px; }
}

/* Seleção múltipla em chips (fornecedores da ferramenta, estilo destinatários de e-mail) */
.chips-field { min-width: 240px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--bg-elevated); font-size: .85rem;
}
.chip__x { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 2px; }
.chip__x:hover { color: var(--danger, #ef4444); }

/* Expansão de linhas da OS no painel interno */
.os-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px; cursor: pointer;
  background: transparent; border: 1px solid var(--line, rgba(255,255,255,.14));
  color: var(--muted); transition: transform .2s, color .2s, border-color .2s;
}
.os-toggle:hover { color: var(--text); border-color: currentColor; }
.os-toggle.is-open { transform: rotate(180deg); color: var(--primary); }
.os-detail > td { background: rgba(255,255,255,.03); }
.os-detail__grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: .5rem; }
.os-detail h4 { margin: .9rem 0 .3rem; font-size: .95rem; }
.os-detail__grid h4 { margin-top: 0; }
.table--compact th, .table--compact td { padding: .35rem .5rem; font-size: .88rem; }

/* ---------- RPS (relatório de procedimento de soldagem) ---------- */
.rps-card__head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.rps-card__head h3 { margin:0; }
.rps-alert { margin:.4rem 0 .8rem; padding:.6rem .8rem; border-radius:8px; font-size:.85rem;
  background:rgba(220,70,60,.12); border:1px solid rgba(220,70,60,.45); color:#ffb4ad; }
.rps-card textarea { width:100%; }

[hidden]{display:none !important}

/* ---------- Feed do Instagram ---------- */
.instagram-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; margin-bottom:28px; }
.instagram-heading h1 { margin-bottom:6px; }
.instagram-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
.instagram-post { position:relative; display:block; width:100%; aspect-ratio:1; padding:0; border:0; border-radius:4px; overflow:hidden; background:var(--surface-2); cursor:pointer; }
.instagram-post img { width:100%; height:100%; object-fit:cover; transition:transform .25s,opacity .25s; }
.instagram-post:hover img { transform:scale(1.025); opacity:.82; }
.instagram-post:focus-visible { outline:3px solid var(--primary); outline-offset:2px; }
.instagram-post__type { position:absolute; top:10px; right:10px; display:grid; place-items:center; width:30px; height:30px; color:#fff; background:rgba(6,8,11,.7); border-radius:50%; }
.instagram-empty { min-height:360px; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; border:1px solid var(--border); background:var(--surface); padding:32px; }
.instagram-empty .icon-box { color:var(--primary); margin-bottom:12px; }
.instagram-viewer { position:fixed; inset:0; z-index:500; display:grid; place-items:center; padding:24px; background:rgba(6,8,11,.92); }
.instagram-viewer__content { display:grid; grid-template-columns:minmax(0,720px) minmax(260px,360px); width:min(1080px,100%); max-height:calc(100vh - 48px); overflow:hidden; background:var(--bg-elevated); border:1px solid var(--border); box-shadow:var(--shadow); }
.instagram-viewer__media { min-height:420px; max-height:calc(100vh - 48px); overflow:auto; background:#090a0c; display:flex; scroll-snap-type:x mandatory; }
.instagram-viewer__media img,.instagram-viewer__media video { flex:0 0 100%; width:100%; max-height:calc(100vh - 48px); object-fit:contain; scroll-snap-align:start; }
.instagram-viewer__details { padding:24px; overflow:auto; }
.instagram-viewer__details strong { font-size:1.1rem; }
.instagram-viewer__details p { white-space:pre-wrap; line-height:1.55; }
.instagram-viewer__details time { color:var(--muted); font-size:.85rem; }
.instagram-viewer__close { position:fixed; top:18px; right:22px; z-index:2; width:42px; height:42px; border:1px solid rgba(255,255,255,.25); border-radius:50%; background:rgba(6,8,11,.8); color:#fff; font-size:2rem; line-height:1; cursor:pointer; }
.instagram-prompt { position:fixed; right:22px; bottom:22px; z-index:3; display:flex; align-items:center; gap:12px; max-width:410px; padding:12px 14px; background:var(--surface); border:1px solid var(--border-strong); box-shadow:var(--shadow); }
.instagram-prompt__close { width:28px; height:28px; padding:0; border:0; background:transparent; color:var(--muted); font-size:1.35rem; cursor:pointer; }
@media (max-width:900px) { .instagram-viewer__content { grid-template-columns:1fr; max-width:680px; overflow:auto; } .instagram-viewer__media { min-height:0; height:min(62vh,620px); } }
@media (max-width:640px) { .instagram-heading { align-items:flex-start; flex-direction:column; } .instagram-grid { gap:3px; } .instagram-viewer { padding:0; align-items:start; } .instagram-viewer__content { width:100%; max-height:100vh; border:0; } .instagram-viewer__media { height:62vh; } .instagram-viewer__details { padding:18px; } .instagram-prompt { left:12px; right:12px; bottom:12px; } }

/* ---------- Acessos: integrações, migração, manual e contas ---------- */
.access-section { scroll-margin-top: calc(var(--header-h) + 18px); }
.access-section > h3, .access-section__heading h3 { margin-top: 0; }
.access-section__heading { margin-bottom: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.access-section__heading p { max-width: 780px; margin-bottom: 0; }
.access-tools { display: grid; gap: 22px; }
.access-tools__panel { padding: 22px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elevated); }
.access-tools__panel > :last-child { margin-bottom: 0; }
.access-tools__panel form + form { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--border); }
.access-tools__nested { margin: 20px 0 0; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: transparent; }
.access-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.access-manual { border-top: 1px solid var(--border); padding-top: 18px; }
.access-manual > summary { cursor: pointer; font-weight: 700; color: var(--text); }
.access-manual__body { margin-top: 20px; padding: 18px; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; }
.access-search { display: grid; grid-template-columns: minmax(240px, 1fr) auto auto; align-items: end; gap: 12px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.access-search .field { margin: 0; }
@media (max-width: 720px) {
  .access-tools__panel, .access-manual__body { padding: 16px; }
  .access-tools__panel .btn, .access-actions .btn { width: 100%; }
  .access-search { grid-template-columns: 1fr; }
  .access-search .btn { width: 100%; }
}
