/* v0.9.13 · Produção e perfis de acesso */

.production-head {
    margin-bottom: 18px;
}

.production-alert {
    margin-bottom: 16px;
}

.production-entry-panel,
.production-selector-panel,
.production-list-panel,
.production-empty-state {
    background: #fff;
    border: 1px solid rgba(23, 56, 75, .10);
    border-radius: 20px;
    box-shadow: 0 12px 34px rgba(23, 56, 75, .06);
}

.production-entry-panel,
.production-list-panel {
    padding: 22px;
    margin-bottom: 20px;
}

.production-selector-panel {
    padding: 18px 20px;
    margin-bottom: 18px;
}

.production-section-title {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.production-section-title h2 {
    margin: 2px 0 0;
}

.production-section-title small {
    color: #687784;
    text-align: right;
}

.production-entry-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    align-items: end;
}

.production-entry-form .field {
    margin: 0;
}

.production-entry-form .field input,
.production-entry-form .field textarea,
.production-consultant-selector select,
.production-manager-cell input,
.production-manager-cell textarea,
.user-role-form select {
    width: 100%;
    box-sizing: border-box;
}

.production-field-client {
    grid-column: span 2;
}

.production-field-notes {
    grid-column: span 3;
}

.production-entry-submit {
    display: flex;
    justify-content: flex-end;
    align-self: end;
}

.production-money-input,
.production-inline-number {
    position: relative;
}

.production-money-input input,
.production-inline-number input {
    padding-right: 36px;
}

.production-money-input span,
.production-inline-number span {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #687784;
    pointer-events: none;
}

.production-consultant-selector {
    display: flex;
    gap: 14px;
    align-items: end;
}

.production-consultant-selector .field {
    flex: 1;
    margin: 0;
}

.production-empty-state {
    padding: 34px 24px;
    display: grid;
    gap: 6px;
    text-align: center;
    color: #687784;
}

.production-empty-state strong {
    color: #17384b;
    font-size: 18px;
}

