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

/*
 * Tema do painel do MetriHub - Gestão (identidade SA Growth Marketing, parametrizável).
 * Funciona nos modos Claro, Escuro e Automático do Filament (classe .dark no <html>).
 * A cor da marca vem de --mh-accent / --mh-accent-rgb, definidas a partir de config/brand.php.
 */
:root {
    --mh-accent: #ff6f00;
    --mh-accent-rgb: 255, 111, 0;
    --mh-radius: 20px;
    --mh-font-display: "Space Grotesk", Inter, ui-sans-serif, system-ui, sans-serif;
}

/* ---------- Fundo da aplicação ---------- */
body.fi-body {
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
    background: #f6f4ef;
}

.dark body.fi-body {
    background:
        radial-gradient(circle at 88% -6%, rgba(var(--mh-accent-rgb), .13), transparent 34%),
        radial-gradient(circle at -4% 100%, rgba(var(--mh-accent-rgb), .07), transparent 32%),
        #0d0d0d;
    background-attachment: fixed;
}

/* ---------- Tipografia ---------- */
.fi-header-heading,
.fi-section-header-heading,
.fi-wi-stats-overview-stat-value,
.fi-modal-heading {
    font-family: var(--mh-font-display);
    letter-spacing: -.03em;
}

.fi-header-heading {
    font-weight: 700;
}

.fi-wi-stats-overview-stat-value {
    font-weight: 700;
    font-size: 1.9rem;
    line-height: 1.1;
}

/* ---------- Cartões ---------- */
.fi-section,
.fi-ta-ctn,
.fi-wi-stats-overview-stat,
.fi-wi-chart,
.fi-fo-wizard,
.fi-in-section {
    border-radius: var(--mh-radius) !important;
}

.dark .fi-section,
.dark .fi-ta-ctn,
.dark .fi-wi-stats-overview-stat,
.dark .fi-wi-chart,
.dark .fi-fo-wizard {
    background-color: #161616;
}

