:root{--bg: #f4f6fa;--card: #fff;--text: #1e293b;--muted: #64748b;--border: #e2e8f0;--primary: #2563eb;--danger: #dc2626;--warn: #d97706;--good: #16a34a;font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;color:var(--text);background:var(--bg)}*{box-sizing:border-box}body{margin:0}h1{font-size:1.5rem;margin:0}h3{margin:0 0 .75rem;font-size:1rem}a{color:var(--primary);text-decoration:none}button{font:inherit;padding:.45rem .9rem;border-radius:8px;border:1px solid var(--border);background:#fff;cursor:pointer}button:hover{background:#f1f5f9}button.primary{background:var(--primary);color:#fff;border-color:var(--primary)}button.primary:hover{filter:brightness(1.1)}button.danger{background:var(--danger);color:#fff;border-color:var(--danger)}button.link{border:0;background:none;color:var(--primary);padding:0}button:disabled{opacity:.6;cursor:default}input,select,textarea{font:inherit;padding:.45rem .6rem;border:1px solid var(--border);border-radius:8px;width:100%;background:#fff}input[type=checkbox]{width:auto}.center{display:grid;place-items:center;height:100vh;height:100dvh}.muted{color:var(--muted)}.good{color:var(--good)}.bad{color:var(--danger);font-weight:600}.warn{color:var(--warn);font-weight:600}.error{background:#fee2e2;color:#991b1b;padding:.6rem .8rem;border-radius:8px;margin:.5rem 0;grid-column:1 / -1}.info{background:#dbeafe;color:#1e3a8a;padding:.6rem .8rem;border-radius:8px;margin-bottom:1rem}.layout{display:flex;min-height:100vh;min-height:100dvh}.sidebar{width:220px;background:#0f172a;color:#e2e8f0;display:flex;flex-direction:column;padding:1rem;position:sticky;top:0;height:100vh}.brand{margin-bottom:1.5rem;display:flex;flex-direction:column;gap:.35rem}.brand img{width:100%;max-width:188px;height:auto;display:block}.brand small{font-size:.74rem;color:#94a3b8;white-space:nowrap;letter-spacing:.01em}.sidebar nav{display:flex;flex-direction:column;gap:2px;flex:1}.sidebar nav a{color:#cbd5e1;padding:.55rem .75rem;border-radius:8px}.sidebar nav a.active,.sidebar nav a:hover{background:#1e293b;color:#fff}.user-box{display:flex;flex-direction:column;gap:2px;font-size:.9rem;border-top:1px solid #1e293b;padding-top:1rem}.user-box span{color:#94a3b8}.user-box .link{color:#93c5fd;text-align:left;margin-top:.3rem}.content{flex:1;padding:1.5rem 2rem;min-width:0}.page-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem;gap:1rem;flex-wrap:wrap}.actions{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap}.card{background:var(--card);border:1px solid var(--border);border-radius:12px;padding:1rem;margin-bottom:1rem;overflow-x:auto}.kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:1rem;margin-bottom:1rem}.kpi{background:var(--card);border:1px solid var(--border);border-radius:12px;padding:1rem;display:flex;flex-direction:column;color:var(--text)}.kpi span{color:var(--muted);font-size:.85rem}.kpi strong{font-size:1.6rem}.grid2{display:grid;grid-template-columns:repeat(auto-fit,minmax(380px,1fr));gap:1rem}.row-between{display:flex;justify-content:space-between;align-items:center;gap:.5rem}table{width:100%;border-collapse:collapse;font-size:.92rem}th,td{text-align:left;padding:.55rem .5rem;border-bottom:1px solid var(--border);white-space:nowrap}td:nth-child(3){white-space:normal}th{color:var(--muted);font-weight:600;font-size:.8rem;text-transform:uppercase}.num{text-align:right}table.fit td{white-space:normal}table.fit td.num,table.fit td.row-actions{white-space:nowrap}@media (min-width: 801px){table.fit td.row-actions .actions{flex-wrap:nowrap;justify-content:flex-end}table.fit td.row-actions,table.fit th:last-child{position:sticky;right:0;background:var(--card);box-shadow:-8px 0 8px -8px #0f172a26}}tr.clickable{cursor:pointer}tr.clickable:hover{background:#f8fafc}.badge{padding:.15rem .5rem;border-radius:999px;font-size:.78rem}.badge.pendente_revisao{background:#fef3c7;color:#92400e}.badge.aprovada{background:#dcfce7;color:#166534}.badge.rejeitada{background:#fee2e2;color:#991b1b}.badge.cancelada{background:#e5e7eb;color:#374151;text-decoration:line-through}.tag{background:#e0e7ff;color:#3730a3;padding:.1rem .45rem;border-radius:6px;font-size:.75rem;margin-left:.3rem}.filters{display:flex;flex-wrap:wrap;gap:.75rem}.filters .field{min-width:140px;flex:1}.field{display:flex;flex-direction:column;gap:.25rem;font-size:.88rem}.field span{color:var(--muted)}.inline{display:inline-flex;gap:.4rem;align-items:center;font-size:.9rem}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#0f172a80;display:grid;place-items:center;z-index:60;padding:1rem}.modal{background:#fff;border-radius:14px;padding:1.25rem;width:min(680px,100%);max-height:90vh;overflow:auto}.modal-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem}.modal-header h3{margin:0;font-size:1.15rem}.modal-actions{display:flex;justify-content:flex-end;gap:.5rem;margin-top:1rem}.form-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:.75rem}.form-grid>*,.field{min-width:0}.field input,.field select{max-width:100%;min-width:0}.full{grid-column:1 / -1}.details{display:grid;grid-template-columns:max-content 1fr;gap:.35rem 1rem;margin:0 0 1rem}.details dt{color:var(--muted)}.details dd{margin:0}.thumb{max-width:260px;max-height:260px;border-radius:8px;display:block}.attachment{margin:.5rem 0}.avatar{display:inline-flex;align-items:center;justify-content:center;flex:none;border-radius:50%;overflow:hidden;background:#e2e8f0;color:#475569;font-weight:600;vertical-align:middle}.avatar.square{border-radius:8px}.avatar img{width:100%;height:100%;object-fit:cover}button.avatar.zoomable{padding:0;border:0;cursor:zoom-in;min-height:0}button.avatar.zoomable:hover,button.avatar.zoomable:focus-visible{outline:2px solid var(--primary);outline-offset:2px}.lightbox{position:fixed;top:0;right:0;bottom:0;left:0;z-index:100;background:#0f172aeb;display:flex;align-items:center;justify-content:center;padding:max(1rem,env(safe-area-inset-top)) 1rem max(1rem,env(safe-area-inset-bottom));cursor:zoom-out;animation:lightbox-in .15s ease-out}.lightbox figure{margin:0;display:flex;flex-direction:column;align-items:center;gap:.75rem;max-width:100%;max-height:100%;cursor:default}.lightbox img{max-width:min(1100px,100%);max-height:calc(100dvh - 7rem);object-fit:contain;border-radius:10px;box-shadow:0 10px 40px #00000080;background:#fff}.lightbox figcaption{color:#e2e8f0;font-weight:600;text-align:center}.lightbox-close{position:absolute;top:max(.75rem,env(safe-area-inset-top));right:.75rem;width:44px;height:44px;border-radius:50%;border:0;background:#ffffff26;color:#fff;font-size:1.8rem;line-height:1;cursor:pointer}.lightbox-close:hover{background:#ffffff47}@keyframes lightbox-in{0%{opacity:0}to{opacity:1}}.name-cell{display:inline-flex;align-items:center;gap:.6rem;min-width:0}.name-cell>:last-child{min-width:0}.file-picker-row{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap}.file-picker-actions{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}.file-preview{width:72px;height:72px;border-radius:50%;object-fit:cover;background:#e2e8f0;display:inline-flex;align-items:center;justify-content:center}.file-preview.square{border-radius:10px;width:96px}.file-name{font-size:.9rem;word-break:break-all}.user-box .name-cell{margin-bottom:.2rem}.upload{display:flex;flex-direction:column;gap:.6rem;margin-top:.25rem}.upload-label{font-weight:700;font-size:.95rem}.upload-drop{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.25rem;text-align:center;padding:1.25rem 1rem;border:2px dashed #93b4f5;border-radius:12px;background:#eef4ff;color:var(--muted);cursor:pointer;transition:background .15s,border-color .15s}.upload-drop:hover,.upload-drop:focus-visible,.upload-drop.dragging{background:#e0ebff;border-color:var(--primary);outline:none}.upload-drop strong{color:var(--text);font-size:1.05rem}.upload-drop span:last-child{font-size:.88rem}.upload-drop-icon{color:var(--primary);display:inline-flex}.upload-buttons{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.5rem}.upload-buttons button{display:inline-flex;align-items:center;justify-content:center;gap:.45rem;min-height:48px;min-width:0;padding:.45rem .4rem;background:#f5f8ff;border:1px solid #dbe5f8;border-radius:10px;color:var(--text);font-weight:500}.upload-buttons button svg{color:var(--primary);flex:none}.upload-buttons button:hover{background:#eaf1ff;border-color:#b9cdf3}.upload-hint{margin:0;text-align:center;font-size:.8rem;color:var(--muted)}.upload-hint span{white-space:nowrap}.upload-file{display:flex;align-items:center;gap:.75rem;padding:.75rem;border:1px solid #dbe5f8;border-radius:12px;background:#f5f8ff}.upload-file img,.upload-file-icon{width:56px;height:56px;border-radius:8px;object-fit:cover;flex:none}.upload-file-icon{display:inline-flex;align-items:center;justify-content:center;background:#e0ebff;color:var(--primary)}.upload-file-info{display:flex;flex-direction:column;min-width:0;flex:1}.upload-file-info strong{font-size:.92rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.upload-file-info span{font-size:.8rem;color:var(--muted)}@media (max-width: 400px){.upload-buttons button{flex-direction:column;gap:.2rem;font-size:.88rem;min-height:62px}}.suggestions,.alerts{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.6rem}.suggestions li{border-left:4px solid var(--good);padding:.4rem .75rem;background:#f8fafc;border-radius:6px}.suggestions p,.alerts p{margin:.25rem 0;font-size:.9rem}.alerts li{border-left:4px solid var(--primary);padding:.4rem .75rem;background:#f8fafc;border-radius:6px}.alerts.big li{padding:.9rem 1rem;margin:0}.alerts li.sev-aviso{border-left-color:var(--warn)}.alerts li.sev-critico{border-left-color:var(--danger)}.alerts li.read{opacity:.75}.login{display:grid;place-items:center;min-height:100vh;padding:1rem}.login form{width:min(400px,100%);display:flex;flex-direction:column;gap:.9rem;padding:2rem}.login h1{font-size:1.3rem}.login-brand{display:flex;flex-direction:column;align-items:center;gap:.4rem;margin-bottom:.5rem;text-align:center}.login-brand img{width:100%;max-width:320px;height:auto}.slogan{margin:0;color:#1d4ed8;font-weight:600;font-size:1.05rem}.topbar-icon{width:26px;height:26px;flex:none}.code{background:#0f172a;color:#e2e8f0;padding:1rem;border-radius:8px;font-size:1.3rem;text-align:center}.chat-page{max-width:800px;display:flex;flex-direction:column;gap:.5rem;height:calc(100vh - 3rem);height:calc(100dvh - 3rem)}.chat{flex:1;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;display:flex;flex-direction:column;gap:.5rem;background:#e5ddd5}.bubble{max-width:75%;padding:.5rem .75rem;border-radius:10px;white-space:pre-wrap;box-shadow:0 1px 1px #0000001a}.bubble p{margin:0}.bubble.in{align-self:flex-end;background:#dcf8c6}.bubble.out{align-self:flex-start;background:#fff}.chat-input{display:flex;flex-direction:column;gap:.5rem;background:var(--bg);padding-bottom:env(safe-area-inset-bottom)}.chat-row{display:flex;gap:.5rem;align-items:stretch}.chat-text{flex:1 1 auto;min-width:0;width:auto}.chat-actions{display:flex;flex-wrap:wrap;gap:.5rem}.chat-file{display:flex;gap:.75rem;align-items:center;font-size:.9rem}label.button{display:inline-flex;align-items:center;gap:.3rem;padding:.45rem .9rem;border-radius:8px;border:1px solid var(--border);background:#fff;cursor:pointer;position:relative;overflow:hidden}label.button.disabled{opacity:.6;pointer-events:none}.visually-hidden{position:absolute;width:1px;height:1px;opacity:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}.grow{flex:1}.mobile-only{display:none!important}.expense-groups{display:flex;flex-direction:column;gap:.5rem}.eg-toolbar{display:grid;grid-template-columns:1fr 1fr;gap:.5rem}.eg-toolbar button{min-height:44px}.eg-day-title,.eg-sub-title{width:100%;display:flex;justify-content:space-between;align-items:center;gap:.5rem;background:none;border:0;border-radius:0;color:inherit;text-align:left;cursor:pointer;-webkit-tap-highlight-color:transparent}.eg-day-title:hover,.eg-sub-title:hover{background:none}.eg-day-title{margin:0;font-size:1rem;font-weight:700;padding:.55rem 0 .4rem;min-height:44px;border-bottom:2px solid var(--text)}.eg-day.open .eg-day-title{margin-bottom:.4rem}.eg-day:not(.open) .eg-day-title{border-bottom:1px solid var(--border)}.eg-label{display:inline-flex;align-items:baseline;gap:.4rem;flex-wrap:wrap;min-width:0}.eg-label small{color:var(--muted);font-weight:400;font-size:.8rem}.eg-chevron{display:inline-block;width:1em;color:var(--muted);transition:transform .15s ease}.eg-day.open>.eg-day-title .eg-chevron,.eg-sub.open>.eg-sub-title .eg-chevron{transform:rotate(90deg)}.eg-sub{margin-bottom:.5rem}.eg-sub-title{color:var(--primary);font-weight:600;font-size:.9rem;padding:.45rem 0 .3rem;min-height:40px}.eg-sub ul{list-style:none;margin:0;padding:0}.eg-sub li{display:flex;justify-content:space-between;align-items:flex-start;gap:.75rem;padding:.55rem 0 .55rem .6rem;border-bottom:1px solid var(--border);border-left:3px solid var(--border)}.eg-sub li:last-child{border-bottom:0}.eg-sub li.clickable{cursor:pointer}.eg-sub li.clickable:active{background:#f1f5f9}.eg-main{display:flex;flex-direction:column;gap:.15rem;min-width:0}.eg-main small{color:var(--muted);font-size:.88rem;overflow-wrap:anywhere}.eg-side{display:flex;flex-direction:column;align-items:flex-end;gap:.25rem;white-space:nowrap}.eg-tags{display:flex;flex-wrap:wrap;gap:.25rem;justify-content:flex-end;align-items:center}.eg-tags .tag{margin-left:0}.list-toolbar{display:flex;justify-content:space-between;align-items:flex-end;gap:.75rem;flex-wrap:wrap;margin-bottom:.75rem}.list-toolbar h3,.list-toolbar p{margin:0}.sort-controls{display:flex;gap:.5rem;flex-wrap:wrap}.sort-controls .field{min-width:150px}.topbar,.backdrop{display:none}@media (max-width: 800px){.layout{flex-direction:column}.mobile-only{display:flex!important}.list-toolbar{flex-direction:column;align-items:stretch}.sort-controls{display:grid;grid-template-columns:1fr 1fr}.sort-controls .field{min-width:0}.desktop-only{display:none!important}.topbar{display:flex;align-items:center;gap:.5rem;position:sticky;top:0;z-index:30;background:#0f172a;color:#fff;padding:.35rem .75rem;padding-top:calc(.35rem + env(safe-area-inset-top))}.topbar strong{font-size:1.05rem}.hamburger{width:44px;height:44px;padding:11px 9px;background:transparent;border:0;display:flex;flex-direction:column;justify-content:space-between}.hamburger:hover{background:#1e293b}.hamburger span{display:block;width:100%;height:3px;border-radius:2px;background:#fff}.backdrop{display:block;position:fixed;top:0;right:0;bottom:0;left:0;background:#0f172a80;z-index:40}.sidebar{position:fixed;top:0;left:0;bottom:0;width:80%;max-width:300px;height:100%;z-index:50;overflow-y:auto;-webkit-overflow-scrolling:touch;transform:translate(-100%);transition:transform .2s ease;padding-top:calc(1rem + env(safe-area-inset-top))}.sidebar.open{transform:translate(0);box-shadow:4px 0 20px #0000004d}.sidebar nav a{padding:.8rem .75rem;font-size:1.05rem}.user-box{padding-bottom:env(safe-area-inset-bottom)}.user-box .link{padding:.5rem 0}body.menu-open{overflow:hidden}.content{padding:1rem .75rem}.page-header h1{display:none}.page-header{margin-bottom:.75rem}.page-header .actions{width:100%}.page-header .actions>*{flex:1 1 auto}.page-header .actions button,.modal-actions button{min-height:44px}.form-grid{grid-template-columns:minmax(0,1fr)}.grid2{grid-template-columns:1fr}.kpis{grid-template-columns:1fr 1fr;gap:.6rem}.kpi strong{font-size:1.25rem}.chat-page{height:auto}.chat{flex:none;height:55vh;height:55dvh}.chat-input{position:sticky;bottom:0;padding-top:.5rem}input,select,textarea,button,label.button{font-size:16px}table{display:block;overflow-x:auto;-webkit-overflow-scrolling:touch}table.responsive{display:table}table.responsive thead{display:none}table.responsive tbody,table.responsive tr,table.responsive td{display:block;width:100%}table.responsive tr{border:1px solid var(--border);border-radius:10px;padding:.35rem .75rem;margin-bottom:.6rem;background:#fff}table.responsive td{display:flex;justify-content:space-between;align-items:center;gap:.75rem;padding:.4rem 0;white-space:normal;text-align:right;border-bottom:1px solid #f1f5f9}table.responsive td:last-child{border-bottom:0}table.responsive td:empty{display:none}table.responsive td:before{content:attr(data-label);color:var(--muted);font-size:.8rem;font-weight:600;text-transform:uppercase;text-align:left}table.responsive td .actions,table.responsive td>button{flex-wrap:wrap;justify-content:flex-end}.card:has(>table.responsive){background:transparent;border:0;padding:0}.modal-backdrop{padding:0;place-items:end center}.modal{border-radius:14px 14px 0 0;max-height:92vh;max-height:92dvh;padding-bottom:calc(1.25rem + env(safe-area-inset-bottom))}}fieldset.groups{border:1px solid #dfe3ea;border-radius:8px;padding:8px 12px;display:flex;flex-wrap:wrap;gap:6px 18px}fieldset.groups legend{font-size:.85rem;color:#5b6472;padding:0 4px}.closing-title{margin:.25rem 0 1rem;font-size:1.25rem}.closing-title small{font-size:.9rem;font-weight:400;margin-left:.5rem}button:disabled{opacity:.5}@media print{.sidebar,.topbar,.backdrop,.no-print,.page-header .actions,.page-header button{display:none!important}.content{padding:0}.card,.kpi{break-inside:avoid;border-color:#ccc}.grid2{grid-template-columns:1fr 1fr}}.table-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch}.usage-table td{white-space:nowrap}.usage-table td.question{max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.usage-detail{display:grid;grid-template-columns:max-content 1fr;gap:.4rem .9rem;margin:0}.usage-detail dt{color:var(--muted)}.usage-detail dd{margin:0;word-break:break-word}.usage-detail .pre{white-space:pre-wrap}.outcome{display:inline-block;padding:.1rem .5rem;border-radius:999px;font-size:.8rem;font-weight:600}.outcome.ok{background:#dcfce7;color:#166534}.outcome.warn{background:#fef3c7;color:#92400e}.outcome.muted{background:#f1f5f9;color:#475569;font-weight:500}.action-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5rem}.action-list li{padding:.5rem .65rem;border-radius:8px;border-left:3px solid #16a34a;background:#f0fdf4}.action-list li.warn{border-left-color:#d97706;background:#fffbeb}.action-error{color:#92400e;font-size:.9rem;margin-top:.15rem}.small-note{font-size:.82rem}@media (max-width: 760px){.usage-table td.question{max-width:none;white-space:normal}.usage-detail{grid-template-columns:1fr}.usage-detail dt{margin-top:.4rem}}.history{list-style:none;padding:0;margin:.75rem 0 0;border-top:1px solid #e5e7eb}.history li{padding:.5rem 0;border-bottom:1px solid #f1f5f9;font-size:.9rem}.history small{display:block;color:#64748b}.history .details-text{white-space:pre-wrap;color:#334155}.notice{background:#f1f5f9;border-radius:8px;padding:.5rem .75rem;font-size:.9rem;color:#334155}
