
:root{--navy:#12324a;--blue:#196fa3;--green:#19734b;--orange:#c66a00;--red:#b42318;--ink:#17232d;--muted:#667784;--line:#d8e1e7;--bg:#f4f7f9;--card:#fff}*{box-sizing:border-box}body{margin:0;font-family:Inter,system-ui,Arial,sans-serif;background:var(--bg);color:var(--ink)}button,input,select,textarea{font:inherit}.hidden{display:none!important}.login-wrap{min-height:100vh;display:grid;place-items:center;padding:24px;background:linear-gradient(135deg,#12324a,#287ca9)}.login-card{width:min(390px,100%);background:#fff;padding:30px;border-radius:20px;box-shadow:0 20px 60px #0018}.logo{width:72px;display:block;margin:auto}.login-card h1,.login-card p{text-align:center}.login-card label,label.field{display:block;font-weight:700;margin:12px 0}.login-card input,.field input,.field select,.field textarea{width:100%;margin-top:6px;padding:10px 12px;border:1px solid var(--line);border-radius:9px;background:#fff}.login-card button{width:100%;padding:12px;border:0;border-radius:9px;background:var(--blue);color:#fff;font-weight:800}.login-card small{display:block;text-align:center;margin-top:10px;color:var(--muted)}header{position:fixed;top:0;left:260px;right:0;height:64px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:12px;padding:0 20px;z-index:10}header div{display:flex;flex-direction:column}header span{font-size:12px;color:var(--muted)}header .secondary{margin-left:auto}aside{position:fixed;left:0;top:0;bottom:0;width:260px;background:var(--navy);color:#fff;display:flex;flex-direction:column;z-index:20;transition:.2s}aside.collapsed{width:72px}.brand{display:flex;align-items:center;gap:10px;padding:18px 14px}.brand img{width:42px}.brand div{display:flex;flex-direction:column}.brand small{opacity:.7}.collapse-handle{position:absolute;right:-14px;top:46%;width:30px;height:58px;border:0;border-radius:0 10px 10px 0;background:#287ca9;color:#fff;font-weight:900;cursor:pointer;box-shadow:0 2px 8px #0003}nav{flex:1;overflow-y:auto;padding:4px 10px;min-height:0}nav button,.aside-foot button,.file-btn{display:flex;width:100%;align-items:center;gap:9px;border:0;background:transparent;color:#fff;padding:11px 12px;border-radius:9px;text-align:left;cursor:pointer;margin:2px 0;white-space:nowrap}nav button:hover,nav button.active{background:#ffffff20}.aside-foot{padding:10px;border-top:1px solid #ffffff2a}.aside-foot small{display:block;text-align:center;opacity:.65;padding:5px}.file-btn input{display:none}aside.collapsed .brand div,aside.collapsed nav button{font-size:0}aside.collapsed nav button{justify-content:center;font-size:20px}aside.collapsed .aside-foot{display:none}aside.collapsed .brand{justify-content:center}aside.collapsed+.x{}main{margin-left:260px;padding:88px 22px 30px;transition:.2s}body.menu-collapsed header{left:72px}body.menu-collapsed main{margin-left:72px}.page-head{display:flex;justify-content:space-between;gap:14px;align-items:center;margin-bottom:16px}.page-head h1{margin:0}.page-head p{margin:4px 0;color:var(--muted)}.toolbar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:12px 0}.toolbar input,.toolbar select{padding:9px 10px;border:1px solid var(--line);border-radius:8px;background:#fff}.btn{border:0;border-radius:8px;padding:9px 12px;cursor:pointer;font-weight:750}.primary{background:var(--green);color:#fff}.edit{background:var(--blue);color:#fff}.detail{background:#5b5bd6;color:#fff}.cancel{background:var(--orange);color:#fff}.reverse{background:var(--red);color:#fff}.secondary{background:#fff;border:1px solid var(--line);color:var(--ink)}.danger{background:var(--red);color:#fff}.card{background:#fff;border:1px solid var(--line);border-radius:14px;padding:16px;box-shadow:0 6px 20px #12324a0b}.kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px;margin-bottom:16px}.kpi{background:#fff;border:1px solid var(--line);border-radius:13px;padding:15px}.kpi small{display:block;color:var(--muted)}.kpi strong{font-size:24px}.table-wrap{overflow:auto;background:#fff;border:1px solid var(--line);border-radius:12px}table{width:100%;border-collapse:collapse;min-width:820px}th,td{padding:10px 12px;border-bottom:1px solid #edf1f4;text-align:left;vertical-align:middle}th{background:#f8fafb;font-size:12px;text-transform:uppercase;color:#586a77;position:sticky;top:0}.tag{display:inline-flex;padding:4px 8px;border-radius:99px;font-size:12px;font-weight:800}.good{background:#e5f5ed;color:#146c47}.warn{background:#fff2d8;color:#865400}.bad{background:#fde8e6;color:#9c1d15}.money{text-align:right;font-variant-numeric:tabular-nums}.actions{display:flex;gap:6px;align-items:center}.action-menu{position:relative}.action-menu summary{list-style:none;cursor:pointer;padding:8px 10px;border:1px solid var(--line);border-radius:8px;background:#fff;font-weight:700}.action-menu summary.action-summary{background:var(--orange);border-color:var(--orange);color:#fff}.action-menu summary::-webkit-details-marker{display:none}.action-menu[open] .menu-pop{display:grid}.menu-pop{display:none;position:absolute;right:0;top:40px;z-index:8;background:#fff;border:1px solid var(--line);box-shadow:0 8px 24px #0002;border-radius:10px;padding:7px;min-width:150px;gap:6px}.menu-pop button{width:100%}.filters .custom-range{display:inline-flex;gap:6px}.pagination{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:12px}.modal{position:fixed;inset:0;background:#0007;display:grid;place-items:center;padding:18px;z-index:100}.modal-card{width:min(760px,96vw);max-height:90vh;overflow:auto;background:#fff;border-radius:16px;padding:22px;position:relative}.modal-card.compact{width:min(420px,94vw)}.modal-close{position:absolute;right:12px;top:10px;border:0;background:none;font-size:26px}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 14px}.span-2{grid-column:1/-1}.error-box{background:#fde8e6;color:#8f1d16;border:1px solid #f4bbb6;padding:10px;border-radius:9px;margin-bottom:10px}.invalid{border-color:var(--red)!important;background:#fff5f4!important}.required{color:var(--red)}.note{background:#eef6fa;border-left:4px solid var(--blue);padding:10px 12px;border-radius:6px}.tabs{display:flex;gap:6px;margin:8px 0}.tabs button{border:1px solid var(--line);background:#fff;padding:8px;border-radius:8px}.tabs button.active{background:var(--navy);color:#fff}.icon-btn{display:none;border:0;background:none;font-size:22px}#toast{position:fixed;right:max(16px,env(safe-area-inset-right));top:max(76px,calc(env(safe-area-inset-top) + 16px));width:max-content;max-width:min(520px,calc(100vw - 32px));background:#17232d;color:#fff;padding:12px 16px;border-radius:10px;opacity:0;transform:translateY(-10px);transition:.2s;z-index:300;box-shadow:0 10px 28px #0003;overflow-wrap:anywhere;text-align:left}#toast.show{opacity:1;transform:none}#toast.success{background:var(--green)}#toast.warning{background:#8a5a00}#toast.error{background:var(--red)}#toast.info{background:var(--blue)}.client-name{text-decoration:none;color:var(--ink);font-weight:700}.client-name:hover{color:var(--blue)}
@media(max-width:850px){aside{transform:translateX(-100%);width:260px}aside.open{transform:none}header{left:0}.icon-btn{display:block}main{margin-left:0;padding:82px 12px 24px}body.menu-collapsed header{left:0}body.menu-collapsed main{margin-left:0}.form-grid{grid-template-columns:1fr}.span-2{grid-column:auto}.collapse-handle{display:none}}

/* RC1.1 Config homologation */
.section-title{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:16px}.section-title h2,.page-head h2{margin-bottom:4px}.section-title p,.page-head p,.modal-subtitle{margin:0;color:var(--muted);font-size:.92rem}.domain-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:14px}.domain-card{border:1px solid var(--line);border-radius:14px;padding:16px;display:flex;flex-direction:column;gap:12px;background:var(--panel)}.domain-card h3{margin:0 0 5px}.domain-card p{margin:0;color:var(--muted);font-size:.9rem}.domain-card small{color:var(--muted)}.domain-values{display:flex;flex-wrap:wrap;gap:6px;min-height:32px}.chip{display:inline-flex;padding:5px 9px;border-radius:999px;background:var(--soft);font-size:.82rem}.domain-card.locked{opacity:.82}.money-input{display:flex;align-items:center;border:1px solid var(--line);border-radius:9px;background:var(--panel);overflow:hidden}.money-input>span{padding:0 10px;color:var(--muted);font-weight:700}.money-input input{border:0!important;border-left:1px solid var(--line)!important;border-radius:0!important;width:100%}.rule-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px}.card.compact{margin:16px 0;padding:16px}.disabled-field{opacity:.55}.note{border-left:4px solid var(--accent);padding:12px 14px;background:var(--soft);border-radius:8px;margin-bottom:16px}.field small{display:block;margin-top:5px;color:var(--muted);line-height:1.35}

/* RC1.1 Config compacto — apenas apresentação; regras e dados preservados */
.compact-config{display:grid;gap:12px;max-width:1500px;margin:0 auto}
.compact-config>.note{margin:0;padding:9px 12px;font-size:.88rem}
.compact-config>.card{padding:12px;border-radius:12px;box-shadow:0 3px 12px #12324a08}
.compact-config .section-title,.compact-config .page-head{margin-bottom:10px;align-items:center}
.compact-config .section-title h2,.compact-config .page-head h2{margin:0;font-size:1.05rem}
.compact-config .section-title p,.compact-config .page-head p{font-size:.82rem;line-height:1.3;margin-top:2px}
.compact-config .form-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px 10px}
.compact-config label.field{margin:5px 0;font-size:.88rem}
.compact-config .field input,.compact-config .field select,.compact-config .field textarea{margin-top:4px;padding:8px 10px}
.compact-config .field small{font-size:.74rem;margin-top:3px}
.compact-config .money-input>span{padding:0 8px}
.compact-config .table-wrap{border-radius:10px}
.compact-config table{min-width:760px}
.compact-config th,.compact-config td{padding:8px 10px}
.compact-config .domain-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.compact-config .domain-card{padding:11px;border-radius:11px;gap:8px}
.compact-config .domain-card h3{font-size:.95rem}
.compact-config .domain-card p,.compact-config .domain-card small{font-size:.76rem;line-height:1.3}
.compact-config .domain-values{min-height:26px;gap:4px}
.compact-config .chip{padding:4px 7px;font-size:.75rem}
.compact-config .btn{padding:8px 10px}
@media(max-width:1100px){.compact-config .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.compact-config .domain-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.compact-config .form-grid,.compact-config .domain-grid{grid-template-columns:1fr}}

