:root {
    --primary: #142C47;
    --secondary: #1479C9;
    --accent: #FF8015;
    --background: #F3F6FA;
    --text: #243247;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--background);
    color: var(--text);
}

.topbar {
    background: var(--primary);
    color: white;
    padding: 18px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 23px;
    font-weight: 700;
}

.brand-icon {
    color: var(--accent);
    margin-right: 8px;
}

.environment {
    font-size: 11px;
    color: #FFB879;
    font-weight: bold;
}

.container {
    max-width: 950px;
    margin: 40px auto;
    padding: 0 20px;
}

.panel {
    background: white;
    padding: 30px;
    border-radius: 14px;
    box-shadow: 0 6px 28px rgba(0,0,0,.07);
}

.hidden {
    display: none;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

h1 {
    color: var(--primary);
    margin-top: 0;
}

h2 {
    margin-top: 28px;
    font-size: 18px;
}

p {
    color: #697586;
}

label {
    display: block;
    margin-top: 16px;
    margin-bottom: 7px;
    font-weight: 600;
}

input {
    width: 100%;
    padding: 12px;
    border: 1px solid #CCD4DF;
    border-radius: 8px;
}

input[type="color"] {
    height: 52px;
    padding: 4px;
    cursor: pointer;
}

input[type="file"] {
    background: #F7F9FC;
}

button {
    margin-top: 18px;
    padding: 13px 22px;
    background: var(--accent);
    border: 0;
    border-radius: 8px;
    color: #172536;
    font-weight: 700;
    cursor: pointer;
}

button:hover {
    filter: brightness(.95);
}

.secondary-button {
    background: var(--primary);
    color: white;
}

.colors {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.preview {
    padding: 30px;
    border-radius: 12px;
    background: var(--primary);
    color: white;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#preview-accent {
    color: var(--accent);
}

#status-message {
    margin-top: 18px;
    font-weight: bold;
}

@media (max-width: 650px) {
    .colors {
        grid-template-columns: repeat(2, 1fr);
    }

    .section-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .panel {
        padding: 20px;
    }
}

.brand-logo {
    max-height: 48px;
    max-width: 180px;
    width: auto;
    object-fit: contain;
}

/* Correção do cabeçalho Hybrid ERP */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 76px;
    padding: 12px 28px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 23px;
    line-height: 1.2;
}

.brand-logo {
    display: block;
    width: auto;
    height: 48px;
    max-width: 160px;
    object-fit: contain;
    flex-shrink: 0;
}

.environment {
    white-space: nowrap;
}

@media (max-width: 650px) {
    .topbar {
        padding: 12px 16px;
    }

    .brand {
        gap: 10px;
        font-size: 18px;
    }

    .brand-logo {
        height: 36px;
        max-width: 100px;
    }
}

/* Hybrid ERP - Seletor de empresas */

#company-id {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-height: 46px;
    padding: 10px 14px;
    margin: 8px 0 16px;
    background-color: #F8FAFC;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    color: #142C47;
    font-family: inherit;
    font-size: 15px;
    cursor: pointer;
}

#company-id:focus {
    outline: 2px solid #FF8015;
    outline-offset: 2px;
}

#company-id:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

#load-branding {
    margin-bottom: 18px;
}

/* Hybrid ERP - Dashboard administrativo */

#dashboard-section {
    width: 100%;
}

body:has(#dashboard-section:not(.hidden)) .container {
    max-width: 1500px;
    margin: 26px auto;
}

.erp-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.erp-sidebar {
    background: #142C47;
    color: #FFFFFF;
    border-radius: 14px;
    padding: 22px 14px;
    min-height: 600px;
}

.sidebar-heading {
    color: #FF8015;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 10px 14px 20px;
}

.erp-sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.erp-nav {
    display: block;
    width: 100%;
    margin: 0;
    padding: 14px 16px;
    text-align: left;
    background: transparent;
    color: #D9E5F2;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
}