/* ---------- Botões e selos ---------- */
.fi-btn {
    border-radius: 999px;
    font-weight: 700;
    transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.fi-btn:not(:disabled):hover {
    transform: translateY(-1px);
}

.fi-btn.fi-color-primary:not(.fi-outlined),
.fi-btn[class*="bg-custom-600"] {
    box-shadow: 0 10px 24px rgba(var(--mh-accent-rgb), .24);
}

.fi-badge {
    border-radius: 999px;
    font-weight: 700;
}

/* ---------- Campos ---------- */
.fi-input-wrp {
    border-radius: 14px;
}

.fi-input-wrp:focus-within {
    box-shadow: 0 0 0 4px rgba(var(--mh-accent-rgb), .14);
}

/* ---------- Tabelas ---------- */
.fi-ta-header-cell {
    font-size: .72rem;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.fi-ta-row {
    transition: background-color .15s ease;
}

.fi-ta-row:hover {
    background-color: rgba(var(--mh-accent-rgb), .05);
}

/* ---------- Barra superior e menu lateral ---------- */
.fi-topbar > nav {
    background-color: rgba(255, 255, 255, .82) !important;
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

.dark .fi-topbar > nav {
    background-color: rgba(17, 17, 17, .78) !important;
}

.fi-sidebar,
.fi-sidebar-header {
    background-color: #fff;
}

.dark .fi-sidebar,
.dark .fi-sidebar-header {
    background-color: #111 !important;
}

.fi-sidebar-item-button {
    border-radius: 14px;
}

.fi-sidebar-item-active > .fi-sidebar-item-button {
    background-color: rgba(var(--mh-accent-rgb), .13) !important;
}

.fi-sidebar-group-label {
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

/* ---------- Logo do cliente no topo, à direita ---------- */
.mh-topbar-brand {
    display: inline-flex;
    align-items: center;
}

.mh-topbar-brand img {
    height: 1.9rem;
    width: auto;
}

.mh-brand-dark,
.mh-pf-dark {
    display: none;
}

.dark .mh-brand-light,
.dark .mh-pf-light {
    display: none;
}

.dark .mh-brand-dark,
.dark .mh-pf-dark {
    display: block;
}

/* ---------- Rodapé do produto (sempre MetriHub) ---------- */
.mh-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .55rem;
    padding: 1.5rem 1rem 1.75rem;
    text-align: center;
    color: rgba(17, 17, 17, .55);
    font-size: .78rem;
}

.dark .mh-footer {
    color: rgba(255, 255, 255, .45);
}

.mh-footer strong {
    font-weight: 700;
}

.mh-footer-logo img {
    height: 1.5rem;
    width: auto;
}

@media (prefers-reduced-motion: reduce) {
    .fi-btn,
    .fi-ta-row {
        transition: none;
    }

    .fi-btn:not(:disabled):hover {
        transform: none;
    }
}

/* =====================================================================
   DASHBOARD: boas-vindas, indicadores, agenda e gráficos
   ===================================================================== */
:root {
    --mh-line: rgba(17, 17, 17, .09);
    --mh-soft: rgba(17, 17, 17, .035);
    --mh-muted: rgba(17, 17, 17, .56);
    --mh-k-os_start: #3b82f6;
    --mh-k-os_end: var(--mh-accent);
    --mh-k-receber: #22c55e;
    --mh-k-pagar: #f43f5e;
}

.dark {
    --mh-line: rgba(255, 255, 255, .09);
    --mh-soft: rgba(255, 255, 255, .04);
    --mh-muted: rgba(255, 255, 255, .58);
    --mh-k-os_start: #60a5fa;
}

.mh-ico { width: 1.1rem; height: 1.1rem; flex: none; }

@keyframes mh-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes mh-float { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-26px, 18px) scale(1.07); } }
@keyframes mh-pulse { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); } 70% { box-shadow: 0 0 0 9px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
@keyframes mh-sheen { from { transform: translateX(-120%); } to { transform: translateX(220%); } }

/* ---------- Boas-vindas ---------- */
.mh-hero {
    position: relative;
    overflow: hidden;
    padding: 1.75rem;
    border-radius: 24px;
    color: #fff;
    background: linear-gradient(135deg, #1b1b1b 0%, #101010 60%, #0b0b0b 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 24px 60px rgba(var(--mh-accent-rgb), .13);
    animation: mh-rise .6s cubic-bezier(.2, .8, .2, 1) both;
}

.mh-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
    background-size: 46px 46px;
    -webkit-mask-image: linear-gradient(120deg, rgba(0, 0, 0, .9), rgba(0, 0, 0, .05) 70%);
    mask-image: linear-gradient(120deg, rgba(0, 0, 0, .9), rgba(0, 0, 0, .05) 70%);
    pointer-events: none;
}

.mh-hero-orb {
    position: absolute;
    right: -90px;
    top: -140px;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--mh-accent-rgb), .5), transparent 65%);
    filter: blur(14px);
    animation: mh-float 10s ease-in-out infinite;
    pointer-events: none;
}

.mh-hero-body {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.25rem;
}

.mh-hero-live {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .3rem .7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .1);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .8);
}

.mh-live-dot {
    width: .5rem;
    height: .5rem;
    border-radius: 50%;
    background: #22c55e;
    animation: mh-pulse 2s infinite;
}

.mh-hero-title {
    margin: .85rem 0 .15rem;
    font-family: var(--mh-font-display);
    font-size: clamp(1.7rem, 3.2vw, 2.4rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -.04em;
    color: #fff;
}

.mh-hero-date { margin: 0; color: rgba(255, 255, 255, .6); font-size: .92rem; }

.mh-quick { display: flex; flex-wrap: wrap; gap: .6rem; }

.mh-quick-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .13);
    color: #fff;
    font-size: .85rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.mh-quick-btn:hover {
    transform: translateY(-2px);
    background: rgba(var(--mh-accent-rgb), .9);
    border-color: transparent;
    box-shadow: 0 12px 28px rgba(var(--mh-accent-rgb), .35);
}

