:root {
    --cfm-font: "CFM Inter", "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --cfm-portal-green: #394B37;
    --cfm-portal-green-2: #6B7862;
    --cfm-portal-green-3: #2F3B30;
    --cfm-portal-cream: #F7F7F2;
    --cfm-portal-soft: #EFF2EC;
    --cfm-portal-card: #FFFFFF;
    --cfm-portal-border: #DDE2D9;
    --cfm-portal-text: #263126;
    --cfm-portal-muted: #748071;
    --cfm-portal-positive: #4D7250;
    --cfm-portal-negative: #9B5A54;
}

/* =========================================================
   ISOLAMENTO DO TEMA / ELEMENTOR
   O painel usa sua própria tipografia e hierarquia.
========================================================= */

.cfm-portal-page,
.cfm-portal-page #page,
.cfm-portal-page .site,
.cfm-portal-page .site-main,
.cfm-portal-page .entry-content {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: none !important;
}

.cfm-portal-page header.site-header,
.cfm-portal-page footer.site-footer,
.cfm-portal-page .elementor-location-header,
.cfm-portal-page .elementor-location-footer,
.cfm-portal-page .page-header,
.cfm-portal-page .entry-header {
    display: none !important;
}

.cfm-portal-page {
    background: var(--cfm-portal-cream) !important;
    color: var(--cfm-portal-text) !important;
    font-family: var(--cfm-font) !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.cfm-portal-page *,
.cfm-portal-page *::before,
.cfm-portal-page *::after,
.cfm-portal-page input,
.cfm-portal-page button,
.cfm-portal-page select,
.cfm-portal-page textarea {
    box-sizing: border-box;
    font-family: var(--cfm-font) !important;
}

.cfm-portal-page h1,
.cfm-portal-page h2,
.cfm-portal-page h3,
.cfm-portal-page h4,
.cfm-portal-page h5,
.cfm-portal-page h6,
.cfm-portal-page p,
.cfm-portal-page span,
.cfm-portal-page small,
.cfm-portal-page label,
.cfm-portal-page a,
.cfm-portal-page button,
.cfm-portal-page input,
.cfm-portal-page td,
.cfm-portal-page th {
    font-family: var(--cfm-font) !important;
    text-transform: none;
    text-shadow: none;
}

.cfm-portal-page h1,
.cfm-portal-page h2,
.cfm-portal-page h3,
.cfm-portal-page h4,
.cfm-portal-page h5,
.cfm-portal-page h6 {
    font-style: normal !important;
}

.cfm-portal-page strong,
.cfm-portal-page b {
    font-weight: 500 !important;
}

.cfm-portal-page a {
    text-decoration: none;
}

/* =========================================================
   LOGIN
========================================================= */

.cfm-login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(400px, .95fr);
    background: var(--cfm-portal-cream);
    color: var(--cfm-portal-text);
}

.cfm-login-brand {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    isolation: isolate;
    padding: 54px 56px 56px;
    background: var(--cfm-portal-green);
    color: #F1F0E8;
    overflow: hidden;
}

.cfm-login-metric-graphic {
    position: absolute;
    inset: 5% -5% 5% -8%;
    z-index: 0;
    pointer-events: none;
    opacity: .82;
}

.cfm-login-metric-graphic svg {
    width: 100%;
    height: 100%;
    display: block;
}

.cfm-metric-bars rect {
    fill: rgba(241,240,232,.055);
}

.cfm-metric-guides path {
    stroke: rgba(241,240,232,.09);
    stroke-width: 1;
}

.cfm-metric-line {
    fill: none;
    stroke: rgba(241,240,232,.28);
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 1100;
    stroke-dashoffset: 1100;
    animation: cfmMetricRise 2.2s cubic-bezier(.22,.61,.36,1) .15s forwards;
}

.cfm-metric-dots circle {
    fill: #FF7900;
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
    animation: cfmMetricDot .45s ease forwards;
}

.cfm-metric-dots circle:nth-child(1) { animation-delay: .45s; }
.cfm-metric-dots circle:nth-child(2) { animation-delay: .75s; }
.cfm-metric-dots circle:nth-child(3) { animation-delay: 1.05s; }
.cfm-metric-dots circle:nth-child(4) { animation-delay: 1.35s; }
.cfm-metric-dots circle:nth-child(5) { animation-delay: 1.65s; }

@keyframes cfmMetricRise {
    to { stroke-dashoffset: 0; }
}

@keyframes cfmMetricDot {
    0% { opacity: 0; transform: scale(.72); }
    100% { opacity: 1; transform: scale(1); }
}

.cfm-login-brand-top {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    margin-top: clamp(42px, 9vh, 110px);
}

