/*
 * Topo do painel no padrão do template Conect7 (26/10/2026).
 * Barra branca 56px com desfoque, chips de 36px (raio 10, borda #e2e8f0), PDV roxo #7c3aed,
 * relógio escuro com dígitos verdes, sino/chat com selo e usuário com avatar roxo.
 * Carregado depois de tema_painel.css; só vale no painel (body.sidebar-mini), o PDV usa header-pos.
 */
body.sidebar-mini .main-header.tp7-topo {
    --t7-borda: #e2e8f0;
    --t7-txt: #0f172a;
    --t7-sub: #64748b;
    --t7-ic: #475569;
    --t7-roxo: #7c3aed;
    position: relative;
    z-index: 1030;
    font-family: Inter, 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ── Logo ── */
body.sidebar-mini .main-header .logo.tp7-logo {
    display: flex !important;
    align-items: center;
    gap: 10px;
    height: 56px !important;
    padding: 0 14px !important;
    background: #fff !important;
    border-right: 1px solid var(--t7-borda) !important;
    border-bottom: 1px solid var(--t7-borda) !important;
    text-align: left;
    overflow: hidden;
}
body.sidebar-mini .main-header .tp7-sigla,
body.sidebar-mini .main-header .tp7-logo-img {
    flex: 0 0 36px;
    width: 36px !important;
    height: 36px !important;
    border-radius: 10px !important;
    object-fit: contain;
}
body.sidebar-mini .main-header .tp7-sigla {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--t7-roxo);
    color: #fff;
    font-weight: 900;
    font-size: 15px;
    letter-spacing: -.5px;
    box-shadow: 0 4px 12px rgba(124, 58, 237, .35);
}
body.sidebar-mini .main-header .tp7-logo-txt {
    display: flex !important;
    flex-direction: column;
    min-width: 0;
    line-height: 1.15;
}
body.sidebar-mini .main-header .tp7-logo-txt b {
    color: var(--t7-txt) !important;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
body.sidebar-mini .main-header .tp7-logo-txt small {
    color: var(--t7-sub) !important;
    font-size: 10px;
    font-weight: 700;
}
body.sidebar-mini.sidebar-collapse .main-header .logo.tp7-logo { justify-content: center; padding: 0 !important; }

/* Ícone de informações do plano (módulo Superadmin) vinha branco com margem inline */
body.sidebar-mini .main-header.tp7-topo .navbar > i.fa-info-circle {
    float: none !important; margin: 0 4px !important; color: #94a3b8 !important; font-size: 16px; flex: 0 0 auto;
}
body.sidebar-mini .main-header.tp7-topo .navbar > i.fa-info-circle:hover { color: var(--t7-roxo) !important; }

/* ── Barra ── */
body.sidebar-mini .main-header.tp7-topo .navbar {
    background: rgba(255, 255, 255, .86) !important;
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--t7-borda) !important;
    box-shadow: 0 1px 8px rgba(0, 0, 0, .04) !important;
    min-height: 56px;
    display: flex;
    align-items: center;
}
body.sidebar-mini .main-header.tp7-topo .navbar > .sidebar-toggle { flex: 0 0 auto; }
body.sidebar-mini .main-header .navbar-custom-menu.tp7-barra {
    float: none !important;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 56px;
    padding: 0 12px 0 6px;
    min-width: 0;
}
body.sidebar-mini .tp7-barra > *,
body.sidebar-mini .tp7-grupo > * { float: none !important; margin: 0 !important; }
body.sidebar-mini .tp7-grupo { display: flex; align-items: center; gap: 8px; }
body.sidebar-mini .tp7-div { width: 1px; height: 24px; background: var(--t7-borda); flex: 0 0 1px; }

