/* Magoods Ultimate - Cyber Theme Overrides (React Match) */

/* 1. Global Backgrounds & Reset */
:root {
    --cyber-bg: #000912;
    --cyber-card: rgba(0, 35, 55, 0.6);
    --cyber-glass: rgba(0, 35, 55, 0.38);
    --cyber-border: rgba(0, 168, 232, 0.35);
    --cyber-text: #e6f6ff;
    --cyber-primary: #00a8e8;
}

/* 1.1 Kill All White Backgrounds */
* {
    -webkit-font-smoothing: antialiased;
}

/* Fix Chrome Autofill White Background */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #00171f inset !important;
    -webkit-text-fill-color: #fff !important;
    transition: background-color 5000s ease-in-out 0s;
}

select option {
    background-color: #00171f !important;
    color: white !important;
}

/* 1.2 Fix Blurry Icons & Buttons */
i,
svg,
.fab,
.fas,
.far,
.btn i {
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Remove weird blue overlay/blur from ALL buttons */
.btn,
button,
.btn-glass,
.btn-primary-glow {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Specific Discord & Social Button Fixes */
.btn-facebook,
.btn-google,
.btn-twitter,
.btn-discord,
.btn-social {
    background-image: none !important;
    box-shadow: none !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
}

.btn-discord {
    background-color: #5865F2 !important;
    /* Official Discord Blurple */
}

.btn-google {
    background-color: #DB4437 !important;
}

.btn-social:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* 1.3 Header Login Button Clean Up */
.btn-glass {
    background: transparent !important;
    border: 1px solid var(--cyber-primary) !important;
    color: var(--cyber-primary) !important;
    box-shadow: none !important;
}

.btn-glass:hover {
    background: var(--cyber-primary) !important;
    color: #000 !important;
}

/* 1.1 Breadcrumb Override */
.breadcrumb,
.master-breadcrumb {
    background-color: transparent !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    margin-bottom: 0 !important;
}

.breadcrumb-item a {
    color: var(--cyber-primary) !important;
    text-shadow: 0 0 5px rgba(0, 168, 232, 0.4);
}

.breadcrumb-item.active {
    color: #fff !important;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.4);
}

.breadcrumb-item+.breadcrumb-item::before {
    color: var(--cyber-border) !important;
}

body,
html {
    background-color: var(--cyber-bg) !important;
    background: var(--cyber-bg) !important;
    color: var(--cyber-text) !important;
}

/* Safety Fix: Prevent Background Canvas from Blocking Clicks */
.topo-canvas,
#topoCanvas {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none !important;
    z-index: 0 !important;
}

/* 2. Override White Backgrounds (Bootstrap/Legacy) */
.card,
.panel,
.well,
.bg-white,
.main-content,
.home-shortcuts,
.tiles .tile {
    background-color: var(--cyber-card) !important;
    background: var(--cyber-glass) !important;
    backdrop-filter: blur(10px) saturate(160%);
    -webkit-backdrop-filter: blur(10px) saturate(160%);
    border: 1px solid var(--cyber-border) !important;
    color: var(--cyber-text) !important;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

/* NO GLASS on unified list pages — panels inside .mg-page use their own solid dark gradients */
.mg-page .panel {
    background-color: transparent !important;
    background: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* 3. Tables & Lists */
.table,
.table-striped,
.list-group-item {
    background-color: transparent !important;
    color: var(--cyber-text) !important;
}

.table th,
.table td,
.list-group-item {
    border-color: var(--cyber-border) !important;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 168, 232, 0.05) !important;
}

/* 4. Form Controls */
.form-control,
input,
select,
textarea {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--cyber-border) !important;
    color: #fff !important;
    backdrop-filter: blur(10px);
}

.form-control:focus {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-color: var(--cyber-primary) !important;
    box-shadow: 0 0 10px rgba(0, 168, 232, 0.2) !important;
    color: #fff !important;
}

/* 5. Modals */
.modal-content {
    background-color: #00121b !important;
    border: 1px solid var(--cyber-primary) !important;
}

.modal-header,
.modal-footer {
    border-color: var(--cyber-border) !important;
}

.close {
    color: #fff !important;
    text-shadow: none !important;
    opacity: 0.8 !important;
}

/* 6. Navbar/Header Overrides */
.navbar,
.header,
.topbar {
    background-color: rgba(3, 43, 67, 0.95) !important;
    border-bottom: 1px solid var(--cyber-border) !important;
}

/* 7. Footer */
.footer,
#footer {
    background-color: #000c14 !important;
    border-top: 1px solid var(--cyber-border) !important;
}