.cfm-login-brand-logo-large {
    width: min(410px, 68%);
    max-width: 410px;
    position: relative;
}

.cfm-gramdi-login-logo-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 0 18px rgba(255,121,0,.05));
}

.cfm-login-brand-inner {
    width: min(520px, 100%);
    padding-bottom: 8px;
    position: relative;
    z-index: 2;
}

.cfm-brand-kicker,
.cfm-login-eyebrow,
.cfm-portal-kicker {
    display: block;
    margin: 0 0 8px;
    text-transform: uppercase !important;
    letter-spacing: .08em;
    font-size: 10px !important;
    line-height: 1.3 !important;
    font-weight: 500 !important;
}

.cfm-login-brand h1 {
    max-width: 520px;
    margin: 0;
    color: #F1F0E8 !important;
    font-size: clamp(28px, 2.9vw, 38px) !important;
    line-height: 1.08 !important;
    letter-spacing: -.035em;
    font-weight: 400 !important;
}

.cfm-login-brand p {
    max-width: 470px;
    margin: 20px 0 0;
    color: rgba(241,240,232,.70) !important;
    font-size: 12px !important;
    line-height: 1.65 !important;
    font-weight: 300 !important;
}

.cfm-login-panel {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 44px 48px;
}

.cfm-login-card {
    width: min(390px, 100%);
}

.cfm-login-logo {
    min-height: 40px;
    display: flex;
    align-items: center;
    margin-bottom: 34px;
}

.cfm-brand-logo-image {
    display: block;
    max-width: 132px;
    max-height: 52px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.cfm-brand-wordmark {
    color: var(--cfm-portal-green) !important;
    font-size: 15px !important;
    letter-spacing: .11em;
    font-weight: 500 !important;
}

.cfm-login-eyebrow {
    color: var(--cfm-portal-green-2) !important;
}

.cfm-login-card h2 {
    margin: 0;
    color: var(--cfm-portal-text) !important;
    font-size: 23px !important;
    line-height: 1.2 !important;
    letter-spacing: -.025em;
    font-weight: 500 !important;
}

.cfm-login-help {
    margin: 8px 0 24px;
    color: var(--cfm-portal-muted) !important;
    font-size: 11px !important;
    line-height: 1.55 !important;
    font-weight: 300 !important;
}

.cfm-login-alert {
    margin: 0 0 16px;
    padding: 10px 11px;
    border: 1px solid #E3C8C4;
    border-radius: 5px;
    background: #FBF4F3;
    color: #814A45 !important;
    font-size: 11px !important;
    font-weight: 400 !important;
}

.cfm-login-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cfm-login-form > label,
.cfm-password-label label {
    margin: 5px 0 0;
    color: var(--cfm-portal-text) !important;
    font-size: 11px !important;
    line-height: 1.4 !important;
    font-weight: 500 !important;
}

.cfm-login-form input[type="text"],
.cfm-login-form input[type="email"],
.cfm-login-form input[type="password"] {
    width: 100%;
    height: 43px;
    margin: 0;
    padding: 0 12px;
    border: 1px solid var(--cfm-portal-border) !important;
    border-radius: 5px !important;
    background: #fff !important;
    color: var(--cfm-portal-text) !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    box-shadow: none !important;
    outline: none;
    transition: border-color .2s ease;
}

.cfm-login-form input[type="text"]:focus,
.cfm-login-form input[type="email"]:focus,
.cfm-login-form input[type="password"]:focus {
    border-color: var(--cfm-portal-green-2) !important;
}

.cfm-password-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 6px;
}

.cfm-password-label a {
    color: var(--cfm-portal-green-2) !important;
    font-size: 10px !important;
    font-weight: 400 !important;
}

.cfm-remember {
    display: inline-flex !important;
    align-items: center;
    gap: 7px;
    margin: 6px 0 4px !important;
    color: var(--cfm-portal-muted) !important;
    font-size: 10px !important;
    font-weight: 400 !important;
}

.cfm-remember input {
    width: 14px;
    height: 14px;
    accent-color: var(--cfm-portal-green);
}

.cfm-register-hint {
    margin: 4px 0 0 !important;
    color: var(--cfm-portal-muted) !important;
    font-size: 10px !important;
    line-height: 1.5 !important;
    font-weight: 300 !important;
}

.cfm-login-note {
    margin: 0 0 14px;
    padding: 12px 13px;
    border: 1px solid var(--cfm-portal-border);
    border-radius: 5px;
    background: rgba(57,75,55,.035);
    color: var(--cfm-portal-muted) !important;
    font-size: 11px !important;
    line-height: 1.55 !important;
    font-weight: 300 !important;
}

