@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    /* Paleta */
    --primary: #2c2c54;
    --primary-600: #3a3a6e;
    --primary-700: #272748;
    --primary-50: #f4f4fb;
    --primary-100: #e6e6f5;
    --primary-200: #cfcfe8;

    --accent: #706fd3;
    --accent-soft: #eeeefa;

    --bg: #f7f7fb;
    --surface: #ffffff;
    --surface-alt: #fafafd;
    --border: #ececf3;
    --border-strong: #d9d9e3;

    --text: #1e1e3f;
    --text-dim: #6b6b85;
    --text-muted: #9a9ab0;

    --success: #10b981;
    --success-soft: #ecfdf5;
    --danger: #ef4444;
    --danger-soft: #fef2f2;
    --warning: #f59e0b;
    --warning-soft: #fffbeb;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --shadow-xs: 0 1px 2px rgba(44,44,84,0.04);
    --shadow-sm: 0 1px 3px rgba(44,44,84,0.06), 0 1px 2px rgba(44,44,84,0.04);
    --shadow:    0 4px 16px rgba(44,44,84,0.06), 0 1px 3px rgba(44,44,84,0.04);
    --shadow-lg: 0 12px 32px rgba(44,44,84,0.10), 0 4px 12px rgba(44,44,84,0.05);
    --shadow-primary: 0 8px 24px rgba(44,44,84,0.25);

    --mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Sticky footer + shells */
html { height: 100%; }
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
body > main { flex: 1 0 auto; }
body > footer,
body > .footer,
body > .land-footer { flex-shrink: 0; }

/* Layout app (sidebar + shell) */
body.app { flex-direction: row; background: var(--bg); }
body.app .app-shell {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
}
body.app .app-shell > main { flex: 1 0 auto; }
body.app .app-shell > .footer { flex-shrink: 0; }

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s ease;
}
a:hover { color: var(--primary-600); }

/* ---------- Layout ---------- */

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Brand (usada na sidebar e landing/topbar simples) ---------- */
.brand {
    font-weight: 800;
    font-size: 19px;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.02em;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.brand::before {
    content: '';
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    box-shadow: var(--shadow-primary);
}

/* ---------- Topbar simples (usuário deslogado em páginas de auth) ---------- */
.plain-topbar {
    background: rgba(255,255,255,0.9);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
    position: sticky; top: 0; z-index: 50;
}
.plain-topbar .container {
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.plain-topbar nav { display: flex; align-items: center; gap: 10px; }
.plain-topbar nav a {
    color: var(--text-dim);
    padding: 8px 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
}
.plain-topbar nav a:hover { color: var(--primary); text-decoration: none; }
.plain-topbar nav .btn { color: #fff; }

.plain-main {
    padding: 40px 24px 60px;
    width: 100%;
}

/* ===================================================================
   SIDEBAR + APP SHELL
   =================================================================== */

:root {
    --sidebar-w: 260px;
    --sidebar-bg: #2c2c54;
    --sidebar-bg-2: #272748;
    --sidebar-fg: rgba(255,255,255,0.75);
    --sidebar-fg-strong: #fff;
    --sidebar-fg-muted: rgba(255,255,255,0.45);
    --sidebar-hover: rgba(255,255,255,0.07);
    --sidebar-active: rgba(255,255,255,0.12);
    --sidebar-border: rgba(255,255,255,0.08);
}

.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
    color: var(--sidebar-fg);
    display: flex;
    flex-direction: column;
    padding: 22px 16px 16px;
    z-index: 40;
    border-right: 1px solid var(--sidebar-border);
    transition: transform 0.25s ease;
}
body.app .app-shell {
    margin-left: var(--sidebar-w);
}

/* Brand dentro da sidebar */
.sidebar-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-weight: 800;
    font-size: 19px;
    text-decoration: none;
    letter-spacing: -0.02em;
    padding: 6px 10px 18px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--sidebar-border);
}
.sidebar-brand:hover { color: #fff; }
.sidebar-brand-mark {
    width: 28px; height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, #fff 0%, var(--accent) 100%);
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    position: relative;
    flex-shrink: 0;
}
.sidebar-brand-mark::after {
    content: '';
    position: absolute;
    inset: 7px;
    border-radius: 4px;
    background: var(--primary);
}

/* Navegação */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    margin: 0 -4px;
    padding: 8px 4px;
}
.nav-section { margin-bottom: 20px; }
.nav-label {
    display: block;
    padding: 0 12px 8px;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--sidebar-fg-muted);
    font-weight: 700;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--sidebar-fg);
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    margin-bottom: 2px;
    text-decoration: none;
    position: relative;
}
.nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.85;
}
.nav-item:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-fg-strong);
    text-decoration: none;
}
.nav-item.active {
    background: var(--sidebar-active);
    color: var(--sidebar-fg-strong);
    font-weight: 600;
}
.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px; bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, #fff 0%, var(--accent) 100%);
}
.nav-item.active svg { opacity: 1; }

