/* ==============================================
   EMPRÉSTIMO PESSOAL - CSS COMPLETO
   Arquivo: emprestimo/static/emprestimo/css/emprestimo.css
   ============================================== */

/* Container Principal */
.emprestimo-container {
    padding: 24px;
}

/* Header */
.emprestimo-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.emprestimo-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 4px 0;
}

.emprestimo-header p {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

.emprestimo-header-buttons {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* ==============================================
   CARDS DE RESUMO - LAYOUT VERTICAL
   ============================================== */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    background: #ffffff;
    border-radius: 8px;
    padding: 12px 16px;
    border-top: 3px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-card.blue {
    border-top-color: #3b82f6;
}

.stat-card.green {
    border-top-color: #10b981;
}

.stat-card.yellow {
    border-top-color: #f59e0b;
}

.stat-card.red {
    border-top-color: #ef4444;
}

/* Título do card - LINHA 1 */
.stat-card-title {
    display: block;
    width: 100%;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin: 0 0 4px 0;
    padding: 0;
}

/* Valor do card - LINHA 2 */
.stat-card-value {
    display: block;
    width: 100%;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 2px 0;
    padding: 0;
}

.stat-card.blue .stat-card-value {
    color: #1d4ed8;
}

.stat-card.green .stat-card-value {
    color: #059669;
}

.stat-card.yellow .stat-card-value {
    color: #d97706;
}

.stat-card.red .stat-card-value {
    color: #dc2626;
}

/* Descrição do card - LINHA 3 */
.stat-card-meta {
    display: block;
    width: 100%;
    font-size: 0.7rem;
    color: #9ca3af;
    margin: 0;
    padding: 0;
}

/* ==============================================
   INFO DO EMPRÉSTIMO
   ============================================== */

.emprestimo-info {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.emprestimo-info-header {
    margin-bottom: 16px;
}

.emprestimo-info-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
}

.emprestimo-info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.info-item {
    text-align: center;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
}

.info-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 6px;
}

.info-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1f2937;
}

.info-value.quitado {
    color: #10b981;
}

.info-value.aberto {
    color: #f59e0b;
}

/* ==============================================
   TABELA DE PAGAMENTOS
   ============================================== */

.pagamentos-section {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.pagamentos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.pagamentos-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
}

.pagamentos-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.pagamentos-table th {
    background: #f8fafc;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #64748b;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid #e5e7eb;
}

.pagamentos-table th.acoes {
    width: 80px;
    text-align: center;
}

.pagamentos-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: #374151;
}

.pagamentos-table td.acoes {
    text-align: center;
}

.pagamentos-table tbody tr:hover {
    background: #fafbfc;
}

.valor-pago {
    font-weight: 600;
    color: #10b981;
}

/* ==============================================
   ESTADO VAZIO
   ============================================== */

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #9ca3af;
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state-large {
    text-align: center;
    padding: 48px 24px;
}

.empty-state-large svg {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    color: #9ca3af;
}

.empty-state-large h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.empty-state-large p {
    color: #6b7280;
    margin-bottom: 24px;
}

/* ==============================================
   BOTÕES
   ============================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 0.813rem;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: #3b82f6;
    color: #ffffff;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-success {
    background: #10b981;
    color: #ffffff;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: #fee2e2;
    color: #dc2626;
    padding: 8px;
}

.btn-danger:hover {
    background: #ef4444;
    color: #ffffff;
}

.btn-secondary {
    background: #6b7280;
    color: #ffffff;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-sm svg {
    width: 14px;
    height: 14px;
}

/* ==============================================
   MODAL
   ============================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #9ca3af;
    padding: 4px;
    line-height: 1;
}

.modal-close:hover {
    color: #6b7280;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

/* ==============================================
   CAMPOS DE FORMULÁRIO
   ============================================== */

.field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    color: #374151;
}

.field input,
.field textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.field small {
    display: block;
    margin-top: 4px;
    font-size: 0.75rem;
    color: #6b7280;
}

/* ==============================================
   RESPONSIVO
   ============================================== */

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

    .emprestimo-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .emprestimo-info-grid {
        grid-template-columns: 1fr;
    }

    .emprestimo-header {
        flex-direction: column;
        gap: 16px;
    }
}
