/* Kaio Eletro Control v0.2.1 — segurança, integridade e mobile compacto */
:root{--bottom-nav-height:66px}

/* Navegação e ações diretas */
.nav-logout{margin:8px 0 0}.nav-logout .nav-danger{display:flex;width:100%;min-height:44px;align-items:center;border:1px solid transparent;border-radius:11px;background:transparent;color:#ffc7c2;padding:10px 13px;font:inherit;font-weight:650;cursor:pointer;text-align:left}.nav-logout .nav-danger:hover{background:rgba(180,35,24,.16)}
.quick-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:14px}.quick-actions a{display:grid;grid-template-columns:38px minmax(0,1fr);grid-template-rows:auto auto;column-gap:10px;align-items:center;min-height:76px;padding:13px 14px;border:1px solid var(--line);border-radius:14px;background:#fff;box-shadow:0 4px 16px rgba(16,24,40,.035);color:var(--text)}.quick-actions a:hover{border-color:#a9bee2;transform:translateY(-1px);box-shadow:0 8px 20px rgba(16,24,40,.07)}.quick-actions span{grid-row:1/3;display:grid;place-items:center;width:38px;height:38px;border-radius:12px;background:var(--primary-soft);color:var(--primary);font-weight:900}.quick-actions strong{font-size:13px;line-height:1.25}.quick-actions small{color:var(--muted);font-size:10px;line-height:1.3}
.mobile-bottom-nav{display:none}

/* Formulários mais fáceis */
.compact-form{max-width:1080px}.form-section-intro{display:grid;gap:2px;padding:12px 14px;border:1px solid #d5e1f5;border-radius:12px;background:#f5f8ff}.form-section-intro strong{font-size:13px}.form-section-intro span{font-size:11px;color:var(--muted)}
.step-heading{display:flex;align-items:center;gap:10px;margin:8px 0 -4px;padding:10px 0;border-bottom:1px solid var(--line)}.step-heading>span{display:grid;place-items:center;width:30px;height:30px;border-radius:10px;background:var(--primary);color:#fff;font-weight:900}.step-heading>div{display:grid;gap:1px}.step-heading strong{font-size:14px}.step-heading small{color:var(--muted);font-size:11px}
.optional-fields{border:1px solid var(--line);border-radius:12px;background:#fbfcfe;overflow:hidden}.optional-fields>summary{cursor:pointer;padding:12px 14px;font-weight:750;color:#344054;list-style:none}.optional-fields>summary::-webkit-details-marker{display:none}.optional-fields>summary:after{content:'+';float:right;color:var(--primary);font-size:18px;line-height:1}.optional-fields[open]>summary:after{content:'−'}.optional-fields[open]>summary{border-bottom:1px solid var(--line);background:#f7f9fc}.optional-fields .details-grid{padding:14px}.details-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px 16px}
.compact-alert{margin:0;padding:10px 12px;font-size:12px}.button:disabled{opacity:.55;cursor:not-allowed;transform:none!important}.sticky-mobile-actions{z-index:8}

/* PIX */
.compact-pix{max-width:680px;margin-inline:auto}.pix-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.pix-heading h2{margin:0}.pix-heading p{margin:4px 0 0;color:var(--muted)}.environment-badge{display:inline-flex;border-radius:999px;padding:6px 9px;font-size:10px;font-weight:850;text-transform:uppercase;letter-spacing:.04em}.environment-badge.production{background:var(--green-soft);color:var(--green)}.environment-badge.test{background:var(--yellow-soft);color:var(--yellow)}.full-width-mobile{display:inline-flex}

/* Saúde do sistema */
.health-overview{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:14px}.health-card{display:grid;gap:3px;padding:15px;border:1px solid var(--line);border-radius:14px;background:#fff;box-shadow:0 4px 16px rgba(16,24,40,.035)}.health-card:before{content:'';width:9px;height:9px;border-radius:50%;margin-bottom:3px;background:#98a2b3}.health-card.ok:before{background:#16a05d}.health-card.warning:before{background:#e7a614}.health-card span{font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.04em;color:var(--muted)}.health-card strong{font-size:17px}.health-card small{font-size:10px;color:var(--muted)}.health-grid{align-items:start}.health-list{display:grid}.health-list>div{display:flex;gap:10px;padding:11px 0;border-bottom:1px solid var(--line)}.health-list>div:last-child{border-bottom:0}.health-dot{flex:0 0 10px;width:10px;height:10px;margin-top:5px;border-radius:50%;background:#98a2b3}.health-dot.ok{background:#16a05d}.health-list p{display:grid;gap:2px;margin:0;min-width:0}.health-list strong{font-size:12px}.health-list small{color:var(--muted);font-size:10px}.health-list em{color:var(--red);font-size:10px;font-style:normal;overflow-wrap:anywhere}.health-dl{display:grid;grid-template-columns:145px minmax(0,1fr);gap:9px 12px}.health-dl dt{color:var(--muted);font-size:11px}.health-dl dd{margin:0;font-size:12px;font-weight:700;overflow-wrap:anywhere}.simple-steps{display:grid;grid-template-columns:auto 1fr auto 1fr auto 1fr;gap:9px;align-items:start}.simple-steps>span{display:grid;place-items:center;width:27px;height:27px;border-radius:9px;background:var(--primary-soft);color:var(--primary);font-weight:850}.simple-steps p{display:grid;gap:2px;margin:0}.simple-steps strong{font-size:12px}.simple-steps small{font-size:10px;color:var(--muted)}

/* Segurança do usuário */
.security-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-bottom:14px}.security-summary>div{display:grid;gap:2px}.security-summary span{font-size:10px;color:var(--muted);text-transform:uppercase;font-weight:800}.security-summary strong{font-size:14px}.security-summary small{font-size:10px;color:var(--muted)}.security-grid{align-items:start}.stack-form{display:grid;gap:12px}.security-state{display:grid;gap:3px;border:1px solid var(--line);border-radius:12px;padding:12px;margin:12px 0}.security-state.ok{background:var(--green-soft);border-color:#b9e2c9;color:var(--green)}.security-state.warning{background:var(--yellow-soft);border-color:#efd8a7;color:#704700}.security-state span{font-size:11px}.login-security-note{display:block;text-align:center;color:var(--muted);font-size:10px;line-height:1.4}

/* Aviso de sessão */
.session-warning{position:fixed;right:16px;bottom:16px;z-index:120;display:grid;gap:8px;max-width:330px;padding:14px;border:1px solid #efd8a7;border-radius:14px;background:#fff9e9;box-shadow:0 18px 44px rgba(16,24,40,.18)}.session-warning strong{font-size:13px}.session-warning span{font-size:11px;color:#704700}.session-warning .button{justify-self:end}

@media(max-width:1100px){.quick-actions{grid-template-columns:repeat(2,minmax(0,1fr))}.health-overview{grid-template-columns:repeat(2,minmax(0,1fr))}}

@media(max-width:900px){
  .main{padding-bottom:calc(var(--bottom-nav-height) + 30px)}
  .mobile-bottom-nav{position:fixed;display:grid;grid-template-columns:repeat(5,1fr);left:0;right:0;bottom:0;z-index:70;height:calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));padding:5px 5px env(safe-area-inset-bottom);border-top:1px solid #d5deeb;background:rgba(255,255,255,.97);box-shadow:0 -8px 24px rgba(16,24,40,.09);backdrop-filter:blur(14px)}
  .mobile-bottom-nav a,.mobile-bottom-nav button{display:grid;place-items:center;align-content:center;gap:2px;border:0;background:transparent;color:#667085;font:inherit;font-size:9px;font-weight:750;cursor:pointer;min-width:0;padding:2px}
  .mobile-bottom-nav span{display:grid;place-items:center;min-width:25px;height:25px;border-radius:9px;font-size:11px;font-weight:900;color:#475467}
  .mobile-bottom-nav a.active{color:var(--primary)}.mobile-bottom-nav a.active span{background:var(--primary-soft);color:var(--primary)}
  .sidebar{padding-bottom:calc(var(--bottom-nav-height) + 25px)}
  .topbar p{max-width:70vw;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
}

@media(max-width:720px){
  :root{--radius:13px}
  body{line-height:1.42}.main{padding:9px 8px calc(var(--bottom-nav-height) + 24px)}.topbar{margin:-9px -8px 11px;padding:8px}.topbar-main{gap:8px}.topbar h1{font-size:18px}.topbar p{font-size:9.5px}.topbar #menuToggle{width:38px;height:38px}
  .panel{padding:11px}.panel h2{font-size:15px}.panel-head{margin-bottom:8px}.metrics{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px}.metrics article{padding:11px 10px}.metrics span{font-size:8.5px}.metrics strong{font-size:17px}.metrics small{font-size:8px;color:var(--muted)}
  .quick-actions{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin-bottom:10px}.quick-actions a{grid-template-columns:31px minmax(0,1fr);min-height:63px;padding:9px;border-radius:12px;column-gap:8px}.quick-actions span{width:31px;height:31px;border-radius:10px}.quick-actions strong{font-size:11.5px}.quick-actions small{font-size:8.5px}
  .grid-two{gap:10px}.form-grid{gap:11px}.compact-form{padding:11px}.form-section-intro{padding:9px 10px}.step-heading{padding:7px 0}.step-heading>span{width:27px;height:27px}.optional-fields>summary{padding:10px 11px;font-size:12px}.optional-fields .details-grid{padding:10px}.details-grid{grid-template-columns:1fr;gap:10px}
  input,select,textarea{min-height:40px;padding:8px 10px;font-size:13px}textarea{min-height:82px}label{gap:5px;font-size:11.5px}label small,.help{font-size:9.5px}.button{min-height:40px;padding:8px 10px;font-size:11.5px}
  .sticky-mobile-actions{position:sticky;bottom:calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 5px);display:grid!important;grid-template-columns:1fr 1.3fr!important;gap:7px;margin:5px -4px -4px;padding:8px;border:1px solid var(--line);border-radius:12px;background:rgba(255,255,255,.96);box-shadow:0 10px 30px rgba(16,24,40,.12);backdrop-filter:blur(10px)}.sticky-mobile-actions .button{width:100%}.sticky-mobile-actions.single-action{grid-template-columns:1fr!important}
  .responsive-table tr{margin-bottom:7px;padding:6px 9px}.responsive-table td{grid-template-columns:minmax(82px,34%) minmax(0,1fr);gap:7px;padding:6px 1px}.responsive-table td:before{font-size:8.5px}.responsive-table td,.responsive-table td strong{font-size:11px}.responsive-table td small{font-size:8.5px}.row-actions{display:grid;grid-template-columns:1fr 1fr;width:100%}.row-actions a{justify-content:center;text-align:center;padding:7px!important;font-size:9.5px!important}
  .collection-item{padding:10px}.collection-main{gap:8px}.collection-customer strong{font-size:12px}.collection-customer span,.collection-due span{font-size:9px}.collection-values strong{font-size:15px}.collection-actions{gap:6px}.collection-actions .button{min-height:38px;font-size:10px}.collection-pix-status{font-size:9px}
  .health-overview{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.health-card{padding:10px}.health-card strong{font-size:14px}.health-card small{font-size:8.5px}.health-dl{grid-template-columns:105px minmax(0,1fr);gap:7px}.simple-steps{grid-template-columns:auto 1fr;gap:8px}.security-summary{grid-template-columns:1fr;gap:9px}.security-summary>div{padding-bottom:8px;border-bottom:1px solid var(--line)}.security-summary>div:last-child{border-bottom:0}.pix-heading{align-items:center}.compact-pix img{max-width:260px}.pix-actions{grid-template-columns:1fr 1fr}.full-width-mobile{display:flex;width:100%;justify-content:center}
  .auto-payment-card{padding:11px}.auto-payment-icon{width:36px;height:36px;flex-basis:36px}.auto-payment-amount{font-size:19px}.auto-payment-customer{font-size:12px}.auto-payment-details{font-size:9px}
  .chart{height:155px}.list a{padding:10px 78px 10px 0}.list a strong{font-size:11px}.list a span{font-size:8.5px}.list a em{font-size:9px}
  .session-warning{left:8px;right:8px;bottom:calc(var(--bottom-nav-height) + 10px);max-width:none}
}

@media(max-width:390px){
  .topbar p{max-width:62vw}.quick-actions a{min-height:58px}.quick-actions small{display:none}.health-card strong{font-size:12px}.responsive-table td{grid-template-columns:1fr;text-align:left;gap:2px}.row-actions{grid-template-columns:1fr}.pix-actions{grid-template-columns:1fr}
}

@media print{.mobile-bottom-nav,.session-warning{display:none!important}}
