.dragwyb-analytics-wrap {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #0f172a;
    background-color: #f8fafc;
    margin: 15px calc(1rem  + 20px) 20px 1rem;
    padding: 0;
    box-sizing: border-box;
}

.dragwyb-select-sm {
    padding: 8px 14px;
    border-radius: var(--dragwyb-radius, 8px);
    border: 1px solid hsl(var(--dragwyb-border, 210 12% 88%));
    background: hsl(var(--dragwyb-card, 0 0% 100%));
    color: hsl(var(--dragwyb-foreground, 210 15% 15%));
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    box-shadow: var(--dragwyb-shadow-2xs);
    transition: all 0.2s ease;
}

.dragwyb-select-sm:focus {
    outline: none;
    border-color: hsl(var(--dragwyb-primary, 340 90% 55%));
    box-shadow: 0 0 0 3px hsl(var(--dragwyb-primary) / 0.15);
}

/* Stats Grid */
.dragwyb-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    padding: 1rem calc(1rem + 20px) 1rem 1rem;
}

.dragwyb-stat-card {
    background: #fff;
    border-radius: var(--dragwyb-radius, 12px);
    padding: 12px;
    border: 1px solid hsl(var(--dragwyb-card-border, 210 12% 92%));
    box-shadow: var(--dragwyb-shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dragwyb-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--dragwyb-shadow-md);
}

.dragwyb-stat-label {
    font-size: 13px;
    font-weight: 500;
    color: hsl(var(--dragwyb-muted-foreground, 210 12% 45%));
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.dragwyb-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: hsl(var(--dragwyb-foreground, 210 15% 15%));
}

/* Tabs */
.dragwyb-analytics-tabs {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 28px;
    list-style: none;
    margin: 0;
    display: flex;
    gap: 12px;
    overflow-x: auto;
}

.dragwyb-atab {
    background: none;
    border: none;
    padding: 14px 16px;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 2px solid rgba(0,0,0,0);
    transition: all .2s ease;
    white-space: nowrap;
    cursor: pointer;
}

.dragwyb-atab:hover {
    color: #0f172a !important;
}

.dragwyb-atab.active {
    color: hsl(var(--dragwyb-primary)) !important;
    font-weight: 600;
    border-bottom-color: hsl(var(--dragwyb-primary));
}

.dragwyb-atab-content-container {
    padding: 24px 28px;
}

.dragwyb-atab-content {
    display: none;
}

.dragwyb-atab-content.active {
    display: block;
}

/* Cards & Layout */
.dragwyb-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 900px) {
    .dragwyb-grid-2 {
        grid-template-columns: 1fr;
    }
}

.dragwyb-card {
    background: hsl(var(--dragwyb-card, 0 0% 100%));
    border-radius: var(--dragwyb-radius, 12px);
    padding: 24px;
    border: 1px solid hsl(var(--dragwyb-card-border, 210 12% 92%));
    box-shadow: var(--dragwyb-shadow-sm);
}

.dragwyb-card-title {
    margin: 0 0 20px 0;
    font-size: 16px;
    font-weight: 700;
    color: hsl(var(--dragwyb-foreground, 210 15% 15%));
    display: flex;
    align-items: center;
    gap: 8px;
}

.dragwyb-card-title i {
    color: hsl(var(--dragwyb-primary, 340 90% 55%)) !important;
}

/* Chart Cards & Canvas Wrappers */
.dragwyb-chart-card {
    display: flex;
    flex-direction: column;
}

.dragwyb-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.dragwyb-chart-legend {
    display: flex;
    align-items: center;
    gap: 16px;
}

.dragwyb-legend-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: hsl(var(--dragwyb-muted-foreground, 210 12% 45%));
}

.dragwyb-legend-pill .pill-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.legend-visitors .pill-dot {
    background: hsl(var(--dragwyb-primary, 340 90% 55%));
}

.legend-sessions .pill-dot {
    background: hsl(220 100% 45%);
}

.dragwyb-chart-canvas-wrap {
    position: relative;
    width: 100%;
    height: 240px;
}

.dragwyb-chart-canvas-wrap.dragwyb-chart-lg {
    height: 300px;
}

.dragwyb-chart-canvas-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Tables */
.dragwyb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.dragwyb-table th {
    text-align: left;
    padding: 12px;
    border-bottom: 2px solid hsl(var(--dragwyb-border, 210 12% 88%));
    color: hsl(var(--dragwyb-muted-foreground, 210 12% 45%));
    font-weight: 600;
}

.dragwyb-table td {
    padding: 12px;
    border-bottom: 1px solid hsl(var(--dragwyb-border, 210 12% 88%) / 0.5);
    color: hsl(var(--dragwyb-foreground, 210 15% 15%));
}

.dragwyb-table code {
    background: hsl(var(--dragwyb-muted, 210 12% 90%));
    padding: 3px 8px;
    border-radius: 4px;
    color: hsl(var(--dragwyb-primary, 340 90% 55%));
    font-size: 12px;
    font-weight: 600;
}

/* Doughnut Circle Charts */
.dragwyb-donut-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 10px 0;
    width: 100%;
}

.dragwyb-donut-chart-wrap {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 0 auto;
}

.dragwyb-donut-chart-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

.dragwyb-donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 120px;
}

.dragwyb-donut-top-val {
    font-size: 26px;
    font-weight: 800;
    color: hsl(var(--dragwyb-foreground, 210 15% 15%));
    line-height: 1.1;
}

.dragwyb-donut-top-label {
    font-size: 11px;
    font-weight: 700;
    color: hsl(var(--dragwyb-muted-foreground, 210 12% 45%));
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dragwyb-donut-legend {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    width: 100%;
    margin-top: 8px;
}

.dragwyb-donut-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: hsl(var(--dragwyb-card, 210 15% 96%));
    border-radius: var(--dragwyb-radius, 8px);
    border: 1px solid hsl(var(--dragwyb-card-border, 210 12% 92%));
    transition: all 0.2s ease;
}

.dragwyb-donut-legend-item.highest-item {
    background: hsl(var(--dragwyb-primary) / 0.06);
    border-color: hsl(var(--dragwyb-primary) / 0.3);
}

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

.dragwyb-donut-legend-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dragwyb-donut-legend-name {
    font-size: 12px;
    font-weight: 600;
    color: hsl(var(--dragwyb-foreground, 210 15% 15%));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dragwyb-donut-legend-meta {
    font-size: 11px;
    color: hsl(var(--dragwyb-muted-foreground, 210 12% 45%));
    font-weight: 500;
}

/* Live Dot */
.dragwyb-live-dot {
    width: 10px;
    height: 10px;
    background: #22c55e;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    animation: dragwybPulse 1.6s infinite;
}

.dragwyb-live-count {
    background: #dcfce7;
    color: #15803d;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
}

@keyframes dragwybPulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

.dragwyb-no-data, .dragwyb-loading {
    color: #94a3b8;
    font-style: italic;
    padding: 20px 0;
    text-align: center;
}
