/* ==========================================================================
   DASHBOARD & NAVBAR - APPLE iOS & SPARTAN X DESIGN SYSTEM
   Theme: Dolphin Hosting 
   Paleta: Dark Slate Deep + Neon Purple (#7C3AED) + Emerald (#10B981)
   Approach: Mobile-first. Base styles target phones; desktop enhancements
   live inside @media (min-width: 992px). The old (max-width: 991.98px)
   override block was replaced by this mobile-first structure.
   ========================================================================== */

/* ── Typography & Variables ────────────────────────────────────────────── */
:root {
  --apple-font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", sans-serif;
  --apple-mono: "JetBrains Mono", "SF Mono", monospace;

  --bg-deep: #06090e;
  --bg-sidebar: rgba(10, 14, 24, 0.96);
  --bg-card-glass: rgba(14, 18, 27, 0.65);
  --bg-card-glass-hover: rgba(20, 25, 37, 0.85);

  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-hover: rgba(139, 92, 246, 0.35);

  --text-main: #f8fafc;
  --text-muted: #cbd5e1;

  --color-primary: #7C3AED;
  --color-primary-glow: rgba(124, 58, 237, 0.4);
  --color-success: #10B981;
  --color-warning: #F59E0B;
  --color-danger: #EF4444;
  --color-info: #3B82F6;

  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(124, 58, 237, 0.15);

  --transition-smooth: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);

  /* Spacing scale (mobile-first) */
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;

  --font-weight-bold: 700;
}

/* ── Glass card component ── */
.glass-card {
  background: var(--bg-card-glass) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass) !important;
  border-radius: var(--radius-xl) !important;
  box-shadow: var(--shadow-glass) !important;
  overflow: hidden;
}

