/* ============================================
   SELECT2 & DATATABLE OVERRIDES
   ============================================ */
.select2-container--bootstrap4.select2-container--focus .select2-selection {
    border-color: #80bdff;
    outline: 0;
    box-shadow: inset 0 0 0 transparent;
}

.datatable-button {
    width: 45px;
    height: 30px;
}

/* ============================================
   SIDEBAR CORE STYLES
   ============================================ */
.main-sidebar {
    width: 250px;
    position: fixed;
    top: 0;
    left: 0;
    min-height: 100vh;
    z-index: 1038;
    transition: all 0.3s ease;
}

.brand-link {
    display: flex;
    align-items: center;
    padding: 0.8rem 1rem;
    min-height: 60px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-link .brand-image {
    margin-right: 0.8rem;
    max-height: 35px;
}

.brand-link .brand-text {
    font-size: 1.1rem;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-sidebar {
    padding: 0;
}

.nav-sidebar .nav-item {
    width: 100%;
    margin-bottom: 2px;
}

.nav-sidebar .nav-link {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    position: relative;
    transition: all 0.3s ease;
}

.nav-sidebar .nav-link p {
    margin: 0 0 0 10px;
    flex-grow: 1;
    font-size: 14px;
    font-weight: 400;
    white-space: normal;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.8);
}

.nav-sidebar .nav-link.active p {
    color: #fff;
    font-weight: 600;
}

.nav-sidebar .nav-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    margin-right: 5px;
}

.user-panel {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-panel .info {
    display: inline-block;
    padding: 5px 5px 5px 10px;
    overflow: hidden;
}

.user-panel .info a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
    display: block;
}

@media (max-width: 991.98px) {
    .main-sidebar {
        box-shadow: none;
    }

    .sidebar-open .main-sidebar {
        transform: translateX(0);
        box-shadow:
            0 14px 28px rgba(0, 0, 0, 0.25),
            0 10px 10px rgba(0, 0, 0, 0.22);
    }

    .nav-sidebar .nav-link p {
        font-size: 13px;
    }
}

.sidebar-collapse .main-sidebar {
    margin-left: -250px;
}

.sidebar-collapse .nav-sidebar .nav-link p {
    opacity: 0;
    visibility: hidden;
}

.nav-sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.nav-sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

/* ============================================
   DASHBOARD V1 — PREMIUM DESIGN SYSTEM
   ============================================ */

/* ── Color Palette ── */
:root {
    --dash-blue: #6366f1;
    --dash-blue-lt: rgba(99, 102, 241, 0.12);
    --dash-emerald: #10b981;
    --dash-emerald-lt: rgba(16, 185, 129, 0.12);
    --dash-violet: #8b5cf6;
    --dash-violet-lt: rgba(139, 92, 246, 0.12);
    --dash-amber: #f59e0b;
    --dash-amber-lt: rgba(245, 158, 11, 0.12);
    --dash-rose: #ec4899;
    --dash-dark: #1e293b;
    --dash-gray-50: #f8fafc;
    --dash-gray-100: #f1f5f9;
    --dash-gray-200: #e2e8f0;
    --dash-gray-400: #94a3b8;
    --dash-gray-600: #475569;
    --dash-gray-700: #334155;
    --dash-gray-900: #0f172a;
    --dash-radius: 14px;
    --dash-radius-sm: 8px;
    --dash-shadow:
        0 1px 3px rgba(0, 0, 0, 0.06), 0 6px 16px rgba(0, 0, 0, 0.04);
    --dash-shadow-lg:
        0 4px 12px rgba(0, 0, 0, 0.08), 0 16px 40px rgba(0, 0, 0, 0.06);
    --dash-transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Wrapper ── */
.dashboard-wrapper {
    background: var(--dash-gray-50);
    min-height: 100vh;
}

/* ── Animations ── */
@keyframes dashFadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes dashPulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

@keyframes dashWave {
    0% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(100%);
    }
}

[data-animate] {
    opacity: 0;
    transform: translateY(30px);
}

