
:root {
    --gw-green: #25d366;
    --gw-green-dark: #12b85a;
    --gs-blue: #2563eb;
    --gs-blue-dark: #1d4ed8;

    --brand-gradient: linear-gradient(135deg, var(--gw-green) 0%, #20c997 46%, var(--gs-blue) 100%);
    --sidebar-bg: #101828;
    --sidebar-bg-2: #182230;
    --sidebar-border: rgba(255,255,255,.08);

    --page-bg: #f6f8fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --border: #e6eaf0;
    --text: #182230;
    --muted: #667085;

    --shadow-sm: 0 1px 3px rgba(16,24,40,.06), 0 1px 2px rgba(16,24,40,.04);
    --shadow-md: 0 8px 28px rgba(16,24,40,.08);
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;
}

* {
    box-sizing: border-box;
}

html, body {
    min-height: 100%;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at top right, rgba(37,211,102,.08), transparent 28rem),
        radial-gradient(circle at 75% 0, rgba(37,99,235,.07), transparent 24rem),
        var(--page-bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--gs-blue);
}

.app-shell {
    min-height: 100vh;
}

.sidebar {
    width: 268px;
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1030;
    padding: 20px 16px;
    background:
        radial-gradient(circle at 20% 0, rgba(37,211,102,.12), transparent 18rem),
        linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
    border-right: 1px solid var(--sidebar-border);
    color: white;
}

.brand-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 8px 24px;
}

.brand-symbol {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: var(--brand-gradient);
    box-shadow: 0 8px 24px rgba(37,211,102,.22);
    display: grid;
    place-items: center;
    color: white;
    font-size: 1.15rem;
}

.brand-text strong {
    display: block;
    font-size: 1rem;
    letter-spacing: -.02em;
}

.brand-text small {
    color: #98a2b3;
    font-size: .72rem;
}

.sidebar-label {
    color: #667085;
    font-size: .69rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 8px 12px 6px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 44px;
    padding: 10px 12px;
    color: #b8c0cc;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 12px;
    transition: .18s ease;
    font-size: .92rem;
    font-weight: 500;
}

.sidebar-nav a i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.sidebar-nav a:hover {
    color: #fff;
    background: rgba(255,255,255,.055);
}

.sidebar-nav a.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(37,211,102,.16), rgba(37,99,235,.11));
    border-color: rgba(37,211,102,.18);
    box-shadow: inset 3px 0 0 var(--gw-green);
}

.sidebar-bottom {
    position: absolute;
    bottom: 18px;
    left: 16px;
    right: 16px;
}

.user-mini {
    border-top: 1px solid rgba(255,255,255,.08);
    padding-top: 14px;
}

.user-mini-card {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border-radius: 13px;
    background: rgba(255,255,255,.035);
}

.user-avatar {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: var(--brand-gradient);
    color: white;
    font-weight: 700;
    font-size: .82rem;
}

.user-mini-card .user-meta {
    min-width: 0;
    flex: 1;
}

.user-mini-card .user-meta strong {
    display: block;
    color: #fff;
    font-size: .78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-mini-card .user-meta small {
    display: block;
    color: #98a2b3;
    font-size: .69rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.main-content {
    margin-left: 268px;
    min-height: 100vh;
}

.topbar {
    height: 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    border-bottom: 1px solid rgba(230,234,240,.85);
    background: rgba(255,255,255,.80);
    backdrop-filter: blur(14px);
    position: sticky;
    top: 0;
    z-index: 1020;
}

.topbar-title {
    font-size: .86rem;
    color: var(--muted);
    margin: 0;
}

.topbar-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: white;
    color: #344054;
    font-size: .76rem;
    box-shadow: var(--shadow-sm);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--gw-green);
    box-shadow: 0 0 0 4px rgba(37,211,102,.12);
}

.content-wrap {
    padding: 30px;
    max-width: 1600px;
    margin: 0 auto;
}

.page-header {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--gs-blue);
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 6px;
}

.page-title {
    margin: 0;
    font-size: clamp(1.55rem, 2vw, 2rem);
    letter-spacing: -.035em;
    font-weight: 750;
}