/* ── Base Override & Typography ──────────────────────────────────────── */
body {
    font-family: var(--apple-font) !important;
    background-color: var(--bg-deep) !important;
    background-image:
        radial-gradient(circle at 85% 15%, rgba(124, 58, 237, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 15% 85%, rgba(59, 130, 246, 0.05) 0%, transparent 40%) !important;
    background-attachment: fixed !important;
    color: var(--text-main) !important;
    letter-spacing: -0.015em;
    min-height: 100vh;
}

.text-mono { font-family: var(--apple-mono) !important; }
.tracking-wide { letter-spacing: 0.05em; }
.tracking-wider { letter-spacing: 0.1em; }
.tracking-tight { letter-spacing: -0.025em; }
.cursor-pointer { cursor: pointer; }
.transition-hover { transition: var(--transition-smooth); }
.min-w-0 { min-width: 0; }
.shrink-0 { flex-shrink: 0; }

/* ── Utility Colors ──────────────────────────────────────────────────── */
.bg-black-25 { background-color: rgba(0, 0, 0, 0.25) !important; }
.bg-black-50 { background-color: rgba(0, 0, 0, 0.5) !important; }
.text-indigo { color: #818cf8 !important; }
.bg-indigo { background-color: #818cf8 !important; }

/* ── Custom utilities referenced by templates (Apple aesthetic) ──────── */
.bg-primary-glow {
    background: linear-gradient(135deg, var(--color-primary) 0%, #4F46E5 100%) !important;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4) !important;
}
.brand-text {
    color: var(--text-main) !important;
    font-weight: var(--font-weight-bold) !important;
    letter-spacing: -0.025em;
}
.brand-tagline {
    color: var(--text-muted) !important;
    font-size: 0.68rem !important;
    letter-spacing: 0.04em;
}
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.max-w-7xl {
    max-width: 1280px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

/* Purge Tabler/Bootstrap white surfaces completely (scoped to Apple bento theme) */
.list-group-transparent .list-group-item,
.apple-bento-theme .card,
.apple-bento-theme .table,
.apple-bento-theme .list-group-item {
    background-color: transparent !important;
}

/* ==========================================================================
   1. APPLE ANNOUNCEMENT BAR & FLOATING NAVBAR
   ========================================================================== */
.apple-nav-wrapper {
    z-index: 1030;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    background: rgba(6, 9, 14, 0.75);
    border-bottom: 1px solid var(--border-glass);
}

.apple-announcement-bar {
    background: linear-gradient(90deg, rgba(124, 58, 237, 0.15) 0%, rgba(59, 130, 246, 0.1) 100%);
    border-color: rgba(124, 58, 237, 0.2) !important;
    font-size: 0.82rem;
}
.apple-announcement-bar .announcement-cta {
    color: #a78bfa;
    transition: var(--transition-smooth);
}
.apple-announcement-bar .announcement-cta:hover {
    color: #c4b5fd;
    transform: translateX(2px);
}

.apple-navbar {
    min-height: 64px;
}
.brand-badge {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--color-primary) 0%, #4F46E5 100%);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

/* Apple Centered Floating Pill Navigation.
   Mobile (base): full-width stacked glass strip.
   Desktop (min-width: 992px): centered floating pill. */
.apple-pill-nav {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    width: 100% !important;
    margin: 0;
}
.apple-pill-nav .navbar-nav {
    background: rgba(15, 20, 32, 0.95);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 0.75rem;
}

.apple-nav-link {
    color: #e2e8f0 !important;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;               /* touch target */
    padding: 0.75rem 1rem;
}
.apple-nav-link:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.12);
}
.apple-nav-link.active {
    color: #ffffff !important;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.85) 0%, rgba(99, 102, 241, 0.75) 100%) !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 10px rgba(124, 58, 237, 0.3) !important;
}

/* User Pill & Balance in Navbar */
.apple-balance-pill {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    transition: var(--transition-smooth);
    min-height: 44px;               /* touch target */
    display: inline-flex;
    align-items: center;
}
.apple-balance-pill:hover {
    background: rgba(16, 185, 129, 0.2);
    transform: translateY(-1px);
}

.apple-user-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition-smooth);
    min-height: 44px;               /* touch target */
    display: inline-flex;
    align-items: center;
}
.apple-user-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.apple-dropdown-menu {
    background: rgba(15, 20, 32, 0.95) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass) !important;
}

/* ==========================================================================
   2. SPARTAN X / PROTON UI VERTICAL SIDEBAR
   ========================================================================== */
.has-sidebar-dock {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

/* Mobile base: fixed off-canvas drawer (toggle via .open class). */
.apple-sidebar {
    width: 270px !important;
    min-width: 270px !important;
    max-width: 270px !important;
    height: 100vh;
    height: 100dvh;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    transform: translateX(-100%);
    background: var(--bg-sidebar) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    border-right: 1px solid var(--border-glass) !important;
    z-index: 1060 !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.9);
}
.apple-sidebar.open {
    transform: translateX(0);
}

/* Mobile backdrop for the drawer. */
.apple-sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1055;
    display: none;
}
.apple-sidebar-backdrop.open {
    display: block;
}

/* macOS Window Dots */
.macos-dots {
    padding-left: 2px;
}
.macos-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    display: inline-block;
}
.macos-close { background-color: #ff5f56; box-shadow: 0 0 6px rgba(255, 95, 86, 0.4); }
.macos-minimize { background-color: #ffbd2e; box-shadow: 0 0 6px rgba(255, 189, 46, 0.4); }
.macos-maximize { background-color: #27c93f; box-shadow: 0 0 6px rgba(39, 201, 63, 0.4); }

.brand-icon-box {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--color-primary) 0%, #4F46E5 100%);
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.35);
}

.sidebar-heading {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: #cbd5e1 !important;
}

/* Sidebar Nav Links */
.sidebar-nav-link {
    color: #cbd5e1;
    font-weight: 500;
    font-size: 0.885rem;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 44px;               /* touch target */
    padding: 0.625rem 1rem;
}
.sidebar-nav-link:hover {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
    transform: translateX(3px) !important;
}
.sidebar-nav-link.active {
    color: #ffffff !important;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.9) 0%, rgba(99, 102, 241, 0.8) 100%) !important;
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3) !important;
    font-weight: 600 !important;
}
.sidebar-nav-link .nav-icon {
    font-size: 1.15rem;
    flex-shrink: 0;
}