/* 8. Text Colors */
h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
    color: #fff !important;
    font-family: 'Orbitron', sans-serif !important;
}

/* 8. Text Links (Safe Scope) - Match React: White default, Blue hover */
a:not(.btn):not(.nav-link):not(.dropdown-item):not(.badge):not(.label) {
    color: #ffffff !important;
    transition: all 0.3s ease;
    text-decoration: none !important;
}

/* 9. Alerts — handled by custom_alerts.css (loaded later) */

/* 10. Specific Legacy Overrides */
#main-body {
    background: transparent !important;
}

section#header {
    background: transparent !important;
}

.client-home-panels .panel-title {
    color: #fff !important;
}

.tile {
    background: rgba(0, 168, 232, 0.1) !important;
}

/* 11. Custom Sidebar Overrides */
/* Fix Alignment */
.sidebar {
    /* Visual alignment fix per user adjustment */
    position: relative !important;
    z-index: 10 !important;
    /* Ensure it's above background canvas */
}

/* Fix Active State Visibility */
.mg-sidebar-nav__item.active {
    background: linear-gradient(90deg, rgba(0, 168, 232, 0.5), rgba(0, 52, 89, 0.7)) !important;
    border-left: 4px solid var(--cyber-primary) !important;
    color: #ffffff !important;
    box-shadow: inset 0 0 20px rgba(0, 168, 232, 0.2) !important;
    font-weight: 700 !important;
}

.mg-sidebar-nav__item.active i {
    color: #00c9ff !important;
    text-shadow: 0 0 10px #00c9ff !important;
}

/* FORCE ICON TO CHECKED STATE WHEN ACTIVE - Fix for 'it doesnt get active' */
.mg-sidebar-nav__item.active i.fa-circle::before,
.mg-sidebar-nav__item.active i.fa-circle-o::before {
    content: "\f058" !important;
    /* fa-check-circle */
    font-family: "Font Awesome 5 Free" !important;
    font-weight: 900 !important;
    color: #00d26a !important;
    /* Green checkmark or neon blue */
    text-shadow: 0 0 10px rgba(0, 210, 106, 0.6) !important;
}

/* Ensure disabled items are still clickable if needed (fix for 'nothing happens') */
.mg-sidebar-nav__item.disabled {
    pointer-events: auto !important;
    cursor: pointer !important;
    opacity: 0.7 !important;
}

.card-sidebar {
    background: rgba(0, 35, 55, 0.4) !important;
    border: 1px solid var(--cyber-border) !important;
    backdrop-filter: blur(10px);
}

.card-sidebar .card-header {
    background: rgba(0, 168, 232, 0.1) !important;
    border-bottom: 1px solid var(--cyber-border) !important;
    color: #fff !important;
}

.card-sidebar .list-group-item {
    background: transparent !important;
    color: rgba(255, 255, 255, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.card-sidebar .list-group-item:hover {
    background: rgba(0, 168, 232, 0.1) !important;
    color: #fff !important;
}

/* 12. DataTables & Pagination */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid var(--cyber-border) !important;
    color: #fff !important;
}

.pagination .page-item .page-link {
    background: rgba(0, 35, 55, 0.6) !important;
    border-color: var(--cyber-border) !important;
    color: #fff !important;
}

.pagination .page-item.active .page-link {
    background: var(--cyber-primary) !important;
    border-color: var(--cyber-primary) !important;
    box-shadow: 0 0 10px rgba(0, 168, 232, 0.5);
}

.pagination .page-item.disabled .page-link {
    background: rgba(0, 0, 0, 0.2) !important;
    opacity: 0.5;
}

/* 13. Badges & Labels */
.badge,
.label {
    background: rgba(0, 168, 232, 0.2) !important;
    border: 1px solid var(--cyber-primary) !important;
    color: #fff !important;
    text-shadow: 0 0 5px var(--cyber-primary);
}

.badge-success,
.label-success {
    background: rgba(0, 210, 106, 0.2) !important;
    border-color: #00d26a !important;
    color: #00d26a !important;
    text-shadow: 0 0 5px #00d26a;
}

.badge-warning,
.label-warning {
    background: rgba(255, 145, 0, 0.2) !important;
    border-color: #ff9100 !important;
    color: #ff9100 !important;
    text-shadow: 0 0 5px #ff9100;
}

.badge-danger,
.label-danger {
    background: rgba(255, 79, 79, 0.2) !important;
    border-color: #ff4f4f !important;
    color: #ff4f4f !important;
    text-shadow: 0 0 5px #ff4f4f;
}

/* 14. Markdown & KB Content */
.kb-article-content {
    color: #e6f6ff !important;
    line-height: 1.7;
}

/* 15. Dropdown Menus */
.dropdown-menu {
    background: rgba(0, 9, 18, 0.95) !important;
    border: 1px solid var(--cyber-border) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8) !important;
}