.erp-nav:hover {
    background: #203D5C;
}

.erp-nav.active {
    background: #FF8015;
    color: #142C47;
}

.sidebar-footer {
    margin-top: 60px;
    padding: 16px 14px;
    border-top: 1px solid #36516C;
    font-size: 13px;
    font-weight: 700;
}

.sidebar-footer small {
    display: block;
    margin-top: 6px;
    color: #AFC2D5;
    font-weight: 400;
}

.erp-content {
    min-width: 0;
}

.erp-content > .panel {
    width: 100%;
}

.erp-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 24px;
}

.erp-stat {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #F3F6FA;
    border: 1px solid #DFE6EE;
    border-radius: 12px;
    padding: 24px;
}

.erp-stat span,
.erp-stat small {
    color: #64748B;
}

.erp-stat strong {
    font-size: 21px;
    color: #142C47;
}

@media (max-width: 850px) {
    .erp-layout {
        grid-template-columns: 1fr;
    }

    .erp-sidebar {
        min-height: auto;
    }

    .erp-sidebar nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sidebar-footer {
        margin-top: 18px;
    }

    .erp-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 450px) {
    .erp-sidebar nav {
        grid-template-columns: 1fr;
    }
}

/* Módulos administrativos */

.erp-table-wrap {
    overflow-x: auto;
    margin-top: 24px;
}

.erp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.erp-table th,
.erp-table td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid #E2E8F0;
}

.erp-table th {
    background: #F3F6FA;
    color: #142C47;
}

.erp-table tr:hover td {
    background: #F8FAFC;
}

.erp-table-action {
    margin: 0;
    padding: 8px 14px;
}

.erp-editor {
    margin-top: 26px;
    padding: 24px;
    background: #F8FAFC;
    border: 1px solid #DCE5EE;
    border-radius: 12px;
}

.erp-editor input,
.erp-editor select,
#branches-company {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    background: white;
    color: #142C47;
}

.erp-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

#company-search {
    margin-top: 20px;
}

@media (max-width: 650px) {
    .erp-table {
        min-width: 520px;
    }
}


/* Gerenciamento de usuarios */
#users-company {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    background: white;
    color: #142C47;
}

#users-message {
    min-height: 24px;
    margin-top: 14px;
}

.erp-user-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.erp-user-actions button {
    white-space: nowrap;
}

#erp-users .erp-table select {
    min-height: 36px;
    max-width: 160px;
}

#erp-users .erp-table {
    min-width: 760px;
}


/* Etapa 48 - Acabamento do painel de usuarios */

.erp-password-field {
    display: flex;
    align-items: stretch;
    gap: 8px;
    width: 100%;
}

.erp-password-field input {
    flex: 1;
    min-width: 0;
}

.erp-password-toggle {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 8px 14px;
    border-radius: 8px;
    white-space: nowrap;
}

#erp-users .erp-user-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

#erp-users .erp-user-actions button {
    min-height: 36px;
    padding: 8px 12px;
    font-size: 13px;
    white-space: nowrap;
}

#erp-users .erp-table td:last-child {
    min-width: 230px;
}

@media (max-width: 650px) {
    #erp-users .erp-user-actions {
        flex-wrap: wrap;
    }
}

/* Etapa 48.7 - Mensagem de status da Identidade Visual */

#erp-branding #status-message {
    display: block;
    position: static;
    width: 100%;
    margin: 16px 0 0;
    padding: 12px 16px;
    box-sizing: border-box;
    border-radius: 8px;
    background: #ECFDF5;
    color: #047857;
    font-size: 14px;
    font-weight: 600;
}

#erp-branding #status-message:empty {
    display: none;
}


/* Hybrid ERP - Assinaturas */
#erp-subscriptions select,
#erp-subscriptions input[type="date"] {
    display: block;
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #d5deea;
    border-radius: 8px;
    background: #fff;
    color: #142c49;
    font: inherit;
    box-sizing: border-box;
    margin-top: 6px;
    margin-bottom: 14px;
}