/* Bloco do usuário no fim da sidebar */
.sidebar-user {
    border-top: 1px solid var(--sidebar-border);
    padding: 14px 8px 4px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.sidebar-user .avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, #fff 100%);
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800;
    font-size: 15px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.sidebar-user .user-info {
    flex: 1;
    min-width: 0;
    line-height: 1.2;
}
.sidebar-user .user-info strong {
    display: block;
    color: var(--sidebar-fg-strong);
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user .user-info small {
    color: var(--sidebar-fg-muted);
    font-size: 11.5px;
}
.sidebar-logout-form { margin: 0; }
.sidebar-logout {
    background: transparent;
    border: none;
    width: 34px; height: 34px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    color: var(--sidebar-fg-muted);
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
    flex-shrink: 0;
}
.sidebar-logout svg { width: 18px; height: 18px; }
.sidebar-logout:hover {
    background: rgba(239,68,68,0.15);
    color: #fca5a5;
}

/* Scrollbar customizada dentro da sidebar */
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 99px;
    border: none;
}

/* App bar (só aparece no mobile) */
.app-bar {
    display: none;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    align-items: center;
    gap: 14px;
    position: sticky; top: 0; z-index: 30;
    backdrop-filter: saturate(180%) blur(8px);
    background: rgba(255,255,255,0.92);
}
.app-bar-brand {
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    font-size: 17px;
    letter-spacing: -0.02em;
}

/* Hamburger */
.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 38px; height: 38px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s ease;
    padding: 0 9px;
}
.hamburger:hover { background: var(--primary-50); }
.hamburger span {
    display: block;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.2s ease;
}

/* Backdrop para mobile */
.sb-toggle { position: absolute; opacity: 0; pointer-events: none; }
.sb-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,15,30,0.5);
    z-index: 35;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.25s ease;
}

/* Área de conteúdo principal (fluida, não boxed) */
.app-content {
    padding: 32px 40px 48px;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
}

/* ---------- Responsivo: sidebar vira drawer ---------- */
@media (max-width: 960px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }
    body.app .app-shell { margin-left: 0; }
    .app-bar { display: flex; }
    .sb-toggle:checked ~ .sidebar {
        transform: translateX(0);
        box-shadow: 0 0 40px rgba(0,0,0,0.25);
    }
    .sb-toggle:checked ~ .sb-backdrop {
        display: block;
        opacity: 1;
    }
}

@media (max-width: 640px) {
    .app-content { padding: 20px 16px 32px; }
}

/* ---------- Tipografia ---------- */

h1, h2, h3, h4 {
    color: var(--text);
    margin-top: 0;
    font-weight: 700;
    letter-spacing: -0.02em;
}
h1 { font-size: 28px; margin-bottom: 8px; line-height: 1.2; }
h2 { font-size: 18px; margin-bottom: 16px; }
h3 { font-size: 15px; margin-bottom: 10px; }

p { margin: 0 0 12px; }
.muted { color: var(--text-dim); }
small { font-size: 12.5px; color: var(--text-dim); }

/* ---------- Cards ---------- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-xs);
    transition: box-shadow 0.2s ease;
}
.card:hover { box-shadow: var(--shadow-sm); }

.card h1:last-child,
.card h2:last-child,
.card p:last-child { margin-bottom: 0; }

/* ---------- Flash messages ---------- */

.flash {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    font-size: 13.5px;
    animation: slideDown 0.25s ease;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.flash-success {
    background: var(--success-soft);
    border-color: rgba(16,185,129,0.2);
    color: #065f46;
}
.flash-error {
    background: var(--danger-soft);
    border-color: rgba(239,68,68,0.2);
    color: #991b1b;
}
.flash::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.flash-success::before { background: var(--success); }
.flash-error::before   { background: var(--danger); }
.flash-warn {
    background: #fef3c7;
    border-color: #fde68a;
    color: #92400e;
}
.flash-warn::before { background: #f59e0b; }
.flash-warn a { color: #78350f; text-decoration: underline; }

/* ---------- Forms ---------- */

form .row { margin-bottom: 18px; }
form label {
    display: block;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 7px;
}
form label .muted { font-weight: 400; }

form input[type=text],
form input[type=email],
form input[type=password],
form input[type=number],
form input[type=url],
form select,
form textarea {
    width: 100%;
    padding: 11px 14px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    transition: all 0.15s ease;
    box-shadow: var(--shadow-xs);
}
form input:hover:not(:disabled),
form select:hover:not(:disabled),
form textarea:hover:not(:disabled) {
    border-color: var(--primary-200);
}
form input:focus,
form select:focus,
form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-100);
}
form input:disabled {
    background: var(--surface-alt);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--primary);
    color: #fff;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    transition: all 0.15s ease;
    box-shadow: var(--shadow-sm);
    line-height: 1.2;
}
.btn:hover {
    background: var(--primary-600);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}
.btn:active { transform: translateY(0); }

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-xs);
}
.btn-secondary:hover {
    background: var(--surface-alt);
    color: var(--text);
    border-color: var(--primary-200);
}

.btn-danger {
    background: var(--danger);
}
.btn-danger:hover { background: #dc2626; }

.btn-ghost {
    background: transparent;
    color: var(--text-dim);
    box-shadow: none;
}
.btn-ghost:hover {
    background: var(--primary-50);
    color: var(--primary);
}

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 13px 26px; font-size: 15px; }

