/* ===========================================================================
   BuscaLead — Identidade visual REAL da Vinci Transplante Capilar
   Paleta terrosa (marrom/bronze/dourado + creme) · Montserrat + Roboto Slab
   Cores extraídas do site: #503629 #845d32 #bc955c #d2b480 #f8f4ec
   =========================================================================== */
:root {
    /* --- Paleta de marca (fonte da verdade) --- */
    --espresso:      #503629;  /* marrom-café escuro */
    --espresso-dark: #3a271d;  /* mais escuro (sidebar/base) */
    --bronze:        #845d32;  /* marrom bronze */
    --gold:          #bc955c;  /* dourado/bronze claro (destaque) */
    --gold-soft:     #d2b480;  /* areia/dourado suave */
    --cream:         #f8f4ec;  /* fundo creme */
    --cream-2:       #f1e9db;  /* creme mais quente */

    /* --- Aliases usados no restante do CSS/telas --- */
    --navy:      var(--espresso);
    --navy-700:  #5f4330;
    --navy-800:  #47301f;
    --navy-900:  var(--espresso-dark);
    --gold-600:  var(--bronze);
    --gold-100:  #f2e8d7;

    --bg:          var(--cream);
    --card:        #ffffff;
    --text:        #33261d;
    --muted:       #8a7c6c;
    --border:      #eadfce;
    --border-2:    #e2d5c0;
    --success:     #3d8b5f;
    --success-bg:  #e8f3ec;
    --danger:      #d63637;   /* vermelho do site */
    --danger-bg:   #fbe9e9;
    --warn:        #b07d1e;
    --warn-bg:     #f8efdc;
    --info:        #066aab;   /* azul discreto do site */

    --radius:      9px;
    --radius-sm:   6px;
    --shadow:      0 1px 2px rgba(80, 54, 41, .06), 0 6px 22px rgba(80, 54, 41, .07);
    --font:      "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    --font-head: "Roboto Slab", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 14.5px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .font-head { font-family: var(--font-head); letter-spacing: .1px; }
a { color: var(--bronze); text-decoration: none; }
a:hover { color: var(--espresso); }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
    width: 244px;
    background: linear-gradient(180deg, var(--espresso) 0%, var(--espresso-dark) 100%);
    color: #e9ded0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; bottom: 0; left: 0;
}
.sidebar .brand {
    padding: 24px 22px 18px;
    border-bottom: 1px solid rgba(255,255,255,.09);
}
.sidebar .brand b { color: #fff; font-size: 20px; letter-spacing: .3px; font-family: var(--font-head); }
.sidebar .brand b span { color: var(--gold); }
.sidebar .brand small { display: block; color: #c3ac91; font-size: 10.5px; margin-top: 3px; letter-spacing: 2.5px; text-transform: uppercase; }

.nav { padding: 14px 12px; flex: 1; }
.nav a {
    display: flex; align-items: center; gap: 11px;
    color: #d8c8b4; padding: 10px 14px; border-radius: var(--radius-sm);
    font-weight: 500; margin-bottom: 3px; transition: background .15s, color .15s;
}
.nav a .ic { width: 18px; height: 18px; opacity: .85; }
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.active { background: var(--gold); color: var(--espresso-dark); font-weight: 600; }
.nav a.active .ic { opacity: 1; }
.nav .sep { color: #a58e73; font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.5px; padding: 16px 14px 6px; }

.sidebar .foot { padding: 14px; border-top: 1px solid rgba(255,255,255,.09); font-size: 12.5px; }
.sidebar .foot .who { color: #c3ac91; margin-bottom: 8px; word-break: break-all; }

.main { margin-left: 244px; flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
    background: var(--card); border-bottom: 1px solid var(--border);
    padding: 16px 30px; display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 20px; margin: 0; font-weight: 600; color: var(--espresso); }
.content { padding: 26px 30px 60px; max-width: 1500px; width: 100%; }

/* ---------- Componentes ---------- */
.card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 22px;
}
.card .card-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card .card-head h2 { font-size: 16px; margin: 0; font-weight: 600; color: var(--espresso); }
.card .card-head p { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; }
.card .card-body { padding: 20px; }
.card .card-body.tight { padding: 0; }

.grid { display: grid; gap: 18px; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

/* Stat tiles */
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--gold); }
.stat .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.stat .value { font-family: var(--font-head); font-size: 30px; font-weight: 700; color: var(--espresso); margin-top: 4px; line-height: 1; }
.stat .value.gold { color: var(--bronze); }
.stat .foot { color: var(--muted); font-size: 12px; margin-top: 8px; }

/* Botões */
.btn {
    display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
    border: 1px solid transparent; border-radius: var(--radius-sm);
    padding: 9px 16px; font-size: 13.5px; font-weight: 600; font-family: var(--font);
    transition: filter .15s, background .15s, border-color .15s; text-decoration: none; line-height: 1.2;
}
.btn:hover { filter: brightness(.97); }
.btn-primary { background: var(--espresso); color: #fff; }
.btn-primary:hover { background: var(--espresso-dark); color: #fff; }
.btn-gold { background: var(--gold); color: var(--espresso-dark); }
.btn-gold:hover { background: var(--bronze); color: #fff; }
.btn-outline { background: #fff; border-color: var(--border-2); color: var(--espresso); }
.btn-outline:hover { border-color: var(--bronze); color: var(--bronze); }
.btn-danger { background: #fff; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Formulários */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 13px; color: var(--espresso); }
.field .hint { color: var(--muted); font-size: 12px; margin-top: 5px; }
input[type=text], input[type=email], input[type=password], input[type=url],
input[type=date], input[type=number], input[type=search], input[type=tel],
select, textarea {
    width: 100%; height: 42px; padding: 10px 12px; border: 1px solid var(--border-2); border-radius: var(--radius-sm);
    font-size: 14px; font-family: var(--font); color: var(--text); background: #fff; transition: border-color .15s, box-shadow .15s;
    line-height: 1.2;
}
textarea { height: auto; }
select { -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a7c6c' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
input[type=date] { position: relative; }
input[type=date]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .55; }
input[type=date]::-webkit-datetime-edit { color: var(--text); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--bronze); box-shadow: 0 0 0 3px rgba(188,149,92,.18); }
textarea { resize: vertical; min-height: 80px; }
.inline-form { display: inline; }

/* Tabelas */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th { text-align: left; padding: 12px 16px; background: var(--cream); color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tr:hover td { background: #fdfbf7; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 700; letter-spacing: .2px; }
.badge.ok { background: var(--success-bg); color: var(--success); }
.badge.fail { background: var(--danger-bg); color: var(--danger); }
.badge.wait { background: var(--warn-bg); color: var(--warn); }
.badge.gray { background: var(--cream-2); color: var(--muted); }
.badge.gold { background: var(--gold-100); color: var(--bronze); }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* Alerts / flash */
.alert { padding: 13px 16px; border-radius: var(--radius-sm); margin-bottom: 20px; font-size: 13.5px; font-weight: 500; border: 1px solid transparent; display: flex; gap: 10px; align-items: flex-start; }
.alert.sucesso { background: var(--success-bg); color: #256b45; border-color: #bfe3cd; }
.alert.erro { background: var(--danger-bg); color: #ab2a2b; border-color: #f2c4c4; }
.alert.info { background: #e7f0f7; color: #0a5c93; border-color: #c2ddef; }

/* Misc */
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; }
.copybox { display: flex; gap: 8px; align-items: stretch; }
.copybox input { background: var(--cream); }
.help-list { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.help-list li { margin-bottom: 6px; }
.pagelead { color: var(--muted); margin: -6px 0 22px; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .big { font-family: var(--font-head); font-size: 16px; color: var(--espresso); font-weight: 600; margin-bottom: 6px; }
.flex { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.divider { height: 1px; background: var(--border); margin: 22px 0; }
.tag-page { font-weight: 600; color: var(--espresso); }
.tag-biz { color: var(--muted); font-size: 12px; }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 4px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; word-break: break-word; }

/* Steps (guia Meta) */
.steps { counter-reset: step; }
.steps li { list-style: none; position: relative; padding: 0 0 18px 42px; }
.steps li::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; background: var(--gold); color: var(--espresso-dark); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; }
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 13.5px; top: 30px; bottom: 0; width: 1.5px; background: var(--border-2); }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--espresso) 0%, var(--espresso-dark) 100%); padding: 20px; }
.login-card { background: #fff; width: 100%; max-width: 400px; border-radius: 12px; box-shadow: 0 20px 60px rgba(58,39,29,.4); overflow: hidden; }
.login-card .head { background: var(--espresso); padding: 32px; text-align: center; }
.login-card .head b { color: #fff; font-size: 27px; letter-spacing: .5px; font-family: var(--font-head); }
.login-card .head b span { color: var(--gold); }
.login-card .head small { display: block; color: #c3ac91; letter-spacing: 3px; text-transform: uppercase; font-size: 11px; margin-top: 5px; }
.login-card .body { padding: 30px; }

/* Toggle */
/* flex:0 0 44px impede que o toggle seja espremido (viraria um círculo) quando
   está dentro de um container flex com pouco espaço, como no celular. */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: 0 0 44px; }
.switch input { display: none; }
.switch .slider { position: absolute; inset: 0; background: #d8cab5; border-radius: 24px; transition: .2s; cursor: pointer; }
.switch .slider::before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: var(--success); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* ---------- Páginas públicas (Política, Termos, Exclusão) ---------- */
.pub-wrap { max-width: 840px; margin: 0 auto; padding: 0 20px; }
.pub-head { background: var(--espresso); padding: 16px 0; }
.pub-head .pub-wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pub-brand { font-family: var(--font-head); color: #fff; font-size: 20px; font-weight: 700; }
.pub-brand span { color: var(--gold); }
.pub-brand:hover { color: #fff; }
.pub-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.pub-nav a { color: #d8c8b4; font-size: 13.5px; font-weight: 500; }
.pub-nav a:hover { color: var(--gold); }
.pub-foot { border-top: 1px solid var(--border); margin-top: 40px; padding: 22px 0; color: var(--muted); font-size: 12.5px; text-align: center; }

.legal { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 38px 40px; margin: 30px 0; }
.legal h1 { font-size: 27px; color: var(--espresso); margin: 0 0 6px; }
.legal .updated { color: var(--muted); font-size: 12.5px; margin: 0 0 26px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.legal h2 { font-size: 17px; color: var(--espresso); margin: 30px 0 10px; }
.legal h3 { font-size: 14.5px; color: var(--bronze); margin: 18px 0 6px; font-family: var(--font); font-weight: 700; }
.legal p, .legal li { color: var(--text); font-size: 14.5px; line-height: 1.7; }
.legal ul, .legal ol { padding-left: 20px; }
.legal li { margin-bottom: 7px; }
.legal a { color: var(--bronze); text-decoration: underline; }
.legal strong { color: var(--espresso); }
.legal .box { background: var(--cream); border: 1px solid var(--border); border-left: 3px solid var(--gold); border-radius: var(--radius-sm); padding: 16px 18px; margin: 18px 0; }
.legal table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 13.5px; }
.legal table th, .legal table td { text-align: left; padding: 10px 12px; border: 1px solid var(--border); vertical-align: top; }
.legal table th { background: var(--cream); color: var(--espresso); font-weight: 600; }

/* ---------- Responsivo ---------- */

/* Notebooks menores: aperta um pouco os espaçamentos */
@media (max-width: 1200px) {
    .content { padding: 22px 20px 50px; }
    .topbar { padding: 15px 20px; }
}

/* Tablet: barra lateral vira só ícones */
@media (max-width: 900px) {
    .legal { padding: 24px 20px; margin: 18px 0; }
    .legal h1 { font-size: 22px; }
    .sidebar { width: 66px; }
    .sidebar .brand small, .nav a span, .nav .sep, .sidebar .foot .who { display: none; }
    .sidebar .brand { padding: 18px 6px; text-align: center; overflow: hidden; }
    /* "BuscaLead" não cabe em 66px — vira só a sigla */
    .sidebar .brand b { font-size: 0; line-height: 1; }
    .sidebar .brand b::after { content: 'BL'; font-size: 18px; color: var(--gold); font-family: var(--font-head); }
    .nav a { justify-content: center; padding: 11px 0; }
    .main { margin-left: 66px; }
    .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
    .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
    .content { padding: 18px 14px 50px; }
    .topbar { padding: 14px 14px; }
    .kv { grid-template-columns: 1fr; }
    /* Título e botões do cartão empilham em vez de espremer (sem esticar botões) */
    .card .card-head { flex-direction: column; align-items: flex-start; gap: 10px; }
    .card .card-head .wrap-actions { justify-content: flex-start; }
}

/* Celular: a tabela vira cartões (cada linha um bloco rotulado) */
@media (max-width: 768px) {
    table.tbl thead { display: none; }
    table.tbl, table.tbl tbody, table.tbl tr, table.tbl td { display: block; width: 100%; }
    table.tbl tr { border-bottom: 7px solid var(--cream); padding: 8px 0; }
    table.tbl tr:last-child { border-bottom: none; }
    table.tbl td {
        border: none; padding: 7px 16px; text-align: right;
        display: flex; align-items: center; justify-content: space-between; gap: 14px;
        /* Sem isso, e-mails/nomes longos não quebram e estouram a largura da tela
           (min-width:auto dos itens flex usa a largura de min-content). */
        min-width: 0; overflow-wrap: anywhere;
    }
    table.tbl td > * { min-width: 0; }
    /* O rótulo da coluna aparece à esquerda de cada valor */
    table.tbl td::before {
        content: attr(data-label);
        font-weight: 700; color: var(--muted); font-size: 10.5px;
        text-transform: uppercase; letter-spacing: .4px; text-align: left; flex: 0 0 auto;
    }
    table.tbl td:last-child { justify-content: flex-end; padding-top: 10px; }
    table.tbl tr:hover td { background: transparent; }
    .table-wrap { overflow-x: visible; }
    /* Ações não podem estourar a largura */
    .wrap-actions .btn, .card-head form .btn { flex: 1 1 auto; justify-content: center; }
}

/* Celular pequeno */
@media (max-width: 560px) {
    .grid.cols-4 { grid-template-columns: 1fr; }
    .stat .value { font-size: 26px; }
    .content { padding: 14px 10px 40px; }
    table.tbl td { padding: 6px 12px; }
    .card .card-body { padding: 16px; }
    .topbar h1 { font-size: 17px; }
}
