/* =====================================================================
   QualyNevado - Tema "Azul Vidro" (camada visual por cima do sistema)
   Só muda a aparência. Para voltar ao visual antigo, remova as duas
   linhas tema-azul.css / tema-azul.js do app.html.
   Tema padrão: azul escuro (html.qn-escuro). Alternativo: html.qn-claro.
   ===================================================================== */

html.qn-azul{
  --qn-bg1:#020b1f; --qn-bg2:#06235a;
  --qn-glass:rgba(14,38,86,.55); --qn-glass2:rgba(12,32,74,.92);
  --qn-stroke:rgba(140,190,255,.16); --qn-hi:rgba(0,174,239,.14);
  --qn-text:#eaf2ff; --qn-mute:rgba(200,222,255,.66);
  --qn-acc:#1e90ff; --qn-acc2:#00c2ff;
  --qn-side-w:250px; --qn-rail-w:76px;
  --qn-font:"Plus Jakarta Sans",system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
}
html.qn-claro{
  --qn-bg1:#e3edfb; --qn-bg2:#c3daf6;
  --qn-glass:rgba(255,255,255,.72); --qn-glass2:rgba(255,255,255,.96);
  --qn-stroke:rgba(0,70,160,.14); --qn-hi:rgba(0,87,184,.09);
  --qn-text:#0b1f45; --qn-mute:rgba(20,50,100,.64);
  --qn-acc:#0057B8; --qn-acc2:#0094d9;
}

