/* =============================================================================
   v2-components.css — Componentes reutilizáveis (Card, Button, Pill, etc)
   ============================================================================= */

/* ── LAYOUT BASE (mobile-first) ──────────────────────────────────────────── */
.v2-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.v2-content {
    flex: 1;
    padding: 20px var(--v2-mobile-pad) 40px;
}

/* ── TOPBAR (header mobile) ──────────────────────────────────────────────── */
.v2-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px var(--v2-mobile-pad);
    background: var(--v2-surface);
    border-bottom: 1px solid var(--v2-border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.v2-topbar__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--v2-text);
}
.v2-iconbtn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--v2-surface-alt);
    border: 1px solid var(--v2-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--v2-text);
    position: relative;
    cursor: pointer;
    transition: background 0.15s;
}
.v2-iconbtn:hover { background: var(--v2-border); }
.v2-iconbtn__dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #E5484D;
    border: 2px solid var(--v2-surface-alt);
}

/* ── HEADINGS ────────────────────────────────────────────────────────────── */
.v2-greeting {
    font-size: 13px;
    color: var(--v2-text-muted);
    font-weight: 500;
}
.v2-h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--v2-text);
    letter-spacing: -0.6px;
    margin: 2px 0 0;
    line-height: 1.2;
}
.v2-h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--v2-text);
    letter-spacing: -0.5px;
    margin: 0;
}
.v2-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 26px 0 10px;
}
.v2-section-header__title {
    font-size: 14px;
    font-weight: 700;
    color: var(--v2-text);
    letter-spacing: -0.3px;
}
.v2-section-header__action {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    font-weight: 600;
    color: var(--v2-primary);
    cursor: pointer;
}

/* ── CARDS ───────────────────────────────────────────────────────────────── */
.v2-card {
    background: var(--v2-surface);
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius);
    padding: 14px;
}
.v2-card--list {
    padding: 6px 0;
}
.v2-card--list .v2-card__row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--v2-border);
}
.v2-card--list .v2-card__row:last-child { border-bottom: none; }

/* ── HERO BALANCE CARD (saldo a receber) ─────────────────────────────────── */
.v2-balance {
    border-radius: calc(var(--v2-radius) + 4px);
    padding: 22px 20px;
    background: linear-gradient(135deg, var(--v2-primary) 0%, #1A2A50 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
    margin-top: 22px;
}
.v2-balance__label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    opacity: 0.7;
}
.v2-balance__value {
    font-size: 38px;
    font-weight: 700;
    letter-spacing: -1.5px;
    margin-top: 4px;
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.v2-balance__value .v2-balance__currency {
    font-size: 16px;
    opacity: 0.7;
    font-weight: 600;
}
.v2-balance__value .v2-balance__cents {
    font-size: 24px;
}
.v2-balance__breakdown {
    display: flex;
    gap: 20px;
    margin-top: 16px;
    font-size: 11px;
}
.v2-balance__breakdown-item .v2-balance__bd-label {
    opacity: 0.7;
    margin-bottom: 2px;
}
.v2-balance__breakdown-item .v2-balance__bd-value {
    font-weight: 700;
    font-size: 13px;
}
.v2-balance__divider {
    width: 1px;
    background: rgba(255, 255, 255, 0.2);
}
.v2-balance__cta {
    margin-top: 18px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s;
}
.v2-balance__cta:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* ── METRIC TILE GRID ────────────────────────────────────────────────────── */
.v2-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}
.v2-metric {
    background: var(--v2-surface);
    border-radius: var(--v2-radius);
    padding: 14px;
    border: 1px solid var(--v2-border);
}
.v2-metric__label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--v2-text-dim);
}
.v2-metric__value {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.8px;
    margin-top: 4px;
    color: var(--v2-text);
}
.v2-metric__value--primary { color: var(--v2-primary); }
.v2-metric__value--success { color: var(--v2-success); }
.v2-metric__value--warning { color: var(--v2-warning); }
.v2-metric__caption {
    font-size: 11px;
    color: var(--v2-text-muted);
    margin-top: 2px;
}