/* Sidebar Footer User Card */
.user-dock-card {
    transition: var(--transition-smooth);
    min-height: 44px;               /* touch target */
    display: flex;
    align-items: center;
}
.user-dock-card:hover {
    background-color: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}
.status-dot-mini {
    width: 9px;
    height: 9px;
    border: 2px solid #0a0e18;
}
.hover-danger:hover {
    color: #ef4444 !important;
}

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 5px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* ==========================================================================
   3. DASHBOARD TOPBAR (SPARTAN X STYLE)
   ========================================================================== */
.dashboard-topbar {
    min-height: 52px;
}
.topbar-search input {
    width: 170px;
    max-width: 100%;
    transition: var(--transition-smooth);
}
.topbar-search input:focus {
    width: 220px;
    max-width: 100%;
    background-color: rgba(0, 0, 0, 0.45) !important;
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25);
}
.topbar-action-btn {
    width: 44px;                    /* touch target */
    height: 44px;                   /* touch target */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: #cbd5e1;
    transition: var(--transition-smooth);
    text-decoration: none;
}
.topbar-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateY(-1px);
}
.topbar-balance-chip {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    transition: var(--transition-smooth);
    min-height: 44px;               /* touch target */
    display: inline-flex;
    align-items: center;
}
.topbar-balance-chip:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

/* ==========================================================================
   4. BENTO CARDS & DASHBOARD WIDGETS
   ========================================================================== */
.bento-card {
    background: var(--bg-card-glass) !important;
    backdrop-filter: blur(24px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
    border: 1px solid var(--border-glass) !important;
    border-radius: var(--radius-xl) !important;
    padding: 1.5rem !important;
    position: relative !important;
    overflow: hidden !important;
    box-shadow: var(--shadow-glass) !important;
    transition: var(--transition-smooth) !important;
}
.bento-card:hover {
    border-color: rgba(255, 255, 255, 0.15) !important;
}

.user-identity-card {
    display: flex;
    flex-direction: column;
}
.card-glow-bg {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 0%, rgba(124, 58, 237, 0.15), transparent 50%);
    z-index: 0;
    pointer-events: none;
}
.user-identity-card .card-content {
    position: relative;
    z-index: 1;
    width: 100%;
}
.dashboard-apple-avatar {
    border-radius: 20px !important;
    border: 2px solid rgba(255,255,255,0.1);
}
.verified-badge {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transform: translate(25%, 25%);
}

.btn-glass {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    backdrop-filter: blur(10px);
    transition: var(--transition-smooth);
    border-radius: var(--radius-md);
    min-height: 44px;               /* touch target */
    min-width: 44px;                /* touch target */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
}
.btn-glass:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    color: #fff;
    transform: translateY(-1px);
}
.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, #9333EA 100%) !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3) !important;
    color: #fff !important;
    transition: var(--transition-smooth) !important;
    min-height: 44px;               /* touch target */
    padding: 0.5rem 1rem;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #8B5CF6 0%, #A855F7 100%) !important;
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.45) !important;
    transform: translateY(-2px) !important;
    color: #fff !important;
}
.btn-icon-only {
    background: transparent;
    border: none;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition-smooth);
    min-width: 44px;                /* touch target */
    min-height: 44px;               /* touch target */
}
.btn-icon-only:hover {
    background: rgba(255,255,255,0.1);
}

.shortcut-item:hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    transform: translateX(4px);
}