.cfm-login-link-button {
    min-height: 43px;
    width: 100%;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--cfm-portal-green) !important;
    border-radius: 5px !important;
    background: var(--cfm-portal-green) !important;
    color: #F1F0E8 !important;
    font-size: 11px !important;
    line-height: 1 !important;
    font-weight: 500 !important;
    text-decoration: none !important;
}

.cfm-login-submit {
    width: 100%;
    min-height: 43px;
    margin-top: 6px;
    border: 1px solid var(--cfm-portal-green) !important;
    border-radius: 5px !important;
    background: var(--cfm-portal-green) !important;
    color: #F1F0E8 !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    cursor: pointer;
    box-shadow: none !important;
    transition: background .2s ease, border-color .2s ease;
}

.cfm-login-submit:hover,
.cfm-login-submit:focus {
    background: var(--cfm-portal-green-3) !important;
    border-color: var(--cfm-portal-green-3) !important;
}

.cfm-login-foot {
    margin: 22px 0 0;
    color: #98A194 !important;
    font-size: 9px !important;
    font-weight: 300 !important;
}

/* =========================================================
   DASHBOARD — ESTRUTURA
========================================================= */

.cfm-portal-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 214px minmax(0, 1fr);
    background: #F4F5F1;
    color: var(--cfm-portal-text);
}

.cfm-portal-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 26px 18px 18px;
    background: var(--cfm-portal-green);
    color: #F1F0E8;
}

.cfm-portal-brand {
    min-height: 50px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 7px;
    margin-bottom: 28px;
    padding: 0 8px;
}

.cfm-portal-brand .cfm-brand-logo-image {
    max-width: 116px;
    max-height: 40px;
    filter: brightness(0) invert(1);
    opacity: .95;
}

.cfm-portal-brand .cfm-brand-wordmark {
    color: #F1F0E8 !important;
    font-size: 12px !important;
}

.cfm-portal-brand > span:last-child {
    color: rgba(241,240,232,.56) !important;
    font-size: 8px !important;
    text-transform: uppercase !important;
    letter-spacing: .08em;
    font-weight: 400 !important;
}

.cfm-portal-nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cfm-portal-nav a {
    display: flex;
    align-items: center;
    min-height: 37px;
    padding: 0 10px;
    border-radius: 5px;
    color: rgba(241,240,232,.66) !important;
    font-size: 10px !important;
    font-weight: 400 !important;
    transition: background .2s ease, color .2s ease;
}

.cfm-portal-nav a:hover,
.cfm-portal-nav a.is-active {
    background: rgba(255,255,255,.08);
    color: #fff !important;
}

.cfm-portal-sidebar-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,.10);
}

.cfm-portal-sidebar-bottom a {
    padding: 7px 9px;
    color: rgba(241,240,232,.64) !important;
    font-size: 9px !important;
    font-weight: 400 !important;
}

.cfm-portal-sidebar-bottom a:hover {
    color: #fff !important;
}

.cfm-portal-main {
    min-width: 0;
    padding: 30px 34px 26px;
}

.cfm-portal-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
}

.cfm-portal-kicker {
    color: var(--cfm-portal-green-2) !important;
}

.cfm-portal-topbar h1 {
    margin: 0;
    color: var(--cfm-portal-text) !important;
    font-size: 22px !important;
    line-height: 1.2 !important;
    letter-spacing: -.025em;
    font-weight: 500 !important;
}

.cfm-portal-topbar p:not(.cfm-portal-kicker) {
    margin: 6px 0 0;
    color: var(--cfm-portal-muted) !important;
    font-size: 10px !important;
    line-height: 1.5 !important;
    font-weight: 300 !important;
}

