/* ===== Layout novo (sidebar, cantos arredondados, sem emojis) com as
   CORES ORIGINAIS do sistema (brand #0f4c6b / accent #147d92) ===== */
:root{
  --gov-blue-900:#0b354b;
  --gov-blue-800:#0f4c6b;
  --gov-blue-700:#135a7d;
  --gov-blue-600:#147d92;
  --gov-gold:#147d92;
  --gov-gold-dark:#0f6377;
  --gov-green:#1f7a4d;
  --gov-red:#a32626;
  --ink:#172033;
  --muted:#5d6a78;
  --line:#dde3ea;
  --surface:#ffffff;
  --bg:#eef2f6;
  --sidebar-w:264px;
  font-family:"Segoe UI",Arial,Helvetica,sans-serif;
  color:var(--ink);
  background:var(--bg);
  --brand:var(--gov-blue-800);
  --accent:var(--gov-gold);
}
*{box-sizing:border-box}
body{margin:0}
main{min-height:100vh}
h1,h2,h3,h4{font-family:"Segoe UI",Arial,sans-serif;letter-spacing:.1px}

/* ===== Login-style cards (login, recovery, gates) ===== */
.login-card{width:min(440px,92vw);margin:10vh auto;background:var(--surface);padding:2.2rem 2rem;border-radius:18px;box-shadow:0 20px 50px #0f4c6b17;border-top:4px solid var(--gov-gold)}
.login-card h1{color:var(--gov-blue-900);font-size:1.35rem;margin:0 0 .35rem}
.login-card p{color:var(--muted);margin-top:0}

label{display:grid;gap:.4rem;font-size:.86rem;font-weight:600;color:#324454}
input,select,textarea{padding:.68rem .75rem;border:1px solid #c3cdd7;border-radius:10px;background:var(--surface);min-width:0;width:100%;font:inherit;color:var(--ink)}
input:focus,select:focus,textarea:focus{outline:none;border-color:var(--gov-blue-600);box-shadow:0 0 0 3px #5c806926}
textarea{resize:vertical}
button{border:0;border-radius:10px;padding:.7rem 1.1rem;background:var(--gov-blue-700);color:#fff;font-weight:600;cursor:pointer;transition:background .15s ease,box-shadow .15s ease}
button:hover{background:var(--gov-blue-600)}
button.secondary{background:transparent;color:var(--gov-blue-700);border:1px solid #c7d6cc}
button.secondary:hover{background:#eef4f8}
.danger{background:var(--gov-red)}
.danger:hover{background:#8f2222}
.cancel-edit{background:#697887}
.cancel-edit:hover{background:#576372}

/* ===== App shell: fixed sidebar + main column ===== */
.app-shell{display:flex;min-height:100vh;align-items:stretch}
.app-shell[hidden]{display:none}
.sidebar{width:var(--sidebar-w);flex:0 0 var(--sidebar-w);background:linear-gradient(180deg,#eef4f7,#e6eff4);border-right:1px solid var(--line);color:var(--ink);display:flex;flex-direction:column;position:sticky;top:0;height:100vh;overflow-y:auto;z-index:20}
.sidebar-brand{display:flex;align-items:center;gap:.7rem;padding:1.5rem 1.3rem;border-bottom:1px solid var(--line)}
.sidebar-brand-text{display:flex;flex-direction:column;line-height:1.3}
.sidebar-brand-text strong{color:var(--gov-blue-900);font-size:1rem;font-weight:700;letter-spacing:-.01em}
.sidebar-brand-text small{color:var(--muted);font-size:.72rem;letter-spacing:.03em;text-transform:uppercase}
.sidebar nav{display:flex;flex-direction:column;gap:.2rem;padding:1.1rem .85rem;flex:1}
.sidebar nav button{background:transparent;color:var(--gov-blue-800);text-align:left;font-weight:500;font-size:.88rem;padding:.68rem .85rem;border-radius:10px;display:flex;align-items:center;gap:.65rem;position:relative;transition:background .15s ease,color .15s ease}
.sidebar nav button:hover{background:#ffffffb0;color:var(--gov-blue-900)}
.sidebar nav button.active{background:var(--surface);color:var(--gov-blue-900);font-weight:700;box-shadow:0 1px 4px #0f4c6b14;border-left:3px solid var(--gov-gold-dark);padding-left:calc(.85rem - 3px)}
.sidebar-footer{padding:1rem .85rem 1.3rem;border-top:1px solid var(--line);display:grid;gap:.5rem}
.sidebar-footer button{width:100%}
.sidebar-toggle{display:none;position:fixed;top:.8rem;left:.8rem;z-index:30;width:2.6rem;height:2.6rem;border-radius:10px;background:var(--gov-blue-800);color:#fff;font-size:1.1rem;box-shadow:0 4px 14px #0f4c6b33}
.sidebar-scrim{position:fixed;inset:0;background:#0b354b99;z-index:15}
.sidebar-scrim[hidden]{display:none}

.app-main{flex:1;min-width:0;display:flex;flex-direction:column}
.topbar{background:var(--surface);border-bottom:1px solid var(--line);padding:.9rem 1.8rem;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:.75rem;position:sticky;top:0;z-index:10;box-shadow:0 1px 0 #0000000d}
.topbar-breadcrumb{display:flex;flex-direction:column;line-height:1.3}
.topbar-eyebrow{font-size:.72rem;text-transform:uppercase;letter-spacing:.06em;color:var(--muted)}
.topbar-breadcrumb strong{font-size:1.15rem;color:var(--gov-blue-900)}
.topbar-controls{display:flex;align-items:center;gap:1rem;flex-wrap:wrap}
.user-label{color:var(--muted);font-size:.86rem;font-weight:600}

.content-area{max-width:1240px;width:100%;margin:0 auto;padding:1.6rem 1.8rem 3rem}

/* Header/nav select + competency controls now live in the light topbar */
.active-competency-context{display:flex;align-items:center;gap:.55rem;color:var(--muted);font-size:.8rem;font-weight:600}
.active-competency-context select{width:auto;min-width:110px;padding:.45rem .6rem}
.competency-switcher{display:inline-flex;align-items:center;gap:.35rem}
.competency-nav{background:var(--surface);border:1px solid #c3cdd7;color:var(--gov-blue-700);border-radius:6px;width:1.9rem;height:1.9rem;line-height:1;cursor:pointer;font-size:.8rem;display:inline-flex;align-items:center;justify-content:center;padding:0}
.competency-nav:hover:not(:disabled){background:#eef2f6}
.competency-nav:disabled{opacity:.3;cursor:default}
.topbar button.secondary{background:var(--surface);color:var(--gov-blue-700);border:1px solid #c3cdd7}
.topbar button.secondary:hover{background:#eef2f6}

/* ===== Cards ===== */
.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:1rem}
.cards article,.panel{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:1.1rem 1.2rem;box-shadow:0 1px 3px #0f4c6b12}
.cards article{border-top:3px solid var(--gov-gold);position:relative}
.cards span{display:block;color:var(--muted);font-size:.86rem;font-weight:600}
.cards strong{display:block;font-size:2.1rem;color:var(--gov-blue-800);margin-top:.4rem;font-weight:800}

.columns,.form-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:1rem}
.form-row>*{min-width:0}
.panel{margin:1.1rem 0}
.panel form,.panel label,form.panel{gap:1rem}
form.panel{display:grid}
.panel>h3,.panel>h4{margin-top:0;color:var(--gov-blue-900)}
h2{color:var(--gov-blue-900);border-bottom:3px solid var(--gov-gold);display:inline-block;padding-bottom:.35rem;margin-bottom:1.1rem}

.notice{background:#fff6e0;border-left:5px solid var(--gov-gold-dark);padding:1rem;margin-top:1rem;border-radius:0 8px 8px 0}
.message{color:var(--gov-red)}
.toast{position:fixed;right:1rem;bottom:1rem;background:var(--gov-blue-900);color:white;padding:1rem 1.2rem;border-radius:10px;box-shadow:0 10px 30px #0005}

/* ===== Tables — zebra striping, sticky headers preserved ===== */
table{border-collapse:collapse;width:100%}
th,td{text-align:left;padding:.65rem .7rem;border-bottom:1px solid var(--line)}
th{color:var(--gov-blue-900);background:#f3f6f9;font-size:.8rem;text-transform:uppercase;letter-spacing:.03em;font-weight:700}
tbody tr:nth-child(even){background:#f7f9fb}
tbody tr:hover{background:#eef4f8}
.table-scroll{overflow-x:auto}
.table-scroll table{min-width:980px}
.money{white-space:nowrap}

@media(max-width:900px){
  .sidebar{position:fixed;left:0;top:0;transform:translateX(-100%);transition:transform .2s ease;box-shadow:0 0 40px #0008}
  .sidebar.sidebar-open{transform:translateX(0)}
  .sidebar-toggle{display:inline-flex;align-items:center;justify-content:center}
  .topbar{padding-left:3.6rem}
  .content-area{padding-left:1.1rem;padding-right:1.1rem}
}
@media(max-width:650px){.topbar,.content-area{padding-left:1rem;padding-right:1rem}}

.form-actions{display:flex;gap:.75rem;justify-content:flex-end}
.selection-hint{color:var(--muted);font-size:.9rem;margin-top:0}
.selectable-row{cursor:pointer}
.selectable-row:hover{background:#dfeaf1}
.selectable-row.selected{background:#d8ecf7;outline:2px solid var(--accent);outline-offset:-2px}

.edit-column,.edit-cell{width:48px;text-align:center}
.row-actions{display:inline-flex;gap:.3rem;align-items:center}
.row-edit-button{display:inline-grid;place-items:center;width:34px;height:34px;padding:0;border:1px solid #b7c3cd;background:#fff;color:var(--gov-blue-700);font-size:1.2rem;line-height:1;opacity:0;transform:translateY(2px);transition:opacity .15s ease,transform .15s ease,background .15s ease;border-radius:7px}
.editable-row:hover .row-edit-button,.editable-row:focus-within .row-edit-button{opacity:1;transform:none}
.row-edit-button:hover,.row-edit-button:focus-visible{background:#e5f1f5;outline:2px solid var(--accent);outline-offset:1px}
.editable-row:hover{background:#eef4f8}
@media(hover:none),(max-width:900px){.row-edit-button{opacity:1;transform:none}}

.registry-panel{min-width:0}
.registry-panel h3{margin-top:0}
.search-field{margin-bottom:.8rem}
.search-field input{padding-left:2.35rem;background-color:#fff;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%235d6a78' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:.7rem center}
.registry-table-scroll{overflow:auto;border:1px solid var(--line);border-radius:9px}
.registry-table-scroll.compact{max-height:260px}
.registry-table-scroll.professionals{max-height:440px}
.registry-table-scroll table{min-width:560px}
.registry-table-scroll.professionals table{min-width:980px}
.registry-table-scroll thead{position:sticky;top:0;z-index:2;background:#f3f6f9;box-shadow:0 1px 0 var(--line)}
.registry-table-scroll tbody tr:last-child td{border-bottom:0}

.professional-filter{padding-left:2.35rem;background-color:#fff;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%235d6a78' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:.7rem center;margin-bottom:.4rem}
.term-boundary-badge{display:inline-block;padding:.25rem .6rem;background:#eef2f6;color:var(--gov-blue-800);border-radius:6px;font-size:.82rem;font-weight:700}
.link-button{background:none;color:var(--gov-blue-700);font-weight:600;padding:.5rem 0;margin-top:.5rem;text-decoration:underline;cursor:pointer}
#change-password-form[hidden]{display:none}
#password-recovery-code-box{font-size:1rem}
#password-recovery-code-box strong{font-size:1.3rem;letter-spacing:.15em;color:var(--gov-blue-800)}
.checkbox-field{display:flex;flex-direction:row;align-items:flex-start;gap:.5rem;font-weight:400}
.checkbox-field input{width:auto;margin-top:.2rem}

.registry-table-scroll.roles table,.registry-table-scroll.departments table{min-width:0;table-layout:fixed}
.registry-table-scroll.roles th:first-child{width:38%}
.registry-table-scroll.roles th:last-child,.registry-table-scroll.departments th:last-child{width:46px}
.registry-table-scroll.departments th:first-child{width:43%}
.registry-table-scroll.departments th:nth-child(2){width:20%}
.registry-table-scroll.roles th,.registry-table-scroll.roles td,.registry-table-scroll.departments th,.registry-table-scroll.departments td{padding-left:.5rem;padding-right:.5rem;overflow-wrap:anywhere}
.role-service-cell{position:relative;padding-right:44px!important}
.role-service-cell .row-edit-button{position:absolute;right:5px;top:50%;opacity:0;transform:translateY(-50%)}
.editable-row:hover .role-service-cell .row-edit-button{opacity:0;transform:translateY(-50%)}
.editable-row .role-service-cell:hover .row-edit-button,.editable-row .role-service-cell:focus-within .row-edit-button{opacity:1;transform:translateY(-50%)}
.role-service-cell.editing{padding:.35rem!important;overflow:visible}
.inline-role-service-editor{display:grid;grid-template-columns:minmax(0,1fr) 32px 32px;align-items:center;gap:.3rem}
.inline-role-service-editor select{padding:.48rem;max-width:100%}
.inline-role-service-editor button{display:grid;place-items:center;width:32px;height:32px;padding:0;font-size:1rem}
.inline-role-service-confirm{background:var(--gov-green)}
.inline-role-service-cancel{background:var(--gov-red)}

.shift-quantity-cell{position:relative;min-width:92px;padding-right:44px}
.shift-quantity-cell .row-edit-button{position:absolute;right:5px;top:50%;opacity:0;transform:translateY(-50%)}
.editable-row:hover .shift-quantity-cell .row-edit-button{opacity:0;transform:translateY(-50%)}
.editable-row .shift-quantity-cell:hover .row-edit-button,.editable-row .shift-quantity-cell:focus-within .row-edit-button{opacity:1;transform:translateY(-50%)}
.shift-quantity-cell.editing{padding:.35rem;min-width:190px}
.inline-shift-editor{display:flex;align-items:center;gap:.3rem}
.inline-shift-editor input{width:86px;padding:.48rem}
.inline-shift-editor button{display:grid;place-items:center;width:32px;height:32px;padding:0;font-size:1rem}
.inline-shift-confirm{background:var(--gov-green)}
.inline-shift-cancel{background:var(--gov-red)}

.hour-duration-cell{position:relative;min-width:145px;padding-right:44px}
.hour-duration-cell .row-edit-button{position:absolute;right:5px;top:50%;opacity:0;transform:translateY(-50%)}
.editable-row:hover .hour-duration-cell .row-edit-button{opacity:0;transform:translateY(-50%)}
.editable-row .hour-duration-cell:hover .row-edit-button,.editable-row .hour-duration-cell:focus-within .row-edit-button{opacity:1;transform:translateY(-50%)}
.hour-duration-cell.editing{padding:.35rem;min-width:205px}
.inline-hour-duration-editor{display:grid;grid-template-columns:minmax(82px,1fr) 32px 32px;align-items:center;gap:.3rem}
.inline-hour-duration-editor input{padding:.48rem}
.inline-hour-duration-editor button{display:grid;place-items:center;width:32px;height:32px;padding:0;font-size:1rem}
.inline-hour-duration-confirm{background:var(--gov-green)}
.inline-hour-duration-cancel{background:var(--gov-red)}

.hour-complement-cell{position:relative;min-width:145px;padding-right:44px}
.hour-complement-cell .row-edit-button{position:absolute;right:5px;top:50%;opacity:0;transform:translateY(-50%)}
.editable-row:hover .hour-complement-cell .row-edit-button{opacity:0;transform:translateY(-50%)}
.editable-row .hour-complement-cell:hover .row-edit-button,.editable-row .hour-complement-cell:focus-within .row-edit-button{opacity:1;transform:translateY(-50%)}
.hour-complement-cell.editing{padding:.35rem;min-width:205px}
.inline-hour-complement-editor{display:grid;grid-template-columns:minmax(82px,1fr) 32px 32px;align-items:center;gap:.3rem}
.inline-hour-complement-editor input{padding:.48rem}
.inline-hour-complement-editor button{display:grid;place-items:center;width:32px;height:32px;padding:0;font-size:1rem}
.inline-hour-complement-confirm{background:var(--gov-green)}
.inline-hour-complement-cancel{background:var(--gov-red)}

.hour-limit-cell{position:relative;min-width:145px;padding-right:44px}
.hour-limit-cell .row-edit-button{position:absolute;right:5px;top:50%;opacity:0;transform:translateY(-50%)}
.editable-row:hover .hour-limit-cell .row-edit-button{opacity:0;transform:translateY(-50%)}
.editable-row .hour-limit-cell:hover .row-edit-button,.editable-row .hour-limit-cell:focus-within .row-edit-button{opacity:1;transform:translateY(-50%)}
.hour-limit-cell.editing{padding:.35rem;min-width:205px}
.inline-hour-limit-editor{display:grid;grid-template-columns:minmax(82px,1fr) 32px 32px;align-items:center;gap:.3rem}
.inline-hour-limit-editor input{padding:.48rem}
.inline-hour-limit-editor button{display:grid;place-items:center;width:32px;height:32px;padding:0;font-size:1rem}
.inline-hour-limit-confirm{background:var(--gov-green)}
.inline-hour-limit-cancel{background:var(--gov-red)}

.registry-table-scroll.hours-table-scroll table{min-width:0;width:100%;table-layout:fixed;font-size:.82rem}
.hours-table-scroll th,.hours-table-scroll td{padding-left:.5rem;padding-right:.5rem;overflow-wrap:anywhere}
.hours-table-scroll th:nth-child(1){width:12%}
.hours-table-scroll th:nth-child(2){width:7%}
.hours-table-scroll th:nth-child(3){width:15%}
.hours-table-scroll th:nth-child(4){width:9%}
.hours-table-scroll th:nth-child(5){width:10%}
.hours-table-scroll th:nth-child(6){width:8%}
.hours-table-scroll th:nth-child(7){width:8%}
.hours-table-scroll th:nth-child(8){width:7%}
.hours-table-scroll th:nth-child(9){width:8%}
.hours-table-scroll th:nth-child(10){width:8%}
.hours-table-scroll th:nth-child(11){width:48px}
.hours-table-scroll .hour-duration-cell,.hours-table-scroll .hour-complement-cell,.hours-table-scroll .hour-limit-cell{min-width:0;padding-right:32px}
.hours-table-scroll .hour-duration-cell .row-edit-button,.hours-table-scroll .hour-complement-cell .row-edit-button,.hours-table-scroll .hour-limit-cell .row-edit-button{right:3px;width:28px;height:28px;font-size:1rem}
.editable-row:focus-within .hour-duration-cell .row-edit-button,.editable-row:focus-within .hour-complement-cell .row-edit-button,.editable-row:focus-within .hour-limit-cell .row-edit-button{opacity:0}
.editable-row .hour-duration-cell:hover .row-edit-button,.editable-row .hour-duration-cell:focus-within .row-edit-button,.editable-row .hour-complement-cell:hover .row-edit-button,.editable-row .hour-complement-cell:focus-within .row-edit-button,.editable-row .hour-limit-cell:hover .row-edit-button,.editable-row .hour-limit-cell:focus-within .row-edit-button{opacity:1}
.hours-table-scroll .hour-duration-cell.editing,.hours-table-scroll .hour-complement-cell.editing,.hours-table-scroll .hour-limit-cell.editing{min-width:0;overflow:visible}
.hours-table-scroll .hour-duration-cell.editing>div,.hours-table-scroll .hour-complement-cell.editing>div,.hours-table-scroll .hour-limit-cell.editing>div{position:absolute;right:0;top:50%;z-index:4;width:205px;transform:translateY(-50%);padding:.3rem;background:#fff;border:1px solid #9fb2bf;border-radius:7px;box-shadow:0 6px 18px #0f4c6b2e}
.hours-table-scroll .hour-duration-cell>.row-edit-button,.hours-table-scroll .hour-complement-cell>.row-edit-button,.hours-table-scroll .hour-limit-cell>.row-edit-button{opacity:0!important}
.hours-table-scroll .hour-duration-cell:hover>.row-edit-button,.hours-table-scroll .hour-complement-cell:hover>.row-edit-button,.hours-table-scroll .hour-limit-cell:hover>.row-edit-button,.hours-table-scroll .row-edit-button:focus-visible{opacity:1!important}

.section-tabs{display:flex;gap:.45rem;margin:1rem 0;border-bottom:2px solid var(--line)}
.section-tab-button{border-radius:8px 8px 0 0;background:#e5ebf0;color:#314554;padding:.8rem 1.4rem;font-weight:700}
.section-tab-button.active{background:var(--gov-blue-800);color:#fff}
.section-tab-button:focus-visible{outline:3px solid #7bc1d1;outline-offset:2px}
.section-tab-pane[hidden]{display:none}

.billing-cards strong{font-size:1.35rem}
.billing-warning{margin:.45rem 0;padding:.65rem .8rem;border-left:4px solid var(--gov-gold-dark);background:#fff8df;border-radius:0 8px 8px 0}
.billing-ok{padding:.65rem .8rem;border-left:4px solid var(--gov-green);background:#edf8f1;border-radius:0 8px 8px 0}
.billing-warnings:empty{display:none}

.invoice-controls{position:relative;z-index:1}
.invoice-scroll{overflow:auto;padding:1rem 0}
.invoice-document{position:relative;width:1120px;height:792px;margin:auto;background:#fff url('/static/assets/invoice-letterhead.jpeg') center/100% 100% no-repeat;color:#111;font-family:'Times New Roman',serif;box-shadow:0 8px 28px #0f4c6b2e}
.invoice-content{position:absolute;inset:190px 95px 100px 160px;font-size:11px}
.invoice-content h3{font-size:16px;margin:0 0 3px}
.invoice-content p{margin:1px 0}
.invoice-identification{display:flex;justify-content:space-between;align-items:center;margin:13px 0 4px;font-size:13px}
.invoice-meta{display:grid;grid-template-columns:75px 1fr 45px 210px;gap:3px 6px;margin-bottom:8px}
.invoice-meta span:nth-of-type(5){grid-column:1}
.invoice-meta strong:last-child{grid-column:2/5}
.invoice-table{table-layout:fixed;font-size:9.5px;background:#fff}
.invoice-table th,.invoice-table td{border:1px solid #111;padding:3px 3px;text-align:center;line-height:1.05}
.invoice-table thead th,.invoice-table tfoot th{background:#dfe7f2;font-weight:700;color:#111;text-transform:none;letter-spacing:normal}
.invoice-table th:nth-child(1){width:4%}
.invoice-table th:nth-child(2){width:23%}
.invoice-table th:nth-child(3){width:9%}
.invoice-table th:nth-child(4){width:6%}
.invoice-table th:nth-child(5){width:10%}
.invoice-table th:nth-child(6){width:9%}
.invoice-table th:nth-child(7){width:10%}
.invoice-table th:nth-child(8){width:9%}
.invoice-table th:nth-child(9){width:8%}
.invoice-table th:nth-child(10){width:12%}
.invoice-table td:nth-child(2){text-align:left}
.invoice-table td:nth-child(1),.invoice-table td:nth-child(3),.invoice-table td:nth-child(5),.invoice-table td:nth-child(6),.invoice-table td:nth-child(7),.invoice-table td:nth-child(8),.invoice-table td:nth-child(9),.invoice-table td:nth-child(10){text-align:right;padding-right:5px}
.invoice-table tfoot th#invoice-total-month-quantity,.invoice-table tfoot th#invoice-total-month-value,.invoice-table tfoot th#invoice-total-accumulated,.invoice-table tfoot th#invoice-total-residue,.invoice-table tfoot th#invoice-total-residue-value{text-align:right;padding-right:5px}
.invoice-quantity{border:0;border-bottom:1px dashed #668;width:100%;padding:2px 5px 2px 2px;text-align:right;font:inherit;border-radius:0}
.invoice-notes{margin-top:7px;font-size:9.5px}
.invoice-attestation{text-align:right;margin-top:-18px}
.invoice-signatures{display:flex;justify-content:space-between;margin-top:71px}
.invoice-signatures>div{width:285px}
.invoice-signatures>div:last-child{text-align:center}
.invoice-signatures span{display:block;border-top:1px solid #111;margin-bottom:4px}
.invoice-signatures p{margin:2px 0}
.invoice-content strong{font-weight:700}
@media print{
  @page{size:A4 landscape;margin:0}
  html,body{width:297mm;height:210mm;margin:0!important;overflow:hidden!important;background:#fff;-webkit-print-color-adjust:exact;print-color-adjust:exact;color-adjust:exact}
  *{-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important;color-adjust:exact!important}
  main{height:0!important;min-height:0!important}
  body *{visibility:hidden}
  #invoice-document,#invoice-document *{visibility:visible}
  #invoice-document{position:fixed;left:0;top:0;width:297mm;height:210mm;margin:0;box-shadow:none;background:#fff url('/static/assets/invoice-letterhead.jpeg') center/100% 100% no-repeat}
  .invoice-content{inset:50.4mm 25.1mm 26.5mm 42.4mm}
  .invoice-quantity{border:0;background:transparent;color:#111;-webkit-appearance:none;appearance:textfield}
  .invoice-quantity::-webkit-inner-spin-button,.invoice-quantity::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
}
.invoice-note-manager{margin:1rem 0;padding:1rem;border:1px solid var(--line);border-radius:8px;background:#f7fafb}
.invoice-note-manager h4{margin:0 0 .8rem}
.invoice-note-manager form{display:grid;gap:.7rem}
.invoice-notes-list{display:grid;gap:.5rem;margin-top:.8rem}
.invoice-note-row{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:.5rem;padding:.6rem .7rem;background:#fff;border:1px solid var(--line);border-radius:7px}
.invoice-note-row span{overflow-wrap:anywhere}
.invoice-note-row button{padding:.45rem .7rem}
.invoice-note-row .delete-note{background:var(--gov-red)}
.invoice-notes ol{margin:3px 0 0;padding-left:17px}
.invoice-notes li{margin:1px 0}

.competency-status-bar{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap;margin:.8rem 0}
.competency-status-bar span{color:var(--muted);font-size:.9rem}
.competency-status-bar strong{color:var(--gov-blue-800);padding:.25rem .6rem;background:#eef2f6;border-radius:6px}
.competency-status-bar button{padding:.55rem .9rem}
.reopen-justification-form{margin:.8rem 0;padding:1rem;border:1px solid var(--line);border-radius:8px;background:#f7fafb;gap:.7rem}
.reopen-justification-form:not([hidden]){display:grid}
.closed-competency-notice{background:#fdeaea;border-left-color:var(--gov-red)}

.report-download-bar{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap;margin-bottom:1rem}
.report-download-bar span{color:var(--muted);font-size:.9rem}
.report-download-button{display:inline-flex;align-items:center;gap:.4rem;padding:.55rem .9rem;border-radius:7px;background:var(--gov-blue-700);color:white;font-weight:700;text-decoration:none;font-size:.9rem}
.report-download-button:hover{background:var(--gov-blue-600)}

.panel-header{display:flex;align-items:center;justify-content:space-between;gap:.75rem;flex-wrap:wrap}
.panel-header h3{margin:0}
.print-report-button{display:inline-flex;align-items:center;gap:.35rem;padding:.4rem .8rem;border-radius:20px;background:transparent;color:var(--gov-blue-700);font-weight:700;font-size:.78rem;text-decoration:none;border:1.5px solid #c7d3dc;white-space:nowrap;transition:background .15s ease,color .15s ease,border-color .15s ease}
.print-report-button span{font-size:.85em}
.print-report-button:hover{background:var(--gov-blue-700);color:white;border-color:var(--gov-blue-700)}

#rounding-report-section table td:nth-child(1),#rounding-report-section table th:nth-child(1),#rounding-report-section table td:nth-child(10),#rounding-report-section table th:nth-child(10){text-align:center}
#rounding-report-section table td:nth-child(3),#rounding-report-section table td:nth-child(4),#rounding-report-section table td:nth-child(6),#rounding-report-section table td:nth-child(7),#rounding-report-section table td:nth-child(8),#rounding-report-section table td:nth-child(9),#rounding-report-section table th:nth-child(3),#rounding-report-section table th:nth-child(4),#rounding-report-section table th:nth-child(6),#rounding-report-section table th:nth-child(7),#rounding-report-section table th:nth-child(8),#rounding-report-section table th:nth-child(9){text-align:right;padding-right:.9rem;white-space:nowrap}
#traces-report-section table td:nth-child(5),#traces-report-section table th:nth-child(5){text-align:center;white-space:nowrap}
#traces-report-section table td:nth-child(6),#traces-report-section table td:nth-child(7),#traces-report-section table td:nth-child(8),#traces-report-section table th:nth-child(6),#traces-report-section table th:nth-child(7),#traces-report-section table th:nth-child(8){text-align:right;padding-right:.9rem;white-space:nowrap}
.hours-table-scroll td:nth-child(2),.hours-table-scroll th:nth-child(2),.hours-table-scroll td:nth-child(10),.hours-table-scroll th:nth-child(10){text-align:center}
.hours-table-scroll td:nth-child(6),.hours-table-scroll td:nth-child(7),.hours-table-scroll td:nth-child(8),.hours-table-scroll td:nth-child(9),.hours-table-scroll th:nth-child(6),.hours-table-scroll th:nth-child(7),.hours-table-scroll th:nth-child(8),.hours-table-scroll th:nth-child(9){text-align:right}
.hours-table-scroll td:nth-child(9),.hours-table-scroll th:nth-child(9){padding-right:.9rem}

.password-field{position:relative;display:block}
.password-field input{padding-right:2.6rem}
.password-field button{position:absolute;right:.3rem;top:50%;transform:translateY(-50%);background:transparent;color:var(--muted);padding:.35rem;border-radius:5px;font-size:1.05rem;line-height:1}
.password-field button:hover{background:#eef2f6}
.print-hours-bar{margin:.7rem 0}

body.competency-locked #horas form,body.competency-locked #atendimentos form,body.competency-locked #plantoes form,body.competency-locked .invoice-note-manager form{opacity:.55;pointer-events:none}
body.competency-locked #horas .row-edit-button,body.competency-locked #atendimentos .edit-cell .row-edit-button,body.competency-locked #plantoes .row-edit-button,body.competency-locked .invoice-note-row button{pointer-events:none;opacity:.35}

.invoice-controls input[readonly]{background:#eef2f6;color:var(--muted);cursor:default}
.invoice-month-cell{position:relative}
.invoice-month-cell .item-detail-button{position:absolute;right:1px;top:50%;transform:translateY(-50%);opacity:0;border:0;background:transparent;cursor:pointer;font-size:10px;line-height:1;padding:2px;border-radius:3px}
.invoice-month-cell:hover .item-detail-button,.invoice-month-cell .item-detail-button:focus-visible{opacity:1;background:#dfe7f2}

.modal-overlay{position:fixed;inset:0;background:#0b354b99;display:flex;align-items:center;justify-content:center;z-index:50;padding:1.5rem}
.modal-card{background:#fff;border-radius:12px;max-width:min(900px,100%);max-height:88vh;width:100%;display:flex;flex-direction:column;padding:1.4rem;gap:.9rem;box-shadow:0 20px 60px #0b354b3a}
.modal-header{display:flex;justify-content:space-between;align-items:flex-start;gap:1rem}
.modal-header h3{margin:0 0 .2rem;color:var(--gov-blue-900)}
.modal-header button{width:2.1rem;height:2.1rem;padding:0;border-radius:50%}
.modal-card .table-scroll{overflow:auto}
.modal-overlay[hidden]{display:none}

.status-badge{display:inline-block;padding:.25rem .6rem;background:#eef2f6;color:var(--gov-blue-800);border-radius:6px;font-size:.82rem;font-weight:700}
.status-badge.closed{background:#fdeaea;color:var(--gov-red)}