.bento-stat-card {
    background: rgba(15, 20, 32, 0.5);
    border: 1px solid var(--border-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: var(--transition-smooth);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    min-height: 44px;               /* touch target */
    display: flex;
    flex-direction: column;
}
.bento-stat-card:hover {
    background: rgba(25, 30, 42, 0.7);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.stat-icon-wrapper {
    font-size: 1.5rem;
}
.bg-gradient-premium {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.8) 0%, rgba(59, 130, 246, 0.8) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.bg-gradient-premium:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.9) 0%, rgba(96, 165, 250, 0.9) 100%) !important;
    box-shadow: 0 10px 30px rgba(124, 58, 237, 0.4);
}
.btn-balance-add {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #fff !important;
    backdrop-filter: blur(4px);
    min-height: 44px;               /* touch target */
}
.btn-balance-add:hover {
    background: rgba(255, 255, 255, 0.95);
    color: var(--color-primary) !important;
}

.stat-card-danger-glow {
    border-color: rgba(239, 68, 68, 0.4);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.15), inset 0 0 15px rgba(239, 68, 68, 0.05);
}
.stat-card-danger-glow:hover {
    border-color: rgba(239, 68, 68, 0.6);
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.25), inset 0 0 20px rgba(239, 68, 68, 0.1);
}

.service-row-item {
    cursor: pointer;
    min-height: 44px;               /* touch target */
    display: flex;
    align-items: center;
}
.service-row-item:hover {
    background-color: rgba(255, 255, 255, 0.04) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.status-indicator {
    width: 12px;
    display: flex;
    justify-content: center;
}
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.apple-progress-bar {
    background-color: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--color-success);
    animation: pulse-animation 2s infinite;
}
@keyframes pulse-animation {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.apple-alert-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.6rem 1.2rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-glass);
    min-width: fit-content;
}
.apple-alert-pill.alert-danger {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.55);
    color: #fca5a5;
}
.apple-alert-pill.alert-success {
    background: rgba(16, 185, 129, 0.25);
    border-color: rgba(16, 185, 129, 0.5);
    color: #6ee7b7;
}
.btn-alert-danger {
    background: #ef4444;
    color: #fff;
    border-radius: 9999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    border: none;
    transition: var(--transition-smooth);
    min-height: 44px;               /* touch target */
    display: inline-flex;
    align-items: center;
}
.btn-alert-danger:hover {
    background: #dc2626;
    color: #fff;
    transform: scale(1.05);
}

/* ==========================================================================
   5. DESKTOP ENHANCEMENTS (min-width: 992px)
   Mobile-first: everything above is the phone base. This block adds
   desktop-only layout on top.
   ========================================================================== */
@media (min-width: 992px) {
    /* Sidebar: sticky full-height vertical navigation on desktop. */
    .has-sidebar-dock {
        flex-direction: row;
    }

    .apple-sidebar {
        position: sticky !important;
        top: 0 !important;
        height: 100vh;
        height: 100dvh !important;
        transform: none !important;
    }

    .apple-sidebar-backdrop {
        display: none !important;
    }

    /* Navbar pill: centered floating glass pill on desktop. */
    .apple-pill-nav {
        background: rgba(15, 23, 42, 0.85) !important;
        border: 1px solid rgba(255, 255, 255, 0.12) !important;
        backdrop-filter: blur(14px) !important;
        -webkit-backdrop-filter: blur(14px) !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35) !important;
        width: auto !important;
        max-width: 820px;
        margin: 0 auto;
    }
    .apple-pill-nav .navbar-nav {
        background: transparent !important;
        border: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
    }

    /* Bento grid uses responsive Bootstrap row/columns */

    /* Desktop topbar search: wider input field. */
    .topbar-search input {
        width: 240px;
    }
    .topbar-search input:focus {
        width: 320px;
    }
}

/* ==========================================================================
   6. MISSING APPLE CLASSES (from templates, added for Bootstrap migration)
   ========================================================================== */