.mh-hero-kpis {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
    margin-top: 1.4rem;
}

.mh-kpi {
    position: relative;
    overflow: hidden;
    padding: .9rem 1.05rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, .055);
    border: 1px solid rgba(255, 255, 255, .09);
    display: flex;
    flex-direction: column;
    gap: .1rem;
}

.mh-kpi::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 40%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .07), transparent);
    animation: mh-sheen 6s ease-in-out infinite;
}

.mh-kpi-label { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .55); }
.mh-kpi strong { font-family: var(--mh-font-display); font-size: 1.35rem; letter-spacing: -.03em; color: #fff; }
.mh-kpi small { color: rgba(255, 255, 255, .5); font-size: .78rem; }
.mh-kpi.is-warn { border-color: rgba(251, 191, 36, .45); }
.mh-kpi.is-warn strong { color: #fbbf24; }
.mh-kpi.is-bad { border-color: rgba(244, 63, 94, .5); }
.mh-kpi.is-bad strong { color: #fb7185; }
.mh-kpi.is-ok strong { color: #4ade80; }

/* ---------- Indicadores ---------- */
.fi-wi-stats-overview-stat {
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease;
    animation: mh-rise .55s cubic-bezier(.2, .8, .2, 1) both;
}

.fi-wi-stats-overview-stats-ctn > :nth-child(1) { animation-delay: .03s; }
.fi-wi-stats-overview-stats-ctn > :nth-child(2) { animation-delay: .08s; }
.fi-wi-stats-overview-stats-ctn > :nth-child(3) { animation-delay: .13s; }
.fi-wi-stats-overview-stats-ctn > :nth-child(4) { animation-delay: .18s; }
.fi-wi-stats-overview-stats-ctn > :nth-child(5) { animation-delay: .23s; }
.fi-wi-stats-overview-stats-ctn > :nth-child(6) { animation-delay: .28s; }
.fi-wi-stats-overview-stats-ctn > :nth-child(7) { animation-delay: .33s; }
.fi-wi-stats-overview-stats-ctn > :nth-child(8) { animation-delay: .38s; }

.fi-wi-stats-overview-stat::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, rgba(var(--mh-accent-rgb), .9), transparent 70%);
    opacity: .75;
}

.fi-wi-stats-overview-stat:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(var(--mh-accent-rgb), .16);
}

.fi-wi-stats-overview-stat-icon { color: rgb(var(--primary-500)) !important; }

@media (max-width: 767px) {
    .fi-wi-stats-overview-stats-ctn { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: .75rem !important; }
    .fi-wi-stats-overview-stat { padding: 1rem !important; }
    .fi-wi-stats-overview-stat-value { font-size: 1.3rem !important; }
}

/* ---------- Agenda ---------- */
.mh-cal { display: flex; flex-direction: column; gap: 1rem; }

.mh-cal-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.mh-cal-title { margin: 0; font-family: var(--mh-font-display); font-size: 1.15rem; font-weight: 700; letter-spacing: -.02em; }
.mh-cal-month { font-size: .88rem; color: var(--mh-muted); }

.mh-cal-nav { display: inline-flex; align-items: center; gap: .4rem; }
.mh-cal-btn {
    min-width: 2.25rem; height: 2.25rem; padding: 0 .75rem;
    border-radius: 999px; border: 1px solid var(--mh-line); background: var(--mh-soft);
    font-size: 1.1rem; font-weight: 700; line-height: 1; cursor: pointer; color: inherit;
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.mh-cal-btn:hover { background: rgba(var(--mh-accent-rgb), .14); border-color: rgba(var(--mh-accent-rgb), .5); transform: translateY(-1px); }
.mh-cal-today { font-size: .82rem; }

.mh-cal-summary { display: flex; flex-wrap: wrap; gap: .5rem .5rem; }
.mh-cal-summary span {
    display: inline-flex; align-items: center; gap: .45rem;
    padding: .35rem .75rem; border-radius: 999px; border: 1px solid var(--mh-line); background: var(--mh-soft);
    font-size: .8rem; color: var(--mh-muted);
}
.mh-cal-summary b { color: inherit; font-weight: 800; }
.dark .mh-cal-summary b { color: #fff; }

.mh-dot { display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; flex: none; }
.mh-k-os_start { background: var(--mh-k-os_start); }
.mh-k-os_end { background: var(--mh-k-os_end); }
.mh-k-receber { background: var(--mh-k-receber); }
.mh-k-pagar { background: var(--mh-k-pagar); }
.mh-k-onboarding { background: #a855f7; }
.mh-cal-group-desc { margin: -.25rem 0 .45rem; font-size: .74rem; line-height: 1.35; color: var(--mh-muted); }

.mh-cal-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }

.mh-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .35rem; }
.mh-cal-wd { padding: .35rem 0; text-align: center; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--mh-muted); }

.mh-cal-day {
    position: relative;
    min-height: 4.4rem;
    padding: .45rem .5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    border-radius: 14px;
    border: 1px solid var(--mh-line);
    background: var(--mh-soft);
    color: inherit;
    cursor: pointer;
    text-align: left;
    transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.mh-cal-day:hover { transform: translateY(-2px); border-color: rgba(var(--mh-accent-rgb), .55); box-shadow: 0 10px 24px rgba(var(--mh-accent-rgb), .14); }
.mh-cal-day.is-out { opacity: .38; }
.mh-cal-num { font-size: .88rem; font-weight: 700; }
.mh-cal-dots { display: flex; flex-wrap: wrap; gap: .25rem; min-height: .5rem; }
.mh-cal-count {
    position: absolute; right: .4rem; top: .4rem;
    min-width: 1.15rem; height: 1.15rem; padding: 0 .3rem; border-radius: 999px;
    background: rgba(var(--mh-accent-rgb), .16); color: rgb(var(--primary-600)); font-size: .68rem; font-weight: 800;
    display: grid; place-items: center;
}
.dark .mh-cal-count { color: rgb(var(--primary-300)); }

.mh-cal-day.is-today .mh-cal-num {
    display: grid; place-items: center; min-width: 1.6rem; height: 1.6rem; margin: -.15rem 0 0 -.2rem;
    border-radius: 50%; background: var(--mh-accent); color: #fff;
    box-shadow: 0 6px 16px rgba(var(--mh-accent-rgb), .45);
}
.mh-cal-day.is-selected { background: rgba(var(--mh-accent-rgb), .12); border-color: var(--mh-accent); box-shadow: 0 0 0 3px rgba(var(--mh-accent-rgb), .16); }
.mh-cal-day.has-overdue { border-color: rgba(244, 63, 94, .55); }

.mh-cal-detail { border-radius: 18px; border: 1px solid var(--mh-line); background: var(--mh-soft); padding: 1rem; min-height: 14rem; }
.mh-cal-detail-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .75rem; font-family: var(--mh-font-display); letter-spacing: -.02em; }
.mh-cal-chip { padding: .15rem .6rem; border-radius: 999px; background: var(--mh-accent); color: #fff; font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }

.mh-cal-group { margin-bottom: .9rem; }
.mh-cal-group-title { display: flex; align-items: center; gap: .45rem; margin-bottom: .4rem; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--mh-muted); }

.mh-cal-item {
    display: flex; align-items: center; justify-content: space-between; gap: .75rem;
    padding: .55rem .7rem; margin-bottom: .35rem; border-radius: 12px;
    border: 1px solid var(--mh-line); background: rgba(255, 255, 255, .55); color: inherit; text-decoration: none;
    transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.dark .mh-cal-item { background: rgba(255, 255, 255, .04); }
.mh-cal-item:hover { transform: translateX(3px); border-color: rgba(var(--mh-accent-rgb), .55); }
.mh-cal-item.is-overdue { border-color: rgba(244, 63, 94, .5); }
.mh-cal-item-main { display: flex; flex-direction: column; min-width: 0; }
.mh-cal-item-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .86rem; font-weight: 700; }
.mh-cal-item-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .75rem; color: var(--mh-muted); }
.mh-cal-item-amount { flex: none; font-size: .84rem; font-weight: 800; }