/* chip / botão de ícone */
body.sidebar-mini .tp7-chip,
body.sidebar-mini .tp7-ic,
body.sidebar-mini .tp7-grupo > .btn {
    height: 36px;
    border-radius: 10px !important;
    border: 1px solid var(--t7-borda) !important;
    background: #fff !important;
    color: var(--t7-txt) !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: none !important;
    text-shadow: none !important;
    transition: transform .15s, box-shadow .15s, color .15s;
    text-decoration: none !important;
}
body.sidebar-mini .tp7-chip { padding: 0 10px; }
body.sidebar-mini .tp7-ic,
body.sidebar-mini .tp7-grupo > .btn { width: 36px; padding: 0 !important; color: var(--t7-ic) !important; font-size: 15px; }
body.sidebar-mini .tp7-ic:hover,
body.sidebar-mini .tp7-grupo > .btn:hover,
body.sidebar-mini a.tp7-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, .14) !important;
    color: var(--t7-roxo) !important;
}
body.sidebar-mini .tp7-ic-perigo { color: #dc2626 !important; }
body.sidebar-mini .tp7-grupo > .btn.hide { display: none !important; }

/* Ambiente */
body.sidebar-mini .tp7-ponto {
    width: 8px; height: 8px; border-radius: 50%;
    background: #10b981; box-shadow: 0 0 8px #10b981;
    animation: tp7pulso 2s cubic-bezier(.4, 0, .6, 1) infinite;
}
@keyframes tp7pulso { 50% { opacity: .5; } }

/* PDV */
body.sidebar-mini .tp7-pdv {
    height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    background: var(--t7-roxo) !important;
    color: #fff !important;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .03em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(124, 58, 237, .3);
    text-decoration: none !important;
    transition: transform .15s, box-shadow .15s;
}
body.sidebar-mini .tp7-pdv:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(124, 58, 237, .4); color: #fff !important; }
body.sidebar-mini .tp7-pdv-ic {
    width: 20px; height: 20px; border-radius: 6px;
    background: rgba(255, 255, 255, .2);
    display: inline-flex; align-items: center; justify-content: center; font-size: 11px;
}
body.sidebar-mini .tp7-mais .tp7-ic { font-size: 11px; }
body.sidebar-mini .tp7-menu {
    min-width: 210px; padding: 6px !important; border-radius: 12px !important;
    border: 1px solid var(--t7-borda) !important; box-shadow: 0 12px 28px rgba(0, 0, 0, .18) !important;
}
body.sidebar-mini .tp7-menu > li > a {
    border-radius: 8px; padding: 9px 12px !important; font-size: 12px; font-weight: 600; color: var(--t7-txt) !important;
}
body.sidebar-mini .tp7-menu > li > a i { width: 18px; color: var(--t7-roxo); margin-right: 6px; }
body.sidebar-mini .tp7-menu > li > a:hover { background: #f8fafc !important; }

/* Relógio */
body.sidebar-mini .tp7-relogio {
    height: 36px;
    padding: 0 9px;
    border-radius: 10px;
    background: #0f172a;
    color: #6ee7b7;
    border: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .1em;
    white-space: nowrap;
}
body.sidebar-mini .tp7-relogio > .fa-clock { margin-right: 5px; font-size: 12px; }
body.sidebar-mini .tp7-relogio .tp7-sep { font-style: normal; opacity: .6; }
body.sidebar-mini .tp7-relogio .tp7-seg { color: #fff; }

/* Chat do atendimento */
body.sidebar-mini .tp7-chat {
    position: relative;
    width: 40px; height: 40px;
    border-radius: 12px;
    border: 1px solid var(--t7-borda);
    border-bottom: 3px solid #cbd5e1;
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
    color: #334155 !important;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 17px;
    text-decoration: none !important;
}
body.sidebar-mini .tp7-chat > i { animation: tp7msg 3s ease-in-out infinite; }
@keyframes tp7msg { 0%, 88%, 100% { transform: translateY(0); } 92% { transform: translateY(-3px); } }
body.sidebar-mini .tp7-chat-badge {
    position: absolute; top: -5px; right: -5px;
    min-width: 18px; height: 18px; padding: 0 4px;
    border-radius: 99px; border: 2px solid #fff;
    background: #94a3b8; color: #fff;
    font-size: 10px; font-weight: 900; line-height: 14px; text-align: center;
}
body.sidebar-mini .tp7-chat-badge.tem { background: var(--t7-roxo); }
body.sidebar-mini .tp7-chat-on {
    position: absolute; bottom: -2px; left: -2px;
    width: 8px; height: 8px; border-radius: 50%;
    background: #10b981; border: 1px solid #fff;
    box-shadow: 0 0 6px rgba(16, 185, 129, .6);
    animation: tp7pulso 2s infinite;
}

/* Sino e usuário (ul.nav do AdminLTE) */
body.sidebar-mini .tp7-nav { display: flex; align-items: center; gap: 8px; margin: 0 !important; }
body.sidebar-mini .tp7-nav > li { float: none !important; }
body.sidebar-mini .main-header .tp7-nav > li.notifications-menu > a {
    width: 36px; height: 36px; padding: 0 !important;
    border-radius: 10px; border: 1px solid var(--t7-borda);
    background: #fff !important; color: var(--t7-ic) !important;
    display: flex; align-items: center; justify-content: center; font-size: 15px;
    transition: transform .15s;
}
body.sidebar-mini .main-header .tp7-nav > li.notifications-menu > a:hover { transform: translateY(-1px); }
body.sidebar-mini .main-header .tp7-nav > li.notifications-menu > a .label {
    position: absolute; top: -5px !important; right: -5px !important;
    min-width: 16px; height: 16px; padding: 0 4px !important;
    border-radius: 99px; background: #ef4444 !important; color: #fff !important;
    font-size: 9px !important; font-weight: 900; line-height: 16px !important;
}
body.sidebar-mini .main-header .tp7-nav > li.notifications-menu > a .label:empty { display: none; }
body.sidebar-mini .main-header .tp7-nav > li.user-menu > a.tp7-usuario {
    display: flex !important; align-items: center; gap: 8px;
    height: 40px; padding: 0 0 0 6px !important;
    background: transparent !important;
}
body.sidebar-mini .tp7-usuario-txt { display: flex !important; flex-direction: column; text-align: right; line-height: 1.2; }
body.sidebar-mini .tp7-usuario-txt b { color: var(--t7-txt); font-size: 11px; font-weight: 800; }
body.sidebar-mini .tp7-usuario-txt small { color: var(--t7-sub); font-size: 10px; }
body.sidebar-mini .main-header .tp7-avatar {
    width: 36px !important; height: 36px !important; margin: 0 !important; float: none !important;
    border-radius: 10px !important; background: var(--t7-roxo);
    color: #fff; font-weight: 900; font-size: 15px;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(124, 58, 237, .35);
    object-fit: cover;
}

/* ── Botão do tema (só no painel inicial) ── */
body.sidebar-mini .tp7-tema { position: relative; overflow: hidden; font-size: 16px; background: #fef3c7 !important; border-color: #fde68a !important; }
body.sidebar-mini .tp7-tema .tp7-sol { display: none; }
html.pn-escuro body.sidebar-mini .tp7-tema .tp7-sol { display: inline; }
html.pn-escuro body.sidebar-mini .tp7-tema .tp7-lua { display: none; }
body.sidebar-mini .tp7-tema.gira span { animation: tp7gira .5s cubic-bezier(.2, .8, .2, 1); }
@keyframes tp7gira { from { transform: rotate(-180deg) scale(.4); opacity: 0; } }

/* ── MODO ESCURO do topo (Dark Premium do template; html.pn-escuro só existe no /home) ── */
html.pn-escuro body.sidebar-mini .main-header.tp7-topo { --t7-borda: rgba(255, 255, 255, .08); --t7-txt: #e2e8f0; --t7-sub: #94a3b8; --t7-ic: #cbd5e1; }
html.pn-escuro body.sidebar-mini .main-header.tp7-topo .navbar {
    background: rgba(15, 23, 42, .85) !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .06), 0 8px 24px rgba(0, 0, 0, .35) !important;
}
html.pn-escuro body.sidebar-mini .main-header .logo.tp7-logo { background: #0f172a !important; }
html.pn-escuro body.sidebar-mini .tp7-chip,
html.pn-escuro body.sidebar-mini .tp7-ic,
html.pn-escuro body.sidebar-mini .tp7-grupo > .btn,
html.pn-escuro body.sidebar-mini .main-header .tp7-nav > li.notifications-menu > a { background: rgba(255, 255, 255, .06) !important; }
html.pn-escuro body.sidebar-mini .tp7-tema { background: rgba(255, 255, 255, .08) !important; border-color: rgba(255, 255, 255, .12) !important; }
html.pn-escuro body.sidebar-mini .tp7-relogio { background: #020617; }
html.pn-escuro body.sidebar-mini .tp7-chat { background: rgba(255, 255, 255, .06); border-bottom: 3px solid rgba(255, 255, 255, .12); color: #e2e8f0 !important; box-shadow: none; }
html.pn-escuro body.sidebar-mini .tp7-chat-badge, html.pn-escuro body.sidebar-mini .tp7-chat-on { border-color: #0f172a; }
html.pn-escuro body.sidebar-mini .tp7-menu { background: #1e293b !important; }
html.pn-escuro body.sidebar-mini .tp7-menu > li > a:hover { background: rgba(255, 255, 255, .06) !important; }
html.pn-escuro body.sidebar-mini .main-header.tp7-topo .sidebar-toggle { color: #cbd5e1 !important; }

/* Telas menores: some o que não cabe, a barra rola em vez de quebrar */
@media (max-width: 1280px) {
    body.sidebar-mini .tp7-data, body.sidebar-mini .tp7-usuario-txt { display: none !important; }
}
@media (max-width: 1100px) {
    body.sidebar-mini .tp7-ambiente, body.sidebar-mini .tp7-relogio { display: none !important; }
}
@media (max-width: 767px) {
    body.sidebar-mini .main-header.tp7-topo .navbar { display: flex; }
    body.sidebar-mini .main-header .logo.tp7-logo { justify-content: flex-start; }
    body.sidebar-mini .main-header .navbar-custom-menu.tp7-barra { overflow-x: auto; }
}