/* --- Sidebar layout --- */
.sidebar-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.08) !important;
}
.sidebar-section {
    margin-bottom: 1.5rem;
}
.sidebar-nav-container {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* --- Sidebar branding --- */
.brand-link {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    color: #ffffff !important;
    text-decoration: none !important;
}
.brand-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.brand-name {
    font-weight: 700 !important;
    font-size: 1rem !important;
    line-height: 1.1 !important;
}
.brand-sub {
    font-size: 0.68rem !important;
    letter-spacing: 0.08em !important;
    color: #cbd5e1 !important;
    text-transform: uppercase !important;
}

/* --- Sidebar user dock --- */
.user-avatar-dock {
    position: relative;
    flex-shrink: 0;
}
.user-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

/* --- Dashboard layout --- */
/* .apple-bento-grid handled by Bootstrap flex row */
.apple-dashboard-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.header-titles {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.header-alerts {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* --- Customer PIN card --- */
.customer-pin-card {
    position: relative;
    overflow: hidden;
}
.pin-display-box {
    background: rgba(15, 20, 32, 0.6);
    border: 1px solid var(--border-glass) !important;
    backdrop-filter: blur(12px);
}
.pin-value {
    font-family: var(--apple-mono);
    letter-spacing: 0.05em;
}
.pin-hint {
    font-size: 0.78rem;
    line-height: 1.4;
}

/* --- Shortcuts --- */
.shortcut-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Services panel --- */
.services-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.services-list-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.service-action {
    display: flex;
    justify-content: flex-end;
}
.btn-manage {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* --- Expiry tracker --- */
.service-expiry-container {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 150px;
}
.expiry-tracker {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.expiry-date {
    font-size: 0.7rem;
    color: #cbd5e1;
}
.expiry-text {
    font-size: 0.75rem;
    font-weight: 600;
}

/* --- Empty state --- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.empty-icon-glass {
    width: 80px;
    height: 80px;
    border-radius: 50% !important;
}

/* --- Invoices --- */
.invoice-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.invoice-amount-status {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* --- Stat cards --- */
.stat-value {
    font-weight: 700;
    line-height: 1.1;
}
.stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.stat-badge {
    margin-top: auto;
}

/* --- Navbar user pill name --- */
.user-pill-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
    display: inline-block;
}

/* ── Bootstrap text-muted override ── */
.text-muted {
    color: #cbd5e1 !important;
}

/* ==========================================================================
   7. SUPPORT TICKET SYSTEM — greenmc-hosting (FossBilling)
   Apple glassmorphism · Mobile-first · Bootstrap 5.3.3 compatible
   Palette: --bg-deep #06090e · --color-primary #7C3AED · success #10B981 ·
   warning #F59E0B · secondary #6C757D · text #f8fafc / #cbd5e1
   All foreground text passes WCAG AA (4.5:1 normal / 3:1 large) on the
   --bg-deep surface.
   ========================================================================== */

/* ── Ticket card ── */
.ticket-card {
  position: relative;
  background: var(--bg-card-glass) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  border: 1px solid var(--border-glass) !important;
  border-radius: var(--radius-xl) !important;
  box-shadow: var(--shadow-glass) !important;
  color: var(--text-main) !important;
  transition: var(--transition-smooth) !important;
  overflow: hidden;
}
.ticket-card:hover {
  border-color: var(--border-glass-hover) !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5) !important;
}

/* ── Ticket header: title + actions ── */
.ticket-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-glass);
  margin-bottom: 1.25rem;
}
.ticket-title {
  margin: 0;
  font-family: var(--apple-font);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main) !important;
  letter-spacing: -0.02em;
}
.ticket-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  color: var(--text-muted) !important;
  font-size: 0.85rem;
}
.ticket-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
}

