/* ============================================================
   Flagy Control — shell do painel e telas de entrada
   Espelho do layout do Flagy Consumer (rail escuro de áreas · topbar
   branca · sidebar clara da área · login em duas metades).
   A cor vem de cada organização (tenants.cor_marca → --mc-primary);
   os tons escuro/claro são derivados aqui.
   ============================================================ */
:root {
    --mc-primary: #09713c;
    --mc-primary-dark: color-mix(in srgb, var(--mc-primary) 78%, #000);
    --mc-primary-fraco: color-mix(in srgb, var(--mc-primary) 10%, #fff);
    --mc-accent: #a6cc42;
    --mc-rail: #151b18;
    --mc-texto: #1c241f;
    --mc-borda: #e6ebe7;
    --mc-bg: #f5f7f5;
}

.fx-body { background: var(--mc-bg); color: var(--mc-texto); font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
.fx { --rail-w: 84px; --top-h: 60px; --sub-w: 228px; display: flex; min-height: 100vh; }

/* Rail de áreas */
.fx-rail { width: var(--rail-w); flex: none; background: var(--mc-rail); color: #c9d1cc;
    position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; align-items: stretch;
    padding: 12px 8px; z-index: 1040; }
.fx-rail__loja { display: grid; place-items: center; margin: 0 auto 14px; width: 50px; height: 50px; border-radius: 50%;
    background: linear-gradient(135deg, var(--mc-primary), var(--mc-accent)); padding: 3px; text-decoration: none; }
.fx-rail__loja span { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: #fff; overflow: hidden; }
.fx-rail__loja img { width: 76%; height: 76%; object-fit: contain; }
.fx-rail__nav { flex: 1; display: flex; flex-direction: column; gap: 4px; overflow: visible; }
.fx-rail__pe { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid rgba(255,255,255,.08); padding-top: 8px; }
.fx-rail__pe form { margin: 0; }
.fx-area { position: relative; }
.fx-area__btn { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 2px 8px; width: 100%;
    border: 0; background: transparent; border-radius: 12px; color: #aab5ae; text-decoration: none; font-size: .66rem; font-weight: 600;
    letter-spacing: .01em; text-align: center; line-height: 1.15; transition: background .12s, color .12s; }
.fx-area__btn i { font-size: 1.25rem; line-height: 1; }
.fx-area__btn:hover { background: rgba(255,255,255,.07); color: #fff; }
.fx-area.is-active > .fx-area__btn { background: var(--mc-primary); color: #fff;
    box-shadow: 0 6px 16px color-mix(in srgb, var(--mc-primary) 40%, transparent); }

/* Flyout da área (hover no desktop) */
.fx-flyout { position: absolute; left: calc(100% + 10px); top: -6px; min-width: 240px; background: #fff;
    border: 1px solid var(--mc-borda); border-radius: 14px; box-shadow: 0 18px 44px rgba(17, 24, 19, .18);
    padding: 8px; display: none; z-index: 1200; }
.fx-flyout::before { content: ''; position: absolute; left: -12px; top: 0; bottom: 0; width: 12px; }
.fx-area:hover > .fx-flyout, .fx-area:focus-within > .fx-flyout { display: block; }
.fx-flyout__titulo { font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #94a099; padding: 6px 10px 4px; }
.fx-flyout a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px;
    color: var(--mc-texto); text-decoration: none; font-size: .88rem; white-space: nowrap; }
.fx-flyout a:hover { background: var(--mc-bg); }
.fx-flyout a.active { background: var(--mc-primary-fraco); color: var(--mc-primary); font-weight: 600; }
.fx-flyout a i { width: 18px; text-align: center; color: var(--mc-primary); }

.fx-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* Topbar branca */
.fx-top { position: sticky; top: 0; z-index: 1030; height: var(--top-h); display: flex; align-items: center; gap: 12px;
    padding: 0 20px; background: rgba(255,255,255,.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--mc-borda); }
.fx-top__burger { display: none; border: 0; background: transparent; font-size: 1.4rem; color: var(--mc-texto); padding: 0 4px; }
.fx-top__titulo { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fx-top__loja { font-weight: 800; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-top__trilha { color: #87928b; font-size: .88rem; font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.fx-top__trilha i { font-size: .7rem; }
.fx-top__acoes { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.fx-pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px;
    border: 1px solid var(--mc-borda); background: #fff; color: var(--mc-texto); font-size: .82rem; font-weight: 600;
    text-decoration: none; cursor: pointer; transition: border-color .12s, color .12s; }
.fx-pill:hover { border-color: var(--mc-primary); color: var(--mc-primary); }
.fx-pill--alerta { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }
.fx-pill--aviso { border-color: #fde68a; background: #fffbeb; color: #92400e; }

/* Status dos leitores (pílula verde/vermelha) */
.fx-status { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 999px;
    border: 1px solid; font-size: .82rem; font-weight: 700; text-decoration: none; background: #fff; }
.fx-status.on  { color: #0f766e; border-color: #99e2d6; background: #effcf9; }
.fx-status.off { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }
.fx-status__dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 20%, transparent); }
.fx-status.on .fx-status__dot { animation: fxPulso 1.8s ease-in-out infinite; }
@keyframes fxPulso { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, currentColor 0%, transparent); } }

.fx-user { display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 0; color: inherit; }
.fx-user__ava { width: 34px; height: 34px; border-radius: 50%; background: var(--mc-rail); color: #fff;
    display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.fx-user__nome { font-size: .85rem; font-weight: 600; text-align: left; line-height: 1.15; }
.fx-user__nome small { display: block; font-weight: 500; color: #87928b; font-size: .72rem; }

/* Corpo: sidebar da área + conteúdo */
.fx-corpo { flex: 1; display: flex; align-items: flex-start; min-height: 0; }
.fx-sub { width: var(--sub-w); flex: none; align-self: stretch; position: sticky; top: var(--top-h);
    height: calc(100vh - var(--top-h)); overflow-y: auto; background: #fff; border-right: 1px solid var(--mc-borda); padding: 8px 10px; }
.fx-sub__head { display: flex; align-items: center; padding: 10px 8px 8px; font-size: .7rem; font-weight: 700;
    letter-spacing: .08em; text-transform: uppercase; color: #94a099; }
.fx-sub__toggle { margin-left: auto; border: 0; background: transparent; color: #94a099; border-radius: 8px; padding: 2px 6px; }
.fx-sub__toggle:hover { background: var(--mc-bg); color: var(--mc-primary); }
.fx-sub a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 2px; border-radius: 10px;
    color: #39433d; text-decoration: none; font-size: .9rem; font-weight: 500; }
.fx-sub a i { width: 20px; text-align: center; font-size: 1rem; color: #87928b; }
.fx-sub a:hover { background: var(--mc-bg); }
.fx-sub a.active { background: var(--mc-primary-fraco); color: var(--mc-primary); font-weight: 700; }
.fx-sub a.active i { color: var(--mc-primary); }
.fx-corpo.sub-fechado .fx-sub { width: 64px; }
.fx-corpo.sub-fechado .fx-sub .fx-sub__label { display: none; }
.fx-corpo.sub-fechado .fx-sub a, .fx-corpo.sub-fechado .fx-sub__head { justify-content: center; }
.fx-corpo.sub-fechado .fx-sub__toggle { margin-left: 0; }
.fx-conteudo { flex: 1; min-width: 0; padding: 24px 28px 40px; }
.fx-veu { display: none; }

/* Mobile: rail vira gaveta; sidebar da área vira abas roláveis */
@media (max-width: 860px) {
    .fx-top { padding: 0 12px; }
    .fx-top__burger { display: inline-flex; }
    .fx-rail { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .2s ease; }
    .fx.rail-aberto .fx-rail { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.35); }
    .fx.rail-aberto .fx-veu { display: block; position: fixed; inset: 0; background: rgba(17, 24, 19, .45); z-index: 1035; }
    .fx-flyout { display: none !important; }
    .fx-corpo { flex-direction: column; align-items: stretch; }
    .fx-sub { position: sticky; top: var(--top-h); z-index: 1020; width: auto !important; height: auto; display: flex; gap: 6px;
        overflow-x: auto; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--mc-borda); scrollbar-width: none; }
    .fx-sub::-webkit-scrollbar { display: none; }
    .fx-sub__head { display: none; }
    .fx-sub a { flex: none; margin: 0; padding: 6px 12px; border: 1px solid var(--mc-borda); border-radius: 999px; font-size: .82rem; }
    .fx-sub .fx-sub__label { display: inline !important; }
    .fx-conteudo { padding: 16px; }
    .fx-top__acoes .fx-pill span, .fx-status span:last-child { display: none; }
}

/* Componentes no padrão do Consumer */
.fx-body .btn { border-radius: 10px; font-weight: 600; }
.fx-body .btn-sm { border-radius: 8px; }
.fx-body .form-control, .fx-body .form-select { border-radius: 10px; border-color: #dfe5e1; }
.fx-body .table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: #87928b; font-weight: 700; }
.fx-body .fc-card, .card-mc { background: #fff; border: 1px solid var(--mc-borda); border-radius: 16px; box-shadow: 0 1px 2px rgba(17, 24, 19, .03); }
.fx-body .fc-page-head h1 { font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; }

/* ============================================================
   Leitores (mesmo visual do clubes.projetos)
   ============================================================ */
.leitor-mini { width: 44px; flex: 0 0 44px; }
.leitor-mini .lm-corpo { position: relative; height: 62px; border-radius: 9px; background: #0b0f15;
    border: 2px solid #d6dce3; display: flex; align-items: center; justify-content: center; color: #8b98a8; }
.leitor-mini .lm-cam { position: absolute; top: 5px; left: 50%; transform: translateX(-50%); width: 5px; height: 5px; border-radius: 50%; background: #39424f; }
.leitor-mini .lm-tela { font-size: 1.05rem; }
.leitor-mini .lm-led { position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%); width: 6px; height: 6px; border-radius: 50%; background: #4b5563; }
.leitor-mini.is-on .lm-led { background: #22c55e; box-shadow: 0 0 6px #22c55e; }
.leitor-mini.is-on .lm-tela { color: #dbe4f0; }
.leitor-mini .lm-base { height: 6px; margin: 3px auto 0; width: 30px; border-radius: 3px; background: #c5ccd5; }
.leitor-card { display: flex; gap: 14px; padding: 16px; height: 100%; text-decoration: none; color: inherit; transition: border-color .12s, box-shadow .12s, transform .12s; cursor: pointer; }
.leitor-card:hover { border-color: var(--mc-primary); box-shadow: 0 8px 22px rgba(17, 24, 19, .07); transform: translateY(-1px); }
.leitor-card__nome { font-weight: 700; color: var(--mc-primary); text-decoration: none; }
.leitor-card.is-off .leitor-card__nome { color: var(--mc-texto); }
.leitor-card__rodape { font-size: .82rem; color: #6b7570; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--mc-borda); }
.selo-sinal { font-size: .65rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.selo-sinal.on { background: #16a34a; color: #fff; }
.selo-sinal.off { background: #6b7280; color: #fff; }

.leitor-mock { position: relative; width: 100%; max-width: 190px; }
.leitor-svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 12px 22px rgba(20,30,50,.18)); }
.leitor-screen { position: absolute; left: 20%; top: 3.7%; width: 60%; height: 53.91%; border-radius: 11px;
    overflow: hidden; background: #0b0f15; color: #fff; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: .25rem; text-align: center; padding: .4rem; transition: background .25s ease; }
.leitor-screen .ls-cam { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); }
.leitor-screen .ls-cam span { display: block; width: 6px; height: 6px; border-radius: 50%; background: #39424f; }
.leitor-screen .ls-icone { font-size: 1.9rem; line-height: 1; }
.leitor-screen .ls-texto { font-size: .72rem; font-weight: 700; letter-spacing: .2px; }
.leitor-screen .ls-sub { font-size: .58rem; opacity: .8; }
.leitor-screen .ls-nome { position: absolute; bottom: 5px; left: 0; right: 0; font-size: .5rem; opacity: .6; }
.leitor-screen.is-ok { background: linear-gradient(160deg, #0f5132, #16a34a); }
.leitor-screen.is-nao { background: linear-gradient(160deg, #5c1620, #dc2626); }
.sync-num { border: 1px solid var(--mc-borda); border-radius: 12px; padding: 10px 6px; text-align: center; height: 100%; }
.sync-num b { display: block; font-size: 1.35rem; font-weight: 800; line-height: 1.15; }
.sync-num span { font-size: .8rem; color: #6b7570; }
.sync-num small { display: block; font-size: .7rem; color: #87928b; }
.sync-num.aviso { border-color: #fbbf24; } .sync-num.erro { border-color: #f87171; } .sync-num.erro b { color: #dc2626; }

/* ============================================================
   Telas de entrada (login) — igual ao Consumer
   ============================================================ */
.au-body { background: #eef1ee; margin: 0; font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
.au { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; gap: 14px; padding: 14px; }
.au-lado { position: relative; overflow: hidden; border-radius: 32px; padding: 48px; color: #fff; display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
    background: radial-gradient(120% 90% at 100% 100%, color-mix(in srgb, var(--mc-primary) 60%, transparent), transparent 55%), var(--mc-rail); }
.au-lado::before { content: ''; position: absolute; left: -90px; top: -90px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255, 255, 255, .04); }
.au-lado::after { content: ''; position: absolute; right: -140px; bottom: -140px; width: 460px; height: 460px; border-radius: 50%; border: 64px solid rgba(255, 255, 255, .05); }
.au-lado > * { position: relative; z-index: 1; }
.au-lado__logo { height: auto; width: auto; max-height: 64px; max-width: 240px; align-self: flex-start; object-fit: contain; }
.au-lado__texto h2 { font-size: 2.4rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.08; max-width: 480px; margin: 0; }
.au-lado__texto h2 em { font-style: normal; color: var(--mc-accent); }
.au-lado__texto p { opacity: .8; max-width: 430px; margin: 16px 0 0; font-size: 1.02rem; }
.au-selo { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.1); border-radius: 999px; padding: 5px 12px; font-size: .8rem; font-weight: 700; margin-bottom: 16px; }
.au-lado__rodape { opacity: .6; }
.au-fila { display: flex; flex-direction: column; gap: 10px; max-width: 380px; }
.au-ped { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; padding: 12px 14px; border-radius: 16px;
    background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); backdrop-filter: blur(8px); animation: au-entra .6s both; }
.au-ped:nth-child(2) { margin-left: 28px; animation-delay: .15s; }
.au-ped:nth-child(3) { margin-left: 56px; animation-delay: .3s; }
.au-ped b { font-size: .9rem; }
.au-ped small { grid-column: 2; opacity: .7; font-size: .78rem; }
.au-canal { grid-row: span 2; font-size: .68rem; font-weight: 800; border-radius: 8px; padding: 4px 8px; }
.au-canal.ok { background: #22c55e; color: #052e16; }
.au-canal.conv { background: var(--mc-accent); color: #1c2a0a; }
.au-canal.nao { background: #ef4444; }
@keyframes au-entra { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.au-form { display: grid; place-items: center; background: #fff; border-radius: 32px; padding: 40px 24px; box-shadow: 0 1px 2px rgba(17, 24, 19, .04); }
.au-form__caixa { width: 100%; max-width: 390px; }
.au-marca { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.au-marca__logo { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; flex: none;
    background: var(--mc-primary); color: #fff; font-size: 1.4rem; font-weight: 800; box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--mc-borda); }
.au-marca__logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.au-marca b { display: block; font-size: 1.02rem; }
.au-marca small { color: #7b8580; }
.au-titulo { font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.au-sub { color: #7b8580; margin: 4px 0 24px; }
.au-label { display: block; font-size: .82rem; font-weight: 700; color: #4b554f; margin-bottom: 6px; }
.au-campo { position: relative; margin-bottom: 16px; }
.au-campo > i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: #909a94; pointer-events: none; }
.au-campo input { width: 100%; height: 52px; border: 1px solid #dfe4e0; border-radius: 14px; padding: 0 48px 0 44px; font-size: 1rem; background: #fafbfa;
    transition: border-color .15s, box-shadow .15s, background .15s; }
.au-campo input:focus { outline: none; border-color: var(--mc-primary); background: #fff; box-shadow: 0 0 0 4px var(--mc-primary-fraco); }
.au-olho { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: none; background: none; border-radius: 10px; color: #7b8580; }
.au-olho:hover { background: #f0f3f1; }
.au-btn { width: 100%; height: 52px; border-radius: 14px; font-weight: 700; font-size: 1rem; margin-top: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.au-ajuda { font-size: .85rem; color: #7b8580; margin: 18px 0 0; text-align: center; }
.au-links { border-top: 1px solid #eef1ef; margin-top: 22px; padding-top: 16px; text-align: center; }
.au-links a { font-size: .88rem; font-weight: 600; color: var(--mc-primary); text-decoration: none; }
.au-form .alert { border-radius: 12px; font-size: .9rem; }
.au-poweredby { display: block; text-align: center; margin-top: 26px; opacity: .65; }
.au-poweredby img { max-height: 34px; max-width: 150px; height: auto; width: auto; object-fit: contain; }
@media (max-width: 900px) {
    .au { grid-template-columns: 1fr; padding: 0; gap: 0; }
    .au-lado { display: none; }
    .au-form { border-radius: 0; min-height: 100vh; }
}
.au-logo-flagy { height: 40px; width: auto; margin-bottom: 28px; }

/* Prévia da identidade visual (Configurações → Geral) */
.fc-marca-prev { width: 96px; background: var(--mc-rail); border-radius: 16px; padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.fc-marca-prev__logo { width: 50px; height: 50px; border-radius: 50%; padding: 3px; background: linear-gradient(135deg, var(--prev), var(--mc-accent)); display: grid; place-items: center; }
.fc-marca-prev__logo img, .fc-marca-prev__logo b { width: 100%; height: 100%; border-radius: 50%; background: #fff; object-fit: contain; display: grid; place-items: center; color: var(--prev); font-weight: 800; }
.fc-marca-prev__logo img[hidden], .fc-marca-prev__logo b[hidden] { display: none; }
.fc-marca-prev__btn { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px; border-radius: 12px; background: var(--prev); color: #fff; font-size: .66rem; font-weight: 600; }
.fc-marca-prev__btn i { font-size: 1.2rem; }
.au-lado__nome { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }

/* Logotipo do cliente em listas (painel do parceiro / SaaS) */
.fc-cli-logo { width: 36px; height: 36px; flex: none; border-radius: 50%; border: 1px solid var(--mc-borda); background: #fff; display: grid; place-items: center; overflow: hidden; font-size: .8rem; font-weight: 800; color: var(--mc-primary); }
.fc-cli-logo img { width: 100%; height: 100%; object-fit: contain; }
.fc-cli-logo--lg { width: 48px; height: 48px; font-size: 1rem; }

/* Prévia white-label (identidade do parceiro) */
.fc-wl-prev { display: flex; gap: 10px; background: #eef1ee; border-radius: 18px; padding: 12px; }
.fc-wl-prev__login { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; min-height: 210px; }
.fc-wl-prev__escuro { border-radius: 12px; padding: 12px; color: #fff; display: flex; flex-direction: column; gap: 10px;
    background: radial-gradient(120% 90% at 100% 100%, color-mix(in srgb, var(--wl-cor) 60%, transparent), transparent 55%), #151b18; }
.fc-wl-prev__escuro img { max-height: 22px; max-width: 100%; object-fit: contain; align-self: flex-start; }
.fc-wl-prev__escuro b { font-size: .85rem; }
.fc-wl-prev__frase { font-size: .78rem; font-weight: 800; line-height: 1.15; margin-top: auto; }
.fc-wl-prev__frase em { font-style: normal; color: var(--wl-acc); }
.fc-wl-prev__claro { border-radius: 12px; background: #fff; padding: 12px; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.fc-wl-prev__cli { width: 28px; height: 28px; border-radius: 50%; background: #64748b; color: #fff; font-size: .6rem; font-weight: 800; display: grid; place-items: center; align-self: flex-start; }
.fc-wl-prev__linha { width: 100%; height: 14px; border-radius: 6px; background: #f1f4f2; border: 1px solid #e3e8e4; }
.fc-wl-prev__btn { width: 100%; height: 16px; border-radius: 6px; background: var(--wl-cor); }
.fc-wl-prev__claro img { max-height: 14px; max-width: 80%; object-fit: contain; margin-top: auto; opacity: .75; }
.fc-wl-prev__claro small { margin-top: auto; font-size: .6rem; color: #7b8580; font-weight: 700; }
.fc-wl-prev__rail { width: 54px; border-radius: 12px; background: #151b18; padding: 8px 6px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.fc-wl-prev__ico { width: 36px; height: 36px; border-radius: 50%; padding: 2px; background: linear-gradient(135deg, var(--wl-cor), var(--wl-acc)); display: grid; place-items: center; }
.fc-wl-prev__ico img, .fc-wl-prev__ico b { width: 100%; height: 100%; border-radius: 50%; background: #fff; object-fit: contain; display: grid; place-items: center; font-size: .6rem; color: var(--wl-cor); }
.fc-wl-prev__ico img[hidden], .fc-wl-prev__ico b[hidden], .fc-wl-prev img[hidden], .fc-wl-prev [hidden] { display: none !important; }
.fc-wl-prev__area { width: 38px; height: 34px; border-radius: 9px; background: var(--wl-cor); color: #fff; display: grid; place-items: center; font-size: .9rem; }
.fc-wl-prev__area.off { background: transparent; color: #aab5ae; }

/* Marca no canto superior esquerdo: bloco escuro com aba que sobressai da topbar,
   cabe logotipo horizontal (cliente → parceiro → Flagy, sempre a versão para fundo escuro). */
.fx { --marca-w: 236px; }
/* Bloco da altura da barra; a largura acompanha o logotipo (o JS do shell mede e ajusta --marca-w). */
.fx-marca { position: fixed; top: 0; left: 0; z-index: 1045; height: var(--top-h);
    width: max-content; min-width: var(--rail-w); max-width: 340px;
    display: flex; align-items: center; justify-content: center; padding: 0 24px 0 18px;
    background: var(--mc-rail); border-bottom-right-radius: 26px; text-decoration: none;
    box-shadow: 6px 8px 18px -10px rgba(17, 24, 19, .45); }
.fx-marca img { height: 40px; width: auto; max-width: 296px; object-fit: contain; }
.fx-marca__txt { color: #fff; font-weight: 800; font-size: 1.05rem; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-marca::after { content: ''; position: absolute; left: 100%; top: 0; width: 22px; height: 22px;
    background: radial-gradient(circle at 100% 100%, transparent 21px, var(--mc-rail) 22px); }
.fx-rail { padding-top: calc(var(--top-h) + 14px); }
.fx-rail__loja { display: none; }
.fx-top { padding-left: max(20px, calc(var(--marca-w) - var(--rail-w) + 34px)); }
.fc-logo-esc-prev { background: var(--mc-rail); border-radius: 10px; padding: 6px 12px; display: inline-flex; }
.fc-logo-esc-prev img { max-height: 28px; max-width: 160px; }
@media (max-width: 860px) {
    .fx-marca { display: none; }
    .fx-top { padding-left: 12px; }
    .fx-rail { padding-top: 12px; }
    .fx-sub { padding-top: 8px; }
}

/* Feed da portaria: snapshot da leitura × foto cadastrada */
.fc-feed__foto { width: 44px; height: 58px; flex: none; border-radius: 9px; object-fit: cover; background: #eef1ef; display: grid; place-items: center; color: #9aa6a0; border: 1px solid var(--mc-borda); }
.fc-feed__foto + .fc-feed__foto { margin-left: -6px; }

/* Página de download do agente */
.fc-dl-ic { width: 56px; height: 56px; flex: none; border-radius: 16px; display: grid; place-items: center; font-size: 1.7rem; background: var(--mc-primary-fraco); color: var(--mc-primary); }
.fc-dl-ic--sm { width: 40px; height: 40px; border-radius: 12px; font-size: 1.2rem; }
.fc-cmd { display: flex; align-items: center; gap: 10px; background: #111814; color: #d6f5df; border-radius: 12px; padding: 10px 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; }
.fc-cmd code { color: inherit; background: none; flex: 1; word-break: break-all; }
.fc-cmd .btn { flex: none; }
.fc-cmd--sm { display: inline-flex; padding: 6px 10px; font-size: .78rem; }
.fc-cmd--sm .btn { padding: 0 6px; }

/* Início (dashboard) */
.db-hero { padding: 22px 24px; background: linear-gradient(120deg, #fff 55%, var(--mc-primary-fraco)); }
.db-hero__topo { display: flex; align-items: center; gap: 18px; }
.db-hero__logo { width: 84px; height: 84px; flex: none; border-radius: 20px; background: #fff; border: 1px solid var(--mc-borda); box-shadow: 0 6px 18px rgba(17,24,19,.06);
    display: grid; place-items: center; overflow: hidden; font-size: 1.6rem; font-weight: 800; color: var(--mc-primary); }
.db-hero__logo img { width: 86%; height: 86%; object-fit: contain; }
.db-hero__org { font-size: .78rem; font-weight: 700; letter-spacing: .08em; color: #6b7570; }
.db-hero__ola { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; margin: 2px 0 4px; }
.db-hero__data { color: #6b7570; font-size: .9rem; }
.db-atalhos { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.db-atalho { display: inline-flex; align-items: center; gap: 10px; padding: 7px 16px 7px 7px; border-radius: 999px; background: #fff; border: 1px solid var(--mc-borda);
    color: var(--mc-texto); font-weight: 600; font-size: .9rem; text-decoration: none; box-shadow: 0 1px 2px rgba(17,24,19,.04); transition: border-color .12s, transform .12s; }
.db-atalho:hover { border-color: var(--mc-primary); color: var(--mc-primary); transform: translateY(-1px); }
.db-atalho span { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--mc-primary-fraco); color: var(--mc-primary); }
.db-tit { display: flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #4b554f; margin-bottom: 12px; }
.db-tit > i { color: var(--mc-primary); }
.db-atual { font-size: .78rem; font-weight: 500; letter-spacing: 0; text-transform: none; color: #87928b; }
.db-grande { display: flex; align-items: center; gap: 16px; background: var(--mc-bg); border-radius: 14px; padding: 14px 16px; }
.db-grande__ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--mc-primary-fraco); color: var(--mc-primary); font-size: 1.3rem; flex: none; }
.db-grande__ic--acc { background: color-mix(in srgb, var(--mc-accent) 22%, #fff); color: color-mix(in srgb, var(--mc-accent) 60%, #000); }
.db-num { font-size: 2.3rem; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.db-num-sub { font-size: 1.05rem; color: #4b554f; }
.db-mini { display: flex; align-items: center; gap: 10px; border: 1px solid var(--mc-borda); border-radius: 12px; padding: 10px 12px; height: 100%; }
.db-mini > span { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--mc-bg); color: #6b7570; flex: none; }
.db-mini b { display: block; font-size: 1.35rem; line-height: 1.1; }
.db-mini small { color: #6b7570; font-size: .76rem; }
.db-mini--ok > span { background: #dcfce7; color: #15803d; } .db-mini--aviso > span { background: #fef3c7; color: #b45309; } .db-mini--nao > span { background: #fee2e2; color: #b91c1c; }
.db-graf { display: flex; align-items: flex-end; gap: 3px; height: 96px; }
.db-graf__col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.db-graf__e { background: var(--mc-primary); border-radius: 3px 3px 0 0; min-height: 0; }
.db-graf__s { background: #f59e0b; border-radius: 3px 3px 0 0; opacity: .85; }
.db-graf__col:not(:has(div[style*="height:0"])) .db-graf__s + .db-graf__e { border-radius: 0; }
.db-leg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; }
.db-leg--e { background: var(--mc-primary); } .db-leg--s { background: #f59e0b; }
.db-lista > div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--mc-borda); font-size: .9rem; }
.db-lista > div:last-child { border-bottom: 0; }
.db-receita { margin-top: 10px; border-radius: 12px; padding: 10px 14px; background: var(--mc-primary-fraco); display: grid; grid-template-columns: 1fr auto; align-items: center; }
.db-receita span { font-size: .82rem; color: #4b554f; } .db-receita b { font-size: 1.25rem; color: var(--mc-primary); grid-row: span 2; } .db-receita small { color: #6b7570; font-size: .75rem; }
.db-area { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--mc-borda); border-radius: 16px; padding: 14px; height: 100%; }
.db-area__ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--mc-primary-fraco); color: var(--mc-primary); flex: none; }
.db-area__nome { font-weight: 700; } .db-area small { color: #6b7570; font-size: .76rem; }
.db-area__num { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.db-alerta { background: #fffbeb; border-color: #fde68a; color: #92400e; }
@media (max-width: 700px) { .db-hero__logo { width: 60px; height: 60px; } .db-hero__ola { font-size: 1.3rem; } .db-num { font-size: 1.8rem; } }
.au-codigo { letter-spacing: .5em; font-size: 1.4rem !important; font-weight: 700; text-align: center; padding-left: 44px !important; }

/* Áreas do convite (preço por área) */
.cv-areas { display: flex; flex-direction: column; gap: 8px; }
.cv-area { display: flex; align-items: center; gap: 12px; border: 1px solid var(--mc-borda); border-radius: 14px; padding: 10px 12px; cursor: pointer; background: #fff; transition: border-color .12s, background .12s; margin: 0; }
.cv-area input { width: 18px; height: 18px; accent-color: var(--mc-primary); flex: none; }
.cv-area.is-on { border-color: var(--mc-primary); background: var(--mc-primary-fraco); }
.cv-area__ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--mc-bg); color: var(--mc-primary); flex: none; }
.cv-area__txt { flex: 1; min-width: 0; line-height: 1.2; } .cv-area__txt small { display: block; color: #6b7570; font-size: .76rem; }
.cv-area__preco { text-align: right; font-weight: 700; white-space: nowrap; } .cv-area__preco small { display: block; font-weight: 500; color: #6b7570; font-size: .72rem; }

/* Grupo familiar (cadastro da pessoa) */
.gf-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.gf-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--mc-borda); border-radius: 14px; background: #fff; color: var(--mc-texto); text-decoration: none; transition: border-color .12s; }
.gf-card:hover { border-color: var(--mc-primary); }
.gf-card__foto { width: 44px; height: 54px; border-radius: 10px; background: var(--mc-bg); display: grid; place-items: center; overflow: hidden; color: #9aa6a0; flex: none; }
.gf-card__foto img { width: 100%; height: 100%; object-fit: cover; }
.gf-card__txt { flex: 1; min-width: 0; line-height: 1.25; } .gf-card__txt small { display: block; color: #6b7570; font-size: .78rem; }
.gf-novo { border: 1px dashed var(--mc-borda); border-radius: 14px; padding: 14px; background: var(--mc-bg); }

/* Tipo de organização (configurações) */
.seg-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.seg-op { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--mc-borda); border-radius: 14px; padding: 12px; cursor: pointer; background: #fff; transition: border-color .12s, background .12s; margin: 0; }
.seg-op input { display: none; }
.seg-op i { font-size: 1.3rem; color: var(--mc-primary); }
.seg-op small { color: #6b7570; font-size: .74rem; }
.seg-op.is-on { border-color: var(--mc-primary); background: var(--mc-primary-fraco); box-shadow: 0 0 0 1px var(--mc-primary) inset; }

/* Unidades em cartões */
.un-grupo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: #4b554f; margin: 4px 0 10px; }
.un-grupo i { color: var(--mc-primary); } .un-grupo span { background: var(--mc-primary-fraco); color: var(--mc-primary); border-radius: 999px; padding: 0 8px; font-size: .72rem; }
.un-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.un-card { background: #fff; border: 1px solid var(--mc-borda); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; transition: border-color .12s, box-shadow .12s, transform .12s; }
.un-card:hover { border-color: var(--mc-primary); box-shadow: 0 8px 22px rgba(17,24,19,.07); transform: translateY(-1px); }
.un-card.is-vazia { background: repeating-linear-gradient(135deg, #fff, #fff 10px, #fafbfa 10px, #fafbfa 20px); }
.un-card__topo { display: flex; align-items: baseline; gap: 8px; }
.un-card__id { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.un-card__tipo { font-size: .76rem; color: #6b7570; }
.un-card__vaga { margin-left: auto; font-size: .78rem; color: #6b7570; }
.un-card__ava { display: flex; }
.un-ava { width: 36px; height: 36px; border-radius: 50%; border: 2px solid #fff; margin-left: -8px; background: var(--mc-primary-fraco); color: var(--mc-primary); display: grid; place-items: center; font-size: .7rem; font-weight: 800; overflow: hidden; text-decoration: none; box-shadow: 0 0 0 1px var(--mc-borda); }
.un-ava:first-child { margin-left: 0; } .un-ava img { width: 100%; height: 100%; object-fit: cover; }
.un-ava--mais { background: var(--mc-bg); color: #6b7570; }
.un-card__tit { font-size: .88rem; font-weight: 600; }
.un-card__vazia { color: #9aa6a0; font-size: .86rem; padding: 8px 0; }
.un-card__pe { display: flex; align-items: center; border-top: 1px solid var(--mc-borda); padding-top: 10px; margin-top: auto; }

/* Pessoas da unidade: titular com grupo expansível */
.up-lista { display: flex; flex-direction: column; gap: 8px; }
.up-item { border: 1px solid var(--mc-borda); border-radius: 14px; background: #fff; }
.up-tit, .up-dep { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.up-ava { width: 40px; height: 40px; border-radius: 50%; flex: none; overflow: hidden; display: grid; place-items: center; background: var(--mc-primary-fraco); color: var(--mc-primary); font-weight: 800; font-size: .78rem; }
.up-ava img { width: 100%; height: 100%; object-fit: cover; }
.up-tit__nome { flex: 1; min-width: 0; line-height: 1.2; } .up-tit__nome b { display: block; } .up-tit__nome small { color: #6b7570; font-size: .78rem; }
.up-tit__nome:hover b { color: var(--mc-primary); }
.up-selos { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.up-selo { font-size: .7rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--mc-bg); color: #4b554f; white-space: nowrap; }
.up-selo--aviso { background: #fef3c7; color: #92400e; } .up-selo--off { background: #fee2e2; color: #991b1b; }
.up-tog .up-seta { transition: transform .15s; font-size: .7rem; } .up-tog.is-open .up-seta { transform: rotate(180deg); }
.up-tog[data-vazio] { opacity: .7; }
.up-deps { border-top: 1px dashed var(--mc-borda); padding: 6px 12px 12px 30px; background: var(--mc-bg); border-radius: 0 0 14px 14px; }
.up-dep { border-radius: 12px; padding: 8px 10px; position: relative; }
.up-dep::before { content: ''; position: absolute; left: -16px; top: 0; bottom: 50%; width: 12px; border-left: 2px solid var(--mc-borda); border-bottom: 2px solid var(--mc-borda); border-radius: 0 0 0 8px; }
.up-dep:hover { background: #fff; }

/* Log Auditoria */
.au-dia td { background: var(--mc-bg) !important; font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #6b7570; padding: 6px 12px !important; cursor: default; }
.au-ic { width: 30px; height: 30px; border-radius: 9px; display: inline-grid; place-items: center; flex: none; background: var(--mc-bg); color: #4b554f; }
.au-ic--lg { width: 44px; height: 44px; border-radius: 12px; font-size: 1.2rem; }
.au-ic--acesso { background: #e0f2fe; color: #0369a1; } .au-ic--pessoas { background: var(--mc-primary-fraco); color: var(--mc-primary); }
.au-ic--convites { background: #fef3c7; color: #b45309; } .au-ic--portaria { background: #dcfce7; color: #15803d; }
.au-ic--config { background: #ede9fe; color: #6d28d9; } .au-ic--equipe { background: #fce7f3; color: #be185d; } .au-ic--suporte { background: #fee2e2; color: #b91c1c; }
.au-campo-l { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #87928b; margin-bottom: 2px; }