#erp-subscriptions select:focus,
#erp-subscriptions input[type="date"]:focus {
    outline: 2px solid #ff8010;
    outline-offset: 1px;
}

#erp-subscriptions table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 14px;
}

#erp-subscriptions th,
#erp-subscriptions td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid #e4eaf2;
    vertical-align: middle;
}

#erp-subscriptions th {
    background: #f2f5f9;
    color: #142c49;
    font-weight: 700;
}

#erp-subscriptions tbody tr:hover {
    background: #f8fafc;
}

#erp-subscriptions button {
    border-radius: 8px;
}

@media (max-width: 768px) {
    #erp-subscriptions table {
        display: block;
        overflow-x: auto;
    }
}


/* ETAPA 52.2 - WHITE LABEL DINAMICO */
:root {
    --erp-brand-primary: #142C47;
    --erp-brand-secondary: #1479C9;
    --erp-brand-accent: #FF8015;
    --erp-brand-background: #F3F6FA;
}

.erp-sidebar {
    background: var(--erp-brand-primary);
}

.erp-nav.active {
    background: var(--erp-brand-accent);
}

.erp-nav:hover:not(.active) {
    background: var(--erp-brand-secondary);
}

.erp-content {
    background: var(--erp-brand-background);
}

#company-sidebar-logo {
    display: block;
    max-width: 150px;
    max-height: 70px;
    object-fit: contain;
    margin-bottom: 12px;
}

#company-sidebar-logo[hidden] {
    display: none;
}

#company-sidebar-name,
#company-sidebar-environment {
    display: block;
}

#company-sidebar-environment {
    font-size: 11px;
    opacity: .8;
    margin-top: 5px;
}

/* ETAPA 54.10 - CHECKBOX LEMBRAR EMAIL */
#login-form .remember-login {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin: 16px 0;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

#login-form .remember-login input[type="checkbox"] {
    appearance: auto;
    -webkit-appearance: checkbox;
    display: inline-block;
    width: 16px;
    height: 16px;
    min-width: 16px;
    margin: 0;
    padding: 0;
    flex: 0 0 16px;
    accent-color: #FF8015;
    cursor: pointer;
}



/* Login Google */
.google-signin-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: #ffffff;
    color: #202124;
    border: 1px solid #dadce0;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
}

.google-signin-button:hover {
    background: #f8fafd;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.google-signin-button:focus-visible {
    outline: 3px solid #4285f4;
    outline-offset: 2px;
}

.google-signin-button svg {
    flex-shrink: 0;
}

.google-login-actions {
    margin-top: 22px;
    text-align: center;
}

.google-login-actions p {
    margin-bottom: 12px;
}


/* ETAPA 54.15.46 - MENUS OCULTOS */
.erp-nav[hidden] {
    display: none !important;
}

/* ETAPA 54.15.74 - MINHA CONTA */

.account-nav-group {
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid rgba(128, 128, 128, 0.25);
}

.account-profile {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    margin: 24px 0;
}

.account-avatar {
    width: 112px;
    height: 112px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #e8edf4;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.account-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.account-avatar img[hidden] {
    display: none;
}

.account-avatar span {
    font-size: 54px;
    color: #64748b;
}

.account-photo-actions {
    flex: 1;
    min-width: 220px;
}

.account-photo-actions h2 {
    margin-top: 0;
}

#erp-account input[readonly] {
    background: #f1f5f9;
    color: #334155;
    cursor: default;
}

#account-message {
    margin-top: 18px;
}


/* HYBRID ERP - TELEFONE INTERNACIONAL */

#erp-account .iti {
    display: block;
    width: 100%;
}

#erp-account .iti input#account-phone {
    width: 100%;
    box-sizing: border-box;
}

#erp-account .iti__country-container {
    z-index: 2;
}


/* HYBRID ERP - SELETOR DE IDIOMAS */