/* ── Status badges ── */
/* open = success #10B981 · on_hold = warning #F59E0B · closed = secondary #6C757D
   White badge text keeps WCAG AA (>4.5:1) on every dark surface. */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.275rem 0.9rem;
  border-radius: 9999px;
  border: 1px solid;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #ffffff !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  transition: var(--transition-smooth);
}
.status-badge.open {
  background: rgba(16, 185, 129, 0.18) !important;
  border-color: rgba(16, 185, 129, 0.55) !important;
}
.status-badge.on_hold {
  background: rgba(245, 158, 11, 0.18) !important;
  border-color: rgba(245, 158, 11, 0.55) !important;
}
.status-badge.closed {
  background: rgba(108, 117, 125, 0.18) !important;
  border-color: rgba(108, 117, 125, 0.55) !important;
}
.status-badge:hover {
  transform: translateY(-1px);
  filter: brightness(1.15);
}

/* ── Message list ── */
.message-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.25rem 0;
}
.message-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
  animation: ticketFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.message-row.client {
  justify-content: flex-start;
  flex-direction: row;
}
.message-row.admin {
  justify-content: flex-end;
  flex-direction: row-reverse;
}
.message-bubble {
  display: inline-block;
  max-width: 82%;
  padding: 0.85rem 1.1rem;
  border: 1px solid;
  border-radius: var(--radius-lg);
  color: var(--text-main) !important;
  font-size: 0.92rem;
  line-height: 1.55;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  transition: var(--transition-smooth);
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.message-bubble.client {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  border-radius: 20px 20px 20px 6px !important;
}
.message-bubble.admin {
  background: rgba(124, 58, 237, 0.10) !important;
  border-color: rgba(124, 58, 237, 0.28) !important;
  border-radius: 20px 20px 6px 20px !important;
}
.message-meta {
  margin-top: 0.35rem;
  font-size: 0.7rem;
  color: rgba(203, 213, 225, 0.6) !important;
  text-align: right;
}

/* ── Avatar: circular with initials ── */
.avatar {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 50% !important;
  background: var(--bg-card-glass) !important;
  border: 1px solid var(--border-glass) !important;
  color: var(--text-main) !important;
  font-family: var(--apple-font);
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-glass);
  transition: var(--transition-smooth);
  flex-shrink: 0;
}
.avatar.admin {
  background: rgba(124, 58, 237, 0.12) !important;
  border-color: rgba(124, 58, 237, 0.45) !important;
  color: #a78bfa !important;
}