[data-animate].dash-animated {
    animation: dashFadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ── Dashboard Header ── */
.dash-content-header {
    padding: 28px 0 8px;
}

.dash-page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dash-gray-900);
    margin-bottom: 4px;
    letter-spacing: -0.025em;
}

.dash-page-subtitle {
    font-size: 0.9rem;
    color: var(--dash-gray-400);
    margin: 0;
    font-weight: 400;
}

.dash-date-badge {
    display: inline-flex;
    align-items: center;
    background: #fff;
    border: 1px solid var(--dash-gray-200);
    padding: 10px 18px;
    border-radius: 50px;
    font-size: 0.85rem;
    color: var(--dash-gray-600);
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.dash-date-badge i {
    color: var(--dash-blue);
}

/* ============================================
   STAT CARDS
   ============================================ */
.dash-stat-card {
    position: relative;
    background: #fff;
    border-radius: var(--dash-radius);
    padding: 24px;
    box-shadow: var(--dash-shadow);
    overflow: hidden;
    transition: var(--dash-transition);
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 16px;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.dash-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--dash-shadow-lg);
}

.dash-stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
    transition: var(--dash-transition);
}

.dash-stat-card:hover .dash-stat-icon {
    transform: scale(1.1) rotate(-5deg);
}

/* Icon Color Variants */
.dash-stat-blue .dash-stat-icon {
    background: var(--dash-blue-lt);
    color: var(--dash-blue);
}
.dash-stat-emerald .dash-stat-icon {
    background: var(--dash-emerald-lt);
    color: var(--dash-emerald);
}
.dash-stat-violet .dash-stat-icon {
    background: var(--dash-violet-lt);
    color: var(--dash-violet);
}
.dash-stat-amber .dash-stat-icon {
    background: var(--dash-amber-lt);
    color: var(--dash-amber);
}

