/**
 * MCF Dashboard — base styles + App Shell (sidebar nav + section router).
 *
 * Tokens mirror the live Uncode palette (Theme Options → Colors):
 *   navy/dark #0f3d1f = color-725309   accent green #48833a = color-123737
 *   line  #eaeaea = color-gyho         muted #777777 = color-wvjs
 * Single RML template: accent fixed via .mcf-svc-member.
 * Namespaced (.mcf-*) so it won't collide with the theme; Louise can still
 * restyle the shell columns freely in WPBakery.
 */

/* Role-gated UI: add the "mcf-hide-staff" Extra class name to any WPBakery
   element to hide it from Staff members (body.mcf-is-staff is set in PHP).
   Owners / Head Office are never tagged, so they always see it. */
body.mcf-is-staff .btn-container:has(.mcf-hide-staff) {
    display: none !important;
}

/* Permission-notice toast — shown by mcf-staff-guard.js when a Staff member
   clicks an element tagged `mcf-lock-staff` (button stays visible, action is
   blocked). Appended to <body>, outside .mcf-dash, so it carries literal brand
   values rather than the --mcf-* tokens. */
.mcf-toast {
    position: fixed;
    left: 50%;
    top: 80px;
    z-index: 100000;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: auto;
    max-width: min(92vw, 440px);
    margin: 0;
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid #eaeaea;
    border-left: 4px solid #48833a; /* accent green */
    border-radius: 10px;
    box-shadow: 0 12px 34px rgba(15, 61, 31, .18);
    opacity: 0;
    transform: translateX(-50%) translateY(-14px); /* slides down into view */
    pointer-events: none;
    transition: opacity .22s ease, transform .22s ease;
}
.mcf-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}
.mcf-toast-ic {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    margin-top: 1px;
    color: #48833a;
}
.mcf-toast-ic svg { display: block; width: 22px; height: 22px; }
.mcf-toast-body { flex: 1 1 auto; min-width: 0; }
.mcf-toast-title {
    margin: 0 0 2px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    color: #0f3d1f; /* dark green */
}
.mcf-toast-msg {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.45;
    color: #5a6472;
}
.mcf-toast-close {
    flex: 0 0 auto;
    -webkit-appearance: none;
    appearance: none;
    margin: -2px -4px 0 0;
    padding: 0 4px;
    background: transparent;
    border: 0;
    font-size: 20px;
    line-height: 1;
    color: #9aa2ad;
    cursor: pointer;
    transition: color .15s ease;
}
.mcf-toast-close:hover,
.mcf-toast-close:focus { color: #0f3d1f; outline: none; }

@media (prefers-reduced-motion: reduce) {
    .mcf-toast { transition: opacity .12s ease; transform: translateX(-50%); }
    .mcf-toast.is-visible { transform: translateX(-50%); }
}

.mcf-dash,
.mcf-dashboard-home {
    --mcf-navy: #0f3d1f;
    --mcf-navy-2: #4a8a5c;
    --mcf-accent: #48833a;
    --mcf-accent-600: #356b2a;
    --mcf-ink: #1b2330;
    --mcf-muted: #777777;
    --mcf-line: #eaeaea;
    --mcf-bg: #ffffff;
    --mcf-bg-soft: #f7f7f7;
}

/* Per-service accent (the section router adds .mcf-svc-{service}). */
.mcf-dash.mcf-svc-member { --mcf-accent: #48833a; --mcf-accent-600: #356b2a; --mcf-accent-050: #eef3ea; }

/* ── Sidebar navigation ───────────────────────────────────────────────── */
.mcf-dash-nav { font-size: 15px; }
.mcf-dash-nav-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
/* Kill the theme's <li> bullets/indent inside the Text element wrapper. */
.mcf-dash-nav-list > li.mcf-dash-nav-item {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    text-indent: 0 !important;
    background: none;
}
.mcf-dash-nav-list > li.mcf-dash-nav-item::before,
.mcf-dash-nav-list > li.mcf-dash-nav-item::marker {
    content: none !important;
    display: none !important;
}
.mcf-dash-nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 14px;
    border-left: 3px solid transparent;
    border-radius: 0;
    color: var(--mcf-ink);
    text-decoration: none;
    line-height: 1.2;
    transition: background .14s ease, color .14s ease;
}
.mcf-dash-nav-link:hover,
.mcf-dash-nav-link:focus {
    background: var(--mcf-bg-soft);
    color: var(--mcf-navy);
}
.mcf-dash-nav-ic {
    color: var(--mcf-muted);
    font-size: 20px;
    width: 22px;
    height: 22px;
}
.mcf-dash-nav-item.is-active .mcf-dash-nav-link {
    background: #eef3ea; /* fallback for no color-mix */
    background: color-mix(in srgb, var(--mcf-accent) 12%, transparent);
    border-left-color: var(--mcf-accent);
    color: var(--mcf-navy);
    font-weight: 600;
}
.mcf-dash-nav-item.is-active .mcf-dash-nav-ic { color: var(--mcf-accent); }
.mcf-dash-nav-logout {
    margin-top: 8px;
    border-top: 1px solid var(--mcf-line);
    padding-top: 8px;
}
.mcf-dash-nav-logout .mcf-dash-nav-link { color: var(--mcf-muted); }

/* Sidebar → scrollable top tab-bar when WPBakery stacks the columns. */
@media (max-width: 782px) {
    .mcf-dash-nav-list {
        flex-direction: row;
        overflow-x: auto;
        gap: 4px;
        -webkit-overflow-scrolling: touch;
    }
    .mcf-dash-nav-link {
        border-left: 0;
        border-bottom: 3px solid transparent;
        white-space: nowrap;
        border-radius: 6px 6px 0 0;
    }
    .mcf-dash-nav-item.is-active .mcf-dash-nav-link {
        border-left: 0;
        border-bottom-color: var(--mcf-accent);
    }
    .mcf-dash-nav-logout {
        margin-top: 0;
        padding-top: 0;
        padding-left: 8px;
        border-top: 0;
        border-left: 1px solid var(--mcf-line);
    }
}

/* ── Slim breadcrumb header for editor pages ([mcf_dashboard_header]) ──── */
.mcf-page-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    position: relative;
    margin: 0 0 24px;
    padding: 0 0 12px;
    border-bottom: 1px solid var(--mcf-line);
    font-size: 14px;
}
.mcf-page-header::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 54px;
    height: 3px;
    background: var(--mcf-accent);
}
.mcf-page-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--mcf-accent);
    font-weight: 600;
    text-decoration: none;
}
.mcf-page-back:hover { color: var(--mcf-accent-600); }
.mcf-page-back .dashicons { font-size: 18px; width: 18px; height: 18px; }
.mcf-page-sep { color: var(--mcf-muted); }
.mcf-page-current { color: var(--mcf-navy); font-weight: 600; }