.dropdown-item {
    color: #e6f6ff !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: rgba(0, 168, 232, 0.15) !important;
    color: #fff !important;
}

/* 16. Primary Buttons Glow */
.btn-primary {
    background: linear-gradient(135deg, #007ea7, #00a8e8) !important;
    border: none !important;
    box-shadow: 0 0 15px rgba(0, 168, 232, 0.4) !important;
    color: #fff !important;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    box-shadow: 0 0 25px rgba(0, 168, 232, 0.6) !important;
    transform: translateY(-2px);
}

/* 17. Scrollbar Styling (Matches Site Theme) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 23, 31, 1);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 168, 232, 0.4);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 168, 232, 0.7);
}

/* Specific fix for dropdowns */
.scrollable-menu::-webkit-scrollbar {
    width: 6px;
}

.scrollable-menu::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

/* Fix corrupted scrollbar thumb selector */
.scrollable-menu::-webkit-scrollbar-thumb {
    background: rgba(0, 168, 232, 0.5);
    border-radius: 3px;
}

/* 18. RTL & Icon Fixes */
/* Force FontAwesome for icons to prevent squares in RTL - HIGH SPECIFICITY */
/* Remove blur from inputs to fix visual glitches */
.form-control,
input,
select,
textarea {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* RTL Specific Overrides (Arabic, etc) */
html[lang="ar"] .input-icon,
body[dir="rtl"] .input-icon {
    left: auto !important;
    right: 16px !important;
}

html[lang="ar"] input.field.form-control,
html[lang="ar"] select.field.form-control,
html[lang="ar"] textarea.field.form-control,
body[dir="rtl"] input.field.form-control,
body[dir="rtl"] select.field.form-control,
body[dir="rtl"] textarea.field.form-control {
    padding-left: 14px !important;
    padding-right: 44px !important;
    background-position: left 16px center !important;
}

html[lang="ar"] .password-toggle,
body[dir="rtl"] .password-toggle {
    right: auto !important;
    left: 16px !important;
}

html[lang="ar"] .checkmark,
body[dir="rtl"] .checkmark {
    margin-right: 0 !important;
    margin-left: 10px !important;
}

html[lang="ar"] .pull-left,
body[dir="rtl"] .pull-left {
    float: right !important;
}

html[lang="ar"] .pull-right,
body[dir="rtl"] .pull-right {
    float: left !important;
}

html[lang="ar"] .text-left,
body[dir="rtl"] .text-left {
    text-align: right !important;
}

html[lang="ar"] .text-right,
body[dir="rtl"] .text-right {
    text-align: left !important;
}

/* Fallback for Empty CC Error Alert (JS Variable Missing Fix) */
#divCcEmailFeedback:not(.hidden):empty::before {
    content: "Invalid Email Address";
    display: inline-block;
}

html[lang="ar"] #divCcEmailFeedback:not(.hidden):empty::before,
body[dir="rtl"] #divCcEmailFeedback:not(.hidden):empty::before {
    content: "عنوان البريد الإلكتروني غير صالح";
}

/* SAFETY: Force Hide Hidden Elements (Ghost Alert Fix) */
#divCcEmailFeedback.hidden {
    display: none !important;
}

/* ENSURE VISIBILITY when 'hidden' is removed, even if 'w-hidden' remains */
#divCcEmailFeedback:not(.hidden) {
    display: block !important;
    animation: fadeIn 0.3s ease;
}

/* PERFORMANCE: Global Hide Logic (Prevents invisible animations) */
.w-hidden,
.hidden,
.d-none {
    display: none !important;
}

/* Dashboard Card Layout Rework v2 */
.mgp-home {
    max-width: none;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

/* Use full available width for client area home instead of narrow fixed container */
body[class*="clientarea"] .main-content .container,
body[class*="clientarea"] .main-content .container-fluid {
    max-width: 100% !important;
    width: 100% !important;
}

.mgp-kpi-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    gap: 14px !important;
    align-items: stretch !important;
}

.mgp-kpi-card {
    min-height: 132px;
    border-radius: 14px !important;
    background: rgba(0, 20, 31, 0.9) !important;
    border: 1px solid rgba(0, 168, 232, 0.14) !important;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease !important;
}

.mgp-kpi-card:hover {
    border-color: rgba(0, 168, 232, 0.3) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
}

.mgp-kpi-card--quotes {
    border-color: rgba(167, 139, 250, 0.22) !important;
}

