/* ==========================================================================
   Camada "profissional": lista de clientes, ficha do cliente e animações de carregamento.
   Carrega depois de style.css e usa os mesmos tokens (claro/escuro/automático).
   ========================================================================== */

/* ---------- carregamento: barra no topo, botão com spinner e tela de espera ---------- */
#ui-bar { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 3000; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, var(--d-down), var(--brand), var(--d-up)); box-shadow: 0 0 12px var(--brand-glow);
  transition: width .25s ease-out, opacity .3s; border-radius: 0 3px 3px 0; overflow: hidden; }
#ui-bar.on { opacity: 1; }
#ui-bar::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.65), transparent 80%);
  transform: translateX(-100%); animation: ui-shimmer 1.1s ease-in-out infinite; }
@keyframes ui-shimmer { to { transform: translateX(100%); } }

.btn { --spin: var(--brand-ink); } .btn.secondary { --spin: var(--brand); } .btn.danger { --spin: #fff; }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after { content: ""; position: absolute; left: 50%; top: 50%; width: 1.05em; height: 1.05em; margin: -.525em 0 0 -.525em; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--spin) 28%, transparent); border-top-color: var(--spin); animation: ui-spin .7s linear infinite; }
@keyframes ui-spin { to { transform: rotate(360deg); } }

#ui-loader { position: fixed; inset: 0; z-index: 2900; display: grid; place-items: center; padding: 20px;
  background: color-mix(in srgb, var(--bg) 62%, transparent); -webkit-backdrop-filter: blur(6px) saturate(1.1); backdrop-filter: blur(6px) saturate(1.1);
  opacity: 0; transition: opacity .25s; }
#ui-loader[hidden] { display: none; }
#ui-loader.on { opacity: 1; }
.ul-card { width: min(360px, 100%); text-align: center; padding: 28px 26px 22px; border-radius: 18px; background: var(--card); border: 1px solid var(--line-hi);
  box-shadow: 0 24px 70px -26px var(--brand-glow), var(--shadow); transform: translateY(8px) scale(.98); transition: transform .3s cubic-bezier(.2,.8,.2,1); }
#ui-loader.on .ul-card { transform: none; }
.ul-orb { position: relative; width: 84px; height: 84px; margin: 0 auto 14px; display: grid; place-items: center; }
.ul-orb i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--brand); opacity: 0; animation: ul-wave 2.1s cubic-bezier(.2,.6,.3,1) infinite; }
.ul-orb i:nth-child(2) { animation-delay: .7s; } .ul-orb i:nth-child(3) { animation-delay: 1.4s; }
.ul-orb b { position: relative; width: 44px; height: 44px; border-radius: 50%; border: 3px solid color-mix(in srgb, var(--brand) 22%, transparent);
  border-top-color: var(--brand); border-right-color: var(--d-up); animation: ui-spin 1s linear infinite; }
.ul-orb::after { content: ""; position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 14px var(--brand-glow); animation: ul-beat 1.2s ease-in-out infinite; }
@keyframes ul-wave { 0% { transform: scale(.45); opacity: .7; } 100% { transform: scale(1.1); opacity: 0; } }
@keyframes ul-beat { 50% { transform: scale(1.5); opacity: .7; } }
.ul-msg { font: 600 1.05rem var(--f-head); }
.ul-sub { color: var(--muted); font-size: .86rem; margin-top: 4px; min-height: 1.3em; transition: opacity .2s; }
.ul-track { height: 4px; border-radius: 4px; background: var(--line); margin-top: 18px; overflow: hidden; }
.ul-track i { display: block; height: 100%; width: 40%; border-radius: 4px; background: linear-gradient(90deg, var(--d-down), var(--brand), var(--d-up)); animation: ul-slide 1.3s ease-in-out infinite; }
@keyframes ul-slide { 0% { transform: translateX(-110%); } 100% { transform: translateX(260%); } }

/* esqueleto (conteúdo que carrega por JS) */
.skel { display: block; height: 14px; border-radius: 6px; margin: 10px 0; background: linear-gradient(100deg, var(--card-2) 30%, var(--line) 50%, var(--card-2) 70%) 0 0 / 220% 100%; animation: ui-skel 1.3s ease-in-out infinite; }
.skel.w60 { width: 60%; } .skel.w80 { width: 80%; } .skel.w40 { width: 40%; }
@keyframes ui-skel { to { background-position: -120% 0; } }

@media (prefers-reduced-motion: reduce) {
  #ui-bar::after, .ul-orb i, .ul-track i, .skel { animation: none !important; }
  .ul-orb b, .btn.is-loading::after { animation-duration: 2.4s !important; }
  .ul-track i { width: 100%; opacity: .5; }
}

/* ---------- base "limpa" para as telas de cliente ---------- */
.clist .card, .cust .card, .sysp .card { border-radius: 14px; box-shadow: 0 1px 2px rgba(10, 16, 36, .05), 0 10px 28px -20px rgba(10, 16, 36, .35); }
.clist .card::before, .cust .card::before, .sysp .card::before { display: none; }
.cust .card h2, .clist .card h2 { font-size: 1.02rem; }
.cust .card > h2:first-child { padding-bottom: 10px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }

/* ---------- lista de clientes ---------- */
.pg-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.pg-head h1 { margin: 0; }
.pg-head .sub { color: var(--muted); font-size: .92rem; margin-top: 2px; }

.seg { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.seg a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px; text-decoration: none; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); font-size: .9rem; font-weight: 500; transition: border-color .15s, background .15s, transform .1s; }
.seg a:hover { border-color: var(--brand); transform: translateY(-1px); }
.seg a b { font: 600 .82rem var(--f-mono); padding: 1px 8px; border-radius: 999px; background: var(--card-2); color: var(--muted); }
.seg a.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: 600; }
.seg a.on b { background: var(--brand); color: var(--brand-ink); }

.filterpill { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 5px 6px 5px 12px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: .86rem; font-weight: 600; }
.filterpill a { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); text-decoration: none; font-size: .8rem; line-height: 1; }

.clist .tablewrap { padding: 0; overflow: hidden; }
.clist .scroll { overflow-x: auto; }
table.cl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .92rem; }
table.cl thead th { position: sticky; top: 0; z-index: 2; text-align: left; padding: 12px 14px; background: var(--card-2); color: var(--muted); font: 600 .72rem var(--f-body);
  letter-spacing: .07em; text-transform: uppercase; border-bottom: 1px solid var(--line-hi); white-space: nowrap; }
table.cl td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.cl tbody tr { transition: background .12s; }
table.cl tbody tr[data-href] { cursor: pointer; }
table.cl tbody tr:hover td { background: var(--brand-soft); }
table.cl tbody tr:last-child td { border-bottom: 0; }
table.cl td.num, table.cl th.num { text-align: right; }