.dash-stat-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.dash-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dash-gray-900);
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.dash-stat-label {
    font-size: 0.82rem;
    color: var(--dash-gray-400);
    font-weight: 500;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dash-stat-trend {
    position: absolute;
    top: 16px;
    right: 18px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

.dash-trend-up {
    color: #059669;
    background: rgba(16, 185, 129, 0.1);
}

.dash-trend-down {
    color: #dc2626;
    background: rgba(239, 68, 68, 0.1);
}

/* Wave accent at bottom */
.dash-stat-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    border-radius: 0 0 var(--dash-radius) var(--dash-radius);
}

.dash-stat-blue .dash-stat-wave {
    background: linear-gradient(90deg, var(--dash-blue), #818cf8);
}
.dash-stat-emerald .dash-stat-wave {
    background: linear-gradient(90deg, var(--dash-emerald), #34d399);
}
.dash-stat-violet .dash-stat-wave {
    background: linear-gradient(90deg, var(--dash-violet), #a78bfa);
}
.dash-stat-amber .dash-stat-wave {
    background: linear-gradient(90deg, var(--dash-amber), #fbbf24);
}

/* ============================================
   CHART CARDS
   ============================================ */
.dash-chart-card {
    background: #fff;
    border-radius: var(--dash-radius);
    box-shadow: var(--dash-shadow);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: var(--dash-transition);
}

.dash-chart-card:hover {
    box-shadow: var(--dash-shadow-lg);
}

.dash-chart-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 22px 24px 10px;
}

.dash-chart-title {
    font-size: 1.05rem;
    font-weight: 650;
    color: var(--dash-gray-900);
    margin: 0;
    letter-spacing: -0.01em;
}

.dash-chart-subtitle {
    font-size: 0.8rem;
    color: var(--dash-gray-400);
    margin: 4px 0 0;
    font-weight: 400;
}

.dash-chart-body {
    padding: 12px 20px 20px;
    position: relative;
}

.dash-chart-body-doughnut {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Chart Action Buttons */
.dash-chart-actions {
    display: flex;
    gap: 4px;
    background: var(--dash-gray-100);
    border-radius: 8px;
    padding: 3px;
}

.dash-chart-btn {
    border: none;
    background: transparent;
    padding: 6px 14px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--dash-gray-400);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--dash-transition);
}

.dash-chart-btn:hover {
    color: var(--dash-gray-700);
}

.dash-chart-btn.active {
    background: #fff;
    color: var(--dash-blue);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* View All Button */
.dash-view-all-btn {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--dash-blue);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 8px;
    transition: var(--dash-transition);
    white-space: nowrap;
}

.dash-view-all-btn:hover {
    background: var(--dash-blue-lt);
    color: var(--dash-blue);
    text-decoration: none;
}

/* ============================================
   DOUGHNUT CUSTOM LEGEND
   ============================================ */
.dash-doughnut-legend {
    width: 100%;
    padding: 8px 16px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    justify-content: center;
}

.dash-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
}

.dash-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dash-legend-label {
    color: var(--dash-gray-600);
    font-weight: 500;
}

.dash-legend-value {
    color: var(--dash-gray-900);
    font-weight: 600;
}

/* ============================================
   ACTIVITY TABLE
   ============================================ */
.dash-table-body {
    padding: 0 16px 16px;
}

.dash-activity-table {
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.dash-activity-table thead th {
    border: none;
    border-bottom: 1px solid var(--dash-gray-200);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--dash-gray-400);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 12px 16px;
}

.dash-activity-table tbody tr {
    transition: var(--dash-transition);
}

.dash-activity-table tbody tr:hover {
    background: var(--dash-gray-50);
}

.dash-activity-table tbody td {
    border: none;
    border-bottom: 1px solid var(--dash-gray-100);
    padding: 14px 16px;
    font-size: 0.85rem;
    color: var(--dash-gray-600);
    vertical-align: middle;
}

.dash-activity-table tbody tr:last-child td {
    border-bottom: none;
}

/* User Cell */
.dash-user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dash-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.dash-avatar-blue {
    background: linear-gradient(135deg, #6366f1, #818cf8);
}
.dash-avatar-emerald {
    background: linear-gradient(135deg, #10b981, #34d399);
}
.dash-avatar-violet {
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
}
.dash-avatar-amber {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

.dash-user-cell span {
    font-weight: 600;
    color: var(--dash-gray-700);
}

/* Status Badges */
.dash-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.73rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.dash-badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.dash-badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.dash-badge-info {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.dash-badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

/* ============================================
   QUICK ACTIONS
   ============================================ */
.dash-quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 12px 20px 20px;
}

.dash-quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px 12px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    transition: var(--dash-transition);
    border: 1px solid transparent;
}

.dash-quick-action-btn:hover {
    text-decoration: none;
    transform: translateY(-3px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.dash-quick-action-btn i {
    font-size: 1.4rem;
}

.dash-qa-blue {
    background: var(--dash-blue-lt);
    color: var(--dash-blue);
}
.dash-qa-blue:hover {
    background: var(--dash-blue);
    color: #fff;
}

.dash-qa-emerald {
    background: var(--dash-emerald-lt);
    color: var(--dash-emerald);
}
.dash-qa-emerald:hover {
    background: var(--dash-emerald);
    color: #fff;
}

.dash-qa-violet {
    background: var(--dash-violet-lt);
    color: var(--dash-violet);
}
.dash-qa-violet:hover {
    background: var(--dash-violet);
    color: #fff;
}

.dash-qa-amber {
    background: var(--dash-amber-lt);
    color: var(--dash-amber);
}
.dash-qa-amber:hover {
    background: var(--dash-amber);
    color: #fff;
}

/* ============================================
   SERVER STATUS / SYSTEM HEALTH
   ============================================ */
.dash-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    margin-top: 6px;
}

.dash-status-online {
    background: var(--dash-emerald);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
    animation: dashPulse 2s ease-in-out infinite;
}

.dash-server-stats {
    padding: 8px 22px 22px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.dash-server-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dash-server-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--dash-gray-600);
    font-weight: 500;
}

.dash-server-value {
    font-weight: 700;
    color: var(--dash-gray-900);
}

.dash-progress-bar {
    width: 100%;
    height: 7px;
    background: var(--dash-gray-100);
    border-radius: 10px;
    overflow: hidden;
}

.dash-progress-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.dash-progress-fill::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    background-size: 200% 100%;
    animation: dashShimmer 2.5s ease-in-out infinite;
}

.dash-progress-blue {
    background: linear-gradient(90deg, var(--dash-blue), #818cf8);
}
.dash-progress-emerald {
    background: linear-gradient(90deg, var(--dash-emerald), #34d399);
}
.dash-progress-violet {
    background: linear-gradient(90deg, var(--dash-violet), #a78bfa);
}
.dash-progress-amber {
    background: linear-gradient(90deg, var(--dash-amber), #fbbf24);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 1199.98px) {
    .dash-stat-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 767.98px) {
    .dash-content-header {
        padding: 20px 0 4px;
    }

    .dash-page-title {
        font-size: 1.35rem;
    }

    .dash-date-badge {
        margin-top: 12px;
    }

    .dash-stat-card {
        padding: 18px;
    }

    .dash-stat-value {
        font-size: 1.4rem;
    }

    .dash-chart-header {
        flex-direction: column;
        gap: 10px;
    }

    .dash-quick-actions {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .dash-quick-action-btn {
        padding: 16px 10px;
    }

    .dash-activity-table thead {
        display: none;
    }

    .dash-activity-table tbody tr {
        display: block;
        padding: 12px 0;
        border-bottom: 1px solid var(--dash-gray-100);
    }

    .dash-activity-table tbody td {
        display: block;
        border: none;
        padding: 4px 8px;
        text-align: left;
    }

    .dash-activity-table tbody td:first-child {
        padding-bottom: 6px;
    }
}

@media (max-width: 575.98px) {
    .dash-quick-actions {
        grid-template-columns: 1fr;
    }
}
.whatsapp-float {
    position: fixed;
    right: 22px;
    bottom: 40px;
    z-index: 999;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 30px;
    text-decoration: none;
    box-shadow: 0 10px 30px rgba(37, 211, 102, 0.35);
    transition: all 0.35s ease;
    overflow: visible;
    isolation: isolate;
    animation: wa-float 3s ease-in-out infinite;
}
.whatsapp-float::before {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        rgba(37, 211, 102, 0.9),
        rgba(18, 140, 126, 0.1),
        rgba(37, 211, 102, 0.9)
    );
    z-index: -2;
    animation: wa-spin 4s linear infinite;
    opacity: 0;
    transition: opacity 0.35s ease;
}
.wa-tooltip {
    position: absolute;
    right: 78px;
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    background: #111;
    color: #fff;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.wa-tooltip::after {
    content: "";
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: #111;
}
.wa-ripple {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    z-index: -1;
    box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5);
    animation: wa-pulse 2s infinite;
}
.whatsapp-float i {
    position: relative;
    z-index: 2;
    transition: transform 0.35s ease;
}
.whatsapp-float::after {
    content: "";
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(37, 211, 102, 0.35),
        transparent 70%
    );
    z-index: -3;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.35s ease;
}
a.whatsapp-float:hover {
    color: #fff;
}

/* ============================================
   PREVIEW LIVE SITE BUTTON STYLES
   ============================================ */
.btn-preview-site {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: #ffffff !important;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 50px;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.28);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none !important;
    letter-spacing: 0.2px;
    cursor: pointer;
    line-height: 1.4;
}

.btn-preview-site:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
    color: #ffffff !important;
    background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%);
}

.btn-preview-site:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn-preview-site .live-indicator-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.35);
    animation: liveIndicatorPulse 2s infinite ease-in-out;
}

@keyframes liveIndicatorPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.35);
    }
    50% {
        transform: scale(1.2);
        opacity: 0.85;
        box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.15);
    }
}

/* ============================================
   SIDEBAR TOGGLE USER PANEL IMAGE VISIBILITY
   ============================================ */
/* Hide image when left menu is toggled / collapsed */
.sidebar-collapse .user-panel .image {
    display: none !important;
}

/* Show image when full left menu is expanded */
body:not(.sidebar-collapse) .user-panel .image,
.sidebar-collapse .main-sidebar:hover .user-panel .image {
    display: block !important;
}


