:root{
  --bg:#0b1220;
  --card:#111a2e;
  --muted:#a7b0c0;
  --text:#e9eef7;
  --line:rgba(255,255,255,.08);
  --primary:#4f7cff;
  --danger:#ff5a6a;
  --ok:#36d399;
}

*{box-sizing:border-box}
body{margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial;color:var(--text)}
a{color:inherit;text-decoration:none}
.bg{background:linear-gradient(180deg,#0b1220,#070b14);min-height:100vh;display:flex;align-items:center;justify-content:center;padding:16px}

/* ✅ garante que hidden SEMPRE esconda (útil pro submenu) */
[hidden]{display:none !important;}

.auth-container{width:100%;max-width:420px}
.card{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:20px;box-shadow:0 12px 30px rgba(0,0,0,.35)}
.card-header h1{margin:0;font-size:22px}
.card-header p{margin:6px 0 16px;color:var(--muted);font-size:14px}

.form{display:flex;flex-direction:column;gap:10px}
label{font-size:13px;color:var(--muted)}
input:not([type="checkbox"]):not([type="radio"]){width:100%;padding:12px;border-radius:12px;border:1px solid var(--line);background:#0c1427;color:var(--text);outline:none}
input:not([type="checkbox"]):not([type="radio"]):focus{border-color:rgba(79,124,255,.6)}
select,textarea{width:100%;padding:12px;border-radius:12px;border:1px solid var(--line);background:#0c1427;color:var(--text);outline:none;min-height:46px}
select:focus,textarea:focus{border-color:rgba(79,124,255,.6)}
select{
  -webkit-appearance:none;
  appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a7b0c0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 12px center;
  padding-right:42px;
}

.btn{padding:10px 14px;border-radius:12px;border:1px solid var(--line);background:transparent;color:var(--text);cursor:pointer}
.btn.primary{background:var(--primary);border-color:transparent;font-weight:600}
.btn:hover{filter:brightness(1.05)}

.alert{padding:10px 12px;border-radius:12px;margin-bottom:10px;border:1px solid var(--line);font-size:14px}
.alert-error{background:rgba(255,90,106,.08);border-color:rgba(255,90,106,.35)}
.alert-success{background:rgba(54,211,153,.08);border-color:rgba(54,211,153,.35)}
.hint{margin-top:10px;color:var(--muted);font-size:12px}

.dash{background:#070b14;display:flex;min-height:100vh}

/* ===== Sidebar (desktop) ===== */
.sidebar{
  width:260px;
  background:#0b1220;
  border-right:1px solid var(--line);
  padding:16px;
  position:sticky;
  top:0;
  height:100vh;
  overflow-y:auto;
  overflow-x:hidden;
  scrollbar-gutter:auto;
  -ms-overflow-style:none !important;
  scrollbar-width:none !important;
}
.sidebar::-webkit-scrollbar{width:0 !important;height:0 !important;display:none !important;}
.sidebar::-webkit-scrollbar-track,.sidebar::-webkit-scrollbar-thumb{background:transparent !important;}
.brand{font-weight:800;letter-spacing:.4px;margin-bottom:14px}

/* =========================================================
   NAV (BASE)  ✅ AQUI ESTÁ O FIX DO "CADASTRO" BRANCO
========================================================= */

.nav{
  display:flex;
  flex-direction:column;
  gap:10px;
}

/* Base visual para qualquer item do menu (a e button) */
.sidebar .nav .nav-item{
  display:flex;
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  align-items:center;

  color:var(--muted);
  background:transparent;
  background-color:transparent;
  border:1px solid transparent;
}

/* Hover e Active consistentes */
.sidebar .nav .nav-item:hover{
  background:rgba(255,255,255,.04);
  background-color:rgba(255,255,255,.04);
  color:var(--text);
}
.sidebar .nav .nav-item.active{
  background:rgba(79,124,255,.12);
  background-color:rgba(79,124,255,.12);
  border-color:rgba(79,124,255,.25);
  color:var(--text);
}

/* ✅ RESET TOTAL do estilo nativo de button (isso remove o "branco") */
.sidebar .nav button.nav-item{
  -webkit-appearance:none !important;
  appearance:none !important;

  background:none !important;
  background-color:transparent !important;
  background-image:none !important;

  border:1px solid transparent !important;
  box-shadow:none !important;
  outline:none !important;

  font:inherit;
  text-align:left;
  cursor:pointer;

  padding:10px 12px;        /* garante igual aos links */
  border-radius:12px;       /* garante igual aos links */
  color:var(--muted) !important;
}

/* foco sem “pintura” */
.sidebar .nav button.nav-item:focus,
.sidebar .nav button.nav-item:focus-visible{
  outline:none !important;
  box-shadow:none !important;
}

/* ===== Dropdown Cadastro ===== */

.nav-group{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.nav-toggle{
  justify-content:space-between;
}

.nav-chev{
  width:18px;
  height:18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.nav-chev::before{
  content:"▾";
  color:var(--muted);
  font-weight:900;
  transition:transform .18s ease;
}
.nav-group.is-open .nav-chev::before{
  transform:rotate(180deg);
}

/* (mantive do seu jeito: fechado por padrão e abre com .is-open) */
.nav-sub{
  display:none !important;
  flex-direction:column;
  gap:10px;
  margin-left:10px;
  padding:10px 0 10px 12px;
  border-left:1px solid rgba(255,255,255,.10);
}
.nav-group.is-open .nav-sub{
  display:flex !important;
}

/* itens do submenu */
.nav-sub-item{
  background:rgba(255,255,255,.03);
}
.nav-sub-item:hover{
  background:rgba(255,255,255,.06);
  color:var(--text);
}
.nav-sub-item.active{
  background:rgba(79,124,255,.14);
  box-shadow:inset 0 0 0 1px rgba(79,124,255,.28);
  border-color:transparent;
  color:var(--text);
}

/* ========================================================= */

.sidebar-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:14px;
}

/* ===== Mobile header + botões ===== */
.icon-btn{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.02);
  color:var(--text);
  cursor:pointer;
  line-height:1;
}
.icon-btn:hover{filter:brightness(1.05)}

.mobile-title{
  font-weight:700;
  color:var(--text);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* trava scroll quando menu aberto */
.no-scroll{overflow:hidden}

.content{flex:1;padding:18px;max-width:1200px;margin:0 auto;width:100%}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px;flex-wrap:wrap}
.topbar h2{margin:0}
.topbar small{color:var(--muted)}
.grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:14px 0}
.kpi{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:16px}
.kpi-title{color:var(--muted);font-size:13px}
.kpi-value{font-size:26px;font-weight:800;margin-top:6px}
.kpi-sub{color:var(--muted);font-size:12px;margin-top:6px}
.card-box{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:16px;margin-top:12px}

/* ===== KPI GRID RESPONSIVA (melhor no mobile) ===== */
.grid.grid-4{grid-template-columns:repeat(4,minmax(0,1fr))}

/* Evita texto vazando do card */
.kpi,.kpi-title,.kpi-value,.kpi-sub{min-width:0}
.kpi-title,.kpi-sub{overflow-wrap:anywhere;word-break:break-word}
.kpi-value{overflow-wrap:anywhere}

@media (max-width: 1080px){
  .grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .grid.grid-4{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width: 560px){
  .grid{grid-template-columns:1fr}
  .grid.grid-4{grid-template-columns:1fr}
  .kpi{padding:14px}
  .kpi-value{font-size:22px}
}

.table{width:100%;border-collapse:collapse;margin-top:10px;min-width:760px}
.table th,.table td{padding:10px;border-bottom:1px solid var(--line);text-align:left}
.table th{color:var(--muted);font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.4px}
.table td{font-size:14px}

select, textarea{
  width:100%;
  padding:12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#0c1427;
  color:var(--text);
  outline:none;
}
textarea{resize:vertical}

.row{display:flex;gap:10px;flex-wrap:wrap}
.col{flex:1;min-width:220px}

.field-error{margin-top:6px;color:var(--danger);font-size:12px}
.btn.danger{background:rgba(255,90,106,.12);border-color:rgba(255,90,106,.35)}

/* =========================================================
   NAV / SIDEBAR RESPONSIVA (MOBILE)
========================================================= */

.mobile-header { display:none !important; }
#sidebarToggle { display:none; }

.mobile-header{
  position:fixed;
  top:0; left:0; right:0;
  height:60px;
  z-index:1400;
  padding:10px 14px;
  display:flex !important;
  align-items:center;
  justify-content:space-between;
  gap:12px;

  background:rgba(11,18,32,.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom:1px solid rgba(255,255,255,.08);
}

.mobile-left{display:flex;align-items:center}
.mobile-center{display:flex;align-items:center;justify-content:center;flex:1}
.mobile-right{width:40px;display:flex;justify-content:flex-end}

.mobile-brand{
  font-weight:800;
  letter-spacing:.4px;
  font-size:14px;
  color:#e9eef7;
  opacity:.95;
}

/* HAMBURGUER BONITO */
.toggle {
  position: relative;
  width: 42px;
  height: 42px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition-duration: .5s;

  border:1px solid rgba(255,255,255,.10);
  border-radius:14px;
  background:rgba(255,255,255,.03);
}

.bars {
  width: 100%;
  height: 4px;
  background-color: rgb(176, 92, 255);
  border-radius: 4px;
}

#bar2 { transition-duration: .8s; }
#bar1,#bar3 { width: 70%; }

#sidebarToggle:checked + .toggle .bars {
  position: absolute;
  transition-duration: .5s;
}
#sidebarToggle:checked + .toggle #bar2 {
  transform: scaleX(0);
  transition-duration: .5s;
}
#sidebarToggle:checked + .toggle #bar1 {
  width: 100%;
  transform: rotate(45deg);
  transition-duration: .5s;
}
#sidebarToggle:checked + .toggle #bar3 {
  width: 100%;
  transform: rotate(-45deg);
  transition-duration: .5s;
}
#sidebarToggle:checked + .toggle {
  transition-duration: .5s;
  transform: rotate(180deg);
}

/* Overlay */
.sidebar-backdrop{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.55);
  z-index:1300;
}
.sidebar-backdrop.show{display:block}

/* Botão fechar dentro do menu (mobile) */
.sidebar-close{
  display:none;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.03);
  color:#e9eef7;
  border-radius:12px;
  padding:8px 10px;
  cursor:pointer;
}

/* MOBILE BREAKPOINT */
@media (max-width: 920px){
  .mobile-header{ display:flex !important; }

  .sidebar{
    position:fixed;
    top:0;
    left:0;
    height:100vh;
    z-index:1350;
    width:86%;
    max-width:320px;
    transform:translateX(-110%);
    transition:transform .22s ease;
    box-shadow:0 18px 45px rgba(0,0,0,.55);
  }
  .sidebar.open{ transform:translateX(0); }

  .sidebar-close{ display:inline-flex; }
  .dash .content{ padding-top:78px; }
}

/* DESKTOP */
@media (min-width: 921px){
  .mobile-header{ display:none !important; }
  .sidebar-backdrop{ display:none !important; }
  .sidebar{ transform:none !important; position:sticky; top:0; height:100vh; }
  body.no-scroll{ overflow:auto; }
}

/* =========================================================
   AÇÕES (dropdown no lugar de vários botões)
========================================================= */
.actions-dropdown{position:relative;display:inline-block}
.actions-dropdown > summary{list-style:none}
.actions-dropdown > summary::-webkit-details-marker{display:none}
.actions-menu{
  position:absolute;
  right:0;
  top:calc(100% + 8px);
  min-width:190px;
  background:#0c1427;
  border:1px solid var(--line);
  border-radius:14px;
  padding:6px;
  box-shadow:0 18px 30px rgba(0,0,0,.35);
  z-index:60;
  display:flex;
  flex-direction:column;
  gap:4px;
}
.actions-item{
  display:block;
  padding:10px 10px;
  border-radius:12px;
  color:var(--text);
  border:1px solid transparent;
  background:transparent;
  text-align:left;
  font-size:14px;
  cursor:pointer;
}
.actions-item:hover{background:rgba(255,255,255,.05);border-color:rgba(255,255,255,.06)}
.actions-item.danger{color:#ff8895}
.actions-item.danger:hover{background:rgba(255,90,106,.12);border-color:rgba(255,90,106,.35)}
.actions-menu form{margin:0}

.os-table-wrap{
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}

/* alias genérico */
.table-wrap{ overflow-x:auto; -webkit-overflow-scrolling:touch; }
.os-table-wrap .actions-menu{
  z-index: 9999;
}

.btn.tiny{
  padding:8px 10px;
  border-radius:12px;
  font-size:13px;
  line-height:1;
}

/* ===== Cards de OS (mobile) ===== */
.os-cards{
  margin-top:12px;
  display:grid;
  gap:12px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.os-card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:16px;
  overflow:hidden;
}

.os-field{
  padding:10px 12px;
  border-bottom:1px solid var(--line);
}
.os-field-last{ border-bottom:0; }

.os-k{
  color:var(--muted);
  font-size:12px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.35px;
}
.os-v{
  margin-top:4px;
  font-size:14px;
  font-weight:700;
}
.os-sub{
  margin-top:3px;
  color:var(--muted);
  font-size:12px;
  font-weight:600;
}

.os-actions-title{
  padding:10px 12px;
  border-top:1px solid var(--line);
  color:var(--muted);
  font-size:12px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.35px;
}

.os-actions{
  padding:12px;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}
.os-actions .btn{ width:100%; text-align:center; }
.os-actions-full{ grid-column:1 / -1; margin:0; }
.os-actions-full .btn{ width:100%; }

.btn.sm{
  padding:9px 10px;
  border-radius:12px;
  font-size:13px;
  line-height:1;
}

.pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  font-size:12px;
  font-weight:700;
}
.pill.ok{ background: rgba(54,211,153,.12); color: var(--ok); }
.pill.warn{ background: rgba(255,90,106,.12); color: var(--danger); }
.pill.neutral{ background: rgba(255,255,255,.06); color: var(--muted); }

/* Active do botão "Cadastro" igual aos links */
.sidebar .nav button.nav-item.nav-toggle.active{
  background: rgba(79,124,255,.12) !important;
  background-color: rgba(79,124,255,.12) !important;
  border-color: rgba(79,124,255,.25) !important;
  color: var(--text) !important;
}

/* ===== FIX: destacar "Cadastro" quando estiver em páginas do grupo ===== */
aside.sidebar nav.nav .nav-group.is-current > button.nav-item.nav-toggle,
aside.sidebar nav.nav .nav-group[data-nav-group="cadastro"] > button.nav-item.nav-toggle.active{
  background: rgba(79,124,255,.12) !important;
  background-color: rgba(79,124,255,.12) !important;
  border-color: rgba(79,124,255,.25) !important;
  color: var(--text) !important;
}