.who2 { display: flex; align-items: center; gap: 12px; min-width: 0; }
.av2 { position: relative; flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font: 700 .86rem var(--f-head);
  color: var(--brand); background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 28%, transparent); }
.av2 i { position: absolute; right: -4px; bottom: -4px; width: 13px; height: 13px; border-radius: 50%; border: 2.5px solid var(--card); background: var(--s-gray-dot); }
.av2 i.s-on { background: var(--s-on-dot); } .av2 i.s-off { background: var(--s-off-dot); } .av2 i.s-blk { background: var(--s-blk-dot); } .av2 i.s-aw { background: var(--s-aw-dot); }
.who2 .nm { font-weight: 600; color: var(--ink); text-decoration: none; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 28ch; }
.who2 a.nm:hover { color: var(--brand); }
.who2 .doc { color: var(--muted); font: 400 .8rem var(--f-mono); }
.pill { display: inline-block; max-width: 34ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; padding: 3px 10px; border-radius: 8px; background: var(--card-2); border: 1px solid var(--line); font-size: .82rem; font-weight: 500; }
.cell2 .a { font: 500 .86rem var(--f-mono); } .cell2 .b { color: var(--muted); font: 400 .76rem var(--f-mono); margin-top: 1px; }
.iconbtn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--card); color: var(--muted); text-decoration: none;
  transition: border-color .15s, color .15s, background .15s; }
.iconbtn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.iconbtn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.rowact { display: flex; gap: 6px; justify-content: flex-end; }
.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty b { display: block; color: var(--ink); font: 600 1.05rem var(--f-head); margin-bottom: 4px; }
.cl-foot { color: var(--muted); font-size: .86rem; margin-top: 12px; }

@media (max-width: 860px) {
  table.cl thead { display: none; }
  table.cl, table.cl tbody { display: block; }
  table.cl tr { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 14px; border-bottom: 1px solid var(--line); }
  table.cl tr:last-child { border-bottom: 0; }
  table.cl td { display: block; padding: 0; border: 0; }
  table.cl td.c-who { grid-column: 1; } table.cl td.c-st { grid-column: 2; grid-row: 1; text-align: right; }
  table.cl td.c-plan, table.cl td.c-ip, table.cl td.c-mac { grid-column: 1 / -1; }
  table.cl td[data-l] { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
  table.cl td[data-l]::before { content: attr(data-l); min-width: 3.2rem; color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; }
  table.cl td.cell2 .b { margin: 0; }
  table.cl td.c-act { grid-column: 1 / -1; }
  .rowact { justify-content: flex-start; }
  table.cl tbody tr:hover td { background: transparent; }
}

/* ---------- ficha do cliente ---------- */
.ch { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; padding: 20px 22px; border-radius: 16px; border: 1px solid var(--line);
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 9%, var(--card)), var(--card) 62%); box-shadow: 0 1px 2px rgba(10,16,36,.05), 0 14px 34px -24px rgba(10,16,36,.4); }
.ch-id { display: flex; gap: 16px; align-items: center; min-width: 0; flex: 1 1 430px; }
.ch-av { position: relative; flex: none; width: 66px; height: 66px; border-radius: 18px; display: grid; place-items: center; font: 700 1.4rem var(--f-head); color: var(--brand-ink);
  background: linear-gradient(135deg, var(--brand), var(--d-up)); box-shadow: 0 10px 24px -12px var(--brand-glow); }
.ch-av i { position: absolute; right: -4px; bottom: -4px; width: 18px; height: 18px; border-radius: 50%; border: 3.5px solid var(--card); background: var(--s-gray-dot); }
.ch-av i.s-on { background: var(--s-on-dot); box-shadow: 0 0 0 0 var(--s-on-dot); animation: pulse 2.2s ease-out infinite; }
.ch-av i.s-off { background: var(--s-off-dot); } .ch-av i.s-blk { background: var(--s-blk-dot); } .ch-av i.s-aw { background: var(--s-aw-dot); }
.ch h1 { margin: 0 0 6px; font-size: 1.55rem; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ch-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: .88rem; align-items: center; }
.ch-meta .m { display: inline-flex; align-items: center; gap: 6px; }
.ch-meta .m b { color: var(--ink); font-weight: 500; }
.ch-meta button.cp { border: 0; background: transparent; color: var(--brand); font: 600 .76rem var(--f-body); cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.ch-meta button.cp:hover { background: var(--brand-soft); }
.ch-act { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ch-act form { display: inline; }
.dd.more > summary { list-style: none; cursor: pointer; }
.dd.more .dd-pop { width: 270px; padding: 6px; }
.dd.more .dd-pop form { margin: 0; border: 0; padding: 0; display: block; }
.dd.more .dd-pop button { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 8px; border: 0; background: transparent; color: var(--ink); font: 500 .9rem var(--f-body); cursor: pointer; }
.dd.more .dd-pop button:hover { background: var(--brand-soft); }
.dd.more .dd-pop button.dng { color: var(--bad); } .dd.more .dd-pop button.dng:hover { background: var(--bad-bg); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin: 14px 0 6px; }
.kpi { position: relative; padding: 14px 16px 14px 20px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); overflow: hidden; box-shadow: 0 1px 2px rgba(10,16,36,.04); }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--line-hi); }
.kpi.t-on::before { background: var(--s-on-dot); } .kpi.t-off::before { background: var(--s-off-dot); } .kpi.t-blk::before { background: var(--s-blk-dot); }
.kpi.t-aw::before { background: var(--s-aw-dot); } .kpi.t-brand::before { background: var(--brand); }
.kpi .k { color: var(--muted); font-size: .72rem; letter-spacing: .07em; text-transform: uppercase; font-weight: 600; }
.kpi .v { font: 700 1.3rem/1.2 var(--f-head); margin-top: 5px; }
.kpi .s { color: var(--muted); font-size: .84rem; margin-top: 2px; }
.kpi.t-on .v { color: var(--s-on); } .kpi.t-off .v { color: var(--s-off); } .kpi.t-blk .v { color: var(--s-blk); }

.tabs { display: flex; gap: 2px; overflow-x: auto; margin: 20px 0 18px; border-bottom: 1px solid var(--line-hi); scrollbar-width: thin; }
.tabs[hidden] { display: none; }
.tab { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 12px 16px; white-space: nowrap;
  color: var(--muted); font: 600 .92rem var(--f-body); cursor: pointer; transition: color .15s, border-color .15s, background .15s; border-radius: 8px 8px 0 0; }
