/* =====================================================
   DASHBOARD: Controle Financeiro - Prestador de Serviços
   ===================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark: #1f2937;
    --gray: #6b7280;
    --light-gray: #f3f4f6;
    --border: #e5e7eb;
    --white: #ffffff;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--dark);
}

/* =====================================================
   LOGIN PAGE
   ===================================================== */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-box {
    background: var(--white);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 28px;
    color: var(--dark);
    margin-bottom: 8px;
}

.login-header p {
    color: var(--gray);
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
}

.form-group input {
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-footer {
    text-align: center;
    margin-top: 10px;
}

.form-footer p {
    font-size: 14px;
    color: var(--gray);
}

.form-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.form-footer a:hover {
    text-decoration: underline;
}

.message-box {
    margin-top: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    display: none;
}

.message-box.show {
    display: block;
}

.message-box.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.message-box.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

/* =====================================================
   DASHBOARD PAGE
   ===================================================== */

.dashboard-page {
    background: var(--light-gray);
    min-height: 100vh;
}

/* Header */
.dashboard-header {
    background: var(--white);
    padding: 20px 30px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-title h1 {
    font-size: 24px;
    color: var(--dark);
}

.header-title p {
    font-size: 14px;
    color: var(--gray);
    margin-top: 4px;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    text-align: right;
}

.user-info p {
    font-size: 14px;
    color: var(--dark);
    font-weight: 600;
}

.user-info small {
    font-size: 12px;
    color: var(--gray);
}

.btn-logout {
    background: var(--danger-color);
    color: var(--white);
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: #dc2626;
}

/* Filters */
.filters-container {
    background: var(--white);
    padding: 20px 30px;
    margin: 20px 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.filters-row {
    display: flex;
    gap: 15px;
    align-items: end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--dark);
}

.filter-group input {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
}

.btn-secondary {
    background: var(--gray);
    color: var(--white);
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

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

.btn-success {
    background: var(--success-color);
    color: var(--white);
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

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

/* Cards */
.cards-container {
    padding: 0 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.mini-card {
    background: var(--white);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.mini-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.mini-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.mini-card-title {
    font-size: 13px;
    color: var(--gray);
    font-weight: 600;
    text-transform: uppercase;
}

.mini-card-icon {
    font-size: 24px;
}

.mini-card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark);
}

.mini-card.success .mini-card-value {
    color: var(--success-color);
}

.mini-card.danger .mini-card-value {
    color: var(--danger-color);
}

.mini-card.warning .mini-card-value {
    color: var(--warning-color);
}

.mini-card.primary .mini-card-value {
    color: var(--primary-color);
}

/* Tabs */
.tabs-container {
    padding: 0 30px;
    margin-bottom: 30px;
}

.tabs-header {
    display: flex;
    gap: 10px;
    background: var(--white);
    padding: 10px;
    border-radius: 12px 12px 0 0;
    box-shadow: var(--shadow);
}

.tab-button {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray);
    cursor: pointer;
    transition: all 0.3s;
}

.tab-button:hover {
    background: var(--light-gray);
}

.tab-button.active {
    background: var(--primary-color);
    color: var(--white);
}

.tabs-content {
    background: var(--white);
    padding: 30px;
    border-radius: 0 0 12px 12px;
    box-shadow: var(--shadow);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.btn-add {
    background: var(--primary-color);
    color: var(--white);
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-add:hover {
    background: var(--primary-dark);
}

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--light-gray);
}

th {
    padding: 12px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--dark);
    text-transform: uppercase;
}

td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

tbody tr:hover {
    background: var(--light-gray);
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.status-badge.pago {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.pendente {
    background: #fef3c7;
    color: #92400e;
}

.checkbox-status {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-edit {
    background: var(--primary-color);
    color: var(--white);
}

.btn-delete {
    background: var(--danger-color);
    color: var(--white);
}

.action-btn:hover {
    opacity: 0.8;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--white);
    padding: 30px;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

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

.modal-header h2 {
    font-size: 20px;
    color: var(--dark);
}

.close-modal {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--gray);
    cursor: pointer;
    line-height: 1;
}

.close-modal:hover {
    color: var(--dark);
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

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

.btn-cancel {
    background: var(--gray);
    color: var(--white);
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--gray);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--gray);
}

.spinner {
    border: 4px solid var(--light-gray);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-header {
        padding: 15px 20px;
    }

    .filters-container,
    .cards-container,
    .tabs-container {
        margin: 15px 20px;
        padding: 15px 20px;
    }

    .tabs-content {
        padding: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .cards-container {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 8px;
    }
}