.content-wide{max-width:1400px}
.grid.grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.grid.grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}
@media (max-width:1080px){.grid.grid-3,.grid.grid-2{grid-template-columns:1fr}}

.toolbar-card{position:relative;overflow:visible;background:var(--card);border:1px solid var(--line);border-radius:16px}
.toolbar-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;align-items:end}
.compact-toolbar{grid-template-columns:repeat(auto-fit,minmax(180px,240px))}
.toolbar-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.toolbar-grid > div{min-width:0}
.toolbar-grid label{display:block;margin-bottom:6px;color:var(--muted)}
.toolbar-card .btn{white-space:nowrap}

.toolbar-card{overflow:hidden}
.toolbar-card form{margin:0}
.toolbar-grid select,.toolbar-grid input{display:block}

.tiny-muted{color:var(--muted);font-size:12px;line-height:1.45}
.section-title-row{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.dashboard-panels{margin-top:12px}

.alert-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
@media (max-width:720px){.alert-grid{grid-template-columns:1fr}}
.alert-tile{border:1px solid var(--line);border-radius:16px;padding:14px;background:rgba(255,255,255,.02)}
.alert-tile.warn{background:rgba(255,193,7,.08);border-color:rgba(255,193,7,.22)}
.alert-tile.danger{background:rgba(255,90,106,.10);border-color:rgba(255,90,106,.24)}
.alert-tile.ok{background:rgba(54,211,153,.08);border-color:rgba(54,211,153,.22)}
.alert-tile.info{background:rgba(79,124,255,.08);border-color:rgba(79,124,255,.24)}
.alert-tile-title{font-size:13px;color:var(--muted)}
.alert-tile-value{font-size:24px;font-weight:800;margin-top:6px}
.alert-tile-sub{font-size:12px;color:var(--muted);margin-top:6px}

.mini-list{display:flex;flex-direction:column;gap:10px;margin-top:12px}
.mini-item{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;padding:12px;border:1px solid var(--line);border-radius:14px;background:rgba(255,255,255,.02)}
.mini-right{display:flex;flex-direction:column;align-items:flex-end;gap:6px;text-align:right}
.mini-sub{color:var(--muted);font-size:12px;line-height:1.45}
.mini-empty{padding:12px;border:1px dashed var(--line);border-radius:14px;color:var(--muted)}
.compact-list .mini-item{padding:10px 12px}

.compare-chart{display:flex;flex-direction:column;gap:10px;margin-top:12px}
.compare-row{display:grid;grid-template-columns:72px 1fr 220px;gap:12px;align-items:center}
.compare-label{font-size:12px;color:var(--muted);font-weight:700}
.compare-bars{display:flex;flex-direction:column;gap:8px}
.bar-track{position:relative;height:10px;border-radius:999px;background:rgba(255,255,255,.06);overflow:hidden}
.bar-fill{display:block;height:100%;border-radius:999px}
.bar-fill.income{background:linear-gradient(90deg, rgba(54,211,153,.95), rgba(30,191,129,.95))}
.bar-fill.expense{background:linear-gradient(90deg, rgba(255,90,106,.95), rgba(240,68,91,.95))}
.compare-values{display:grid;grid-template-columns:1fr 1fr;gap:8px;font-size:12px;color:var(--muted)}
@media (max-width:840px){.compare-row{grid-template-columns:1fr;}.compare-values{grid-template-columns:1fr 1fr}}

.report-card{min-height:220px;display:flex;flex-direction:column;justify-content:space-between}
.report-table th,.report-table td{white-space:nowrap}
.shortcut-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px}
.shortcut-card{display:flex;flex-direction:column;gap:6px;padding:14px;border:1px solid var(--line);border-radius:16px;background:rgba(255,255,255,.02)}
.shortcut-card strong{font-size:16px}
.shortcut-card span{font-size:12px;color:var(--muted)}

