﻿/* ============================================
                   e-SendBill - Dashboard do Credor (DEMO)
                   Paleta: Cinzas + Laranja (#ff8c00 e #e94e1b)
                   ============================================ */

:root {
    --primary-orange: #ff8c00;
    --primary-orange-dark: #e67e00;
    --accent-red: #e94e1b;
    --success-green: #4caf50;
    --text-dark: #1a1a1a;
    --text-medium: #666;
    --text-light: #999;
    --bg-white: #ffffff;
    --bg-light: #f5f5f5;
    --bg-gray: #eaeaea;
    --border-color: #e0e0e0;
    --border-light: #f0f0f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    min-height: 100vh;
    line-height: 1.5;
}

/* ========== DEMO BANNER ========== */
.demo-banner {
    background: linear-gradient(135deg, #1a1a1a, #333);
    color: white;
    padding: 1rem 2rem;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

    .demo-banner h4 {
        font-size: 0.9rem;
        font-weight: 600;
        margin-bottom: 0.25rem;
    }

    .demo-banner p {
        font-size: 0.8rem;
        color: #ccc;
        margin: 0;
    }

    .demo-banner .highlight {
        color: var(--primary-orange);
        font-weight: 700;
    }

/* ========== CONTAINER PRINCIPAL ========== */
.dashboard {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    background-color: white;
    min-height: calc(100vh - 80px);
    box-sizing: border-box;
}

/* ========== 1. HEADER - SAUDAÇÃO ========== */
.dashboard-header {
    margin-bottom: 2rem;
}

.greeting {
    font-size: 1.75rem;
    font-weight: 400;
    color: var(--text-dark);
    margin: 0 0 0.25rem 0;
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-medium);
    margin: 0;
}

/* ========== 2. RESUMO FINANCEIRO (Hero Card) ========== */
.financial-hero {
    background: linear-gradient(135deg, #eaeaea 0%, #333 100%);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    color: white;
    position: relative;
    overflow: hidden;
}

    .financial-hero::before {
        content: '';
        position: absolute;
        top: -50%;
        right: -10%;
        width: 300px;
        height: 300px;
        background: radial-gradient(circle, rgba(255,140,0,0.15) 0%, transparent 70%);
        border-radius: 50%;
        pointer-events: none;
    }

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.hero-main {
    flex: 1 1 auto;
    min-width: 200px;
}

.hero-label {
    font-size: 0.8rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 0.5rem 0;
}

.hero-balance {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--primary-orange);
    margin: 0 0 0.25rem 0;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 0.85rem;
    color: #ccc;
    margin: 0;
}

.hero-stats {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.hero-stat {
    text-align: center;
    min-width: 80px;
}

.hero-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    line-height: 1.2;
}

    .hero-stat-value.warning {
        color: var(--primary-orange);
    }

    .hero-stat-value.danger {
        color: var(--accent-red);
    }

    .hero-stat-value.success {
        color: var(--success-green);
    }

.hero-stat-label {
    font-size: 0.7rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

/* ========== 3. CTA - NOVA COBRANÇA ========== */
.cta-primary {
    background: linear-gradient(135deg, #ff8c00, #e67e00);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(255, 140, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
}

    .cta-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 25px rgba(255, 140, 0, 0.4);
    }

.cta-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cta-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.cta-text h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    margin: 0 0 0.15rem 0;
}

.cta-text p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

.cta-arrow {
    font-size: 1.5rem;
    color: white;
    font-weight: 300;
}

/* ========== 4. KPI CAROUSEL ========== */
.kpi-section {
    margin-bottom: 2rem;
}

.kpi-carousel-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    position: relative;
}

.kpi-nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: white;
    color: var(--text-medium);
    font-size: 1.5rem;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 2;
    line-height: 1;
    padding: 0;
}

.kpi-nav-prev {
    padding-right: 2px;
}

.kpi-nav-next {
    padding-left: 2px;
}

.kpi-nav-btn:hover:not(:disabled) {
    border-color: var(--primary-orange);
    color: var(--primary-orange);
    background: #fff8f0;
}

.kpi-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.kpi-grid {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex: 1;
    padding: 0.25rem 0;
}

    .kpi-grid::-webkit-scrollbar {
        display: none;
    }

.kpi-indicators {
    display: none;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0 1rem;
}

.kpi-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d0d0d0;
    transition: all 0.3s;
    cursor: pointer;
}

    .kpi-dot.active {
        background: var(--primary-orange);
        width: 24px;
        border-radius: 4px;
    }

.kpi-card {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: all 0.3s;
    min-width: calc((100% - 3rem) / 4);
    flex-shrink: 0;
    scroll-snap-align: start;
    box-sizing: border-box;
}

    .kpi-card.highlight {
        border: 2px solid var(--primary-orange);
        box-shadow: 0 2px 12px rgba(255, 140, 0, 0.15);
    }

    .kpi-card:hover {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    }