.mh-cal-empty { display: flex; flex-direction: column; gap: .2rem; padding: 1.5rem .5rem; text-align: center; color: var(--mh-muted); font-size: .85rem; }
.mh-cal-empty strong { font-family: var(--mh-font-display); font-size: 1.05rem; color: inherit; }

@media (max-width: 1023px) {
    .mh-cal-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1023px) {
    .mh-hero-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .mh-hero { padding: 1.25rem; }
    .mh-hero-kpis { grid-template-columns: minmax(0, 1fr); }
    .mh-cal-grid { gap: .25rem; }
    .mh-cal-day { min-height: 3.35rem; padding: .35rem .4rem; border-radius: 10px; }
    .mh-cal-count { display: none; }
    .mh-cal-wd { font-size: .64rem; letter-spacing: .02em; }
}

@media (prefers-reduced-motion: reduce) {
    .mh-hero, .fi-wi-stats-overview-stat, .mh-hero-orb, .mh-kpi::after, .mh-live-dot { animation: none !important; }
    .fi-wi-stats-overview-stat, .mh-cal-day, .mh-quick-btn, .mh-cal-btn, .mh-cal-item { transition: none; }
}


/* ---------- Texto do contrato exibido na tela ---------- */
.mh-contract-body { max-height: 34rem; overflow: auto; padding: 1.1rem 1.25rem; border-radius: 14px; border: 1px solid var(--mh-line); background: var(--mh-soft); font-size: .86rem; line-height: 1.6; }
.mh-contract-body p { margin: 0 0 .55rem; text-align: justify; }
.mh-contract-body h1 { margin: 0 0 1rem; text-align: center; font-size: 1.05rem; font-family: var(--mh-font-display); }
.mh-contract-body h2 { margin: 1.1rem 0 .45rem; font-size: .88rem; text-transform: uppercase; font-weight: 800; }
.mh-contract-body h3 { margin: 1rem 0 .4rem; font-size: .8rem; text-transform: uppercase; color: rgb(var(--primary-600)); }
.mh-contract-body .item { padding-left: 2.4rem; text-indent: -2.4rem; }
.mh-contract-body .item .num { display: inline-block; min-width: 2.4rem; text-indent: 0; font-weight: 700; }
.mh-contract-body .item.l2 { padding-left: 4.6rem; }
.mh-contract-body .right { text-align: right; }
.mh-contract-body .page-break { height: 1px; margin: 1.2rem 0; background: var(--mh-line); }
.mh-contract-body table { width: 100%; border-collapse: collapse; margin: .6rem 0; }
.mh-contract-body td, .mh-contract-body th { padding: .35rem .5rem; border-bottom: 1px solid var(--mh-line); text-align: left; }
.mh-contract-body .num, .mh-contract-body td.num { text-align: right; }
.mh-contract-body .signatures .line { margin: 1.6rem 0 .3rem; border-top: 1px solid currentColor; }
.mh-contract-body .muted { opacity: .65; }

/* Financeiro: resumo do topo mais compacto (6 indicadores em uma linha no desktop), para a lista aparecer sem rolar tanto. */
.fi-resource-financial-transactions .fi-wi-stats-overview > div.grid { gap: .75rem; }
.fi-resource-financial-transactions .fi-wi-stats-overview-stat { padding: .7rem .9rem; }
.fi-resource-financial-transactions .fi-wi-stats-overview-stat-value { font-size: 1.35rem; line-height: 1.7rem; }
.fi-resource-financial-transactions .fi-wi-stats-overview-stat-label { font-size: .75rem; }
@media (min-width: 1280px) {
    .fi-resource-financial-transactions .fi-wi-stats-overview > div.grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
