/* =============================================
   modal.css — Modal de resultado
   Power BI Modern Theme
   ============================================= */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
    animation: fadeIn 0.2s ease;
    overflow-y: auto;
    padding: 20px 0;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-content {
    background: var(--pbi-card);
    margin: 60px auto;
    padding: 0;
    border-radius: var(--pbi-radius-md);
    width: 90%;
    max-width: 400px;
    max-height: calc(100vh - 120px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.28), 0 4px 12px rgba(0,0,0,0.12);
    animation: slideIn 0.2s ease;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--pbi-border);
}

@keyframes slideIn {
    from { transform: translateY(-30px); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 1.5rem;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    line-height: 1;
    z-index: 1;
    transition: color 0.15s ease, transform 0.2s ease;
}

.modal-close:hover {
    color: var(--pbi-yellow);
    transform: rotate(90deg);
}

.modal-header {
    background: var(--pbi-dark);
    color: white;
    padding: 20px 24px;
    text-align: center;
    flex-shrink: 0;
    position: relative;
    border-bottom: 3px solid var(--pbi-yellow);
}

.modal-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 6px;
}

.modal-header h2 {
    font-size: 16px;
    margin: 0;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.modal-body {
    padding: 18px 20px;
    overflow-y: auto;
    flex: 1;
}

.result-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 8px;
    background: #FAFAFA;
    border-radius: var(--pbi-radius);
    border: 1px solid var(--pbi-border2);
    transition: background 0.12s ease;
}

.result-item:hover {
    background: var(--pbi-blue-lt);
}

.result-item.total {
    background: var(--pbi-dark);
    border-color: var(--pbi-dark);
    font-weight: 700;
}

.result-item.total .result-label {
    color: rgba(255,255,255,0.85);
}

.result-item.total .result-value {
    color: var(--pbi-yellow);
}

.result-label {
    flex: 1;
    font-size: 13px;
    color: var(--pbi-text);
    font-weight: 500;
}

.result-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--pbi-blue);
    min-width: 44px;
    text-align: right;
}

.modal-errors {
    margin-top: 12px;
    padding: 10px 12px;
    background: #FFF4CE;
    border-radius: var(--pbi-radius);
    border-left: 3px solid #F2C811;
}

.error-header {
    font-weight: 700;
    color: #7D5800;
    margin-bottom: 6px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.error-list {
    font-size: 12px;
    color: #7D5800;
    max-height: 110px;
    overflow-y: auto;
}

.error-list div {
    padding: 3px 0;
    border-bottom: 1px solid #E8D9A0;
}

.error-list div:last-child { border-bottom: none; }

.modal-footer {
    padding: 12px 20px;
    text-align: center;
    background: #FAFAFA;
    flex-shrink: 0;
    border-top: 1px solid var(--pbi-border2);
}

.btn-modal {
    padding: 8px 32px;
    background: var(--pbi-blue);
    color: white;
    border: none;
    border-radius: var(--pbi-radius);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease;
    min-width: 90px;
    font-family: inherit;
    letter-spacing: 0.1px;
}

.btn-modal:hover {
    background: var(--pbi-blue-dk);
    box-shadow: var(--pbi-shadow-sm);
}

/* ── Modal de Aviso ── */
.warning-modal-content {
    max-width: 460px;
}

.warning-modal-header {
    background: #7D5800;
    border-bottom: 3px solid #F2C811;
}

.warning-modal-body {
    padding: 20px 24px;
}

.warning-modal-msg {
    font-size: 14px;
    color: var(--pbi-text);
    margin: 0 0 16px;
    font-weight: 500;
    text-align: center;
}

.warning-modal-hint {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #EFF6FF;
    border: 1px solid #BDD7EE;
    border-left: 3px solid #0078D4;
    border-radius: var(--pbi-radius);
    padding: 12px 14px;
    font-size: 13px;
    color: #004578;
    line-height: 1.5;
}

/* ── Modal de Detalhes ERB ── */
.erb-detail-modal .erb-modal-content {
    max-width: 960px;
    width: 95%;
}

.erb-modal-header {
    background: var(--pbi-dark);
    border-bottom: 3px solid var(--pbi-red, #D13438);
}

.erb-modal-subtitle {
    font-size: 12px;
    color: rgba(255,255,255,0.65);
    margin: 4px 0 0;
    font-weight: 400;
}

.erb-modal-body {
    padding: 16px;
    max-height: 60vh;
    overflow-y: auto;
}

.erb-table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--pbi-border);
    border-radius: var(--pbi-radius);
}

.erb-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.erb-detail-table thead {
    background: var(--pbi-dark);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 1;
}

.erb-detail-table th {
    padding: 8px 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
    border-right: 1px solid #3A3A3A;
}

.erb-detail-table th:last-child { border-right: none; }

.erb-detail-table td {
    padding: 7px 12px;
    border-bottom: 1px solid var(--pbi-border2);
    color: var(--pbi-text);
    white-space: nowrap;
}

.erb-detail-table tbody tr:hover { background: var(--pbi-blue-lt); }
.erb-detail-table tbody tr:nth-child(even) { background: #FAFAFA; }
.erb-detail-table tbody tr:nth-child(even):hover { background: var(--pbi-blue-lt); }

.erb-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-modal-green {
    background: var(--pbi-green);
    border-color: var(--pbi-green);
}

.btn-modal-green:hover {
    background: #0A6A0A;
    box-shadow: var(--pbi-shadow-sm);
}