/* ---------- Tabelas ---------- */

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}
th, td {
    text-align: left;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
th {
    color: var(--text-dim);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    background: var(--surface-alt);
    font-weight: 600;
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.15s ease; }
tbody tr:hover { background: var(--primary-50); }
td.actions { text-align: right; white-space: nowrap; }

/* ---------- Badges ---------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    border: 1px solid transparent;
}
.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}
.badge-active {
    background: var(--success-soft);
    color: #065f46;
    border-color: rgba(16,185,129,0.2);
}
.badge-active::before { background: var(--success); }
.badge-inactive {
    background: var(--surface-alt);
    color: var(--text-muted);
    border-color: var(--border-strong);
}
.badge-inactive::before { background: var(--text-muted); }
.badge-admin {
    background: var(--accent-soft);
    color: var(--primary);
    border-color: var(--primary-200);
}
.badge-admin::before { background: var(--accent); }

/* ---------- Token / URL display ---------- */

.token {
    font-family: var(--mono);
    background: var(--surface-alt);
    border: 1px solid var(--border);
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    word-break: break-all;
    display: inline-block;
    color: var(--text);
}

.url-block {
    font-family: var(--mono);
    font-size: 13px;
    background: linear-gradient(180deg, var(--surface-alt) 0%, #fff 100%);
    border: 1px solid var(--border);
    padding: 14px 16px;
    border-radius: var(--radius);
    word-break: break-all;
    user-select: all;
    color: var(--primary);
    font-weight: 500;
    box-shadow: var(--shadow-xs);
    position: relative;
}
.url-block::before {
    content: '🔗';
    margin-right: 8px;
    opacity: 0.6;
}

/* ---------- Helpers ---------- */

.text-right { text-align: right; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mt-5 { margin-top: 32px; }
.mb-2 { margin-bottom: 10px; }
.mb-4 { margin-bottom: 24px; }

/* ---------- Auth card ---------- */

.auth-card {
    max-width: 440px;
    margin: 60px auto;
}
.auth-card .card {
    padding: 36px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}
.auth-card h1 {
    font-size: 24px;
    margin-bottom: 8px;
    text-align: center;
}
.auth-card .muted { text-align: center; margin-bottom: 24px; }
.auth-card .btn { width: 100%; margin-bottom: 8px; }
.auth-card .btn-secondary { width: 100%; }

/* ---------- Actions bar ---------- */

.actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 12px;
    flex-wrap: wrap;
}
.actions-bar h1 { margin-bottom: 0; }
.actions-bar > div { display: flex; gap: 8px; }

/* ---------- Empty state ---------- */

.empty-state {
    text-align: center;
    padding: 70px 30px;
    color: var(--text-dim);
}
.empty-state p { font-size: 15px; margin-bottom: 20px; }
.empty-state::before {
    content: '';
    display: block;
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-50) 0%, var(--accent-soft) 100%);
    background-image:
        radial-gradient(circle at center, transparent 30%, transparent 30%),
        linear-gradient(135deg, var(--primary-50) 0%, var(--accent-soft) 100%);
    box-shadow: inset 0 0 0 1px var(--primary-100);
}

/* ---------- Grids ---------- */

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
@media (max-width: 1100px) {
    .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ---------- Dashboard ---------- */

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border, #e5e7eb);
}
.dashboard-title {
    margin: 0;
    font-size: 1.875rem;
    font-weight: 700;
    background: linear-gradient(135deg, #0f172a 0%, #4f46e5 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}
.dashboard-subtitle {
    margin: .35rem 0 0;
    color: var(--text-dim);
    font-size: .95rem;
}
.dashboard-filter {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 12px);
    padding: .5rem 1rem;
    box-shadow: var(--shadow-xs, 0 1px 2px rgba(0,0,0,.05));
}
.dashboard-filter select {
    border: none;
    background: transparent;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    padding: .25rem .5rem;
}

.section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 1rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid #f1f5f9;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.dashboard .section-title {
    font-size: 0.9rem;
}