.mgp-kpi-card--quotes .mgp-kpi-card__value {
    color: #a78bfa !important;
}

.mgp-kpi-card--quotes .mgp-kpi-card__icon {
    background: rgba(167, 139, 250, 0.11) !important;
    border: 1px solid rgba(167, 139, 250, 0.24) !important;
    color: #a78bfa !important;
}

.mgp-kpi-card--quotes .label-quotes {
    color: #a78bfa !important;
    background: rgba(167, 139, 250, 0.1) !important;
    border: 1px solid rgba(167, 139, 250, 0.3) !important;
}

.mgp-home-card--services .mgp-home-card__body {
    padding: 16px 18px 18px !important;
}

/* === Superseded by Revamp block below — kept as comment placeholder === */

@media (max-width: 1200px) {
    .mgp-kpi-grid {
        grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)) !important;
    }

    .mgp-svc-grid {
        grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)) !important;
        gap: 14px !important;
    }
}

@media (max-width: 768px) {
    .mgp-home {
        padding-left: 8px;
        padding-right: 8px;
    }

    .mgp-kpi-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)) !important;
        gap: 10px !important;
    }

    .mgp-kpi-card {
        min-height: 118px;
    }

    .mgp-svc-grid {
        grid-template-columns: 1fr !important;
        justify-content: stretch !important;
        padding: 12px !important;
        gap: 12px !important;
    }

    .mgp-svc-card {
        padding: 18px !important;
    }
}

/* -- KPI GRID: auto-fit handles 4 or 5 cards -- */
.mgp-kpi-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
    gap: 14px !important;
}

/* -- Quotes card: purple accent -- */
.mgp-kpi-card--quotes {
    border-color: rgba(167, 139, 250, 0.18) !important;
}

.mgp-kpi-card--quotes .mgp-kpi-card__value {
    color: #a78bfa !important;
}

.mgp-kpi-card--quotes .mgp-kpi-card__icon {
    background: rgba(167, 139, 250, 0.10) !important;
    border: 1px solid rgba(167, 139, 250, 0.22) !important;
    color: #a78bfa !important;
}

.mgp-kpi-card--quotes .label-quotes {
    color: #a78bfa !important;
    background: rgba(167, 139, 250, 0.10) !important;
    border: 1px solid rgba(167, 139, 250, 0.28) !important;
}

/* =========================================
   MAGOODS — Active Services Cards (Revamp)
   ========================================= */

.mgp-svc-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 18px !important;
    padding: 20px !important;
}

.mgp-svc-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(0, 18, 30, 0.95), rgba(0, 40, 65, 0.85)) !important;
    border: 1px solid rgba(0, 168, 232, 0.20) !important;
    border-radius: 18px !important;
    padding: 22px !important;
    cursor: pointer;
    transition: border-color 0.28s ease, transform 0.28s ease, box-shadow 0.28s ease !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
    display: flex;
    flex-direction: column;
}

.mgp-svc-card:hover {
    border-color: rgba(0, 168, 232, 0.55) !important;
    transform: translateY(-4px) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 168, 232, 0.15), 0 0 30px rgba(0, 168, 232, 0.12) !important;
}

/* Animated top accent line */
.mgp-svc-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00a8e8, #00d26a, #00a8e8, transparent);
    background-size: 200% 100%;
    opacity: 0;
    transition: opacity 0.3s;
    animation: mgpSvcScanline 3s linear infinite;
    animation-play-state: paused;
}

.mgp-svc-card:hover::before {
    opacity: 1;
    animation-play-state: running;
}

@keyframes mgpSvcScanline {
    0%   { background-position: -100% 0; }
    100% { background-position: 200% 0; }
}

/* Corner accent glow */
.mgp-svc-card::after {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(0, 168, 232, 0.12), transparent 70%);
    pointer-events: none;
    transition: opacity 0.3s;
    opacity: 0.6;
}

.mgp-svc-card:hover::after {
    opacity: 1;
}

/* Suspended card variant */
.mgp-svc-card--suspended {
    background: linear-gradient(145deg, rgba(20, 12, 0, 0.95), rgba(45, 28, 0, 0.85)) !important;
    border-color: rgba(245, 158, 11, 0.25) !important;
}

.mgp-svc-card--suspended:hover {
    border-color: rgba(245, 158, 11, 0.55) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 30px rgba(245, 158, 11, 0.10) !important;
}

