/* SóServiços design system — tema adaptado à logo azul */
:root {
  --bg: #f2f7fb;
  --surface: #ffffff;
  --surface-2: #f6fbfe;
  --border: #dbe8f3;
  --text: #102a43;
  --text-2: #4a6582;
  --text-3: #809ab5;
  --brand: #1270b8; /* azul principal da logo */
  --brand-600: #0d4e85; /* hover escuro */
  --brand-soft: #e6f2fe; /* soft light blue */
  --brand-gradient: linear-gradient(135deg, #0e5fa8, #1fb0e6);
  --brand-gradient-hero: linear-gradient(160deg, #071f3a 0%, #0d4e85 38%, #1270b8 72%, #1bb8e6 100%);
  --green: #059669;
  --green-soft: #ecfdf5;
  --amber: #d97706;
  --amber-soft: #fffbeb;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --blue: #1270b8;
  --blue-soft: #e6f2fe;
  --purple: #7c3aed;
  --purple-soft: #f5f3ff;
  --gray-soft: #eef4f9;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 42, 67, .05), 0 6px 20px rgba(16, 42, 67, .06);
  --shadow-lg: 0 8px 40px rgba(16, 42, 67, .18);
  --sidebar-w: 252px;
  font-size: 15px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
::placeholder { color: var(--text-3); }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); background: #081e36; /* dark blue da logo */
  color: #c6d8ea;
  display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 40;
  transition: transform .25s ease;
  border-right: 1px solid rgba(255,255,255,.06);
}
.sidebar .logo {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 18px 18px 14px;
  font-weight: 800; font-size: 1.12rem; color: #fff; letter-spacing: -.02em;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.logo-badge {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  background: #fff;
  display: grid; place-items: center; overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.logo-badge img { width: 28px; height: 28px; object-fit: contain; }
.logo-full { height: 34px; width: auto; object-fit: contain; display: block; }
.logo-hero { height: 52px; width: auto; object-fit: contain; display: block; filter: drop-shadow(0 4px 12px rgba(0,0,0,.25)); }
.logo-icon-img { width: 100%; height: 100%; object-fit: contain; }

.side-nav { flex: 1; padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y:auto; }
.side-nav a {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 9px;
  color: #9bb7d1; font-weight: 500; font-size: .94rem; transition: background .15s, color .15s;
}
.side-nav a svg { flex: none; opacity: .9; }
.side-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-nav a.active { background: var(--brand); color: #fff; box-shadow: 0 4px 14px rgba(18,112,184,.35); }
.side-nav .nav-label { font-size: .70rem; text-transform: uppercase; letter-spacing: .08em; color: #6a8bb0; padding: 18px 12px 6px; font-weight: 700; }
.side-user { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,.15); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #1270b8, #1fb0e6); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: .85rem;
}
.side-user .u-name { font-size: .88rem; color: #fff; font-weight: 600; line-height: 1.2; }
.side-user .u-shop { font-size: .75rem; color: #8fb0cc; white-space: nowrap; overflow:hidden; text-overflow: ellipsis; }
.side-user button { margin-left: auto; background: none; border: 0; color: #8fb0cc; padding: 6px; border-radius: 8px; }
.side-user button:hover { color: #fff; background: rgba(255,255,255,.08); }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: none; align-items: center; gap: 8px; padding: 8px 12px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; left:0; right:0; width:100%;
  z-index: 30; min-height: 52px; box-sizing:border-box;
}
.topbar .burger { background: none; border: 0; padding: 6px; color: var(--text); display: grid; flex:none; }
.topbar-brand { display:flex; align-items:center; gap:8px; flex:1; min-width:0; overflow:hidden; }
.topbar .logo-mini { height: 28px; width: auto; flex:none; }
.topbar .brand-text { line-height:1.1; min-width:0; overflow:hidden; flex:1; }
.topbar .brand-text strong { font-size:.92rem; letter-spacing:-.01em; display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.topbar .brand-text span { display:block; font-size:.66rem; color:var(--text-3); font-weight:500; line-height:1.2; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:180px; }
.topbar-seg { font-size:.78rem; background:var(--brand); color:#fff; padding:6px 12px; border-radius:99px; font-weight:700; display:inline-flex; align-items:center; gap:6px; white-space:nowrap; flex:none; max-width:55%; overflow:hidden; }
.topbar-seg .seg-icon { flex:none; }
.topbar-seg .seg-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }
@media (max-width: 480px) {
  .topbar { padding:8px 10px; gap:6px; }
  .topbar .brand-text { display:none; }
  .topbar-seg { max-width:65%; font-size:.75rem; padding:5px 10px; }
  .topbar-seg .seg-name { max-width:110px; }
}
@media (max-width: 360px) {
  .topbar-seg .seg-name { max-width:80px; font-size:.70rem; }
  .topbar-seg { padding:5px 8px; }
}
@media (max-width: 800px) {
  .topbar { width:100vw; left:0; right:0; }
  .main { width:100vw; overflow-x:hidden; }
  .content { width:100%; max-width:100vw; padding:16px 12px 60px; box-sizing:border-box; }
  .card { max-width:100%; box-sizing:border-box; overflow:hidden; }
}

.content { padding: 28px 32px 60px; max-width: 1180px; width: 100%; margin: 0 auto; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 1.55rem; letter-spacing: -.02em; display:flex; align-items:center; gap:10px; }
.page-head .sub { color: var(--text-2); margin-top: 4px; font-size: .93rem; }

/* ---------- Components ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 600; font-size: .92rem; transition: all .15s; white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(18,112,184,.25); }
.btn-primary:hover:not(:disabled) { background: var(--brand-600); box-shadow: 0 6px 16px rgba(18,112,184,.35); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); border-color: #b8d3ea; }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover:not(:disabled) { background: #fee2e2; }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover:not(:disabled) { background: #047857; }
.btn-wa { background: #25d366; color: #fff; }
.btn-wa:hover:not(:disabled) { background: #1fb958; }
.btn-sm { padding: 6px 11px; font-size: .84rem; border-radius: 8px; }
.btn-icon { padding: 7px; border-radius: 8px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: .85rem; font-weight: 600; color: var(--text-2); }
.input, select.input, textarea.input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(18,112,184,.14); }
textarea.input { resize: vertical; min-height: 80px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px;
  border-radius: 99px; font-size: .78rem; font-weight: 650; white-space: nowrap;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-recebido { background: #eaf1f8; color: #4a6d8a; }
.st-em_analise { background: var(--brand-soft); color: var(--brand); }
.st-aguardando_aprovacao { background: var(--amber-soft); color: var(--amber); }
.st-aguardando_pecas { background: #ede9fe; color: #6d28d9; }
.st-em_reparo { background: var(--brand-soft); color: var(--brand); }
.st-pronto { background: var(--green-soft); color: var(--green); }
.st-entregue { background: #e6f7f1; color: #0f766e; }
.st-cancelado { background: var(--red-soft); color: var(--red); }
.st-na_fila { background: #eaf1f8; color: #4a6d8a; }
.st-em_execucao { background: var(--brand-soft); color: var(--brand); }
.st-finalizando { background: #dff4ff; color: #0b6aa8; }
.st-em_avaliacao { background: #dff4ff; color: #0b6aa8; }
.st-controle_qualidade { background: #ede9fe; color: #6d28d9; }

/* tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.table-wrap::-webkit-scrollbar { height:6px; }
.table-wrap::-webkit-scrollbar-thumb { background: #dbe8f3; border-radius:99px; }
table.data { min-width: 480px; }
@media (max-width: 600px) {
  table.data { min-width: 420px; font-size:.85rem; }
  table.data th, table.data td { padding:10px 12px; }
  .card { border-radius:10px; }
  .content { padding:16px 12px 60px; }
}
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th {
  text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-3); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
table.data td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background .12s; }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr.clickable:hover { background: var(--surface-2); }

/* stat cards */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; border-top: 3px solid transparent; }
.stat:nth-child(1) { border-top-color: var(--brand); }
.stat:nth-child(2) { border-top-color: var(--amber); }
.stat:nth-child(3) { border-top-color: var(--green); }
.stat:nth-child(4) { border-top-color: #1fb0e6; }
.stat .s-label { font-size: .8rem; color: var(--text-2); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.stat .s-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.stat .s-value { font-size: 1.7rem; font-weight: 800; letter-spacing: -.03em; }
.stat .s-hint { font-size: .78rem; color: var(--text-3); }

/* empty & loading */
.empty { text-align: center; padding: 56px 24px; color: var(--text-2); }
.empty .e-icon { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 16px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.empty h3 { color: var(--text); margin-bottom: 6px; font-size: 1.05rem; }
.empty p { font-size: .92rem; max-width: 420px; margin: 0 auto 18px; }

.skeleton { position: relative; overflow: hidden; background: #e6eef7; border-radius: 8px; }
.skeleton::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.spinner {
  width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite; display: inline-block;
}
.spinner.dark { border-color: rgba(18,112,184,.25); border-top-color: var(--brand); }
@keyframes spin { to { transform: rotate(360deg); } }

/* toast */
#toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 100; }
.toast {
  background: #0a2540; color: #fff; padding: 12px 18px; border-radius: 10px;
  box-shadow: var(--shadow-lg); font-size: .9rem; display: flex; align-items: center; gap: 10px;
  animation: slideIn .25s ease; max-width: 340px;
}
.toast.err { background: var(--red); }
.toast.ok { background: #0e8a5e; }
@keyframes slideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(8, 30, 54, .55); z-index: 60;
  display: grid; place-items: center; padding: 20px; animation: fadeIn .15s ease;
  backdrop-filter: blur(3px);
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 580px; max-height: 90vh; overflow-y: auto;
  animation: popIn .18s ease;
}
@keyframes popIn { from { opacity: 0; transform: scale(.96) translateY(8px); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 0; }
.modal-head h2 { font-size: 1.12rem; }
.modal-head .x { background: none; border: 0; color: var(--text-3); padding: 4px; border-radius: 6px; font-size: 1.2rem; line-height: 1; }
.modal-head .x:hover { background: var(--gray-soft); color: var(--text); }
.modal-body { padding: 18px 22px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 22px 22px; }

/* photo */
.photo-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.photo-thumb { position: relative; width: 92px; height: 92px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb .rm {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(8,30,54,.75); color: #fff; border: 0; font-size: .8rem; line-height: 1;
}
.photo-add {
  width: 92px; height: 92px; border-radius: 10px; border: 1.5px dashed var(--border);
  background: var(--surface-2); color: var(--text-3); display: grid; place-items: center;
  font-size: 1.4rem; transition: all .15s;
}
.photo-add:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

/* filters */
.filters { 
  display: flex; 
  gap: 12px; 
  flex-wrap: nowrap; 
  overflow-x: auto; 
  overflow-y: hidden; 
  margin-bottom: 16px; 
  align-items: center; 
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display:none; }
.filters .chip { flex: 0 0 auto; white-space: nowrap; }
.filters .search-box { flex: 0 0 auto; margin-left: 12px; min-width: 220px; }
@media (max-width: 700px) {
  .filters { gap: 8px; }
  .filters .search-box { min-width: 180px; }
}
.chip {
  padding: 7px 13px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface);
  font-size: .84rem; font-weight: 600; color: var(--text-2); transition: all .15s;
}
.chip:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 10px rgba(18,112,184,.25); }
.chip-service {
  padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  font-size: .85rem; font-weight: 500; display: inline-flex; gap:6px; align-items:center; margin:4px;
  transition: all .15s;
}
.chip-service:hover { border-color: var(--brand); background: var(--brand-soft); transform: translateY(-1px); }
.chip-service .price { font-weight:700; color: var(--brand); }
.search-box { position: relative; margin-left: auto; }
.search-box input { padding-left: 36px; min-width: 230px; }
.search-box svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.muted { color: var(--text-3); font-size: .85rem; }
.mono { font-variant-numeric: tabular-nums; font-weight: 600; }
.opt-pending { opacity: .55; pointer-events: none; }

.q-row { display: grid; grid-template-columns: 1fr 64px 110px 34px; gap: 8px; margin-bottom: 8px; align-items: center; }
.q-total { text-align: right; font-weight: 700; font-size: 1.05rem; padding-top: 12px; margin-top: 8px; border-top: 1px dashed var(--border); }

/* Orçamento novo layout limpo - Fase melhoria UI */
.q-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.q-item:hover { border-color: #b8d3ea; box-shadow: var(--shadow); }
.q-item-desc { margin-bottom: 10px; }
.q-item-desc .input { font-weight: 500; font-size: .92rem; }
.q-item-meta {
  display: grid;
  grid-template-columns: 64px 1fr auto 36px;
  gap: 8px;
  align-items: center;
}
.q-item-meta .q-qty .input { text-align:center; padding:8px; }
.q-item-meta .q-price { min-width:0; }
.q-item-meta .q-subtotal { font-size:.88rem; font-weight:700; color:var(--text-2); text-align:right; white-space:nowrap; min-width:72px; }
.q-item-meta .q-rm { width:36px; height:36px; }
@media (max-width: 600px) {
  .q-item-meta { grid-template-columns: 56px 1fr 36px; }
  .q-item-meta .q-subtotal { display:none; }
}
#catalogChips { display:flex; flex-wrap:wrap; gap:6px; max-height:220px; overflow-y:auto; padding:4px; border:1px dashed var(--border); border-radius:10px; background:var(--surface-2); }
#catalogChips .svc-cat { margin:8px 0 4px; width:100%; }
#catalogChips:empty { display:none; }

/* Input group com R$ */
.input-group { display:flex; align-items:stretch; border:1px solid var(--border); border-radius:10px; background:var(--surface); overflow:hidden; transition:border-color .15s, box-shadow .15s; }
.input-group:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(18,112,184,.14); }
.input-group .prefix { display:grid; place-items:center; background:var(--gray-soft); color:var(--text-2); font-weight:700; font-size:.88rem; padding:0 12px; border-right:1px solid var(--border); min-width:44px; }
.input-group input { border:0; flex:1; padding:9px 12px; outline:0; background:transparent; width:100%; }

.svc-cat {
  display: flex; align-items: center; gap: 10px;
  font-size: .84rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-2); font-weight: 800;
  margin: 28px 0 12px; padding: 12px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  border-radius: 10px;
}
.svc-cat span:first-child { flex:1; }
.svc-cat .count-badge {
  background: var(--brand); color:#fff; font-size:.72rem; padding:4px 10px; border-radius:99px; font-weight:700;
  box-shadow: 0 2px 6px rgba(18,112,184,.25);
}

.svc-card { display: flex; justify-content: space-between; gap:12px; padding: 16px 18px; border:1px solid var(--border); border-radius: 12px; background: var(--surface); transition: all .15s; }
.svc-card:hover { border-color: #b8d3ea; box-shadow: var(--shadow); transform: translateY(-1px); }
.svc-card.inactive { opacity:.6; background: var(--surface-2); }
.svc-prices { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.svc-price { font-size:.80rem; padding: 5px 10px; border-radius: 99px; border: 1px solid var(--border); font-weight:600; display:inline-flex; align-items:center; gap:4px; }
.svc-price::before { content:''; width:6px; height:6px; border-radius:50%; background: currentColor; opacity:.7; }
.svc-price.var-hatch { background:#dbeafe; color:#1e40af; border-color:#bfdbfe; }
.svc-price.var-sedan { background:#ede9fe; color:#5b21b6; border-color:#ddd6fe; }
.svc-price.var-suv { background:#fef3c7; color:#92400e; border-color:#fde68a; }
.svc-price.var-caminhonete { background:#dcfce7; color:#166534; border-color:#bbf7d0; }
.svc-price.var-moto { background:#ffedd5; color:#9a3412; border-color:#fed7aa; }
.svc-price.var-caminhao { background:#fee2e2; color:#991b1b; border-color:#fecaca; }
.svc-price.var-caminhao2 { background:#fce7f3; color:#9d174d; border-color:#fbcfe8; }
.svc-price.var-unico { background:var(--brand-soft); color:var(--brand); border-color:#b8d3ea; }

.porte-selector { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:12px; }
.porte-opt { padding:7px 14px; border-radius:99px; border:1px solid var(--border); background: var(--surface); font-size:.85rem; font-weight:600; transition:all .15s; }
.porte-opt:hover { border-color: var(--brand); background: var(--brand-soft); }
.porte-opt.active { background: var(--brand); color:#fff; border-color: var(--brand); box-shadow: 0 4px 10px rgba(18,112,184,.25); }

/* timeline */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item .tl-dot {
  position: absolute; left: -24px; top: 4px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--brand); z-index: 1;
}
.tl-item.first .tl-dot { border-color: var(--green); }
.tl-item .tl-title { font-weight: 600; font-size: .93rem; }
.tl-item .tl-date { font-size: .78rem; color: var(--text-3); }
.tl-item .tl-note { font-size: .86rem; color: var(--text-2); margin-top: 2px; }

/* auth */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.auth-hero {
  background: var(--brand-gradient-hero);
  color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 48px 56px;
  position: relative; overflow: hidden;
}
.auth-hero::before {
  content: ''; position: absolute; width: 600px; height: 600px; border-radius: 50%;
  background: radial-gradient(circle, rgba(31,176,230,.32), transparent 70%);
  top: -120px; right: -160px; pointer-events: none;
}
.auth-hero::after {
  content: ''; position: absolute; width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.07), transparent 70%);
  bottom: -100px; left: -100px; pointer-events: none;
}
.auth-hero h2 { font-size: 2.1rem; letter-spacing: -.03em; margin: 22px 0 14px; line-height: 1.15; position: relative; z-index: 1; font-weight: 800; }
.auth-hero p { color: #cfe6f9; line-height: 1.6; max-width: 420px; position: relative; z-index: 1; font-size: .98rem; }
.auth-hero ul { margin-top: 26px; display: flex; flex-direction: column; gap: 12px; list-style: none; position: relative; z-index: 1; }
.auth-hero li { display: flex; gap: 10px; align-items: center; color: #e6f2fe; font-size: .95rem; }
.auth-hero li svg { color: #57d8ff; flex: none; }
.auth-panel { display: grid; place-items: center; padding: 40px 24px; background: #fff; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card h1 { font-size: 1.45rem; margin-bottom: 6px; letter-spacing: -.02em; }
.auth-card .sub { color: var(--text-2); margin-bottom: 24px; font-size: .93rem; }
.auth-switch { text-align: center; margin-top: 18px; font-size: .9rem; color: var(--text-2); }
.demo-hint {
  margin-top: 20px; padding: 12px 14px; border-radius: 10px; background: var(--brand-soft);
  color: var(--brand-600); font-size: .84rem; line-height: 1.5; cursor: pointer; border: 1px dashed #a3c9ea;
}
.err-box { background: var(--red-soft); color: var(--red); padding: 10px 14px; border-radius: 9px; font-size: .88rem; margin-bottom: 14px; }

.segment-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.segment-card {
  border: 1.5px solid var(--border); border-radius: 12px; padding: 10px 12px; cursor: pointer;
  background: var(--surface); transition: all .15s; text-align: left;
  display:flex; flex-direction:column; min-height:86px;
}
.segment-card:hover { border-color: var(--brand); background: var(--brand-soft); transform: translateY(-1px); }
.segment-card.active { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px rgba(18,112,184,.14); }
.segment-card .ic { font-size: 1.25rem; margin-bottom: 4px; line-height:1; }
.segment-card .name { font-weight: 700; font-size: .88rem; line-height:1.15; }
.segment-card .desc {
  font-size: .72rem; color: var(--text-2); margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height:1.25; min-height:2.5em;
}
@media (min-width: 1100px) {
  .segment-grid { grid-template-columns: 1fr 1fr 1fr; }
}

.detail-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 20px; align-items: start; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; font-size: .92rem; }
.kv dt { color: var(--text-3); font-weight: 500; }
.kv dd { font-weight: 500; }
.section-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); font-weight: 700; margin-bottom: 12px; }

.copy-link {
  display: flex; gap: 8px; align-items: center; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 10px; padding: 8px 8px 8px 12px;
}
.copy-link input { border: 0; background: none; flex: 1; font-size: .84rem; color: var(--text-2); min-width: 0; outline: 0; }

@media (max-width: 1080px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .segment-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr; gap:12px; }
  .stat { padding:14px 16px; }
  .stat .s-value { font-size:1.4rem; }
  .stat .s-label { font-size:.75rem; }
}
@media (max-width: 800px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .main { margin-left: 0; }
  .topbar { display: flex; }
  .topbar .logo-mini { margin-right: auto; }
  .content { padding: 20px 16px 60px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .search-box { margin-left: 0; width: 100%; }
  .search-box input { width: 100%; }
  .hide-sm { display: none; }
}
.backdrop-mobile { position: fixed; inset: 0; background: rgba(8,30,54,.45); z-index: 35; }

/* ---------- Modal responsivo - Fase melhoria ---------- */
@media (max-width: 600px) {
  .modal-backdrop { padding: 10px; align-items: flex-start; padding-top: 16px; overflow-y: auto; }
  .modal { max-width: 94vw; width: 94vw; margin: 0 auto; max-height: 90vh; border-radius: 14px; }
  .modal-head { padding: 16px 16px 0; }
  .modal-body { padding: 14px 16px 16px; }
  .modal-foot { padding: 0 16px 16px; flex-wrap: wrap; }
  .modal .grid-2, .modal .grid-3 { grid-template-columns: 1fr; }
  .modal .field { margin-bottom: 12px; }
}

/* Admin filtros - evitar overflow */
.admin-filters { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.admin-filters .search-box { flex:1; min-width:200px; }
.admin-filters .search-box input { width:100%; min-width:0; }
@media (max-width: 900px) {
  .admin-filters { flex-direction:column; align-items:stretch; }
  .admin-filters .search-box { width:100%; }
  .admin-filters select { width:100% !important; }
}

/* Photo modal com botão fechar - para mobile Android não precisar voltar */
.photo-modal-backdrop {
  background: rgba(8,30,54,.85);
  backdrop-filter: blur(4px);
  z-index: 80;
}
.photo-modal {
  position: relative;
  max-width: 92vw;
  max-height: 88vh;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: popIn .18s ease;
}
.photo-modal img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  background: #000;
}
.photo-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0,0,0,.6);
  color: #fff;
  border: 1px solid rgba(255,255,255,.2);
  font-size: 1.1rem;
  display: grid;
  place-items: center;
  z-index: 2;
}
.photo-modal-close:hover { background: rgba(0,0,0,.85); }
.photo-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 12px;
  background: #0a2540;
}
.photo-modal-actions .btn { flex:1; max-width:200px; }


/* Billing limpo e responsivo */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.plan-card {
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  background: #fff;
  position: relative;
  transition: all .15s;
}
.plan-card:hover { border-color: var(--brand); }
.plan-card.active { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px rgba(18,112,184,.14); }
.plan-card.highlight { border-color: #1270b8; background: #f0f7ff; }
.plan-card .plan-top { display:flex; justify-content:space-between; align-items:center; font-weight:700; }
.plan-card .plan-badge {
  position: absolute;
  top: -10px;
  right: 10px;
  background: #1270b8;
  color: #fff;
  font-size:.68rem;
  font-weight:800;
  padding:3px 8px;
  border-radius:99px;
}
.total-bar {
  margin-top:16px;
  padding:14px;
  background: var(--gray-soft);
  border-radius:12px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:1rem;
}
.total-bar strong { font-size:1.6rem; color:var(--brand); }
.pix-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  align-items: start;
}
.pix-qr { text-align:center; }
.pix-qr img { width:100%; max-width:260px; border:1px solid var(--border); border-radius:12px; background:#fff; }
@media (max-width: 800px) {
  .pix-grid { grid-template-columns: 1fr; }
  .plan-grid { grid-template-columns: 1fr; }
  .total-bar { flex-direction:column; align-items:flex-start; gap:6px; }
}

/* Mic button para defeito/diagnostico */
.mic-btn { transition: all .2s; }
.mic-btn.mic-recording { animation: micPulse 1s infinite; background: var(--red-soft); border-color: var(--red); color: var(--red); }
.mic-icon { font-size:1rem; }
@keyframes micPulse { 0%{ transform:scale(1); } 50%{ transform:scale(1.05); } 100%{ transform:scale(1); } }


/* Mic WhatsApp style ao lado dos campos */
.input-with-mic {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.input-with-mic .input {
  flex: 1;
}
.mic-wa {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--brand);
  display: grid;
  place-items: center;
  flex: none;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 2px 6px rgba(16,42,67,.08);
  font-size: 1.2rem;
}
.mic-wa:hover { border-color: var(--brand); background: var(--brand-soft); transform: scale(1.05); }
.mic-wa.mic-recording {
  background: #fee2e2;
  border-color: var(--red);
  color: var(--red);
  animation: micPulse 1s infinite;
  box-shadow: 0 0 0 4px rgba(220,38,38,.15);
}
.mic-wa:disabled { opacity:.5; cursor:not-allowed; transform:none; }


/* Mic integrado dentro do input - estilo WhatsApp/Telegram minimalista */
.input-with-mic.inside {
  position: relative;
  display: block;
}
.input-with-mic.inside .input {
  padding-right: 52px;
  min-height: 86px;
}
.mic-inside {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: #64748b;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all .18s;
  z-index: 2;
}
.mic-inside:hover {
  background: #F1F5F9;
  color: #0f172a;
}
.mic-inside.mic-recording {
  background: #fef2f2;
  color: #dc2626;
  animation: micPulse 1.2s infinite;
}
.mic-inside:disabled { opacity:.5; cursor:not-allowed; }
.mic-inside .mic-pulse { animation: micPulse 1s infinite; }
@keyframes micWave {
  0% { box-shadow: 0 0 0 0 rgba(220,38,38,.3); }
  100% { box-shadow: 0 0 0 10px rgba(220,38,38,0); }
}
.mic-inside.mic-recording { animation: micWave 1.5s infinite; }

