/* M8 Services Dashboard */
.m8sd,
.m8sd * {
    box-sizing: border-box;
}

.m8sd {
    --m8-red: #e34332;
    --m8-red-dark: #c93427;
    --m8-text: #151515;
    --m8-muted: #667085;
    --m8-line: #eceff3;
    --m8-bg: #f6f7f9;
    --m8-card: #ffffff;
    --m8-radius: 28px;
    font-family: inherit;
    background:
        radial-gradient(circle at 15% 0%, rgba(227,67,50,.10), transparent 32%),
        radial-gradient(circle at 88% 12%, rgba(227,67,50,.08), transparent 28%),
        var(--m8-bg);
    padding: 48px 16px 56px;
    color: var(--m8-text);
}

.m8sd__inner {
    width: min(1180px, 100%);
    margin: 0 auto;
}

.m8sd__hero {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: end;
    margin-bottom: 26px;
}

.m8sd__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(227,67,50,.10);
    color: var(--m8-red);
    font-size: 14px;
    font-weight: 800;
}

.m8sd__title {
    margin: 0;
    color: var(--m8-text);
    font-size: clamp(34px, 4.5vw, 62px);
    line-height: 1.02;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.m8sd__subtitle {
    max-width: 680px;
    margin: 16px 0 0;
    color: var(--m8-muted);
    font-size: 18px;
    line-height: 1.55;
}

.m8sd__hero-card {
    width: 280px;
    padding: 20px;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .08);
    border: 1px solid rgba(227,67,50,.12);
}

.m8sd__hero-card strong {
    display: block;
    margin-bottom: 6px;
    font-size: 16px;
}

.m8sd__hero-card span {
    color: var(--m8-muted);
    font-size: 14px;
    line-height: 1.5;
}

.m8sd__switch-wrap {
    position: sticky;
    top: 0;
    z-index: 20;
    margin: 0 -16px 34px;
    padding: 10px 16px;
    background: rgba(246,247,249,.85);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(227,67,50,.08);
}

.admin-bar .m8sd__switch-wrap {
    top: 32px;
}

.m8sd__switch {
    width: min(1180px, 100%);
    margin: 0 auto;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
}

.m8sd__switch::-webkit-scrollbar {
    display: none;
}

.m8sd__level-btn {
    appearance: none;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #1f2937;
    border-radius: 999px;
    padding: 12px 18px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    transition: all .2s ease;
    box-shadow: 0 8px 22px rgba(15,23,42,.04);
}

.m8sd__level-btn:hover {
    border-color: rgba(227,67,50,.5);
    color: var(--m8-red);
    transform: translateY(-1px);
}

.m8sd__level-btn.is-active {
    background: var(--m8-red);
    border-color: var(--m8-red);
    color: #fff;
    box-shadow: 0 14px 30px rgba(227,67,50,.28);
}

.m8sd__featured {
    margin-bottom: 34px;
}

.m8sd__section-head {
    margin: 0 0 16px;
}

.m8sd__section-head h2 {
    margin: 0;
    color: var(--m8-text);
    font-size: 26px;
    line-height: 1.2;
    font-weight: 900;
    letter-spacing: -.02em;
}

.m8sd__section-head p {
    margin: 6px 0 0;
    color: var(--m8-muted);
    font-size: 15px;
}

.m8sd__categories {
    display: grid;
    gap: 34px;
}

.m8sd__category.is-empty,
.m8sd__featured.is-empty {
    display: none;
}

.m8sd__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

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

.m8sd__card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 286px;
    padding: 24px;
    border-radius: var(--m8-radius);
    background: var(--m8-card);
    border: 1px solid var(--m8-line);
    box-shadow: 0 10px 34px rgba(15,23,42,.06);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
    overflow: hidden;
}

.m8sd__card::after {
    content: "";
    position: absolute;
    inset: auto -30px -50px auto;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(227,67,50,.08);
    transition: transform .2s ease, opacity .2s ease;
}

.m8sd__card:hover {
    transform: translateY(-5px);
    border-color: rgba(227,67,50,.38);
    box-shadow: 0 22px 55px rgba(15,23,42,.12);
}

.m8sd__card:hover::after {
    transform: scale(1.18);
    opacity: .8;
}

.m8sd__card[hidden] {
    display: none !important;
}

.m8sd__card-top {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.m8sd__icon {
    display: grid;
    place-items: center;
    width: 60px;
    height: 60px;
    flex: 0 0 60px;
    border-radius: 20px;
    background: rgba(227,67,50,.10);
    color: var(--m8-red);
}

.m8sd__icon svg {
    width: 32px;
    height: 32px;
    fill: currentColor;
}

.m8sd__badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.m8sd__level,
.m8sd__badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 800;
}

.m8sd__level {
    background: #f3f4f6;
    color: #475467;
}

.m8sd__badge {
    background: rgba(227,67,50,.10);
    color: var(--m8-red);
}

.m8sd__card h3 {
    position: relative;
    z-index: 1;
    margin: 0;
    color: var(--m8-text);
    font-size: 22px;
    line-height: 1.15;
    font-weight: 900;
    letter-spacing: -.02em;
}

.m8sd__card p {
    position: relative;
    z-index: 1;
    margin: 12px 0 0;
    color: var(--m8-muted);
    font-size: 15px;
    line-height: 1.55;
}

.m8sd__link {
    position: relative;
    z-index: 1;
    margin-top: auto;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: fit-content;
    padding: 11px 16px;
    border-radius: 14px;
    background: var(--m8-red);
    color: #fff !important;
    text-decoration: none !important;
    font-size: 15px;
    font-weight: 900;
    transition: background .2s ease, transform .2s ease;
}

.m8sd__link:hover {
    background: var(--m8-red-dark);
    transform: translateX(2px);
}

.m8sd__cta {
    margin-top: 42px;
    padding: 28px;
    border-radius: 28px;
    background: #111;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.m8sd__cta h2 {
    margin: 0;
    font-size: 26px;
    font-weight: 900;
}

.m8sd__cta p {
    margin: 6px 0 0;
    color: rgba(255,255,255,.72);
}

.m8sd__cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 190px;
    padding: 13px 18px;
    border-radius: 16px;
    background: var(--m8-red);
    color: #fff !important;
    font-weight: 900;
    text-decoration: none !important;
}

.m8sd__empty {
    padding: 40px;
    border-radius: 28px;
    background: #fff;
    border: 1px dashed rgba(227,67,50,.4);
}

@media (max-width: 1100px) {
    .m8sd__grid,
    .m8sd__grid--featured {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .m8sd__hero {
        grid-template-columns: 1fr;
    }

    .m8sd__hero-card {
        width: 100%;
    }
}

@media (max-width: 700px) {
    .m8sd {
        padding: 34px 14px 42px;
    }

    .admin-bar .m8sd__switch-wrap {
        top: 46px;
    }

    .m8sd__subtitle {
        font-size: 16px;
    }

    .m8sd__grid,
    .m8sd__grid--featured {
        grid-template-columns: 1fr;
    }

    .m8sd__card {
        min-height: 250px;
        padding: 22px;
    }

    .m8sd__switch-wrap {
        margin-left: -14px;
        margin-right: -14px;
        padding-left: 14px;
        padding-right: 14px;
    }

    .m8sd__level-btn {
        padding: 11px 15px;
        font-size: 14px;
    }

    .m8sd__cta {
        align-items: stretch;
        flex-direction: column;
    }

    .m8sd__cta-btn,
    .m8sd__link {
        width: 100%;
    }
}
