/* Camada visual e responsiva do ZapObras. Não altera regras de negócio. */
body{line-height:1.45;}
button,input,select,textarea{touch-action:manipulation;}
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,[tabindex]:focus-visible{outline:3px solid rgba(232,160,32,.45);outline-offset:2px;}
.topbar-heading{min-width:0;}
.topbar-subtitle{font-size:10px;color:var(--text3);margin-top:1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:420px;}
.sidebar-support{border-top:1px solid rgba(255,255,255,.08);padding:10px;display:grid;gap:6px;}
.sidebar-support button{width:100%;border:0;border-radius:8px;padding:9px 10px;background:rgba(255,255,255,.06);color:rgba(255,255,255,.76);font:500 11px 'DM Sans',sans-serif;text-align:left;cursor:pointer;}
.sidebar-support button:hover,.sidebar-support button:focus-visible{background:rgba(232,160,32,.14);color:var(--accent);}
.sidebar.collapsed .sidebar-support{padding:8px 6px;}
.sidebar.collapsed .sidebar-support button{font-size:0;text-align:center;padding:9px 4px;}
.sidebar.collapsed .sidebar-support button::first-letter{font-size:16px;}

.page-guide{background:linear-gradient(135deg,#fffaf0 0%,#fff 58%);border:1px solid #efd9ad;border-radius:16px;padding:16px 18px;margin-bottom:18px;box-shadow:0 3px 18px rgba(80,57,18,.06);}
.page-guide-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;}
.page-guide-title{display:flex;align-items:flex-start;gap:12px;min-width:0;}
.page-guide-icon{width:38px;height:38px;border-radius:11px;background:var(--brand);color:var(--accent);display:grid;place-items:center;font-size:19px;flex:0 0 auto;}
.page-guide-kicker{font-size:10px;line-height:1.2;color:#8b651f;text-transform:uppercase;letter-spacing:.8px;font-weight:700;margin-bottom:3px;}
.page-guide h2{font-size:16px;color:var(--brand);margin:0 0 3px;}
.page-guide-summary{font-size:12px;color:var(--text2);max-width:760px;}
.page-guide-toggle{border:1px solid #e6cf9f;background:#fff;color:var(--text2);border-radius:8px;padding:6px 9px;cursor:pointer;font:600 11px 'DM Sans',sans-serif;white-space:nowrap;}
.page-guide-body{margin-top:10px;}
.page-guide-steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;counter-reset:guide-step;}
.page-guide-step{position:relative;background:rgba(255,255,255,.82);border:1px solid #eee3ce;border-radius:10px;padding:9px 10px;font-size:11px;color:var(--text2);min-height:44px;display:flex;align-items:center;}
.page-guide-step::before{display:none;}
.page-guide-footer{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:9px;}
.page-guide-tip{flex:1;padding:8px 10px;border-radius:8px;background:#eef6ff;color:#315f83;font-size:11px;}
.page-guide-tour{border:0;background:transparent;color:#76520d;text-decoration:underline;font:600 11px 'DM Sans',sans-serif;cursor:pointer;white-space:nowrap;padding:7px;}
.page-guide.collapsed{padding:11px 14px;}
.page-guide.collapsed .page-guide-body{display:none;}
.page-guide.collapsed .page-guide-summary{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:min(760px,65vw);}
.page-guide.collapsed .page-guide-icon{width:30px;height:30px;font-size:15px;}
.page-guide.collapsed h2{font-size:13px;margin:2px 0 0;}

.mobile-scroll-hint{display:none;font-size:11px;color:#705014;background:#fff8e8;border:1px solid #efd9ad;border-radius:8px;padding:7px 10px;margin:8px 10px 0;}
.modal-helper{font-size:12px;color:var(--text2);background:#f7f9fc;border-bottom:1px solid var(--border);padding:9px 20px;}
.ux-toast{position:fixed;right:20px;bottom:20px;z-index:3000;max-width:340px;padding:11px 14px;border-radius:10px;background:var(--brand);color:#fff;box-shadow:var(--shadow-lg);font-size:12px;opacity:0;transform:translateY(12px);pointer-events:none;transition:.2s;}
.ux-toast.show{opacity:1;transform:translateY(0);}
.ux-tour-overlay{position:fixed;inset:0;background:rgba(14,17,31,.65);z-index:2500;display:none;align-items:center;justify-content:center;padding:18px;}
.ux-tour-overlay.open{display:flex;}
.ux-tour{width:min(680px,100%);max-height:92vh;overflow:auto;background:var(--surface);border-radius:18px;box-shadow:var(--shadow-lg);}
.ux-tour-header{padding:20px 22px 16px;background:linear-gradient(135deg,var(--brand),var(--brand2));color:#fff;border-radius:18px 18px 0 0;display:flex;justify-content:space-between;gap:12px;}
.ux-tour-header h2{font-family:'DM Serif Display',serif;font-size:22px;color:var(--accent);}
.ux-tour-header p{font-size:12px;color:rgba(255,255,255,.72);margin-top:3px;}
.ux-tour-close{border:0;background:rgba(255,255,255,.1);color:#fff;width:34px;height:34px;border-radius:9px;font-size:20px;cursor:pointer;flex:0 0 auto;}
.ux-tour-body{padding:20px 22px;}
.ux-tour-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
.ux-tour-card{border:1px solid var(--border);border-radius:12px;padding:13px;}
.ux-tour-card strong{display:block;font-size:13px;color:var(--brand);margin-bottom:4px;}
.ux-tour-card p{font-size:11px;color:var(--text2);}
.ux-tour-footer{padding:13px 22px;border-top:1px solid var(--border);display:flex;justify-content:flex-end;}
.ux-page-tutorial-overlay{position:fixed;inset:0;background:rgba(14,17,31,.65);z-index:2550;display:none;align-items:center;justify-content:center;padding:18px;}
.ux-page-tutorial-overlay.open{display:flex;}
.ux-page-tutorial{width:min(680px,100%);max-height:92vh;overflow:auto;background:var(--surface);border-radius:18px;box-shadow:var(--shadow-lg);}
.ux-page-tutorial-header{padding:20px 22px 16px;background:linear-gradient(135deg,#fffaf0,#fff);display:grid;grid-template-columns:auto 1fr auto;align-items:start;gap:12px;border-bottom:1px solid #efd9ad;}
.ux-page-tutorial-header h2{font-family:'DM Serif Display',serif;font-size:22px;color:var(--brand);margin:0 0 4px;}
.ux-page-tutorial-header p{font-size:12px;color:var(--text2);}
.ux-page-tutorial-header .ux-tour-close{background:#eef1f5;color:var(--brand);}
.ux-page-tutorial-icon{width:42px;height:42px;border-radius:12px;background:var(--brand);color:var(--accent);display:grid;place-items:center;font-size:20px;}
.ux-page-tutorial-body{padding:20px 22px;}
.ux-page-tutorial-steps{display:grid;gap:9px;margin-bottom:12px;}
.ux-page-tutorial-step{border:1px solid var(--border);border-radius:10px;padding:11px 12px;font-size:12px;color:var(--text2);}

@media(max-width:768px){
  :root{--radius:10px;}
  body{font-size:14px;}
  .topbar{gap:8px;min-height:58px;}
  .topbar>div:first-child{min-width:0;flex:1;}
  .topbar-heading{min-width:0;}
  .topbar-subtitle{max-width:48vw;font-size:9px;}
  .topbar-right{gap:5px;flex:0 0 auto;}
  .topbar-right #tdate,.topbar-right .desktop-secondary{display:none!important;}
  .topbar-right .btn{min-height:40px;padding:8px 10px;}
  #topbtn{max-width:126px;overflow:hidden;text-overflow:ellipsis;}
  .help-trigger{white-space:nowrap;}
  .content{padding:12px 10px 88px;}
  .card{margin-bottom:12px;}
  .card-header{padding:11px 12px;gap:8px;align-items:flex-start;}
  .card-header>.bg{justify-content:flex-end;}
  .card-body{padding:14px 12px;}
  .stat-grid{gap:8px;margin-bottom:14px;}
  .stat-card{padding:13px 12px;min-width:0;}
  .stat-card .sl{font-size:9px;}
  .stat-card .sv{font-size:21px;overflow-wrap:anywhere;}
  .filters{display:grid;grid-template-columns:1fr 1fr;gap:8px;align-items:stretch;}
  .filters input,.filters select{width:100%;min-width:0;min-height:44px;font-size:16px;}
  .filters .btn{min-height:44px;justify-content:center;}
  .fg input,.fg select,.fg textarea{min-height:44px;font-size:16px;}
  .btn{min-height:40px;justify-content:center;}
  .btn-xs{min-height:36px;}
  .ptabs{overflow-x:auto;scroll-snap-type:x proximity;justify-content:flex-start;}
  .ptab{min-height:38px;display:flex;align-items:center;white-space:nowrap;scroll-snap-align:start;}
  .tw{position:relative;padding-bottom:2px;}
  .tw table{min-width:680px;}
  .mobile-scroll-hint{display:block;}
  .page-guide{padding:13px 12px;margin-bottom:12px;border-radius:12px;}
  .page-guide-head{gap:8px;}
  .page-guide-icon{width:34px;height:34px;font-size:17px;}
  .page-guide h2{font-size:14px;}
  .page-guide-summary{font-size:11px;}
  .page-guide-toggle{padding:7px 8px;font-size:10px;}
  .page-guide-steps{grid-template-columns:1fr;gap:6px;}
  .page-guide-step{min-height:0;}
  .page-guide-footer{align-items:flex-start;flex-direction:column;}
  .page-guide.collapsed .page-guide-summary{max-width:58vw;}
  .modal-header{padding:14px 15px 11px;position:sticky;top:0;background:var(--surface);z-index:3;}
  .modal-helper{padding:9px 15px;}
  .modal-body{padding:15px;}
  .modal-footer{position:sticky;bottom:0;background:var(--surface);padding:10px 15px calc(10px + env(safe-area-inset-bottom));z-index:3;}
  .modal-footer .btn{flex:1;}
  .ux-tour-overlay{padding:0;align-items:flex-end;}
  .ux-tour{max-height:94dvh;border-radius:18px 18px 0 0;}
  .ux-tour-grid{grid-template-columns:1fr;}
  .ux-tour-body{padding:16px;}
  .ux-tour-header{padding:18px 16px 14px;}
  .ux-tour-footer{padding:11px 16px calc(11px + env(safe-area-inset-bottom));}
  .ux-tour-footer .btn{width:100%;}
  .ux-page-tutorial-overlay{padding:0;align-items:flex-end;}
  .ux-page-tutorial{max-height:94dvh;border-radius:18px 18px 0 0;}
  .ux-page-tutorial-header{padding:17px 15px 14px;}
  .ux-page-tutorial-body{padding:15px;}
}

@media(max-width:380px){
  .stat-grid{grid-template-columns:1fr;}
  #topbtn{max-width:106px;font-size:11px;}
  .filters{grid-template-columns:1fr;}
}

@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important;}
}


/* UX-MOBILE-TOUCH-FIX */
.topbar-title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
@media(max-width:768px){
  .menu-toggle{width:40px;height:40px;padding:8px;flex:0 0 40px;}
  .sidebar-support button{min-height:44px;font-size:12px;}
  .page-guide-toggle{min-height:40px;}
  .close-btn{width:40px;height:40px;display:grid;place-items:center;padding:0;}
  .ux-tour-close{width:44px;height:44px;}
  .topbar-subtitle{max-width:30vw;}
}


/* UX-FLEX-OVERFLOW-FIX */
.main,.content,.page{min-width:0;}
.main,.page{max-width:100%;}
.tw{max-width:100%;}
@media(max-width:768px){
  .app,.main,.content,.page{width:100%;max-width:100%;}
}


/* UX-LOGIN-MOBILE-FIX */
@media(max-width:480px){
  .login-card{margin:12px;padding:28px 22px;border-radius:16px;}
  .login-brand{margin-bottom:20px;}
  .login-divider{margin-bottom:20px;}
  .login-input{font-size:16px;min-height:48px;padding-right:48px;}
  .login-eye{right:4px;width:40px;height:40px;padding:0;display:grid;place-items:center;}
  .login-btn{min-height:48px;}
  .login-footer{margin-top:14px;}
}