.chip {
    display: inline-block;
    font-size: .65rem;
    padding: .15rem .5rem;
    border-radius: 999px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-left: .5rem;
    vertical-align: middle;
}
.chip-admin   { background: #fef3c7; color: #92400e; }
.chip-success { background: #d1fae5; color: #065f46; }
.chip-warn    { background: #fef3c7; color: #92400e; }

.dashboard-footnote {
    text-align: center;
    font-size: .85em;
    padding: 1rem 0;
}

/* ---------- KPI cards (hero grid) ---------- */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px)  { .kpi-grid { grid-template-columns: 1fr; } }

.kpi {
    position: relative;
    display: flex;
    gap: 1rem;
    padding: 1.25rem 1.4rem;
    border-radius: 16px;
    background: linear-gradient(135deg, #ffffff 0%, #fafbff 100%);
    border: 1px solid #eef0f7;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease;
}
.kpi::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--kpi-accent, linear-gradient(135deg, #4f46e5, #6366f1));
    opacity: .04;
    pointer-events: none;
}
.kpi:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.08);
}
.kpi-icon {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--kpi-accent, linear-gradient(135deg, #4f46e5, #6366f1));
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}
.kpi-body { flex: 1; min-width: 0; }
.kpi-label {
    font-size: .75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .5px;
    font-weight: 600;
    margin-bottom: .25rem;
}
.kpi-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
    color: #0f172a;
    letter-spacing: -.02em;
}
.kpi-foot {
    margin-top: .5rem;
    font-size: .8rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.kpi-in  { --kpi-accent: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%); }
.kpi-out { --kpi-accent: linear-gradient(135deg, #10b981 0%, #059669 100%); }

.kpi-health.health-good { --kpi-accent: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.kpi-health.health-warn { --kpi-accent: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.kpi-health.health-bad  { --kpi-accent: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); }

/* Trends */
.trend {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .15rem .5rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
}
.trend-up      { background: #dcfce7; color: #166534; }
.trend-down    { background: #fee2e2; color: #991b1b; }
.trend-neutral { background: #f1f5f9; color: #64748b; }

/* Health cores (textos) */
.health-good { color: #059669; }
.health-warn { color: #d97706; }
.health-bad  { color: #dc2626; }

/* ---------- Volume cards ---------- */

.volume-grid { gap: 18px; }
.volume-card {
    background: linear-gradient(180deg, #ffffff 0%, #fafbff 100%);
    border: 1px solid #eef0f7;
    transition: box-shadow .15s ease;
}
.volume-card:hover { box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06); }
.volume-card-header {
    display: flex;
    align-items: center;
    gap: .85rem;
    margin-bottom: 1rem;
}
.volume-card-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
}
.volume-card-header p { margin: .15rem 0 0; font-size: .85rem; }
.volume-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex: 0 0 40px;
}
.volume-icon-in  { background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%); }
.volume-icon-out { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }

.volume-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    padding-top: .75rem;
    border-top: 1px dashed #e2e8f0;
}
.volume-stats > div {
    display: flex;
    flex-direction: column;
    text-align: center;
}
.volume-stat-label {
    font-size: .7rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .5px;
    font-weight: 600;
    margin-bottom: .25rem;
}
.volume-stats strong {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
}
@media (max-width: 600px) {
    .volume-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Health cards ---------- */

.health-grid { gap: 18px; }
.health-card { background: white; }
.health-card-header {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin-bottom: 1rem;
    color: #475569;
}
.health-card-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}
.health-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding-top: .75rem;
    border-top: 1px dashed #e2e8f0;
}
.health-label {
    font-size: .7rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .5px;
    font-weight: 600;
    margin-bottom: .35rem;
}
.health-value {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -.02em;
}
.health-sub { font-size: .75rem; margin-top: .35rem; }

/* ---------- Connector table ---------- */

.connector-table-card { padding: 0; overflow: hidden; }
.connector-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}
.connector-table thead th {
    background: #f8fafc;
    font-size: .75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .5px;
    font-weight: 700;
    padding: .85rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
}
.connector-table thead th.num { text-align: right; }
.connector-table tbody td {
    padding: .9rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: .9rem;
}
.connector-table tbody td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.connector-table tbody tr:last-child td { border-bottom: none; }
.connector-table tbody tr:hover { background: #fafbff; }
.connector-link {
    text-decoration: none;
    color: #0f172a;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}
.connector-link:hover { color: #4f46e5; }
.connector-id {
    font-size: .75rem;
    background: #eef2ff;
    color: #4f46e5;
    padding: .15rem .5rem;
    border-radius: 6px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* Empty state */
.empty-state { text-align: center; padding: 3rem 2rem; }
.empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: 16px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.3);
}
.empty-state ol { display: inline-block; text-align: left; max-width: 480px; }

/* ---------- Charts (sem JS) ---------- */

.chart-legend {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-dim);
}
.chart-legend-item { display: inline-flex; align-items: center; gap: 0.4rem; }
.chart-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
}
.chart-swatch-in  { background: var(--primary, #4f46e5); }
.chart-swatch-out { background: #10b981; }

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 220px;
    padding: 0 0.5rem;
    border-bottom: 1px solid var(--border, #e5e7eb);
}
.chart-bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    min-width: 0;
}
.chart-bar-pair {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    padding-bottom: 4px;
    min-height: 0;
}
.chart-bar {
    flex: 1;
    max-width: 26px;
    min-height: 2px;
    border-radius: 4px 4px 0 0;
    position: relative;
    transition: opacity 0.15s ease;
    cursor: default;
}
.chart-bar:hover { opacity: 0.85; }
.chart-bar-in  { background: var(--primary, #4f46e5); }
.chart-bar-out { background: #10b981; }
.chart-bar-value {
    position: absolute;
    top: -1.4em;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: var(--text-dim);
    white-space: nowrap;
    pointer-events: none;
}
.chart-bar-label {
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--text-dim);
    text-align: center;
}

/* ---------- Stats ---------- */

.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-xs);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}
.stat:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
    border-color: var(--primary-200);
}
.stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    opacity: 0;
    transition: opacity 0.2s ease;
}
.stat:hover::before { opacity: 1; }
.stat .label {
    color: var(--text-dim);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 600;
}
.stat .value {
    font-size: 32px;
    font-weight: 800;
    margin-top: 8px;
    color: var(--primary);
    letter-spacing: -0.03em;
    line-height: 1;
}

/* ---------- Listas ---------- */

ol, ul { padding-left: 22px; }
ol li, ul li { margin-bottom: 6px; }

/* ---------- Footer ---------- */

.footer {
    border-top: 1px solid var(--border);
    padding: 24px 0;
    color: var(--text-muted);
    text-align: center;
    background: var(--surface);
}
.footer small { color: var(--text-muted); }

/* ---------- Misc ---------- */

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}

code {
    font-family: var(--mono);
    background: var(--surface-alt);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12.5px;
    color: var(--primary);
}

::selection {
    background: var(--primary-100);
    color: var(--primary-700);
}

/* Scrollbar sutil (Webkit) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 99px;
    border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* =================================================================
   LANDING PAGE
   ================================================================= */

body.landing { background: #fff; }

/* ---------- Top bar leve (landing) ---------- */
.land-topbar {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255,255,255,0.85);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
}
.land-topbar .container {
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.land-topbar nav {
    display: flex; align-items: center; gap: 4px;
}
.land-topbar nav a {
    color: var(--text-dim);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 14px;
    transition: all 0.15s ease;
}
.land-topbar nav a:hover {
    color: var(--primary);
    background: var(--primary-50);
    text-decoration: none;
}
.land-topbar nav a.btn { color: #fff; }
.land-topbar nav a.btn:hover { color: #fff; background: var(--primary-600); }

/* ---------- HERO ---------- */
.hero {
    position: relative;
    padding: 80px 0 100px;
    overflow: hidden;
}
.hero-bg {
    position: absolute; inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
}
.blob-1 {
    width: 500px; height: 500px;
    top: -150px; left: -150px;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
}
.blob-2 {
    width: 600px; height: 600px;
    top: 50px; right: -200px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    opacity: 0.18;
}

.hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 60px;
    align-items: center;
}
@media (max-width: 960px) {
    .hero-grid { grid-template-columns: 1fr; gap: 50px; }
    .hero { padding: 48px 0 60px; }
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-50);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 99px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.01em;
    border: 1px solid var(--primary-100);
    margin-bottom: 22px;
}
.pulse {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 0 rgba(16,185,129,0.7);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(16,185,129,0.7); }
    70%  { box-shadow: 0 0 0 10px rgba(16,185,129,0); }
    100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

.hero-title {
    font-size: 60px;
    line-height: 1.05;
    letter-spacing: -0.04em;
    margin: 0 0 22px;
    font-weight: 800;
    color: var(--text);
}
@media (max-width: 760px) {
    .hero-title { font-size: 40px; }
}
.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-sub {
    font-size: 18px;
    color: var(--text-dim);
    margin-bottom: 32px;
    max-width: 540px;
    line-height: 1.55;
}
.hero-sub strong { color: var(--text); }

.hero-ctas {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.btn-hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #fff;
    font-weight: 700;
    padding: 15px 28px;
    box-shadow: var(--shadow-primary);
    border: none;
    font-size: 15px;
}
.btn-hero:hover {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--accent) 100%);
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(44,44,84,0.35);
    color: #fff;
}

.hero-trust {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-dim);
    font-size: 13.5px;
    flex-wrap: wrap;
}
.hero-trust .check {
    color: var(--success);
    font-weight: 800;
}
.hero-trust .dot {
    width: 3px; height: 3px;
    background: var(--border-strong);
    border-radius: 50%;
}

/* ---------- Mockup do hero ---------- */
.hero-mockup {
    position: relative;
    perspective: 1000px;
}
.browser {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transform: rotateY(-6deg) rotateX(3deg);
    transition: transform 0.4s ease;
}
.browser:hover { transform: rotateY(-2deg) rotateX(1deg); }
.browser-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--surface-alt);
    border-bottom: 1px solid var(--border);
}
.browser-bar span.dot-red,
.browser-bar span.dot-yellow,
.browser-bar span.dot-green {
    width: 11px; height: 11px; border-radius: 50%;
}
.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }
.browser-url {
    margin-left: 12px;
    font-size: 12px;
    font-family: var(--mono);
    color: var(--text-muted);
    background: #fff;
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
}
.browser-body { padding: 20px; }
.mock-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    background: #fff;
    transition: all 0.2s ease;
}
.mock-card:hover { border-color: var(--primary-200); transform: translateX(2px); }
.mock-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 10px;
}
.mock-head strong { font-size: 14px; color: var(--text); }
.mock-line {
    height: 8px; background: var(--surface-alt); border-radius: 4px;
    margin-bottom: 6px;
}
.mock-line.short { width: 60%; }
.mock-stats {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 12px; margin-top: 4px;
}
.mock-stats > div {
    background: linear-gradient(135deg, var(--primary-50) 0%, var(--accent-soft) 100%);
    padding: 14px;
    border-radius: var(--radius);
    border: 1px solid var(--primary-100);
}
.mock-num {
    display: block;
    font-size: 22px; font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.02em;
}
.mock-stats small { color: var(--text-dim); font-size: 11px; }