.cfm-portal-top-actions {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

/* =========================================================
   BOTÕES DO PAINEL
   Isolamento forte contra Elementor / tema.
========================================================= */

.cfm-portal-page .cfm-portal-shell .cfm-btn,
.cfm-portal-page .cfm-portal-shell button.cfm-btn,
.cfm-portal-page .cfm-portal-shell input[type="submit"].cfm-btn {
    min-height: 34px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 11px !important;
    margin: 0 !important;
    border-width: 1px !important;
    border-style: solid !important;
    border-radius: 5px !important;
    box-shadow: none !important;
    text-shadow: none !important;
    text-decoration: none !important;
    font-size: 9px !important;
    line-height: 1 !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    cursor: pointer !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease !important;
}

.cfm-portal-page .cfm-portal-shell .cfm-btn-dark,
.cfm-portal-page .cfm-portal-shell button.cfm-btn-dark,
.cfm-portal-page .cfm-portal-shell .cfm-btn-dark:hover,
.cfm-portal-page .cfm-portal-shell .cfm-btn-dark:focus,
.cfm-portal-page .cfm-portal-shell .cfm-btn-dark:focus-visible,
.cfm-portal-page .cfm-portal-shell .cfm-btn-dark:active,
.cfm-portal-page .cfm-portal-shell .cfm-btn-dark:visited {
    border-color: var(--cfm-portal-green) !important;
    background: var(--cfm-portal-green) !important;
    background-color: var(--cfm-portal-green) !important;
    color: #F1F0E8 !important;
    -webkit-text-fill-color: #F1F0E8 !important;
    box-shadow: none !important;
    outline-color: var(--cfm-portal-green) !important;
}

.cfm-portal-page .cfm-portal-shell .cfm-btn-light,
.cfm-portal-page .cfm-portal-shell button.cfm-btn-light,
.cfm-portal-page .cfm-portal-shell .cfm-btn-light:hover,
.cfm-portal-page .cfm-portal-shell .cfm-btn-light:focus,
.cfm-portal-page .cfm-portal-shell .cfm-btn-light:focus-visible,
.cfm-portal-page .cfm-portal-shell .cfm-btn-light:active,
.cfm-portal-page .cfm-portal-shell .cfm-btn-light:visited {
    border-color: var(--cfm-portal-border) !important;
    background: #FFFFFF !important;
    background-color: #FFFFFF !important;
    color: var(--cfm-portal-green) !important;
    -webkit-text-fill-color: var(--cfm-portal-green) !important;
    box-shadow: none !important;
}

@media (hover: hover) {
    .cfm-portal-page .cfm-portal-shell .cfm-btn-dark:hover {
        filter: brightness(.94);
    }

    .cfm-portal-page .cfm-portal-shell .cfm-btn-light:hover {
        background: var(--cfm-portal-soft) !important;
        background-color: var(--cfm-portal-soft) !important;
    }
}

/* =========================================================
   FILTROS
========================================================= */

.cfm-portal-filter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
    padding: 9px 11px;
    border: 1px solid var(--cfm-portal-border);
    border-radius: 6px;
    background: #fff;
}

.cfm-portal-presets {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
}

.cfm-portal-presets a {
    padding: 6px 8px;
    border-radius: 4px;
    color: var(--cfm-portal-muted) !important;
    font-size: 9px !important;
    font-weight: 400 !important;
}

.cfm-portal-presets a:hover,
.cfm-portal-presets a.is-active {
    background: var(--cfm-portal-soft);
    color: var(--cfm-portal-green) !important;
}

.cfm-portal-date-form {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cfm-portal-date-form label {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--cfm-portal-muted) !important;
    font-size: 9px !important;
    font-weight: 400 !important;
}

.cfm-date-wrap {
    min-width: 122px;
    display: flex;
    align-items: center;
    border: 1px solid var(--cfm-portal-border);
    border-radius: 5px;
    padding: 5px 7px;
    background: #fff;
}

.cfm-date-wrap input[type="date"] {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0 !important;
    background: transparent !important;
    color: var(--cfm-portal-text) !important;
    font-size: 9px !important;
    font-weight: 400 !important;
    box-shadow: none !important;
    outline: none;
}

.cfm-portal-date-form button {
    min-height: 30px;
    padding: 0 9px;
    border: 1px solid var(--cfm-portal-green) !important;
    border-radius: 5px !important;
    background: var(--cfm-portal-green) !important;
    color: #fff !important;
    font-size: 9px !important;
    font-weight: 500 !important;
    cursor: pointer;
    box-shadow: none !important;
}

.cfm-section-anchor {
    scroll-margin-top: 20px;
}

/* =========================================================
   MÉTRICAS
========================================================= */

.cfm-portal-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.cfm-portal-metric-card {
    min-height: 112px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 15px;
    border: 1px solid var(--cfm-portal-border);
    border-radius: 6px;
    background: #fff;
}

.cfm-metric-label {
    color: var(--cfm-portal-muted) !important;
    font-size: 9px !important;
    line-height: 1.35 !important;
    font-weight: 400 !important;
}

.cfm-metric-value {
    display: block;
    margin: 8px 0 10px;
    color: var(--cfm-portal-text) !important;
    font-size: 24px !important;
    line-height: 1 !important;
    letter-spacing: -.03em;
    font-weight: 500 !important;
}

.cfm-metric-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--cfm-portal-muted) !important;
    font-size: 8px !important;
    line-height: 1.35 !important;
    font-weight: 300 !important;
}

.cfm-change {
    font-weight: 500 !important;
}

.cfm-change.is-positive { color: var(--cfm-portal-positive) !important; }
.cfm-change.is-negative { color: var(--cfm-portal-negative) !important; }
.cfm-change.is-neutral { color: var(--cfm-portal-muted) !important; }

/* =========================================================
   PAINÉIS
========================================================= */