/* ── PILL (badge) ────────────────────────────────────────────────────────── */
.v2-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 22px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1px;
    white-space: nowrap;
    background: var(--v2-surface-alt);
    color: var(--v2-text-muted);
    border: 1px solid var(--v2-border);
}
.v2-pill--sm { height: 18px; padding: 2px 7px; font-size: 10px; }
.v2-pill--lg { height: 24px; padding: 4px 10px; font-size: 12px; }

.v2-pill--primary { background: var(--v2-primary-soft); color: var(--v2-primary); border-color: transparent; }
.v2-pill--success { background: var(--v2-success-soft); color: var(--v2-success); border-color: transparent; }
.v2-pill--warning { background: var(--v2-warning-soft); color: var(--v2-warning); border-color: transparent; }
.v2-pill--danger  { background: var(--v2-danger-soft);  color: var(--v2-danger);  border-color: transparent; }

/* ── BUTTONS ─────────────────────────────────────────────────────────────── */
.v2-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 52px;
    padding: 0 20px;
    border-radius: var(--v2-radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.05s;
    text-decoration: none;
}
.v2-btn:hover { opacity: 0.92; }
.v2-btn:active { transform: translateY(1px); }
.v2-btn--primary {
    background: var(--v2-primary);
    color: #fff;
}
.v2-btn--secondary {
    background: var(--v2-surface);
    color: var(--v2-primary);
    border: 1px solid var(--v2-border-strong);
}
.v2-btn--full { width: 100%; }
.v2-btn--sm { height: 38px; padding: 0 14px; font-size: 13px; }

