/* =========================================================
   TOMarketing Dashboard — Premium Design System
   ========================================================= */

/* -- Root Tokens --------------------------------------- */
:root {
    --dash-wa: #25D366;          /* WhatsApp green */
    --dash-wa-dark: #128C7E;
    --dash-wa-light: #DCF8C6;
    --dash-primary: #009ef7;
    --dash-purple: #7239ea;
    --dash-coral: #f1416c;
    --dash-amber: #ffc700;
    --dash-emerald: #50cd89;
    --dash-info: #0dcaf0;
    --dash-radius: 16px;
    --dash-radius-sm: 10px;
    --dash-shadow: 0 4px 24px rgba(0,0,0,.06);
    --dash-shadow-hover: 0 12px 40px rgba(0,0,0,.12);
    --dash-transition: all .28s cubic-bezier(.4,0,.2,1);
}


/* -- Dashboard Wrapper --------------------------------- */
.home-dashboard, 
.home-dashboard .app-toolbar, 
.home-dashboard .app-content {
    background-color: var(--bs-app-bg-color) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    font-family: "Inter", Helvetica, "sans-serif" !important;
}

@media (min-width: 992px) {
    .dash-container {
        padding: 2rem 1.75rem 3rem;
    }
}

/* -- Live Clock (Screenshot 1 Style) ------------------- */
.dash-live-clock {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .1rem;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    min-width: 130px;
    flex-shrink: 0;
}

.dash-clock-time {
    font-size: 1.85rem;
    font-weight: 850;
    color: #181c32;
    line-height: 1;
    letter-spacing: -1px;
    font-variant-numeric: tabular-nums;
}

.dash-clock-ampm {
    font-size: 1rem;
    font-weight: 700;
    color: #7e8299;
    margin-left: .2rem;
    text-transform: uppercase;
}

.dash-clock-date {
    font-size: .95rem;
    font-weight: 600;
    color: #7e8299;
    margin-top: .15rem;
}



/* vertical separator after clock */
.dash-live-clock::after {
    display: none; /* separator handled by gap on parent flex */
}

/* -- Campaign Category dots --------------------------- */
.dash-category-dots {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}



/* -- Minimal Page Header (Screenshot 3 Style) ---------- */
.dash-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 0.5rem 0 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.dash-page-header-left-content {
    display: flex;
    flex-direction: column;
    gap: .2rem;
}



.dash-page-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #181c32;
    margin: 0;
    letter-spacing: -.5px;
    line-height: 1.1;
}

.dash-page-subtitle {
    font-size: .88rem;
    font-weight: 600;
    color: #a1a5b7;
    margin: 0;
}

/* Date display in header */
.dash-header-date {
    font-size: .82rem;
    font-weight: 600;
    color: #7e8299;
    white-space: nowrap;
    padding: .4rem .85rem;
    background: #f5f6fa;
    border-radius: 8px;
    border: 1px solid #eaecf0;
}



/* -- Mini Sparkline in KPI ---------------------------- */
.dash-kpi-spark {
    margin-top: 1rem;
    height: 36px;
}



/* -- Period Tabs --------------------------------------- */
.dash-period-tabs {
    display: flex;
    gap: .25rem;
    background: #f4f4f6;
    border-radius: 8px;
    padding: 3px;
}

.dash-period-tab {
    font-size: .75rem;
    font-weight: 600;
    padding: .3rem .7rem;
    border-radius: 6px;
    cursor: pointer;
    color: #7e8299;
    transition: var(--dash-transition);
    border: none;
    background: transparent;
}

.dash-period-tab.active {
    background: #fff;
    color: #181c32;
    box-shadow: 0 1px 4px rgba(0,0,0,.1);
}



/* -- Animated Counter ---------------------------------- */
.dash-counter { display: inline; }



/* -- Skeleton Loader ----------------------------------- */
.dash-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 6px;
}

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* -- Responsive Tweaks --------------------------------- */
@media (max-width: 768px) {
    .dash-hero { padding: 1.5rem 1.25rem; }
    .dash-hero-text h1 { font-size: 1.4rem; }
    .dash-container { padding: 1rem .75rem 2rem; }
}