.cfm-portal-panel {
    margin-bottom: 14px;
    padding: 17px;
    border: 1px solid var(--cfm-portal-border);
    border-radius: 6px;
    background: #fff;
}

.cfm-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 15px;
}

.cfm-panel-head h2 {
    margin: 0;
    color: var(--cfm-portal-text) !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
    font-weight: 500 !important;
    letter-spacing: -.01em;
}

.cfm-panel-head p {
    margin: 4px 0 0;
    color: var(--cfm-portal-muted) !important;
    font-size: 9px !important;
    line-height: 1.5 !important;
    font-weight: 300 !important;
}

.cfm-grid-2,
.cfm-grid-3 {
    display: grid;
    gap: 14px;
}

.cfm-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cfm-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.cfm-portal-chart-wrap {
    width: 100%;
    min-height: 252px;
}

.cfm-portal-chart-wrap canvas {
    display: block;
    width: 100%;
    height: 270px;
}

.cfm-portal-legend {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--cfm-portal-muted) !important;
    font-size: 8px !important;
    font-weight: 400 !important;
}

.cfm-portal-legend span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.cfm-legend-dot {
    width: 6px;
    height: 6px;
    display: inline-block;
    border-radius: 50%;
}

.cfm-legend-dot.is-view { background: var(--cfm-portal-green); }
.cfm-legend-dot.is-click { background: #9AA792; }

/* =========================================================
   RANKINGS
========================================================= */

.cfm-ranking-list {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.cfm-rank-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 5px;
    color: var(--cfm-portal-text) !important;
    font-size: 9px !important;
    font-weight: 400 !important;
}

.cfm-rank-line > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cfm-rank-line strong {
    flex: 0 0 auto;
    color: var(--cfm-portal-green) !important;
    font-size: 9px !important;
    font-weight: 500 !important;
}

.cfm-rank-line small {
    color: var(--cfm-portal-muted) !important;
    font-size: 8px !important;
    font-weight: 300 !important;
}

.cfm-progress {
    width: 100%;
    height: 4px;
    overflow: hidden;
    border-radius: 10px;
    background: #EEF0EB;
}

.cfm-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--cfm-portal-green-2);
}

/* =========================================================
   HORAS / DIAS DA SEMANA
========================================================= */

.cfm-hour-chart {
    height: 164px;
    display: grid;
    grid-template-columns: repeat(24, minmax(0, 1fr));
    gap: 3px;
    align-items: end;
    padding-top: 8px;
}

.cfm-hour-col {
    position: relative;
    height: 134px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    border-bottom: 1px solid var(--cfm-portal-border);
}

.cfm-hour-bar {
    width: 66%;
    min-height: 2px;
    border-radius: 2px 2px 0 0;
    background: var(--cfm-portal-green-2);
    opacity: .78;
}

.cfm-hour-col small {
    position: absolute;
    top: 140px;
    color: var(--cfm-portal-muted) !important;
    font-size: 7px !important;
    font-weight: 300 !important;
    white-space: nowrap;
}

.cfm-weekday-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}

.cfm-weekday-item {
    min-width: 0;
    padding: 9px 4px;
    border-radius: 5px;
    background: var(--cfm-portal-soft);
    text-align: center;
}

.cfm-weekday-item strong {
    display: block;
    margin-bottom: 5px;
    color: var(--cfm-portal-muted) !important;
    font-size: 8px !important;
    font-weight: 500 !important;
}

.cfm-weekday-item > span {
    display: block;
    margin-bottom: 7px;
    color: var(--cfm-portal-green) !important;
    font-size: 15px !important;
    font-weight: 500 !important;
}

/* =========================================================
   TABELA
========================================================= */

.cfm-portal-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.cfm-portal-table {
    width: 100%;
    border-collapse: collapse;
    border: 0;
}

.cfm-portal-table th,
.cfm-portal-table td {
    padding: 9px 8px;
    border-bottom: 1px solid #EDF0EA;
    text-align: left;
    white-space: nowrap;
}

.cfm-portal-table th {
    background: var(--cfm-portal-soft);
    color: var(--cfm-portal-muted) !important;
    font-size: 8px !important;
    font-weight: 500 !important;
}

.cfm-portal-table td {
    color: var(--cfm-portal-text) !important;
    font-size: 9px !important;
    font-weight: 400 !important;
}

.cfm-portal-empty {
    padding: 26px 14px;
    border-radius: 5px;
    background: var(--cfm-portal-soft);
    color: var(--cfm-portal-muted) !important;
    text-align: center;
    font-size: 9px !important;
    font-weight: 300 !important;
}

/* =========================================================
   CALENDÁRIO
========================================================= */

.cfm-calendar-head {
    align-items: center;
}