/* ── TABS (segmented control) ──────────────────────────────────────────── */
.v2-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--v2-surface-alt);
    border-radius: 999px;
    border: 1px solid var(--v2-border);
}
.v2-tabs__item {
    flex: 1;
    height: 34px;
    border-radius: 999px;
    background: transparent;
    color: var(--v2-text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    border: none;
}
.v2-tabs__item:hover { color: var(--v2-text); }
.v2-tabs__item--active {
    background: var(--v2-surface);
    color: var(--v2-text);
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.v2-tabs__count {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 999px;
    background: transparent;
    color: var(--v2-text-dim);
}
.v2-tabs__item--active .v2-tabs__count {
    background: var(--v2-primary-soft);
    color: var(--v2-primary);
}

/* ── CHIP FILTER (brand filter) ────────────────────────────────────────── */
.v2-chips {
    display: flex;
    gap: 6px;
    margin-top: 14px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}
.v2-chips::-webkit-scrollbar { display: none; }
.v2-chip {
    height: 32px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--v2-border);
    background: var(--v2-surface);
    color: var(--v2-text);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all 0.15s;
}
.v2-chip:hover { border-color: var(--v2-primary); color: var(--v2-primary); }
.v2-chip--active {
    background: var(--v2-primary);
    color: #fff;
    border-color: transparent;
}
/* Active+hover: garante texto branco mesmo com .v2-app a vencendo no escopo */
.v2-chips .v2-chip--active,
.v2-chips .v2-chip--active:hover,
.v2-chips .v2-chip--active:focus,
.v2-chips .v2-chip--active:active,
a.v2-chip--active,
a.v2-chip--active:hover,
a.v2-chip--active:focus,
a.v2-chip--active:active {
    background: var(--v2-primary);
    color: #fff;
    border-color: transparent;
}

/* ── CAMPAIGN CARD (tela de campanhas — imagem hero + corpo) ───────────── */
.v2-campaign-card {
    display: block;
    width: 100%;
    padding: 0;
    border-radius: calc(var(--v2-radius) + 2px);
    border: 1px solid var(--v2-border);
    background: var(--v2-surface);
    overflow: hidden;
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.08s;
}
.v2-campaign-card:hover {
    border-color: var(--v2-primary);
    box-shadow: var(--v2-shadow-md);
}
.v2-campaign-card:active { transform: translateY(1px); }

.v2-campaign-hero {
    height: 120px;
    position: relative;
    overflow: hidden;
}
.v2-campaign-hero--brand-1 { background: linear-gradient(135deg, var(--v2-brand-1-c1), var(--v2-brand-1-c2)); }
.v2-campaign-hero--brand-2 { background: linear-gradient(135deg, var(--v2-brand-2-c1), var(--v2-brand-2-c2)); }
.v2-campaign-hero--brand-3 { background: linear-gradient(135deg, var(--v2-brand-3-c1), var(--v2-brand-3-c2)); }
.v2-campaign-hero--brand-4 { background: linear-gradient(135deg, var(--v2-brand-4-c1), var(--v2-brand-4-c2)); }
.v2-campaign-hero--brand-5 { background: linear-gradient(135deg, var(--v2-brand-5-c1), var(--v2-brand-5-c2)); }
.v2-campaign-hero--brand-6 { background: linear-gradient(135deg, var(--v2-brand-6-c1), var(--v2-brand-6-c2)); }
.v2-campaign-hero--brand-7 { background: linear-gradient(135deg, var(--v2-brand-7-c1), var(--v2-brand-7-c2)); }

.v2-campaign-hero__brand-tag {
    position: absolute;
    left: 14px;
    top: 14px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.25);
}
.v2-campaign-hero__until {
    position: absolute;
    right: 14px;
    top: 14px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.v2-campaign-hero__monogram {
    position: absolute;
    right: -20px;
    bottom: -30px;
    font-size: 140px;
    font-weight: 900;
    letter-spacing: -6px;
    color: rgba(255, 255, 255, 0.12);
    line-height: 1;
    pointer-events: none;
}
.v2-campaign-body {
    padding: 14px 16px 16px;
}
.v2-campaign-body__title {
    font-size: 15px;
    font-weight: 700;
    color: var(--v2-text);
    letter-spacing: -0.3px;
    line-height: 1.25;
}
.v2-campaign-body__desc {
    font-size: 12px;
    color: var(--v2-text-muted);
    margin-top: 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.v2-campaign-body__pills {
    display: flex;
    gap: 6px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.v2-campaign-body__actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}
.v2-campaign-body__actions .v2-btn {
    flex: 1;
    height: 42px;
    font-size: 13px;
}
.v2-campaign-body__actions .v2-btn--primary { flex: 1.3; }

/* Grid desktop de campanhas */
@media (min-width: 768px) {
    .v2-campaigns-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}
@media (min-width: 1200px) {
    .v2-campaigns-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Empty state */
.v2-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--v2-text-muted);
}
.v2-empty__icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--v2-surface-alt);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--v2-text-dim);
    margin-bottom: 14px;
}
.v2-empty__title {
    font-size: 15px;
    font-weight: 700;
    color: var(--v2-text);
    margin-bottom: 6px;
}
.v2-empty__text {
    font-size: 13px;
    line-height: 1.5;
    max-width: 300px;
    margin: 0 auto;
}

/* ── CAMPAIGN MINI CARD (na dashboard) ──────────────────────────────────── */
.v2-campaign-mini {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--v2-radius);
    background: var(--v2-surface);
    border: 1px solid var(--v2-border);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
}
.v2-campaign-mini:hover {
    border-color: var(--v2-primary);
    box-shadow: var(--v2-shadow-md);
}
.v2-campaign-mini__thumb {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    flex-shrink: 0;
}
.v2-campaign-mini__body {
    flex: 1;
    min-width: 0;
}
.v2-campaign-mini__brand {
    font-size: 11px;
    font-weight: 700;
    color: var(--v2-primary);
    letter-spacing: 0.2px;
}
.v2-campaign-mini__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--v2-text);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.v2-campaign-mini__pills {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    flex-wrap: wrap;
}
.v2-campaign-mini__chev {
    color: var(--v2-text-dim);
    flex-shrink: 0;
}