/* ── Section router wrapper + link-source button ──────────────────────── */
.mcf-dash-section { color: var(--mcf-ink); }
.mcf-dash .mcf-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--mcf-accent);
    color: #fff;
    border: 0;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s ease;
}
.mcf-dash .mcf-btn:hover { background: var(--mcf-accent-600); color: #fff; }

/* ── Home (greeting + quick cards) ────────────────────────────────────── */
.mcf-dashboard-home { max-width: 1100px; margin: 0 auto; }

.mcf-banner { padding: 28px 0 8px; }
.mcf-banner-title {
    margin: 0 0 6px;
    font-size: 1.8rem;
    color: var(--mcf-navy);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.mcf-role-pill {
    font-size: .8rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    background: #eef2ea;
    color: var(--mcf-navy);
}
.mcf-banner-subtitle { margin: 0 0 18px; color: var(--mcf-muted); }

.mcf-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin: 18px 0;
}

.mcf-card,
.mcf-quick-card {
    display: block;
    padding: 20px;
    border: 1px solid var(--mcf-line);
    border-radius: 10px;
    background: var(--mcf-bg);
    text-decoration: none;
    color: inherit;
    transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}
.mcf-quick-card:hover {
    box-shadow: 0 6px 18px rgba(0, 46, 98, .10);
    transform: translateY(-1px);
    border-color: var(--mcf-accent);
}
.mcf-quick-card { display: flex; flex-direction: column; gap: 8px; }
.mcf-quick-ic { color: var(--mcf-accent); font-size: 24px; width: 24px; height: 24px; }
.mcf-quick-title { font-weight: 600; color: var(--mcf-navy); }

.mcf-card h3 { margin: 0 0 8px; font-size: 1.1rem; color: var(--mcf-navy); }
.mcf-card p  { margin: 0; color: var(--mcf-muted); }

.mcf-notice {
    background: #fff8e6;
    border-color: #f0e2b8;
}

.mcf-placeholder { border-style: dashed; }

.mcf-coming-soon {
    display: inline-block;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #fff;
    background: var(--mcf-navy);
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 12px;
}
.mcf-ai-card { background: var(--mcf-bg-soft); }