.cfm-calendar-nav {
    display: flex;
    align-items: center;
    gap: 7px;
}

.cfm-calendar-nav a {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--cfm-portal-border);
    border-radius: 5px;
    background: #fff;
    color: var(--cfm-portal-green) !important;
    font-size: 14px !important;
    font-weight: 400 !important;
}

.cfm-calendar-nav strong {
    min-width: 110px;
    color: var(--cfm-portal-green) !important;
    text-align: center;
    font-size: 9px !important;
    font-weight: 500 !important;
}

.cfm-calendar-weekdays,
.cfm-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px;
}

.cfm-calendar-weekdays {
    margin-bottom: 5px;
}

.cfm-calendar-weekdays span {
    padding: 4px;
    color: var(--cfm-portal-muted) !important;
    text-align: center;
    font-size: 8px !important;
    font-weight: 400 !important;
}

.cfm-calendar-empty {
    min-height: 76px;
}

.cfm-calendar-day {
    min-height: 76px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    border: 1px solid var(--cfm-portal-border);
    border-radius: 5px;
    background: #fff;
    color: var(--cfm-portal-text) !important;
    transition: border-color .2s ease, background .2s ease;
}

.cfm-calendar-day:hover {
    border-color: #AAB5A6;
    color: var(--cfm-portal-green) !important;
}

.cfm-calendar-day.is-today {
    border-color: var(--cfm-portal-green-2);
    background: #F6F7F3;
}

.cfm-calendar-day strong {
    font-size: 9px !important;
    font-weight: 500 !important;
}

.cfm-calendar-day span {
    margin-top: auto;
    color: var(--cfm-portal-green) !important;
    font-size: 8px !important;
    font-weight: 400 !important;
}

.cfm-calendar-day small {
    color: var(--cfm-portal-muted) !important;
    font-size: 7px !important;
    font-weight: 300 !important;
}

.cfm-portal-footer {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 9px 2px 0;
    color: #9AA397 !important;
    font-size: 8px !important;
    font-weight: 300 !important;
}

/* =========================================================
   RESPONSIVO
========================================================= */

