﻿/* =========================================================
   DMB FinCore - SolicitaÃ§Ãµes de Pagamento
   Escopo: somente pÃ¡ginas com .payment-requests-page
   ========================================================= */

.payment-requests-page {
    width: 100%;
}

.payment-requests-page .module-header {
    align-items: center;
}

.payment-requests-page .module-header-actions {
    flex-shrink: 0;
}

.payment-requests-page .summary-card {
    min-height: 104px;
}

.payment-requests-page .summary-icon svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.payment-requests-page .summary-content {
    flex: 1;
    text-align: center;
}

.payment-requests-page .summary-content strong {
    margin-top: 0.45rem;
    font-size: clamp(1.35rem, 1.8vw, 1.75rem);
    white-space: nowrap;
}

.payment-requests-page .request-workflow-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.payment-requests-page .request-workflow-tabs button {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 44px;
    padding: 0.65rem 1rem;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    color: #1d4ed8;
    background: #eff6ff;
    font-weight: 800;
    cursor: pointer;
}

.payment-requests-page .request-workflow-tabs button.active {
    border-color: #1d4ed8;
    color: #fff;
    background: #2454df;
}

.payment-requests-page .request-workflow-tabs button span {
    min-width: 25px;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    color: #1d4ed8;
    background: #fff;
    text-align: center;
}

.payment-requests-page .request-actions-menu .success-action {
    color: #047857;
    background: #ecfdf5;
}

.payment-requests-page .request-actions-menu .danger-action {
    color: #b91c1c;
    background: #fef2f2;
}

.request-form-overlay {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.64);
    backdrop-filter: blur(4px);
}

.payment-requests-page .request-form-modal {
    width: min(1180px, 96vw);
    max-height: calc(100vh - 3rem);
    margin: auto;
    padding: 1.5rem;
    overflow-y: auto;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.34);
}

.payment-requests-page .request-form-modal .section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.payment-requests-page .request-form-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid #bfdbfe;
    border-radius: 13px;
    color: #1d4ed8;
    background: #eff6ff;
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.payment-requests-page .request-form-close:hover {
    border-color: #1d4ed8;
    background: #dbeafe;
}

.payment-requests-page .request-form-feedback {
    margin: 0 0 1.25rem;
}

.payment-requests-page .request-date-rule {
    display: block;
    margin-top: 0.4rem;
    color: #64748b;
    line-height: 1.35;
}

.payment-requests-page .feature-card,
.payment-requests-page .form-section,
.payment-requests-page .feature-filters,
.payment-requests-page .feature-table-card {
    border-color: #dbe3ef;
}

.payment-requests-page .feature-table tbody tr:hover {
    background: #f8fbff;
}

.payment-requests-page .feature-status-active,
.payment-requests-page .status-active {
    color: #059669;
    font-weight: 900;
}

.payment-requests-page .feature-status-inactive,
.payment-requests-page .status-inactive {
    color: #64748b;
    font-weight: 900;
}

.payment-requests-page .feature-money-positive {
    color: #047857;
    font-weight: 900;
}

.payment-requests-page .feature-money-negative {
    color: #dc2626;
    font-weight: 900;
}

/* A tabela segue o mesmo padrão aprovado em Unidades. */
.payment-requests-page .table-card,
.payment-requests-page .data-table {
    overflow: visible;
}

.payment-requests-page .data-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.payment-requests-page .data-table th,
.payment-requests-page .data-table td {
    padding: 1rem 0.65rem;
    overflow-wrap: anywhere;
}

.payment-requests-page .data-table td {
    vertical-align: middle;
}

.payment-requests-page .data-table th:nth-child(2),
.payment-requests-page .data-table td:nth-child(2),
.payment-requests-page .data-table th:nth-child(5),
.payment-requests-page .data-table td:nth-child(5),
.payment-requests-page .data-table th:nth-child(6),
.payment-requests-page .data-table td:nth-child(6),
.payment-requests-page .data-table th:nth-child(7),
.payment-requests-page .data-table td:nth-child(7),
.payment-requests-page .data-table th:nth-child(8),
.payment-requests-page .data-table td:nth-child(8),
.payment-requests-page .data-table th:nth-child(9),
.payment-requests-page .data-table td:nth-child(9) {
    text-align: center;
}

.payment-requests-page .data-table th:first-child,
.payment-requests-page .data-table td:first-child {
    width: 15%;
}

.payment-requests-page .data-table th:nth-child(3),
.payment-requests-page .data-table td:nth-child(3) {
    width: 12%;
}

