/* ==========================================================
   Mídia & Tráfego — Relatórios | Estilos
   Conceito: painéis flutuando sobre um fundo suave.
   Paleta: primária #1800ae (índigo) / secundária #e3bc59 (dourado)
   ========================================================== */

:root {
    --mt-primary: #1800ae;
    --mt-primary-dark: #12007e;
    --mt-primary-light: #3a25c9;
    --mt-secondary: #e3bc59;
    --mt-secondary-dark: #c9a23f;

    --mt-canvas: #eceef6;
    --mt-ink: #1f2330;
    --mt-muted: #7a7f96;

    --mt-sidebar-w: 250px;
    --mt-gap: 20px;
    --mt-radius: 22px;
    --mt-radius-sm: 14px;

    --mt-shadow: 0 12px 34px rgba(20, 10, 80, .07);
    --mt-shadow-lg: 0 18px 44px rgba(24, 0, 174, .12);
}

* { scrollbar-width: thin; }

body {
    background:
        radial-gradient(1200px 600px at 110% -10%, rgba(227, 188, 89, .10), transparent 60%),
        radial-gradient(900px 500px at -10% 110%, rgba(24, 0, 174, .07), transparent 55%),
        var(--mt-canvas);
    background-attachment: fixed;
    color: var(--mt-ink);
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* --- Cores / acentos --------------------------------------- */
.btn-primary {
    background-color: var(--mt-primary);
    border-color: var(--mt-primary);
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--mt-primary-dark);
    border-color: var(--mt-primary-dark);
}
.btn-outline-primary { color: var(--mt-primary); border-color: var(--mt-primary); }
.btn-outline-primary:hover { background-color: var(--mt-primary); border-color: var(--mt-primary); }
.text-primary-mt { color: var(--mt-primary) !important; }
.text-secondary-mt { color: var(--mt-secondary-dark) !important; }
a { color: var(--mt-primary); text-decoration: none; }
a:hover { color: var(--mt-primary-dark); }
.btn { border-radius: 12px; font-weight: 500; }
.btn-secondary-mt {
    background-color: var(--mt-secondary);
    border-color: var(--mt-secondary);
    color: #3a2e00;
}
.btn-secondary-mt:hover { background-color: var(--mt-secondary-dark); border-color: var(--mt-secondary-dark); color: #3a2e00; }

.form-control, .form-select { border-radius: 12px; padding: .6rem .85rem; }
.form-control:focus, .form-select:focus {
    border-color: var(--mt-primary-light);
    box-shadow: 0 0 0 .2rem rgba(24, 0, 174, .12);
}

/* --- Marca ------------------------------------------------- */
.mt-logo-mark {
    width: 40px; height: 40px;
    border-radius: 12px;
    background: var(--mt-primary);
    color: #fff;
    display: grid; place-items: center;
    font-weight: 800; font-size: 1.3rem;
}

/* --- Sidebar flutuante ------------------------------------- */
.mt-sidebar {
    position: fixed;
    top: var(--mt-gap); left: var(--mt-gap); bottom: var(--mt-gap);
    width: var(--mt-sidebar-w);
    background: linear-gradient(165deg, #2a14d6 0%, var(--mt-primary) 50%, var(--mt-primary-dark) 100%);
    border-radius: 28px;
    box-shadow: var(--mt-shadow-lg);
    padding: 1.5rem 0 1rem;
    overflow-y: auto;
    color: rgba(255, 255, 255, .82);
    z-index: 1030;
}
.mt-sidebar::-webkit-scrollbar { width: 6px; }
.mt-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 3px; }

.mt-sidebar .mt-brand {
    color: #fff;
    padding: 0 1.5rem 1.25rem;
    display: flex; align-items: center; gap: .65rem;
    font-weight: 700; font-size: 1.05rem;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    margin-bottom: 1rem;
}
.mt-sidebar .mt-brand .mt-logo-mark {
    background: #fff; color: var(--mt-primary);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .2);
}

.mt-sidebar .nav { padding: 0 .85rem; }
.mt-sidebar .nav-link {
    color: rgba(255, 255, 255, .78);
    padding: .72rem .9rem;
    margin: 3px 0;
    border-radius: 14px;
    display: flex; align-items: center; gap: .8rem;
    font-size: .95rem;
    transition: all .16s ease;
}
.mt-sidebar .nav-link i { font-size: 1.1rem; opacity: .9; }
.mt-sidebar .nav-link:hover {
    background: rgba(255, 255, 255, .10);
    color: #fff;
    transform: translateX(2px);
}
.mt-sidebar .nav-link.active {
    background: rgba(255, 255, 255, .16);
    color: #fff;
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--mt-secondary), 0 6px 16px rgba(0, 0, 0, .12);
}
.mt-sidebar .nav-link.active i { color: var(--mt-secondary); opacity: 1; }
.mt-sidebar .nav-section {
    text-transform: uppercase;
    font-size: .7rem; letter-spacing: .06em;
    color: rgba(255, 255, 255, .4);
    padding: 1.1rem 1.5rem .4rem;
}

/* --- Área principal ---------------------------------------- */
.mt-main {
    margin-left: calc(var(--mt-sidebar-w) + var(--mt-gap) * 2);
    min-height: 100vh;
    padding: var(--mt-gap) calc(var(--mt-gap) + 4px) calc(var(--mt-gap) + 10px);
}