.floating-msg {
    position: absolute;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    animation: float 4s ease-in-out infinite;
}
.floating-msg strong { display: block; color: var(--text); font-size: 12.5px; }
.floating-msg span { color: var(--text-dim); font-size: 12px; }
.floating-msg .av {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--accent-soft);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.floating-msg .av-ok { background: var(--success-soft); color: var(--success); }
.msg-1 { top: 40px; left: -30px; animation-delay: 0s; }
.msg-2 { bottom: 60px; right: -20px; animation-delay: 2s; }
@media (max-width: 960px) {
    .floating-msg { display: none; }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}

/* ---------- Métricas ---------- */
.metrics-row {
    padding: 30px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--surface-alt);
}
.metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    text-align: center;
}
@media (max-width: 760px) {
    .metrics { grid-template-columns: repeat(2, 1fr); gap: 20px; }
}
.metric-num {
    display: block;
    font-size: 38px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.03em;
    line-height: 1;
}
.metric-num small {
    font-size: 15px;
    color: var(--text-dim);
    font-weight: 600;
    margin-left: 2px;
}
.metric-lbl {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-dim);
    font-weight: 500;
}

/* ---------- Seções ---------- */
.section { padding: 80px 0; }
.section-alt { background: var(--surface-alt); }
.section-head {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 56px;
}
.section-head .eyebrow { margin-bottom: 16px; }
.section-title {
    font-size: 40px;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin: 0 0 14px;
    font-weight: 800;
}
@media (max-width: 760px) {
    .section-title { font-size: 30px; }
    .section { padding: 56px 0; }
}
.section-sub {
    font-size: 17px;
    color: var(--text-dim);
    margin: 0;
}