.mgp-svc-card--suspended::before {
    background: linear-gradient(90deg, transparent, #f59e0b, #ffd700, #f59e0b, transparent) !important;
    background-size: 200% 100% !important;
}

.mgp-svc-card--suspended::after {
    background: radial-gradient(circle, rgba(245, 158, 11, 0.12), transparent 70%) !important;
}

/* Card header row */
.mgp-svc-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 10px;
}

/* Icon box */
.mgp-svc-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.mgp-svc-icon--active {
    background: linear-gradient(135deg, rgba(0, 168, 232, 0.18), rgba(0, 126, 167, 0.12)) !important;
    border: 1px solid rgba(0, 168, 232, 0.38) !important;
    color: #00a8e8 !important;
    box-shadow: 0 0 14px rgba(0, 168, 232, 0.20) !important;
}

.mgp-svc-icon--suspended {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.08)) !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
    color: #f59e0b !important;
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.15) !important;
}

/* Status pill */
.mgp-svc-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-family: 'Orbitron', sans-serif !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    flex-shrink: 0;
}

.mgp-svc-status--active {
    color: #00d26a !important;
    background: rgba(0, 210, 106, 0.12) !important;
    border: 1px solid rgba(0, 210, 106, 0.32) !important;
    box-shadow: 0 0 10px rgba(0, 210, 106, 0.15) !important;
}

.mgp-svc-status--active::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #00d26a;
    box-shadow: 0 0 6px #00d26a;
    animation: mgp-pulse 2s infinite;
}

.mgp-svc-status--suspended {
    color: #f59e0b !important;
    background: rgba(245, 158, 11, 0.12) !important;
    border: 1px solid rgba(245, 158, 11, 0.32) !important;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.12) !important;
}

.mgp-svc-status--suspended::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #f59e0b;
}

@keyframes mgp-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 6px #00d26a; }
    50%       { opacity: 0.4; box-shadow: 0 0 2px #00d26a; }
}

/* Identity block: product name + sub-label */
.mgp-svc-card__identity {
    margin-bottom: 14px;
}

/* Product name */
.mgp-svc-card__name {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #e6f6ff !important;
    line-height: 1.35;
    margin-bottom: 4px;
    letter-spacing: 0.01em;
}

/* Product category sub-label */
.mgp-svc-card__sub {
    font-size: 12px !important;
    color: rgba(0, 168, 232, 0.65) !important;
    font-weight: 500 !important;
    margin-bottom: 0;
    letter-spacing: 0.02em;
}

/* Specs details block */
.mgp-svc-card__details {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(0, 168, 232, 0.14);
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
    flex: 1;
}

.mgp-svc-detail {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(0, 168, 232, 0.08);
    transition: background 0.2s;
}

.mgp-svc-detail:last-child {
    border-bottom: none;
}

.mgp-svc-detail:hover {
    background: rgba(0, 168, 232, 0.06);
}

.mgp-svc-detail__label {
    font-family: 'Orbitron', sans-serif !important;
    font-size: 10px !important;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(170, 220, 245, 0.60) !important;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.mgp-svc-detail__label i {
    color: rgba(0, 168, 232, 0.65) !important;
    font-size: 11px !important;
    width: 14px;
    text-align: center;
}

.mgp-svc-detail__val {
    font-family: 'JetBrains Mono', 'Courier New', monospace !important;
    font-size: 12px !important;
    color: #e6f6ff !important;
    font-weight: 500 !important;
    text-align: right;
    word-break: break-all;
}

/* Action button area */
.mgp-svc-card__foot {
    display: flex;
    gap: 8px;
    margin-top: 0;
}

/* Keep fallback service cards visible as lightweight placeholders until hydration completes. */
.mgp-svc-card--placeholder {
    visibility: visible !important;
    opacity: 0.78;
}

.mgp-svc-grid--hydrating {
    min-height: 160px;
}

.mgp-svc-loading {
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(0, 168, 232, 0.25);
    background: rgba(0, 21, 31, 0.56);
    color: rgba(230, 246, 255, 0.86);
    font-family: 'Poppins', sans-serif !important;
    font-size: 12px !important;
}

.mgp-svc-loading__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #00a8e8;
    box-shadow: 0 0 10px rgba(0, 168, 232, 0.65);
    animation: mgpSvcPulse 0.9s ease-in-out infinite;
}

.mgp-svc-card--reveal {
    animation: mgpSvcReveal 0.35s ease;
}

@keyframes mgpSvcPulse {
    0%, 100% { opacity: 0.4; transform: scale(0.9); }
    50%       { opacity: 1;   transform: scale(1);   }
}

@keyframes mgpSvcReveal {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0);    }
}