.erp-topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

.erp-language-selector select {
    width: auto;
    max-width: 100%;
    min-width: 175px;
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #1e293b;
    font-size: 13px;
    cursor: pointer;
}

.erp-language-selector select:focus-visible {
    outline: 2px solid #0891b2;
    outline-offset: 2px;
}

.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: 600px) {
    .erp-topbar-actions {
        gap: 8px;
    }

    .erp-language-selector select {
        min-width: 140px;
        font-size: 12px;
    }
}


/* ETAPA 54.15.83.27.6 - GOOGLE VINCULADO */
#google-link-button.google-account-linked,
#google-link-button.google-account-linked:disabled {
    background: #142D49;
    color: #FFFFFF;
    opacity: 1;
    cursor: default;
}

#google-link-password[hidden] {
    display: none !important;
}


/* ETAPA 54.15.83.27.7.2 - ACCOUNT LOGOUT */
#erp-account .account-logout-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: -36px;
    margin-bottom: 24px;
}

#erp-account .account-logout-actions button {
    width: auto;
    flex: 0 0 auto;
}

@media (max-width: 600px) {
    #erp-account .account-logout-actions {
        margin-top: 12px;
        margin-bottom: 16px;
    }
}


/* ETAPA 54.15.83.27.8 - FILE SELECTOR */
.account-custom-file {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
    margin-bottom: 12px;
}

.account-custom-file input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

.account-custom-file-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    padding: 10px 16px;
    border-radius: 7px;
    background: #142b49;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.account-custom-file-button:hover {
    background: #23456d;
}

.account-custom-file input[type="file"]:focus-visible
+ .account-custom-file-button {
    outline: 3px solid #ff8a00;
    outline-offset: 3px;
}

#account-file-name {
    font-size: 13px;
    color: #53657f;
    overflow-wrap: anywhere;
}


/* ETAPA 54.15.83.28.1 - BRANDING FILE SELECTOR */
.branding-custom-file {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #f8fafc;
}

.branding-custom-file input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

.branding-custom-file span {
    font-size: 13px;
    overflow-wrap: anywhere;
}

.branding-custom-file input[type="file"]:focus-visible + label {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}


/* HYBRID ERP PARTNERS 54.15.84.13.3 */

#erp-partners .partners-company-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

#erp-partners .partners-company-row select {
    width: auto;
    max-width: 100%;
    min-width: min(100%, 300px);
}

#erp-partners .partners-search-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

#erp-partners .partners-search-row input[type="search"] {
    flex: 1 1 280px;
    min-width: 0;
}

#erp-partners .partners-category-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px;
    margin: 18px 0;
}

#erp-partners .partners-check-label {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    width: auto;
    margin: 0;
    cursor: pointer;
}

#erp-partners .partners-check-label input[type="checkbox"] {
    appearance: auto;
    -webkit-appearance: checkbox;
    display: inline-block;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin: 0;
}

@media (max-width: 600px) {
    #erp-partners .partners-company-row select {
        width: 100%;
    }
}

/* Hybrid ERP - Classificacoes comerciais */
#partner-classifications {
    margin: 16px 0;
    padding: 16px;
    border: 1px solid #dce3eb;
    border-radius: 8px;
}

#partner-classifications legend {
    padding: 0 8px;
    font-weight: 600;
}

#partner-classifications .partners-category-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 18px;
    margin-top: 14px;
}

#partner-classifications .partners-category-options label {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    margin: 0;
    padding: 0;
    font-size: 14px;
    cursor: pointer;
}

#partner-classifications input[type="checkbox"] {
    appearance: auto;
    -webkit-appearance: checkbox;
    display: inline-block;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    margin: 0;
    padding: 0;
    vertical-align: middle;
    accent-color: #167347;
}

@media (max-width: 700px) {
    #partner-classifications .partners-category-options {
        grid-template-columns: 1fr;
    }
}