/* topo transparente, "solto" */
.mt-topbar {
    background: transparent;
    border: none;
    padding: .35rem .25rem 1.5rem;
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem;
}
.mt-page-eyebrow {
    color: var(--mt-muted);
    font-size: .8rem;
    text-transform: capitalize;
}
.mt-page-title {
    font-weight: 700;
    color: var(--mt-ink);
    letter-spacing: -.01em;
}
.mt-menu-toggle { border-radius: 12px; box-shadow: var(--mt-shadow); }

.mt-user-pill {
    background: #fff;
    border-radius: 999px;
    padding: .35rem .8rem .35rem .4rem;
    box-shadow: var(--mt-shadow);
    color: var(--mt-ink);
}
.mt-user-pill:hover { box-shadow: var(--mt-shadow-lg); }
.mt-user-pill::after { margin-left: .35rem; }
.mt-user-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(140deg, var(--mt-primary-light), var(--mt-primary));
    color: #fff;
    display: grid; place-items: center;
    font-weight: 700; font-size: .9rem;
}
.mt-user-role { color: var(--mt-secondary-dark); font-size: .72rem; font-weight: 600; }
.dropdown-menu { border-radius: 14px; }

.mt-content { padding: 0 .25rem; }

/* --- Cards ------------------------------------------------- */
.card {
    border: none;
    border-radius: var(--mt-radius);
    box-shadow: var(--mt-shadow);
    background: #fff;
}
.card-body { padding: 1.5rem; }

/* cards de métrica */
.mt-stat-card {
    border-radius: var(--mt-radius);
    box-shadow: var(--mt-shadow);
    transition: transform .18s ease, box-shadow .18s ease;
}
.mt-stat-card:hover { transform: translateY(-3px); box-shadow: var(--mt-shadow-lg); }
.mt-stat-card .mt-stat-label {
    color: var(--mt-muted);
    font-size: .8rem; text-transform: uppercase; letter-spacing: .03em;
}
.mt-stat-card .mt-stat-value {
    font-size: 1.7rem; font-weight: 700; color: var(--mt-primary);
    letter-spacing: -.02em;
}
.mt-stat-card .mt-stat-icon {
    width: 48px; height: 48px;
    border-radius: 14px;
    display: grid; place-items: center;
    background: linear-gradient(140deg, rgba(24, 0, 174, .12), rgba(24, 0, 174, .04));
    color: var(--mt-primary);
    font-size: 1.25rem;
}

/* tabelas */
.table { --bs-table-bg: transparent; }
.table thead th {
    color: var(--mt-muted);
    font-size: .76rem; text-transform: uppercase; letter-spacing: .03em;
    border-bottom: 1px solid #eceef4;
    padding-bottom: .8rem;
}
.table tbody td { padding-top: .85rem; padding-bottom: .85rem; border-color: #f1f2f7; }
.table tbody tr { transition: background .12s ease; }
.table-hover tbody tr:hover { background: #f7f8fc; }

/* sino de notificações */
.mt-bell {
    background: #fff;
    border-radius: 50%;
    width: 42px; height: 42px;
    display: grid; place-items: center;
    box-shadow: var(--mt-shadow);
    color: var(--mt-primary);
    font-size: 1.05rem;
}
.mt-bell:hover { box-shadow: var(--mt-shadow-lg); color: var(--mt-primary-dark); }
.mt-bell-badge {
    position: absolute; top: -4px; right: -4px;
    background: #e23b3b; color: #fff;
    font-size: .62rem; font-weight: 700;
    min-width: 18px; height: 18px;
    border-radius: 9px;
    display: grid; place-items: center;
    padding: 0 4px;
    border: 2px solid #fff;
}

/* alertas */
.mt-alerta-icone { font-size: 1.2rem; line-height: 1.4; width: 1.6rem; text-align: center; }

/* selos de variação (crescimento) */
.mt-delta { font-size: .78rem; font-weight: 600; }
.mt-delta-up   { color: #1b7a43; }
.mt-delta-down { color: #b42424; }
.mt-delta-novo { color: var(--mt-secondary-dark); }

/* badges de status */
.badge { font-weight: 600; padding: .4em .7em; border-radius: 8px; }
.badge-ativo   { background: #e6f7ed; color: #1b7a43; }
.badge-pausado { background: #fff4e0; color: #9a6a00; }
.badge-inativo { background: #fbe7e7; color: #b42424; }

/* cards clicáveis (ex.: seletor de clientes) */
.mt-card-link .card { transition: transform .18s ease, box-shadow .18s ease; }
.mt-card-link:hover .card { transform: translateY(-3px); box-shadow: var(--mt-shadow-lg); }

/* --- Login ------------------------------------------------- */
.mt-login-wrap {
    min-height: 100vh;
    display: grid; place-items: center;
    background:
        radial-gradient(800px 500px at 90% 10%, rgba(227,188,89,.18), transparent 55%),
        linear-gradient(135deg, var(--mt-primary) 0%, var(--mt-primary-dark) 100%);
    padding: 1rem;
}
.mt-login-card {
    width: 100%; max-width: 420px;
    background: #fff;
    border-radius: 24px;
    padding: 2.75rem 2.25rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
}
.mt-login-card .mt-logo-mark {
    width: 56px; height: 56px; font-size: 1.7rem; border-radius: 16px;
    margin: 0 auto;
}

/* --- Responsivo -------------------------------------------- */
@media (max-width: 991.98px) {
    .mt-sidebar {
        top: 0; left: 0; bottom: 0;
        border-radius: 0 22px 22px 0;
        width: 260px;
        transform: translateX(-105%);
        transition: transform .22s ease;
    }
    .mt-sidebar.show { transform: translateX(0); }
    .mt-main { margin-left: 0; padding: 14px; }
    .mt-page-title { font-size: 1.25rem; }
}