/* ====== MANAGE BUTTON ====== */
.mgp-svc-btn {
    flex: none;
    padding: 12px 16px;
    min-height: 46px;
    border-radius: 12px;
    font-family: 'Poppins', sans-serif !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid;
    transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
    letter-spacing: 0.02em;
    text-decoration: none !important;
    position: relative;
    overflow: hidden;
}

.mgp-svc-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.mgp-svc-btn:hover::before {
    transform: translateX(100%);
}

.mgp-svc-btn--primary {
    background: linear-gradient(135deg, rgba(0, 168, 232, 0.22), rgba(0, 126, 167, 0.18)) !important;
    border-color: rgba(0, 168, 232, 0.45) !important;
    color: #00c8ff !important;
    box-shadow: 0 4px 14px rgba(0, 168, 232, 0.20), inset 0 1px 0 rgba(255,255,255,0.08) !important;
}

.mgp-svc-btn--primary:hover {
    background: linear-gradient(135deg, #007ea7, #00a8e8) !important;
    border-color: #00a8e8 !important;
    color: #fff !important;
    box-shadow: 0 8px 24px rgba(0, 168, 232, 0.45) !important;
    transform: translateY(-1px);
}

.mgp-svc-btn--warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.08)) !important;
    border-color: rgba(245, 158, 11, 0.38) !important;
    color: #f59e0b !important;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.15) !important;
}

.mgp-svc-btn--warning:hover {
    background: linear-gradient(135deg, #d97706, #f59e0b) !important;
    border-color: #f59e0b !important;
    color: #fff !important;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.40) !important;
    transform: translateY(-1px);
}

.mgp-svc-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.09) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.35) !important;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s !important;
    flex-shrink: 0;
}

.mgp-svc-icon-btn:hover {
    background: rgba(255, 255, 255, 0.09) !important;
    color: #e6f6ff !important;
}

/* Active Services + Responsive Hotfix (Final Override) */
.mgp-home,
.mgp-home-grid,
.mgp-home-stack,
.mgp-home-columns {
    min-width: 0 !important;
}

.mgp-home {
    width: 100% !important;
    max-width: none !important;
}

body[class*="clientarea"] .main-content,
body[class*="clientarea"] .main-content .container,
body[class*="clientarea"] .main-content .container-fluid {
    width: 100% !important;
    max-width: 100% !important;
}

.mgp-home-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px) !important;
    gap: 18px !important;
    align-items: start !important;
}

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

.mgp-kpi-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
    gap: 14px !important;
}

.mgp-svc-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(265px, 1fr)) !important;
    gap: 14px !important;
    padding: 16px 18px !important;
}

.mgp-svc-view-more {
    padding: 8px 18px 18px !important;
    display: flex !important;
    justify-content: center !important;
}

.mgp-svc-view-more__btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 9px 22px !important;
    border-radius: 10px !important;
    border: 1px solid rgba(0, 168, 232, 0.24) !important;
    background: rgba(0, 168, 232, 0.08) !important;
    color: #00a8e8 !important;
    font-family: 'Poppins', sans-serif !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
}

.mgp-svc-view-more__btn:hover {
    background: rgba(0, 168, 232, 0.14) !important;
    border-color: rgba(0, 168, 232, 0.45) !important;
    color: #e6f6ff !important;
}