.tab:hover { color: var(--ink); background: var(--brand-soft); }
.tab[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.tab .cnt { font: 600 .72rem var(--f-mono); padding: 1px 7px; border-radius: 999px; background: var(--card-2); color: var(--muted); }
.tab .cnt.bad { background: var(--bad-bg); color: var(--bad); }
.js-tabs .tabpane { display: none; }
.js-tabs .tabpane.on { display: block; animation: pane .28s cubic-bezier(.2,.8,.2,1); }
@keyframes pane { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.tabpane > h2.sec { margin: 4px 0 10px; font-size: 1.05rem; }
.cust .toolbar h2 { margin: 0; }
.cust .grid2 { margin-bottom: 0; }
.cust .grid2 > .card { margin-bottom: 16px; }

@media (max-width: 640px) {
  .ch { padding: 16px; } .ch-av { width: 54px; height: 54px; border-radius: 15px; font-size: 1.15rem; }
  .ch h1 { font-size: 1.25rem; } .ch-act { width: 100%; }
}
@media print { #ui-bar, #ui-loader { display: none !important; } }

/* ---------- Limpar MAC (busca no estilo de resultado do IXC) ---------- */
.lm-search { display: flex; gap: 0; align-items: stretch; margin-bottom: 18px; border: 1px solid var(--line-hi); border-radius: 999px; background: var(--card); overflow: hidden; position: relative; }
.lm-search select { flex: none; width: auto; max-width: 160px; border: 0; border-right: 1px solid var(--line-hi); border-radius: 0; box-shadow: none; background-color: transparent; color: var(--ink); padding: 0 34px 0 18px; font: 500 .95rem var(--f-body); }
.lm-search input { flex: 1; width: auto; min-width: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; color: var(--ink); padding: 12px 14px; font-size: 1rem; outline: none; }
.lm-search .lm-x { display: grid; place-items: center; padding: 0 12px; color: var(--muted); text-decoration: none; font-size: 1.4rem; }
.lm-search .btn { border-radius: 0; }
.lm-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.lm-list { display: flex; flex-direction: column; gap: 10px; }
.lm-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.lm-head { display: grid; grid-template-columns: 44px minmax(0, 1.2fr) minmax(0, 1.4fr) minmax(0, .8fr); gap: 4px 18px; align-items: start; }
.lm-head > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: .93rem; }
.lm-head > div > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lm-name { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 1rem; }
.lm-name:hover { color: var(--brand); }
.lm-head b, .lm-login b { color: var(--ink); font-weight: 800; }
.lm-person { width: 38px; height: 48px; display: grid; place-items: center; }
.lm-person svg { width: 38px; height: 46px; fill: currentColor; }
.lm-person.s-on { color: var(--s-on-dot); } .lm-person.s-off { color: var(--s-off-dot); } .lm-person.s-blk { color: var(--s-blk-dot); }
.lm-person.s-aw { color: var(--s-aw-dot); } .lm-person.s-gray { color: var(--s-gray-dot); }
.lm-login { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; margin: 10px 0 0 30px; padding: 9px 14px; border-radius: 9px;
  background: color-mix(in srgb, var(--bg) 70%, var(--card)); border: 1px solid var(--line); font-size: .9rem; }
.lm-f { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.lm-f small { color: var(--muted); font-size: .8rem; }
.lm-plan { font-weight: 600; font-size: .85rem; }
.lm-on svg { width: 18px; height: 18px; fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.lm-on.yes svg { stroke: var(--s-on-dot); } .lm-on.no svg { stroke: var(--s-off-dot); }
.lm-act { margin-left: auto; } .lm-act form { margin: 0; }
@media (max-width: 760px) {
  .lm-head { grid-template-columns: 40px minmax(0, 1fr); }
  .lm-head .lm-c2, .lm-head .lm-c3 { grid-column: 2; }
  .lm-login { margin-left: 0; }
  .lm-act { margin-left: 0; width: 100%; } .lm-act .btn { width: 100%; }
}
.lm-search input::-webkit-search-cancel-button { display: none; }

/* ---------- ficha do cliente: aba Resumo ---------- */
.rs-info { display: grid; grid-template-columns: 1.15fr 1.15fr 1.1fr 1fr; gap: 14px 26px; }
.rs-info .cp { border: 0; background: transparent; color: var(--brand); font: 600 .74rem var(--f-body); cursor: pointer; padding: 1px 5px; border-radius: 6px; }
.rs-info .cp:hover { background: var(--brand-soft); }
.nowrap { white-space: nowrap; }
.rs-info .rs-col { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 10px; margin: 0; align-content: start; font-size: .92rem; }
.rs-info .rs-col + .rs-col { border-left: 1px solid var(--line); padding-left: 22px; }
.rs-info dt { font-weight: 700; color: var(--ink); white-space: nowrap; }
.rs-info dt::after { content: ":"; }
.rs-info dd { margin: 0; color: var(--ink-2, var(--ink)); overflow-wrap: anywhere; }
.rs-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 14px 0; }
.rs-tile { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 3px; min-height: 150px; }
.rs-tile .k { color: var(--muted); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; }
.rs-tile .t { font-weight: 600; font-size: .95rem; }
.rs-tile .v { font: 700 1.35rem var(--f-head); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.rs-tile .s { color: var(--muted); font-size: .8rem; margin-top: auto; }
.rs-tile.t-on .v { color: var(--s-on); } .rs-tile.t-off .v { color: var(--s-off); } .rs-tile.t-aw .v { color: var(--s-aw); } .rs-tile.t-blk .v { color: var(--s-blk); }
.rs-tile::after { content: ""; position: absolute; inset: auto -30% -60% auto; width: 70%; aspect-ratio: 1; border-radius: 50%; pointer-events: none; opacity: .14; background: radial-gradient(closest-side, var(--brand), transparent); }
.rs-tile.t-on::after { background: radial-gradient(closest-side, var(--s-on-dot), transparent); } .rs-tile.t-off::after { background: radial-gradient(closest-side, var(--s-off-dot), transparent); }
.rs-dl { display: flex; gap: 14px; flex-wrap: wrap; font-size: 1.15rem !important; }
.rs-spark { height: 46px; margin: 4px 0 2px; }
.spark { width: 100%; height: 100%; overflow: visible; }
.spark .mid { stroke: var(--line-hi); stroke-dasharray: 3 4; }
.spark .line { fill: none; stroke: var(--s-on-dot); stroke-width: 2; }
.spark .area { fill: color-mix(in srgb, var(--s-on-dot) 16%, transparent); stroke: none; }
.spark .dots circle { fill: var(--card); stroke: var(--s-on-dot); stroke-width: 1.6; }
.rs-tile.t-off .spark .line, .rs-tile.t-aw .spark .line { stroke: var(--s-aw-dot); } .rs-tile.t-off .spark .dots circle, .rs-tile.t-aw .spark .dots circle { stroke: var(--s-aw-dot); }
.rs-tile.t-off .spark .area, .rs-tile.t-aw .spark .area { fill: color-mix(in srgb, var(--s-aw-dot) 16%, transparent); }
.rs-fold { padding: 12px 16px; margin-bottom: 12px; }
.rs-fold > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; font-weight: 700; }
.rs-fold > summary::-webkit-details-marker { display: none; }
.rs-fold > summary > span::before { content: "▸"; display: inline-block; margin-right: 8px; color: var(--muted); transition: transform .15s; }
.rs-fold[open] > summary > span::before { transform: rotate(90deg); }
.rs-fold .lm-login { margin-left: 0; }
@media (max-width: 1100px) { .rs-info { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rs-info .rs-col:nth-child(3) { border-left: 0; padding-left: 0; } }
@media (max-width: 640px) { .rs-info { grid-template-columns: 1fr; } .rs-info .rs-col + .rs-col { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 12px; } }
@media (prefers-reduced-motion: reduce) { .rs-fold > summary > span::before { transition: none; } }
@media (max-width: 640px) { .rs-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .rs-tile { min-height: 0; padding: 12px; } .rs-tile .v { font-size: 1.1rem; } .rs-tile .t { font-size: .85rem; } }

/* ================= painel inicial em cartões (bento) ================= */
.bx { --bx-r: 22px; --bx-gap: 14px; }
.bx-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.bx-head { position: relative; isolation: isolate; }
.bx-head > .fx-net { position: absolute; inset: -8px 0; width: 100%; height: calc(100% + 16px); z-index: -1; opacity: .55; pointer-events: none; }
.bx-head h1 { display: inline; margin: 0 10px 0 0; font-size: 1.6rem; }
.bx-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.bx-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--bx-gap); }
.bx-card { position: relative; overflow: hidden; border-radius: var(--bx-r); padding: 18px 20px; min-width: 0; display: flex; flex-direction: column; gap: 6px;
  color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 18px 40px -24px rgba(0,0,0,.6); }
.bx-card h2, .bx-card h3 { margin: 0; font: 600 1rem var(--f-body); letter-spacing: 0; color: inherit; }
.bx-card h3 { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; opacity: .85; }
.bx-card a { color: inherit; }
.bx-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.bx-card .muted { color: inherit; opacity: .62; font-size: .82rem; }
.bx-leg { display: flex; gap: 12px; list-style: none; margin: 0; padding: 0; font-size: .78rem; opacity: .9; }
.bx-leg li { display: inline-flex; align-items: center; gap: 6px; }
.bx-leg i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.bx-sub { font-size: .84rem; opacity: .85; }
.bx-sub b { font-weight: 700; }
.bx-tag, .bx-chip { font: 600 .74rem var(--f-mono); padding: 3px 9px; border-radius: 999px; background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.18); white-space: nowrap; }
.bx-foot { margin-top: auto; font-size: .78rem; opacity: .75; }
.bx-mid { font: 600 1.7rem var(--f-body); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.bx-mid.big { font-size: 2.1rem; font-weight: 500; }
.bx-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.bx-aside { font-size: .82rem; opacity: .7; } .bx-aside b { font: 700 1.05rem var(--f-mono); opacity: 1; }

/* receita: número em matriz de pontos + rio de camadas */
.bx-rev { grid-column: span 8; min-height: 330px; background: radial-gradient(120% 90% at 0% 0%, #8f9bff 0%, transparent 55%), radial-gradient(90% 80% at 100% 100%, #2f2cd8 0%, transparent 60%), linear-gradient(160deg, #6c75f6, #1b17b8 70%, #120f8a); }
.bx-big { font: 800 clamp(2.4rem, 5vw, 3.6rem)/1 var(--f-mono); letter-spacing: .02em; margin: 6px 0 2px; font-variant-numeric: tabular-nums;
  -webkit-mask: radial-gradient(circle at center, #000 62%, transparent 66%) 0 0 / 4px 4px; mask: radial-gradient(circle at center, #000 62%, transparent 66%) 0 0 / 4px 4px; }
.bx-up { color: #f4ff6a; font-weight: 700; } .bx-up.neg { color: #ffc2c2; }
.bx-stream { position: relative; margin-top: auto; height: 170px; padding: 0 0 22px; }
.stream { width: 100%; height: 100%; display: block; }
.stream .sl0, .bx-leg .sl0 { fill: #eef0ff; background: #eef0ff; } .stream .sl1, .bx-leg .sl1 { fill: #a9b1ff; background: #a9b1ff; } .stream .sl2, .bx-leg .sl2 { fill: #f6a77c; background: #f6a77c; }
.stream .sl0 { opacity: .96; } .stream .sl1 { opacity: .85; } .stream .sl2 { opacity: .92; }
.stream .mk { stroke: rgba(10,10,40,.75); stroke-width: 1.4; }
.bx-pin, .bx-mon { position: absolute; transform: translateX(-50%); white-space: nowrap; font: 600 .7rem var(--f-mono); padding: 3px 8px; border-radius: 8px; background: #0b0b16; color: #fff; }
.bx-pin { top: -2px; } .bx-mon { bottom: -2px; }
.bx-stream > span:nth-of-type(1), .bx-stream > span:nth-of-type(2) { transform: none; } /* primeiro marcador alinhado à esquerda */
.bx-stream > span:nth-last-of-type(1), .bx-stream > span:nth-last-of-type(2) { transform: translateX(-100%); }

/* rede: arco de traços */
.bx-net { grid-column: span 4; background: radial-gradient(90% 60% at 50% 0%, rgba(255,255,255,.12), transparent 70%), linear-gradient(170deg, #3a3a46, #15151b 75%); }
.bx-gauge { position: relative; width: min(100%, 300px); margin: 6px auto 0; }
.gauge { width: 100%; display: block; }
.gauge line { stroke-width: 4.2; stroke-linecap: round; }
.gauge .off { stroke: rgba(255,255,255,.22); }
.gauge .on { stroke: url(#none); stroke: #9fa8ff; }
.gauge .on:nth-child(n+16) { stroke: #c7b8ff; } .gauge .on:nth-child(n+26) { stroke: #f6a77c; } .gauge .tip { stroke: #fff; }
.bx-gv { position: absolute; inset: auto 0 6px 0; text-align: center; }
.bx-gv b { font: 300 3rem/1 var(--f-body); letter-spacing: -.03em; } .bx-gv sup { font-size: .9rem; color: #f6a77c; margin-left: 2px; }
.bx-gv span { display: block; font-size: .78rem; opacity: .7; }
.bx-list { list-style: none; margin: auto 0 0; padding: 0; }
.bx-list li a { display: grid; grid-template-columns: 14px 1fr auto 3.6rem; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid rgba(255,255,255,.1); text-decoration: none; font-size: .88rem; }
.bx-list li span { opacity: .6; font: 500 .8rem var(--f-mono); } .bx-list li b { text-align: right; font: 700 .9rem var(--f-mono); }
.bx-list .d { width: 8px; height: 8px; border-radius: 50%; } .bx-list .d.on { background: #36e08c; } .bx-list .d.off { background: #ff6b7d; } .bx-list .d.blk { background: #ffd166; }

/* linha de 4 cartões */
.bx-lime, .bx-dark { grid-column: span 3; min-height: 168px; }
.bx-lime { background: radial-gradient(100% 80% at 0% 0%, #d9ef7a, transparent 60%), linear-gradient(165deg, #b6d24b, #5c7a0f 85%); color: #fbffe6; }
.bx-huge { font: 300 clamp(2.2rem, 3.6vw, 3rem)/1 var(--f-body); letter-spacing: -.03em; margin-top: auto; }
.bx-dark { background: linear-gradient(180deg, color-mix(in srgb, var(--card) 92%, #fff 8%), var(--card)); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 1px 0 rgba(255,255,255,.05) inset; }
.ticks { width: 100%; height: 30px; margin-top: auto; display: block; }
.ticks line { stroke-width: 2; stroke-linecap: round; }
.ticks .b0 { stroke: #d6ff3a; } .ticks .b1 { stroke: #ffd166; } .ticks .b2 { stroke: #ff9f5a; } .ticks .b3 { stroke: #ff5d73; }
.bx-scale { display: flex; justify-content: space-between; font: 500 .66rem var(--f-mono); color: var(--muted); }
.bx-due { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.bx-due a { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 6px 0; text-decoration: none; border-bottom: 1px solid var(--line); font-size: .85rem; }
.bx-due li:last-child a { border-bottom: 0; }
.bx-due .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.bx-due .d { color: var(--muted); font: 500 .75rem var(--f-mono); } .bx-due b { font: 700 .82rem var(--f-mono); }
.bx-ini { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font: 700 .7rem var(--f-mono); background: var(--card-2); border: 1px solid var(--line-hi); }
.bx-goal { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.bx-goal > div:first-child { display: flex; justify-content: space-between; font-size: .84rem; font-weight: 600; } .bx-goal b { font-family: var(--f-mono); }
.bx-dash { height: 10px; border-radius: 3px; background: repeating-linear-gradient(90deg, var(--line-hi) 0 2px, transparent 2px 5px); position: relative; overflow: hidden; }
.bx-dash::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--p); background: repeating-linear-gradient(90deg, #d6ff3a 0 2px, transparent 2px 5px); }

/* última linha */
.bx-pink, .bx-copper, .bx-green { grid-column: span 4; min-height: 300px; }
.bx-pink { background: radial-gradient(100% 70% at 0% 0%, #ff9fd0, transparent 60%), linear-gradient(170deg, #e2508f, #8e1650 55%, #4a0b2a); }
.bx-pink .bx-leg i.w1 { background: #fff; } .bx-pink .bx-leg i.w2 { background: #ffc6dd; }
.mirror { width: 100%; height: auto; margin-top: auto; display: block; }
.mirror .g { stroke: rgba(255,255,255,.12); stroke-dasharray: 2 4; }
.mirror .main { fill: none; stroke: #fff; stroke-width: 2.4; }
.mirror .echo { fill: none; stroke: rgba(255,255,255,.45); stroke-width: 1.2; } .mirror .echo.e1 { stroke: rgba(255,255,255,.25); }
.mirror text { fill: rgba(255,255,255,.85); font: 600 9px var(--f-mono); }
.bx-copper { background: radial-gradient(110% 70% at 0% 0%, #f5b48e, transparent 60%), linear-gradient(170deg, #c9764e, #6b3420 55%, #2a140c); }
.bx-seg { display: flex; gap: 4px; height: 7px; margin: 4px 0 6px; }
.bx-seg i { border-radius: 4px; background: #fff; } .bx-seg i:nth-child(2) { background: rgba(255,255,255,.7); } .bx-seg i:nth-child(3) { background: rgba(255,255,255,.45); } .bx-seg i.o { background: rgba(255,255,255,.22); }
.bx-plans { list-style: none; margin: auto 0 0; padding: 0; }
.bx-plans li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid rgba(255,255,255,.14); font-size: .86rem; }
.bx-plans li > div { display: flex; flex-direction: column; min-width: 0; } .bx-plans li > div b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bx-plans span { font: 500 .72rem var(--f-mono); opacity: .7; } .bx-plans li > b { font-family: var(--f-mono); white-space: nowrap; }
.bx-green { background: radial-gradient(110% 70% at 0% 0%, #9ff0c6, transparent 60%), linear-gradient(170deg, #3aa874, #145c3c 55%, #082419); }
.week { width: 100%; height: auto; margin-top: auto; display: block; }
.week .trk { fill: rgba(0,0,0,.25); } .week .bar { fill: #fff; } .week .bar.now { fill: #e8ff3a; }
.week text { fill: rgba(255,255,255,.7); font: 600 10px var(--f-mono); } .week text.now { fill: #e8ff3a; }

/* entrada suave dos cartões */
@keyframes bx-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.bx-card { animation: bx-in .5s cubic-bezier(.2,.7,.2,1) both; }
.bx-card:nth-child(2) { animation-delay: .04s; } .bx-card:nth-child(3) { animation-delay: .08s; } .bx-card:nth-child(4) { animation-delay: .1s; }
.bx-card:nth-child(5) { animation-delay: .12s; } .bx-card:nth-child(6) { animation-delay: .14s; } .bx-card:nth-child(n+7) { animation-delay: .18s; }
@media (prefers-reduced-motion: reduce) { .bx-card { animation: none; } }

@media (max-width: 1280px) { .bx-rev { grid-column: span 12; } .bx-net { grid-column: span 6; } .bx-lime, .bx-dark { grid-column: span 6; } .bx-pink, .bx-copper, .bx-green { grid-column: span 6; } }
@media (max-width: 1280px) and (min-width: 761px) { .bx-green { grid-column: span 12; } }
@media (max-width: 760px) { .bx-grid { grid-template-columns: minmax(0, 1fr); } .bx-grid > .bx-card { grid-column: auto; } .bx-rev { min-height: 300px; } }
.no-anim .bx-card { animation: none; } /* a atualização automática a cada minuto não repete a entrada */

/* ================= Liquid Glass (opcional: botão "Vidro" no seletor de tema) =================
   Fundo colorido fixo + superfícies translúcidas com desfoque, borda clara e brilho no topo.
   Vale nos temas claro e escuro. Quem pede "menos transparência" no sistema continua com superfícies sólidas. */
.side .foot .theme:has(.glass-btn) { --theme-n: 2; }
:root[data-glass="on"] {
  --glass-bg: rgba(255, 255, 255, .68); --glass-bg-2: rgba(255, 255, 255, .5); --glass-brd: rgba(255, 255, 255, .75); --glass-hi: rgba(255, 255, 255, .95);
  --glass-shadow: 0 12px 34px -16px rgba(40, 40, 90, .35); --glass-blur: blur(22px) saturate(175%);
  --wall-1: #a7b4ff; --wall-2: #ffb3d9; --wall-3: #8ff0d6; --wall-4: #ffd59a; --wall-base: #eef0fb;
}
@media (prefers-color-scheme: dark) { :root[data-glass="on"]:not([data-theme="light"]) {
  --glass-bg: rgba(18, 20, 36, .66); --glass-bg-2: rgba(26, 28, 50, .52); --glass-brd: rgba(255, 255, 255, .13); --glass-hi: rgba(255, 255, 255, .22);
  --glass-shadow: 0 16px 40px -18px rgba(0, 0, 0, .7);
  --wall-1: #4b3cf0; --wall-2: #c2187a; --wall-3: #0f8f7a; --wall-4: #b36a12; --wall-base: #07070f;
} }
:root[data-glass="on"][data-theme="dark"] {
  --glass-bg: rgba(18, 20, 36, .66); --glass-bg-2: rgba(26, 28, 50, .52); --glass-brd: rgba(255, 255, 255, .13); --glass-hi: rgba(255, 255, 255, .22);
  --glass-shadow: 0 16px 40px -18px rgba(0, 0, 0, .7);
  --wall-1: #4b3cf0; --wall-2: #c2187a; --wall-3: #0f8f7a; --wall-4: #b36a12; --wall-base: #07070f;
}
:root[data-glass="on"] body {
  background:
    radial-gradient(55vw 45vw at 8% 6%, var(--wall-1), transparent 62%),
    radial-gradient(48vw 40vw at 96% 12%, var(--wall-2), transparent 60%),
    radial-gradient(50vw 44vw at 80% 96%, var(--wall-3), transparent 62%),
    radial-gradient(40vw 36vw at 18% 92%, var(--wall-4), transparent 60%),
    var(--wall-base);
  background-attachment: fixed;
}
:root[data-glass="on"] :is(.card, .tcard, .ccard, .stat, .tile, .panel, .kpi, .rs-tile, .lm-card, .rs-fold, .ch, .bx-dark, .ul-card, .tb-dash, .tb-search, .lm-search, .tb-btn, .iconbtn, .chips-filter a, .bigsearch input) {
  background-color: var(--glass-bg) !important;
  background-image: linear-gradient(135deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 45%) !important;
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border-color: var(--glass-brd) !important;
  box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 -1px 0 rgba(255, 255, 255, .05), var(--glass-shadow) !important;
}
:root[data-glass="on"] :is(.card, .panel, .kpi, .rs-tile, .lm-card, .rs-fold, .ch, .bx-dark, .tile, .stat) { border-radius: 20px; }
:root[data-glass="on"] .side {
  background: var(--glass-bg-2); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--glass-brd); box-shadow: inset -1px 0 0 var(--glass-hi);
}
:root[data-glass="on"] .lm-login, :root[data-glass="on"] table.cl thead th { background: var(--glass-bg-2); border-color: var(--glass-brd); }
:root[data-glass="on"] :is(input[type=text], input[type=password], input[type=number], input[type=date], input[type=email], input[type=tel], input[type=search], select, textarea) {
  background-color: var(--glass-bg-2); border-color: var(--glass-brd);
}
:root[data-glass="on"] .btn.secondary { background: var(--glass-bg-2); border-color: var(--glass-brd); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
:root[data-glass="on"] .bx-card:not(.bx-dark) { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 0 0 1px rgba(255, 255, 255, .18), 0 18px 40px -20px rgba(0, 0, 0, .55); }
:root[data-glass="on"] .bx-card:not(.bx-dark)::before { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(160deg, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0) 32%); }
.theme .glass-btn[aria-pressed="true"] { background: linear-gradient(135deg, #9fb0ff, #f39ad0 55%, #7fe3c8); color: #10122a; }
@media (prefers-reduced-transparency: reduce) {
  :root[data-glass="on"] :is(.card, .tcard, .ccard, .stat, .tile, .panel, .kpi, .rs-tile, .lm-card, .rs-fold, .ch, .bx-dark, .ul-card, .dd-pop, .tb-dash, .tb-search, .lm-search, .tb-btn, .iconbtn, .side) {
    -webkit-backdrop-filter: none; backdrop-filter: none; background-color: var(--card) !important; }
}

/* backup externo: restaurar */
.danger-zone { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)) !important; }
.danger-zone > summary, details.card > summary { cursor: pointer; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before { content: "▸"; display: inline-block; margin-right: 8px; color: var(--muted); transition: transform .15s; }
details.card[open] > summary::before { transform: rotate(90deg); }
label.chk { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: .9rem; }
label.chk input { margin-top: 4px; }

/* menus suspensos (notificações, conta, mais ações) por cima de outros cartões: quase opacos para o texto não se misturar */
:root[data-glass="on"] .dd-pop {
  background-color: color-mix(in srgb, var(--card) 97%, transparent) !important; background-image: none !important;
  -webkit-backdrop-filter: blur(28px) saturate(160%); backdrop-filter: blur(28px) saturate(160%);
  border-color: var(--glass-brd) !important; box-shadow: inset 0 1px 0 var(--glass-hi), 0 22px 50px -14px rgba(0, 0, 0, .6) !important;
}
:root[data-glass="on"] select option { background: var(--card); color: var(--ink); }

/* cartão Servidor (só administradores) */
.bx-srv { grid-column: span 12; min-height: 0; }
.srv-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.5fr); gap: 18px 26px; align-items: center; margin-top: 6px; }
.srv-rings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.srv-r { display: flex; align-items: center; gap: 10px; min-width: 0; }
.srv-r > div { display: flex; flex-direction: column; min-width: 0; }
.srv-r b { font: 700 1.35rem var(--f-mono); line-height: 1.1; } .srv-r span { font-weight: 600; font-size: .86rem; } .srv-r small { color: var(--muted); font-size: .74rem; line-height: 1.3; }
.srv-r b.ok { color: var(--s-on); } .srv-r b.warn { color: var(--warn); } .srv-r b.bad { color: var(--bad); }
.ring { width: 54px; height: 54px; flex: none; }
.ring circle { fill: none; stroke-width: 7; } .ring .trk { stroke: var(--line-hi); } .ring .val { stroke: var(--s-on-dot); stroke-linecap: round; transition: stroke-dasharray .6s; }
.ring.warn .val { stroke: #ffb020; } .ring.bad .val { stroke: var(--s-off-dot); }
.srv-chart .bx-leg { margin-bottom: 4px; } .srv-chart .bx-leg i.c-cpu { background: var(--brand); } .srv-chart .bx-leg i.c-mem { background: #36c4a0; }
.srvchart { width: 100%; height: auto; display: block; }
.srvchart .g { stroke: var(--line); stroke-dasharray: 3 4; } .srvchart text { fill: var(--muted); font: 500 9px var(--f-mono); }
.srvchart path { fill: none; stroke-width: 1.8; stroke-linejoin: round; } .srvchart .cpu { stroke: var(--brand); } .srvchart .mem { stroke: #36c4a0; }
.srv-alert { margin: 8px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--bad-bg); color: var(--bad); font-size: .86rem; }
@media (max-width: 1100px) { .srv-body { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .srv-rings { grid-template-columns: minmax(0, 1fr); } }

/* tela de entrada: link "Esqueci minha senha" e ajuda para o dono do servidor */
.ls-forgot { margin: 14px 0 0; text-align: center; font-size: .9rem; }
.ls-forgot a { color: var(--brand); text-decoration: none; font-weight: 600; } .ls-forgot a:hover { text-decoration: underline; }
.ls-owner { margin-top: 14px; font-size: .84rem; color: var(--muted); }
.ls-owner summary { cursor: pointer; text-align: center; }
.ls-cmd { background: var(--card-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: .78rem; overflow-wrap: anywhere; }

/* "Mais ações" e outros menus suspensos ficam acima dos cartões seguintes (cartões com vidro/desfoque criam camadas próprias) */
.ch { position: relative; z-index: 4; }
.ch:has(details[open]) { z-index: 60; }
.card:has(> * details.dd[open]), .card:has(details.dd[open]) { position: relative; z-index: 60; }

/* Gerar financeiro */
.fin-gen .dd-pop { width: 300px; display: flex; flex-direction: column; gap: 2px; }
.fin-gen .dd-pop button { display: block; text-align: left; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font: inherit; cursor: pointer; }
.fin-gen .dd-pop button:hover, .fin-gen .dd-pop button:focus-visible { background: var(--brand-soft); }
.fin-gen .dd-pop b { display: block; } .fin-gen .dd-pop small { display: block; color: var(--muted); font-size: .76rem; font-weight: 400; margin-top: 1px; }
.fin-form { margin: 0 0 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card-2); }
.fin-form > summary { cursor: pointer; font-weight: 700; }
.fin-form form { margin-top: 10px; }
.fin-t td.fin-acts { text-align: right; width: 1%; white-space: nowrap; }
.fin-acts-in { display: inline-flex; flex-wrap: nowrap; gap: 6px; justify-content: flex-end; align-items: center; } .fin-acts-in form { margin: 0; }
.fin-t td:nth-child(3) { white-space: nowrap; }
.fin-act { position: relative; }
.fin-act .dd-pop { width: 340px; text-align: left; white-space: normal; }
.fin-act .code { font: 500 .76rem var(--f-mono); overflow-wrap: anywhere; background: var(--field); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; }
.card:has(details.fin-act[open]) { position: relative; z-index: 60; }

/* ================= dashboard principal (operação) e servidor: nc-* ================= */
.nc-card { background: radial-gradient(120% 80% at 100% 0%, rgba(139,108,255,.16), transparent 60%), linear-gradient(165deg, #241c45, #15102b 70%, #100c22);
  border: 1px solid rgba(255,255,255,.08); color: #f3f0ff; }
.nc-w3 { grid-column: span 3; } .nc-w4 { grid-column: span 4; } .nc-w6 { grid-column: span 6; } .nc-w8 { grid-column: span 8; } .nc-w12 { grid-column: span 12; }
.nc-chart { margin-top: auto; } .nc-chart svg { width: 100%; display: block; }
.nc-card svg text { fill: rgba(235,230,255,.55); font: 500 10px var(--f-mono); }
.nc-card svg .g { stroke: rgba(255,255,255,.08); stroke-dasharray: 3 5; }
.nc-wait { margin: auto 0; }
.nc-kpi { display: flex; align-items: baseline; gap: 10px; }
.nc-kpi b { font: 300 2.6rem/1 var(--f-body); letter-spacing: -.03em; font-variant-numeric: tabular-nums;
  background: linear-gradient(90deg, #ffb24d, #ff5c8a 50%, #a58bff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nc-kpi span { font-size: .82rem; opacity: .65; }
.nc-area { height: 210px; } .nc-area .ln { fill: none; stroke-width: 2.6; stroke-linecap: round; }
.nc-area .now { fill: #fff; stroke: #ff5c8a; stroke-width: 3; }
/* mostrador */
.nc-dialw { position: relative; width: min(100%, 210px); margin: 4px auto 0; }
.nc-dial { width: 100%; display: block; }
.nc-dial line { stroke-width: 3; stroke-linecap: round; } .nc-dial .off { stroke: rgba(255,255,255,.16); }
.nc-dial .on { stroke: #a58bff; } .nc-dial .on:nth-child(n+22) { stroke: #d36cff; } .nc-dial .on:nth-child(n+40) { stroke: #ff5c8a; }
.nc-dial .trk { fill: none; stroke: rgba(255,255,255,.08); stroke-width: 8; } .nc-dial .val { fill: none; stroke-width: 8; stroke-linecap: round; }
.nc-dialv { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.nc-dialv b { font: 600 1.9rem/1 var(--f-body); letter-spacing: -.02em; } .nc-dialv small { font-size: .95rem; opacity: .55; font-weight: 400; }
.nc-dialv span { font-size: .76rem; opacity: .6; }
.bx-list .d.aw { background: #8b6cff; }
/* anéis concêntricos + medidores */
.nc-qual { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 16px; align-items: center; margin-top: auto; }
.nc-ringw { position: relative; } .nc-ringw b { position: absolute; inset: 0; display: grid; place-content: center; font: 600 1.5rem var(--f-body); }
.nc-ringw sup { font-size: .7rem; color: #ffb24d; }
.nc-rings { width: 100%; display: block; }
.nc-rings circle { fill: none; stroke-width: 9; stroke-linecap: round; } .nc-rings .trk { stroke: rgba(255,255,255,.08); }
.nc-rings .r0 { stroke: #8b6cff; } .nc-rings .r1 { stroke: #ff5c8a; } .nc-rings .r2 { stroke: #ffb24d; }
.nc-meters { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.nc-meters li > div { display: flex; justify-content: space-between; gap: 8px; font-size: .78rem; margin-bottom: 5px; }
.nc-meters li > div span { opacity: .75; } .nc-meters li b { font-family: var(--f-mono); }
.nc-meter { display: block; height: 10px; border-radius: 99px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); padding: 1px; }
.nc-meter i { display: block; height: 100%; border-radius: 99px; }
.nc-meter.r0 i { background: linear-gradient(90deg, #6f8bff, #8b6cff); } .nc-meter.r1 i { background: linear-gradient(90deg, #ff8fb8, #ff5c8a); } .nc-meter.r2 i { background: linear-gradient(90deg, #ffd27a, #ffb24d); }
/* colunas, linhas, agrupadas */
.nc-cols { height: 180px; } .nc-cols .zero { opacity: .35; } .nc-cols .pk { fill: #fff; } .nc-cols .pkv { fill: #fff; font-weight: 700; }
.nc-lines { height: 200px; } .nc-lines polyline { fill: none; stroke-width: 2.2; stroke-linejoin: round; }
.nc-lines polyline.s0 { stroke: #ffb24d; } .nc-lines polyline.s1 { stroke: #8b6cff; }
.nc-lines circle.s0 { fill: #ffb24d; } .nc-lines circle.s1 { fill: #8b6cff; } .nc-lines circle { stroke: #15102b; stroke-width: 2; }
.nc-group { height: 210px; }
.nc .bx-leg i.ga { background: linear-gradient(#ffb24d, #ff4f9a); } .nc .bx-leg i.gb { background: linear-gradient(#6f8bff, #9b5cff); }
/* barras em pílula */
.nc-pills { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.nc-pills li, .nc-pills a { display: grid; grid-template-columns: minmax(70px, 38%) minmax(0, 1fr) 2.6rem; align-items: center; gap: 10px; font-size: .82rem; text-decoration: none; }
.nc-pills a { grid-column: 1 / -1; }
.nc-pills .l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .85; }
.nc-pills .bar { height: 12px; border-radius: 99px; background: rgba(255,255,255,.07); overflow: hidden; }
.nc-pills .bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #8b6cff, #d36cff 55%, #ff5c8a 80%, #ffb24d); }
.nc-pills b { text-align: right; font: 700 .82rem var(--f-mono); }
.nc-pills li.muted { display: block; }
/* servidor (cartão resumido e dashboard) */
.nc-srv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: auto 0 6px; text-align: center; }
.nc-srv > div { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.nc-srv .ring { width: 74px; height: 74px; } .nc-srv b { position: absolute; top: 25px; font: 700 .9rem var(--f-mono); } .nc-srv span { font-size: .74rem; opacity: .7; }
.nc-card .ring .trk { stroke: rgba(255,255,255,.1); }
.nc-gaugecard { min-height: 200px; }
.nc-big { position: relative; width: 120px; margin: 4px auto 0; } .nc-big .ring { width: 120px; height: 120px; }
.nc-big b { position: absolute; inset: 0; display: grid; place-content: center; font: 600 1.5rem var(--f-mono); }
.nc-card b.ok { color: #6ff0b0; } .nc-card b.warn { color: #ffd166; } .nc-card b.bad { color: #ff6b7d; }
.nc-week { height: 200px; } .nc-week path { fill: none; stroke-width: 1.8; }
.nc-week .w0, .nc .bx-leg i.w0 { stroke: #ff5c8a; background: #ff5c8a; } .nc-week .w1, .nc .bx-leg i.w1 { stroke: #8b6cff; background: #8b6cff; } .nc-week .w2, .nc .bx-leg i.w2 { stroke: #ffb24d; background: #ffb24d; }
.nc-facts { list-style: none; margin: 4px 0 0; padding: 0; }
.nc-facts li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid rgba(255,255,255,.08); font-size: .84rem; }
.nc-facts span { opacity: .7; } .nc-facts b { font-family: var(--f-mono); text-align: right; }
.nc-card .srvchart { width: 100%; height: 190px; }
@media (max-width: 1280px) { .nc-w8, .nc-w12 { grid-column: span 12; } .nc-w4, .nc-w6 { grid-column: span 6; } .nc-w3 { grid-column: span 6; } }
@media (max-width: 760px) { .nc-w3, .nc-w4, .nc-w6, .nc-w8, .nc-w12 { grid-column: span 12; } .nc-qual { grid-template-columns: 110px minmax(0, 1fr); } }
.nc .bx-leg i.c-cpu { background: var(--brand); } .nc .bx-leg i.c-mem { background: #36c4a0; }
.nc-ringw b { display: flex; align-items: center; justify-content: center; } .nc-ringw sup { margin-left: 1px; position: relative; top: -.55em; }
.nc-facts-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 28px; }
@media (max-width: 1000px) { .nc-facts-grid { grid-template-columns: minmax(0, 1fr); } }

/* ================= aplicativo instalável (PWA) ================= */
.pwa-bar { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 90; max-width: 520px; margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px; border-radius: 16px;
  background: var(--card); color: var(--ink); border: 1px solid var(--line-hi); box-shadow: 0 18px 40px -16px rgba(0,0,0,.55); animation: bx-in .35s ease both; }
.pwa-txt { flex: 1 1 220px; display: flex; flex-direction: column; gap: 2px; font-size: .86rem; } .pwa-txt span { color: var(--muted); }
.pwa-act { display: flex; gap: 8px; }
.pwa-share { display: inline-block; width: 13px; height: 15px; vertical-align: -2px; border: 1.6px solid currentColor; border-top: 0; border-radius: 0 0 3px 3px; position: relative; margin: 0 2px; }
.pwa-share::before { content: ""; position: absolute; left: 50%; top: -6px; width: 1.6px; height: 11px; background: currentColor; transform: translateX(-50%); }
.pwa-pick { max-width: 460px; margin: 6vh auto 0; display: flex; flex-direction: column; gap: 12px; }
.pwa-pick h1 { margin: 0; }
.pwa-opt { display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: 16px; text-decoration: none; color: var(--ink);
  background: var(--card); border: 1px solid var(--line-hi); transition: transform .15s ease, border-color .15s ease; }
.pwa-opt:hover { border-color: var(--brand); } .pwa-opt:active { transform: scale(.98); }
.pwa-opt b { font-size: 1.05rem; } .pwa-opt span { color: var(--muted); font-size: .86rem; }
.pwa-off { max-width: 520px; margin: 8vh auto 0; }
.is-app body { -webkit-user-select: none; user-select: none; } .is-app input, .is-app textarea, .is-app [contenteditable] { -webkit-user-select: text; user-select: text; }
@media (prefers-reduced-motion: reduce) { .pwa-bar { animation: none; } .pwa-opt { transition: none; } }

/* acesso externo (HTTPS) */
.ax-links { list-style: none; margin: 8px 0 0; padding: 0; }
.ax-links li { display: grid; grid-template-columns: minmax(120px, 220px) minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.ax-links code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .ax-links span { color: var(--muted); font-size: .86rem; }
.ax-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 12px; }
.ax-ports { margin: 8px 0 6px; }
.ax-pre { white-space: pre-wrap; word-break: break-all; font-size: .78rem; padding: 10px; border-radius: 10px; background: var(--card-2); border: 1px solid var(--line); margin: 6px 0; }
.ax-checks { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ax-checks li { display: grid; grid-template-columns: 26px 1fr; gap: 8px; padding: 10px; border-radius: 10px; border: 1px solid var(--line); }
.ax-checks i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 700; font-size: .8rem; }
.ax-checks .ok i { background: var(--ok-bg); color: var(--ok); } .ax-checks .warn i { background: var(--warn-bg); color: var(--warn); } .ax-checks .bad i { background: var(--bad-bg); color: var(--bad); }
.ax-checks div { display: flex; flex-direction: column; gap: 2px; font-size: .86rem; } .ax-checks span { color: var(--muted); }
@media (max-width: 640px) { .ax-links li { grid-template-columns: minmax(0, 1fr) auto; } .ax-links li span { grid-column: 1 / -1; } }
