/* HunterTrack — menu do perfil (avatar) e tema claro. Carregado depois de app.css e screens.css. */

:root { --chart-grid: rgba(255, 255, 255, .05); --chart-cross: rgba(255, 255, 255, .18); }

/* ---------- Avatar e menu do perfil ---------- */
.avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; font: 700 13px var(--display); letter-spacing: .02em; color: #fff;
  background: linear-gradient(135deg, #7c3aed, #a855f7 60%, #38d6f5); box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px rgba(139, 92, 246, .55); }
.avatar.lg { width: 44px; height: 44px; font-size: 16px; }
.sidebar-foot.pf { position: relative; padding: 0; overflow: visible; white-space: normal; }
.pf-btn { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid transparent; border-radius: 12px; background: none; color: var(--text); font: inherit; cursor: pointer; text-align: left; transition: background .2s, border-color .2s; }
.pf-btn:hover, .pf-btn[aria-expanded="true"] { background: var(--surface-2); border-color: var(--border-soft); }
.pf-txt { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.pf-txt b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-txt small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-chev { width: 16px; height: 16px; color: var(--muted); flex: none; transition: transform .2s; }
.pf-btn[aria-expanded="true"] .pf-chev { transform: rotate(180deg); }
.pf-menu { position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); min-width: 0; z-index: 70; padding: 8px; border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface-solid); box-shadow: 0 18px 50px rgba(0, 0, 0, .45); animation: pfIn .18s var(--ease); }
@keyframes pfIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.pf-who { display: flex; align-items: center; gap: 10px; padding: 8px 8px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--border-soft); min-width: 0; }
.pf-who div { min-width: 0; display: flex; flex-direction: column; }
.pf-who b { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-who small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-menu form { margin: 0; }
.pf-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: 9px; background: none; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; text-align: left; }
.pf-item:hover { background: var(--surface-2); text-decoration: none; }
.pf-item.danger { color: var(--neg); }
.pf-ico { width: 20px; text-align: center; flex: none; }
.pf-item > span:nth-child(2) { flex: 1; }
.pf-sw { margin: 0; pointer-events: none; }
.pf-sw input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pf-sw span { display: block; width: 36px; height: 20px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); position: relative; transition: background .2s; }
.pf-sw span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.pf-sw input:checked + span { background: var(--brand); border-color: var(--brand); }
.pf-sw input:checked + span::after { transform: translateX(16px); }
.sb-min .pf-txt, .sb-min .pf-chev { display: none; }
.sb-min .pf-btn { justify-content: center; padding: 6px 0; }
.pf-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; }
.pf-theme label { display: inline-flex; align-items: center; cursor: pointer; }
.pf-theme input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pf-theme span { padding: 6px 14px; border-radius: 8px; font-size: 14px; color: var(--text-2); }
.pf-theme input:checked + span { background: var(--brand); color: #fff; }
.pf-theme input:focus-visible + span { outline: 2px solid var(--brand); }
@media (max-width: 900px) {
  .sb-min .pf-txt, .sb-min .pf-chev { display: flex; }
  .sb-min .pf-btn { justify-content: flex-start; padding: 8px; }
}

/* ---------- Tema claro (paleta roxa) ---------- */
html[data-theme="light"] {
  --bg: #f6f4fb;
  --bg-2: #ffffff;
  --surface: rgba(255, 255, 255, .9);
  --surface-solid: #ffffff;
  --surface-2: #f0ebfb;
  --border: #ddd4f2;
  --border-soft: #e9e3f7;
  --text: #1c1430;
  --text-2: #4a3d68;
  --muted: #7b7194;
  --brand: #7c3aed;
  --brand-2: #6d28d9;
  --brand-glow: rgba(124, 58, 237, .13);
  --cyan: #0891b2;
  --pos: #0b9a69;
  --neg: #dc2f57;
  --warn: #b7791f;
  --s-rev: #7c3aed;
  --s-cost: #b7791f;
  --s-profit: #0b9a69;
  --chart-grid: rgba(28, 20, 48, .07);
  --chart-cross: rgba(28, 20, 48, .25);
  color-scheme: light;
}
html[data-theme="light"] ::selection { background: rgba(124, 58, 237, .22); }
html[data-theme="light"] * { scrollbar-color: #cfc3ee transparent; }
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: #cfc3ee; background-clip: content-box; }
html[data-theme="light"] .bg-fx { opacity: .55; }
html[data-theme="light"] .sidebar { background: linear-gradient(180deg, #ffffff, #f8f5ff); box-shadow: 1px 0 0 var(--border-soft); }
html[data-theme="light"] .sb-toggle:hover, html[data-theme="light"] .fx-swap:hover { color: var(--brand-2); }
html[data-theme="light"] .nav a { color: var(--text-2); }
html[data-theme="light"] .nav a:hover { background: var(--surface-2); color: var(--text); }
html[data-theme="light"] .nav a.active { background: linear-gradient(90deg, rgba(124, 58, 237, .16), rgba(124, 58, 237, .03)); color: var(--brand-2); }
html[data-theme="light"] .topbar { background: rgba(246, 244, 251, .82); }
html[data-theme="light"] .fx { background: linear-gradient(160deg, rgba(124, 58, 237, .08), rgba(8, 145, 178, .04) 60%, #fff); }
html[data-theme="light"] .fx-row output { color: var(--text); }
html[data-theme="light"] .card { box-shadow: 0 1px 2px rgba(28, 20, 48, .04), 0 8px 24px rgba(28, 20, 48, .05); }
html[data-theme="light"] .card:hover { border-color: #cbbdf0; }
html[data-theme="light"] .kpi:hover { box-shadow: 0 12px 30px rgba(28, 20, 48, .1), 0 0 0 1px rgba(124, 58, 237, .18); }
html[data-theme="light"] .seg .on, html[data-theme="light"] .seg .on:hover { background: linear-gradient(135deg, #7c3aed, #9b6bff); color: #fff; box-shadow: 0 2px 10px rgba(124, 58, 237, .3); }
html[data-theme="light"] tr:hover td { background: rgba(124, 58, 237, .03); }
html[data-theme="light"] tr.clickable:hover td { background: rgba(124, 58, 237, .06); }
html[data-theme="light"] .tag { background: #efeaf9; }
html[data-theme="light"] .tag.brand { background: rgba(124, 58, 237, .12); }
html[data-theme="light"] .tag.t-pago { color: #6d28d9; } html[data-theme="light"] .tag.t-organico { color: #0b8a5f; }
html[data-theme="light"] .tag.t-direto { color: #a16207; } html[data-theme="light"] .tag.t-referencia { color: #1d6fb8; }
html[data-theme="light"] .tag.t-bot { color: #be3a66; }
html[data-theme="light"] .modal-bg { background: rgba(28, 20, 48, .35); }
html[data-theme="light"] .modal-panel { background: #fbfaff; box-shadow: -20px 0 60px rgba(28, 20, 48, .18); }
html[data-theme="light"] .stat:hover { border-color: #cbbdf0; }
html[data-theme="light"] .fstep.on b { color: var(--text); }
html[data-theme="light"] input[type=date] { color-scheme: light; }
html[data-theme="light"] .sb-backdrop { background: rgba(28, 20, 48, .35); }
html[data-theme="light"] .auth { background: radial-gradient(ellipse at top, rgba(124, 58, 237, .14), transparent 60%); }
html[data-theme="light"] .pf-menu { box-shadow: 0 18px 50px rgba(28, 20, 48, .18); }
html[data-theme="light"] .avatar { box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(124, 58, 237, .45); }
html[data-theme="light"] .trk[open] { box-shadow: 0 0 0 1px rgba(124, 58, 237, .15), 0 8px 24px rgba(28, 20, 48, .06); }
.sb-min .pf-menu { right: auto; width: 240px; left: 0; }
.sidebar:has(.pf-menu:not([hidden])) { overflow: visible; z-index: 65; }

/* ---------- Logo (DJM HunterTrack) ---------- */
.brand-mark.logo { width: 40px; height: 40px; background: none; border-radius: 10px; box-shadow: 0 0 18px rgba(139, 92, 246, .45); overflow: hidden; }
.brand-mark.logo::after { display: none; }
.brand-mark.logo img { display: block; width: 100%; height: 100%; }
.auth .brand-mark.logo { width: 52px; height: 52px; border-radius: 12px; }
html[data-theme="light"] .brand-mark.logo { box-shadow: 0 4px 14px rgba(124, 58, 237, .3); }
.pf-item[hidden] { display: none; }
#ht-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; max-width: min(92vw, 460px); padding: 12px 16px; border-radius: 12px;
  background: var(--surface-solid); color: var(--text); border: 1px solid var(--brand); box-shadow: 0 12px 40px rgba(0, 0, 0, .45); font-size: 14px; line-height: 1.4; }
#ht-toast.bad { border-color: var(--neg); }
#ht-toast[hidden] { display: none; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar { overflow: hidden; }
.avatar.xl { width: 72px; height: 72px; font-size: 24px; }
.pf-photo { display: inline-flex; margin: 4px 8px 0 0; } .pf-photo label.btn { cursor: pointer; }