/* ---------- Features ---------- */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
@media (max-width: 960px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .features { grid-template-columns: 1fr; } }
.feature-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: all 0.25s ease;
}
.feature-card:hover {
    border-color: var(--primary-200);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.feature-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-50) 0%, var(--accent-soft) 100%);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    margin-bottom: 18px;
    border: 1px solid var(--primary-100);
}
.feature-card h3 {
    font-size: 17px;
    margin-bottom: 10px;
}
.feature-card p {
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.55;
    margin: 0;
}

/* ---------- Steps ---------- */
.steps {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    gap: 20px;
    align-items: stretch;
    max-width: 960px;
    margin: 0 auto;
}
@media (max-width: 840px) {
    .steps { grid-template-columns: 1fr; }
    .step-arrow { display: none; }
}
.step {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
}
.step:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-200);
}
.step-num {
    width: 48px; height: 48px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    font-weight: 800;
    box-shadow: var(--shadow-primary);
}
.step h3 { font-size: 17px; margin-bottom: 10px; }
.step p { color: var(--text-dim); font-size: 14px; margin: 0; }
.step-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-200);
    font-size: 28px;
    font-weight: 300;
}
.step-cta {
    text-align: center;
    margin-top: 48px;
}

/* ---------- Para quem ---------- */
.for-whom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}
@media (max-width: 960px) {
    .for-whom { grid-template-columns: 1fr; gap: 40px; }
}
.for-whom .section-title { text-align: left; margin-bottom: 12px; }
.for-whom .section-sub { margin-bottom: 28px; }

.check-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.check-list li {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
    color: var(--text-dim);
    line-height: 1.5;
}
.check-list li strong { color: var(--text); font-weight: 600; }
.check-list li:last-child { border-bottom: none; }
.chk {
    width: 22px; height: 22px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--success-soft);
    color: var(--success);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
    font-weight: 800;
    border: 1px solid rgba(16,185,129,0.2);
}

.quote-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-700) 100%);
    color: #fff;
    padding: 40px;
    border-radius: var(--radius-xl);
    position: relative;
    box-shadow: var(--shadow-lg);
}
.quote-mark {
    font-size: 80px;
    line-height: 0.8;
    color: var(--accent);
    font-family: Georgia, serif;
    margin-bottom: 10px;
}
.quote-card p {
    font-size: 18px;
    line-height: 1.55;
    color: #fff;
    font-weight: 500;
    margin-bottom: 24px;
}
.quote-author strong {
    display: block;
    color: #fff;
    font-size: 15px;
}
.quote-author small {
    color: rgba(255,255,255,0.6);
    font-size: 13px;
}

/* ---------- CTA FINAL ---------- */
.final-cta {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-700) 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}
.final-cta::before,
.final-cta::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
}
.final-cta::before {
    width: 400px; height: 400px;
    background: var(--accent);
    top: -100px; left: 10%;
}
.final-cta::after {
    width: 500px; height: 500px;
    background: #9b59b6;
    bottom: -200px; right: 5%;
    opacity: 0.2;
}
.final-cta-inner {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
}
.final-cta h2 {
    color: #fff;
    font-size: 40px;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 18px;
    font-weight: 800;
}
@media (max-width: 760px) { .final-cta h2 { font-size: 28px; } }
.final-cta p {
    font-size: 18px;
    color: rgba(255,255,255,0.85);
    margin-bottom: 32px;
}
.final-ctas {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.btn-hero-inverted {
    background: #fff;
    color: var(--primary);
    padding: 15px 32px;
    font-weight: 700;
    border: none;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    font-size: 15px;
}
.btn-hero-inverted:hover {
    background: #fff;
    color: var(--primary-700);
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.3);
}
.btn-ghost-inverted {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 15px 28px;
    font-size: 15px;
    box-shadow: none;
}
.btn-ghost-inverted:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-color: rgba(255,255,255,0.5);
}
.final-trust {
    display: block;
    color: rgba(255,255,255,0.6);
    font-size: 13px;
    margin-top: 4px;
}

