body{margin:0;background:#edf4f1;color:#142923;font:16px/1.5 system-ui,sans-serif}
/* IBPT: one workspace, compact state navigation and readable tax columns. */
.developer-layout main:not(:has(> section:is(:target, :has(:target))))[data-screen="ibpt"] > #ibpt{display:block}
.ibpt-heading,.ibpt-table-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;flex-wrap:wrap}
.ibpt-heading h2{font-size:1.8rem;margin:4px 0}.ibpt-heading p{margin:4px 0;color:#51685f}.ibpt-heading .eyebrow{font-size:.7rem;font-weight:750;letter-spacing:.12em;color:#0b735c}
.ibpt-cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin:24px 0}
.ibpt-cards article{margin:0;padding:18px 20px;background:#f3f7f5;border:1px solid #dbe7e1;border-radius:12px;display:grid;gap:6px}
.ibpt-cards article>span{font-size:.8rem;font-weight:650}.ibpt-cards article strong{font-size:1.8rem;line-height:1.15}.ibpt-cards article small{font-size:.76rem;color:#64766e}.ibpt-cards strong small{font-size:.9rem;font-weight:400}
.ibpt-cards .ibpt-good{border-top:3px solid #198067}.ibpt-cards .ibpt-warning{border-top:3px solid #d38a20}.ibpt-cards .ibpt-danger{border-top:3px solid #c45a5a}
.ibpt-update-status{padding:16px 20px;border:1px solid #dbe7e1;border-radius:10px;background:#f8faf9}.ibpt-update-status p{margin:5px 0;font-size:.9rem}.ibpt-update-status small{color:#62766c}
.ibpt-state-strip{display:flex;flex-wrap:wrap;gap:6px;padding:22px 0;border-bottom:1px solid #dbe7e1;margin-bottom:20px}
.ibpt-state{font-size:.74rem;font-weight:700;text-decoration:none;padding:6px 9px;border:1px solid transparent;border-radius:6px}.ibpt-state.selected{outline:2px solid #183f35;outline-offset:1px}
.ibpt-valid{background:#def4e8;color:#12543f}.ibpt-expired{background:#fff0d8;color:#87550d}.ibpt-invalid{background:#fce6e5;color:#913b3b}.ibpt-future{background:#e5ecfb;color:#355f91}
.ibpt-badge{font-size:.74rem;border-radius:20px;padding:4px 9px;font-weight:650}.ibpt-table-heading h3{margin:0}.ibpt-table-heading p{font-size:.82rem;color:#64766d;margin:5px 0 16px}
.ibpt-workspace .ibpt-search{display:grid;grid-template-columns:90px minmax(180px,1fr) auto;gap:12px;max-width:none;align-items:end;margin-bottom:18px}.ibpt-search label{font-size:.8rem;font-weight:650}.ibpt-search button{height:42px}
.ibpt-table-scroll{overflow:auto;border:1px solid #dbe7e1;border-radius:10px;max-height:530px}.ibpt-table{width:100%;border-collapse:collapse;font-size:.8rem}.ibpt-table th{position:sticky;top:0;background:#f1f6f3;color:#36594c;font-size:.73rem;text-align:left;white-space:nowrap;z-index:1}.ibpt-table th,.ibpt-table td{padding:11px 12px;border-bottom:1px solid #e8efeb}.ibpt-table tbody tr:nth-child(even){background:#f9fbfa}.ibpt-table tbody tr:hover{background:#edf7f1}.ibpt-table td:nth-child(4){min-width:220px}.ibpt-table .ibpt-rate{white-space:nowrap;text-align:right;font-variant-numeric:tabular-nums}.ibpt-code{font-variant-numeric:tabular-nums;font-weight:650;white-space:nowrap}.ibpt-kind{font-size:.68rem;color:#61756c;border:1px solid #dae5df;border-radius:4px;padding:2px 5px;white-space:nowrap}
.ibpt-pagination{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:14px 0;font-size:.8rem}.ibpt-pagination div{display:flex;gap:14px}.ibpt-pagination a{padding:7px 12px;border:1px solid #c9dfd3;border-radius:6px;text-decoration:none}.ibpt-source{font-size:.74rem;color:#667a70}.ibpt-empty{padding:30px;text-align:center;background:#faf5f2;border-radius:10px}
.ibpt-workspace details{margin-top:20px}.ibpt-settings p{font-size:.86rem;padding:0 12px}.ibpt-settings form{grid-template-columns:1fr 1.5fr 1.2fr;max-width:none}.ibpt-settings .ibpt-check{grid-column:1/-1;display:flex;align-items:center;gap:10px}.ibpt-settings .ibpt-check input{width:auto}.ibpt-settings button{grid-column:1/-1}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:900px){.ibpt-cards{grid-template-columns:repeat(2,minmax(0,1fr))}.ibpt-settings form{grid-template-columns:1fr}.ibpt-workspace .ibpt-search{grid-template-columns:80px minmax(0,1fr)}.ibpt-search button{grid-column:1/-1}.ibpt-pagination{flex-wrap:wrap}}
main{max-width:900px;margin:auto;padding:24px}
section,article{background:white;padding:16px;margin:14px 0;border-radius:10px}
form{display:grid;gap:12px;max-width:520px}
label{display:grid;gap:4px}
input,textarea,select,button{font:inherit;padding:8px;border:1px solid #65877a;border-radius:6px}
button{background:#095746;color:white;cursor:pointer;justify-self:start}
a{color:#075846}summary{cursor:pointer}textarea{min-height:85px}

.portal-header{position:sticky;top:0;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:16px;background:#f5f8f6;border-bottom:1px solid #d5e7df;padding:10px max(16px,calc((100% - 900px)/2))}
.portal-header img{display:block;width:55px;height:55px;object-fit:contain}
main h1{color:#0d4239;line-height:1.15}
form,section{border-radius:12px}
.log-filters{grid-template-columns:repeat(auto-fit,minmax(130px,1fr));align-items:end;max-width:none;margin-bottom:16px}
.log-filters input{min-width:0;width:100%;box-sizing:border-box}
.client-table{overflow-x:auto;margin:16px 0}
.client-table table{width:100%;border-collapse:collapse;text-align:left;font-size:.9rem}
.client-table th,.client-table td{padding:8px 10px;border-bottom:1px solid #d5e7df}
.client-table th{background:#edf4f1}
.ticket-chat{display:flex;flex-direction:column;gap:10px;margin:16px 0}
.ticket-chat .chat-message{align-self:flex-start;max-width:min(85%,680px);margin:0;padding:10px 14px;background:#edf4f1;overflow-wrap:anywhere}
.ticket-chat .chat-operator{align-self:flex-end;background:#d8f0e5}
.ticket-chat .chat-message p{margin:4px 0 0}
.developer-layout{display:grid;grid-template-columns:218px minmax(0,1fr);min-height:calc(100vh - 76px)}
.developer-layout main{width:100%;max-width:1440px;box-sizing:border-box;min-width:0}
.developer-layout [id]{scroll-margin-top:90px}
.developer-nav{display:flex;flex-direction:column;gap:6px;position:sticky;top:76px;align-self:start;min-height:calc(100vh - 76px);box-sizing:border-box;padding:20px 12px;background:#103d35;color:#fff}
.developer-nav strong{font-size:1.25rem;padding:0 10px 12px}
.developer-nav a{color:#fff;text-decoration:none;padding:9px 10px;border-radius:7px}
.developer-nav a:hover,.developer-nav a:focus-visible{background:#b6f0d7;color:#103d35}
@media(max-width:760px){
    .developer-layout{grid-template-columns:minmax(0,1fr)}
    .developer-nav{position:static;min-height:0;flex-direction:row;flex-wrap:wrap;padding:10px}
    .developer-nav strong{flex-basis:100%;padding-bottom:0}
    .developer-layout main{padding:16px}
}

/* Cada opção do menu abre uma área de trabalho. Âncoras internas mantêm o módulo aberto. */
.developer-layout main > section { display: none; }
.developer-layout main > section:is(:target, :has(:target)),
.developer-layout main:not(:has(> section:is(:target, :has(:target))))[data-screen="ordens"] > #ordens,
.developer-layout main:not(:has(> section:is(:target, :has(:target))))[data-screen="clientes"] > #clientes,
.developer-layout main:not(:has(> section:is(:target, :has(:target))))[data-screen="erros"] > #erros,
.developer-layout main:not(:has(> section:is(:target, :has(:target))))[data-screen="chamados"] > #chamados,
.developer-layout main:not(:has(> section:is(:target, :has(:target))))[data-screen="cadastros"] > #cadastros {
    display: block;
}
.developer-layout main > section { padding: clamp(16px, 2.5vw, 32px); border: 1px solid #d5e7df; }
.developer-layout main > section h2 { margin-top: 0; color: #103d35; }
.developer-layout main > section > form { max-width: none; }
.developer-layout main > section > form[method="get"] {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
    align-items: end;
}
.developer-layout input:not([type="checkbox"]), .developer-layout select { min-width: 0; }
.developer-layout details { border-bottom: 1px solid #d5e7df; }
.developer-layout details > summary { padding: 10px; }
.developer-layout details[open] { background: #f5f8f6; padding-bottom: 12px; }
.developer-layout details > form { padding: 12px; }
.developer-layout .client-table { max-height: 56vh; }
.developer-layout .client-table th { position: sticky; top: 0; }
.developer-layout .client-table tbody tr:nth-child(even) { background: #f5f8f6; }

.order-row { display:grid; grid-template-columns: 5rem minmax(0,2fr) minmax(0,1fr) minmax(8rem,auto); align-items:center; gap:12px; cursor:pointer; }
.order-row::marker { content:""; }
.order-record:nth-of-type(even) { background:#f5f8f6; }
.order-record > .order-row:hover { background:#e7f3ee; }
.order-number { font-variant-numeric:tabular-nums; color:#075846; font-weight:700; }
.order-customer { font-weight:650; overflow-wrap:anywhere; }
.order-customer small { display:block; color:#526960; font-weight:400; }
.order-owner { overflow-wrap:anywhere; }
.status-badge { justify-self:start; border-radius:1rem; padding:.2rem .65rem; font-size:.82rem; font-weight:650; background:#edf0f2; color:#344551; }
.status-aberto { background:#fff0cc; color:#714600; }
.status-iniciado { background:#dcecff; color:#164c84; }
.status-agendado { background:#eee5ff; color:#573a86; }
.status-parado { background:#ffe6e0; color:#8b3529; }
.status-finalizado { background:#d9f4e5; color:#14593e; }
.order-detail { padding:12px 16px; }
.record-actions { display:flex; flex-wrap:wrap; gap:8px; }
.record-actions p { margin:0; }
.record-actions a,.catalog-grid a { display:block; border:1px solid #c7ddd4; padding:8px 12px; border-radius:6px; text-decoration:none; }
.record-actions a:hover,.catalog-grid a:hover { background:#dff1e9; }
.catalog-grid { list-style:none; padding:0; display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr)); gap:8px; }
@media(max-width:680px) {
    .order-row { grid-template-columns:4rem minmax(0,1fr); }
    .order-owner,.status-badge { grid-column:2; }
}

#cadastros > nav { display:flex; flex-wrap:wrap; gap:12px; margin-bottom:20px; }
#cadastros > form, #ordens > form:has([name="order_description"]) {
    padding:18px; border:1px solid #d5e7df; background:#f5f8f6;
    grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));
    align-items:end; margin:12px 0 20px;
}
#cadastros > form label:has(textarea), #ordens > form label:has(textarea) { grid-column:1/-1; }
#cadastros > form button, #ordens > form button { font-weight:650; }
.order-record[open] > summary { background:#e1f2ea; }

#log-edit { padding:14px; background:#edf5f1; border:1px solid #d5e7df; }
#log-edit textarea { min-height:42px; }
.error-grid-heading,.error-record { display:grid; grid-template-columns:3rem minmax(0,1fr); }
.error-grid-heading,.error-row { gap:12px; grid-template-columns:5rem minmax(0,2fr) minmax(0,1fr) minmax(0,1fr) minmax(7rem,auto); }
.error-grid-heading { grid-template-columns:3rem 5rem minmax(0,2fr) minmax(0,1fr) minmax(0,1fr) minmax(7rem,auto); background:#e1eee8; font-weight:650; padding:10px; }
.error-record { border-bottom:1px solid #d5e7df; padding:0 10px; }
.error-record:nth-of-type(even) { background:#f5f8f6; }
.error-record > input { align-self:start; justify-self:center; margin-top:16px; }
.error-record > details { min-width:0; border:0; }
.developer-layout .error-row { display:grid; align-items:center; padding:10px 0; overflow-wrap:anywhere; }
.error-row small { display:block; color:#526960; }
.error-detail { padding:12px; background:#f5f8f6; overflow-wrap:anywhere; }
.error-detail dl { display:grid; grid-template-columns:minmax(8rem,auto) minmax(0,1fr); gap:6px 12px; }
.error-detail dd { margin:0; }
.status-andamento { background:#dcecff; color:#164c84; }
.status-aguardando { background:#eee5ff; color:#573a86; }
@media(max-width:880px) {
    .error-grid-heading { display:none; }
    .error-row { grid-template-columns:1fr 1fr; }
}

.client-table td small { display:block; color:#526960; }
.client-table td a { font-weight:650; }
.status-ativo { background:#d9f4e5; color:#14593e; }
.status-inativo { background:#ffe6e0; color:#8b3529; }
.client-profile { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr)); gap:16px; border-top:1px solid #d5e7df; margin-top:20px; }
.client-profile h3 { grid-column:1/-1; }
.client-profile form { padding:14px; background:#f5f8f6; }

.developer-layout .customer-editor { gap:16px; margin-top:16px; }
.customer-editor fieldset { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,200px),1fr)); gap:12px; min-width:0; padding:16px; margin:0; background:#f5f8f6; border:1px solid #d5e7df; border-radius:8px; }
.customer-editor legend { padding:0 6px; color:#103d35; font-weight:650; }
.new-customer-link { display:inline-block; padding:8px 12px; margin-bottom:14px; border-radius:6px; background:#095746; color:#fff; text-decoration:none; }

.customer-editor fieldset { grid-template-columns:repeat(6,minmax(0,1fr)); gap:14px; }
.customer-editor fieldset > label { grid-column:span 2; min-width:0; }
.customer-editor label :is(input,select) { width:100%; box-sizing:border-box; }
.customer-editor fieldset > :is(.customer-field-razao_social,.customer-field-fantasia,.customer-field-email_empresa,.customer-field-end_rua,.customer-field-end_cidade,.customer-field-prop_nome,.customer-field-cont_nome,.customer-field-email_prop,.customer-field-email_cont) { grid-column:span 3; }
.customer-editor fieldset > :is(.customer-field-end_num,.customer-field-end_cep) { grid-column:span 1; }
.customer-editor input[readonly] { background:#e6efea; }
.client-profile { align-items:start; }
.client-profile form { align-content:start; }
.developer-layout main:not(:has(> section:is(:target, :has(:target))))[data-screen="sicredi"] > #sicredi { display:block; }
.section-intro,.field-hint { color:#526960;font-size:.92rem; }
.customer-editor fieldset { background:#fff;padding:22px;border-radius:14px;align-items:start; }
.customer-editor legend { font-size:1rem;padding:0 10px; }
.customer-editor label { font-size:.86rem;font-weight:600;color:#35554a; }
.customer-editor input,.customer-editor select { height:44px;background:#fbfdfc;border-color:#c4d7ce;color:#142923;font-weight:400; }
input:focus,select:focus,textarea:focus { outline:3px solid #c2ead8;outline-offset:1px;border-color:#14775b; }
input[aria-invalid="true"] { border-color:#b43838;background:#fff8f8; }
.customer-editor .field-hint { grid-column:1/-1;margin:0; }
.customer-editor .lookup-button { background:#e9f4ee;color:#075846;border-color:#c4d7ce;align-self:end;margin-top:24px;min-height:44px;font-size:.85rem; }
.customer-editor > button { padding:12px 24px;font-weight:650; }
.client-billing { border-top:1px solid #d5e7df;margin-top:30px;padding-top:16px; }
.invoice-compose { display:flex;align-items:end;flex-wrap:wrap;gap:12px;max-width:none; }
.invoice-compose input { height:42px;box-sizing:border-box; }
.invoice-compose button { min-height:42px; }
.bank-state { background:#f0f6f3;border:1px solid #d5e7df;padding:18px;border-radius:12px; }
.bank-state p { margin-bottom:0;color:#526960;max-width:80ch; }
.status-pending_issue { background:#fff0cc;color:#714600; }
.status-paid { background:#d9f4e5;color:#14593e; }
.status-issued { background:#dcecff;color:#164c84; }
.status-overdue { background:#ffe6e0;color:#8b3529; }
[role="alert"] { border-left:4px solid #228563;background:#e7f3ee;padding:12px 16px; }
.customer-editor [role="status"] { color:#075846;min-height:1.5em; }
.empty-state { padding:20px;background:#f5f8f6;border-radius:10px;color:#526960; }
.plan-summary { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0 16px;background:#eff7f2;padding:18px;border-radius:12px; }
.plan-summary dt { grid-row:1;color:#526960;font-size:.86rem; }
.plan-summary dd { grid-row:2;margin:5px 0 0;font-weight:700;color:#103d35; }
.password-panel { color:#075846; }
.password-panel form { padding-top:16px; }
.invoice-actions { display:flex;gap:6px;flex-wrap:wrap;max-width:320px; }
.invoice-actions button { font-size:.8rem;padding:8px 10px; }
.invoice-actions label { font-size:.8rem; }
.customer-editor .automation-choice { display:flex;gap:8px;align-items:center;grid-column:1/-1; }
.customer-editor .automation-choice input { width:18px;height:18px; }
.sicredi-activation { display:block;padding:24px;margin:24px 0;border:1px solid #d0e3dd;border-radius:14px;background:#f7faf9; }
.activation-heading { display:flex;justify-content:space-between;align-items:flex-start;gap:16px; }
.activation-heading h3 { margin:0 0 6px; }
.activation-heading p { margin:0;color:#526d65; }
.activation-heading .status-badge { flex-shrink:0; }
.sicredi-switch { display:flex;align-items:center;gap:12px;margin:24px 0 16px;font-weight:700;cursor:pointer; }
.sicredi-switch input { appearance:none;flex:0 0 46px;width:46px;height:26px;margin:0;padding:3px;border:0;border-radius:20px;background:#81928d;cursor:pointer; }
.sicredi-switch input::before { content:'';display:block;width:20px;height:20px;border-radius:50%;background:white;transition:transform .15s ease; }
.sicredi-switch input:checked { background:#08735c; }
.sicredi-switch input:checked::before { transform:translateX(20px); }
.sicredi-switch input:focus-visible { outline:3px solid #69bca9;outline-offset:3px; }
.activation-pending { padding:14px 18px;border-left:3px solid #c18e2c;background:#fff9ec;border-radius:6px;margin:18px 0; }
.activation-pending ul { margin:8px 0 0;padding-left:20px; }
.activation-delivery { color:#526d65;font-size:.92rem; }
.backup-badge { display:inline-flex;align-items:center;gap:7px;padding:7px 11px;border-radius:8px;font-size:.82rem;font-weight:700;white-space:nowrap;text-decoration:none; }
.backup-badge::before { content:'';width:7px;height:7px;border-radius:50%;background:currentColor;flex-shrink:0; }
.backup-recent { color:#126440;background:#e1f4e9;border:1px solid #b4dec5; }
.backup-old { color:#985009;background:#fff0d9;border:1px solid #ebcd96; }
.backup-missing { color:#a52c32;background:#ffebed;border:1px solid #ebbdc1; }
.backup-unknown { color:#566474;background:#edf0f5;border:1px solid #cbd3de; }
.backup-badge:focus-visible { outline:3px solid #117e68;outline-offset:2px; }
.backup-refresh { display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin-bottom:18px; }
.backup-refresh small { color:#526d65; }
.customer-totals { margin:0 0 18px; }
.customer-total-cards { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:0; }
.customer-total { border:1px solid #d5e5df;border-top:3px solid #78938a;border-radius:10px;padding:16px 18px;background:#f7faf9; }
.customer-total dt { font-size:.84rem;font-weight:600;color:#4b625a; }
.customer-total dd { margin:5px 0 0;font-size:1.8rem;font-weight:750;line-height:1.15;font-variant-numeric:tabular-nums;color:#24493c; }
.customer-total-active { border-top-color:#21835d;background:#f0f9f4; }
.customer-total-active dd { color:#146442; }
.customer-total-inactive { border-top-color:#89949c;background:#f5f7f8; }
.customer-total-inactive dd { color:#566570; }
.customer-total-current_license { border-top-color:#2c83a6;background:#f0f8fb; }
.customer-total-current_license dd { color:#226782; }
.customer-total-expired_license { border-top-color:#c95b61;background:#fff5f5; }
.customer-total-expired_license dd { color:#a7353d; }
.customer-totals p { margin:10px 0 0;color:#60736b;font-size:.78rem;line-height:1.5; }
@media(max-width:900px) { .customer-total-cards { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:420px) { .customer-total { padding:12px; } .customer-total dt { font-size:.76rem; } }
.backup-heading { display:flex;align-items:center;justify-content:space-between;gap:16px; }
.backup-heading h3 { margin-bottom:6px; }
.backup-heading p { color:#526d65;margin-top:0; }
.customer-backups { margin:28px 0;padding-top:16px;border-top:1px solid #d5e5df;scroll-margin-top:110px; }
.customer-backups .client-table { margin-top:16px;max-height:420px;overflow:auto; }
.backup-name { overflow-wrap:anywhere;min-width:220px; }
.delivery-panel { margin-top:32px;border-top:1px solid #d5e5df;padding-top:20px;scroll-margin-top:110px; }
.delivery-switches { padding:16px 24px;background:#f1f7f4;border:1px solid #d5e5df;border-radius:12px; }
.delivery-switches .sicredi-switch { display:inline-flex;margin:12px 32px 12px 0; }
.delivery-switches small { display:block;color:#526d65;font-weight:400;margin-top:3px; }
.template-preview { grid-column:1/-1;background:#fff;border-left:3px solid #157b63;padding:16px;border-radius:8px;color:#36564b; }
.template-preview p { margin-bottom:0; }
.delivery-tests { display:flex;gap:20px;flex-wrap:wrap;margin-top:24px; }
.delivery-tests form { flex:1;min-width:240px;padding:18px;border:1px solid #d5e5df;border-radius:10px; }
.delivery-tests small { display:block;color:#526d65;margin-top:12px;line-height:1.5; }
@media(max-width:820px) {
    .customer-editor fieldset { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .customer-editor fieldset > label { grid-column:span 1 !important; }
    .customer-editor fieldset > :is(.customer-field-razao_social,.customer-field-fantasia,.customer-field-end_rua) { grid-column:1/-1 !important; }
}

/* Identity of the authenticated developer, shared across all workspace screens. */
.portal-header-actions{display:flex;align-items:center;justify-content:flex-end;gap:24px;min-width:0}.portal-identity{display:grid;gap:1px;border-left:3px solid #168268;padding-left:12px;line-height:1.3;min-width:0}.portal-identity span{font-size:.72rem;color:#526f64}.portal-identity strong{font-size:.95rem;color:#0d4239;overflow-wrap:anywhere}.portal-header-actions>a{font-size:.85rem}@media(max-width:520px){.portal-header-actions{gap:12px;flex-wrap:wrap}.portal-identity strong{font-size:.85rem}}