.mini-action{margin-top:8px;padding:7px 10px}.review-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:12px 0}.review-box{border:1px solid var(--line);border-radius:10px;padding:12px;background:#f8fafb}.review-box small{display:block;color:var(--muted);margin-bottom:5px}.review-box strong{font-size:18px}@media(max-width:600px){.review-grid{grid-template-columns:1fr}#toast{left:14px;right:14px;top:72px}}

/* Sprint 02 — Fluxo RC2.1 */
.nowrap{white-space:nowrap}.type-income{background:#e5f5ed!important;color:#146c47!important}.type-expense{background:#fde8e6!important;color:#9c1d15!important}.finance-kpis{margin:12px 0}.finance-table table{min-width:1380px}.finance-table th,.finance-table td{white-space:nowrap}.finance-table td:nth-child(5){white-space:normal;min-width:190px}.menu-empty{display:block;padding:8px;color:var(--muted);font-size:.85rem}.fab{position:fixed;right:28px;bottom:28px;width:56px;height:56px;border:0;border-radius:50%;background:var(--green);color:#fff;font-size:30px;line-height:1;box-shadow:0 10px 26px #0004;cursor:pointer;z-index:50}.fab:hover{filter:brightness(.94);transform:translateY(-1px)}.filters{flex-wrap:wrap}.filters .custom-range{order:3}.filters [data-filter="clear"]{order:4}.action-menu .menu-pop{z-index:500}.modal-card input[type="date"]{min-width:170px}.hidden{display:none!important}@media(max-width:700px){.fab{right:18px;bottom:18px}.finance-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Sprint 02 RC2.2 — estabilização do Fluxo */
.no-actions{display:inline-block;color:var(--muted);min-width:18px;text-align:center}
.action-menu .menu-pop{z-index:1000}
.field input.invalid,.field select.invalid,.field textarea.invalid{border-color:var(--red)!important;background:#fff5f4!important}
/* Recolhimento total: deixa somente a alça de reabertura */
aside.collapsed{width:0;overflow:visible}
aside.collapsed .brand,aside.collapsed nav,aside.collapsed .aside-foot{display:none!important}
body.menu-collapsed header{left:0}
body.menu-collapsed main{margin-left:0}
aside.collapsed .collapse-handle{right:-30px;border-radius:0 10px 10px 0}
@media(max-width:850px){aside.collapsed{transform:translateX(-100%)}body.menu-collapsed header{left:0}body.menu-collapsed main{margin-left:0}}

/* RC2.4.0 — Consolidação operacional */
.dashboard-scope{display:inline-flex;margin:0 0 14px;padding:7px 10px;border-radius:999px;background:#eaf2f7;color:var(--navy);font-size:.84rem;font-weight:750}
.agenda-summary{display:grid;grid-template-columns:repeat(2,minmax(170px,260px));gap:12px;margin-bottom:16px}.agenda-card{margin-bottom:16px}.agenda-card h2{margin-top:0}.agenda-table{min-width:960px}.empty-state{text-align:center;color:var(--muted);padding:28px!important}.checkline{display:flex;align-items:flex-start;gap:9px;line-height:1.35}.checkline input{width:auto!important;margin:2px 0 0!important;flex:0 0 auto}.pos-currency{text-align:right;font-variant-numeric:tabular-nums}.table-wrap table td{line-height:1.25}.table-wrap table td,.table-wrap table th{overflow-wrap:normal}.table-wrap table td:nth-child(1),.table-wrap table td:nth-child(2),.table-wrap table .money{white-space:nowrap}.table-wrap table tbody tr{height:50px}.table-wrap table tbody tr:hover{background:#f8fbfc}.agenda-table td{white-space:nowrap}.agenda-table td:nth-child(2){min-width:180px}.agenda-table td:nth-child(3){min-width:150px}.agenda-table td:nth-child(5){min-width:120px}
@media(max-width:700px){.agenda-summary{grid-template-columns:1fr}.page-head{align-items:flex-start}.page-head>.btn{flex:0 0 auto}}

/* RC2.4.0 — Bloco 1: consistência do grid e datas brasileiras */
.job-table table{min-width:1180px}
.job-table th,.job-table td{white-space:nowrap}
.job-table td:nth-child(3){min-width:180px}
.job-table td:nth-child(4){min-width:145px}
.job-table td:nth-child(10){min-width:150px}
.job-table td:last-child{min-width:170px}
.job-table .tag{white-space:nowrap}
.job-table .actions{flex-wrap:nowrap;white-space:nowrap}
.date-br{min-width:132px;font-variant-numeric:tabular-nums}
.custom-range .date-br{width:132px}

/* RC2.4.0 — detalhes e linha de vida auditável do Job */
.detail-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px 18px;margin:12px 0 20px}
.detail-grid p{margin:0;padding:10px 12px;background:var(--panel,#f8fafc);border-radius:10px}
.job-timeline{list-style:none;margin:12px 0 20px;padding:0;border-left:3px solid #d7dee8}
.job-timeline li{position:relative;display:grid;grid-template-columns:110px 1fr;gap:14px;padding:0 0 18px 18px}
.job-timeline li::before{content:"";position:absolute;left:-8px;top:4px;width:13px;height:13px;border-radius:50%;background:#fff;border:3px solid #64748b}
.job-timeline time{font-weight:700;white-space:nowrap}
.job-timeline li div{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap}

/* RC2.4.1 — padronização de cadastros e ledger */
.actions>.secondary,.actions>.edit{white-space:nowrap}.fab:focus-visible{outline:3px solid #fff;outline-offset:2px}.ledger-cycle{font-size:.78rem;color:var(--muted)}

.money-input>span{flex:0 0 auto;user-select:none}.money-input .pos-currency{min-width:0}
@media(max-width:600px){#toast{right:16px;left:16px;width:auto;max-width:none;top:72px}.actions{flex-wrap:wrap}}

/* RC2.5 — N Helpers por Job */
.team-card{margin-top:16px}
.team-grid{display:grid;gap:10px}
.team-row{display:grid;grid-template-columns:minmax(180px,1.3fr) minmax(130px,.8fr) minmax(150px,.8fr) minmax(180px,1fr);gap:10px;align-items:end;padding:12px;border:1px solid var(--border);border-radius:12px;background:var(--surface)}
.team-row.selected{border-color:var(--primary);box-shadow:0 0 0 2px rgba(37,99,235,.08)}
.team-check{align-self:center;padding-bottom:10px}
.payment-members{display:grid;gap:8px;margin:14px 0}
.payment-member{display:flex;justify-content:space-between;gap:16px;align-items:center;padding:12px;border:1px solid var(--border);border-radius:10px}
@media(max-width:850px){.team-row{grid-template-columns:1fr}.team-check{padding-bottom:0}.payment-member{align-items:flex-start;flex-direction:column}}

/* RC2.5.1 — equipe progressiva e confirmação interna */
.compact-team-row{display:grid;grid-template-columns:minmax(220px,1.3fr) minmax(170px,.8fr) minmax(220px,1fr) auto;gap:10px;align-items:end;padding:12px;border:1px solid var(--line);border-radius:12px;background:#fff}.compact-team-row .remove-helper{margin-bottom:12px}.team-required-note{align-self:center;color:var(--muted);font-size:.82rem;padding:0 6px 12px}.add-helper{margin-top:10px}.confirm-overlay{position:fixed;inset:0;background:#0008;display:grid;place-items:center;padding:18px;z-index:500}.confirm-card{width:min(480px,94vw);background:#fff;border-radius:16px;padding:22px;box-shadow:0 20px 60px #0005}.confirm-card h2{margin:0 0 10px}.confirm-card p{line-height:1.5;color:var(--ink)}.confirm-actions{justify-content:flex-end;margin-top:18px}@media(max-width:850px){.compact-team-row{grid-template-columns:1fr}.compact-team-row .remove-helper{margin-bottom:0}.team-required-note{padding:0}}

/* RC2.5.2 — Equipe responsiva e distribuição de Tip */
.team-card{overflow:hidden}.team-row-v2{display:grid;grid-template-columns:minmax(220px,1.35fr) minmax(155px,.8fr) minmax(145px,.7fr);gap:12px;align-items:start;padding:14px;border:1px solid var(--line);border-radius:12px;background:#fff}.team-row-v2 .team-exception{grid-column:1/-1}.team-row-v2 .remove-helper{justify-self:end;grid-column:3}.helper-main{position:relative;min-width:0}.helper-main select{width:100%;min-width:0}.primary-helper-badge{display:inline-flex;margin-top:6px;padding:3px 7px;border-radius:999px;background:var(--soft);color:var(--muted);font-size:.75rem;font-weight:800}.tip-summary{display:flex;flex-wrap:wrap;gap:8px 18px;margin-top:12px;padding:10px 12px;background:var(--soft);border-radius:10px;font-size:.9rem}.tip-over{color:var(--red)}.modal-card{overflow-x:hidden}.team-row-v2 input,.team-row-v2 select{max-width:100%;box-sizing:border-box}@media(max-width:850px){.team-row-v2{grid-template-columns:1fr}.team-row-v2 .team-exception,.team-row-v2 .remove-helper{grid-column:1}.team-row-v2 .remove-helper{justify-self:start}}
/* RC2.5.3 — Equipe do Job e política de Tip */
.add-helper{background:#0f766e!important;color:#fff!important;border-color:#0f766e!important;font-weight:800;box-shadow:0 2px 6px rgba(15,118,110,.22)}
.add-helper:hover{filter:brightness(.95)}
.tip-summary{align-items:center}
.tip-policy-action{margin-left:auto}
.tip-exception-reason{flex:1 1 100%;margin-top:4px}
.tip-exception-reason input{width:100%;box-sizing:border-box}
.team-row-v2 .remove-helper{align-self:end}
@media(max-width:850px){.tip-policy-action{margin-left:0}.tip-summary{align-items:stretch}}

/* RC2.6.0 — Agenda operacional */
.agenda-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 0 14px;flex-wrap:wrap}.agenda-view-buttons,.agenda-nav{display:flex;align-items:center;gap:8px}.agenda-nav strong{min-width:250px;text-align:center;text-transform:capitalize}.agenda-filters{display:grid;grid-template-columns:minmax(220px,2fr) repeat(3,minmax(145px,1fr)) auto;gap:10px;align-items:end;margin-bottom:14px}.agenda-filters .field{margin:0}.agenda-kpis{grid-template-columns:repeat(4,minmax(150px,1fr));margin-bottom:16px}.agenda-day{margin:0 0 18px}.agenda-day-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:0 0 8px;padding:0 4px}.agenda-day-head h2{margin:0;text-transform:capitalize;font-size:1.05rem}.agenda-day-head small{color:var(--muted)}.agenda-list{display:grid;gap:8px}.agenda-item{display:grid;grid-template-columns:150px minmax(260px,1fr) 170px auto;gap:16px;align-items:center;background:#fff;border:1px solid var(--line);border-radius:12px;padding:13px 15px;box-shadow:0 2px 8px rgba(18,50,74,.04)}.agenda-item:hover{border-color:#b8cbd5;box-shadow:0 5px 16px rgba(18,50,74,.08)}.agenda-item.agenda-conflict{border-left:5px solid #b42318}.agenda-time,.agenda-main,.agenda-state{display:flex;flex-direction:column;gap:4px}.agenda-time small,.agenda-main small,.agenda-state small{color:var(--muted)}.agenda-title{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.agenda-actions{display:flex;gap:7px;justify-content:flex-end}.agenda-custom{margin-bottom:12px}.agenda-custom label{display:flex;align-items:center;gap:8px}
@media(max-width:1050px){.agenda-filters{grid-template-columns:repeat(2,minmax(180px,1fr))}.agenda-item{grid-template-columns:135px 1fr 150px}.agenda-actions{grid-column:2/4;justify-content:flex-start}.agenda-kpis{grid-template-columns:repeat(2,minmax(150px,1fr))}}
@media(max-width:700px){.agenda-toolbar,.agenda-day-head{align-items:stretch;flex-direction:column}.agenda-nav{justify-content:space-between}.agenda-nav strong{min-width:0}.agenda-filters,.agenda-kpis{grid-template-columns:1fr}.agenda-item{grid-template-columns:1fr;gap:9px}.agenda-actions{grid-column:auto}.agenda-view-buttons{overflow-x:auto}.agenda-day-head .btn{width:100%}}
.agenda-filter-actions{display:flex;gap:7px;align-items:center}.agenda-filter-actions .btn{white-space:nowrap}
@media(max-width:700px){.agenda-filter-actions{display:grid;grid-template-columns:1fr 1fr}}

/* RC2.6.1 — Schedule visual */
.schedule-top,.schedule-subbar,.schedule-period,.schedule-switcher{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.schedule-top{justify-content:space-between;margin-bottom:12px}.schedule-period strong{min-width:220px;text-align:center}.schedule-switcher{background:var(--panel,#fff);border:1px solid var(--line,#d9e2ec);border-radius:12px;padding:4px}.schedule-switcher button{border:0;background:transparent;padding:8px 11px;border-radius:9px;cursor:pointer}.schedule-switcher button.active{background:#1f6feb;color:#fff}.schedule-subbar{justify-content:space-between;margin-bottom:12px}.agenda-filters.collapsed{display:none}.schedule-canvas{display:grid;gap:14px}.schedule-day{background:#fff;border:1px solid #e4e9f0;border-radius:16px;padding:14px}.schedule-day-title{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}.schedule-day-title h2{font-size:1rem;margin:0;text-transform:capitalize}.schedule-day-title small{color:#667085}.schedule-stacked,.schedule-compact,.schedule-details,.schedule-list{display:grid;gap:8px}.schedule-card{display:grid;grid-template-columns:120px 1fr auto;gap:14px;align-items:center;border:1px solid #e6ebf1;border-radius:14px;padding:12px;background:#fff;position:relative;overflow:hidden}.schedule-card.stacked-view{grid-template-columns:5px 120px 1fr auto}.schedule-accent{align-self:stretch;background:#1f6feb;border-radius:8px}.schedule-card.compact-view{grid-template-columns:120px 1fr auto auto;padding:9px 12px}.schedule-card.details-view{align-items:start}.schedule-time{font-weight:700}.schedule-body,.schedule-client,.schedule-side{display:flex;flex-direction:column;gap:4px}.schedule-title{display:flex;gap:8px;align-items:center}.schedule-client span,.schedule-body span,.schedule-body small{color:#667085}.schedule-actions{display:flex;gap:6px;flex-wrap:wrap;margin-top:5px}.icon-action{border:0;background:#eef4ff;color:#175cd3;border-radius:8px;padding:6px 8px;cursor:pointer;font-size:.78rem}.schedule-list-row{display:grid;grid-template-columns:120px 1.4fr 1fr auto auto;gap:12px;align-items:center;padding:10px 6px;border-bottom:1px solid #edf0f4}.schedule-list-row>div:nth-child(2){display:flex;flex-direction:column}.schedule-list-row span{color:#667085}.has-conflict{box-shadow:inset 4px 0 #d92d20}.calendar-weekdays,.calendar-grid{display:grid;grid-template-columns:repeat(7,1fr)}.calendar-weekdays span{padding:8px;text-align:center;font-weight:700;color:#667085}.calendar-cell{min-height:120px;border:1px solid #e6ebf1;padding:6px;background:#fff}.calendar-cell.outside{background:#f8fafc;color:#98a2b3}.calendar-cell.today-cell{outline:2px solid #1f6feb;outline-offset:-2px}.calendar-date{border:0;background:transparent;font-weight:700;cursor:pointer}.calendar-jobs{display:grid;gap:4px;margin-top:5px}.calendar-job{border:0;text-align:left;background:#eef4ff;border-radius:6px;padding:4px;font-size:.75rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.calendar-job.conflict-dot{border-left:3px solid #d92d20}.invoice-preview{border:1px solid #dfe5ec;border-radius:14px;padding:18px;background:#fff}.invoice-preview table{width:100%;margin-top:16px}.invoice-preview th,.invoice-preview td{padding:9px;border-bottom:1px solid #edf0f4}.invoice-preview td:last-child,.invoice-preview th:last-child{text-align:right}
@media(max-width:800px){.schedule-card,.schedule-card.stacked-view,.schedule-card.compact-view{grid-template-columns:1fr}.schedule-accent{display:none}.schedule-list-row{grid-template-columns:90px 1fr}.schedule-list-row>div:nth-child(n+3),.schedule-list-row>.schedule-actions{grid-column:2}.calendar-cell{min-height:85px}.calendar-job{font-size:.68rem}.schedule-period strong{min-width:0}}


/* RC2.6.2 — Refinamento visual e alinhamento da Agenda */
.agenda-workspace{width:100%;max-width:none;margin:0;display:grid;gap:14px}
.schedule-switcher-top{width:max-content;max-width:100%;margin:0 0 2px;overflow-x:auto;scrollbar-width:thin;background:#eaf0f5;border-color:#cfdbe4;padding:5px;border-radius:14px}
.schedule-switcher-top button{min-width:112px;padding:10px 14px;font-weight:800;white-space:nowrap;color:#445767}
.schedule-switcher-top button.active{background:var(--navy);color:#fff;box-shadow:0 3px 10px rgba(18,50,74,.18)}
.agenda-heading{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:2px 0 0}
.agenda-heading h1{margin:0;font-size:1.65rem;letter-spacing:-.02em}
.agenda-heading p{margin:4px 0 0;color:var(--muted)}
.agenda-new-button{min-width:132px;padding:10px 16px}
.agenda-control-panel{position:relative;display:grid;grid-template-columns:auto minmax(260px,1fr) auto;align-items:center;gap:16px;background:#fff;border:1px solid var(--line);border-radius:16px;padding:11px 13px;box-shadow:0 5px 18px rgba(18,50,74,.06)}
.agenda-period-tabs{display:flex;align-items:center;gap:4px;padding:4px;background:#eef3f6;border-radius:11px}
.agenda-period-tabs button{border:0;background:transparent;color:#4f6270;padding:8px 13px;border-radius:8px;font-weight:800;cursor:pointer}
.agenda-period-tabs button.active{background:#fff;color:var(--blue);box-shadow:0 2px 8px rgba(18,50,74,.12)}
.schedule-period-centered{justify-self:center;display:grid;grid-template-columns:38px minmax(250px,auto) 38px;align-items:center;gap:9px}
.schedule-period-centered strong{min-width:0;text-align:center;text-transform:capitalize;font-size:1rem;color:var(--ink)}
.period-arrow{width:38px;height:38px;border:1px solid var(--line);border-radius:10px;background:#fff;color:var(--navy);font-size:1.45rem;line-height:1;cursor:pointer}
.period-arrow:hover{background:#f1f6f9;border-color:#b7c8d3}
.agenda-filter-toggle{justify-self:end}
.schedule-canvas{width:100%;min-width:0}
.schedule-canvas.calendar-canvas{background:#fff;border:1px solid var(--line);border-radius:16px;padding:12px;box-shadow:0 6px 20px rgba(18,50,74,.06)}
.calendar-weekdays{width:100%;border-bottom:1px solid #e7edf1}
.calendar-weekdays span{padding:11px 8px}
.calendar-grid{width:100%}
.calendar-cell{min-height:145px;padding:8px;border-color:#e3e9ee}
.calendar-date{width:30px;height:30px;border-radius:50%;display:grid;place-items:center}
.calendar-date:hover{background:#edf4f8}
.calendar-cell.today-cell{outline:0;background:#f5faff;box-shadow:inset 0 0 0 2px var(--blue)}
.calendar-job{padding:6px 7px;font-size:.78rem}
@media(min-width:1500px){.calendar-cell{min-height:165px}.schedule-canvas.calendar-canvas{padding:16px}}
@media(max-width:1050px){.agenda-control-panel{grid-template-columns:1fr auto}.schedule-period-centered{grid-column:1/-1;grid-row:2;justify-self:stretch;grid-template-columns:38px 1fr 38px}.agenda-filter-toggle{grid-column:2;grid-row:1}.agenda-period-tabs{grid-column:1;grid-row:1;width:max-content}}
@media(max-width:700px){.schedule-switcher-top{width:100%}.schedule-switcher-top button{min-width:104px}.agenda-heading{align-items:flex-start}.agenda-heading p{font-size:.86rem}.agenda-new-button{min-width:auto;white-space:nowrap}.agenda-control-panel{grid-template-columns:1fr;padding:10px}.agenda-period-tabs{grid-column:1;grid-row:1;width:100%;display:grid;grid-template-columns:repeat(3,1fr)}.agenda-period-tabs button{padding:8px 5px}.schedule-period-centered{grid-column:1;grid-row:2}.agenda-filter-toggle{grid-column:1;grid-row:3;justify-self:stretch}.calendar-cell{min-height:92px;padding:4px}.calendar-weekdays span{padding:7px 2px;font-size:.76rem}.calendar-job{padding:3px;font-size:.66rem}.schedule-canvas.calendar-canvas{padding:5px;border-radius:12px}}

/* RC2.6.3 — Agenda ERP em três blocos */
.agenda-erp{display:grid;gap:14px;min-width:0}.agenda-erp-head{display:flex;align-items:center;justify-content:space-between;gap:16px}.agenda-erp-head h1{margin:0;font-size:1.7rem}.agenda-erp-head p{margin:4px 0 0;color:var(--muted)}
.agenda-main-toolbar{display:grid;grid-template-columns:auto minmax(300px,1fr) auto;gap:14px;align-items:center;background:#fff;border:1px solid var(--line);border-radius:14px;padding:10px 12px;box-shadow:0 4px 14px rgba(18,50,74,.05)}
.agenda-view-tabs{display:flex;background:#eef3f6;border-radius:10px;padding:4px;gap:3px}.agenda-view-tabs button{border:0;background:transparent;padding:8px 13px;border-radius:8px;font-weight:800;color:#526575;cursor:pointer}.agenda-view-tabs button.active{background:#fff;color:var(--blue);box-shadow:0 2px 7px rgba(18,50,74,.13)}
.agenda-date-nav{display:grid;grid-template-columns:auto 34px minmax(190px,1fr) 34px;align-items:center;gap:7px;justify-self:center}.agenda-date-nav button{border:1px solid var(--line);background:#fff;border-radius:8px;padding:7px 10px;cursor:pointer}.agenda-date-nav strong{text-align:center;text-transform:capitalize}
.agenda-layout{display:grid;grid-template-columns:210px minmax(0,1fr) 285px;gap:14px;min-height:650px}.agenda-left,.agenda-context,.agenda-center{background:#fff;border:1px solid var(--line);border-radius:16px;min-width:0}.agenda-left{padding:12px;align-self:start;position:sticky;top:10px}.agenda-center{padding:12px;overflow:hidden}.agenda-stage{overflow:auto;min-height:590px}.agenda-context{padding:16px;align-self:start;position:sticky;top:10px}.agenda-context.empty{display:grid;place-items:center;text-align:center;color:var(--muted);min-height:220px}.agenda-context.empty h3{color:var(--ink)}
.mini-calendar-title{display:grid;grid-template-columns:28px 1fr 28px;align-items:center;gap:4px;text-align:center;text-transform:capitalize}.mini-calendar-title button{border:0;background:transparent;font-size:1.2rem;cursor:pointer}.mini-weekdays,.mini-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:2px}.mini-weekdays{margin-top:10px}.mini-weekdays span{text-align:center;font-size:.7rem;color:var(--muted);font-weight:800}.mini-grid button{border:0;background:transparent;border-radius:7px;padding:6px 2px;font-size:.75rem;cursor:pointer}.mini-grid button.outside{color:#b2bcc5}.mini-grid button.today{outline:1px solid var(--blue)}.mini-grid button.selected{background:var(--blue);color:#fff}
.agenda-filter-section{border-top:1px solid var(--line);margin-top:14px;padding-top:13px;display:grid;gap:8px}.agenda-filter-section label{font-size:.84rem;display:flex;gap:7px;align-items:center}.agenda-filter-section input{width:auto}.filter-title{margin-bottom:2px}
.erp-week-grid{display:grid;grid-template-columns:repeat(7,minmax(170px,1fr));gap:8px;min-width:1190px}.erp-week-grid.single-day{grid-template-columns:minmax(420px,1fr);min-width:0;max-width:760px}.erp-day-column{border:1px solid #e5eaf0;border-radius:13px;background:#f9fbfc;min-height:545px;overflow:hidden}.erp-day-head{display:flex;align-items:center;justify-content:space-between;padding:10px;border-bottom:1px solid #e5eaf0;background:#fff}.erp-day-head>div{display:flex;align-items:center;gap:7px;text-transform:capitalize}.erp-day-head span{display:grid;place-items:center;width:28px;height:28px;border-radius:50%;background:#eef4ff;color:#175cd3;font-weight:800}.erp-day-head button{border:0;background:transparent;font-size:1.2rem;cursor:pointer}.erp-day-events{display:grid;gap:7px;padding:8px}.erp-event{display:grid;grid-template-columns:auto 1fr;gap:7px;text-align:left;border:1px solid #dfe7ef;background:#fff;border-radius:10px;padding:9px;cursor:pointer;box-shadow:0 2px 6px rgba(18,50,74,.04)}.erp-event:hover{border-color:#9fb8cc}.erp-event-time{font-weight:800;color:#175cd3}.erp-event-main{display:flex;flex-direction:column;gap:2px;min-width:0}.erp-event-main small{color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.erp-event-status{grid-column:1/-1}.erp-event-status .tag{font-size:.68rem}
.context-head{display:flex;justify-content:space-between;gap:10px}.context-head h3{margin:3px 0 0}.context-head small{color:var(--muted)}.context-head button{border:0;background:transparent;font-size:1.4rem;cursor:pointer}.context-list{display:grid;gap:0;margin:14px 0}.context-list>div{padding:9px 0;border-bottom:1px solid #edf0f4}.context-list dt{font-size:.72rem;text-transform:uppercase;color:var(--muted);font-weight:800}.context-list dd{margin:4px 0 0}.context-notes{background:#f7f9fb;border-radius:10px;padding:10px}.context-notes p{margin:5px 0 0;color:#526575}.context-actions{display:grid;gap:7px;margin-top:14px}.context-actions .btn{width:100%}
.agenda-list-head,.agenda-list-item{display:grid;grid-template-columns:110px minmax(240px,1.5fr) minmax(160px,1fr) 130px;gap:12px;align-items:center}.agenda-list-head{padding:8px 12px;color:var(--muted);font-size:.75rem;font-weight:800;text-transform:uppercase}.agenda-list-item{width:100%;border:0;border-bottom:1px solid #edf0f4;background:#fff;padding:12px;text-align:left;cursor:pointer}.agenda-list-item:hover{background:#f8fbfc}.agenda-list-item>span:nth-child(2){display:flex;flex-direction:column;gap:3px}.agenda-list-item small{color:var(--muted)}.agenda-list-time{font-weight:800;color:#175cd3}
.team-timeline{min-width:900px}.team-hours,.team-row{display:grid;grid-template-columns:150px 1fr}.team-hours>span{border-right:1px solid var(--line)}.team-hours>div{display:grid}.team-hours{height:34px}.team-hours b{font-size:.72rem;color:var(--muted);text-align:center}.team-hours{grid-template-columns:150px repeat(12,1fr)}.team-row{min-height:82px;border-top:1px solid #e7ebf0}.team-name{padding:12px;display:flex;flex-direction:column}.team-name small{color:var(--muted)}.team-track{position:relative;background:repeating-linear-gradient(to right,transparent 0,transparent calc(8.333% - 1px),#edf0f4 calc(8.333% - 1px),#edf0f4 8.333%)}.team-event{position:absolute;top:13px;width:150px;max-width:18%;border:1px solid #b8d0ef;background:#eef5ff;border-radius:9px;padding:8px;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}.team-event.has-conflict,.erp-event.has-conflict,.agenda-list-item.has-conflict{box-shadow:inset 4px 0 #d92d20}
.month-stage .calendar-cell{min-height:132px}.agenda-center .agenda-filters{margin-bottom:10px}
@media(max-width:1250px){.agenda-layout{grid-template-columns:190px minmax(0,1fr)}.agenda-context{display:none}.agenda-main-toolbar{grid-template-columns:1fr auto}.agenda-date-nav{grid-column:1/-1;grid-row:2;width:100%}.agenda-view-tabs{overflow-x:auto}}
@media(max-width:800px){.agenda-layout{grid-template-columns:1fr}.agenda-left{position:static;display:none}.agenda-main-toolbar{grid-template-columns:1fr}.agenda-view-tabs{width:100%}.agenda-date-nav{grid-template-columns:auto 32px 1fr 32px}.agenda-erp-head p{display:none}.agenda-center{padding:8px}.erp-week-grid{min-width:1050px}.agenda-list-head{display:none}.agenda-list-item{grid-template-columns:80px 1fr}.agenda-list-item>span:nth-child(3),.agenda-list-item>span:nth-child(4){display:none}}

/* RC3.0.0 PILOTO — Agenda Inteligente */
.agenda-smart{display:grid;gap:13px;min-width:0}.agenda-smart-head{display:flex;align-items:center;justify-content:space-between;gap:14px}.agenda-smart-head h1{margin:0;font-size:1.75rem}.agenda-smart-head p{margin:4px 0 0;color:var(--muted)}.smart-head-actions{display:flex;align-items:center;gap:10px}.pilot-badge{background:#dff7df;color:#18752a;border-radius:999px;padding:6px 10px;font-size:.72rem;font-weight:900}.smart-toolbar{display:grid;grid-template-columns:auto minmax(300px,1fr) auto;gap:12px;align-items:center;background:#fff;border:1px solid var(--line);border-radius:14px;padding:10px 12px;box-shadow:0 4px 14px rgba(18,50,74,.05)}.smart-layout{display:grid;grid-template-columns:205px minmax(0,1fr) 285px;gap:12px;min-height:700px}.smart-left{position:sticky;top:8px;align-self:start}.smart-center{background:#fff;border:1px solid var(--line);border-radius:16px;min-width:0;overflow:hidden}.smart-stage{overflow:auto;min-height:650px}.ticket-legend{border-top:1px solid var(--line);margin-top:14px;padding-top:13px;display:grid;gap:7px;font-size:.78rem}.ticket-legend span{display:flex;align-items:center;gap:7px}.ticket-legend i{width:11px;height:11px;border-radius:3px;display:inline-block}.ticket-legend i.job-regular{background:#66b9f0}.ticket-legend i.job-deep{background:#a77be8}.ticket-legend i.job-move{background:#f2b54b}.ticket-legend i.job-commercial{background:#ef82a1}.smart-calendar-shell{min-width:930px}.smart-week-header{display:grid;grid-template-columns:60px repeat(7,minmax(125px,1fr));position:sticky;top:0;z-index:8;background:#fff;border-bottom:1px solid #e7ebf0}.single-day .smart-week-header{grid-template-columns:60px 1fr}.smart-day-title{text-align:center;padding:10px 5px;text-transform:capitalize;border-left:1px solid #edf0f4}.smart-day-title b{display:block;font-size:.76rem;color:#667085}.smart-day-title span{display:inline-grid;place-items:center;width:30px;height:30px;margin-top:3px;font-weight:900}.smart-day-title.today span{background:#1769e0;color:#fff;border-radius:50%}.smart-week-body{display:grid;grid-template-columns:60px repeat(7,minmax(125px,1fr));position:relative}.single-day .smart-week-body{grid-template-columns:60px 1fr}.smart-time-axis{background:#fbfcfd}.smart-time-axis span{display:block;border-top:1px solid #edf0f4;padding:5px 6px;text-align:right;font-size:.7rem;color:#667085}.smart-day-column{position:relative;border-left:1px solid #e8edf2;min-height:864px;background:repeating-linear-gradient(to bottom,#fff 0,#fff 71px,#edf0f4 71px,#edf0f4 72px)}.smart-day-column.drag-over,.smart-month-cell.drag-over{background-color:#edf7ff;outline:2px dashed #1f6feb;outline-offset:-3px}.smart-slot{display:block;width:100%;border:0;background:transparent;cursor:crosshair}.smart-slot:hover{background:rgba(31,111,235,.045)}.smart-ticket-position{position:absolute;left:5px;right:5px;z-index:3}.smart-ticket{width:100%;height:100%;border:1px solid;border-left-width:5px;border-radius:9px;padding:7px 8px;text-align:left;display:flex;flex-direction:column;gap:2px;cursor:grab;overflow:hidden;box-shadow:0 2px 5px rgba(31,42,55,.08)}.smart-ticket:active{cursor:grabbing}.smart-ticket.dragging{opacity:.45}.smart-ticket strong{font-size:.78rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.smart-ticket small{font-size:.67rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ticket-top{display:flex;justify-content:space-between;font-size:.68rem;font-weight:900}.ticket-top i{font-style:normal}.smart-ticket.job-regular{background:#e7f5ff;border-color:#58a9e5;color:#124c79}.smart-ticket.job-deep{background:#f1eaff;border-color:#9b6bdd;color:#5b2f91}.smart-ticket.job-move{background:#fff4db;border-color:#e5a536;color:#8b5500}.smart-ticket.job-commercial{background:#ffe8ef;border-color:#e76d95;color:#8d2b50}.smart-ticket.job-airbnb{background:#e4f8ed;border-color:#54bd80;color:#24663e}.smart-ticket.job-special{background:#e7f8f7;border-color:#4eb7b2;color:#1f6260}.smart-ticket.has-conflict{box-shadow:inset 4px 0 #d92d20,0 2px 5px rgba(31,42,55,.08)}.smart-month-weekdays,.smart-month-grid{display:grid;grid-template-columns:repeat(7,1fr);min-width:850px}.smart-month-weekdays span{text-align:center;padding:10px;font-weight:800;color:#667085;border-bottom:1px solid #e7ebf0}.smart-month-cell{min-height:142px;border-right:1px solid #edf0f4;border-bottom:1px solid #edf0f4;padding:5px;background:#fff}.smart-month-cell.outside{background:#f8fafc}.smart-month-date{width:100%;display:flex;justify-content:space-between;border:0;background:transparent;padding:3px;font-weight:900;cursor:pointer}.smart-month-date span{opacity:0}.smart-month-cell:hover .smart-month-date span{opacity:1}.month-ticket-wrap{height:54px;margin-top:4px}.month-ticket-wrap .smart-ticket{padding:5px}.month-ticket-wrap .smart-ticket small:nth-of-type(n+2){display:none}.more-jobs{display:block;padding:4px;color:#526575;font-weight:700}.quick-create-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:18px 0}.quick-create-card{border:1px solid #cbd9e5;background:#f8fbff;border-radius:14px;padding:20px;text-align:left;display:grid;gap:6px;cursor:pointer}.quick-create-card:hover{border-color:#1f6feb;box-shadow:0 5px 16px rgba(31,111,235,.14)}.quick-create-card.recurring{background:#f3fbf5}.quick-create-icon{font-size:1.6rem;color:#1769e0}.quick-create-card small{color:#667085}.move-summary{display:grid;gap:7px;padding:14px;border:1px solid var(--line);border-radius:12px;background:#f8fafc;margin:14px 0}.move-summary span{color:#526575}
@media(max-width:1280px){.smart-layout{grid-template-columns:190px minmax(0,1fr)}.smart-layout>.agenda-context{display:none}.smart-toolbar{grid-template-columns:1fr auto}.agenda-date-nav{grid-column:1/-1;grid-row:2;width:100%}}
@media(max-width:800px){.smart-layout{grid-template-columns:1fr}.smart-left{display:none}.smart-toolbar{grid-template-columns:1fr}.agenda-view-tabs{overflow-x:auto}.agenda-smart-head p{display:none}.smart-head-actions{flex-wrap:wrap;justify-content:flex-end}.quick-create-grid{grid-template-columns:1fr}.smart-calendar-shell{min-width:820px}}

/* RC3.0.1 FOUNDATION — layout fiel ao piloto aprovado */
body.agenda-foundation-active{background:#f4f6fa}
body.agenda-foundation-active>div#app>header{display:none}
body.agenda-foundation-active main#content{margin-left:228px;padding:0;min-height:100vh}
body.agenda-foundation-active aside#sidebar{width:228px;background:#13233b}
body.agenda-foundation-active aside#sidebar .brand{padding:22px 18px;border-bottom:1px solid rgba(255,255,255,.08)}
body.agenda-foundation-active aside#sidebar nav{padding:18px 12px}
body.agenda-foundation-active aside#sidebar nav button{padding:12px 14px;border-radius:8px;color:#dbe5f1;font-size:.92rem}
body.agenda-foundation-active aside#sidebar nav button.active{background:#2f6fed;color:#fff;box-shadow:0 6px 18px rgba(25,91,216,.3)}
body.agenda-foundation-active aside#sidebar .collapse-handle{display:none}
.foundation-shell{min-height:100vh;background:#f5f7fb;color:#1f2937}
.foundation-titlebar{position:static!important;height:auto!important;background:#fff!important;border-bottom:1px solid #e6eaf0!important;padding:18px 24px!important;display:flex!important;justify-content:space-between!important;align-items:center!important;box-shadow:none!important}
.foundation-titlebar>div{display:block!important}.foundation-titlebar h1{margin:0;font-size:1.45rem}.foundation-titlebar p{margin:5px 0 0;color:#788596;font-size:.87rem}.foundation-titlebar>div:last-child{display:flex!important;align-items:center;gap:12px}.foundation-badge{font-size:.68rem;font-weight:900;letter-spacing:.06em;background:#e7f7eb;color:#26834a;padding:6px 9px;border-radius:999px}.foundation-new-btn{border:0;background:#2764d7;color:white;font-weight:800;padding:10px 16px;border-radius:8px;box-shadow:0 4px 10px rgba(39,100,215,.25);cursor:pointer}
.foundation-commandbar{height:58px;background:#fff;border-bottom:1px solid #e6eaf0;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;padding:0 24px;gap:16px}.foundation-tabs{display:flex;align-self:stretch}.foundation-tabs button{border:0;background:transparent;color:#627084;padding:0 16px;font-weight:750;cursor:pointer;border-bottom:3px solid transparent}.foundation-tabs button.active{color:#2764d7;border-bottom-color:#2764d7}.foundation-nav{display:grid;grid-template-columns:auto 34px minmax(180px,auto) 34px;align-items:center;gap:5px}.foundation-nav button,.foundation-tools button{height:32px;border:1px solid #dce2ea;background:#fff;border-radius:7px;color:#536174;cursor:pointer}.foundation-nav strong{text-align:center;text-transform:capitalize;font-size:.93rem}.foundation-tools{justify-self:end;display:flex;gap:7px}.foundation-tools button{width:34px;font-size:1rem}
.foundation-layout{display:grid;grid-template-columns:205px minmax(700px,1fr) 310px;min-height:calc(100vh - 135px);background:#fff}.foundation-left{position:static!important;width:auto!important;background:#fff!important;color:#263244!important;border-right:1px solid #e6eaf0;padding:16px 14px!important;display:block!important;z-index:auto!important}.foundation-left .mini-calendar{border:0;padding:0 2px 16px;border-bottom:1px solid #edf0f4;border-radius:0;background:transparent}.foundation-left .mini-calendar-title button{border:0;background:transparent;color:#637186}.foundation-left .mini-calendar-title b{font-size:.84rem;text-transform:capitalize}.foundation-left .mini-grid button{height:25px;font-size:.7rem}.foundation-left .mini-grid button.selected,.foundation-left .mini-grid button.today{background:#2f6fed;color:#fff}.foundation-filter{padding:16px 4px 12px;border-bottom:1px solid #edf0f4;display:grid;gap:9px}.foundation-filter>b{font-size:.75rem;text-transform:uppercase;letter-spacing:.06em;color:#8a95a5;margin-bottom:2px}.foundation-filter label{display:flex;align-items:center;gap:8px;font-size:.78rem;cursor:pointer}.foundation-filter input{position:absolute;opacity:0}.filter-dot,.status-dot{width:10px;height:10px;border-radius:3px;background:#4f84ed;box-shadow:0 0 0 2px #fff,0 0 0 3px #d5dce7}.filter-dot.d1{background:#8b65d8}.filter-dot.d2{background:#e98a61}.filter-dot.d3{background:#59aa7d}.status-dot{border-radius:50%}.status-dot.s0{background:#64748b}.status-dot.s1{background:#4299e1}.status-dot.s2{background:#f6ad55}.status-dot.s3{background:#48bb78}.status-dot.s4{background:#a0aec0}.foundation-filter input:checked+span{box-shadow:0 0 0 2px #fff,0 0 0 4px #2f6fed}.foundation-add-filter{margin:14px 4px 0;border:0;background:transparent;color:#2f6fed;font-weight:750;font-size:.78rem;cursor:pointer}
.foundation-center{min-width:0;background:#fff;border-right:1px solid #e6eaf0;overflow:hidden}.foundation-stage{height:calc(100vh - 135px);overflow:auto}.foundation-center .agenda-filters{margin:10px;border:1px solid #dfe6ef;border-radius:10px;padding:10px;background:#f8fafc;grid-template-columns:1fr 220px auto}.foundation-center .agenda-filters.collapsed{display:none}
.foundation-calendar{min-width:920px}.foundation-week-head{display:grid;grid-template-columns:58px repeat(7,minmax(118px,1fr));height:54px;position:sticky;top:0;z-index:8;background:#fff;border-bottom:1px solid #e7ebf0}.foundation-calendar.one-day .foundation-week-head{grid-template-columns:58px 1fr}.foundation-tz{font-size:.63rem;color:#9aa3b0;padding:31px 5px 0;text-align:center}.foundation-day-head{text-align:center;border-left:1px solid #edf0f4;padding:6px}.foundation-day-head b{text-transform:uppercase;font-size:.67rem;color:#8a95a5}.foundation-day-head span{display:grid;place-items:center;width:28px;height:28px;margin:2px auto 0;font-weight:900}.foundation-day-head.today span{background:#2f6fed;color:#fff;border-radius:50%}.foundation-week-body{display:grid;grid-template-columns:58px repeat(7,minmax(118px,1fr));position:relative}.foundation-calendar.one-day .foundation-week-body{grid-template-columns:58px 1fr}.foundation-time-axis{background:#fbfcfe}.foundation-time-axis span{display:block;border-top:1px solid #edf0f4;padding:5px 6px;text-align:right;font-size:.63rem;color:#8994a3}.foundation-day-column{position:relative;border-left:1px solid #e8edf2;min-height:888px;background:repeating-linear-gradient(to bottom,#fff 0,#fff 73px,#edf0f4 73px,#edf0f4 74px)}.foundation-day-column.drag-over{background-color:#eff6ff;outline:2px dashed #2f6fed;outline-offset:-3px}.foundation-slot{display:block;width:100%;border:0;background:transparent;cursor:crosshair}.foundation-slot:hover{background:rgba(47,111,237,.045)}.foundation-ticket-pos{position:absolute;left:6px;right:6px;z-index:3}.foundation-ticket{height:100%;width:100%;border:1px solid;border-left-width:4px;border-radius:7px;padding:7px 8px;text-align:left;display:flex;flex-direction:column;gap:3px;cursor:grab;overflow:hidden;box-shadow:0 2px 5px rgba(15,23,42,.08)}.foundation-ticket.dragging{opacity:.45}.foundation-ticket-top{display:flex;justify-content:space-between;font-size:.65rem;font-weight:900}.foundation-ticket-top i{font-style:normal;font-size:.9rem}.foundation-ticket>strong{font-size:.78rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.foundation-ticket>small{font-size:.61rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;opacity:.82}.foundation-ticket-footer{margin-top:auto;display:flex;align-items:center;justify-content:space-between;gap:4px}.foundation-ticket-footer em{font-style:normal;font-size:.59rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.foundation-avatar{width:22px;height:22px;border-radius:50%;display:grid;place-items:center;background:#2f6fed;color:#fff;font-size:.55rem;font-weight:900;border:2px solid rgba(255,255,255,.85);flex:0 0 auto}.foundation-avatar.large{width:29px;height:29px;font-size:.62rem}.foundation-ticket.job-regular{background:#dceeff;border-color:#5d9fe5;color:#174d7e}.foundation-ticket.job-deep{background:#eadfff;border-color:#8c68d4;color:#53358a}.foundation-ticket.job-move{background:#fff0ce;border-color:#dca23c;color:#815405}.foundation-ticket.job-commercial{background:#ffe2eb;border-color:#dc7496;color:#87334f}.foundation-ticket.job-airbnb{background:#daf5e6;border-color:#59b97e;color:#24623e}.foundation-ticket.job-special{background:#dff4f3;border-color:#55b0ac;color:#265f5c}.foundation-ticket.has-conflict{box-shadow:inset 4px 0 #d92d20,0 2px 5px rgba(15,23,42,.08)}
.foundation-context{position:static!important;width:auto!important;background:#fff!important;color:#263244!important;padding:0!important;display:block!important;overflow:auto;z-index:auto!important}.foundation-context-head{display:grid;grid-template-columns:44px 1fr 32px 32px;gap:10px;align-items:center;padding:16px;border-bottom:1px solid #edf0f4}.foundation-client-avatar{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;background:#dce9ff;color:#285fac;font-weight:900}.foundation-context-head h3{margin:0;font-size:.98rem}.foundation-context-head span{font-size:.7rem;color:#8a95a5}.foundation-icon-btn{width:30px;height:30px;border:1px solid #dfe5ec;background:#fff;border-radius:7px;cursor:pointer}.foundation-contact-row{display:grid;grid-template-columns:1fr 1fr;gap:5px;padding:12px 16px;border-bottom:1px solid #edf0f4;font-size:.68rem;color:#4f5e70}.foundation-detail-block{padding:13px 16px;border-bottom:1px solid #edf0f4}.foundation-detail-block>label{display:block;text-transform:uppercase;letter-spacing:.06em;color:#929cab;font-size:.63rem;font-weight:900;margin-bottom:7px}.foundation-detail-block p{margin:0;font-size:.75rem;line-height:1.5}.foundation-detail-block small{color:#7b8798}.foundation-service-box{display:grid;grid-template-columns:22px 1fr;gap:7px;align-items:start;background:#f7f9fc;border:1px solid #e8edf3;padding:9px;border-radius:7px}.foundation-service-box>span{width:18px;height:18px;border-radius:50%;display:grid;place-items:center;background:#e2f5e8;color:#25844c;font-size:.65rem}.foundation-service-box b{display:block;font-size:.74rem}.foundation-service-box small{display:block;font-size:.64rem;margin-top:3px}.foundation-price-line{display:flex;justify-content:space-between;margin-top:9px;font-size:.72rem}.foundation-team-list{display:grid;gap:8px}.foundation-team-list>div{display:grid;grid-template-columns:32px 1fr auto;gap:8px;align-items:center}.foundation-team-list p{display:grid}.foundation-team-list em{font-style:normal;background:#edf4ff;color:#2f6fed;padding:3px 6px;border-radius:999px;font-size:.58rem}.foundation-note{background:#fff8e8;border:1px solid #f3e0ae;border-radius:7px;padding:9px!important}.foundation-invoice{margin:14px 16px;padding:12px;border:1px solid #e2e8f0;border-radius:8px;display:flex;justify-content:space-between;align-items:center;background:#f9fbfd}.foundation-invoice div{display:grid}.foundation-invoice span{font-size:.64rem;color:#8a95a5}.foundation-invoice b{font-size:.72rem;color:#2f6fed}.foundation-context-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:0 16px 18px}.foundation-context-empty{display:grid!important;place-content:center;text-align:center;padding:30px!important;color:#7c8797}.foundation-empty-icon{font-size:2rem}
@media(max-width:1350px){.foundation-layout{grid-template-columns:190px minmax(650px,1fr) 280px}.foundation-context{font-size:.95em}}
@media(max-width:1120px){body.agenda-foundation-active main#content{margin-left:72px}.foundation-layout{grid-template-columns:185px minmax(700px,1fr)}.foundation-context{display:none!important}.foundation-commandbar{grid-template-columns:1fr auto}.foundation-tools{display:none}}
@media(max-width:850px){body.agenda-foundation-active main#content{margin-left:0}.foundation-layout{grid-template-columns:1fr}.foundation-left{display:none!important}.foundation-commandbar{grid-template-columns:1fr;height:auto;padding:8px}.foundation-tabs{overflow-x:auto;height:42px}.foundation-nav{grid-row:2}.foundation-titlebar{padding:13px 14px!important}.foundation-titlebar p,.foundation-badge{display:none}.foundation-stage{height:calc(100vh - 170px)}}


/* RC3.0.2 — Ajuste homologação: calendário central utiliza toda a largura sem sobreposição */
body.agenda-foundation-active main#content{margin-left:210px;width:calc(100vw - 210px);max-width:none;overflow:hidden}
body.agenda-foundation-active aside#sidebar{width:210px}
.foundation-shell{width:100%;max-width:none;overflow:hidden}
.foundation-layout{width:100%;grid-template-columns:174px minmax(0,1fr) 270px;min-width:0}
.foundation-left{min-width:0;padding:14px 10px!important}
.foundation-center{min-width:0;width:100%;overflow:hidden}
.foundation-stage{width:100%;overflow:auto}
.foundation-calendar{width:100%;min-width:0;max-width:100%}
.foundation-week-head,.foundation-week-body{grid-template-columns:52px repeat(7,minmax(0,1fr));width:100%;min-width:0}
.foundation-calendar.one-day .foundation-week-head,.foundation-calendar.one-day .foundation-week-body{grid-template-columns:52px minmax(0,1fr)}
.foundation-day-head{min-width:0;overflow:hidden;padding:6px 2px}
.foundation-day-head b{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.foundation-day-column{min-width:0;overflow:hidden}
.foundation-ticket-pos{left:4px;right:4px;min-width:0}
.foundation-ticket{min-width:0;padding:6px;gap:2px}
.foundation-ticket>strong,.foundation-ticket>small,.foundation-ticket-footer em{max-width:100%;overflow:hidden;text-overflow:ellipsis}
.foundation-ticket>strong{font-size:clamp(.63rem,.72vw,.78rem)}
.foundation-ticket>small{font-size:clamp(.53rem,.6vw,.61rem)}
.foundation-ticket-footer em{font-size:clamp(.5rem,.56vw,.59rem)}
.foundation-ticket-top{font-size:clamp(.56rem,.62vw,.65rem)}
.foundation-context{min-width:0}
@media(max-width:1450px){
  body.agenda-foundation-active main#content{margin-left:200px;width:calc(100vw - 200px)}
  body.agenda-foundation-active aside#sidebar{width:200px}
  .foundation-layout{grid-template-columns:160px minmax(0,1fr) 248px}
  .foundation-commandbar{padding:0 14px;gap:8px}
  .foundation-tabs button{padding:0 11px}
  .foundation-titlebar{padding:15px 16px!important}
  .foundation-context-head,.foundation-detail-block{padding-left:12px;padding-right:12px}
}
@media(max-width:1180px){
  .foundation-layout{grid-template-columns:150px minmax(0,1fr)}
  .foundation-context{display:none!important}
  .foundation-calendar{min-width:0}
}
@media(max-width:850px){
  body.agenda-foundation-active main#content{margin-left:0;width:100vw}
  .foundation-layout{grid-template-columns:1fr}
  .foundation-calendar{min-width:760px}
}

/* RC3.0.3 — Agenda expandida: área central integral com painéis laterais preservados */
body.agenda-foundation-active main#content{
  margin-left:210px;
  width:calc(100vw - 210px);
  padding:0;
  max-width:none;
  overflow:hidden;
}
body.agenda-foundation-active aside#sidebar{width:210px}
.foundation-shell{width:100%;max-width:none;overflow:hidden}
.foundation-layout{
  display:grid;
  grid-template-columns:164px minmax(0,1fr) 258px;
  width:100%;
  min-width:0;
  gap:0;
}
.foundation-left{min-width:0;padding:14px 10px!important}
.foundation-center{
  min-width:0;
  width:100%;
  padding:8px;
  border-left:1px solid #e6eaf0;
  border-right:1px solid #e6eaf0;
  overflow:hidden;
}
.foundation-stage{
  width:100%;
  height:calc(100vh - 151px);
  min-width:0;
  overflow:auto;
  border-radius:8px;
}
.foundation-context{
  display:block!important;
  min-width:0;
  width:100%;
  overflow:auto;
}
.foundation-calendar,
.smart-month-weekdays,
.smart-month-grid,
.calendar-weekdays,
.calendar-grid{
  width:100%;
  max-width:100%;
  min-width:0!important;
}
.foundation-week-head,
.foundation-week-body{
  grid-template-columns:52px repeat(7,minmax(0,1fr));
  width:100%;
  min-width:0;
}
.foundation-calendar.one-day .foundation-week-head,
.foundation-calendar.one-day .foundation-week-body{
  grid-template-columns:52px minmax(0,1fr);
}
.smart-month-weekdays,
.smart-month-grid,
.calendar-weekdays,
.calendar-grid{
  grid-template-columns:repeat(7,minmax(0,1fr));
}
.smart-month-weekdays span,
.smart-month-cell,
.calendar-cell{
  min-width:0;
  overflow:hidden;
}
.smart-month-cell{padding:5px}
.smart-month-date{min-width:0}
.month-ticket-wrap,.calendar-jobs{min-width:0;overflow:hidden}
.month-ticket-wrap .smart-ticket,.calendar-job{max-width:100%;min-width:0}
.foundation-day-head,.foundation-day-column{min-width:0;overflow:hidden}
.foundation-ticket-pos{left:4px;right:4px;min-width:0}
.foundation-ticket{min-width:0;max-width:100%}
.foundation-ticket>strong,
.foundation-ticket>small,
.foundation-ticket-footer em{
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
}
@media(max-width:1365px){
  .foundation-layout{grid-template-columns:150px minmax(0,1fr) 240px}
  .foundation-titlebar{padding:14px 16px!important}
  .foundation-commandbar{padding:0 12px;gap:8px}
  .foundation-tabs button{padding:0 10px}
  .foundation-context-head,.foundation-detail-block{padding-left:11px;padding-right:11px}
}
@media(max-width:1020px){
  .foundation-layout{grid-template-columns:142px minmax(0,1fr) 222px}
  .foundation-context{display:block!important}
  .foundation-contact-row{grid-template-columns:1fr}
}
@media(max-width:900px){
  body.agenda-foundation-active main#content{margin-left:0;width:100vw}
  .foundation-layout{grid-template-columns:1fr}
  .foundation-left,.foundation-context{display:none!important}
  .foundation-calendar{min-width:760px!important}
}

/* RC3.0.4 — Correção estrutural definitiva da grade da Agenda
   Objetivo: manter painel esquerdo + calendário integral + painel direito,
   sem rolagem horizontal, corte, sobreposição ou deslocamento residual. */
body.agenda-foundation-active main#content{
  margin-left:210px;
  width:calc(100vw - 210px);
  min-width:0;
  overflow:hidden;
}
.foundation-shell,
.foundation-layout,
.foundation-center,
.foundation-stage{
  min-width:0;
  max-width:100%;
}
.foundation-layout{
  grid-template-columns:164px minmax(0,1fr) 258px;
  width:100%;
  gap:0;
  overflow:hidden;
}
.foundation-left,
.foundation-context{
  min-width:0;
  overflow-y:auto;
  overflow-x:hidden;
}
.foundation-center{
  width:100%;
  padding:8px;
  overflow:hidden;
}
.foundation-stage{
  width:100%;
  height:calc(100vh - 151px);
  overflow-y:auto;
  overflow-x:hidden;
  overscroll-behavior:contain;
}
.foundation-calendar,
.foundation-week-head,
.foundation-week-body,
.smart-month-weekdays,
.smart-month-grid{
  width:100%;
  min-width:0!important;
  max-width:100%;
}
.foundation-week-head,
.foundation-week-body{
  grid-template-columns:52px repeat(7,minmax(0,1fr));
}
.smart-month-weekdays,
.smart-month-grid{
  grid-template-columns:repeat(7,minmax(0,1fr));
}
.foundation-day-head,
.foundation-day-column,
.smart-month-weekdays>*,
.smart-month-cell,
.month-ticket-wrap,
.month-ticket-wrap .smart-ticket{
  min-width:0;
  max-width:100%;
}
.smart-month-cell,
.foundation-day-column{
  overflow:hidden;
}
.foundation-ticket-pos{left:4px;right:4px;min-width:0;max-width:calc(100% - 8px)}
.foundation-ticket,
.smart-ticket{min-width:0;max-width:100%;overflow:hidden}
@media(max-width:1365px){
  .foundation-layout{grid-template-columns:150px minmax(0,1fr) 240px}
}
@media(max-width:1020px){
  .foundation-layout{grid-template-columns:142px minmax(0,1fr) 222px}
  .foundation-context{display:block!important}
}
@media(max-width:900px){
  body.agenda-foundation-active main#content{margin-left:0;width:100vw}
  .foundation-layout{grid-template-columns:1fr}
  .foundation-left,.foundation-context{display:none!important}
  .foundation-stage{overflow-x:auto}
  .foundation-calendar{min-width:760px!important}
}
/* Neutraliza a regra global aplicada a qualquer elemento <main>.
   .foundation-center também é um <main>; sem este reset recebia margin-left:260px,
   deslocando a grade sobre o painel do cliente. */
.foundation-layout > main.foundation-center{
  margin:0!important;
  max-width:none!important;
}

/* RC3.0.5 — Agenda: consistência, ações e segurança */
body.agenda-foundation-active.menu-collapsed main#content{margin-left:72px!important;width:calc(100vw - 72px)!important}
body.agenda-foundation-active.menu-collapsed aside#sidebar{width:72px!important}
.foundation-more-menu{position:relative}
.foundation-more-menu>summary{list-style:none;display:grid;place-items:center}
.foundation-more-menu>summary::-webkit-details-marker{display:none}
.foundation-more-pop{position:absolute;right:0;top:36px;z-index:80;display:grid;min-width:180px;padding:7px;background:#fff;border:1px solid #dfe5ec;border-radius:9px;box-shadow:0 12px 30px #0f172a26}
.foundation-more-menu:not([open]) .foundation-more-pop{display:none}
.foundation-more-pop button{border:0;background:#fff;text-align:left;padding:9px 10px;border-radius:6px;cursor:pointer;color:#263244}
.foundation-more-pop button:hover{background:#f1f5f9}
.foundation-more-pop .danger-text{color:#b42318}
#agendaFilters.search-only label:not(:first-child),#agendaFilters.search-only .agenda-filter-actions{display:none}
#agendaFilters.search-only{grid-template-columns:minmax(240px,560px);justify-content:end}
.foundation-slot{background-image:linear-gradient(to bottom,transparent calc(50% - .5px),#edf1f5 calc(50% - .5px),#edf1f5 calc(50% + .5px),transparent calc(50% + .5px))}
.foundation-ticket{cursor:pointer}
.foundation-ticket:focus-visible{outline:3px solid #2563eb;outline-offset:2px}
.modal-card{overscroll-behavior:contain}


/* RC3.0.6 — correções operacionais auditadas da Agenda */
body.agenda-foundation-active aside#sidebar .collapse-handle{
  display:grid!important;
  place-items:center;
  position:absolute;
  right:-16px;
  top:88px;
  width:32px;
  height:42px;
  z-index:1200;
  border:1px solid #d7e0eb;
  border-left:0;
  border-radius:0 10px 10px 0;
  background:#fff;
  color:#18324f;
  box-shadow:2px 3px 10px rgba(15,23,42,.14);
  cursor:pointer;
}
body.agenda-foundation-active aside#sidebar.collapsed .collapse-handle{right:-32px}
body.agenda-foundation-active aside#sidebar,
body.agenda-foundation-active main#content,
body.agenda-foundation-active header{transition:width .22s ease,left .22s ease,margin-left .22s ease}

/* Grade horária: linhas cheias a cada hora e tracejadas a cada 30 minutos */
.foundation-day-column{
  background-color:#fff!important;
  background-image:
    repeating-linear-gradient(to bottom,
      transparent 0,
      transparent 36px,
      rgba(148,163,184,.34) 36px,
      rgba(148,163,184,.34) 37px,
      transparent 37px,
      transparent 73px,
      rgba(100,116,139,.45) 73px,
      rgba(100,116,139,.45) 74px)!important;
  background-size:100% 74px!important;
}
.foundation-time-axis span{position:relative;border-top:1px solid rgba(100,116,139,.45)!important}
.foundation-time-axis span::after{content:"";position:absolute;left:0;right:0;top:50%;border-top:1px dashed rgba(148,163,184,.45)}
.foundation-slot{position:relative;background:transparent!important;border:0!important}
.foundation-slot::after{content:"";position:absolute;left:0;right:0;top:50%;border-top:1px dashed rgba(148,163,184,.34);pointer-events:none}
.foundation-week-head{border-bottom:1px solid rgba(100,116,139,.45)!important}

/* RC3.0.7 — Agenda focada em dados operacionais */
.foundation-context-operational .foundation-operational-summary{display:grid;gap:0;border-top:1px solid #e7edf4}
.foundation-context-operational .foundation-operational-summary>div{padding:14px 16px;border-bottom:1px solid #e7edf4}
.foundation-context-operational .foundation-operational-summary label,.foundation-operational-note label{display:block;font-size:10px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:#8190a5;margin-bottom:6px}
.foundation-context-operational .foundation-operational-summary p{margin:0;color:#26364c;line-height:1.45}
.foundation-context-operational .foundation-operational-summary .tag{display:inline-flex}
.foundation-context-operational .foundation-operational-note{margin:0;padding:14px 16px}
.foundation-context-operational .operational-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:14px 16px}
.foundation-context-operational .operational-actions .btn:last-child{grid-column:1/-1}
.foundation-ticket>small{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.foundation-ticket-footer em{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.foundation-conflict-mark{display:inline-grid;place-items:center;width:19px;height:19px;border-radius:50%;background:#dc2626;color:#fff;font-style:normal;font-weight:900;flex:0 0 auto}


/* RC3.0.8 — Agenda usa exatamente o controle lateral global */
body.agenda-foundation-active aside#sidebar .collapse-handle,
body.agenda-foundation-active aside#sidebar.collapsed .collapse-handle{
  display:block!important;
  position:absolute!important;
  right:-14px!important;
  top:46%!important;
  width:30px!important;
  height:58px!important;
  border:0!important;
  border-radius:0 10px 10px 0!important;
  background:#287ca9!important;
  color:#fff!important;
  font-weight:900!important;
  box-shadow:0 2px 8px #0003!important;
}
.agenda-worker-fieldset{border:1px solid var(--line);border-radius:10px;padding:12px;margin:0;min-width:0}
.agenda-worker-fieldset legend{font-weight:800;padding:0 5px}
.agenda-worker-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.agenda-worker-option{display:flex;align-items:center;gap:9px;border:1px solid var(--line);border-radius:9px;padding:9px;background:#fff;cursor:pointer}
.agenda-worker-option input{width:18px;height:18px}
.agenda-worker-option span{display:flex;flex-direction:column;min-width:0}
.agenda-worker-option small{color:var(--muted)}
@media(max-width:650px){.agenda-worker-options{grid-template-columns:1fr}}

/* RC3.0.9 — consistência global da Agenda */
body.agenda-foundation-active.menu-collapsed aside#sidebar{width:0!important;overflow:visible!important}
body.agenda-foundation-active.menu-collapsed main#content{margin-left:0!important;width:100vw!important}
body.agenda-foundation-active.menu-collapsed header{left:0!important}
body.agenda-foundation-active aside#sidebar.collapsed .brand,
body.agenda-foundation-active aside#sidebar.collapsed nav,
body.agenda-foundation-active aside#sidebar.collapsed .aside-foot{display:none!important}
body.agenda-foundation-active aside#sidebar.collapsed .collapse-handle{right:-30px!important}
.foundation-filter-btn{min-width:92px!important;padding:8px 12px!important;border:1px solid #dbe3ec!important;border-radius:8px!important;background:#fff!important;color:#26364c!important;font-weight:800!important;cursor:pointer!important}
.foundation-center .agenda-filters{grid-template-columns:repeat(5,minmax(150px,1fr)) auto!important;align-items:end}
.foundation-filter-summary{display:grid;gap:5px;padding:12px 15px;color:#536176}.foundation-filter-summary small{color:#8491a3}
.foundation-new-btn{position:relative;z-index:5;pointer-events:auto;display:inline-flex;align-items:center;justify-content:center;min-height:42px}
.foundation-new-btn::before{content:"";position:absolute;inset:0}
button:disabled{opacity:.45;cursor:not-allowed;filter:grayscale(.25)}
.modal-feedback{margin:0 0 12px;padding:10px 12px;border-radius:9px;background:#eef4ff;color:#174ea6;border:1px solid #c9dcff}.modal-feedback.success{background:#e8f6ee;color:#146c47;border-color:#b9e3ca}.modal-feedback.error{background:#fdebea;color:#9c1d15;border-color:#f4c1bd}
.invoice-flow{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin:12px 0 16px}.invoice-flow span{padding:8px;text-align:center;border-radius:999px;background:#edf1f5;color:#657184;font-size:.82rem;font-weight:800}.invoice-flow span.active{background:#fff2d8;color:#865400}.invoice-flow span.done{background:#e5f5ed;color:#146c47}
#toast{left:50%!important;right:auto!important;top:auto!important;bottom:24px!important;transform:translate(-50%,12px)!important;text-align:center!important}#toast.show{transform:translate(-50%,0)!important}
@media(max-width:1100px){.foundation-center .agenda-filters{grid-template-columns:repeat(2,minmax(160px,1fr))!important}.agenda-filter-actions{grid-column:1/-1}}
/* RC3.1.0 — Invoice profissional */
.professional-invoice{display:grid;gap:18px}.invoice-head,.invoice-parties{display:flex;justify-content:space-between;gap:24px}.invoice-head p,.invoice-parties p,.invoice-payment p{margin:3px 0;color:#52606d}.invoice-meta{display:flex;flex-direction:column;gap:5px;text-align:right}.invoice-meta>b{font-size:1.1rem}.invoice-parties{padding:14px;background:#f8fafc;border-radius:12px}.invoice-parties>div{flex:1}.professional-invoice td small{display:block;color:#667085;margin-top:4px}.professional-invoice tfoot th{font-weight:600}.professional-invoice .invoice-total th{font-size:1.08rem;border-top:2px solid #cfd8e3}.invoice-payment{padding:14px;border:1px solid #e1e7ef;border-radius:12px}.professional-invoice footer{text-align:center;padding-top:8px;color:#52606d}@media(max-width:720px){.invoice-head,.invoice-parties{flex-direction:column}.invoice-meta{text-align:left}}


/* RC3.1.1 */
.invoice-logo-uploader{display:flex;align-items:center;gap:16px;margin-top:8px;padding:14px;border:1px solid var(--line);border-radius:12px;background:#f8fafc}.invoice-logo-preview{width:150px;height:90px;display:grid;place-items:center;border:1px dashed #b8c4ce;border-radius:10px;background:#fff;color:var(--muted);overflow:hidden}.invoice-logo-preview img{max-width:100%;max-height:100%;object-fit:contain}.invoice-logo-button{display:inline-flex;margin:0 8px 6px 0}.invoice-logo-button input{display:none}.invoice-logo-uploader small{display:block;color:var(--muted);margin-top:4px}.invoice-modal-card{width:min(980px,96vw)!important;padding:24px!important}.invoice-modal-title{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin:0 34px 14px 0}.invoice-modal-title h2{margin:0}.invoice-modal-title p{margin:4px 0 0;color:var(--muted)}.invoice-status-badge{padding:6px 10px;border-radius:999px;background:#eef4ff;color:#175cd3;font-weight:800}.invoice-document{max-width:860px;margin:0 auto;border:1px solid #dce4eb;border-radius:16px;background:#fff;overflow:hidden;box-shadow:0 12px 30px #12324a12}.invoice-document-head{position:static;height:auto;background:#fff;border:0;padding:24px 28px;display:flex;justify-content:space-between;align-items:flex-start;gap:24px}.invoice-brand-block{display:flex;gap:16px;align-items:flex-start}.invoice-brand-block div{display:block}.invoice-brand-block h3{font-size:1.25rem;margin:0 0 7px}.invoice-brand-block p{margin:3px 0;color:#52606d}.invoice-document-logo{width:96px;height:64px;object-fit:contain}.invoice-document-meta{display:flex;flex-direction:column;align-items:flex-end;gap:4px;text-align:right}.invoice-document-meta>strong{font-size:1.65rem;letter-spacing:.08em;color:var(--navy)}.invoice-document-meta>b{font-size:1rem}.invoice-document-meta span{font-size:.84rem;color:#52606d}.invoice-bill-grid{display:grid;grid-template-columns:1fr 1fr;gap:24px;padding:18px 28px;background:#f7f9fb;border-top:1px solid #edf1f4;border-bottom:1px solid #edf1f4}.invoice-bill-grid div{display:flex;flex-direction:column;gap:4px}.invoice-bill-grid small,.invoice-payment-info small{font-size:.72rem;font-weight:900;letter-spacing:.06em;color:#667784}.invoice-service-table{padding:22px 28px}.invoice-service-head,.invoice-service-row{display:grid;grid-template-columns:1fr 150px;gap:20px}.invoice-service-head{padding:0 0 9px;border-bottom:1px solid #dfe6ec;font-size:.76rem;font-weight:900;text-transform:uppercase;color:#667784}.invoice-service-head span:last-child{text-align:right}.invoice-service-row{padding:15px 0;border-bottom:1px solid #edf1f4}.invoice-service-row>div{display:flex;flex-direction:column;gap:5px}.invoice-service-row span{color:#667784}.invoice-service-row>strong{text-align:right;font-size:1.05rem}.invoice-summary{width:min(380px,100%);margin-left:auto;padding:0 28px 22px}.invoice-summary>div{display:flex;justify-content:space-between;padding:8px 0}.invoice-grand-total{border-top:2px solid var(--navy);margin-top:5px;padding-top:13px!important;font-size:1.25rem;color:var(--navy)}.invoice-payment-info{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin:0 28px 22px;padding:16px;border:1px solid #dfe6ec;border-radius:12px}.invoice-payment-info p{margin:5px 0 0}.invoice-document footer{text-align:center;padding:16px 28px;background:#f7f9fb;color:#52606d}.invoice-actions{justify-content:center;flex-wrap:wrap;margin-top:16px}.cancelled-ticket{filter:grayscale(1);opacity:.62;background:#e5e7eb!important;border-color:#aeb6bf!important}.cancelled-ticket strong{text-decoration:line-through}.cancelled-job{opacity:.82}.cancelled-job .foundation-operational-summary{filter:grayscale(.8)}@media(max-width:720px){.invoice-logo-uploader,.invoice-document-head{flex-direction:column}.invoice-document-meta{align-items:flex-start;text-align:left}.invoice-bill-grid,.invoice-payment-info{grid-template-columns:1fr}.invoice-service-head,.invoice-service-row{grid-template-columns:1fr 100px}.invoice-modal-card{padding:16px!important}}

/* RC3.1.2 — Agenda: filtros, legenda, cancelamento e eventos simples */
.foundation-commandbar{overflow:visible}
.foundation-tools{display:flex;align-items:center;justify-content:flex-end;min-width:108px;padding-right:12px}
.foundation-filter-btn{position:relative;inset:auto;max-width:100%}
.foundation-center .agenda-filters{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(170px,1fr))!important;gap:12px!important;align-items:end!important;max-width:100%!important;overflow:hidden!important;padding:14px!important;border:1px solid #dfe6ee!important;border-radius:12px!important;margin:12px!important;background:#f8fafc!important}
.foundation-center .agenda-filters.collapsed{display:none!important}
.foundation-center .agenda-filter-actions{display:flex;gap:8px;align-items:center;justify-content:flex-end;min-width:0}
.foundation-center .agenda-filter-actions .btn{white-space:nowrap}
.foundation-center .agenda-filter-actions .btn:disabled{opacity:.45;cursor:not-allowed}
.foundation-left{overflow-y:auto}
.foundation-service-legend{display:grid;gap:8px;padding:14px 15px;border-top:1px solid #e5eaf0;color:#536176}
.foundation-service-legend>b{color:#344054;margin-bottom:2px}
.foundation-service-legend span{display:flex;align-items:center;gap:8px;font-size:12px}
.foundation-service-legend i{display:inline-block;width:12px;height:12px;border-radius:3px;border:1px solid rgba(15,23,42,.16)}
.foundation-service-legend i.job-regular{background:#dff0ff}.foundation-service-legend i.job-deep{background:#efe4ff}.foundation-service-legend i.job-move{background:#fff0d7}.foundation-service-legend i.job-commercial{background:#def7e7}.foundation-service-legend i.job-airbnb{background:#ffe1eb}.foundation-service-legend i.job-special{background:#e1f5f2}
.agenda-event-dot{background:#64748b!important;border-radius:50%!important}.cancelled-dot{background:#d1d5db!important}
.agenda-only-event{border-style:dashed!important}.agenda-only-event.event-slate{background:#eef2f6!important;border-color:#64748b!important}.agenda-only-event.event-blue{background:#e1effe!important;border-color:#3b82f6!important}.agenda-only-event.event-green{background:#e4f7ec!important;border-color:#22a06b!important}.agenda-only-event.event-yellow{background:#fff5d6!important;border-color:#d79b00!important}.agenda-only-event.event-purple{background:#f0e7ff!important;border-color:#8b5cf6!important}
.agenda-event-pos{z-index:7}.cancelled-card-status{display:inline-flex;padding:2px 6px;border-radius:999px;background:#6b7280;color:#fff;font-size:10px;font-style:normal;font-weight:800;text-decoration:none!important}
.cancelled-ticket{filter:grayscale(1);opacity:.72;background:#e5e7eb!important;border-color:#9ca3af!important}.cancelled-ticket strong{text-decoration:line-through}.cancelled-ticket .foundation-ticket-footer{align-items:center;gap:5px}
@media(max-width:1180px){.foundation-center .agenda-filters{grid-template-columns:repeat(2,minmax(160px,1fr))!important}.foundation-center .agenda-filter-actions{grid-column:1/-1;justify-content:flex-start}}
@media(max-width:720px){.foundation-center .agenda-filters{grid-template-columns:1fr!important}.foundation-center .agenda-filter-actions{grid-column:auto;flex-wrap:wrap}}


/* RC3.1.3 — UX de arraste e rolagem */
.job-table{overflow-x:auto;cursor:grab;scrollbar-gutter:stable}
.job-table.grab-scrolling{cursor:grabbing;user-select:none}
.job-table table{min-width:1180px}
body.agenda-dragging{user-select:none;overflow:hidden}
body.agenda-dragging .foundation-ticket:not(.dragging),body.agenda-dragging .smart-ticket:not(.dragging){pointer-events:none}
.foundation-ticket.dragging,.smart-ticket.dragging{opacity:.62;box-shadow:0 14px 30px rgba(15,23,42,.24);transform:scale(.98);border-style:solid!important}
.foundation-day-column.drag-over,.smart-day-column.drag-over,.smart-month-cell.drag-over{background:rgba(59,130,246,.10)!important;box-shadow:inset 0 0 0 2px rgba(59,130,246,.45)}
.money-input input:disabled{background:#eef1f4!important;color:#8a94a3!important;border-color:#d6dce3!important;cursor:not-allowed}


/* RC3.1.3 — Correções finais da sprint atual */
.foundation-filter-btn.filter-content-fixed{display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:6px!important;line-height:1!important;padding-top:8px!important;padding-bottom:8px!important}
.foundation-filter-btn.filter-content-fixed .filter-chevron,.foundation-filter-btn.filter-content-fixed span{display:inline-flex;align-items:center;line-height:1}
.foundation-filter-btn.filter-content-fixed .filter-chevron{font-size:14px;transform:translateY(-1px)}
.foundation-day-column.drag-over,.smart-day-column.drag-over,.smart-month-cell.drag-over{background:#dbeafe!important;box-shadow:inset 0 0 0 2px #3b82f6!important;outline:none!important}
.foundation-calendar,.smart-calendar,.foundation-center,.smart-center,.foundation-stage,.smart-stage,.table-wrap{scroll-behavior:auto}
.foundation-center,.smart-center,.foundation-stage,.smart-stage,.table-wrap{cursor:grab}
.foundation-center.grab-scrolling,.smart-center.grab-scrolling,.foundation-stage.grab-scrolling,.smart-stage.grab-scrolling,.table-wrap.grab-scrolling{cursor:grabbing!important;user-select:none}
.cancel-scope-options{display:grid;gap:12px;margin:18px 0}.cancel-scope-options .btn{justify-content:center;min-height:44px}
.invoice-brand-block>div:empty{display:none}.invoice-brand-block:has(.invoice-document-logo) h3:empty{display:none}


/* RC3.1.3 — Correções finais do último sprint */
.foundation-day-column.drag-over,.smart-day-column.drag-over,.smart-month-cell.drag-over{background:inherit!important;box-shadow:none!important;outline:none!important}
.foundation-ticket.dragging,.smart-ticket.dragging{opacity:0!important;outline:none!important;box-shadow:none!important}
.foundation-ticket:focus.dragging,.smart-ticket:focus.dragging{outline:none!important}
.table-wrap{overflow:auto}
.table-wrap.grab-scrolling,.finance-table.grab-scrolling,.foundation-center.grab-scrolling,.smart-center.grab-scrolling,.foundation-stage.grab-scrolling,.smart-stage.grab-scrolling{cursor:grabbing!important;user-select:none!important}
.cancelled-ticket{filter:grayscale(1)!important;opacity:.72!important;background:#e5e7eb!important;border-color:#9ca3af!important;color:#4b5563!important}
.cancelled-card-status{display:inline-flex!important;padding:2px 6px;border-radius:999px;background:#6b7280;color:#fff;font-size:10px;font-style:normal;font-weight:800;text-decoration:none!important}

/* RC3.1.3 — Ajustes de homologação (rodada atual) */
.foundation-ticket.dragging,.smart-ticket.dragging,
.foundation-ticket.drag-source-visible,.smart-ticket.drag-source-visible{opacity:.82!important;visibility:visible!important;filter:none!important;box-shadow:0 8px 20px rgba(15,23,42,.18)!important;transform:none!important}
.agenda-drag-preview{position:fixed!important;left:-10000px!important;top:-10000px!important;width:150px!important;min-height:70px!important;opacity:1!important;visibility:visible!important;pointer-events:none!important;z-index:99999!important;box-shadow:0 16px 34px rgba(15,23,42,.3)!important;transform:none!important}
.foundation-day-column.drag-over,.smart-day-column.drag-over,.smart-month-cell.drag-over{background:inherit!important;box-shadow:none!important;outline:none!important;border-color:inherit!important}
#content .table-wrap{overflow:auto!important;cursor:grab!important;max-height:calc(100vh - 260px)}
#content .table-wrap.grab-scrolling{cursor:grabbing!important;user-select:none!important}
#content .table-wrap table{min-width:max-content}
#content .finance-table table{min-width:1450px}
#content .job-table table{min-width:1180px}
.agenda-simple-badge{display:inline-flex;align-items:center;padding:2px 6px;border-radius:999px;background:#64748b;color:#fff;font-size:9px;font-weight:800;line-height:1.2}
.agenda-only-event{border-style:solid!important}.agenda-only-event strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.agenda-only-event small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.quick-create-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
@media(max-width:800px){.quick-create-grid{grid-template-columns:1fr!important}#content .table-wrap{max-height:calc(100vh - 220px)}}

/* RC3.1.3 — Agendamento simples operacional e drag sem deformação */
.agenda-drag-preview-exact{position:fixed!important;left:-10000px!important;top:-10000px!important;display:block!important;box-sizing:border-box!important;margin:0!important;padding:inherit!important;overflow:hidden!important;opacity:1!important;visibility:visible!important;transform:none!important;pointer-events:none!important;z-index:99999!important;box-shadow:0 14px 30px rgba(15,23,42,.28)!important}
.foundation-ticket.drag-source-visible,.smart-ticket.drag-source-visible,.agenda-only-event.drag-source-visible{opacity:.55!important;transform:none!important;visibility:visible!important}
.agenda-event-context .foundation-context-section{padding:14px 17px;border-top:1px solid #e5eaf0}.agenda-event-context .foundation-context-section small{display:block;font-size:10px;font-weight:900;letter-spacing:.08em;color:#8090a4;margin-bottom:6px}.agenda-event-context .foundation-context-section p{margin:0;color:#263548;line-height:1.45}.event-type-chip{display:inline-flex;align-items:center;padding:5px 9px;border-radius:999px;border:1px solid transparent;font-size:12px;font-weight:800}.event-type-chip.event-slate{background:#eef2f6;border-color:#94a3b8}.event-type-chip.event-blue{background:#e1effe;border-color:#3b82f6}.event-type-chip.event-green{background:#e4f7ec;border-color:#22a06b}.event-type-chip.event-yellow{background:#fff5d6;border-color:#d79b00}.event-type-chip.event-purple{background:#f0e7ff;border-color:#8b5cf6}
.event-color-preview{display:flex;align-items:center;gap:9px;min-height:42px;padding:9px 11px;border:1px solid #dce3ea;border-radius:9px;font-weight:800}.event-color-preview i{width:18px;height:18px;border-radius:5px;border:1px solid rgba(15,23,42,.18)}.event-color-preview.event-slate i{background:#94a3b8}.event-color-preview.event-blue i{background:#3b82f6}.event-color-preview.event-green i{background:#22a06b}.event-color-preview.event-yellow i{background:#eab308}.event-color-preview.event-purple i{background:#8b5cf6}
.event-colors-config{display:grid;grid-template-columns:repeat(3,minmax(180px,1fr));gap:12px}.agenda-only-event{cursor:pointer}.agenda-only-event[draggable="true"]{cursor:grab}.agenda-only-event[draggable="true"]:active{cursor:grabbing}
@media(max-width:850px){.event-colors-config{grid-template-columns:1fr}}


/* RC3.1.3 — UX moderna de Jobs e campo colorido do agendamento */
.job-actions-modern{display:flex;align-items:center;justify-content:flex-end;gap:7px;white-space:nowrap}
.job-actions-modern .job-primary-action{min-width:82px}
.job-overflow .action-summary{display:grid;place-items:center;width:38px;height:36px;padding:0;border:1px solid #d7e0ea;border-radius:9px;background:#fff;font-size:22px;line-height:1;color:#334155}
.job-modern-menu{min-width:190px;padding:6px}
.job-modern-menu button{display:block;width:100%;border:0;background:transparent;text-align:left;padding:10px 11px;border-radius:7px;color:#263548;font-weight:650;cursor:pointer}
.job-modern-menu button:hover{background:#f1f5f9}
.event-type-field{padding:10px;border:1px solid #dce3ea;border-radius:10px;transition:background .16s,border-color .16s}
.event-type-field select{background:rgba(255,255,255,.88)}
.event-type-field.event-slate{background:#f1f5f9;border-color:#94a3b8}.event-type-field.event-blue{background:#eff6ff;border-color:#60a5fa}.event-type-field.event-green{background:#ecfdf5;border-color:#34d399}.event-type-field.event-yellow{background:#fefce8;border-color:#facc15}.event-type-field.event-purple{background:#f5f3ff;border-color:#a78bfa}
body:not(.agenda-dragging) .agenda-drag-preview-exact{display:none!important}

/* RC3.1.3 — Correção funcional final da Agenda */
.agenda-pointer-preview{box-sizing:border-box!important;overflow:hidden!important;opacity:.96!important;transform:none!important;margin:0!important;box-shadow:0 12px 30px rgba(15,23,42,.28)!important}
.agenda-card-drag-source{opacity:.35!important}
.agenda-card-selected{outline:2px solid rgba(37,99,235,.55)!important;outline-offset:2px!important}

/* RC3.1.3 — Sprint Agenda compacta e Receipt */
.compact-week .foundation-week-body{grid-template-columns:58px repeat(7,minmax(118px,1fr))}
.compact-week.one-day .foundation-week-body{grid-template-columns:58px 1fr}
.compact-week .foundation-day-column{min-height:696px;background:repeating-linear-gradient(to bottom,#fff 0,#fff 57px,#edf0f4 57px,#edf0f4 58px)}
.compact-week .foundation-ticket{padding:4px 6px;gap:1px;border-radius:6px}
.compact-week .foundation-ticket>small:nth-of-type(n+2),.compact-week .foundation-ticket-footer{display:none}
.compact-week .foundation-ticket-top{font-size:.58rem}.compact-week .foundation-ticket>strong{font-size:.69rem}
.compact-ticket-pos{z-index:4}
.agenda-unscheduled-row{display:grid;grid-template-columns:58px repeat(7,minmax(118px,1fr));border-bottom:1px solid #dfe5ec;background:#f8fafc;min-height:46px}
.one-day .agenda-unscheduled-row{grid-template-columns:58px 1fr}
.agenda-unscheduled-label{font-size:.62rem;font-weight:800;color:#64748b;padding:8px 4px;text-align:center;border-right:1px solid #e5eaf0}
.agenda-unscheduled-day{min-width:0;border-left:1px solid #e5eaf0;padding:3px;display:flex;flex-direction:column;gap:3px}
.agenda-unscheduled-day .foundation-ticket{height:38px;min-height:38px;padding:3px 5px}
.agenda-unscheduled-day .foundation-ticket>small,.agenda-unscheduled-day .foundation-ticket-footer{display:none}
.agenda-unscheduled-empty{display:block;text-align:center;color:#c0c7d0;padding-top:8px}
.more-jobs-button{border:0;background:transparent;color:#2563eb;cursor:pointer;font:inherit;padding:3px 1px;text-align:left;font-weight:700}
.more-jobs-button:hover{text-decoration:underline}
.agenda-overflow-list{display:grid;gap:7px;max-height:55vh;overflow:auto}
.agenda-overflow-item{display:grid;grid-template-columns:78px 1fr;gap:10px;align-items:center;text-align:left;border:1px solid #e1e7ef;background:#fff;border-radius:9px;padding:10px;cursor:pointer}
.agenda-overflow-item:hover{border-color:#2563eb;background:#f6f9ff}.agenda-overflow-item span{display:flex;flex-direction:column}.agenda-overflow-item small{color:#64748b}
.receipt-document{border-top:5px solid #18864b}.receipt-document .invoice-document-meta>strong{color:#18864b}.receipt-document .invoice-grand-total{background:#edf9f2}

/* RC3.1.3 — Sprint UX Agenda: grade visual simplificada */
/* Mantém a orientação por dia e hora, mas remove o excesso de linhas intermediárias. */
.foundation-day-column,
.compact-week .foundation-day-column{
  background-color:#fff!important;
  background-image:repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 57px,
    rgba(148,163,184,.20) 57px,
    rgba(148,163,184,.20) 58px
  )!important;
  background-size:100% 58px!important;
  border-left:1px solid rgba(148,163,184,.18)!important;
}
.foundation-time-axis{background:#fff!important}
.foundation-time-axis span{
  border-top:1px solid rgba(148,163,184,.20)!important;
  color:#8b98a8!important;
}
.foundation-time-axis span::after,
.foundation-slot::after{
  display:none!important;
  content:none!important;
}
.foundation-slot{
  background:transparent!important;
  border:0!important;
}
.foundation-slot:hover{background:rgba(47,111,237,.025)!important}
.foundation-day-head{border-left:1px solid rgba(148,163,184,.16)!important}
.foundation-week-head{border-bottom:1px solid rgba(148,163,184,.24)!important}
.agenda-unscheduled-row{border-bottom:1px solid rgba(148,163,184,.22)!important}
.agenda-unscheduled-day{border-left:1px solid rgba(148,163,184,.16)!important}

/* RC3.1.3 — Sprint de consolidação final da Agenda */
.foundation-left .mini-grid button.today,
.foundation-left .mini-grid button.is-today,
.mini-grid button.today,
.mini-grid button.is-today{background:transparent!important;color:inherit!important;box-shadow:inset 0 0 0 1px #94a3b8!important;border-radius:50%!important}
.foundation-left .mini-grid button.selected,
.mini-grid button.selected{background:#2f6fed!important;color:#fff!important;box-shadow:none!important;border-radius:50%!important}
.foundation-left .mini-grid button.selected.is-today,
.mini-grid button.selected.is-today{background:#2f6fed!important;color:#fff!important;box-shadow:none!important}

.agenda-view-tabs{display:flex;align-items:center;gap:4px}
.agenda-more-views{position:relative}
.agenda-more-views>summary{list-style:none;cursor:pointer;padding:9px 12px;border-radius:8px;font-weight:750;color:#526071;white-space:nowrap}
.agenda-more-views>summary::-webkit-details-marker{display:none}
.agenda-more-views[open]>summary,.agenda-more-views>summary:hover{background:#eef4ff;color:#245fd1}
.agenda-more-views>div{position:absolute;top:calc(100% + 6px);left:0;z-index:80;min-width:120px;background:#fff;border:1px solid #dfe5ec;border-radius:10px;padding:6px;box-shadow:0 10px 28px rgba(15,23,42,.16)}
.agenda-more-views>div button{display:block;width:100%;border:0;background:transparent;border-radius:7px;padding:8px 10px;text-align:left;cursor:pointer;font-weight:700;color:#344054}
.agenda-more-views>div button:hover,.agenda-more-views>div button.active{background:#eef4ff;color:#245fd1}

.foundation-center,.foundation-stage,.smart-center,.smart-stage,.agenda-stage{cursor:default!important}
.foundation-center.grab-scrolling,.foundation-stage.grab-scrolling,.smart-center.grab-scrolling,.smart-stage.grab-scrolling,.agenda-stage.grab-scrolling{cursor:default!important;user-select:auto!important}

.more-jobs-button{display:block!important;width:100%;max-width:100%;padding:2px 3px!important;font-size:10px!important;line-height:1.2!important;font-weight:700!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;text-align:left!important;border-radius:5px!important}
.more-jobs-button:hover{background:#eef4ff!important;text-decoration:none!important}
.agenda-overflow-modal{width:min(430px,calc(100vw - 28px))!important;max-height:min(620px,calc(100vh - 40px))!important}
.overflow-dialog-head h2{margin:0}.overflow-dialog-head p{margin:3px 0 14px;color:#667085}
.agenda-overflow-list{display:grid;gap:7px;max-height:420px;overflow:auto}
.agenda-overflow-item{width:100%;display:grid;grid-template-columns:82px 1fr;gap:10px;align-items:center;border:1px solid #e3e8ef;background:#fff;border-radius:9px;padding:9px 10px;text-align:left;cursor:pointer}
.agenda-overflow-item:hover{border-color:#8ab4f8;background:#f6f9ff}
.agenda-overflow-item span{display:grid;gap:2px;min-width:0}.agenda-overflow-item strong,.agenda-overflow-item small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.compact-move-overlay{position:fixed;inset:0;z-index:100000;display:grid;place-items:center;background:rgba(15,23,42,.22);padding:16px}
.compact-move-card{position:relative;width:min(380px,calc(100vw - 32px));background:#fff;border-radius:13px;padding:18px;box-shadow:0 18px 50px rgba(15,23,42,.24)}
.compact-move-card h3{margin:0 30px 6px 0;font-size:1.05rem}.compact-move-card>b{display:block;color:#475467;margin-bottom:10px}
.compact-move-card p{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:7px;margin:0 0 12px;padding:10px;background:#f7f9fc;border-radius:9px;font-size:.8rem}
.compact-move-card p span:last-child{text-align:right}.compact-move-card p strong{color:#2f6fed}
.compact-move-card label{display:grid;gap:5px;font-size:.75rem;font-weight:700;color:#475467}.compact-move-card select{height:36px;border:1px solid #d0d5dd;border-radius:8px;padding:0 9px;background:#fff}
.compact-move-close{position:absolute;right:11px;top:9px;border:0;background:transparent;font-size:1.35rem;color:#667085;cursor:pointer}
.compact-move-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:14px}

/* RC3.1.3 — correção final de snap e overflow */
.agenda-overflow-draggable{cursor:grab!important;touch-action:none}
.agenda-overflow-draggable:active{cursor:grabbing!important}
.agenda-overflow-drag-ghost{position:fixed!important;z-index:100000!important;width:260px!important;pointer-events:none!important;opacity:.94!important;box-shadow:0 16px 36px rgba(15,23,42,.28)!important}
.agenda-drop-target{outline:2px solid #2563eb!important;outline-offset:-2px!important;background:rgba(37,99,235,.055)!important}

/* RC3.1.3 — preview unificado para cards ocultos da Agenda */
.agenda-overflow-drag-ghost.agenda-unified-drag-preview{
  position:fixed!important;
  z-index:100000!important;
  width:140px!important;
  min-height:54px!important;
  display:flex!important;
  flex-direction:column!important;
  gap:2px!important;
  padding:7px 8px!important;
  border:1px solid #5d9fe5!important;
  border-left:4px solid #5d9fe5!important;
  border-radius:7px!important;
  background:#dceeff!important;
  color:#174d7e!important;
  pointer-events:none!important;
  opacity:.96!important;
  box-shadow:0 12px 28px rgba(15,23,42,.24)!important;
  overflow:hidden!important;
}
.agenda-overflow-drag-ghost.agenda-unified-drag-preview strong,
.agenda-overflow-drag-ghost.agenda-unified-drag-preview small{
  display:block!important;
  max-width:100%!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.agenda-overflow-drag-ghost.agenda-unified-drag-preview strong{font-size:.78rem!important}
.agenda-overflow-drag-ghost.agenda-unified-drag-preview small{font-size:.61rem!important;opacity:.82!important}
.agenda-unified-drag-time{font-size:.65rem!important;font-weight:900!important}
/* O destino fica discreto; não pinta nem contorna toda a célula como no comportamento antigo. */
.agenda-drop-target{
  outline:none!important;
  background:rgba(37,99,235,.025)!important;
  box-shadow:inset 0 0 0 1px rgba(37,99,235,.18)!important;
}


/* RC3.1.3 — correção visual final do overflow da Agenda */
/* O modal abre limpo, sem seleção azul herdada do clique/arraste anterior. */
.agenda-overflow-modal,
.agenda-overflow-modal *{
  user-select:none!important;
  -webkit-user-select:none!important;
}
.agenda-overflow-modal .agenda-overflow-item:focus-visible{
  outline:2px solid rgba(37,99,235,.45)!important;
  outline-offset:2px!important;
}
/* Preview com a mesma escala compacta dos cards do grid mensal. */
.agenda-overflow-drag-ghost.agenda-unified-drag-preview{
  width:92px!important;
  height:54px!important;
  min-height:54px!important;
  padding:5px 6px!important;
  gap:1px!important;
  border-radius:7px!important;
  box-shadow:0 8px 18px rgba(15,23,42,.18)!important;
}
.agenda-overflow-drag-ghost.agenda-unified-drag-preview strong{
  font-size:.72rem!important;
  line-height:1.1!important;
}
.agenda-overflow-drag-ghost.agenda-unified-drag-preview small,
.agenda-unified-drag-time{
  font-size:.58rem!important;
  line-height:1.05!important;
}


/* RC3.2.0 — Central de Faturamento */
.billing-kpis{grid-template-columns:repeat(4,minmax(150px,1fr))}
.billing-filter-card{padding:14px 16px}
.billing-filters{display:grid;grid-template-columns:minmax(220px,2fr) minmax(150px,1fr) minmax(140px,1fr) minmax(140px,1fr) auto;gap:12px;align-items:end}
.billing-filter-actions,.billing-actions{display:flex;gap:8px;align-items:center}
.billing-table td small{display:block;color:#667085;margin-top:3px}
.billing-table td{vertical-align:middle}
.billing-status{display:inline-flex;align-items:center;min-height:25px;padding:3px 9px;border-radius:999px;font-size:.72rem;font-weight:800;white-space:nowrap;background:#eef2f6;color:#344054}
.billing-a-faturar{background:#fff4e5;color:#9a4b00}.billing-gerada{background:#eef4ff;color:#3538cd}.billing-enviada{background:#e8f7ff;color:#026aa2}.billing-vencida{background:#feeceb;color:#b42318}.billing-paga,.billing-recibo-enviado{background:#e9f8ef;color:#067647}.billing-cancelada{background:#f2f4f7;color:#667085}
@media(max-width:1050px){.billing-filters{grid-template-columns:1fr 1fr}.billing-filter-actions{grid-column:1/-1}.billing-kpis{grid-template-columns:repeat(2,minmax(140px,1fr))}}
@media(max-width:680px){.billing-filters,.billing-kpis{grid-template-columns:1fr}.billing-actions{flex-direction:column;align-items:stretch}}

/* RC3.2.0 UX — cabeçalho sólido, filtros compactos e Invoice comercial */
#content .billing-table{position:relative;isolation:isolate;background:#fff}
#content .billing-table thead{position:sticky;top:0;z-index:30}
#content .billing-table thead th{position:sticky;top:0;z-index:31;background:#f8fafc!important;box-shadow:0 1px 0 #d9e1e8,0 4px 8px rgba(15,23,42,.05);background-clip:padding-box}
#content .billing-table tbody{position:relative;z-index:1}

.billing-filter-card{padding:10px 12px!important;border-radius:12px}
.billing-filters{grid-template-columns:minmax(250px,2.2fr) minmax(135px,.8fr) minmax(135px,.8fr) minmax(135px,.8fr) auto!important;gap:8px!important;align-items:end}
.billing-filters .field{gap:3px;margin:0;font-size:.72rem;color:#667085}
.billing-filters .field>span{font-weight:800;line-height:1}
.billing-filters input,.billing-filters select{height:38px!important;min-height:38px!important;padding:7px 11px!important;border-radius:9px!important;background:#fff}
.billing-filter-actions{gap:6px!important}
.billing-filter-actions .btn{height:38px;padding:0 14px;border-radius:9px}
.billing-search-field input{padding-left:34px!important;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23667085' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:11px center}

.invoice-document{border-radius:4px!important;border:1px solid #d6d9de!important;box-shadow:0 16px 38px rgba(15,23,42,.16)!important}
.invoice-accent-bar{height:58px;background:linear-gradient(115deg,#111 0 46%,#f28c18 46% 100%);display:flex;align-items:center;padding:0 28px;position:relative;overflow:hidden}
.invoice-accent-bar:after{content:"";position:absolute;left:46%;top:-20px;width:18px;height:100px;background:#fff;transform:skewX(-24deg);opacity:.95}
.invoice-accent-bar span{color:#fff;font-size:1.35rem;font-weight:950;letter-spacing:.14em;z-index:1}
.invoice-document-head{padding:22px 28px 18px!important}
.invoice-document-meta>strong{color:#111!important}
.invoice-bill-grid{background:#fbfbfc!important;border-top:3px solid #f28c18!important}
.invoice-service-head,.invoice-service-row{grid-template-columns:minmax(260px,1fr) 110px 70px 120px!important;align-items:center}
.invoice-service-head{background:#151515;color:#fff!important;padding:10px 12px!important;border-bottom:3px solid #f28c18!important}
.invoice-service-head span:not(:first-child),.invoice-service-row>span,.invoice-service-row>strong{text-align:right}
.invoice-service-row{padding:14px 12px!important}
.invoice-summary{border-top:1px solid #e5e7eb;padding-top:10px!important}
.invoice-grand-total{border-top:3px solid #f28c18!important;color:#111!important}
.invoice-terms{display:grid;grid-template-columns:1.4fr 1fr;gap:24px;margin:0 28px 22px;padding-top:16px;border-top:1px solid #dfe3e8}
.invoice-terms small{font-size:.7rem;font-weight:900;letter-spacing:.08em;color:#111}
.invoice-terms p{margin:6px 0 0;font-size:.8rem;line-height:1.45;color:#59636e}
.invoice-document footer{border-bottom:8px solid #111;background:#fff!important;color:#344054!important}
@media(max-width:1050px){.billing-filters{grid-template-columns:1fr 1fr!important}.billing-filter-actions{grid-column:1/-1}.invoice-service-head,.invoice-service-row{grid-template-columns:minmax(180px,1fr) 90px 55px 100px!important}}
@media(max-width:680px){.billing-filters{grid-template-columns:1fr!important}.invoice-service-head,.invoice-service-row{grid-template-columns:1fr 90px!important}.invoice-service-head span:nth-child(2),.invoice-service-head span:nth-child(3),.invoice-service-row>span{display:none}.invoice-terms{grid-template-columns:1fr}}

/* RC3.2.0 — UX global compacto e correção definitiva de tabelas */
:root{
  --sidebar-width:214px;
  --sidebar-collapsed:66px;
  --app-header-height:58px;
}
header{
  left:var(--sidebar-width);
  height:var(--app-header-height);
  padding:0 16px;
  gap:10px;
  z-index:80;
}
header .app-page-heading{min-width:0;line-height:1.12}
header .app-page-heading strong{font-size:1rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
header .app-page-heading span{font-size:.72rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:min(68vw,760px)}
header .secondary{margin-left:auto;height:34px;padding:0 12px}
aside{width:var(--sidebar-width)}
aside.collapsed{width:var(--sidebar-collapsed)}
body.menu-collapsed header{left:var(--sidebar-collapsed)}
body.menu-collapsed main{margin-left:var(--sidebar-collapsed)}
main{margin-left:var(--sidebar-width);padding:72px 14px 18px}
.brand{padding:13px 11px;gap:8px}
.brand img{width:36px}.brand b{font-size:.92rem}.brand small{font-size:.68rem}
nav{padding:3px 7px}
nav button,.aside-foot button,.file-btn{padding:8px 9px;border-radius:7px;margin:1px 0;font-size:.86rem;gap:8px}
.aside-foot{padding:7px}.aside-foot small{font-size:.64rem;padding:3px}
.collapse-handle{right:-12px;width:26px;height:48px}

/* O título/descrição principal vive no topo; a área interna mantém apenas as ações. */
#content>.page-head-primary{min-height:0;margin:0 0 8px;justify-content:flex-end}
#content>.page-head-primary .page-head-copy{display:none}
.page-head{margin-bottom:9px;gap:9px}
.page-head h1{font-size:1.35rem}.page-head h2{font-size:1.05rem;margin:0}.page-head p{font-size:.78rem;margin:2px 0}

/* Densidade visual de ERP: mais conteúdo e menos espaço desperdiçado. */
.card{padding:10px 12px;border-radius:10px;box-shadow:0 3px 12px #12324a08}
.kpis{gap:8px;margin-bottom:9px;grid-template-columns:repeat(auto-fit,minmax(145px,1fr))}
.kpi{padding:9px 11px;border-radius:9px;min-height:66px}
.kpi small{font-size:.69rem}.kpi strong{font-size:1.25rem;line-height:1.2}
.toolbar{gap:6px;margin:7px 0}
.toolbar input,.toolbar select,.field input,.field select,.field textarea{padding:7px 9px;border-radius:7px}
.field{margin:7px 0!important;font-size:.78rem}
.btn{padding:7px 10px;border-radius:7px;font-size:.78rem;min-height:32px}
.form-grid{gap:7px 10px}
.tabs{margin:5px 0}.tabs button{padding:6px 8px}
.pagination{padding:7px 9px;font-size:.78rem}
.modal-card{padding:17px;border-radius:12px}

/* Tabelas: rolagem própria, cabeçalho opaco e sempre acima das linhas. */
.table-wrap{
  position:relative;
  isolation:isolate;
  overflow:auto;
  max-height:calc(100vh - 225px);
  border-radius:9px;
  background:#fff;
}
.table-wrap table{position:relative;z-index:1}
.table-wrap thead{position:relative;z-index:40}
.table-wrap th{
  position:sticky!important;
  top:0!important;
  z-index:45!important;
  background:#f7f9fb!important;
  background-clip:padding-box!important;
  box-shadow:inset 0 -1px 0 #d8e1e7,0 2px 4px rgba(15,23,42,.06)!important;
}
th,td{padding:7px 9px}
th{font-size:.68rem}
.table-wrap table tbody tr{height:38px}
.table-wrap table td{font-size:.78rem;line-height:1.15}
.tag{padding:3px 7px;font-size:.68rem}
.action-menu summary{padding:6px 8px}.menu-pop{top:34px}

/* Faturamento compacto: filtros e KPIs sem ocupar duas linhas desnecessárias. */
.billing-kpis{grid-template-columns:repeat(4,minmax(125px,1fr));margin-bottom:8px}
.billing-filter-card{padding:8px 10px!important}
.billing-filters{grid-template-columns:minmax(210px,2fr) repeat(3,minmax(120px,.8fr)) auto!important;gap:6px!important}
.billing-filters input,.billing-filters select,.billing-filter-actions .btn{height:34px!important;min-height:34px!important}
.billing-table{max-height:calc(100vh - 275px)}

/* Módulos com tabelas longas ganham mais área útil. */
.finance-table,.job-table{max-height:calc(100vh - 235px)}
.agenda-card{margin-bottom:9px}.agenda-summary{gap:8px;margin-bottom:9px}

@media(max-width:1050px){
  :root{--sidebar-width:196px}
  .billing-filters{grid-template-columns:1fr 1fr!important}
  .billing-table{max-height:calc(100vh - 330px)}
}
@media(max-width:850px){
  header{left:0}.icon-btn{display:block}aside{transform:translateX(-105%)}aside.open{transform:none}
  main{margin-left:0;padding:70px 10px 14px}
  body.menu-collapsed header{left:0}body.menu-collapsed main{margin-left:0}
  .table-wrap{max-height:calc(100vh - 220px)}
}
@media(max-width:680px){
  header .app-page-heading span{max-width:55vw}.kpis,.billing-kpis{grid-template-columns:repeat(2,minmax(120px,1fr))}
  .billing-filters{grid-template-columns:1fr!important}
}

/* RC3.2.1 — correções consolidadas de UX e responsividade */
html,body{width:100%;height:100%;overflow:hidden}
#app.app{width:100vw;height:100vh;overflow:hidden}
main#content{
  height:100vh;
  min-width:0;
  overflow:hidden;
  display:flex;
  flex-direction:column;
}
main#content>*{min-width:0}

/* Menu lateral: recolhimento completo, igual em todos os módulos. */
aside#sidebar{z-index:1000;will-change:transform,width;transition:transform .22s ease,width .22s ease}
aside#sidebar.collapsed{width:var(--sidebar-width);transform:translateX(-100%)}
body.menu-collapsed header{left:0}
body.menu-collapsed main#content{margin-left:0}
aside#sidebar.collapsed .collapse-handle{
  transform:translateX(100%);
  right:-26px;
  border-radius:0 9px 9px 0;
}

/* Tabelas usam toda a altura restante e mantêm rolagem touch nativa. */
#content>.table-wrap,#content>.card.table-wrap{
  flex:1 1 auto;
  min-height:180px;
  max-height:none!important;
  width:100%;
  max-width:100%;
  overflow:auto!important;
  overscroll-behavior:contain;
  touch-action:pan-x pan-y;
  -webkit-overflow-scrolling:touch;
  cursor:default!important;
  contain:paint;
}
#content>.table-wrap+ .pagination,#content>.card.table-wrap+ .pagination{flex:0 0 auto}
.table-wrap.grab-scrolling{cursor:default!important}
.table-wrap table{z-index:auto!important}
.table-wrap thead{position:sticky!important;top:0!important;z-index:70!important}
.table-wrap thead tr{position:relative;z-index:71}
.table-wrap thead th{
  z-index:72!important;
  background:#f7f9fb!important;
  opacity:1!important;
  box-shadow:inset 0 -1px 0 #ccd7df,0 3px 7px rgba(15,23,42,.10)!important;
}
.table-wrap tbody,.table-wrap tbody tr,.table-wrap tbody td{position:relative;z-index:1}
.billing-table{overflow:auto!important;clip-path:inset(0 round 9px);isolation:isolate;contain:paint}
.billing-table thead,.billing-table thead tr,.billing-table thead th{z-index:100!important}

/* Faturamento: busca sob demanda, igual ao padrão Jobs/Fluxo. */
.billing-quick-toolbar{flex:0 0 auto;margin:2px 0 7px}
.billing-filter-panel{display:none;flex:0 0 auto;margin:0 0 8px!important}
.billing-filter-panel.is-open{display:block}
.billing-table{flex:1 1 auto!important;min-height:190px;max-height:none!important}

/* Agenda compacta e com foco permanente nos cards. */
body.agenda-foundation-active main#content{height:100vh;overflow:hidden}
.foundation-shell{height:100%;min-height:0!important;overflow:hidden!important;display:flex;flex-direction:column}
.foundation-titlebar{min-height:56px!important;padding:9px 14px!important;flex:0 0 auto}
.foundation-titlebar h1{font-size:1.2rem!important;margin:0!important}
.foundation-titlebar p{font-size:.76rem!important;margin:2px 0 0!important}
.foundation-commandbar{min-height:48px!important;height:48px!important;padding:5px 10px!important;flex:0 0 auto}
.foundation-tabs{height:38px!important}
.foundation-tabs button,.foundation-nav button,.foundation-filter-btn{min-height:32px!important;height:32px!important;padding:4px 9px!important;font-size:.76rem!important}
.foundation-layout{flex:1 1 auto;min-height:0!important;height:auto!important;grid-template-columns:160px minmax(0,1fr) 260px!important}
.foundation-left{padding:9px 8px!important;overflow:auto!important}
.foundation-left .mini-grid button{height:21px!important;font-size:.64rem!important}
.foundation-filter-summary{padding:8px 10px!important;font-size:.72rem!important}
.foundation-center{position:relative;min-height:0!important;overflow:hidden!important}
.foundation-stage{height:100%!important;min-height:0!important;overflow:auto!important;touch-action:pan-x pan-y;-webkit-overflow-scrolling:touch;cursor:default!important}
.foundation-context{width:auto!important;min-width:0!important}
.collapse-handle{width:24px!important;height:42px!important;font-size:.9rem!important}
#agendaNew{min-height:34px!important;height:34px!important;padding:5px 11px!important;font-size:.78rem!important}

/* Filtros da Agenda como popover: não empurram nem escondem os cards. */
.foundation-center .agenda-filters.agenda-filter-popover{
  position:absolute!important;
  top:10px!important;
  right:10px!important;
  left:auto!important;
  z-index:800!important;
  width:min(590px,calc(100% - 20px))!important;
  max-height:calc(100% - 20px)!important;
  overflow:auto!important;
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:7px 10px!important;
  margin:0!important;
  padding:11px!important;
  border:1px solid #d7e0e8!important;
  border-radius:11px!important;
  background:#fff!important;
  box-shadow:0 16px 38px rgba(15,23,42,.20)!important;
}
.foundation-center .agenda-filters.agenda-filter-popover.collapsed{display:none!important}
.agenda-filter-popover-head{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #e7edf2;padding-bottom:7px;margin-bottom:1px}
.agenda-filter-close{border:0;background:transparent;font-size:1.35rem;line-height:1;cursor:pointer;padding:0 3px;color:#536176}
.agenda-filter-popover .field{margin:0!important;font-size:.72rem!important}
.agenda-filter-popover input,.agenda-filter-popover select{height:34px!important;min-height:34px!important;padding:5px 8px!important}
.agenda-filter-popover .agenda-filter-actions{grid-column:1/-1;display:flex;justify-content:flex-end;gap:6px}
.agenda-filter-popover .agenda-filter-actions .btn{min-height:32px!important;height:32px!important}

@media(max-width:1100px){
  .foundation-layout{grid-template-columns:145px minmax(0,1fr) 230px!important}
}
@media(max-width:850px){
  html,body{overflow:hidden}
  main#content{height:100vh;padding-bottom:8px}
  aside#sidebar.collapsed{transform:translateX(-105%)}
  .foundation-layout{grid-template-columns:1fr!important}
  .foundation-center .agenda-filters.agenda-filter-popover{width:calc(100% - 16px)!important;right:8px!important;top:8px!important}
}
@media(max-width:620px){
  .foundation-center .agenda-filters.agenda-filter-popover{grid-template-columns:1fr!important}
  .agenda-filter-popover-head,.agenda-filter-popover .agenda-filter-actions{grid-column:1}
}

/* RC3.2.2 — correções finais de homologação */
/* Faturamento: cabeçalho fora do container rolável. As linhas jamais passam visualmente por trás dele. */
.billing-grid{
  display:flex!important;
  flex-direction:column;
  min-height:190px;
  max-height:none!important;
  overflow:hidden!important;
  padding:0!important;
  contain:layout paint;
  isolation:isolate;
  background:#fff;
}
.billing-grid-head,.billing-grid-row{
  display:grid;
  grid-template-columns:minmax(140px,1.1fr) minmax(85px,.7fr) minmax(140px,1.15fr) minmax(145px,1.15fr) minmax(105px,.85fr) minmax(90px,.7fr) minmax(125px,1fr) minmax(190px,1.35fr);
  min-width:1120px;
  align-items:center;
}
.billing-grid-head{
  flex:0 0 auto;
  position:relative;
  z-index:5;
  background:#f7f9fb;
  color:#586a77;
  font-size:.68rem;
  font-weight:800;
  text-transform:uppercase;
  border-bottom:1px solid #ccd7df;
  box-shadow:0 2px 5px rgba(15,23,42,.08);
}
.billing-grid-head>div,.billing-grid-row>div{padding:7px 10px;min-width:0}
.billing-grid-body{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  touch-action:pan-x pan-y;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
  background:#fff;
}
.billing-grid-row{min-height:45px;border-bottom:1px solid #edf1f4;font-size:.78rem;line-height:1.15;background:#fff}
.billing-grid-row small{display:block;color:var(--muted);margin-top:2px}
.billing-grid-empty{padding:22px;text-align:center;min-width:100%}
.billing-grid .billing-actions{display:flex;gap:6px;white-space:nowrap}

/* Datas do Faturamento seguem o padrão dd/mm/aaaa usado em Jobs e Fluxo. */
.billing-filters .date-br{width:100%;min-width:132px}

/* Agenda: usa exatamente o mesmo botão lateral compacto dos demais módulos. */
body.agenda-foundation-active aside#sidebar .collapse-handle,
body.agenda-foundation-active aside#sidebar.collapsed .collapse-handle{
  display:grid!important;
  place-items:center!important;
  right:-12px!important;
  top:46%!important;
  width:24px!important;
  height:42px!important;
  padding:0!important;
  border:0!important;
  border-radius:0 9px 9px 0!important;
  background:#287ca9!important;
  color:#fff!important;
  font-size:.9rem!important;
  line-height:1!important;
  box-shadow:0 2px 8px #0003!important;
}
body.agenda-foundation-active aside#sidebar.collapsed .collapse-handle{right:-24px!important;transform:none!important}

/* Mensagens globais no canto superior direito, sem cobrir calendário ou tabelas. */
#toast{
  left:auto!important;
  right:max(16px,env(safe-area-inset-right))!important;
  top:max(76px,calc(env(safe-area-inset-top) + 16px))!important;
  bottom:auto!important;
  transform:translateY(-10px)!important;
  text-align:left!important;
}
#toast.show{transform:none!important}

/* RC3.3.0 — Clientes / CRM operacional */
.link-button{border:0;background:none;padding:0;color:var(--primary,#12324a);font:inherit;font-weight:700;cursor:pointer;text-align:left}.link-button:hover{text-decoration:underline}
.client-profile-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:14px 0}.client-profile-grid .card{margin:0}.client-profile-grid p{margin:7px 0}.clients-table .actions{flex-wrap:nowrap}.client-kpis{margin-bottom:16px}
@media(max-width:1000px){.client-profile-grid{grid-template-columns:1fr 1fr}.clients-table .actions{flex-wrap:wrap}}
@media(max-width:650px){.client-profile-grid{grid-template-columns:1fr}}


/* RC3.3.1 — Clientes: ajuda contextual, origem por indicação e proteção do CTA */
#newClient{position:relative;z-index:3;flex:0 0 auto;white-space:nowrap;max-width:100%}
.page-head{min-width:0;overflow:visible;flex-wrap:wrap}
.page-head>div,.page-head-copy{min-width:0;flex:1 1 320px}
.field-label-help{display:inline-flex;align-items:center;gap:5px;position:relative}
.help-icon{width:18px;height:18px;padding:0;border:1px solid #94a3b8;border-radius:50%;background:#fff;color:#526575;font-size:11px;font-weight:900;line-height:16px;text-align:center;cursor:help;position:relative}
.help-icon::after{content:attr(data-help);display:none;position:absolute;left:50%;bottom:calc(100% + 9px);transform:translateX(-50%);width:min(290px,70vw);padding:9px 11px;border-radius:8px;background:#17232d;color:#fff;font-size:12px;font-weight:500;line-height:1.35;text-align:left;box-shadow:0 8px 22px rgba(15,23,42,.24);z-index:250;white-space:normal}
.help-icon::before{content:'';display:none;position:absolute;left:50%;bottom:calc(100% + 4px);transform:translateX(-50%);border:5px solid transparent;border-top-color:#17232d;z-index:251}
.help-icon:hover::after,.help-icon:hover::before,.help-icon:focus::after,.help-icon:focus::before,.help-icon.help-open::after,.help-icon.help-open::before{display:block}
@media(max-width:700px){#content>.page-head{align-items:stretch}.page-head>#newClient{width:100%;margin:0}}


/* RC3.3.2 — Padronização visual de Clientes, Jobs e menu da Agenda */
#content>.page-head-primary:has(#newClient){
  min-height:40px;
  align-items:center;
  margin:0 0 10px;
  overflow:visible;
}
#newClient{position:static!important;z-index:auto!important;margin:0!important}
.client-name-stack{display:flex;flex-direction:column;align-items:flex-start;gap:2px;line-height:1.12}
.client-name-stack strong{font-size:.9rem;color:#12324a;font-weight:850}
.client-name-stack small{font-size:.67rem;color:#718096;font-weight:650;letter-spacing:.02em}
.client-actions-modern{flex-wrap:nowrap;justify-content:flex-start}
.client-overflow .action-summary{display:grid;place-items:center;width:38px;height:36px;padding:0;border:1px solid #d7e0ea;border-radius:9px;background:#fff!important;color:#334155!important;font-size:22px;line-height:1;box-shadow:none}
.client-modern-menu button{border:0;background:#fff;color:#17232d;text-align:left;padding:9px 10px;border-radius:7px;cursor:pointer;font-weight:700}
.client-modern-menu button:hover{background:#f1f5f9}

/* A Agenda usa o mesmo tamanho e estado ativo do menu global. */
body.agenda-foundation-active aside#sidebar nav{padding:3px 7px!important}
body.agenda-foundation-active aside#sidebar nav button{
  padding:8px 9px!important;
  border-radius:7px!important;
  margin:1px 0!important;
  font-size:.86rem!important;
  gap:8px!important;
  min-height:0!important;
  color:#fff!important;
  box-shadow:none!important;
}
body.agenda-foundation-active aside#sidebar nav button:hover,
body.agenda-foundation-active aside#sidebar nav button.active{
  background:#ffffff20!important;
  color:#fff!important;
  box-shadow:none!important;
}
@media(max-width:700px){#content>.page-head-primary:has(#newClient){min-height:42px}.page-head>#newClient{width:100%}}

/* RC3.3.3 — correção estrutural definitiva do shell global da Agenda
   A Agenda não pode redimensionar, ocultar ou recriar a navegação global. */
body.agenda-foundation-active{
  background:var(--bg)!important;
}
body.agenda-foundation-active>div#app>header{
  display:flex!important;
  left:var(--sidebar-width)!important;
  height:var(--app-header-height)!important;
}
body.agenda-foundation-active aside#sidebar,
body.agenda-foundation-active aside#sidebar:not(.collapsed){
  width:var(--sidebar-width)!important;
  background:var(--navy)!important;
}
body.agenda-foundation-active aside#sidebar .brand{
  padding:13px 11px!important;
  border-bottom:1px solid rgba(255,255,255,.12)!important;
}
body.agenda-foundation-active aside#sidebar nav{
  padding:3px 7px!important;
}
body.agenda-foundation-active aside#sidebar nav button{
  padding:8px 9px!important;
  border-radius:7px!important;
  margin:1px 0!important;
  min-height:0!important;
  font-size:.86rem!important;
  gap:8px!important;
  color:#fff!important;
  background:transparent!important;
  box-shadow:none!important;
}
body.agenda-foundation-active aside#sidebar nav button:hover,
body.agenda-foundation-active aside#sidebar nav button.active{
  background:#ffffff20!important;
  color:#fff!important;
  box-shadow:none!important;
}
body.agenda-foundation-active main#content{
  margin-left:var(--sidebar-width)!important;
  width:auto!important;
  height:auto!important;
  min-height:100vh!important;
  padding:72px 14px 18px!important;
  overflow:visible!important;
}
body.agenda-foundation-active .foundation-shell{
  height:calc(100vh - 90px)!important;
  min-height:560px!important;
  border:1px solid #e1e7ed;
  border-radius:10px;
  background:#fff;
  overflow:hidden!important;
}
body.agenda-foundation-active.menu-collapsed>div#app>header{
  left:0!important;
}
body.agenda-foundation-active.menu-collapsed main#content{
  margin-left:0!important;
  width:auto!important;
}
body.agenda-foundation-active aside#sidebar.collapsed{
  width:0!important;
  background:var(--navy)!important;
}
@media(max-width:850px){
  body.agenda-foundation-active>div#app>header{left:0!important}
  body.agenda-foundation-active main#content{margin-left:0!important;width:auto!important;padding:72px 12px 18px!important}
  body.agenda-foundation-active .foundation-shell{height:calc(100vh - 90px)!important;min-height:520px!important}
}

/* RC3.3.4 — padronização de Ações e rolagem íntegra do Faturamento */
/* Clientes e Jobs: o menu secundário segue o padrão clean aprovado em Clientes. */
.job-overflow .action-summary,
.client-overflow .action-summary,
.job-table .action-menu .action-summary{
  display:grid!important;
  place-items:center!important;
  width:38px!important;
  height:36px!important;
  padding:0!important;
  border:1px solid var(--orange)!important;
  border-radius:9px!important;
  background:#fff!important;
  color:#334155!important;
  box-shadow:none!important;
  font-size:22px!important;
  line-height:1!important;
}

/* O cabeçalho AÇÕES representa o conjunto Detalhar + menu, não apenas um botão. */
.job-table th:last-child,
.clients-table th:last-child{
  text-align:center!important;
}
.job-table td:last-child .actions,
.clients-table td:last-child .actions{
  justify-content:center!important;
  width:100%;
}

/* Remove o vazio excessivo entre Viabilidade e Ações sem comprimir os controles. */
.job-table th:nth-child(10),
.job-table td:nth-child(10){
  width:112px!important;
  min-width:112px!important;
  max-width:112px!important;
}
.job-table th:last-child,
.job-table td:last-child{
  width:142px!important;
  min-width:142px!important;
  max-width:142px!important;
  padding-left:6px!important;
  padding-right:6px!important;
}
.clients-table th:last-child,
.clients-table td:last-child{
  width:142px!important;
  min-width:142px!important;
  max-width:142px!important;
  padding-left:6px!important;
  padding-right:6px!important;
}

/* Faturamento: cabeçalho e registros pertencem ao MESMO viewport de rolagem.
   Assim, qualquer deslocamento horizontal move os dois em perfeita sincronia. */
.billing-grid{
  display:block!important;
  overflow:auto!important;
  max-height:calc(100vh - 330px)!important;
  min-height:190px;
  padding:0!important;
  scrollbar-gutter:stable;
  contain:layout paint;
  isolation:isolate;
  background:#fff;
}
.billing-grid-head,
.billing-grid-row{
  width:max-content!important;
  min-width:1120px!important;
}
.billing-grid-head{
  position:sticky!important;
  top:0!important;
  z-index:6!important;
}
.billing-grid-body{
  display:block!important;
  overflow:visible!important;
  min-width:1120px!important;
  min-height:0!important;
}
@media(max-width:850px){
  .billing-grid{max-height:calc(100vh - 285px)!important}
}

/* RC3.3.5 — Agenda e Faturamento: consolidação de UX */
/* Agenda usa somente o cabeçalho global do ERP. */
body.agenda-foundation-active .foundation-shell{border-radius:14px;overflow:hidden}
body.agenda-foundation-active .foundation-titlebar{display:none!important}
body.agenda-foundation-active .foundation-commandbar{min-height:58px;padding:8px 12px;gap:10px}
body.agenda-foundation-active .foundation-commandbar .agenda-command-actions{margin-left:auto;display:flex;align-items:center;gap:10px}
body.agenda-foundation-active .foundation-commandbar .foundation-badge{white-space:nowrap}
body.agenda-foundation-active .foundation-commandbar .foundation-new-btn{white-space:nowrap}
body.agenda-foundation-active .foundation-layout{grid-template-columns:164px minmax(0,1fr) 220px!important}
body.agenda-foundation-active .foundation-context{width:auto!important;min-width:0!important}
body.agenda-foundation-active .foundation-tabs{display:flex;align-items:center;gap:4px;min-width:0}
body.agenda-foundation-active .foundation-tabs .agenda-more-menu{position:relative}
body.agenda-foundation-active .foundation-tabs .agenda-more-menu>summary{list-style:none;display:flex;align-items:center;gap:4px;border:0;background:transparent;color:#526176;padding:7px 9px;border-radius:8px;font-weight:700;font-size:.82rem;cursor:pointer}
body.agenda-foundation-active .foundation-tabs .agenda-more-menu>summary::-webkit-details-marker{display:none}
body.agenda-foundation-active .foundation-tabs .agenda-more-menu[open]>summary,
body.agenda-foundation-active .foundation-tabs .agenda-more-menu.active>summary{background:#fff;color:#1d4ed8;box-shadow:0 1px 4px #0f172a18}
body.agenda-foundation-active .agenda-more-pop{position:absolute;top:40px;left:0;z-index:40;display:grid;min-width:130px;padding:6px;background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:0 10px 28px #0f172a26}
body.agenda-foundation-active .agenda-more-pop button{border:0;background:#fff;text-align:left;padding:8px 10px;border-radius:7px;font-weight:700;cursor:pointer}
body.agenda-foundation-active .agenda-more-pop button:hover,
body.agenda-foundation-active .agenda-more-pop button.active{background:#eef4ff;color:#175cd3}
body.agenda-foundation-active .agenda-period-picker{border:0;background:transparent;padding:7px 10px;border-radius:8px;font-weight:800;cursor:pointer;color:var(--ink)}
body.agenda-foundation-active .agenda-period-picker:hover{background:#f1f5f9}
.agenda-period-form{display:grid;grid-template-columns:1fr 130px;gap:12px;align-items:end}
.agenda-period-form .actions{grid-column:1/-1;justify-content:flex-end}

/* Faturamento: toda a lista fica visível; apenas o eixo horizontal pertence à tabela. */
.billing-grid{display:block!important;max-height:none!important;height:auto!important;min-height:0!important;overflow-x:auto!important;overflow-y:visible!important;scrollbar-gutter:auto!important}
.billing-grid-head{position:sticky!important;top:0!important;z-index:6!important}
.billing-grid-body{overflow:visible!important;min-height:0!important;height:auto!important}
.billing-grid-head>div:last-child{text-align:center!important}
.billing-grid-row>div:last-child{display:flex!important;align-items:center!important;justify-content:center!important}
.billing-grid .billing-actions{justify-content:center!important;width:100%}

/* Invoice/Receipt: centralização e redimensionamento automático. */
.modal:has(.invoice-modal-card){align-items:center!important;justify-items:center!important;padding:16px!important}
.invoice-modal-card{width:min(1040px,calc(100vw - 32px))!important;max-width:1040px!important;max-height:calc(100vh - 32px)!important;margin:auto!important;padding:20px!important;overflow:auto!important}
.invoice-modal-card .invoice-document{width:100%!important;max-width:900px!important;margin-inline:auto!important}
.invoice-modal-card .invoice-modal-title{padding-right:28px}
.invoice-accent-bar{background:linear-gradient(115deg,#0f2f49 0 46%,var(--blue) 46% 100%)!important}
.receipt-document{border-top-color:var(--blue)!important}
.receipt-document .invoice-document-meta>strong{color:var(--blue)!important}
.receipt-document .invoice-grand-total{background:#eef6fb!important}
@media(max-width:1100px){body.agenda-foundation-active .foundation-layout{grid-template-columns:150px minmax(0,1fr) 205px!important}}
@media(max-width:850px){body.agenda-foundation-active .foundation-layout{grid-template-columns:1fr!important}.agenda-period-form{grid-template-columns:1fr}.invoice-modal-card{width:calc(100vw - 20px)!important;max-height:calc(100vh - 20px)!important;padding:14px!important}}

/* RC3.3.6 — correções finais de Agenda, documentos e seta do menu */
/* Agenda: nenhum botão novo não aprovado e apenas um menu Mais. */
body.agenda-foundation-active .agenda-command-actions,
body.agenda-foundation-active #agendaNew,
body.agenda-foundation-active .foundation-new-btn,
body.agenda-foundation-active .foundation-badge{display:none!important}
body.agenda-foundation-active .foundation-tabs>.agenda-more-views{display:none!important}
body.agenda-foundation-active .foundation-tabs .agenda-more-menu{flex:0 0 auto}
body.agenda-foundation-active .foundation-tabs .agenda-more-menu>summary{font-size:.76rem!important;padding:6px 8px!important}

/* O próprio calendário lateral abre o seletor nativo de mês e ano. */
.mini-calendar-title{position:relative}
.mini-month-year-button{border:0;background:transparent;color:inherit;font:inherit;font-weight:800;line-height:1.15;padding:3px 5px;border-radius:6px;cursor:pointer;text-transform:capitalize}
.mini-month-year-button:hover,.mini-month-year-button:focus-visible{background:#eef4ff;outline:none;color:#175cd3}
.mini-month-picker{position:absolute!important;left:50%!important;top:50%!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none!important}

/* Invoice e Receipt: modal acima do menu, compacto e inteiramente dentro do viewport. */
.modal.invoice-modal-open{z-index:3200!important;display:flex!important;align-items:center!important;justify-content:center!important;padding:20px!important;overflow:hidden!important}
.modal.invoice-modal-open .invoice-modal-card{width:min(860px,calc(100vw - 40px))!important;max-width:860px!important;height:auto!important;max-height:calc(100vh - 40px)!important;margin:0!important;padding:16px!important;overflow:auto!important;border-radius:14px!important}
.modal.invoice-modal-open .invoice-document{width:100%!important;max-width:790px!important;margin:0 auto!important;box-shadow:none!important}
.modal.invoice-modal-open .invoice-modal-title h2{font-size:1.35rem!important;margin:0!important}
.modal.invoice-modal-open .invoice-modal-title p{margin:3px 0 0!important}
.modal.invoice-modal-open .invoice-flow{gap:7px!important;margin:10px 0!important}
.modal.invoice-modal-open .invoice-flow span{padding:7px 8px!important;font-size:.76rem!important}
.modal.invoice-modal-open .invoice-document-head{padding:16px 20px 13px!important}
.modal.invoice-modal-open .invoice-accent-bar{height:48px!important;padding:0 20px!important}
.modal.invoice-modal-open .invoice-bill-grid{padding:13px 20px!important}
.modal.invoice-modal-open .invoice-terms{margin:0 20px 16px!important}
@media(max-width:700px){.modal.invoice-modal-open{padding:10px!important}.modal.invoice-modal-open .invoice-modal-card{width:calc(100vw - 20px)!important;max-height:calc(100vh - 20px)!important;padding:12px!important}}

/* A seta homologada da Agenda passa a ser o padrão global, sem alterar a Agenda. */
aside#sidebar .collapse-handle,
aside#sidebar.collapsed .collapse-handle{
  display:grid!important;place-items:center!important;right:-12px!important;top:46%!important;width:24px!important;height:42px!important;padding:0!important;border:0!important;border-radius:0 9px 9px 0!important;background:#287ca9!important;color:#fff!important;font-size:.9rem!important;line-height:1!important;box-shadow:0 2px 8px #0003!important;transform:none!important
}
aside#sidebar.collapsed .collapse-handle{right:-24px!important;transform:none!important}

/* RC3.3.7 — ajustes finais aprovados da Agenda e do menu lateral */
/* Painel contextual mais estreito; o espaço ganho vai para o calendário. */
body.agenda-foundation-active .foundation-layout{
  grid-template-columns:164px minmax(0,1fr) 176px!important;
}
body.agenda-foundation-active .foundation-context-head,
body.agenda-foundation-active .foundation-context-section,
body.agenda-foundation-active .foundation-context-actions{padding-left:12px!important;padding-right:12px!important}

/* Botão Mais controlado por JavaScript, sem dependência do comportamento instável de details. */
.agenda-more-control{position:relative;flex:0 0 auto}
.agenda-more-trigger{display:flex;align-items:center;gap:4px;border:0;background:transparent;color:#526176;padding:7px 9px;border-radius:8px;font-weight:700;font-size:.78rem;cursor:pointer}
.agenda-more-trigger:hover,.agenda-more-control.active .agenda-more-trigger,.agenda-more-trigger[aria-expanded="true"]{background:#fff;color:#1d4ed8;box-shadow:0 1px 4px #0f172a18}
.agenda-more-dropdown{position:absolute;top:calc(100% + 6px);left:0;z-index:120;min-width:126px;padding:6px;background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:0 10px 28px #0f172a26}
.agenda-more-dropdown[hidden]{display:none!important}
.agenda-more-dropdown button{display:block;width:100%;border:0;background:#fff;text-align:left;padding:8px 10px;border-radius:7px;font-weight:700;cursor:pointer;color:#344054}
.agenda-more-dropdown button:hover,.agenda-more-dropdown button.active{background:#eef4ff;color:#175cd3}

/* Cabeçalho do mini-calendário proporcional e em uma única linha. */
.foundation-left .mini-calendar-title{display:grid!important;grid-template-columns:28px minmax(0,1fr) 28px!important;align-items:center!important;gap:3px!important}
.foundation-left .mini-month-year-button{display:block!important;width:100%!important;min-width:0!important;padding:3px 2px!important;font-size:.78rem!important;line-height:1.15!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;text-align:center!important;text-transform:capitalize!important}
.mini-month-picker{display:none!important}
.agenda-period-compact{display:grid;grid-template-columns:minmax(190px,1fr) 130px;gap:12px;align-items:end;margin-top:14px}
.agenda-period-modal{width:min(460px,calc(100vw - 28px))!important}
.agenda-period-actions{justify-content:flex-end;margin-top:16px}

/* Remove somente a faixa vertical escura causada pelo trilho da rolagem do menu.
   Os dois divisores horizontais aprovados permanecem intactos. */
aside#sidebar nav{scrollbar-width:none!important;scrollbar-color:transparent transparent!important}
aside#sidebar nav::-webkit-scrollbar{width:0!important;height:0!important;display:none!important}

@media(max-width:1100px){body.agenda-foundation-active .foundation-layout{grid-template-columns:150px minmax(0,1fr) 166px!important}}
@media(max-width:850px){body.agenda-foundation-active .foundation-layout{grid-template-columns:1fr!important}.agenda-period-compact{grid-template-columns:1fr}}

/* RC3.3.8 — correções estruturais finais de Agenda e Fluxo */
/* Barra superior estável: sem quebra, sobreposição ou controles comprimidos. */
body.agenda-foundation-active .foundation-commandbar.agenda-commandbar-fixed{
  display:grid!important;
  grid-template-columns:minmax(300px,max-content) minmax(260px,1fr) max-content!important;
  align-items:center!important;
  column-gap:14px!important;
  overflow:visible!important;
  min-height:54px!important;
  height:54px!important;
  padding:7px 12px!important;
}
body.agenda-foundation-active .agenda-commandbar-fixed .foundation-tabs{
  min-width:0!important;
  overflow:visible!important;
  z-index:45!important;
}
body.agenda-foundation-active .agenda-commandbar-fixed .foundation-nav.agenda-nav-fixed{
  display:grid!important;
  grid-template-columns:36px minmax(150px,1fr) 36px!important;
  justify-self:center!important;
  align-items:center!important;
  gap:6px!important;
  min-width:250px!important;
  max-width:360px!important;
  overflow:visible!important;
}
body.agenda-foundation-active .agenda-commandbar-fixed .foundation-nav.agenda-nav-fixed>button{
  width:36px!important;min-width:36px!important;height:34px!important;padding:0!important;
}
body.agenda-foundation-active .agenda-period-label-fixed{
  display:block!important;min-width:0!important;text-align:center!important;
  white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
  font-size:.86rem!important;line-height:1.1!important;
}
body.agenda-foundation-active .agenda-commandbar-fixed .foundation-tools{justify-self:end!important;min-width:max-content!important}

/* Menu Mais fora do fluxo visual do calendário, acima de todos os painéis. */
.agenda-more-dropdown{
  position:fixed!important;
  z-index:5000!important;
  min-width:136px!important;
  max-height:none!important;
  overflow:visible!important;
  isolation:isolate!important;
}

/* Seletor mês/ano compacto. */
.agenda-period-modal-compact{
  width:min(340px,calc(100vw - 28px))!important;
  max-width:340px!important;
  padding:16px!important;
}
.agenda-period-modal-compact h2{font-size:1.05rem!important;margin:0 0 12px!important}
.agenda-period-modal-compact .agenda-period-compact{
  grid-template-columns:minmax(150px,1fr) 105px!important;
  gap:8px!important;
  margin-top:0!important;
}
.agenda-period-modal-compact .field{font-size:.72rem!important;gap:4px!important}
.agenda-period-modal-compact select,
.agenda-period-modal-compact input{height:36px!important;min-height:36px!important;padding:6px 9px!important}
.agenda-period-modal-compact .agenda-period-actions{margin-top:12px!important;gap:7px!important}
.agenda-period-modal-compact .agenda-period-actions .btn{height:34px!important;padding:0 12px!important}

/* Painel direito: nome e dois botões sem colisão. */
body.agenda-foundation-active .foundation-context-head-fixed{
  display:grid!important;
  grid-template-columns:42px minmax(0,1fr) 30px 30px!important;
  gap:7px!important;
  align-items:center!important;
  padding:12px 10px!important;
}
body.agenda-foundation-active .foundation-context-head-fixed>div:nth-child(2){min-width:0!important;overflow:hidden!important}
body.agenda-foundation-active .foundation-context-head-fixed h3,
body.agenda-foundation-active .foundation-context-head-fixed span{
  display:block!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
}
body.agenda-foundation-active .foundation-context-head-fixed .foundation-icon-btn,
body.agenda-foundation-active .foundation-context-head-fixed .foundation-more-menu{min-width:0!important;justify-self:center!important}
body.agenda-foundation-active .foundation-context-head-fixed .foundation-more-menu>summary{width:30px!important;height:30px!important;padding:0!important}

/* Painel contextual realmente menor; calendário recebe o espaço. */
body.agenda-foundation-active .foundation-layout{
  grid-template-columns:164px minmax(0,1fr) 158px!important;
}

/* Cards do +N agendamentos no mesmo padrão compacto do grid mensal. */
.agenda-overflow-list-compact{
  display:grid!important;
  grid-template-columns:repeat(auto-fill,minmax(92px,92px))!important;
  gap:8px!important;
  justify-content:start!important;
  max-height:430px!important;
  overflow:auto!important;
}
.agenda-overflow-list-compact .agenda-overflow-item{
  width:92px!important;
  height:54px!important;
  min-height:54px!important;
  grid-template-columns:1fr!important;
  gap:1px!important;
  padding:5px 6px!important;
  border-left:4px solid #5d9fe5!important;
  background:#dceeff!important;
  color:#174d7e!important;
  border-radius:7px!important;
  overflow:hidden!important;
}
.agenda-overflow-list-compact .agenda-overflow-item>b,
.agenda-overflow-list-compact .agenda-overflow-item strong,
.agenda-overflow-list-compact .agenda-overflow-item small{
  display:block!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;
  line-height:1.05!important;
}
.agenda-overflow-list-compact .agenda-overflow-item>b{font-size:.61rem!important}
.agenda-overflow-list-compact .agenda-overflow-item strong{font-size:.72rem!important}
.agenda-overflow-list-compact .agenda-overflow-item small{font-size:.58rem!important}

/* Fluxo: título Ações centralizado e botão do topo fora dos painéis. */
.finance-table .finance-actions-head{text-align:center!important;min-width:150px!important}
.finance-table .finance-actions-cell{text-align:center!important}
.finance-table .finance-actions-cell>.actions{justify-content:center!important;align-items:center!important;gap:7px!important;width:100%!important}
#newFinance.finance-new-fixed{
  position:static!important;
  inset:auto!important;
  transform:none!important;
  margin-left:auto!important;
  z-index:auto!important;
}

@media(max-width:1100px){
  body.agenda-foundation-active .foundation-layout{grid-template-columns:150px minmax(0,1fr) 152px!important}
  body.agenda-foundation-active .foundation-commandbar.agenda-commandbar-fixed{grid-template-columns:minmax(280px,max-content) minmax(220px,1fr) max-content!important}
}

/* RC3.3.10 — governança e correções isoladas por módulo */
/* Agenda: painel contextual legível e rolável até o último campo. */
body.agenda-foundation-active .foundation-layout{grid-template-columns:164px minmax(0,1fr) 210px!important}
body.agenda-foundation-active .foundation-context{min-width:0!important;overflow-y:auto!important;overflow-x:hidden!important;padding-bottom:96px!important;scroll-padding-bottom:96px!important}
body.agenda-foundation-active .foundation-context-head,
body.agenda-foundation-active .helper-context-head{grid-template-columns:42px minmax(0,1fr) 30px 30px!important;gap:7px!important;align-items:center!important}
body.agenda-foundation-active .foundation-context-head>div:nth-child(2),
body.agenda-foundation-active .helper-context-head>div:nth-child(2){min-width:0!important;overflow:visible!important}
body.agenda-foundation-active .foundation-context-head h3,
body.agenda-foundation-active .helper-context-head h3{white-space:normal!important;overflow:visible!important;text-overflow:clip!important;line-height:1.15!important;overflow-wrap:anywhere!important}
body.agenda-foundation-active .foundation-context-head span,
body.agenda-foundation-active .helper-context-head span{white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
body.agenda-foundation-active .foundation-context-section,
body.agenda-foundation-active .foundation-detail-block{padding:12px 14px!important}

/* Agenda / Equipe: compacta, sem alterar modais compartilhados. */
body.agenda-foundation-active .team-row{min-height:62px!important;grid-template-columns:168px minmax(0,1fr)!important}
body.agenda-foundation-active .team-name{padding:8px 12px!important;gap:2px!important}
body.agenda-foundation-active .team-name b{font-size:.92rem!important}
body.agenda-foundation-active .team-name small{font-size:.69rem!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
body.agenda-foundation-active .team-helper-button{width:100%!important;border:0!important;background:transparent!important;text-align:left!important;cursor:pointer!important;color:inherit!important;border-radius:8px!important}
body.agenda-foundation-active .team-helper-button:hover,
body.agenda-foundation-active .team-helper-button:focus-visible{background:#f2f6fb!important;outline:2px solid #d7e7fb!important;outline-offset:-2px!important}

/* Menus de ação em portal: acima das tabelas, sem tocar nos modais. */
#aoc-action-portal{position:fixed!important;z-index:12000!important;display:grid!important;min-width:160px!important;padding:6px!important;background:#fff!important;border:1px solid #d9e1e8!important;border-radius:10px!important;box-shadow:0 14px 36px rgba(15,23,42,.24)!important}
#aoc-action-portal[hidden]{display:none!important}
#aoc-action-portal button{width:100%!important;border:0!important;background:#fff!important;text-align:left!important;white-space:nowrap!important;padding:9px 11px!important;border-radius:7px!important;font-weight:700!important;color:#25364a!important;cursor:pointer!important}
#aoc-action-portal button:hover{background:#eef4ff!important;color:#175cd3!important}

/* Fluxo: ação centralizada e botão principal sempre fora dos KPIs. */
.finance-table th:last-child,.finance-table td:last-child{text-align:center!important}
.finance-table td:last-child>.actions{justify-content:center!important;align-items:center!important;gap:7px!important}
#content>.page-head #newFinance,#content header #newFinance{position:static!important;inset:auto!important;transform:none!important;margin-left:auto!important;z-index:auto!important}
.finance-kpis{clear:both!important}

/* Invoice/Receipt: centro da área útil, levemente à esquerda sem encobrir a seta. */
@media(min-width:851px){
  .modal.invoice-modal-open{padding-left:245px!important;padding-right:28px!important;justify-content:center!important}
  aside#sidebar.collapsed~main .modal.invoice-modal-open,
  body:has(#sidebar.collapsed) .modal.invoice-modal-open{padding-left:74px!important;padding-right:20px!important}
}

/* Guard rail: os modais homologados de Clientes, Jobs e Fluxo mantêm o layout original. */
.modal-card:not(.invoice-modal-card):not(.agenda-period-modal):not(.agenda-overflow-modal){width:min(980px,calc(100vw - 48px));max-height:calc(100vh - 48px)}

@media(max-width:1100px){body.agenda-foundation-active .foundation-layout{grid-template-columns:150px minmax(0,1fr) 198px!important}}

/* RC3.3.11 — correções cirúrgicas após auditoria visual */
/* Modais homologados: restaurar largura e composição sem afetar Invoice/Agenda. */
.modal-card.client-detail-modal{width:min(1040px,calc(100vw - 56px))!important;max-width:1040px!important;padding:22px!important}
.modal-card.client-form-modal{width:min(820px,calc(100vw - 56px))!important;max-width:820px!important;padding:22px!important}
.modal-card.job-detail-modal{width:min(920px,calc(100vw - 56px))!important;max-width:920px!important;padding:22px!important}
.modal-card.finance-form-modal{width:min(820px,calc(100vw - 56px))!important;max-width:820px!important;padding:22px!important}
.modal-card.client-form-modal .form-grid,
.modal-card.finance-form-modal .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px 14px!important}
.modal-card.job-detail-modal .detail-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:10px 14px!important}
.modal-card.client-form-modal .help-icon::after{width:min(270px,40vw)!important;z-index:14000!important}
.modal-card.client-form-modal .help-icon::before{z-index:14001!important}
@media(max-width:760px){
  .modal-card.client-detail-modal,.modal-card.client-form-modal,.modal-card.job-detail-modal,.modal-card.finance-form-modal{width:calc(100vw - 24px)!important;padding:16px!important}
  .modal-card.client-form-modal .form-grid,.modal-card.finance-form-modal .form-grid,.modal-card.job-detail-modal .detail-grid{grid-template-columns:1fr!important}
}

/* Invoice/Receipt: ligeiramente à esquerda do centro da área útil, mantendo folga da seta. */
@media(min-width:851px){
  .modal.invoice-modal-open{padding-left:160px!important;padding-right:28px!important}
  body:has(#sidebar.collapsed) .modal.invoice-modal-open{padding-left:58px!important;padding-right:20px!important}
}

/* Fluxo: botão principal totalmente visível e cinco registros úteis no Chromebook. */
#content>.page-head-primary:has(#newFinance){min-height:44px!important;align-items:center!important;margin:0 0 12px!important;overflow:visible!important}
#newFinance{position:static!important;margin:0!important;align-self:center!important;z-index:2!important}
.finance-kpis{gap:8px!important;margin:0 0 9px!important}
.finance-kpis .kpi{min-height:58px!important;padding:7px 10px!important}
.finance-kpis .kpi strong{font-size:1.17rem!important}
.finance-table th,.finance-table td{padding-top:8px!important;padding-bottom:8px!important}
.finance-table{max-height:calc(100vh - 207px)!important}

/* Menu Ações do Fluxo visualmente ancorado ao registro que o abriu. */
#aoc-action-portal.finance-action-portal{min-width:178px!important;border-color:#cbd5e1!important;box-shadow:0 10px 26px rgba(15,23,42,.22)!important}
#aoc-action-portal.finance-action-portal::before{content:'';position:absolute;right:18px;top:-7px;width:12px;height:12px;background:#fff;border-left:1px solid #cbd5e1;border-top:1px solid #cbd5e1;transform:rotate(45deg)}
#aoc-action-portal.finance-action-portal button{position:relative;z-index:1}


/* RC3.3.12 — tamanhos intermediários, menus toggle e densidade segura do Fluxo */
/* Modais: dimensionados pela área útil do conteúdo, sem invadir o menu lateral. */
@media (min-width: 851px){
  .modal-card.client-detail-modal{
    width:min(900px,calc(100vw - 330px))!important;
    max-width:900px!important;
    max-height:calc(100vh - 54px)!important;
    padding:20px!important;
  }
  .modal-card.job-detail-modal{
    width:min(850px,calc(100vw - 330px))!important;
    max-width:850px!important;
    max-height:calc(100vh - 54px)!important;
    padding:20px!important;
  }
  .modal-card.finance-form-modal{
    width:min(760px,calc(100vw - 330px))!important;
    max-width:760px!important;
    max-height:calc(100vh - 54px)!important;
    padding:20px!important;
  }
}
/* Mantém as composições homologadas em colunas, sem voltar à versão vertical estreita. */
.modal-card.client-detail-modal .client-profile-grid{gap:12px!important}
.modal-card.job-detail-modal .detail-grid{gap:9px 12px!important}
.modal-card.finance-form-modal .form-grid{gap:9px 12px!important}

/* Fluxo: cinco registros visíveis por meio de densidade controlada, não de recorte. */
.finance-kpis{gap:7px!important;margin-bottom:7px!important}
.finance-kpis .kpi{min-height:52px!important;padding:6px 9px!important}
.finance-kpis .kpi small{font-size:.75rem!important;line-height:1.05!important}
.finance-kpis .kpi strong{font-size:1.12rem!important;line-height:1.05!important}
.finance-table{height:calc(100vh - 198px)!important;max-height:calc(100vh - 198px)!important;min-height:250px!important}
.finance-table th,.finance-table td{padding:6px 10px!important;line-height:1.15!important}
.finance-table tbody tr{height:40px!important}
.finance-table thead tr{height:34px!important}
#content:has(.finance-table) .pagination{padding:7px 10px!important}
#content:has(.finance-table) .toolbar{margin:7px 0!important}

@media(max-width:850px){
  .modal-card.client-detail-modal,.modal-card.job-detail-modal,.modal-card.finance-form-modal{
    width:calc(100vw - 24px)!important;max-width:none!important;padding:16px!important;
  }
  .finance-table{height:auto!important;max-height:calc(100vh - 220px)!important}
}

/* RC3.3.13 — paginação restaurada e dimensionamento cirúrgico dos overlays */
@media (min-width:851px){
  .modal-card.client-detail-modal{width:min(820px,calc(100vw - 390px))!important;max-width:820px!important;max-height:calc(100vh - 72px)!important;padding:18px!important}
  .modal-card.client-form-modal{width:min(760px,calc(100vw - 390px))!important;max-width:760px!important;max-height:calc(100vh - 72px)!important;padding:18px!important}
  .modal-card.job-detail-modal{width:min(800px,calc(100vw - 390px))!important;max-width:800px!important;max-height:calc(100vh - 72px)!important;padding:18px!important}
  .modal-card.finance-form-modal{width:min(700px,calc(100vw - 410px))!important;max-width:700px!important;max-height:calc(100vh - 72px)!important;padding:18px!important}
  .modal.invoice-modal-open{padding-left:205px!important;padding-right:44px!important}
}
.modal-card.client-detail-modal .client-profile-grid{gap:10px!important}
.modal-card.client-detail-modal .card{padding:13px!important}
.modal-card.job-detail-modal .detail-grid{gap:8px 10px!important}
.modal-card.finance-form-modal .form-grid{gap:8px 12px!important}
#aoc-action-portal{min-width:148px!important;max-width:210px!important;padding:5px!important}
#aoc-action-portal button{padding:8px 10px!important;font-size:.88rem!important}

/* A paginação permanece visível e o FAB não bloqueia Anterior/Próxima. */
#content:has(.pagination){padding-bottom:84px!important}
#content:has(.pagination) .fab{bottom:78px!important;right:30px!important}
#content:has(.pagination) .pagination{display:flex!important;visibility:visible!important;min-height:46px!important;background:var(--bg)!important;position:relative!important;z-index:3!important}
.clients-table{max-height:286px!important}
.billing-table{max-height:292px!important;overflow:auto!important}
.finance-table{height:auto!important;max-height:236px!important;min-height:220px!important}
.finance-table tbody tr{height:38px!important}
.finance-table th,.finance-table td{padding-top:5px!important;padding-bottom:5px!important}
@media(max-height:720px){
  .clients-table,.billing-table{max-height:250px!important}
  .finance-table{max-height:214px!important;min-height:200px!important}
}


/* RC3.3.14 — Configurações: restaura rolagem vertical da página sem afetar tabelas e Agenda */
main#content.settings-scroll-page{
  display:block!important;
  height:100vh!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  padding-bottom:34px!important;
  overscroll-behavior-y:contain;
  -webkit-overflow-scrolling:touch;
}
main#content.settings-scroll-page>.page-head-primary{
  position:relative!important;
  flex:none!important;
}
main#content.settings-scroll-page>.config-page{
  display:block!important;
  min-height:max-content!important;
  overflow:visible!important;
  padding-bottom:48px!important;
}
main#content.settings-scroll-page .card,
main#content.settings-scroll-page .domain-grid{
  overflow:visible;
}
body.settings-page-active .collapse-handle{position:fixed!important;}

/* RC3.3.15 — Clientes: cinco registros úteis e modal Detalhar proporcional */
/* Mantém paginação visível, mas devolve altura suficiente para cinco linhas no Chromebook. */
.clients-table{
  max-height:326px!important;
  min-height:0!important;
  overflow:auto!important;
}
.clients-table thead tr{height:34px!important}
.clients-table tbody tr{height:49px!important}
.clients-table th,.clients-table td{
  padding-top:7px!important;
  padding-bottom:7px!important;
  line-height:1.15!important;
}

/* Modal de detalhe do cliente: tamanho intermediário, centralizado na área útil e com rolagem interna. */
@media (min-width:851px){
  .modal-card.client-detail-modal{
    width:min(760px,calc(100vw - 430px))!important;
    max-width:760px!important;
    max-height:calc(100vh - 92px)!important;
    padding:18px!important;
    margin-left:130px!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
  }
  .modal-card.client-detail-modal .client-profile-grid{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:10px!important;
  }
  .modal-card.client-detail-modal .card{padding:12px!important}
}
@media (max-width:1100px) and (min-width:851px){
  .modal-card.client-detail-modal{
    width:min(720px,calc(100vw - 360px))!important;
    margin-left:96px!important;
  }
}
@media (max-height:720px){
  .clients-table{max-height:292px!important}
  .modal-card.client-detail-modal{max-height:calc(100vh - 54px)!important}
}

/* RC3.3.16 — Clientes: aproveitamento real da altura e histórico sem rolagem horizontal */
/* A tabela principal ocupa toda a altura livre entre KPIs e paginação. */
#content:has(.clients-table){padding-bottom:10px!important}
#content:has(.clients-table) .client-kpis{flex:0 0 auto!important;margin-bottom:10px!important}
#content:has(.clients-table) .clients-table{
  flex:1 1 auto!important;
  height:auto!important;
  min-height:255px!important;
  max-height:none!important;
  overflow:auto!important;
}
#content:has(.clients-table) .clients-table tbody tr{height:49px!important}
#content:has(.clients-table) .pagination{flex:0 0 auto!important;padding:9px 10px!important;min-height:44px!important}

/* Histórico do cliente: colunas proporcionais dentro do modal, sem barra lateral. */
.modal-card.client-detail-modal .table-wrap{
  width:100%!important;
  max-width:100%!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
}
.modal-card.client-detail-modal .table-wrap table{
  width:100%!important;
  min-width:0!important;
  table-layout:fixed!important;
}
.modal-card.client-detail-modal .table-wrap th,
.modal-card.client-detail-modal .table-wrap td{
  padding:7px 8px!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.modal-card.client-detail-modal .table-wrap th:nth-child(1),
.modal-card.client-detail-modal .table-wrap td:nth-child(1){width:20%!important}
.modal-card.client-detail-modal .table-wrap th:nth-child(2),
.modal-card.client-detail-modal .table-wrap td:nth-child(2){width:11%!important}
.modal-card.client-detail-modal .table-wrap th:nth-child(3),
.modal-card.client-detail-modal .table-wrap td:nth-child(3){width:15%!important}
.modal-card.client-detail-modal .table-wrap th:nth-child(4),
.modal-card.client-detail-modal .table-wrap td:nth-child(4){width:18%!important}
.modal-card.client-detail-modal .table-wrap th:nth-child(5),
.modal-card.client-detail-modal .table-wrap td:nth-child(5){width:14%!important}
.modal-card.client-detail-modal .table-wrap th:nth-child(6),
.modal-card.client-detail-modal .table-wrap td:nth-child(6){width:14%!important}
.modal-card.client-detail-modal .table-wrap th:nth-child(7),
.modal-card.client-detail-modal .table-wrap td:nth-child(7){width:8%!important;text-align:center!important}
.modal-card.client-detail-modal .table-wrap td:nth-child(7) .btn{
  padding:6px 8px!important;
  min-width:0!important;
  font-size:.82rem!important;
}

/* RC3.3.17 — Jobs: modal proporcional e uso integral da altura do grid */
/* O módulo Jobs passa a usar a mesma geometria equilibrada já homologada em Clientes. */
@media (min-width:851px){
  .modal-card.job-detail-modal{
    width:min(760px,calc(100vw - 430px))!important;
    max-width:760px!important;
    max-height:calc(100vh - 92px)!important;
    padding:18px!important;
    margin-left:130px!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
  }
  .modal-card.job-detail-modal .detail-grid{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:9px 10px!important;
  }
  .modal-card.job-detail-modal .detail-grid>p{
    padding:10px 12px!important;
    margin:0!important;
    min-height:48px!important;
  }
  .modal-card.job-detail-modal .table-wrap{
    width:100%!important;
    max-width:100%!important;
    overflow-x:auto!important;
  }
}
@media (max-width:1100px) and (min-width:851px){
  .modal-card.job-detail-modal{
    width:min(720px,calc(100vw - 360px))!important;
    margin-left:96px!important;
  }
}
@media (max-height:720px){
  .modal-card.job-detail-modal{max-height:calc(100vh - 54px)!important}
}

/* O grid principal ocupa a altura livre real entre filtros e paginação. */
#content:has(.job-table){
  display:flex!important;
  flex-direction:column!important;
  height:calc(100vh - 118px)!important;
  min-height:0!important;
  padding-bottom:10px!important;
  overflow:hidden!important;
}
#content:has(.job-table)>.page-head,
#content:has(.job-table)>.toolbar{
  flex:0 0 auto!important;
}
#content:has(.job-table)>.toolbar{margin:8px 0!important}
#content:has(.job-table) .job-table{
  flex:1 1 auto!important;
  height:auto!important;
  min-height:284px!important;
  max-height:none!important;
  overflow:auto!important;
}
#content:has(.job-table) .job-table thead tr{height:34px!important}
#content:has(.job-table) .job-table tbody tr{height:49px!important}
#content:has(.job-table) .job-table th,
#content:has(.job-table) .job-table td{
  padding-top:7px!important;
  padding-bottom:7px!important;
  line-height:1.15!important;
}
#content:has(.job-table) .pagination{
  flex:0 0 auto!important;
  min-height:44px!important;
  padding:9px 10px!important;
}
#content:has(.job-table) .fab{bottom:78px!important}

/* RC3.3.18 — Jobs: restauração exata da altura homologada do grid */
/* Referência visual: RC3.3.0. Cinco linhas completas + paginação no viewport do Chromebook. */
#content:has(.job-table){
  height:calc(100vh - 118px)!important;
  min-height:0!important;
  overflow:hidden!important;
}
#content:has(.job-table) .job-table{
  flex:0 0 315px!important;
  height:315px!important;
  min-height:315px!important;
  max-height:315px!important;
  overflow:auto!important;
}
#content:has(.job-table) .job-table thead tr{height:32px!important}
#content:has(.job-table) .job-table tbody tr{height:56px!important}
#content:has(.job-table) .pagination{
  display:flex!important;
  visibility:visible!important;
  flex:0 0 46px!important;
  min-height:46px!important;
  padding:8px 10px!important;
}
#content:has(.job-table) .fab{bottom:78px!important}
@media(max-height:730px) and (min-width:851px){
  #content:has(.job-table) .job-table{
    flex-basis:300px!important;
    height:300px!important;
    min-height:300px!important;
    max-height:300px!important;
  }
  #content:has(.job-table) .job-table tbody tr{height:53px!important}
}

/* RC3.3.19 — Jobs: restauração estrutural do grid homologado */
/*
 * O módulo volta ao fluxo vertical estável da RC3.3.0:
 * filtros e paginação têm altura natural; somente o grid ocupa o espaço restante.
 * Remove os limites fixos introduzidos nas RC3.3.17/18 que cortavam a quinta linha
 * e empurravam a paginação para fora do viewport.
 */
#content:has(> .job-table){
  display:flex!important;
  flex-direction:column!important;
  height:100vh!important;
  min-height:0!important;
  overflow:hidden!important;
  padding-bottom:18px!important;
}
#content:has(> .job-table)> .page-head-primary,
#content:has(> .job-table)> .toolbar,
#content:has(> .job-table)> .pagination{
  flex:0 0 auto!important;
}
#content:has(> .job-table)> .job-table{
  flex:1 1 auto!important;
  height:auto!important;
  min-height:180px!important;
  max-height:none!important;
  overflow:auto!important;
}
#content:has(> .job-table)> .job-table thead tr{height:auto!important}
#content:has(> .job-table)> .job-table tbody tr{height:38px!important}
#content:has(> .job-table)> .job-table th,
#content:has(> .job-table)> .job-table td{
  padding:7px 9px!important;
  line-height:1.15!important;
}
#content:has(> .job-table)> .pagination{
  display:flex!important;
  visibility:visible!important;
  min-height:46px!important;
  padding:7px 9px!important;
  background:var(--bg)!important;
  position:relative!important;
  z-index:3!important;
}
#content:has(> .job-table)> .fab{
  bottom:28px!important;
  right:28px!important;
}

/* RC3.3.20 — Jobs: FAB afastado da paginação */
#content:has(> .job-table)> .fab{
  bottom:86px!important;
  right:28px!important;
}

/* RC3.3.21 — Faturamento: grid ocupa a altura útil e mantém paginação visível */
/* Replica no Faturamento a estrutura vertical homologada no módulo Jobs. */
#content:has(> .billing-grid){
  display:flex!important;
  flex-direction:column!important;
  height:100vh!important;
  min-height:0!important;
  overflow:hidden!important;
  padding-bottom:18px!important;
}
#content:has(> .billing-grid)> .page-head-primary,
#content:has(> .billing-grid)> .billing-kpis,
#content:has(> .billing-grid)> .billing-quick-toolbar,
#content:has(> .billing-grid)> .billing-filter-card,
#content:has(> .billing-grid)> .pagination{
  flex:0 0 auto!important;
}
#content:has(> .billing-grid)> .billing-kpis{
  margin-bottom:8px!important;
}
#content:has(> .billing-grid)> .billing-quick-toolbar{
  margin:2px 0 7px!important;
}
#content:has(> .billing-grid)> .billing-grid{
  flex:1 1 auto!important;
  height:auto!important;
  min-height:245px!important;
  max-height:none!important;
  overflow:auto!important;
}
#content:has(> .billing-grid)> .billing-grid .billing-grid-body{
  overflow:visible!important;
  height:auto!important;
  min-height:0!important;
}
#content:has(> .billing-grid)> .billing-grid .billing-grid-row{
  min-height:49px!important;
}
#content:has(> .billing-grid)> .pagination{
  display:flex!important;
  visibility:visible!important;
  min-height:46px!important;
  padding:7px 9px!important;
  background:var(--bg)!important;
  position:relative!important;
  z-index:3!important;
}


/* RC3.3.22 — Faturamento/Ver Job: Equipe do Job sem rolagem horizontal */
.modal-card.job-detail-modal .job-team-detail-table{
  width:100%!important;
  max-width:100%!important;
  overflow-x:hidden!important;
}
.modal-card.job-detail-modal .job-team-detail-table table{
  width:100%!important;
  min-width:0!important;
  table-layout:fixed!important;
}
.modal-card.job-detail-modal .job-team-detail-table th,
.modal-card.job-detail-modal .job-team-detail-table td{
  padding:8px 7px!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.modal-card.job-detail-modal .job-team-detail-table th:nth-child(1),
.modal-card.job-detail-modal .job-team-detail-table td:nth-child(1){width:11%!important}
.modal-card.job-detail-modal .job-team-detail-table th:nth-child(2),
.modal-card.job-detail-modal .job-team-detail-table td:nth-child(2){width:18%!important}
.modal-card.job-detail-modal .job-team-detail-table th:nth-child(3),
.modal-card.job-detail-modal .job-team-detail-table td:nth-child(3){width:22%!important}
.modal-card.job-detail-modal .job-team-detail-table th:nth-child(4),
.modal-card.job-detail-modal .job-team-detail-table td:nth-child(4){width:12%!important}
.modal-card.job-detail-modal .job-team-detail-table th:nth-child(5),
.modal-card.job-detail-modal .job-team-detail-table td:nth-child(5){width:20%!important}
.modal-card.job-detail-modal .job-team-detail-table th:nth-child(6),
.modal-card.job-detail-modal .job-team-detail-table td:nth-child(6){width:17%!important;text-align:center!important}
@media(max-width:850px){
  .modal-card.job-detail-modal .job-team-detail-table{overflow-x:auto!important}
  .modal-card.job-detail-modal .job-team-detail-table table{min-width:640px!important;table-layout:auto!important}
}

/* RC3.3.23 — Padronização localizada dos modais do sprint */
/* Formulário de Job aberto por Clientes ou Jobs: tamanho médio, duas colunas e rolagem interna. */
#modal .modal-card.job-form-modal{
  width:min(820px,calc(100vw - 330px))!important;
  max-width:820px!important;
  max-height:calc(100vh - 56px)!important;
  padding:20px!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
}
#modal .modal-card.job-form-modal #jobForm>.form-grid,
#modal .modal-card.job-form-modal #jobForm .form-grid{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:9px 13px!important;
}
#modal .modal-card.job-form-modal .team-card{
  padding:14px!important;
}
#modal .modal-card.job-form-modal .field{
  margin:8px 0!important;
}

/* Cancelar Job, Estornar e Cancelar lançamento: modal pequeno e objetivo. */
#modal .modal-card.reason-modal,
#modal .modal-card.compact.reason-modal{
  width:min(460px,calc(100vw - 48px))!important;
  max-width:460px!important;
  max-height:min(430px,calc(100vh - 72px))!important;
  padding:22px!important;
  overflow:auto!important;
}
#modal .modal-card.reason-modal h2{margin:0 36px 12px 0!important}
#modal .modal-card.reason-modal .field{margin:8px 0 14px!important}
#modal .modal-card.reason-modal textarea{
  min-height:110px!important;
  max-height:180px!important;
  resize:vertical!important;
}
#modal .modal-card.reason-modal .actions{
  justify-content:flex-end!important;
  margin-top:12px!important;
}

/* Confirmações simples permanecem compactas e centralizadas. */
.confirm-overlay .confirm-card{
  width:min(460px,calc(100vw - 48px))!important;
  max-width:460px!important;
  padding:22px!important;
}

@media(max-width:900px){
  #modal .modal-card.job-form-modal{
    width:calc(100vw - 28px)!important;
    max-height:calc(100vh - 28px)!important;
    padding:16px!important;
  }
  #modal .modal-card.job-form-modal #jobForm>.form-grid,
  #modal .modal-card.job-form-modal #jobForm .form-grid{
    grid-template-columns:1fr!important;
  }
}

/* RC3.3.24 — Clientes > Criar novo Job: modal médio e proporcional */
@media (min-width:901px){
  #modal .modal-card.job-form-modal{
    width:min(720px,calc(100vw - 420px))!important;
    max-width:720px!important;
    max-height:calc(100vh - 84px)!important;
    padding:18px 20px!important;
    overflow:hidden!important;
    display:flex!important;
    flex-direction:column!important;
  }
  #modal .modal-card.job-form-modal #modalBody{
    min-height:0!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    padding-right:4px!important;
  }
  #modal .modal-card.job-form-modal h2{
    margin:0 40px 10px 0!important;
    font-size:1.45rem!important;
  }
  #modal .modal-card.job-form-modal #jobForm>.form-grid,
  #modal .modal-card.job-form-modal #jobForm .form-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px 12px!important;
  }
  #modal .modal-card.job-form-modal .field{
    margin:6px 0!important;
  }
  #modal .modal-card.job-form-modal .field input,
  #modal .modal-card.job-form-modal .field select,
  #modal .modal-card.job-form-modal .field textarea{
    padding:9px 10px!important;
  }
  #modal .modal-card.job-form-modal .actions{
    position:sticky!important;
    bottom:0!important;
    background:#fff!important;
    padding-top:10px!important;
    margin-top:8px!important;
    z-index:2!important;
  }
}

/* RC3.3.25 — Fluxo: indicadores no topo e ação principal junto aos filtros */
/* Ajuste estritamente isolado ao módulo Fluxo de Caixa. */
#content:has(> .finance-kpis){
  display:flex!important;
  flex-direction:column!important;
  height:100vh!important;
  min-height:0!important;
  overflow:hidden!important;
  padding-bottom:18px!important;
}
#content:has(> .finance-kpis)> .page-head-primary,
#content:has(> .finance-kpis)> .finance-kpis,
#content:has(> .finance-kpis)> .finance-controls-row,
#content:has(> .finance-kpis)> .pagination{
  flex:0 0 auto!important;
}
#content:has(> .finance-kpis)> .page-head-primary{
  margin-bottom:8px!important;
}
#content:has(> .finance-kpis)> .finance-kpis{
  order:1!important;
  margin:0 0 10px!important;
}
.finance-controls-row{
  order:2!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:12px!important;
  width:100%!important;
  margin:0 0 8px!important;
  min-height:38px!important;
}
.finance-controls-row>.toolbar.filters{
  display:flex!important;
  flex:1 1 auto!important;
  align-items:center!important;
  gap:8px!important;
  margin:0!important;
  min-width:0!important;
}
.finance-controls-row>#newFinance{
  flex:0 0 auto!important;
  position:static!important;
  inset:auto!important;
  margin:0!important;
  transform:none!important;
  white-space:nowrap!important;
  z-index:2!important;
}
#content:has(> .finance-kpis)> .finance-table{
  order:3!important;
  flex:1 1 auto!important;
  height:auto!important;
  min-height:210px!important;
  max-height:none!important;
  overflow:auto!important;
}
#content:has(> .finance-kpis)> .pagination{
  order:4!important;
  display:flex!important;
  visibility:visible!important;
  min-height:46px!important;
  padding:7px 9px!important;
  margin:0!important;
  background:var(--bg)!important;
  position:relative!important;
  z-index:3!important;
}
#content:has(> .finance-kpis)> .fab{
  bottom:86px!important;
  right:28px!important;
}
@media(max-width:760px){
  .finance-controls-row{align-items:stretch!important;flex-direction:column!important}
  .finance-controls-row>.toolbar.filters{width:100%!important;flex-wrap:wrap!important}
  .finance-controls-row>#newFinance{align-self:flex-end!important}
}

/* RC3.3.26 — ajustes isolados do sprint */
@media (min-width:901px){
  /* Clientes: pequeno afastamento visual da barra lateral. */
  #modal .modal-card.client-form-modal{
    transform:translateX(28px)!important;
  }

  /* Jobs: rolagem apenas no conteúdo, afastada do botão X. */
  #modal .modal-card.job-form-modal{
    overflow:hidden!important;
  }
  #modal .modal-card.job-form-modal #modalBody{
    width:calc(100% - 14px)!important;
    margin-right:14px!important;
    padding-right:8px!important;
    scrollbar-gutter:stable!important;
  }
  #modal .modal-card.job-form-modal #modalClose{
    z-index:20!important;
    background:#fff!important;
    border-radius:999px!important;
    width:34px!important;
    height:34px!important;
  }
}

/* Fluxo: menu de uma ação com tamanho coerente e texto claro. */
#aoc-action-portal.finance-action-portal{
  min-width:176px!important;
  width:max-content!important;
  max-width:240px!important;
  padding:5px!important;
  gap:2px!important;
}
#aoc-action-portal.finance-action-portal.single-action{
  min-width:176px!important;
}
#aoc-action-portal.finance-action-portal button{
  width:100%!important;
  min-height:34px!important;
  padding:7px 10px!important;
  margin:0!important;
  white-space:nowrap!important;
  text-align:left!important;
}

/* Invoice/Receipt: ação de atualização sem quebrar o rodapé. */
.invoice-actions #refreshCompanyData{
  white-space:nowrap!important;
}

/* RC3.3.27 — Invoice profissional: cliente único, itens e resumo financeiro */
.invoice-company-address{margin-top:8px!important}
.invoice-company-contact{margin-top:5px!important}
.invoice-client-section{display:flex;flex-direction:column;gap:4px;padding:16px 28px;background:#fbfbfc;border-top:3px solid #f28c18;border-bottom:1px solid #edf1f4}
.invoice-client-section small,.invoice-observations small{font-size:.72rem;font-weight:900;letter-spacing:.07em;color:#667784}
.invoice-client-section b{font-size:1rem}
.invoice-client-section span{color:#52606d}
.invoice-service-head,.invoice-service-row{grid-template-columns:52px minmax(220px,1fr) 105px 64px 112px!important;gap:12px!important}
.invoice-service-head span:first-child,.invoice-service-row>.invoice-item-number{text-align:center!important}
.invoice-item-number{font-weight:800;color:#344054!important}
.invoice-observations{margin:0 28px 22px;padding:14px 0 0;border-top:1px solid #dfe3e8}
.invoice-observations p{margin:6px 0 0;font-size:.84rem;line-height:1.45;color:#59636e}
@media(max-width:1050px){.invoice-service-head,.invoice-service-row{grid-template-columns:44px minmax(170px,1fr) 88px 52px 92px!important;gap:8px!important}}
@media(max-width:680px){.invoice-service-head,.invoice-service-row{grid-template-columns:38px 1fr 84px!important}.invoice-service-head span:nth-child(3),.invoice-service-head span:nth-child(4),.invoice-service-row>span:nth-child(3),.invoice-service-row>span:nth-child(4){display:none}.invoice-client-section{padding:14px 18px}.invoice-observations{margin:0 18px 18px}}

/* RC3.3.28 — Invoice restaurada e navegação horizontal do Faturamento */
.invoice-restored-footer{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin-top:14px;
  padding-top:14px;
  border-top:1px solid #e7ebf0;
}
.invoice-restored-footer>div{
  min-width:0;
  padding:11px 12px;
  background:#f8fafc;
  border:1px solid #e7ebf0;
  border-radius:9px;
}
.invoice-restored-footer small{display:block;font-size:.66rem;font-weight:800;letter-spacing:.06em;color:#667085;margin-bottom:5px}
.invoice-restored-footer p{margin:0;font-size:.76rem;line-height:1.45;color:#344054}
.billing-grid[data-mouse-drag3328="1"]{cursor:grab;user-select:none}
.billing-grid.billing-dragging{cursor:grabbing!important;scroll-behavior:auto!important}
.billing-grid.billing-dragging *{cursor:grabbing!important}
.billing-grid button,.billing-grid a,.billing-grid input,.billing-grid select,.billing-grid textarea{user-select:auto}
@media(max-width:680px){.invoice-restored-footer{grid-template-columns:1fr}}

/* RC3.3.29 — Invoice consolidada conforme homologação */
.invoice-brand-block>div{display:flex;flex-direction:column;align-items:flex-start;gap:0}
.invoice-brand-block h3{margin:0 0 8px;font-size:1.28rem}
.invoice-brand-block p{display:block;margin:3px 0;line-height:1.35;color:#52606d}
.invoice-restored-footer{margin:0 28px 22px;padding-top:14px;border-top:1px solid #dfe3e8;display:grid;grid-template-columns:1fr 1fr;gap:24px}
.invoice-restored-footer small{font-size:.72rem;font-weight:900;letter-spacing:.07em;color:#667784}
.invoice-restored-footer p{margin:6px 0 0;font-size:.84rem;line-height:1.45;color:#59636e}
.receipt-document .invoice-payment-info{grid-template-columns:1fr}
@media(max-width:680px){.invoice-restored-footer{grid-template-columns:1fr;margin:0 18px 18px}}

/* RC3.3.30 — Terms & Conditions claramente visível na Invoice */
.invoice-restored-footer{
  grid-template-columns:1fr!important;
  gap:14px!important;
  border-top:1px solid #dfe3e8;
}
.invoice-restored-footer>div{
  display:block!important;
  padding:14px 16px!important;
  border:1px solid #dfe3e8!important;
  border-radius:10px!important;
  background:#fafbfc!important;
}
.invoice-terms-restored small{
  display:block!important;
  font-size:.76rem!important;
  font-weight:900!important;
  letter-spacing:.08em!important;
  color:#344054!important;
  margin-bottom:7px!important;
}
.invoice-terms-restored p{
  display:block!important;
  margin:0!important;
  min-height:20px;
  font-size:.86rem!important;
  line-height:1.5!important;
  color:#344054!important;
  white-space:pre-line;
}

/* RC3.4.0 — Fase 3.1: painel de saúde da integração */
.integration-health-card{margin-bottom:18px;padding:18px}.integration-health-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:14px}.integration-health-head h3{margin:0 0 4px}.integration-health-head p{margin:0;color:var(--muted)}.integration-event-list{display:grid;gap:8px;margin-top:14px}.integration-event-list>div{display:grid;grid-template-columns:minmax(120px,.5fr) minmax(240px,2fr) auto;gap:12px;align-items:center;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:var(--panel)}.integration-event-list span{color:var(--text)}.integration-event-list small{color:var(--muted);white-space:nowrap}@media(max-width:760px){.integration-health-head{flex-direction:column}.integration-event-list>div{grid-template-columns:1fr}.integration-event-list small{white-space:normal}}

/* RC3.5.0 — Dashboard Executivo modular */
.dashboard-toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:16px;padding:10px 12px;background:#fff;border:1px solid var(--border);border-radius:14px}.dashboard-toolbar label{display:flex;align-items:center;gap:8px;font-size:.82rem;font-weight:800;color:var(--muted)}.dashboard-toolbar input{width:150px;padding:8px 10px}.dashboard-tabs{display:flex;gap:6px;flex-wrap:wrap}.dashboard-tabs button{border:0;background:#edf2f6;color:var(--navy);padding:9px 13px;border-radius:9px;font-weight:800;cursor:pointer}.dashboard-tabs button.active{background:var(--navy);color:#fff}.executive-kpis{display:grid;grid-template-columns:repeat(4,minmax(170px,1fr));gap:12px;margin-bottom:16px}.executive-kpi{min-height:122px;text-align:left;border:1px solid var(--border);border-top:4px solid #94a3b8;border-radius:14px;background:#fff;padding:16px;cursor:pointer;display:flex;flex-direction:column;align-items:flex-start;box-shadow:0 8px 22px rgba(15,23,42,.04)}.executive-kpi:hover{transform:translateY(-1px);box-shadow:0 10px 26px rgba(15,23,42,.08)}.executive-kpi small{font-weight:800;color:var(--muted);text-transform:uppercase;letter-spacing:.035em}.executive-kpi strong{font-size:1.72rem;color:var(--navy);margin:9px 0 5px;line-height:1.05}.executive-kpi span{font-size:.78rem;color:var(--muted);line-height:1.3}.executive-kpi.good{border-top-color:#16a34a}.executive-kpi.danger{border-top-color:#dc2626;background:#fffafa}.attention-center{background:#0f2940;color:#fff;border-radius:16px;padding:18px;margin-bottom:16px}.attention-center .section-title{margin-bottom:13px}.attention-center .section-title small{font-size:.72rem;letter-spacing:.12em;color:#9dd8ff;font-weight:900}.attention-center h2{margin:3px 0 0;color:#fff}.attention-center .section-title>span{background:rgba(255,255,255,.12);padding:6px 10px;border-radius:999px;font-size:.78rem}.attention-grid{display:grid;grid-template-columns:repeat(2,minmax(250px,1fr));gap:9px}.attention-item{border:1px solid rgba(255,255,255,.12);background:rgba(255,255,255,.07);color:#fff;border-radius:11px;padding:12px;display:grid;grid-template-columns:8px 1fr auto;gap:11px;align-items:center;text-align:left;cursor:pointer}.attention-item i{width:8px;height:36px;border-radius:8px;background:#94a3b8}.attention-item.critical i{background:#fb7185}.attention-item.warning i{background:#fbbf24}.attention-item.success i{background:#4ade80}.attention-item div{display:flex;flex-direction:column;gap:3px}.attention-item span{font-size:.78rem;color:#cbd5e1}.attention-item>strong{font-size:1.35rem}.dashboard-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.dashboard-panel{background:#fff;border:1px solid var(--border);border-radius:14px;padding:16px;min-width:0}.dashboard-panel h2{margin:0 0 14px;font-size:1.03rem}.section-title{display:flex;align-items:center;justify-content:space-between;gap:12px}.section-title button{border:0;background:transparent;color:var(--primary);font-weight:800;cursor:pointer}.ranking-bars{display:grid;gap:13px}.ranking-bars>div>span{display:flex;justify-content:space-between;gap:12px;margin-bottom:6px}.ranking-bars b{font-size:.86rem}.ranking-bars em{font-size:.76rem;color:var(--muted);font-style:normal}.ranking-bars i{display:block;height:8px;border-radius:99px;background:#e8eef3;overflow:hidden}.ranking-bars u{display:block;height:100%;background:#1c6b87;border-radius:99px;text-decoration:none}.team-performance{display:grid;gap:5px}.team-performance>div{display:flex;justify-content:space-between;align-items:center;padding:10px 0;border-bottom:1px solid #edf1f4}.team-performance span{display:flex;flex-direction:column}.team-performance small{color:var(--muted);margin-top:2px}.agenda-line{width:100%;display:grid;grid-template-columns:60px 1fr auto;gap:10px;align-items:center;border:0;border-bottom:1px solid #edf1f4;background:transparent;padding:11px 3px;text-align:left;cursor:pointer}.agenda-line time{font-weight:900;color:var(--primary)}.agenda-line div{display:flex;flex-direction:column}.agenda-line span{font-size:.78rem;color:var(--muted)}.agenda-line em{font-style:normal;font-size:.75rem;background:#edf2f6;padding:5px 8px;border-radius:999px}.metric-list{display:grid;gap:2px}.metric-list>div,.cash-waterfall>div{display:flex;justify-content:space-between;gap:14px;padding:11px 0;border-bottom:1px solid #edf1f4}.cash-waterfall .total{margin-top:5px;border-top:2px solid var(--navy);font-size:1.03rem}.dashboard-note,.dashboard-criteria{font-size:.79rem;line-height:1.45;color:var(--muted);background:#f5f8fa;border-radius:10px;padding:11px;margin-top:12px}.dashboard-criteria{margin-top:16px;border:1px solid var(--border)}.dashboard-empty{padding:26px 10px;text-align:center;color:var(--muted)}
@media(max-width:1100px){.executive-kpis{grid-template-columns:repeat(2,minmax(170px,1fr))}}@media(max-width:760px){.dashboard-toolbar{align-items:stretch;flex-direction:column}.dashboard-toolbar label{justify-content:space-between}.dashboard-columns,.attention-grid{grid-template-columns:1fr}.executive-kpis{grid-template-columns:1fr}.ranking-bars>div>span{flex-direction:column;gap:2px}.agenda-line{grid-template-columns:52px 1fr}.agenda-line em{grid-column:2}}

/* RC3.5.1 — Correções de homologação: rolagem, Centro de Atenção e cursores */
body.dashboard-page-active main#content,
main#content.dashboard-scroll-page{
  display:block!important;
  height:100vh!important;
  min-height:0!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  overscroll-behavior-y:contain;
  touch-action:pan-y;
  -webkit-overflow-scrolling:touch;
  padding-bottom:42px!important;
  cursor:grab;
}
main#content.dashboard-scroll-page.grab-scrolling{
  cursor:grabbing!important;
  user-select:none!important;
}
main#content.dashboard-scroll-page button,
main#content.dashboard-scroll-page input,
main#content.dashboard-scroll-page select,
main#content.dashboard-scroll-page textarea,
main#content.dashboard-scroll-page a{
  cursor:pointer;
}
main#content.dashboard-scroll-page input,
main#content.dashboard-scroll-page select,
main#content.dashboard-scroll-page textarea{
  cursor:auto;
}
.attention-item{transition:transform .15s ease,background .15s ease,border-color .15s ease}
.attention-item:hover,.attention-item:focus-visible{background:rgba(255,255,255,.14);border-color:rgba(255,255,255,.28);transform:translateY(-1px);outline:none}
.attention-item:active{transform:translateY(0)}
.attention-item>strong{transition:transform .15s ease}.attention-item:hover>strong{transform:translateX(3px)}

/* Módulos com navegação por arraste: mão aberta/fechada somente na área rolável. */
#content .table-wrap[data-robust-grab-bound="1"],
#content .finance-table[data-robust-grab-bound="1"],
#content .job-table[data-robust-grab-bound="1"]{
  cursor:grab!important;
}
#content .table-wrap[data-robust-grab-bound="1"].grab-scrolling,
#content .finance-table[data-robust-grab-bound="1"].grab-scrolling,
#content .job-table[data-robust-grab-bound="1"].grab-scrolling{
  cursor:grabbing!important;
  user-select:none!important;
}
#content .table-wrap[data-robust-grab-bound="1"] button,
#content .table-wrap[data-robust-grab-bound="1"] a,
#content .table-wrap[data-robust-grab-bound="1"] input,
#content .table-wrap[data-robust-grab-bound="1"] select,
#content .table-wrap[data-robust-grab-bound="1"] textarea,
#content .finance-table[data-robust-grab-bound="1"] button,
#content .job-table[data-robust-grab-bound="1"] button{cursor:pointer!important}

/* Faturamento: arraste bidirecional e diagonal dentro do grid. */
#content:has(> .billing-grid)> .billing-grid{
  overflow:auto!important;
  touch-action:pan-x pan-y!important;
  overscroll-behavior:contain!important;
  cursor:grab!important;
}
.billing-grid.billing-drag-ready{cursor:grab!important}
.billing-grid.billing-dragging{cursor:grabbing!important;user-select:none!important}
.billing-grid.billing-dragging *{cursor:grabbing!important}
.billing-grid button,.billing-grid a,.billing-grid input,.billing-grid select,.billing-grid textarea{cursor:pointer;user-select:auto}

/* RC3.5.3 — Seletor de período do Dashboard usando o mini-calendário homologado da Agenda. */
.dashboard-period-control{position:relative!important;display:flex!important;align-items:center!important;gap:8px!important}
.dashboard-period-trigger{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:184px;border:1px solid var(--border);background:#fff;color:var(--navy);padding:8px 10px;border-radius:9px;font-weight:800;cursor:pointer;text-transform:capitalize}
.dashboard-period-trigger:hover,.dashboard-period-trigger[aria-expanded="true"]{border-color:#2f6fed;box-shadow:0 0 0 3px rgba(47,111,237,.10)}
.dashboard-calendar-popover{position:absolute;right:0;top:calc(100% + 8px);z-index:150;width:238px;padding:14px;background:#fff;border:1px solid var(--border);border-radius:14px;box-shadow:0 18px 42px rgba(15,23,42,.18)}
.dashboard-calendar-popover[hidden]{display:none!important}
.dashboard-mini-calendar .mini-calendar-title{grid-template-columns:28px minmax(0,1fr) 28px!important}
.dashboard-mini-calendar .mini-month-year-button{width:100%;min-width:0;font-size:.82rem!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dashboard-mini-calendar .mini-grid button{height:28px}
@media(max-width:760px){.dashboard-period-control{align-items:stretch!important;flex-direction:column!important}.dashboard-period-trigger{width:100%}.dashboard-calendar-popover{left:0;right:auto;width:min(238px,calc(100vw - 48px))}}

/* RC3.5.4 — diagnóstico do módulo Auditoria */
.integration-diagnostic{display:flex;flex-direction:column;gap:4px;margin:16px 0;padding:14px 16px;border-radius:12px;border:1px solid #cbd5e1;background:#f8fafc}
.integration-diagnostic.is-ok{border-color:#86efac;background:#f0fdf4}
.integration-diagnostic.has-issues{border-color:#fbbf24;background:#fffbeb}
.integration-diagnostic span,.integration-issues span{color:#64748b;font-size:13px}
.integration-issues{display:grid;gap:8px;margin-bottom:16px}
.integration-issues>div{display:flex;flex-direction:column;gap:3px;padding:10px 12px;border-left:4px solid #ef4444;background:#fff;border-radius:8px}

/* RC3.5.5 — ação gerencial e relatório da sincronização */
.integration-action-box{display:flex;flex-direction:column;align-items:flex-end;gap:6px;max-width:360px}
.integration-action-box small{color:#64748b;font-size:12px;line-height:1.35;text-align:right}
.integration-issues>div{position:relative;padding-right:132px}
.audit-fix-btn{position:absolute;right:10px;top:50%;transform:translateY(-50%);white-space:nowrap}
.audit-report-summary{display:flex;flex-direction:column;gap:4px;padding:14px 16px;border-radius:12px;margin:14px 0}
.audit-report-summary.is-ok{background:#f0fdf4;border:1px solid #86efac}
.audit-report-summary.has-issues{background:#fffbeb;border:1px solid #fbbf24}
.audit-report-summary span{color:#64748b;font-size:13px}
.audit-report-section{margin-top:18px}
.audit-report-section h3{margin:0 0 10px;color:var(--navy)}
.audit-check-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.audit-check-grid>div,.audit-report-list>div{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border:1px solid var(--border);border-radius:9px;background:#fff}
.audit-check-grid span{font-weight:700}.audit-check-grid b{font-size:13px;color:#64748b}
.audit-report-list{display:grid;gap:8px}
.audit-report-list>div{align-items:flex-start;flex-wrap:wrap}
.audit-report-list>div span{flex:1;min-width:220px;color:#64748b;font-size:13px}
.audit-report-list.human>div{border-left:4px solid #ef4444}
@media(max-width:760px){.integration-health-head{align-items:stretch!important;flex-direction:column}.integration-action-box{align-items:stretch;max-width:none}.integration-action-box small{text-align:left}.integration-issues>div{padding-right:12px}.audit-fix-btn{position:static;transform:none;margin-top:8px}.audit-check-grid{grid-template-columns:1fr}}
@media print{body>*:not(#modalRoot):not(.modal-overlay){display:none!important}.modal-overlay{position:static!important;background:#fff!important}.modal{box-shadow:none!important;max-width:none!important;width:100%!important}.modal .actions{display:none!important}}


/* RC3.5.5 — Auditoria com rolagem vertical e ajuda contextual do botão. */
body.audit-page-active main#content,
main#content.audit-scroll-page{
  height:100vh!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  overscroll-behavior-y:contain;
  scrollbar-gutter:stable;
  padding-bottom:44px!important;
}
main#content.audit-scroll-page .integration-health-card,
main#content.audit-scroll-page .table-wrap{min-width:0}
#runIntegrationNow[title]{position:relative}
#runIntegrationNow:focus-visible{outline:3px solid rgba(25,111,163,.25);outline-offset:2px}

/* RC3.5.6 — proporção dos modais, filtros de período e histórico de sincronização. */
.integration-action-box{max-width:none!important}
.integration-action-box small{display:none!important}
#modal .modal-card.sync-report-modal{width:min(760px,calc(100vw - 340px))!important;max-width:760px!important;max-height:calc(100vh - 90px)!important;padding:20px!important}
#modal .modal-card.sync-report-modal #modalBody{overflow-y:auto!important;max-height:calc(100vh - 135px)!important;padding-right:6px}
#modal .modal-card.attention-info-modal{width:min(620px,calc(100vw - 360px))!important;max-width:620px!important;max-height:calc(100vh - 130px)!important;padding:20px!important}
#modal .modal-card.attention-info-modal #modalBody{overflow-y:auto!important;max-height:calc(100vh - 175px)!important}
.dashboard-range-box{display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap;margin-left:auto}
.dashboard-range-box .field{margin:0;min-width:140px}
.dashboard-range-box input,.dashboard-range-box select{min-height:38px}
.dashboard-range-mode{min-width:175px!important}.dashboard-range-anchor{min-width:150px!important}.dashboard-custom-date{min-width:155px!important}
.dashboard-range-apply{min-height:38px}
.dashboard-period-readout{display:flex;flex-direction:column;justify-content:center;min-height:38px;padding:5px 10px;border-left:3px solid var(--blue,#2f6fed);background:#f8fafc;border-radius:6px;min-width:190px}
.dashboard-period-readout small{font-size:11px;color:#64748b}.dashboard-period-readout b{font-size:13px;color:var(--navy);text-transform:capitalize}
.integration-run-history{margin-top:16px;border-top:1px solid var(--border);padding-top:12px}.integration-run-history h3{margin:0 0 10px}.integration-run-history>div{display:grid;grid-template-columns:110px 1fr auto;gap:12px;align-items:center;padding:10px 12px;border:1px solid var(--border);border-radius:10px;margin-bottom:8px}.integration-run-history span,.integration-run-history small{color:#64748b}
.integration-health-card .kpi span{display:block;color:#64748b;font-size:11px;margin-top:3px}
@media(max-width:900px){#modal .modal-card.sync-report-modal,#modal .modal-card.attention-info-modal{width:calc(100vw - 32px)!important;max-width:none!important}.dashboard-range-box{margin-left:0;width:100%}.dashboard-range-box .field,.dashboard-range-apply,.dashboard-period-readout{flex:1 1 150px}.integration-run-history>div{grid-template-columns:1fr}.integration-run-history small{text-align:left}}

/* RC3.5.7 — filtro compacto do Dashboard e ajuste final do modal de sincronização. */
#modal .modal-card.sync-report-modal{
  width:min(700px,calc(100vw - 430px))!important;
  max-width:700px!important;
}
.dashboard-toolbar{align-items:flex-start!important}
.dashboard-compact-period{position:relative;display:flex;flex-direction:column;align-items:stretch;gap:6px;margin-left:auto;min-width:190px}
.dashboard-period-button{align-self:flex-start;min-height:34px;padding:7px 14px}
.dashboard-period-control{width:100%;display:block!important}
.dashboard-period-trigger{width:100%;min-width:190px}
.dashboard-custom-period-panel{position:absolute;right:0;top:42px;z-index:180;display:grid;grid-template-columns:repeat(2,minmax(118px,1fr));gap:8px;align-items:end;width:360px;padding:12px;background:#fff;border:1px solid var(--border);border-radius:12px;box-shadow:0 16px 36px rgba(15,23,42,.18)}
.dashboard-custom-period-panel[hidden]{display:none!important}
.dashboard-custom-period-panel label{display:flex;flex-direction:column;gap:4px;font-size:12px;font-weight:700;color:var(--navy)}
.dashboard-custom-period-panel input{height:34px;min-height:34px;padding:5px 7px;font-size:12px}
.dashboard-custom-period-panel .btn{min-height:34px;padding:7px 10px}
.dashboard-period-caption{font-size:11px;color:#64748b;text-align:right;line-height:1.2;text-transform:capitalize}
.dashboard-calendar-popover{top:calc(100% + 6px)!important}
@media(max-width:900px){
  #modal .modal-card.sync-report-modal{width:calc(100vw - 48px)!important;max-width:700px!important}
  .dashboard-compact-period{margin-left:0;width:100%}
  .dashboard-period-button{align-self:flex-start}
  .dashboard-period-trigger{width:min(100%,260px)}
  .dashboard-custom-period-panel{left:0;right:auto;width:min(360px,calc(100vw - 48px));grid-template-columns:1fr 1fr}
}
@media(max-width:560px){.dashboard-custom-period-panel{grid-template-columns:1fr}.dashboard-custom-period-panel .btn{width:100%}}

/* RC3.5.8 — calendário padronizado e modais compactos do Dashboard. */
#modal .modal-card.dashboard-month-modal{
  width:min(520px,calc(100vw - 380px))!important;
  max-width:520px!important;
  max-height:calc(100vh - 150px)!important;
  padding:20px!important;
}
.dashboard-month-fields{display:grid!important;grid-template-columns:minmax(0,1fr) 130px!important;gap:12px!important;margin-top:14px}
.dashboard-month-fields .field{margin:0!important}
.dashboard-custom-period-panel{grid-template-columns:repeat(2,minmax(128px,1fr))!important;width:390px!important}
.dashboard-date-field{position:relative;display:flex;align-items:center}
.dashboard-date-field input{width:100%;padding-right:36px!important}
.dashboard-date-open{position:absolute;right:4px;width:28px;height:28px;border:0;background:transparent;border-radius:6px;cursor:pointer;font-size:14px}
.dashboard-date-open:hover{background:#eef4f8}
.dashboard-date-input.invalid{border-color:#dc2626!important;box-shadow:0 0 0 2px rgba(220,38,38,.10)!important}
.dashboard-date-picker{position:absolute;right:12px;top:78px;z-index:220;width:238px;padding:10px;background:#fff;border:1px solid var(--border);border-radius:12px;box-shadow:0 18px 38px rgba(15,23,42,.22)}
.dashboard-date-picker[hidden]{display:none!important}
.dashboard-date-picker-head{display:grid;grid-template-columns:30px 1fr 30px;align-items:center;gap:6px;margin-bottom:8px}
.dashboard-date-picker-head b{text-align:center;text-transform:capitalize;font-size:13px}
.dashboard-date-picker-head button{height:28px;border:0;background:#eef4f8;border-radius:7px;cursor:pointer;font-size:18px}
.dashboard-date-picker .mini-grid button{border:0;background:transparent;min-height:28px;border-radius:7px;cursor:pointer;font-size:12px}
.dashboard-date-picker .mini-grid button:hover{background:#e8f1ff}
.dashboard-date-picker .mini-grid button.outside{color:#a0aec0}
.dashboard-date-picker .mini-grid button.today{outline:1px solid #2f6fed}
.dashboard-date-picker .mini-grid button.selected{background:#1769e0;color:#fff;font-weight:800}
@media(max-width:900px){
  #modal .modal-card.dashboard-month-modal{width:calc(100vw - 48px)!important;max-width:520px!important}
  .dashboard-date-picker{left:12px;right:auto}
}
@media(max-width:560px){.dashboard-month-fields{grid-template-columns:1fr!important}.dashboard-custom-period-panel{width:min(360px,calc(100vw - 48px))!important}}

/* RC4.0.0 — Conciliação Financeira */
.reconcile-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px;padding:16px 18px;background:var(--card,#fff);border:1px solid var(--border,#e5e7eb);border-radius:14px}.reconcile-toolbar small{display:block;margin-top:5px;color:var(--muted,#64748b)}.reconcile-summary{display:flex;gap:10px;margin:12px 0 16px}.reconcile-summary span{padding:7px 11px;border-radius:999px;background:#f3f4f6;font-size:13px}.status{display:inline-block;margin-left:8px;padding:4px 9px;border-radius:999px;font-size:12px}.status-ok{background:#dcfce7;color:#166534}.status-warning{background:#fef3c7;color:#92400e}.severity{display:inline-block;padding:4px 8px;border-radius:999px;font-size:12px;font-weight:700}.severity-high{background:#fee2e2;color:#991b1b}.severity-medium{background:#fef3c7;color:#92400e}.btn.tiny{padding:6px 9px;font-size:12px}.empty-state{text-align:center;padding:28px!important;color:var(--muted,#64748b)}@media(max-width:760px){.reconcile-toolbar{align-items:flex-start;flex-direction:column}.reconcile-toolbar .actions{width:100%}.reconcile-toolbar .actions .btn{flex:1}.reconcile-summary{flex-wrap:wrap}}

/* RC4.1.0 — Conciliação Sprint 2 */
.reconcile-toolbar .actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.modal-lead{color:var(--muted,#64748b);margin-top:-4px}.ignored-reconcile-table,.bank-import-table{max-height:55vh;overflow:auto}.bank-import-table td:nth-child(3){font-weight:700;white-space:nowrap}@media(max-width:900px){.reconcile-toolbar .actions{justify-content:flex-start}.reconcile-toolbar .actions .btn{flex:0 1 auto}}

/* RC4.1.1 — arraste global unificado e cenário de homologação. */
[data-grab-surface="1"]{cursor:grab!important;overscroll-behavior:contain}
[data-grab-surface="1"].grab-scrolling{cursor:grabbing!important;user-select:none!important;scroll-behavior:auto!important}
[data-grab-surface="1"].grab-scrolling *{user-select:none!important}
[data-grab-surface="1"] button,[data-grab-surface="1"] a,[data-grab-surface="1"] input,[data-grab-surface="1"] select,[data-grab-surface="1"] textarea,[data-grab-surface="1"] summary,[data-grab-surface="1"] label{cursor:auto!important}
[data-grab-surface="1"] button,[data-grab-surface="1"] a,[data-grab-surface="1"] summary{cursor:pointer!important}
.reconcile-test-banner{margin:12px 0 16px;padding:13px 15px;border:1px solid #f0b429;border-left:5px solid #f0b429;border-radius:10px;background:#fff8df;display:flex;flex-direction:column;gap:4px;color:#563c00}
.reconcile-test-banner span{font-size:.88rem;line-height:1.45}

/* RC4.1.2 — foco do Centro de Atenção e pan universal. */
.attention-filter-banner{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:0 0 14px;padding:13px 15px;border:1px solid #f59e0b;border-left:5px solid #f59e0b;border-radius:11px;background:#fffbeb;color:#78350f}
.attention-filter-banner>div{display:flex;flex-direction:column;gap:3px}.attention-filter-banner span{font-size:.86rem}
.job-table tr.attention-job-row>td{background:#fff4d6!important;border-top:1px solid #f3bd4b;border-bottom:1px solid #f3bd4b}.job-table tr.attention-job-row>td:first-child{box-shadow:inset 5px 0 0 #f59e0b;font-weight:900}
#content,.table-wrap,.finance-table,.job-table,.billing-grid,#modalBody,.modal-card,.ignored-reconcile-table,.bank-import-table{touch-action:none}
#content,.table-wrap,.finance-table,.job-table,.billing-grid,#modalBody,.ignored-reconcile-table,.bank-import-table{cursor:grab}
.universal-panning{cursor:grabbing!important;user-select:none!important;scroll-behavior:auto!important}.universal-panning *{cursor:grabbing!important;user-select:none!important}
#content button,#content a,#content input,#content select,#content textarea,#modal button,#modal a,#modal input,#modal select,#modal textarea{touch-action:manipulation}
@media(max-width:760px){.attention-filter-banner{align-items:stretch;flex-direction:column}.attention-filter-banner .btn{width:100%}}
/* RC4.2.0 — auditoria financeira por Job */
.financial-breakdown{display:grid;gap:8px;margin:10px 0 18px}.financial-breakdown>div{display:flex;justify-content:space-between;gap:18px;padding:10px 12px;border:1px solid var(--line,#d9dee7);border-radius:9px;background:var(--surface,#fff);cursor:help}.financial-breakdown>div span{font-weight:600}.financial-breakdown>div b{white-space:nowrap}.financial-breakdown>div.total{border-width:2px;background:rgba(15,23,42,.035)}

/* RC4.2.2 — Conciliação compacta sem rolagem horizontal desnecessária */
.reconcile-table table{width:100%;table-layout:fixed;min-width:0}
.reconcile-table th,.reconcile-table td{padding:10px 8px;vertical-align:middle}
.reconcile-table th:nth-child(1),.reconcile-table td:nth-child(1){width:8%}
.reconcile-table th:nth-child(2),.reconcile-table td:nth-child(2){width:12%}
.reconcile-table th:nth-child(3),.reconcile-table td:nth-child(3){width:7%;white-space:nowrap}
.reconcile-table th:nth-child(4),.reconcile-table td:nth-child(4){width:12%}
.reconcile-table th:nth-child(5),.reconcile-table td:nth-child(5),
.reconcile-table th:nth-child(6),.reconcile-table td:nth-child(6){width:9%;white-space:nowrap}
.reconcile-table th:nth-child(7),.reconcile-table td:nth-child(7){width:34%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.reconcile-table th:nth-child(8),.reconcile-table td:nth-child(8){width:9%;text-align:center;white-space:nowrap}
.reconcile-table td:nth-child(7){cursor:help}
@media(max-width:900px){.reconcile-table{overflow-x:auto}.reconcile-table table{min-width:880px}}

/* RC4.2.3 — grid da Conciliação compacto e coluna Ação sempre visível */
.reconcile-table{overflow-x:hidden!important}
.reconcile-table table{width:100%!important;min-width:0!important;table-layout:fixed!important}
.reconcile-table col.reconcile-col-severity{width:86px}
.reconcile-table col.reconcile-col-type{width:138px}
.reconcile-table col.reconcile-col-job{width:62px}
.reconcile-table col.reconcile-col-client{width:132px}
.reconcile-table col.reconcile-col-value{width:102px}
.reconcile-table col.reconcile-col-detail{width:auto}
.reconcile-table col.reconcile-col-action{width:82px}
.reconcile-table th,.reconcile-table td{padding:9px 6px!important;min-width:0!important;overflow:hidden;text-overflow:ellipsis}
.reconcile-table th{font-size:11px!important;letter-spacing:0!important}
.reconcile-table td{font-size:13px}
.reconcile-table td:nth-child(1),.reconcile-table td:nth-child(3),.reconcile-table td:nth-child(5),.reconcile-table td:nth-child(6),.reconcile-table td:nth-child(8){white-space:nowrap}
.reconcile-table td:nth-child(2),.reconcile-table td:nth-child(4){white-space:nowrap;text-overflow:ellipsis}
.reconcile-table td:nth-child(7){white-space:normal!important;line-height:1.25;cursor:help}
.reconcile-detail-text{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
.reconcile-table th:nth-child(8),.reconcile-table td:nth-child(8){text-align:center!important;overflow:visible!important}
.reconcile-table .ignore-reconcile{padding:6px 8px!important;min-width:64px}
@media(max-width:1050px){
  .reconcile-table col.reconcile-col-severity{width:78px}
  .reconcile-table col.reconcile-col-type{width:125px}
  .reconcile-table col.reconcile-col-job{width:56px}
  .reconcile-table col.reconcile-col-client{width:112px}
  .reconcile-table col.reconcile-col-value{width:88px}
  .reconcile-table col.reconcile-col-action{width:76px}
  .reconcile-table th,.reconcile-table td{padding-left:5px!important;padding-right:5px!important}
}

/* RC4.2.4 — densidade da homologação, rolagem do Novo Job e arraste contínuo */
.reconcile-test-banner{
  min-height:0!important;
  margin:10px 0 14px!important;
  padding:10px 14px!important;
  display:flex!important;
  align-items:center!important;
  gap:12px!important;
  border-left-width:4px!important;
}
.reconcile-test-banner b{white-space:nowrap!important;font-size:.94rem!important}
.reconcile-test-banner span{font-size:.84rem!important;line-height:1.3!important;margin:0!important}

#modal .modal-card.job-form-modal{
  display:flex!important;
  flex-direction:column!important;
  overflow:hidden!important;
  min-height:0!important;
}
#modal .modal-card.job-form-modal #modalBody{
  display:block!important;
  flex:1 1 auto!important;
  min-height:0!important;
  max-height:calc(100vh - 118px)!important;
  overflow-y:scroll!important;
  overflow-x:hidden!important;
  scrollbar-gutter:stable!important;
  padding-right:10px!important;
  overscroll-behavior:contain!important;
}
#modal .modal-card.job-form-modal #modalBody::-webkit-scrollbar{width:12px!important}
#modal .modal-card.job-form-modal #modalBody::-webkit-scrollbar-thumb{background:#aeb9c4!important;border-radius:999px!important;border:3px solid #fff!important}
#modal .modal-card.job-form-modal #modalBody::-webkit-scrollbar-track{background:#eef2f5!important;border-radius:999px!important}

.universal-pan-ready{cursor:grab!important}
.universal-panning{cursor:grabbing!important;user-select:none!important}
#content,.table-wrap,.finance-table,.job-table,.billing-grid,#modalBody,.modal-card,.ignored-reconcile-table,.bank-import-table{
  overscroll-behavior:contain!important;
}
@media(max-width:900px){
  .reconcile-test-banner{align-items:flex-start!important;flex-direction:column!important;gap:3px!important}
  .reconcile-test-banner b{white-space:normal!important}
  #modal .modal-card.job-form-modal #modalBody{max-height:calc(100vh - 82px)!important}
}


/* RC4.2.5 — alerta de homologação compacto, expansível e sem sobreposição */
.reconcile-test-banner{
  display:block!important;
  min-height:0!important;
  height:auto!important;
  margin:10px 0 14px!important;
  padding:0!important;
  border:1px solid #f0b429!important;
  border-left:4px solid #f0b429!important;
  border-radius:10px!important;
  background:#fff8df!important;
  color:#563c00!important;
  overflow:hidden!important;
  position:relative!important;
  z-index:auto!important;
}
.reconcile-test-banner>summary{
  min-height:42px!important;
  box-sizing:border-box!important;
  display:grid!important;
  grid-template-columns:max-content minmax(0,1fr) max-content!important;
  align-items:center!important;
  gap:10px!important;
  padding:9px 12px!important;
  cursor:pointer!important;
  list-style:none!important;
  position:relative!important;
}
.reconcile-test-banner>summary::-webkit-details-marker{display:none!important}
.reconcile-test-banner-title{
  font-size:.91rem!important;
  font-weight:800!important;
  line-height:1.2!important;
  white-space:nowrap!important;
}
.reconcile-test-banner-brief{
  min-width:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  font-size:.83rem!important;
  line-height:1.25!important;
}
.reconcile-test-banner-toggle{
  font-size:.78rem!important;
  font-weight:800!important;
  white-space:nowrap!important;
  color:#7a5200!important;
}
.reconcile-test-banner[open] .reconcile-test-banner-toggle{font-size:0!important}
.reconcile-test-banner[open] .reconcile-test-banner-toggle::after{content:'Ocultar detalhes';font-size:.78rem!important}
.reconcile-test-banner-details{
  display:block!important;
  box-sizing:border-box!important;
  padding:9px 12px 11px!important;
  border-top:1px solid rgba(240,180,41,.55)!important;
  font-size:.83rem!important;
  line-height:1.4!important;
  position:static!important;
}
.reconcile-test-banner + .kpi-grid,
.reconcile-test-banner + .cards,
.reconcile-test-banner + .reconcile-kpis{
  clear:both!important;
  margin-top:0!important;
}
@media(max-width:900px){
  .reconcile-test-banner>summary{
    grid-template-columns:minmax(0,1fr) max-content!important;
    gap:4px 10px!important;
  }
  .reconcile-test-banner-title{white-space:normal!important}
  .reconcile-test-banner-brief{
    grid-column:1/-1!important;
    white-space:normal!important;
    overflow:visible!important;
    text-overflow:clip!important;
  }
  .reconcile-test-banner-toggle{grid-column:2;grid-row:1}
}

/* RC4.3.0 — arquitetura financeira auditável */
.fixed-cost-config{border:1px solid var(--line);border-radius:12px;padding:14px;background:#f8fafc}
.fixed-cost-config h3{margin:0 0 4px}.fixed-cost-config>p{margin:0 0 12px;color:var(--muted);font-size:.84rem}
.fixed-cost-grid{display:grid;grid-template-columns:repeat(3,minmax(180px,1fr));gap:10px}
.fixed-cost-grid .field{margin:0}.fixed-cost-total{grid-column:1/-1;display:flex;justify-content:space-between;align-items:center;padding:12px 14px;border:2px solid var(--navy);border-radius:10px;background:#fff}.fixed-cost-total span{font-weight:800}.fixed-cost-total strong{font-size:1.2rem;color:var(--navy)}
@media(max-width:980px){.fixed-cost-grid{grid-template-columns:repeat(2,minmax(170px,1fr))}}
@media(max-width:650px){.fixed-cost-grid{grid-template-columns:1fr}}

/* RC4.3.2 — Centro Financeiro do Job */
.job-detail-tabs{display:flex;gap:8px;margin:12px 0 18px;border-bottom:1px solid var(--border,#dfe3e8);padding-bottom:8px;flex-wrap:wrap}
.job-detail-tabs button{border:1px solid var(--border,#dfe3e8);background:transparent;border-radius:9px;padding:9px 14px;font-weight:700;cursor:pointer;color:inherit}
.job-detail-tabs button.active{background:var(--primary,#213547);color:#fff;border-color:var(--primary,#213547)}
.job-finance-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:4px 0 18px}
.job-finance-summary .metric-card{border:1px solid var(--border,#dfe3e8);border-radius:12px;padding:14px;background:var(--surface,#fff);display:flex;flex-direction:column;gap:5px;min-width:0}
.job-finance-summary .metric-card small{font-weight:700;color:var(--muted,#65717d)}
.job-finance-summary .metric-card strong{font-size:1.25rem;overflow-wrap:anywhere}
.job-finance-summary .metric-card span{font-size:.82rem;color:var(--muted,#65717d)}
.job-finance-summary .metric-card.danger{border-color:#b42318;background:rgba(180,35,24,.06)}
.financial-method-note{border-left:4px solid var(--primary,#213547);padding:12px 14px;margin:0 0 14px;background:rgba(33,53,71,.06);border-radius:8px}
.financial-calculation-details{border:1px solid var(--border,#dfe3e8);border-radius:10px;padding:12px}
.financial-calculation-details summary{cursor:pointer;font-weight:800}
.financial-exception{background:rgba(180,35,24,.06)}
@media (max-width:800px){.job-finance-summary{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:520px){.job-finance-summary{grid-template-columns:1fr}.job-detail-tabs button{flex:1 1 auto}}

/* RC4.3.3 — regressões: cenário de homologação, rolagem de Configurações e consulta financeira */
.reconcile-test-banner.rc433-restored{
  display:block!important;
  position:relative!important;
  width:100%!important;
  box-sizing:border-box!important;
  margin:12px 0 16px!important;
  clear:both!important;
  z-index:1!important;
}
.reconcile-test-banner.rc433-restored + .reconcile-kpis,
.reconcile-test-banner.rc433-restored + .kpis{
  margin-top:0!important;
  clear:both!important;
}
main#content.settings-scroll-page{
  height:calc(100vh - 70px)!important;
  max-height:calc(100vh - 70px)!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  touch-action:pan-y!important;
  cursor:grab;
}
main#content.settings-scroll-page.settings-dragging{
  cursor:grabbing!important;
  user-select:none!important;
}
.job-detail-readonly-note{
  margin:0 0 12px;
  padding:9px 12px;
  border:1px solid var(--border,#dfe3e8);
  border-radius:9px;
  background:var(--surface,#fff);
  color:var(--muted,#65717d);
  font-size:.86rem;
}
.job-detail-actions .job-operational-action[hidden]{display:none!important}

/* RC4.3.4 — modo financeiro progressivo e confiabilidade do rateio */
.financial-mode-box{display:grid;grid-template-columns:minmax(260px,1fr) minmax(280px,1.4fr);gap:16px;align-items:end;padding:16px;border:1px solid var(--border);border-radius:14px;background:#f8fafc}
.financial-mode-note{margin:0}
.advanced-financial-settings{border:1px solid var(--border);border-radius:14px;padding:0;background:#fff}
.advanced-financial-settings summary{cursor:pointer;font-weight:700;padding:16px 18px;color:#173a52}
.advanced-financial-settings.is-basic:not([open]) summary:after{content:' · opcional';font-weight:400;color:#64748b}
.advanced-financial-grid{padding:0 16px 16px}
.financial-confidence{margin:12px 0;padding:12px 14px;border-radius:12px;background:#eef6ff;border:1px solid #bfd7f0}
.financial-confidence.good{background:#ecfdf3;border-color:#a7e3bd}
.financial-confidence.warning{background:#fff8e6;border-color:#f0d58a}
.financial-confidence.danger{background:#fff1f1;border-color:#efb3b3}
@media(max-width:760px){.financial-mode-box{grid-template-columns:1fr}}

/* RC4.3.5 — navegação completa do Job e Resultado Financeiro visual */
#modal .modal-card.job-detail-modal{width:min(1180px,calc(100vw - 72px))!important;max-width:1180px!important;max-height:calc(100vh - 48px)!important;padding:0!important;overflow:hidden!important}
#modal .modal-card.job-detail-modal #modalBody{max-height:calc(100vh - 48px)!important;overflow-y:auto!important;padding:22px 24px 26px!important;touch-action:pan-y!important;cursor:auto!important}
.job-detail-title{display:flex;justify-content:space-between;gap:16px;align-items:flex-start}.job-detail-title h2{margin:2px 0 5px}.job-detail-title p{margin:0;color:var(--muted)}.job-breadcrumb{color:var(--muted);font-weight:700}
.job-detail-tabs{flex-wrap:nowrap!important;overflow-x:auto;padding-bottom:0!important;gap:0!important;border-bottom:1px solid var(--border)!important;scrollbar-width:thin}
.job-detail-tabs button{flex:0 0 auto;border:0!important;border-bottom:3px solid transparent!important;border-radius:0!important;background:transparent!important;padding:12px 16px!important;color:var(--muted)!important;white-space:nowrap}
.job-detail-tabs button.active{color:#1757b7!important;border-bottom-color:#1757b7!important;background:transparent!important}
.job-result-header{display:grid;grid-template-columns:1fr 1.4fr .85fr;gap:0;border:1px solid var(--border);border-radius:14px;background:#fff;margin:14px 0 18px;overflow:hidden}.job-result-header>div{padding:18px 20px;display:flex;flex-direction:column;gap:6px}.job-result-header>div+div{border-left:1px solid var(--border)}.confidence-card small,.tip-policy-card small{font-weight:800;color:var(--muted)}.confidence-card strong{font-size:1.35rem;text-transform:uppercase}.confidence-card.good strong{color:#15803d}.confidence-card.warning strong{color:#b7791f}.confidence-card.danger strong{color:#b42318}.confidence-explanation span,.tip-policy-card span{color:var(--muted);font-size:.88rem;line-height:1.45}.tip-policy-card strong{font-size:1.2rem}.compact-btn{padding:7px 10px!important;margin-top:4px;align-self:flex-start}
.finance-three-columns{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.finance-panel{border:1px solid var(--border);border-radius:14px;background:#fff;padding:18px;display:flex;flex-direction:column;min-width:0}.finance-panel h3{margin:0 0 12px;font-size:1rem}.revenue-panel h3,.revenue-panel .finance-subtotal{color:#147a43}.costs-panel h3,.costs-panel .finance-subtotal{color:#b42318}.results-panel h3,.results-panel .finance-result{color:#1757b7}.finance-line{display:flex;justify-content:space-between;gap:14px;padding:9px 0;border-bottom:1px solid #edf1f4}.finance-line span{min-width:0}.finance-line b{white-space:nowrap}.finance-subtotal{display:flex;justify-content:space-between;gap:12px;margin-top:12px;padding-top:14px;border-top:2px solid currentColor;font-weight:900}.finance-help{margin:auto 0 0;margin-top:18px;padding:10px 12px;border-radius:9px;background:#f6f8fa;color:var(--muted);font-size:.8rem;line-height:1.4}.finance-result{display:grid;grid-template-columns:1fr auto;gap:4px 12px;margin:10px 0;padding:13px 0;border-top:2px solid #dbe7f7;border-bottom:1px solid #dbe7f7;font-weight:900}.finance-result small{grid-column:1/-1;color:var(--muted);font-weight:600}.finance-result.final{font-size:1.08rem;border-top-color:#1757b7}
.calculation-flow{margin-top:18px;border:1px solid var(--border);border-radius:14px;background:#fff;padding:18px}.calculation-flow h3{margin:0 0 15px}.calculation-flow-grid{display:grid;grid-template-columns:1fr auto 1fr auto 1fr auto 1fr auto 1fr;gap:10px;align-items:center}.calculation-flow-grid>div{display:flex;flex-direction:column;gap:5px;min-width:0}.calculation-flow-grid span{font-size:.78rem;color:var(--muted);line-height:1.3}.calculation-flow-grid strong{font-size:.95rem}.calculation-flow-grid i{font-style:normal;color:var(--muted);font-size:1.25rem}.job-empty-panel{text-align:center;padding:48px 20px;border:1px dashed var(--border);border-radius:12px;color:var(--muted)}.job-empty-panel h3{color:var(--navy)}
@media(max-width:1000px){.finance-three-columns{grid-template-columns:1fr}.job-result-header{grid-template-columns:1fr}.job-result-header>div+div{border-left:0;border-top:1px solid var(--border)}.calculation-flow-grid{grid-template-columns:1fr}.calculation-flow-grid i{transform:rotate(90deg);justify-self:center}}
@media(max-width:700px){#modal .modal-card.job-detail-modal{width:calc(100vw - 24px)!important}.job-detail-tabs button{padding:11px 12px!important}.job-detail-title p{line-height:1.5}}

/* RC4.3.6 — proporção equilibrada do detalhamento do Job */
#modal:has(.modal-card.job-detail-modal){
  padding:24px 24px 24px 284px!important;
  place-items:center!important;
}
body.menu-collapsed #modal:has(.modal-card.job-detail-modal){
  padding-left:96px!important;
}
#modal .modal-card.job-detail-modal{
  width:min(1080px,calc(100vw - 332px))!important;
  max-width:1080px!important;
  height:auto!important;
  max-height:min(88vh,820px)!important;
  margin:0!important;
  border-radius:16px!important;
}
body.menu-collapsed #modal .modal-card.job-detail-modal{
  width:min(1180px,calc(100vw - 132px))!important;
  max-width:1180px!important;
}
#modal .modal-card.job-detail-modal #modalBody{
  max-height:min(88vh,820px)!important;
  padding:18px 20px 22px!important;
}
#modal .modal-card.job-detail-modal .job-detail-title h2{font-size:1.45rem!important}
#modal .modal-card.job-detail-modal .job-detail-title p{font-size:.9rem!important}
#modal .modal-card.job-detail-modal .job-detail-tabs button{padding:10px 13px!important}
#modal .modal-card.job-detail-modal .job-result-header{margin:12px 0 14px!important}
#modal .modal-card.job-detail-modal .job-result-header>div{padding:14px 16px!important}
#modal .modal-card.job-detail-modal .finance-three-columns{gap:12px!important}
#modal .modal-card.job-detail-modal .finance-panel{padding:15px!important}
#modal .modal-card.job-detail-modal .finance-line{padding:7px 0!important}
#modal .modal-card.job-detail-modal .calculation-flow{margin-top:14px!important;padding:15px!important}

@media(max-width:1050px){
  #modal:has(.modal-card.job-detail-modal){padding:16px!important}
  #modal .modal-card.job-detail-modal,
  body.menu-collapsed #modal .modal-card.job-detail-modal{
    width:min(940px,calc(100vw - 32px))!important;
    max-width:940px!important;
    max-height:calc(100vh - 32px)!important;
  }
  #modal .modal-card.job-detail-modal #modalBody{max-height:calc(100vh - 32px)!important}
}
@media(max-width:700px){
  #modal:has(.modal-card.job-detail-modal){padding:10px!important}
  #modal .modal-card.job-detail-modal,
  body.menu-collapsed #modal .modal-card.job-detail-modal{
    width:calc(100vw - 20px)!important;
    max-height:calc(100vh - 20px)!important;
  }
  #modal .modal-card.job-detail-modal #modalBody{max-height:calc(100vh - 20px)!important;padding:16px!important}
}

/* RC4.3.7 — Estabilização regressiva consolidada */
#modal .modal-card.rc437-message-modal{width:min(650px,calc(100vw - 340px))!important;max-width:650px!important;max-height:calc(100vh - 96px)!important;padding:22px!important}
#modal .modal-card.rc437-message-modal #modalBody{max-height:calc(100vh - 140px)!important;overflow:auto!important}
#modal .modal-card.rc437-mileage-modal{width:min(680px,calc(100vw - 340px))!important;max-width:680px!important;height:auto!important;max-height:calc(100vh - 110px)!important;padding:24px!important}
#modal .modal-card.rc437-mileage-modal #modalBody{max-height:calc(100vh - 160px)!important;overflow:auto!important}
.table-wrap,.clients-table,.job-table,.finance-table,.billing-grid,.reconcile-table,.ignored-reconcile-table,.bank-import-table{cursor:grab!important;overflow:auto!important;overscroll-behavior:contain}
.table-wrap.rc437-panning,.clients-table.rc437-panning,.job-table.rc437-panning,.finance-table.rc437-panning,.billing-grid.rc437-panning,.reconcile-table.rc437-panning,.ignored-reconcile-table.rc437-panning,.bank-import-table.rc437-panning{cursor:grabbing!important;user-select:none!important}
.invoice-service-head{background:var(--blue,#1f6feb)!important;color:#fff!important;border-bottom:0!important;padding:10px 12px!important;border-radius:4px 4px 0 0!important}
.invoice-service-head span{color:#fff!important}
@media(max-width:900px){#modal .modal-card.rc437-message-modal,#modal .modal-card.rc437-mileage-modal{width:calc(100vw - 32px)!important;max-width:none!important}}

/* RC4.3.8 — estabilidade de navegação do Dashboard. */
main#content.dashboard-scroll-page.rc438-dashboard-pan-ready{cursor:grab!important}
main#content.dashboard-scroll-page.rc438-dashboard-panning{cursor:grabbing!important;user-select:none!important;scroll-behavior:auto!important}
main#content.dashboard-scroll-page.rc438-dashboard-panning *{user-select:none!important}

/* RC4.3.9 — feedback consistente do arraste no Dashboard. */
main#content.dashboard-scroll-page{cursor:grab}
main#content.dashboard-scroll-page.rc439-dashboard-panning{cursor:grabbing!important;user-select:none}
main#content.dashboard-scroll-page button,
main#content.dashboard-scroll-page a,
main#content.dashboard-scroll-page input,
main#content.dashboard-scroll-page select,
main#content.dashboard-scroll-page textarea,
main#content.dashboard-scroll-page label{cursor:auto}

/* RC4.3.11 — Escopo congelado: somente modais de criação da Agenda. */
#modal .modal-card.rc4311-agenda-quick-modal{
  width:min(820px,calc(100vw - 340px))!important;
  max-width:820px!important;
  height:auto!important;
  max-height:calc(100vh - 100px)!important;
  padding:22px!important;
  overflow:hidden!important;
}
#modal .modal-card.rc4311-agenda-quick-modal #modalBody{
  max-height:calc(100vh - 144px)!important;
  overflow-y:auto!important;
  padding-right:4px;
}
#modal .modal-card.rc4311-agenda-quick-modal .quick-create-grid{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:14px!important;
  margin:16px 0!important;
}
#modal .modal-card.rc4311-agenda-quick-modal .quick-create-card{
  min-height:150px!important;
  padding:18px!important;
}
#modal .modal-card.rc4311-agenda-simple-modal{
  width:min(760px,calc(100vw - 360px))!important;
  max-width:760px!important;
  height:auto!important;
  max-height:calc(100vh - 72px)!important;
  padding:22px!important;
  overflow:hidden!important;
}
#modal .modal-card.rc4311-agenda-recurring-modal{
  width:min(720px,calc(100vw - 360px))!important;
  max-width:720px!important;
  height:auto!important;
  max-height:calc(100vh - 86px)!important;
  padding:22px!important;
  overflow:hidden!important;
}
#modal .modal-card.rc4311-agenda-simple-modal #modalBody,
#modal .modal-card.rc4311-agenda-recurring-modal #modalBody{
  max-height:calc(100vh - 126px)!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  padding-right:5px;
}
#modal .modal-card.rc4311-agenda-simple-modal .actions,
#modal .modal-card.rc4311-agenda-recurring-modal .actions{
  position:sticky;
  bottom:0;
  background:#fff;
  padding-top:12px;
  margin-top:12px;
}
@media(max-width:900px){
  #modal .modal-card.rc4311-agenda-quick-modal,
  #modal .modal-card.rc4311-agenda-simple-modal,
  #modal .modal-card.rc4311-agenda-recurring-modal{
    width:calc(100vw - 32px)!important;
    max-width:none!important;
    max-height:calc(100vh - 32px)!important;
    padding:18px!important;
  }
  #modal .modal-card.rc4311-agenda-quick-modal .quick-create-grid{grid-template-columns:1fr!important}
  #modal .modal-card.rc4311-agenda-quick-modal #modalBody,
  #modal .modal-card.rc4311-agenda-simple-modal #modalBody,
  #modal .modal-card.rc4311-agenda-recurring-modal #modalBody{max-height:calc(100vh - 78px)!important}
}

/* RC4.3.12 — Escopo congelado: ajuste final de proporção em dois modais da Agenda. */
#modal .modal-card.rc4311-agenda-quick-modal{
  box-sizing:border-box!important;
  width:min(720px,calc(100vw - 430px))!important;
  max-width:720px!important;
  padding:20px!important;
}
#modal .modal-card.rc4311-agenda-quick-modal .quick-create-grid{
  gap:12px!important;
  margin:14px 0!important;
}
#modal .modal-card.rc4311-agenda-quick-modal .quick-create-card{
  min-height:142px!important;
  padding:16px!important;
}
#modal .modal-card.rc4311-agenda-simple-modal{
  box-sizing:border-box!important;
  width:min(700px,calc(100vw - 430px))!important;
  max-width:700px!important;
  padding:20px!important;
}
@media(max-width:900px){
  #modal .modal-card.rc4311-agenda-quick-modal,
  #modal .modal-card.rc4311-agenda-simple-modal{
    box-sizing:border-box!important;
    width:calc(100vw - 32px)!important;
    max-width:none!important;
  }
}

/* RC4.3.13 — estado visual exclusivo do arraste na grade de Clientes. */
#content .clients-table.rc4313-clients-panning{cursor:grabbing!important;user-select:none!important;scroll-behavior:auto!important}
#content .clients-table.rc4313-clients-panning *{user-select:none!important}

/* RC4.3.14 — estado visual exclusivo do arraste estável em Clientes. */
#content .clients-table.rc4314-clients-panning,
#content.rc4314-clients-panning{cursor:grabbing!important;user-select:none!important;scroll-behavior:auto!important}
#content .clients-table.rc4314-clients-panning *{user-select:none!important}

/* RC4.3.15 — Jobs: feedback visual do arraste da grade e dos formulários. */
#content .job-table,
#modal:not(.hidden) #modalBody:has(#jobForm),
#modal:not(.hidden) #modalBody:has([data-job-detail-panel]){cursor:grab}
#content .job-table.rc4315-jobs-panning,
#content.rc4315-jobs-panning,
#modal:not(.hidden) .modal-card.rc4315-jobs-panning,
#modal:not(.hidden) #modalBody.rc4315-jobs-panning{cursor:grabbing!important;user-select:none!important}
#content .job-table button,#content .job-table a,#content .job-table input,#content .job-table select,#content .job-table textarea,
#modal:not(.hidden) #modalBody button,#modal:not(.hidden) #modalBody a,#modal:not(.hidden) #modalBody input,#modal:not(.hidden) #modalBody select,#modal:not(.hidden) #modalBody textarea{cursor:auto}

/* RC4.3.16 — Faturamento: grade estável para nomes longos e cenário de conciliação. */
#content:has(> .billing-grid) .billing-grid-head,
#content:has(> .billing-grid) .billing-grid-row{
  box-sizing:border-box!important;
  grid-template-columns:140px 92px 210px 170px 112px 100px 140px 214px!important;
  width:1178px!important;
  min-width:1178px!important;
  max-width:1178px!important;
}
#content:has(> .billing-grid) .billing-grid-head>div,
#content:has(> .billing-grid) .billing-grid-row>div{
  min-width:0!important;
  overflow:hidden;
}
#content:has(> .billing-grid) .billing-client-cell,
#content:has(> .billing-grid) .billing-service-cell{
  display:block!important;
  min-width:0!important;
  overflow:hidden!important;
  white-space:nowrap!important;
  text-overflow:ellipsis!important;
}
#content:has(> .billing-grid) .billing-client-cell>span,
#content:has(> .billing-grid) .billing-service-cell>span{
  display:block;
  min-width:0;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}
#content:has(> .billing-grid) .billing-actions{
  min-width:0;
  justify-content:center!important;
}

/* RC4.3.17 — Fluxo de Caixa: pan de tela e faixa dedicada do formulário. */
#content:has(.finance-table),#content .finance-table{cursor:grab!important;overscroll-behavior:contain}
#content.finance-screen-panning,#content .finance-table.finance-screen-panning{cursor:grabbing!important;user-select:none!important}
.finance-modal-scroll-handle{
  position:sticky;top:-1px;z-index:5;display:flex;align-items:center;justify-content:center;gap:8px;
  width:100%;margin:0 0 10px;padding:8px 12px;border:1px dashed #9eb4c4;border-radius:9px;
  background:#eef5f9;color:#294c63;cursor:grab;user-select:none;touch-action:none;font-size:13px
}
.finance-modal-scroll-handle span{font-size:18px;line-height:1}.finance-modal-scroll-handle.is-dragging{cursor:grabbing;background:#e2eff6}
.finance-modal-scroll-handle:focus-visible{outline:3px solid #77a9c8;outline-offset:2px}

/* RC4.3.18 — Fluxo de Caixa: faixa sticky e arraste pelas áreas vazias do formulário. */
#modal:not(.hidden) .modal-card.rc4318-finance-scroll-modal{
  overflow-y:auto!important;
  overscroll-behavior:contain!important;
  scroll-behavior:auto!important;
}
#modal:not(.hidden) #modalBody.rc4318-finance-scroll-body{
  position:relative!important;
  min-height:100%!important;
}
#modal:not(.hidden) .finance-modal-scroll-handle.rc4318-finance-sticky-handle{
  position:sticky!important;
  top:-1px!important;
  z-index:30!important;
  box-sizing:border-box!important;
  width:100%!important;
  margin:0 0 12px!important;
  box-shadow:0 5px 12px rgba(18,50,74,.12)!important;
}
#modal:not(.hidden) .modal-card.rc4318-finance-scroll-modal #modalBody,
#modal:not(.hidden) .modal-card.rc4318-finance-scroll-modal #financeForm,
#modal:not(.hidden) .modal-card.rc4318-finance-scroll-modal #financeForm>.form-grid{
  cursor:grab;
}
#modal:not(.hidden) .modal-card.rc4318-finance-scroll-modal input,
#modal:not(.hidden) .modal-card.rc4318-finance-scroll-modal select,
#modal:not(.hidden) .modal-card.rc4318-finance-scroll-modal textarea,
#modal:not(.hidden) .modal-card.rc4318-finance-scroll-modal button,
#modal:not(.hidden) .modal-card.rc4318-finance-scroll-modal a,
#modal:not(.hidden) .modal-card.rc4318-finance-scroll-modal label{
  cursor:auto;
}
#modal:not(.hidden) .modal-card.rc4318-finance-scroll-modal.rc4318-finance-form-panning,
#modal:not(.hidden) .modal-card.rc4318-finance-scroll-modal.rc4318-finance-form-panning #modalBody,
#modal:not(.hidden) .modal-card.rc4318-finance-scroll-modal.rc4318-finance-form-panning #financeForm{
  cursor:grabbing!important;
  user-select:none!important;
}

/* RC4.3.20 — escopo congelado: somente Conciliação. */
main#content .reconcile-table td:nth-child(7),
main#content .reconcile-detail-text{
  cursor:default!important;
}
main#content.rc4320-reconcile-panning,
main#content .rc4320-reconcile-panning{
  cursor:grabbing!important;
  user-select:none!important;
  scroll-behavior:auto!important;
}
#modal .modal-card.rc4320-reconcile-modal{
  width:min(760px,calc(100vw - 330px))!important;
  max-width:760px!important;
  max-height:78vh!important;
  height:auto!important;
  margin-left:auto!important;
  margin-right:auto!important;
  box-sizing:border-box!important;
  overflow:hidden!important;
}
#modal .modal-card.rc4320-reconcile-modal #modalBody{
  max-height:calc(78vh - 36px)!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
}
#modal .modal-card.rc4320-reconcile-modal .table-wrap{
  max-height:50vh!important;
  overflow:auto!important;
}
@media(max-width:900px){
  #modal .modal-card.rc4320-reconcile-modal{
    width:min(92vw,720px)!important;
    max-height:82vh!important;
  }
  #modal .modal-card.rc4320-reconcile-modal #modalBody{max-height:calc(82vh - 32px)!important}
}

/* RC4.3.21 — Conciliação: modais mais compactos e tabelas sem rolagem horizontal no uso normal. */
#modal .modal-card.rc4320-reconcile-modal{
  width:min(660px,calc(100vw - 380px))!important;
  max-width:660px!important;
  max-height:74vh!important;
}
#modal .modal-card.rc4320-reconcile-modal #modalBody{
  max-height:calc(74vh - 34px)!important;
  padding-left:18px!important;
  padding-right:18px!important;
}
#modal .modal-card.rc4320-reconcile-modal .table-wrap{
  max-height:46vh!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
}
#modal .modal-card.rc4320-reconcile-modal table{
  width:100%!important;
  min-width:0!important;
  table-layout:fixed!important;
  border-collapse:collapse!important;
}
#modal .modal-card.rc4320-reconcile-modal th,
#modal .modal-card.rc4320-reconcile-modal td{
  padding:9px 10px!important;
  font-size:13px!important;
  line-height:1.25!important;
  min-width:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
#modal .modal-card.rc4320-reconcile-modal .ignored-reconcile-table th:first-child,
#modal .modal-card.rc4320-reconcile-modal .ignored-reconcile-table td:first-child{width:76%!important}
#modal .modal-card.rc4320-reconcile-modal .ignored-reconcile-table th:last-child,
#modal .modal-card.rc4320-reconcile-modal .ignored-reconcile-table td:last-child{width:24%!important;text-align:center!important}
#modal .modal-card.rc4320-reconcile-modal .bank-import-table th:nth-child(1),
#modal .modal-card.rc4320-reconcile-modal .bank-import-table td:nth-child(1){width:20%!important}
#modal .modal-card.rc4320-reconcile-modal .bank-import-table th:nth-child(2),
#modal .modal-card.rc4320-reconcile-modal .bank-import-table td:nth-child(2){width:42%!important}
#modal .modal-card.rc4320-reconcile-modal .bank-import-table th:nth-child(3),
#modal .modal-card.rc4320-reconcile-modal .bank-import-table td:nth-child(3){width:18%!important}
#modal .modal-card.rc4320-reconcile-modal .bank-import-table th:nth-child(4),
#modal .modal-card.rc4320-reconcile-modal .bank-import-table td:nth-child(4){width:20%!important}
@media(max-width:900px){
  #modal .modal-card.rc4320-reconcile-modal{
    width:min(88vw,640px)!important;
    max-height:78vh!important;
  }
  #modal .modal-card.rc4320-reconcile-modal #modalBody{max-height:calc(78vh - 32px)!important}
  #modal .modal-card.rc4320-reconcile-modal .table-wrap{overflow-x:auto!important}
  #modal .modal-card.rc4320-reconcile-modal table{min-width:560px!important}
}
/* RC5.0.1 — Gestão Inteligente de Materiais. Escopo aditivo; módulos anteriores congelados. */
.stock-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 18px}.stock-tabs button{border:1px solid var(--line,#d9e2ea);background:#fff;border-radius:10px;padding:10px 14px;font-weight:700;cursor:pointer}.stock-tabs button.active{background:#12324a;color:#fff;border-color:#12324a}.stock-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:16px}.stock-kpis article{background:#fff;border:1px solid #dfe7ed;border-radius:16px;padding:18px;box-shadow:0 4px 14px rgba(18,50,74,.06)}.stock-kpis small,.stock-kpis span{display:block;color:#60717f}.stock-kpis strong{display:block;font-size:28px;margin:8px 0}.stock-kpis article.critical{border-left:5px solid #c53b3b}.stock-kpis article.warning{border-left:5px solid #d59a17}.stock-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.section-title{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px}.section-title h2,.toolbar h2{margin:0}.section-title p,.toolbar p{margin:4px 0 0;color:#60717f}.stock-alert,.stock-movement-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px;border-top:1px solid #edf1f4}.stock-alert div,.stock-movement-row div{flex:1}.stock-alert small,.stock-movement-row small,.table-sub{display:block;color:#687985;margin-top:3px}.stock-alert span,.stock-status{border-radius:999px;padding:5px 9px;font-size:12px;font-weight:800;white-space:nowrap}.stock-status.success,.stock-alert.success span{background:#e4f5eb;color:#177245}.stock-status.warning,.stock-alert.warning span{background:#fff1d6;color:#946200}.stock-status.critical,.stock-alert.critical span{background:#fde4e4;color:#a12727}.movement-icon{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:#edf2f5;font-weight:900}.movement-icon.in{background:#e4f5eb;color:#177245}.movement-icon.out{background:#fde4e4;color:#a12727}.stock-toolbar{justify-content:flex-end}.stock-toolbar input{min-width:min(460px,100%)}.stock-kit-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.stock-kit{display:flex;flex-direction:column;gap:10px}.stock-kit>div:first-child{display:flex;align-items:center;justify-content:space-between}.stock-kit-icon{font-size:30px}.stock-kit h3,.stock-kit p{margin:0}.stock-kit ul{padding-left:18px;margin:0;min-height:76px}.stock-kit li{margin:5px 0}.stock-kit li b{float:right}.kit-products{display:grid;gap:8px;max-height:310px;overflow:auto;border:1px solid #dfe7ed;border-radius:12px;padding:10px}.kit-product-row{display:grid;grid-template-columns:auto 1fr 110px;gap:10px;align-items:center;padding:8px;border-bottom:1px solid #edf1f4}.kit-product-row span small{display:block;color:#687985}.empty-state{padding:24px;text-align:center;color:#687985}.btn.small{padding:6px 10px;font-size:12px}@media(max-width:1000px){.stock-kpis{grid-template-columns:repeat(2,1fr)}.stock-grid{grid-template-columns:1fr}.stock-kit-grid{grid-template-columns:repeat(2,1fr)}}@media(max-width:650px){.stock-kpis,.stock-kit-grid{grid-template-columns:1fr}.stock-tabs{display:grid;grid-template-columns:1fr 1fr}.stock-toolbar input{min-width:0;width:100%}.kit-product-row{grid-template-columns:auto 1fr 85px}}

/* RC5.0.1 — correções isoladas do módulo Estoque. Demais módulos congelados. */
#modal .modal-card.rc501-stock-modal{
  width:min(820px,calc(100vw - 320px))!important;
  max-width:820px!important;
  max-height:82vh!important;
  height:auto!important;
  overflow:hidden!important;
  padding:0!important;
}
#modal .modal-card.rc501-stock-modal #modalBody{
  max-height:82vh!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  padding:22px 24px 24px!important;
  touch-action:pan-y!important;
  cursor:auto!important;
  overscroll-behavior:contain!important;
}
#modal .modal-card.rc501-stock-modal .actions{
  position:sticky!important;
  bottom:-24px!important;
  z-index:10!important;
  margin:18px -24px -24px!important;
  padding:14px 24px!important;
  background:#fff!important;
  border-top:1px solid #dfe7ed!important;
}
#modal .modal-card.rc501-product-modal .form-grid{gap:14px 16px!important}
#modal .modal-card.rc501-kit-modal{width:min(760px,calc(100vw - 340px))!important;max-width:760px!important}
#modal .modal-card.rc501-kit-modal .kit-products{max-height:280px!important;overflow-y:auto!important;touch-action:pan-y!important}
#modal .modal-card.rc501-category-modal{width:min(620px,calc(100vw - 360px))!important;max-width:620px!important;max-height:78vh!important}
.stock-category-add{display:grid;grid-template-columns:1fr auto;gap:12px;align-items:end}.stock-category-list{display:grid;gap:8px;max-height:42vh;overflow-y:auto;margin-top:14px;padding-right:4px}.stock-category-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border:1px solid #dfe7ed;border-radius:10px;background:#fff}
@media(max-width:1000px){
  #modal .modal-card.rc501-stock-modal,#modal .modal-card.rc501-kit-modal{width:min(92vw,820px)!important;max-height:86vh!important}
  #modal .modal-card.rc501-stock-modal #modalBody{max-height:86vh!important}
  #modal .modal-card.rc501-category-modal{width:min(90vw,620px)!important}
}
@media(max-width:700px){
  #modal{padding:10px!important;align-items:center!important}
  #modal .modal-card.rc501-stock-modal,#modal .modal-card.rc501-kit-modal,#modal .modal-card.rc501-category-modal{width:calc(100vw - 20px)!important;max-height:92vh!important}
  #modal .modal-card.rc501-stock-modal #modalBody{max-height:92vh!important;padding:18px!important}
  #modal .modal-card.rc501-stock-modal .form-grid{grid-template-columns:1fr!important}
  #modal .modal-card.rc501-stock-modal .actions{bottom:-18px!important;margin:16px -18px -18px!important;padding:12px 18px!important}
  .stock-category-add{grid-template-columns:1fr}
}

/* RC5.0.1 — correções isoladas do módulo Estoque. Demais módulos congelados. */
#modal .modal-card.rc501-stock-modal{width:min(820px,calc(100vw - 320px))!important;max-width:820px!important;max-height:82vh!important;height:auto!important;overflow:hidden!important;padding:0!important}
#modal .modal-card.rc501-stock-modal #modalBody{max-height:82vh!important;overflow-y:auto!important;overflow-x:hidden!important;padding:22px 24px 24px!important;touch-action:pan-y!important;cursor:auto!important;overscroll-behavior:contain!important}
#modal .modal-card.rc501-stock-modal .actions{position:sticky!important;bottom:-24px!important;z-index:10!important;margin:18px -24px -24px!important;padding:14px 24px!important;background:#fff!important;border-top:1px solid #dfe7ed!important}
#modal .modal-card.rc501-product-modal .form-grid{gap:14px 16px!important}
#modal .modal-card.rc501-kit-modal{width:min(760px,calc(100vw - 340px))!important;max-width:760px!important}
#modal .modal-card.rc501-kit-modal .kit-products{max-height:280px!important;overflow-y:auto!important;touch-action:pan-y!important}
#modal .modal-card.rc501-category-modal{width:min(620px,calc(100vw - 360px))!important;max-width:620px!important;max-height:78vh!important}
.stock-category-add{display:grid;grid-template-columns:1fr auto;gap:12px;align-items:end}.stock-category-list{display:grid;gap:8px;max-height:42vh;overflow-y:auto;margin-top:14px;padding-right:4px}.stock-category-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border:1px solid #dfe7ed;border-radius:10px;background:#fff}
@media(max-width:1000px){#modal .modal-card.rc501-stock-modal,#modal .modal-card.rc501-kit-modal{width:min(92vw,820px)!important;max-height:86vh!important}#modal .modal-card.rc501-stock-modal #modalBody{max-height:86vh!important}#modal .modal-card.rc501-category-modal{width:min(90vw,620px)!important}}
@media(max-width:700px){#modal{padding:10px!important;align-items:center!important}#modal .modal-card.rc501-stock-modal,#modal .modal-card.rc501-kit-modal,#modal .modal-card.rc501-category-modal{width:calc(100vw - 20px)!important;max-height:92vh!important}#modal .modal-card.rc501-stock-modal #modalBody{max-height:92vh!important;padding:18px!important}#modal .modal-card.rc501-stock-modal .form-grid{grid-template-columns:1fr!important}#modal .modal-card.rc501-stock-modal .actions{bottom:-18px!important;margin:16px -18px -18px!important;padding:12px 18px!important}.stock-category-add{grid-template-columns:1fr}}

/* RC5.0.2 — ajuste final exclusivo dos modais do Estoque. Demais módulos congelados. */
#modal .modal-card.rc501-product-modal{
  width:min(680px,calc(100vw - 420px))!important;
  max-width:680px!important;
  max-height:78vh!important;
}
#modal .modal-card.rc501-product-modal #modalBody{
  max-height:78vh!important;
  padding:20px 22px 22px!important;
}
#modal .modal-card.rc501-product-modal .form-grid{
  gap:11px 14px!important;
}
#modal .modal-card.rc501-product-modal .actions{
  bottom:-22px!important;
  margin:16px -22px -22px!important;
  padding:12px 22px!important;
}
#modal .modal-card.rc501-kit-modal{
  width:min(640px,calc(100vw - 440px))!important;
  max-width:640px!important;
  max-height:78vh!important;
}
#modal .modal-card.rc501-kit-modal #modalBody{
  max-height:78vh!important;
  padding:20px 22px 22px!important;
}
#modal .modal-card.rc501-kit-modal .actions{
  bottom:-22px!important;
  margin:16px -22px -22px!important;
  padding:12px 22px!important;
}
@media(max-width:1100px){
  #modal .modal-card.rc501-product-modal{width:min(72vw,680px)!important;max-height:82vh!important}
  #modal .modal-card.rc501-kit-modal{width:min(68vw,640px)!important;max-height:82vh!important}
  #modal .modal-card.rc501-product-modal #modalBody,
  #modal .modal-card.rc501-kit-modal #modalBody{max-height:82vh!important}
}
@media(max-width:760px){
  #modal .modal-card.rc501-product-modal,
  #modal .modal-card.rc501-kit-modal{width:calc(100vw - 24px)!important;max-width:none!important;max-height:90vh!important}
  #modal .modal-card.rc501-product-modal #modalBody,
  #modal .modal-card.rc501-kit-modal #modalBody{max-height:90vh!important;padding:18px!important}
  #modal .modal-card.rc501-product-modal .form-grid,
  #modal .modal-card.rc501-kit-modal .form-grid{grid-template-columns:1fr!important}
}

/* RC5.0.3 — restauração integral e rolagem dos modais do Estoque. Demais módulos congelados. */
#modal .modal-card.rc501-product-modal{
  width:min(700px,calc(100vw - 400px))!important;
  max-width:700px!important;
  height:min(74vh,620px)!important;
  max-height:74vh!important;
  display:flex!important;
  flex-direction:column!important;
  overflow:hidden!important;
}
#modal .modal-card.rc501-product-modal #modalBody{
  flex:1 1 auto!important;
  min-height:0!important;
  height:auto!important;
  max-height:none!important;
  overflow-y:scroll!important;
  overflow-x:hidden!important;
  scrollbar-gutter:stable!important;
  overscroll-behavior:contain!important;
  touch-action:pan-y!important;
  padding:20px 22px 0!important;
}
#modal .modal-card.rc501-product-modal #stockProductForm{
  min-height:max-content!important;
  padding-bottom:0!important;
}
#modal .modal-card.rc501-product-modal .actions{
  position:sticky!important;
  bottom:0!important;
  margin:16px -22px 0!important;
  padding:12px 22px!important;
  background:#fff!important;
  border-top:1px solid #dfe7ed!important;
  z-index:20!important;
}
#modal .modal-card.rc501-product-modal #modalBody::-webkit-scrollbar,
#modal .modal-card.rc501-kit-modal #modalBody::-webkit-scrollbar{width:12px!important}
#modal .modal-card.rc501-product-modal #modalBody::-webkit-scrollbar-thumb,
#modal .modal-card.rc501-kit-modal #modalBody::-webkit-scrollbar-thumb{background:#8fa3b3!important;border:3px solid #fff!important;border-radius:10px!important}
#modal .modal-card.rc501-product-modal #modalBody::-webkit-scrollbar-track,
#modal .modal-card.rc501-kit-modal #modalBody::-webkit-scrollbar-track{background:#eef3f6!important}
#modal .modal-card.rc501-kit-modal{
  width:min(600px,calc(100vw - 470px))!important;
  max-width:600px!important;
  height:min(72vh,590px)!important;
  max-height:72vh!important;
  display:flex!important;
  flex-direction:column!important;
  overflow:hidden!important;
}
#modal .modal-card.rc501-kit-modal #modalBody{
  flex:1 1 auto!important;
  min-height:0!important;
  height:auto!important;
  max-height:none!important;
  overflow-y:scroll!important;
  overflow-x:hidden!important;
  scrollbar-gutter:stable!important;
  overscroll-behavior:contain!important;
  touch-action:pan-y!important;
  padding:20px 22px 0!important;
}
#modal .modal-card.rc501-kit-modal .actions{
  position:sticky!important;
  bottom:0!important;
  margin:16px -22px 0!important;
  padding:12px 22px!important;
  background:#fff!important;
  border-top:1px solid #dfe7ed!important;
  z-index:20!important;
}
@media(max-width:1100px){
  #modal .modal-card.rc501-product-modal{width:min(74vw,700px)!important;height:76vh!important;max-height:76vh!important}
  #modal .modal-card.rc501-kit-modal{width:min(64vw,600px)!important;height:74vh!important;max-height:74vh!important}
}
@media(max-width:760px){
  #modal .modal-card.rc501-product-modal,
  #modal .modal-card.rc501-kit-modal{width:calc(100vw - 24px)!important;max-width:none!important;height:88vh!important;max-height:88vh!important}
  #modal .modal-card.rc501-product-modal #modalBody,
  #modal .modal-card.rc501-kit-modal #modalBody{padding:18px 18px 0!important}
  #modal .modal-card.rc501-product-modal .actions,
  #modal .modal-card.rc501-kit-modal .actions{margin:14px -18px 0!important;padding:12px 18px!important}
}

/* RC5.0.4 Compatibilidade 2.1 — fallback de inicialização */
.boot-error{position:fixed;inset:0;z-index:100000;background:rgba(18,50,74,.72);display:grid;place-items:center;padding:20px}
.boot-error.hidden{display:none}
.boot-error-card{width:min(520px,100%);max-height:calc(100dvh - 40px);overflow:auto;background:#fff;border-radius:16px;padding:24px;box-shadow:0 24px 70px rgba(0,0,0,.28)}
.boot-error-card h2{margin:0 0 10px;color:#b42318}.boot-error-card p{margin:0 0 18px;line-height:1.5}.boot-error-card button{border:0;border-radius:10px;padding:11px 16px;background:#12324a;color:#fff;font-weight:700;cursor:pointer}

/* RC5.0.4 — Responsividade Estrutural 2.2.1
   Camada conservadora: layout principal, navegação, modais e contenção de overflow.
   Regras de negócio e renderização dos módulos permanecem inalteradas. */
html,body{max-width:100%;overflow-x:hidden}
img,svg,canvas{max-width:100%}
#app,.app,main#content,#content{min-width:0;max-width:100%}
.page-head,.section-title,.toolbar,.actions{min-width:0}
.page-head>*,.section-title>*,.toolbar>*{min-width:0}
.table-wrap,.reconcile-table,.ignored-reconcile-table,.bank-import-table{max-width:100%;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain}
.modal{overflow:auto;overscroll-behavior:contain;padding:max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left))}
.modal-card{max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);overscroll-behavior:contain}
.modal-card input,.modal-card select,.modal-card textarea,.modal-card button{max-width:100%}

@media(max-width:850px){
  body{min-width:0}
  header{height:auto;min-height:64px;padding:10px max(12px,env(safe-area-inset-right)) 10px max(12px,env(safe-area-inset-left));align-items:center;flex-wrap:wrap}
  header .app-page-heading{flex:1 1 150px;min-width:0}
  header .app-page-heading strong,header .app-page-heading span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
  header .secondary{margin-left:auto;flex:0 0 auto}
  aside{width:min(86vw,300px);max-width:calc(100vw - 36px);padding-top:env(safe-area-inset-top);box-shadow:12px 0 30px #0004}
  aside.open::after{content:"";position:fixed;left:100%;top:0;width:100vw;height:100dvh;background:#0007;pointer-events:none}
  main,body.menu-collapsed main{width:100%;max-width:100%;padding:84px 12px max(24px,env(safe-area-inset-bottom));overflow-x:hidden}
  .page-head,.section-title{align-items:stretch;flex-direction:column}
  .page-head .actions,.section-title .actions{width:100%;flex-wrap:wrap}
  .page-head .actions>.btn,.section-title .actions>.btn{flex:1 1 150px}
  .toolbar{align-items:stretch}
  .toolbar input,.toolbar select,.toolbar .btn{min-width:0;max-width:100%}
  .toolbar input,.toolbar select{flex:1 1 180px;width:100%}
  .card{max-width:100%;overflow:hidden}
  .kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  .modal{place-items:start center}
  .modal-card,.modal-card.compact{width:100%!important;max-width:100%!important;margin:auto 0;padding:18px 16px 16px;border-radius:14px}
  .modal-close{position:sticky;float:right;top:0;z-index:5;background:#fff;border-radius:50%;box-shadow:0 1px 6px #0002}
  .form-grid{grid-template-columns:1fr!important}
  .span-2{grid-column:auto!important}
  .tabs{overflow-x:auto;flex-wrap:nowrap;padding-bottom:4px;-webkit-overflow-scrolling:touch}
  .tabs button{flex:0 0 auto}
  table{width:max-content;min-width:100%;max-width:none}
  th,td{white-space:nowrap}
  td .actions{white-space:normal;flex-wrap:wrap}
  body.agenda-foundation-active main#content{margin-left:0!important;width:100%!important;max-width:100%!important;overflow:hidden!important}
  body.agenda-foundation-active aside#sidebar{width:min(86vw,300px)!important}
  .foundation-shell,.foundation-layout,.foundation-center,.foundation-stage,.foundation-calendar{min-width:0!important;max-width:100%!important;width:100%!important}
  .foundation-layout{grid-template-columns:1fr!important}
  .foundation-stage{overflow:auto!important;-webkit-overflow-scrolling:touch}
}

@media(max-width:560px){
  .login-wrap{padding:16px max(12px,env(safe-area-inset-right)) max(16px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));place-items:center}
  .login-card{padding:24px 18px;border-radius:16px}
  main,body.menu-collapsed main{padding-left:10px;padding-right:10px}
  .kpis,.executive-kpis,.stock-kpis{grid-template-columns:1fr!important}
  .page-head .actions>.btn,.section-title .actions>.btn,.actions>.btn{flex:1 1 100%;width:100%}
  .toolbar>*{flex-basis:100%!important;width:100%!important}
  .modal{padding:6px}
  .modal-card,.modal-card.compact{max-height:calc(100dvh - 12px)!important;border-radius:12px;padding:16px 12px 14px}
  .modal-card .actions{flex-direction:column;align-items:stretch}
  .modal-card .actions .btn{width:100%}
  #toast{left:12px;right:12px;top:max(70px,calc(env(safe-area-inset-top) + 12px));width:auto;max-width:none}
}

@supports not (height:100dvh){
  .modal-card{max-height:calc(100vh - 24px)}
  @media(max-width:560px){.modal-card,.modal-card.compact{max-height:calc(100vh - 12px)!important}}
}
