/* Correção forçada para Safari no iPhone. Novo nome para evitar cache antigo. */
html.ios-device{-webkit-text-size-adjust:100%;text-size-adjust:100%}
html.iphone-device,html.iphone-device body{width:100%;max-width:100%;min-width:0;overflow-x:hidden!important}
html.iphone-device body{padding-bottom:calc(84px + env(safe-area-inset-bottom,0px));background:#f5f7fb!important}
html.iphone-device *{box-sizing:border-box;min-width:0}
html.iphone-device img,html.iphone-device svg,html.iphone-device canvas{max-width:100%!important}
html.iphone-device .app-navbar{position:sticky;top:0;z-index:1040;min-height:56px;padding-top:max(.35rem,env(safe-area-inset-top,0px))}
html.iphone-device .app-navbar .container-fluid{width:100%;padding-inline:.85rem}
html.iphone-device .brand-full{display:none!important}
html.iphone-device .brand-mobile{display:inline!important}
html.iphone-device .navbar-brand{font-size:1rem}
html.iphone-device .navbar-toggler{min-width:44px;min-height:44px;margin:0}
html.iphone-device .navbar-collapse{max-height:calc(100dvh - 70px);overflow-y:auto;padding:.65rem 0 .85rem}
html.iphone-device .navbar-nav .nav-link{display:flex;align-items:center;min-height:44px;border-bottom:1px solid rgba(255,255,255,.08)}
html.iphone-device .nav-user-area{align-items:stretch!important;flex-direction:column;width:100%;padding-top:.65rem}
html.iphone-device .nav-user-area form,html.iphone-device .nav-user-area .btn{width:100%}
html.iphone-device .app-main{width:100%;max-width:100%!important;padding:.75rem .68rem calc(96px + env(safe-area-inset-bottom,0px))!important;overflow-x:hidden}
html.iphone-device .alert{margin-bottom:.7rem;padding:.75rem 2.5rem .75rem .8rem;border-radius:12px;font-size:.84rem}

/* Dashboard em uma coluna */
html.iphone-device .dashboard-hero{display:block!important;min-height:0!important;margin-bottom:.75rem!important;padding:1rem!important;border-radius:17px!important;box-shadow:0 10px 25px rgba(15,23,42,.12)!important}
html.iphone-device .dashboard-hero:after{display:none}
html.iphone-device .dashboard-hero__content{max-width:none}
html.iphone-device .dashboard-eyebrow{margin-bottom:.4rem;font-size:.62rem}
html.iphone-device .dashboard-hero h1{margin-bottom:.3rem;font-size:1.45rem!important;line-height:1.15}
html.iphone-device .dashboard-hero p{font-size:.78rem;line-height:1.4}
html.iphone-device .dashboard-hero__actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;width:100%!important;min-width:0!important;margin-top:.85rem;gap:.55rem!important}
html.iphone-device .dashboard-action{width:100%;min-height:54px!important;padding:.55rem .6rem!important;border-radius:12px!important}
html.iphone-device .dashboard-action:first-child{grid-column:1/-1}
html.iphone-device .dashboard-action i{width:29px;height:29px;flex-basis:29px;font-size:.85rem}
html.iphone-device .dashboard-action span{font-size:.7rem}
html.iphone-device .dashboard-action small{font-size:.57rem}
html.iphone-device .dashboard-metrics{display:grid!important;grid-template-columns:1fr!important;gap:.62rem!important;margin-bottom:.75rem!important}
html.iphone-device .metric-card{width:100%;min-height:0!important;padding:.9rem!important;border-radius:15px!important}
html.iphone-device .metric-card__top{margin-bottom:.55rem}
html.iphone-device .metric-icon{width:34px;height:34px;flex-basis:34px}
html.iphone-device .metric-label{font-size:.72rem}
html.iphone-device .metric-value{display:block;margin-bottom:.3rem;font-size:1.35rem!important;line-height:1.15;white-space:normal!important;overflow-wrap:anywhere}
html.iphone-device .metric-caption,html.iphone-device .metric-trend{font-size:.68rem!important;line-height:1.35}
html.iphone-device .row,html.iphone-device .row.g-4{--bs-gutter-x:0;--bs-gutter-y:.7rem;width:100%;margin-inline:0}
html.iphone-device .row>[class*="col-"]{width:100%!important;max-width:100%!important;flex:0 0 100%!important;padding-inline:0!important}
html.iphone-device .dashboard-panel{width:100%;padding:.9rem!important;border-radius:15px!important}
html.iphone-device .dashboard-panel__header{align-items:flex-start!important;flex-direction:column!important;gap:.35rem!important;margin-bottom:.75rem!important}
html.iphone-device .dashboard-panel h2{font-size:1rem!important}
html.iphone-device .dashboard-panel__eyebrow{font-size:.58rem!important}
html.iphone-device .dashboard-link{max-width:100%!important;justify-content:flex-start!important;font-size:.7rem!important;text-align:left!important}
html.iphone-device .dashboard-chart,html.iphone-device .dashboard-chart--line{width:100%!important;height:215px!important;min-height:215px!important}
html.iphone-device .dashboard-chart--doughnut{width:100%!important;height:180px!important;min-height:180px!important}
html.iphone-device .dashboard-chart canvas{width:100%!important;height:100%!important}
html.iphone-device .health-description{min-height:0!important}
html.iphone-device .dashboard-secondary-action{min-height:44px}
html.iphone-device .financial-agenda{gap:.6rem!important}
html.iphone-device .agenda-item,html.iphone-device .agenda-item:first-child,html.iphone-device .agenda-item:last-child{display:grid!important;grid-template-columns:42px minmax(0,1fr)!important;grid-template-areas:"date main" "date due" "action action"!important;gap:.4rem .6rem!important;width:100%;padding:.72rem!important;border:1px solid #e4eaf2!important;border-radius:14px!important;background:#fff}
html.iphone-device .agenda-date{grid-area:date;width:42px;height:50px}
html.iphone-device .agenda-main{grid-area:main}
html.iphone-device .agenda-due{grid-area:due;align-items:center!important;justify-content:space-between!important;flex-direction:row!important;gap:.4rem}
html.iphone-device .agenda-action{grid-area:action;width:100%}
html.iphone-device .agenda-title{font-size:.84rem}
html.iphone-device .agenda-meta{font-size:.64rem}
html.iphone-device .btn-quick-pay{width:100%!important;min-width:0!important;min-height:46px!important;border-radius:11px!important}
html.iphone-device .category-chart-wrap{display:grid!important;grid-template-columns:1fr!important;min-height:0!important;gap:.7rem!important}
html.iphone-device .category-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html.iphone-device .recent-grid{display:grid!important;grid-template-columns:1fr!important;gap:.55rem!important}
html.iphone-device .recent-card{grid-template-columns:38px minmax(0,1fr)!important;grid-template-areas:"icon content" "icon value";width:100%;gap:.2rem .55rem!important;padding:.72rem!important}
html.iphone-device .recent-icon{grid-area:icon}
html.iphone-device .recent-content{grid-area:content}
html.iphone-device .recent-value{grid-area:value;align-items:flex-start!important;text-align:left!important}
html.iphone-device .recent-value strong{max-width:100%!important}

/* Formulários e páginas */
html.iphone-device .mobile-page-header{align-items:stretch!important;flex-direction:column!important;width:100%}
html.iphone-device .mobile-page-header h1{font-size:1.35rem}
html.iphone-device .mobile-page-actions,html.iphone-device .mobile-action-grid{display:grid!important;grid-template-columns:1fr!important;gap:.5rem!important;width:100%!important}
html.iphone-device .mobile-page-actions .btn,html.iphone-device .mobile-action-grid .btn,html.iphone-device .mobile-action-grid form,html.iphone-device .mobile-page-header>.btn{width:100%!important}
html.iphone-device input,html.iphone-device select,html.iphone-device textarea,html.iphone-device .form-control,html.iphone-device .form-select{min-height:46px;font-size:16px!important}
html.iphone-device textarea{min-height:100px}
html.iphone-device .btn{min-height:44px;touch-action:manipulation}
html.iphone-device .card{border-radius:15px}
html.iphone-device .card-body{padding:.9rem}

/* Tabelas viram cartões mesmo se “Site para computador” estiver ativo */
html.iphone-device .table-responsive{width:100%;overflow:visible!important}
html.iphone-device .mobile-card-table,html.iphone-device .mobile-card-table tbody,html.iphone-device .mobile-card-table tr,html.iphone-device .mobile-card-table td{display:block!important;width:100%!important}
html.iphone-device .mobile-card-table thead{display:none!important}
html.iphone-device .mobile-card-table tbody{padding:.6rem!important;background:#f5f7fb}
html.iphone-device .mobile-card-table tbody tr{overflow:hidden;margin-bottom:.65rem;padding:.4rem .75rem;border:1px solid #e3e9f1;border-radius:14px;background:#fff;box-shadow:0 4px 14px rgba(15,23,42,.04)}
html.iphone-device .mobile-card-table td{display:grid!important;grid-template-columns:minmax(82px,34%) minmax(0,1fr)!important;align-items:center;gap:.55rem;padding:.52rem 0!important;border:0!important;border-bottom:1px solid #edf1f6!important;font-size:.8rem;text-align:right!important;white-space:normal!important}
html.iphone-device .mobile-card-table td:last-child{border-bottom:0!important}
html.iphone-device .mobile-card-table td:before{content:attr(data-label);color:#8290a3;font-size:.65rem;font-weight:800;text-align:left;text-transform:uppercase}
html.iphone-device .mobile-card-table td[data-label="Conta"],html.iphone-device .mobile-card-table td[data-label="Tipo/Título"],html.iphone-device .mobile-card-table td[data-label="Ações"]{display:block!important;text-align:left!important}
html.iphone-device .mobile-card-table td[data-label="Conta"]:before,html.iphone-device .mobile-card-table td[data-label="Tipo/Título"]:before,html.iphone-device .mobile-card-table td[data-label="Ações"]:before{display:none!important}
html.iphone-device .mobile-card-table td[data-label="Ações"]>.d-flex{display:grid!important;grid-template-columns:1fr!important;gap:.45rem!important}
html.iphone-device .mobile-card-table td[data-label="Ações"] form,html.iphone-device .mobile-card-table td[data-label="Ações"] .btn{width:100%!important}

/* Barra inferior sempre ativa no iPhone */
html.iphone-device .mobile-bottom-nav{position:fixed!important;right:0;bottom:0;left:0;z-index:1050;display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr));min-height:calc(66px + env(safe-area-inset-bottom,0px));padding:.35rem .25rem max(.35rem,env(safe-area-inset-bottom,0px));border-top:1px solid #dfe6ef;background:rgba(255,255,255,.97);box-shadow:0 -8px 24px rgba(15,23,42,.09);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px)}
html.iphone-device .mobile-bottom-nav__item{display:flex!important;align-items:center;justify-content:center;flex-direction:column;gap:.15rem;min-height:52px;color:#64748b;font-size:.58rem;font-weight:700;text-decoration:none}
html.iphone-device .mobile-bottom-nav__item>i{font-size:1.18rem}
html.iphone-device .mobile-bottom-nav__item.is-active{color:#2563eb}
html.iphone-device .mobile-bottom-nav__add-icon{display:grid;place-items:center;width:36px;height:36px;margin-top:-16px;border-radius:50%;color:#fff;background:#2563eb;box-shadow:0 6px 16px rgba(37,99,235,.32)}