/* ── Ticket create modal: Apple glass modal ── */
.ticket-create-modal {
  position: fixed;
  inset: 0;
  z-index: 1070 !important;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(6, 9, 14, 0.72) !important;
  backdrop-filter: blur(16px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(160%) !important;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.ticket-create-modal.show {
  display: flex !important;
  opacity: 1 !important;
}
.ticket-create-modal .modal-dialog {
  width: 100%;
  max-width: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0.5rem;
}
.ticket-create-modal .modal-content {
  position: relative;
  background: var(--bg-card-glass) !important;
  backdrop-filter: blur(28px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(180%) !important;
  border: 1px solid var(--border-glass) !important;
  border-radius: var(--radius-xl) !important;
  box-shadow: var(--shadow-glass) !important;
  width: 100%;
  max-height: 90dvh;
  overflow-y: auto;
  animation: ticketModalSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.ticket-create-modal .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 0;
  border-bottom: 1px solid var(--border-glass);
}
.ticket-create-modal .modal-title {
  margin: 0;
  font-family: var(--apple-font);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main) !important;
  letter-spacing: -0.01em;
}
.ticket-create-modal .btn-close {
  background: transparent !important;
  border: none !important;
  color: var(--text-muted) !important;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0.25rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.ticket-create-modal .btn-close:hover {
  color: var(--text-main) !important;
}
.ticket-create-modal .card-body {
  padding: 1.25rem 1.5rem;
}
.ticket-create-modal .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0 1.5rem 1.25rem;
  border-top: 1px solid var(--border-glass);
}

/* ── Reply form: styled textarea + button ── */
.reply-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}
.reply-form textarea {
  width: 100% !important;
  min-height: 110px;
  max-height: 240px;
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid var(--border-glass) !important;
  border-radius: var(--radius-lg) !important;
  color: var(--text-main) !important;
  font-family: var(--apple-font) !important;
  font-size: 0.95rem;
  line-height: 1.55;
  padding: 0.85rem 1rem !important;
  resize: vertical;
  transition: var(--transition-smooth) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.reply-form textarea::placeholder {
  color: rgba(203, 213, 225, 0.55) !important;
  opacity: 1;
}
.reply-form textarea:focus {
  outline: none !important;
  border-color: var(--color-primary) !important;
  background: rgba(255, 255, 255, 0.09) !important;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2) !important;
}
.reply-form .reply-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.25rem;
}
.reply-form .btn-send {
  background: linear-gradient(135deg, var(--color-primary) 0%, #9333EA 100%) !important;
  border: none !important;
  color: #ffffff !important;
  font-family: var(--apple-font) !important;
  font-weight: 600 !important;
  font-size: 0.92rem;
  padding: 0.65rem 1.25rem !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35) !important;
  transition: var(--transition-smooth) !important;
  min-height: 44px;
}
.reply-form .btn-send:hover {
  background: linear-gradient(135deg, #8B5CF6 0%, #A855F7 100%) !important;
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5) !important;
  transform: translateY(-1px);
}
.reply-form .btn-send:disabled {
  opacity: 0.55 !important;
  cursor: not-allowed !important;
  transform: none !important;
}

@keyframes ticketFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes ticketModalSlide {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Desktop enhancements (min-width: 992px) ──
   Mobile-first: every rule above is the phone base; this block layers
   desktop-only layout on top. */
@media (min-width: 992px) {
  .ticket-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 1.5rem;
  }
  .ticket-header-actions {
    margin-top: 0;
  }
  .ticket-card:hover {
    transform: translateY(-2px);
  }
  .message-list {
    margin: 1.75rem 0;
  }
  .message-bubble {
    max-width: 62%;
  }
  .ticket-create-modal .modal-dialog {
    padding: 1rem;
  }
  .ticket-create-modal .modal-content {
    max-width: 620px;
  }
  .reply-form textarea {
    min-height: 150px;
    font-size: 1rem;
  }
}

/* ==========================================================================
   8. REFERRAL MODULE — greenmc-hosting (FossBilling)
   Apple glassmorphism · Mobile-first · Bootstrap 5.3.3 compatible
   Palette: --bg-deep #06090e · --color-primary #7C3AED · success #10B981 ·
   warning #F59E0B · text #f8fafc / #cbd5e1
   WCAG AA: foreground passes 4.5:1 on dark surfaces.
   Reuses .glass-card (not redefined here) and --color-primary / --bg-deep.
   ========================================================================== */

/* ── Referral dashboard: stat tile row ── */
.referral-dashboard {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

/* ── Ref stat card: glass card (composes with .glass-card; .glass-card not redefined) ── */
.ref-stat-card {
  position: relative;
  background: var(--bg-card-glass) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  border: 1px solid var(--border-glass) !important;
  border-radius: var(--radius-xl) !important;
  box-shadow: var(--shadow-glass) !important;
  overflow: hidden;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  min-height: 140px;
  color: var(--text-main) !important;
}
.ref-stat-card:hover {
  border-color: var(--border-glass-hover) !important;
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5) !important;
}
.ref-stat-value {
  font-family: var(--apple-mono);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-main) !important;
  letter-spacing: -0.02em;
}
.ref-stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted) !important;
}
.ref-stat-delta {
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.ref-stat-delta.up { color: var(--color-success) !important; }
.ref-stat-delta.down { color: var(--color-danger) !important; }

/* ── Ref link box: code display ── */
.ref-link-box {
  position: relative;
  background: rgba(15, 20, 32, 0.5);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  transition: var(--transition-smooth);
  min-height: 56px;
}
.ref-link-box:hover {
  border-color: var(--border-glass-hover);
  background: rgba(20, 25, 37, 0.7);
}
.ref-link {
  flex: 1;
  min-width: 0;
}
.ref-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted) !important;
  display: block;
  margin-bottom: 0.25rem;
}
.ref-link-code {
  font-family: var(--apple-mono);
  font-size: 0.85rem;
  color: #a78bfa !important;
  word-break: break-all;
  line-height: 1.4;
}
.btn-copy-ref {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main) !important;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  font-size: 0.9rem;
  cursor: pointer;
}
.btn-copy-ref:hover {
  background: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
  color: #fff !important;
  transform: translateY(-1px);
}

