/* Camada de apresentação para celular. O relatório/PDF possui estilos próprios. */
.mobile-only,.mobile-bottom-nav,.mobile-menu-backdrop { display:none; }
@media (max-width:760px) {
 :root { --mobile-header:64px; --mobile-bottom:68px; }
 html { scroll-padding-top:80px; }
 body { padding-bottom:calc(var(--mobile-bottom) + env(safe-area-inset-bottom,0px) + 20px); }
 .topbar { height:calc(var(--mobile-header) + env(safe-area-inset-top,0px)); padding:env(safe-area-inset-top,0px) 16px 0; gap:12px; border-bottom:1px solid #ffffff16; }
 .brand { width:auto; flex:1; font-size:17px; letter-spacing:1.3px; }
 .topbar .identity { display:none; }
 .mobile-only { display:flex; }
 .mobile-header-menu { min-width:44px; min-height:44px; padding:10px; border:1px solid #ffffff30; background:#ffffff0d; color:white; }
 .mobile-header-menu svg { width:22px; height:22px; }
 .content { margin:calc(var(--mobile-header) + env(safe-area-inset-top,0px)) 0 0; width:100%; max-width:100%; padding:22px 14px; }
 .heading { display:block; margin-bottom:20px; }
 h1 { font-size:25px; line-height:1.2; letter-spacing:-.6px; overflow-wrap:anywhere; }
 h2 { font-size:18px; }
 .heading > .actions { margin-top:16px; display:flex; gap:8px; }
 .heading > .actions > .btn { flex:1 1 140px; }
 .card { border-radius:16px; padding:18px 16px; margin-bottom:16px; box-shadow:0 3px 12px #10283e05; min-width:0; }
 .grid,.grid.three,.form-grid,.layout { grid-template-columns:minmax(0,1fr); gap:16px; }
 .grid.four { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
 .stat { padding:15px 12px; }
 .stat strong { font-size:30px; }
 button,.btn { min-height:46px; padding:11px 14px; border-radius:10px; touch-action:manipulation; }
 button.small,.btn.small { min-height:44px; font-size:13px; }
 input:not([type=checkbox]):not([type=radio]),select,textarea { font-size:16px; min-height:48px; border-radius:10px; padding:12px; }
 input[type=file] { max-width:100%; overflow:hidden; }
 textarea { min-height:140px; line-height:1.6; }
 label.field { font-size:13px; }
 label.field > span { margin-bottom:8px; }
 input[type=checkbox] { width:21px; height:21px; flex-shrink:0; }
 .checklist label { min-height:48px; padding:12px 0; }
 .filters { gap:9px; }
 .filters input,.filters select { min-width:0; flex:1 1 100%; }
 .filters button { flex:1 1 100%; }
 .tabs { flex-wrap:nowrap; overflow-x:auto; gap:22px; margin:18px 0; scrollbar-width:thin; }
 .tabs a { white-space:nowrap; min-height:48px; flex-shrink:0; }
 .person-head { align-items:flex-start; gap:14px; }
 .person-head h1,.person-head h2 { overflow-wrap:anywhere; }
 .person-head .avatar { width:78px; height:96px; flex-shrink:0; }
 .details { grid-template-columns:minmax(0,100px) minmax(0,1fr); gap:12px; }
 .attachments { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
 .attachment { padding:10px; border-radius:12px; }
 .attachment img { height:115px; }
 .attachment .btn { width:100%; margin-bottom:6px; }
 .attachment form,.attachment form button { width:100%; }
 .actions { min-width:0; }
 #map { height:320px; max-height:55svh; width:100%; border-radius:12px; }
 #location-status,#local-photo-status { line-height:1.55; overflow-wrap:anywhere; }
 #use-device-location { width:100%; background:#edf5ff; color:#1253a5; border-color:#c8defb; font-weight:600; }
 #choose-local-photos,#take-local-photo { flex:1 1 120px; }
 .preview-files { gap:10px; }
 .preview-files > div { width:calc(50% - 5px); max-width:none!important; }
 .preview-files img { width:100%; height:120px; }
 .preview-files > img { width:calc(50% - 5px); }
 .sticky-actions { position:sticky; bottom:calc(var(--mobile-bottom) + env(safe-area-inset-bottom,0px) + 8px); z-index:4; background:#ffffffed; border:1px solid var(--line); border-radius:14px; padding:10px; box-shadow:0 5px 25px #10283e12; backdrop-filter:blur(10px); }
 .sticky-actions > button,.sticky-actions > .btn { flex:1; }
 .sticky-actions .primary { flex:2; }
 iframe { height:65svh; min-height:340px; }
 .mobile-bottom-nav { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); position:fixed; bottom:0; left:0; right:0; z-index:10; padding:7px 8px calc(7px + env(safe-area-inset-bottom,0px)); background:#fff; border-top:1px solid #dfe7f0; box-shadow:0 -4px 20px #10283e08; }
 .mobile-bottom-nav a,.mobile-bottom-nav button { display:flex; flex-direction:column; justify-content:center; align-items:center; gap:4px; min-height:54px; padding:5px 0; border:0; color:#718095; background:transparent; border-radius:12px; font-size:10px; font-weight:600; line-height:1.2; }
 .mobile-bottom-nav svg { width:22px; height:22px; }
 .mobile-bottom-nav .active { color:#1765df; background:#edf4ff; }
 .mobile-bottom-nav button[aria-expanded=true] { color:#1765df; background:#edf4ff; }
 .sidebar { display:none; position:fixed; z-index:22; top:0; left:auto; right:0; bottom:0; width:min(340px,90vw); margin:0; padding:calc(20px + env(safe-area-inset-top,0px)) 18px calc(24px + env(safe-area-inset-bottom,0px)); overflow-y:auto; overscroll-behavior:contain; background:#10283e; box-shadow:-20px 0 60px #071b3233; }
 body.mobile-menu-open .sidebar { display:block; }
 .sidebar a { min-height:48px; padding:13px 14px; margin:6px 0; font-size:15px; }
 .sidebar small { display:block; margin:24px 14px 10px; }
 .mobile-menu-head { justify-content:space-between; align-items:center; color:white; font-weight:700; font-size:19px; margin-bottom:14px; }
 .mobile-menu-head button { color:white; background:transparent; border-color:#ffffff30; min-width:44px; font-size:23px; line-height:1; }
 .mobile-menu-user { display:block; color:#c1d1df; padding:12px 0 18px; border-bottom:1px solid #ffffff20; margin-bottom:18px; overflow-wrap:anywhere; }
 .mobile-menu-user strong { display:block; color:white; }
 .mobile-menu-search { flex-direction:column; gap:8px; margin-bottom:18px; }
 .mobile-menu-search input { background:#fff; }
 .mobile-menu-logout { margin-top:26px; }
 .mobile-menu-logout button { width:100%; background:#ffffff0d; color:white; border-color:#ffffff30; }
 body.mobile-menu-open .mobile-menu-backdrop { display:block; position:fixed; inset:0; z-index:21; border:0; border-radius:0; background:#071b3299; backdrop-filter:blur(2px); padding:0; }
 body.mobile-menu-open { overflow:hidden; }
 .table-wrap:has(table[data-mobile-cards]) { overflow:visible; }
 table[data-mobile-cards],table[data-mobile-cards] tbody { display:block; width:100%; }
 table[data-mobile-cards] thead { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
 table[data-mobile-cards] tbody tr { display:block; border:1px solid #dfe7f0; border-radius:13px; background:#fff; margin-bottom:12px; padding:6px 12px; }
 table[data-mobile-cards] tbody td { display:grid; grid-template-columns:100px minmax(0,1fr); column-gap:12px; padding:10px 0; font-size:14px; overflow-wrap:anywhere; }
 table[data-mobile-cards] tbody td::before { content:attr(data-label); font-size:11px; font-weight:600; color:#728399; padding-top:2px; }
 table[data-mobile-cards] tbody td > * { min-width:0; }
 table[data-mobile-cards] tbody td.mobile-cell-title { display:block; font-weight:600; padding:10px 0 13px; color:#203247; }
 table[data-mobile-cards] tbody td.mobile-cell-title::before { display:none; }
 table[data-mobile-cards] tbody td.mobile-cell-actions { display:block; padding:12px 0 8px; }
 table[data-mobile-cards] tbody td.mobile-cell-actions::before { display:none; }
 table[data-mobile-cards] td.mobile-cell-actions .mobile-cell-value > .btn { width:100%; }
 table[data-mobile-cards] td.mobile-cell-actions .actions > * { flex:1 1 90px; }
 table[data-mobile-cards] td.mobile-cell-actions form button { width:100%; }
 table[data-mobile-cards] tbody td[colspan] { display:block; text-align:center; padding:20px 0; }
 table[data-mobile-cards] tbody td[colspan]::before { display:none; }
 .login-page { padding:20px; padding-bottom:calc(20px + env(safe-area-inset-bottom,0px)); min-height:100svh; background:linear-gradient(155deg,#10283e 0%,#173b58 60%,#245281 100%); }
 .login-card { padding:30px 22px; border-radius:22px; box-shadow:0 20px 60px #0002; }
 .login-card h1 { margin:12px 0; font-size:28px; }
 .login-card > .muted:first-child { color:#1765df; font-weight:800; letter-spacing:2px; font-size:13px; }
 .login-card .primary { min-height:50px; }
}
@media (max-width:360px) {
 .content { padding-left:10px; padding-right:10px; }
 .card { padding:15px 12px; }
 .attachments { grid-template-columns:minmax(0,1fr); }
 table[data-mobile-cards] tbody td { grid-template-columns:85px minmax(0,1fr); }
}
@media print { .mobile-bottom-nav,.mobile-only,.mobile-menu-backdrop { display:none!important; } }