@media (max-width: 1180px) {
    .cfm-portal-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cfm-grid-3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .cfm-login-shell {
        grid-template-columns: 1fr;
    }

    .cfm-login-brand {
        min-height: 250px;
        height: 250px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 20px 18px;
    }

    .cfm-login-brand-top {
        justify-content: center;
        margin: 0;
    }

    .cfm-login-brand-logo-large {
        width: min(235px, 58vw);
        max-width: 235px;
    }

    .cfm-login-brand-inner {
        display: none;
    }

    .cfm-login-metric-graphic {
        inset: -8% -7% -10% -12%;
        opacity: .92;
    }

    .cfm-metric-line {
        stroke-width: 2.6;
    }

    .cfm-metric-dots circle {
        r: 8px;
    }

    .cfm-login-panel {
        min-height: auto;
        padding: 34px 22px 46px;
    }

    .cfm-portal-shell {
        display: block;
    }

    .cfm-portal-sidebar {
        position: static;
        width: 100%;
        height: auto;
        display: block;
        padding: 14px 16px;
    }

    .cfm-portal-brand {
        min-height: 36px;
        margin: 0 0 10px;
        padding: 0;
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }

    .cfm-portal-nav {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .cfm-portal-nav a {
        flex: 0 0 auto;
        min-height: 32px;
        padding: 0 8px;
        font-size: 9px !important;
    }

    .cfm-portal-sidebar-bottom {
        display: none;
    }

    .cfm-portal-main {
        padding: 22px 16px;
    }

    .cfm-portal-filter,
    .cfm-portal-topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .cfm-grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .cfm-login-logo {
        margin-bottom: 26px;
    }

    .cfm-login-card h2 {
        font-size: 21px !important;
    }

    .cfm-portal-main {
        padding: 18px 11px 22px;
    }

    .cfm-portal-topbar h1 {
        font-size: 20px !important;
    }

    .cfm-portal-top-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .cfm-portal-filter {
        padding: 9px;
    }

    .cfm-portal-presets {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .cfm-portal-presets a {
        flex: 0 0 auto;
    }

    .cfm-portal-date-form {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }

    .cfm-portal-date-form label {
        min-width: 0;
        flex-direction: column;
        align-items: stretch;
    }

    .cfm-date-wrap {
        width: 100%;
        min-width: 0;
    }

    .cfm-portal-date-form button {
        grid-column: 1 / -1;
    }

    .cfm-portal-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }

    .cfm-portal-metric-card {
        min-height: 102px;
        padding: 12px;
    }

    .cfm-metric-value {
        font-size: 22px !important;
    }

    .cfm-metric-meta {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }

    .cfm-portal-panel {
        padding: 14px;
        margin-bottom: 9px;
    }

    .cfm-panel-head {
        margin-bottom: 12px;
    }

    .cfm-portal-legend {
        display: none;
    }

    .cfm-portal-chart-wrap,
    .cfm-portal-chart-wrap canvas {
        min-height: 215px;
        height: 215px;
    }

    .cfm-weekday-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .cfm-calendar-weekdays,
    .cfm-calendar-grid {
        gap: 3px;
    }

    .cfm-calendar-day {
        min-height: 58px;
        padding: 5px;
    }

    .cfm-calendar-day span,
    .cfm-calendar-day small {
        font-size: 6px !important;
    }

    .cfm-calendar-empty {
        min-height: 58px;
    }

    .cfm-calendar-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .cfm-portal-footer {
        flex-direction: column;
        gap: 4px;
    }
}

@media (max-width: 380px) {
    .cfm-portal-metrics {
        grid-template-columns: 1fr;
    }

    .cfm-portal-top-actions {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cfm-metric-line,
    .cfm-metric-dots circle {
        animation: none !important;
        opacity: 1;
        stroke-dashoffset: 0;
    }
}

/* =========================================================
   APARÊNCIA DO DASHBOARD — CONFIGURAÇÕES DO ESTABELECIMENTO
========================================================= */
.cfm-settings-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
}

.cfm-settings-head h1 {
    margin: 0 0 5px;
    color: var(--cfm-portal-text) !important;
    font-size: 22px !important;
    line-height: 1.2 !important;
    font-weight: 500 !important;
    letter-spacing: -.025em;
}

.cfm-settings-head p:not(.cfm-portal-kicker) {
    margin: 0;
    color: var(--cfm-portal-muted) !important;
    font-size: 11px !important;
    font-weight: 300 !important;
}

.cfm-settings-notice {
    margin: 0 0 16px;
    padding: 10px 12px;
    border: 1px solid var(--cfm-portal-border);
    border-radius: 5px;
    background: var(--cfm-portal-card);
    font-size: 11px !important;
}

.cfm-settings-notice.is-success {
    color: var(--cfm-portal-positive) !important;
}

.cfm-settings-panel,
.cfm-theme-preview {
    margin-bottom: 16px;
}

.cfm-color-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.cfm-color-field {
    display: block;
    padding: 14px;
    border: 1px solid var(--cfm-portal-border);
    border-radius: 5px;
    background: var(--cfm-portal-card);
}

.cfm-color-label {
    display: block;
    margin-bottom: 8px;
    color: var(--cfm-portal-text) !important;
    font-size: 11px !important;
    font-weight: 500 !important;
}

.cfm-color-control {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
}

.cfm-color-control input[type="color"] {
    width: 42px !important;
    height: 36px !important;
    padding: 2px !important;
    border: 1px solid var(--cfm-portal-border) !important;
    border-radius: 4px !important;
    background: var(--cfm-portal-card) !important;
    cursor: pointer;
}

.cfm-color-control input[type="text"] {
    width: 100%;
    height: 36px;
    padding: 0 10px !important;
    border: 1px solid var(--cfm-portal-border) !important;
    border-radius: 4px !important;
    background: var(--cfm-portal-card) !important;
    color: var(--cfm-portal-text) !important;
    font-size: 11px !important;
    font-weight: 400 !important;
    text-transform: uppercase !important;
    box-shadow: none !important;
    outline: none !important;
}

.cfm-color-field small {
    display: block;
    margin-top: 8px;
    color: var(--cfm-portal-muted) !important;
    font-size: 9px !important;
    line-height: 1.45 !important;
    font-weight: 300 !important;
}

.cfm-settings-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.cfm-preview-shell {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    min-height: 260px;
    overflow: hidden;
    border: 1px solid var(--cfm-portal-border);
    border-radius: 6px;
    background: var(--cfm-portal-cream);
}

.cfm-preview-sidebar {
    padding: 18px 12px;
    background: var(--cfm-portal-green);
    color: #fff;
}

.cfm-preview-sidebar span {
    display: block;
    margin-bottom: 6px;
    padding: 7px 8px;
    border-radius: 4px;
    color: rgba(255,255,255,.72) !important;
    font-size: 9px !important;
}

.cfm-preview-sidebar .cfm-preview-logo {
    margin-bottom: 20px;
    padding: 0 8px;
    color: #fff !important;
    font-size: 11px !important;
    font-weight: 500 !important;
}

.cfm-preview-sidebar span.is-active {
    background: rgba(255,255,255,.12);
    color: #fff !important;
}

.cfm-preview-main {
    padding: 22px;
    background: var(--cfm-portal-cream);
}

.cfm-preview-title {
    margin-bottom: 16px;
    color: var(--cfm-portal-text) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
}

.cfm-preview-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.cfm-preview-cards > div {
    padding: 12px;
    border: 1px solid var(--cfm-portal-border);
    border-radius: 5px;
    background: var(--cfm-portal-card);
}

.cfm-preview-cards small {
    display: block;
    margin-bottom: 7px;
    color: var(--cfm-portal-muted) !important;
    font-size: 8px !important;
}

.cfm-preview-cards strong {
    color: var(--cfm-portal-text) !important;
    font-size: 16px !important;
    font-weight: 500 !important;
}

.cfm-preview-chart {
    height: 84px;
    display: flex;
    align-items: flex-end;
    gap: 7px;
    margin-top: 14px;
    padding: 12px;
    border: 1px solid var(--cfm-portal-border);
    border-radius: 5px;
    background: var(--cfm-portal-card);
}

.cfm-preview-chart i {
    width: 16px;
    height: 32%;
    display: block;
    border-radius: 3px 3px 0 0;
    background: var(--cfm-portal-green-2);
    opacity: .68;
}
.cfm-preview-chart i:nth-child(2) { height: 48%; }
.cfm-preview-chart i:nth-child(3) { height: 42%; }
.cfm-preview-chart i:nth-child(4) { height: 70%; }
.cfm-preview-chart i:nth-child(5) { height: 88%; background: var(--cfm-portal-green); opacity: 1; }

@media (max-width: 760px) {
    .cfm-settings-head {
        flex-direction: column;
        align-items: stretch;
    }
    .cfm-color-grid {
        grid-template-columns: 1fr;
    }
    .cfm-preview-shell {
        grid-template-columns: 92px minmax(0, 1fr);
    }
    .cfm-preview-main {
        padding: 14px;
    }
    .cfm-preview-cards {
        grid-template-columns: 1fr;
    }
    .cfm-settings-actions {
        align-items: stretch;
        flex-direction: column;
    }
}


/* =========================================================
   ESTABELECIMENTO — CONFIGURAÇÃO POR INSTALAÇÃO
========================================================= */
.cfm-establishment-page {
    width: 100%;
}

.cfm-establishment-form {
    width: 100%;
}

.cfm-establishment-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.cfm-establishment-field {
    display: block;
    padding: 14px;
    border: 1px solid var(--cfm-portal-border);
    border-radius: 5px;
    background: var(--cfm-portal-card);
}

.cfm-establishment-field--wide {
    grid-column: 1 / -1;
}

.cfm-establishment-field > span {
    display: block;
    margin-bottom: 8px;
    color: var(--cfm-portal-text) !important;
    font-size: 11px !important;
    line-height: 1.3 !important;
    font-weight: 500 !important;
}

.cfm-establishment-field input[type="text"],
.cfm-establishment-field input[type="url"] {
    width: 100% !important;
    min-height: 38px !important;
    margin: 0 !important;
    padding: 0 11px !important;
    border: 1px solid var(--cfm-portal-border) !important;
    border-radius: 4px !important;
    background: var(--cfm-portal-card) !important;
    color: var(--cfm-portal-text) !important;
    -webkit-text-fill-color: var(--cfm-portal-text) !important;
    box-shadow: none !important;
    outline: none !important;
    font-family: var(--cfm-font, "Inter", sans-serif) !important;
    font-size: 11px !important;
    font-weight: 400 !important;
    box-sizing: border-box !important;
}

.cfm-establishment-field input[type="text"]:focus,
.cfm-establishment-field input[type="url"]:focus {
    border-color: var(--cfm-portal-green-2) !important;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--cfm-portal-green-2) 12%, transparent) !important;
}

.cfm-establishment-field small {
    display: block;
    margin-top: 8px;
    color: var(--cfm-portal-muted) !important;
    font-size: 9px !important;
    line-height: 1.45 !important;
    font-weight: 300 !important;
}

.cfm-shortcode-note {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 14px;
    padding: 11px 12px;
    border: 1px solid var(--cfm-portal-border);
    border-radius: 5px;
    background: var(--cfm-portal-soft);
    color: var(--cfm-portal-muted) !important;
    font-size: 10px !important;
    line-height: 1.4 !important;
}

.cfm-shortcode-note strong {
    color: var(--cfm-portal-text) !important;
    font-weight: 500 !important;
}

.cfm-shortcode-note code {
    padding: 3px 6px;
    border-radius: 3px;
    background: var(--cfm-portal-card);
    color: var(--cfm-portal-green) !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
    font-size: 10px !important;
}

@media (max-width: 760px) {
    .cfm-establishment-grid {
        grid-template-columns: 1fr;
    }

    .cfm-establishment-field--wide {
        grid-column: auto;
    }
}