/* ── Ref chart container ── */
.ref-chart-container {
  position: relative;
  background: rgba(15, 20, 32, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 1.25rem 1.5rem 1rem;
  transition: var(--transition-smooth);
}
.ref-chart-title {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted) !important;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ref-chart-surface {
  position: relative;
  height: 220px;
  width: 100%;
  min-height: 200px;
}

/* ── btn-ref-primary ── */
.btn-ref-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, #9333EA 100%) !important;
  border: none !important;
  color: #ffffff !important;
  font-family: var(--apple-font) !important;
  font-weight: 600 !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35) !important;
  transition: var(--transition-smooth) !important;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  cursor: pointer;
}
.btn-ref-primary:hover {
  background: linear-gradient(135deg, #8B5CF6 0%, #A855F7 100%) !important;
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5) !important;
  transform: translateY(-1px);
  color: #fff !important;
}
.btn-ref-primary:disabled {
  opacity: 0.55 !important;
  cursor: not-allowed !important;
  transform: none !important;
}

/* ── Status badges: pending / paid / cancelled ──
   White badge text keeps WCAG AA (>4.5:1) on dark surfaces, mirroring
   the existing .status-badge pattern. */
.ref-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.275rem 0.9rem;
  border-radius: 9999px;
  border: 1px solid;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #ffffff !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  transition: var(--transition-smooth);
}
.ref-badge.pending {
  background: rgba(245, 158, 11, 0.18) !important;
  border-color: rgba(245, 158, 11, 0.55) !important;
}
.ref-badge.paid {
  background: rgba(16, 185, 129, 0.18) !important;
  border-color: rgba(16, 185, 129, 0.55) !important;
}
.ref-badge.cancelled {
  background: rgba(108, 117, 125, 0.18) !important;
  border-color: rgba(108, 117, 125, 0.55) !important;
}
.ref-badge:hover {
  transform: translateY(-1px);
  filter: brightness(1.15);
}

/* ── Ref table ── */
.ref-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.ref-table th,
.ref-table td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-glass);
  color: var(--text-main) !important;
  font-size: 0.875rem;
}
.ref-table thead th {
  background: rgba(15, 20, 32, 0.4);
  border-bottom: 1px solid var(--border-glass);
  color: var(--text-muted) !important;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  z-index: 2;
}
.ref-table tbody tr:last-child td {
  border-bottom: none;
}
.ref-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}
.ref-table-cell-mono {
  font-family: var(--apple-mono);
  font-size: 0.85rem;
}

/* ── Desktop enhancements (min-width: 992px) ──
   Mobile-first: everything above is the phone base; this block layers
   desktop-only layout on top. */
@media (min-width: 992px) {
  .referral-dashboard {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .ref-stat-card {
    flex: 1 1 calc(25% - 1rem);
    min-width: calc(25% - 1rem);
  }
  .ref-link-box {
    min-height: 56px;
  }
  .ref-chart-surface {
    height: 260px;
  }
  .ref-table th,
  .ref-table td {
    padding: 0.875rem 1.25rem;
    font-size: 0.9rem;
  }
}