@media (max-width: 1400px) {
    .mgp-home-grid {
        grid-template-columns: minmax(0, 1fr) minmax(260px, 300px) !important;
    }

    .mgp-home-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 1100px) {
    .mgp-home-grid {
        grid-template-columns: 1fr !important;
    }

    .mgp-home-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 768px) {
    .mgp-home-columns {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    .mgp-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    .mgp-svc-grid {
        grid-template-columns: 1fr !important;
        padding: 12px !important;
    }
}

@media (max-width: 520px) {
    .mgp-kpi-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Mobile polish for clientarea home cards */
@media (max-width: 991px) {

    .mgp-home .mgp-home-card__header,
    .mgp-home .mgp-home-actions-card__header {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 10px !important;
    }

    .mgp-home .mgp-home-card__title,
    .mgp-home .mgp-home-actions-card__title {
        min-width: 0 !important;
        font-size: 12px !important;
        line-height: 1.35 !important;
        letter-spacing: 0.08em !important;
        word-break: break-word !important;
    }

    .mgp-home .mgp-home-card .btn,
    .mgp-home .mgp-home-actions-card .btn,
    .mgp-home .mgp-home-kb-search__submit {
        max-width: 100% !important;
    }

    .mgp-home .mgp-home-actions,
    .mgp-home .qa-list {
        gap: 10px !important;
    }

    .mgp-home .mgp-home-actions__button,
    .mgp-home .qa-item {
        width: 100% !important;
    }

    .mgp-home .mgp-home-kb-search__field {
        width: 100% !important;
        min-width: 0 !important;
    }

    .mgp-home .mgp-home-kb-search__input {
        min-width: 0 !important;
        width: 100% !important;
    }
}

@media (max-width: 768px) {
    .mgp-home {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .mgp-home .mgp-home-card,
    .mgp-home .mgp-home-actions-card,
    .mgp-home .mgp-home-kb-card {
        border-radius: 12px !important;
    }

    .mgp-home .mgp-home-card__header,
    .mgp-home .mgp-home-actions-card__header {
        padding: 12px 14px !important;
    }

    .mgp-home .mgp-home-card__body,
    .mgp-home .mgp-home-actions-card__body {
        padding: 12px 14px !important;
    }

    .mgp-home .mgp-svc-grid {
        padding: 0 !important;
    }

    .mgp-home .mgp-kpi-card {
        min-height: 108px !important;
        padding: 12px !important;
    }

    .mgp-home .mgp-kpi-card__value {
        font-size: 1.8rem !important;
    }

    .mgp-home .mgp-kpi-card__label {
        font-size: 9px !important;
    }

    /* Hide duplicate WHMCS secondary mobile sidebar on dashboard */
    .d-lg-none.sidebar.sidebar-secondary {
        display: none !important;
    }
}

/* Pending service style */
.mgp-svc-card--pending {
    border-color: rgba(245, 158, 11, 0.2) !important;
}

.mgp-svc-status--pending {
    color: #f59e0b !important;
    background: rgba(245, 158, 11, 0.1) !important;
    border: 1px solid rgba(245, 158, 11, 0.28) !important;
}

.mgp-svc-status--pending::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #f59e0b;
}

/* Service cards now use a single Manage control only */
.mgp-svc-card__foot .mgp-svc-icon-btn {
    display: none !important;
}

/* Arabic / RTL global alignment and icon direction helpers */
html[lang="ar"] .mg-support-subtitle,
body[dir="rtl"] .mg-support-subtitle,
html[lang="ar"] .mg-support-page p,
body[dir="rtl"] .mg-support-page p,
html[lang="ar"] .mgp-empty-state__desc,
body[dir="rtl"] .mgp-empty-state__desc {
    text-align: right !important;
    direction: rtl !important;
}

.mgp-empty-state {
    justify-items: center !important;
    text-align: center !important;
}

html[lang="ar"] .mgp-empty-state,
body[dir="rtl"] .mgp-empty-state,
html[lang="ar"] .mgp-empty-state__desc,
body[dir="rtl"] .mgp-empty-state__desc {
    text-align: center !important;
}

.mgp-empty-state>.btn,
.mgp-empty-state>a.btn {
    justify-self: center !important;
}

html[lang="ar"] .btn,
body[dir="rtl"] .btn,
html[lang="ar"] .mg-support-btn,
body[dir="rtl"] .mg-support-btn,
html[lang="ar"] .mgp-svc-btn,
body[dir="rtl"] .mgp-svc-btn,
html[lang="ar"] .mgp-svc-view-more__btn,
body[dir="rtl"] .mgp-svc-view-more__btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
}

html[lang="ar"] .mgp-svc-btn,
body[dir="rtl"] .mgp-svc-btn,
html[lang="ar"] .mg-service-view-details,
body[dir="rtl"] .mg-service-view-details {
    flex-direction: row-reverse !important;
}

html[lang="ar"] .btn i[class*="arrow"],
body[dir="rtl"] .btn i[class*="arrow"],
html[lang="ar"] .mg-support-btn i[class*="arrow"],
body[dir="rtl"] .mg-support-btn i[class*="arrow"],
html[lang="ar"] .mgp-svc-btn i[class*="arrow"],
body[dir="rtl"] .mgp-svc-btn i[class*="arrow"],
html[lang="ar"] .mgp-svc-view-more__btn i[class*="arrow"],
body[dir="rtl"] .mgp-svc-view-more__btn i[class*="arrow"] {
    order: 2;
    margin-left: 6px !important;
    margin-right: 0 !important;
}

html[lang="ar"] i.fa-arrow-right,
body[dir="rtl"] i.fa-arrow-right,
html[lang="ar"] i.fa-arrow-circle-right,
body[dir="rtl"] i.fa-arrow-circle-right,
html[lang="ar"] i.fa-long-arrow-alt-right,
body[dir="rtl"] i.fa-long-arrow-alt-right,
html[lang="ar"] i.fa-chevron-right,
body[dir="rtl"] i.fa-chevron-right,
html[lang="ar"] i.fa-angle-right,
body[dir="rtl"] i.fa-angle-right {
    transform: scaleX(-1) !important;
}

/* Services panel final override — reinforces revamp styles */
.mgp-home-card--services .mgp-home-card__body {
    padding: 0 !important;
}

.mgp-home-card--services .mgp-svc-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 18px !important;
    padding: 20px !important;
    align-items: stretch !important;
}