.payment-requests-page .request-type-text,
.payment-requests-page .request-priority-text {
    display: inline;
    color: #0b1f3a;
    font-size: 0.94rem;
    font-weight: 600;
}

.payment-requests-page .request-priority-text.urgent {
    color: #b91c1c;
    font-weight: 800;
}

.payment-requests-page .data-table th:nth-child(8),
.payment-requests-page .data-table td:nth-child(8) {
    width: 126px;
    min-width: 126px;
    text-align: center;
}

.payment-requests-page .data-table th:last-child,
.payment-requests-page .data-table td:last-child {
    width: 96px;
    min-width: 96px;
    text-align: center;
}

.payment-requests-page .request-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    padding: 0.38rem 0.75rem;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1;
    pointer-events: none;
    user-select: none;
}

.payment-requests-page .request-status-badge.active {
    color: #047857;
    background: #d1fae5;
}

.payment-requests-page .request-status-badge.inactive {
    color: #b91c1c;
    background: #fee2e2;
}

.payment-requests-page .request-status-badge.pending {
    color: #92400e;
    background: #fef3c7;
}

.payment-requests-page .request-status-badge.neutral {
    color: #475569;
    background: #e2e8f0;
}

.payment-requests-page .actions-cell {
    position: relative;
    z-index: 1;
    overflow: visible;
}

.payment-requests-page .request-actions-menu {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.payment-requests-page .kebab-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 42px;
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    background: #ffffff;
    color: #1d4ed8;
    font-size: 1.6rem;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    box-shadow: none;
}

.payment-requests-page .kebab-button:hover {
    background: #eff6ff;
    border-color: #1d4ed8;
}

.payment-requests-page .kebab-menu {
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    z-index: 130;
    min-width: 180px;
    padding: 0.45rem;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.18);
}

.payment-requests-page .kebab-menu button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 46px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #0b1f3a;
    padding: 0.75rem 0.9rem;
    text-align: center;
    line-height: 1.25;
    font-size: 0.96rem;
    font-weight: 800;
    cursor: pointer;
}

.payment-requests-page .kebab-menu button:hover {
    background: #eff6ff;
    color: #1d4ed8;
}

.payment-requests-page .data-table tbody tr:last-child .kebab-menu {
    top: auto;
    bottom: calc(100% + 0.45rem);
}

.payment-requests-page .actions-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    border: 0;
    background: transparent;
    cursor: default;
}

.payment-requests-page .data-table tbody tr {
    position: relative;
    z-index: 0;
}

.payment-requests-page .data-table tbody tr.actions-row-open {
    z-index: 110;
}

.payment-requests-page .actions-cell.is-open,
.payment-requests-page .actions-cell.is-open .request-actions-menu {
    z-index: 120;
}

@media (max-width: 760px) {
    .payment-requests-page .feature-title {
        font-size: 2.25rem;
    }

    .payment-requests-page .module-header-actions,
    .payment-requests-page .module-header-actions .btn {
        width: 100%;
    }

    .request-form-overlay {
        align-items: flex-start;
        padding: 0.5rem;
    }

    .payment-requests-page .request-form-modal {
        max-height: calc(100vh - 1rem);
        padding: 1rem;
    }

    .payment-requests-page .actions-cell {
        width: 72px;
        min-width: 72px;
    }

    .payment-requests-page .kebab-menu {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }
}

/* Impressão individual da solicitação e do respectivo anexo. */
.request-viewer-overlay {
    position: fixed;
    inset: 0;
    z-index: 2200;
    display: flex;
    justify-content: center;
    padding: 1.5rem;
    overflow: auto;
    background: rgba(15, 23, 42, 0.68);
    backdrop-filter: blur(4px);
}

.request-print-overlay {
    align-items: flex-start;
}

.request-print-sheet {
    width: min(210mm, 100%);
    margin: 0 auto;
    padding: 18mm 14mm 14mm;
    border-radius: 18px;
    background: #ffffff;
    color: #0b1f3a;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.28);
}

.request-print-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin: -8mm 0 8mm;
}

.request-print-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid #0b1f3a;
}

.request-print-header .print-brand-logo {
    display: block;
    width: 210px;
    max-width: 60vw;
    height: auto;
    margin-bottom: 10px;
}

.request-print-header h1 {
    margin: 0.2rem 0;
    color: #0b1f3a;
    font-size: 1.65rem;
}

.request-print-header p,
.request-print-identification small {
    margin: 0;
    color: #64748b;
}

.request-print-identification {
    display: grid;
    min-width: 165px;
    text-align: right;
}