/* ── BRAND TILE (cor sólida 34x34) ──────────────────────────────────────── */
.v2-brand-tile {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    flex-shrink: 0;
}
.v2-brand-tile--56 { width: 56px; height: 56px; border-radius: 12px; }
.v2-brand-tile--brand-1 { background: linear-gradient(135deg, var(--v2-brand-1-c1), var(--v2-brand-1-c2)); }
.v2-brand-tile--brand-2 { background: linear-gradient(135deg, var(--v2-brand-2-c1), var(--v2-brand-2-c2)); }
.v2-brand-tile--brand-3 { background: linear-gradient(135deg, var(--v2-brand-3-c1), var(--v2-brand-3-c2)); }
.v2-brand-tile--brand-4 { background: linear-gradient(135deg, var(--v2-brand-4-c1), var(--v2-brand-4-c2)); }
.v2-brand-tile--brand-5 { background: linear-gradient(135deg, var(--v2-brand-5-c1), var(--v2-brand-5-c2)); }
.v2-brand-tile--brand-6 { background: linear-gradient(135deg, var(--v2-brand-6-c1), var(--v2-brand-6-c2)); }
.v2-brand-tile--brand-7 { background: linear-gradient(135deg, var(--v2-brand-7-c1), var(--v2-brand-7-c2)); }

/* ── BRAND ROW (lista marcas aprovadas) ─────────────────────────────────── */
.v2-brand-row__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--v2-text);
}
.v2-brand-row__tag {
    font-size: 11px;
    color: var(--v2-text-dim);
}

/* ── SIDEBAR DRAWER (mobile) ─────────────────────────────────────────────── */
.v2-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 16, 35, 0.55);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.v2-drawer-overlay--open {
    opacity: 1;
    pointer-events: all;
}
.v2-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--v2-sidebar-w);
    background: var(--v2-surface);
    z-index: 101;
    transform: translateX(-100%);
    transition: transform 0.25s ease-out;
    display: flex;
    flex-direction: column;
    box-shadow: var(--v2-shadow-lg);
}
.v2-drawer--open { transform: translateX(0); }
.v2-drawer__header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--v2-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.v2-drawer__brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.v2-drawer__brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--v2-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
}
.v2-drawer__brand-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--v2-text);
    line-height: 1.1;
}
.v2-drawer__brand-sub {
    font-size: 11px;
    color: var(--v2-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-top: 2px;
}
.v2-drawer__nav {
    padding: 14px 12px;
    flex: 1;
    overflow-y: auto;
}
.v2-drawer__group {
    margin-bottom: 14px;
}
.v2-drawer__group-title {
    font-size: 10px;
    font-weight: 700;
    color: var(--v2-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 0 10px;
    margin-bottom: 6px;
}
.v2-drawer__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 10px;
    border-radius: 10px;
    color: var(--v2-text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.12s;
}
.v2-drawer__item:hover {
    background: var(--v2-surface-alt);
    color: var(--v2-text);
}
.v2-drawer__item--active {
    background: var(--v2-primary-soft);
    color: var(--v2-primary);
    font-weight: 600;
}
.v2-drawer__item-icon { flex-shrink: 0; opacity: 0.85; }
.v2-drawer__footer {
    padding: 16px 20px;
    border-top: 1px solid var(--v2-border);
}

/* ── RESPONSIVO: tablet (≥768px) ─────────────────────────────────────────── */
@media (min-width: 768px) {
    :root {
        --v2-mobile-pad: 28px;
    }
    .v2-balance__value { font-size: 44px; }
    .v2-metrics { grid-template-columns: 1fr 1fr 1fr 1fr; }
    .v2-content { padding: 28px; }
}

/* ── RESPONSIVO: desktop (≥1024px) ───────────────────────────────────────── */
@media (min-width: 1024px) {
    .v2-shell {
        flex-direction: row;
    }
    /* Sidebar fixa lateral */
    .v2-drawer {
        position: sticky;
        top: 0;
        transform: none;
        height: 100vh;
        box-shadow: none;
        border-right: 1px solid var(--v2-border);
    }
    .v2-drawer-overlay { display: none; }
    /* Esconde botão menu na topbar */
    .v2-topbar__menu { display: none; }
    /* Topbar interna do conteúdo */
    .v2-main {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
    }
    .v2-content {
        padding: 32px 40px 60px;
        max-width: var(--v2-content-max);
        margin: 0 auto;
        width: 100%;
    }
    .v2-h1 { font-size: 28px; }
}
