/* Modelo do Plano de Contas */
.template-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.template-summary__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border: 1px solid #e7e9f2;
    border-radius: 12px;
    background: #fff;
    color: #777d92;
}

.template-summary__item strong { color: #26345b; font-size: 1.5rem; }

.template-workflows {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
    margin-bottom: 1.5rem;
}

.workflow-card {
    min-width: 0;
    padding: 1.35rem;
    border: 1px solid #e7e9f2;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(31, 40, 73, .05);
}

.workflow-card__header,
.model-editor-heading > div { display: flex; align-items: flex-start; gap: .85rem; }
.workflow-card__header { margin-bottom: 1.25rem; }

.workflow-card__header h2,
.model-editor-heading h2 { margin: 0; color: #27355c; font-size: 1.1rem; font-weight: 700; }
.workflow-card__header p,
.model-editor-heading p { margin: .2rem 0 0; color: #737a91; font-size: .9rem; }

.workflow-step {
    display: inline-flex;
    flex: 0 0 32px;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e6f3ef;
    color: #0e4438;
    font-weight: 800;
}

.workflow-label { display: block; margin-bottom: .45rem; color: #39435f; font-size: .82rem; font-weight: 700; }
.workflow-action-row { display: flex; align-items: stretch; gap: .75rem; }
.workflow-action-row .button { white-space: nowrap; }

.client-selector-header,
.preview-panel__header,
.preview-footer,
.model-editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.client-selector-header small { display: block; color: #8a90a5; }
.selection-actions { display: flex; gap: .7rem; }
.selection-actions button { padding: 0; border: 0; background: transparent; color: #176b5a; cursor: pointer; font-size: .8rem; font-weight: 700; }

.client-selector {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .55rem;
    max-height: 245px;
    margin: .7rem 0 1rem;
    padding: .2rem;
    overflow-y: auto;
}

.client-option {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-width: 0;
    padding: .75rem;
    border: 1px solid #e6e8f0;
    border-radius: 9px;
    background: #fafbfc;
    color: #596079;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}

.client-option:hover,
.client-option--selected { border-color: #1a7864; background: #f0f8f6; color: #173f37; }
.client-option input,
.difference-option input { width: 17px; height: 17px; accent-color: #176b5a; }
.client-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.preview-panel { margin-top: 1.25rem; padding-top: 1.1rem; border-top: 1px solid #eceef4; }
.preview-panel__header strong,
.eyebrow { display: block; }
.eyebrow { color: #9298aa; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.preview-metrics { display: flex; flex-wrap: wrap; gap: .45rem; margin: .9rem 0; }

.metric,
.action-badge { display: inline-flex; align-items: center; padding: .28rem .55rem; border-radius: 999px; background: #f0f1f5; color: #646b7f; font-size: .75rem; font-weight: 700; }
.metric--create,
.action-badge--create { background: #e8f6ef; color: #26724f; }
.metric--fill,
.action-badge--fill,
.action-badge--link { background: #eaf2ff; color: #34649c; }
.metric--conflict,
.action-badge--conflict,
.action-badge--invalid { background: #fff0ed; color: #b24b3b; }

.preview-table-wrapper { max-height: 420px; overflow: auto; border: 1px solid #eceef4; border-radius: 9px; }
.preview-table { margin-bottom: 0 !important; font-size: .84rem; }
.preview-table thead { position: sticky; top: 0; z-index: 1; background: #f8f9fb; }
.preview-message { display: block; color: #697086; }
.difference-details,
.company-preview { margin-top: .55rem; }
.difference-details summary,
.company-preview summary { color: #176b5a; cursor: pointer; font-weight: 700; }

.difference-option { display: flex; align-items: flex-start; gap: .55rem; margin-top: .55rem; color: #555d73; cursor: pointer; }
.preview-footer { margin-top: 1rem; color: #777e92; font-size: .82rem; }
.company-preview { padding: .8rem 0; border-bottom: 1px solid #eceef4; }
.company-preview summary { display: flex; flex-direction: column; gap: .2rem; }
.company-preview summary span { color: #7e8497; font-size: .8rem; font-weight: 400; }

.conflict-card { display: flex; flex-direction: column; margin-top: .65rem; padding: .75rem; border-left: 3px solid #dc6f5f; background: #fff8f6; }
.result-list,
.result-banner { display: flex; flex-direction: column; gap: .65rem; }
.result-list { margin-top: 1rem; }
.result-banner { margin-top: 1rem; padding: .85rem 1rem; border-radius: 9px; }
.result-banner--success { background: #eaf7f1; color: #216b4c; }
.result-banner--error { background: #fff0ed; color: #a94336; }

.model-editor-heading { margin-bottom: 1rem; padding: 1.1rem 1.25rem; border: 1px solid #e7e9f2; border-radius: 12px; background: #fff; color: #7b8296; }
button[disabled] { cursor: not-allowed; opacity: .55; }

@media (max-width: 1024px) {
    .template-workflows { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .template-summary { grid-template-columns: 1fr; }
    .workflow-action-row,
    .preview-footer,
    .model-editor-heading { align-items: stretch; flex-direction: column; }
    .client-selector { grid-template-columns: 1fr; }
}
