*{box-sizing:border-box}body{margin:0;background:#f3f5f2;color:#18382e;font-family:Segoe UI,Arial,sans-serif;line-height:1.55}header{background:#173f33;color:white;padding:24px 5%;display:flex;align-items:center;justify-content:space-between;gap:24px}a{color:#176a52}header a{color:white;text-decoration:none}.brand{letter-spacing:3px;font-size:16px}nav{display:flex;align-items:center;gap:22px;flex-wrap:wrap}nav form{margin:0}main{max-width:1140px;margin:48px auto;padding:0 24px;min-height:65vh}h1{font-size:38px;line-height:1.2;font-weight:600;letter-spacing:-1px}h2{font-size:23px;font-weight:600}.eyebrow{text-transform:uppercase;letter-spacing:2px;font-size:12px;color:#53766b}.lead{font-size:18px;max-width:660px;color:#52665e}.badge{border:1px solid #7b9d90;border-radius:24px;padding:5px 12px;font-size:12px}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(270px,1fr));gap:20px}.card{background:white;padding:28px;border:1px solid #d8e2db;border-radius:12px;margin-bottom:20px}.card a{font-weight:600}.auth{max-width:480px;margin:60px auto}label{display:block;font-weight:600;margin:18px 0 6px}input,select,textarea{display:block;width:100%;padding:11px 12px;border:1px solid #9eb5a9;border-radius:6px;font:inherit;background:white;color:#18382e}button,.button{display:inline-block;border:0;border-radius:6px;padding:12px 20px;background:#195b45;color:white;font:inherit;font-weight:600;text-decoration:none;cursor:pointer;margin-top:20px}button:hover{background:#103c2e}.quiet{background:transparent;color:inherit;margin:0;padding:5px 8px;border:1px solid #78988b}.danger{background:#953d35}table{width:100%;border-collapse:collapse;font-size:14px}th,td{padding:14px 10px;border-bottom:1px solid #d9e3dd;text-align:left;overflow-wrap:anywhere}code{overflow-wrap:anywhere}.validation-summary-errors,.field-validation-error{color:#a02a22}.notice{background:#e6efe8;border-left:4px solid #477c61;padding:16px;margin:20px 0}.muted{color:#63756c;font-size:14px}footer{padding:28px 5%;color:#63756c;border-top:1px solid #d5e0d7}a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #ca981f;outline-offset:3px}.scroll{overflow-x:auto}@media(max-width:650px){header{align-items:flex-start;flex-direction:column}h1{font-size:30px}main{margin:28px auto}.card{padding:20px}}

input[type=checkbox]{display:inline-block;width:auto;vertical-align:middle;margin-right:8px}
.tables-menu{position:relative}
.tables-menu summary{display:flex;align-items:center;gap:8px;list-style:none;cursor:pointer;padding:8px 10px;border:1px solid #78988b;border-radius:6px;font-weight:600}
.tables-menu summary::-webkit-details-marker{display:none}
.tables-menu summary:focus-visible{outline:3px solid #ca981f;outline-offset:3px}
.tables-menu[open] summary,.tables-menu summary:hover{background:#245441}
.tables-menu[open] .tables-chevron{transform:rotate(180deg)}
.tables-icon{flex-shrink:0}
.tables-menu-links{position:absolute;top:calc(100% + 8px);left:0;z-index:50;display:flex;flex-direction:column;gap:2px;min-width:280px;max-width:90vw;max-height:65vh;overflow-y:auto;background:#fff;color:#18382e;border:1px solid #d8e2db;border-radius:8px;padding:8px;box-shadow:0 8px 24px #0003}
header .tables-menu-links a{display:block;color:#18382e;padding:8px 12px;border-radius:4px;white-space:normal}
header .tables-menu-links a:hover,header .tables-menu-links a:focus-visible{background:#e6efe8}
@media(max-width:650px){.tables-menu-links{min-width:0;width:min(300px,85vw);max-height:55vh}}
.tables-menu-panel{position:absolute;top:calc(100% + 8px);left:0;z-index:50;width:310px;max-width:85vw;background:#fff;color:#18382e;border:1px solid #d8e2db;border-radius:8px;padding:8px;box-shadow:0 8px 24px #0003}
.tables-menu-search{padding:0 8px 8px}
.tables-menu-search label{margin:4px 0 6px;font-size:14px}
.tables-menu-search input{margin:0;font-size:15px}
.tables-search-status{font-size:13px;margin:6px 0 0}
.tables-search-status:empty{display:none}
.tables-menu .tables-menu-links{position:static;min-width:0;width:100%;max-width:100%;max-height:50vh;border:0;padding:0;box-shadow:none}
header .tables-menu-links a[hidden]{display:none}
@media(max-width:650px){.tables-menu .tables-menu-links{max-height:45vh}}
.catalog-footer{margin-top:22px;padding-top:14px;border-top:1px solid #d9e3dd}
.catalog-pagination{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.catalog-pagination a{display:inline-block;padding:7px 11px;border:1px solid #9eb5a9;border-radius:5px;text-decoration:none}
.catalog-pagination a:hover{background:#e6efe8}
.catalog-pagination a[aria-current=page]{background:#195b45;color:white;border-color:#195b45;font-weight:700}
.pagination-gap{padding:0 5px}
.catalog-totals{margin:12px 0 0;font-size:14px}

/* O resumo válido contém apenas um item vazio gerado pelo Razor. */
.validation-summary-valid,.field-validation-valid{display:none}

/* Separação entre as ações de pesquisa dos cadastros. */
form[method="get"] > button + a.button{margin-inline-start:8px}
.catalog-print-link{margin:0 0 14px}
.catalog-print-view header,.catalog-print-view footer{display:none}
.catalog-print-view main > :not(.catalog-print-content):not(.catalog-print-toolbar){display:none}
.catalog-print-content{background:#fff;padding:24px;border:1px solid #d8e2db}
.catalog-print-toolbar{display:flex;align-items:center;gap:8px;margin-bottom:20px;flex-wrap:wrap}
.catalog-print-toolbar .button,.catalog-print-toolbar button{margin-top:0}
@media print{
 @page{size:auto;margin:14mm}
 body.catalog-print-view{background:#fff;color:#000}
 .catalog-print-view main{max-width:none;min-height:0;margin:0;padding:0}
 .catalog-print-toolbar{display:none!important}
 .catalog-print-content{border:0;padding:0}
 .catalog-print-content table{font-size:10pt}
 .catalog-print-content th,.catalog-print-content td{padding:5px;border-color:#888}
 .catalog-print-content thead{display:table-header-group}
 .catalog-print-content tr{break-inside:avoid}
 .catalog-print-content a{color:#000;text-decoration:none}
 .catalog-print-content h1{font-size:20pt}
}
.catalog-search-actions{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:20px}
.catalog-search-actions button,.catalog-search-actions .button{margin:0}
.catalog-search-actions .catalog-print-link{margin:0}

.catalog-import-menu{position:relative}
.catalog-import-menu summary{list-style:none;cursor:pointer}
.catalog-import-menu summary::-webkit-details-marker{display:none}
.catalog-import-menu summary:focus-visible{outline:3px solid #ca981f;outline-offset:3px}
.catalog-import-options{position:absolute;top:calc(100% + 8px);left:0;z-index:50;min-width:240px;max-width:85vw;background:#fff;border:1px solid #d8e2db;border-radius:8px;padding:8px;box-shadow:0 8px 24px #0003}
.catalog-import-options a{display:block;color:#176a52;text-decoration:none;padding:10px 12px;border-radius:4px}
.catalog-import-options a:hover,.catalog-import-options a:focus-visible{background:#e6efe8}
@media print{.catalog-import-menu{display:none}}

/* Área de implantação: fundo exclusivo da página da empresa. */
body.company-workspace-view{background:#C6C6C6}
.company-workspace-view main{max-width:1440px}
.company-workspace{padding-bottom:20px}
.company-workspace-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:24px;margin-bottom:28px}
.company-workspace-heading h1{margin:8px 0 14px}
.company-workspace-heading .lead{max-width:800px;color:#29483c}
.company-workspace-heading>.button{white-space:nowrap}
.company-selection,.company-context{border-top:5px solid #195b45}
.company-context h2{font-size:28px;margin:6px 0 12px}
.company-context-tags{display:flex;gap:8px;flex-wrap:wrap;margin:18px 0}
.company-context-tags span{background:#e6efe8;border-radius:20px;padding:5px 12px;font-size:14px}
.company-choices,.company-catalog-links{display:grid;grid-template-columns:repeat(auto-fit,minmax(235px,1fr));gap:12px}
.company-choices a,.company-catalog-links a{display:flex;justify-content:space-between;gap:12px;padding:16px 18px;background:#fff;border:1px solid #9eb5a9;border-radius:8px;text-decoration:none;font-weight:600}
.company-choices a:hover,.company-catalog-links a:hover{background:#e6efe8}
.company-work-choices{display:flex;flex-wrap:wrap;gap:10px}
.company-work-choices a{padding:10px 14px;border:1px solid #9eb5a9;border-radius:6px;text-decoration:none}
.company-work-choices .selected{background:#195b45;color:#fff;border-color:#195b45}
.company-section-nav{display:flex;flex-wrap:wrap;gap:10px;margin:24px 0 32px}
.company-section-nav a{background:#173f33;color:#fff;padding:10px 15px;text-decoration:none;border-radius:6px}
.company-section{scroll-margin-top:24px;margin:38px 0}
.company-section-heading{margin-bottom:20px}
.company-section-heading h2{font-size:28px;margin:4px 0 10px}
.company-section-heading p{max-width:900px}
.company-module-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(285px,1fr));gap:18px}
.company-module{display:flex;flex-direction:column;margin:0;padding:24px}
.company-module h3{font-size:21px;line-height:1.3;margin:12px 0 4px}
.company-module p{flex:1;color:#52665e}
.company-module .button{align-self:flex-start}
.company-module-label{font-size:12px;letter-spacing:1px;text-transform:uppercase;color:#326850}
.company-module-pending{background:#f5f2e9}
@media(max-width:700px){.company-workspace-heading{flex-direction:column;gap:0}.company-module-grid{grid-template-columns:1fr}.company-context h2{font-size:24px}}

.company-profile-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));gap:12px 22px;align-items:start}
.company-profile-fields>div{min-width:0}
.company-profile-fields label{margin-top:6px}
.company-profile-fields input,.company-profile-fields textarea{width:100%}
@media(max-width:600px){.company-profile-fields{grid-template-columns:1fr}}

.company-profile-value { white-space: pre-wrap; overflow-wrap: anywhere; }

.company-inline-action{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.company-inline-action input{flex:1;min-width:120px}.company-inline-action button{margin-top:0;white-space:nowrap}.company-cnae-options{max-height:45vh;overflow:auto;display:grid;gap:8px}.company-cnae-options button{text-align:left;margin:0;padding:10px}#company-cnae-dialog{width:min(860px,95vw);max-height:90vh;border:1px solid #9eb5a9;border-radius:12px;padding:24px}#company-cnae-dialog::backdrop{background:rgb(0 0 0 / 45%)}

/* Compact codes; descriptive fields use the remaining row width. */
.company-profile-fields{display:flex;flex-wrap:wrap;align-items:flex-start;gap:12px 22px}
.company-profile-fields>div{flex:1 1 260px;min-width:0;max-width:100%}
.company-profile-fields>.company-code-field{flex:0 1 154px;min-width:130px}
.company-code-field input{width:calc(8ch + 26px);max-width:100%;font-variant-numeric:tabular-nums}
.company-profile-fields>.company-description-field{flex:2 1 280px}
.company-profile-fields input.company-cnae-code{width:calc(10ch + 26px);max-width:100%}
@media(max-width:450px){.company-profile-fields>.company-code-field{flex-basis:130px;min-width:110px}}

.company-code-field input[maxlength="2"]{width:calc(2ch + 28px)}
.company-code-field input[maxlength="3"]{width:calc(3ch + 28px)}
.company-code-field input[maxlength="4"]{width:calc(4ch + 28px)}

/* Content-sized controls, scoped to Cadastro Empresa. JS measures real font metrics. */
body.company-registration-view main{max-width:none;width:100%;margin:32px auto;padding-inline:clamp(12px,2vw,40px)}
.company-registration-sheet{max-width:100%;min-width:0}
.company-registration-sheet .card{max-width:100%;min-width:0}
.company-registration-sheet .company-profile-fields{display:flex;flex-wrap:wrap;align-items:flex-start;gap:12px 18px}
.company-registration-sheet .company-profile-fields>div,
.company-registration-sheet .company-profile-fields>.company-code-field,
.company-registration-sheet .company-profile-fields>.company-description-field{flex:0 1 auto;min-width:0;max-width:100%;width:fit-content}
.company-registration-sheet .company-profile-fields label{white-space:normal;overflow-wrap:anywhere;max-width:100%}
.company-registration-sheet input:not([type=hidden]):not([type=checkbox]):not([type=file]),
.company-registration-sheet textarea,.company-registration-sheet select{max-width:100%;min-width:0;box-sizing:border-box}
.company-registration-sheet .company-inline-action{max-width:100%;width:fit-content;flex-wrap:wrap}
.company-registration-sheet .company-inline-action input{flex:0 1 auto;min-width:0}
.company-registration-sheet textarea{resize:vertical;overflow-wrap:anywhere;white-space:pre-wrap}
.company-registration-sheet small{display:block;max-width:100%;overflow-wrap:anywhere}
@media(max-width:600px){body.company-registration-view main{margin-block:20px}.company-registration-sheet .card{padding:16px}.company-registration-sheet .company-profile-fields{gap:12px}}
@media print{body.company-registration-view main{width:100%;max-width:none;margin:0;padding:0}.company-registration-sheet .company-profile-fields>div{max-width:100%}}

.company-registration-sheet .company-profile-fields>.company-secondary-field{flex-basis:100%;width:100%!important;max-width:100%}.company-secondary-list{list-style:none;padding:0;margin:12px 0}.company-secondary-list li{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:8px 0;border-bottom:1px solid #d8e2db}.company-secondary-list span{overflow-wrap:anywhere;flex:1 1 240px}.company-secondary-list button{margin-top:0;padding:8px 12px}

.company-registration-sheet #company-mei-section[hidden]{display:none!important}



.company-registration-sheet #partner-capital-amounts{overflow:hidden;resize:none;min-height:0}

.company-registration-sheet .company-profile-fields>.person-row-break{flex:0 0 100%;height:0;width:100%!important}
.company-registration-sheet .company-profile-fields>.person-profession-field{flex:1 1 55%;min-width:min(100%,300px);width:auto!important;max-width:100%}
.company-registration-sheet .company-profile-fields>.person-education-field{flex:1 1 35%;min-width:min(100%,220px);width:auto!important;max-width:100%}
.company-registration-sheet .person-profession-field input:not([type=hidden]),.company-registration-sheet .person-education-field select{width:100%!important}
@media(max-width:600px){.company-registration-sheet .company-profile-fields>.person-profession-field,.company-registration-sheet .company-profile-fields>.person-education-field{flex-basis:100%}}

.company-registration-sheet .person-registration-type{margin-bottom:12px}