/* ---------- Variáveis do sistema no modo escuro ---------- */
html.qn-escuro{
  color-scheme:dark;
  --bd:#9fd0ff; --bm:#3b9cff; --bl:#38c6ff; --bp:rgba(0,174,239,.14);
  --gb:rgba(255,255,255,.05); --gb2:rgba(140,190,255,.18);
  --tm:#e8f1ff; --ts:rgba(205,222,255,.70);
  --danger:#f05b4f; --warn:#f5a524; --ok:#34c77b;
}
html.qn-azul body{font-family:var(--qn-font)}
html.qn-azul body,html.qn-azul #app{
  background:
    radial-gradient(55% 60% at 12% 4%,rgba(13,79,184,.85) 0%,transparent 60%),
    radial-gradient(45% 50% at 95% 12%,rgba(0,136,214,.65) 0%,transparent 55%),
    radial-gradient(60% 60% at 60% 105%,rgba(10,47,122,.9) 0%,transparent 60%),
    linear-gradient(160deg,var(--qn-bg1),var(--qn-bg2));
  background-attachment:fixed;color:var(--tm)
}
html.qn-claro body,html.qn-claro #app{
  background:
    radial-gradient(55% 60% at 12% 4%,#a9cbf6 0%,transparent 60%),
    radial-gradient(45% 50% at 95% 12%,#b7e6ff 0%,transparent 55%),
    linear-gradient(160deg,var(--qn-bg1),var(--qn-bg2));
  background-attachment:fixed
}

/* ---------- Login ---------- */
html.qn-azul #login-screen{background:
  radial-gradient(55% 60% at 15% 10%,#0d4fb8 0%,transparent 60%),
  radial-gradient(45% 50% at 90% 20%,#0088d6 0%,transparent 55%),
  linear-gradient(160deg,#020b1f,#06235a)}
html.qn-azul .lcard{background:rgba(255,255,255,.94);backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);border:1px solid rgba(255,255,255,.4);border-radius:22px;box-shadow:0 30px 80px -20px rgba(0,0,0,.6)}
html.qn-azul .lcard input{background:#fff;color:#1a1a1a;border-color:#d6e0ee}
html.qn-azul .btn-login{background:linear-gradient(90deg,#0a5fd0,#0579c2);border-radius:12px;box-shadow:0 10px 26px -10px #00c2ff}

/* ---------- Menu lateral ---------- */
html.qn-azul .sidebar{
  top:12px;left:12px;bottom:12px;width:var(--qn-side-w);border-radius:20px;
  background:var(--qn-glass);border:1px solid var(--qn-stroke);
  backdrop-filter:blur(20px) saturate(140%);-webkit-backdrop-filter:blur(20px) saturate(140%);
  box-shadow:0 20px 50px -25px rgba(0,0,0,.55);overflow:visible;
  transition:width .28s cubic-bezier(.4,0,.2,1),transform .3s cubic-bezier(.3,.9,.3,1)
}
html.qn-claro .sidebar{background:linear-gradient(180deg,rgba(0,48,135,.94),rgba(0,87,184,.9))}
html.qn-azul .sidebar-logo{padding:14px 14px 12px;border-bottom:1px solid rgba(255,255,255,.1);border-radius:20px 20px 0 0}
html.qn-azul .sidebar-logo img{max-width:40px;height:auto}
html.qn-azul .sidebar nav{padding:6px 10px 10px;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.18) transparent}
html.qn-azul .sidebar-brand{border-top:1px solid rgba(255,255,255,.1)}
html.qn-azul .sidebar-bottom{border-top:1px solid rgba(255,255,255,.1);border-radius:0 0 20px 20px}

/* busca do menu */
.qn-sb-search{display:flex;align-items:center;gap:8px;margin:10px 10px 2px;padding:9px 11px;border-radius:12px;background:rgba(255,255,255,.08);color:rgba(255,255,255,.7);font-size:12.5px;cursor:pointer;border:1px solid transparent;white-space:nowrap;overflow:hidden}
.qn-sb-search:hover{background:rgba(255,255,255,.14);color:#fff}
.qn-sb-search i{font-size:16px;flex-shrink:0}
.qn-sb-search kbd{margin-left:auto;font:500 10px ui-monospace,Consolas,monospace;padding:2px 6px;border-radius:5px;border:1px solid rgba(255,255,255,.2)}

/* grupos que recolhem */
html.qn-azul .nav-sec.qn-gh{display:flex;align-items:center;gap:10px;padding:10px 10px 6px;margin-top:2px;border-radius:10px;cursor:pointer;user-select:none;color:rgba(255,255,255,.5);font-weight:700;font-size:10.5px;letter-spacing:.12em}
html.qn-azul .nav-sec.qn-gh:hover{color:#fff}
.qn-gh .qn-gi{display:none;font-size:20px}
.qn-gh .qn-chev{margin-left:auto;font-size:14px;transition:transform .2s;letter-spacing:0}
.qn-grp.qn-closed .qn-chev{transform:rotate(-90deg)}
.qn-items{display:grid;grid-template-rows:1fr;transition:grid-template-rows .25s ease}
.qn-items>.qn-in{overflow:hidden;display:flex;flex-direction:column;gap:2px;min-height:0}
.qn-grp.qn-closed .qn-items{grid-template-rows:0fr}
.qn-grp{position:relative}
.qn-fly-h{display:none}

html.qn-azul .nav-item{border-left:0;border-radius:12px;padding:9px 12px;gap:11px;color:rgba(225,238,255,.78);font-weight:500;white-space:nowrap}
html.qn-azul .nav-item:hover{background:rgba(255,255,255,.1);color:#fff}
html.qn-azul .nav-item.active{background:linear-gradient(90deg,#0a5fd0,#0579c2);color:#fff;box-shadow:0 8px 22px -10px #00c2ff;font-weight:600}
html.qn-azul .nav-item i{font-size:17px}

/* botão recolher */
.qn-collapse{position:absolute;right:-13px;top:64px;width:26px;height:26px;border-radius:50%;border:1px solid var(--qn-stroke);background:var(--qn-glass2);color:var(--qn-text);display:flex;align-items:center;justify-content:center;cursor:pointer;z-index:120;padding:0;box-shadow:0 4px 12px rgba(0,0,0,.25)}
.qn-collapse i{font-size:15px;transition:transform .25s}
body.qn-rail .qn-collapse i{transform:rotate(180deg)}

/* ----- Menu recolhido (trilho de ícones) ----- */
@media (min-width:901px){
  body.qn-rail .sidebar{width:var(--qn-rail-w)}
  body.qn-rail .main{margin-left:calc(var(--qn-rail-w) + 24px)}
  body.qn-rail .sidebar-logo{padding:12px 8px;display:flex;justify-content:center}
  body.qn-rail .sidebar-logo > div{justify-content:center}
  body.qn-rail .sidebar-logo .s-name,body.qn-rail .sidebar-logo .s-sub,body.qn-rail .sidebar-brand,
  body.qn-rail .qn-sb-search span,body.qn-rail .qn-sb-search kbd,
  body.qn-rail .qn-gh .qn-gl,body.qn-rail .qn-gh .qn-chev,
  body.qn-rail .sidebar-bottom #sb-name,body.qn-rail .sidebar-bottom #sb-role{display:none}
  body.qn-rail .sidebar-logo img{max-width:38px}
  body.qn-rail .qn-sb-search{justify-content:center;margin:10px 12px 4px;padding:10px 0}
  body.qn-rail .sidebar nav{overflow:visible;padding:6px 12px}
  body.qn-rail .nav-sec.qn-gh{justify-content:center;padding:11px 0;margin:2px 0;color:rgba(225,238,255,.72)}
  body.qn-rail .nav-sec.qn-gh:hover,body.qn-rail .qn-grp.qn-flyopen .nav-sec.qn-gh{background:rgba(255,255,255,.12);color:#fff}
  body.qn-rail .qn-grp.qn-has-on .nav-sec.qn-gh{background:linear-gradient(135deg,#0a5fd0,#0579c2);color:#fff}
  body.qn-rail .qn-gh .qn-gi{display:block}
  /* painel flutuante com os módulos do grupo */
  body.qn-rail .qn-items{display:none;position:absolute;left:calc(100% + 14px);top:-6px;min-width:250px;z-index:130;
    padding:10px;border-radius:16px;background:#0b1d42;border:1px solid var(--qn-stroke);box-shadow:0 24px 60px -18px rgba(0,0,0,.6)}
  html.qn-claro body.qn-rail .qn-items{background:rgba(0,48,135,.97)}
  body.qn-rail .qn-items::before{content:"";position:absolute;left:-16px;top:0;bottom:0;width:16px}
  body.qn-rail .qn-grp:hover .qn-items,body.qn-rail .qn-grp.qn-flyopen .qn-items{display:block}
  body.qn-rail .qn-grp.qn-closed .qn-items{grid-template-rows:1fr}
  body.qn-rail .qn-fly-h{display:block;font-size:10.5px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:rgba(255,255,255,.55);padding:2px 8px 8px}
  body.qn-rail .sidebar-bottom{padding:12px 0;display:flex;justify-content:center}
  body.qn-rail .sidebar-bottom > div{flex-direction:column;gap:8px!important}
  body.qn-rail .sidebar-bottom .ti-logout{margin-left:0!important}
}

/* ---------- Área principal ---------- */
html.qn-azul .main{margin-left:calc(var(--qn-side-w) + 24px);transition:margin-left .28s cubic-bezier(.4,0,.2,1);padding-right:12px}
html.qn-azul .topbar{
  margin-top:12px;top:12px;border-radius:18px;padding:10px 16px;
  background:var(--qn-glass);border:1px solid var(--qn-stroke);
  backdrop-filter:blur(20px) saturate(140%);-webkit-backdrop-filter:blur(20px) saturate(140%);
  box-shadow:0 14px 40px -24px rgba(0,0,0,.5)
}
html.qn-azul .topbar-title{color:var(--qn-text);font-weight:700;font-size:17px;display:flex;align-items:baseline;gap:6px}
html.qn-azul .topbar-title::before{content:"QualyNevado /";font-size:12px;font-weight:500;color:var(--qn-mute)}
html.qn-azul .content{padding:16px 2px 30px}

.qn-tb-btn{width:36px;height:36px;border-radius:11px;display:inline-flex;align-items:center;justify-content:center;background:var(--qn-hi);color:var(--qn-text);border:1px solid var(--qn-stroke);cursor:pointer;padding:0;flex-shrink:0}
.qn-tb-btn i{font-size:18px}
.qn-tb-btn:hover{border-color:var(--qn-acc2)}

/* ---------- Cartões em vidro ---------- */
html.qn-azul .card,html.qn-azul .stat-card,html.qn-azul .forn-card{
  background:var(--qn-glass);border:1px solid var(--qn-stroke);border-radius:18px;
  backdrop-filter:blur(18px) saturate(140%);-webkit-backdrop-filter:blur(18px) saturate(140%);
  box-shadow:0 14px 40px -26px rgba(0,0,0,.55)
}
html.qn-azul .stat-card{padding:16px 18px}
html.qn-azul .stats-grid > .stat-card:first-child{background:linear-gradient(145deg,#0a5fd0,#0570b8);border-color:rgba(160,220,255,.35)}
html.qn-azul .stats-grid > .stat-card:first-child .stat-val,html.qn-azul .stats-grid > .stat-card:first-child .stat-lbl{color:#fff!important}
html.qn-azul .stat-val{font-variant-numeric:tabular-nums;letter-spacing:-.02em}
html.qn-azul .card-title{color:var(--qn-text)}
html.qn-azul .forn-card:hover{border-color:var(--qn-acc2);box-shadow:0 0 0 2px rgba(0,194,255,.25)}

/* ---------- Botões ---------- */
html.qn-azul .btn-p{background:linear-gradient(90deg,#0a5fd0,#0579c2);color:#fff;border-radius:11px;box-shadow:0 8px 20px -10px #00c2ff}
html.qn-azul .btn-p:hover{background:linear-gradient(90deg,#0852b8,#046aa8)}
html.qn-azul .btn-d{background:#d2362b;color:#fff}html.qn-azul .btn-s{background:#17854b;color:#fff}html.qn-azul .btn-w{background:#b35f00;color:#fff}
html.qn-azul .step.active .step-num{background:#0a5fd0;color:#fff}html.qn-azul .step.done .step-num{background:#17854b;color:#fff}
html.qn-azul .rb-coord{background:#0a5fd0}html.qn-azul .ai-msg.user{background:#0a5fd0;color:#fff}
html.qn-azul .btn-o{border-radius:11px}
html.qn-azul .btn-d,html.qn-azul .btn-s,html.qn-azul .btn-w{border-radius:11px}
html.qn-escuro .btn-o{background:rgba(255,255,255,.04);color:#cfe6ff;border-color:rgba(140,190,255,.35)}
html.qn-escuro .btn-o:hover{background:rgba(0,174,239,.16)}

/* ---------- Janelas ---------- */
html.qn-azul .modal-ov{background:rgba(1,10,32,.6);backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px)}
html.qn-azul .modal-box{border-radius:20px}
html.qn-escuro .modal-box{background:#0b1d42;border:1px solid var(--qn-stroke);box-shadow:0 30px 80px -20px rgba(0,0,0,.7)}
html.qn-escuro #toast{background:#0f2a5c;border:1px solid var(--qn-stroke)}

/* ---------- Tabelas ---------- */
html.qn-escuro th{background:rgba(0,174,239,.12);color:#cfe6ff;border-bottom-color:rgba(140,190,255,.25)}
html.qn-escuro tr:hover td{background:rgba(255,255,255,.04)}
html.qn-azul .table-wrap{border-radius:12px}

/* ---------- Campos ---------- */
html.qn-escuro #app input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]),
html.qn-escuro #app select,html.qn-escuro #app textarea,
html.qn-escuro .modal-ov input:not([type=checkbox]):not([type=radio]):not([type=file]),
html.qn-escuro .modal-ov select,html.qn-escuro .modal-ov textarea{
  background-color:rgba(4,16,44,.55)!important;color:var(--tm)!important;border-color:rgba(140,190,255,.25)!important}
html.qn-escuro #app input::placeholder,html.qn-escuro #app textarea::placeholder{color:rgba(200,222,255,.45)}
html.qn-escuro select option,html.qn-escuro select optgroup{background:#0b1d42;color:#e8f1ff}
html.qn-escuro .upload-area:hover{background:rgba(0,174,239,.1)}

/* ---------- Selos e status (versão escura legível) ---------- */
html.qn-escuro .b-ok,html.qn-escuro .sp-aprovado,html.qn-escuro .dc-ok,html.qn-escuro .perm-chip.on{background:rgba(52,199,123,.16);color:#6ee7a5;border-color:rgba(52,199,123,.35)}
html.qn-escuro .b-warn,html.qn-escuro .sp-pendente-doc,html.qn-escuro .dc-pend{background:rgba(245,165,36,.16);color:#fcc565;border-color:rgba(245,165,36,.35)}
html.qn-escuro .b-danger,html.qn-escuro .sp-reprovado,html.qn-escuro .sp-exp,html.qn-escuro .dc-miss,html.qn-escuro .perm-chip.off{background:rgba(240,91,79,.16);color:#ff8f86;border-color:rgba(240,91,79,.35)}
html.qn-escuro .b-info,html.qn-escuro .sp-andamento{background:rgba(59,156,255,.16);color:#9fd0ff}
html.qn-escuro .sp-analise{background:rgba(139,123,255,.18);color:#c4b8ff}
html.qn-escuro .sp-obsoleto{background:rgba(255,255,255,.08);color:#b8c4d8}
html.qn-escuro .rb-analista{background:rgba(0,174,239,.18);color:#9fd0ff}
html.qn-escuro .rb-auditor{background:rgba(170,100,255,.2);color:#d9b8ff}
html.qn-escuro .rb-viewer{background:rgba(255,255,255,.1);color:#d6dbe4}
html.qn-escuro .ai-danger{background:rgba(240,91,79,.12)}
html.qn-escuro .ai-warn{background:rgba(245,165,36,.12)}
html.qn-escuro .ai-msg.bot{background:rgba(255,255,255,.06)}
html.qn-escuro .tab.active{background:rgba(0,174,239,.14);color:#9fd0ff;border-bottom-color:#38c6ff}
html.qn-escuro .tab:hover:not(.active){background:rgba(255,255,255,.06)}

/* ---------- Cores fixas escritas direto nas telas (modo escuro) ----------
   Fundos brancos/claros viram vidro escuro e textos escuros viram claros,
   para nada ficar ilegível. */
html.qn-escuro #app [style*="background:#fff"],html.qn-escuro .modal-ov [style*="background:#fff"],
html.qn-escuro #app [style*="background: #fff"],html.qn-escuro .modal-ov [style*="background: #fff"],
html.qn-escuro #app [style*="background:white"],html.qn-escuro .modal-ov [style*="background:white"],
html.qn-escuro #app [style*="background-color:#fff"],html.qn-escuro .modal-ov [style*="background-color:#fff"],
html.qn-escuro [id^="m-"][style*="position:fixed"] [style*="background:#fff"]{background:rgba(12,32,74,.72)!important}
html.qn-escuro .modal-ov > [style*="background:#fff"],html.qn-escuro [id^="m-"][style*="position:fixed"] > [style*="background:#fff"]{background:#0b1d42!important}

html.qn-escuro #app [style*="background:#f"]:not([style*="background:#fff"]),html.qn-escuro .modal-ov [style*="background:#f"]:not([style*="background:#fff"]),
html.qn-escuro #app [style*="background:#e"]:not([style*="background:#e2"]):not([style*="background:#e67"]):not([style*="background:#dc"]):not([style*="background:#d9"]):not([style*="background:#d3"]),html.qn-escuro .modal-ov [style*="background:#e"]:not([style*="background:#e2"]):not([style*="background:#e67"]):not([style*="background:#dc"]):not([style*="background:#d9"]):not([style*="background:#d3"]),
html.qn-escuro #app [style*="background:#E"],html.qn-escuro .modal-ov [style*="background:#E"],
html.qn-escuro #app [style*="background:#d"]:not([style*="background:#e2"]):not([style*="background:#e67"]):not([style*="background:#dc"]):not([style*="background:#d9"]):not([style*="background:#d3"]),html.qn-escuro .modal-ov [style*="background:#d"]:not([style*="background:#e2"]):not([style*="background:#e67"]):not([style*="background:#dc"]):not([style*="background:#d9"]):not([style*="background:#d3"]){background:rgba(255,255,255,.06)!important}
/* tons claros de verde / amarelo / vermelho / azul mantêm o significado */
html.qn-escuro #app [style*="background:#e8f8"],html.qn-escuro #app [style*="background:#eefa"],html.qn-escuro #app [style*="background:#ecfd"],html.qn-escuro #app [style*="background:#f0fd"],html.qn-escuro #app [style*="background:#dcfc"],
html.qn-escuro .modal-ov [style*="background:#e8f8"],html.qn-escuro .modal-ov [style*="background:#eefa"],html.qn-escuro .modal-ov [style*="background:#ecfd"],html.qn-escuro .modal-ov [style*="background:#f0fd"],html.qn-escuro .modal-ov [style*="background:#dcfc"]{background:rgba(52,199,123,.13)!important}
html.qn-escuro #app [style*="background:#fef"],html.qn-escuro #app [style*="background:#fff7"],html.qn-escuro #app [style*="background:#fffb"],html.qn-escuro #app [style*="background:#fff3"],html.qn-escuro #app [style*="background:#fef9"],html.qn-escuro #app [style*="background:#fffa"],html.qn-escuro #app [style*="background:#f5f0"],html.qn-escuro #app [style*="background:#f0e8"],html.qn-escuro #app [style*="background:#fdf6"],html.qn-escuro #app [style*="background:#fef3"],
html.qn-escuro .modal-ov [style*="background:#fef"],html.qn-escuro .modal-ov [style*="background:#fff7"],html.qn-escuro .modal-ov [style*="background:#fffb"],html.qn-escuro .modal-ov [style*="background:#fff3"],html.qn-escuro .modal-ov [style*="background:#f5f0"],html.qn-escuro .modal-ov [style*="background:#f0e8"]{background:rgba(245,165,36,.12)!important}
html.qn-escuro #app [style*="background:#fde"],html.qn-escuro #app [style*="background:#fff4"],html.qn-escuro #app [style*="background:#fee"],html.qn-escuro #app [style*="background:#fef2"],html.qn-escuro #app [style*="background:#fdf2"],
html.qn-escuro .modal-ov [style*="background:#fde"],html.qn-escuro .modal-ov [style*="background:#fff4"],html.qn-escuro .modal-ov [style*="background:#fee"],html.qn-escuro .modal-ov [style*="background:#fef2"]{background:rgba(240,91,79,.13)!important}
html.qn-escuro #app [style*="background:#e6f"],html.qn-escuro #app [style*="background:#E6F"],html.qn-escuro #app [style*="background:#eaf"],html.qn-escuro #app [style*="background:#f3f9"],html.qn-escuro #app [style*="background:#f8fb"],html.qn-escuro #app [style*="background:#eff6"],html.qn-escuro #app [style*="background:#dbea"],html.qn-escuro #app [style*="background:#f0f7"],html.qn-escuro #app [style*="background:#f0f9"],
html.qn-escuro .modal-ov [style*="background:#e6f"],html.qn-escuro .modal-ov [style*="background:#E6F"],html.qn-escuro .modal-ov [style*="background:#eaf"],html.qn-escuro .modal-ov [style*="background:#f3f9"],html.qn-escuro .modal-ov [style*="background:#f8fb"],html.qn-escuro .modal-ov [style*="background:#eff6"]{background:rgba(59,156,255,.13)!important}
html.qn-escuro #app [style*="background:#f1ed"],html.qn-escuro #app [style*="background:#eeed"],html.qn-escuro #app [style*="background:#f3e8"],html.qn-escuro #app [style*="background:#f5f3"]{background:rgba(139,123,255,.14)!important}

/* textos escuros fixos -> claros */
html.qn-escuro #app [style*="color:#0"]:not([style*="-color:#0"]),html.qn-escuro .modal-ov [style*="color:#0"]:not([style*="-color:#0"]),
html.qn-escuro #app [style*="color:#1"]:not([style*="-color:#1"]),html.qn-escuro .modal-ov [style*="color:#1"]:not([style*="-color:#1"]),
html.qn-escuro #app [style*="color: #0"],html.qn-escuro #app [style*="color: #1"],
html.qn-escuro #app [style*="color:#2"]:not([style*="-color:#2"]),html.qn-escuro .modal-ov [style*="color:#2"]:not([style*="-color:#2"]),
html.qn-escuro #app [style*="color:#3"]:not([style*="-color:#3"]),html.qn-escuro .modal-ov [style*="color:#3"]:not([style*="-color:#3"]),
html.qn-escuro #app [style*="color:#000"],html.qn-escuro #app [style*="color:black"]{color:#e8f1ff!important}
html.qn-escuro #app [style*="color:#4"]:not([style*="-color:#4"]),html.qn-escuro .modal-ov [style*="color:#4"]:not([style*="-color:#4"]),
html.qn-escuro #app [style*="color:#5"]:not([style*="-color:#5"]),html.qn-escuro .modal-ov [style*="color:#5"]:not([style*="-color:#5"]),
html.qn-escuro #app [style*="color:#6"]:not([style*="-color:#6"]),html.qn-escuro .modal-ov [style*="color:#6"]:not([style*="-color:#6"]),
html.qn-escuro #app [style*="color:#7"]:not([style*="-color:#7"]),html.qn-escuro .modal-ov [style*="color:#7"]:not([style*="-color:#7"]),
html.qn-escuro #app [style*="color:#888"],html.qn-escuro #app [style*="color:#999"]{color:rgba(205,222,255,.72)!important}
/* azuis, verdes, vermelhos e amarelos escuros ganham versão clara */
html.qn-escuro #app [style*="color:#003087"],html.qn-escuro #app [style*="color:#0057B8"],html.qn-escuro #app [style*="color:#0057b8"],html.qn-escuro #app [style*="color:#0c447c"],html.qn-escuro #app [style*="color:#1a4a8a"],html.qn-escuro #app [style*="color:#1d4ed8"],html.qn-escuro #app [style*="color:#1e40af"],html.qn-escuro #app [style*="color:#2563eb"],
html.qn-escuro .modal-ov [style*="color:#003087"],html.qn-escuro .modal-ov [style*="color:#0057B8"],html.qn-escuro .modal-ov [style*="color:#0057b8"],html.qn-escuro .modal-ov [style*="color:#1d4ed8"]{color:#8fc8ff!important}
html.qn-escuro #app [style*="color:#1a7a42"],html.qn-escuro #app [style*="color:#1e7e4a"],html.qn-escuro #app [style*="color:#166534"],html.qn-escuro #app [style*="color:#15803d"],html.qn-escuro #app [style*="color:#27ae60"],html.qn-escuro #app [style*="color:#16a34a"],html.qn-escuro #app [style*="color:#065f46"],
html.qn-escuro .modal-ov [style*="color:#1a7a42"],html.qn-escuro .modal-ov [style*="color:#1e7e4a"],html.qn-escuro .modal-ov [style*="color:#166534"],html.qn-escuro .modal-ov [style*="color:#27ae60"]{color:#6ee7a5!important}
html.qn-escuro #app [style*="color:#9a1a1a"],html.qn-escuro #app [style*="color:#991b1b"],html.qn-escuro #app [style*="color:#b91c1c"],html.qn-escuro #app [style*="color:#c0392b"],html.qn-escuro #app [style*="color:#dc2626"],html.qn-escuro #app [style*="color:#7f1d1d"],
html.qn-escuro .modal-ov [style*="color:#9a1a1a"],html.qn-escuro .modal-ov [style*="color:#c0392b"],html.qn-escuro .modal-ov [style*="color:#b91c1c"],html.qn-escuro .modal-ov [style*="color:#dc2626"]{color:#ff8f86!important}
html.qn-escuro #app [style*="color:#9a5700"],html.qn-escuro #app [style*="color:#b45309"],html.qn-escuro #app [style*="color:#92400e"],html.qn-escuro #app [style*="color:#854d0e"],html.qn-escuro #app [style*="color:#5a4000"],html.qn-escuro #app [style*="color:#7a5c00"],html.qn-escuro #app [style*="color:#e67e22"],
html.qn-escuro .modal-ov [style*="color:#9a5700"],html.qn-escuro .modal-ov [style*="color:#b45309"],html.qn-escuro .modal-ov [style*="color:#92400e"]{color:#fcc565!important}
html.qn-escuro #app [style*="color:#3c3489"],html.qn-escuro #app [style*="color:#5a1a8a"],html.qn-escuro #app [style*="color:#5b21b6"]{color:#c4b8ff!important}
/* botões com fundo forte continuam com texto branco */
html.qn-escuro #app [style*="background:#003087"],html.qn-escuro #app [style*="background:#0057B8"],html.qn-escuro #app [style*="background:#112240"],
html.qn-escuro #app [style*="background:#e24b4a"],html.qn-escuro #app [style*="background:#dc2626"],html.qn-escuro #app [style*="background:#c0392b"],html.qn-escuro #app [style*="background:#27ae60"]{color:#fff}
/* bordas claras fixas */
html.qn-escuro #app [style*="border:1px solid #e"],html.qn-escuro #app [style*="border:1.5px solid #e"],html.qn-escuro #app [style*="border:1px solid #d"],html.qn-escuro #app [style*="border-bottom:1px solid #e"],html.qn-escuro #app [style*="border-top:1px solid #e"]{border-color:rgba(140,190,255,.18)!important}

/* botão "Instalar app" no azul do tema */
html.qn-azul #qn-install{background:linear-gradient(90deg,#0a5fd0,#0579c2);box-shadow:0 10px 26px -10px #00c2ff}
html.qn-azul #qn-ios b{color:#0057B8}html.qn-azul #qn-ios button{background:#0057B8}

/* ---------- Busca rápida (Ctrl+K) ---------- */
#qn-cmdk{position:fixed;inset:0;z-index:2000;background:rgba(1,10,32,.55);backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px);display:none;align-items:flex-start;justify-content:center;padding:max(80px,12vh) 16px 16px}
#qn-cmdk.open{display:flex}
#qn-cmdk .qn-box{width:min(560px,100%);border-radius:18px;padding:12px;background:#0b1d42;border:1px solid rgba(140,190,255,.2);box-shadow:0 30px 80px -20px rgba(0,0,0,.7);display:flex;flex-direction:column;gap:6px}
html.qn-claro #qn-cmdk .qn-box{background:#fff;border-color:#d6e0ee}
#qn-cmdk input{width:100%;font:500 16px var(--qn-font);padding:12px 14px;border-radius:12px;border:1px solid rgba(140,190,255,.25);background:rgba(255,255,255,.06);color:var(--qn-text);outline:none}
html.qn-claro #qn-cmdk input{background:#f4f7fc;color:#0b1f45;border-color:#d6e0ee}
#qn-cmdk .qn-res{max-height:min(380px,60vh);overflow:auto;display:flex;flex-direction:column;gap:2px}
#qn-cmdk .qn-r{display:flex;align-items:center;gap:11px;padding:10px 12px;border-radius:11px;color:var(--qn-text);font-size:14px;cursor:pointer}
#qn-cmdk .qn-r i{font-size:18px;color:var(--qn-acc2)}
#qn-cmdk .qn-r small{margin-left:auto;color:var(--qn-mute);font-size:11px;text-transform:uppercase;letter-spacing:.08em}
#qn-cmdk .qn-r.sel,#qn-cmdk .qn-r:hover{background:var(--qn-hi)}
#qn-cmdk .qn-empty{padding:12px;color:var(--qn-mute);font-size:13px}

/* ---------- Barra de baixo do celular ---------- */
#qn-tabbar,#qn-fabmenu{display:none}
@media (max-width:900px){
  html.qn-azul .main{margin-left:0;padding-right:0}
  html.qn-azul .topbar{margin:8px 8px 0;top:8px;border-radius:16px;padding:8px 10px;padding-top:max(8px,env(safe-area-inset-top));flex-wrap:nowrap}
  html.qn-azul .topbar-title{font-size:16px}
  html.qn-azul .topbar-title::before{display:none}
  html.qn-azul .topbar-actions{width:auto;flex:0 0 auto;overflow:visible}
  html.qn-azul .topbar-actions > .btn-o,html.qn-azul .topbar-actions > .btn-p,html.qn-azul .topbar-actions > #emailjs-status,
  html.qn-azul .topbar-actions > .qn-user-chip,html.qn-azul .topbar-actions > .qn-tb-busca{display:none!important}
  html.qn-azul .topbar-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block}
  html.qn-azul .stats-grid > .stat-card:first-child{grid-column:1/-1}
  html.qn-azul #qn-install{bottom:calc(94px + env(safe-area-inset-bottom));right:14px;padding:9px 14px;font-size:13px}
  html.qn-azul #qn-ios{bottom:calc(94px + env(safe-area-inset-bottom))}
  body.qn-nav-open #qn-install{display:none!important}
  html.qn-azul #qn-menu-btn{display:none!important}
  html.qn-azul .content{padding:12px 10px calc(104px + env(safe-area-inset-bottom))}

  /* o menu vira uma gaveta que sobe de baixo */
  html.qn-azul .sidebar{top:auto;left:0;right:0;bottom:0;width:100%!important;height:86vh;height:86dvh;border-radius:26px 26px 0 0;
    transform:translateY(105%);background:var(--qn-glass2);backdrop-filter:blur(26px) saturate(150%);-webkit-backdrop-filter:blur(26px) saturate(150%);
    padding-bottom:env(safe-area-inset-bottom);overflow:hidden;box-shadow:none}
  html.qn-claro .sidebar{background:rgba(0,48,135,.97)}
  html.qn-azul body.qn-nav-open .sidebar{transform:none;box-shadow:0 -20px 60px rgba(0,0,0,.45)}
  html.qn-azul .sidebar::before{content:"";display:block;width:42px;height:5px;border-radius:9px;background:rgba(255,255,255,.35);margin:9px auto 0;flex-shrink:0}
  html.qn-azul .sidebar-logo{padding:8px 16px 10px}
  html.qn-azul .sidebar-brand{display:none}
  html.qn-azul .nav-item{padding:13px 14px;font-size:15px}
  html.qn-azul .nav-sec.qn-gh{padding:14px 10px 8px;font-size:11px}
  html.qn-azul .qn-sb-search{margin:8px 14px 4px;padding:12px 14px;font-size:15px}
  html.qn-azul .qn-sb-search kbd{display:none}
  .qn-collapse{display:none}
  #qn-nav-ov{background:rgba(1,10,32,.55)!important}

  #qn-tabbar{display:flex;position:fixed;left:10px;right:10px;bottom:calc(10px + env(safe-area-inset-bottom));z-index:280;
    justify-content:space-around;align-items:center;padding:7px 6px;border-radius:24px;
    background:var(--qn-glass2);border:1px solid var(--qn-stroke);backdrop-filter:blur(22px) saturate(150%);-webkit-backdrop-filter:blur(22px) saturate(150%);
    box-shadow:0 16px 40px -14px rgba(0,0,0,.55)}
  body.qn-nav-open #qn-tabbar{display:none}
  .qn-tab{display:flex;flex-direction:column;align-items:center;gap:2px;min-width:58px;padding:5px 2px;border:0;background:none;color:var(--qn-mute);font:600 10.5px var(--qn-font);cursor:pointer;-webkit-tap-highlight-color:transparent}
  .qn-tab i{font-size:23px}
  .qn-tab.on{color:var(--qn-acc2)}
  html.qn-claro .qn-tab.on{color:var(--qn-acc)}
  .qn-tab[hidden]{display:none}
  .qn-fab{width:54px;height:54px;border-radius:18px;margin-top:-28px;border:0;display:flex;align-items:center;justify-content:center;color:#fff;cursor:pointer;
    background:linear-gradient(135deg,#1e90ff,#00c2ff);box-shadow:0 12px 26px -8px #00c2ff;-webkit-tap-highlight-color:transparent}
  .qn-fab i{font-size:26px;transition:transform .2s}
  .qn-fab.open i{transform:rotate(45deg)}
  #qn-fabmenu{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(92px + env(safe-area-inset-bottom));z-index:285;width:min(280px,calc(100vw - 32px));
    flex-direction:column;gap:4px;padding:8px;border-radius:18px;background:var(--qn-glass2);border:1px solid var(--qn-stroke);
    backdrop-filter:blur(22px);-webkit-backdrop-filter:blur(22px);box-shadow:0 20px 50px -14px rgba(0,0,0,.6)}
  #qn-fabmenu.open{display:flex}
  #qn-fabmenu button{display:flex;align-items:center;gap:12px;padding:14px;border:0;border-radius:12px;background:transparent;color:var(--qn-text);font:600 15px var(--qn-font);text-align:left;cursor:pointer}
  #qn-fabmenu button i{font-size:20px;color:var(--qn-acc2)}
  #qn-fabmenu button:active{background:var(--qn-hi)}
  #toast{bottom:calc(96px + env(safe-area-inset-bottom))!important}
}

/* ---------- Tabelas viram cartões no celular ---------- */
@media (max-width:600px){
  html.qn-azul table.qn-cards,html.qn-azul table.qn-cards tbody{display:block;width:100%;overflow:visible}
  html.qn-azul table.qn-cards thead{display:none}
  html.qn-azul table.qn-cards tr{display:block;margin:0 0 10px;padding:10px 12px;border-radius:14px;background:var(--qn-glass);border:1px solid var(--qn-stroke)}
  html.qn-azul table.qn-cards td{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:6px 0;border:0;text-align:right;min-width:0;white-space:normal;word-break:break-word}
  html.qn-azul table.qn-cards td::before{content:attr(data-label);flex-shrink:0;max-width:45%;text-align:left;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--ts)}
  html.qn-azul table.qn-cards td[data-label=""]::before{display:none}
  html.qn-azul table.qn-cards td:first-child{font-weight:600;font-size:14px}
  html.qn-azul table.qn-cards td[colspan]{display:block;text-align:center}
  html.qn-azul table.qn-cards td[colspan]::before{display:none}
  html.qn-azul table.qn-cards tr:hover td{background:none}
}

@media (prefers-reduced-motion:reduce){
  html.qn-azul *{transition:none!important}
}

/* ---------- Letras um pouco maiores para leitura ---------- */
html.qn-azul .fg label{font-size:12px;letter-spacing:.4px}
html.qn-azul .stat-lbl{font-size:13px}
html.qn-azul .stat-badge,html.qn-azul .sp,html.qn-azul .dc,html.qn-azul .rb{font-size:12px}
html.qn-azul table{font-size:13.5px}
html.qn-azul .a-sub,html.qn-azul .lbl,html.qn-azul .prog-lbl{font-size:12.5px}
html.qn-azul .nav-sec.qn-gh{font-size:11px}
html.qn-azul .step-lbl{font-size:11px}
html.qn-azul .sidebar-brand .bl{font-size:10px}

/* ---------- Enquadramento das janelas (modais) ---------- */
html.qn-escuro{--gb1:rgba(255,255,255,.06)}
html.qn-azul .modal-box{box-sizing:border-box;width:min(640px,calc(100vw - 32px));max-height:calc(100vh - 40px);max-height:calc(100dvh - 40px);overflow-x:hidden;overflow-y:auto;padding:0 24px 24px;overscroll-behavior:contain}
html.qn-azul .modal-box.wide{width:min(820px,calc(100vw - 32px))}
html.qn-azul .modal-box *,html.qn-azul [id^="m-"][style*="position:fixed"] > div *{box-sizing:border-box}
html.qn-azul .modal-hdr{position:sticky;top:0;z-index:5;margin:0 -24px 18px;padding:18px 24px 14px;background:inherit;border-bottom:1px solid var(--gb2);border-radius:20px 20px 0 0}
html.qn-escuro .modal-hdr{background:#0b1d42}
html.qn-claro .modal-hdr{background:#fff}
html.qn-azul .modal-hdr h3{display:flex;align-items:center;gap:6px;min-width:0;line-height:1.3}
html.qn-azul .modal-close{flex-shrink:0;width:38px;height:38px;border-radius:11px;display:inline-flex;align-items:center;justify-content:center}
html.qn-azul .modal-close:hover{background:var(--bp)}
/* nada empurra a janela para os lados */
html.qn-azul .modal-box .form-grid > *,html.qn-azul .modal-box .two-col > *,html.qn-azul .modal-box .three-col > *,
html.qn-azul .modal-box .fg,html.qn-azul [id^="m-"][style*="position:fixed"] .fg{min-width:0}
html.qn-azul .modal-box input:not([type=checkbox]):not([type=radio]),html.qn-azul .modal-box select,html.qn-azul .modal-box textarea,
html.qn-azul [id^="m-"][style*="position:fixed"] input:not([type=checkbox]):not([type=radio]),
html.qn-azul [id^="m-"][style*="position:fixed"] select,html.qn-azul [id^="m-"][style*="position:fixed"] textarea{max-width:100%;min-width:0}
html.qn-azul .modal-box .fg input:not([type=checkbox]):not([type=radio]),html.qn-azul .modal-box .fg select,html.qn-azul .modal-box .fg textarea{width:100%}
html.qn-azul .modal-box img,html.qn-azul .modal-box iframe,html.qn-azul .modal-box canvas{max-width:100%}
html.qn-azul .modal-box table{display:block;max-width:100%;overflow-x:auto}
html.qn-azul .modal-box .fg label{line-height:1.35}
html.qn-azul .modal-box > div:last-child[style*="display:flex"]:has(> button){position:sticky;bottom:-24px;z-index:4;margin:16px -24px -24px!important;padding:14px 24px;background:inherit;border-top:1px solid var(--gb2)}
html.qn-escuro .modal-box > div:last-child[style*="display:flex"]:has(> button){background:#0b1d42}
html.qn-claro .modal-box > div:last-child[style*="display:flex"]:has(> button){background:#fff}
@media (max-width:900px){
  html.qn-azul .modal-box,html.qn-azul .modal-box.wide{width:100%!important;max-height:94vh;max-height:94dvh;padding:0 16px calc(16px + env(safe-area-inset-bottom))}
  html.qn-azul .modal-hdr{margin:0 -16px 14px;padding:14px 16px 12px;border-radius:16px 16px 0 0}
  html.qn-azul .modal-box > div:last-child[style*="display:flex"]:has(> button){margin:14px -16px calc(-16px - env(safe-area-inset-bottom))!important;padding:12px 16px calc(12px + env(safe-area-inset-bottom));bottom:calc(-16px - env(safe-area-inset-bottom))}
}
@media (max-width:600px){
  html.qn-azul .modal-box .form-grid{grid-template-columns:1fr}
  html.qn-azul .modal-box .fg.span2{grid-column:auto}
}
html.qn-azul .modal-ov{z-index:400}
body:has(.modal-ov.open) #qn-tabbar,body:has(.modal-ov.open) #qn-fabmenu,body:has(.modal-ov.open) #qn-install{display:none!important}

/* ---------- Tabelas: colunas de ações alinhadas com a linha ---------- */
html.qn-azul td{vertical-align:middle}
@media (min-width:601px){
  html.qn-azul td[style*="display:flex"]{display:table-cell!important;white-space:nowrap}
  html.qn-azul td[style*="display:flex"] > *{vertical-align:middle}
  html.qn-azul td[style*="display:flex"] > * + *{margin-left:4px}
}

/* ---------- Barra do topo sempre em uma linha ---------- */
@media (min-width:901px){
  html.qn-azul .topbar{flex-wrap:nowrap}
  html.qn-azul .topbar-title{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1 1 auto;display:block}
  html.qn-azul .topbar-actions{flex-wrap:nowrap;flex-shrink:0}
  html.qn-azul .topbar-actions > *{flex-shrink:0;white-space:nowrap}
}
@media (min-width:901px) and (max-width:1500px){
  html.qn-azul .topbar-actions > .qn-user-chip{display:none!important}
}
@media (min-width:901px) and (max-width:1150px){
  html.qn-azul .topbar-title::before{display:none}
  html.qn-azul .topbar-actions > #emailjs-status span{display:none}
}
html.qn-azul .topbar-title::before{margin-right:6px}