/* -------------------------------------------------------
   PAGE LAYOUT: Standard Bootstrap Row/Col used in HTML
------------------------------------------------------- */


/* -- WhatsApp Account Card: New Design ----------------- */

/* Green banner at the top of the card */
.dash-wa-banner {
    position: relative;
    height: 70px;
    overflow: visible;
    border-radius: var(--dash-radius) var(--dash-radius) 0 0;
}

.dash-wa-banner-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    border-radius: var(--dash-radius) var(--dash-radius) 0 0;
}

.dash-wa-banner-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.1;
    background-image: radial-gradient(#fff 1px, transparent 0);
    background-size: 10px 10px;
}

/* Initials avatar floating over the banner — LEFT aligned */
.dash-wa-banner-avatar {
    position: absolute;
    bottom: -24px;
    left: 1.25rem;
    width: 60px;
    height: 60px;
    background: #fff;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 800;
    color: #128C7E;
    border: 4px solid #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
    z-index: 2;
    letter-spacing: .5px;
}

.dash-wa-banner-avatar-img {
    position: absolute;
    bottom: -24px;
    left: 1.25rem;
    width: 60px;
    height: 60px;
    border-radius: 16px;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
    z-index: 2;
}

/* Profile info block below banner — LEFT aligned */
.dash-wa-profile-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .15rem;
    padding: 2rem 1.25rem 1rem;
    text-align: left;
    border-bottom: 1px solid #f4f4f6;
}

.dash-wa-profile-body .dash-wa-display-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: #181c32;
    margin-top: .15rem;
}

.dash-wa-profile-body .dash-wa-phone {
    font-size: .82rem;
    color: #25D366;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: .3rem;
}

.dash-wa-profile-body .dash-wa-vertical {
    font-size: .78rem;
    color: #7e8299;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: .3rem;
}

/* Account health inline row */
.dash-wa-health-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .5rem;
}

.dash-wa-health-label {
    font-size: .85rem;
    font-weight: 700;
    color: #181c32;
}

.dash-wa-health-badge {
    display: inline-flex;
    align-items: center;
    padding: .25rem .75rem;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 700;
    background: rgba(37,211,102,.12);
    color: #128C7E;
    border: 1px solid rgba(37,211,102,.25);
}
.dash-wa-health-badge.quality-yellow { background: rgba(255,199,0,.12); color: #c59600; border-color: rgba(255,199,0,.3); }
.dash-wa-health-badge.quality-red    { background: rgba(241,65,108,.1);  color: #c0193c; border-color: rgba(241,65,108,.25); }
.dash-wa-health-badge.quality-gray   { background: #f4f4f6; color: #7e8299; border-color: #e4e6ef; }

.dash-wa-health-desc {
    font-size: .78rem;
    color: #a1a5b7;
    line-height: 1.5;
}

/* Messaging limit header row */
.dash-wa-limit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .5rem;
}

/* Counts below progress bar */
.dash-wa-limit-counts {
    display: flex;
    justify-content: space-between;
    font-size: .72rem;
    color: #a1a5b7;
    font-weight: 500;
    margin-top: .35rem;
}

.dash-wa-scanner-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    padding: .5rem 0;
}

.dash-wa-qr-container {
    width: 180px;
    height: 180px;
    background: #fff;
    border-radius: 20px;
    padding: 12px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0,0,0,.04), 0 0 0 1px rgba(0,0,0,.02);
    border: 1px solid #f0f0f4;
}

#dash_wa_qr_img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 2;
    position: relative;
}

.dash-wa-qr-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-align: center;
}

/* Premium Scan Line Animation */
.dash-wa-scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--dash-wa), transparent);
    z-index: 3;
    box-shadow: 0 0 8px var(--dash-wa);
    animation: scanner-move 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes scanner-move {
    0%, 100% { top: 5%; opacity: .1; }
    50% { top: 92%; opacity: .8; }
}