.request-print-identification span,
.request-print-data span,
.request-print-description > span,
.request-print-section-title span,
.request-print-value span {
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.request-print-value {
    display: grid;
    margin: 1rem 0;
    padding: 0.9rem 1rem;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    background: #eff6ff;
}

.request-print-value strong {
    color: #0b1f3a;
    font-size: 1.65rem;
}

.request-print-value small {
    color: #475569;
}

.request-print-data {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    overflow: hidden;
    border: 1px solid #dbe5f1;
    border-radius: 12px;
}

.request-print-data > div {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
    padding: 0.7rem 0.8rem;
    border-right: 1px solid #dbe5f1;
    border-bottom: 1px solid #dbe5f1;
}

.request-print-data strong,
.request-print-description strong,
.request-print-description p {
    overflow-wrap: anywhere;
}

.request-print-description,
.request-print-attachment {
    display: grid;
    gap: 0.35rem;
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid #dbe5f1;
    border-radius: 12px;
}

.request-print-description p {
    margin: 0;
    color: #334155;
}

.request-print-section-title > div {
    display: grid;
}

.request-print-attachment img,
.request-print-attachment object {
    display: block;
    width: 100%;
    height: auto;
    max-height: 95mm;
    margin-top: 0.5rem;
    object-fit: contain;
    border: 1px solid #e2e8f0;
    background: #ffffff;
}

.request-print-attachment object {
    height: 95mm;
}

.request-print-attachment pre {
    max-height: 95mm;
    margin: 0.5rem 0 0;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 0.68rem;
}

.request-print-no-attachment {
    margin: 0.5rem 0 0;
    padding: 1rem;
    color: #64748b;
    text-align: center;
    background: #f8fafc;
}

.request-print-signatures {
    display: grid;
    grid-template-columns: 1fr 1fr 0.65fr;
    gap: 1rem;
    margin-top: 1.4rem;
}

.request-print-signatures div {
    min-height: 34px;
    padding-top: 0.45rem;
    border-top: 1px solid #334155;
    color: #475569;
    font-size: 0.76rem;
    text-align: center;
}

.request-attachment-overlay {
    align-items: center;
}

.request-attachment-modal {
    display: flex;
    flex-direction: column;
    width: min(1180px, 96vw);
    max-height: calc(100vh - 3rem);
    overflow: hidden;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.34);
}

.request-attachment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #dbe5f1;
}

.request-attachment-header > div {
    min-width: 0;
}

.request-attachment-header span {
    display: block;
    margin-bottom: 0.2rem;
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.request-attachment-header h3 {
    margin: 0;
    overflow-wrap: anywhere;
    color: #0b1f3a;
    font-size: 1.2rem;
}

.request-attachment-content {
    flex: 1;
    min-height: 0;
    padding: 1rem;
    background: #f1f5f9;
}

.request-attachment-content object {
    display: block;
    width: 100%;
    height: min(76vh, 820px);
    border: 0;
    border-radius: 12px;
    background: #ffffff;
}

@media (max-width: 760px) {
    .request-viewer-overlay { padding: 0; }
    .request-print-sheet { padding: 1rem; border-radius: 0; }
    .request-print-header { flex-direction: column; }
    .request-print-identification { text-align: left; }
    .request-print-data { grid-template-columns: 1fr; }
    .request-print-actions { margin: 0 0 1rem; }
    .request-attachment-overlay { align-items: stretch; }
    .request-attachment-modal { width: 100%; max-height: 100vh; border-radius: 0; }
    .request-attachment-header { align-items: flex-start; }
    .request-attachment-content object { height: calc(100vh - 96px); }
}

@media print {
    @page {
        size: A4 portrait;
        margin: 8mm;
    }

    body * {
        visibility: hidden !important;
    }

    .request-viewer-overlay,
    .request-viewer-overlay *,
    .request-print-sheet,
    .request-print-sheet * {
        visibility: visible !important;
    }

    .request-print-overlay {
        position: absolute !important;
        inset: 0 auto auto 0 !important;
        display: block !important;
        width: 100% !important;
        height: auto !important;
        padding: 0 !important;
        overflow: visible !important;
        background: #ffffff !important;
    }

    .request-print-sheet {
        width: 100% !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    .no-print {
        display: none !important;
    }

    .request-print-header,
    .request-print-value,
    .request-print-data,
    .request-print-description,
    .request-print-attachment,
    .request-print-signatures {
        break-inside: avoid;
    }

    .request-print-attachment pre {
        overflow: hidden;
    }
}