/* ---------- Landing footer ---------- */
.land-footer {
    background: var(--surface-alt);
    border-top: 1px solid var(--border);
    padding: 50px 0 24px;
    color: var(--text-dim);
}
.land-footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 32px;
}
@media (max-width: 640px) {
    .land-footer-grid { grid-template-columns: 1fr; gap: 24px; }
}
.land-footer-grid strong {
    display: block;
    color: var(--text);
    font-size: 14px;
    margin-bottom: 12px;
}
.land-footer-grid a {
    display: block;
    color: var(--text-dim);
    font-size: 14px;
    margin-bottom: 8px;
}
.land-footer-grid a:hover { color: var(--primary); }
.land-footer-bottom {
    padding-top: 20px;
    border-top: 1px solid var(--border);
    text-align: center;
}

/* ==========================================================================
   PRICING PAGE
   ========================================================================== */

.pricing-wrap { max-width: 1100px; margin: 0 auto; }
.pricing-header { text-align: center; margin-bottom: 2.5rem; }
.pricing-header h1 { font-size: 2rem; margin-bottom: .4rem; }
.pricing-header p { font-size: 1.05rem; }

.cycle-toggle {
    display: inline-flex;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px;
    margin-top: 1.2rem;
    gap: 4px;
}
.cycle-opt {
    padding: .45rem 1.2rem;
    border-radius: 6px;
    font-size: .9rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--text-dim);
    transition: background .15s, color .15s;
}
.cycle-opt:hover { color: var(--text); }
.cycle-opt.active {
    background: var(--primary);
    color: #fff;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.plan-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 2rem 1.5rem 1.8rem;
    display: flex;
    flex-direction: column;
    transition: transform .15s, box-shadow .15s;
}
.plan-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(15,23,42,.08);
}
.plan-highlight {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 20%, transparent);
}
.plan-badge {
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #fff;
    font-size: .72rem;
    font-weight: 600;
    padding: .25rem .8rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .02em;
}
.plan-badge-current {
    background: var(--success, #10b981);
    top: auto;
    bottom: -11px;
}
.plan-current {
    border-color: var(--success, #10b981);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}
.plan-card h2 { font-size: 1.3rem; margin-bottom: .25rem; }
.plan-tagline { font-size: .88rem; margin-bottom: 1rem; }

.plan-price {
    margin-bottom: 1.4rem;
}
.plan-price strong {
    font-size: 2rem;
    letter-spacing: -.02em;
}
.plan-price small {
    font-size: .85rem;
    color: var(--text-dim);
    margin-left: .3rem;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    flex: 1;
}
.plan-features li {
    position: relative;
    padding-left: 1.4rem;
    font-size: .88rem;
    margin-bottom: .55rem;
    color: var(--text-dim);
}
.plan-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 700;
}

.plan-cta {
    width: 100%;
    text-align: center;
}

/* ==========================================================================
   BILLING PAGE
   ========================================================================== */

.billing-plan-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.billing-plan-name { font-size: 1.2rem; margin-right: .6rem; }
.billing-meta { margin-bottom: 1.2rem; }
.billing-meta p { margin: 0; font-size: .9rem; }

.usage-row {
    margin-bottom: 1.2rem;
}
.usage-row label {
    display: block;
    font-size: .85rem;
    color: var(--text-dim);
    margin-bottom: .25rem;
}
.usage-row span {
    font-size: .9rem;
    font-weight: 500;
}

.bar {
    height: 8px;
    background: var(--surface-alt);
    border-radius: 4px;
    overflow: hidden;
    margin-top: .4rem;
}
.bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width .3s ease;
}
.bar-fill.bar-warn {
    background: #f59e0b;
}

/* ==========================================================================
   CHECKOUT PAGE
   ========================================================================== */

.checkout-summary .row-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .5rem 0;
    font-size: .92rem;
}
.checkout-summary .total { font-size: 1.1rem; }
.checkout-summary hr { border: none; border-top: 1px solid var(--border); margin: .5rem 0; }

.row-inline {
    display: flex;
    gap: .5rem;
    align-items: flex-end;
}
.row-inline input { flex: 1; }

/* ==========================================================================
   PAYMENT / PIX PAGE
   ========================================================================== */

.pix-card { text-align: center; }