.dash-wa-scanner-info {
    text-align: center;
    width: 100%;
}

.dash-wa-scanner-status {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem .85rem;
    background: #f8f9fc;
    border-radius: 20px;
    border: 1px solid #f0f0f4;
    margin-bottom: .6rem;
}

.dash-wa-scanner-status .dot {
    width: 7px;
    height: 7px;
    background: var(--dash-wa);
    border-radius: 50%;
    animation: pulse-dot 1.6s infinite;
}

#dash_wa_scanner_status_text {
    font-size: .75rem;
    font-weight: 700;
    color: #181c32;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.dash-wa-scanner-msg {
    font-size: .78rem;
    color: #a1a5b7;
    line-height: 1.5;
    margin: 0;
    padding: 0 1rem;
}

/* -- Quality Color Variants ------------------------- */
.dash-wa-tracking-val.quality-green  { color: #25D366; }
.dash-wa-tracking-val.quality-yellow { color: #ffc700; }

/* -- QR Actions (Screenshot Style) ------------------- */
.dash-wa-qr-actions {
    display: flex;
    flex-direction: column;
    padding: 0 .25rem;
}

/* ═══════════════════════════════════════════════════════════════════
   NEW: AUTO-SLIDER DESIGN SYSTEM (Metronic Course Style)
   ═══════════════════════════════════════════════════════════════════ */

.dash-slider-container {
    width: 100%;
    height: auto;
    max-height: 500px; /* Maximum height to prevent over-stretching */
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 5px;
}

/* Minimalist Scrollbar */
.dash-slider-container::-webkit-scrollbar {
    width: 4px;
}
.dash-slider-container::-webkit-scrollbar-track {
    background: transparent;
}
.dash-slider-container::-webkit-scrollbar-thumb {
    background: #e4e6ef;
    border-radius: 10px;
}
.dash-slider-container::-webkit-scrollbar-thumb:hover {
    background: #d1d3e0;
}

.dash-slider-track {
    display: flex;
    flex-direction: column; /* Vertical stack instead of horizontal */
    gap: 0.75rem;
    padding: 0.5rem 0.25rem;
}

/* --- Slider Card (Exact Metronic Match) --- */
.dash-slider-card {
    min-width: 100%;
    background: #fff;
    border: 1px solid #f1f1f4;
    border-radius: 12px;
    padding: 1rem 1.25rem; /* Compact padding */
    display: flex;
    flex-direction: column;
    gap: 0.75rem; /* Reduced gap */
    transition: var(--dash-transition);
    cursor: pointer;
}

.dash-slider-card:hover {
    background: #fcfdfe; /* Only a very subtle background shift */
}

/* Header Row (Icon + Title) */
.dash-slider-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.dash-slider-icon-wrap {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
    background: #f8f9fa; /* Soft background for icon */
    border-radius: 50%;
}

.dash-slider-icon-wrap svg {
    position: absolute;
    inset: -2px;
    transform: rotate(-90deg);
}

.dash-slider-icon-wrap .progress-bg {
    fill: none;
    stroke: #f1f1f4;
    stroke-width: 3;
}

.dash-slider-icon-wrap .progress-val {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
}

.dash-slider-icon-wrap.status-running .progress-val { stroke: #25D366; }
.dash-slider-icon-wrap.status-scheduled .progress-val { stroke: #009ef7; }

.dash-slider-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #181c32;
    margin: 0;
}

/* Stats Grid (Below Header) */
.dash-slider-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.25rem 1rem; /* Tightened row gap */
}

.dash-slider-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #7e8299;
    font-weight: 500;
}

.dash-slider-stat i {
    font-size: 0.9rem;
    color: #d1d3e0; /* Subtle icons like reference */
}

/* Card Content (Right) */
.dash-slider-content {
    flex-grow: 1;
    min-width: 0;
}

.dash-slider-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #181c32;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-slider-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 8px;
}

.dash-slider-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: #a1a5b7;
    font-weight: 600;
}