.page-description {
    color: var(--muted);
    margin: 7px 0 0;
    font-size: .91rem;
}

.modern-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.modern-card:hover {
    box-shadow: var(--shadow-md);
}

.card-head {
    padding: 19px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.card-head-title {
    margin: 0;
    font-size: .96rem;
    font-weight: 700;
}

.card-head-subtitle {
    color: var(--muted);
    font-size: .78rem;
    margin-top: 3px;
}

.card-body-modern {
    padding: 22px;
}

.metric-card {
    height: 100%;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.metric-card::after {
    content: "";
    position: absolute;
    width: 90px;
    height: 90px;
    right: -28px;
    top: -28px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(37,211,102,.10), rgba(37,99,235,.08));
}

.metric-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    color: var(--gs-blue);
    background: #eff6ff;
    margin-bottom: 16px;
    font-size: 1.1rem;
}

.metric-card.green .metric-icon {
    color: var(--gw-green-dark);
    background: #ecfdf3;
}

.metric-card.purple .metric-icon {
    color: #7c3aed;
    background: #f5f3ff;
}

.metric-label {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 600;
}

.metric-value {
    margin-top: 3px;
    font-size: 2rem;
    letter-spacing: -.04em;
    font-weight: 760;
}

.metric-foot {
    margin-top: 8px;
    font-size: .72rem;
    color: #98a2b3;
}

.btn-brand {
    border: 0;
    color: #fff;
    font-weight: 650;
    border-radius: 11px;
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--gs-blue), #1689f8);
    box-shadow: 0 7px 16px rgba(37,99,235,.18);
}

.btn-brand:hover,
.btn-brand:focus {
    color: #fff;
    transform: translateY(-1px);
    background: linear-gradient(135deg, var(--gs-blue-dark), var(--gs-blue));
}

.btn-green {
    border: 0;
    color: #fff;
    font-weight: 650;
    border-radius: 11px;
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--gw-green-dark), var(--gw-green));
    box-shadow: 0 7px 16px rgba(37,211,102,.20);
}

.btn-green:hover,
.btn-green:focus {
    color: #fff;
    transform: translateY(-1px);
}

.btn-soft {
    border: 1px solid var(--border);
    background: #fff;
    color: #344054;
    border-radius: 11px;
    padding: 9px 14px;
    font-weight: 600;
}

.btn-soft:hover {
    background: var(--surface-soft);
    border-color: #d0d5dd;
}

.form-label {
    font-size: .81rem;
    font-weight: 650;
    color: #344054;
    margin-bottom: 7px;
}

.form-control,
.form-select {
    min-height: 44px;
    border-color: #d9dee7;
    border-radius: 11px;
    font-size: .88rem;
    box-shadow: 0 1px 2px rgba(16,24,40,.03);
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(37,99,235,.65);
    box-shadow: 0 0 0 4px rgba(37,99,235,.10);
}

.form-text {
    color: #98a2b3;
    font-size: .72rem;
}

.input-group .form-control {
    border-radius: 11px 0 0 11px;
}

.input-group .btn {
    border-radius: 0 11px 11px 0;
}

.table-modern {
    margin: 0;
}

.table-modern thead th {
    padding: 13px 18px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    color: #667085;
    font-size: .69rem;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: .045em;
}

.table-modern tbody td {
    padding: 15px 18px;
    border-color: #eef1f5;
    vertical-align: middle;
    font-size: .84rem;
}

.table-modern tbody tr:last-child td {
    border-bottom: 0;
}

.table-modern tbody tr:hover {
    background: #fbfcfe;
}

.badge-soft-success,
.badge-soft-warning,
.badge-soft-secondary,
.badge-soft-danger,
.badge-soft-info {
    border-radius: 999px;
    font-size: .69rem;
    padding: 6px 9px;
    font-weight: 700;
}

.badge-soft-success {
    color: #087443;
    background: #ecfdf3;
    border: 1px solid #abefc6;
}

.badge-soft-warning {
    color: #93370d;
    background: #fffaeb;
    border: 1px solid #fedf89;
}

.badge-soft-secondary {
    color: #475467;
    background: #f2f4f7;
    border: 1px solid #e4e7ec;
}