.production-summary {
    display: grid;
    grid-template-columns: minmax(220px, 1.5fr) repeat(4, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.production-summary > div {
    padding: 16px 17px;
    border: 1px solid rgba(23, 56, 75, .10);
    border-radius: 16px;
    background: #fff;
    min-width: 0;
}

.production-summary span,
.production-summary small {
    display: block;
    color: #73808b;
    font-size: 12px;
}

.production-summary strong {
    display: block;
    margin-top: 4px;
    color: #17384b;
    font-size: 18px;
    overflow-wrap: anywhere;
}

.production-summary-person strong {
    font-size: 17px;
}

.production-table-wrap {
    overflow-x: auto;
    overscroll-behavior-inline: contain;
}

.production-table {
    min-width: 1320px;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.production-table.is-manager-view {
    min-width: 1760px;
}

.production-table th,
.production-table td {
    vertical-align: top;
}

.production-table th {
    white-space: nowrap;
}

.production-table td {
    min-width: 120px;
}

.production-table td:nth-child(2) {
    min-width: 190px;
}

.production-table td:nth-child(9),
.production-table td:nth-child(12) {
    min-width: 230px;
}

.production-manager-column,
.production-manager-cell {
    background: rgba(200, 163, 95, .06);
}

.production-manager-column {
    border-top-color: rgba(200, 163, 95, .25) !important;
}

.production-manager-cell input,
.production-manager-cell textarea {
    min-width: 120px;
    border: 1px solid rgba(23, 56, 75, .15);
    border-radius: 10px;
    padding: 9px 10px;
    background: #fff;
    color: #17212b;
    font: inherit;
}

.production-manager-cell textarea {
    min-width: 220px;
    resize: vertical;
}

.production-points-input {
    max-width: 120px;
}

.production-manager-save {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
}

.production-manager-save small {
    color: #7b8790;
    font-size: 10px;
    line-height: 1.25;
}

.production-number,
.production-nowrap {
    white-space: nowrap;
}

.production-number {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.production-policy {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
}

.production-status {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(23, 56, 75, .08);
    color: #17384b;
    font-size: 12px;
    font-weight: 700;
}

.production-notes-cell {
    white-space: normal;
    line-height: 1.45;
    color: #4f5d67;
}

.production-empty-list {
    padding: 34px 20px;
    text-align: center;
    color: #73808b;
    border: 1px dashed rgba(23, 56, 75, .18);
    border-radius: 14px;
}

.production-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
    color: #687784;
    font-size: 13px;
}

.user-role.manager,
.user-role.consultant {
    white-space: nowrap;
}

.user-role.manager {
    background: rgba(200, 163, 95, .14);
    color: #765a23;
}

.user-role.consultant {
    background: rgba(23, 56, 75, .09);
    color: #17384b;
}

.user-role-form {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.user-role-form select {
    min-width: 165px;
    padding: 7px 9px;
    border: 1px solid rgba(23, 56, 75, .15);
    border-radius: 9px;
    background: #fff;
    font: inherit;
    font-size: 12px;
}

@media (max-width: 1180px) {
    .production-entry-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .production-field-client,
    .production-field-notes {
        grid-column: span 2;
    }

    .production-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .production-summary-person {
        grid-column: span 2;
    }
}

@media (max-width: 720px) {
    .production-entry-panel,
    .production-list-panel,
    .production-selector-panel {
        padding: 16px;
        border-radius: 16px;
    }

    .production-entry-form,
    .production-summary {
        grid-template-columns: 1fr;
    }

    .production-field-client,
    .production-field-notes,
    .production-summary-person {
        grid-column: span 1;
    }

    .production-section-title,
    .production-consultant-selector {
        align-items: stretch;
        flex-direction: column;
    }

    .production-section-title small {
        text-align: left;
    }

    .production-entry-submit .btn,
    .production-consultant-selector .btn {
        width: 100%;
    }

    .production-pagination {
        flex-wrap: wrap;
    }

    .mobile-nav {
        overflow-x: auto;
        justify-content: flex-start;
    }

    .mobile-nav .nav-menu-item {
        min-width: 68px;
        flex: 1 0 68px;
    }
}

/* v0.9.14 · campos fechados e pesquisa de clientes */
.production-entry-form .field select {
    width: 100%;
    box-sizing: border-box;
}

.production-client-lookup {
    position: relative;
}

.production-client-suggestions {
    position: absolute;
    z-index: 80;
    left: 0;
    right: 0;
    top: calc(100% + 5px);
    max-height: 290px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid rgba(23, 56, 75, .16);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(23, 56, 75, .18);
}

.production-client-suggestion {
    display: grid;
    width: 100%;
    gap: 2px;
    padding: 10px 11px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #17384b;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.production-client-suggestion:hover,
.production-client-suggestion:focus-visible {
    background: rgba(23, 56, 75, .07);
    outline: none;
}

.production-client-suggestion strong {
    font-size: 13px;
    line-height: 1.3;
}

.production-client-suggestion span,
.production-client-suggestion-empty {
    color: #6d7a84;
    font-size: 12px;
    line-height: 1.35;
}

.production-client-suggestion-empty {
    padding: 11px;
}

.production-table {
    min-width: 1450px;
}

.production-table.is-manager-view {
    min-width: 1900px;
}

.production-table td:nth-child(3) {
    min-width: 190px;
}

.production-table td:nth-child(10),
.production-table td:nth-child(13) {
    min-width: 230px;
}

@media (max-width: 760px) {
    .production-client-suggestions {
        max-height: 240px;
    }
}

.production-table td:nth-child(2) { min-width: 115px; }
.production-table td:nth-child(9) { min-width: 120px; }
.production-table td:nth-child(12) { min-width: 120px; }

/* v0.9.16 · produção mensal, validação e tabela compacta */
.production-entry-panel.is-editing {
    border-color: rgba(200, 163, 95, .38);
    box-shadow: 0 12px 34px rgba(200, 163, 95, .10);
}

.production-month-nav {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    margin: 0 0 14px;
    padding: 10px 12px;
    border: 1px solid rgba(23, 56, 75, .10);
    border-radius: 15px;
    background: #fff;
}

.production-month-current {
    text-align: center;
    line-height: 1.15;
}

.production-month-current span {
    display: block;
    color: #74818b;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.production-month-current strong {
    display: block;
    margin-top: 2px;
    color: #17384b;
    font-size: 16px;
}

.production-month-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 92px;
}

.production-month-arrow {
    min-width: 34px;
    padding-inline: 9px !important;
}

.production-current-month-link,
.production-month-now {
    color: #667681;
    font-size: 10px;
    white-space: nowrap;
}

.production-current-month-link {
    text-decoration: none;
}

.production-current-month-link:hover {
    color: #17384b;
    text-decoration: underline;
}

.production-summary.is-manager-summary {
    grid-template-columns: minmax(180px, 1.35fr) repeat(5, minmax(105px, 1fr));
}

.production-list-title {
    margin-bottom: 10px;
}

.production-table-wrap {
    width: 100%;
    overflow: visible;
}

.production-table.production-table-compact {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 9.5px;
}

.production-table.production-table-compact th,
.production-table.production-table-compact td {
    min-width: 0 !important;
    max-width: none;
    box-sizing: border-box;
    padding: 5px 3px !important;
    vertical-align: middle;
    line-height: 1.18;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.production-table.production-table-compact th {
    font-size: 8.5px;
    letter-spacing: -.01em;
}

.production-table.production-table-compact td strong {
    font-size: inherit;
}

.production-table.production-table-compact .production-policy {
    font-size: 8.5px;
}

.production-table.production-table-compact .production-number {
    text-align: right;
    font-size: 9px;
}

.production-table.production-table-compact .production-status-compact {
    max-width: 100%;
    padding: 2px 4px;
    border-radius: 6px;
    font-size: 8px;
    line-height: 1.1;
    white-space: nowrap;
}

.production-table.production-table-compact .production-notes-cell {
    line-height: 1.18;
    white-space: nowrap;
}

.production-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.production-table.production-table-compact .production-manager-cell input {
    width: 100%;
    min-width: 0;
    height: 25px;
    padding: 3px 4px;
    border-radius: 6px;
    font-size: 8.5px;
    line-height: 1;
}

.production-table.production-table-compact .production-inline-number.compact input {
    padding-right: 16px;
}

.production-table.production-table-compact .production-inline-number.compact span {
    right: 4px;
    font-size: 8px;
}

.production-table.production-table-compact .production-points-input {
    max-width: none;
}

.production-manager-form,
.production-manager-buttons,
.production-actions-cell {
    min-width: 0;
}

.production-manager-buttons {
    display: flex;
    gap: 3px;
    margin-top: 3px;
}

.btn.btn-tiny {
    min-height: 0;
    padding: 3px 5px;
    border-radius: 6px;
    font-size: 8px;
    line-height: 1.1;
    white-space: nowrap;
}

.production-validation-state {
    overflow: hidden;
}

.production-validation-badge {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 2px 4px;
    border-radius: 999px;
    font-size: 8px;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
}

.production-validation-badge.is-valid {
    background: rgba(34, 156, 102, .12);
    color: #137a50;
}

.production-validation-badge.is-pending {
    background: rgba(200, 163, 95, .14);
    color: #755923;
}

.production-table tr.is-validated td {
    background-image: linear-gradient(rgba(34, 156, 102, .018), rgba(34, 156, 102, .018));
}

.production-actions-cell {
    text-align: center;
}

.production-delete-form {
    display: inline;
    margin: 0;
    padding: 0;
}

.production-action-link {
    display: inline;
    margin: 0 2px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #315f79;
    font: inherit;
    font-size: 8.5px;
    text-decoration: underline;
    cursor: pointer;
}

.production-action-link.is-danger {
    color: #a53b3b;
}

.production-locked-label {
    color: #87929a;
    font-size: 8px;
}

/* Larguras da vista do Consultor: 100% da tabela, sem scroll horizontal. */
.production-table.is-consultant-view th:nth-child(1),
.production-table.is-consultant-view td:nth-child(1) { width: 5%; }
.production-table.is-consultant-view th:nth-child(2),
.production-table.is-consultant-view td:nth-child(2) { width: 8%; }
.production-table.is-consultant-view th:nth-child(3),
.production-table.is-consultant-view td:nth-child(3) { width: 15%; }
.production-table.is-consultant-view th:nth-child(4),
.production-table.is-consultant-view td:nth-child(4) { width: 9%; }
.production-table.is-consultant-view th:nth-child(5),
.production-table.is-consultant-view td:nth-child(5) { width: 8%; }
.production-table.is-consultant-view th:nth-child(6),
.production-table.is-consultant-view td:nth-child(6) { width: 9%; }
.production-table.is-consultant-view th:nth-child(7),
.production-table.is-consultant-view td:nth-child(7) { width: 9%; }
.production-table.is-consultant-view th:nth-child(8),
.production-table.is-consultant-view td:nth-child(8) { width: 8%; }
.production-table.is-consultant-view th:nth-child(9),
.production-table.is-consultant-view td:nth-child(9) { width: 7%; }
.production-table.is-consultant-view th:nth-child(10),
.production-table.is-consultant-view td:nth-child(10) { width: 8%; }
.production-table.is-consultant-view th:nth-child(11),
.production-table.is-consultant-view td:nth-child(11) { width: 7%; }
.production-table.is-consultant-view th:nth-child(12),
.production-table.is-consultant-view td:nth-child(12) { width: 7%; }

/* Larguras da vista do Gestor/Admin: 14 colunas dentro da largura disponível. */
.production-table.is-manager-view th:nth-child(1),
.production-table.is-manager-view td:nth-child(1) { width: 4%; }
.production-table.is-manager-view th:nth-child(2),
.production-table.is-manager-view td:nth-child(2) { width: 6%; }
.production-table.is-manager-view th:nth-child(3),
.production-table.is-manager-view td:nth-child(3) { width: 10%; }
.production-table.is-manager-view th:nth-child(4),
.production-table.is-manager-view td:nth-child(4) { width: 7%; }
.production-table.is-manager-view th:nth-child(5),
.production-table.is-manager-view td:nth-child(5) { width: 6%; }
.production-table.is-manager-view th:nth-child(6),
.production-table.is-manager-view td:nth-child(6) { width: 7%; }
.production-table.is-manager-view th:nth-child(7),
.production-table.is-manager-view td:nth-child(7) { width: 7%; }
.production-table.is-manager-view th:nth-child(8),
.production-table.is-manager-view td:nth-child(8) { width: 6%; }
.production-table.is-manager-view th:nth-child(9),
.production-table.is-manager-view td:nth-child(9) { width: 5%; }
.production-table.is-manager-view th:nth-child(10),
.production-table.is-manager-view td:nth-child(10) { width: 9%; }
.production-table.is-manager-view th:nth-child(11),
.production-table.is-manager-view td:nth-child(11) { width: 7%; }
.production-table.is-manager-view th:nth-child(12),
.production-table.is-manager-view td:nth-child(12) { width: 6%; }
.production-table.is-manager-view th:nth-child(13),
.production-table.is-manager-view td:nth-child(13) { width: 10%; }
.production-table.is-manager-view th:nth-child(14),
.production-table.is-manager-view td:nth-child(14) { width: 10%; }

@media (max-width: 1180px) {
    .production-summary.is-manager-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .production-summary.is-manager-summary .production-summary-person {
        grid-column: span 3;
    }
}

@media (max-width: 900px) {
    .production-table-wrap {
        overflow-x: auto;
        overscroll-behavior-inline: contain;
    }

    .production-table.production-table-compact.is-consultant-view {
        min-width: 980px !important;
    }

    .production-table.production-table-compact.is-manager-view {
        min-width: 1250px !important;
    }
}

@media (max-width: 720px) {
    .production-month-nav {
        grid-template-columns: auto 1fr auto;
    }

    .production-current-month-link,
    .production-month-now {
        display: none;
    }

    .production-summary.is-manager-summary {
        grid-template-columns: 1fr;
    }

    .production-summary.is-manager-summary .production-summary-person {
        grid-column: span 1;
    }
}

.production-summary:not(.is-manager-summary) {
    grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(120px, 1fr));
}

@media (max-width: 1180px) {
    .production-summary:not(.is-manager-summary) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .production-summary:not(.is-manager-summary) .production-summary-person {
        grid-column: span 2;
    }
}

@media (max-width: 720px) {
    .production-summary:not(.is-manager-summary) {
        grid-template-columns: 1fr;
    }

    .production-summary:not(.is-manager-summary) .production-summary-person {
        grid-column: span 1;
    }
}

/* v0.9.17 · melhoria de legibilidade do histórico de Produção */
.production-list-panel {
    padding: 24px 28px 26px;
}

.production-list-title {
    margin-bottom: 14px;
}

.production-table-wrap {
    border: 1px solid rgba(23, 56, 75, .10);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

.production-table.production-table-compact {
    font-size: 11.25px;
    color: #263943;
}

.production-table.production-table-compact th,
.production-table.production-table-compact td {
    padding: 8px 5px !important;
    line-height: 1.25;
    text-align: left !important;
}

.production-table.production-table-compact thead th {
    padding-top: 9px !important;
    padding-bottom: 9px !important;
    background: #f5f7f8;
    color: #65747e;
    border-bottom: 1px solid rgba(23, 56, 75, .12);
    font-size: 9.5px;
    font-weight: 750;
    letter-spacing: .015em;
    text-transform: uppercase;
}

.production-table.production-table-compact tbody td {
    border-bottom: 1px solid rgba(23, 56, 75, .085);
}

.production-table.production-table-compact tbody tr:last-child td {
    border-bottom: 0;
}

.production-table.production-table-compact tbody tr:hover td {
    background-color: rgba(23, 56, 75, .025);
}

.production-table.production-table-compact td strong {
    font-weight: 700;
}

.production-table.production-table-compact .production-policy {
    font-size: 10.5px;
}

/* Todos os valores do histórico, incluindo montantes, ficam alinhados à esquerda. */
.production-table.production-table-compact .production-number,
.production-table.production-table-compact .production-actions-cell {
    text-align: left !important;
}

.production-table.production-table-compact .production-number {
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.production-table.production-table-compact .production-status-compact,
.production-validation-badge {
    padding: 3px 6px;
    border-radius: 999px;
    font-size: 9.5px;
    line-height: 1.15;
}

.production-action-link {
    margin: 0 5px 0 0;
    font-size: 10.5px;
    font-weight: 600;
    text-decoration: none;
}

.production-action-link:hover,
.production-action-link:focus-visible {
    text-decoration: underline;
}

.production-locked-label {
    font-size: 10px;
}

/* Distribuição revista para dar mais leitura a Cliente e Notas sem criar scroll. */
.production-table.is-consultant-view th:nth-child(1),
.production-table.is-consultant-view td:nth-child(1) { width: 5%; }
.production-table.is-consultant-view th:nth-child(2),
.production-table.is-consultant-view td:nth-child(2) { width: 8%; }
.production-table.is-consultant-view th:nth-child(3),
.production-table.is-consultant-view td:nth-child(3) { width: 16%; }
.production-table.is-consultant-view th:nth-child(4),
.production-table.is-consultant-view td:nth-child(4) { width: 9%; }
.production-table.is-consultant-view th:nth-child(5),
.production-table.is-consultant-view td:nth-child(5) { width: 8%; }
.production-table.is-consultant-view th:nth-child(6),
.production-table.is-consultant-view td:nth-child(6) { width: 9%; }
.production-table.is-consultant-view th:nth-child(7),
.production-table.is-consultant-view td:nth-child(7) { width: 8%; }
.production-table.is-consultant-view th:nth-child(8),
.production-table.is-consultant-view td:nth-child(8) { width: 7%; }
.production-table.is-consultant-view th:nth-child(9),
.production-table.is-consultant-view td:nth-child(9) { width: 7%; }
.production-table.is-consultant-view th:nth-child(10),
.production-table.is-consultant-view td:nth-child(10) { width: 10%; }
.production-table.is-consultant-view th:nth-child(11),
.production-table.is-consultant-view td:nth-child(11) { width: 7%; }
.production-table.is-consultant-view th:nth-child(12),
.production-table.is-consultant-view td:nth-child(12) { width: 6%; }

/* Na vista de gestão existem mais colunas; mantém-se ligeiramente mais compacta. */
.production-table.production-table-compact.is-manager-view {
    font-size: 10.25px;
}

.production-table.production-table-compact.is-manager-view th {
    font-size: 8.75px;
}

.production-table.production-table-compact.is-manager-view .production-number {
    font-size: 10px;
}

.production-table.production-table-compact .production-manager-cell input {
    height: 29px;
    padding: 4px 5px;
    font-size: 9.5px;
}

.production-table.production-table-compact .production-inline-number.compact span {
    font-size: 9px;
}

.btn.btn-tiny {
    padding: 4px 6px;
    font-size: 9px;
}

@media (max-width: 900px) {
    .production-table-wrap {
        overflow-x: auto;
    }

    .production-list-panel {
        padding-inline: 18px;
    }
}

/* v0.9.18 · ações por ícones SVG sempre visíveis */
.production-table.production-table-compact .production-actions-cell {
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: nowrap;
}

.production-action-buttons {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
    min-width: 61px;
    white-space: nowrap;
}

.production-delete-form {
    display: inline-flex;
    flex: 0 0 auto;
}

.production-icon-action,
.production-icon-locked {
    width: 27px;
    height: 27px;
    flex: 0 0 27px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border-radius: 7px;
}

.production-icon-action {
    padding: 0;
    border: 1px solid rgba(23, 56, 75, .13);
    background: #fff;
    color: #315f79;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}

.production-icon-action svg,
.production-icon-locked svg {
    width: 15px;
    height: 15px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.production-icon-action:hover,
.production-icon-action:focus-visible {
    background: rgba(49, 95, 121, .07);
    border-color: rgba(49, 95, 121, .28);
    color: #234b62;
    text-decoration: none;
    transform: translateY(-1px);
    outline: none;
}

.production-icon-action.is-danger {
    color: #a53b3b;
}

.production-icon-action.is-danger:hover,
.production-icon-action.is-danger:focus-visible {
    background: rgba(165, 59, 59, .07);
    border-color: rgba(165, 59, 59, .25);
    color: #8f2f2f;
}

.production-icon-locked {
    color: #87929a;
    background: rgba(135, 146, 154, .08);
    border: 1px solid rgba(135, 146, 154, .13);
}

/* Reserva espaço suficiente para lápis + lixo sem reticências. */
.production-table.is-consultant-view th:nth-child(12),
.production-table.is-consultant-view td:nth-child(12) {
    width: 7%;
}

.production-table.is-consultant-view th:nth-child(10),
.production-table.is-consultant-view td:nth-child(10) {
    width: 9%;
}

/* v0.9.20 · pré-auditoria automática da Produção no Libax */
.production-summary.is-manager-summary {
    grid-template-columns: minmax(180px, 1.35fr) repeat(6, minmax(96px, 1fr));
}

.production-list-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.production-libax-month-form,
.production-libax-row-form {
    margin: 0;
}

.production-libax-month-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.production-libax-month-button svg,
.production-libax-recheck svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.production-libax-audit-row {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
    margin-bottom: 5px;
}

.production-libax-badge {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    max-width: calc(100% - 28px);
    padding: 3px 5px;
    border-radius: 7px;
    font-size: 8.25px;
    font-weight: 750;
    line-height: 1.18;
    white-space: normal;
    overflow-wrap: anywhere;
}

.production-libax-badge.is-libax-valid {
    background: rgba(34, 156, 102, .12);
    color: #137a50;
}

.production-libax-badge.is-libax-warning {
    background: rgba(200, 163, 95, .16);
    color: #755923;
}

.production-libax-badge.is-libax-missing {
    background: rgba(180, 61, 61, .10);
    color: #9a3636;
}

.production-libax-badge.is-libax-error {
    background: rgba(180, 61, 61, .08);
    color: #8a4141;
}

.production-libax-badge.is-libax-pending {
    background: rgba(101, 116, 126, .10);
    color: #667681;
}

.production-libax-recheck {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(23, 56, 75, .13);
    border-radius: 7px;
    background: #fff;
    color: #315f79;
    cursor: pointer;
}

.production-libax-recheck:hover,
.production-libax-recheck:focus-visible {
    border-color: rgba(23, 56, 75, .30);
    background: #f5f7f8;
    outline: none;
}

.production-management-cell {
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
}

.production-management-cell .production-validation-state {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    overflow: visible;
}

.production-validation-label {
    color: #71808a;
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
}

/* Dá espaço suficiente aos dois níveis de validação sem acrescentar uma nova coluna. */
.production-table.is-manager-view th:nth-child(3),
.production-table.is-manager-view td:nth-child(3) { width: 9%; }
.production-table.is-manager-view th:nth-child(4),
.production-table.is-manager-view td:nth-child(4) { width: 6%; }
.production-table.is-manager-view th:nth-child(5),
.production-table.is-manager-view td:nth-child(5) { width: 5%; }
.production-table.is-manager-view th:nth-child(10),
.production-table.is-manager-view td:nth-child(10) { width: 8%; }
.production-table.is-manager-view th:nth-child(13),
.production-table.is-manager-view td:nth-child(13) { width: 8%; }
.production-table.is-manager-view th:nth-child(14),
.production-table.is-manager-view td:nth-child(14) { width: 16%; }

@media (max-width: 1180px) {
    .production-summary.is-manager-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .production-summary.is-manager-summary .production-summary-person {
        grid-column: span 3;
    }
}

@media (max-width: 720px) {
    .production-list-tools {
        align-items: flex-start;
        justify-content: flex-start;
    }

    .production-libax-month-button {
        white-space: normal;
    }
}

@media (max-width: 720px) {
    .production-summary.is-manager-summary {
        grid-template-columns: 1fr;
    }

    .production-summary.is-manager-summary .production-summary-person {
        grid-column: span 1;
    }
}

/* v0.9.25 · índice local de apólices Libax */
.production-libax-index-sync {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.production-libax-index-label {
    color: #667681;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.production-libax-index-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.production-libax-index-button svg,
.production-libax-month-button svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.production-libax-index-button:disabled,
.production-libax-month-button:disabled,
.production-libax-recheck:disabled {
    opacity: .52;
    cursor: wait;
    pointer-events: none;
}

.production-libax-recheck:disabled {
    background: #f4f6f7;
}

@media (max-width: 1180px) {
    .production-libax-index-sync {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 720px) {
    .production-libax-index-sync {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .production-libax-index-label {
        white-space: normal;
    }
}

/* v0.9.32 · diferenças visíveis e correções assistidas pela base Libax */
.production-table td.is-libax-field-mismatch {
    background: #fff1f1 !important;
    color: #9a3636;
    box-shadow: inset 3px 0 0 #c85757;
}

.production-table tr:hover td.is-libax-field-mismatch {
    background: #ffeaea !important;
}

.production-table td.is-libax-field-mismatch strong,
.production-table td.is-libax-field-mismatch .production-policy,
.production-table td.is-libax-field-mismatch .production-status {
    color: #9a3636;
}

.production-libax-correction-panel {
    margin: 0 0 6px;
    border: 1px solid rgba(184, 88, 88, .18);
    border-radius: 8px;
    background: #fffafa;
    overflow: hidden;
}

.production-libax-correction-panel > summary {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 7px;
    color: #963f3f;
    font-size: 8.75px;
    font-weight: 800;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.production-libax-correction-panel > summary::-webkit-details-marker {
    display: none;
}

.production-libax-correction-panel > summary::before {
    content: '✎';
    font-size: 10px;
}

.production-libax-correction-panel[open] > summary {
    border-bottom: 1px solid rgba(184, 88, 88, .14);
    background: #fff5f5;
}

.production-libax-correction-form {
    display: grid;
    gap: 6px;
    padding: 7px;
}

.production-libax-correction-title {
    color: #5d6870;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .035em;
}

.production-libax-correction-option {
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr);
    align-items: start;
    gap: 5px;
    padding: 5px;
    border: 1px solid rgba(33, 58, 72, .09);
    border-radius: 7px;
    background: #fff;
    cursor: pointer;
}

.production-libax-correction-option input {
    margin: 2px 0 0;
}

.production-libax-correction-option span {
    min-width: 0;
}

.production-libax-correction-option strong {
    display: block;
    color: #293b46;
    font-size: 8.5px;
}

.production-libax-correction-option small {
    display: block;
    margin-top: 2px;
    color: #667681;
    font-size: 8px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.production-libax-correction-option del {
    color: #a04b4b;
}

.production-libax-correction-option b {
    color: #137a50;
}

.production-libax-correct-button {
    justify-self: start;
}

.production-libax-correction-note {
    color: #7b878f;
    font-size: 7.75px;
    line-height: 1.3;
}

@media (max-width: 980px) {
    .production-libax-correction-option {
        grid-template-columns: 18px minmax(0, 1fr);
    }

    .production-libax-correction-panel > summary,
    .production-libax-correction-option strong {
        font-size: 10px;
    }

    .production-libax-correction-option small,
    .production-libax-correction-note {
        font-size: 9px;
    }
}

/* v0.9.33 · anulação justificada de registos sem correspondência no Libax */
.production-table tr.is-annulled td {
    background-color: #f7f8f8;
    color: #8a949b;
}

.production-table tr.is-annulled td:nth-child(-n+10) {
    text-decoration: line-through;
    text-decoration-thickness: 1px;
    text-decoration-color: rgba(102, 115, 123, .62);
    opacity: .72;
}

.production-table tr.is-annulled:hover td {
    background-color: #f4f5f5;
}

.production-validation-badge.is-annulled {
    background: rgba(95, 106, 114, .13);
    color: #5d6870;
    border: 1px solid rgba(95, 106, 114, .12);
}

.production-annulled-state {
    display: grid;
    gap: 4px;
    justify-items: start;
}

.production-annulled-reason {
    display: block;
    max-width: 170px;
    color: #737f86;
    font-size: 7.75px;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
}

.production-annulled-static {
    display: block;
    color: #858f96;
    font-size: 9px;
}

.production-annul-panel {
    margin: 0 0 6px;
    border: 1px solid rgba(166, 69, 69, .20);
    border-radius: 8px;
    background: #fff9f9;
    overflow: hidden;
}

.production-annul-panel > summary {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 7px;
    color: #9a3f3f;
    font-size: 8.75px;
    font-weight: 800;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.production-annul-panel > summary::-webkit-details-marker {
    display: none;
}

.production-annul-panel > summary::before {
    content: '⊘';
    font-size: 10px;
}

.production-annul-panel[open] > summary {
    border-bottom: 1px solid rgba(166, 69, 69, .14);
    background: #fff3f3;
}

.production-annul-form {
    display: grid;
    gap: 6px;
    padding: 7px;
}

.production-annul-form label {
    display: grid;
    gap: 4px;
    color: #5f6d75;
    font-size: 8px;
    font-weight: 700;
}

.production-annul-form textarea {
    width: 100%;
    min-height: 52px;
    resize: vertical;
    border: 1px solid rgba(35, 60, 74, .16);
    border-radius: 7px;
    padding: 6px 7px;
    background: #fff;
    color: #293b46;
    font: inherit;
    font-size: 8.5px;
    line-height: 1.3;
}

.production-annul-form textarea:focus {
    outline: 0;
    border-color: rgba(166, 69, 69, .52);
    box-shadow: 0 0 0 2px rgba(166, 69, 69, .08);
}

.production-annul-button {
    justify-self: start;
    background: #9d4545 !important;
    border-color: #9d4545 !important;
    color: #fff !important;
}

.production-annul-form > small {
    color: #7b878f;
    font-size: 7.75px;
    line-height: 1.3;
}

@media (max-width: 980px) {
    .production-annul-panel > summary,
    .production-annul-form label,
    .production-annul-form textarea {
        font-size: 10px;
    }

    .production-annul-form > small,
    .production-annulled-reason {
        font-size: 9px;
    }
}

/* v0.9.34 · resumo compacto + Report Mensal */
@media (min-width: 1201px) {
    .production-summary.is-manager-summary {
        grid-template-columns: minmax(150px, 1.35fr) repeat(8, minmax(82px, 1fr));
        gap: 8px;
    }

    .production-summary.is-manager-summary > div {
        padding: 10px 11px;
        border-radius: 13px;
        min-height: 78px;
    }

    .production-summary.is-manager-summary span,
    .production-summary.is-manager-summary small {
        font-size: 10px;
        line-height: 1.25;
    }

    .production-summary.is-manager-summary strong {
        margin-top: 3px;
        font-size: 15px;
        line-height: 1.15;
    }

    .production-summary.is-manager-summary .production-summary-person strong {
        font-size: 14px;
    }
}

.production-monthly-report-button,
.production-monthly-report-actions button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.production-monthly-report-button svg,
.production-monthly-report-actions svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.production-monthly-report-shell {
    max-width: 1500px;
    margin: 0 auto;
}

.production-monthly-report-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.production-monthly-report {
    padding: 24px;
    border: 1px solid rgba(23, 56, 75, .10);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 28px rgba(23, 56, 75, .05);
}

.production-monthly-report-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(23, 56, 75, .09);
}

.production-monthly-report-head h1 {
    margin: 3px 0 8px;
    color: #17384b;
    font-size: 27px;
}

.production-monthly-report-head strong,
.production-monthly-report-head small {
    display: block;
}

.production-monthly-report-head > div:first-child > strong {
    color: #1f3948;
    font-size: 16px;
}

.production-monthly-report-head > div:first-child > small {
    margin-top: 2px;
    color: #74828c;
}

.production-monthly-report-rule {
    max-width: 340px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f3f7f8;
}

.production-monthly-report-rule span,
.production-monthly-report-rule small {
    display: block;
    color: #71808a;
    font-size: 11px;
}

.production-monthly-report-rule strong {
    margin: 2px 0 3px;
    color: #17384b;
    font-size: 14px;
}

.production-monthly-report-totals {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 10px;
    margin: 18px 0;
}

.production-monthly-report-totals > div {
    padding: 12px 14px;
    border: 1px solid rgba(23, 56, 75, .09);
    border-radius: 12px;
    background: #fbfcfc;
}

.production-monthly-report-totals span {
    display: block;
    color: #73808b;
    font-size: 11px;
}

.production-monthly-report-totals strong {
    display: block;
    margin-top: 3px;
    color: #17384b;
    font-size: 18px;
}

.production-monthly-report-table-wrap {
    overflow-x: auto;
}

.production-monthly-report-table {
    width: 100%;
    min-width: 1100px;
    border-collapse: collapse;
    color: #304652;
    font-size: 11px;
}

.production-monthly-report-table th {
    padding: 8px 9px;
    background: #f3f6f7;
    color: #5d707c;
    text-align: left;
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: .02em;
    border-bottom: 1px solid rgba(23, 56, 75, .10);
}

.production-monthly-report-table td {
    padding: 9px;
    border-bottom: 1px solid rgba(23, 56, 75, .075);
    vertical-align: top;
}

.production-monthly-report-table td.is-number,
.production-monthly-report-table th.is-number {
    text-align: right;
    white-space: nowrap;
}

.production-monthly-report-table tfoot td {
    background: #f8fafb;
    border-top: 1px solid rgba(23, 56, 75, .14);
    border-bottom: 0;
}

.production-report-valid {
    display: block;
    color: #2b7557;
    font-weight: 800;
    white-space: nowrap;
}

.production-monthly-report-table td > small {
    display: block;
    margin-top: 2px;
    color: #7b878e;
    font-size: 9px;
}

.production-monthly-report-empty {
    padding: 34px 20px;
    border: 1px dashed rgba(23, 56, 75, .16);
    border-radius: 12px;
    color: #71808a;
    text-align: center;
}

.production-monthly-report-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px solid rgba(23, 56, 75, .08);
    color: #87929a;
    font-size: 10px;
}

@media (max-width: 1200px) {
    .production-summary.is-manager-summary {
        grid-template-columns: repeat(4, minmax(130px, 1fr));
    }

    .production-summary.is-manager-summary .production-summary-person {
        grid-column: span 2;
    }
}

@media (max-width: 760px) {
    .production-monthly-report {
        padding: 15px;
    }

    .production-monthly-report-head,
    .production-monthly-report-actions,
    .production-monthly-report-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .production-monthly-report-totals {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }
}

@media print {
    .no-print,
    header.app-header,
    nav,
    .topbar,
    .context-nav,
    .flash-stack {
        display: none !important;
    }

    body {
        background: #fff !important;
    }

    .app-shell,
    main,
    .workspace,
    .production-monthly-report-shell {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .production-monthly-report {
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    .production-monthly-report-table-wrap {
        overflow: visible !important;
    }

    .production-monthly-report-table {
        min-width: 0 !important;
        font-size: 8.5px !important;
    }

    .production-monthly-report-table th {
        font-size: 7.5px !important;
    }

    .production-monthly-report-table th,
    .production-monthly-report-table td {
        padding: 5px !important;
    }
}

/* Preserve legibility; the annulled badge already communicates state. */
.production-table tr.is-annulled td:nth-child(-n+10){text-decoration:none;opacity:1;color:#52616a}