.kpi-icon-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.kpi-emoji {
    font-size: 1.5rem;
}

.kpi-label {
    font-size: 0.7rem;
    color: var(--text-light);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
}

    .kpi-value.orange {
        color: var(--primary-orange);
    }

    .kpi-value.red {
        color: var(--accent-red);
    }

    .kpi-value.green {
        color: var(--success-green);
    }

.kpi-trend {
    font-size: 0.8rem;
    color: var(--text-medium);
    font-weight: 500;
}

/* ========== 5. HISTÓRICO DE COBRANÇAS ========== */
.history-section {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

    .section-title span {
        font-weight: 400;
        color: var(--text-light);
        font-size: 0.9rem;
        margin-left: 0.5rem;
    }

.search-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-light);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

    .search-box:focus-within {
        border-color: var(--primary-orange);
        box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.1);
    }

    .search-box input {
        background: transparent;
        border: none;
        outline: none;
        color: var(--text-dark);
        font-family: inherit;
        font-size: 0.9rem;
        width: 180px;
    }

        .search-box input::placeholder {
            color: var(--text-light);
        }

.search-icon {
    color: var(--text-light);
    font-size: 1rem;
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

thead {
    background: var(--bg-light);
}

th {
    text-align: left;
    padding: 1rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    white-space: nowrap;
}

td {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-light);
    font-size: 0.9rem;
    vertical-align: middle;
}

tbody tr {
    transition: background 0.2s;
}

    tbody tr:hover {
        background: #fafafa;
    }

.date-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.date-box {
    width: 48px;
    height: 48px;
    background: var(--bg-light);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .date-box .day {
        font-size: 1.1rem;
        font-weight: 700;
        color: var(--text-dark);
        line-height: 1;
    }

    .date-box .month {
        font-size: 0.65rem;
        color: var(--text-light);
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

.description-cell {
    max-width: 300px;
}

.description-text {
    font-weight: 500;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.description-sub {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.15rem;
}

.amount {
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
}

    .amount.positive {
        color: var(--success-green);
    }

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

    .status-badge.paid {
        background: rgba(76, 175, 80, 0.12);
        color: var(--success-green);
    }

    .status-badge.pending {
        background: rgba(255, 140, 0, 0.12);
        color: var(--primary-orange);
    }

    .status-badge.overdue {
        background: rgba(233, 78, 27, 0.12);
        color: var(--accent-red);
    }

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.due-date {
    display: flex;
    flex-direction: column;
}

.due-date-value {
    font-weight: 500;
}

.due-date-status {
    font-size: 0.75rem;
    margin-top: 0.15rem;
}

    .due-date-status.overdue {
        color: var(--accent-red);
        font-weight: 600;
    }

    .due-date-status.today {
        color: var(--primary-orange);
        font-weight: 600;
    }

.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-light);
    background: var(--bg-light);
}

.pagination-info {
    font-size: 0.85rem;
    color: var(--text-medium);
}

.pagination-buttons {
    display: flex;
    gap: 0.5rem;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-medium);
    font-family: inherit;
    font-size: 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

    .pagination-btn:hover:not(:disabled) {
        border-color: var(--primary-orange);
        color: var(--primary-orange);
    }

    .pagination-btn:disabled {
        opacity: 0.4;
        cursor: not-allowed;
    }

    .pagination-btn.active {
        background: var(--primary-orange);
        border-color: var(--primary-orange);
        color: white;
    }

/* ========== RESPONSIVIDADE ========== */
@media (max-width: 900px) {
    .kpi-card {
        min-width: calc((100% - 2rem) / 3);
    }
}

@@media (max-width: 768px) {
    .dashboard {
        padding: 1.5rem;
    }

    .greeting {
        font-size: 1.5rem;
    }

    .hero-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-balance {
        font-size: 2rem;
    }

    .hero-stats {
        width: 100%;
        justify-content: space-between;
    }

    .cta-primary {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .cta-content {
        flex-direction: column;
    }

    .cta-arrow {
        transform: rotate(90deg);
    }

    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .search-box {
        width: 100%;
    }

        .search-box input {
            width: 100%;
        }

    .kpi-nav-btn {
        display: none;
    }

    .kpi-carousel-container {
        margin-bottom: 0;
    }

    .kpi-grid {
        gap: 0;
        padding: 0;
        min-height: 130px;
    }

    .kpi-card {
        min-width: 100%;
        width: 100%;
        scroll-snap-align: center;
    }

    .kpi-indicators {
        display: flex;
        margin-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .dashboard {
        padding: 1rem;
    }

    .greeting {
        font-size: 1.35rem;
    }

    .hero-balance {
        font-size: 1.75rem;
    }

    .hero-stat-value {
        font-size: 1.5rem;
    }

    th, td {
        padding: 1rem;
    }
}