.pix-status {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-size: .9rem;
    font-weight: 500;
    padding: .4rem .9rem;
    border-radius: 20px;
    margin-bottom: 1.2rem;
}
.pix-status .dot {
    width: 10px; height: 10px; border-radius: 50%;
    display: inline-block;
}
.pix-pending { background: #fef3c7; color: #92400e; }
.pix-pending .dot { background: #f59e0b; animation: pulse 1.2s infinite; }
.pix-paid { background: #d1fae5; color: #065f46; }
.pix-paid .dot { background: #10b981; }
.pix-expired { background: #fee2e2; color: #991b1b; }
.pix-expired .dot { background: #ef4444; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .4; }
}

.pix-qr {
    display: block;
    margin: 0 auto 1.2rem;
    max-width: 240px;
    border-radius: 12px;
    border: 1px solid var(--border);
}
.pix-payload {
    font-size: .78rem;
    width: 100%;
    resize: none;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .6rem;
    margin-bottom: .6rem;
}

.list-meta {
    list-style: none;
    padding: 0;
    margin: 0;
}
.list-meta li {
    font-size: .88rem;
    padding: .35rem 0;
    border-bottom: 1px solid var(--border);
}
.list-meta li:last-child { border-bottom: none; }

/* ==========================================================================
   FINANCE DASHBOARD
   ========================================================================== */

.finance-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.2rem;
    margin-bottom: .5rem;
}
@media (max-width: 1100px) { .finance-kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .finance-kpis { grid-template-columns: 1fr; } }

.finance-kpi {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.4rem 1.3rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: transform .15s, box-shadow .15s;
}
.finance-kpi:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15,23,42,.06);
}

.finance-kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.finance-kpi-mrr       { background: linear-gradient(135deg, #dbeafe 0%, #ede9fe 100%); }
.finance-kpi-revenue   { background: linear-gradient(135deg, #d1fae5 0%, #cffafe 100%); }
.finance-kpi-users     { background: linear-gradient(135deg, #fef3c7 0%, #fce7f3 100%); }
.finance-kpi-retention { background: linear-gradient(135deg, #ede9fe 0%, #fce7f3 100%); }

.finance-kpi-body { flex: 1; min-width: 0; }
.finance-kpi-label {
    font-size: .78rem;
    color: var(--text-dim);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    margin-bottom: .25rem;
}
.finance-kpi-value {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.2;
    margin-bottom: .3rem;
}
.finance-kpi-foot {
    font-size: .78rem;
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
}

/* Plan distribution */
.plan-dist-list { display: flex; flex-direction: column; gap: 1rem; }
.plan-dist-item {}
.plan-dist-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .35rem;
    font-size: .88rem;
    flex-wrap: wrap;
}
.plan-dist-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.plan-dist-mrr {
    margin-left: auto;
    font-weight: 600;
    font-size: .82rem;
    color: var(--text);
}

/* Compact data table variant */
.data-table-compact th,
.data-table-compact td {
    padding: .4rem .6rem;
    font-size: .82rem;
}

/* btn-success for activate buttons */
.btn-success {
    background: var(--success, #10b981);
    color: #fff;
    border: none;
}
.btn-success:hover {
    background: #059669;
    color: #fff;
}

/* Utility */
.center { text-align: center; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.btn-sm { font-size: .82rem; padding: .35rem .8rem; }

/* ---------- Split Layout (Auth) ---------- */
.split-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(420px, 560px);
    min-height: 100vh;
    background: var(--bg);
    position: relative;
    overflow: hidden;
    align-items: stretch;
}

.split-left {
    grid-column: 1;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.12), transparent 35%),
        radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.08), transparent 28%),
        linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px;
    color: #fff;
}

.split-left::before,
.split-left::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}
.split-left::before {
    width: 600px;
    height: 600px;
    top: -100px;
    left: -200px;
}
.split-left::after {
    width: 400px;
    height: 400px;
    bottom: -100px;
    right: -100px;
}

.split-left-content::before {
    content: '';
    display: block;
    width: 84px;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.65);
    margin-bottom: 22px;
    box-shadow: 0 0 24px rgba(255, 255, 255, 0.22);
}

.split-left-content {
    position: relative;
    z-index: 10;
    max-width: 500px;
}

.split-left h1 {
    color: #fff;
    font-size: clamp(34px, 4vw, 48px);
    margin-bottom: 20px;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.split-left p {
    font-size: 18px;
    opacity: 0.9;
    line-height: 1.6;
    max-width: 38rem;
}

.split-brand {
    position: absolute;
    top: 40px;
    left: 60px;
    color: #fff;
    font-weight: 800;
    font-size: 24px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}
.split-brand:hover {
    color: #fff;
}
.split-brand::before {
    content: '';
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #fff 0%, var(--accent-soft) 100%);
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    position: relative;
    flex-shrink: 0;
}

.split-right {
    grid-column: 2;
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.75), transparent 48%),
        var(--bg);
    padding: 44px;
    position: relative;
}

.split-right .auth-card {
    width: 100%;
    max-width: 430px;
    margin: 0;
}

.split-right .auth-card .card {
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 24px;
    padding: 32px;
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.92);
}

.split-right .auth-card .card h1 {
    font-size: 30px;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.split-right .auth-card .card form {
    margin-top: 22px;
}

.split-right .auth-card .card .row {
    margin-bottom: 16px;
}

.split-right .auth-card .card label {
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.split-right .auth-card .card input {
    height: 48px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.split-right .auth-card .card input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.split-right .auth-card .card .btn {
    width: 100%;
    margin-top: 8px;
    border-radius: 14px;
    min-height: 48px;
}

.split-right .auth-card .card .btn-secondary {
    margin-top: 12px;
    background: var(--surface-alt);
    color: var(--text);
    border: 1px solid var(--border);
}

.split-right .auth-card .card .btn-secondary:hover {
    background: #f3f6fb;
    color: var(--primary);
}

@media (max-width: 900px) {
    .split-layout {
        display: flex;
        flex-direction: column;
    }
    .split-left {
        padding: 40px 20px;
        min-height: 300px;
        flex: none;
        align-items: center;
        text-align: center;
    }
    .split-brand {
        top: 20px;
        left: 20px;
    }
    .split-left-content {
        margin-top: 60px;
    }
    .split-right {
        width: 100%;
        padding: 28px 16px 36px;
    }

    .split-right .auth-card .card {
        padding: 26px 20px;
        border-radius: 20px;
    }
}
