/* AdminHub V15 — PWA mobile-first compartilhado por Index, Painel e todos os módulos */
:root{
  --adminhub-safe-top:env(safe-area-inset-top,0px);
  --adminhub-safe-right:env(safe-area-inset-right,0px);
  --adminhub-safe-bottom:env(safe-area-inset-bottom,0px);
  --adminhub-safe-left:env(safe-area-inset-left,0px);
  --adminhub-touch:42px;
}
html{min-height:100%;text-size-adjust:100%;-webkit-text-size-adjust:100%;overscroll-behavior:none}
body{min-height:100%;min-height:100dvh;-webkit-tap-highlight-color:transparent}
button,input,select,textarea{font:inherit}
button,a,[role="button"]{touch-action:manipulation}
[data-pwa-install][hidden]{display:none!important}
input,select,textarea{max-width:100%}
img,svg,canvas{max-width:100%}
.pwa-install-login{display:none;width:100%;min-height:42px;margin-top:10px;border:1px solid var(--border,var(--stroke,#dbe3ef));border-radius:12px;background:var(--surface,var(--panel,#fff));color:var(--accent,#2f5ea7);font-weight:850;cursor:pointer}
.pwa-install-login[data-pwa-visible="1"]{display:flex;align-items:center;justify-content:center;gap:7px}
.pwa-ios-help{position:fixed;z-index:50000;inset:0;display:grid;place-items:end center;padding:16px max(16px,var(--adminhub-safe-right)) max(16px,var(--adminhub-safe-bottom)) max(16px,var(--adminhub-safe-left));background:rgba(15,23,42,.38);backdrop-filter:blur(7px);-webkit-backdrop-filter:blur(7px)}
.pwa-ios-card{width:min(420px,100%);background:var(--panel,#fff);color:var(--text,#0f172a);border:1px solid var(--stroke,#dbe3ef);border-radius:18px;box-shadow:0 26px 80px rgba(15,23,42,.30);padding:18px}
.pwa-ios-card h3{margin:0 0 8px;font-size:17px}.pwa-ios-card p{margin:0;color:var(--muted,#64748b);font-size:13px;line-height:1.5}.pwa-ios-card ol{margin:14px 0;padding-left:22px;font-size:13px;line-height:1.65}.pwa-ios-card button{width:100%;min-height:42px;border:0;border-radius:11px;background:var(--accent,#2f5ea7);color:#fff;font-weight:850;cursor:pointer}

/* Componentes compartilhados dos módulos */
.tableCard,.table-wrap,.table-scroll,.miniTableWrap,.pricing-table-wrap{max-width:100%;overflow:auto;-webkit-overflow-scrolling:touch}
.dataTable,.miniTable,.pricing-table,.tableCard table,.table-wrap table,.table-scroll table{border-collapse:collapse}
.modalOverlay,.modal-back,.modalWrap{padding:max(8px,var(--adminhub-safe-top)) max(8px,var(--adminhub-safe-right)) max(8px,var(--adminhub-safe-bottom)) max(8px,var(--adminhub-safe-left))}
.modal,.modal-card{max-width:calc(100vw - 16px)}
.modalBody,.modal-body{overscroll-behavior:contain;-webkit-overflow-scrolling:touch}

@media (max-width:820px){
  body{padding-left:var(--adminhub-safe-left);padding-right:var(--adminhub-safe-right)}
  input,select,textarea{font-size:16px!important}
  .btn,.iconBtn,.actBtn,.icon-btn,.tab,.config-tab,.planViewTab{min-height:var(--adminhub-touch)}

  /* Login */
  body>.login-card{width:min(420px,calc(100vw - 22px))!important;max-width:none!important;margin:max(12px,var(--adminhub-safe-top)) auto max(12px,var(--adminhub-safe-bottom))!important;padding:24px 20px!important;border-radius:18px!important}
  .login-card .brand h1{font-size:1.65rem!important}.login-card .brand p{font-size:.82rem!important}
  .login-card .form-grid{gap:14px!important}.login-card .btn-primary{min-height:48px!important}
  .login-card .wos-pop{position:fixed!important;left:12px!important;right:12px!important;top:max(64px,calc(var(--adminhub-safe-top) + 52px))!important;width:auto!important;max-width:none!important}
  .pwa-install-login[data-pwa-visible="1"]{display:flex}

  /* Shell principal: apps viram dock inferior e o conteúdo usa toda a largura */
  .shell,body[data-sidebar="collapsed"] .shell,body[data-sidebar="expanded"] .shell{display:block!important;height:100dvh!important;padding-bottom:calc(68px + var(--adminhub-safe-bottom))!important}
  .main{height:calc(100dvh - 68px - var(--adminhub-safe-bottom))!important;display:grid!important;grid-template-rows:56px minmax(0,1fr)!important;min-width:0!important}
  .sidebar{position:fixed!important;z-index:12000!important;left:0!important;right:0!important;bottom:0!important;width:auto!important;height:calc(68px + var(--adminhub-safe-bottom))!important;padding:8px max(8px,var(--adminhub-safe-right)) max(8px,var(--adminhub-safe-bottom)) max(8px,var(--adminhub-safe-left))!important;display:flex!important;flex-direction:row!important;align-items:center!important;gap:8px!important;border-right:0!important;border-top:1px solid var(--stroke,#dbe3ef)!important;overflow:hidden!important;background:color-mix(in srgb,var(--panel,#fff) 96%,transparent)!important;backdrop-filter:blur(18px)!important;-webkit-backdrop-filter:blur(18px)!important;box-shadow:0 -10px 30px rgba(15,23,42,.10)!important}
  .sidebarTitleRow,.sidebar>.divider,.appsStatus{display:none!important}
  #btnAddApp{flex:0 0 48px!important;width:48px!important;height:48px!important;min-height:48px!important;padding:0!important;border-radius:14px!important}
  #btnAddApp .txt,#btnAddApp .ic{display:none!important}#btnAddApp .mini{display:flex!important;align-items:center!important;justify-content:center!important;font-size:0!important}#btnAddApp .mini i{font-size:18px!important}
  .appsPane{flex:1!important;min-width:0!important;padding:0!important;display:block!important}
  .appsList{height:52px!important;display:flex!important;flex-direction:row!important;align-items:center!important;gap:8px!important;overflow-x:auto!important;overflow-y:hidden!important;padding:2px!important;scrollbar-width:none!important}.appsList::-webkit-scrollbar{display:none!important}
  .appCard{flex:0 0 48px!important;width:48px!important;height:48px!important;min-width:48px!important;padding:0!important;border-radius:14px!important;display:flex!important;align-items:center!important;justify-content:center!important;box-shadow:none!important}
  .appCard .appMeta,.appCard>.dot{display:none!important}.appCard .appBadge{display:flex!important;width:100%!important;height:100%!important;border-radius:13px!important;font-size:0!important}.appCard .appBadge i{font-size:18px!important}
  .topbar{height:56px!important;min-height:56px!important;padding:calc(5px + var(--adminhub-safe-top)) max(7px,var(--adminhub-safe-right)) 5px max(7px,var(--adminhub-safe-left))!important;gap:5px!important;position:sticky!important;top:0!important;z-index:11000!important}
  .topLeft{min-width:0!important;gap:4px!important}.hello{font-size:.82rem!important;max-width:92px!important}.helloHi{display:none!important}.helloName{overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;display:block!important}
  .topRight{min-width:0!important;gap:1px!important;overflow-x:auto!important;scrollbar-width:none!important}.topRight::-webkit-scrollbar{display:none!important}
  .iconBtn{flex:0 0 34px!important;width:34px!important;height:34px!important;min-height:34px!important;border-radius:10px!important}.iconBtn i{font-size:18px!important}
  .statusChip{font-size:0!important;width:34px!important;height:34px!important;padding:0!important;justify-content:center!important}.statusChip .dotMini{width:9px!important;height:9px!important;margin:0!important}
  .avatarBtn{flex:0 0 34px!important;width:34px!important;height:34px!important;font-size:.75rem!important}
  .content{height:auto!important;min-height:0!important;overflow:auto!important;padding:10px!important;padding-bottom:14px!important}
  .dashboardModuleWrap,.dashboardFrame{min-height:calc(100dvh - 150px)!important;border-radius:12px!important}
  .appView{min-height:0!important}.appHeader{position:sticky!important;top:0!important;z-index:20!important;background:var(--bg,#f8fafc)!important;padding-top:2px!important}.appTitle{font-size:1.05rem!important;padding:0 2px!important}.tabs{gap:14px!important;overflow-x:auto!important;overflow-y:hidden!important;scrollbar-width:none!important;white-space:nowrap!important}.tabs::-webkit-scrollbar{display:none!important}.tab{flex:0 0 auto!important;padding:8px 0!important;font-size:.76rem!important}
  .panelBody,.moduleWrap,.moduleFrame{min-height:0!important;height:100%!important}

  /* Dashboard e páginas internas */
  .wrap{padding:10px!important}.dashboard-head,.dash-header,.summary-head{flex-direction:column!important;align-items:stretch!important;gap:10px!important}
  .dashboard-grid,.kpi-grid,.metrics-grid,.summary-grid,.chart-grid,.bottom-grid{grid-template-columns:1fr!important;gap:10px!important}
  .moduleIntro,.hero{margin:0 0 10px!important;padding:12px!important;border-radius:14px!important;gap:10px!important;flex-wrap:wrap!important;align-items:flex-start!important}
  .moduleIntroMain,.hero-copy{min-width:0!important;gap:10px!important}.moduleIntroIcon,.hero-icon{width:40px!important;height:40px!important;flex:0 0 40px!important;border-radius:12px!important}.moduleIntroTitle,.hero h1{font-size:1.05rem!important}.moduleIntroSubtitle,.hero p{font-size:.76rem!important;line-height:1.35!important}.moduleIntroTag{font-size:.66rem!important;padding:5px 8px!important}.hero-actions{width:100%!important;display:flex!important;gap:7px!important}.hero-actions .btn{flex:1!important;padding:8px 10px!important;font-size:.75rem!important}
  .moduleHead,.toolbar,.panel-header,.pricing-toolbar,.report-toolbar{display:flex!important;flex-wrap:wrap!important;align-items:stretch!important;gap:8px!important;padding:10px!important}.moduleHead>.searchBox,.toolbar>.search,.searchBox{flex:1 1 100%!important;min-width:0!important;width:100%!important}.moduleHead>.filters,.filters{display:flex!important;flex:1 1 100%!important;gap:7px!important;overflow-x:auto!important}.selectFilter{flex:1 1 150px!important;min-width:145px!important}.moduleHead>.btn,.toolbar>.btn,.panel-header>.btn{flex:1 1 auto!important;justify-content:center!important}
  .planViewTabs,.config-tabs,.tabs{display:flex!important;overflow-x:auto!important;overflow-y:hidden!important;white-space:nowrap!important;scrollbar-width:none!important;padding:3px!important;gap:5px!important}.planViewTabs::-webkit-scrollbar,.config-tabs::-webkit-scrollbar,.tabs::-webkit-scrollbar{display:none!important}.planViewTab,.config-tab,.tabs .tab{flex:0 0 auto!important;font-size:.72rem!important;padding:8px 10px!important}
  .tableCard{border-radius:13px!important;overflow:auto!important;-webkit-overflow-scrolling:touch!important}.dataTable,.miniTable,.pricing-table,.tableCard table{min-width:720px!important;font-size:.76rem!important}.dataTable th,.dataTable td,.miniTable th,.miniTable td,.pricing-table th,.pricing-table td{padding:9px 10px!important}
  .panel,.card{border-radius:13px!important}.panel-body,.panelBody,.card-body{padding:12px!important}
  .form-grid,.pricing-modal-grid,.grid-2,.two-col,.fields-grid,.proposal-grid,.trial-grid{grid-template-columns:1fr!important}.full{grid-column:auto!important}
  .modalOverlay,.modal-back,.modalWrap{padding:0!important;align-items:stretch!important;justify-content:stretch!important}.modalOverlay>.modal,.modal-back>.modal,.modalWrap>.modal,.modal{width:100vw!important;max-width:100vw!important;height:100dvh!important;max-height:100dvh!important;border-radius:0!important;margin:0!important;display:flex!important;flex-direction:column!important}
  .modalHead,.modal-head,.modalHeader{position:sticky!important;top:0!important;z-index:3!important;min-height:54px!important;padding:10px 12px!important;background:var(--panel,#fff)!important}.modalBody,.modal-body{flex:1!important;min-height:0!important;max-height:none!important;overflow:auto!important;padding:12px!important}.modalFoot,.modal-foot,.modalFooter{position:sticky!important;bottom:0!important;z-index:3!important;padding:9px 12px calc(9px + var(--adminhub-safe-bottom))!important;background:var(--panel,#fff)!important;gap:7px!important;flex-wrap:wrap!important}.modalFoot .btn,.modal-foot .btn,.modalFooter .btn{min-height:40px!important}
  .ticket-modal-body,.ticket-chat,.messages{min-height:0!important}.modal-body .ticket-meta{max-height:34vh!important}
}

@media (max-width:520px){
  body>.login-card{padding:20px 16px!important}.login-card .footer-links{font-size:.68rem!important}
  .topbar{padding-left:5px!important;padding-right:5px!important}.hello{max-width:72px!important}.statusChip{display:none!important}.iconBtn{flex-basis:32px!important;width:32px!important;height:32px!important}.topRight{gap:0!important}
  .content{padding:7px!important}.appTitle{font-size:.95rem!important}.tabs{gap:11px!important}
  .moduleIntroSubtitle,.hero p,.moduleIntroTag{display:none!important}.moduleIntro,.hero{align-items:center!important}.moduleIntroText,.hero-copy>div{min-width:0!important}.moduleIntroTitle,.hero h1{white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  .moduleHead>.btn,.toolbar>.btn,.panel-header>.btn{width:100%!important;flex-basis:100%!important}
  .dataTable,.miniTable,.pricing-table,.tableCard table{min-width:660px!important}
  .modalFoot,.modal-foot,.modalFooter{justify-content:stretch!important}.modalFoot .btn,.modal-foot .btn,.modalFooter .btn{flex:1 1 120px!important}
  .atendimento-workspace{top:0!important;height:100dvh!important}
}