.mgp-home-card--services .mgp-svc-card {
    min-height: 0 !important;
    padding: 22px !important;
    border-radius: 18px !important;
    display: flex;
    flex-direction: column;
}

.mgp-home-card--services .mgp-svc-card__head {
    align-items: center !important;
    margin-bottom: 16px !important;
}

.mgp-home-card--services .mgp-svc-status {
    font-size: 9px !important;
    letter-spacing: 0.10em !important;
    padding: 5px 12px !important;
}

.mgp-home-card--services .mgp-svc-card__name {
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
    margin-bottom: 4px !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mgp-home-card--services .mgp-svc-card__sub {
    font-size: 12px !important;
    color: rgba(0, 168, 232, 0.65) !important;
    font-weight: 500 !important;
    margin-bottom: 0 !important;
}

.mgp-home-card--services .mgp-svc-card__details {
    margin-bottom: 16px !important;
}

.mgp-home-card--services .mgp-svc-card__foot {
    margin-top: 0 !important;
}

.mgp-home-card--services .mgp-svc-btn {
    min-height: 46px !important;
    padding: 12px 16px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
}

/* Keep sync placeholders visible so cards don't appear to "lag in" */
.mgp-home-card--services .mgp-svc-card--placeholder {
    visibility: visible !important;
    opacity: 0.72;
}

.mgp-home-card--services .mgp-svc-loading {
    margin-top: 12px !important;
}

@media (max-width: 768px) {
    .mgp-home-card--services .mgp-svc-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        padding: 14px !important;
    }
    .mgp-home-card--services .mgp-svc-card {
        padding: 18px !important;
    }
}

/* ── Shared page-header components (invoices / quotes / tickets / addons) ── */
.mg-page-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(0, 168, 232, 0.2);
    background: rgba(0, 168, 232, 0.06);
    color: rgba(168, 240, 255, 0.9);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}
.mg-page-eyebrow i { color: #00c9ff; }

.mg-page-header__main {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.mg-page-header__copy { flex: 1 1 auto; min-width: 0; }
.mg-page-header__actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
}

.mg-page-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.6rem 1.15rem;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: none !important;
    transition: all 180ms ease;
    white-space: nowrap;
    cursor: pointer;
    border: 1px solid transparent;
}
.mg-page-btn--primary {
    background: linear-gradient(135deg, #007ea7, #00a8e8);
    color: #fff !important;
    border-color: rgba(0, 168, 232, 0.3);
    box-shadow: 0 4px 14px rgba(0, 168, 232, 0.2);
}
.mg-page-btn--primary:hover {
    background: linear-gradient(135deg, #00a8e8, #00c9ff);
    box-shadow: 0 6px 20px rgba(0, 168, 232, 0.35);
    transform: translateY(-1px);
    color: #fff !important;
}
.mg-page-btn--ghost {
    background: rgba(0, 168, 232, 0.06);
    color: rgba(168, 240, 255, 0.9) !important;
    border-color: rgba(0, 168, 232, 0.18);
}
.mg-page-btn--ghost:hover {
    background: rgba(0, 168, 232, 0.12);
    border-color: rgba(0, 168, 232, 0.35);
    color: #fff !important;
}

/* Shared page stats row */
.mg-page-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.85rem;
}
.mg-page-stat {
    padding: 0.85rem 1rem;
    border-radius: 14px;
    border: 1px solid rgba(0, 168, 232, 0.16);
    background: linear-gradient(180deg, rgba(0, 22, 34, 0.88), rgba(0, 14, 24, 0.94));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.mg-page-stat--active { border-color: rgba(0, 210, 106, 0.24); }
.mg-page-stat--warn   { border-color: rgba(255, 165, 0, 0.22); }
.mg-page-stat--danger { border-color: rgba(255, 79, 79, 0.22); }
.mg-page-stat--info   { border-color: rgba(0, 168, 232, 0.24); }
.mg-page-stat--neutral { border-color: rgba(255, 255, 255, 0.1); }
.mg-page-stat__label {
    display: block;
    color: rgba(230, 246, 255, 0.6);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}
.mg-page-stat__value {
    display: block;
    margin-top: 0.3rem;
    color: #fff;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.6rem;
    line-height: 1;
}

/* RTL shared page-header */
