/* painel-vendedor.css — Dashboard do Prestador */

body {
    padding-bottom: 24px !important;
}

/* ================================================
   DASHBOARD LAYOUT
   ================================================ */

.dashboard {
    width: min(1200px, calc(100% - 32px));
    margin: 24px auto 0;
    display: grid;
    gap: 20px;
}

/* ================================================
   CARD BASE
   ================================================ */

.dash-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    min-width: 0;
    overflow: hidden;
}

.dash-card__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Sora', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.dash-card__title .material-symbols-rounded {
    font-size: 1.15rem;
    color: var(--accent);
    font-variation-settings: 'FILL' 1;
}

.dash-card__header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

/* ================================================
   WELCOME BANNER
   ================================================ */

.welcome-banner {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.welcome-banner__info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.welcome-banner__icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(138, 5, 190, 0.1);
    border: 1px solid rgba(138, 5, 190, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.welcome-banner__icon .material-symbols-rounded {
    font-size: 1.5rem;
    color: var(--accent);
    font-variation-settings: 'FILL' 1;
}

.welcome-banner h1 {
    font-family: 'Sora', sans-serif;
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.25;
}

.welcome-banner__sub {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.welcome-banner__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Buttons */
.btn {
    height: 40px;
    border-radius: var(--radius-sm);
    padding: 0 18px;
    font-size: 0.85rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s, border-color 0.2s;
    text-decoration: none;
    font-family: inherit;
    cursor: pointer;
    border: none;
}

.btn .material-symbols-rounded {
    font-size: 1.1rem;
    font-variation-settings: 'FILL' 1;
}

.btn--primary {
    background: var(--accent);
    color: #fff;
}

.btn--primary:hover {
    background: var(--accent-strong);
}

.btn--outline {
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text-secondary);
}

.btn--outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ================================================
   PLAN BADGE
   ================================================ */

.plan-badge {
    display: inline-flex;
    align-items: center;
    height: 30px;
    padding: 0 14px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.plan-badge--gratis {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

.plan-badge--plus {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #818cf8;
}

.plan-badge--top {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(245, 158, 11, 0.15));
    border: 1px solid rgba(251, 191, 36, 0.35);
    color: #fbbf24;
}

/* ================================================
   STATS STRIP
   ================================================ */

.stats-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.stat-card__label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-card__icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(138, 5, 190, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card__icon .material-symbols-rounded {
    font-size: 1.1rem;
    color: var(--accent);
    font-variation-settings: 'FILL' 1;
}

.stat-card__icon--teal {
    background: rgba(20, 184, 166, 0.1);
}
.stat-card__icon--teal .material-symbols-rounded {
    color: #14b8a6;
}

.stat-card__icon--blue {
    background: rgba(99, 102, 241, 0.1);
}
.stat-card__icon--blue .material-symbols-rounded {
    color: #6366f1;
}

.stat-card__icon--green {
    background: rgba(52, 211, 153, 0.1);
}
.stat-card__icon--green .material-symbols-rounded {
    color: #34d399;
}

.stat-card__icon--amber {
    background: rgba(251, 191, 36, 0.1);
}
.stat-card__icon--amber .material-symbols-rounded {
    color: #fbbf24;
}

.stat-card__value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-card__delta {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* ================================================
   GOALS
   ================================================ */

.goals-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.2s, color 0.2s;
}

.goals-edit-btn .material-symbols-rounded {
    font-size: 0.9rem;
}

.goals-edit-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.goals-grid {
    display: grid;
    gap: 18px;
}

.goal-bar__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.goal-bar__label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.goal-bar__pct {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--text-primary);
}

.goal-bar__track {
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.goal-bar__fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.goal-bar__fill--green { background: #34d399; }
.goal-bar__fill--purple { background: var(--accent); }
.goal-bar__fill--blue { background: #6366f1; }

.goal-bar__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.goal-bar__target {
    color: var(--text-muted);
    opacity: 0.7;
}

/* Goals Modal */
.goals-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.goals-modal-overlay[hidden] {
    display: none;
}

.goals-modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    width: min(420px, 100%);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.goals-modal h3 {
    font-family: 'Sora', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 24px;
}

.goals-modal__field {
    margin-bottom: 18px;
}

.goals-modal__field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.goals-modal__field input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.goals-modal__field input:focus {
    border-color: var(--accent);
}

.goals-modal__actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
}

.goals-modal__cancel,
.goals-modal__save {
    flex: 1;
    height: 44px;
    border-radius: 10px;
    border: none;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}

.goals-modal__cancel {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
}

.goals-modal__cancel:hover {
    background: rgba(255, 255, 255, 0.1);
}

.goals-modal__save {
    background: var(--accent);
    color: #fff;
}

.goals-modal__save:hover {
    background: var(--accent-strong);
}

/* ================================================
   CHART PERIOD FILTERS
   ================================================ */

.chart-period-filters {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 3px;
}

.chart-period {
    height: 28px;
    padding: 0 12px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.chart-period:hover {
    color: var(--text-primary);
}

.chart-period--active {
    background: var(--accent);
    color: #fff;
}

/* ================================================
   CHARTS
   ================================================ */

.chart-container {
    position: relative;
    width: 100%;
    min-width: 0;
    height: 220px;
    overflow: hidden;
}

.chart-container--donut {
    height: 260px;
}

.chart-container canvas {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
}

.chart-container.is-loading::before,
.chart-container.is-empty::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background:
        linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.035), transparent),
        rgba(255, 255, 255, 0.025);
    background-size: 180% 100%, 100% 100%;
    animation: chartPulse 1.25s ease-in-out infinite;
}

.chart-container.is-empty::before {
    animation: none;
    background: rgba(255, 255, 255, 0.025);
}

.chart-container.is-loading::after,
.chart-container.is-empty::after {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 16px;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-align: center;
    pointer-events: none;
}

.chart-container.is-loading::after {
    content: "Carregando dados...";
}

.chart-container.is-empty::after {
    content: attr(data-empty);
}

@keyframes chartPulse {
    from { background-position: 180% 0, 0 0; }
    to { background-position: -180% 0, 0 0; }
}

@media (prefers-reduced-motion: reduce) {
    .chart-container.is-loading::before {
        animation: none;
    }
}

/* ================================================
   FUNNEL STRIP
   ================================================ */

.funnel-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.funnel-strip__item {
    flex: 1;
    min-width: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 12px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
}

.funnel-strip__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.funnel-strip__label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.funnel-strip__value {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
}

.funnel-strip__value--green { color: #34d399; }
.funnel-strip__value--red { color: #f87171; }

.funnel-strip__arrow {
    color: var(--text-muted);
    opacity: 0.3;
    flex-shrink: 0;
}

.funnel-strip__arrow .material-symbols-rounded {
    font-size: 1rem;
}

/* ================================================
   ACTIVE ORDERS
   ================================================ */

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.section-head__link {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s;
}

.section-head__link:hover { color: #b44de0; }

.section-head__link .material-symbols-rounded { font-size: 1rem; }

.active-order-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    transition: border-color 0.15s;
}

.active-order-row:hover {
    border-color: var(--border-strong);
}

.active-order-row__info {
    flex: 1;
    min-width: 0;
}

.active-order-row__info strong {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.active-order-row__time {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.active-order-badge {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.badge--yellow {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.25);
    color: #fbbf24;
}

.badge--blue {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: #818cf8;
}

.badge--green {
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.25);
    color: #34d399;
}

.active-order-row__link {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(138, 5, 190, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    flex-shrink: 0;
    transition: background 0.15s;
}

.active-order-row__link:hover {
    background: rgba(138, 5, 190, 0.2);
}

.active-order-row__link .material-symbols-rounded {
    font-size: 1rem;
    color: var(--accent);
}

.active-orders-empty {
    text-align: center;
    padding: 32px 20px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.active-orders-empty .material-symbols-rounded {
    font-size: 2rem;
    color: var(--text-muted);
    opacity: 0.4;
    display: block;
    margin-bottom: 8px;
}

.active-orders-empty p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

/* ================================================
   QUICK ACTIONS
   ================================================ */

.actions-grid {
    display: grid;
    gap: 8px;
}

.action-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 600;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.action-link:hover {
    border-color: var(--accent);
    color: var(--text-primary);
    background: rgba(138, 5, 190, 0.04);
}

.action-link__icon {
    font-size: 1.15rem;
    color: var(--accent);
    font-variation-settings: 'FILL' 1;
    flex-shrink: 0;
}

.action-link__arrow {
    font-size: 1rem;
    color: var(--border-strong);
    margin-left: auto;
    flex-shrink: 0;
}

.action-link:hover .action-link__arrow {
    color: var(--accent);
}

/* ================================================
   TIPS
   ================================================ */

.tips-list {
    list-style: none;
    display: grid;
    gap: 8px;
}

.tip-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.tip-row__icon {
    font-size: 1.1rem;
    color: var(--accent);
    font-variation-settings: 'FILL' 1;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ================================================
   MAIN GRID
   ================================================ */

.dash-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: minmax(0, 1fr);
}

/* ================================================
   RESPONSIVE
   ================================================ */

@media (max-width: 640px) {
    .dashboard {
        gap: 14px;
        margin-top: 16px;
    }

    .welcome-banner {
        flex-direction: column;
        align-items: flex-start;
        padding: 18px;
        gap: 16px;
    }

    .welcome-banner h1 {
        font-size: 1.1rem;
    }

    .welcome-banner__sub {
        font-size: 0.82rem;
    }

    .welcome-banner__icon {
        width: 42px;
        height: 42px;
        border-radius: 10px;
    }

    .welcome-banner__icon .material-symbols-rounded {
        font-size: 1.2rem;
    }

    .welcome-banner__actions {
        width: 100%;
    }

    .welcome-banner__actions .btn {
        flex: 1;
        height: 36px;
        padding: 0 12px;
        font-size: 0.78rem;
    }

    .welcome-banner__actions .btn .material-symbols-rounded {
        font-size: 1rem;
    }

    .stats-strip {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .stat-card {
        padding: 14px;
    }

    .stat-card__label {
        font-size: 0.7rem;
    }

    .stat-card__value {
        font-size: 1.15rem;
    }

    .stat-card__icon {
        width: 30px;
        height: 30px;
        border-radius: 8px;
    }

    .stat-card__icon .material-symbols-rounded {
        font-size: 0.95rem;
    }

    .stat-card__delta {
        font-size: 0.72rem;
    }

    .dash-card {
        padding: 16px;
    }

    .dash-card__title {
        font-size: 0.88rem;
        gap: 8px;
    }

    .chart-container {
        height: 180px;
    }

    .chart-container--donut {
        height: 220px;
    }

    .funnel-strip {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }

    .funnel-strip__arrow {
        display: none;
    }

    .funnel-strip__item {
        min-width: calc(50% - 6px);
        padding: 12px 10px;
    }

    .funnel-strip__value {
        font-size: 1.1rem;
    }

    .funnel-strip__label {
        font-size: 0.7rem;
    }

    .dash-card__header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .goals-modal {
        padding: 20px;
    }

    .goals-modal h3 {
        font-size: 1rem;
    }

    .section-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .active-order-row {
        padding: 12px;
        gap: 10px;
    }

    .active-order-row__info strong {
        font-size: 0.82rem;
    }

    .active-order-badge {
        font-size: 0.64rem;
        height: 20px;
        padding: 0 8px;
    }

    .action-link {
        padding: 12px 14px;
        font-size: 0.82rem;
    }

    .tip-row {
        padding: 12px 14px;
        font-size: 0.8rem;
    }

    .plan-badge {
        font-size: 0.68rem;
        height: 26px;
        padding: 0 10px;
    }
}

@media (max-width: 420px) {
    .stats-strip {
        gap: 6px;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-card__value {
        font-size: 1rem;
    }

    .stat-card__icon {
        width: 28px;
        height: 28px;
    }

    .welcome-banner__actions {
        flex-direction: column;
    }

    .welcome-banner__actions .btn {
        width: 100%;
    }

    .welcome-banner__actions .plan-badge {
        align-self: flex-start;
    }
}

@media (min-width: 641px) and (max-width: 1023px) {
    .stats-strip {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .stats-strip {
        grid-template-columns: repeat(5, 1fr);
    }

    .dash-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