.badge-soft-danger {
    color: #b42318;
    background: #fef3f2;
    border: 1px solid #fecdca;
}

.badge-soft-info {
    color: #175cd3;
    background: #eff8ff;
    border: 1px solid #b2ddff;
}

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

.empty-icon {
    width: 58px;
    height: 58px;
    margin: 0 auto 16px;
    border-radius: 17px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(37,211,102,.12), rgba(37,99,235,.12));
    color: var(--gs-blue);
    font-size: 1.35rem;
}

.alert {
    border-radius: 12px;
    border-width: 1px;
    font-size: .85rem;
}

.section-note {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid #b2ddff;
    border-radius: 12px;
    background: #eff8ff;
    color: #175cd3;
    font-size: .79rem;
}

.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr);
    background: #fff;
}

.login-brand-panel {
    min-height: 100vh;
    padding: 54px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 15% 20%, rgba(37,211,102,.22), transparent 22rem),
        radial-gradient(circle at 90% 15%, rgba(37,99,235,.22), transparent 26rem),
        linear-gradient(150deg, #101828 0%, #172554 100%);
    color: #fff;
}

.login-brand-panel::after {
    content: "";
    position: absolute;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    right: -260px;
    bottom: -210px;
    border: 1px solid rgba(255,255,255,.12);
    box-shadow:
        0 0 0 60px rgba(255,255,255,.025),
        0 0 0 120px rgba(255,255,255,.018);
}

.login-brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1;
}

.login-brand-logo .brand-symbol {
    width: 46px;
    height: 46px;
}

.login-hero {
    max-width: 650px;
    margin: auto 0;
    position: relative;
    z-index: 1;
}

.login-hero h1 {
    font-size: clamp(2.2rem, 4vw, 4.4rem);
    line-height: .99;
    letter-spacing: -.055em;
    font-weight: 800;
    margin-bottom: 22px;
}

.login-hero h1 span {
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.login-hero p {
    color: #cbd5e1;
    max-width: 520px;
    font-size: 1rem;
    line-height: 1.65;
}

.login-features {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
}

.login-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 11px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.055);
    color: #e2e8f0;
    font-size: .76rem;
}

.login-form-panel {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 38px;
    background:
        radial-gradient(circle at 90% 0, rgba(37,211,102,.05), transparent 22rem),
        #fff;
}

.login-form-wrap {
    width: 100%;
    max-width: 430px;
}

.login-form-wrap .eyebrow {
    color: var(--gw-green-dark);
    font-size: .73rem;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 8px;
}

.login-form-wrap h2 {
    font-weight: 780;
    letter-spacing: -.04em;
    margin-bottom: 8px;
}

.login-form-wrap > p {
    color: var(--muted);
    font-size: .88rem;
    margin-bottom: 28px;
}

.login-form-wrap .btn-brand {
    min-height: 46px;
}

.login-footer-note {
    margin-top: 22px;
    color: #98a2b3;
    font-size: .72rem;
    text-align: center;
}

.mobile-topbar {
    display: none;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .22s ease;
        box-shadow: 20px 0 50px rgba(16,24,40,.20);
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-topbar {
        display: inline-flex;
    }

    .content-wrap {
        padding: 22px 18px;
    }

    .topbar {
        padding: 0 18px;
    }

    .login-page {
        grid-template-columns: 1fr;
    }

    .login-brand-panel {
        display: none;
    }

    .login-form-panel {
        padding: 24px;
    }
}

@media (max-width: 575.98px) {
    .page-header {
        flex-direction: column;
    }

    .page-header .page-actions,
    .page-header .page-actions .btn {
        width: 100%;
    }

    .topbar-badge {
        display: none;
    }
}


/* V8 - Gerenciar afiliado */
.form-select-sm,
.form-control-sm {
    min-height: 38px;
    border-radius: 10px;
    font-size: .8rem;
}

.page-actions .btn {
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    .page-actions {
        width: 100%;
    }

    .page-actions .btn {
        flex: 1 1 auto;
    }
}


.marketplace-logo-placeholder {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(37,211,102,.12), rgba(37,99,235,.12));
    color: var(--gs-blue);
    font-size: 1.15rem;
    flex: 0 0 auto;
}
