/* ============================================================
 * Site visit statistics widget — modern card redesign
 * ============================================================ */
.stats-widget {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    margin-bottom: 18px;
    font-family: inherit;
}
.stats-widget-header {
    background: linear-gradient(135deg, #0ea5e9 0%, #04415e 100%);
    color: #fff;
    padding: 12px 16px;
    font-weight: 700;
    font-size: 15px;
    text-align: center;
    letter-spacing: 0.3px;
}
.stats-widget-header i { margin-right: 6px; }
.stats-widget-body { padding: 12px; }

/* Online users hero — green pulse card */
.stats-online {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    border-radius: 10px;
    padding: 14px 12px;
    margin-bottom: 14px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(16,185,129,0.25);
}
.stats-online-pulse { font-size: 13px; opacity: 0.95; margin-bottom: 6px; }
.stats-online-pulse .dot {
    display: inline-block;
    width: 9px; height: 9px;
    background: #fff;
    border-radius: 50%;
    margin-right: 7px;
    vertical-align: middle;
    box-shadow: 0 0 0 0 rgba(255,255,255,0.7);
    animation: stats-pulse 1.8s infinite;
}
@keyframes stats-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(255,255,255,0.55); }
    70%  { box-shadow: 0 0 0 10px rgba(255,255,255,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}
.stats-online-num { font-size: 26px; font-weight: 800; line-height: 1.1; letter-spacing: 0.5px; }
.stats-online-num span { font-size: 13px; font-weight: 600; opacity: 0.9; margin-left: 2px; }
.stats-online-start { font-size: 11px; opacity: 0.88; margin-top: 6px; }
.stats-online-start i { margin-right: 3px; }

/* Stats rows */
.stats-list { list-style: none; padding: 0; margin: 0 0 12px; }
.stats-list li {
    display: flex; align-items: center;
    padding: 9px 8px;
    border-bottom: 1px dashed #e7eaee;
    transition: background 0.15s;
}
.stats-list li:last-child { border-bottom: none; }
.stats-list li:hover { background: #f8fafc; }

.stats-icon {
    width: 34px; height: 34px;
    line-height: 34px;
    text-align: center;
    border-radius: 50%;
    flex-shrink: 0;
    margin-right: 11px;
    color: #fff;
    font-size: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.stats-icon.ico-today      { background: #3b82f6; }
.stats-icon.ico-yesterday  { background: #8b5cf6; }
.stats-icon.ico-month      { background: #06b6d4; }
.stats-icon.ico-lastmonth  { background: #64748b; }
.stats-icon.ico-year       { background: #f59e0b; }
.stats-icon.ico-total      { background: #ef4444; }

.stats-label { flex: 1; color: #475569; font-size: 13px; font-weight: 500; }
.stats-value {
    font-weight: 800; color: #1a2540;
    font-size: 14px; min-width: 60px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* "ทั้งหมด" row — emphasized */
.stats-list li.stats-total {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    border-radius: 8px;
    padding: 10px 8px;
    margin-top: 6px;
}
.stats-list li.stats-total .stats-label { color: #991b1b; font-weight: 700; }
.stats-list li.stats-total .stats-value { color: #dc2626; font-size: 15px; }
.stats-list li.stats-total:hover { background: #fee2e2; }

/* IP footer */
.stats-ip {
    background: #f1f5f9;
    color: #475569;
    border-radius: 8px;
    padding: 9px 10px;
    text-align: center;
    font-size: 12px;
    border: 1px dashed #cbd5e1;
}
.stats-ip i { color: #ef4444; margin-right: 4px; }
.stats-ip b { color: #0ea5e9; font-weight: 700; }

/* Mobile fine-tuning */
@media (max-width: 380px) {
    .stats-widget-body { padding: 10px; }
    .stats-online-num { font-size: 22px; }
    .stats-icon { width: 30px; height: 30px; line-height: 30px; font-size: 13px; margin-right: 9px; }
    .stats-label { font-size: 12px; }
    .stats-value { font-size: 13px; }
}