/* ERP partners classification list filter 54.15.84.21.6 */
#erp-partners #partners-classification-filter {
    min-width: 210px;
    max-width: 280px;
    flex: 1 1 210px;
}

#erp-partners .erp-table td {
    vertical-align: middle;
}

@media (max-width: 700px) {
    #erp-partners #partners-classification-filter {
        width: 100%;
        max-width: none;
    }
}


/* Hybrid ERP - Commercial classification badges 54.15.84.22.1 */

#erp-partners .partner-classification-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

#erp-partners .partner-classification-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border: 1px solid #d5e3f0;
    border-radius: 6px;
    background: #f0f5fa;
    color: #23415f;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    white-space: normal;
}

#erp-partners .partner-classifications-cell {
    min-width: 220px;
    max-width: 400px;
}

@media (max-width: 700px) {
    #erp-partners .partner-classifications-cell {
        min-width: 180px;
    }
}


/* HYBRID ERP PAGINATION UI 54.15.84.22.5 */
#erp-partners .partners-pagination {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 0;
    font-size: 13px;
}

#erp-partners .partners-pagination label {
    width: auto;
    margin: 0;
}

#erp-partners #partners-page-size {
    width: auto;
    min-width: 75px;
}

#erp-partners #partners-page-info {
    flex: 1 1 220px;
    color: #475569;
}

#erp-partners .partners-page-buttons {
    display: flex;
    gap: 8px;
}

#erp-partners .partners-page-buttons button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

@media (max-width: 700px) {
    #erp-partners .partners-pagination {
        align-items: stretch;
    }
    #erp-partners #partners-page-info {
        flex-basis: 100%;
    }
}


/* ETAPA 54.19.8.13 - SEGMENTOS */

.erp-segment-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 18px 0;
    padding: 16px;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
}

.erp-segment-selector legend {
    font-weight: 600;
    padding: 0 6px;
}

.erp-segment-selector p {
    margin: 0 0 6px;
    font-size: 0.9rem;
}

.erp-segment-selector label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.erp-segment-selector input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    flex-shrink: 0;
}

.erp-segment-selector:disabled {
    opacity: 0.65;
}

#company-segments-message {
    margin: 6px 0 12px;
    font-size: 0.9rem;
}

/* HYBRID ERP - PRODUCTS & SERVICES LAYOUT */

#erp-products {
    width: 100%;
    box-sizing: border-box;
}

#erp-products .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

#erp-products .section-header h1 {
    margin: 0 0 8px;
}

#erp-products .section-header p {
    margin: 0;
}

#erp-products .erp-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

#erp-products .partners-company-row {
    margin-bottom: 20px;
}

#erp-products #products-company {
    width: min(100%, 420px);
    min-height: 40px;
}

#erp-products .partners-search-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 160px 160px auto;
    gap: 12px;
    align-items: center;
}

#erp-products .partners-search-row input,
#erp-products .partners-search-row select {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    box-sizing: border-box;
}

#erp-products #products-refresh {
    min-height: 40px;
    white-space: nowrap;
}

#erp-products .erp-table-wrap {
    width: 100%;
    overflow-x: auto;
    margin-top: 16px;
}

#erp-products .erp-table {
    width: 100%;
    border-collapse: collapse;
}

#erp-products .erp-table th,
#erp-products .erp-table td {
    padding: 12px 14px;
    text-align: left;
    vertical-align: middle;
}

#erp-products .erp-table tbody tr:hover {
    background: rgba(128, 128, 128, 0.05);
}

#erp-products #products-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

#erp-products #products-pagination .partners-page-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

#erp-products #products-page-info {
    margin-right: auto;
    white-space: nowrap;
}

#erp-products #products-page-size {
    width: auto;
    min-width: 70px;
}

#erp-products #products-editor {
    margin-top: 24px;
}

@media (max-width: 900px) {
    #erp-products .partners-search-row {
        grid-template-columns: minmax(180px, 1fr) 150px;
    }
}