.dash-slider-stat i {
    font-size: 0.85rem;
    color: #cbd4e1;
}

/* --- Slider Dots --- */
.dash-slider-dots {
    display: flex;
    gap: 6px;
}

.dash-slider-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #e1e3ea;
    transition: all 0.3s ease;
    cursor: pointer;
}

.dash-slider-dot.active {
    background: #009ef7;
    width: 18px;
    border-radius: 4px;
}

/* Responsive: 1 card on smaller screens */
@media (max-width: 1200px) {
    .dash-slider-card {
        flex: 0 0 100%;
    }
}

.dash-qr-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .65rem;
}

.dash-qr-grid {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.dash-qr-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 0.4rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: background-color 0.2s ease;
    cursor: pointer;
    border: none;
    background: #f5f8fa; /* Standard project light background */
    color: #5e6278;
}

.dash-qr-btn i {
    font-size: 1.1rem;
    color: #a1a5b7;
}

.dash-qr-btn:hover {
    background: #eff2f5; /* Subtle darken only */
    color: #181c32;
}

.dash-qr-btn:hover i {
    color: var(--dash-primary);
}

.dash-qr-btn-primary {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    padding: 0.85rem;
    border-radius: 10px;
    background: var(--dash-wa);
    color: #fff; /* Text color */
    border: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.dash-qr-btn-primary i {
    color: #fff !important; /* Force icon to be white */
}

.dash-qr-btn-primary:hover {
    background: #20bd5c;
}


/* --- Slider Indicators (Dots) --- */
.dash-slider-dots {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    z-index: 100;
}

.dash-slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e1e3ea;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dash-slider-dot.active {
    width: 24px;
    border-radius: 4px;
    background: #009ef7; /* Dynamic color handled by JS or default blue */
}

/* Color overrides for active states */
#dash_cm_dots .dash-slider-dot.active { background: #009ef7; }
#dash_wf_dots .dash-slider-dot.active { background: #50cd89; }

/* --- Category Switcher Dots --- */
.dash-cat-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e4e6ef;
    cursor: pointer;
    transition: var(--dash-transition);
}

.dash-cat-dot.active {
    background: var(--dash-primary);
    width: 26px; /* Expand active pill */
    border-radius: 6px;
}

.dash-cat-dot:hover:not(.active) {
    background: #d1d3e0;
}
#dash_wf_dots .dash-slider-dot.active { background: #25D366; }
/* --- Layout Grid (Enhanced Responsive Sticky) --- */
.dash-page-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    width: 100%;
}

.dash-page-main {
    flex: 1;
    min-width: 0; /* Prevents flex children from overflowing */
}

.dash-account-sidebar {
    width: 320px;
    min-width: 320px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    z-index: 10;
    max-height: calc(100vh - 40px); /* Independent scroll if too tall */
    overflow-y: auto;
    scrollbar-width: none; /* Hide scrollbar for clean look */
    -ms-overflow-style: none;
}

.dash-account-sidebar::-webkit-scrollbar {
    display: none;
}

@media (max-width: 1200px) {
    .dash-main-container {
        flex-direction: column;
    }
    .dash-account-sidebar {
        width: 100%;
        min-width: 100%;
        position: static;
        max-height: none;
    }
}

@media (max-width: 1100px) {
    .dash-page-layout {
        flex-direction: column;
        gap: 1.5rem;
    }
    .dash-account-sidebar {
        width: 100%;
        min-width: 100%;
        position: static;
        max-height: none;
        overflow: visible;
    }
}

@media (max-width: 768px) {
    .dash-container {
        padding: 1.5rem 1rem;
    }
}

/* --- Empty State (Exact Match with Analytics Page) --- */
.dash-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    width: 100%;
}

.dash-empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    color: #a1a5b7;
}

.dash-empty-icon i {
    font-size: 3rem !important; /* Larger icon since outer circle is gone */
    color: #d1d3e1;
    font-weight: 500;
}

.dash-empty-text {
    font-size: 1rem;
    font-weight: 700;
    color: #5e6278;
    margin: 0;
}
