/* =====================================================================
   AUREON CRM — Layout (shell, sidebar, dashboard, kanban, ficha)
   ===================================================================== */

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border-forte); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.login-top { padding: 34px 32px 8px; text-align: center; }
.login-top .brand { justify-content: center; margin-bottom: 6px; }
.login-sub { color: var(--txt-muted); font-size: 13px; letter-spacing: 0.03em; }
.login-body { padding: 20px 32px 32px; }
.login-strip { height: 4px; background: var(--grad-ouro); }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); background: var(--preto-2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 50;
}
.sidebar-brand { padding: 22px 20px; border-bottom: 1px solid var(--border); }
.nav { padding: 14px 12px; flex: 1; overflow-y: auto; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--txt-muted); padding: 14px 12px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--txt-2); font-size: 14px; font-weight: 500; cursor: pointer; transition: var(--transition);
  margin-bottom: 2px;
}
.nav-item .ico { width: 18px; text-align: center; font-size: 16px; opacity: 0.85; }
.nav-item:hover { background: var(--surface); color: var(--txt); }
.nav-item.active { background: rgba(166,138,84,0.14); color: var(--ouro-claro); }
.nav-item.active .ico { opacity: 1; }
.nav-badge { margin-left: auto; background: var(--ouro); color: var(--preto); font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.sidebar-foot { padding: 14px; border-top: 1px solid var(--border); }
.user-pill { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--grad-ouro); color: var(--preto); display: grid; place-items: center; font-weight: 700; font-size: 14px; }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; }
.topbar {
  height: 64px; border-bottom: 1px solid var(--border); background: rgba(14,14,14,0.85);
  backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 16px; padding: 0 28px;
}
.topbar h1 { font-size: 19px; font-weight: 700; letter-spacing: 0.01em; }
.topbar .sub { color: var(--txt-muted); font-size: 13px; }
.content { padding: 28px; max-width: 1400px; }

/* ---------- Stat cards ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; position: relative; overflow: hidden;
}
.stat::before { content: ""; position: absolute; top: 0; left: 0; width: 3px; height: 100%; background: var(--grad-ouro); opacity: 0.85; }
.stat .label { font-size: 12px; color: var(--txt-muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.stat .value { font-size: 30px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .value.gold { color: var(--ouro-claro); }
.stat .hint { font-size: 12px; color: var(--txt-2); margin-top: 4px; }

/* Metas / progress */
.meta-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.meta-row:last-child { border-bottom: none; }
.progress { flex: 1; height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--grad-ouro); border-radius: 999px; transition: width 400ms ease; }
.meta-num { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 58px; text-align: right; }

.dash-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-top: 16px; }
@media (max-width: 1000px) { .dash-grid { grid-template-columns: 1fr; } }

/* Funil */
.funnel-stage { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.funnel-bar { height: 30px; border-radius: 6px; background: var(--grad-ouro); min-width: 34px; display: flex; align-items: center; padding: 0 10px; color: var(--preto); font-weight: 700; font-size: 13px; transition: width 400ms ease; }
.funnel-label { width: 130px; font-size: 13px; color: var(--txt-2); }

/* ---------- Kanban ---------- */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.kanban-col { flex: 0 0 288px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 200px); }
.kanban-col.dragover { border-color: var(--ouro); box-shadow: 0 0 0 2px rgba(166,138,84,0.3); }
.kanban-head { padding: 12px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: var(--surface); border-radius: var(--radius) var(--radius) 0 0; }
.kanban-head .t { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.kanban-head .c { background: var(--surface-3); color: var(--txt-2); font-size: 11px; padding: 1px 8px; border-radius: 999px; font-weight: 700; }
.kanban-body { padding: 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.lead-card { background: var(--surface-2); border: 1px solid var(--border-forte); border-radius: var(--radius-sm); padding: 12px; cursor: grab; transition: var(--transition); }
.lead-card:hover { border-color: var(--ouro); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.lead-card:active { cursor: grabbing; }
.lead-card .nome { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.lead-card .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lead-card .val { color: var(--ouro-claro); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.score-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ---------- Prospecção (filtros) ---------- */
.pros-layout { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .pros-layout { grid-template-columns: 1fr; } }
.filtros-panel { position: sticky; top: 84px; }
.filtro-grupo { border-bottom: 1px solid var(--border); padding: 6px 0; }
.filtro-grupo > summary { cursor: pointer; padding: 10px 4px; font-weight: 700; font-size: 13px; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.filtro-grupo > summary::-webkit-details-marker { display: none; }
.filtro-grupo > summary::after { content: "▾"; color: var(--txt-muted); transition: var(--transition); }
.filtro-grupo[open] > summary::after { transform: rotate(180deg); }
.filtro-grupo .conteudo { padding: 6px 4px 14px; }
.multi-opts { display: flex; flex-wrap: wrap; gap: 6px; }

.result-row { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); transition: var(--transition); }
.result-row:hover { background: var(--surface-2); }

/* ---------- Ficha do lead ---------- */
.lead-layout { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .lead-layout { grid-template-columns: 1fr; } }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; }
.info-item .k { font-size: 11.5px; color: var(--txt-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.info-item .v { font-size: 14.5px; margin-top: 2px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab { padding: 10px 16px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--txt-2); border-bottom: 2px solid transparent; transition: var(--transition); }
.tab:hover { color: var(--txt); }
.tab.active { color: var(--ouro-claro); border-bottom-color: var(--ouro); }

.timeline-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.timeline-ico { width: 34px; height: 34px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; flex-shrink: 0; font-size: 15px; }

.dd-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.dd-status { padding: 4px 10px; border-radius: var(--radius-sm); font-size: 12px; border: 1px solid var(--border-forte); background: var(--surface-2); cursor: pointer; }

.calc-line { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.calc-line.total { border-bottom: none; border-top: 1px solid var(--border-forte); margin-top: 6px; padding-top: 12px; font-weight: 700; font-size: 16px; }
.calc-line .v { font-variant-numeric: tabular-nums; }

/* ---------- Cadência ---------- */
.cad-step { display: flex; gap: 16px; padding: 16px 0; position: relative; }
.cad-day { flex: 0 0 70px; text-align: center; }
.cad-day .num { font-size: 22px; font-weight: 800; color: var(--ouro-claro); font-family: var(--font-marca); }
.cad-day .lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--txt-muted); }
.cad-body { flex: 1; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--ouro); border-radius: var(--radius-sm); padding: 14px 16px; }
.cad-line { position: absolute; left: 35px; top: 44px; bottom: -16px; width: 2px; background: var(--border); }

/* Responsivo básico */
@media (max-width: 760px) {
  .sidebar { transform: translateX(-100%); transition: transform var(--transition); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .field-row, .info-grid { grid-template-columns: 1fr; }
}