.pill.ok{background:rgba(54,211,153,.10);border-color:rgba(54,211,153,.22);color:#8df0c6}
.pill.danger{background:rgba(255,90,106,.10);border-color:rgba(255,90,106,.24);color:#ff98a4}

.alert{position:relative;padding-right:44px}
.alert-elevated{box-shadow:0 10px 24px rgba(0,0,0,.20);animation:alertIn .24s ease both}
.alert.is-fading{opacity:0;transform:translateY(-4px);transition:all .24s ease}
.alert-close{position:absolute;right:10px;top:8px;background:transparent;border:0;color:var(--muted);font-size:22px;line-height:1;cursor:pointer}
@keyframes alertIn{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}

.shortcut-modal[hidden]{display:none !important}
.shortcut-modal{position:fixed;inset:0;z-index:1600}
.shortcut-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.58)}
.shortcut-panel{position:relative;z-index:1;max-width:720px;margin:8vh auto 0;padding:18px;border-radius:22px;background:#0c1427;border:1px solid var(--line);box-shadow:0 30px 60px rgba(0,0,0,.45)}
.shortcut-header{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:14px}

.no-print{}
.print-only-block{display:none}
@media print{
  body{background:#fff;color:#111}
  .no-print,.sidebar,.mobile-header,.sidebar-backdrop{display:none !important}
  .print-only-block{display:block !important}
  .dash{display:block;background:#fff}
  .content,.content-wide{max-width:none;width:100%;padding:0}
  .card-box,.kpi,.mini-item,.alert-tile,.shortcut-card{box-shadow:none;background:#fff !important;color:#111;border-color:#ddd}
  .kpi-title,.kpi-sub,.tiny-muted,.mini-sub,.alert-tile-sub,.compare-label,.compare-values{color:#555 !important}
  .table th,.table td{border-color:#ddd;color:#111}
  a{color:#111;text-decoration:none}
}


.toolbar-card{padding:14px 16px;}
.toolbar-card-padded{padding:14px 16px;}
.dashboard-toolbar-grid{grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px;}
.dashboard-toolbar-card .toolbar-actions{justify-content:flex-start;}
.dashboard-visibility-wrap{display:flex;align-items:center;justify-content:center;padding:0 2px 0 0;}
.dashboard-visibility-toggle{--color:#a5a5b0;--size:28px;display:flex;justify-content:center;align-items:center;position:relative;cursor:pointer;font-size:var(--size);user-select:none;fill:var(--color);width:34px;height:34px;border-radius:999px;transition:background .18s ease,fill .18s ease;flex:0 0 auto;}
.dashboard-visibility-toggle:hover{background:rgba(255,255,255,.05);fill:#d6d9e3;}
.dashboard-visibility-toggle .eye,.dashboard-visibility-toggle .eye-slash{position:absolute;animation:keyframes-dashboard-visibility .35s ease;}
.dashboard-visibility-toggle .eye-slash{display:none;}
.dashboard-visibility-toggle input:checked ~ .eye{display:none;}
.dashboard-visibility-toggle input:checked ~ .eye-slash{display:block;}
.dashboard-visibility-toggle input{position:absolute;opacity:0;cursor:pointer;height:0;width:0;}
.dashboard-sensitive{display:inline-block;white-space:nowrap;transition:opacity .18s ease;}
@keyframes keyframes-dashboard-visibility{0%{transform:scale(.2);opacity:0;}50%{transform:scale(1.15);}100%{transform:scale(1);opacity:1;}}

 .kanban-toolbar-grid{grid-template-columns:minmax(320px,1fr) auto;align-items:end;}
.kanban-search-field{min-width:0;}
.kanban-summary-grid{margin-top:12px;}
.kanban-board-wrap{margin-top:12px;overflow-x:auto;padding:2px 4px 8px;}
.kanban-board.kanban-board-grouped{display:grid;grid-template-columns:repeat(4,minmax(340px,1fr));gap:18px;align-items:start;min-width:1460px;}
.kanban-group{background:var(--card);border:2px solid var(--line);border-radius:5px;display:flex;flex-direction:column;min-height:0;box-shadow:4px 4px var(--line);overflow:hidden;align-self:start;}
.kanban-group.single-lane{min-height:0;}
.kanban-group-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:15px 16px 13px;border-bottom:2px solid var(--line);background:#ececec;}
.kanban-group[data-group="intake"] .kanban-group-header{background:#efe7ff;}
.kanban-group[data-group="approval"] .kanban-group-header{background:#fff0cf;}
.kanban-group[data-group="delivery"] .kanban-group-header{background:#dff5e9;}
.kanban-group[data-group="cancelled"] .kanban-group-header{background:#ffe1e1;}
.kanban-group-header h3{margin:0;font-size:18px;line-height:1.25;color:var(--text);}
.kanban-group-header small{display:block;margin-top:4px;color:var(--muted);}
.kanban-column-badge{display:inline-flex;align-items:center;justify-content:center;min-width:38px;height:38px;padding:0 10px;border-radius:999px;border:2px solid var(--line);background:#ffffff;box-shadow:3px 3px var(--line);font-weight:800;color:var(--text);}
.kanban-group-body{display:flex;flex-direction:column;gap:12px;padding:12px;min-height:0;background:rgba(255,255,255,.25);}
.kanban-group-body.single-lane{display:flex;flex-direction:column;}
.kanban-lane{display:flex;flex-direction:column;min-height:0;border:2px solid var(--line);border-radius:5px;background:#f8f8f8;overflow:hidden;align-self:stretch;box-shadow:3px 3px var(--line);}
.kanban-lane-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:13px 14px 11px;border-bottom:2px solid var(--line);background:#f1f1f1;}
.kanban-lane[data-status="aguardando"] .kanban-lane-header{background:#f2eaff;}
.kanban-lane[data-status="analise"] .kanban-lane-header{background:#e6f2ff;}
.kanban-lane[data-status="aprovado"] .kanban-lane-header{background:#fff7dd;}
.kanban-lane[data-status="aguardando_peca"] .kanban-lane-header{background:#ffeccc;}
.kanban-lane[data-status="concluido"] .kanban-lane-header{background:#e2f7ea;}
.kanban-lane[data-status="entregue"] .kanban-lane-header{background:#d3f1e3;}
.kanban-lane[data-status="cancelado"] .kanban-lane-header{background:#ffdede;}
.kanban-lane-header h4{margin:0;font-size:16px;line-height:1.25;color:var(--text);}
.kanban-lane-header small{display:block;margin-top:4px;color:var(--muted);}
.kanban-column-body{display:flex;flex-direction:column;gap:12px;padding:14px;min-height:116px;background:transparent;transition:background .16s ease,border-color .16s ease;overflow:visible;flex:0 0 auto;}
.kanban-column-body.is-over{background:#ece4fb;}
.kanban-empty{padding:16px;border:2px dashed var(--line);border-radius:5px;color:var(--muted);text-align:center;background:#ffffff;}
.hidden{display:none !important;}
.kanban-card{position:relative;border:2px solid var(--line);border-radius:5px;background:#ffffff;padding:14px;display:flex;flex-direction:column;gap:10px;cursor:pointer;box-shadow:4px 4px var(--line);transition:transform .16s ease, box-shadow .16s ease, background .16s ease;}
.kanban-card::before{content:"";position:absolute;left:0;top:0;right:0;height:7px;background:#d9a6ff;border-bottom:2px solid var(--line);}
.kanban-card:hover{transform:translate(1px,1px);box-shadow:3px 3px var(--line);background:#fcfcfc;}
.kanban-card.is-dragging{opacity:.78;transform:rotate(.8deg);box-shadow:2px 2px var(--line);}
.kanban-card[data-card-status="aguardando"]::before{background:#d8c3ff;}
.kanban-card[data-card-status="analise"]::before{background:#bdddff;}
.kanban-card[data-card-status="aprovado"]::before{background:#ffe395;}
.kanban-card[data-card-status="aguardando_peca"]::before{background:#ffd2a0;}
.kanban-card[data-card-status="concluido"]::before{background:#bfeacb;}
.kanban-card[data-card-status="entregue"]::before{background:#8bdebb;}
.kanban-card[data-card-status="cancelado"]::before{background:#ffbaba;}
.kanban-card-top,.kanban-card-bottom,.kanban-card-meta{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;}
.kanban-card-top{padding-top:2px;}
.kanban-card-top strong{font-size:15px;color:var(--text);}
.kanban-card-client{font-size:17px;font-weight:800;line-height:1.3;color:var(--text);}
.kanban-card-problem{color:#4b4b4b;line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
.kanban-card-device{display:flex;flex-direction:column;gap:2px;color:var(--muted);font-size:13px;}
.kanban-card-device span{color:var(--muted);}
.kanban-card-meta{font-size:12px;color:var(--muted);padding-top:2px;justify-content:flex-start;}
.kanban-card-bottom{font-size:13px;color:var(--muted);padding-top:4px;border-top:1px dashed rgba(50,50,50,.22);}
.kanban-card-bottom strong{font-size:18px;color:var(--text);}
.kanban-pill{display:inline-flex;align-items:center;justify-content:center;border-radius:999px;padding:5px 10px;font-size:11px;font-weight:800;border:2px solid var(--line);letter-spacing:.2px;background:#ffffff;color:var(--text);box-shadow:2px 2px var(--line);}
.kanban-pill.ok{background:#e4f8ea;color:#1f6a42;}
.kanban-pill.warn{background:#ffe3e3;color:#8e2d2d;}
.kanban-pill.neutral{background:#f5f5f5;color:#666666;}
.kanban-priority{display:inline-flex;align-items:center;justify-content:center;padding:5px 10px;border-radius:999px;border:2px solid var(--line);box-shadow:2px 2px var(--line);font-size:11px;font-weight:800;line-height:1;color:var(--text);background:#ffffff;}
.kanban-priority.baixa{background:#f1f1f1;}
.kanban-priority.media{background:#e6f2ff;}
.kanban-priority.alta{background:#ffe7bf;}
.kanban-priority.urgente{background:#ffd9d9;}
.kanban-modal{position:fixed;inset:0;z-index:80;display:flex;align-items:center;justify-content:center;padding:20px;}
.kanban-modal-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.28);backdrop-filter:blur(2px);}
.kanban-modal-dialog{position:relative;z-index:1;width:min(560px,100%);background:var(--card);border:2px solid var(--line);border-radius:5px;box-shadow:6px 6px var(--line);overflow:hidden;}
.kanban-modal-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:18px 20px;border-bottom:2px solid var(--line);background:#ececec;}
.kanban-modal-header h3{margin:0 0 4px;font-size:22px;color:var(--text);}
.kanban-modal-header small{color:var(--muted);}
.kanban-modal-body{padding:20px;}
.kanban-modal-info{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:16px;}
.kanban-modal-info div{padding:12px 14px;border:2px solid var(--line);border-radius:5px;background:#ffffff;min-width:0;box-shadow:3px 3px var(--line);}
.kanban-modal-info span{display:block;font-size:12px;color:var(--muted);margin-bottom:6px;}
.kanban-modal-info strong{display:block;line-height:1.45;word-break:break-word;color:var(--text);}
.kanban-modal-full{grid-column:1 / -1;}
.checkbox-row{display:flex;align-items:flex-start;gap:10px;color:var(--text);font-size:14px;}
.checkbox-row input{width:auto;min-width:18px;margin-top:2px;}
.kanban-modal-actions{display:flex;justify-content:flex-end;align-items:center;gap:8px;flex-wrap:wrap;margin-top:8px;}
.kanban-inline-alert{margin-bottom:12px;}

@media (max-width: 900px){
  .kanban-toolbar-grid{grid-template-columns:1fr;}
  .kanban-board.kanban-board-grouped{grid-template-columns:repeat(4,minmax(320px,1fr));min-width:1360px;}
}
@media (max-width: 640px){
  .kanban-modal{padding:12px;}
  .kanban-modal-body,.kanban-modal-header{padding:16px;}
  .kanban-modal-info{grid-template-columns:1fr;}
}

/* ===== Sidebar footer / profile / notifications ===== */
.sidebar{
  display:flex;
  flex-direction:column;
  gap:14px;
  padding-bottom:16px;
  overflow:hidden;
}
.sidebar .nav{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  overflow-x:hidden;
  padding-right:0;
  -ms-overflow-style:none !important;
  scrollbar-width:none !important;
}
.sidebar .nav::-webkit-scrollbar{width:0 !important;height:0 !important;display:none !important;}
.sidebar .nav::-webkit-scrollbar-track,.sidebar .nav::-webkit-scrollbar-thumb{background:transparent !important;}
.sidebar-footer{
  position:relative;
  flex:0 0 auto;
  display:flex;
  flex-direction:column;
  gap:12px;
  padding-top:14px;
  border-top:1px solid rgba(255,255,255,.08);
  background:linear-gradient(180deg,rgba(11,18,32,0),rgba(11,18,32,.96) 28%,rgba(11,18,32,1));
}
.sidebar-footer-actions{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;}
.sidebar-footer-icon{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  height:44px;
  border-radius:14px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.02);
  color:var(--muted);
  transition:background .18s ease,border-color .18s ease,color .18s ease,transform .18s ease;
  cursor:pointer;
}
.sidebar-footer-icon svg{width:20px;height:20px;fill:currentColor;}
.sidebar-footer-icon:hover{background:rgba(255,255,255,.06);color:var(--text);border-color:rgba(79,124,255,.25);transform:translateY(-1px);}
.sidebar-footer-icon.is-active{background:rgba(79,124,255,.12);border-color:rgba(79,124,255,.28);color:var(--text);}
.sidebar-footer-icon.is-disabled{opacity:.45;cursor:not-allowed;pointer-events:none;}
.sidebar-footer-icon.has-alert{color:#ffd76a;}
.sidebar-footer-badge{
  position:absolute;
  top:6px;
  right:6px;
  min-width:18px;
  height:18px;
  padding:0 5px;
  border-radius:999px;
  background:var(--danger);
  color:#fff;
  font-size:10px;
  font-weight:800;
  display:flex;
  align-items:center;
  justify-content:center;
  line-height:1;
}
.sidebar-profile-card{
  border:1px solid var(--line);
  border-radius:18px;
  background:rgba(255,255,255,.03);
  padding:14px;
  display:flex;
  flex-direction:column;
  gap:12px;
}
.sidebar-profile-main{display:flex;align-items:center;gap:12px;min-width:0;}
.sidebar-profile-avatar{
  width:54px;
  height:54px;
  border-radius:50%;
  object-fit:cover;
  border:1px solid rgba(255,255,255,.12);
  background:#111a2e;
  flex:0 0 54px;
}
.sidebar-profile-avatar-fallback{
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:800;
  font-size:18px;
  color:var(--text);
  background:linear-gradient(180deg,rgba(79,124,255,.32),rgba(79,124,255,.12));
}
.sidebar-profile-texts{display:flex;flex-direction:column;gap:2px;min-width:0;}
.sidebar-profile-texts strong,.sidebar-profile-texts span,.sidebar-profile-texts small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.sidebar-profile-texts strong{font-size:16px;color:var(--text);}
.sidebar-profile-texts span{font-size:13px;color:var(--muted);}
.sidebar-profile-texts small{font-size:12px;color:var(--muted);}
.sidebar-logout-btn{width:100%;min-height:44px;}
.sidebar-notification-overlay{
  position:fixed;
  inset:0;
  z-index:58;
  background:rgba(3,8,18,.56);
  backdrop-filter:blur(2px);
}
.sidebar-notification-panel{
  position:fixed;
  top:50%;
  left:50%;
  right:auto;
  transform:translate(-50%, -50%);
  width:min(760px,calc(100vw - 32px));
  max-height:min(82vh,780px);
  z-index:59;
  border:1px solid var(--line);
  border-radius:22px;
  background:#111a2e;
  box-shadow:0 24px 48px rgba(0,0,0,.45);
  overflow:hidden;
}
.sidebar-notification-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:16px 16px 12px;border-bottom:1px solid var(--line);}
.sidebar-notification-head strong{display:block;font-size:16px;}
.sidebar-notification-head small{display:block;margin-top:4px;color:var(--muted);font-size:12px;}
.sidebar-panel-close{width:34px;height:34px;border-radius:12px;border:1px solid var(--line);background:rgba(255,255,255,.02);color:var(--text);cursor:pointer;}
.sidebar-notification-toolbar{display:flex;gap:8px;flex-wrap:wrap;padding:12px 16px;border-bottom:1px solid var(--line);}
.sidebar-notification-empty{padding:18px 16px;color:var(--muted);font-size:13px;line-height:1.6;}
.sidebar-notification-list{max-height:min(62vh,560px);overflow:auto;padding:12px;display:flex;flex-direction:column;gap:10px;}
.sidebar-notification-item{border:1px solid rgba(255,255,255,.08);border-radius:16px;background:rgba(255,255,255,.02);padding:12px;display:flex;flex-direction:column;gap:8px;}
.sidebar-notification-item.is-read{opacity:.82;}
.sidebar-notification-item.is-favorite{border-color:rgba(255,215,106,.32);box-shadow:inset 0 0 0 1px rgba(255,215,106,.08);}
.sidebar-notification-item-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;}
.sidebar-notification-item-head strong{display:block;font-size:14px;line-height:1.35;}
.sidebar-notification-group{font-size:11px;text-transform:uppercase;letter-spacing:.4px;color:var(--muted);margin-bottom:4px;}
.sidebar-notification-link{font-size:14px;line-height:1.5;color:var(--text);}
.sidebar-notification-link:hover{text-decoration:underline;}
.sidebar-notification-meta{font-size:12px;color:var(--muted);line-height:1.5;}
.sidebar-notification-footer{display:flex;align-items:center;justify-content:space-between;gap:10px;}
.sidebar-notification-footer small{font-size:11px;color:var(--muted);}
.sidebar-notification-actions{display:flex;align-items:center;gap:6px;}
.sidebar-mini-action{min-width:32px;height:32px;border-radius:10px;border:1px solid var(--line);background:rgba(255,255,255,.02);color:var(--text);cursor:pointer;}
.sidebar-mini-action:hover,.sidebar-panel-close:hover{background:rgba(255,255,255,.06);}
.sidebar-notification-mini-pill{display:inline-flex;align-items:center;justify-content:center;height:24px;padding:0 10px;border-radius:999px;background:rgba(79,124,255,.12);border:1px solid rgba(79,124,255,.22);font-size:11px;font-weight:700;color:var(--text);white-space:nowrap;}

/* ===== Profile page ===== */
.profile-page-grid{display:grid;grid-template-columns:320px minmax(0,1fr);gap:18px;align-items:start;}
.profile-preview-card{border:1px solid var(--line);border-radius:18px;background:rgba(255,255,255,.03);padding:18px;display:flex;flex-direction:column;align-items:center;gap:14px;text-align:center;}
.profile-preview-avatar-wrap{display:flex;justify-content:center;width:100%;}
.profile-preview-avatar{width:120px;height:120px;border-radius:50%;object-fit:cover;border:1px solid rgba(255,255,255,.12);background:#111a2e;}
.profile-preview-fallback{display:flex;align-items:center;justify-content:center;font-size:34px;font-weight:800;background:linear-gradient(180deg,rgba(79,124,255,.3),rgba(79,124,255,.12));}
.profile-preview-texts{display:flex;flex-direction:column;gap:4px;}
.profile-preview-texts strong{font-size:20px;}
.profile-preview-texts span,.profile-preview-texts small{color:var(--muted);}
.profile-form-grid{display:flex;flex-direction:column;gap:14px;}
.profile-checks-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:12px;}
.profile-check-card{display:flex;align-items:flex-start;gap:12px;padding:14px;border:1px solid var(--line);border-radius:16px;background:rgba(255,255,255,.02);cursor:pointer;}
.profile-check-card input{width:18px;height:18px;min-width:18px;margin-top:2px;}
.profile-check-card span{display:flex;flex-direction:column;gap:4px;}
.profile-check-card strong{font-size:14px;color:var(--text);}
.profile-check-card small{font-size:12px;color:var(--muted);line-height:1.45;}

@media (max-width: 920px){
  .profile-page-grid{grid-template-columns:1fr;}
  .sidebar-notification-panel{
    top:50%;
    left:50%;
    right:auto;
    bottom:auto;
    transform:translate(-50%, -50%);
    width:min(760px,calc(100vw - 24px));
    max-height:min(92vh,calc(100vh - 24px));
    border-radius:20px;
  }
}

.profile-avatar-upload-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:10px;}
.profile-avatar-upload-actions .hint{margin:0;flex:1 1 220px;}
.profile-avatar-editor{position:fixed;inset:0;z-index:72;display:flex;align-items:center;justify-content:center;padding:16px;}
.profile-avatar-editor[hidden]{display:none !important;}
.profile-avatar-editor-backdrop{position:absolute;inset:0;background:rgba(3,8,18,.62);backdrop-filter:blur(3px);}
.profile-avatar-editor-panel{position:relative;width:min(760px,calc(100vw - 24px));border:1px solid var(--line);border-radius:22px;background:#111a2e;box-shadow:0 28px 56px rgba(0,0,0,.48);overflow:hidden;}
.profile-avatar-editor-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:18px 18px 14px;border-bottom:1px solid var(--line);}
.profile-avatar-editor-header strong{display:block;font-size:17px;}
.profile-avatar-editor-header small{display:block;margin-top:4px;color:var(--muted);font-size:12px;line-height:1.5;}
.profile-avatar-editor-body{padding:18px;display:grid;grid-template-columns:minmax(280px,360px) minmax(0,1fr);gap:18px;align-items:start;}
.profile-avatar-crop-area{display:flex;justify-content:center;}
.profile-avatar-crop-frame{position:relative;width:min(100%,340px);aspect-ratio:1/1;border-radius:24px;overflow:hidden;background:linear-gradient(180deg,rgba(255,255,255,.04),rgba(255,255,255,.02));border:1px solid rgba(255,255,255,.08);box-shadow:inset 0 0 0 1px rgba(255,255,255,.02);touch-action:none;user-select:none;cursor:grab;}
.profile-avatar-crop-frame.is-dragging{cursor:grabbing;}
.profile-avatar-crop-frame::after{content:'';position:absolute;inset:0;border-radius:24px;box-shadow:inset 0 0 0 1px rgba(79,124,255,.28);pointer-events:none;}
.profile-avatar-crop-image{position:absolute;top:0;left:0;max-width:none;max-height:none;user-select:none;-webkit-user-drag:none;transform-origin:top left;will-change:transform;}
.profile-avatar-editor-side{display:flex;flex-direction:column;gap:14px;}
.profile-avatar-editor-help{margin:0;padding:14px;}
.profile-avatar-editor-help strong{display:block;margin-bottom:6px;}
.profile-avatar-editor-help p{margin:0;color:var(--muted);font-size:13px;line-height:1.6;}
.profile-avatar-editor-side input[type="range"]{padding:0;height:auto;background:transparent;border:none;}
.profile-avatar-editor-actions{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap;padding:0 18px 18px;}
@media (max-width: 860px){
  .profile-avatar-editor-body{grid-template-columns:1fr;}
  .profile-avatar-crop-frame{width:min(100%,320px);}
}

/* ===== Relatórios operacionais / contas a receber / permissões ===== */
.stats-grid{display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));}
.stats-grid-5{grid-template-columns:repeat(auto-fit,minmax(180px,1fr));}
.stat-card{padding:16px;border:1px solid var(--line);border-radius:16px;background:rgba(255,255,255,.02);display:flex;flex-direction:column;gap:8px;min-height:132px}
.stat-card span,.stat-label{font-size:12px;color:var(--muted);font-weight:700;letter-spacing:.02em;text-transform:uppercase}
.stat-card strong,.stat-value{font-size:26px;line-height:1.15;font-weight:800;color:var(--text)}
.stat-card small{font-size:12px;color:var(--muted);line-height:1.45}
.stack-actions{display:flex;gap:6px;flex-wrap:wrap;align-items:center}
.subtle-badge{display:inline-flex;align-items:center;gap:6px;padding:5px 9px;border-radius:999px;border:1px solid rgba(245,166,35,.28);background:rgba(245,166,35,.12);font-size:12px;font-weight:700;color:var(--text)}
.permission-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:12px}
.permission-card{padding:16px;border:1px solid var(--line);border-radius:18px;background:rgba(255,255,255,.02)}
.permission-card-head{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}
.permission-pill-list{display:flex;gap:8px;flex-wrap:wrap}
.permission-pill{display:inline-flex;align-items:center;padding:6px 10px;border-radius:999px;background:rgba(79,124,255,.12);border:1px solid rgba(79,124,255,.26);font-size:12px;font-weight:700;color:var(--text)}
@media (max-width: 768px){
  .stat-card strong,.stat-value{font-size:22px}
}


/* =========================================================
   Tema visual inspirado no "Modelo 4"
   Mantém a lógica do ERP e troca apenas a aparência.
========================================================= */
:root{
  --bg:#ededee;
  --card:#d3d3d3;
  --muted:#666666;
  --text:#323232;
  --line:#323232;
  --primary:#d9a6ff;
  --primary-hover:#c37cff;
  --danger:#d9534f;
  --ok:#36a16b;
}

html{background:var(--bg)}
body{
  background:var(--bg);
  color:var(--text);
  line-height:1.5;
}

a{color:inherit}
a:hover{text-decoration:none}

.bg{
  background:var(--bg);
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
}

.dash{
  background:var(--bg);
  color:var(--text);
}

::selection{
  background:rgba(217,166,255,.55);
  color:#161616;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible{
  outline:3px solid #c37cff;
  outline-offset:3px;
}

/* ----- Base de formulário ----- */
label{
  color:var(--text);
  font-weight:600;
  font-size:13px;
}

input,
select,
textarea{
  width:100%;
  min-height:44px;
  padding:10px 12px;
  border-radius:5px;
  border:2px solid var(--line);
  background:#ffffff;
  color:var(--text);
  outline:none;
  box-shadow:4px 4px var(--line);
}

input::placeholder,
textarea::placeholder{
  color:#777777;
}

input:focus,
select:focus,
textarea:focus{
  border-color:#2d8cf0;
}

select{
  background-color:#ffffff;
  background-position:right 12px center;
}

/* ----- Botões ----- */
.btn,
button.btn,
.icon-btn,
.sidebar-mini-action,
.sidebar-panel-close{
  min-height:42px;
  padding:10px 14px;
  border-radius:5px;
  border:2px solid var(--line);
  background:#ffffff;
  color:var(--text);
  cursor:pointer;
  box-shadow:4px 4px var(--line);
  transition:transform .15s ease, box-shadow .15s ease, background-color .15s ease, filter .15s ease;
}

.btn:hover,
button.btn:hover,
.icon-btn:hover,
.sidebar-mini-action:hover,
.sidebar-panel-close:hover{
  filter:none;
  transform:translate(1px,1px);
  box-shadow:3px 3px var(--line);
}

.btn.primary{
  background:var(--primary);
  border-color:var(--line);
  color:#161616;
  font-weight:700;
}

.btn.primary:hover{
  background:var(--primary-hover);
}

.btn.danger{
  background:#ffd6d6;
  border-color:var(--line);
  color:#7a1818;
}

.btn.sm,
.btn.tiny{
  min-height:36px;
  padding:8px 12px;
  box-shadow:3px 3px var(--line);
}

/* ----- Alertas ----- */
.alert{
  border-radius:8px;
  border:2px solid var(--line);
  box-shadow:4px 4px var(--line);
  background:#ffffff;
  color:var(--text);
}

.alert-error{
  background:#ffe3e3;
  border-color:var(--line);
}

.alert-success{
  background:#e4f8ea;
  border-color:var(--line);
}

.hint,
.tiny-muted,
.card-header p,
.topbar small,
.kpi-title,
.kpi-sub,
.mini-sub,
.alert-tile-sub,
.compare-label,
.compare-values,
.toolbar-grid label,
.profile-preview-texts span,
.profile-preview-texts small,
.sidebar-profile-texts span,
.sidebar-profile-texts small,
.sidebar-notification-meta,
.sidebar-notification-head small,
.shortcut-card span{
  color:var(--muted) !important;
}

/* ----- Login ----- */
.auth-container{
  width:100%;
  max-width:360px;
}

.card,
.auth-card,
.auth-panel{
  background:var(--card);
  border:2px solid var(--line);
  border-radius:5px;
  padding:16px 16px 18px;
  box-shadow:4px 4px var(--line);
}

.auth-panel .form{
  gap:12px;
}

.auth-logo{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:8px;
}

.auth-logo-badge{
  width:18px;
  height:18px;
  border-radius:50%;
  border:2px solid var(--line);
  background:var(--primary);
  box-shadow:2px 2px var(--line);
  flex:0 0 auto;
}

.auth-logo-copy strong{
  font-size:14px;
  color:var(--text);
  letter-spacing:.2px;
}

.card-header h1{
  margin:0 0 4px;
  font-size:22px;
  line-height:1.2;
  color:var(--text);
}

.auth-submit{
  margin-top:4px;
}

/* ----- Estrutura principal ----- */
.content{
  flex:1;
  width:100%;
  max-width:1280px;
  margin:0 auto;
  padding:18px;
}

.content.content-wide{
  max-width:1360px;
}

.topbar{
  align-items:flex-start;
  margin-bottom:12px;
}

.topbar h2{
  margin:0;
  color:var(--text);
  font-size:24px;
  line-height:1.2;
}

.card-box,
.kpi,
.toolbar-card,
.shortcut-card,
.alert-tile,
.mini-item,
.bar-card,
.compare-row,
.pill,
.sidebar-notification-item,
.profile-preview-card,
.profile-check-card,
.profile-avatar-editor-help{
  background:var(--card);
  border:2px solid var(--line);
  border-radius:5px;
  box-shadow:4px 4px var(--line);
}

.card-box,
.kpi,
.toolbar-card{
  padding:16px;
}

.kpi-title{
  font-size:13px;
  font-weight:600;
}

.kpi-value{
  font-size:28px;
  font-weight:800;
  color:var(--text);
}

.toolbar-card{
  overflow:visible;
}

.toolbar-card form{
  margin:0;
}

.table-wrap{
  border-radius:8px;
}

.table{
  min-width:760px;
  background:#ffffff;
  border:2px solid var(--line);
  border-radius:5px;
  overflow:hidden;
  box-shadow:4px 4px var(--line);
}

.table th,
.table td{
  border-bottom:1px solid rgba(50,50,50,.18);
  color:var(--text);
}

.table th{
  background:#ececec;
  color:#444444;
}

.table tr:nth-child(even) td{
  background:#fafafa;
}

/* ----- Sidebar ----- */
.sidebar{
  width:280px;
  background:var(--card);
  border-right:2px solid var(--line);
  padding:16px 14px;
  box-shadow:4px 0 0 var(--line);
}

.brand{
  font-size:20px;
  font-weight:800;
  color:var(--text);
}

.sidebar .nav{
  gap:8px;
}

.sidebar-search input{
  background:#ffffff;
  box-shadow:4px 4px var(--line);
}

.sidebar .nav .nav-item,
.sidebar .nav button.nav-item{
  display:flex;
  align-items:center;
  width:100%;
  min-height:44px;
  padding:10px 12px;
  border-radius:5px;
  border:2px solid transparent !important;
  background:transparent !important;
  color:var(--text) !important;
  box-shadow:none !important;
  font-weight:600;
}

.sidebar .nav .nav-item:hover,
.sidebar .nav button.nav-item:hover,
.nav-sub-item:hover{
  background:#ffffff !important;
  border-color:var(--line) !important;
  box-shadow:3px 3px var(--line) !important;
  transform:translate(1px,1px);
}

.sidebar .nav .nav-item.active,
.sidebar .nav button.nav-item.active,
.nav-sub-item.active,
.sidebar .nav button.nav-item.nav-toggle.active,
aside.sidebar nav.nav .nav-group.is-current > button.nav-item.nav-toggle,
aside.sidebar nav.nav .nav-group[data-nav-group="cadastro"] > button.nav-item.nav-toggle.active{
  background:var(--primary) !important;
  border-color:var(--line) !important;
  color:#161616 !important;
  box-shadow:3px 3px var(--line) !important;
}

.nav-group{
  gap:8px;
}

.nav-sub{
  margin-left:8px;
  padding:8px 0 8px 10px;
  border-left:2px dashed rgba(50,50,50,.24);
}

.nav-sub-item{
  background:rgba(255,255,255,.48);
}

.nav-chev::before{
  color:var(--text);
}

.sidebar-footer{
  margin-top:16px;
  padding-top:14px;
  border-top:2px solid rgba(50,50,50,.18);
}

.sidebar-footer-actions{
  gap:8px;
}

.sidebar-footer-icon{
  min-height:44px;
  border-radius:5px;
  border:2px solid var(--line);
  background:#ffffff;
  color:var(--text);
  box-shadow:3px 3px var(--line);
}

.sidebar-footer-icon:hover,
.sidebar-footer-icon.is-active{
  background:var(--primary);
  border-color:var(--line);
  color:#161616;
  transform:translate(1px,1px);
  box-shadow:2px 2px var(--line);
}

.sidebar-footer-icon.is-disabled{
  opacity:.55;
  color:#888;
}

.sidebar-footer-badge{
  background:#111111;
  color:#ffffff;
  border:2px solid #ffffff;
}

.sidebar-profile-card{
  margin-top:14px;
  background:#ffffff;
  border:2px solid var(--line);
  border-radius:5px;
  padding:12px;
  box-shadow:4px 4px var(--line);
}

.sidebar-profile-avatar{
  width:52px;
  height:52px;
  border-radius:50%;
  object-fit:cover;
  border:2px solid var(--line);
  box-shadow:3px 3px var(--line);
  background:#ffffff;
}

.sidebar-profile-avatar-fallback,
.profile-preview-fallback{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:var(--primary);
  color:#161616;
  font-weight:800;
}

.sidebar-profile-avatar-fallback{
  width:52px;
  height:52px;
  border:2px solid var(--line);
  box-shadow:3px 3px var(--line);
}

.sidebar-logout-btn{
  width:100%;
  margin-top:10px;
}

.sidebar-notification-overlay{
  background:rgba(0,0,0,.35);
}

.sidebar-notification-panel{
  background:var(--bg);
  color:var(--text);
  border-left:2px solid var(--line);
  box-shadow:-4px 0 0 var(--line);
}

.sidebar-notification-head,
.sidebar-notification-toolbar{
  border-bottom:2px solid rgba(50,50,50,.14);
}

.sidebar-notification-item{
  background:#ffffff;
}

.sidebar-notification-group{
  color:#555555;
}

.sidebar-notification-link{
  color:var(--text);
}

/* ----- Header mobile ----- */
.mobile-header{
  background:var(--card);
  border-bottom:2px solid var(--line);
  box-shadow:0 4px 0 var(--line);
}

.mobile-brand,
.mobile-title{
  color:var(--text);
  font-weight:800;
}

.toggle{
  border:2px solid var(--line);
  border-radius:5px;
  background:#ffffff;
  box-shadow:3px 3px var(--line);
}

.bars{
  background:var(--text) !important;
}

.sidebar-close{
  min-height:40px;
}

/* ----- Componentes do dashboard ----- */
.section-title-row h3,
.shortcut-card strong,
.alert-tile-title,
.mini-item strong,
.mini-right strong{
  color:var(--text);
}

.alert-tile.warn{background:#fff3cd}
.alert-tile.danger{background:#ffe3e3}
.alert-tile.info{background:#e7f1ff}
.alert-tile.ok{background:#e4f8ea}

.mini-empty{
  background:#ffffff;
  border:2px dashed rgba(50,50,50,.25);
  border-radius:5px;
  padding:14px;
  color:var(--muted);
}

.bar-slot{
  background:#ffffff;
  border:2px solid var(--line);
  border-radius:5px;
  overflow:hidden;
}

.bar-slot span{
  border-radius:0;
}

.bar-slot.income span{background:#36a16b}
.bar-slot.expense span{background:#d9534f}

.pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:30px;
  padding:0 10px;
  font-size:12px;
  font-weight:700;
  background:#ffffff;
  color:var(--text);
}

.pill.danger{
  background:#ffd6d6;
}

.shortcut-panel{
  background:var(--bg);
  border:2px solid var(--line);
  box-shadow:4px 4px var(--line);
}

.shortcut-card{
  background:#ffffff;
  padding:14px;
}

.shortcut-card strong{
  font-size:20px;
}

/* ----- Perfil ----- */
.profile-page-grid{
  display:grid;
  grid-template-columns:320px minmax(0,1fr);
  gap:18px;
}

.profile-preview-card{
  background:var(--card);
  padding:20px;
  align-items:center;
  text-align:center;
}

.profile-preview-avatar{
  width:120px;
  height:120px;
  border-radius:50%;
  object-fit:cover;
  border:2px solid var(--line);
  background:#ffffff;
  box-shadow:4px 4px var(--line);
}

.profile-preview-texts strong{
  display:block;
  margin-bottom:4px;
  font-size:18px;
  color:var(--text);
}

.profile-form-grid{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.profile-form-grid .row{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
}

.profile-form-grid .col{
  min-width:0;
}

.profile-checks-row{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
}

.profile-check-card{
  display:flex;
  gap:12px;
  align-items:flex-start;
  padding:14px;
  background:#ffffff;
}

.profile-check-card input[type="checkbox"]{
  width:18px;
  height:18px;
  min-height:18px;
  margin-top:2px;
  box-shadow:none;
}

.profile-avatar-upload-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin-top:10px;
}

.profile-avatar-editor-panel{
  background:var(--bg);
  border:2px solid var(--line);
  border-radius:8px;
  box-shadow:4px 4px var(--line);
}

.profile-avatar-editor-header{
  border-bottom:2px solid rgba(50,50,50,.14);
}

.profile-avatar-crop-frame{
  border-radius:12px;
  border:2px solid var(--line);
  background:#ffffff;
  box-shadow:4px 4px var(--line);
}

.profile-avatar-crop-frame::after{
  box-shadow:inset 0 0 0 2px rgba(195,124,255,.55);
  border-radius:12px;
}

.profile-avatar-editor-side input[type="range"]{
  box-shadow:none;
}

.profile-avatar-editor-help{
  background:#ffffff;
}

.profile-preview-avatar-wrap{
  width:100%;
  display:flex;
  justify-content:center;
}

/* ----- Impressão e responsivo ----- */
@media (max-width: 920px){
  .sidebar{
    box-shadow:4px 0 0 var(--line);
  }
  .content{
    padding:14px;
  }
  .profile-page-grid,
  .profile-form-grid .row,
  .profile-checks-row{
    grid-template-columns:1fr;
  }
}

@media (max-width: 560px){
  .bg{padding:12px}
  .auth-container{max-width:100%}
  .card,.auth-card,.auth-panel,.card-box,.kpi,.toolbar-card{padding:14px}
  .kpi-value{font-size:24px}
}


/* ===== Refinos do dashboard (gráficos e leitura visual) ===== */
.dashboard-panels{
  gap:18px;
  margin-top:18px;
}

.dashboard-panels .card-box{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.dashboard-panels .section-title-row{
  align-items:flex-start;
  gap:12px;
  margin-bottom:0;
}

.bar-legend{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin-top:-2px;
}

.bar-legend span{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:5px 10px;
  border-radius:999px;
  background:#ffffff;
  border:1px solid rgba(50,50,50,.14);
  font-size:12px;
  font-weight:700;
  color:var(--text);
}

.bar-legend span::before{
  content:'';
  width:10px;
  height:10px;
  border-radius:999px;
  display:block;
}

.bar-legend .income::before{background:#36a16b;}
.bar-legend .expense::before{background:#d9534f;}

.bars-wrap.dual-bars{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(92px,1fr));
  gap:14px;
  align-items:stretch;
}

.bar-card{
  display:flex;
  flex-direction:column;
  gap:10px;
  min-width:0;
  padding:14px 12px;
  background:#f6f6f7;
  border:1px solid rgba(50,50,50,.18);
  border-radius:16px;
  box-shadow:none;
}

.bar-label{
  text-align:center;
  font-size:13px;
  font-weight:800;
  line-height:1.2;
  color:var(--text);
}

.bar-pair{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  align-items:end;
  min-height:172px;
}

.bar-slot{
  position:relative;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  height:172px;
  min-height:172px;
  padding:8px;
  background:linear-gradient(180deg,#ffffff 0%,#f0f0f2 100%);
  border:1px solid rgba(50,50,50,.16);
  border-radius:14px;
  overflow:hidden;
}

.bar-slot::before{
  content:'';
  position:absolute;
  inset:10px;
  border-radius:10px;
  background:repeating-linear-gradient(
    to top,
    rgba(50,50,50,.05) 0,
    rgba(50,50,50,.05) 1px,
    transparent 1px,
    transparent 30px
  );
  pointer-events:none;
}

.bar-slot span{
  position:relative;
  display:block;
  width:100%;
  min-height:10px;
  border-radius:10px 10px 6px 6px;
  box-shadow:inset 0 -1px 0 rgba(0,0,0,.12);
}

.bar-slot.income span{
  background:linear-gradient(180deg,#59bb84 0%,#36a16b 100%);
}

.bar-slot.expense span{
  background:linear-gradient(180deg,#ea7f78 0%,#d9534f 100%);
}

.bar-values{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.bar-values small{
  display:flex;
  justify-content:space-between;
  gap:8px;
  color:var(--muted);
  line-height:1.35;
}

.bar-values small strong{
  color:var(--text);
}

.dashboard-panels .mini-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.dashboard-panels .mini-item{
  padding:14px;
  background:#f7f7f8;
  border:1px solid rgba(50,50,50,.16);
  box-shadow:none;
}

.dashboard-panels .mini-sub{
  margin-top:4px;
  color:var(--muted);
}

.dashboard-empty-state{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:240px;
  padding:18px;
  border:1px dashed rgba(50,50,50,.22);
  border-radius:16px;
  background:#fbfbfc;
  color:var(--muted);
  text-align:center;
}

.dashboard-panels .table thead th{
  background:#f7f7f8;
}

.dashboard-panels .table tbody tr{
  background:#ffffff;
}

@media (max-width: 920px){
  .bars-wrap.dual-bars{
    grid-template-columns:repeat(auto-fit,minmax(78px,1fr));
    gap:12px;
  }

  .bar-card{
    padding:12px 10px;
  }

  .bar-pair,
  .bar-slot{
    min-height:150px;
    height:150px;
  }
}

@media (max-width: 640px){
  .bars-wrap.dual-bars{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}


/* ----- Refino extra: rodapé da sidebar ----- */
.sidebar-footer{
  margin-top:8px;
  padding-top:16px;
  border-top:2px solid rgba(50,50,50,.18);
  background:transparent;
  box-shadow:none;
}

.sidebar-footer-actions{
  gap:8px;
  background:transparent;
}

.sidebar-footer-icon{
  height:44px;
  border-radius:6px;
  border:2px solid var(--line);
  background:#ffffff;
  color:var(--text);
  box-shadow:3px 3px var(--line);
}

.sidebar-footer-icon:hover,
.sidebar-footer-icon:focus-visible{
  background:#f6f6f6;
  border-color:var(--line);
  color:var(--text);
  box-shadow:2px 2px var(--line);
  transform:translate(1px,1px);
}

.sidebar-footer-icon.is-active{
  background:var(--primary);
  border-color:var(--line);
  color:#161616;
  box-shadow:3px 3px var(--line);
}

.sidebar-footer-icon.is-disabled{
  opacity:.55;
  background:#efefef;
}

.sidebar-footer-badge{
  top:-4px;
  right:-4px;
  min-width:20px;
  height:20px;
  border:2px solid #ffffff;
  box-shadow:none;
}

.sidebar-profile-card{
  border:2px solid var(--line);
  border-radius:8px;
  background:#efefef;
  box-shadow:4px 4px var(--line);
}

.sidebar-profile-avatar{
  border:2px solid var(--line);
  background:#ffffff;
}

.sidebar-profile-avatar-fallback{
  color:#161616;
  background:linear-gradient(180deg,#d9a6ff,#b867ef);
}

.sidebar-profile-texts strong,
.sidebar-profile-texts span,
.sidebar-profile-texts small{
  color:var(--text);
}

.sidebar-logout-btn{
  min-height:42px;
  border:2px solid var(--line);
  background:#ffffff;
  color:var(--text);
  box-shadow:none;
}

.sidebar-logout-btn:hover,
.sidebar-logout-btn:focus-visible{
  background:#f6f6f6;
  transform:none;
}


/* ===== Dark mode ===== */
.dashboard-theme-wrap{display:flex;align-items:center;justify-content:center;padding:0 2px 0 0;flex:0 0 auto;}
.checkbox-wrapper-5{display:flex;align-items:center;justify-content:center;line-height:0;}
.checkbox-wrapper-5 .check{
  --size:40px;
  position:relative;
  background:linear-gradient(90deg,#f19af3,#f099b5);
  line-height:0;
  perspective:400px;
  font-size:var(--size);
}
.checkbox-wrapper-5 .check input[type="checkbox"],
.checkbox-wrapper-5 .check label,
.checkbox-wrapper-5 .check label::before,
.checkbox-wrapper-5 .check label::after,
.checkbox-wrapper-5 .check{
  appearance:none;
  display:inline-block;
  border-radius:var(--size);
  border:0;
  transition:.35s ease-in-out;
  box-sizing:border-box;
  cursor:pointer;
}
.checkbox-wrapper-5 .check label{
  width:calc(2.2 * var(--size));
  height:var(--size);
  background:#d7d7d7;
  overflow:hidden;
}
.checkbox-wrapper-5 .check input[type="checkbox"]{
  position:absolute;
  z-index:1;
  width:calc(.8 * var(--size));
  height:calc(.8 * var(--size));
  top:calc(.1 * var(--size));
  left:calc(.1 * var(--size));
  background:linear-gradient(45deg,#dedede,#ffffff);
  box-shadow:0 6px 7px rgba(0,0,0,0.3);
  outline:none;
  margin:0;
  min-height:0;
  padding:0;
  border:0;
}
.checkbox-wrapper-5 .check input[type="checkbox"]:checked{
  left:calc(1.3 * var(--size));
}
.checkbox-wrapper-5 .check input[type="checkbox"]:checked + label{
  background:transparent;
}
.checkbox-wrapper-5 .check label::before,
.checkbox-wrapper-5 .check label::after{
  content:"· ·";
  position:absolute;
  overflow:hidden;
  left:calc(.15 * var(--size));
  top:calc(.5 * var(--size));
  height:var(--size);
  letter-spacing:calc(-0.04 * var(--size));
  color:#9b9b9b;
  font-family:"Times New Roman",serif;
  z-index:2;
  font-size:calc(.6 * var(--size));
  border-radius:0;
  transform-origin:0 0 calc(-0.5 * var(--size));
  backface-visibility:hidden;
}
.checkbox-wrapper-5 .check label::after{
  content:"●";
  top:calc(.65 * var(--size));
  left:calc(.2 * var(--size));
  height:calc(.1 * var(--size));
  width:calc(.35 * var(--size));
  font-size:calc(.2 * var(--size));
  transform-origin:0 0 calc(-0.4 * var(--size));
}
.checkbox-wrapper-5 .check input[type="checkbox"]:checked + label::before,
.checkbox-wrapper-5 .check input[type="checkbox"]:checked + label::after{
  left:calc(1.55 * var(--size));
  top:calc(.4 * var(--size));
  line-height:calc(.1 * var(--size));
  transform:rotateY(360deg);
}
.checkbox-wrapper-5 .check input[type="checkbox"]:checked + label::after{
  height:calc(.16 * var(--size));
  top:calc(.55 * var(--size));
  left:calc(1.6 * var(--size));
  font-size:calc(.6 * var(--size));
  line-height:0;
}
html.theme-dark{
  color-scheme:dark;
  --bg:#11141d;
  --card:#1a1f2b;
  --muted:#aab2c5;
  --text:#edf2ff;
  --line:#394052;
  --primary:#d9a6ff;
  --primary-hover:#c37cff;
  --danger:#ff8f8f;
  --ok:#65d29e;
}
html.theme-dark body,
html.theme-dark .bg,
html.theme-dark .dash{
  background:var(--bg);
  color:var(--text);
}
html.theme-dark .card,
html.theme-dark .auth-card,
html.theme-dark .auth-panel,
html.theme-dark .card-box,
html.theme-dark .kpi,
html.theme-dark .toolbar-card,
html.theme-dark .shortcut-card,
html.theme-dark .alert-tile,
html.theme-dark .mini-item,
html.theme-dark .bar-card,
html.theme-dark .compare-row,
html.theme-dark .pill,
html.theme-dark .sidebar-notification-item,
html.theme-dark .profile-preview-card,
html.theme-dark .profile-check-card,
html.theme-dark .profile-avatar-editor-help,
html.theme-dark .sidebar,
html.theme-dark .shortcut-panel,
html.theme-dark .mobile-header,
html.theme-dark .kanban-group,
html.theme-dark .kanban-modal-dialog{
  background:var(--card);
  border-color:var(--line);
  color:var(--text);
  box-shadow:4px 4px var(--line);
}
html.theme-dark input,
html.theme-dark select,
html.theme-dark textarea,
html.theme-dark .btn,
html.theme-dark button.btn,
html.theme-dark .icon-btn,
html.theme-dark .sidebar-mini-action,
html.theme-dark .sidebar-panel-close,
html.theme-dark .sidebar-search input,
html.theme-dark .sidebar-footer-icon,
html.theme-dark .sidebar-profile-card,
html.theme-dark .sidebar-logout-btn,
html.theme-dark .profile-avatar-crop-frame,
html.theme-dark .mini-empty,
html.theme-dark .dashboard-empty-state,
html.theme-dark .bar-slot,
html.theme-dark .kanban-card,
html.theme-dark .kanban-pill,
html.theme-dark .kanban-priority,
html.theme-dark .kanban-modal-info div,
html.theme-dark .kanban-empty,
html.theme-dark .table{
  background:#151a26;
  color:var(--text);
  border-color:var(--line);
}
html.theme-dark input::placeholder,
html.theme-dark textarea::placeholder{color:#8c95aa;}
html.theme-dark .btn,
html.theme-dark button.btn,
html.theme-dark .icon-btn,
html.theme-dark .sidebar-mini-action,
html.theme-dark .sidebar-panel-close,
html.theme-dark .sidebar-footer-icon,
html.theme-dark .sidebar-logout-btn{box-shadow:4px 4px var(--line);}
html.theme-dark .btn:hover,
html.theme-dark button.btn:hover,
html.theme-dark .icon-btn:hover,
html.theme-dark .sidebar-mini-action:hover,
html.theme-dark .sidebar-panel-close:hover,
html.theme-dark .sidebar-footer-icon:hover,
html.theme-dark .sidebar-logout-btn:hover{background:#202637;color:var(--text);box-shadow:3px 3px var(--line);}
html.theme-dark .btn.primary{color:#161616;background:var(--primary);}
html.theme-dark .alert{background:#171d2a;border-color:var(--line);color:var(--text);}
html.theme-dark .alert-error{background:#2a1b23;}
html.theme-dark .alert-success{background:#16271f;}
html.theme-dark .table th{background:#202637;color:#dde4f7;border-bottom-color:rgba(255,255,255,.08);}
html.theme-dark .table td{border-bottom-color:rgba(255,255,255,.08);color:var(--text);}
html.theme-dark .table tr:nth-child(even) td,
html.theme-dark .dashboard-panels .table tbody tr{background:#171d2a;}
html.theme-dark .dashboard-panels .table thead th{background:#202637;}
html.theme-dark .sidebar{box-shadow:4px 0 0 var(--line);}
html.theme-dark .sidebar .nav .nav-item,
html.theme-dark .sidebar .nav button.nav-item{color:var(--text) !important;}
html.theme-dark .sidebar .nav .nav-item:hover,
html.theme-dark .sidebar .nav button.nav-item:hover,
html.theme-dark .nav-sub-item:hover{background:#202637 !important;border-color:var(--line) !important;color:var(--text) !important;box-shadow:3px 3px var(--line) !important;}
html.theme-dark .sidebar .nav .nav-item.active,
html.theme-dark .sidebar .nav button.nav-item.active,
html.theme-dark .nav-sub-item.active,
html.theme-dark .sidebar .nav button.nav-item.nav-toggle.active,
html.theme-dark aside.sidebar nav.nav .nav-group.is-current > button.nav-item.nav-toggle,
html.theme-dark aside.sidebar nav.nav .nav-group[data-nav-group="cadastro"] > button.nav-item.nav-toggle.active{color:#161616 !important;}
html.theme-dark .nav-sub{border-left-color:rgba(255,255,255,.18);}
html.theme-dark .nav-sub-item{background:rgba(255,255,255,.04);}
html.theme-dark .sidebar-footer{border-top-color:rgba(255,255,255,.1);}
html.theme-dark .sidebar-footer-icon.is-active{color:#161616;}
html.theme-dark .sidebar-footer-icon.is-disabled{background:#202637;color:#7f8798;}
html.theme-dark .sidebar-footer-badge{background:#11141d;border-color:#151a26;color:#fff;}
html.theme-dark .sidebar-profile-card{background:#1c2230;}
html.theme-dark .sidebar-profile-texts strong,
html.theme-dark .sidebar-profile-texts span,
html.theme-dark .sidebar-profile-texts small,
html.theme-dark .sidebar-notification-link,
html.theme-dark .kanban-card-client,
html.theme-dark .kanban-card-top strong,
html.theme-dark .kanban-card-bottom strong,
html.theme-dark .kanban-modal-info strong{color:var(--text);}
html.theme-dark .sidebar-notification-panel{background:#121722;border-left-color:var(--line);box-shadow:-4px 0 0 var(--line);}
html.theme-dark .sidebar-notification-head,
html.theme-dark .sidebar-notification-toolbar,
html.theme-dark .profile-avatar-editor-header{border-bottom-color:rgba(255,255,255,.1);}
html.theme-dark .sidebar-notification-item{background:#171d2a;}
html.theme-dark .sidebar-notification-group{color:#b4bdd1;}
html.theme-dark .dashboard-visibility-toggle:hover{background:rgba(255,255,255,.08);fill:#edf2ff;}
html.theme-dark .mini-empty,
html.theme-dark .dashboard-empty-state,
html.theme-dark .dashboard-panels .mini-item{background:#171d2a;border-color:rgba(255,255,255,.1);color:var(--text);box-shadow:none;}
html.theme-dark .bar-slot{background:#171d2a;border-color:var(--line);}
html.theme-dark .bar-slot::before{background:rgba(255,255,255,.03);}
html.theme-dark .bar-legend span{background:#171d2a;border-color:rgba(255,255,255,.1);color:var(--text);}
html.theme-dark .kanban-group-header{background:#202637;}
html.theme-dark .kanban-group[data-group="intake"] .kanban-group-header{background:#2b2340;}
html.theme-dark .kanban-group[data-group="approval"] .kanban-group-header{background:#3b321f;}
html.theme-dark .kanban-group[data-group="delivery"] .kanban-group-header{background:#1f3529;}
html.theme-dark .kanban-group[data-group="cancelled"] .kanban-group-header{background:#3b2026;}
html.theme-dark .kanban-group-body{background:rgba(255,255,255,.02);}
html.theme-dark .kanban-lane{background:#151a26;border-color:var(--line);box-shadow:3px 3px var(--line);}
html.theme-dark .kanban-lane-header{background:#202637;border-bottom-color:var(--line);}
html.theme-dark .kanban-lane[data-status="aguardando"] .kanban-lane-header{background:#2e2540;}
html.theme-dark .kanban-lane[data-status="analise"] .kanban-lane-header{background:#1f3142;}
html.theme-dark .kanban-lane[data-status="aprovado"] .kanban-lane-header{background:#40361d;}
html.theme-dark .kanban-lane[data-status="aguardando_peca"] .kanban-lane-header{background:#44301c;}
html.theme-dark .kanban-lane[data-status="concluido"] .kanban-lane-header{background:#1e3729;}
html.theme-dark .kanban-lane[data-status="entregue"] .kanban-lane-header{background:#1a3a2b;}
html.theme-dark .kanban-lane[data-status="cancelado"] .kanban-lane-header{background:#412126;}
html.theme-dark .kanban-card{background:#171d2a;box-shadow:4px 4px var(--line);}
html.theme-dark .kanban-card:hover{background:#1c2332;box-shadow:3px 3px var(--line);}
html.theme-dark .kanban-card-problem{color:#ccd4e8;}
html.theme-dark .kanban-card-device,
html.theme-dark .kanban-card-device span,
html.theme-dark .kanban-card-meta,
html.theme-dark .kanban-group-header small,
html.theme-dark .kanban-lane-header small,
html.theme-dark .kanban-modal-header small{color:var(--muted);}
html.theme-dark .kanban-card-bottom{border-top-color:rgba(255,255,255,.12);}
html.theme-dark .kanban-pill.ok{background:#193426;color:#81ddb0;}
html.theme-dark .kanban-pill.warn{background:#3b2323;color:#ffb8b8;}
html.theme-dark .kanban-pill.neutral{background:#232a39;color:#cad2e7;}
html.theme-dark .kanban-priority.baixa{background:#232a39;}
html.theme-dark .kanban-priority.media{background:#1d3144;}
html.theme-dark .kanban-priority.alta{background:#3d331d;}
html.theme-dark .kanban-priority.urgente{background:#422126;}
html.theme-dark .kanban-modal-header{background:#202637;border-bottom-color:var(--line);}
html.theme-dark .kanban-modal-info div{background:#171d2a;box-shadow:3px 3px var(--line);}
html.theme-dark .kanban-empty{border-color:rgba(255,255,255,.18);}
html.theme-dark .checkbox-wrapper-5 .check label{background:#2a3040;}
@media (max-width: 560px){
  .dashboard-theme-wrap .checkbox-wrapper-5 .check{--size:32px;}
}


/* ===== Dark mode refined ===== */
html,
body,
.card,
.auth-card,
.auth-panel,
.card-box,
.kpi,
.toolbar-card,
.shortcut-card,
.alert-tile,
.mini-item,
.bar-card,
.compare-row,
.pill,
.sidebar,
.sidebar-profile-card,
.sidebar-notification-panel,
.sidebar-notification-item,
.profile-preview-card,
.profile-check-card,
.profile-avatar-editor-help,
.profile-avatar-editor-panel,
.profile-avatar-crop-frame,
.table,
.table th,
.table td,
.kanban-group,
.kanban-lane,
.kanban-card,
.kanban-modal-dialog,
.mobile-header,
input,
select,
textarea,
.btn,
.icon-btn,
.sidebar-footer-icon,
.sidebar-logout-btn,
.bar-slot,
.dashboard-empty-state,
.mini-empty{
  transition:background-color .22s ease,border-color .22s ease,color .22s ease,box-shadow .22s ease;
}

html.theme-dark{
  --bg:#0e1420;
  --card:#151c29;
  --text:#ecf1fb;
  --muted:#9aa5ba;
  --line:rgba(159,174,201,.22);
  --primary:#d79bf5;
  --primary-hover:#c987ee;
}

html.theme-dark body,
html.theme-dark .bg,
html.theme-dark .dash{
  background:
    radial-gradient(circle at top right, rgba(215,155,245,.10), transparent 26%),
    radial-gradient(circle at bottom left, rgba(96,154,255,.08), transparent 22%),
    #0e1420;
  color:var(--text);
}

html.theme-dark .card,
html.theme-dark .auth-card,
html.theme-dark .auth-panel,
html.theme-dark .card-box,
html.theme-dark .kpi,
html.theme-dark .toolbar-card,
html.theme-dark .shortcut-panel,
html.theme-dark .profile-preview-card,
html.theme-dark .profile-avatar-editor-panel,
html.theme-dark .kanban-group,
html.theme-dark .kanban-modal-dialog,
html.theme-dark .mobile-header,
html.theme-dark .sidebar-notification-panel{
  background:linear-gradient(180deg, rgba(24,32,47,.98) 0%, rgba(18,24,36,.98) 100%);
  border-color:rgba(159,174,201,.18);
  box-shadow:0 18px 40px rgba(0,0,0,.24);
}

html.theme-dark .sidebar{
  background:linear-gradient(180deg, rgba(18,25,37,.98) 0%, rgba(15,21,32,.98) 100%);
  border-right-color:rgba(159,174,201,.16);
  box-shadow:inset -1px 0 0 rgba(255,255,255,.02);
}

html.theme-dark .topbar h2,
html.theme-dark .brand,
html.theme-dark .section-title-row h3,
html.theme-dark .sidebar-profile-texts strong,
html.theme-dark .profile-preview-texts strong,
html.theme-dark .kpi-value,
html.theme-dark .bar-label,
html.theme-dark .shortcut-card strong,
html.theme-dark .mini-item strong,
html.theme-dark .mini-right strong,
html.theme-dark .kanban-card-client,
html.theme-dark .kanban-card-top strong,
html.theme-dark .kanban-card-bottom strong,
html.theme-dark .kanban-modal-info strong{
  color:#f3f6fd;
}

html.theme-dark .hint,
html.theme-dark .tiny-muted,
html.theme-dark .card-header p,
html.theme-dark .topbar small,
html.theme-dark .kpi-title,
html.theme-dark .kpi-sub,
html.theme-dark .mini-sub,
html.theme-dark .alert-tile-sub,
html.theme-dark .compare-label,
html.theme-dark .compare-values,
html.theme-dark .toolbar-grid label,
html.theme-dark .profile-preview-texts span,
html.theme-dark .profile-preview-texts small,
html.theme-dark .sidebar-profile-texts span,
html.theme-dark .sidebar-profile-texts small,
html.theme-dark .sidebar-notification-meta,
html.theme-dark .sidebar-notification-head small,
html.theme-dark .shortcut-card span,
html.theme-dark .bar-values small,
html.theme-dark .dashboard-empty-state,
html.theme-dark .mini-empty{
  color:#9aa5ba !important;
}

html.theme-dark input,
html.theme-dark select,
html.theme-dark textarea,
html.theme-dark .sidebar-search input,
html.theme-dark .profile-avatar-crop-frame,
html.theme-dark .mini-empty,
html.theme-dark .dashboard-empty-state,
html.theme-dark .bar-slot,
html.theme-dark .kanban-empty,
html.theme-dark .table,
html.theme-dark .table td,
html.theme-dark .table th,
html.theme-dark .kanban-card,
html.theme-dark .kanban-modal-info div,
html.theme-dark .profile-check-card,
html.theme-dark .profile-avatar-editor-help,
html.theme-dark .sidebar-profile-card,
html.theme-dark .sidebar-notification-item,
html.theme-dark .shortcut-card,
html.theme-dark .dashboard-panels .mini-item,
html.theme-dark .bar-card{
  background:#192131;
  border-color:rgba(159,174,201,.16);
  box-shadow:none;
}

html.theme-dark input,
html.theme-dark select,
html.theme-dark textarea,
html.theme-dark .sidebar-search input{
  color:#edf2fb;
}

html.theme-dark input:focus,
html.theme-dark select:focus,
html.theme-dark textarea:focus,
html.theme-dark .sidebar-search input:focus{
  border-color:rgba(215,155,245,.55);
  box-shadow:0 0 0 4px rgba(215,155,245,.12);
}

html.theme-dark .btn,
html.theme-dark button.btn,
html.theme-dark .icon-btn,
html.theme-dark .sidebar-mini-action,
html.theme-dark .sidebar-panel-close,
html.theme-dark .sidebar-footer-icon,
html.theme-dark .sidebar-logout-btn{
  background:#1a2232;
  color:#eef2fb;
  border-color:rgba(159,174,201,.16);
  box-shadow:none;
}

html.theme-dark .btn:hover,
html.theme-dark button.btn:hover,
html.theme-dark .icon-btn:hover,
html.theme-dark .sidebar-mini-action:hover,
html.theme-dark .sidebar-panel-close:hover,
html.theme-dark .sidebar-footer-icon:hover,
html.theme-dark .sidebar-logout-btn:hover{
  background:#20293c;
  color:#fff;
  transform:none;
  box-shadow:0 10px 22px rgba(0,0,0,.18);
}

html.theme-dark .btn.primary{
  background:linear-gradient(180deg, #e0aaff 0%, #cf8ef1 100%);
  border-color:transparent;
  color:#17131d;
  box-shadow:0 12px 26px rgba(207,142,241,.24);
}

html.theme-dark .btn.primary:hover{
  background:linear-gradient(180deg, #e5b7ff 0%, #d698f3 100%);
}

html.theme-dark .sidebar .nav .nav-item,
html.theme-dark .sidebar .nav button.nav-item,
html.theme-dark .nav-sub-item{
  color:#dfe6f4 !important;
}

html.theme-dark .sidebar .nav .nav-item:hover,
html.theme-dark .sidebar .nav button.nav-item:hover,
html.theme-dark .nav-sub-item:hover{
  background:#1b2435 !important;
  border-color:rgba(159,174,201,.16) !important;
  box-shadow:none !important;
  transform:none;
}

html.theme-dark .sidebar .nav .nav-item.active,
html.theme-dark .sidebar .nav button.nav-item.active,
html.theme-dark .nav-sub-item.active,
html.theme-dark .sidebar .nav button.nav-item.nav-toggle.active,
html.theme-dark aside.sidebar nav.nav .nav-group.is-current > button.nav-item.nav-toggle,
html.theme-dark aside.sidebar nav.nav .nav-group[data-nav-group="cadastro"] > button.nav-item.nav-toggle.active,
html.theme-dark .sidebar-footer-icon.is-active{
  background:linear-gradient(180deg, #e0aaff 0%, #cf8ef1 100%) !important;
  border-color:transparent !important;
  color:#17131d !important;
  box-shadow:0 10px 24px rgba(207,142,241,.22) !important;
}

html.theme-dark .sidebar-profile-card{
  background:linear-gradient(180deg, rgba(30,38,56,.96) 0%, rgba(23,29,42,.96) 100%);
}

html.theme-dark .sidebar-footer{
  border-top-color:rgba(159,174,201,.14);
}

html.theme-dark .sidebar-footer-badge{
  background:#f5b3c8;
  border-color:#1c2333;
  color:#17131d;
}

html.theme-dark .alert{
  background:#151d2b;
  border-color:rgba(159,174,201,.16);
  box-shadow:none;
}
html.theme-dark .alert-error{background:#2b1820;}
html.theme-dark .alert-success{background:#14251d;}

html.theme-dark .alert-tile.warn{background:linear-gradient(180deg, rgba(103,79,25,.38) 0%, rgba(72,56,20,.38) 100%);}
html.theme-dark .alert-tile.danger{background:linear-gradient(180deg, rgba(97,38,48,.42) 0%, rgba(69,24,32,.42) 100%);}
html.theme-dark .alert-tile.info{background:linear-gradient(180deg, rgba(35,65,103,.38) 0%, rgba(24,43,72,.38) 100%);}
html.theme-dark .alert-tile.ok{background:linear-gradient(180deg, rgba(28,85,58,.40) 0%, rgba(18,59,40,.40) 100%);}

html.theme-dark .dashboard-panels .mini-item,
html.theme-dark .bar-card{
  background:linear-gradient(180deg, rgba(27,35,51,.98) 0%, rgba(21,28,41,.98) 100%);
}

html.theme-dark .bar-slot{
  background:linear-gradient(180deg, #1e2738 0%, #171e2c 100%);
}

html.theme-dark .bar-slot::before{
  background:repeating-linear-gradient(
    to top,
    rgba(255,255,255,.05) 0,
    rgba(255,255,255,.05) 1px,
    transparent 1px,
    transparent 30px
  );
}

html.theme-dark .bar-legend span,
html.theme-dark .pill{
  background:#1c2435;
  border-color:rgba(159,174,201,.16);
  color:#eef2fb;
}

html.theme-dark .dashboard-empty-state,
html.theme-dark .mini-empty,
html.theme-dark .kanban-empty{
  background:#171e2d;
  border-color:rgba(159,174,201,.18);
}

html.theme-dark .table{
  background:#171f2e;
}

html.theme-dark .table th{
  background:#202a3c;
  color:#ecf1fb;
  border-bottom-color:rgba(159,174,201,.16);
}

html.theme-dark .table td,
html.theme-dark .table tr:nth-child(even) td,
html.theme-dark .dashboard-panels .table tbody tr{
  background:#171f2e;
  color:#ecf1fb;
  border-bottom-color:rgba(159,174,201,.10);
}

html.theme-dark .table tbody tr:hover td{
  background:#1d2638;
}

html.theme-dark .shortcut-card{
  background:linear-gradient(180deg, rgba(28,36,53,.98) 0%, rgba(22,29,43,.98) 100%);
}

html.theme-dark .profile-check-card input[type="checkbox"]{
  accent-color:#cf8ef1;
}

html.theme-dark .kanban-group-header,
html.theme-dark .kanban-lane-header,
html.theme-dark .kanban-modal-header,
html.theme-dark .sidebar-notification-head,
html.theme-dark .sidebar-notification-toolbar,
html.theme-dark .profile-avatar-editor-header{
  border-bottom-color:rgba(159,174,201,.12);
}

html.theme-dark .kanban-card{
  background:linear-gradient(180deg, rgba(29,37,54,.98) 0%, rgba(22,29,42,.98) 100%);
}

html.theme-dark .kanban-card:hover{
  background:linear-gradient(180deg, rgba(34,43,61,.98) 0%, rgba(25,32,46,.98) 100%);
  transform:translateY(-1px);
}

html.theme-dark .kanban-card-bottom{
  border-top-color:rgba(159,174,201,.12);
}

html.theme-dark .kanban-pill.ok{background:#173224;color:#8fe1b7;}
html.theme-dark .kanban-pill.warn{background:#3a2026;color:#ffbec9;}
html.theme-dark .kanban-pill.neutral{background:#212b3d;color:#d8e1f2;}

html.theme-dark .kanban-priority.baixa{background:#243047;color:#dfe8fa;}
html.theme-dark .kanban-priority.media{background:#1c3951;color:#b9ddfb;}
html.theme-dark .kanban-priority.alta{background:#4a3618;color:#ffd9a0;}
html.theme-dark .kanban-priority.urgente{background:#51242d;color:#ffc2cc;}

html.theme-dark .checkbox-wrapper-5 .check{
  filter:drop-shadow(0 10px 20px rgba(0,0,0,.18));
}
html.theme-dark .checkbox-wrapper-5 .check label{
  background:linear-gradient(180deg, #232c3c 0%, #1d2432 100%);
}
html.theme-dark .checkbox-wrapper-5 .check input[type="checkbox"]{
  background:linear-gradient(180deg, #ffffff 0%, #e8edf6 100%);
}

html.theme-dark .dashboard-visibility-toggle{
  background:#1a2232;
  border-color:rgba(159,174,201,.16);
  box-shadow:none;
}
html.theme-dark .dashboard-visibility-toggle:hover{
  background:#20293c;
}
html.theme-dark .dashboard-visibility-toggle .eye,
html.theme-dark .dashboard-visibility-toggle .eye-slash{
  fill:#eef2fb;
}

html.theme-dark .mobile-header{
  backdrop-filter:blur(8px);
}

@media (max-width: 560px){
  html.theme-dark .btn,
  html.theme-dark button.btn,
  html.theme-dark .icon-btn,
  html.theme-dark .sidebar-footer-icon,
  html.theme-dark .sidebar-logout-btn{
    box-shadow:none;
  }
}


.app-modal{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;padding:20px;z-index:1400}
.app-modal[hidden]{display:none !important}
.app-modal-backdrop{position:absolute;inset:0;background:rgba(5,10,20,.55);backdrop-filter:blur(2px)}
.app-modal-card{position:relative;z-index:1;width:min(560px,100%);max-height:calc(100vh - 40px);overflow:auto}
.inline-form{display:inline-flex;margin:0}
.charge-history-list,.fiscal-queue-list{display:grid;gap:10px}
.charge-history-item,.fiscal-queue-item{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;padding:12px 14px;border:1px solid rgba(255,255,255,.08);border-radius:14px;background:rgba(255,255,255,.03)}
.subtle-badge--ok{border-color:rgba(28,201,110,.25);background:rgba(28,201,110,.12);color:#53d68b}
.subtle-badge--warn{border-color:rgba(255,184,0,.28);background:rgba(255,184,0,.12);color:#f6c65b}
.subtle-badge--danger{border-color:rgba(255,94,98,.28);background:rgba(255,94,98,.12);color:#ff8b8f}
.subtle-badge--neutral{border-color:rgba(148,163,184,.25);background:rgba(148,163,184,.12);color:#cbd5e1}
body.modal-open{overflow:hidden}
@media (max-width: 900px){.charge-history-item,.fiscal-queue-item{flex-direction:column;align-items:stretch}.app-modal{padding:12px}}


/* ===== Sidebar recolhida + ícones ===== */
.sidebar-header-actions{display:flex;align-items:center;gap:8px;}
.sidebar-collapse-toggle{
  width:38px;height:38px;border-radius:12px;border:1px solid var(--line);
  background:rgba(255,255,255,.03);color:var(--text);display:inline-flex;
  align-items:center;justify-content:center;cursor:pointer;transition:background .18s ease,border-color .18s ease,transform .18s ease;
}
.sidebar-collapse-toggle svg{width:18px;height:18px;fill:currentColor;}
.sidebar-collapse-toggle:hover{background:rgba(255,255,255,.06);border-color:rgba(79,124,255,.25);}
.sidebar-collapse-toggle .collapse-closed{display:none;}
.brand{display:flex;align-items:center;min-height:38px;}
.brand-mini{display:none !important;}
.nav-search-link{display:none;background:rgba(255,255,255,.03);}
.nav-search-link:hover{background:rgba(255,255,255,.06);}
body:not(.sidebar-collapsed) .nav-search-link{display:none !important;}
.nav-item{position:relative;gap:12px;}
.nav-icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 20px;width:20px;height:20px;color:currentColor;}
.nav-icon svg{width:20px;height:20px;fill:currentColor;}
.sidebar-collapsed-logout{display:none;margin-top:12px;}
.sidebar-collapsed-logout-btn{
  width:100%;min-height:48px;border-radius:14px;border:1px solid var(--line);background:rgba(255,255,255,.03);color:var(--text);cursor:pointer;
  display:flex;align-items:center;justify-content:center;
}
.sidebar-collapsed-logout-btn svg{width:20px;height:20px;fill:currentColor;}
.sidebar-collapsed-logout-btn:hover{background:rgba(255,255,255,.06);}


/* Sidebar scroll invisível mantendo rolagem */
.sidebar,
.sidebar .nav,
#sidebarNav{
  -ms-overflow-style:none !important;
  scrollbar-width:none !important;
}
.sidebar::-webkit-scrollbar,
.sidebar .nav::-webkit-scrollbar,
#sidebarNav::-webkit-scrollbar{
  width:0 !important;
  height:0 !important;
  display:none !important;
}
.sidebar::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-thumb,
.sidebar .nav::-webkit-scrollbar-track,
.sidebar .nav::-webkit-scrollbar-thumb,
#sidebarNav::-webkit-scrollbar-track,
#sidebarNav::-webkit-scrollbar-thumb{
  background:transparent !important;
}

@media (min-width: 921px){
  body.sidebar-collapsed .sidebar{
    width:86px;
    padding:16px 10px;
  }
  body.sidebar-collapsed .content{
    max-width:none;
  }
  body.sidebar-collapsed .brand-full,
  body.sidebar-collapsed .sidebar-search,
  body.sidebar-collapsed .nav-label,
  body.sidebar-collapsed .nav-chev,
  body.sidebar-collapsed .sidebar-footer-actions,
  body.sidebar-collapsed .sidebar-profile-card{
    display:none !important;
  }
  body.sidebar-collapsed .brand{display:none !important;}
  body.sidebar-collapsed .sidebar-header{justify-content:flex-end;gap:8px;}
  body.sidebar-collapsed .sidebar-header-actions{flex-direction:column;}
  body.sidebar-collapsed .sidebar-collapse-toggle .collapse-open{display:none;}
  body.sidebar-collapsed .sidebar-collapse-toggle .collapse-closed{display:block;}
  body.sidebar-collapsed .nav{align-items:center;}
  body.sidebar-collapsed .nav-item{
    width:56px !important;
    min-height:48px;
    padding:12px !important;
    justify-content:center;
    gap:0;
    margin:0 auto;
  }
  body.sidebar-collapsed .nav-group{width:100%;align-items:center;position:relative;}
  body.sidebar-collapsed .nav-sub{
    position:absolute;
    left:calc(100% + 10px);
    top:0;
    min-width:220px;
    margin:0;
    padding:8px;
    border-left:none;
    border:1px solid var(--line);
    border-radius:16px;
    background:#0c1427;
    box-shadow:0 18px 30px rgba(0,0,0,.35);
    z-index:1400;
  }
  body.sidebar-collapsed .nav-group.is-open .nav-sub{display:flex !important;}
  body.sidebar-collapsed .nav-sub .nav-item{
    width:100% !important;
    justify-content:flex-start;
    gap:12px;
    margin:0;
  }
  body.sidebar-collapsed .nav-sub .nav-label{display:inline !important;}
  body.sidebar-collapsed .sidebar-footer{padding-top:10px;}
  body.sidebar-collapsed .sidebar-collapsed-logout{display:block;}
  body.sidebar-collapsed .nav-search-link{display:flex !important;}
}
@media (max-width: 920px){
  .sidebar-collapse-toggle{display:none !important;}
}
html.theme-dark .sidebar-collapse-toggle,
html.theme-dark .sidebar-collapsed-logout-btn{box-shadow:4px 4px var(--line);}
html.theme-dark .sidebar-collapse-toggle:hover,
html.theme-dark .sidebar-collapsed-logout-btn:hover{background:#202637;color:var(--text);box-shadow:3px 3px var(--line);}


/* ===== Ajuste fino: alinhamento da sidebar + expansão ao passar o mouse ===== */
.sidebar .nav .nav-item,
.sidebar .nav button.nav-item{
  justify-content:flex-start;
  text-align:left;
}
.sidebar .nav .nav-item .nav-label,
.sidebar .nav button.nav-item .nav-label{
  flex:1 1 auto;
  min-width:0;
  text-align:left;
}
.sidebar .nav .nav-item .nav-icon,
.sidebar .nav button.nav-item .nav-icon{
  flex:0 0 20px;
}

@media (min-width: 921px){
  body.sidebar-collapsed .sidebar{
    overflow:visible;
    position:sticky;
    z-index:80;
    transition:width .18s ease, margin-right .18s ease, padding .18s ease, box-shadow .18s ease;
  }

  body.sidebar-collapsed:not(.sidebar-collapse-lock) .sidebar:hover,
  body.sidebar-collapsed:not(.sidebar-collapse-lock) .sidebar:focus-within{
    width:280px;
    padding:16px 14px;
    margin-right:-194px;
    box-shadow:4px 0 0 var(--line), 16px 0 30px rgba(15,23,42,.12);
  }

  body.sidebar-collapsed:not(.sidebar-collapse-lock) .sidebar:hover .brand-full,
  body.sidebar-collapsed:not(.sidebar-collapse-lock) .sidebar:focus-within .brand-full,
  body.sidebar-collapsed .sidebar:hover .sidebar-search,
  body.sidebar-collapsed .sidebar:focus-within .sidebar-search,
  body.sidebar-collapsed .sidebar:hover .nav-label,
  body.sidebar-collapsed .sidebar:focus-within .nav-label,
  body.sidebar-collapsed .sidebar:hover .nav-chev,
  body.sidebar-collapsed .sidebar:focus-within .nav-chev{
    display:initial !important;
  }

  body.sidebar-collapsed:not(.sidebar-collapse-lock) .sidebar:hover .brand,
  body.sidebar-collapsed:not(.sidebar-collapse-lock) .sidebar:focus-within .brand{
    display:flex !important;
    justify-content:flex-start;
    width:100%;
  }

  body.sidebar-collapsed:not(.sidebar-collapse-lock) .sidebar:hover .brand-mini,
  body.sidebar-collapsed:not(.sidebar-collapse-lock) .sidebar:focus-within .brand-mini{
    display:none !important;
  }

  body.sidebar-collapsed:not(.sidebar-collapse-lock) .sidebar:hover .nav-search-link,
  body.sidebar-collapsed:not(.sidebar-collapse-lock) .sidebar:focus-within .nav-search-link{
    display:none !important;
  }

  body.sidebar-collapsed:not(.sidebar-collapse-lock) .sidebar:hover .sidebar-header,
  body.sidebar-collapsed:not(.sidebar-collapse-lock) .sidebar:focus-within .sidebar-header{
    justify-content:space-between;
  }

  body.sidebar-collapsed:not(.sidebar-collapse-lock) .sidebar:hover .sidebar-header-actions,
  body.sidebar-collapsed:not(.sidebar-collapse-lock) .sidebar:focus-within .sidebar-header-actions{
    flex-direction:row;
  }

  body.sidebar-collapsed:not(.sidebar-collapse-lock) .sidebar:hover .sidebar-collapse-toggle .collapse-open,
  body.sidebar-collapsed:not(.sidebar-collapse-lock) .sidebar:focus-within .sidebar-collapse-toggle .collapse-open{
    display:block;
  }

  body.sidebar-collapsed:not(.sidebar-collapse-lock) .sidebar:hover .sidebar-collapse-toggle .collapse-closed,
  body.sidebar-collapsed:not(.sidebar-collapse-lock) .sidebar:focus-within .sidebar-collapse-toggle .collapse-closed{
    display:none;
  }

  body.sidebar-collapsed:not(.sidebar-collapse-lock) .sidebar:hover .nav,
  body.sidebar-collapsed:not(.sidebar-collapse-lock) .sidebar:focus-within .nav{
    align-items:stretch;
  }

  body.sidebar-collapsed:not(.sidebar-collapse-lock) .sidebar:hover .nav-item,
  body.sidebar-collapsed:not(.sidebar-collapse-lock) .sidebar:hover button.nav-item,
  body.sidebar-collapsed:not(.sidebar-collapse-lock) .sidebar:focus-within .nav-item,
  body.sidebar-collapsed:not(.sidebar-collapse-lock) .sidebar:focus-within button.nav-item{
    width:100% !important;
    min-height:44px;
    padding:10px 12px !important;
    justify-content:flex-start;
    gap:12px;
    margin:0;
  }

  body.sidebar-collapsed:not(.sidebar-collapse-lock) .sidebar:hover .nav-group,
  body.sidebar-collapsed:not(.sidebar-collapse-lock) .sidebar:focus-within .nav-group{
    width:100%;
    align-items:stretch;
  }

  body.sidebar-collapsed:not(.sidebar-collapse-lock) .sidebar:hover .nav-sub,
  body.sidebar-collapsed:not(.sidebar-collapse-lock) .sidebar:focus-within .nav-sub{
    position:static;
    left:auto;
    top:auto;
    min-width:0;
    margin-left:8px;
    padding:8px 0 8px 10px;
    border:none;
    border-left:2px dashed rgba(50,50,50,.24);
    border-radius:0;
    background:transparent;
    box-shadow:none;
  }

  body.sidebar-collapsed:not(.sidebar-collapse-lock) .sidebar:hover .nav-sub .nav-item,
  body.sidebar-collapsed:not(.sidebar-collapse-lock) .sidebar:focus-within .nav-sub .nav-item{
    width:100% !important;
    margin:0;
  }

  body.sidebar-collapsed:not(.sidebar-collapse-lock) .sidebar:hover .nav-sub .nav-label,
  body.sidebar-collapsed:not(.sidebar-collapse-lock) .sidebar:focus-within .nav-sub .nav-label{
    display:inline !important;
  }
}

html.theme-dark body.sidebar-collapsed:not(.sidebar-collapse-lock) .sidebar:hover,
html.theme-dark body.sidebar-collapsed:not(.sidebar-collapse-lock) .sidebar:focus-within{
  box-shadow:4px 0 0 var(--line), 16px 0 30px rgba(0,0,0,.35);
}
html.theme-dark body.sidebar-collapsed:not(.sidebar-collapse-lock) .sidebar:hover .nav-sub,
html.theme-dark body.sidebar-collapsed:not(.sidebar-collapse-lock) .sidebar:focus-within .nav-sub{
  border-left:2px dashed rgba(255,255,255,.18);
}


/* ===== TriVion custom checkbox (isolado, não afeta inputs comuns) ===== */
.trivion-check {
  --input-focus: var(--primary, #2d8cf0);
  --input-out-of-focus: #f2f3f5;
  --bg-color: #ffffff;
  --bg-color-alt: #666666;
  --main-color: var(--line, #323232);
  --check-size: 24px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--check-size);
  min-width: var(--check-size);
  height: var(--check-size);
  cursor: pointer;
  line-height: 0;
  flex: 0 0 auto;
}

.trivion-check input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  cursor: pointer;
  z-index: 2;
}

.trivion-check .checkmark {
  width: var(--check-size);
  height: var(--check-size);
  position: relative;
  top: 0;
  left: 0;
  border: 2px solid var(--main-color);
  border-radius: 5px;
  box-shadow: 3px 3px var(--main-color);
  background-color: var(--input-out-of-focus);
  transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.trivion-check input:checked ~ .checkmark {
  background-color: var(--input-focus);
}

.trivion-check .checkmark:after {
  content: "";
  width: 6px;
  height: 12px;
  position: absolute;
  top: 2px;
  left: 7px;
  display: none;
  border: solid var(--bg-color);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

.trivion-check input:checked ~ .checkmark:after {
  display: block;
}

.trivion-check:hover .checkmark {
  transform: translateY(-1px);
}

.trivion-check input:focus-visible ~ .checkmark {
  box-shadow: 3px 3px var(--main-color), 0 0 0 4px rgba(79,124,255,.16);
}

.trivion-check input:disabled ~ .checkmark {
  opacity: .58;
  cursor: not-allowed;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.checkbox-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255,255,255,.82);
  box-shadow: 3px 3px var(--line);
  cursor: pointer;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.checkbox-card:hover {
  border-color: rgba(79,124,255,.38);
  transform: translateY(-1px);
}

.checkbox-card:focus-within {
  border-color: rgba(79,124,255,.58);
}

.checkbox-card-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.checkbox-card-content strong {
  color: var(--text);
  line-height: 1.3;
}

.checkbox-card-content small {
  line-height: 1.35;
}

html.theme-dark .trivion-check {
  --input-out-of-focus: #1d2636;
  --bg-color: #ffffff;
  --main-color: rgba(159,174,201,.42);
}

html.theme-dark .trivion-check input:focus-visible ~ .checkmark {
  box-shadow: 3px 3px var(--main-color), 0 0 0 4px rgba(217,166,255,.16);
}

html.theme-dark .checkbox-card {
  background: linear-gradient(180deg, rgba(28,36,53,.98) 0%, rgba(22,29,43,.98) 100%);
  border-color: rgba(159,174,201,.16);
  box-shadow: 3px 3px rgba(0,0,0,.22);
}

html.theme-dark .checkbox-card:hover {
  border-color: rgba(217,166,255,.38);
}

@media (max-width: 640px) {
  .trivion-check { --check-size: 22px; }
  .trivion-check .checkmark { box-shadow: 2px 2px var(--main-color); }
  .trivion-check .checkmark:after { width: 5px; height: 11px; top: 2px; left: 6px; }
  .checkbox-grid { grid-template-columns: 1fr; }
  .checkbox-card { gap: 10px; padding: 11px; }
}

/* ===== SaaS Planos: módulos compactos ===== */
.saas-plans-editor{
  display:grid;
  grid-template-columns:minmax(280px,.9fr) minmax(360px,1.1fr);
  gap:12px;
  margin-top:12px;
  align-items:start;
}
.saas-plan-commercial,
.saas-modules-form{
  padding:12px;
  display:grid;
  gap:8px;
  align-self:start;
}
.saas-module-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(145px,1fr));
  gap:8px;
  margin-top:6px;
  align-items:stretch;
}
.saas-module-card{
  display:grid;
  grid-template-columns:22px minmax(0,1fr);
  gap:8px;
  align-items:start;
  padding:8px 9px;
  min-height:54px;
  border:1.5px solid var(--line);
  border-radius:10px;
  background:rgba(255,255,255,.72);
  cursor:pointer;
  box-shadow:2px 2px var(--line);
  transition:border-color .16s ease, background-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.saas-module-card:hover{
  border-color:rgba(45,140,240,.45);
  transform:translateY(-1px);
}
.saas-module-card:focus-within{
  border-color:#2d8cf0;
  box-shadow:2px 2px var(--line),0 0 0 3px rgba(45,140,240,.12);
}
.saas-module-card .trivion-check{
  --input-focus:#2d8cf0;
  --input-out-of-focus:#f7f7f7;
  --bg-color:#ffffff;
  --main-color:#323232;
  --check-size:16px;
  width:var(--check-size);
  min-width:var(--check-size);
  height:var(--check-size);
  margin-top:2px;
}
.saas-module-card .trivion-check input{
  position:absolute;
  opacity:0;
  inset:0;
  width:100% !important;
  height:100% !important;
  margin:0 !important;
  padding:0 !important;
  cursor:pointer;
  z-index:2;
}
.saas-module-card .trivion-check .checkmark{
  width:var(--check-size);
  height:var(--check-size);
  border:1.8px solid var(--main-color);
  border-radius:4px;
  box-shadow:2px 2px var(--main-color);
  background-color:var(--input-out-of-focus);
  transition:all .18s ease;
}
.saas-module-card .trivion-check input:checked ~ .checkmark{
  background-color:var(--input-focus);
}
.saas-module-card .trivion-check .checkmark:after{
  content:"";
  width:4px;
  height:8px;
  position:absolute;
  top:1px;
  left:5px;
  display:none;
  border:solid var(--bg-color);
  border-width:0 2px 2px 0;
  transform:rotate(45deg);
}
.saas-module-card .trivion-check input:checked ~ .checkmark:after{display:block;}
.saas-module-card-text{
  display:flex;
  flex-direction:column;
  gap:2px;
  min-width:0;
  line-height:1.2;
}
.saas-module-card-text strong{
  color:var(--text);
  font-size:13px;
  line-height:1.2;
  word-break:normal;
  overflow-wrap:anywhere;
}
.saas-module-card-text small{
  color:var(--muted);
  font-size:11px;
  line-height:1.25;
  overflow-wrap:anywhere;
}
html.theme-dark .saas-module-card{
  background:linear-gradient(180deg,rgba(28,36,53,.98) 0%,rgba(22,29,43,.98) 100%);
  border-color:rgba(159,174,201,.16);
  box-shadow:2px 2px rgba(0,0,0,.22);
}
html.theme-dark .saas-module-card:hover{border-color:rgba(217,166,255,.38);}
html.theme-dark .saas-module-card .trivion-check{
  --input-focus:#d9a6ff;
  --input-out-of-focus:#20293a;
  --bg-color:#171d2a;
  --main-color:rgba(159,174,201,.62);
}
@media (max-width:1100px){
  .saas-plans-editor{grid-template-columns:1fr;}
  .saas-module-grid{grid-template-columns:repeat(auto-fill,minmax(135px,1fr));}
}
@media (max-width:560px){
  .saas-plan-commercial,.saas-modules-form{padding:10px;}
  .saas-module-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;}
  .saas-module-card{grid-template-columns:20px minmax(0,1fr);gap:7px;padding:7px;min-height:50px;box-shadow:1.5px 1.5px var(--line);}
  .saas-module-card .trivion-check{--check-size:14px;margin-top:2px;}
  .saas-module-card .trivion-check .checkmark{box-shadow:1.5px 1.5px var(--main-color);}
  .saas-module-card .trivion-check .checkmark:after{width:3.5px;height:7px;top:.8px;left:4.3px;border-width:0 1.8px 1.8px 0;}
  .saas-module-card-text strong{font-size:12px;}
  .saas-module-card-text small{font-size:10px;}
}

/* ===== Correção global dos campos no modo claro/escuro =====
   Mantém o checkbox SaaS intacto e corrige somente campos editáveis comuns. */
body input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]),
body select,
body textarea{
  background:#ffffff;
  color:#323232;
  border-color:var(--line);
}
body input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"])::placeholder,
body textarea::placeholder{
  color:#777777;
}
html.theme-dark body input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]),
html.theme-dark body select,
html.theme-dark body textarea{
  background:#151a26;
  color:var(--text);
  border-color:var(--line);
}
html.theme-dark body input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"])::placeholder,
html.theme-dark body textarea::placeholder{
  color:#8c95aa;
}

/* ===== Fix definitivo: campos claros no tema claro =====
   Não altera checkboxes/radios e preserva o checkbox customizado do SaaS. */
html:not(.theme-dark) body input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="file"]),
html:not(.theme-dark) body select,
html:not(.theme-dark) body textarea,
body:not(.theme-dark) input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="file"]),
body:not(.theme-dark) select,
body:not(.theme-dark) textarea{
  background:#ffffff !important;
  background-color:#ffffff !important;
  color:#1f2937 !important;
  border-color:#323232 !important;
}
html:not(.theme-dark) body input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="file"])::placeholder,
html:not(.theme-dark) body textarea::placeholder,
body:not(.theme-dark) input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="file"])::placeholder,
body:not(.theme-dark) textarea::placeholder{
  color:#6b7280 !important;
  opacity:1 !important;
}
html.theme-dark body input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="file"]),
html.theme-dark body select,
html.theme-dark body textarea,
body.theme-dark input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="file"]),
body.theme-dark select,
body.theme-dark textarea{
  background:#151a26 !important;
  background-color:#151a26 !important;
  color:var(--text) !important;
  border-color:var(--line) !important;
}
html.theme-dark body input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="file"])::placeholder,
html.theme-dark body textarea::placeholder,
body.theme-dark input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="file"])::placeholder,
body.theme-dark textarea::placeholder{
  color:#8c95aa !important;
  opacity:1 !important;
}


/* ===== v6.8.2 — Login com retorno ao portal e fundo oldschool sutil ===== */
.login-page-modern.bg,
html.theme-dark .login-page-modern.bg{
  position:relative;
  overflow:hidden;
  min-height:100vh;
  isolation:isolate;
  background:
    radial-gradient(circle at 18% 16%, rgba(217,166,255,.32), transparent 26%),
    radial-gradient(circle at 84% 22%, rgba(154,202,255,.24), transparent 28%),
    radial-gradient(circle at 50% 92%, rgba(255,226,171,.28), transparent 32%),
    linear-gradient(135deg,#f9f7ff 0%,#eef5ff 48%,#fff8ea 100%);
}

.login-page-modern::before{
  content:'';
  position:fixed;
  inset:-80px;
  z-index:-3;
  pointer-events:none;
  background-image:
    linear-gradient(rgba(50,50,50,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(50,50,50,.055) 1px, transparent 1px),
    radial-gradient(circle, rgba(195,124,255,.20) 1px, transparent 1.8px);
  background-size:42px 42px,42px 42px,18px 18px;
  background-position:0 0,0 0,8px 8px;
  opacity:.82;
  animation:loginGridDrift 24s linear infinite;
}

.login-page-modern::after{
  content:'';
  position:fixed;
  inset:0;
  z-index:-2;
  pointer-events:none;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.18) 0, rgba(255,255,255,.18) 1px, transparent 1px, transparent 5px),
    linear-gradient(90deg, transparent, rgba(255,255,255,.46), transparent);
  opacity:.36;
  animation:loginSoftScan 8s ease-in-out infinite;
}

.auth-shell-login{
  position:relative;
  z-index:1;
  width:100%;
  min-height:calc(100vh - 40px);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:22px;
}

.auth-shell-login .auth-container{
  position:relative;
  z-index:2;
}

.login-card-modern{
  position:relative;
  overflow:hidden;
  backdrop-filter:blur(8px);
}

.login-card-modern::before{
  content:'';
  position:absolute;
  inset:0;
  pointer-events:none;
  background:linear-gradient(135deg, rgba(255,255,255,.38), transparent 42%);
  opacity:.55;
}

.login-card-modern > *{
  position:relative;
  z-index:1;
}

.auth-card-toolbar{
  display:flex;
  justify-content:flex-start;
  margin-bottom:12px;
}

.auth-portal-back{
  min-height:36px;
  padding:8px 12px;
  font-size:13px;
  font-weight:700;
  display:inline-flex;
  align-items:center;
  gap:7px;
  background:#ffffff;
  text-decoration:none;
}

.auth-portal-back span{
  font-size:16px;
  line-height:1;
  transform:translateY(-1px);
}

.login-retro-orb{
  position:fixed;
  z-index:-1;
  pointer-events:none;
  border:2px solid rgba(50,50,50,.10);
  box-shadow:8px 8px rgba(50,50,50,.08);
  opacity:.72;
  animation:loginOrbFloat 12s ease-in-out infinite;
}

.login-retro-orb.orb-one{
  width:96px;
  height:96px;
  border-radius:24px;
  background:rgba(217,166,255,.22);
  top:14%;
  left:12%;
}

.login-retro-orb.orb-two{
  width:74px;
  height:74px;
  border-radius:50%;
  background:rgba(154,202,255,.20);
  right:14%;
  top:18%;
  animation-delay:-4s;
}

.login-retro-orb.orb-three{
  width:118px;
  height:64px;
  border-radius:999px;
  background:rgba(255,226,171,.24);
  left:14%;
  bottom:15%;
  animation-delay:-7s;
}

@keyframes loginGridDrift{
  from{transform:translate3d(0,0,0);}
  to{transform:translate3d(42px,42px,0);}
}

@keyframes loginSoftScan{
  0%,100%{transform:translateX(-18px);opacity:.28;}
  50%{transform:translateX(18px);opacity:.42;}
}

@keyframes loginOrbFloat{
  0%,100%{transform:translate3d(0,0,0) rotate(0deg);}
  50%{transform:translate3d(10px,-14px,0) rotate(2deg);}
}

@media (prefers-reduced-motion: reduce){
  .login-page-modern::before,
  .login-page-modern::after,
  .login-retro-orb{
    animation:none !important;
  }
}

@media (max-width: 560px){
  .auth-shell-login{padding:14px;}
  .login-retro-orb{display:none;}
  .auth-card-toolbar{margin-bottom:10px;}
  .auth-portal-back{width:100%;justify-content:center;}
}