@media (max-width: 600px) {
    #erp-products .section-header {
        align-items: flex-start;
        flex-direction: column;
    }

    #erp-products .partners-search-row {
        grid-template-columns: 1fr;
    }

    #erp-products #products-company {
        width: 100%;
    }

    #erp-products #products-pagination {
        justify-content: flex-start;
    }

    #erp-products #products-page-info {
        width: 100%;
    }
}


/* HYBRID ERP - PRODUCTS & SERVICES FORM */

#erp-products #products-editor {
    width: 100%;
    box-sizing: border-box;
    padding: 20px;
}

#erp-products #products-editor input:not([type="hidden"]),
#erp-products #products-editor select,
#erp-products #products-editor textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

#erp-products #product-description {
    min-height: 100px;
    resize: vertical;
    padding: 10px 12px;
    font: inherit;
}

#erp-products #products-editor label {
    display: block;
    margin-top: 12px;
    margin-bottom: 6px;
}

#erp-products #products-editor .erp-actions {
    margin-top: 18px;
}



/* ETAPA 4.9.16 - DASHBOARD DE ESTOQUE */

.inventory-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
}

.inventory-filters select {
    min-width: 180px;
    max-width: 100%;
}

.inventory-cards {
    margin-top: 18px;
}

.inventory-cards .erp-stat strong {
    overflow-wrap: anywhere;
}

.inventory-note {
    margin-top: 16px;
    font-size: 0.9rem;
    opacity: 0.8;
}

#inventory-message {
    margin-top: 12px;
    min-height: 24px;
}


/* ETAPA 4.9.17 - ALERTAS DE REPOSICAO */

.inventory-alerts-section {
    margin-top: 30px;
}

.inventory-alerts-table {
    width: 100%;
}

.inventory-alerts-table td:nth-child(n+4),
.inventory-alerts-table th:nth-child(n+4) {
    text-align: right;
}

.inventory-alerts-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 16px;
}

#inventory-alerts-message {
    margin-top: 12px;
}


/* ETAPA 4.9.17.3 - ALERTAS VISUAIS */

.inventory-alert-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
    margin: 18px 0;
    border: 1px solid;
    border-radius: 12px;
}

.inventory-alert-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 50%;
    font-size: 24px;
    font-weight: 800;
}

.inventory-alert-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 0;
}

.inventory-alert-count {
    font-size: 22px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.inventory-alert-normal {
    background: #ecfdf3;
    border-color: #a6f4c5;
    color: #067647;
}

.inventory-alert-normal .inventory-alert-icon {
    background: #d1fadf;
}

.inventory-alert-warning {
    background: #fffaeb;
    border-color: #fedf89;
    color: #93370d;
}

.inventory-alert-warning .inventory-alert-icon {
    background: #fef0c7;
}

.inventory-alert-critical {
    background: #fef3f2;
    border-color: #fda29b;
    color: #b42318;
}

.inventory-alert-critical .inventory-alert-icon {
    background: #fee4e2;
}

.inventory-alert-loading {
    background: #f2f4f7;
    border-color: #d0d5dd;
    color: #475467;
}

.inventory-alert-loading .inventory-alert-icon {
    background: #e4e7ec;
}

.inventory-row-warning td {
    background: #fffaeb;
}

.inventory-row-critical td {
    background: #fef3f2;
    color: #b42318;
    font-weight: 600;
}

@keyframes inventory-alert-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(180, 35, 24, 0);
    }
    50% {
        box-shadow: 0 0 0 7px rgba(180, 35, 24, 0.18);
    }
}

.inventory-alert-pulse {
    animation: inventory-alert-pulse 1.8s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    .inventory-alert-pulse {
        animation: none;
    }
}

@media (max-width: 600px) {
    .inventory-alert-banner {
        gap: 10px;
        padding: 12px;
    }

    .inventory-alert-count {
        font-size: 18px;
    }
}
